From b8a637f3d2eff88de1d2d76d9014cc0a4086d9d1 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 18 Jan 2009 09:47:34 +0100 Subject: implement assign-to-label in subtoolbar --- modules/backend-rpc.php | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'modules/backend-rpc.php') 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 ""; + + if ($label) { + getGlobalCounters($link); + getLabelCounters($link); + if (get_pref($link, 'ENABLE_FEED_CATS')) { + getCategoryCounters($link); + } + } + + print ""; + + return; + } + print "Unknown method: $subop"; } ?> -- cgit v1.2.3-54-g00ecf