]> git.wh0rd.org - tt-rss.git/commitdiff
show label color indicators in pref-filters
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Fri, 31 Aug 2012 11:40:19 +0000 (15:40 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Fri, 31 Aug 2012 11:40:19 +0000 (15:40 +0400)
classes/pref/filters.php

index 2ed46435858266bbd4107dceefde1e0785667fa8..53f7d396a9c4be797f2d07aca22d1c845c846157 100644 (file)
@@ -109,6 +109,8 @@ class Pref_Filters extends Handler_Protected {
                $filter_search = $_SESSION["prefs_filter_search"];
 
                $result = db_query($this->link, "SELECT *,
+                       (SELECT action_param FROM ttrss_filters2_actions
+                               WHERE filter_id = ttrss_filters2.id ORDER BY id LIMIT 1) AS action_param,
                        (SELECT action_id FROM ttrss_filters2_actions
                                WHERE filter_id = ttrss_filters2.id ORDER BY id LIMIT 1) AS action_id,
                        (SELECT description FROM ttrss_filter_actions
@@ -153,6 +155,19 @@ class Pref_Filters extends Handler_Protected {
                                }
                        }
 
+                       if ($line['action_id'] == 7) {
+                               $label_result = db_query($this->link, "SELECT fg_color, bg_color
+                                       FROM ttrss_labels2 WHERE caption = '".db_escape_string($line['action_param'])."' AND
+                                               owner_uid = " . $_SESSION["uid"]);
+
+                               if (db_num_rows($label_result) > 0) {
+                                       $fg_color = db_fetch_result($label_result, 0, "fg_color");
+                                       $bg_color = db_fetch_result($label_result, 0, "bg_color");
+
+                                       $name[1] = "<span class=\"labelColorIndicator\" id=\"label-editor-indicator\" style='color : $fg_color; background-color : $bg_color; margin-right : 4px'>&alpha;</span>" . $name[1];
+                               }
+                       }
+
                        $filter = array();
                        $filter['id'] = 'FILTER:' . $line['id'];
                        $filter['bare_id'] = $line['id'];