diff options
Diffstat (limited to 'classes/pref/filters.php')
-rwxr-xr-x | classes/pref/filters.php | 59 |
1 files changed, 15 insertions, 44 deletions
diff --git a/classes/pref/filters.php b/classes/pref/filters.php index ec980d5f9..9c2a7bf54 100755 --- a/classes/pref/filters.php +++ b/classes/pref/filters.php @@ -146,48 +146,16 @@ class Pref_Filters extends Handler_Protected { $content_preview = $line["content_preview"]; - $tmp = "<tr style='margin-top : 5px'>"; - - #$tmp .= "<td width='5%' align='center'><input dojoType=\"dijit.form.CheckBox\" - # checked=\"1\" disabled=\"1\" type=\"checkbox\"></td>"; - - $id = $line['id']; - $tmp .= "<td width='5%' align='center'><img style='cursor : pointer' title='".__("Preview article")."' - src='images/information.png' onclick='popupOpenArticle($id)'></td><td>"; - - /*foreach ($filter['rules'] as $rule) { - $reg_exp = str_replace('/', '\/', $rule["reg_exp"]); - - $line["title"] = preg_replace("/($reg_exp)/i", - "<span class=\"highlight\">$1</span>", $line["title"]); - - $content_preview = preg_replace("/($reg_exp)/i", - "<span class=\"highlight\">$1</span>", $content_preview); - }*/ - - $tmp .= "<strong>" . $line["title"] . "</strong><br/>"; - $tmp .= $line['feed_title'] . ", " . mb_substr($line["date_entered"], 0, 16); - $tmp .= "<div class='insensitive'>" . $content_preview . "</div>"; - $tmp .= "</td></tr>"; + $tmp = "<li><span class='title'>" . $line["title"] . "</span><br/>" . + "<span class='feed'>" . $line['feed_title'] . "</span>, <span class='date'>" . mb_substr($line["date_entered"], 0, 16) . "</span>" . + "<div class='preview insensitive'>" . $content_preview . "</div>" . + "</li>"; array_push($rv, $tmp); - /*array_push($rv, array("title" => $line["title"], - "content" => $content_preview, - "date" => $line["date_entered"], - "feed" => $line["feed_title"])); */ - } } - //$offset += $limit; - //} - - /*if ($found == 0) { - print "<tr><td align='center'>" . - __("No recent articles matching this filter have been found."); - }*/ - print json_encode($rv); } @@ -199,9 +167,8 @@ class Pref_Filters extends Handler_Protected { print "<div><img id='prefFilterLoadingIndicator' src='images/indicator_tiny.gif'> <span id='prefFilterProgressMsg'>Looking for articles...</span></div>"; - print "<br/><div class='panel panel-scrollable'>"; - print "<table width='100%' id='prefFilterTestResultList'>"; - print "</table></div>"; + print "<ul class='panel panel-scrollable list list-unstyled' id='prefFilterTestResultList'>"; + print "</ul>"; print "<div style='text-align : center'>"; print "<button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('filterTestDlg').hide()\">". @@ -210,7 +177,7 @@ class Pref_Filters extends Handler_Protected { } - private function getfilterrules_concise($filter_id) { + private function getfilterrules_list($filter_id) { $sth = $this->pdo->prepare("SELECT reg_exp, inverse, match_on, @@ -260,11 +227,11 @@ class Pref_Filters extends Handler_Protected { $inverse = $line["inverse"] ? "inverse" : ""; - $rv .= "<span class='$inverse'>" . T_sprintf("%s on %s in %s %s", + $rv .= "<li class='$inverse'>" . T_sprintf("%s on %s in %s %s", htmlspecialchars($line["reg_exp"]), $line["field"], $where, - $line["inverse"] ? __("(inverse)") : "") . "</span>"; + $line["inverse"] ? __("(inverse)") : "") . "</li>"; } return $rv; @@ -301,6 +268,10 @@ class Pref_Filters extends Handler_Protected { $match_ok = false; if ($filter_search) { + if (mb_strpos($line['title'], $filter_search) !== false) { + $match_ok = true; + } + $rules_sth = $this->pdo->prepare("SELECT reg_exp FROM ttrss_filters2_rules WHERE filter_id = ?"); $rules_sth->execute([$line['id']]); @@ -335,7 +306,7 @@ class Pref_Filters extends Handler_Protected { $filter['checkbox'] = false; $filter['last_triggered'] = $line["last_triggered"] ? make_local_datetime($line["last_triggered"], false) : null; $filter['enabled'] = $line["enabled"]; - $filter['rules'] = $this->getfilterrules_concise($line['id']); + $filter['rules'] = $this->getfilterrules_list($line['id']); if (!$filter_search || $match_ok) { array_push($folder['items'], $filter); @@ -785,7 +756,7 @@ class Pref_Filters extends Handler_Protected { print "<div style='float : right; padding-right : 4px;'> <input dojoType=\"dijit.form.TextBox\" id=\"filter_search\" size=\"20\" type=\"search\" value=\"$filter_search\"> - <button dojoType=\"dijit.form.Button\" onclick=\"updateFilterList()\">". + <button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('filterTree').reload()\">". __('Search')."</button> </div>"; |