From: Andrew Dolgov Date: Thu, 10 Nov 2011 11:46:24 +0000 (+0400) Subject: when FORCE_ARTICLE_PURGE is defined, show relevant information in the UI X-Git-Tag: 1.5.7~38 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=df0b946fee42bb1f06bdadbc6b3116c3aa718e5e;p=tt-rss.git when FORCE_ARTICLE_PURGE is defined, show relevant information in the UI --- diff --git a/modules/pref-feeds.php b/modules/pref-feeds.php index d5f0e8b4..449f3c92 100644 --- a/modules/pref-feeds.php +++ b/modules/pref-feeds.php @@ -363,22 +363,15 @@ $purge_interval = db_fetch_result($result, 0, "purge_interval"); - if (FORCE_ARTICLE_PURGE == 0) { /* Purge intl */ - print "
"; - - print __('Article purging:') . " "; - - print_select_hash("purge_interval", $purge_interval, $purge_intervals, - 'dojoType="dijit.form.Select"'); - - } else { - print ""; + print "
"; + print __('Article purging:') . " "; - } + print_select_hash("purge_interval", $purge_interval, $purge_intervals, + 'dojoType="dijit.form.Select" ' . + ((FORCE_ARTICLE_PURGE == 0) ? "" : 'disabled="1"')); print ""; print "
".__("Authentication")."
"; diff --git a/modules/pref-prefs.php b/modules/pref-prefs.php index bcabd07a..4826732a 100644 --- a/modules/pref-prefs.php +++ b/modules/pref-prefs.php @@ -14,10 +14,10 @@ "DEFAULT_UPDATE_INTERVAL", "USER_TIMEZONE", "SORT_HEADLINES_BY_FEED_DATE", "SSL_CERT_SERIAL"); - if (FORCE_ARTICLE_PURGE != 0) { + /* if (FORCE_ARTICLE_PURGE != 0) { array_push($prefs_blacklist, "PURGE_OLD_DAYS"); array_push($prefs_blacklist, "PURGE_UNREAD_ARTICLES"); - } + } */ if ($subop == "change-password") { @@ -419,15 +419,30 @@ $value = __("No"); } - print_radio($pref_name, $value, __("Yes"), array(__("Yes"), __("No"))); + if ($pref_name == "PURGE_UNREAD_ARTICLES" && FORCE_ARTICLE_PURGE != 0) { + $disabled = "disabled=\"1\""; + $value = __("Yes"); + } else { + $disabled = ""; + } + + print_radio($pref_name, $value, __("Yes"), array(__("Yes"), __("No")), + $disabled); } else if (array_search($pref_name, array('FRESH_ARTICLE_MAX_AGE', 'DEFAULT_ARTICLE_LIMIT', 'PURGE_OLD_DAYS', 'LONG_DATE_FORMAT', 'SHORT_DATE_FORMAT')) !== false) { $regexp = ($type_name == 'integer') ? 'regexp="^\d*$"' : ''; + if ($pref_name == "PURGE_OLD_DAYS" && FORCE_ARTICLE_PURGE != 0) { + $disabled = "disabled=\"1\""; + $value = FORCE_ARTICLE_PURGE; + } else { + $disabled = ""; + } + print ""; } else if ($pref_name == "SSL_CERT_SERIAL") {