normal_view.phtml 9.1 KB

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