]> git.wh0rd.org - tt-rss.git/blobdiff - modules/pref-labels.php
tmp color-ops toolbar (2)
[tt-rss.git] / modules / pref-labels.php
index 1c8fd02ada3da2519e32d0cdb1a89c4f88c63ee8..162592625df78b3deff732765c330644099f51fb 100644 (file)
@@ -3,6 +3,19 @@
 
                $subop = $_GET["subop"];
 
+               if ($subop == "color-set") {
+                       $kind = db_escape_string($_REQUEST["kind"]);
+                       $ids = split(',', db_escape_string($_REQUEST["ids"]));
+                       $color = db_escape_string($_REQUEST["color"]);
+
+                       foreach ($ids as $id) {
+                               db_query($link, "UPDATE ttrss_labels2 SET
+                                       ${kind}_color = '$color' WHERE id = '$id'
+                                       AND owner_uid = " . $_SESSION["uid"]);                  
+                       }
+
+               }
+
                if ($subop == "save") {
 
                        $id = db_escape_string($_REQUEST["id"]);
        
                        print "<p id=\"labelOpToolbar\">";
 
-                       print "<div style='float : right'>";
+                       print "<input type=\"submit\" class=\"button\" disabled=\"true\"
+                               onclick=\"javascript:removeSelectedLabels()\" value=\"".__('Remove')."\">";
+
+                       print "&nbsp;&nbsp;";
                        print __("Color:");
-                       print " <input type=\"submit\" class=\"button\" disabled=\"true\"
-                               onclick=\"\" value=\"".__('Fg')."\">&nbsp;";
+                       print "&nbsp;<input type=\"submit\" class=\"button\" disabled=\"true\"
+                               onclick=\"labelColorSet('fg')\" value=\"".__('Fg')."\">&nbsp;";
                        print "<input type=\"submit\" class=\"button\" disabled=\"true\"
-                               onclick=\"\" value=\"".__('Bg')."\">&nbsp;";
+                               onclick=\"labelColorSet('bg')\" value=\"".__('Bg')."\">&nbsp;";
                        print "<input type=\"submit\" class=\"button\" disabled=\"true\"
-                               onclick=\"\" value=\"".__('Clear')."\">";
+                               onclick=\"labelColorReset()\" value=\"".__('Clear')."\">";
 
-                       print "</div>";
-
-                       print "<input type=\"submit\" class=\"button\" disabled=\"true\"
-                               onclick=\"javascript:removeSelectedLabels()\" value=\"".__('Remove')."\">";
                        print "</p>";
 
                } else {