diff options
Diffstat (limited to 'include')
| -rwxr-xr-x | include/functions.php | 34 | ||||
| -rwxr-xr-x | include/login_form.php | 3 | ||||
| -rwxr-xr-x | include/sanity_check.php | 7 |
3 files changed, 28 insertions, 16 deletions
diff --git a/include/functions.php b/include/functions.php index a1aeb7135..8c0654f3c 100755 --- a/include/functions.php +++ b/include/functions.php @@ -141,7 +141,6 @@ } _bindtextdomain("messages", "locale"); - _textdomain("messages"); _bind_textdomain_codeset("messages", "UTF-8"); } @@ -1981,7 +1980,7 @@ return true; } - function add_feed_category($feed_cat, $parent_cat_id = false) { + function add_feed_category($feed_cat, $parent_cat_id = false, $order_id = 0) { if (!$feed_cat) return false; @@ -2004,9 +2003,9 @@ if (!$sth->fetch()) { - $sth = $pdo->prepare("INSERT INTO ttrss_feed_categories (owner_uid,title,parent_cat) - VALUES (?, ?, ?)"); - $sth->execute([$_SESSION['uid'], $feed_cat, $parent_cat_id]); + $sth = $pdo->prepare("INSERT INTO ttrss_feed_categories (owner_uid,title,parent_cat,order_id) + VALUES (?, ?, ?, ?)"); + $sth->execute([$_SESSION['uid'], $feed_cat, $parent_cat_id, (int)$order_id]); if (!$tr_in_progress) $pdo->commit(); @@ -2403,18 +2402,23 @@ return __((parseInt(n) > 1) ? msg2 : msg1); }'; - $l10n = _get_reader(); + global $text_domains; - for ($i = 0; $i < $l10n->total; $i++) { - $orig = $l10n->get_original_string($i); - if(strpos($orig, "\000") !== FALSE) { // Plural forms - $key = explode(chr(0), $orig); - print T_js_decl($key[0], _ngettext($key[0], $key[1], 1)); // Singular - print T_js_decl($key[1], _ngettext($key[0], $key[1], 2)); // Plural - } else { - $translation = __($orig); - print T_js_decl($orig, $translation); + foreach (array_keys($text_domains) as $domain) { + $l10n = _get_reader($domain); + + for ($i = 0; $i < $l10n->total; $i++) { + $orig = $l10n->get_original_string($i); + if(strpos($orig, "\000") !== FALSE) { // Plural forms + $key = explode(chr(0), $orig); + print T_js_decl($key[0], _ngettext($key[0], $key[1], 1)); // Singular + print T_js_decl($key[1], _ngettext($key[0], $key[1], 2)); // Plural + } else { + $translation = _dgettext($domain,$orig); + print T_js_decl($orig, $translation); + } } + } } diff --git a/include/login_form.php b/include/login_form.php index 68ebcef29..6c6aaf8cf 100755 --- a/include/login_form.php +++ b/include/login_form.php @@ -1,4 +1,5 @@ <?php startup_gettext(); ?> +<!DOCTYPE html> <html> <head> <title>Tiny Tiny RSS : Login</title> @@ -60,7 +61,7 @@ function bwLimitChange(elem) { } </script> -<?php $return = urlencode($_SERVER["REQUEST_URI"]) ?> +<?php $return = urlencode(make_self_url()) ?> <div class="container"> diff --git a/include/sanity_check.php b/include/sanity_check.php index c2ecee368..654c83e38 100755 --- a/include/sanity_check.php +++ b/include/sanity_check.php @@ -14,6 +14,12 @@ * If you come crying when stuff inevitably breaks, you will be mocked and told * to get out. */ + function make_self_url() { + $proto = is_server_https() ? 'https' : 'http'; + + return $proto . '://' . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]; + } + function make_self_url_path() { $proto = is_server_https() ? 'https' : 'http'; $url_path = $proto . '://' . $_SERVER["HTTP_HOST"] . parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH); @@ -176,6 +182,7 @@ } if (count($errors) > 0 && $_SERVER['REQUEST_URI']) { ?> + <!DOCTYPE html> <html> <head> <title>Startup failed</title> |