entry_bottom.phtml 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?php
  2. declare(strict_types=1);
  3. /** @var FreshRSS_View $this */
  4. if ($this->entry === null) {
  5. return;
  6. }
  7. $bottomline_read = FreshRSS_Context::userConf()->bottomline_read;
  8. $bottomline_favorite = FreshRSS_Context::userConf()->bottomline_favorite;
  9. $bottomline_sharing = FreshRSS_Context::userConf()->bottomline_sharing && (count(FreshRSS_Context::userConf()->sharing) > 0);
  10. $bottomline_myLabels = FreshRSS_Context::userConf()->bottomline_myLabels;
  11. $bottomline_tags = FreshRSS_Context::userConf()->bottomline_tags;
  12. $bottomline_date = FreshRSS_Context::userConf()->bottomline_date;
  13. $bottomline_link = FreshRSS_Context::userConf()->bottomline_link;
  14. ?><ul class="horizontal-list bottom"><?php
  15. if (FreshRSS_Auth::hasAccess()) {
  16. if ($bottomline_read) {
  17. ?><li class="item manage"><?php
  18. $arUrl = ['c' => 'entry', 'a' => 'read', 'params' => ['id' => $this->entry->id()]];
  19. if ($this->entry->isRead()) {
  20. $arUrl['params']['is_read'] = '0';
  21. }
  22. ?><a class="item-element read" href="<?= Minz_Url::display($arUrl) ?>" title="<?= _t('conf.shortcut.mark_read') ?>"><?php
  23. echo _i($this->entry->isRead() ? 'read' : 'unread'); ?></a><?php
  24. ?></li><?php
  25. }
  26. if ($bottomline_favorite) {
  27. ?><li class="item manage"><?php
  28. $arUrl = ['c' => 'entry', 'a' => 'bookmark', 'params' => ['id' => $this->entry->id()]];
  29. if ($this->entry->isFavorite()) {
  30. $arUrl['params']['is_favorite'] = '0';
  31. }
  32. ?><a class="item-element bookmark" href="<?= Minz_Url::display($arUrl) ?>" title="<?= _t('conf.shortcut.mark_favorite') ?>"><?php
  33. echo _i($this->entry->isFavorite() ? 'starred' : 'non-starred'); ?></a><?php
  34. ?></li><?php
  35. }
  36. }
  37. if ($bottomline_myLabels) {
  38. ?><li class="item labels">
  39. <div class="item-element dropdown dynamictags">
  40. <div id="dropdown-labels-<?= $this->entry->id() ?>" class="dropdown-target"></div>
  41. <a class="dropdown-toggle" href="#dropdown-labels-<?= $this->entry->id() ?>">
  42. <?= _i('label') ?><?= _t('index.menu.tags') ?>
  43. </a>
  44. </div>
  45. </li><?php
  46. }
  47. $tags = $bottomline_tags ? $this->entry->tags() : null;
  48. if (!empty($tags)) {
  49. ?><li class="item tags">
  50. <div class="item-element dropdown">
  51. <div id="dropdown-tags-<?= $this->entry->id() ?>" class="dropdown-target"></div>
  52. <a class="dropdown-toggle" href="#dropdown-tags-<?= $this->entry->id() ?>">
  53. <?= _i('tag') ?><?= _t('index.tag.related') ?>
  54. </a>
  55. <ul class="dropdown-menu">
  56. <?php
  57. foreach ($tags as $tag) {
  58. ?><li class="item"><a href="<?= _url('index', 'index', 'search', '#' . str_replace(' ', '+', htmlspecialchars_decode($tag, ENT_QUOTES))) ?>"><?= $tag ?></a></li><?php
  59. } ?>
  60. </ul>
  61. <a class="dropdown-close" href="#close">❌</a>
  62. </div>
  63. </li><?php
  64. }
  65. ?><li class="item share"><?php
  66. if ($bottomline_sharing) {
  67. ?><div class="item-element dropdown">
  68. <div id="dropdown-share-<?= $this->entry->id() ?>" class="dropdown-target"></div>
  69. <a class="dropdown-toggle" href="#dropdown-share-<?= $this->entry->id() ?>">
  70. <?= _i('share') ?><?= _t('index.share') ?>
  71. </a>
  72. <?php /* entry_share_menu */ ?>
  73. </div>
  74. <?php } ?>
  75. </li><?php
  76. if ($bottomline_date) {
  77. ?><li class="item date"><time datetime="<?= $this->entry->machineReadableDate() ?>" class="item-element"><?= $this->entry->date() ?></time>&nbsp;</li><?php
  78. }
  79. if ($bottomline_link) {
  80. ?><li class="item link"><a target="_blank" class="item-element" rel="noreferrer" href="<?= $this->entry->link() ?>" title="<?= _t('conf.shortcut.see_on_website') ?>"><?= _i('link') ?></a></li><?php
  81. } ?>
  82. </ul>