diff options
author | Andrew Dolgov <[email protected]> | 2007-03-05 13:50:46 +0100 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2007-03-05 13:50:46 +0100 |
commit | 4dccf1ed93948f6e75750c31ba6bb0abf053e52b (patch) | |
tree | fb071c51f25d2551e67b144405722fba655bf734 /modules | |
parent | 8497d2b976c320604929efd8055155380ebe3814 (diff) |
more i18n work
Diffstat (limited to 'modules')
-rw-r--r-- | modules/pref-feeds.php | 7 | ||||
-rw-r--r-- | modules/pref-filters.php | 52 | ||||
-rw-r--r-- | modules/pref-users.php | 19 |
3 files changed, 36 insertions, 42 deletions
diff --git a/modules/pref-feeds.php b/modules/pref-feeds.php index 1f5a9d9da..5a5d0f0e7 100644 --- a/modules/pref-feeds.php +++ b/modules/pref-feeds.php @@ -443,9 +443,9 @@ } if (subscribe_to_feed($link, $feed_url, $cat_id)) { - print format_notice(sprintf(__("Subscribed to <b>%s</b>."), $feed_url)); + print_notice(T_sprintf("Subscribed to <b>%s</b>.", $feed_url)); } else { - print format_warning(sprintf(__("Already subscribed to <b>%s</b>."), $feed_url)); + print_warning(T_sprintf("Already subscribed to <b>%s</b>.", $feed_url)); } if ($p_from != 'tt-rss') { @@ -547,7 +547,8 @@ } else { - print format_warning(sprintf(__("Category <b>$%s</b> already exists in the database."), $feed_cat)); + print_warning(T_sprintf("Category <b>$%s</b> already exists in the database.", + $feed_cat)); } } diff --git a/modules/pref-filters.php b/modules/pref-filters.php index e3447c1ab..1403464b1 100644 --- a/modules/pref-filters.php +++ b/modules/pref-filters.php @@ -148,49 +148,45 @@ enabled = $enabled, inverse = $inverse, action_param = '$action_param' - WHERE id = '$filter_id' AND owner_uid = " . $_SESSION["uid"]); + WHERE id = '$filter_id' AND owner_uid = " . $_SESSION["uid"]); + } if ($subop == "remove") { - if (!WEB_DEMO_MODE) { - - $ids = split(",", db_escape_string($_GET["ids"])); + $ids = split(",", db_escape_string($_GET["ids"])); - foreach ($ids as $id) { - db_query($link, "DELETE FROM ttrss_filters WHERE id = '$id' AND owner_uid = ". $_SESSION["uid"]); - - } + foreach ($ids as $id) { + db_query($link, "DELETE FROM ttrss_filters WHERE id = '$id' AND owner_uid = ". $_SESSION["uid"]); } } if ($subop == "add") { - if (!WEB_DEMO_MODE) { + $regexp = db_escape_string(trim($_GET["reg_exp"])); + $filter_type = db_escape_string(trim($_GET["filter_type"])); + $feed_id = db_escape_string($_GET["feed_id"]); + $action_id = db_escape_string($_GET["action_id"]); + $action_param = db_escape_string($_GET["action_param"]); - $regexp = db_escape_string(trim($_GET["reg_exp"])); - $filter_type = db_escape_string(trim($_GET["filter_type"])); - $feed_id = db_escape_string($_GET["feed_id"]); - $action_id = db_escape_string($_GET["action_id"]); - $action_param = db_escape_string($_GET["action_param"]); + $inverse = checkbox_to_sql_bool(db_escape_string($_GET["inverse"])); - $inverse = checkbox_to_sql_bool(db_escape_string($_GET["inverse"])); + if (!$regexp) return; - if (!$regexp) return; + if (!$feed_id) { + $feed_id = 'NULL'; + } else { + $feed_id = sprintf("'%s'", db_escape_string($feed_id)); + } - if (!$feed_id) { - $feed_id = 'NULL'; - } else { - $feed_id = sprintf("'%s'", db_escape_string($feed_id)); - } + $result = db_query($link, + "INSERT INTO ttrss_filters (reg_exp,filter_type,owner_uid,feed_id, + action_id, action_param, inverse) + VALUES + ('$regexp', '$filter_type','".$_SESSION["uid"]."', + $feed_id, '$action_id', '$action_param', $inverse)"); - $result = db_query($link, - "INSERT INTO ttrss_filters (reg_exp,filter_type,owner_uid,feed_id, - action_id, action_param, inverse) - VALUES - ('$regexp', '$filter_type','".$_SESSION["uid"]."', - $feed_id, '$action_id', '$action_param', $inverse)"); - } + print_notice(T_sprintf("Created filter <b>%s</b>", htmlspecialchars($regexp))); } if ($quiet) return; diff --git a/modules/pref-users.php b/modules/pref-users.php index be9660a34..fbd6d7762 100644 --- a/modules/pref-users.php +++ b/modules/pref-users.php @@ -68,14 +68,14 @@ $login = db_escape_string(trim($_GET["login"])); $uid = db_escape_string($_GET["id"]); - $access_level = sprintf("%d", $_GET["access_level"]); + $access_level = (int) $_GET["access_level"]; $email = db_escape_string(trim($_GET["email"])); $password = db_escape_string(trim($_GET["password"])); if ($password) { $pwd_hash = 'SHA1:' . sha1($password); $pass_query_part = "pwd_hash = '$pwd_hash', "; - print format_notice(sprintf(__('Changed password of user <b>%s</b>.'), $login)); + print_notice(T_sprintf('Changed password of user <b>%s</b>.', $login)); } else { $pass_query_part = ""; } @@ -120,21 +120,18 @@ $new_uid = db_fetch_result($result, 0, "id"); - print format_notice(sprintf(__("Added user <b>%s</b> - with password <b>%s</b>"), $login, $tmp_user_pwd)); + print_notice(T_sprintf("Added user <b>%s</b> with password <b>%s</b>", + $login, $tmp_user_pwd)); initialize_user($link, $new_uid); } else { - print format_warning(sprintf(__("Could not create user <b>%s</b>"), - $login)); + print_warning(T_sprintf("Could not create user <b>%s</b>", $login)); } } else { - print format_warning(sprintf(__("User <b>%s</b> already exists."), - $login)); - + print_warning(T_sprintf("User <b>%s</b> already exists.", $login)); } } } else if ($subop == "resetPass") { @@ -154,8 +151,8 @@ db_query($link, "UPDATE ttrss_users SET pwd_hash = '$pwd_hash' WHERE id = '$uid'"); - print format_notice(sprintf(__("Changed password of user <b>%s</b> - to <b>%s</b>"), $login, $tmp_user_pwd)); + print_notice(T_sprintf("Changed password of user <b>%s</b> + to <b>%s</b>", $login, $tmp_user_pwd)); if (MAIL_RESET_PASS && $email) { print " Notifying <b>$email</b>."; |