]> git.wh0rd.org Git - tt-rss.git/commitdiff
use ttrss_filters.enabled
authorAndrew Dolgov <fox@bah.spb.su>
Sun, 20 Aug 2006 14:18:02 +0000 (15:18 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Sun, 20 Aug 2006 14:18:02 +0000 (15:18 +0100)
backend.php
functions.php

index fc36d2e039965090f08d552a2b94d8c80a6dfdd5..51653b65685c9b9294072a3a405d838ef3f38bf5 100644 (file)
                        $filter_type = db_fetch_result($result, 0, "filter_type");
                        $feed_id = db_fetch_result($result, 0, "feed_id");
                        $action_id = db_fetch_result($result, 0, "action_id");
-                               
+
+                       $enabled = sql_bool_to_bool(db_fetch_result($result, 0, "enabled"));
+
                        print "<div id=\"infoBoxTitle\">Filter editor</div>";
                        print "<div class=\"infoBoxContents\">";
 
        
                        print "</select>";
 
+                       print "</td></tr>";
+
+                       if ($enabled) {
+                               $checked = "checked";
+                       } else {
+                               $checked = "";
+                       }
+
+                       print "<tr><td>Options:</td><td>
+                                       <input type=\"checkbox\" name=\"enabled\" id=\"enabled\" $checked>
+                                       <label for=\"enabled\">Enabled</label>";
+
                        print "</td></tr></table>";
 
                        print "</form>";
                        $filter_id = db_escape_string($_GET["id"]);
                        $feed_id = db_escape_string($_GET["feed_id"]);
                        $action_id = db_escape_string($_GET["action_id"]); 
+                       $enabled = checkbox_to_sql_bool(db_escape_string($_GET["enabled"]));
 
                        if (!$feed_id) {
                                $feed_id = 'NULL';
                                        reg_exp = '$reg_exp', 
                                        feed_id = $feed_id,
                                        action_id = '$action_id',
-                                       filter_type = '$filter_type'
+                                       filter_type = '$filter_type',
+                                       enabled = $enabled
                                WHERE id = '$filter_id' AND owner_uid = " . $_SESSION["uid"]);
                }
 
                                ttrss_filters.id AS id,reg_exp,
                                ttrss_filter_types.name AS filter_type_name,
                                ttrss_filter_types.description AS filter_type_descr,
+                               enabled,
                                feed_id,
                                ttrss_filter_actions.description AS action_description,
                                ttrss_feeds.title AS feed_title
        
                                $filter_id = $line["id"];
                                $edit_filter_id = $_GET["id"];
+
+                               $enabled = sql_bool_to_bool($line["enabled"]);
        
                                if ($subop == "edit" && $filter_id != $edit_filter_id) {
                                        $class .= "Grayed";
 
                                print "<td align='center'><input onclick='toggleSelectPrefRow(this, \"filter\");' 
                                        type=\"checkbox\" id=\"FICHK-".$line["id"]."\"></td>";
+
+                               if (!$enabled) {
+                                       $line["reg_exp"] = "<span class=\"insensitive\">" . 
+                                               $line["reg_exp"] . " (Disabled)</span>";
+                                       $line["feed_title"] = "<span class=\"insensitive\">" . 
+                                               $line["feed_title"] . "</span>";
+                                       $line["filter_type_descr"] = "<span class=\"insensitive\">" . 
+                                               $line["filter_type_descr"] . "</span>";
+                                       $line["action_description"] = "<span class=\"insensitive\">" . 
+                                               $line["action_description"] . "</span>";
+                               }       
        
                                print "<td><a href=\"javascript:editFilter($filter_id);\">" . 
                                        $line["reg_exp"] . "</td>";             
index 7e6a134f940aef8c5e2ff53cd596c5314946ef0d..d775abb145df68b0255c71142ee34e946a0f84f3 100644 (file)
 
                        $result = db_query($link, "SELECT reg_exp,
                                ttrss_filter_types.name AS name,
-                               ttrss_filter_actions.name AS action
+                               ttrss_filter_actions.name AS action,
                                FROM ttrss_filters,ttrss_filter_types,ttrss_filter_actions WHERE                                        
+                                       enabled = true AND
                                        owner_uid = $owner_uid AND
                                        ttrss_filter_types.id = filter_type AND
                                        ttrss_filter_actions.id = action_id AND