From 131f34648d8b8fa8388f619c144480e06f5f9921 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 19 Feb 2021 15:03:48 +0300 Subject: render headline labels on the client --- classes/article.php | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'classes/article.php') diff --git a/classes/article.php b/classes/article.php index 91fc0c11a..8efa9088c 100755 --- a/classes/article.php +++ b/classes/article.php @@ -292,22 +292,17 @@ class Article extends Handler_Protected { $label = Labels::find_caption($label_id, $_SESSION["uid"]); - $reply["info-for-headlines"] = array(); + $reply["labels-for"] = []; if ($label) { - foreach ($ids as $id) { - if ($assign) Labels::add_article($id, $label, $_SESSION["uid"]); else Labels::remove_article($id, $label, $_SESSION["uid"]); - $labels = $this->_get_labels($id, $_SESSION["uid"]); - - array_push($reply["info-for-headlines"], - array("id" => $id, "labels" => $this->_format_labels_html($labels))); - + array_push($reply["labels-for"], + ["id" => (int)$id, "labels" => $this->_get_labels($id)]); } } -- cgit v1.2.3-54-g00ecf