nav_menu.phtml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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 = strlen ($anotherUnreadId) > 1 ? 'c_' . $anotherUnreadId : 'all';
  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 = strlen ($anotherUnreadId) > 1 ? 'f_' . $anotherUnreadId : 'c_' . $this->get_c;
  51. break;
  52. }
  53. }
  54. ?>
  55. <div class="stick" id="nav_menu_read_all">
  56. <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>
  57. <div class="dropdown">
  58. <div id="dropdown-read" class="dropdown-target"></div>
  59. <a class="dropdown-toggle btn" href="#dropdown-read"><i class="icon i_down"></i></a>
  60. <ul class="dropdown-menu">
  61. <li class="dropdown-close"><a href="#close">&nbsp;</a></li>
  62. <li class="item"><a href="<?php echo _url ('entry', 'read', 'is_read', 1, 'get', $get, 'nextGet', $nextGet); ?>"><?php echo $string_mark; ?></a></li>
  63. <li class="separator"></li>
  64. <?php
  65. $date = getdate ();
  66. $today = mktime (0, 0, 0, $date['mon'], $date['mday'], $date['year']);
  67. $one_week = $today - 604800;
  68. ?>
  69. <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>
  70. <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>
  71. </ul>
  72. </div>
  73. </div>
  74. <?php } ?>
  75. <?php
  76. $params = Request::params ();
  77. if (isset ($params['search'])) {
  78. $params['search'] = urlencode ($params['search']);
  79. }
  80. $url = array (
  81. 'c' => 'index',
  82. 'a' => 'index',
  83. 'params' => $params
  84. );
  85. ?>
  86. <div class="dropdown" id="nav_menu_views">
  87. <div id="dropdown-views" class="dropdown-target"></div>
  88. <a class="dropdown-toggle btn" href="#dropdown-views"><?php echo Translate::t ('display'); ?> <i class="icon i_down"></i></a>
  89. <ul class="dropdown-menu">
  90. <li class="dropdown-close"><a href="#close">&nbsp;</a></li>
  91. <?php
  92. $url_output = $url;
  93. $actual_view = Request::param('output', 'normal');
  94. ?>
  95. <?php if($actual_view != 'normal') { ?>
  96. <li class="item">
  97. <?php $url_output['params']['output'] = 'normal'; ?>
  98. <a class="view_normal" href="<?php echo Url::display ($url_output); ?>">
  99. <?php echo Translate::t ('normal_view'); ?>
  100. </a>
  101. </li>
  102. <?php } if($actual_view != 'reader') { ?>
  103. <li class="item">
  104. <?php $url_output['params']['output'] = 'reader'; ?>
  105. <a class="view_normal" href="<?php echo Url::display ($url_output); ?>">
  106. <?php echo Translate::t ('reader_view'); ?>
  107. </a>
  108. </li>
  109. <?php } if($actual_view != 'global') { ?>
  110. <li class="item">
  111. <?php $url_output['params']['output'] = 'global'; ?>
  112. <a class="view_normal" href="<?php echo Url::display ($url_output); ?>">
  113. <?php echo Translate::t ('global_view'); ?>
  114. </a>
  115. </li>
  116. <?php } ?>
  117. <li class="separator"></li>
  118. <li class="item">
  119. <?php
  120. $url_state = $url;
  121. if ($this->state == 'not_read') {
  122. $url_state['params']['state'] = 'all';
  123. ?>
  124. <a class="print_all" href="<?php echo Url::display ($url_state); ?>">
  125. <?php echo Translate::t ('show_all_articles'); ?>
  126. </a>
  127. <?php
  128. } else {
  129. $url_state['params']['state'] = 'not_read';
  130. ?>
  131. <a class="print_non_read" href="<?php echo Url::display ($url_state); ?>">
  132. <?php echo Translate::t ('show_not_reads'); ?>
  133. </a>
  134. <?php } ?>
  135. </li>
  136. <li class="separator"></li>
  137. <li class="item">
  138. <?php
  139. $url_order = $url;
  140. if ($this->order == 'low_to_high') {
  141. $url_order['params']['order'] = 'high_to_low';
  142. ?>
  143. <a href="<?php echo Url::display ($url_order); ?>">
  144. <?php echo Translate::t ('older_first'); ?>
  145. </a>
  146. <?php
  147. } else {
  148. $url_order['params']['order'] = 'low_to_high';
  149. ?>
  150. <a href="<?php echo Url::display ($url_order); ?>">
  151. <?php echo Translate::t ('newer_first'); ?>
  152. </a>
  153. <?php } ?>
  154. </li>
  155. </ul>
  156. </div>
  157. </div>