diff options
| author | 2025-06-22 00:36:32 +0200 | |
|---|---|---|
| committer | 2025-06-22 00:36:32 +0200 | |
| commit | 51298cd6bc100b1cc6508abb602a59c01a9e2c04 (patch) | |
| tree | dc3ac061d48242ddb1dd4aaada009f531e2e08a7 /app/views | |
| parent | bea9ca12adf58896a95959c4a1fbb48f4bbc144b (diff) | |
Exposed the reading modes for extensions through Minz (#7668)
* + Exposed the reading modes for extensions through Minz. Now extensions can add a custom view mode. Graceful fallback to normal view in case the extension was disabled without resetting the view_mode through the uninstall method. In that case the user will be informed via Minz_Request::setBadNotification that the view has been reset to normal.
+ Added translation strings for de, en and en-us for the notification
* + Added missing, generated translations
* Simplify indexAction, performance
* Minor settings htmlspecialchars
* i18n: fr
* Minor wording
* Doc
* Fix i18n
---------
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Diffstat (limited to 'app/views')
| -rw-r--r-- | app/views/configure/reading.phtml | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/app/views/configure/reading.phtml b/app/views/configure/reading.phtml index dc67874b0..c31cfda0b 100644 --- a/app/views/configure/reading.phtml +++ b/app/views/configure/reading.phtml @@ -14,9 +14,19 @@ <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::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> + <?php + /** @var FreshRSS_View $this */ + /** @var list<FreshRSS_ViewMode>|null $viewModes */ + $viewModes = isset($this->viewModes) && is_array($this->viewModes) ? $this->viewModes : null; + if ($viewModes === null) { + $viewModes = FreshRSS_ViewMode::getAllModes(); + } + foreach ($viewModes as $mode): + ?> + <option value="<?= htmlspecialchars($mode->id(), ENT_COMPAT, 'UTF-8') ?>"<?= FreshRSS_Context::userConf()->view_mode === $mode->id() ? ' selected="selected"' : '' ?>> + <?= htmlspecialchars($mode->name(), ENT_NOQUOTES, 'UTF-8') ?> + </option> + <?php endforeach; ?> </select> </div> </div> |
