]> git.wh0rd.org Git - tt-rss.git/commitdiff
quickAddFilter: prefill current feed in the dialog
authorAndrew Dolgov <fox@fakecake.org>
Sun, 26 Aug 2012 12:54:47 +0000 (16:54 +0400)
committerAndrew Dolgov <fox@fakecake.org>
Sun, 26 Aug 2012 12:54:47 +0000 (16:54 +0400)
classes/dlg.php
js/functions.js

index 6a6dace24f1c632ad2d191ed3e65e984c024f61d..c540214a6ac163b0bd49aafcd5a763ca4e5da52f 100644 (file)
@@ -445,7 +445,8 @@ class Dlg extends Handler_Protected {
        }
 
        function quickAddFilter() {
-               $active_feed_id = db_escape_string($_REQUEST["param"]);
+               $active_feed_id = (int) db_escape_string($_REQUEST["feed"]);
+               $cat_filter = db_escape_string($_REQUEST["is_cat"]) == "true";
 
                print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"pref-filters\">";
                print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"quiet\" value=\"1\">";
@@ -497,7 +498,8 @@ class Dlg extends Handler_Protected {
                print __("in") . " ";
 
                print "<span id='filterDlg_feeds'>";
-               print_feed_select($this->link, "feed_id", $active_feed_id,
+               print_feed_select($this->link, "feed_id",
+                       $cat_filter ? "CAT:$active_feed_id" : $active_feed_id,
                        'dojoType="dijit.form.FilteringSelect"');
                print "</span>";
 
index 65d214ae57f847ef6297f215cdddf31f5941df7d..3aa73035908545232819beb04bd5ad7956949a59 100644 (file)
@@ -940,7 +940,14 @@ function quickAddFeed() {
 
 function quickAddFilter() {
        try {
-               var query = "backend.php?op=dlg&method=quickAddFilter";
+               var query = "";
+               if (!inPreferences()) {
+                       query = "backend.php?op=dlg&method=quickAddFilter&feed=" +
+                               param_escape(getActiveFeedId()) + "&is_cat=" +
+                               param_escape(activeFeedIsCat());
+               } else {
+                       query = "backend.php?op=dlg&method=quickAddFilter";
+               }
 
                if (dijit.byId("feedEditDlg"))
                        dijit.byId("feedEditDlg").destroyRecursive();