entry_bottom.phtml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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') ?>"><?=
  23. _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') ?>"><?=
  33. _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') ?><span class="dropdown-label"><?= _t('index.menu.mylabels') ?></span>
  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') ?><span class="dropdown-label"><?= _t('index.tag.related') ?></span>
  54. </a>
  55. <ul class="dropdown-menu">
  56. <li class="dropdown-header"><?= _t('index.tag.related') ?></li>
  57. <?php
  58. foreach ($tags as $tag) {
  59. ?><li class="item"><a href="<?= _url('index', 'index', 'search', '#' .
  60. FreshRSS_tag_Controller::escapeForSearch($tag)) ?>"><?= $tag ?></a></li><?php
  61. } ?>
  62. </ul>
  63. <a class="dropdown-close" href="#close">❌</a>
  64. </div>
  65. </li><?php
  66. }
  67. ?><li class="item share"><?php
  68. if ($bottomline_sharing) {
  69. ?><div class="item-element dropdown">
  70. <div id="dropdown-share-<?= $this->entry->id() ?>" class="dropdown-target"></div>
  71. <a class="dropdown-toggle" href="#dropdown-share-<?= $this->entry->id() ?>">
  72. <?= _i('share') ?><span class="dropdown-label"><?= _t('index.share') ?></span>
  73. </a>
  74. <?php /* entry_share_menu */ ?>
  75. </div>
  76. <?php } ?>
  77. </li><?php
  78. if ($bottomline_date) {
  79. ?><li class="item date"><time datetime="<?= $this->entry->machineReadableDate() ?>" class="item-element"><?= $this->entry->date() ?></time>&nbsp;</li><?php
  80. }
  81. if ($bottomline_link) {
  82. ?><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
  83. } ?>
  84. </ul>