]> git.wh0rd.org - tt-rss.git/blobdiff - modules/pref-labels.php
allow adding labels on the fly
[tt-rss.git] / modules / pref-labels.php
index a744b9f6a893c37300992aa2700fd43aa210ddff..d9cacecc366b52e39e63a184f910b1e4c37e4605 100644 (file)
                }
 
                if ($subop == "add") {
-
                        $caption = db_escape_string($_REQUEST["caption"]);
+                       $output = db_escape_string($_REQUEST["output"]);
 
                        if ($caption) {
 
                                if (label_create($link, $caption)) {
-                                       print T_sprintf("Created label <b>%s</b>", htmlspecialchars($caption));
+                                       if (!$output) {
+                                               print T_sprintf("Created label <b>%s</b>", htmlspecialchars($caption));
+                                       }
                                }
 
+                               if ($output == "select") {
+                                       header("Content-Type: text/xml");
+
+                                       print "<rpc-reply><payload><![CDATA[";
+
+                                       print_label_select($link, "select_label", 
+                                               $caption, "");
+
+                                       print "]]></payload></rpc-reply>";
+                               }
                        }
 
                        return;