aboutsummaryrefslogtreecommitdiff
path: root/app/layout
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-10-24 15:17:07 +0200
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-10-24 15:17:07 +0200
commit3e2d34c8671acae33568fdeb1398afad8296d9bf (patch)
tree6a8fa1430115d12e78855362e093dae9667008f8 /app/layout
parent5d7d01be296a23058026e0dc610b2e2077b3262c (diff)
parent83d95ca4b894a84de467a97c7f413c1d04c43631 (diff)
Merge branch '634-refactor-with-context' into dev
Diffstat (limited to 'app/layout')
-rw-r--r--app/layout/aside_feed.phtml95
-rw-r--r--app/layout/aside_flux.phtml103
-rw-r--r--app/layout/aside_subscription.phtml2
-rw-r--r--app/layout/layout.phtml19
-rw-r--r--app/layout/nav_menu.phtml205
5 files changed, 155 insertions, 269 deletions
diff --git a/app/layout/aside_feed.phtml b/app/layout/aside_feed.phtml
new file mode 100644
index 000000000..3c23e0178
--- /dev/null
+++ b/app/layout/aside_feed.phtml
@@ -0,0 +1,95 @@
+<?php
+ $class = '';
+ if (FreshRSS_Context::$conf->hide_read_feeds &&
+ FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_NOT_READ) &&
+ !FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_READ)) {
+ $class = ' state_unread';
+ }
+?>
+
+<div class="aside aside_feed<?php echo $class; ?>" id="aside_feed">
+ <a class="toggle_aside" href="#close"><?php echo _i('close'); ?></a>
+
+ <?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('subscription_management'); ?></a>
+ <a class="btn btn-important" href="<?php echo _url('importExport', 'index'); ?>"><?php echo _i('import'); ?></a>
+ </div>
+ <?php } elseif (Minz_Configuration::needsLogin()) { ?>
+ <a href="<?php echo _url('index', 'about'); ?>"><?php echo _t('about_freshrss'); ?></a>
+ <?php } ?>
+
+ <form id="mark-read-aside" method="post" style="display: none"></form>
+
+ <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('main_stream'); ?></a>
+ </div>
+ </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('favorite_feeds', format_number(FreshRSS_Context::$total_starred['all'])); ?></a>
+ </div>
+ </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::$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" data-unread="<?php echo format_number($cat->nbNotRead()); ?>" href="<?php echo _url('index', 'index', 'get', 'c_' . $cat->id()); ?>"><?php echo $cat->name(); ?></a>
+ </div>
+
+ <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>
+</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 _t('filter'); ?></a></li>
+ <?php if (FreshRSS_Auth::hasAccess()) { ?>
+ <li class="item"><a href="<?php echo _url('stats', 'repartition', 'id', '!!!!!!'); ?>"><?php echo _t('stats'); ?></a></li>
+ <?php } ?>
+ <li class="item"><a target="_blank" href="http://example.net/"><?php echo _t('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('administration'); ?></a></li>
+ <li class="item"><a href="<?php echo _url('feed', 'actualize', 'id', '!!!!!!'); ?>"><?php echo _t('actualize'); ?></a></li>
+ <li class="item">
+ <?php $confirm = FreshRSS_Context::$conf->reading_confirm ? 'confirm' : ''; ?>
+ <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('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 114ccbf56..000000000
--- a/app/layout/aside_flux.phtml
+++ /dev/null
@@ -1,103 +0,0 @@
-<div class="aside aside_flux<?php if (FreshRSS_Context::$conf->hide_read_feeds && ($this->state & FreshRSS_Entry::STATE_NOT_READ) && !($this->state & FreshRSS_Entry::STATE_READ)) echo ' state_unread'; ?>" id="aside_flux">
- <a class="toggle_aside" href="#close"><?php echo _i('close'); ?></a>
-
- <ul class="categories">
- <?php if (FreshRSS_Auth::hasAccess()) { ?>
- <form id="mark-read-aside" method="post" style="display: none"></form>
-
- <li>
- <div class="stick configure-feeds">
- <a class="btn btn-important" href="<?php echo _url('subscription', 'index'); ?>"><?php echo _t('subscription_management'); ?></a>
- <a class="btn btn-important" href="<?php echo _url('importExport', 'index'); ?>"><?php echo _i('import'); ?></a>
- </div>
- </li>
- <?php } elseif (Minz_Configuration::needsLogin()) { ?>
- <li><a href="<?php echo _url('index', 'about'); ?>"><?php echo _t('about_freshrss'); ?></a></li>
- <?php } ?>
-
- <?php
- $arUrl = array('c' => 'index', 'a' => 'index', 'params' => array());
- if (FreshRSS_Context::$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 _i('all'); ?>
- <?php echo _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 _i('bookmark'); ?>
- <?php echo _t('favorite_feeds', formatNumber($this->nb_favorites['all'])); ?>
- </a>
- </div>
- </li>
-
- <?php
- foreach ($this->cat_aside as $cat) {
- $feeds = $cat->feeds();
- if (!empty($feeds)) {
- $c_active = false;
- $c_show = false;
- if ($this->get_c == $cat->id()) {
- $c_active = true;
- if (!FreshRSS_Context::$conf->display_categories || $this->get_f) {
- $c_show = true;
- }
- }
- ?><li data-unread="<?php echo $cat->nbNotRead(); ?>"<?php if ($c_active) echo ' class="active"'; ?>><?php
- ?><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 _i($c_show ? 'up' : 'down'); ?></a><?php
- ?></div><?php
- ?><ul class="feeds<?php echo $c_show ? ' 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' : ''; ?>" data-unread="<?php echo $feed->nbNotRead(); ?>"><?php
- ?><div class="dropdown"><?php
- ?><div class="dropdown-target"></div><?php
- ?><a class="dropdown-toggle" data-fweb="<?php echo $feed->website(); ?>"><?php echo _i('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 _t('filter'); ?></a></li>
- <?php if (FreshRSS_Auth::hasAccess()) { ?>
- <li class="item"><a href="<?php echo _url('stats', 'repartition', 'id', '!!!!!!'); ?>"><?php echo _t('stats'); ?></a></li>
- <?php } ?>
- <li class="item"><a target="_blank" href="http://example.net/"><?php echo _t('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('administration'); ?></a></li>
- <li class="item"><a href="<?php echo _url('feed', 'actualize', 'id', '!!!!!!'); ?>"><?php echo _t('actualize'); ?></a></li>
- <li class="item">
- <?php $confirm = FreshRSS_Context::$conf->reading_confirm ? 'confirm' : ''; ?>
- <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('mark_read'); ?></button>
- </li>
- <?php } ?>
- </ul>
-</script>
diff --git a/app/layout/aside_subscription.phtml b/app/layout/aside_subscription.phtml
index 9a95763c3..cbf5df67d 100644
--- a/app/layout/aside_subscription.phtml
+++ b/app/layout/aside_subscription.phtml
@@ -1,4 +1,4 @@
-<ul class="nav nav-list aside aside_feed">
+<ul class="nav nav-list aside">
<li class="nav-header"><?php echo _t('subscription_management'); ?></li>
<li class="item<?php echo Minz_Request::controllerName() == 'subscription' ? ' active' : ''; ?>">
diff --git a/app/layout/layout.phtml b/app/layout/layout.phtml
index a8c70ec64..1827d6c26 100644
--- a/app/layout/layout.phtml
+++ b/app/layout/layout.phtml
@@ -10,21 +10,22 @@
<?php $this->renderHelper('javascript_vars'); ?>
//]]></script>
<?php
- if (!empty($this->nextId)) {
- $params = Minz_Request::params();
- $params['next'] = $this->nextId;
- $params['ajax'] = 1;
+ $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(array('c' => Minz_Request::controllerName(), 'a' => Minz_Request::actionName(), 'params' => $params)); ?>" />
+ <link id="prefetch" rel="next prefetch" href="<?php echo Minz_Url::display($url_next); ?>" />
<?php } ?>
<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->url)) {
- $rss_url = $this->url;
- $rss_url['params']['output'] = 'rss';
+ if (isset($this->rss_title)) {
+ $url_rss = $url_base;
+ $url_rss['a'] = 'rss';
?>
- <link rel="alternate" type="application/rss+xml" title="<?php echo $this->rss_title; ?>" href="<?php echo Minz_Url::display($rss_url); ?>" />
+ <link rel="alternate" type="application/rss+xml" title="<?php echo $this->rss_title; ?>" href="<?php echo Minz_Url::display($url_rss); ?>" />
<?php } ?>
<link rel="prefetch" href="<?php echo FreshRSS_Themes::icon('starred', true); ?>">
<link rel="prefetch" href="<?php echo FreshRSS_Themes::icon('non-starred', true); ?>">
diff --git a/app/layout/nav_menu.phtml b/app/layout/nav_menu.phtml
index bb9468ab1..775daf088 100644
--- a/app/layout/nav_menu.phtml
+++ b/app/layout/nav_menu.phtml
@@ -1,90 +1,31 @@
-<?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 _i('category'); ?></a>
+ <a class="btn toggle_aside" href="#aside_feed"><?php echo _i('category'); ?></a>
<?php } ?>
<?php if (FreshRSS_Auth::hasAccess()) { ?>
<div id="nav_menu_actions" class="stick">
<?php
- $url_state = $this->url;
-
- if ($this->state & FreshRSS_Entry::STATE_READ) {
- $url_state['params']['state'] = $this->state & ~FreshRSS_Entry::STATE_READ;
- $checked = 'true';
- $class = 'active';
- } else {
- $url_state['params']['state'] = $this->state | FreshRSS_Entry::STATE_READ;
- $checked = 'false';
- $class = '';
- }
- ?>
- <a id="toggle-read"
- class="btn <?php echo $class; ?>"
- aria-checked="<?php echo $checked; ?>"
- href="<?php echo Minz_Url::display($url_state); ?>"
- title="<?php echo _t('show_read'); ?>">
- <?php echo _i('read'); ?>
- </a>
-
- <?php
- if ($this->state & FreshRSS_Entry::STATE_NOT_READ) {
- $url_state['params']['state'] = $this->state & ~FreshRSS_Entry::STATE_NOT_READ;
- $checked = 'true';
- $class = 'active';
- } else {
- $url_state['params']['state'] = $this->state | FreshRSS_Entry::STATE_NOT_READ;
- $checked = 'false';
- $class = '';
- }
- ?>
- <a id="toggle-unread"
- class="btn <?php echo $class; ?>"
- aria-checked="<?php echo $checked; ?>"
- href="<?php echo Minz_Url::display($url_state); ?>"
- title="<?php echo _t('show_not_reads'); ?>">
- <?php echo _i('unread'); ?>
- </a>
-
- <?php
- if ($this->state & FreshRSS_Entry::STATE_FAVORITE || $this->get_c == 's') {
- $url_state['params']['state'] = $this->state & ~FreshRSS_Entry::STATE_FAVORITE;
- $checked = 'true';
- $class = 'active';
- } else {
- $url_state['params']['state'] = $this->state | FreshRSS_Entry::STATE_FAVORITE;
- $checked = 'false';
- $class = '';
- }
- ?>
- <a id="toggle-favorite"
- class="btn <?php echo $class; ?>"
- aria-checked="<?php echo $checked; ?>"
- href="<?php echo Minz_Url::display($url_state); ?>"
- title="<?php echo _t('show_favorite'); ?>">
- <?php echo _i('starred'); ?>
- </a>
-
- <?php
- if ($this->state & FreshRSS_Entry::STATE_NOT_FAVORITE) {
- $url_state['params']['state'] = $this->state & ~FreshRSS_Entry::STATE_NOT_FAVORITE;
- $checked = 'true';
- $class = 'active';
- } else {
- $url_state['params']['state'] = $this->state | FreshRSS_Entry::STATE_NOT_FAVORITE;
- $checked = 'false';
- $class = '';
- }
+ $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-not-favorite"
- class="btn <?php echo $class; ?>"
- aria-checked="<?php echo $checked; ?>"
- href="<?php echo Minz_Url::display($url_state); ?>"
- title="<?php echo _t('show_not_favorite'); ?>">
- <?php echo _i('non-starred'); ?>
- </a>
+ <a id="toggle-<?php echo $state_str; ?>"
+ class="btn <?php echo $state_enabled ? 'active' : ''; ?>"
+ aria-checked="<?php echo $state_enabled ? 'true' : 'false'; ?>"
+ title="<?php echo _t($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>
@@ -109,7 +50,7 @@
<?php } ?>
<?php
- $url_query = $this->url;
+ $url_query = Minz_Request::currentRequest();;
$url_query['c'] = 'configure';
$url_query['a'] = 'addQuery';
?>
@@ -117,74 +58,25 @@
</ul>
</div>
</div>
+
<?php
- $get = false;
+ $get = FreshRSS_Context::currentGet();
$string_mark = _t('mark_all_read');
- if ($this->get_f) {
- $get = 'f_' . $this->get_f;
+ if ($get[0] == 'f') {
$string_mark = _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;
- }
+ } elseif ($get[0] == 'c') {
$string_mark = _t('mark_cat_read');
}
- $nextGet = $get;
- if (FreshRSS_Context::$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;
- }
- }
- $p = isset($this->entries[0]) ? $this->entries[0] : null;
- $idMax = $p === null ? (time() - 1) . '000000' : $p->id();
-
- if ($this->order === 'ASC') { //In this case we do not know but we guess idMax
- $idMax2 = (time() - 1) . '000000';
- if (strcmp($idMax2, $idMax) > 0) {
- $idMax = $idMax2;
- }
- }
-
- $arUrl = array('c' => 'entry', 'a' => 'read', 'params' => array('get' => $get, 'nextGet' => $nextGet, 'idMax' => $idMax));
- $output = Minz_Request::param('output', '');
- if ($output != '' && FreshRSS_Context::$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,
+ )
+ );
?>
<form id="mark-read-menu" method="post" style="display: none"></form>
@@ -193,7 +85,7 @@
<?php $confirm = FreshRSS_Context::$conf->reading_confirm ? 'confirm' : ''; ?>
<button class="read_all btn <?php echo $confirm; ?>"
form="mark-read-menu"
- formaction="<?php echo $markReadUrl; ?>"
+ formaction="<?php echo Minz_Url::display($mark_read_url); ?>"
type="submit"><?php echo _t('mark_read'); ?></button>
<div class="dropdown">
@@ -206,15 +98,16 @@
<li class="item">
<button class="as-link <?php echo $confirm; ?>"
form="mark-read-menu"
- formaction="<?php echo $markReadUrl; ?>"
+ formaction="<?php echo Minz_Url::display($mark_read_url); ?>"
type="submit"><?php echo $string_mark; ?></button>
</li>
<li class="separator"></li>
<?php
- $mark_before_today = $arUrl;
- $mark_before_today['params']['idMax'] = $this->today . '000000';
- $mark_before_one_week = $arUrl;
- $mark_before_one_week['params']['idMax'] = ($this->today - 604800) . '000000';
+ $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">
<button class="as-link <?php echo $confirm; ?>"
@@ -233,25 +126,25 @@
</div>
<?php } ?>
- <?php $url_output = $this->url; ?>
+ <?php $url_output = Minz_Request::currentRequest(); ?>
<div class="stick" id="nav_menu_views">
- <?php $url_output['params']['output'] = 'normal'; ?>
+ <?php $url_output['a'] = 'normal'; ?>
<a class="view_normal btn <?php echo $actual_view == 'normal'? 'active' : ''; ?>" title="<?php echo _t('normal_view'); ?>" href="<?php echo Minz_Url::display($url_output); ?>">
<?php echo _i("view-normal"); ?>
</a>
- <?php $url_output['params']['output'] = 'global'; ?>
+ <?php $url_output['a'] = 'global'; ?>
<a class="view_global btn <?php echo $actual_view == 'global'? 'active' : ''; ?>" title="<?php echo _t('global_view'); ?>" href="<?php echo Minz_Url::display($url_output); ?>">
<?php echo _i("view-global"); ?>
</a>
- <?php $url_output['params']['output'] = 'reader'; ?>
- <a class="view_reader btn <?php echo $actual_view == 'reader'? 'active' : ''; ?>" title="<?php echo _t('reader_view'); ?>" href="<?php echo Minz_Url::display($url_output); ?>">
+ <?php $url_output['a'] = 'reader'; ?>
+ <a class="view_reader btn <?php echo $actual_view == 'reader'? 'active' : ''; ?>" title="<?php echo _t('global_view'); ?>" href="<?php echo Minz_Url::display($url_output); ?>">
<?php echo _i("view-reader"); ?>
</a>
<?php
- $url_output['params']['output'] = 'rss';
+ $url_output['a'] = 'rss';
if (FreshRSS_Context::$conf->token) {
$url_output['params']['token'] = FreshRSS_Context::$conf->token;
}
@@ -284,7 +177,7 @@
</div>
<?php
- if ($this->order === 'DESC') {
+ if (FreshRSS_Context::$order === 'DESC') {
$order = 'ASC';
$icon = 'up';
$title = 'older_first';
@@ -293,7 +186,7 @@
$icon = 'down';
$title = 'newer_first';
}
- $url_order = $this->url;
+ $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); ?>">