From da1da2e4d8b3f17ac8f35817d4bb3d1f4b55fbbd Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 26 Aug 2012 16:54:47 +0400 Subject: [PATCH] quickAddFilter: prefill current feed in the dialog --- classes/dlg.php | 6 ++++-- js/functions.js | 9 ++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/classes/dlg.php b/classes/dlg.php index 6a6dace2..c540214a 100644 --- a/classes/dlg.php +++ b/classes/dlg.php @@ -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 ""; print ""; @@ -497,7 +498,8 @@ class Dlg extends Handler_Protected { print __("in") . " "; print ""; - 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 ""; diff --git a/js/functions.js b/js/functions.js index 65d214ae..3aa73035 100644 --- a/js/functions.js +++ b/js/functions.js @@ -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(); -- 2.39.5