diff options
author | Andrew Dolgov <[email protected]> | 2006-12-08 08:21:44 +0100 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2006-12-08 08:21:44 +0100 |
commit | 073ca0e663781bb90e01c56b058b7c0801f19bcb (patch) | |
tree | 7062c3e6da971edc6257184dcd5fb8c12534656e /modules | |
parent | de07b5eee928a3d78fede1e3b7ef2d80b5199d42 (diff) |
new filter action: tag article
Diffstat (limited to 'modules')
-rw-r--r-- | modules/popup-dialog.php | 11 | ||||
-rw-r--r-- | modules/pref-filters.php | 20 |
2 files changed, 25 insertions, 6 deletions
diff --git a/modules/popup-dialog.php b/modules/popup-dialog.php index 459b3b3e9..5549a2d79 100644 --- a/modules/popup-dialog.php +++ b/modules/popup-dialog.php @@ -208,7 +208,8 @@ print "<tr><td>Action:</td>"; - print "<td colspan='2'><select name=\"action_id\">"; + print "<td colspan='2'><select name=\"action_id\" + onchange=\"filterDlgCheckAction(this)\">"; $result = db_query($link, "SELECT id,description FROM ttrss_filter_actions ORDER BY name"); @@ -219,7 +220,13 @@ print "</select>"; - print "</td></tr></table>"; + print "</td></tr>"; + + print "<tr><td>Params:</td>"; + + print "<td><input disabled class='iedit' name='action_param'></td></tr>"; + + print "</table>"; print "</form>"; diff --git a/modules/pref-filters.php b/modules/pref-filters.php index 0570b7ac5..610e3dcd0 100644 --- a/modules/pref-filters.php +++ b/modules/pref-filters.php @@ -14,6 +14,7 @@ $filter_type = db_fetch_result($result, 0, "filter_type"); $feed_id = db_fetch_result($result, 0, "feed_id"); $action_id = db_fetch_result($result, 0, "action_id"); + $action_param = db_fetch_result($result, 0, "action_param"); $enabled = sql_bool_to_bool(db_fetch_result($result, 0, "enabled")); @@ -58,7 +59,8 @@ print "<tr><td>Action:</td>"; - print "<td colspan='2'><select name=\"action_id\">"; + print "<td colspan='2'><select name=\"action_id\" + onchange=\"filterDlgCheckAction(this)\">"; $result = db_query($link, "SELECT id,description FROM ttrss_filter_actions ORDER BY name"); @@ -72,6 +74,13 @@ print "</td></tr>"; + print "<tr><td>Params:</td>"; + + $param_disabled = ($action_id == 4) ? "" : "disabled"; + + print "<td><input $param_disabled class='iedit' + name=\"action_param\" value=\"$action_param\"></td></tr>"; + if ($enabled) { $checked = "checked"; } else { @@ -110,6 +119,7 @@ $filter_id = db_escape_string($_GET["id"]); $feed_id = db_escape_string($_GET["feed_id"]); $action_id = db_escape_string($_GET["action_id"]); + $action_param = db_escape_string($_GET["action_param"]); $enabled = checkbox_to_sql_bool(db_escape_string($_GET["enabled"])); if (!$feed_id) { @@ -123,7 +133,8 @@ feed_id = $feed_id, action_id = '$action_id', filter_type = '$filter_type', - enabled = $enabled + enabled = $enabled, + action_param = '$action_param' WHERE id = '$filter_id' AND owner_uid = " . $_SESSION["uid"]); } @@ -148,6 +159,7 @@ $filter_type = db_escape_string(trim($_GET["filter_type"])); $feed_id = db_escape_string($_GET["feed_id"]); $action_id = db_escape_string($_GET["action_id"]); + $action_param = db_escape_string($_GET["action_param"]); if (!$regexp) return; @@ -159,10 +171,10 @@ $result = db_query($link, "INSERT INTO ttrss_filters (reg_exp,filter_type,owner_uid,feed_id, - action_id) + action_id, action_param) VALUES ('$regexp', '$filter_type','".$_SESSION["uid"]."', - $feed_id, '$action_id')"); + $feed_id, '$action_id', '$action_param')"); } } |