entry_bottom.phtml 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. <ul class="dropdown-menu dropdown-menu-scrollable scrollbar-thin">
  45. <li class="dropdown-header">
  46. <?= _t('index.menu.tags') ?>
  47. <?php if (FreshRSS_Auth::hasAccess()) { ?>
  48. <a href="<?= _url('tag', 'index') ?>"><?= _i('configure') ?></a>
  49. <?php } ?>
  50. </li>
  51. <!-- Ajax -->
  52. </ul>
  53. <a class="dropdown-close" href="#close">❌</a>
  54. </div>
  55. </li><?php
  56. }
  57. $tags = $bottomline_tags ? $this->entry->tags() : null;
  58. if (!empty($tags)) {
  59. ?><li class="item tags">
  60. <div class="item-element dropdown">
  61. <div id="dropdown-tags-<?= $this->entry->id() ?>" class="dropdown-target"></div>
  62. <a class="dropdown-toggle" href="#dropdown-tags-<?= $this->entry->id() ?>">
  63. <?= _i('tag') ?><?= _t('index.tag.related') ?>
  64. </a>
  65. <ul class="dropdown-menu">
  66. <?php
  67. foreach ($tags as $tag) {
  68. ?><li class="item"><a href="<?= _url('index', 'index', 'search', '#' . str_replace(' ', '+', htmlspecialchars_decode($tag, ENT_QUOTES))) ?>"><?= $tag ?></a></li><?php
  69. } ?>
  70. </ul>
  71. <a class="dropdown-close" href="#close">❌</a>
  72. </div>
  73. </li><?php
  74. }
  75. ?><li class="item share"><?php
  76. if ($bottomline_sharing) {
  77. ?><div class="item-element dropdown">
  78. <div id="dropdown-share-<?= $this->entry->id() ?>" class="dropdown-target"></div>
  79. <a class="dropdown-toggle" href="#dropdown-share-<?= $this->entry->id() ?>">
  80. <?= _i('share') ?><?= _t('index.share') ?>
  81. </a>
  82. <?php /* entry_share_menu */ ?>
  83. </div>
  84. <?php } ?>
  85. </li><?php
  86. if ($bottomline_date) {
  87. ?><li class="item date"><time datetime="<?= $this->entry->machineReadableDate() ?>" class="item-element"><?= $this->entry->date() ?></time>&nbsp;</li><?php
  88. }
  89. if ($bottomline_link) {
  90. ?><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
  91. } ?>
  92. </ul>