diff options
| author | 2017-02-15 14:14:03 +0100 | |
|---|---|---|
| committer | 2017-02-15 14:14:03 +0100 | |
| commit | 5a1bb1393b4496eb35a2ffb3cc63d41c9dc1e2e5 (patch) | |
| tree | 67028e45792c575c25c92616633f64cc7a4a13eb /app/layout | |
| parent | 7e949d50320317b5c3b5a2da2bdaf324e794b2f7 (diff) | |
| parent | 5f637bd816b7323885bfe1751a1724ee59a822f6 (diff) | |
Merge remote-tracking branch 'FreshRSS/master'
Diffstat (limited to 'app/layout')
| -rw-r--r-- | app/layout/aside_configure.phtml | 54 | ||||
| -rw-r--r-- | app/layout/aside_feed.phtml | 144 | ||||
| -rw-r--r-- | app/layout/aside_flux.phtml | 88 | ||||
| -rw-r--r-- | app/layout/aside_stats.phtml | 12 | ||||
| -rw-r--r-- | app/layout/aside_subscription.phtml | 17 | ||||
| -rw-r--r-- | app/layout/header.phtml | 114 | ||||
| -rw-r--r-- | app/layout/layout.phtml | 81 | ||||
| -rw-r--r-- | app/layout/nav_entries.phtml | 6 | ||||
| -rw-r--r-- | app/layout/nav_menu.phtml | 346 |
9 files changed, 426 insertions, 436 deletions
diff --git a/app/layout/aside_configure.phtml b/app/layout/aside_configure.phtml index 27f11ab6d..d956ec21f 100644 --- a/app/layout/aside_configure.phtml +++ b/app/layout/aside_configure.phtml @@ -1,19 +1,49 @@ <ul class="nav nav-list aside"> - <li class="nav-header"><?php echo Minz_Translate::t ('configuration'); ?></li> - <li class="item<?php echo Minz_Request::actionName () == 'display' ? ' active' : ''; ?>"> - <a href="<?php echo _url ('configure', 'display'); ?>"><?php echo Minz_Translate::t ('reading_configuration'); ?></a> + <li class="nav-header"><?php echo _t('gen.menu.configuration'); ?></li> + <li class="item<?php echo Minz_Request::actionName() === 'display' ? ' active' : ''; ?>"> + <a href="<?php echo _url('configure', 'display'); ?>"><?php echo _t('gen.menu.display'); ?></a> </li> - <li class="item<?php echo Minz_Request::actionName () == 'archiving' ? ' active' : ''; ?>"> - <a href="<?php echo _url ('configure', 'archiving'); ?>"><?php echo Minz_Translate::t ('archiving_configuration'); ?></a> + <li class="item<?php echo Minz_Request::actionName() === 'reading' ? ' active' : ''; ?>"> + <a href="<?php echo _url('configure', 'reading'); ?>"><?php echo _t('gen.menu.reading'); ?></a> </li> - <li class="item<?php echo Minz_Request::actionName () == 'sharing' ? ' active' : ''; ?>"> - <a href="<?php echo _url ('configure', 'sharing'); ?>"><?php echo Minz_Translate::t ('sharing'); ?></a> + <li class="item<?php echo Minz_Request::actionName() === 'archiving' ? ' active' : ''; ?>"> + <a href="<?php echo _url('configure', 'archiving'); ?>"><?php echo _t('gen.menu.archiving'); ?></a> </li> - <li class="item<?php echo Minz_Request::actionName () == 'shortcut' ? ' active' : ''; ?>"> - <a href="<?php echo _url ('configure', 'shortcut'); ?>"><?php echo Minz_Translate::t ('shortcuts'); ?></a> + <li class="item<?php echo Minz_Request::actionName() === 'sharing' ? ' active' : ''; ?>"> + <a href="<?php echo _url('configure', 'sharing'); ?>"><?php echo _t('gen.menu.sharing'); ?></a> </li> - <li class="separator"></li> - <li class="item<?php echo Minz_Request::actionName () == 'users' ? ' active' : ''; ?>"> - <a href="<?php echo _url ('configure', 'users'); ?>"><?php echo Minz_Translate::t ('users'); ?></a> + <li class="item<?php echo Minz_Request::actionName() === 'shortcut' ? ' active' : ''; ?>"> + <a href="<?php echo _url('configure', 'shortcut'); ?>"><?php echo _t('gen.menu.shortcuts'); ?></a> </li> + <li class="item<?php echo Minz_Request::actionName() === 'queries' ? ' active' : ''; ?>"> + <a href="<?php echo _url('configure', 'queries'); ?>"><?php echo _t('gen.menu.queries'); ?></a> + </li> + <li class="item<?php echo Minz_Request::controllerName() === 'user' && + Minz_Request::actionName() === 'profile'? ' active' : ''; ?>"> + <a href="<?php echo _url('user', 'profile'); ?>"><?php echo _t('gen.menu.user_profile'); ?></a> + </li> + <li class="item<?php echo Minz_Request::controllerName() === 'extension' ? ' active' : ''; ?>"> + <a href="<?php echo _url('extension', 'index'); ?>"><?php echo _t('gen.menu.extensions'); ?></a> + </li> + <?php if (FreshRSS_Auth::hasAccess('admin')) { ?> + <li class="nav-header"><?php echo _t('gen.menu.admin'); ?></li> + <li class="item<?php echo Minz_Request::actionName() === 'system' ? ' active' : ''; ?>"> + <a href="<?php echo _url('configure', 'system')?>"><?php echo _t('gen.menu.system'); ?></a> + </li> + <li class="item<?php echo Minz_Request::controllerName() === 'user' && + Minz_Request::actionName() === 'manage' ? ' active' : ''; ?>"> + <a href="<?php echo _url('user', 'manage'); ?>"><?php echo _t('gen.menu.user_management'); ?></a> + </li> + <li class="item<?php echo Minz_Request::controllerName() === 'auth' ? ' active' : ''; ?>"> + <a href="<?php echo _url('auth', 'index'); ?>"><?php echo _t('gen.menu.authentication'); ?></a> + </li> + <li class="item<?php echo Minz_Request::controllerName() === 'update' && + Minz_Request::actionName() === 'checkInstall' ? ' active' : ''; ?>"> + <a href="<?php echo _url('update', 'checkInstall'); ?>"><?php echo _t('gen.menu.check_install'); ?></a> + </li> + <li class="item<?php echo Minz_Request::controllerName() === 'update' && + Minz_Request::actionName() === 'index' ? ' active' : ''; ?>"> + <a href="<?php echo _url('update', 'index'); ?>"><?php echo _t('gen.menu.update'); ?></a> + </li> + <?php } ?> </ul> diff --git a/app/layout/aside_feed.phtml b/app/layout/aside_feed.phtml index e324b15bd..3e1ee44dd 100644 --- a/app/layout/aside_feed.phtml +++ b/app/layout/aside_feed.phtml @@ -1,64 +1,96 @@ -<ul class="nav nav-list aside aside_feed"> - <li class="nav-header"><?php echo Minz_Translate::t ('your_rss_feeds'); ?></li> +<?php + $class = ''; + if (FreshRSS_Context::$user_conf->hide_read_feeds && + FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_NOT_READ) && + !FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_READ)) { + $class = ' state_unread'; + } +?> - <li class="nav-form"><form id="add_rss" method="post" action="<?php echo Minz_Url::display (array ('c' => 'feed', 'a' => 'add')); ?>" autocomplete="off"> - <div class="stick"> - <input type="url" name="url_rss" placeholder="<?php echo Minz_Translate::t ('add_rss_feed'); ?>" /> - <div class="dropdown"> - <div id="dropdown-cat" class="dropdown-target"></div> +<div class="aside aside_feed<?php echo $class; ?>" id="aside_feed"> + <a class="toggle_aside" href="#close"><?php echo _i('close'); ?></a> - <a class="dropdown-toggle btn" href="#dropdown-cat"><?php echo FreshRSS_Themes::icon('down'); ?></a> - <ul class="dropdown-menu"> - <li class="dropdown-close"><a href="#close">❌</a></li> - - <li class="dropdown-header"><?php echo Minz_Translate::t ('category'); ?></li> - - <li class="input"> - <select name="category" id="category"> - <?php foreach ($this->categories as $cat) { ?> - <option value="<?php echo $cat->id (); ?>"<?php echo $cat->id () == 1 ? ' selected="selected"' : ''; ?>> - <?php echo $cat->name (); ?> - </option> - <?php } ?> - </select> - </li> - - <li class="separator"></li> + <?php if (FreshRSS_Auth::hasAccess()) { ?> + <div class="stick configure-feeds no-mobile"> + <a class="btn btn-important" href="<?php echo _url('subscription', 'index'); ?>"><?php echo _t('index.menu.subscription'); ?></a> + <a class="btn btn-important" href="<?php echo _url('importExport', 'index'); ?>"><?php echo _i('import'); ?></a> + </div> + <?php } elseif (FreshRSS_Auth::accessNeedsLogin()) { ?> + <a href="<?php echo _url('index', 'about'); ?>"><?php echo _t('index.menu.about'); ?></a> + <?php } ?> - <li class="dropdown-header"><?php echo Minz_Translate::t ('http_authentication'); ?></li> - <li class="input"> - <input type="text" name="http_user" id="http_user_add" autocomplete="off" placeholder="<?php echo Minz_Translate::t ('username'); ?>" /> - </li> - <li class="input"> - <input type="password" name="http_pass" id="http_pass_add" autocomplete="off" placeholder="<?php echo Minz_Translate::t ('password'); ?>" /> - </li> - </ul> + <form id="mark-read-aside" method="post"> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <ul class="tree"> + <li class="tree-folder category all<?php echo FreshRSS_Context::isCurrentGet('a') ? ' active' : ''; ?>"> + <div class="tree-folder-title"> + <?php echo _i('all'); ?> <a class="title" data-unread="<?php echo format_number(FreshRSS_Context::$total_unread); ?>" href="<?php echo _url('index', 'index'); ?>"><?php echo _t('index.menu.main_stream'); ?></a> </div> - <button class="btn" type="submit"><?php echo FreshRSS_Themes::icon('add'); ?></button> - </div> - </form></li> + </li> - <li class="item<?php echo Minz_Request::actionName () == 'importExport' ? ' active' : ''; ?>"> - <a href="<?php echo _url ('configure', 'importExport'); ?>"><?php echo Minz_Translate::t ('import_export_opml'); ?></a> - </li> + <li class="tree-folder category favorites<?php echo FreshRSS_Context::isCurrentGet('s') ? ' active' : ''; ?>"> + <div class="tree-folder-title"> + <?php echo _i('bookmark'); ?> <a class="title" data-unread="<?php echo format_number(FreshRSS_Context::$total_starred['unread']); ?>" href="<?php echo _url('index', 'index', 'get', 's'); ?>"><?php echo _t('index.menu.favorites', format_number(FreshRSS_Context::$total_starred['all'])); ?></a> + </div> + </li> - <li class="item<?php echo Minz_Request::actionName () == 'categorize' ? ' active' : ''; ?>"> - <a href="<?php echo _url ('configure', 'categorize'); ?>"><?php echo Minz_Translate::t ('categories_management'); ?></a> - </li> + <?php + foreach ($this->categories as $cat) { + $feeds = $cat->feeds(); + if (!empty($feeds)) { + $c_active = FreshRSS_Context::isCurrentGet('c_' . $cat->id()); + $c_show = $c_active && (!FreshRSS_Context::$user_conf->display_categories || + FreshRSS_Context::$current_get['feed']); + ?> + <li class="tree-folder category<?php echo $c_active ? ' active' : ''; ?>" data-unread="<?php echo $cat->nbNotRead(); ?>"> + <div class="tree-folder-title"> + <a class="dropdown-toggle" href="#"><?php echo _i($c_show ? 'up' : 'down'); ?></a> + <a class="title<?php echo $cat->hasFeedsWithError() ? ' error' : ''; ?>" data-unread="<?php echo format_number($cat->nbNotRead()); ?>" href="<?php echo _url('index', 'index', 'get', 'c_' . $cat->id()); ?>"><?php echo $cat->name(); ?></a> + </div> - <li class="separator"></li> + <ul class="tree-folder-items<?php echo $c_show ? ' active' : ''; ?>"> + <?php + foreach ($feeds as $feed) { + $f_active = FreshRSS_Context::isCurrentGet('f_' . $feed->id()); + ?> + <li id="f_<?php echo $feed->id(); ?>" class="item feed<?php echo $f_active ? ' active' : ''; ?><?php echo $feed->inError() ? ' error' : ''; ?><?php echo $feed->nbEntries() <= 0 ? ' empty' : ''; ?>" data-unread="<?php echo $feed->nbNotRead(); ?>" data-priority="<?php echo $feed->priority(); ?>"> + <div class="dropdown no-mobile"> + <div class="dropdown-target"></div> + <a class="dropdown-toggle" data-fweb="<?php echo $feed->website(); ?>"><?php echo _i('configure'); ?></a> + <?php /* feed_config_template */ ?> + </div> + <img class="favicon" src="<?php echo $feed->favicon(); ?>" alt="✇" /> <a class="item-title" data-unread="<?php echo format_number($feed->nbNotRead()); ?>" href="<?php echo _url('index', 'index', 'get', 'f_' . $feed->id()); ?>"><?php echo $feed->name(); ?></a> + </li> + <?php } ?> + </ul> + </li> + <?php + } + } + ?> + </ul> + </form> +</div> - <?php if (!empty ($this->feeds)) { ?> - <?php foreach ($this->feeds as $feed) { ?> - <?php $nbEntries = $feed->nbEntries (); ?> - <li class="item<?php echo ($this->flux && $this->flux->id () == $feed->id ()) ? ' active' : ''; ?><?php echo $feed->inError () ? ' error' : ''; ?><?php echo $nbEntries == 0 ? ' empty' : ''; ?>"> - <a href="<?php echo _url ('configure', 'feed', 'id', $feed->id ()); ?>"> - <img class="favicon" src="<?php echo $feed->favicon (); ?>" alt="✇" /> - <?php echo $feed->name (); ?> - </a> - </li> - <?php } ?> - <?php } else { ?> - <li class="item disable"><?php echo Minz_Translate::t ('no_rss_feed'); ?></li> - <?php } ?> -</ul> +<script id="feed_config_template" type="text/html"> + <ul class="dropdown-menu"> + <li class="dropdown-close"><a href="#close">❌</a></li> + <li class="item"><a href="<?php echo _url('index', 'index', 'get', 'f_------'); ?>"><?php echo _t('gen.action.filter'); ?></a></li> + <?php if (FreshRSS_Auth::hasAccess()) { ?> + <li class="item"><a href="<?php echo _url('stats', 'repartition', 'id', '------'); ?>"><?php echo _t('index.menu.stats'); ?></a></li> + <?php } ?> + <li class="item"><a target="_blank" rel="noreferrer" href="http://example.net/"><?php echo _t('gen.action.see_website'); ?></a></li> + <?php if (FreshRSS_Auth::hasAccess()) { ?> + <li class="separator"></li> + <li class="item"><a href="<?php echo _url('subscription', 'index', 'id', '------'); ?>"><?php echo _t('gen.action.manage'); ?></a></li> + <li class="item"><a href="<?php echo _url('feed', 'actualize', 'id', '------'); ?>"><?php echo _t('gen.action.actualize'); ?></a></li> + <li class="item"> + <?php $confirm = FreshRSS_Context::$user_conf->reading_confirm ? 'confirm" disabled="disabled' : ''; ?> + <button class="read_all as-link <?php echo $confirm; ?>" + form="mark-read-aside" + formaction="<?php echo _url('entry', 'read', 'get', 'f_------'); ?>" + type="submit"><?php echo _t('gen.action.mark_read'); ?></button> + </li> + <?php } ?> + </ul> +</script> diff --git a/app/layout/aside_flux.phtml b/app/layout/aside_flux.phtml deleted file mode 100644 index 817dae676..000000000 --- a/app/layout/aside_flux.phtml +++ /dev/null @@ -1,88 +0,0 @@ -<div class="aside aside_flux" id="aside_flux"> - <a class="toggle_aside" href="#close"><?php echo FreshRSS_Themes::icon('close'); ?></a> - - <ul class="categories"> - <?php if ($this->loginOk) { ?> - <li> - <div class="stick"> - <a class="btn btn-important" href="<?php echo _url ('configure', 'feed'); ?>"><?php echo Minz_Translate::t ('subscription_management'); ?></a> - <a class="btn btn-important" href="<?php echo _url ('configure', 'categorize'); ?>" title="<?php echo Minz_Translate::t ('categories_management'); ?>"><?php echo FreshRSS_Themes::icon('category-white'); ?></a> - </div> - </li> - <?php } elseif (Minz_Configuration::needsLogin()) { ?> - <li><a href="<?php echo _url ('index', 'about'); ?>"><?php echo Minz_Translate::t ('about_freshrss'); ?></a></li> - <?php } ?> - - <?php - $arUrl = array('c' => 'index', 'a' => 'index', 'params' => array()); - if ($this->conf->view_mode !== Minz_Request::param('output', 'normal')) { - $arUrl['params']['output'] = 'normal'; - } - ?> - <li> - <div class="category all<?php echo $this->get_c == 'a' ? ' active' : ''; ?>"> - <a data-unread="<?php echo formatNumber($this->nb_not_read); ?>" class="btn<?php echo $this->get_c == 'a' ? ' active' : ''; ?>" href="<?php echo Minz_Url::display($arUrl); ?>"> - <?php echo FreshRSS_Themes::icon('all'); ?> - <?php echo Minz_Translate::t ('main_stream'); ?> - </a> - </div> - </li> - - <li> - <div class="category favorites<?php echo $this->get_c == 's' ? ' active' : ''; ?>"> - <a data-unread="<?php echo formatNumber($this->nb_favorites['unread']); ?>" class="btn<?php echo $this->get_c == 's' ? ' active' : ''; ?>" href="<?php $arUrl['params']['get'] = 's'; echo Minz_Url::display($arUrl); ?>"> - <?php echo FreshRSS_Themes::icon('bookmark'); ?> - <?php echo Minz_Translate::t('favorite_feeds', formatNumber($this->nb_favorites['all'])); ?> - </a> - </div> - </li> - - <?php - foreach ($this->cat_aside as $cat) { - $feeds = $cat->feeds (); - if (!empty ($feeds)) { - ?><li><?php - $c_active = false; - if ($this->get_c == $cat->id ()) { - $c_active = true; - } - ?><div class="category stick<?php echo $c_active ? ' active' : ''; ?>"><?php - ?><a data-unread="<?php echo formatNumber($cat->nbNotRead()); ?>" class="btn<?php echo $c_active ? ' active' : ''; ?>" href="<?php $arUrl['params']['get'] = 'c_' . $cat->id(); echo Minz_Url::display($arUrl); ?>"><?php echo $cat->name (); ?></a><?php - ?><a class="btn dropdown-toggle" href="#"><?php echo FreshRSS_Themes::icon($c_active ? 'up' : 'down'); ?></a><?php - ?></div><?php - ?><ul class="feeds<?php echo $c_active ? ' active' : ''; ?>"><?php - foreach ($feeds as $feed) { - $feed_id = $feed->id (); - $nbEntries = $feed->nbEntries (); - $f_active = ($this->get_f == $feed_id); - ?><li id="f_<?php echo $feed_id; ?>" class="item<?php echo $f_active ? ' active' : ''; ?><?php echo $feed->inError () ? ' error' : ''; ?><?php echo $nbEntries == 0 ? ' empty' : ''; ?>"><?php - ?><div class="dropdown"><?php - ?><div class="dropdown-target"></div><?php - ?><a class="dropdown-toggle" data-fweb="<?php echo $feed->website (); ?>"><?php echo FreshRSS_Themes::icon('configure'); ?></a><?php - /* feed_config_template */ - ?></div><?php - ?> <img class="favicon" src="<?php echo $feed->favicon (); ?>" alt="✇" /> <?php - ?><a class="feed" data-unread="<?php echo formatNumber($feed->nbNotRead()); ?>" data-priority="<?php echo $feed->priority (); ?>" href="<?php $arUrl['params']['get'] = 'f_' . $feed_id; echo Minz_Url::display($arUrl); ?>"><?php echo $feed->name(); ?></a><?php - ?></li><?php - } - ?></ul><?php - ?></li><?php - } - } ?> - </ul> - <span class="aside_flux_ender"><!-- For fixed menu --></span> -</div> - -<script id="feed_config_template" type="text/html"> - <ul class="dropdown-menu"> - <li class="dropdown-close"><a href="#close">❌</a></li> - <li class="item"><a href="<?php echo _url ('index', 'index', 'get', 'f_!!!!!!'); ?>"><?php echo Minz_Translate::t ('filter'); ?></a></li> - <li class="item"><a target="_blank" href="http://example.net/"><?php echo Minz_Translate::t ('see_website'); ?></a></li> - <?php if ($this->loginOk) { ?> - <li class="separator"></li> - <li class="item"><a href="<?php echo _url ('configure', 'feed', 'id', '!!!!!!'); ?>"><?php echo Minz_Translate::t ('administration'); ?></a></li> - <li class="item"><a href="<?php echo _url ('feed', 'actualize', 'id', '!!!!!!'); ?>"><?php echo Minz_Translate::t ('actualize'); ?></a></li> - <li class="item"><a href="<?php echo _url ('entry', 'read', 'get', 'f_!!!!!!'); ?>"><?php echo Minz_Translate::t ('mark_read'); ?></a></li> - <?php } ?> - </ul> -</script> diff --git a/app/layout/aside_stats.phtml b/app/layout/aside_stats.phtml new file mode 100644 index 000000000..4bdaf7165 --- /dev/null +++ b/app/layout/aside_stats.phtml @@ -0,0 +1,12 @@ +<ul class="nav nav-list aside"> + <li class="nav-header"><?php echo _t('admin.stats'); ?></li> + <li class="item<?php echo Minz_Request::actionName() == 'index' ? ' active' : ''; ?>"> + <a href="<?php echo _url('stats', 'index'); ?>"><?php echo _t('admin.stats.menu.main'); ?></a> + </li> + <li class="item<?php echo Minz_Request::actionName() == 'idle' ? ' active' : ''; ?>"> + <a href="<?php echo _url('stats', 'idle'); ?>"><?php echo _t('admin.stats.menu.idle'); ?></a> + </li> + <li class="item<?php echo Minz_Request::actionName() == 'repartition' ? ' active' : ''; ?>"> + <a href="<?php echo _url('stats', 'repartition'); ?>"><?php echo _t('admin.stats.menu.repartition'); ?></a> + </li> +</ul> diff --git a/app/layout/aside_subscription.phtml b/app/layout/aside_subscription.phtml new file mode 100644 index 000000000..e14afe2a7 --- /dev/null +++ b/app/layout/aside_subscription.phtml @@ -0,0 +1,17 @@ +<ul class="nav nav-list aside"> + <li class="nav-header"><?php echo _t('sub.menu.subscription_management'); ?></li> + + <li class="item<?php echo Minz_Request::controllerName() == 'subscription' ? ' active' : ''; ?>"> + <a href="<?php echo _url('subscription', 'index'); ?>"><?php echo _t('sub.menu.subscription_management'); ?></a> + </li> + + <li class="item<?php echo Minz_Request::controllerName() == 'importExport' ? ' active' : ''; ?>"> + <a href="<?php echo _url('importExport', 'index'); ?>"><?php echo _t('sub.menu.import_export'); ?></a> + </li> + + <li class="item"> + <a class="bookmarkClick" href="javascript:(function(){var%20url%20=%20location.href;var%20otherWindow=window.open('about:blank','_blank');otherWindow.opener=null;otherWindow.location='<?php echo Minz_Url::display(array('c' => 'feed', 'a' => 'add'), 'html', true); ?>&url_rss='+encodeURIComponent(url);})();"> + <?php echo _t('sub.menu.bookmark'); ?> + </a> + </li> +</ul> diff --git a/app/layout/header.phtml b/app/layout/header.phtml index d20f7487f..238c664b0 100644 --- a/app/layout/header.phtml +++ b/app/layout/header.phtml @@ -1,22 +1,12 @@ <?php -if (Minz_Configuration::canLogIn()) { + +if (FreshRSS_Auth::accessNeedsAction()) { ?><ul class="nav nav-head nav-login"><?php - switch (Minz_Configuration::authType()) { - case 'form': - if ($this->loginOk) { - ?><li class="item"><?php echo FreshRSS_Themes::icon('logout'); ?> <a class="signout" href="<?php echo _url ('index', 'formLogout'); ?>"><?php echo Minz_Translate::t ('logout'); ?></a></li><?php - } else { - ?><li class="item"><?php echo FreshRSS_Themes::icon('login'); ?> <a class="signin" href="<?php echo _url ('index', 'formLogin'); ?>"><?php echo Minz_Translate::t ('login'); ?></a></li><?php - } - break; - case 'persona': - if ($this->loginOk) { - ?><li class="item"><?php echo FreshRSS_Themes::icon('logout'); ?> <a class="signout" href="#"><?php echo Minz_Translate::t ('logout'); ?></a></li><?php - } else { - ?><li class="item"><?php echo FreshRSS_Themes::icon('login'); ?> <a class="signin" href="#"><?php echo Minz_Translate::t ('login'); ?></a></li><?php - } - break; - } + if (FreshRSS_Auth::hasAccess()) { + ?><li class="item"><?php echo _i('logout'); ?> <a class="signout" href="<?php echo _url('auth', 'logout'); ?>"><?php echo _t('gen.auth.logout'); ?></a></li><?php + } else { + ?><li class="item"><?php echo _i('login'); ?> <a class="signin" href="<?php echo _url('auth', 'login'); ?>"><?php echo _t('gen.auth.login'); ?></a></li><?php + } ?></ul><?php } ?> @@ -24,84 +14,80 @@ if (Minz_Configuration::canLogIn()) { <div class="header"> <div class="item title"> <h1> - <a href="<?php echo _url ('index', 'index'); ?>"> - <img class="logo" src="<?php echo Minz_Url::display ('/themes/icons/icon.svg'); ?>" alt="⊚" /> - <?php echo Minz_Configuration::title (); ?> + <a href="<?php echo _url('index', 'index'); ?>"> + <img class="logo" src="<?php echo _i('icon', true); ?>" alt="⊚" /> + <?php echo FreshRSS_Context::$system_conf->title; ?> </a> </h1> </div> <div class="item search"> - <?php if ($this->loginOk || Minz_Configuration::allowAnonymous()) { ?> - <form action="<?php echo _url ('index', 'index'); ?>" method="get"> + <?php if (FreshRSS_Auth::hasAccess() || FreshRSS_Context::$system_conf->allow_anonymous) { ?> + <form action="<?php echo _url('index', 'index'); ?>" method="get"> <div class="stick"> - <?php $search = Minz_Request::param ('search', ''); ?> - <input type="search" name="search" id="search" class="extend" value="<?php echo $search; ?>" placeholder="<?php echo Minz_Translate::t ('search'); ?>" /> + <input type="search" name="search" id="search" class="extend" value="<?php echo FreshRSS_Context::$search; ?>" placeholder="<?php echo _t('gen.menu.search'); ?>" /> - <?php $get = Minz_Request::param ('get', ''); ?> - <?php if($get != '') { ?> + <?php $get = Minz_Request::param('get', ''); ?> + <?php if ($get != '') { ?> <input type="hidden" name="get" value="<?php echo $get; ?>" /> <?php } ?> - <?php $order = Minz_Request::param ('order', ''); ?> - <?php if($order != '') { ?> + <?php $order = Minz_Request::param('order', ''); ?> + <?php if ($order != '') { ?> <input type="hidden" name="order" value="<?php echo $order; ?>" /> <?php } ?> - <?php $state = Minz_Request::param ('state', ''); ?> - <?php if($state != '') { ?> + <?php $state = Minz_Request::param('state', ''); ?> + <?php if ($state != '') { ?> <input type="hidden" name="state" value="<?php echo $state; ?>" /> <?php } ?> - <button class="btn" type="submit"><?php echo FreshRSS_Themes::icon('search'); ?></button> + <button class="btn" type="submit"><?php echo _i('search'); ?></button> </div> </form> <?php } ?> </div> - <?php if ($this->loginOk) { ?> + <?php if (FreshRSS_Auth::hasAccess()) { ?> <div class="item configure"> <div class="dropdown"> <div id="dropdown-configure" class="dropdown-target"></div> - <a class="btn dropdown-toggle" href="#dropdown-configure"><?php echo FreshRSS_Themes::icon('configure'); ?></a> + <a class="btn dropdown-toggle" href="#dropdown-configure"><?php echo _i('configure'); ?></a> <ul class="dropdown-menu"> <li class="dropdown-close"><a href="#close">❌</a></li> - <li class="dropdown-header"><?php echo Minz_Translate::t ('configuration'); ?></li> - <li class="item"><a href="<?php echo _url ('configure', 'display'); ?>"><?php echo Minz_Translate::t ('reading_configuration'); ?></a></li> - <li class="item"><a href="<?php echo _url ('configure', 'archiving'); ?>"><?php echo Minz_Translate::t ('archiving_configuration'); ?></a></li> - <li class="item"><a href="<?php echo _url ('configure', 'sharing'); ?>"><?php echo Minz_Translate::t ('sharing'); ?></a></li> - <li class="item"><a href="<?php echo _url ('configure', 'shortcut'); ?>"><?php echo Minz_Translate::t ('shortcuts'); ?></a></li> + <li class="dropdown-header"><?php echo _t('gen.menu.configuration'); ?></li> + <li class="item"><a href="<?php echo _url('configure', 'display'); ?>"><?php echo _t('gen.menu.display'); ?></a></li> + <li class="item"><a href="<?php echo _url('configure', 'reading'); ?>"><?php echo _t('gen.menu.reading'); ?></a></li> + <li class="item"><a href="<?php echo _url('configure', 'archiving'); ?>"><?php echo _t('gen.menu.archiving'); ?></a></li> + <li class="item"><a href="<?php echo _url('configure', 'sharing'); ?>"><?php echo _t('gen.menu.sharing'); ?></a></li> + <li class="item"><a href="<?php echo _url('configure', 'shortcut'); ?>"><?php echo _t('gen.menu.shortcuts'); ?></a></li> + <li class="item"><a href="<?php echo _url('configure', 'queries'); ?>"><?php echo _t('gen.menu.queries'); ?></a></li> + <li class="item"><a href="<?php echo _url('user', 'profile'); ?>"><?php echo _t('gen.menu.user_profile'); ?></a></li> + <li class="item"><a href="<?php echo _url('extension', 'index'); ?>"><?php echo _t('gen.menu.extensions'); ?></a></li> + <?php if (FreshRSS_Auth::hasAccess('admin')) { ?> <li class="separator"></li> - <li class="item"><a href="<?php echo _url ('configure', 'users'); ?>"><?php echo Minz_Translate::t ('users'); ?></a></li> + <li class="dropdown-header"><?php echo _t('gen.menu.admin'); ?></li> + <li class="item"><a href="<?php echo _url('configure', 'system'); ?>"><?php echo _t('gen.menu.system'); ?></a></li> + <li class="item"><a href="<?php echo _url('user', 'manage'); ?>"><?php echo _t('gen.menu.user_management'); ?></a></li> + <li class="item"><a href="<?php echo _url('auth', 'index'); ?>"><?php echo _t('gen.menu.authentication'); ?></a></li> + <li class="item"><a href="<?php echo _url('update', 'checkInstall'); ?>"><?php echo _t('gen.menu.check_install'); ?></a></li> + <li class="item"><a href="<?php echo _url('update', 'index'); ?>"><?php echo _t('gen.menu.update'); ?></a></li> + <?php } ?> <li class="separator"></li> - <li class="item"><a href="<?php echo _url ('index', 'stats'); ?>"><?php echo Minz_Translate::t ('stats'); ?></a></li> - <li class="item"><a href="<?php echo _url ('index', 'logs'); ?>"><?php echo Minz_Translate::t ('logs'); ?></a></li> - <li class="item"><a href="<?php echo _url ('index', 'about'); ?>"><?php echo Minz_Translate::t ('about'); ?></a></li> + <li class="item"><a href="<?php echo _url('stats', 'index'); ?>"><?php echo _t('gen.menu.stats'); ?></a></li> + <li class="item"><a href="<?php echo _url('index', 'logs'); ?>"><?php echo _t('gen.menu.logs'); ?></a></li> + <li class="item"><a href="<?php echo _url('index', 'about'); ?>"><?php echo _t('gen.menu.about'); ?></a></li> <?php - if (Minz_Configuration::canLogIn()) { - ?><li class="separator"></li><?php - switch (Minz_Configuration::authType()) { - case 'form': - ?><li class="item"><a class="signout" href="<?php echo _url ('index', 'formLogout'); ?>"><?php echo FreshRSS_Themes::icon('logout'), ' ', Minz_Translate::t ('logout'); ?></a></li><?php - break; - case 'persona': - ?><li class="item"><a class="signout" href="#"><?php echo FreshRSS_Themes::icon('logout'), ' ', Minz_Translate::t ('logout'); ?></a></li><?php - break; - } + if (FreshRSS_Auth::accessNeedsAction()) { + ?><li class="separator"></li> + <li class="item"><a class="signout" href="<?php echo _url('auth', 'logout'); ?>"><?php echo _i('logout'), ' ', _t('gen.auth.logout'); ?></a></li><?php } ?> </ul> </div> </div> - <?php } elseif (Minz_Configuration::canLogIn()) { - ?><div class="item configure"><?php - switch (Minz_Configuration::authType()) { - case 'form': - echo FreshRSS_Themes::icon('login'); ?><a class="signin" href="<?php echo _url ('index', 'formLogin'); ?>"><?php echo Minz_Translate::t ('login'); ?></a></li><?php - break; - case 'persona': - echo FreshRSS_Themes::icon('login'); ?><a class="signin" href="#"><?php echo Minz_Translate::t ('login'); ?></a></li><?php - break; - } - ?></div><?php - } ?> + <?php } elseif (FreshRSS_Auth::accessNeedsAction()) { ?> + <div class="item configure"> + <?php echo _i('login'); ?><a class="signin" href="<?php echo _url('auth', 'login'); ?>"><?php echo _t('gen.auth.login'); ?></a> + </div> + <?php } ?> </div> diff --git a/app/layout/layout.phtml b/app/layout/layout.phtml index 1501df3c3..1f11e0af1 100644 --- a/app/layout/layout.phtml +++ b/app/layout/layout.phtml @@ -1,53 +1,78 @@ +<?php FreshRSS::preLayout(); ?> <!DOCTYPE html> -<html lang="<?php echo $this->conf->language; ?>" xml:lang="<?php echo $this->conf->language; ?>"> +<html lang="<?php echo FreshRSS_Context::$user_conf->language; ?>" xml:lang="<?php echo FreshRSS_Context::$user_conf->language; ?>"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="initial-scale=1.0" /> - <?php echo self::headTitle (); ?> - <?php echo self::headStyle (); ?> - <?php echo self::headScript (); ?> - <script>//<![CDATA[ -<?php $this->renderHelper ('javascript_vars'); ?> - //]]></script> -<?php - if (!empty($this->nextId)) { - $params = Minz_Request::params (); - $params['next'] = $this->nextId; -?> - <link id="prefetch" rel="next prefetch" href="<?php echo Minz_Url::display (array ('c' => Minz_Request::controllerName (), 'a' => Minz_Request::actionName (), 'params' => $params)); ?>" /> -<?php } ?> - <link rel="shortcut icon" type="image/x-icon" sizes="16x16 64x64" href="<?php echo Minz_Url::display('/favicon.ico'); ?>" /> + <?php echo self::headStyle(); ?> + <script id="jsonVars" type="application/json"> +<?php $this->renderHelper('javascript_vars'); ?> + </script> + <?php echo self::headScript(); ?> + <link rel="shortcut icon" id="favicon" type="image/x-icon" sizes="16x16 64x64" href="<?php echo Minz_Url::display('/favicon.ico'); ?>" /> <link rel="icon msapplication-TileImage apple-touch-icon" type="image/png" sizes="256x256" href="<?php echo Minz_Url::display('/themes/icons/favicon-256.png'); ?>" /> -<?php if (isset ($this->rss_url)) { ?> - <link rel="alternate" type="application/rss+xml" title="<?php echo $this->rss_title; ?>" href="<?php echo Minz_Url::display ($this->rss_url); ?>" /> -<?php } ?> - <link rel="prefetch" href="<?php echo FreshRSS_Themes::icon('starred', true); ?>"> - <link rel="prefetch" href="<?php echo FreshRSS_Themes::icon('non-starred', true); ?>"> - <link rel="prefetch" href="<?php echo FreshRSS_Themes::icon('read', true); ?>"> - <link rel="prefetch" href="<?php echo FreshRSS_Themes::icon('unread', true); ?>"> + <link rel="prefetch" href="<?php echo FreshRSS_Themes::icon('starred', true); ?>" /> + <link rel="prefetch" href="<?php echo FreshRSS_Themes::icon('non-starred', true); ?>" /> + <link rel="prefetch" href="<?php echo FreshRSS_Themes::icon('read', true); ?>" /> + <link rel="prefetch" href="<?php echo FreshRSS_Themes::icon('unread', true); ?>" /> + <link rel="apple-touch-icon" href="<?php echo Minz_Url::display('/themes/icons/apple-touch-icon.png'); ?>" /> + <meta name="apple-mobile-web-app-capable" content="yes" /> + <meta name="apple-mobile-web-app-status-bar-style" content="black" /> + <meta name="apple-mobile-web-app-title" content="<?php echo FreshRSS_Context::$system_conf->title; ?>"> <meta name="msapplication-TileColor" content="#FFF" /> +<?php if (!FreshRSS_Context::$system_conf->allow_referrer) { ?> + <meta name="referrer" content="never" /> +<?php + } + flush(); + if (isset($this->callbackBeforeContent)) { + call_user_func($this->callbackBeforeContent, $this); + } +?> + <?php echo self::headTitle(); ?> +<?php + $url_base = Minz_Request::currentRequest(); + if (FreshRSS_Context::$next_id !== '') { + $url_next = $url_base; + $url_next['params']['next'] = FreshRSS_Context::$next_id; + $url_next['params']['ajax'] = 1; +?> + <link id="prefetch" rel="next prefetch" href="<?php echo Minz_Url::display($url_next); ?>" /> +<?php + } if (isset($this->rss_title)) { + $url_rss = $url_base; + $url_rss['a'] = 'rss'; + if (FreshRSS_Context::$user_conf->since_hours_posts_per_rss) { + $url_rss['params']['hours'] = FreshRSS_Context::$user_conf->since_hours_posts_per_rss; + } +?> + <link rel="alternate" type="application/rss+xml" title="<?php echo $this->rss_title; ?>" href="<?php echo Minz_Url::display($url_rss); ?>" /> +<?php } if (FreshRSS_Context::$system_conf->allow_robots) { ?> + <meta name="description" content="<?php echo htmlspecialchars(FreshRSS_Context::$name . ' | ' . FreshRSS_Context::$description, ENT_COMPAT, 'UTF-8'); ?>" /> +<?php } else { ?> <meta name="robots" content="noindex,nofollow" /> +<?php } ?> </head> - <body class="<?php echo Minz_Request::param('output', 'normal'); ?>"> -<?php $this->partial ('header'); ?> + <body class="<?php echo Minz_Request::actionName(); ?>"> +<?php $this->partial('header'); ?> <div id="global"> - <?php $this->render (); ?> + <?php $this->render(); ?> </div> <?php $msg = ''; $status = 'closed'; - if (isset ($this->notification)) { + if (isset($this->notification)) { $msg = $this->notification['content']; $status = $this->notification['type']; invalidateHttpCache(); } ?> -<div id="notification" class="<?php echo $status; ?>"> +<div id="notification" class="notification <?php echo $status; ?>"> <span class="msg"><?php echo $msg; ?></span> - <a class="close" href=""><?php echo FreshRSS_Themes::icon('close'); ?></a> + <a class="close" href=""><?php echo _i('close'); ?></a> </div> </body> </html> diff --git a/app/layout/nav_entries.phtml b/app/layout/nav_entries.phtml index 3141e92a0..ca6849193 100644 --- a/app/layout/nav_entries.phtml +++ b/app/layout/nav_entries.phtml @@ -1,5 +1,5 @@ <ul id="nav_entries"> - <li class="item"><a class="previous_entry" href="#"><?php echo FreshRSS_Themes::icon('prev'); ?></a></li> - <li class="item"><a class="up" href="#"><?php echo FreshRSS_Themes::icon('up'); ?></a></li> - <li class="item"><a class="next_entry" href="#"><?php echo FreshRSS_Themes::icon('next'); ?></a></li> + <li class="item"><a class="previous_entry" href="#"><?php echo _i('prev'); ?></a></li> + <li class="item"><a class="up" href="#"><?php echo _i('up'); ?></a></li> + <li class="item"><a class="next_entry" href="#"><?php echo _i('next'); ?></a></li> </ul>
\ No newline at end of file diff --git a/app/layout/nav_menu.phtml b/app/layout/nav_menu.phtml index 98064a6f7..f6d824d55 100644 --- a/app/layout/nav_menu.phtml +++ b/app/layout/nav_menu.phtml @@ -1,228 +1,204 @@ -<?php - $actual_view = Minz_Request::param('output', 'normal'); -?> +<?php $actual_view = Minz_Request::actionName(); ?> + <div class="nav_menu"> <?php if ($actual_view === 'normal') { ?> - <a class="btn toggle_aside" href="#aside_flux"><?php echo FreshRSS_Themes::icon('category'); ?></a> + <a class="btn toggle_aside" href="#aside_feed"><?php echo _i('category'); ?></a> <?php } ?> - <?php if ($this->loginOk || Minz_Configuration::allowAnonymousRefresh()) { ?> - <a id="actualize" class="btn" href="<?php echo _url ('feed', 'actualize'); ?>"><?php echo FreshRSS_Themes::icon('refresh'); ?></a> - <?php } ?> + <?php if (FreshRSS_Auth::hasAccess()) { ?> + <div id="nav_menu_actions" class="stick"> + <?php + $states = array( + 'read' => FreshRSS_Entry::STATE_READ, + 'unread' => FreshRSS_Entry::STATE_NOT_READ, + 'starred' => FreshRSS_Entry::STATE_FAVORITE, + 'non-starred' => FreshRSS_Entry::STATE_NOT_FAVORITE, + ); + + foreach ($states as $state_str => $state) { + $state_enabled = FreshRSS_Context::isStateEnabled($state); + $url_state = Minz_Request::currentRequest(); + $url_state['params']['state'] = FreshRSS_Context::getRevertState($state); + ?> + <a id="toggle-<?php echo $state_str; ?>" + class="btn <?php echo $state_enabled ? 'active' : ''; ?>" + role="checkbox" aria-checked="<?php echo $state_enabled ? 'true' : 'false'; ?>" + title="<?php echo _t('index.menu.' . $state_str); ?>" + href="<?php echo Minz_Url::display($url_state); ?>"><?php echo _i($state_str); ?></a> + <?php } ?> + + <div class="dropdown"> + <div id="dropdown-query" class="dropdown-target"></div> + + <a class="dropdown-toggle btn" href="#dropdown-query"><?php echo _i('down'); ?></a> + <ul class="dropdown-menu"> + <li class="dropdown-close"><a href="#close">❌</a></li> + + <li class="dropdown-header"> + <?php echo _t('index.menu.queries'); ?> + <a class="no-mobile" href="<?php echo _url('configure', 'queries'); ?>"><?php echo _i('configure'); ?></a> + </li> + + <?php foreach (FreshRSS_Context::$user_conf->queries as $query) { ?> + <li class="item query"> + <a href="<?php echo $query['url']; ?>"><?php echo $query['name']; ?></a> + </li> + <?php } ?> + + <?php if (count(FreshRSS_Context::$user_conf->queries) > 0) { ?> + <li class="separator no-mobile"></li> + <?php } ?> + + <?php + $url_query = Minz_Request::currentRequest();; + $url_query['c'] = 'configure'; + $url_query['a'] = 'addQuery'; + ?> + <li class="item no-mobile"><a href="<?php echo Minz_Url::display($url_query); ?>"><?php echo _i('bookmark-add'); ?> <?php echo _t('index.menu.add_query'); ?></a></li> + </ul> + </div> + </div> - <?php if ($this->loginOk) { ?> <?php - $get = false; - $string_mark = Minz_Translate::t ('mark_all_read'); - if ($this->get_f) { - $get = 'f_' . $this->get_f; - $string_mark = Minz_Translate::t ('mark_feed_read'); - } elseif ($this->get_c && $this->get_c != 'a') { - if ($this->get_c === 's') { - $get = 's'; - } else { - $get = 'c_' . $this->get_c; - } - $string_mark = Minz_Translate::t ('mark_cat_read'); - } - $nextGet = $get; - if ($this->conf->onread_jump_next && (strlen ($get) > 2)) { - $anotherUnreadId = ''; - $foundCurrent = false; - switch ($get[0]) { - case 'c': - foreach ($this->cat_aside as $cat) { - if ($cat->id () == $this->get_c) { - $foundCurrent = true; - continue; - } - if ($cat->nbNotRead () <= 0) continue; - $anotherUnreadId = $cat->id (); - if ($foundCurrent) break; - } - $nextGet = empty ($anotherUnreadId) ? 'a' : 'c_' . $anotherUnreadId; - break; - case 'f': - foreach ($this->cat_aside as $cat) { - if ($cat->id () == $this->get_c) { - foreach ($cat->feeds () as $feed) { - if ($feed->id () == $this->get_f) { - $foundCurrent = true; - continue; - } - if ($feed->nbNotRead () <= 0) continue; - $anotherUnreadId = $feed->id (); - if ($foundCurrent) break; - } - break; - } - } - $nextGet = empty ($anotherUnreadId) ? 'c_' . $this->get_c : 'f_' . $anotherUnreadId; - break; - } + $get = FreshRSS_Context::currentGet(); + $string_mark = _t('index.menu.mark_all_read'); + if ($get[0] == 'f') { + $string_mark = _t('index.menu.mark_feed_read'); + } elseif ($get[0] == 'c') { + $string_mark = _t('index.menu.mark_cat_read'); } - $p = isset($this->entries[0]) ? $this->entries[0] : null; - $idMax = $p === null ? '0' : $p->id(); - $arUrl = array('c' => 'entry', 'a' => 'read', 'params' => array('get' => $get, 'nextGet' => $nextGet, 'idMax' => $idMax)); - $output = Minz_Request::param('output', ''); - if (($output != '') && ($this->conf->view_mode !== $output)) { - $arUrl['params']['output'] = $output; - } - $markReadUrl = Minz_Url::display($arUrl); - Minz_Session::_param ('markReadUrl', $markReadUrl); + $mark_read_url = array( + 'c' => 'entry', + 'a' => 'read', + 'params' => array( + 'get' => $get, + 'nextGet' => FreshRSS_Context::$next_get, + 'idMax' => FreshRSS_Context::$id_max, + 'search' => FreshRSS_Context::$search, + 'state' => FreshRSS_Context::$state, + ) + ); ?> <div class="stick" id="nav_menu_read_all"> - <a class="read_all btn" href="<?php echo $markReadUrl; ?>"><?php echo Minz_Translate::t ('mark_read'); ?></a> + <form id="mark-read-menu" method="post"> + <?php $confirm = FreshRSS_Context::$user_conf->reading_confirm ? 'confirm" disabled="disabled' : ''; ?> + <button class="read_all btn <?php echo $confirm; ?>" + form="mark-read-menu" + formaction="<?php echo Minz_Url::display($mark_read_url); ?>" + type="submit"><?php echo _t('gen.action.mark_read'); ?></button> + <div class="dropdown"> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> <div id="dropdown-read" class="dropdown-target"></div> - <a class="dropdown-toggle btn" href="#dropdown-read"><?php echo FreshRSS_Themes::icon('down'); ?></a> + <a class="dropdown-toggle btn" href="#dropdown-read"><?php echo _i('down'); ?></a> <ul class="dropdown-menu"> <li class="dropdown-close"><a href="#close">❌</a></li> - <li class="item"><a href="<?php echo $markReadUrl; ?>"><?php echo $string_mark; ?></a></li> + <li class="item"> + <button class="as-link <?php echo $confirm; ?>" + form="mark-read-menu" + formaction="<?php echo Minz_Url::display($mark_read_url); ?>" + type="submit"><?php echo $string_mark; ?></button> + </li> <li class="separator"></li> <?php - $today = $this->today; - $one_week = $today - 604800; + $today = @strtotime('today'); + $mark_before_today = $mark_read_url; + $mark_before_today['params']['idMax'] = $today . '000000'; + $mark_before_one_week = $mark_read_url; + $mark_before_one_week['params']['idMax'] = ($today - 604800) . '000000'; ?> - <li class="item"><a href="<?php echo _url ('entry', 'read', 'is_read', 1, 'get', $get, 'idMax', $today . '000000'); ?>"><?php echo Minz_Translate::t ('before_one_day'); ?></a></li> - <li class="item"><a href="<?php echo _url ('entry', 'read', 'is_read', 1, 'get', $get, 'idMax', $one_week . '000000'); ?>"><?php echo Minz_Translate::t ('before_one_week'); ?></a></li> + <li class="item"> + <button class="as-link <?php echo $confirm; ?>" + form="mark-read-menu" + formaction="<?php echo Minz_Url::display($mark_before_today); ?>" + type="submit"><?php echo _t('index.menu.before_one_day'); ?></button> + </li> + <li class="item"> + <button class="as-link <?php echo $confirm; ?>" + form="mark-read-menu" + formaction="<?php echo Minz_Url::display($mark_before_one_week); ?>" + type="submit"><?php echo _t('index.menu.before_one_week'); ?></button> + </li> </ul> </div> + </form> </div> <?php } ?> - <?php - $params = Minz_Request::params (); - if (isset ($params['search'])) { - $params['search'] = urlencode ($params['search']); - } - $url = array ( - 'c' => 'index', - 'a' => 'index', - 'params' => $params - ); - ?> - <div class="dropdown" id="nav_menu_views"> - <div id="dropdown-views" class="dropdown-target"></div> - <a class="dropdown-toggle btn" href="#dropdown-views"><?php echo Minz_Translate::t ('display'); ?> <?php echo FreshRSS_Themes::icon('down'); ?></a> - <ul class="dropdown-menu"> - <li class="dropdown-close"><a href="#close">❌</a></li> - - <?php - $url_output = $url; - if ($actual_view !== 'normal') { ?> - <li class="item"> - <?php $url_output['params']['output'] = 'normal'; ?> - <a class="view_normal" href="<?php echo Minz_Url::display ($url_output); ?>"> - <?php echo Minz_Translate::t ('normal_view'); ?> - </a> - </li> - <?php } if($actual_view !== 'reader') { ?> - <li class="item"> - <?php $url_output['params']['output'] = 'reader'; ?> - <a class="view_normal" href="<?php echo Minz_Url::display ($url_output); ?>"> - <?php echo Minz_Translate::t ('reader_view'); ?> - </a> - </li> - <?php } if($actual_view !== 'global') { ?> - <li class="item"> - <?php $url_output['params']['output'] = 'global'; ?> - <a class="view_normal" href="<?php echo Minz_Url::display ($url_output); ?>"> - <?php echo Minz_Translate::t ('global_view'); ?> - </a> - </li> - <?php } ?> - - <li class="separator"></li> - - <?php - $url_state = $url; - $url_state['params']['state'] = 'all'; - ?> - <li class="item" role="checkbox" aria-checked="<?php echo ($this->state === 'all') ? 'true' :'false'; ?>"> - <a class="print_all" href="<?php echo Minz_Url::display ($url_state); ?>"> - <?php echo Minz_Translate::t ('show_all_articles'); ?> - </a> - </li> - <?php - $url_state['params']['state'] = 'not_read'; - ?> - <li class="item" role="checkbox" aria-checked="<?php echo ($this->state === 'not_read') ? 'true' :'false'; ?>"> - <a class="print_non_read" href="<?php echo Minz_Url::display ($url_state); ?>"> - <?php echo Minz_Translate::t ('show_not_reads'); ?> - </a> - </li> - <?php - $url_state['params']['state'] = 'read'; - ?> - <li class="item" role="checkbox" aria-checked="<?php echo ($this->state === 'read') ? 'true' :'false'; ?>"> - <a class="print_read" href="<?php echo Minz_Url::display ($url_state); ?>"> - <?php echo Minz_Translate::t ('show_read'); ?> - </a> - </li> - <?php - $url_state['params']['state'] = 'favorite'; - ?> - <li class="item" role="checkbox" aria-checked="<?php echo ($this->state === 'favorite') ? 'true' :'false'; ?>"> - <a class="print_favorite" href="<?php echo Minz_Url::display ($url_state); ?>"> - <?php echo Minz_Translate::t ('show_favorite'); ?> - </a> - </li> - - <li class="separator"></li> - - <li class="item"> - <?php - $url_order = $url; - if ($this->order === 'DESC') { - $url_order['params']['order'] = 'ASC'; - ?> - <a href="<?php echo Minz_Url::display ($url_order); ?>"> - <?php echo Minz_Translate::t ('older_first'); ?> - </a> - <?php - } else { - $url_order['params']['order'] = 'DESC'; - ?> - <a href="<?php echo Minz_Url::display ($url_order); ?>"> - <?php echo Minz_Translate::t ('newer_first'); ?> - </a> - <?php } ?> - </li> - - <li class="separator"></li> - - <li class="item"> - <a class="view_rss" target="_blank" href="<?php echo Minz_Url::display ($this->rss_url); ?>"> - <?php echo Minz_Translate::t ('rss_view'); ?> - </a> - </li> - </ul> + <?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 + $url_output['a'] = 'rss'; + if (FreshRSS_Context::$user_conf->token) { + $url_output['params']['token'] = FreshRSS_Context::$user_conf->token; + } + if (FreshRSS_Context::$user_conf->since_hours_posts_per_rss) { + $url_output['params']['hours'] = FreshRSS_Context::$user_conf->since_hours_posts_per_rss; + } + ?> + <a class="view_rss btn" target="_blank" rel="noreferrer" title="<?php echo _t('index.menu.rss_view'); ?>" href="<?php echo Minz_Url::display($url_output); ?>"> + <?php echo _i('rss'); ?> + </a> </div> <div class="item search"> - <form action="<?php echo _url ('index', 'index'); ?>" method="get"> - <?php $search = Minz_Request::param ('search', ''); ?> - <input type="search" name="search" class="extend" value="<?php echo $search; ?>" placeholder="<?php echo Minz_Translate::t ('search_short'); ?>" /> + <form action="<?php echo _url('index', 'index'); ?>" method="get"> + <input type="search" name="search" class="extend" value="<?php echo FreshRSS_Context::$search; ?>" placeholder="<?php echo _t('index.menu.search_short'); ?>" /> - <?php $get = Minz_Request::param ('get', ''); ?> + <?php $get = Minz_Request::param('get', ''); ?> <?php if($get != '') { ?> <input type="hidden" name="get" value="<?php echo $get; ?>" /> <?php } ?> - <?php $order = Minz_Request::param ('order', ''); ?> + <?php $order = Minz_Request::param('order', ''); ?> <?php if($order != '') { ?> <input type="hidden" name="order" value="<?php echo $order; ?>" /> <?php } ?> - <?php $state = Minz_Request::param ('state', ''); ?> + <?php $state = Minz_Request::param('state', ''); ?> <?php if($state != '') { ?> <input type="hidden" name="state" value="<?php echo $state; ?>" /> <?php } ?> </form> </div> + + <?php + if (FreshRSS_Context::$order === 'DESC') { + $order = 'ASC'; + $icon = 'up'; + $title = 'index.menu.older_first'; + } else { + $order = 'DESC'; + $icon = 'down'; + $title = 'index.menu.newer_first'; + } + $url_order = Minz_Request::currentRequest(); + $url_order['params']['order'] = $order; + ?> + <a id="toggle-order" class="btn" href="<?php echo Minz_Url::display($url_order); ?>" title="<?php echo _t($title); ?>"> + <?php echo _i($icon); ?> + </a> + + <?php if (FreshRSS_Auth::hasAccess() || FreshRSS_Context::$system_conf->allow_anonymous_refresh) { ?> + <a id="actualize" class="btn" href="<?php echo _url('feed', 'actualize'); ?>" title="<?php echo _t('gen.action.actualize'); ?>"><?php echo _i('refresh'); ?></a> + <?php } ?> </div> |
