entry_bottom.phtml 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <?php
  2. declare(strict_types=1);
  3. /** @var FreshRSS_View $this */
  4. $bottomline_read = FreshRSS_Context::userConf()->bottomline_read;
  5. $bottomline_favorite = FreshRSS_Context::userConf()->bottomline_favorite;
  6. $bottomline_sharing = FreshRSS_Context::userConf()->bottomline_sharing && (count(FreshRSS_Context::userConf()->sharing) > 0);
  7. $bottomline_myLabels = FreshRSS_Context::userConf()->bottomline_myLabels;
  8. $bottomline_tags = FreshRSS_Context::userConf()->bottomline_tags;
  9. $bottomline_date = FreshRSS_Context::userConf()->bottomline_date;
  10. $bottomline_link = FreshRSS_Context::userConf()->bottomline_link;
  11. ?><ul class="horizontal-list bottom"><?php
  12. if (FreshRSS_Auth::hasAccess()) {
  13. if ($bottomline_read) {
  14. ?><li class="item manage"><?php
  15. $arUrl = ['c' => 'entry', 'a' => 'read', 'params' => ['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 ($bottomline_favorite) {
  24. ?><li class="item manage"><?php
  25. $arUrl = ['c' => 'entry', 'a' => 'bookmark', 'params' => ['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. if ($bottomline_myLabels) {
  35. ?><li class="item labels">
  36. <div class="item-element dropdown dynamictags">
  37. <div id="dropdown-labels-<?= $this->entry->id() ?>" class="dropdown-target"></div>
  38. <a class="dropdown-toggle" href="#dropdown-labels-<?= $this->entry->id() ?>">
  39. <?= _i('label') ?><?= _t('index.menu.tags') ?>
  40. </a>
  41. <ul class="dropdown-menu dropdown-menu-scrollable scrollbar-thin">
  42. <li class="dropdown-header">
  43. <?= _t('index.menu.tags') ?>
  44. <?php if (FreshRSS_Auth::hasAccess()) { ?>
  45. <a href="<?= _url('tag', 'index') ?>"><?= _i('configure') ?></a>
  46. <?php } ?>
  47. </li>
  48. <!-- Ajax -->
  49. </ul>
  50. <a class="dropdown-close" href="#close">❌</a>
  51. </div>
  52. </li><?php
  53. }
  54. $tags = $bottomline_tags ? $this->entry->tags() : null;
  55. if (!empty($tags)) {
  56. ?><li class="item tags">
  57. <div class="item-element dropdown">
  58. <div id="dropdown-tags-<?= $this->entry->id() ?>" class="dropdown-target"></div>
  59. <a class="dropdown-toggle" href="#dropdown-tags-<?= $this->entry->id() ?>">
  60. <?= _i('tag') ?><?= _t('index.tag.related') ?>
  61. </a>
  62. <ul class="dropdown-menu">
  63. <?php
  64. foreach ($tags as $tag) {
  65. ?><li class="item"><a href="<?= _url('index', 'index', 'search', '#' . str_replace(' ', '+', htmlspecialchars_decode($tag, ENT_QUOTES))) ?>"><?= $tag ?></a></li><?php
  66. } ?>
  67. </ul>
  68. <a class="dropdown-close" href="#close">❌</a>
  69. </div>
  70. </li><?php
  71. }
  72. ?><li class="item share"><?php
  73. if ($bottomline_sharing) {
  74. ?><div class="item-element dropdown">
  75. <div id="dropdown-share-<?= $this->entry->id() ?>" class="dropdown-target"></div>
  76. <a class="dropdown-toggle" href="#dropdown-share-<?= $this->entry->id() ?>">
  77. <?= _i('share') ?><?= _t('index.share') ?>
  78. </a>
  79. <?php /* entry_share_menu */ ?>
  80. </div>
  81. <?php } ?>
  82. </li><?php
  83. if ($bottomline_date) {
  84. ?><li class="item date"><time datetime="<?= $this->entry->machineReadableDate() ?>" class="item-element"><?= $this->entry->date() ?></time>&nbsp;</li><?php
  85. }
  86. if ($bottomline_link) {
  87. ?><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
  88. } ?>
  89. </ul>