]> git.wh0rd.org - tt-rss.git/commitdiff
prefs: display label color indicators in filters list
authorAndrew Dolgov <fox@bah.org.ru>
Thu, 12 Feb 2009 18:54:07 +0000 (21:54 +0300)
committerAndrew Dolgov <fox@bah.org.ru>
Thu, 12 Feb 2009 18:54:07 +0000 (21:54 +0300)
modules/pref-filters.php

index f2e3832e2c0cd7eb4fca056d30284468fe5cecf0..e8e1cd60e4ebf6eee1027748aa54812c433ee6e7 100644 (file)
                                $filter_params = array(
                                        "before" => __("before"),
                                        "after" => __("after"));
-       
+
+                               if ($line["action_name"] == 'label') {
+
+                                       $tmp_result = db_query($link, "SELECT fg_color, bg_color
+                                               FROM ttrss_labels2 WHERE caption = '".
+                                                       db_escape_string($line["action_param"])."' AND
+                                                       owner_uid = " . $_SESSION["uid"]);
+
+                                       $fg_color = db_fetch_result($tmp_result, 0, "fg_color");
+                                       $bg_color = db_fetch_result($tmp_result, 0, "bg_color");
+
+                                       $tmp = "<div class='labelColorIndicator' id='LICID-$id' 
+                                               style='color : $fg_color; background-color : $bg_color'>
+                                               &alpha;";
+                                       $tmp .= "</div>";
+
+                                       $line["action_param"] = "$tmp " . $line["action_param"];
+                               }
+
                                if ($line["filter_type"] == 5) {
 
                                        if (!strtotime($line["reg_exp"])) {