entry_header.phtml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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="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="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"><a href="<?= _url('index', 'index', 'get', 'f_' . $this->feed->id()) ?>" title="<?= _t('gen.action.filter') ?>">
  35. <?php if (FreshRSS_Context::$user_conf->show_favicons): ?><img class="favicon" src="<?= $this->feed->favicon() ?>" alt="✇" loading="lazy" /><?php endif; ?>
  36. <span><?= $this->feed->name() ?></span></a>
  37. </li>
  38. <?php
  39. if ($topline_thumbnail !== 'none'):
  40. ?><li class="item thumbnail <?= $topline_thumbnail ?> <?= $topline_summary ? '' : 'small' ?>"><?php
  41. $thumbnail = $this->entry->thumbnail();
  42. if ($thumbnail != null):
  43. ?><img src="<?= htmlspecialchars($thumbnail['url'], ENT_COMPAT, 'UTF-8') ?>"<?= $lazyload ? ' loading="lazy"' : '' ?><?=
  44. empty($thumbnail['alt']) ? '' : ' alt="' . htmlspecialchars(strip_tags($thumbnail['alt']), ENT_COMPAT, 'UTF-8') . '"' ?> /><?php
  45. endif;
  46. ?></li><?php
  47. endif; ?>
  48. <li class="item title<?= (($topline_thumbnail !== 'none') || $topline_summary) ? ' multiline' : '' ?>" dir="auto"><a target="_blank" rel="noreferrer" href="<?= $this->entry->link() ?>"><?= $this->entry->title() ?><?php
  49. if ($topline_display_authors):
  50. ?><span class="author"><?php
  51. $authors = $this->entry->authors();
  52. if (is_array($authors)) {
  53. $first = true;
  54. foreach ($authors as $author) {
  55. echo $first ? $author : ', ' . $author;
  56. $first = false;
  57. }
  58. }
  59. ?></span><?php
  60. endif;
  61. if ($topline_summary):
  62. ?><div class="summary">
  63. <?= mb_substr(strip_tags($this->entry->content()), 0, 500, 'UTF-8') ?>
  64. </div><?php
  65. endif;
  66. ?></a></li>
  67. <?php if ($topline_date) { ?><li class="item date"><time datetime="<?= $this->entry->machineReadableDate() ?>"><?= $this->entry->date() ?></time>&nbsp;</li><?php } ?>
  68. <?php if ($topline_link) { ?><li class="item link"><a target="_blank" rel="noreferrer" href="<?= $this->entry->link() ?>" title="<?=
  69. _t('conf.shortcut.see_on_website') ?>"><?= _i('link') ?></a></li><?php } ?>
  70. </ul>