aboutsummaryrefslogtreecommitdiff
path: root/app/layout
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2013-09-14 18:13:21 +0200
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2013-09-14 18:13:21 +0200
commit6967de0e64b0ffa302e46da98db2c999f3a0a6df (patch)
tree6f5ac2cb20e45ac1c6aa9cfe5faf4f6240822b63 /app/layout
parentcdae47efae646759571c71202821de224fbe896d (diff)
parent6d09878880e1cc94cdfc11974f734c808c33ec95 (diff)
Merge branch 'onread_jump_next' of https://github.com/Alkarex/FreshRSS into Alkarex-onread_jump_next
Diffstat (limited to 'app/layout')
-rw-r--r--app/layout/nav_menu.phtml40
1 files changed, 38 insertions, 2 deletions
diff --git a/app/layout/nav_menu.phtml b/app/layout/nav_menu.phtml
index d64b68765..59ddc57ea 100644
--- a/app/layout/nav_menu.phtml
+++ b/app/layout/nav_menu.phtml
@@ -17,10 +17,46 @@
$get = 'c_' . $this->get_c;
$string_mark = Translate::t ('mark_cat_read');
}
+ $nextGet = $get;
+ if (($this->conf->onread_jump_next () === 'yes') && (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 = strlen ($anotherUnreadId) > 1 ? 'c_' . $anotherUnreadId : 'all';
+ 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 = strlen ($anotherUnreadId) > 1 ? 'f_' . $anotherUnreadId : 'c_' . $this->get_c;
+ break;
+ }
+ }
?>
<div class="stick" id="nav_menu_read_all">
- <a class="read_all btn" href="<?php echo _url ('entry', 'read', 'is_read', 1, 'get', $get); ?>"><?php echo Translate::t ('mark_read'); ?></a>
+ <a class="read_all btn" href="<?php echo _url ('entry', 'read', 'is_read', 1, 'get', $get, 'nextGet', $nextGet); ?>"><?php echo Translate::t ('mark_read'); ?></a>
<div class="dropdown">
<div id="dropdown-read" class="dropdown-target"></div>
@@ -28,7 +64,7 @@
<ul class="dropdown-menu">
<li class="dropdown-close"><a href="#close"><i class="icon i_close"></i></a></li>
- <li class="item"><a href="<?php echo _url ('entry', 'read', 'is_read', 1, 'get', $get); ?>"><?php echo $string_mark; ?></a></li>
+ <li class="item"><a href="<?php echo _url ('entry', 'read', 'is_read', 1, 'get', $get, 'nextGet', $nextGet); ?>"><?php echo $string_mark; ?></a></li>
<li class="separator"></li>
<?php
$date = getdate ();