]> git.wh0rd.org Git - tt-rss.git/commitdiff
do not base headlines label context submenu on feed tree labels category
authorAndrew Dolgov <noreply@fakecake.org>
Sun, 30 Jul 2017 08:55:30 +0000 (11:55 +0300)
committerAndrew Dolgov <noreply@fakecake.org>
Sun, 30 Jul 2017 08:55:30 +0000 (11:55 +0300)
classes/labels.php
include/functions.php
js/viewfeed.js

index 2ca623a32aad4072422ecbfb0e651bd41cd11759..e19a2967e3d51eb0471b655df8a06a21ad72e655 100644 (file)
@@ -36,7 +36,7 @@ class Labels
        static function get_all_labels($owner_uid)      {
                $rv = array();
 
-               $result = db_query("SELECT fg_color, bg_color, caption FROM ttrss_labels2 WHERE owner_uid = " . $owner_uid);
+               $result = db_query("SELECT id, fg_color, bg_color, caption FROM ttrss_labels2 WHERE owner_uid = " . $owner_uid);
 
                while ($line = db_fetch_assoc($result)) {
                        array_push($rv, $line);
index ba5a699b9a64cf9986330db93cf9f1dfa8644e50..dc2e9f64d31d17f9130cf464c36583fce12fa9d8 100644 (file)
                $params["icon_cross"] = base64_img("images/cross.png");
                $params["icon_indicator_white"] = base64_img("images/indicator_white.gif");
 
+               $params["labels"] = Labels::get_all_labels($_SESSION["uid"]);
+
                return $params;
        }
 
                $data['dep_ts'] = calculate_dep_timestamp();
                $data['reload_on_ts_change'] = !defined('_NO_RELOAD_ON_TS_CHANGE');
 
+               $data["labels"] = Labels::get_all_labels($_SESSION["uid"]);
 
                if (CHECK_FOR_UPDATES && !$disable_update_check && $_SESSION["last_version_check"] + 86400 + rand(-1000, 1000) < time()) {
                        $update_result = @check_for_update();
index 3e2f9775186eac46d7c507e4f5d2eb79a23d57f2..6a1e15c33a250ac568b02c9f5128da927e288482 100755 (executable)
@@ -1738,7 +1738,7 @@ function headlinesMenuCommon(menu) {
        }));
 
 
-       var labels = dijit.byId("feedTree").model.getItemsInCategory(-2);
+       var labels = getInitParam("labels");
 
        if (labels) {
 
@@ -1748,11 +1748,8 @@ function headlinesMenuCommon(menu) {
                var labelDelMenu = new dijit.Menu({ownerMenu: menu});
 
                labels.each(function (label) {
-                       var id = label.id[0];
-                       var bare_id = id.substr(id.indexOf(":") + 1);
-                       var name = label.name[0];
-
-                       bare_id = feed_to_label_id(bare_id);
+                       var bare_id = label.id;
+                       var name = label.caption;
 
                        labelAddMenu.addChild(new dijit.MenuItem({
                                label: name,