From 1c31e1908a1c8d8e46df83a756f2a5ad445ceb70 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 9 Nov 2010 01:04:00 +0300 Subject: allow adding labels on the fly --- modules/pref-filters.php | 5 ++++- modules/pref-labels.php | 16 ++++++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) (limited to 'modules') diff --git a/modules/pref-filters.php b/modules/pref-filters.php index f3ca8e4cb..c629f9c18 100644 --- a/modules/pref-filters.php +++ b/modules/pref-filters.php @@ -523,7 +523,8 @@ $result = db_query($link, "SELECT caption FROM ttrss_labels2 WHERE owner_uid = '".$_SESSION["uid"]."' ORDER BY caption"); - print ""; while ($line = db_fetch_assoc($result)) { @@ -533,6 +534,8 @@ } + print ""; + print ""; diff --git a/modules/pref-labels.php b/modules/pref-labels.php index a744b9f6a..d9cacecc3 100644 --- a/modules/pref-labels.php +++ b/modules/pref-labels.php @@ -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 %s", htmlspecialchars($caption)); + if (!$output) { + print T_sprintf("Created label %s", htmlspecialchars($caption)); + } } + if ($output == "select") { + header("Content-Type: text/xml"); + + print ""; + } } return; -- cgit v1.2.3-54-g00ecf