entry_bottom.phtml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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_myLabels = FreshRSS_Context::$user_conf->bottomline_myLabels;
  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. if ($bottomline_myLabels) {
  34. ?><li class="item labels">
  35. <div class="item-element dropdown dynamictags">
  36. <div id="dropdown-labels-<?= $this->entry->id() ?>" class="dropdown-target"></div>
  37. <a class="dropdown-toggle" href="#dropdown-labels-<?= $this->entry->id() ?>">
  38. <?= _i('label') ?><?= _t('index.menu.tags') ?>
  39. </a>
  40. <ul class="dropdown-menu dropdown-menu-scrollable scrollbar-thin">
  41. <li class="dropdown-header">
  42. <?= _t('index.menu.tags') ?>
  43. <?php if (FreshRSS_Auth::hasAccess()) { ?>
  44. <a href="<?= _url('tag', 'index') ?>"><?= _i('configure') ?></a>
  45. <?php } ?>
  46. </li>
  47. <!-- Ajax -->
  48. </ul>
  49. <a class="dropdown-close" href="#close">❌</a>
  50. </div>
  51. </li><?php
  52. }
  53. $tags = $bottomline_tags ? $this->entry->tags() : null;
  54. if (!empty($tags)) {
  55. ?><li class="item tags">
  56. <div class="item-element dropdown">
  57. <div id="dropdown-tags-<?= $this->entry->id() ?>" class="dropdown-target"></div>
  58. <a class="dropdown-toggle" href="#dropdown-tags-<?= $this->entry->id() ?>">
  59. <?= _i('tag') ?><?= _t('index.tag.related') ?>
  60. </a>
  61. <ul class="dropdown-menu">
  62. <?php
  63. foreach ($tags as $tag) {
  64. ?><li class="item"><a href="<?= _url('index', 'index', 'search', '#' . str_replace(' ', '+', htmlspecialchars_decode($tag, ENT_QUOTES))) ?>"><?= $tag ?></a></li><?php
  65. } ?>
  66. </ul>
  67. <a class="dropdown-close" href="#close">❌</a>
  68. </div>
  69. </li><?php
  70. }
  71. ?><li class="item share"><?php
  72. if ($bottomline_sharing) {
  73. ?><div class="item-element dropdown">
  74. <div id="dropdown-share-<?= $this->entry->id() ?>" class="dropdown-target"></div>
  75. <a class="dropdown-toggle" href="#dropdown-share-<?= $this->entry->id() ?>">
  76. <?= _i('share') ?><?= _t('index.share') ?>
  77. </a>
  78. <ul class="dropdown-menu">
  79. <li class="dropdown-header"><?= _t('index.share') ?> <a href="<?= _url('configure', 'integration') ?>"><?= _i('configure') ?></a></li><?php
  80. $id = $this->entry->id();
  81. $link = $this->entry->link();
  82. $title = $this->entry->title() . ' · ' . $this->feed->name();
  83. foreach (FreshRSS_Context::$user_conf->sharing as $share_options) {
  84. $share = FreshRSS_Share::get($share_options['type']);
  85. if ($share === null) {
  86. continue;
  87. }
  88. $cssClass = $share->isDeprecated() ? ' error' : '';
  89. $share_options['id'] = $id;
  90. $share_options['link'] = $link;
  91. $share_options['title'] = $title;
  92. $share->update($share_options);
  93. ?><li class="item share<?= $cssClass ?>">
  94. <?php if ('GET' === $share->method()) {
  95. if ($share->HTMLtag() !== 'button') {?>
  96. <a target="_blank" rel="noreferrer" href="<?= $share->url() ?>" data-type="<?= $share->type() ?>"><?= $share->name() ?></a>
  97. <?php } else { ?>
  98. <button type="button" class="as-link" data-url="<?= $share->url() ?>" data-type="<?= $share->type() ?>" data-title="<?= htmlspecialchars($title) ?>"><?= $share->name() ?></button>
  99. <?php
  100. }
  101. } else {?>
  102. <a href="POST"><?= $share->name() ?></a>
  103. <form method="POST" action="<?= $share->url() ?>" disabled="disabled">
  104. <input type="hidden" value="<?= $link ?>" name="<?= $share->field() ?>"/>
  105. </form>
  106. <?php } ?>
  107. </li><?php
  108. }
  109. ?></ul>
  110. <a class="dropdown-close" href="#close">❌</a>
  111. </div>
  112. <?php } ?>
  113. </li><?php
  114. if ($bottomline_date) {
  115. ?><li class="item date"><time datetime="<?= $this->entry->machineReadableDate() ?>" class="item-element"><?= $this->entry->date() ?></time>&nbsp;</li><?php
  116. }
  117. if ($bottomline_link) {
  118. ?><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
  119. } ?>
  120. </ul>