]>
Commit | Line | Data |
---|---|---|
ef8be8ea AD |
1 | <?php |
2 | function module_pref_filters($link) { | |
b4e75b2a AD |
3 | $subop = $_REQUEST["subop"]; |
4 | $quiet = $_REQUEST["quiet"]; | |
ef8be8ea AD |
5 | |
6 | if ($subop == "edit") { | |
7 | ||
b4e75b2a | 8 | $filter_id = db_escape_string($_REQUEST["id"]); |
ef8be8ea AD |
9 | |
10 | $result = db_query($link, | |
11 | "SELECT * FROM ttrss_filters WHERE id = '$filter_id' AND owner_uid = " . $_SESSION["uid"]); | |
12 | ||
47439031 | 13 | $reg_exp = htmlspecialchars(db_fetch_result($result, 0, "reg_exp")); |
ef8be8ea AD |
14 | $filter_type = db_fetch_result($result, 0, "filter_type"); |
15 | $feed_id = db_fetch_result($result, 0, "feed_id"); | |
16 | $action_id = db_fetch_result($result, 0, "action_id"); | |
073ca0e6 | 17 | $action_param = db_fetch_result($result, 0, "action_param"); |
44d0e774 | 18 | $filter_param = db_fetch_result($result, 0, "filter_param"); |
ef8be8ea AD |
19 | |
20 | $enabled = sql_bool_to_bool(db_fetch_result($result, 0, "enabled")); | |
3f2ff803 | 21 | $inverse = sql_bool_to_bool(db_fetch_result($result, 0, "inverse")); |
ef8be8ea | 22 | |
ecace165 | 23 | print "<div id=\"infoBoxTitle\">".__('Filter Editor')."</div>"; |
ef8be8ea AD |
24 | print "<div class=\"infoBoxContents\">"; |
25 | ||
e6312f6c | 26 | print "<form id=\"filter_edit_form\" onsubmit='return false'>"; |
ef8be8ea AD |
27 | |
28 | print "<input type=\"hidden\" name=\"op\" value=\"pref-filters\">"; | |
29 | print "<input type=\"hidden\" name=\"id\" value=\"$filter_id\">"; | |
30 | print "<input type=\"hidden\" name=\"subop\" value=\"editSave\">"; | |
ef8be8ea AD |
31 | |
32 | $result = db_query($link, "SELECT id,description | |
33 | FROM ttrss_filter_types ORDER BY description"); | |
34 | ||
35 | $filter_types = array(); | |
36 | ||
37 | while ($line = db_fetch_assoc($result)) { | |
38 | //array_push($filter_types, $line["description"]); | |
89cb787e | 39 | $filter_types[$line["id"]] = __($line["description"]); |
ef8be8ea AD |
40 | } |
41 | ||
10fa6615 AD |
42 | print "<div class=\"dlgSec\">".__("Match")."</div>"; |
43 | ||
44 | print "<div class=\"dlgSecCont\">"; | |
45 | ||
6e278744 | 46 | if ($filter_type != 5) { |
df00fb80 | 47 | $date_ops_invisible = 'style="display : none"'; |
6e278744 AD |
48 | } |
49 | ||
50 | print "<span id=\"filter_dlg_date_mod_box\" $date_ops_invisible>"; | |
51 | print __("Date") . " "; | |
44d0e774 AD |
52 | |
53 | $filter_params = array( | |
54 | "before" => __("before"), | |
55 | "after" => __("after")); | |
56 | ||
57 | print_select_hash("filter_date_modifier", $filter_param, | |
58 | $filter_params); | |
59 | ||
60 | print " </span>"; | |
6e278744 | 61 | |
10fa6615 | 62 | print "<input onkeypress=\"return filterCR(event, filterEditSave)\" |
10fa6615 AD |
63 | name=\"reg_exp\" size=\"30\" value=\"$reg_exp\">"; |
64 | ||
6e278744 | 65 | print "<span id=\"filter_dlg_date_chk_box\" $date_ops_invisible>"; |
a918f5f9 AD |
66 | print " <button onclick=\"return filterDlgCheckDate()\">". |
67 | __('Check it')."</button>"; | |
6e278744 AD |
68 | print "</span>"; |
69 | ||
70 | print "<br/> " . __("on field") . " "; | |
71 | print_select_hash("filter_type", $filter_type, $filter_types, | |
72 | 'onchange="filterDlgCheckType(this)"'); | |
10fa6615 AD |
73 | |
74 | print "<br/>"; | |
75 | ||
76 | print __("in") . " "; | |
77 | print_feed_select($link, "feed_id", $feed_id); | |
78 | ||
79 | print "</div>"; | |
80 | ||
ecace165 | 81 | print "<div class=\"dlgSec\">".__("Perform Action")."</div>"; |
10fa6615 AD |
82 | |
83 | print "<div class=\"dlgSecCont\">"; | |
84 | ||
85 | print "<select name=\"action_id\" | |
86 | onchange=\"filterDlgCheckAction(this)\">"; | |
87 | ||
88 | $result = db_query($link, "SELECT id,description FROM ttrss_filter_actions | |
89 | ORDER BY name"); | |
90 | ||
91 | while ($line = db_fetch_assoc($result)) { | |
92 | $is_sel = ($line["id"] == $action_id) ? "selected" : ""; | |
93 | printf("<option value='%d' $is_sel>%s</option>", $line["id"], __($line["description"])); | |
94 | } | |
95 | ||
96 | print "</select>"; | |
97 | ||
ceb30ba4 | 98 | $param_hidden = ($action_id == 4 || $action_id == 6 || $action_id == 7) ? "" : "display : none"; |
10fa6615 | 99 | |
143a4973 AD |
100 | print "<span id=\"filter_dlg_param_box\" style=\"$param_hidden\">"; |
101 | print " " . __("with parameters:") . " "; | |
ceb30ba4 AD |
102 | |
103 | $param_int_hidden = ($action_id != 7) ? "" : "display : none"; | |
104 | ||
105 | print "<input size=\"20\" style=\"$param_int_hidden\" | |
074bf20c | 106 | onkeypress=\"return filterCR(event, filterEditSave)\" |
143a4973 | 107 | name=\"action_param\" value=\"$action_param\">"; |
ceb30ba4 AD |
108 | |
109 | $param_int_hidden = ($action_id == 7) ? "" : "display : none"; | |
110 | ||
111 | print_label_select($link, "action_param_label", $action_param, | |
112 | $param_int_hidden); | |
113 | ||
143a4973 | 114 | print "</span>"; |
10fa6615 | 115 | |
143a4973 | 116 | print " "; // tiny layout hack |
10fa6615 AD |
117 | |
118 | print "</div>"; | |
119 | ||
120 | print "<div class=\"dlgSec\">".__("Options")."</div>"; | |
121 | print "<div class=\"dlgSecCont\">"; | |
122 | ||
ecace165 AD |
123 | print "<div style=\"line-height : 100%\">"; |
124 | ||
10fa6615 AD |
125 | if ($enabled) { |
126 | $checked = "checked"; | |
127 | } else { | |
128 | $checked = ""; | |
129 | } | |
130 | ||
131 | print "<input type=\"checkbox\" name=\"enabled\" id=\"enabled\" $checked> | |
132 | <label for=\"enabled\">".__('Enabled')."</label><br/>"; | |
133 | ||
134 | if ($inverse) { | |
135 | $checked = "checked"; | |
136 | } else { | |
137 | $checked = ""; | |
138 | } | |
139 | ||
140 | print "<input type=\"checkbox\" name=\"inverse\" id=\"inverse\" $checked> | |
141 | <label for=\"inverse\">".__('Inverse match')."</label>"; | |
142 | ||
143 | print "</div>"; | |
ecace165 | 144 | print "</div>"; |
10fa6615 AD |
145 | |
146 | print "<div class=\"dlgButtons\">"; | |
ef8be8ea | 147 | |
ddb61e79 | 148 | $reg_exp = htmlspecialchars($reg_exp, ENT_QUOTES); // second escaping seems to be needed for javascript |
143a4973 AD |
149 | |
150 | print "<div style=\"float : left\">"; | |
577399e8 AD |
151 | print "<button onclick='return removeFilter($filter_id, \"$reg_exp\")'>". |
152 | __('Remove')."</button>"; | |
143a4973 AD |
153 | print "</div>"; |
154 | ||
577399e8 AD |
155 | print "<button onclick=\"return filterEditSave()\">". |
156 | __('Save')."</button> "; | |
ef8be8ea | 157 | |
577399e8 AD |
158 | print "<button onclick=\"return filterEditCancel()\">". |
159 | __('Cancel')."</button>"; | |
ef8be8ea AD |
160 | |
161 | print "</div>"; | |
162 | ||
163 | return; | |
164 | } | |
165 | ||
166 | ||
167 | if ($subop == "editSave") { | |
168 | ||
b8ffa322 AD |
169 | global $memcache; |
170 | ||
171 | if ($memcache) $memcache->flush(); | |
172 | ||
b4e75b2a AD |
173 | $reg_exp = db_escape_string(trim($_REQUEST["reg_exp"])); |
174 | $filter_type = db_escape_string(trim($_REQUEST["filter_type"])); | |
175 | $filter_id = db_escape_string($_REQUEST["id"]); | |
176 | $feed_id = db_escape_string($_REQUEST["feed_id"]); | |
177 | $action_id = db_escape_string($_REQUEST["action_id"]); | |
178 | $action_param = db_escape_string($_REQUEST["action_param"]); | |
179 | $action_param_label = db_escape_string($_REQUEST["action_param_label"]); | |
180 | $enabled = checkbox_to_sql_bool(db_escape_string($_REQUEST["enabled"])); | |
181 | $inverse = checkbox_to_sql_bool(db_escape_string($_REQUEST["inverse"])); | |
ef8be8ea | 182 | |
44d0e774 | 183 | # for the time being, no other filters use params anyway... |
b4e75b2a | 184 | $filter_param = db_escape_string($_REQUEST["filter_date_modifier"]); |
44d0e774 | 185 | |
ef8be8ea AD |
186 | if (!$feed_id) { |
187 | $feed_id = 'NULL'; | |
188 | } else { | |
189 | $feed_id = sprintf("'%s'", db_escape_string($feed_id)); | |
190 | } | |
ceb30ba4 AD |
191 | |
192 | /* When processing 'assign label' filters, action_param_label dropbox | |
193 | * overrides action_param */ | |
194 | ||
195 | if ($action_id == 7) { | |
196 | $action_param = $action_param_label; | |
197 | } | |
198 | ||
ef8be8ea AD |
199 | $result = db_query($link, "UPDATE ttrss_filters SET |
200 | reg_exp = '$reg_exp', | |
201 | feed_id = $feed_id, | |
202 | action_id = '$action_id', | |
203 | filter_type = '$filter_type', | |
073ca0e6 | 204 | enabled = $enabled, |
3f2ff803 | 205 | inverse = $inverse, |
44d0e774 AD |
206 | action_param = '$action_param', |
207 | filter_param = '$filter_param' | |
4dccf1ed | 208 | WHERE id = '$filter_id' AND owner_uid = " . $_SESSION["uid"]); |
5e6f933a AD |
209 | |
210 | if (db_affected_rows($link, $result) != 0) { | |
211 | print_notice(T_sprintf("Saved filter <b>%s</b>", htmlspecialchars($reg_exp))); | |
212 | } | |
213 | ||
ef8be8ea AD |
214 | } |
215 | ||
216 | if ($subop == "remove") { | |
a522a767 AD |
217 | |
218 | if ($memcache) $memcache->flush(); | |
ef8be8ea | 219 | |
b4e75b2a | 220 | $ids = split(",", db_escape_string($_REQUEST["ids"])); |
ef8be8ea | 221 | |
4dccf1ed AD |
222 | foreach ($ids as $id) { |
223 | db_query($link, "DELETE FROM ttrss_filters WHERE id = '$id' AND owner_uid = ". $_SESSION["uid"]); | |
ef8be8ea AD |
224 | } |
225 | } | |
226 | ||
227 | if ($subop == "add") { | |
a522a767 AD |
228 | |
229 | if ($memcache) $memcache->flush(); | |
230 | ||
b4e75b2a AD |
231 | $regexp = db_escape_string(trim($_REQUEST["reg_exp"])); |
232 | $filter_type = db_escape_string(trim($_REQUEST["filter_type"])); | |
233 | $feed_id = db_escape_string($_REQUEST["feed_id"]); | |
234 | $action_id = db_escape_string($_REQUEST["action_id"]); | |
235 | $action_param = db_escape_string($_REQUEST["action_param"]); | |
236 | $action_param_label = db_escape_string($_REQUEST["action_param_label"]); | |
237 | $inverse = checkbox_to_sql_bool(db_escape_string($_REQUEST["inverse"])); | |
4dccf1ed | 238 | |
44d0e774 | 239 | # for the time being, no other filters use params anyway... |
b4e75b2a | 240 | $filter_param = db_escape_string($_REQUEST["filter_date_modifier"]); |
44d0e774 | 241 | |
4dccf1ed AD |
242 | if (!$regexp) return; |
243 | ||
244 | if (!$feed_id) { | |
245 | $feed_id = 'NULL'; | |
246 | } else { | |
247 | $feed_id = sprintf("'%s'", db_escape_string($feed_id)); | |
248 | } | |
249 | ||
db34a63e AD |
250 | /* When processing 'assign label' filters, action_param_label dropbox |
251 | * overrides action_param */ | |
252 | ||
253 | if ($action_id == 7) { | |
254 | $action_param = $action_param_label; | |
255 | } | |
256 | ||
4dccf1ed AD |
257 | $result = db_query($link, |
258 | "INSERT INTO ttrss_filters (reg_exp,filter_type,owner_uid,feed_id, | |
a8732d0c | 259 | action_id, action_param, inverse, filter_param) |
4dccf1ed AD |
260 | VALUES |
261 | ('$regexp', '$filter_type','".$_SESSION["uid"]."', | |
a8732d0c | 262 | $feed_id, '$action_id', '$action_param', $inverse, '$filter_param')"); |
4dccf1ed | 263 | |
5e6f933a AD |
264 | if (db_affected_rows($link, $result) != 0) { |
265 | print T_sprintf("Created filter <b>%s</b>", htmlspecialchars($regexp)); | |
266 | } | |
267 | ||
268 | return; | |
ef8be8ea AD |
269 | } |
270 | ||
271 | if ($quiet) return; | |
272 | ||
fe8d2059 AD |
273 | set_pref($link, "_PREFS_ACTIVE_TAB", "filterConfig"); |
274 | ||
b4e75b2a | 275 | $sort = db_escape_string($_REQUEST["sort"]); |
ef8be8ea AD |
276 | |
277 | if (!$sort || $sort == "undefined") { | |
278 | $sort = "reg_exp"; | |
279 | } | |
280 | ||
281 | // print "<div id=\"infoBoxShadow\"><div id=\"infoBox\">PLACEHOLDER</div></div>"; | |
282 | ||
283 | $result = db_query($link, "SELECT id,description | |
284 | FROM ttrss_filter_types ORDER BY description"); | |
285 | ||
286 | $filter_types = array(); | |
287 | ||
288 | while ($line = db_fetch_assoc($result)) { | |
289 | //array_push($filter_types, $line["description"]); | |
290 | $filter_types[$line["id"]] = $line["description"]; | |
291 | } | |
292 | ||
9c87d75c | 293 | |
b4e75b2a | 294 | $filter_search = db_escape_string($_REQUEST["search"]); |
9c87d75c | 295 | |
b4e75b2a | 296 | if (array_key_exists("search", $_REQUEST)) { |
9c87d75c AD |
297 | $_SESSION["prefs_filter_search"] = $filter_search; |
298 | } else { | |
299 | $filter_search = $_SESSION["prefs_filter_search"]; | |
300 | } | |
301 | ||
577399e8 | 302 | print "<div style='float : right'> |
9c87d75c | 303 | <input id=\"filter_search\" size=\"20\" type=\"search\" |
4cf6fc6a AD |
304 | onfocus=\"javascript:disableHotkeys();\" |
305 | onblur=\"javascript:enableHotkeys();\" | |
9c87d75c | 306 | onchange=\"javascript:updateFilterList()\" value=\"$filter_search\"> |
577399e8 | 307 | <button onclick=\"javascript:updateFilterList()\">".__('Search')."</button> |
1e5548db AD |
308 | |
309 | <a class='helpLinkPic' href=\"javascript:displayHelpInfobox(2)\"> | |
883fee8d | 310 | <img style='vertical-align : top;' src='".theme_image($link, "images/sign_quest.png")."'></a> |
577399e8 | 311 | </div>"; |
9c87d75c | 312 | |
3393238d | 313 | print "<button onclick=\"return quickAddFilter()\">". |
577399e8 | 314 | __('Create filter')."</button> "; |
0d32b41e | 315 | |
577399e8 AD |
316 | print "<button onclick=\"return editSelectedFilter()\">". |
317 | __('Edit')."</button> "; | |
ef8be8ea | 318 | |
577399e8 AD |
319 | print "<button onclick=\"return removeSelectedFilters()\">". |
320 | __('Remove')."</button> "; | |
1e5548db | 321 | |
fe1c99af AD |
322 | if (defined('_ENABLE_FEED_DEBUGGING')) { |
323 | print "<button onclick=\"rescore_all_feeds()\">". | |
324 | __('Rescore articles')."</button> "; | |
325 | } | |
95a948a5 | 326 | |
9c87d75c | 327 | if ($filter_search) { |
1638fc4e AD |
328 | $filter_search = split(' ', db_escape_string($filter_search)); |
329 | ||
330 | $tokens = array(); | |
331 | ||
332 | foreach ($filter_search as $token) { | |
333 | $token = trim($token); | |
334 | ||
335 | array_push($tokens, "( | |
336 | UPPER(ttrss_filter_actions.description) LIKE UPPER('%$token%') OR | |
337 | UPPER(reg_exp) LIKE UPPER('%$token%') OR | |
338 | UPPER(action_param) LIKE UPPER('%$token%') OR | |
339 | UPPER(ttrss_feeds.title) LIKE UPPER('%$token%') OR | |
340 | UPPER(ttrss_filter_types.description) LIKE UPPER('%$token%'))"); | |
341 | } | |
342 | ||
343 | $filter_search_query = "(" . join($tokens, " AND ") . ") AND "; | |
344 | ||
9c87d75c AD |
345 | } else { |
346 | $filter_search_query = ""; | |
347 | } | |
348 | ||
ef8be8ea AD |
349 | $result = db_query($link, "SELECT |
350 | ttrss_filters.id AS id,reg_exp, | |
351 | ttrss_filter_types.name AS filter_type_name, | |
352 | ttrss_filter_types.description AS filter_type_descr, | |
353 | enabled, | |
3f2ff803 | 354 | inverse, |
ef8be8ea | 355 | feed_id, |
7f94284b | 356 | filter_param, |
1b74062f | 357 | filter_type, |
ef8be8ea | 358 | ttrss_filter_actions.description AS action_description, |
ff6e357a AD |
359 | ttrss_feeds.title AS feed_title, |
360 | ttrss_filter_actions.name AS action_name, | |
361 | ttrss_filters.action_param AS action_param | |
ef8be8ea AD |
362 | FROM |
363 | ttrss_filter_types,ttrss_filter_actions,ttrss_filters LEFT JOIN | |
364 | ttrss_feeds ON (ttrss_filters.feed_id = ttrss_feeds.id) | |
365 | WHERE | |
366 | filter_type = ttrss_filter_types.id AND | |
9c87d75c | 367 | $filter_search_query |
ef8be8ea AD |
368 | ttrss_filter_actions.id = action_id AND |
369 | ttrss_filters.owner_uid = ".$_SESSION["uid"]." | |
a82dc5e4 | 370 | ORDER by action_description, $sort"); |
ef8be8ea AD |
371 | |
372 | if (db_num_rows($result) != 0) { | |
373 | ||
ef8be8ea AD |
374 | print "<p><table width=\"100%\" cellspacing=\"0\" class=\"prefFilterList\" |
375 | id=\"prefFilterList\">"; | |
376 | ||
377 | print "<tr><td class=\"selectPrompt\" colspan=\"8\"> | |
e8d0177d | 378 | ".__('Select:')." |
a998dbef AD |
379 | <a href=\"#\" onclick=\"selectPrefRows('filter', true)\">".__('All')."</a>, |
380 | <a href=\"#\" onclick=\"selectPrefRows('filter', false)\">".__('None')."</a> | |
ef8be8ea AD |
381 | </td</tr>"; |
382 | ||
ef8be8ea | 383 | $lnum = 0; |
a82dc5e4 AD |
384 | |
385 | $cur_action_description = ""; | |
386 | ||
ef8be8ea AD |
387 | while ($line = db_fetch_assoc($result)) { |
388 | ||
ef8be8ea | 389 | $filter_id = $line["id"]; |
b4e75b2a | 390 | $edit_filter_id = $_REQUEST["id"]; |
ef8be8ea AD |
391 | |
392 | $enabled = sql_bool_to_bool($line["enabled"]); | |
3f2ff803 AD |
393 | $inverse = sql_bool_to_bool($line["inverse"]); |
394 | ||
ef9cab23 | 395 | $this_row_id = "id=\"FILRR-$filter_id\""; |
a82dc5e4 AD |
396 | |
397 | $line["filter_type_descr"] = __($line["filter_type_descr"]); | |
398 | $line["action_description"] = __($line["action_description"]); | |
399 | ||
400 | if ($line["action_description"] != $cur_action_description) { | |
401 | $cur_action_description = $line["action_description"]; | |
402 | ||
403 | print "<tr><td class='filterEditCat' colspan='6'>$cur_action_description</td></tr>"; | |
404 | ||
405 | print "<tr class=\"title\"> | |
406 | <td align='center' width=\"5%\"> </td> | |
a998dbef AD |
407 | <td width=\"20%\"><a href=\"#\" onclick=\"updateFilterList('reg_exp')\">".__('Match')."</a></td> |
408 | <td width=\"\"><a href=\"#\" onclick=\"updateFilterList('feed_title')\">".__('Feed')."</a></td> | |
409 | <td width=\"20%\"><a href=\"#\" onclick=\"updateFilterList('filter_type')\">".__('Field')."</a></td> | |
410 | <td width=\"20%\"><a href=\"#\" onclick=\"updateFilterList('action_param')\">".__('Params')."</a></td>"; | |
a82dc5e4 | 411 | |
ef9cab23 | 412 | $lnum = 0; |
a82dc5e4 AD |
413 | } |
414 | ||
ef9cab23 AD |
415 | $class = ($lnum % 2) ? "even" : "odd"; |
416 | ||
ef8be8ea AD |
417 | print "<tr class=\"$class\" $this_row_id>"; |
418 | ||
47439031 | 419 | $line["reg_exp"] = htmlspecialchars($line["reg_exp"]); |
ef8be8ea | 420 | |
a3c159c4 | 421 | if (!$line["feed_title"]) $line["feed_title"] = __("All feeds"); |
0966ea37 | 422 | |
799e1b39 AD |
423 | if (array_search($line["action_name"], |
424 | array("score", "tag", "label")) === false) { | |
425 | ||
426 | $line["action_param"] = false; | |
427 | } | |
428 | ||
0966ea37 | 429 | if (!$line["action_param"]) { |
08e618f7 | 430 | $line["action_param"] = "—"; |
0966ea37 AD |
431 | } else if ($line["action_name"] == "score") { |
432 | ||
883fee8d AD |
433 | $score_pic = theme_image($link, |
434 | "images/" . get_score_pic($line["action_param"])); | |
0966ea37 | 435 | |
883fee8d | 436 | $score_pic = "<img class='hlScorePic' src=\"$score_pic\">"; |
0966ea37 AD |
437 | |
438 | $line["action_param"] = "$score_pic " . $line["action_param"]; | |
439 | ||
440 | } | |
ef8be8ea | 441 | |
47439031 | 442 | $line["feed_title"] = htmlspecialchars($line["feed_title"]); |
ef8be8ea | 443 | |
a998dbef | 444 | print "<td align='center'><input onclick='toggleSelectRow(this);' |
ef8be8ea AD |
445 | type=\"checkbox\" id=\"FICHK-".$line["id"]."\"></td>"; |
446 | ||
7f94284b AD |
447 | $filter_params = array( |
448 | "before" => __("before"), | |
449 | "after" => __("after")); | |
a970edb1 AD |
450 | |
451 | if ($line["action_name"] == 'label') { | |
452 | ||
453 | $tmp_result = db_query($link, "SELECT fg_color, bg_color | |
454 | FROM ttrss_labels2 WHERE caption = '". | |
455 | db_escape_string($line["action_param"])."' AND | |
456 | owner_uid = " . $_SESSION["uid"]); | |
457 | ||
458 | $fg_color = db_fetch_result($tmp_result, 0, "fg_color"); | |
459 | $bg_color = db_fetch_result($tmp_result, 0, "bg_color"); | |
460 | ||
461 | $tmp = "<div class='labelColorIndicator' id='LICID-$id' | |
462 | style='color : $fg_color; background-color : $bg_color'> | |
463 | α"; | |
464 | $tmp .= "</div>"; | |
465 | ||
466 | $line["action_param"] = "$tmp " . $line["action_param"]; | |
467 | } | |
468 | ||
7f94284b AD |
469 | if ($line["filter_type"] == 5) { |
470 | ||
471 | if (!strtotime($line["reg_exp"])) { | |
472 | $line["reg_exp"] = "<span class=\"filterDateError\">" . | |
473 | $line["reg_exp"] . "</span>"; | |
474 | } | |
475 | ||
476 | $line["reg_exp"] = __("Date") . " " . | |
477 | $filter_params[$line['filter_param']] . " " . | |
478 | $line["reg_exp"]; | |
479 | } | |
480 | ||
ef8be8ea AD |
481 | if (!$enabled) { |
482 | $line["reg_exp"] = "<span class=\"insensitive\">" . | |
a3c159c4 | 483 | $line["reg_exp"] . " " . __("(Disabled)")."</span>"; |
ef8be8ea AD |
484 | $line["feed_title"] = "<span class=\"insensitive\">" . |
485 | $line["feed_title"] . "</span>"; | |
486 | $line["filter_type_descr"] = "<span class=\"insensitive\">" . | |
487 | $line["filter_type_descr"] . "</span>"; | |
488 | $line["action_description"] = "<span class=\"insensitive\">" . | |
489 | $line["action_description"] . "</span>"; | |
a82dc5e4 AD |
490 | $line["action_param"] = "<span class=\"insensitive\">" . |
491 | $line["action_param"] . "</span>"; | |
ef8be8ea | 492 | } |
a95da136 | 493 | |
a998dbef | 494 | $onclick = "onclick='editFilter($filter_id, event)' title='".__('Click to edit')."'"; |
a95da136 | 495 | |
3f2ff803 AD |
496 | $inverse_label = ""; |
497 | ||
498 | if ($inverse) { | |
a3c159c4 | 499 | $inverse_label = " <span class='insensitive'>".__('(Inverse)')."</span>"; |
3f2ff803 | 500 | } |
1b74062f AD |
501 | |
502 | print "<td $onclick>" . $line["reg_exp"] . "$inverse_label</td>"; | |
503 | print "<td $onclick>" . $line["feed_title"] . "</td>"; | |
ef8be8ea | 504 | |
1b74062f | 505 | print "<td $onclick>" . $line["filter_type_descr"] . "</td>"; |
08e618f7 | 506 | print "<td $onclick>" . $line["action_param"] . "</td>"; |
ff6e357a | 507 | |
ef8be8ea AD |
508 | print "</tr>"; |
509 | ||
510 | ++$lnum; | |
511 | } | |
a5bd7bf0 | 512 | |
ef8be8ea AD |
513 | print "</table>"; |
514 | ||
ef8be8ea AD |
515 | } else { |
516 | ||
9c87d75c | 517 | print "<p>"; |
9c87d75c | 518 | if (!$filter_search) { |
cea04d61 | 519 | print_warning(__('No filters defined.')); |
9c87d75c | 520 | } else { |
cea04d61 | 521 | print_warning(__('No matching filters found.')); |
9c87d75c | 522 | } |
9c87d75c | 523 | print "</p>"; |
ef8be8ea AD |
524 | |
525 | } | |
526 | } | |
ceb30ba4 | 527 | |
ef8be8ea | 528 | ?> |