nav_menu.phtml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <div class="nav_menu">
  2. <a class="btn toggle_aside" href="#aside_flux"><i class="icon i_category"></i></a>
  3. <?php if (!login_is_conf ($this->conf) || is_logged ()) { ?>
  4. <a id="actualize" class="btn" href="<?php echo _url ('feed', 'actualize'); ?>"><i class="icon i_refresh"></i></a>
  5. <?php
  6. $get = false;
  7. $string_mark = Translate::t ('mark_all_read');
  8. if ($this->get_f) {
  9. $get = 'f_' . $this->get_f;
  10. $string_mark = Translate::t ('mark_feed_read');
  11. } elseif ($this->get_c &&
  12. $this->get_c != 'all' &&
  13. $this->get_c != 'favoris' &&
  14. $this->get_c != 'public') {
  15. $get = 'c_' . $this->get_c;
  16. $string_mark = Translate::t ('mark_cat_read');
  17. }
  18. $nextGet = $get;
  19. if (($this->conf->onread_jump_next () === 'yes') && (strlen ($get) > 2)) {
  20. $anotherUnreadId = '';
  21. $foundCurrent = false;
  22. switch ($get[0]) {
  23. case 'c':
  24. foreach ($this->cat_aside as $cat) {
  25. if ($cat->id () === $this->get_c) {
  26. $foundCurrent = true;
  27. continue;
  28. }
  29. if ($cat->nbNotRead () <= 0) continue;
  30. $anotherUnreadId = $cat->id ();
  31. if ($foundCurrent) break;
  32. }
  33. $nextGet = empty ($anotherUnreadId) ? 'all' : 'c_' . $anotherUnreadId;
  34. break;
  35. case 'f':
  36. foreach ($this->cat_aside as $cat) {
  37. if ($cat->id () === $this->get_c) {
  38. foreach ($cat->feeds () as $feed) {
  39. if ($feed->id () === $this->get_f) {
  40. $foundCurrent = true;
  41. continue;
  42. }
  43. if ($feed->nbNotRead () <= 0) continue;
  44. $anotherUnreadId = $feed->id ();
  45. if ($foundCurrent) break;
  46. }
  47. break;
  48. }
  49. }
  50. $nextGet = empty ($anotherUnreadId) ? 'c_' . $this->get_c : 'f_' . $anotherUnreadId;
  51. break;
  52. }
  53. }
  54. $markReadUrl = _url ('entry', 'read', 'is_read', 1, 'get', $get, 'nextGet', $nextGet);
  55. Session::_param ('markReadUrl', $markReadUrl);
  56. ?>
  57. <div class="stick" id="nav_menu_read_all">
  58. <a class="read_all btn" href="<?php echo $markReadUrl; ?>"><?php echo Translate::t ('mark_read'); ?></a>
  59. <div class="dropdown">
  60. <div id="dropdown-read" class="dropdown-target"></div>
  61. <a class="dropdown-toggle btn" href="#dropdown-read"><i class="icon i_down"></i></a>
  62. <ul class="dropdown-menu">
  63. <li class="dropdown-close"><a href="#close"> </a></li>
  64. <li class="item"><a href="<?php echo $markReadUrl; ?>"><?php echo $string_mark; ?></a></li>
  65. <li class="separator"></li>
  66. <?php
  67. $date = getdate ();
  68. $today = mktime (0, 0, 0, $date['mon'], $date['mday'], $date['year']);
  69. $one_week = $today - 604800;
  70. ?>
  71. <li class="item"><a href="<?php echo _url ('entry', 'read', 'is_read', 1, 'get', $get, 'dateMax', $today); ?>"><?php echo Translate::t ('before_one_day'); ?></a></li>
  72. <li class="item"><a href="<?php echo _url ('entry', 'read', 'is_read', 1, 'get', $get, 'dateMax', $one_week); ?>"><?php echo Translate::t ('before_one_week'); ?></a></li>
  73. </ul>
  74. </div>
  75. </div>
  76. <?php } ?>
  77. <?php
  78. $params = Request::params ();
  79. if (isset ($params['search'])) {
  80. $params['search'] = urlencode ($params['search']);
  81. }
  82. $url = array (
  83. 'c' => 'index',
  84. 'a' => 'index',
  85. 'params' => $params
  86. );
  87. ?>
  88. <div class="dropdown" id="nav_menu_views">
  89. <div id="dropdown-views" class="dropdown-target"></div>
  90. <a class="dropdown-toggle btn" href="#dropdown-views"><?php echo Translate::t ('display'); ?> <i class="icon i_down"></i></a>
  91. <ul class="dropdown-menu">
  92. <li class="dropdown-close"><a href="#close"> </a></li>
  93. <?php
  94. $url_output = $url;
  95. $actual_view = Request::param('output', 'normal');
  96. ?>
  97. <?php if($actual_view != 'normal') { ?>
  98. <li class="item">
  99. <?php $url_output['params']['output'] = 'normal'; ?>
  100. <a class="view_normal" href="<?php echo Url::display ($url_output); ?>">
  101. <?php echo Translate::t ('normal_view'); ?>
  102. </a>
  103. </li>
  104. <?php } if($actual_view != 'reader') { ?>
  105. <li class="item">
  106. <?php $url_output['params']['output'] = 'reader'; ?>
  107. <a class="view_normal" href="<?php echo Url::display ($url_output); ?>">
  108. <?php echo Translate::t ('reader_view'); ?>
  109. </a>
  110. </li>
  111. <?php } if($actual_view != 'global') { ?>
  112. <li class="item">
  113. <?php $url_output['params']['output'] = 'global'; ?>
  114. <a class="view_normal" href="<?php echo Url::display ($url_output); ?>">
  115. <?php echo Translate::t ('global_view'); ?>
  116. </a>
  117. </li>
  118. <?php } ?>
  119. <li class="separator"></li>
  120. <li class="item">
  121. <?php
  122. $url_state = $url;
  123. if ($this->state == 'not_read') {
  124. $url_state['params']['state'] = 'all';
  125. ?>
  126. <a class="print_all" href="<?php echo Url::display ($url_state); ?>">
  127. <?php echo Translate::t ('show_all_articles'); ?>
  128. </a>
  129. <?php
  130. } else {
  131. $url_state['params']['state'] = 'not_read';
  132. ?>
  133. <a class="print_non_read" href="<?php echo Url::display ($url_state); ?>">
  134. <?php echo Translate::t ('show_not_reads'); ?>
  135. </a>
  136. <?php } ?>
  137. </li>
  138. <li class="item">
  139. <?php
  140. $url_order = $url;
  141. if ($this->order == 'low_to_high') {
  142. $url_order['params']['order'] = 'high_to_low';
  143. ?>
  144. <a href="<?php echo Url::display ($url_order); ?>">
  145. <?php echo Translate::t ('older_first'); ?>
  146. </a>
  147. <?php
  148. } else {
  149. $url_order['params']['order'] = 'low_to_high';
  150. ?>
  151. <a href="<?php echo Url::display ($url_order); ?>">
  152. <?php echo Translate::t ('newer_first'); ?>
  153. </a>
  154. <?php } ?>
  155. </li>
  156. <li class="separator"></li>
  157. <li class="item">
  158. <a class="view_rss" target="_blank" href="<?php echo Url::display ($this->rss_url); ?>">
  159. <?php echo Translate::t ('rss_view'); ?>
  160. </a>
  161. </li>
  162. </ul>
  163. </div>
  164. </div>