summaryrefslogtreecommitdiff
path: root/app/layout
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2018-01-01 20:49:18 +0100
committerGravatar GitHub <noreply@github.com> 2018-01-01 20:49:18 +0100
commita756878219f0c67674849c1bc1b881303d394ee7 (patch)
tree4c17b3e0574fa8b6ebd6d96bed4f883960401723 /app/layout
parent8c2113f9e6eb86b630a4e861513229d7abf219b8 (diff)
parent97d4250bd308175b72785f784d5b15e41ed7b04f (diff)
Merge pull request #1714 from kevinpapst/hook-readingmodes
Added extension hook for reading modes
Diffstat (limited to 'app/layout')
-rw-r--r--app/layout/nav_menu.phtml27
1 files changed, 13 insertions, 14 deletions
diff --git a/app/layout/nav_menu.phtml b/app/layout/nav_menu.phtml
index 2bc693e5d..7632b944c 100644
--- a/app/layout/nav_menu.phtml
+++ b/app/layout/nav_menu.phtml
@@ -131,20 +131,19 @@
<?php $url_output = Minz_Request::currentRequest(); ?>
<div class="stick" id="nav_menu_views">
- <?php $url_output['a'] = 'normal'; ?>
- <a class="view_normal btn <?php echo $actual_view == 'normal'? 'active' : ''; ?>" title="<?php echo _t('index.menu.normal_view'); ?>" href="<?php echo Minz_Url::display($url_output); ?>">
- <?php echo _i("view-normal"); ?>
- </a>
-
- <?php $url_output['a'] = 'global'; ?>
- <a class="view_global btn <?php echo $actual_view == 'global'? 'active' : ''; ?>" title="<?php echo _t('index.menu.global_view'); ?>" href="<?php echo Minz_Url::display($url_output); ?>">
- <?php echo _i("view-global"); ?>
- </a>
-
- <?php $url_output['a'] = 'reader'; ?>
- <a class="view_reader btn <?php echo $actual_view == 'reader'? 'active' : ''; ?>" title="<?php echo _t('index.menu.reader_view'); ?>" href="<?php echo Minz_Url::display($url_output); ?>">
- <?php echo _i("view-reader"); ?>
- </a>
+ <?php
+ $readingModes = FreshRSS_ReadingMode::getReadingModes();
+ $readingModes = Minz_ExtensionManager::callHook('nav_reading_modes', $readingModes);
+
+ /** @var FreshRSS_ReadingMode $mode */
+ foreach ($readingModes as $mode) {
+ ?>
+ <a class="view_normal btn <?php if ($mode->isActive()) { echo 'active'; } ?>" title="<?php echo $mode->getTitle(); ?>" href="<?php echo Minz_Url::display($mode->getUrlParams()); ?>">
+ <?php echo $mode->getName(); ?>
+ </a>
+ <?php
+ }
+ ?>
<?php
$url_output['a'] = 'rss';