summaryrefslogtreecommitdiff
path: root/backend.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2005-12-09 20:48:13 +0100
committerAndrew Dolgov <[email protected]>2005-12-09 20:48:13 +0100
commita24f525cce32a6515532ac9392a5b02838ff82be (patch)
treef19d8acaf7f0fb7e7e5a0fa97c206c13204d2830 /backend.php
parent3820a960c6cd28c61a43d88add853c3b0b4c9932 (diff)
quick action to add filter, misc backend improvements
Diffstat (limited to 'backend.php')
-rw-r--r--backend.php71
1 files changed, 71 insertions, 0 deletions
diff --git a/backend.php b/backend.php
index b1c57c3a9..a31afb61b 100644
--- a/backend.php
+++ b/backend.php
@@ -1268,6 +1268,7 @@
if ($op == "pref-feeds") {
$subop = $_GET["subop"];
+ $quiet = $_GET["quiet"];
if ($subop == "editSave") {
$feed_title = db_escape_string($_GET["t"]);
@@ -1442,6 +1443,8 @@
}
+ if ($quiet) return;
+
// print "<h3>Edit Feeds</h3>";
$result = db_query($link, "SELECT id,title,feed_url,last_error
@@ -1896,6 +1899,7 @@
if ($op == "pref-filters") {
$subop = $_GET["subop"];
+ $quiet = $_GET["quiet"];
if ($subop == "editSave") {
@@ -1960,6 +1964,8 @@
}
}
+ if ($quiet) return;
+
$result = db_query($link, "SELECT description
FROM ttrss_filter_types ORDER BY description");
@@ -2529,6 +2535,71 @@
}
+ if ($id == "quickAddFilter") {
+
+ $result = db_query($link, "SELECT description
+ FROM ttrss_filter_types ORDER BY description");
+
+ $filter_types = array();
+
+ while ($line = db_fetch_assoc($result)) {
+ array_push($filter_types, $line["description"]);
+ }
+
+ print "<table>";
+
+ print "<tr><td>Match:</td><td><input id=\"fadd_regexp\" size=\"40\">&nbsp;";
+
+ print_select("fadd_match", "Title", $filter_types);
+
+ print "</td></tr>";
+ print "<tr><td>Feed:</td><td><select id=\"fadd_feed\">";
+
+ print "<option selected id=\"0\">All feeds</option>";
+
+ $result = db_query($link, "SELECT id,title FROM ttrss_feeds
+ WHERE owner_uid = ".$_SESSION["uid"]." ORDER BY title");
+
+ if (db_num_rows($result) > 0) {
+ print "<option disabled>--------</option>";
+ }
+
+ while ($line = db_fetch_assoc($result)) {
+ if ($param == $line["id"]) {
+ $selected = "selected";
+ } else {
+ $selected = "";
+ }
+ printf("<option id='%d' %s>%s</option>", $line["id"], $selected, $line["title"]);
+ }
+
+ print "</select></td></tr>";
+
+ print "<tr><td>Action:</td>";
+
+ print "<td><select id=\"fadd_action\">";
+
+ $result = db_query($link, "SELECT id,description FROM ttrss_filter_actions
+ ORDER BY name");
+
+ while ($line = db_fetch_assoc($result)) {
+ printf("<option id='%d'>%s</option>", $line["id"], $line["description"]);
+ }
+
+ print "</select>";
+
+ print "</td></tr><tr><td colspan=\"2\" align=\"right\">";
+
+ print "<input type=\"submit\"
+ class=\"button\" onclick=\"javascript:qaddFilter()\"
+ value=\"Add filter\"> ";
+
+ print "<input class=\"button\"
+ type=\"submit\" onclick=\"javascript:closeDlg()\"
+ value=\"Close\">";
+
+ print "</td></tr></table>";
+ }
}
// update feeds of all users, may be used anonymously