normal_view.phtml 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  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. $shaarli = $this->conf->sharing ('shaarli');
  10. $poche = $this->conf->sharing ('poche');
  11. $diaspora = $this->conf->sharing ('diaspora');
  12. }
  13. $twitter = $this->conf->sharing ('twitter');
  14. $google_plus = $this->conf->sharing ('g+');
  15. $facebook = $this->conf->sharing ('facebook');
  16. $email = $this->conf->sharing ('email');
  17. $print = $this->conf->sharing ('print');
  18. $hidePosts = !$this->conf->display_posts;
  19. $lazyload = $this->conf->lazyload;
  20. $topline_read = $this->conf->topline_read;
  21. $topline_favorite = $this->conf->topline_favorite;
  22. $topline_date = $this->conf->topline_date;
  23. $topline_link = $this->conf->topline_link;
  24. $bottomline_read = $this->conf->bottomline_read;
  25. $bottomline_favorite = $this->conf->bottomline_favorite;
  26. $bottomline_sharing = $this->conf->bottomline_sharing && (
  27. $shaarli || $poche || $diaspora || $twitter ||
  28. $google_plus || $facebook || $email || $print);
  29. $bottomline_tags = $this->conf->bottomline_tags;
  30. $bottomline_date = $this->conf->bottomline_date;
  31. $bottomline_link = $this->conf->bottomline_link;
  32. ?>
  33. <div id="stream" class="normal<?php echo $hidePosts ? ' hide_posts' : ''; ?>">
  34. <?php foreach ($this->entries as $item) { ?>
  35. <?php if ($display_today && $item->isDay (FreshRSS_Days::TODAY, $this->today)) { ?>
  36. <div class="day" id="day_today">
  37. <?php echo Minz_Translate::t ('today'); ?>
  38. <span class="date"> - <?php echo timestamptodate (time (), false); ?></span>
  39. <span class="name"><?php echo $this->currentName; ?></span>
  40. </div>
  41. <?php $display_today = false; } ?>
  42. <?php if ($display_yesterday && $item->isDay (FreshRSS_Days::YESTERDAY, $this->today)) { ?>
  43. <div class="day" id="day_yesterday">
  44. <?php echo Minz_Translate::t ('yesterday'); ?>
  45. <span class="date"> - <?php echo timestamptodate (time () - 86400, false); ?></span>
  46. <span class="name"><?php echo $this->currentName; ?></span>
  47. </div>
  48. <?php $display_yesterday = false; } ?>
  49. <?php if ($display_others && $item->isDay (FreshRSS_Days::BEFORE_YESTERDAY, $this->today)) { ?>
  50. <div class="day" id="day_before_yesterday">
  51. <?php echo Minz_Translate::t ('before_yesterday'); ?>
  52. <span class="name"><?php echo $this->currentName; ?></span>
  53. </div>
  54. <?php $display_others = false; } ?>
  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. ?><a class="read" href="<?php echo _url ('entry', 'read', 'id', $item->id (), 'is_read', $item->isRead () ? 0 : 1); ?>"><?php
  61. echo FreshRSS_Themes::icon($item->isRead () ? 'read' : 'unread'); ?></a><?php
  62. ?></li><?php
  63. }
  64. if ($topline_favorite) {
  65. ?><li class="item manage"><?php
  66. ?><a class="bookmark" href="<?php echo _url ('entry', 'bookmark', 'id', $item->id (), 'is_favorite', $item->isFavorite () ? 0 : 1); ?>"><?php
  67. echo FreshRSS_Themes::icon($item->isFavorite () ? 'starred' : 'non-starred'); ?></a><?php
  68. ?></li><?php
  69. }
  70. }
  71. $feed = FreshRSS_CategoryDAO::findFeed($this->cat_aside, $item->feed ()); //We most likely already have the feed object in cache
  72. if (empty($feed)) $feed = $item->feed (true);
  73. ?>
  74. <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>
  75. <li class="item title"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo $item->title (); ?></a></li>
  76. <?php if ($topline_date) { ?><li class="item date"><?php echo $item->date (); ?> </li><?php } ?>
  77. <?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 } ?>
  78. </ul>
  79. <div class="flux_content">
  80. <div class="content">
  81. <h1 class="title"><?php echo $item->title (); ?></h1>
  82. <?php
  83. $author = $item->author ();
  84. echo $author != '' ? '<div class="author">' . Minz_Translate::t ('by_author', $author) . '</div>' : '';
  85. if ($lazyload) {
  86. echo $hidePosts ? lazyIframe(lazyimg($item->content())) : lazyimg($item->content());
  87. } else {
  88. echo $item->content();
  89. }
  90. ?>
  91. </div>
  92. <ul class="horizontal-list bottom"><?php
  93. if ($this->loginOk) {
  94. if ($bottomline_read) {
  95. ?><li class="item manage"><?php
  96. ?><a class="read" href="<?php echo _url ('entry', 'read', 'id', $item->id (), 'is_read', $item->isRead () ? 0 : 1); ?>"><?php
  97. echo FreshRSS_Themes::icon($item->isRead () ? 'read' : 'unread'); ?></a><?php
  98. ?></li><?php
  99. }
  100. if ($bottomline_favorite) {
  101. ?><li class="item manage"><?php
  102. ?><a class="bookmark" href="<?php echo _url ('entry', 'bookmark', 'id', $item->id (), 'is_favorite', $item->isFavorite () ? 0 : 1); ?>"><?php
  103. echo FreshRSS_Themes::icon($item->isFavorite () ? 'starred' : 'non-starred'); ?></a><?php
  104. ?></li><?php
  105. }
  106. } ?>
  107. <li class="item">
  108. <?php
  109. if ($bottomline_sharing) {
  110. $link = urlencode ($item->link ());
  111. $title = urlencode ($item->title () . ' - ' . $feed->name ());
  112. ?>
  113. <div class="dropdown">
  114. <div id="dropdown-share-<?php echo $item->id ();?>" class="dropdown-target"></div>
  115. <a class="dropdown-toggle" href="#dropdown-share-<?php echo $item->id ();?>">
  116. <?php echo FreshRSS_Themes::icon('share'); ?>
  117. <?php echo Minz_Translate::t ('share'); ?>
  118. </a>
  119. <ul class="dropdown-menu">
  120. <li class="dropdown-close"><a href="#close">❌</a></li>
  121. <?php if ($shaarli) { ?>
  122. <li class="item">
  123. <a target="_blank" href="<?php echo $shaarli . '?post=' . $link . '&amp;title=' . $title . '&amp;source=FreshRSS'; ?>">
  124. <?php echo Minz_Translate::t ('shaarli'); ?>
  125. </a>
  126. </li>
  127. <?php } if ($poche) { ?>
  128. <li class="item">
  129. <a target="_blank" href="<?php echo $poche . '?action=add&amp;url=' . base64_encode (urldecode($link)); ?>">
  130. <?php echo Minz_Translate::t ('poche'); ?>
  131. </a>
  132. </li>
  133. <?php } if ($diaspora) { ?>
  134. <li class="item">
  135. <a target="_blank" href="<?php echo $diaspora . '/bookmarklet?url=' . $link . '&amp;title=' . $title; ?>">
  136. <?php echo Minz_Translate::t ('diaspora'); ?>
  137. </a>
  138. </li>
  139. <?php } if ($twitter) { ?>
  140. <li class="item">
  141. <a target="_blank" href="https://twitter.com/share?url=<?php echo $link; ?>&amp;text=<?php echo $title; ?>">
  142. <?php echo Minz_Translate::t ('twitter'); ?>
  143. </a>
  144. </li>
  145. <?php } if ($google_plus) { ?>
  146. <li class="item">
  147. <a target="_blank" href="https://plus.google.com/share?url=<?php echo $link; ?>">
  148. <?php echo Minz_Translate::t ('g+'); ?>
  149. </a>
  150. </li>
  151. <?php } if ($facebook) { ?>
  152. <li class="item">
  153. <a target="_blank" href="https://www.facebook.com/sharer.php?u=<?php echo $link; ?>&amp;t=<?php echo $title; ?>">
  154. <?php echo Minz_Translate::t ('facebook'); ?>
  155. </a>
  156. </li>
  157. <?php } if ($email) { ?>
  158. <li class="item">
  159. <a href="mailto:?subject=<?php echo urldecode($title); ?>&amp;body=<?php echo $link; ?>">
  160. <?php echo Minz_Translate::t ('by_email'); ?>
  161. </a>
  162. </li>
  163. <?php } if ($print) { ?>
  164. <li class="item">
  165. <a href="#" class="print-article">
  166. <?php echo Minz_Translate::t ('print'); ?>
  167. </a>
  168. </li>
  169. <?php } ?>
  170. </ul>
  171. </div>
  172. <?php } ?>
  173. </li>
  174. <?php
  175. $tags = $bottomline_tags ? $item->tags() : null;
  176. if (!empty($tags)) {
  177. ?>
  178. <li class="item">
  179. <div class="dropdown">
  180. <div id="dropdown-tags-<?php echo $item->id ();?>" class="dropdown-target"></div>
  181. <a class="dropdown-toggle" href="#dropdown-tags-<?php echo $item->id ();?>">
  182. <?php echo FreshRSS_Themes::icon('tag'); ?>
  183. <?php echo Minz_Translate::t ('related_tags'); ?>
  184. </a>
  185. <ul class="dropdown-menu">
  186. <li class="dropdown-close"><a href="#close">❌</a></li>
  187. <?php foreach($tags as $tag) { ?>
  188. <li class="item"><a href="<?php echo _url ('index', 'index', 'search', urlencode ('#' . $tag)); ?>"><?php echo $tag; ?></a></li>
  189. <?php } ?>
  190. </ul>
  191. </div>
  192. </li>
  193. <?php } ?>
  194. <?php if ($bottomline_date) { ?><li class="item date"><?php echo $item->date (); ?> </li><?php } ?>
  195. <?php if ($bottomline_link) { ?><li class="item link"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a></li><?php } ?>
  196. </ul>
  197. </div>
  198. </div>
  199. <?php } ?>
  200. <?php $this->renderHelper('pagination'); ?>
  201. </div>
  202. <?php $this->partial ('nav_entries'); ?>
  203. <?php } else { ?>
  204. <div id="stream" class="alert alert-warn normal">
  205. <span class="alert-head"><?php echo Minz_Translate::t ('no_feed_to_display'); ?></span>
  206. </div>
  207. <?php } ?>