entry_header.phtml 3.6 KB

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