$fg_color = db_fetch_result($label_result, 0, "fg_color");
$bg_color = db_fetch_result($label_result, 0, "bg_color");
- $name[1] = "<span class=\"labelColorIndicator\" id=\"label-editor-indicator\" style='color : $fg_color; background-color : $bg_color; margin-right : 4px'>α</span>" . $name[1];
+ if ($name[1]) $name[1] = "<span class=\"labelColorIndicator\" id=\"label-editor-indicator\" style='color : $fg_color; background-color : $bg_color; margin-right : 4px'>α</span>" . $name[1];
}
}
$enabled = sql_bool_to_bool(db_fetch_result($result, 0, "enabled"));
$match_any_rule = sql_bool_to_bool(db_fetch_result($result, 0, "match_any_rule"));
$inverse = sql_bool_to_bool(db_fetch_result($result, 0, "inverse"));
+ $title = htmlspecialchars(db_fetch_result($result, 0, "title"));
print "<form id=\"filter_edit_form\" onsubmit='return false'>";
print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"editSave\">";
print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"csrf_token\" value=\"".$_SESSION['csrf_token']."\">";
+ print "<div class=\"dlgSec\">".__("Caption")."</div>";
+
+ print "<input dojoType=\"dijit.form.TextBox\" style=\"width : 20em;\" name=\"title\" value=\"$title\">";
+
+ print "</div>";
+
print "<div class=\"dlgSec\">".__("Match")."</div>";
print "<div dojoType=\"dijit.Toolbar\">";
$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"]);
$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"]);
print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"add\">";
print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"csrf_token\" value=\"".$_SESSION['csrf_token']."\">";
+ print "<div class=\"dlgSec\">".__("Caption")."</div>";
+
+ print "<input dojoType=\"dijit.form.TextBox\" style=\"width : 20em;\" name=\"title\" value=\"\">";
+
print "<div class=\"dlgSec\">".__("Match")."</div>";
print "<div dojoType=\"dijit.Toolbar\">";
}
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");
}
return array(join(", ", $titles), join(", ", $actions));
+
+ }
}
function join() {