$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>";
$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