From: Andrew Dolgov Date: Wed, 15 Aug 2012 05:59:08 +0000 (+0400) Subject: pref_feeds: add missing methods to add/remove cats X-Git-Tag: 1.6.0~157 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=28537341efcbc9add611e4d5969a0f31ab0b2ea3;p=tt-rss.git pref_feeds: add missing methods to add/remove cats --- diff --git a/classes/pref_feeds.php b/classes/pref_feeds.php index bddf3218..71685fda 100644 --- a/classes/pref_feeds.php +++ b/classes/pref_feeds.php @@ -1290,6 +1290,19 @@ class Pref_Feeds extends Protected_Handler { db_query($this->link, "COMMIT"); } + function removeCat() { + $ids = split(",", db_escape_string($_REQUEST["ids"])); + foreach ($ids as $id) { + remove_feed_category($this->link, $id, $_SESSION["uid"]); + } + } + + function addCat() { + $feed_cat = db_escape_string(trim($_REQUEST["cat"])); + + add_feed_category($this->link, $feed_cat); + } + function index() { print "
"; diff --git a/js/prefs.js b/js/prefs.js index c0ad6a86..d351a7bc 100644 --- a/js/prefs.js +++ b/js/prefs.js @@ -1175,7 +1175,7 @@ function removeCategory(id, item) { var ok = confirm(__("Remove category %s? Any nested feeds would be placed into Uncategorized.").replace("%s", item.name)); if (ok) { - var query = "?op=pref-feeds&method=editCats&action=remove&ids="+ + var query = "?op=pref-feeds&method=removeCat&ids="+ param_escape(id); notify_progress("Removing category..."); @@ -1201,7 +1201,7 @@ function createCategory() { notify_progress("Creating category..."); - var query = "?op=pref-feeds&method=editCats&action=add&cat=" + + var query = "?op=pref-feeds&method=addCat&cat=" + param_escape(title); new Ajax.Request("backend.php", {