]> git.wh0rd.org - tt-rss.git/blobdiff - classes/pref/labels.php
move label stuff to Labels class
[tt-rss.git] / classes / pref / labels.php
index a928dd0171dc940130e74ec7e4796d5f034e280a..5720a1f4b8303ebfd5a9fec940303356e0e1f787 100644 (file)
@@ -15,9 +15,9 @@ class Pref_Labels extends Handler_Protected {
 
                $line = $this->dbh->fetch_assoc($result);
 
-               print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"id\" value=\"$label_id\">";
-               print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"pref-labels\">";
-               print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"save\">";
+               print_hidden("id", "$label_id");
+               print_hidden("op", "pref-labels");
+               print_hidden("method", "save");
 
                print "<div class=\"dlgSec\">".__("Caption")."</div>";
 
@@ -136,7 +136,7 @@ class Pref_Labels extends Handler_Protected {
                                        AND owner_uid = " . $_SESSION["uid"]);
                        }
 
-                       $caption = $this->dbh->escape_string(label_find_caption($id, $_SESSION["uid"]));
+                       $caption = $this->dbh->escape_string(Labels::find_caption($id, $_SESSION["uid"]));
 
                        /* Remove cached data */
 
@@ -156,7 +156,7 @@ class Pref_Labels extends Handler_Protected {
                                fg_color = '', bg_color = '' WHERE id = '$id'
                                AND owner_uid = " . $_SESSION["uid"]);
 
-                       $caption = $this->dbh->escape_string(label_find_caption($id, $_SESSION["uid"]));
+                       $caption = $this->dbh->escape_string(Labels::find_caption($id, $_SESSION["uid"]));
 
                        /* Remove cached data */
 
@@ -216,7 +216,7 @@ class Pref_Labels extends Handler_Protected {
                $ids = explode(",", $this->dbh->escape_string($_REQUEST["ids"]));
 
                foreach ($ids as $id) {
-                       label_remove($id, $_SESSION["uid"]);
+                       Labels::remove($id, $_SESSION["uid"]);
                }
 
        }
@@ -227,7 +227,7 @@ class Pref_Labels extends Handler_Protected {
 
                if ($caption) {
 
-                       if (label_create($caption)) {
+                       if (Labels::create($caption)) {
                                if (!$output) {
                                        print T_sprintf("Created label <b>%s</b>", htmlspecialchars($caption));
                                }
@@ -250,20 +250,6 @@ class Pref_Labels extends Handler_Protected {
 
        function index() {
 
-               $sort = $this->dbh->escape_string($_REQUEST["sort"]);
-
-               if (!$sort || $sort == "undefined") {
-                       $sort = "caption";
-               }
-
-               $label_search = $this->dbh->escape_string($_REQUEST["search"]);
-
-               if (array_key_exists("search", $_REQUEST)) {
-                       $_SESSION["prefs_label_search"] = $label_search;
-               } else {
-                       $label_search = $_SESSION["prefs_label_search"];
-               }
-
                print "<div id=\"pref-label-wrap\" dojoType=\"dijit.layout.BorderContainer\" gutters=\"false\">";
                print "<div id=\"pref-label-header\" dojoType=\"dijit.layout.ContentPane\" region=\"top\">";
                print "<div id=\"pref-label-toolbar\" dojoType=\"dijit.Toolbar\">";
@@ -319,13 +305,10 @@ class Pref_Labels extends Handler_Protected {
 
                print "</div>"; #pane
 
-               global $pluginhost;
-               $pluginhost->run_hooks($pluginhost::HOOK_PREFS_TAB,
+               PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_TAB,
                        "hook_prefs_tab", "prefLabels");
 
                print "</div>"; #container
 
        }
-}
-
-?>
+}
\ No newline at end of file