summaryrefslogtreecommitdiff
path: root/modules/backend-rpc.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2010-11-07 23:30:05 +0300
committerAndrew Dolgov <[email protected]>2010-11-07 23:30:05 +0300
commit5c7c7da9e12134ae2c4be1f60823e5440015f0ca (patch)
tree6480604220624b1b5633024115ee266e1ea00b3e /modules/backend-rpc.php
parent8b640f50e0bf933e95e315d3015f36cebb460a30 (diff)
allow adding cats from feed editor
Diffstat (limited to 'modules/backend-rpc.php')
-rw-r--r--modules/backend-rpc.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/modules/backend-rpc.php b/modules/backend-rpc.php
index fee93a586..4a82a888b 100644
--- a/modules/backend-rpc.php
+++ b/modules/backend-rpc.php
@@ -1094,6 +1094,31 @@
return;
}
+ if ($subop == "quickAddCat") {
+ print "<rpc-reply>";
+
+ $cat = db_escape_string($_REQUEST["cat"]);
+
+ add_feed_category($link, $cat);
+
+ $result = db_query($link, "SELECT id FROM ttrss_feed_categories WHERE
+ title = '$cat' AND owner_uid = " . $_SESSION["uid"]);
+
+ if (db_num_rows($result) == 1) {
+ $id = db_fetch_result($result, 0, "id");
+ } else {
+ $id = 0;
+ }
+
+ print "<payload><![CDATA[";
+ print_feed_cat_select($link, "cat_id", $id);
+ print "]]></payload>";
+
+ print "</rpc-reply>";
+
+ return;
+ }
+
print "<rpc-reply><error>Unknown method: $subop</error></rpc-reply>";
}
?>