diff options
| author | 2023-12-18 17:59:16 +0100 | |
|---|---|---|
| committer | 2023-12-18 17:59:16 +0100 | |
| commit | a80a5f48a16e7d232168a7aaa68e9a1804235ce1 (patch) | |
| tree | a515b88592629dea7e83b96e26e2452d3f98a98e /app/views/configure | |
| parent | 6bb45a87268157aab961a6a4a728d9a9bbe043b0 (diff) | |
Pass PHPStan level 8 (#5946)
* Pass PHPStan level 8
And prepare for PHPStan level 9 https://phpstan.org/user-guide/rule-levels
* Revert wrong replace in comment
* Fix PHPStan level 8
* Update PHPStan and other dev dependencies
* Remove obsolete comment
* noVariableVariables and towards bleedingEdge
https://github.com/phpstan/phpstan-strict-rules
https://phpstan.org/blog/what-is-bleeding-edge
* More bleedingEdge
* A bit more PHPStan level 9
* More PHPStan level 9
* Prepare for booleansInConditions
Ignore int and null
* Revert wrong line
* More fixes
* Fix keep_max_n_unread
* Stricter attribute functions
* Stricter callHooks and more PHPStan level 9
* More typing
* A tiny more
Diffstat (limited to 'app/views/configure')
| -rw-r--r-- | app/views/configure/archiving.phtml | 52 | ||||
| -rw-r--r-- | app/views/configure/display.phtml | 94 | ||||
| -rw-r--r-- | app/views/configure/integration.phtml | 5 | ||||
| -rw-r--r-- | app/views/configure/reading.phtml | 148 | ||||
| -rw-r--r-- | app/views/configure/shortcut.phtml | 2 | ||||
| -rw-r--r-- | app/views/configure/system.phtml | 40 |
6 files changed, 172 insertions, 169 deletions
diff --git a/app/views/configure/archiving.phtml b/app/views/configure/archiving.phtml index 6004cec1b..86b8246e3 100644 --- a/app/views/configure/archiving.phtml +++ b/app/views/configure/archiving.phtml @@ -17,21 +17,21 @@ <div class="form-group"> <label class="group-name" for="ttl_default"><?= _t('conf.archiving.ttl') ?></label> <div class="group-controls"> - <select class="number" name="ttl_default" id="ttl_default" required="required" data-leave-validation="<?= FreshRSS_Context::$user_conf->ttl_default ?>"><?php + <select class="number" name="ttl_default" id="ttl_default" required="required" data-leave-validation="<?= FreshRSS_Context::userConf()->ttl_default ?>"><?php $found = false; foreach (array(1200 => '20min', 1500 => '25min', 1800 => '30min', 2700 => '45min', 3600 => '1h', 5400 => '1.5h', 7200 => '2h', 10800 => '3h', 14400 => '4h', 18800 => '5h', 21600 => '6h', 25200 => '7h', 28800 => '8h', 36000 => '10h', 43200 => '12h', 64800 => '18h', 86400 => '1d', 129600 => '1.5d', 172800 => '2d', 259200 => '3d', 345600 => '4d', 432000 => '5d', 518400 => '6d', 604800 => '1wk') as $v => $t) { - echo '<option value="' . $v . (FreshRSS_Context::$user_conf->ttl_default == $v ? '" selected="selected' : '') . '">' . $t . '</option>'; - if (FreshRSS_Context::$user_conf->ttl_default == $v) { + echo '<option value="' . $v . (FreshRSS_Context::userConf()->ttl_default == $v ? '" selected="selected' : '') . '">' . $t . '</option>'; + if (FreshRSS_Context::userConf()->ttl_default == $v) { $found = true; } } if (!$found) { - echo '<option value="' . intval(FreshRSS_Context::$user_conf->ttl_default) . '" selected="selected">' - . intval(FreshRSS_Context::$user_conf->ttl_default) . 's</option>'; + echo '<option value="' . intval(FreshRSS_Context::userConf()->ttl_default) . '" selected="selected">' + . intval(FreshRSS_Context::userConf()->ttl_default) . 's</option>'; } ?></select> (<?= _t('gen.short.by_default') ?>) </div> @@ -46,10 +46,10 @@ <div class="group-controls"> <label class="checkbox" for="enable_keep_max"> <input type="checkbox" name="enable_keep_max" id="enable_keep_max" value="1"<?= - empty(FreshRSS_Context::$user_conf->archiving['keep_max']) ? '' : ' checked="checked"' ?> - data-leave-validation="<?= empty(FreshRSS_Context::$user_conf->archiving['keep_max']) ? 0 : 1 ?>"/> + empty(FreshRSS_Context::userConf()->archiving['keep_max']) ? '' : ' checked="checked"' ?> + data-leave-validation="<?= empty(FreshRSS_Context::userConf()->archiving['keep_max']) ? 0 : 1 ?>"/> <?= _t('conf.archiving.keep_max') ?> - <?php $keepMax = empty(FreshRSS_Context::$user_conf->archiving['keep_max']) ? 200 : FreshRSS_Context::$user_conf->archiving['keep_max']; ?> + <?php $keepMax = empty(FreshRSS_Context::userConf()->archiving['keep_max']) ? 200 : FreshRSS_Context::userConf()->archiving['keep_max']; ?> <input type="number" id="keep_max" name="keep_max" min="0" value="<?= $keepMax ?>" data-leave-validation="<?= $keepMax ?>"/> </label> </div> @@ -59,18 +59,18 @@ <div class="group-controls"> <label class="checkbox" for="enable_keep_period"> <input type="checkbox" name="enable_keep_period" id="enable_keep_period" value="1"<?= - FreshRSS_Context::$user_conf->volatile['enable_keep_period'] ? ' checked="checked"' : '' ?> - data-leave-validation="<?= FreshRSS_Context::$user_conf->volatile['enable_keep_period'] ? 1 : 0 ?>"/> + FreshRSS_Context::userConf()->volatile['enable_keep_period'] ? ' checked="checked"' : '' ?> + data-leave-validation="<?= FreshRSS_Context::userConf()->volatile['enable_keep_period'] ? 1 : 0 ?>"/> <?= _t('conf.archiving.keep_period') ?> - <input type="number" id="keep_period_count" name="keep_period_count" min="0" value="<?= FreshRSS_Context::$user_conf->volatile['keep_period_count'] ?>" - data-leave-validation="<?= FreshRSS_Context::$user_conf->volatile['keep_period_count'] ?>"/> - <select class="number" name="keep_period_unit" id="keep_period_unit" data-leave-validation="<?= FreshRSS_Context::$user_conf->volatile['keep_period_unit'] ?>"> + <input type="number" id="keep_period_count" name="keep_period_count" min="0" value="<?= FreshRSS_Context::userConf()->volatile['keep_period_count'] ?>" + data-leave-validation="<?= FreshRSS_Context::userConf()->volatile['keep_period_count'] ?>"/> + <select class="number" name="keep_period_unit" id="keep_period_unit" data-leave-validation="<?= FreshRSS_Context::userConf()->volatile['keep_period_unit'] ?>"> <option></option> - <option value="P1Y" <?= 'P1Y' === FreshRSS_Context::$user_conf->volatile['keep_period_unit'] ? 'selected="selected"' : '' ?>><?= _t('gen.period.years') ?></option> - <option value="P1M" <?= 'P1M' === FreshRSS_Context::$user_conf->volatile['keep_period_unit'] ? 'selected="selected"' : '' ?>><?= _t('gen.period.months') ?></option> - <option value="P1W" <?= 'P1W' === FreshRSS_Context::$user_conf->volatile['keep_period_unit'] ? 'selected="selected"' : '' ?>><?= _t('gen.period.weeks') ?></option> - <option value="P1D" <?= 'P1D' === FreshRSS_Context::$user_conf->volatile['keep_period_unit'] ? 'selected="selected"' : '' ?>><?= _t('gen.period.days') ?></option> - <option value="PT1H" <?= 'PT1H' === FreshRSS_Context::$user_conf->volatile['keep_period_unit'] ? 'selected="selected"' : '' ?>><?= _t('gen.period.hours') ?></option> + <option value="P1Y" <?= 'P1Y' === FreshRSS_Context::userConf()->volatile['keep_period_unit'] ? 'selected="selected"' : '' ?>><?= _t('gen.period.years') ?></option> + <option value="P1M" <?= 'P1M' === FreshRSS_Context::userConf()->volatile['keep_period_unit'] ? 'selected="selected"' : '' ?>><?= _t('gen.period.months') ?></option> + <option value="P1W" <?= 'P1W' === FreshRSS_Context::userConf()->volatile['keep_period_unit'] ? 'selected="selected"' : '' ?>><?= _t('gen.period.weeks') ?></option> + <option value="P1D" <?= 'P1D' === FreshRSS_Context::userConf()->volatile['keep_period_unit'] ? 'selected="selected"' : '' ?>><?= _t('gen.period.days') ?></option> + <option value="PT1H" <?= 'PT1H' === FreshRSS_Context::userConf()->volatile['keep_period_unit'] ? 'selected="selected"' : '' ?>><?= _t('gen.period.hours') ?></option> </select> </label> </div> @@ -81,8 +81,8 @@ <div class="group-controls"> <label class="checkbox" for="keep_favourites"> <input type="checkbox" name="keep_favourites" id="keep_favourites" value="1"<?= - FreshRSS_Context::$user_conf->archiving['keep_favourites'] !== false ? ' checked="checked"' : '' ?> - data-leave-validation="<?= FreshRSS_Context::$user_conf->archiving['keep_favourites'] !== false ? 1 : 0 ?>"/> + FreshRSS_Context::userConf()->archiving['keep_favourites'] !== false ? ' checked="checked"' : '' ?> + data-leave-validation="<?= FreshRSS_Context::userConf()->archiving['keep_favourites'] !== false ? 1 : 0 ?>"/> <?= _t('conf.archiving.keep_favourites') ?> </label> </div> @@ -92,8 +92,8 @@ <div class="group-controls"> <label class="checkbox" for="keep_labels"> <input type="checkbox" name="keep_labels" id="keep_labels" value="1"<?= - FreshRSS_Context::$user_conf->archiving['keep_labels'] !== false ? ' checked="checked"' : '' ?> - data-leave-validation="<?= FreshRSS_Context::$user_conf->archiving['keep_labels'] !== false ? 1 : 0 ?>"/> + FreshRSS_Context::userConf()->archiving['keep_labels'] !== false ? ' checked="checked"' : '' ?> + data-leave-validation="<?= FreshRSS_Context::userConf()->archiving['keep_labels'] !== false ? 1 : 0 ?>"/> <?= _t('conf.archiving.keep_labels') ?> </label> </div> @@ -103,8 +103,8 @@ <div class="group-controls"> <label class="checkbox" for="keep_unreads"> <input type="checkbox" name="keep_unreads" id="keep_unreads" value="1"<?= - FreshRSS_Context::$user_conf->archiving['keep_unreads'] ? ' checked="checked"' : '' ?> - data-leave-validation="<?= FreshRSS_Context::$user_conf->archiving['keep_unreads'] ? 1 : 0 ?>"/> + FreshRSS_Context::userConf()->archiving['keep_unreads'] ? ' checked="checked"' : '' ?> + data-leave-validation="<?= FreshRSS_Context::userConf()->archiving['keep_unreads'] ? 1 : 0 ?>"/> <?= _t('conf.archiving.keep_unreads') ?> </label> </div> @@ -114,8 +114,8 @@ <div class="group-controls"> <label for="keep_min_default"><?= _t('conf.archiving.keep_min_by_feed') ?> <input type="number" id="keep_min_default" name="keep_min_default" min="0" value="<?= - FreshRSS_Context::$user_conf->archiving['keep_min'] ?>" - data-leave-validation="<?= FreshRSS_Context::$user_conf->archiving['keep_min'] ?>"> + FreshRSS_Context::userConf()->archiving['keep_min'] ?>" + data-leave-validation="<?= FreshRSS_Context::userConf()->archiving['keep_min'] ?>"> </label> </div> </div> diff --git a/app/views/configure/display.phtml b/app/views/configure/display.phtml index b48dcbf71..d373c0bb5 100644 --- a/app/views/configure/display.phtml +++ b/app/views/configure/display.phtml @@ -16,10 +16,10 @@ <div class="form-group"> <label class="group-name" for="language"><?= _t('conf.display.language') ?></label> <div class="group-controls"> - <select name="language" id="language" data-leave-validation="<?= FreshRSS_Context::$user_conf->language ?>"> + <select name="language" id="language" data-leave-validation="<?= FreshRSS_Context::userConf()->language ?>"> <?php $languages = Minz_Translate::availableLanguages(); ?> <?php foreach ($languages as $lang) { ?> - <option value="<?= $lang ?>"<?= FreshRSS_Context::$user_conf->language === $lang ? ' selected="selected"' : '' ?>><?= _t('gen.lang.' . $lang) ?></option> + <option value="<?= $lang ?>"<?= FreshRSS_Context::userConf()->language === $lang ? ' selected="selected"' : '' ?>><?= _t('gen.lang.' . $lang) ?></option> <?php } ?> </select> </div> @@ -28,15 +28,15 @@ <div class="form-group"> <label class="group-name" for="timezone"><?= _t('conf.display.timezone') ?></label> <div class="group-controls"> - <select name="timezone" id="timezone" data-leave-validation="<?= FreshRSS_Context::$user_conf->timezone ?>"> + <select name="timezone" id="timezone" data-leave-validation="<?= FreshRSS_Context::userConf()->timezone ?>"> <?php $timezones = array_merge([''], DateTimeZone::listIdentifiers()); - if (!in_array(FreshRSS_Context::$user_conf->timezone, $timezones, true)) { - FreshRSS_Context::$user_conf->timezone = ''; + if (!in_array(FreshRSS_Context::userConf()->timezone, $timezones, true)) { + FreshRSS_Context::userConf()->timezone = ''; } ?> <?php foreach ($timezones as $timezone): ?> - <option value="<?= $timezone ?>"<?= FreshRSS_Context::$user_conf->timezone === $timezone ? ' selected="selected"' : '' ?>> + <option value="<?= $timezone ?>"<?= FreshRSS_Context::userConf()->timezone === $timezone ? ' selected="selected"' : '' ?>> <?= $timezone == '' ? _t('gen.short.by_default') . ' (' . FreshRSS_Context::defaultTimeZone() . ')' : $timezone ?> </option> <?php endforeach; ?> @@ -49,16 +49,16 @@ <div class="group-controls"> <ul class="theme-preview-list"> <?php $slides = count($this->themes); $i = 1; $themeAvailable = false; ?> - <?php /** @var array{'id':string, 'deprecated':bool, 'author':string, 'name':string, 'description':string} $theme */ - foreach($this->themes as $theme) { ?> - <?php if (FreshRSS_Context::$user_conf->theme === $theme['id']) { + <?php + foreach ($this->themes as $theme) { ?> + <?php if (FreshRSS_Context::userConf()->theme === $theme['id']) { $checked = 'checked="checked"'; $themeAvailable = true; } else { $checked = ''; } ?> <input type="radio" name="theme" id="img-<?= $i ?>" <?= $checked ?> value="<?= $theme['id'] ?>" - data-leave-validation="<?= (FreshRSS_Context::$user_conf->theme === $theme['id']) ? 1 : 0 ?>" /> + data-leave-validation="<?= (FreshRSS_Context::userConf()->theme === $theme['id']) ? 1 : 0 ?>" /> <li class="preview-container"> <div class="preview"> <img src="<?= Minz_Url::display('/themes/' . $theme['id'] . '/thumbs/original.png') ?>" loading="lazy" /> @@ -98,7 +98,7 @@ <label for="img-<?= $i - 1 ?>" class="prev">‹</label> </div> <div class="properties alert-error"> - <div><?= _t('conf.display.theme_not_available', FreshRSS_Context::$user_conf->theme)?></div> + <div><?= _t('conf.display.theme_not_available', FreshRSS_Context::userConf()->theme)?></div> </div> </li> <?php }?> @@ -109,14 +109,14 @@ <div class="form-group"> <label class="group-name" for="darkMode"><?= _t('conf.display.darkMode') ?></label> <div class="group-controls"> - <select name="darkMode" id="darkMode" data-leave-validation="<?= FreshRSS_Context::$user_conf->darkMode ?>"> - <option value="no"<?= FreshRSS_Context::$user_conf->darkMode === 'no' ? ' selected' : '' ?>><?= _t('conf.display.darkMode.no') ?></option> - <option value="auto"<?= FreshRSS_Context::$user_conf->darkMode === 'auto' ? ' selected' : '' ?>><?= _t('conf.display.darkMode.auto') ?></option> + <select name="darkMode" id="darkMode" data-leave-validation="<?= FreshRSS_Context::userConf()->darkMode ?>"> + <option value="no"<?= FreshRSS_Context::userConf()->darkMode === 'no' ? ' selected' : '' ?>><?= _t('conf.display.darkMode.no') ?></option> + <option value="auto"<?= FreshRSS_Context::userConf()->darkMode === 'auto' ? ' selected' : '' ?>><?= _t('conf.display.darkMode.auto') ?></option> </select> </div> </div> - <?php $width = FreshRSS_Context::$user_conf->content_width; ?> + <?php $width = FreshRSS_Context::userConf()->content_width; ?> <div class="form-group"> <label class="group-name" for="content_width"><?= _t('conf.display.width.content') ?></label> <div class="group-controls"> @@ -137,7 +137,7 @@ </div> </div> - <?php $topline_website = FreshRSS_Context::$user_conf->topline_website; ?> + <?php $topline_website = FreshRSS_Context::userConf()->topline_website; ?> <div class="form-group"> <label class="group-name" for="topline_website"><?= _t('conf.display.website.label') ?></label> <div class="group-controls"> @@ -158,7 +158,7 @@ </div> </div> - <?php $topline_thumbnail = FreshRSS_Context::$user_conf->topline_thumbnail; ?> + <?php $topline_thumbnail = FreshRSS_Context::userConf()->topline_thumbnail; ?> <div class="form-group"> <label class="group-name" for="topline_thumbnail"><?= _t('conf.display.thumbnail.label') ?></label> <div class="group-controls"> @@ -201,50 +201,50 @@ <tr> <th><?= _t('conf.display.icon.top_line') ?></th> <td><input type="checkbox" name="topline_read" value="1"<?= - FreshRSS_Context::$user_conf->topline_read ? ' checked="checked"' : '' ?> - data-leave-validation="<?= FreshRSS_Context::$user_conf->topline_read ?>" /></td> + FreshRSS_Context::userConf()->topline_read ? ' checked="checked"' : '' ?> + data-leave-validation="<?= FreshRSS_Context::userConf()->topline_read ?>" /></td> <td><input type="checkbox" name="topline_favorite" value="1"<?= - FreshRSS_Context::$user_conf->topline_favorite ? ' checked="checked"' : '' ?> - data-leave-validation="<?= FreshRSS_Context::$user_conf->topline_favorite ?>" /></td> + FreshRSS_Context::userConf()->topline_favorite ? ' checked="checked"' : '' ?> + data-leave-validation="<?= FreshRSS_Context::userConf()->topline_favorite ?>" /></td> <td><input type="checkbox" disabled="disabled" /></td> <td><input type="checkbox" disabled="disabled" /></td> <td><input type="checkbox" disabled="disabled" /></td> <td><input type="checkbox" name="topline_summary" value="1"<?= - FreshRSS_Context::$user_conf->topline_summary ? 'checked="checked"' : '' ?> - data-leave-validation="<?= FreshRSS_Context::$user_conf->topline_summary ?>" /></td> + FreshRSS_Context::userConf()->topline_summary ? 'checked="checked"' : '' ?> + data-leave-validation="<?= FreshRSS_Context::userConf()->topline_summary ?>" /></td> <td><input type="checkbox" name="topline_display_authors" value="1"<?= - FreshRSS_Context::$user_conf->topline_display_authors ? ' checked="checked"' : '' ?> - data-leave-validation="<?= FreshRSS_Context::$user_conf->topline_display_authors ?>" /></td> + FreshRSS_Context::userConf()->topline_display_authors ? ' checked="checked"' : '' ?> + data-leave-validation="<?= FreshRSS_Context::userConf()->topline_display_authors ?>" /></td> <td><input type="checkbox" name="topline_date" value="1"<?= - FreshRSS_Context::$user_conf->topline_date ? ' checked="checked"' : '' ?> - data-leave-validation="<?= FreshRSS_Context::$user_conf->topline_date ?>" /></td> - <td><input type="checkbox" name="topline_link" value="1"<?= FreshRSS_Context::$user_conf->topline_link ? ' checked="checked"' : '' ?> - data-leave-validation="<?= FreshRSS_Context::$user_conf->topline_link ?>" /></td> + FreshRSS_Context::userConf()->topline_date ? ' checked="checked"' : '' ?> + data-leave-validation="<?= FreshRSS_Context::userConf()->topline_date ?>" /></td> + <td><input type="checkbox" name="topline_link" value="1"<?= FreshRSS_Context::userConf()->topline_link ? ' checked="checked"' : '' ?> + data-leave-validation="<?= FreshRSS_Context::userConf()->topline_link ?>" /></td> </tr><tr> <th><?= _t('conf.display.icon.bottom_line') ?></th> <td><input type="checkbox" name="bottomline_read" value="1"<?= - FreshRSS_Context::$user_conf->bottomline_read ? ' checked="checked"' : '' ?> - data-leave-validation="<?= FreshRSS_Context::$user_conf->bottomline_read ?>" /></td> + FreshRSS_Context::userConf()->bottomline_read ? ' checked="checked"' : '' ?> + data-leave-validation="<?= FreshRSS_Context::userConf()->bottomline_read ?>" /></td> <td><input type="checkbox" name="bottomline_favorite" value="1"<?= - FreshRSS_Context::$user_conf->bottomline_favorite ? ' checked="checked"' : '' ?> - data-leave-validation="<?= FreshRSS_Context::$user_conf->bottomline_favorite ?>" /></td> + FreshRSS_Context::userConf()->bottomline_favorite ? ' checked="checked"' : '' ?> + data-leave-validation="<?= FreshRSS_Context::userConf()->bottomline_favorite ?>" /></td> <td><input type="checkbox" name="bottomline_myLabels" value="1"<?= - FreshRSS_Context::$user_conf->bottomline_myLabels ? ' checked="checked"' : '' ?> - data-leave-validation="<?= FreshRSS_Context::$user_conf->bottomline_myLabels ?>" /></td> + FreshRSS_Context::userConf()->bottomline_myLabels ? ' checked="checked"' : '' ?> + data-leave-validation="<?= FreshRSS_Context::userConf()->bottomline_myLabels ?>" /></td> <td><input type="checkbox" name="bottomline_tags" value="1"<?= - FreshRSS_Context::$user_conf->bottomline_tags ? ' checked="checked"' : '' ?> - data-leave-validation="<?= FreshRSS_Context::$user_conf->bottomline_tags ?>" /></td> + FreshRSS_Context::userConf()->bottomline_tags ? ' checked="checked"' : '' ?> + data-leave-validation="<?= FreshRSS_Context::userConf()->bottomline_tags ?>" /></td> <td><input type="checkbox" name="bottomline_sharing" value="1"<?= - FreshRSS_Context::$user_conf->bottomline_sharing ? ' checked="checked"' : '' ?> - data-leave-validation="<?= FreshRSS_Context::$user_conf->bottomline_sharing ?>" /></td> + FreshRSS_Context::userConf()->bottomline_sharing ? ' checked="checked"' : '' ?> + data-leave-validation="<?= FreshRSS_Context::userConf()->bottomline_sharing ?>" /></td> <td><input type="checkbox" disabled="disabled" /></td> <td><input type="checkbox" disabled="disabled" /></td> <td><input type="checkbox" name="bottomline_date" value="1"<?= - FreshRSS_Context::$user_conf->bottomline_date ? ' checked="checked"' : '' ?> - data-leave-validation="<?= FreshRSS_Context::$user_conf->bottomline_date ?>" /></td> + FreshRSS_Context::userConf()->bottomline_date ? ' checked="checked"' : '' ?> + data-leave-validation="<?= FreshRSS_Context::userConf()->bottomline_date ?>" /></td> <td><input type="checkbox" name="bottomline_link" value="1"<?= - FreshRSS_Context::$user_conf->bottomline_link ? ' checked="checked"' : '' ?> - data-leave-validation="<?= FreshRSS_Context::$user_conf->bottomline_link ?>" /></td> + FreshRSS_Context::userConf()->bottomline_link ? ' checked="checked"' : '' ?> + data-leave-validation="<?= FreshRSS_Context::userConf()->bottomline_link ?>" /></td> </tr> </tbody> </table> @@ -255,8 +255,8 @@ <label class="group-name" for="html5_notif_timeout"><?= _t('conf.display.notif_html5.timeout') ?></label> <div class="group-controls"> <input type="number" id="html5_notif_timeout" name="html5_notif_timeout" value="<?= - FreshRSS_Context::$user_conf->html5_notif_timeout ?>" - data-leave-validation="<?= FreshRSS_Context::$user_conf->html5_notif_timeout ?>" /> <?= _t('conf.display.notif_html5.seconds') ?> + FreshRSS_Context::userConf()->html5_notif_timeout ?>" + data-leave-validation="<?= FreshRSS_Context::userConf()->html5_notif_timeout ?>" /> <?= _t('conf.display.notif_html5.seconds') ?> </div> </div> @@ -264,8 +264,8 @@ <div class="group-controls"> <label class="checkbox" for="show_nav_buttons"> <input type="checkbox" name="show_nav_buttons" id="show_nav_buttons" value="1"<?= - FreshRSS_Context::$user_conf->show_nav_buttons ? ' checked="checked"' : '' ?> - data-leave-validation="<?= FreshRSS_Context::$user_conf->show_nav_buttons ?>" /> + FreshRSS_Context::userConf()->show_nav_buttons ? ' checked="checked"' : '' ?> + data-leave-validation="<?= FreshRSS_Context::userConf()->show_nav_buttons ?>" /> <?= _t('conf.display.show_nav_buttons') ?> </label> </div> diff --git a/app/views/configure/integration.phtml b/app/views/configure/integration.phtml index fc3cc2a32..973ee128f 100644 --- a/app/views/configure/integration.phtml +++ b/app/views/configure/integration.phtml @@ -57,8 +57,11 @@ </template> <?php - foreach (FreshRSS_Context::$user_conf->sharing as $key => $share_options) { + foreach (FreshRSS_Context::userConf()->sharing as $key => $share_options) { $share = FreshRSS_Share::get($share_options['type']); + if ($share === null) { + continue; + } $share->update($share_options); ?> <formgroup class="group-share dragbox" id="group-share-<?= $key ?>"> diff --git a/app/views/configure/reading.phtml b/app/views/configure/reading.phtml index 94cf51977..17fdbe7c3 100644 --- a/app/views/configure/reading.phtml +++ b/app/views/configure/reading.phtml @@ -17,10 +17,10 @@ <div class="form-group"> <label class="group-name" for="view_mode"><?= _t('conf.reading.view.default') ?></label> <div class="group-controls"> - <select name="view_mode" id="view_mode" data-leave-validation="<?= FreshRSS_Context::$user_conf->view_mode ?>"> - <option value="normal"<?= FreshRSS_Context::$user_conf->view_mode === 'normal' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.view.normal') ?></option> - <option value="reader"<?= FreshRSS_Context::$user_conf->view_mode === 'reader' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.view.reader') ?></option> - <option value="global"<?= FreshRSS_Context::$user_conf->view_mode === 'global' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.view.global') ?></option> + <select name="view_mode" id="view_mode" data-leave-validation="<?= FreshRSS_Context::userConf()->view_mode ?>"> + <option value="normal"<?= FreshRSS_Context::userConf()->view_mode === 'normal' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.view.normal') ?></option> + <option value="reader"<?= FreshRSS_Context::userConf()->view_mode === 'reader' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.view.reader') ?></option> + <option value="global"<?= FreshRSS_Context::userConf()->view_mode === 'global' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.view.global') ?></option> </select> </div> </div> @@ -28,10 +28,10 @@ <div class="form-group"> <label class="group-name" for="default_view"><?= _t('conf.reading.show') ?></label> <div class="group-controls"> - <select name="default_view" id="default_view" data-leave-validation="<?= FreshRSS_Context::$user_conf->default_view ?>"> - <option value="adaptive"<?= FreshRSS_Context::$user_conf->default_view === 'adaptive' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.show.adaptive') ?></option> - <option value="all"<?= FreshRSS_Context::$user_conf->default_view === 'all' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.show.all_articles') ?></option> - <option value="unread"<?= FreshRSS_Context::$user_conf->default_view === 'unread' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.show.unread') ?></option> + <select name="default_view" id="default_view" data-leave-validation="<?= FreshRSS_Context::userConf()->default_view ?>"> + <option value="adaptive"<?= FreshRSS_Context::userConf()->default_view === 'adaptive' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.show.adaptive') ?></option> + <option value="all"<?= FreshRSS_Context::userConf()->default_view === 'all' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.show.all_articles') ?></option> + <option value="unread"<?= FreshRSS_Context::userConf()->default_view === 'unread' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.show.unread') ?></option> </select> </div> </div> @@ -40,8 +40,8 @@ <label class="group-name" for="posts_per_page"><?= _t('conf.reading.articles_per_page') ?></label> <div class="group-controls"> <input type="number" id="posts_per_page" name="posts_per_page" value="<?= - FreshRSS_Context::$user_conf->posts_per_page ?>" min="5" max="500" - data-leave-validation="<?= FreshRSS_Context::$user_conf->posts_per_page ?>"/> + FreshRSS_Context::userConf()->posts_per_page ?>" min="5" max="500" + data-leave-validation="<?= FreshRSS_Context::userConf()->posts_per_page ?>"/> <p class="help"><?= _i('help') ?> <?= _t('conf.reading.number_divided_when_reader') ?></p> </div> </div> @@ -50,8 +50,8 @@ <div class="group-controls"> <label class="checkbox" for="auto_load_more"> <input type="checkbox" name="auto_load_more" id="auto_load_more" value="1"<?= - FreshRSS_Context::$user_conf->auto_load_more ? ' checked="checked"' : '' ?> - data-leave-validation="<?= FreshRSS_Context::$user_conf->auto_load_more ?>"/> + FreshRSS_Context::userConf()->auto_load_more ? ' checked="checked"' : '' ?> + data-leave-validation="<?= FreshRSS_Context::userConf()->auto_load_more ?>"/> <?= _t('conf.reading.auto_load_more') ?> <noscript> — <strong><?= _t('gen.js.should_be_activated') ?></strong></noscript> </label> @@ -61,9 +61,9 @@ <div class="form-group"> <label class="group-name" for="sort_order"><?= _t('conf.reading.sort') ?></label> <div class="group-controls"> - <select name="sort_order" id="sort_order" data-leave-validation="<?= FreshRSS_Context::$user_conf->sort_order ?>"> - <option value="DESC"<?= FreshRSS_Context::$user_conf->sort_order === 'DESC' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.sort.newer_first') ?></option> - <option value="ASC"<?= FreshRSS_Context::$user_conf->sort_order === 'ASC' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.sort.older_first') ?></option> + <select name="sort_order" id="sort_order" data-leave-validation="<?= FreshRSS_Context::userConf()->sort_order ?>"> + <option value="DESC"<?= FreshRSS_Context::userConf()->sort_order === 'DESC' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.sort.newer_first') ?></option> + <option value="ASC"<?= FreshRSS_Context::userConf()->sort_order === 'ASC' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.sort.older_first') ?></option> </select> </div> </div> @@ -75,14 +75,14 @@ <div class="form-group"> <label class="group-name" for="display_categories"><?= _t('conf.reading.display_categories_unfolded') ?></label> <div class="group-controls"> - <select name="display_categories" id="display_categories" data-leave-validation="<?= FreshRSS_Context::$user_conf->display_categories ?>"> - <option value="active"<?= FreshRSS_Context::$user_conf->display_categories === 'active' ? ' selected="selected"' : '' ?>><?= + <select name="display_categories" id="display_categories" data-leave-validation="<?= FreshRSS_Context::userConf()->display_categories ?>"> + <option value="active"<?= FreshRSS_Context::userConf()->display_categories === 'active' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.show.active_category') ?></option> - <option value="remember"<?= FreshRSS_Context::$user_conf->display_categories === 'remember' ? ' selected="selected"' : '' ?>><?= + <option value="remember"<?= FreshRSS_Context::userConf()->display_categories === 'remember' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.show.remember_categories') ?></option> - <option value="all"<?= FreshRSS_Context::$user_conf->display_categories === 'all' ? ' selected="selected"' : '' ?>><?= + <option value="all"<?= FreshRSS_Context::userConf()->display_categories === 'all' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.show.all_categories') ?></option> - <option value="none"<?= FreshRSS_Context::$user_conf->display_categories === 'none' ? ' selected="selected"' : '' ?>><?= + <option value="none"<?= FreshRSS_Context::userConf()->display_categories === 'none' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.show.no_category') ?></option> </select> </div> @@ -92,8 +92,8 @@ <div class="group-controls"> <label class="checkbox" for="show_fav_unread"> <input type="checkbox" name="show_fav_unread" id="show_fav_unread" value="1"<?= - FreshRSS_Context::$user_conf->show_fav_unread ? ' checked="checked"' : '' ?> - data-leave-validation="<?= FreshRSS_Context::$user_conf->show_fav_unread ?>"/> + FreshRSS_Context::userConf()->show_fav_unread ? ' checked="checked"' : '' ?> + data-leave-validation="<?= FreshRSS_Context::userConf()->show_fav_unread ?>"/> <?= _t('conf.reading.always_show_favorites') ?> <p class="help"><?= _i('help') ?> <?= _t('conf.reading.show_fav_unread_help') ?></p> </label> @@ -104,8 +104,8 @@ <div class="group-controls"> <label class="checkbox" for="hide_read_feeds"> <input type="checkbox" name="hide_read_feeds" id="hide_read_feeds" value="1"<?= - FreshRSS_Context::$user_conf->hide_read_feeds ? ' checked="checked"' : '' ?> - data-leave-validation="<?= FreshRSS_Context::$user_conf->hide_read_feeds ?>"/> + FreshRSS_Context::userConf()->hide_read_feeds ? ' checked="checked"' : '' ?> + data-leave-validation="<?= FreshRSS_Context::userConf()->hide_read_feeds ?>"/> <?= _t('conf.reading.hide_read_feeds') ?> </label> </div> @@ -117,32 +117,32 @@ <div class="form-group"> <label class="group-name" for="show_feed_name"><?= _t('conf.reading.article.feed_title') ?></label> <div class="group-controls"> - <select name="show_feed_name" id="show_feed_name" data-leave-validation="<?= FreshRSS_Context::$user_conf->show_feed_name ?>"> - <option value="0"<?= FreshRSS_Context::$user_conf->show_feed_name === '0' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.article.feed_name.none') ?></option> - <option value="t"<?= FreshRSS_Context::$user_conf->show_feed_name === 't' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.article.feed_name.above_title') ?></option> - <option value="a"<?= FreshRSS_Context::$user_conf->show_feed_name === 'a' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.article.feed_name.with_authors') ?></option> + <select name="show_feed_name" id="show_feed_name" data-leave-validation="<?= FreshRSS_Context::userConf()->show_feed_name ?>"> + <option value="0"<?= FreshRSS_Context::userConf()->show_feed_name === '0' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.article.feed_name.none') ?></option> + <option value="t"<?= FreshRSS_Context::userConf()->show_feed_name === 't' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.article.feed_name.above_title') ?></option> + <option value="a"<?= FreshRSS_Context::userConf()->show_feed_name === 'a' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.article.feed_name.with_authors') ?></option> </select> </div> </div> <div class="form-group"> <label class="group-name" for="show_author_date"><?= _t('conf.reading.article.authors_date') ?></label> <div class="group-controls"> - <select name="show_author_date" id="show_author_date" data-leave-validation="<?= FreshRSS_Context::$user_conf->show_author_date ?>"> - <option value="0" <?= FreshRSS_Context::$user_conf->show_author_date === '0' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.article.authors_date.none') ?></option> - <option value="h" <?= FreshRSS_Context::$user_conf->show_author_date === 'h' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.article.authors_date.header') ?></option> - <option value="f" <?= FreshRSS_Context::$user_conf->show_author_date === 'f' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.article.authors_date.footer') ?></option> - <option value="b" <?= FreshRSS_Context::$user_conf->show_author_date === 'b' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.article.authors_date.both') ?></option> + <select name="show_author_date" id="show_author_date" data-leave-validation="<?= FreshRSS_Context::userConf()->show_author_date ?>"> + <option value="0" <?= FreshRSS_Context::userConf()->show_author_date === '0' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.article.authors_date.none') ?></option> + <option value="h" <?= FreshRSS_Context::userConf()->show_author_date === 'h' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.article.authors_date.header') ?></option> + <option value="f" <?= FreshRSS_Context::userConf()->show_author_date === 'f' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.article.authors_date.footer') ?></option> + <option value="b" <?= FreshRSS_Context::userConf()->show_author_date === 'b' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.article.authors_date.both') ?></option> </select> </div> </div> <div class="form-group"> <label class="group-name" for="show_tags"><?= _t('conf.reading.article.tags') ?></label> <div class="group-controls"> - <select class="select-input-changer" name="show_tags" id="show_tags" data-name="show_tags_max" data-leave-validation="<?= FreshRSS_Context::$user_conf->show_tags ?>"> - <option value="0" <?= FreshRSS_Context::$user_conf->show_tags === '0' ? ' selected="selected"' : '' ?> data-input-visible="false"><?= _t('conf.reading.article.tags.none') ?></option> - <option value="h" <?= FreshRSS_Context::$user_conf->show_tags === 'h' ? ' selected="selected"' : '' ?> data-input-visible="true"><?= _t('conf.reading.article.tags.header') ?></option> - <option value="f" <?= FreshRSS_Context::$user_conf->show_tags === 'f' ? ' selected="selected"' : '' ?> data-input-visible="true"><?= _t('conf.reading.article.tags.footer') ?></option> - <option value="b" <?= FreshRSS_Context::$user_conf->show_tags === 'b' ? ' selected="selected"' : '' ?> data-input-visible="true"><?= _t('conf.reading.article.tags.both') ?></option> + <select class="select-input-changer" name="show_tags" id="show_tags" data-name="show_tags_max" data-leave-validation="<?= FreshRSS_Context::userConf()->show_tags ?>"> + <option value="0" <?= FreshRSS_Context::userConf()->show_tags === '0' ? ' selected="selected"' : '' ?> data-input-visible="false"><?= _t('conf.reading.article.tags.none') ?></option> + <option value="h" <?= FreshRSS_Context::userConf()->show_tags === 'h' ? ' selected="selected"' : '' ?> data-input-visible="true"><?= _t('conf.reading.article.tags.header') ?></option> + <option value="f" <?= FreshRSS_Context::userConf()->show_tags === 'f' ? ' selected="selected"' : '' ?> data-input-visible="true"><?= _t('conf.reading.article.tags.footer') ?></option> + <option value="b" <?= FreshRSS_Context::userConf()->show_tags === 'b' ? ' selected="selected"' : '' ?> data-input-visible="true"><?= _t('conf.reading.article.tags.both') ?></option> </select> <noscript> — <strong><?= _t('gen.js.should_be_activated') ?></strong></noscript> </div> @@ -150,7 +150,7 @@ <div class="form-group" id="show_tags_max-block"> <label class="group-name" for="show_tags_max"><?= _t('conf.reading.article.tags_max') ?></label> <div class="group-controls"> - <input type="number" id="show_tags_max" name="show_tags_max" value="<?= FreshRSS_Context::$user_conf->show_tags_max ?>" min="0" data-leave-validation="<?= FreshRSS_Context::$user_conf->show_tags_max ?>" data-number="2" /> + <input type="number" id="show_tags_max" name="show_tags_max" value="<?= FreshRSS_Context::userConf()->show_tags_max ?>" min="0" data-leave-validation="<?= FreshRSS_Context::userConf()->show_tags_max ?>" data-number="2" /> <p class="help"><?= _i('help') ?> <?= _t('conf.reading.article.tags_max.help') ?></p> </div> </div> @@ -162,8 +162,8 @@ <div class="group-controls"> <label class="checkbox" for="display_posts"> <input type="checkbox" name="display_posts" id="display_posts" value="1"<?= - FreshRSS_Context::$user_conf->display_posts ? ' checked="checked"' : '' ?> - data-leave-validation="<?= FreshRSS_Context::$user_conf->display_posts ?>"/> + FreshRSS_Context::userConf()->display_posts ? ' checked="checked"' : '' ?> + data-leave-validation="<?= FreshRSS_Context::userConf()->display_posts ?>"/> <?= _t('conf.reading.display_articles_unfolded') ?> <noscript> — <strong><?= _t('gen.js.should_be_activated') ?></strong></noscript> </label> @@ -174,8 +174,8 @@ <div class="group-controls"> <label class="checkbox" for="sticky_post"> <input type="checkbox" name="sticky_post" id="sticky_post" value="1"<?= - FreshRSS_Context::$user_conf->sticky_post ? ' checked="checked"' : '' ?> - data-leave-validation="<?= FreshRSS_Context::$user_conf->sticky_post ?>"/> + FreshRSS_Context::userConf()->sticky_post ? ' checked="checked"' : '' ?> + data-leave-validation="<?= FreshRSS_Context::userConf()->sticky_post ?>"/> <?= _t('conf.reading.sticky_post') ?> <noscript> — <strong><?= _t('gen.js.should_be_activated') ?></strong></noscript> </label> @@ -186,8 +186,8 @@ <div class="group-controls"> <label class="checkbox" for="sides_close_article"> <input type="checkbox" name="sides_close_article" id="sides_close_article" value="1"<?= - FreshRSS_Context::$user_conf->sides_close_article ? ' checked="checked"' : '' ?> - data-leave-validation="<?= FreshRSS_Context::$user_conf->sides_close_article ?>"/> + FreshRSS_Context::userConf()->sides_close_article ? ' checked="checked"' : '' ?> + data-leave-validation="<?= FreshRSS_Context::userConf()->sides_close_article ?>"/> <?= _t('conf.reading.sides_close_article') ?> <noscript> — <strong><?= _t('gen.js.should_be_activated') ?></strong></noscript> </label> @@ -201,8 +201,8 @@ <div class="group-controls"> <label class="checkbox" for="auto_remove_article"> <input type="checkbox" name="auto_remove_article" id="auto_remove_article" value="1"<?= - FreshRSS_Context::$user_conf->auto_remove_article ? ' checked="checked"' : '' ?> - data-leave-validation="<?= FreshRSS_Context::$user_conf->auto_remove_article ?>"/> + FreshRSS_Context::userConf()->auto_remove_article ? ' checked="checked"' : '' ?> + data-leave-validation="<?= FreshRSS_Context::userConf()->auto_remove_article ?>"/> <?= _t('conf.reading.auto_remove_article') ?> <noscript> — <strong><?= _t('gen.js.should_be_activated') ?></strong></noscript> </label> @@ -213,8 +213,8 @@ <div class="group-controls"> <label class="checkbox" for="reading_confirm"> <input type="checkbox" name="reading_confirm" id="reading_confirm" value="1"<?= - FreshRSS_Context::$user_conf->reading_confirm ? ' checked="checked"' : '' ?> - data-leave-validation="<?= FreshRSS_Context::$user_conf->reading_confirm ?>"/> + FreshRSS_Context::userConf()->reading_confirm ? ' checked="checked"' : '' ?> + data-leave-validation="<?= FreshRSS_Context::userConf()->reading_confirm ?>"/> <?= _t('conf.reading.confirm_enabled') ?> <noscript> — <strong><?= _t('gen.js.should_be_activated') ?></strong></noscript> </label> @@ -226,8 +226,8 @@ <div class="group-controls"> <label class="checkbox" for="onread_jump_next"> <input type="checkbox" name="onread_jump_next" id="onread_jump_next" value="1"<?= - FreshRSS_Context::$user_conf->onread_jump_next ? ' checked="checked"' : '' ?> - data-leave-validation="<?= FreshRSS_Context::$user_conf->onread_jump_next ?>"/> + FreshRSS_Context::userConf()->onread_jump_next ? ' checked="checked"' : '' ?> + data-leave-validation="<?= FreshRSS_Context::userConf()->onread_jump_next ?>"/> <?= _t('conf.reading.jump_next') ?> </label> </div> @@ -237,8 +237,8 @@ <div class="group-controls"> <label class="checkbox" for="mark_updated_article_unread"> <input type="checkbox" name="mark_updated_article_unread" id="mark_updated_article_unread" value="1"<?= - FreshRSS_Context::$user_conf->mark_updated_article_unread ? ' checked="checked"' : '' ?> - data-leave-validation="<?= FreshRSS_Context::$user_conf->mark_updated_article_unread ?>"/> + FreshRSS_Context::userConf()->mark_updated_article_unread ? ' checked="checked"' : '' ?> + data-leave-validation="<?= FreshRSS_Context::userConf()->mark_updated_article_unread ?>"/> <?= _t('conf.reading.mark_updated_article_unread') ?> </label> </div> @@ -249,8 +249,8 @@ <div class="group-controls"> <label class="checkbox" for="check_open_article"> <input type="checkbox" name="mark_open_article" id="check_open_article" value="1"<?= - FreshRSS_Context::$user_conf->mark_when['article'] ? ' checked="checked"' : '' ?> - data-leave-validation="<?= FreshRSS_Context::$user_conf->mark_when['article'] ?>"/> + FreshRSS_Context::userConf()->mark_when['article'] ? ' checked="checked"' : '' ?> + data-leave-validation="<?= FreshRSS_Context::userConf()->mark_when['article'] ?>"/> <?= _t('conf.reading.read.article_viewed') ?> </label> </div> @@ -261,8 +261,8 @@ <div class="group-controls"> <label class="checkbox" for="check_open_site"> <input type="checkbox" name="mark_open_site" id="check_open_site" value="1"<?= - FreshRSS_Context::$user_conf->mark_when['site'] ? ' checked="checked"' : '' ?> - data-leave-validation="<?= FreshRSS_Context::$user_conf->mark_when['site'] ?>"/> + FreshRSS_Context::userConf()->mark_when['site'] ? ' checked="checked"' : '' ?> + data-leave-validation="<?= FreshRSS_Context::userConf()->mark_when['site'] ?>"/> <?= _t('conf.reading.read.article_open_on_website') ?> </label> </div> @@ -273,8 +273,8 @@ <div class="group-controls"> <label class="checkbox" for="check_scroll"> <input type="checkbox" name="mark_scroll" id="check_scroll" value="1"<?= - FreshRSS_Context::$user_conf->mark_when['scroll'] ? ' checked="checked"' : '' ?> - data-leave-validation="<?= FreshRSS_Context::$user_conf->mark_when['scroll'] ?>"/> + FreshRSS_Context::userConf()->mark_when['scroll'] ? ' checked="checked"' : '' ?> + data-leave-validation="<?= FreshRSS_Context::userConf()->mark_when['scroll'] ?>"/> <?= _t('conf.reading.read.scroll') ?> </label> </div> @@ -285,8 +285,8 @@ <div class="group-controls"> <label class="checkbox" for="check_focus"> <input type="checkbox" name="mark_focus" id="check_focus" value="1"<?= - FreshRSS_Context::$user_conf->mark_when['focus'] ? ' checked="checked"' : '' ?> - data-leave-validation="<?= FreshRSS_Context::$user_conf->mark_when['focus'] ?>" /> + FreshRSS_Context::userConf()->mark_when['focus'] ? ' checked="checked"' : '' ?> + data-leave-validation="<?= FreshRSS_Context::userConf()->mark_when['focus'] ?>" /> <?= _t('conf.reading.read.focus') ?> </label> </div> @@ -297,10 +297,10 @@ <div class="group-controls"> <label class="checkbox" for="enable_read_when_same_title_in_feed"> <input type="checkbox" name="enable_read_when_same_title_in_feed" id="enable_read_when_same_title_in_feed" value="1"<?= - empty(FreshRSS_Context::$user_conf->mark_when['same_title_in_feed']) ? '' : ' checked="checked"' ?> - data-leave-validation="<?= empty(FreshRSS_Context::$user_conf->mark_when['same_title_in_feed']) ? 0 : 1 ?>"/> + empty(FreshRSS_Context::userConf()->mark_when['same_title_in_feed']) ? '' : ' checked="checked"' ?> + data-leave-validation="<?= empty(FreshRSS_Context::userConf()->mark_when['same_title_in_feed']) ? 0 : 1 ?>"/> <?= _t('conf.reading.read.when_same_title') ?> - <?php $read_when_same_title_in_feed = empty(FreshRSS_Context::$user_conf->mark_when['same_title_in_feed']) ? 25 : FreshRSS_Context::$user_conf->mark_when['same_title_in_feed']; ?> + <?php $read_when_same_title_in_feed = empty(FreshRSS_Context::userConf()->mark_when['same_title_in_feed']) ? 25 : FreshRSS_Context::userConf()->mark_when['same_title_in_feed']; ?> <input type="number" id="read_when_same_title_in_feed" name="read_when_same_title_in_feed" min="0" value="<?= $read_when_same_title_in_feed ?>" data-leave-validation="<?= $read_when_same_title_in_feed ?>" /> </label> @@ -312,8 +312,8 @@ <div class="group-controls"> <label class="checkbox" for="mark_upon_reception"> <input type="checkbox" name="mark_upon_reception" id="mark_upon_reception" value="1"<?= - FreshRSS_Context::$user_conf->mark_when['reception'] ? ' checked="checked"' : '' ?> - data-leave-validation="<?= FreshRSS_Context::$user_conf->mark_when['reception'] ?>"/> + FreshRSS_Context::userConf()->mark_when['reception'] ? ' checked="checked"' : '' ?> + data-leave-validation="<?= FreshRSS_Context::userConf()->mark_when['reception'] ?>"/> <?= _t('conf.reading.read.upon_reception') ?> </label> </div> @@ -324,8 +324,8 @@ <div class="group-controls"> <label class="checkbox" for="read_upon_gone"> <input type="checkbox" name="read_upon_gone" id="read_upon_gone" value="1"<?= - FreshRSS_Context::$user_conf->mark_when['gone'] ? ' checked="checked"' : '' ?> - data-leave-validation="<?= FreshRSS_Context::$user_conf->mark_when['gone'] ?>"/> + FreshRSS_Context::userConf()->mark_when['gone'] ? ' checked="checked"' : '' ?> + data-leave-validation="<?= FreshRSS_Context::userConf()->mark_when['gone'] ?>"/> <?= _t('conf.reading.read.upon_gone') ?> </label> </div> @@ -335,10 +335,10 @@ <div class="group-controls"> <label class="checkbox" for="keep_max_n_unread"> <input type="checkbox" name="enable_keep_max_n_unread" id="enable_keep_max_n_unread" value="1"<?= - empty(FreshRSS_Context::$user_conf->mark_when['max_n_unread']) ? '' : ' checked="checked"' ?> - data-leave-validation="<?= empty(FreshRSS_Context::$user_conf->mark_when['max_n_unread']) ? 0 : 1 ?>"/> + empty(FreshRSS_Context::userConf()->mark_when['max_n_unread']) ? '' : ' checked="checked"' ?> + data-leave-validation="<?= empty(FreshRSS_Context::userConf()->mark_when['max_n_unread']) ? 0 : 1 ?>"/> <?= _t('conf.reading.read.keep_max_n_unread') ?> - <?php $keep_max_n_unread = empty(FreshRSS_Context::$user_conf->mark_when['max_n_unread']) ? 1000 : FreshRSS_Context::$user_conf->mark_when['max_n_unread']; ?> + <?php $keep_max_n_unread = empty(FreshRSS_Context::userConf()->mark_when['max_n_unread']) ? 1000 : FreshRSS_Context::userConf()->mark_when['max_n_unread']; ?> <input type="number" id="keep_max_n_unread" name="keep_max_n_unread" min="0" value="<?= $keep_max_n_unread ?>" data-leave-validation="<?= $keep_max_n_unread ?>" /> </label> </div> @@ -351,7 +351,7 @@ <label class="group-name" for="filteractions_read"><?= _t('conf.reading.read.when') ?></label> <div class="group-controls"> <textarea name="filteractions_read" id="filteractions_read" class="w100"><?php - foreach (FreshRSS_Context::$user_conf->filtersAction('read') as $filterRead) { + foreach (FreshRSS_Context::userConf()->filtersAction('read') as $filterRead) { echo $filterRead->getRawInput(), PHP_EOL; } ?></textarea> @@ -366,8 +366,8 @@ <div class="group-controls"> <label class="checkbox" for="lazyload"> <input type="checkbox" name="lazyload" id="lazyload" value="1"<?= - FreshRSS_Context::$user_conf->lazyload ? ' checked="checked"' : '' ?> - data-leave-validation="<?= FreshRSS_Context::$user_conf->lazyload ?>"/> + FreshRSS_Context::userConf()->lazyload ? ' checked="checked"' : '' ?> + data-leave-validation="<?= FreshRSS_Context::userConf()->lazyload ?>"/> <?= _t('conf.reading.img_with_lazyload') ?> <noscript> — <strong><?= _t('gen.js.should_be_activated') ?></strong></noscript> </label> diff --git a/app/views/configure/shortcut.phtml b/app/views/configure/shortcut.phtml index e578938cd..0d7ee4cb7 100644 --- a/app/views/configure/shortcut.phtml +++ b/app/views/configure/shortcut.phtml @@ -16,7 +16,7 @@ <?php } ?> </datalist> - <?php $s = FreshRSS_Context::$user_conf->shortcuts; ?> + <?php $s = FreshRSS_Context::userConf()->shortcuts; ?> <?php if ([] !== $nonStandard = getNonStandardShortcuts($s)): ?> <p class="alert alert-error"> diff --git a/app/views/configure/system.phtml b/app/views/configure/system.phtml index d19698932..09d1fe188 100644 --- a/app/views/configure/system.phtml +++ b/app/views/configure/system.phtml @@ -16,16 +16,16 @@ <div class="form-group"> <label class="group-name" for="instance-name"><?= _t('admin.system.instance-name') ?></label> <div class="group-controls"> - <input type="text" id="instance-name" name="instance-name" value="<?= FreshRSS_Context::$system_conf->title ?>" - data-leave-validation="<?= FreshRSS_Context::$system_conf->title ?>"/> + <input type="text" id="instance-name" name="instance-name" value="<?= FreshRSS_Context::systemConf()->title ?>" + data-leave-validation="<?= FreshRSS_Context::systemConf()->title ?>"/> </div> </div> <div class="form-group"> <label class="group-name" for="base-url"><?= _t('admin.system.base-url') ?></label> <div class="group-controls"> - <input type="text" id="base-url" name="base-url" value="<?= FreshRSS_Context::$system_conf->base_url ?>" - data-leave-validation="<?= FreshRSS_Context::$system_conf->base_url ?>" disabled="disabled" /> + <input type="text" id="base-url" name="base-url" value="<?= FreshRSS_Context::systemConf()->base_url ?>" + data-leave-validation="<?= FreshRSS_Context::systemConf()->base_url ?>" disabled="disabled" /> <p class="help"><?= _i('help') ?> <?= _t('admin.system.base-url.recommendation', dirname(Minz_Request::guessBaseUrl())) ?></p> <p class="help"><?= _i('help') ?> <?= _t('admin.system.sensitive-parameter') ?></p> </div> @@ -35,7 +35,7 @@ <label class="group-name" for="websub"><?= _t('sub.feed.websub') ?></label> <div class="group-controls"> <input type="checkbox" id="websub" name="websub" disabled="disabled" <?= - FreshRSS_Context::$system_conf->pubsubhubbub_enabled && Minz_Request::serverIsPublic(FreshRSS_Context::$system_conf->base_url) ? 'checked="checked"' : '' ?> /> + FreshRSS_Context::systemConf()->pubsubhubbub_enabled && Minz_Request::serverIsPublic(FreshRSS_Context::systemConf()->base_url) ? 'checked="checked"' : '' ?> /> <p class="help"><?= _i('help') ?> <?= _t('admin.system.websub.help') ?></p> <p class="help"><?= _i('help') ?> <?= _t('admin.system.sensitive-parameter') ?></p> </div> @@ -44,32 +44,32 @@ <div class="form-group"> <label class="group-name" for="auto-update-url"><?= _t('admin.system.auto-update-url') ?></label> <div class="group-controls"> - <input type="text" id="auto-update-url" name="auto-update-url" value="<?= FreshRSS_Context::$system_conf->auto_update_url ?>" - data-leave-validation="<?= FreshRSS_Context::$system_conf->auto_update_url ?>"/> + <input type="text" id="auto-update-url" name="auto-update-url" value="<?= FreshRSS_Context::systemConf()->auto_update_url ?>" + data-leave-validation="<?= FreshRSS_Context::systemConf()->auto_update_url ?>"/> </div> </div> <div class="form-group"> <label class="group-name" for="max-feeds"><?= _t('admin.system.max-feeds') ?></label> <div class="group-controls"> - <input type="number" id="max-feeds" name="max-feeds" value="<?= FreshRSS_Context::$system_conf->limits['max_feeds'] ?>" min="1" - data-leave-validation="<?= FreshRSS_Context::$system_conf->limits['max_feeds'] ?>"/> + <input type="number" id="max-feeds" name="max-feeds" value="<?= FreshRSS_Context::systemConf()->limits['max_feeds'] ?>" min="1" + data-leave-validation="<?= FreshRSS_Context::systemConf()->limits['max_feeds'] ?>"/> </div> </div> <div class="form-group"> <label class="group-name" for="max-categories"><?= _t('admin.system.max-categories') ?></label> <div class="group-controls"> - <input type="number" id="max-categories" name="max-categories" value="<?= FreshRSS_Context::$system_conf->limits['max_categories'] ?>" min="1" - data-leave-validation="<?= FreshRSS_Context::$system_conf->limits['max_categories'] ?>"/> + <input type="number" id="max-categories" name="max-categories" value="<?= FreshRSS_Context::systemConf()->limits['max_categories'] ?>" min="1" + data-leave-validation="<?= FreshRSS_Context::systemConf()->limits['max_categories'] ?>"/> </div> </div> <div class="form-group"> <label class="group-name" for="cookie-duration"><?= _t('admin.system.cookie-duration.number') ?></label> <div class="group-controls"> - <input type="number" id="cookie-duration" name="cookie-duration" value="<?= FreshRSS_Context::$system_conf->limits['cookie_duration'] ?>" min="0" - data-leave-validation="<?= FreshRSS_Context::$system_conf->limits['cookie_duration'] ?>"/> + <input type="number" id="cookie-duration" name="cookie-duration" value="<?= FreshRSS_Context::systemConf()->limits['cookie_duration'] ?>" min="0" + data-leave-validation="<?= FreshRSS_Context::systemConf()->limits['cookie_duration'] ?>"/> <p class="help"><?= _i('help') ?> <?= _t('admin.system.cookie-duration.help') ?></p> </div> </div> @@ -80,9 +80,9 @@ <label class="group-name" for="max-registrations-select"><?= _t('admin.system.registration.select.label') ?></label> <div class="group-controls"> <select class="select-input-changer" name="" data-name="max-registrations"> - <option value="1" <?= FreshRSS_Context::$system_conf->limits['max_registrations'] == 1 ? 'selected = "selected"' : ''; ?> data-input-visible="false"><?= _t('admin.system.registration.select.option.noform') ?></option> - <option value="0" <?= FreshRSS_Context::$system_conf->limits['max_registrations'] == 0 ? 'selected = "selected"' : ''; ?> data-input-visible="false"><?= _t('admin.system.registration.select.option.nolimit') ?></option> - <option value="2" <?= FreshRSS_Context::$system_conf->limits['max_registrations'] > 1 ? 'selected = "selected"' : ''; ?> data-input-visible="true"><?= _t('admin.system.registration.select.option.setaccountsnumber') ?></option> + <option value="1" <?= FreshRSS_Context::systemConf()->limits['max_registrations'] == 1 ? 'selected = "selected"' : ''; ?> data-input-visible="false"><?= _t('admin.system.registration.select.option.noform') ?></option> + <option value="0" <?= FreshRSS_Context::systemConf()->limits['max_registrations'] == 0 ? 'selected = "selected"' : ''; ?> data-input-visible="false"><?= _t('admin.system.registration.select.option.nolimit') ?></option> + <option value="2" <?= FreshRSS_Context::systemConf()->limits['max_registrations'] > 1 ? 'selected = "selected"' : ''; ?> data-input-visible="true"><?= _t('admin.system.registration.select.option.setaccountsnumber') ?></option> </select> </div> </div> @@ -91,8 +91,8 @@ <label class="group-name" for="max-registrations-input"><?= _t('admin.system.registration.number') ?></label> <div class="group-controls"> <?php $number = count(listUsers()); ?> - <input type="number" id="max-registrations-input" name="" value="<?= FreshRSS_Context::$system_conf->limits['max_registrations'] > 1 ? FreshRSS_Context::$system_conf->limits['max_registrations'] : $number + 1; ?>" min="2" - data-leave-validation="<?= FreshRSS_Context::$system_conf->limits['max_registrations'] > 1 ? FreshRSS_Context::$system_conf->limits['max_registrations'] : $number + 1; ?>" data-number="<?= $number ?>"/> + <input type="number" id="max-registrations-input" name="" value="<?= FreshRSS_Context::systemConf()->limits['max_registrations'] > 1 ? FreshRSS_Context::systemConf()->limits['max_registrations'] : $number + 1; ?>" min="2" + data-leave-validation="<?= FreshRSS_Context::systemConf()->limits['max_registrations'] > 1 ? FreshRSS_Context::systemConf()->limits['max_registrations'] : $number + 1; ?>" data-number="<?= $number ?>"/> <span id="max-registrations-status-disabled">(= <?= _t('admin.system.registration.status.disabled') ?>)</span><span id="max-registrations-status-enabled">(= <?= _t('admin.system.registration.status.enabled') ?>)</span> </div> </div> @@ -124,8 +124,8 @@ name="force-email-validation" id="force-email-validation" value="1" - <?= FreshRSS_Context::$system_conf->force_email_validation ? 'checked="checked"' : '' ?> - data-leave-validation="<?= FreshRSS_Context::$system_conf->force_email_validation ?>" + <?= FreshRSS_Context::systemConf()->force_email_validation ? 'checked="checked"' : '' ?> + data-leave-validation="<?= FreshRSS_Context::systemConf()->force_email_validation ?>" /> <?= _t('admin.system.force_email_validation') ?> </label> |
