}
+ private function getfilterrules_concise($filter_id) {
+ $result = $this->dbh->query("SELECT reg_exp,
+ inverse,
+ feed_id,
+ cat_id,
+ cat_filter,
+ ttrss_filter_types.description AS field
+ FROM
+ ttrss_filters2_rules, ttrss_filter_types
+ WHERE
+ filter_id = '$filter_id' AND filter_type = ttrss_filter_types.id");
+
+ $rv = "";
+
+ while ($line = $this->dbh->fetch_assoc($result)) {
+
+ $where = sql_bool_to_bool($line["cat_filter"]) ?
+ getCategoryTitle($line["cat_id"]) : getFeedTitle($line["feed_id"]);
+
+# $where = $line["cat_id"] . "/" . $line["feed_id"];
+
+ $inverse = sql_bool_to_bool($line["inverse"]) ? "inverse" : "";
+
+ $rv .= "<span class='$inverse'>" . T_sprintf("%s on %s in %s %s",
+ strip_tags($line["reg_exp"]),
+ $line["field"],
+ $where,
+ sql_bool_to_bool($line["inverse"]) ? __("(inverse)") : "") . "</span>";
+ }
+
+ return $rv;
+ }
function getfiltertree() {
$root = array();
$filter['param'] = $name[1];
$filter['checkbox'] = false;
$filter['enabled'] = sql_bool_to_bool($line["enabled"]);
+ $filter['rules'] = $this->getfilterrules_concise($line['id']);
if (!$filter_search || $match_ok) {
array_push($folder['items'], $filter);
WHERE id = ".(int)$rule["filter_type"]);
$filter_type = $this->dbh->fetch_result($result, 0, "description");
- return T_sprintf("%s on %s in %s %s", strip_tags($rule["reg_exp"]),
- $filter_type, $feed, isset($rule["inverse"]) ? __("(inverse)") : "");
+ $inverse = isset($rule["inverse"]) ? "inverse" : "";
+
+ return "<span class='filterRule $inverse'>" .
+ T_sprintf("%s on %s in %s %s", strip_tags($rule["reg_exp"]),
+ $filter_type, $feed, isset($rule["inverse"]) ? __("(inverse)") : "") . "</span>";
}
function printRuleName() {
margin-right : 1em;
}
+.claro .dijitTree .filterRules {
+ display : block;
+ color : #ccc;
+ font-size : 10px;
+ margin-left : 100px;
+}
+
+.claro .dijitTree .filterRules span {
+ display : block;
+ color : green;
+}
+
+#filterDlg_Matches span.filterRule {
+ color : green;
+}
+
+.claro .dijitTree .filterRules span.inverse,
+#filterDlg_Matches span.filterRule.inverse {
+ color : red;
+}
+
+
.claro .dijitTree .labelParam {
float : right;
margin-right : 1em;
var enabled = this.model.store.getValue(args.item, 'enabled');
var param = this.model.store.getValue(args.item, 'param');
+ var rules = this.model.store.getValue(args.item, 'rules');
if (param) {
param = dojo.doc.createElement('span');
dojo.place(param, tnode.rowNode, 'first');
}
+ if (rules) {
+ param = dojo.doc.createElement('span');
+ param.className = 'filterRules';
+ param.innerHTML = rules;
+ dojo.place(param, tnode.rowNode, 'next');
+ }
+
if (this.model.store.getValue(args.item, 'id') != 'root') {
var img = dojo.doc.createElement('img');
img.src ='images/filter.png';