nav_menu.phtml 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <div class="nav_menu">
  2. <a class="btn toggle_aside" href="#aside_flux"><?php echo FreshRSS_Themes::icon('category'); ?></a>
  3. <?php if ($this->loginOk) { ?>
  4. <a id="actualize" class="btn" href="<?php echo _url ('feed', 'actualize'); ?>"><?php echo FreshRSS_Themes::icon('refresh'); ?></a>
  5. <?php
  6. $get = false;
  7. $string_mark = Minz_Translate::t ('mark_all_read');
  8. if ($this->get_f) {
  9. $get = 'f_' . $this->get_f;
  10. $string_mark = Minz_Translate::t ('mark_feed_read');
  11. } elseif ($this->get_c && $this->get_c != 'a') {
  12. if ($this->get_c === 's') {
  13. $get = 's';
  14. } else {
  15. $get = 'c_' . $this->get_c;
  16. }
  17. $string_mark = Minz_Translate::t ('mark_cat_read');
  18. }
  19. $nextGet = $get;
  20. if ($this->conf->onread_jump_next && (strlen ($get) > 2)) {
  21. $anotherUnreadId = '';
  22. $foundCurrent = false;
  23. switch ($get[0]) {
  24. case 'c':
  25. foreach ($this->cat_aside as $cat) {
  26. if ($cat->id () == $this->get_c) {
  27. $foundCurrent = true;
  28. continue;
  29. }
  30. if ($cat->nbNotRead () <= 0) continue;
  31. $anotherUnreadId = $cat->id ();
  32. if ($foundCurrent) break;
  33. }
  34. $nextGet = empty ($anotherUnreadId) ? 'a' : 'c_' . $anotherUnreadId;
  35. break;
  36. case 'f':
  37. foreach ($this->cat_aside as $cat) {
  38. if ($cat->id () == $this->get_c) {
  39. foreach ($cat->feeds () as $feed) {
  40. if ($feed->id () == $this->get_f) {
  41. $foundCurrent = true;
  42. continue;
  43. }
  44. if ($feed->nbNotRead () <= 0) continue;
  45. $anotherUnreadId = $feed->id ();
  46. if ($foundCurrent) break;
  47. }
  48. break;
  49. }
  50. }
  51. $nextGet = empty ($anotherUnreadId) ? 'c_' . $this->get_c : 'f_' . $anotherUnreadId;
  52. break;
  53. }
  54. }
  55. $p = isset($this->entries[0]) ? $this->entries[0] : null;
  56. $idMax = $p === null ? '0' : $p->id();
  57. $markReadUrl = _url ('entry', 'read', 'is_read', 1, 'get', $get, 'nextGet', $nextGet, 'idMax', $idMax);
  58. Minz_Session::_param ('markReadUrl', $markReadUrl);
  59. ?>
  60. <div class="stick" id="nav_menu_read_all">
  61. <a class="read_all btn" href="<?php echo $markReadUrl; ?>"><?php echo Minz_Translate::t ('mark_read'); ?></a>
  62. <div class="dropdown">
  63. <div id="dropdown-read" class="dropdown-target"></div>
  64. <a class="dropdown-toggle btn" href="#dropdown-read"><?php echo FreshRSS_Themes::icon('down'); ?></a>
  65. <ul class="dropdown-menu">
  66. <li class="dropdown-close"><a href="#close">❌</a></li>
  67. <li class="item"><a href="<?php echo $markReadUrl; ?>"><?php echo $string_mark; ?></a></li>
  68. <li class="separator"></li>
  69. <?php
  70. $today = $this->today;
  71. $one_week = $today - 604800;
  72. ?>
  73. <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>
  74. <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>
  75. </ul>
  76. </div>
  77. </div>
  78. <?php } ?>
  79. <?php
  80. $params = Minz_Request::params ();
  81. if (isset ($params['search'])) {
  82. $params['search'] = urlencode ($params['search']);
  83. }
  84. $url = array (
  85. 'c' => 'index',
  86. 'a' => 'index',
  87. 'params' => $params
  88. );
  89. ?>
  90. <div class="dropdown" id="nav_menu_views">
  91. <div id="dropdown-views" class="dropdown-target"></div>
  92. <a class="dropdown-toggle btn" href="#dropdown-views"><?php echo Minz_Translate::t ('display'); ?> <?php echo FreshRSS_Themes::icon('down'); ?></a>
  93. <ul class="dropdown-menu">
  94. <li class="dropdown-close"><a href="#close">❌</a></li>
  95. <?php
  96. $url_output = $url;
  97. $actual_view = Minz_Request::param('output', 'normal');
  98. ?>
  99. <?php if($actual_view != 'normal') { ?>
  100. <li class="item">
  101. <?php $url_output['params']['output'] = 'normal'; ?>
  102. <a class="view_normal" href="<?php echo Minz_Url::display ($url_output); ?>">
  103. <?php echo Minz_Translate::t ('normal_view'); ?>
  104. </a>
  105. </li>
  106. <?php } if($actual_view != 'reader') { ?>
  107. <li class="item">
  108. <?php $url_output['params']['output'] = 'reader'; ?>
  109. <a class="view_normal" href="<?php echo Minz_Url::display ($url_output); ?>">
  110. <?php echo Minz_Translate::t ('reader_view'); ?>
  111. </a>
  112. </li>
  113. <?php } if($actual_view != 'global') { ?>
  114. <li class="item">
  115. <?php $url_output['params']['output'] = 'global'; ?>
  116. <a class="view_normal" href="<?php echo Minz_Url::display ($url_output); ?>">
  117. <?php echo Minz_Translate::t ('global_view'); ?>
  118. </a>
  119. </li>
  120. <?php } ?>
  121. <li class="separator"></li>
  122. <li class="item">
  123. <?php
  124. $url_state = $url;
  125. if ($this->state == 'not_read') {
  126. $url_state['params']['state'] = 'all';
  127. ?>
  128. <a class="print_all" href="<?php echo Minz_Url::display ($url_state); ?>">
  129. <?php echo Minz_Translate::t ('show_all_articles'); ?>
  130. </a>
  131. <?php
  132. } else {
  133. $url_state['params']['state'] = 'not_read';
  134. ?>
  135. <a class="print_non_read" href="<?php echo Minz_Url::display ($url_state); ?>">
  136. <?php echo Minz_Translate::t ('show_not_reads'); ?>
  137. </a>
  138. <?php } ?>
  139. </li>
  140. <li class="item">
  141. <?php
  142. $url_order = $url;
  143. if ($this->order === 'DESC') {
  144. $url_order['params']['order'] = 'ASC';
  145. ?>
  146. <a href="<?php echo Minz_Url::display ($url_order); ?>">
  147. <?php echo Minz_Translate::t ('older_first'); ?>
  148. </a>
  149. <?php
  150. } else {
  151. $url_order['params']['order'] = 'DESC';
  152. ?>
  153. <a href="<?php echo Minz_Url::display ($url_order); ?>">
  154. <?php echo Minz_Translate::t ('newer_first'); ?>
  155. </a>
  156. <?php } ?>
  157. </li>
  158. <li class="separator"></li>
  159. <li class="item">
  160. <a class="view_rss" target="_blank" href="<?php echo Minz_Url::display ($this->rss_url); ?>">
  161. <?php echo Minz_Translate::t ('rss_view'); ?>
  162. </a>
  163. </li>
  164. </ul>
  165. </div>
  166. <div class="item search">
  167. <form action="<?php echo _url ('index', 'index'); ?>" method="get">
  168. <?php $search = Minz_Request::param ('search', ''); ?>
  169. <input type="search" name="search" value="<?php echo $search; ?>" placeholder="<?php echo Minz_Translate::t ('search_short'); ?>" />
  170. <?php $get = Minz_Request::param ('get', ''); ?>
  171. <?php if($get != '') { ?>
  172. <input type="hidden" name="get" value="<?php echo $get; ?>" />
  173. <?php } ?>
  174. <?php $order = Minz_Request::param ('order', ''); ?>
  175. <?php if($order != '') { ?>
  176. <input type="hidden" name="order" value="<?php echo $order; ?>" />
  177. <?php } ?>
  178. <?php $state = Minz_Request::param ('state', ''); ?>
  179. <?php if($state != '') { ?>
  180. <input type="hidden" name="state" value="<?php echo $state; ?>" />
  181. <?php } ?>
  182. </form>
  183. </div>
  184. </div>