From 5e6f933a322fed7b6818955532bb1b41d1248383 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 5 Mar 2007 14:45:34 +0100 Subject: [PATCH] more i18n work, add some report notices --- functions.js | 8 +++++--- modules/popup-dialog.php | 21 +++++++++++++++++---- modules/pref-feeds.php | 7 ++----- modules/pref-filters.php | 12 ++++++++++-- modules/pref-labels.php | 28 ++++++++++++++++++---------- 5 files changed, 52 insertions(+), 24 deletions(-) diff --git a/functions.js b/functions.js index 72011568..7442daa6 100644 --- a/functions.js +++ b/functions.js @@ -1343,7 +1343,9 @@ function infobox_submit_callback() { } } catch (e) { } -// notify_info(xmlhttp.responseText); + if (xmlhttp.responseText) { + notify_info(xmlhttp.responseText); + } } } @@ -1364,7 +1366,7 @@ function infobox_callback() { } } -function qaddFilter() { +function addFilter() { if (!xmlhttp_ready(xmlhttp)) { printLockingError(); @@ -1400,7 +1402,7 @@ function isValidURL(s) { return s.match("http://") != null || s.match("https://") != null || s.match("feed://") != null; } -function qafAdd() { +function qaddFeed() { if (!xmlhttp_ready(xmlhttp)) { printLockingError(); diff --git a/modules/popup-dialog.php b/modules/popup-dialog.php index 6ac80be7..8fe1ac4b 100644 --- a/modules/popup-dialog.php +++ b/modules/popup-dialog.php @@ -36,6 +36,7 @@ print ""; + return; } if ($id == "quickAddFeed") { @@ -52,7 +53,7 @@ print ""; @@ -69,10 +70,12 @@ print "
+ type=\"submit\" onclick=\"return qaddFeed()\" value=\"".__('Subscribe')."\">
"; + + return; } if ($id == "search") { @@ -153,6 +156,8 @@ print ""; + return; + } if ($id == "quickAddLabel") { @@ -200,6 +205,8 @@ print ""; + + return; } if ($id == "quickAddFilter") { @@ -279,7 +286,7 @@ print " "; print "
Feed URL:
"; + return; } if ($id == "feedUpdateErrors") { @@ -379,8 +387,13 @@ print ""; + return; } - print ""; + print "
Internal Error
+
+

Unknown dialog $id

+
"; + } ?> diff --git a/modules/pref-feeds.php b/modules/pref-feeds.php index 5a5d0f0e..57a224eb 100644 --- a/modules/pref-feeds.php +++ b/modules/pref-feeds.php @@ -750,9 +750,8 @@ "; - - print "
- @@ -765,8 +764,6 @@ onclick=\"javascript:browseFeeds()\" value=\"".__('Top 25')."\">"; } - print "
"; - $feeds_sort = db_escape_string($_GET["sort"]); if (!$feeds_sort || $feeds_sort == "undefined") { diff --git a/modules/pref-filters.php b/modules/pref-filters.php index 1403464b..57432955 100644 --- a/modules/pref-filters.php +++ b/modules/pref-filters.php @@ -149,7 +149,11 @@ inverse = $inverse, action_param = '$action_param' WHERE id = '$filter_id' AND owner_uid = " . $_SESSION["uid"]); - + + if (db_affected_rows($link, $result) != 0) { + print_notice(T_sprintf("Saved filter %s", htmlspecialchars($reg_exp))); + } + } if ($subop == "remove") { @@ -186,7 +190,11 @@ ('$regexp', '$filter_type','".$_SESSION["uid"]."', $feed_id, '$action_id', '$action_param', $inverse)"); - print_notice(T_sprintf("Created filter %s", htmlspecialchars($regexp))); + if (db_affected_rows($link, $result) != 0) { + print T_sprintf("Created filter %s", htmlspecialchars($regexp)); + } + + return; } if ($quiet) return; diff --git a/modules/pref-labels.php b/modules/pref-labels.php index ccd669fc..c07d6132 100644 --- a/modules/pref-labels.php +++ b/modules/pref-labels.php @@ -153,6 +153,11 @@ sql_exp = '$sql_exp', description = '$descr' WHERE id = '$label_id'"); + + if (db_affected_rows($link, $result) != 0) { + print_notice(T_sprintf("Saved label %s", htmlspecialchars($descr))); + } + } if ($subop == "remove") { @@ -169,19 +174,22 @@ } if ($subop == "add") { - - if (!WEB_DEMO_MODE) { - // no escaping is done here on purpose - $sql_exp = trim($_GET["sql_exp"]); - $description = db_escape_string($_GET["description"]); + // no escaping is done here on purpose + $sql_exp = trim($_GET["sql_exp"]); + $description = db_escape_string($_GET["description"]); - if (!$sql_exp || !$description) return; + if (!$sql_exp || !$description) return; - $result = db_query($link, - "INSERT INTO ttrss_labels (sql_exp,description,owner_uid) - VALUES ('$sql_exp', '$description', '".$_SESSION["uid"]."')"); - } + $result = db_query($link, + "INSERT INTO ttrss_labels (sql_exp,description,owner_uid) + VALUES ('$sql_exp', '$description', '".$_SESSION["uid"]."')"); + + if (db_affected_rows($link, $result) != 0) { + print T_sprintf("Created label %s", htmlspecialchars($description)); + } + + return; } $sort = db_escape_string($_GET["sort"]); -- 2.39.5