mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2026-01-01 07:19:15 +00:00
allow adding labels on the fly
This commit is contained in:
@@ -523,7 +523,8 @@
|
||||
$result = db_query($link, "SELECT caption FROM ttrss_labels2
|
||||
WHERE owner_uid = '".$_SESSION["uid"]."' ORDER BY caption");
|
||||
|
||||
print "<select name=\"$name\" style=\"$style\">";
|
||||
print "<select default=\"$value\" name=\"$name\" style=\"$style\"
|
||||
onchange=\"labelSelectOnChange(this)\" >";
|
||||
|
||||
while ($line = db_fetch_assoc($result)) {
|
||||
|
||||
@@ -533,6 +534,8 @@
|
||||
|
||||
}
|
||||
|
||||
print "<option value=\"ADD_LABEL\">" .__("Add label...") . "</option>";
|
||||
|
||||
print "</select>";
|
||||
|
||||
|
||||
|
||||
@@ -93,15 +93,27 @@
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user