normal_view.phtml 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. <?php
  2. $this->partial ('aside_flux');
  3. $this->partial ('nav_menu');
  4. if (!empty($this->entries)) {
  5. $display_today = true;
  6. $display_yesterday = true;
  7. $display_others = true;
  8. if ($this->loginOk) {
  9. $sharing = $this->conf->sharing;
  10. } else {
  11. $sharing = array();
  12. }
  13. $hidePosts = !$this->conf->display_posts;
  14. $lazyload = $this->conf->lazyload;
  15. $topline_read = $this->conf->topline_read;
  16. $topline_favorite = $this->conf->topline_favorite;
  17. $topline_date = $this->conf->topline_date;
  18. $topline_link = $this->conf->topline_link;
  19. $bottomline_read = $this->conf->bottomline_read;
  20. $bottomline_favorite = $this->conf->bottomline_favorite;
  21. $bottomline_sharing = $this->conf->bottomline_sharing && (count($sharing));
  22. $bottomline_tags = $this->conf->bottomline_tags;
  23. $bottomline_date = $this->conf->bottomline_date;
  24. $bottomline_link = $this->conf->bottomline_link;
  25. $content_width = $this->conf->content_width;
  26. ?>
  27. <div id="stream" class="normal<?php echo $hidePosts ? ' hide_posts' : ''; ?>"><?php
  28. ?><div id="new-article">
  29. <a href="<?php echo Minz_Url::display ($this->url); ?>"><?php echo Minz_Translate::t ('new_article'); ?></a>
  30. </div><?php
  31. foreach ($this->entries as $item) {
  32. if ($display_today && $item->isDay (FreshRSS_Days::TODAY, $this->today)) {
  33. ?><div class="day" id="day_today"><?php
  34. echo Minz_Translate::t ('today');
  35. ?><span class="date"> — <?php echo timestamptodate (time (), false); ?></span><?php
  36. ?><span class="name"><?php echo $this->currentName; ?></span><?php
  37. ?></div><?php
  38. $display_today = false;
  39. }
  40. if ($display_yesterday && $item->isDay (FreshRSS_Days::YESTERDAY, $this->today)) {
  41. ?><div class="day" id="day_yesterday"><?php
  42. echo Minz_Translate::t ('yesterday');
  43. ?><span class="date"> — <?php echo timestamptodate (time () - 86400, false); ?></span><?php
  44. ?><span class="name"><?php echo $this->currentName; ?></span><?php
  45. ?></div><?php
  46. $display_yesterday = false;
  47. }
  48. if ($display_others && $item->isDay (FreshRSS_Days::BEFORE_YESTERDAY, $this->today)) {
  49. ?><div class="day" id="day_before_yesterday"><?php
  50. echo Minz_Translate::t ('before_yesterday');
  51. ?><span class="name"><?php echo $this->currentName; ?></span><?php
  52. ?></div><?php
  53. $display_others = false;
  54. }
  55. ?><div class="flux<?php echo !$item->isRead () ? ' not_read' : ''; ?><?php echo $item->isFavorite () ? ' favorite' : ''; ?>" id="flux_<?php echo $item->id (); ?>">
  56. <ul class="horizontal-list flux_header"><?php
  57. if ($this->loginOk) {
  58. if ($topline_read) {
  59. ?><li class="item manage"><?php
  60. $arUrl = array('c' => 'entry', 'a' => 'read', 'params' => array('id' => $item->id ()));
  61. if ($item->isRead()) {
  62. $arUrl['params']['is_read'] = 0;
  63. }
  64. ?><a class="read" href="<?php echo Minz_Url::display($arUrl); ?>"><?php
  65. echo FreshRSS_Themes::icon($item->isRead () ? 'read' : 'unread'); ?></a><?php
  66. ?></li><?php
  67. }
  68. if ($topline_favorite) {
  69. ?><li class="item manage"><?php
  70. $arUrl = array('c' => 'entry', 'a' => 'bookmark', 'params' => array('id' => $item->id ()));
  71. if ($item->isFavorite()) {
  72. $arUrl['params']['is_favorite'] = 0;
  73. }
  74. ?><a class="bookmark" href="<?php echo Minz_Url::display($arUrl); ?>"><?php
  75. echo FreshRSS_Themes::icon($item->isFavorite () ? 'starred' : 'non-starred'); ?></a><?php
  76. ?></li><?php
  77. }
  78. }
  79. $feed = FreshRSS_CategoryDAO::findFeed($this->cat_aside, $item->feed ()); //We most likely already have the feed object in cache
  80. if (empty($feed)) $feed = $item->feed (true);
  81. ?><li class="item website"><a href="<?php echo _url ('index', 'index', 'get', 'f_' . $feed->id ()); ?>"><img class="favicon" src="<?php echo $feed->favicon (); ?>" alt="✇" /> <span><?php echo $feed->name(); ?></span></a></li>
  82. <li class="item title"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo $item->title (); ?></a></li>
  83. <?php if ($topline_date) { ?><li class="item date"><?php echo $item->date (); ?> </li><?php } ?>
  84. <?php if ($topline_link) { ?><li class="item link"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a></li><?php } ?>
  85. </ul>
  86. <div class="flux_content">
  87. <div class="content <?php echo $content_width; ?>">
  88. <h1 class="title"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo $item->title (); ?></a></h1>
  89. <?php
  90. $author = $item->author ();
  91. echo $author != '' ? '<div class="author">' . Minz_Translate::t ('by_author', $author) . '</div>' : '';
  92. if ($lazyload) {
  93. echo $hidePosts ? lazyIframe(lazyimg($item->content())) : lazyimg($item->content());
  94. } else {
  95. echo $item->content();
  96. }
  97. ?>
  98. </div>
  99. <ul class="horizontal-list bottom"><?php
  100. if ($this->loginOk) {
  101. if ($bottomline_read) {
  102. ?><li class="item manage"><?php
  103. $arUrl = array('c' => 'entry', 'a' => 'read', 'params' => array('id' => $item->id ()));
  104. if ($item->isRead()) {
  105. $arUrl['params']['is_read'] = 0;
  106. }
  107. ?><a class="read" href="<?php echo Minz_Url::display($arUrl); ?>"><?php
  108. echo FreshRSS_Themes::icon($item->isRead () ? 'read' : 'unread'); ?></a><?php
  109. ?></li><?php
  110. }
  111. if ($bottomline_favorite) {
  112. ?><li class="item manage"><?php
  113. $arUrl = array('c' => 'entry', 'a' => 'bookmark', 'params' => array('id' => $item->id ()));
  114. if ($item->isFavorite()) {
  115. $arUrl['params']['is_favorite'] = 0;
  116. }
  117. ?><a class="bookmark" href="<?php echo Minz_Url::display($arUrl); ?>"><?php
  118. echo FreshRSS_Themes::icon($item->isFavorite () ? 'starred' : 'non-starred'); ?></a><?php
  119. ?></li><?php
  120. }
  121. } ?>
  122. <li class="item"><?php
  123. if ($bottomline_sharing) {
  124. $link = urlencode ($item->link ());
  125. $title = urlencode ($item->title () . ' · ' . $feed->name ());
  126. ?><div class="dropdown">
  127. <div id="dropdown-share-<?php echo $item->id ();?>" class="dropdown-target"></div>
  128. <a class="dropdown-toggle" href="#dropdown-share-<?php echo $item->id ();?>">
  129. <?php echo FreshRSS_Themes::icon('share'); ?>
  130. <?php echo Minz_Translate::t ('share'); ?>
  131. </a>
  132. <ul class="dropdown-menu">
  133. <li class="dropdown-close"><a href="#close">❌</a></li>
  134. <?php foreach ($sharing as $share) :?>
  135. <li class="item share">
  136. <a target="_blank" href="<?php echo FreshRSS_Share::generateUrl($this->conf->shares, $share, $item->link(), $item->title() . ' . ' . $feed->name())?>">
  137. <?php echo Minz_Translate::t ($share['name']);?>
  138. </a>
  139. </li>
  140. <?php endforeach;?>
  141. </ul>
  142. </div>
  143. <?php } ?>
  144. </li><?php
  145. $tags = $bottomline_tags ? $item->tags() : null;
  146. if (!empty($tags)) {
  147. ?><li class="item">
  148. <div class="dropdown">
  149. <div id="dropdown-tags-<?php echo $item->id ();?>" class="dropdown-target"></div>
  150. <a class="dropdown-toggle" href="#dropdown-tags-<?php echo $item->id ();?>"><?php
  151. echo FreshRSS_Themes::icon('tag'), Minz_Translate::t ('related_tags');
  152. ?></a>
  153. <ul class="dropdown-menu">
  154. <li class="dropdown-close"><a href="#close">❌</a></li><?php
  155. foreach($tags as $tag) {
  156. ?><li class="item"><a href="<?php echo _url ('index', 'index', 'search', urlencode ('#' . $tag)); ?>"><?php echo $tag; ?></a></li><?php
  157. } ?>
  158. </ul>
  159. </div>
  160. </li><?php
  161. }
  162. if ($bottomline_date) {
  163. ?><li class="item date"><?php echo $item->date (); ?></li><?php
  164. }
  165. if ($bottomline_link) {
  166. ?><li class="item link"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a></li><?php
  167. } ?>
  168. </ul>
  169. </div>
  170. </div>
  171. <?php } ?>
  172. <?php $this->renderHelper('pagination'); ?>
  173. </div>
  174. <?php $this->partial ('nav_entries'); ?>
  175. <?php } else { ?>
  176. <div id="stream" class="alert alert-warn normal">
  177. <span class="alert-head"><?php echo Minz_Translate::t ('no_feed_to_display'); ?></span>
  178. <?php echo Minz_Translate::t ('think_to_add'); ?>
  179. </div>
  180. <?php } ?>