mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2026-02-07 16:21:32 +00:00
create label now uses dialog, code cleanups
This commit is contained in:
63
backend.php
63
backend.php
@@ -2395,22 +2395,21 @@
|
||||
if (!WEB_DEMO_MODE) {
|
||||
|
||||
// no escaping is done here on purpose
|
||||
$exp = trim($_GET["exp"]);
|
||||
$sql_exp = trim($_GET["sql_exp"]);
|
||||
$description = db_escape_string($_GET["description"]);
|
||||
|
||||
$result = db_query($link,
|
||||
"INSERT INTO ttrss_labels (sql_exp,description,owner_uid)
|
||||
VALUES ('$exp', '$exp', '".$_SESSION["uid"]."')");
|
||||
VALUES ('$sql_exp', '$description', '".$_SESSION["uid"]."')");
|
||||
}
|
||||
}
|
||||
|
||||
print "<div class=\"prefGenericAddBox\">
|
||||
<input size=\"40\"
|
||||
onkeyup=\"toggleSubmitNotEmpty(this, 'label_create_btn')\"
|
||||
id=\"ladd_expr\"> ";
|
||||
|
||||
print "<div class=\"prefGenericAddBox\">";
|
||||
|
||||
print"<input type=\"submit\" class=\"button\"
|
||||
disabled=\"true\" id=\"label_create_btn\"
|
||||
onclick=\"javascript:addLabel()\" value=\"Create label\"></div>";
|
||||
id=\"label_create_btn\"
|
||||
onclick=\"return displayDlg('quickAddLabel', false)\"
|
||||
value=\"Create label\"></div>";
|
||||
|
||||
$result = db_query($link, "SELECT
|
||||
id,sql_exp,description
|
||||
@@ -2665,6 +2664,52 @@
|
||||
|
||||
}
|
||||
|
||||
if ($id == "quickAddLabel") {
|
||||
print "<div id=\"infoBoxTitle\">Create label</div>";
|
||||
print "<div class=\"infoBoxContents\">";
|
||||
|
||||
print "<form id=\"label_edit_form\">";
|
||||
|
||||
print "<input type=\"hidden\" name=\"op\" value=\"pref-labels\">";
|
||||
print "<input type=\"hidden\" name=\"subop\" value=\"add\">";
|
||||
|
||||
print "<table width='100%'>";
|
||||
|
||||
print "<tr><td>Caption:</td>
|
||||
<td><input onkeypress=\"return filterCR(event)\"
|
||||
onkeyup=\"toggleSubmitNotEmpty(this, 'infobox_submit')\"
|
||||
name=\"description\" class=\"iedit\">";
|
||||
|
||||
print "</td></tr>";
|
||||
|
||||
print "<tr><td colspan=\"2\">
|
||||
<p>SQL Expression:</p>";
|
||||
|
||||
print "<textarea onkeyup=\"toggleSubmitNotEmpty(this, 'infobox_submit')\"
|
||||
rows=\"4\" name=\"sql_exp\" class=\"iedit\"></textarea>";
|
||||
|
||||
print "</td></tr></table>";
|
||||
|
||||
print "</form>";
|
||||
|
||||
print "<div style=\"display : none\" id=\"label_test_result\"></div>";
|
||||
|
||||
print "<div align='right'>";
|
||||
|
||||
print "<input type=\"submit\" onclick=\"labelTest()\" value=\"Test\">
|
||||
";
|
||||
|
||||
print "<input type=\"submit\"
|
||||
id=\"infobox_submit\"
|
||||
disabled=\"true\"
|
||||
class=\"button\" onclick=\"return addLabel()\"
|
||||
value=\"Create\"> ";
|
||||
|
||||
print "<input class=\"button\"
|
||||
type=\"submit\" onclick=\"return labelEditCancel()\"
|
||||
value=\"Cancel\">";
|
||||
}
|
||||
|
||||
if ($id == "quickAddFilter") {
|
||||
|
||||
$active_feed_id = db_escape_string($_GET["param"]);
|
||||
|
||||
Reference in New Issue
Block a user