nav_menu.phtml 7.6 KB

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