]> git.wh0rd.org Git - tt-rss.git/commitdiff
when FORCE_ARTICLE_PURGE is defined, show relevant information in the UI
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Thu, 10 Nov 2011 11:46:24 +0000 (15:46 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Thu, 10 Nov 2011 11:46:24 +0000 (15:46 +0400)
modules/pref-feeds.php
modules/pref-prefs.php

index d5f0e8b4e99b934f2baccc0c002acd90726dfa78..449f3c92a2e8d25322668fe930a93a421e0689d2 100644 (file)
 
                        $purge_interval = db_fetch_result($result, 0, "purge_interval");
 
-                       if (FORCE_ARTICLE_PURGE == 0) {
 
                                /* Purge intl */
 
-                               print "<hr/>";
-
-                               print __('Article purging:') . " ";
-
-                               print_select_hash("purge_interval", $purge_interval, $purge_intervals,
-                                       'dojoType="dijit.form.Select"');
-
-                       } else {
-                               print "<input style=\"display : none\" name='purge_interval'
-                                       dojoType=\"dijit.form.TextBox\" value='$purge_interval'>";
+                       print "<hr/>";
+                       print __('Article purging:') . " ";
 
-                       }
+                       print_select_hash("purge_interval", $purge_interval, $purge_intervals,
+                               'dojoType="dijit.form.Select" ' .
+                                       ((FORCE_ARTICLE_PURGE == 0) ? "" : 'disabled="1"'));
 
                        print "</div>";
                        print "<div class=\"dlgSec\">".__("Authentication")."</div>";
index bcabd07ac2e2502848f0aa1309b6d80743bbd1b9..4826732ab88de72842a02691a2098e959b4d0d81 100644 (file)
                        "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") {
 
                                                $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") {