diff options
| author | 2022-11-29 15:27:32 +0100 | |
|---|---|---|
| committer | 2022-11-29 15:27:32 +0100 | |
| commit | 6261dc9cf41aaaa0eb2a05fbe81bc107ab91bbdd (patch) | |
| tree | c578b84508173d4750c226fecca91082448fca31 /app/views | |
| parent | 60d626030d1c3fc5ee42ddabd379318509ccc154 (diff) | |
User-defined time zone (#4906)
* User-defined time zone
#fix https://github.com/FreshRSS/FreshRSS/issues/2754
* Update app/i18n/nl/conf.php
Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
* Timezone when creating a new user
Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
Diffstat (limited to 'app/views')
| -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 |
3 files changed, 45 insertions, 2 deletions
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" |
