nav_menu.phtml 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  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. $arUrl = array('c' => 'entry', 'a' => 'read', 'params' => array('get' => $get, 'nextGet' => $nextGet, 'idMax' => $idMax));
  58. $output = Minz_Request::param('output', '');
  59. if (($output != '') && ($this->conf->view_mode !== $output)) {
  60. $arUrl['params']['output'] = $output;
  61. }
  62. $markReadUrl = Minz_Url::display($arUrl);
  63. Minz_Session::_param ('markReadUrl', $markReadUrl);
  64. ?>
  65. <div class="stick" id="nav_menu_read_all">
  66. <a class="read_all btn" href="<?php echo $markReadUrl; ?>"><?php echo Minz_Translate::t ('mark_read'); ?></a>
  67. <div class="dropdown">
  68. <div id="dropdown-read" class="dropdown-target"></div>
  69. <a class="dropdown-toggle btn" href="#dropdown-read"><?php echo FreshRSS_Themes::icon('down'); ?></a>
  70. <ul class="dropdown-menu">
  71. <li class="dropdown-close"><a href="#close">❌</a></li>
  72. <li class="item"><a href="<?php echo $markReadUrl; ?>"><?php echo $string_mark; ?></a></li>
  73. <li class="separator"></li>
  74. <?php
  75. $today = $this->today;
  76. $one_week = $today - 604800;
  77. ?>
  78. <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>
  79. <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>
  80. </ul>
  81. </div>
  82. </div>
  83. <?php } ?>
  84. <?php
  85. $params = Minz_Request::params ();
  86. if (isset ($params['search'])) {
  87. $params['search'] = urlencode ($params['search']);
  88. }
  89. $url = array (
  90. 'c' => 'index',
  91. 'a' => 'index',
  92. 'params' => $params
  93. );
  94. ?>
  95. <div class="dropdown" id="nav_menu_views">
  96. <div id="dropdown-views" class="dropdown-target"></div>
  97. <a class="dropdown-toggle btn" href="#dropdown-views"><?php echo Minz_Translate::t ('display'); ?> <?php echo FreshRSS_Themes::icon('down'); ?></a>
  98. <ul class="dropdown-menu">
  99. <li class="dropdown-close"><a href="#close">❌</a></li>
  100. <?php
  101. $url_output = $url;
  102. $actual_view = Minz_Request::param('output', 'normal');
  103. ?>
  104. <?php if($actual_view !== 'normal') { ?>
  105. <li class="item">
  106. <?php $url_output['params']['output'] = 'normal'; ?>
  107. <a class="view_normal" href="<?php echo Minz_Url::display ($url_output); ?>">
  108. <?php echo Minz_Translate::t ('normal_view'); ?>
  109. </a>
  110. </li>
  111. <?php } if($actual_view !== 'reader') { ?>
  112. <li class="item">
  113. <?php $url_output['params']['output'] = 'reader'; ?>
  114. <a class="view_normal" href="<?php echo Minz_Url::display ($url_output); ?>">
  115. <?php echo Minz_Translate::t ('reader_view'); ?>
  116. </a>
  117. </li>
  118. <?php } if($actual_view !== 'global') { ?>
  119. <li class="item">
  120. <?php $url_output['params']['output'] = 'global'; ?>
  121. <a class="view_normal" href="<?php echo Minz_Url::display ($url_output); ?>">
  122. <?php echo Minz_Translate::t ('global_view'); ?>
  123. </a>
  124. </li>
  125. <?php } ?>
  126. <li class="separator"></li>
  127. <?php
  128. $url_state = $url;
  129. $url_state['params']['state'] = 'all';
  130. ?>
  131. <li class="item" role="checkbox" aria-checked="<?php echo ($this->state === 'all') ? 'true' :'false'; ?>">
  132. <a class="print_all" href="<?php echo Minz_Url::display ($url_state); ?>">
  133. <?php echo Minz_Translate::t ('show_all_articles'); ?>
  134. </a>
  135. </li>
  136. <?php
  137. $url_state['params']['state'] = 'not_read';
  138. ?>
  139. <li class="item" role="checkbox" aria-checked="<?php echo ($this->state === 'not_read') ? 'true' :'false'; ?>">
  140. <a class="print_non_read" href="<?php echo Minz_Url::display ($url_state); ?>">
  141. <?php echo Minz_Translate::t ('show_not_reads'); ?>
  142. </a>
  143. </li>
  144. <?php
  145. $url_state['params']['state'] = 'read';
  146. ?>
  147. <li class="item" role="checkbox" aria-checked="<?php echo ($this->state === 'read') ? 'true' :'false'; ?>">
  148. <a class="print_read" href="<?php echo Minz_Url::display ($url_state); ?>">
  149. <?php echo Minz_Translate::t ('show_read'); ?>
  150. </a>
  151. </li>
  152. <?php
  153. $url_state['params']['state'] = 'favorite';
  154. ?>
  155. <li class="item" role="checkbox" aria-checked="<?php echo ($this->state === 'favorite') ? 'true' :'false'; ?>">
  156. <a class="print_favorite" href="<?php echo Minz_Url::display ($url_state); ?>">
  157. <?php echo Minz_Translate::t ('show_favorite'); ?>
  158. </a>
  159. </li>
  160. <li class="separator"></li>
  161. <li class="item">
  162. <?php
  163. $url_order = $url;
  164. if ($this->order === 'DESC') {
  165. $url_order['params']['order'] = 'ASC';
  166. ?>
  167. <a href="<?php echo Minz_Url::display ($url_order); ?>">
  168. <?php echo Minz_Translate::t ('older_first'); ?>
  169. </a>
  170. <?php
  171. } else {
  172. $url_order['params']['order'] = 'DESC';
  173. ?>
  174. <a href="<?php echo Minz_Url::display ($url_order); ?>">
  175. <?php echo Minz_Translate::t ('newer_first'); ?>
  176. </a>
  177. <?php } ?>
  178. </li>
  179. <li class="separator"></li>
  180. <li class="item">
  181. <a class="view_rss" target="_blank" href="<?php echo Minz_Url::display ($this->rss_url); ?>">
  182. <?php echo Minz_Translate::t ('rss_view'); ?>
  183. </a>
  184. </li>
  185. </ul>
  186. </div>
  187. <div class="item search">
  188. <form action="<?php echo _url ('index', 'index'); ?>" method="get">
  189. <?php $search = Minz_Request::param ('search', ''); ?>
  190. <input type="search" name="search" value="<?php echo $search; ?>" placeholder="<?php echo Minz_Translate::t ('search_short'); ?>" />
  191. <?php $get = Minz_Request::param ('get', ''); ?>
  192. <?php if($get != '') { ?>
  193. <input type="hidden" name="get" value="<?php echo $get; ?>" />
  194. <?php } ?>
  195. <?php $order = Minz_Request::param ('order', ''); ?>
  196. <?php if($order != '') { ?>
  197. <input type="hidden" name="order" value="<?php echo $order; ?>" />
  198. <?php } ?>
  199. <?php $state = Minz_Request::param ('state', ''); ?>
  200. <?php if($state != '') { ?>
  201. <input type="hidden" name="state" value="<?php echo $state; ?>" />
  202. <?php } ?>
  203. </form>
  204. </div>
  205. </div>