4
0

entry_bottom.phtml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <?php
  2. /** @var FreshRSS_View $this */
  3. $bottomline_read = FreshRSS_Context::$user_conf->bottomline_read;
  4. $bottomline_favorite = FreshRSS_Context::$user_conf->bottomline_favorite;
  5. $bottomline_sharing = FreshRSS_Context::$user_conf->bottomline_sharing && (count(FreshRSS_Context::$user_conf->sharing) > 0);
  6. $bottomline_labels = true; //TODO
  7. $bottomline_tags = FreshRSS_Context::$user_conf->bottomline_tags;
  8. $bottomline_date = FreshRSS_Context::$user_conf->bottomline_date;
  9. $bottomline_link = FreshRSS_Context::$user_conf->bottomline_link;
  10. ?><ul class="horizontal-list bottom"><?php
  11. if (FreshRSS_Auth::hasAccess()) {
  12. if ($bottomline_read) {
  13. ?><li class="item manage"><?php
  14. $arUrl = array('c' => 'entry', 'a' => 'read', 'params' => array('id' => $this->entry->id()));
  15. if ($this->entry->isRead()) {
  16. $arUrl['params']['is_read'] = 0;
  17. }
  18. ?><a class="item-element read" href="<?= Minz_Url::display($arUrl) ?>" title="<?= _t('conf.shortcut.mark_read') ?>"><?php
  19. echo _i($this->entry->isRead() ? 'read' : 'unread'); ?></a><?php
  20. ?></li><?php
  21. }
  22. if ($bottomline_favorite) {
  23. ?><li class="item manage"><?php
  24. $arUrl = array('c' => 'entry', 'a' => 'bookmark', 'params' => array('id' => $this->entry->id()));
  25. if ($this->entry->isFavorite()) {
  26. $arUrl['params']['is_favorite'] = 0;
  27. }
  28. ?><a class="item-element bookmark" href="<?= Minz_Url::display($arUrl) ?>" title="<?= _t('conf.shortcut.mark_favorite') ?>"><?php
  29. echo _i($this->entry->isFavorite() ? 'starred' : 'non-starred'); ?></a><?php
  30. ?></li><?php
  31. }
  32. }
  33. // @phpstan-ignore-next-line
  34. if ($bottomline_labels) {
  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. <ul class="dropdown-menu">
  80. <li class="dropdown-header"><?= _t('index.share') ?> <a href="<?= _url('configure', 'integration') ?>"><?= _i('configure') ?></a></li><?php
  81. $id = $this->entry->id();
  82. $link = $this->entry->link();
  83. $title = $this->entry->title() . ' · ' . $this->feed->name();
  84. foreach (FreshRSS_Context::$user_conf->sharing as $share_options) {
  85. $share = FreshRSS_Share::get($share_options['type']);
  86. if ($share === null) {
  87. continue;
  88. }
  89. $cssClass = $share->isDeprecated() ? ' error' : '';
  90. $share_options['id'] = $id;
  91. $share_options['link'] = $link;
  92. $share_options['title'] = $title;
  93. $share->update($share_options);
  94. ?><li class="item share<?= $cssClass ?>">
  95. <?php if ('GET' === $share->method()) {
  96. if ($share->HTMLtag() !== 'button') {?>
  97. <a target="_blank" rel="noreferrer" href="<?= $share->url() ?>" data-type="<?= $share->type() ?>"><?= $share->name() ?></a>
  98. <?php } else { ?>
  99. <button type="button" class="as-link" data-url="<?= $share->url() ?>" data-type="<?= $share->type() ?>" data-title="<?= htmlspecialchars($title) ?>"><?= $share->name() ?></button>
  100. <?php
  101. }
  102. } else {?>
  103. <a href="POST"><?= $share->name() ?></a>
  104. <form method="POST" action="<?= $share->url() ?>" disabled="disabled">
  105. <input type="hidden" value="<?= $link ?>" name="<?= $share->field() ?>"/>
  106. </form>
  107. <?php } ?>
  108. </li><?php
  109. }
  110. ?></ul>
  111. <a class="dropdown-close" href="#close">❌</a>
  112. </div>
  113. <?php } ?>
  114. </li><?php
  115. if ($bottomline_date) {
  116. ?><li class="item date"><time datetime="<?= $this->entry->machineReadableDate() ?>" class="item-element"><?= $this->entry->date() ?></time>&nbsp;</li><?php
  117. }
  118. if ($bottomline_link) {
  119. ?><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
  120. } ?>
  121. </ul>