reader.phtml 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. $this->partial('nav_menu');
  3. if (!empty($this->entries)) {
  4. $lazyload = FreshRSS_Context::$user_conf->lazyload;
  5. $content_width = FreshRSS_Context::$user_conf->content_width;
  6. ?>
  7. <div id="stream" class="reader"><?php
  8. foreach ($this->entries as $item) {
  9. $item = Minz_ExtensionManager::callHook('entry_before_display', $item);
  10. if (is_null($item)) {
  11. continue;
  12. }
  13. ?><div class="flux<?php echo !$item->isRead() ? ' not_read' : ''; ?><?php echo $item->isFavorite() ? ' favorite' : ''; ?>" id="flux_<?php echo $item->id(); ?>">
  14. <div class="flux_content">
  15. <div class="content <?php echo $content_width; ?>">
  16. <?php
  17. $feed = FreshRSS_CategoryDAO::findFeed($this->categories, $item->feed()); //We most likely already have the feed object in cache
  18. if (empty($feed)) $feed = $item->feed(true);
  19. $favoriteUrl = array('c' => 'entry', 'a' => 'bookmark', 'params' => array('id' => $item->id()));
  20. if ($item->isFavorite()) {
  21. $favoriteUrl['params']['is_favorite'] = 0;
  22. }
  23. $readUrl = array('c' => 'entry', 'a' => 'read', 'params' => array('id' => $item->id()));
  24. if ($item->isRead()) {
  25. $readUrl['params']['is_read'] = 0;
  26. }
  27. ?>
  28. <a class="read" href="<?php echo Minz_Url::display($readUrl); ?>">
  29. <?php echo _i($item->isRead() ? 'read' : 'unread'); ?>
  30. </a>
  31. <a class="bookmark" href="<?php echo Minz_Url::display($favoriteUrl); ?>">
  32. <?php echo _i($item->isFavorite() ? 'starred' : 'non-starred'); ?>
  33. </a>
  34. <a href="<?php echo _url('index', 'reader', 'get', 'f_' . $feed->id()); ?>">
  35. <img class="favicon" src="<?php echo $feed->favicon(); ?>" alt="✇" /> <span><?php echo $feed->name(); ?></span>
  36. </a>
  37. <h1 class="title"><a target="_blank" rel="noreferrer" class="go_website" href="<?php echo $item->link(); ?>"><?php echo $item->title(); ?></a></h1>
  38. <div class="author"><?php
  39. $author = $item->author();
  40. echo $author != '' ? _t('gen.short.by_author', $author) . ' — ' : '',
  41. $item->date();
  42. ?></div>
  43. <?php echo $item->content(); ?>
  44. </div>
  45. </div>
  46. </div>
  47. <?php } ?>
  48. <?php $this->renderHelper('pagination'); ?>
  49. </div>
  50. <?php } else { ?>
  51. <div id="stream" class="prompt alert alert-warn reader">
  52. <h2><?php echo _t('index.feed.empty'); ?></h2>
  53. <a href="<?php echo _url('subscription', 'index'); ?>"><?php echo _t('index.feed.add'); ?></a><br /><br />
  54. </div>
  55. <?php } ?>