]> git.wh0rd.org Git - tt-rss.git/commitdiff
pref_feeds: add missing methods to add/remove cats
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Wed, 15 Aug 2012 05:59:08 +0000 (09:59 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Wed, 15 Aug 2012 05:59:08 +0000 (09:59 +0400)
classes/pref_feeds.php
js/prefs.js

index bddf321852f268a641ee1f782ebb5ae87d4ab3b5..71685fda77a24a5c2867cb9ce28d529f71f6cc4a 100644 (file)
@@ -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 "<div dojoType=\"dijit.layout.AccordionContainer\" region=\"center\">";
index c0ad6a86e634d99d6bb58b5fa67e6ff455f8dfed..d351a7bc3c3b2fc9dcbdfc5d8bad272c930e1abb 100644 (file)
@@ -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", {