diff options
Diffstat (limited to 'app')
| -rwxr-xr-x | app/Controllers/configureController.php | 1 | ||||
| -rw-r--r-- | app/Controllers/userController.php | 1 | ||||
| -rw-r--r-- | app/FreshRSS.php | 3 | ||||
| -rw-r--r-- | app/Models/UserConfiguration.php | 1 | ||||
| -rw-r--r-- | app/i18n/cz/conf.php | 1 | ||||
| -rw-r--r-- | app/i18n/de/conf.php | 1 | ||||
| -rw-r--r-- | app/i18n/el/conf.php | 1 | ||||
| -rw-r--r-- | app/i18n/en-us/conf.php | 1 | ||||
| -rw-r--r-- | app/i18n/en/conf.php | 1 | ||||
| -rwxr-xr-x | app/i18n/es/conf.php | 1 | ||||
| -rw-r--r-- | app/i18n/fr/conf.php | 1 | ||||
| -rw-r--r-- | app/i18n/he/conf.php | 1 | ||||
| -rw-r--r-- | app/i18n/id/conf.php | 1 | ||||
| -rw-r--r-- | app/i18n/it/conf.php | 1 | ||||
| -rw-r--r-- | app/i18n/ja/conf.php | 1 | ||||
| -rw-r--r-- | app/i18n/ko/conf.php | 1 | ||||
| -rw-r--r-- | app/i18n/nl/conf.php | 1 | ||||
| -rw-r--r-- | app/i18n/oc/conf.php | 1 | ||||
| -rw-r--r-- | app/i18n/pl/conf.php | 1 | ||||
| -rw-r--r-- | app/i18n/pt-br/conf.php | 1 | ||||
| -rw-r--r-- | app/i18n/ru/conf.php | 1 | ||||
| -rw-r--r-- | app/i18n/sk/conf.php | 1 | ||||
| -rw-r--r-- | app/i18n/tr/conf.php | 1 | ||||
| -rw-r--r-- | app/i18n/zh-cn/conf.php | 1 | ||||
| -rw-r--r-- | app/i18n/zh-tw/conf.php | 1 | ||||
| -rw-r--r-- | app/views/auth/register.phtml | 12 | ||||
| -rw-r--r-- | app/views/configure/display.phtml | 19 | ||||
| -rw-r--r-- | app/views/user/manage.phtml | 16 |
28 files changed, 72 insertions, 2 deletions
diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php index 613bacade..926ab2272 100755 --- a/app/Controllers/configureController.php +++ b/app/Controllers/configureController.php @@ -42,6 +42,7 @@ class FreshRSS_configure_Controller extends FreshRSS_ActionController { public function displayAction() { if (Minz_Request::isPost()) { FreshRSS_Context::$user_conf->language = Minz_Request::param('language', 'en'); + FreshRSS_Context::$user_conf->timezone = Minz_Request::param('timezone', ''); FreshRSS_Context::$user_conf->theme = Minz_Request::param('theme', FreshRSS_Themes::$defaultTheme); FreshRSS_Context::$user_conf->content_width = Minz_Request::param('content_width', 'thin'); FreshRSS_Context::$user_conf->topline_read = Minz_Request::param('topline_read', false); diff --git a/app/Controllers/userController.php b/app/Controllers/userController.php index 06dbab9fa..55b4ca7cb 100644 --- a/app/Controllers/userController.php +++ b/app/Controllers/userController.php @@ -344,6 +344,7 @@ class FreshRSS_user_Controller extends FreshRSS_ActionController { $ok = self::createUser($new_user_name, $email, $passwordPlain, array( 'language' => Minz_Request::param('new_user_language', FreshRSS_Context::$user_conf->language), + 'timezone' => Minz_Request::param('new_user_timezone', ''), 'is_admin' => Minz_Request::paramBoolean('new_user_is_admin'), 'enabled' => true, )); diff --git a/app/FreshRSS.php b/app/FreshRSS.php index 602c46658..02460af69 100644 --- a/app/FreshRSS.php +++ b/app/FreshRSS.php @@ -99,6 +99,9 @@ class FreshRSS extends Minz_FrontController { Minz_Session::_param('language', $language); Minz_Translate::init($language); + + $timezone = isset(FreshRSS_Context::$user_conf) ? FreshRSS_Context::$user_conf->timezone : ''; + date_default_timezone_set($timezone != '' ? $timezone : '' . ini_get('date.timezone')); } private static function getThemeFileUrl($theme_id, $filename) { diff --git a/app/Models/UserConfiguration.php b/app/Models/UserConfiguration.php index b8b023d79..157737cb8 100644 --- a/app/Models/UserConfiguration.php +++ b/app/Models/UserConfiguration.php @@ -28,6 +28,7 @@ * @property-read string $is_admin * @property int|null $keep_history_default * @property string $language + * @property string $timezone * @property bool $lazyload * @property string $mail_login * @property bool $mark_updated_article_unread diff --git a/app/i18n/cz/conf.php b/app/i18n/cz/conf.php index 7b603555c..7b0b85465 100644 --- a/app/i18n/cz/conf.php +++ b/app/i18n/cz/conf.php @@ -57,6 +57,7 @@ return array( 'portrait' => 'Na výšku', 'square' => 'Čtverec', ), + 'timezone' => 'Time zone', // TODO 'title' => 'Zobrazení', 'width' => array( 'content' => 'Šířka obsahu', diff --git a/app/i18n/de/conf.php b/app/i18n/de/conf.php index 5e9cdb36e..52826353b 100644 --- a/app/i18n/de/conf.php +++ b/app/i18n/de/conf.php @@ -57,6 +57,7 @@ return array( 'portrait' => 'Hochformat', 'square' => 'Quadrat', ), + 'timezone' => 'Time zone', // TODO 'title' => 'Anzeige', 'width' => array( 'content' => 'Inhaltsbreite', diff --git a/app/i18n/el/conf.php b/app/i18n/el/conf.php index 98f559d18..a068282ea 100644 --- a/app/i18n/el/conf.php +++ b/app/i18n/el/conf.php @@ -57,6 +57,7 @@ return array( 'portrait' => 'Portrait', // TODO 'square' => 'Square', // TODO ), + 'timezone' => 'Time zone', // TODO 'title' => 'Display', // TODO 'width' => array( 'content' => 'Content width', // TODO diff --git a/app/i18n/en-us/conf.php b/app/i18n/en-us/conf.php index 8330e4970..8a572def3 100644 --- a/app/i18n/en-us/conf.php +++ b/app/i18n/en-us/conf.php @@ -57,6 +57,7 @@ return array( 'portrait' => 'Portrait', // IGNORE 'square' => 'Square', // IGNORE ), + 'timezone' => 'Time zone', // IGNORE 'title' => 'Display', // IGNORE 'width' => array( 'content' => 'Content width', // IGNORE diff --git a/app/i18n/en/conf.php b/app/i18n/en/conf.php index fe03499ea..d6633f981 100644 --- a/app/i18n/en/conf.php +++ b/app/i18n/en/conf.php @@ -57,6 +57,7 @@ return array( 'portrait' => 'Portrait', 'square' => 'Square', ), + 'timezone' => 'Time zone', 'title' => 'Display', 'width' => array( 'content' => 'Content width', diff --git a/app/i18n/es/conf.php b/app/i18n/es/conf.php index c91b0205c..8c77dcd7e 100755 --- a/app/i18n/es/conf.php +++ b/app/i18n/es/conf.php @@ -57,6 +57,7 @@ return array( 'portrait' => 'Retrato', 'square' => 'Cuadrado', ), + 'timezone' => 'Time zone', // TODO 'title' => 'Visualización', 'width' => array( 'content' => 'Ancho de contenido', diff --git a/app/i18n/fr/conf.php b/app/i18n/fr/conf.php index 61306289c..71902d96d 100644 --- a/app/i18n/fr/conf.php +++ b/app/i18n/fr/conf.php @@ -57,6 +57,7 @@ return array( 'portrait' => 'Portrait', // IGNORE 'square' => 'Carrée', ), + 'timezone' => 'Fuseau horaire', 'title' => 'Affichage', 'width' => array( 'content' => 'Largeur du contenu', diff --git a/app/i18n/he/conf.php b/app/i18n/he/conf.php index ad479db44..ec322fddf 100644 --- a/app/i18n/he/conf.php +++ b/app/i18n/he/conf.php @@ -57,6 +57,7 @@ return array( 'portrait' => 'Portrait', // TODO 'square' => 'Square', // TODO ), + 'timezone' => 'Time zone', // TODO 'title' => 'תצוגה', 'width' => array( 'content' => 'רוחב התוכן', diff --git a/app/i18n/id/conf.php b/app/i18n/id/conf.php index b8a5b4fc1..f46347fe2 100644 --- a/app/i18n/id/conf.php +++ b/app/i18n/id/conf.php @@ -57,6 +57,7 @@ return array( 'portrait' => 'Portrait', // TODO 'square' => 'Square', // TODO ), + 'timezone' => 'Time zone', // TODO 'title' => 'Display', // TODO 'width' => array( 'content' => 'Content width', // TODO diff --git a/app/i18n/it/conf.php b/app/i18n/it/conf.php index 4597687cc..8efe6be41 100644 --- a/app/i18n/it/conf.php +++ b/app/i18n/it/conf.php @@ -57,6 +57,7 @@ return array( 'portrait' => 'Ritratto', 'square' => 'Squadrata', ), + 'timezone' => 'Time zone', // TODO 'title' => 'Visualizzazione', 'width' => array( 'content' => 'Larghezza contenuto', diff --git a/app/i18n/ja/conf.php b/app/i18n/ja/conf.php index 5e9aabfa2..f84354c36 100644 --- a/app/i18n/ja/conf.php +++ b/app/i18n/ja/conf.php @@ -57,6 +57,7 @@ return array( 'portrait' => 'ポートレート', 'square' => '四角', ), + 'timezone' => 'Time zone', // TODO 'title' => 'ディスプレイ', 'width' => array( 'content' => 'コンテンツ幅', diff --git a/app/i18n/ko/conf.php b/app/i18n/ko/conf.php index 279f2f4ad..95fda6969 100644 --- a/app/i18n/ko/conf.php +++ b/app/i18n/ko/conf.php @@ -57,6 +57,7 @@ return array( 'portrait' => '세로 방향', 'square' => '정사각형', ), + 'timezone' => 'Time zone', // TODO 'title' => '표시', 'width' => array( 'content' => '내용 표시 너비', diff --git a/app/i18n/nl/conf.php b/app/i18n/nl/conf.php index 8b3d597b1..261c3aa33 100644 --- a/app/i18n/nl/conf.php +++ b/app/i18n/nl/conf.php @@ -57,6 +57,7 @@ return array( 'portrait' => 'Staand', 'square' => 'Vierkant', ), + 'timezone' => 'Tijdzone', 'title' => 'Opmaak', 'width' => array( 'content' => 'Inhoud breedte', diff --git a/app/i18n/oc/conf.php b/app/i18n/oc/conf.php index c1834e9aa..9f157a497 100644 --- a/app/i18n/oc/conf.php +++ b/app/i18n/oc/conf.php @@ -57,6 +57,7 @@ return array( 'portrait' => 'Retrach', 'square' => 'Carrat', ), + 'timezone' => 'Time zone', // TODO 'title' => 'Afichatge', 'width' => array( 'content' => 'Largor del contengut', diff --git a/app/i18n/pl/conf.php b/app/i18n/pl/conf.php index 31b0d238c..3349bbf53 100644 --- a/app/i18n/pl/conf.php +++ b/app/i18n/pl/conf.php @@ -57,6 +57,7 @@ return array( 'portrait' => 'Portret', 'square' => 'Kwadrat', ), + 'timezone' => 'Time zone', // TODO 'title' => 'Wyświetlanie', 'width' => array( 'content' => 'Rozmiar treści', diff --git a/app/i18n/pt-br/conf.php b/app/i18n/pt-br/conf.php index b925aee21..bcf9fbd2f 100644 --- a/app/i18n/pt-br/conf.php +++ b/app/i18n/pt-br/conf.php @@ -57,6 +57,7 @@ return array( 'portrait' => 'Modo retrato', 'square' => 'Modo quadrado', ), + 'timezone' => 'Time zone', // TODO 'title' => 'Exibição', 'width' => array( 'content' => 'Largura do conteúdo', diff --git a/app/i18n/ru/conf.php b/app/i18n/ru/conf.php index c0d25aec1..98e6f5003 100644 --- a/app/i18n/ru/conf.php +++ b/app/i18n/ru/conf.php @@ -57,6 +57,7 @@ return array( 'portrait' => 'Вертикальный', 'square' => 'Квадратный', ), + 'timezone' => 'Time zone', // TODO 'title' => 'Отображение', 'width' => array( 'content' => 'Ширина содержимого', diff --git a/app/i18n/sk/conf.php b/app/i18n/sk/conf.php index 7efc3a75d..822de7b09 100644 --- a/app/i18n/sk/conf.php +++ b/app/i18n/sk/conf.php @@ -57,6 +57,7 @@ return array( 'portrait' => 'Nastojato', 'square' => 'Štvorec', ), + 'timezone' => 'Time zone', // TODO 'title' => 'Zobraziť', 'width' => array( 'content' => 'Šírka obsahu', diff --git a/app/i18n/tr/conf.php b/app/i18n/tr/conf.php index 7220d6670..14eb152c3 100644 --- a/app/i18n/tr/conf.php +++ b/app/i18n/tr/conf.php @@ -57,6 +57,7 @@ return array( 'portrait' => 'Portre', 'square' => 'Kare', ), + 'timezone' => 'Time zone', // TODO 'title' => 'Görünüm', 'width' => array( 'content' => 'İçerik genişliği', diff --git a/app/i18n/zh-cn/conf.php b/app/i18n/zh-cn/conf.php index 3a1282a12..a4d293aeb 100644 --- a/app/i18n/zh-cn/conf.php +++ b/app/i18n/zh-cn/conf.php @@ -57,6 +57,7 @@ return array( 'portrait' => '纵向', 'square' => '方形', ), + 'timezone' => 'Time zone', // TODO 'title' => '显示', 'width' => array( 'content' => '内容宽度', diff --git a/app/i18n/zh-tw/conf.php b/app/i18n/zh-tw/conf.php index 15fabaa40..61ba44151 100644 --- a/app/i18n/zh-tw/conf.php +++ b/app/i18n/zh-tw/conf.php @@ -57,6 +57,7 @@ return array( 'portrait' => '肖像', 'square' => '方塊', ), + 'timezone' => 'Time zone', // TODO 'title' => '顯示', 'width' => array( 'content' => '內容寬度', diff --git a/app/views/auth/register.phtml b/app/views/auth/register.phtml index a56eff3ee..66c4a1ccb 100644 --- a/app/views/auth/register.phtml +++ b/app/views/auth/register.phtml @@ -16,6 +16,18 @@ </div> <div class="form-group"> + <label for="new_user_timezone"><?= _t('conf.display.timezone') ?></label> + <select name="new_user_timezone" id="new_user_timezone"> + <?php $timezones = array_merge([''], DateTimeZone::listIdentifiers()); ?> + <?php foreach ($timezones as $timezone): ?> + <option value="<?= $timezone ?>"<?= $timezone === '' ? ' selected="selected"' : '' ?>> + <?= $timezone == '' ? _t('gen.short.by_default') . ' (' . ini_get('date.timezone') . ')' : $timezone ?> + </option> + <?php endforeach; ?> + </select> + </div> + + <div class="form-group"> <label for="new_user_name"><?= _t('gen.auth.username') ?></label> <input id="new_user_name" name="new_user_name" type="text" size="16" required="required" autocomplete="off" pattern="<?= FreshRSS_user_Controller::USERNAME_PATTERN ?>" autocapitalize="off" /> diff --git a/app/views/configure/display.phtml b/app/views/configure/display.phtml index d49986981..0391e59b3 100644 --- a/app/views/configure/display.phtml +++ b/app/views/configure/display.phtml @@ -26,6 +26,25 @@ </div> <div class="form-group"> + <label class="group-name" for="language"><?= _t('conf.display.timezone') ?></label> + <div class="group-controls"> + <select name="timezone" id="timezone" data-leave-validation="<?= FreshRSS_Context::$user_conf->timezone ?>"> + <?php + $timezones = array_merge([''], DateTimeZone::listIdentifiers()); + if (!in_array(FreshRSS_Context::$user_conf->timezone, $timezones, true)) { + FreshRSS_Context::$user_conf->timezone = ''; + } + ?> + <?php foreach ($timezones as $timezone): ?> + <option value="<?= $timezone ?>"<?= FreshRSS_Context::$user_conf->timezone === $timezone ? ' selected="selected"' : '' ?>> + <?= $timezone == '' ? _t('gen.short.by_default') . ' (' . ini_get('date.timezone') . ')' : $timezone ?> + </option> + <?php endforeach; ?> + </select> + </div> + </div> + + <div class="form-group"> <label class="group-name" for="theme"><?= _t('conf.display.theme') ?></label> <div class="group-controls"> <ul class="slides"> diff --git a/app/views/user/manage.phtml b/app/views/user/manage.phtml index 0d01d33d7..22a1a4d03 100644 --- a/app/views/user/manage.phtml +++ b/app/views/user/manage.phtml @@ -15,8 +15,6 @@ <input type="hidden" name="originController" value="<?= Minz_Request::controllerName() ?>" /> <input type="hidden" name="originAction" value="<?= Minz_Request::actionName() ?>" /> - - <div class="form-group"> <label class="group-name" for="new_user_language"><?= _t('admin.user.language') ?></label> <div class="group-controls"> @@ -31,6 +29,20 @@ </div> <div class="form-group"> + <label class="group-name" for="new_user_timezone"><?= _t('conf.display.timezone') ?></label> + <div class="group-controls"> + <select name="new_user_timezone" id="new_user_timezone"> + <?php $timezones = array_merge([''], DateTimeZone::listIdentifiers()); ?> + <?php foreach ($timezones as $timezone): ?> + <option value="<?= $timezone ?>"<?= $timezone === '' ? ' selected="selected"' : '' ?>> + <?= $timezone == '' ? _t('gen.short.by_default') . ' (' . ini_get('date.timezone') . ')' : $timezone ?> + </option> + <?php endforeach; ?> + </select> + </div> + </div> + + <div class="form-group"> <label class="group-name" for="new_user_name"><?= _t('admin.user.username') ?></label> <div class="group-controls"> <input id="new_user_name" name="new_user_name" type="text" size="16" required="required" autocomplete="off" |
