summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-02-19 15:03:48 +0300
committerAndrew Dolgov <[email protected]>2021-02-19 15:03:48 +0300
commit131f34648d8b8fa8388f619c144480e06f5f9921 (patch)
treeffd368ae79c68d59587cf0cc308e8c5185fb3c9f /classes
parent660a1bbe011fef5f0fa6bb0af43521fed7598cc7 (diff)
render headline labels on the client
Diffstat (limited to 'classes')
-rwxr-xr-xclasses/article.php11
-rwxr-xr-xclasses/feeds.php6
2 files changed, 4 insertions, 13 deletions
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)]);
}
}
diff --git a/classes/feeds.php b/classes/feeds.php
index 04553451c..1e1b20d93 100755
--- a/classes/feeds.php
+++ b/classes/feeds.php
@@ -216,11 +216,7 @@ class Feeds extends Handler_Protected {
if (!is_array($labels)) $labels = Article::_get_labels($id);
- $labels_str = "<span class=\"HLLCTR-$id\">";
- $labels_str .= Article::_format_labels_html($labels);
- $labels_str .= "</span>";
-
- $line["labels"] = $labels_str;
+ $line["labels"] = Article::_get_labels($id);
if (count($topmost_article_ids) < 3) {
array_push($topmost_article_ids, $id);