diff options
author | Andrew Dolgov <[email protected]> | 2011-11-10 15:46:24 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2011-11-10 15:46:24 +0400 |
commit | df0b946fee42bb1f06bdadbc6b3116c3aa718e5e (patch) | |
tree | 86ff22c76be89acc306e45256eee07669e1d2852 /modules/pref-prefs.php | |
parent | 410c0b3a01b497cfc4349e4a8d13626051ab9d26 (diff) |
when FORCE_ARTICLE_PURGE is defined, show relevant information in the UI
Diffstat (limited to 'modules/pref-prefs.php')
-rw-r--r-- | modules/pref-prefs.php | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/modules/pref-prefs.php b/modules/pref-prefs.php index bcabd07ac..4826732ab 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 "<input dojoType=\"dijit.form.ValidationTextBox\" - required=\"1\" $regexp + required=\"1\" $regexp $disabled name=\"$pref_name\" value=\"$value\">"; } else if ($pref_name == "SSL_CERT_SERIAL") { |