";
@@ -422,10 +429,12 @@ class Pref_Filters extends Handler_Protected {
$enabled = checkbox_to_sql_bool(db_escape_string($this->link, $_REQUEST["enabled"]));
$match_any_rule = checkbox_to_sql_bool(db_escape_string($this->link, $_REQUEST["match_any_rule"]));
$inverse = checkbox_to_sql_bool(db_escape_string($this->link, $_REQUEST["inverse"]));
+ $title = db_escape_string($this->link, $_REQUEST["title"]);
$result = db_query($this->link, "UPDATE ttrss_filters2 SET enabled = $enabled,
match_any_rule = $match_any_rule,
- inverse = $inverse
+ inverse = $inverse,
+ title = '$title'
WHERE id = '$filter_id'
AND owner_uid = ". $_SESSION["uid"]);
@@ -539,14 +548,15 @@ class Pref_Filters extends Handler_Protected {
$enabled = checkbox_to_sql_bool($_REQUEST["enabled"]);
$match_any_rule = checkbox_to_sql_bool($_REQUEST["match_any_rule"]);
+ $title = db_escape_string($this->link, $_REQUEST["title"]);
db_query($this->link, "BEGIN");
/* create base filter */
$result = db_query($this->link, "INSERT INTO ttrss_filters2
- (owner_uid, match_any_rule, enabled) VALUES
- (".$_SESSION["uid"].",$match_any_rule,$enabled)");
+ (owner_uid, match_any_rule, enabled, title) VALUES
+ (".$_SESSION["uid"].",$match_any_rule,$enabled, '$title')");
$result = db_query($this->link, "SELECT MAX(id) AS id FROM ttrss_filters2
WHERE owner_uid = ".$_SESSION["uid"]);
@@ -668,6 +678,10 @@ class Pref_Filters extends Handler_Protected {
print "
";
print "
";
+ print "
".__("Caption")."
";
+
+ print "
";
+
print "
".__("Match")."
";
print "
";
@@ -894,6 +908,16 @@ class Pref_Filters extends Handler_Protected {
}
private function getFilterName($id) {
+
+ $result = db_query($this->link,
+ "SELECT title FROM ttrss_filters2 WHERE id = '$id'");
+
+ $title = db_fetch_result($result, 0, "title");
+
+ if ($title) {
+ return array($title);
+ } else {
+
$result = db_query($this->link,
"SELECT * FROM ttrss_filters2_rules WHERE filter_id = '$id' ORDER BY id
LIMIT 3");
@@ -937,6 +961,8 @@ class Pref_Filters extends Handler_Protected {
}
return array(join(", ", $titles), join(", ", $actions));
+
+ }
}
function join() {