entry_header.phtml 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. /** @var FreshRSS_View $this */
  3. $topline_read = FreshRSS_Context::$user_conf->topline_read;
  4. $topline_favorite = FreshRSS_Context::$user_conf->topline_favorite;
  5. $topline_website = FreshRSS_Context::$user_conf->topline_website;
  6. $topline_thumbnail = FreshRSS_Context::$user_conf->topline_thumbnail;
  7. $topline_summary = FreshRSS_Context::$user_conf->topline_summary;
  8. $topline_display_authors = FreshRSS_Context::$user_conf->topline_display_authors;
  9. $topline_date = FreshRSS_Context::$user_conf->topline_date;
  10. $topline_link = FreshRSS_Context::$user_conf->topline_link;
  11. $lazyload = FreshRSS_Context::$user_conf->lazyload;
  12. ?><ul class="horizontal-list flux_header website<?= $topline_website ?>"><?php
  13. if (FreshRSS_Auth::hasAccess()) {
  14. if ($topline_read) {
  15. ?><li class="item manage"><?php
  16. $arUrl = array('c' => 'entry', 'a' => 'read', 'params' => array('id' => $this->entry->id()));
  17. if ($this->entry->isRead()) {
  18. $arUrl['params']['is_read'] = 0;
  19. }
  20. ?><a class="item-element read" href="<?= Minz_Url::display($arUrl) ?>" title="<?= _t('conf.shortcut.mark_read') ?>"><?php
  21. echo _i($this->entry->isRead() ? 'read' : 'unread'); ?></a><?php
  22. ?></li><?php
  23. }
  24. if ($topline_favorite) {
  25. ?><li class="item manage"><?php
  26. $arUrl = array('c' => 'entry', 'a' => 'bookmark', 'params' => array('id' => $this->entry->id()));
  27. if ($this->entry->isFavorite()) {
  28. $arUrl['params']['is_favorite'] = 0;
  29. }
  30. ?><a class="item-element bookmark" href="<?= Minz_Url::display($arUrl) ?>" title="<?= _t('conf.shortcut.mark_favorite') ?>"><?php
  31. echo _i($this->entry->isFavorite() ? 'starred' : 'non-starred'); ?></a><?php
  32. ?></li><?php
  33. }
  34. }
  35. if ($topline_website !== 'none'):
  36. ?><li class="item website <?= $topline_website ?>">
  37. <a href="<?= _url('index', 'index', 'get', 'f_' . $this->feed->id()) ?>" class="item-element" title="<?= _t('gen.action.filter') ?>: <?= $this->feed->name() ?>">
  38. <?php if (FreshRSS_Context::$user_conf->show_favicons && 'name' !== $topline_website): ?><img class="favicon" src="<?= $this->feed->favicon() ?>" alt="✇" loading="lazy" /><?php endif; ?><?php if ('icon' !== $topline_website): ?><span class="websiteName"><?= $this->feed->name() ?></span><?php endif; ?>
  39. </a>
  40. </li><?php
  41. endif; ?>
  42. <?php
  43. if ($topline_thumbnail !== 'none'):
  44. ?><li class="item thumbnail <?= $topline_thumbnail ?> <?= $topline_summary ? '' : 'small' ?>"><?php
  45. $thumbnail = $this->entry->thumbnail();
  46. if ($thumbnail != null):
  47. ?><img src="<?= $thumbnail['url'] ?>" class="item-element "<?= $lazyload ? ' loading="lazy"' : '' ?> alt="" /><?php
  48. endif;
  49. ?></li><?php
  50. endif; ?>
  51. <li class="item title<?= (($topline_thumbnail !== 'none') || $topline_summary) ? ' multiline' : '' ?>" dir="auto"><a target="_blank" rel="noreferrer" href="<?= $this->entry->link() ?>" class="item-element"><?= $this->entry->title() ?><?php
  52. if ($topline_display_authors):
  53. ?><span class="author"><?php
  54. $authors = $this->entry->authors();
  55. if (is_array($authors)) {
  56. $first = true;
  57. foreach ($authors as $author) {
  58. echo $first ? $author : ', ' . $author;
  59. $first = false;
  60. }
  61. }
  62. ?></span><?php
  63. endif;
  64. if ($topline_summary):
  65. ?><div class="summary"><?= trim(mb_substr(strip_tags($this->entry->content(false)), 0, 500, 'UTF-8')) ?></div><?php
  66. endif;
  67. ?></a></li>
  68. <?php if ($topline_date) { ?><li class="item date"><time datetime="<?= $this->entry->machineReadableDate() ?>" class="item-element"><?= $this->entry->date() ?></time>&nbsp;</li><?php } ?>
  69. <?php if ($topline_link) { ?><li class="item link"><a target="_blank" rel="noreferrer" href="<?= $this->entry->link() ?>" class="item-element" title="<?=
  70. _t('conf.shortcut.see_on_website') ?>"><?= _i('link') ?></a></li><?php } ?>
  71. </ul>