entry_bottom.phtml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <?php
  2. $sharing = array();
  3. if (FreshRSS_Auth::hasAccess()) {
  4. $sharing = FreshRSS_Context::$user_conf->sharing;
  5. }
  6. $bottomline_read = FreshRSS_Context::$user_conf->bottomline_read;
  7. $bottomline_favorite = FreshRSS_Context::$user_conf->bottomline_favorite;
  8. $bottomline_sharing = FreshRSS_Context::$user_conf->bottomline_sharing && (count($sharing) > 0);
  9. $bottomline_labels = true; //TODO
  10. $bottomline_tags = FreshRSS_Context::$user_conf->bottomline_tags;
  11. $bottomline_date = FreshRSS_Context::$user_conf->bottomline_date;
  12. $bottomline_link = FreshRSS_Context::$user_conf->bottomline_link;
  13. ?><ul class="horizontal-list bottom"><?php
  14. if (FreshRSS_Auth::hasAccess()) {
  15. if ($bottomline_read) {
  16. ?><li class="item manage"><?php
  17. $arUrl = array('c' => 'entry', 'a' => 'read', 'params' => array('id' => $this->entry->id()));
  18. if ($this->entry->isRead()) {
  19. $arUrl['params']['is_read'] = 0;
  20. }
  21. ?><a class="read" href="<?= Minz_Url::display($arUrl) ?>" title="<?= _t('conf.shortcut.mark_read') ?>"><?php
  22. echo _i($this->entry->isRead() ? 'read' : 'unread'); ?></a><?php
  23. ?></li><?php
  24. }
  25. if ($bottomline_favorite) {
  26. ?><li class="item manage"><?php
  27. $arUrl = array('c' => 'entry', 'a' => 'bookmark', 'params' => array('id' => $this->entry->id()));
  28. if ($this->entry->isFavorite()) {
  29. $arUrl['params']['is_favorite'] = 0;
  30. }
  31. ?><a class="bookmark" href="<?= Minz_Url::display($arUrl) ?>" title="<?= _t('conf.shortcut.mark_favorite') ?>"><?php
  32. echo _i($this->entry->isFavorite() ? 'starred' : 'non-starred'); ?></a><?php
  33. ?></li><?php
  34. }
  35. }
  36. if ($bottomline_labels) {
  37. ?><li class="item">
  38. <div class="dropdown dynamictags">
  39. <div id="dropdown-labels-<?= $this->entry->id() ?>" class="dropdown-target"></div>
  40. <?= FreshRSS_Themes::alt('label') ?>
  41. <a class="dropdown-toggle" href="#dropdown-labels-<?= $this->entry->id() ?>"><?php
  42. echo _t('index.menu.tags');
  43. ?></a>
  44. <ul class="dropdown-menu dropdown-menu-scrollable">
  45. <li class="dropdown-close"><a href="#close">❌</a></li>
  46. <!-- Ajax -->
  47. </ul>
  48. <div class="dropdown-close"><a href="#close">❌</a></div>
  49. </div>
  50. </li><?php
  51. }
  52. $tags = $bottomline_tags ? $this->entry->tags() : null;
  53. if (!empty($tags)) {
  54. ?><li class="item">
  55. <div class="dropdown">
  56. <div id="dropdown-tags-<?= $this->entry->id() ?>" class="dropdown-target"></div>
  57. <?= _i('tag') ?>
  58. <a class="dropdown-toggle" href="#dropdown-tags-<?= $this->entry->id() ?>"><?php
  59. echo _t('index.tag.related');
  60. ?></a>
  61. <ul class="dropdown-menu">
  62. <li class="dropdown-close"><a href="#close">❌</a></li><?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. </div>
  68. </li><?php
  69. }
  70. ?><li class="item"><?php
  71. if ($bottomline_sharing) {
  72. ?><div class="dropdown">
  73. <div id="dropdown-share-<?= $this->entry->id() ?>" class="dropdown-target"></div>
  74. <a class="dropdown-toggle" href="#dropdown-share-<?= $this->entry->id() ?>">
  75. <?= _i('share') ?>
  76. <?= _t('index.share') ?>
  77. </a>
  78. <ul class="dropdown-menu">
  79. <li class="dropdown-close"><a href="#close">❌</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. $share_options['id'] = $id;
  89. $share_options['link'] = $link;
  90. $share_options['title'] = $title;
  91. $share->update($share_options);
  92. ?><li class="item share">
  93. <?php if ('GET' === $share->method()) {?>
  94. <a target="_blank" rel="noreferrer" href="<?= $share->url() ?>"><?= $share->name() ?></a>
  95. <?php } else {?>
  96. <a href="POST"><?= $share->name() ?></a>
  97. <form method="POST" action="<?= $share->url() ?>" disabled="disabled">
  98. <input type="hidden" value="<?= $link ?>" name="<?= $share->field() ?>"/>
  99. </form>
  100. <?php } ?>
  101. </li><?php
  102. }
  103. ?></ul>
  104. </div>
  105. <?php } ?>
  106. </li><?php
  107. if ($bottomline_date) {
  108. ?><li class="item date"><time datetime="<?= $this->entry->machineReadableDate() ?>"><?= $this->entry->date() ?></time>&nbsp;</li><?php
  109. }
  110. if ($bottomline_link) {
  111. ?><li class="item link"><a target="_blank" rel="noreferrer" href="<?= $this->entry->link() ?>" title="<?= _t('conf.shortcut.see_on_website') ?>"><?= _i('link') ?></a></li><?php
  112. } ?>
  113. </ul>