summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2009-01-18 09:47:34 +0100
committerAndrew Dolgov <[email protected]>2009-01-18 09:47:34 +0100
commitb8a637f3d2eff88de1d2d76d9014cc0a4086d9d1 (patch)
tree28b2365df8d22ef5f15d6caa7e51e347ccd58ad8 /modules
parentceb30ba49d300d53a0693aba7e1f0e4c523aeedc (diff)
implement assign-to-label in subtoolbar
Diffstat (limited to 'modules')
-rw-r--r--modules/backend-rpc.php29
1 files changed, 29 insertions, 0 deletions
diff --git a/modules/backend-rpc.php b/modules/backend-rpc.php
index 4d65ee23e..691771f73 100644
--- a/modules/backend-rpc.php
+++ b/modules/backend-rpc.php
@@ -424,6 +424,35 @@
return;
}
+ if ($subop == "assignToLabel") {
+
+ $ids = split(",", db_escape_string($_REQUEST["ids"]));
+ $label_id = db_escape_string($_REQUEST["lid"]);
+
+ $label = label_find_caption($link, $label_id, $_SESSION["uid"]);
+
+ if ($label) {
+
+ foreach ($ids as $id) {
+ label_add_article($link, $id, $label, $_SESSION["uid"]);
+ }
+ }
+
+ print "<rpc-reply><counters>";
+
+ if ($label) {
+ getGlobalCounters($link);
+ getLabelCounters($link);
+ if (get_pref($link, 'ENABLE_FEED_CATS')) {
+ getCategoryCounters($link);
+ }
+ }
+
+ print "</counters></rpc-reply>";
+
+ return;
+ }
+
print "<rpc-reply><error>Unknown method: $subop</error></rpc-reply>";
}
?>