entry_header.phtml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. $topline_read = FreshRSS_Context::$user_conf->topline_read;
  3. $topline_favorite = FreshRSS_Context::$user_conf->topline_favorite;
  4. $topline_display_authors = FreshRSS_Context::$user_conf->topline_display_authors;
  5. $topline_date = FreshRSS_Context::$user_conf->topline_date;
  6. $topline_link = FreshRSS_Context::$user_conf->topline_link;
  7. ?><ul class="horizontal-list flux_header"><?php
  8. if (FreshRSS_Auth::hasAccess()) {
  9. if ($topline_read) {
  10. ?><li class="item manage"><?php
  11. $arUrl = array('c' => 'entry', 'a' => 'read', 'params' => array('id' => $this->entry->id()));
  12. if ($this->entry->isRead()) {
  13. $arUrl['params']['is_read'] = 0;
  14. }
  15. ?><a class="read" href="<?= Minz_Url::display($arUrl) ?>" title="<?= _t('conf.shortcut.mark_read') ?>"><?php
  16. echo _i($this->entry->isRead() ? 'read' : 'unread'); ?></a><?php
  17. ?></li><?php
  18. }
  19. if ($topline_favorite) {
  20. ?><li class="item manage"><?php
  21. $arUrl = array('c' => 'entry', 'a' => 'bookmark', 'params' => array('id' => $this->entry->id()));
  22. if ($this->entry->isFavorite()) {
  23. $arUrl['params']['is_favorite'] = 0;
  24. }
  25. ?><a class="bookmark" href="<?= Minz_Url::display($arUrl) ?>" title="<?= _t('conf.shortcut.mark_favorite') ?>"><?php
  26. echo _i($this->entry->isFavorite() ? 'starred' : 'non-starred'); ?></a><?php
  27. ?></li><?php
  28. }
  29. }
  30. ?><li class="item website"><a href="<?= _url('index', 'index', 'get', 'f_' . $this->feed->id()) ?>" title="<?= _t('gen.action.filter') ?>">
  31. <?php if (FreshRSS_Context::$user_conf->show_favicons): ?><img class="favicon" src="<?= $this->feed->favicon() ?>" alt="✇" loading="lazy" /><?php endif; ?>
  32. <span><?= $this->feed->name() ?></span></a></li>
  33. <li class="item title" dir="auto"><a target="_blank" rel="noreferrer" href="<?= $this->entry->link() ?>"><?= $this->entry->title() ?><?php
  34. if ($topline_display_authors):
  35. ?><span class="author"><?php
  36. $authors = $this->entry->authors();
  37. if (is_array($authors)) {
  38. $first = true;
  39. foreach ($authors as $author) {
  40. echo $first ? $author : ', ' . $author;
  41. $first = false;
  42. }
  43. }
  44. ?></span><?php
  45. endif;
  46. ?></a></li>
  47. <?php if ($topline_date) { ?><li class="item date"><time datetime="<?= $this->entry->machineReadableDate() ?>"><?= $this->entry->date() ?></time>&nbsp;</li><?php } ?>
  48. <?php if ($topline_link) { ?><li class="item link"><a target="_blank" rel="noreferrer" href="<?= $this->entry->link() ?>" title="<?= _t('conf.shortcut.see_on_website') ?>"><?= _i('link') ?></a></li><?php } ?>
  49. </ul>