]> git.wh0rd.org - tt-rss.git/blobdiff - classes/pref/feeds.php
hide purge options when config.php has forced things
[tt-rss.git] / classes / pref / feeds.php
index 2d68f66b40644ec79fb26691e02a7edfcd344a6c..d6abe2328809482ee20edb182043431a367c0acc 100755 (executable)
@@ -600,6 +600,7 @@ class Pref_Feeds extends Handler_Protected {
 
                        /* Purge intl */
 
+               if (FORCE_ARTICLE_PURGE == 0) {
                        $purge_interval = $row["purge_interval"];
 
                        print "<hr/>";
@@ -608,6 +609,7 @@ class Pref_Feeds extends Handler_Protected {
                        print_select_hash("purge_interval", $purge_interval, $purge_intervals,
                                'dojoType="dijit.form.Select" ' .
                                ((FORCE_ARTICLE_PURGE == 0) ? "" : 'disabled="1"'));
+               }
 
                        print "</div>";
 
@@ -660,6 +662,7 @@ class Pref_Feeds extends Handler_Protected {
                        print "<input dojoType=\"dijit.form.CheckBox\" type=\"checkbox\" name=\"private\" id=\"private\"
                        $checked>&nbsp;<label for=\"private\">".__('Hide from Popular feeds')."</label>";
 
+               if (DIGEST_SUBJECT !== false) {
                        $include_in_digest = $row["include_in_digest"];
 
                        if ($include_in_digest) {
@@ -671,6 +674,7 @@ class Pref_Feeds extends Handler_Protected {
                        print "<hr/><input dojoType=\"dijit.form.CheckBox\" type=\"checkbox\" id=\"include_in_digest\"
                        name=\"include_in_digest\"
                        $checked>&nbsp;<label for=\"include_in_digest\">".__('Include in e-mail digest')."</label>";
+               }
 
 
                        $always_display_enclosures = $row["always_display_enclosures"];
@@ -1711,11 +1715,11 @@ class Pref_Feeds extends Handler_Protected {
 
        function regenFeedKey() {
                $feed_id = clean($_REQUEST['id']);
-               $is_cat = clean($_REQUEST['is_cat']) == "true";
+               $is_cat = clean($_REQUEST['is_cat']);
 
                $new_key = $this->update_feed_access_key($feed_id, $is_cat);
 
-               print json_encode(array("link" => $new_key));
+               print json_encode(["link" => $new_key]);
        }
 
 
@@ -1725,7 +1729,7 @@ class Pref_Feeds extends Handler_Protected {
                // clear old value and generate new one
                $sth = $this->pdo->prepare("DELETE FROM ttrss_access_keys
                        WHERE feed_id = ? AND is_cat = ? AND owner_uid = ?");
-               $sth->execute([$feed_id, $is_cat, $owner_uid]);
+               $sth->execute([$feed_id, bool_to_sql_bool($is_cat), $owner_uid]);
 
                return get_feed_access_key($feed_id, $is_cat, $owner_uid);
        }