diff options
author | Andrew Dolgov <[email protected]> | 2006-08-17 05:54:57 +0100 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2006-08-17 05:54:57 +0100 |
commit | f156fd00ee99338d1824d20f65f0fe30d03c4f9e (patch) | |
tree | a7508b5bd911540c5755ff6284a79412ecbcf298 /backend.php | |
parent | 60a2080f9a886a26ac2e119031f807c8986de595 (diff) |
create label now uses dialog, code cleanups
Diffstat (limited to 'backend.php')
-rw-r--r-- | backend.php | 63 |
1 files changed, 54 insertions, 9 deletions
diff --git a/backend.php b/backend.php index 7155846b6..8b31297fb 100644 --- a/backend.php +++ b/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"]); |