entry_bottom.phtml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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="<?php echo Minz_Url::display($arUrl); ?>"><?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="<?php echo Minz_Url::display($arUrl); ?>"><?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-<?php echo $this->entry->id();?>" class="dropdown-target"></div>
  40. <?php echo FreshRSS_Themes::alt('label'); ?>
  41. <a class="dropdown-toggle" href="#dropdown-labels-<?php echo $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>
  49. </li><?php
  50. }
  51. $tags = $bottomline_tags ? $this->entry->tags() : null;
  52. if (!empty($tags)) {
  53. ?><li class="item">
  54. <div class="dropdown">
  55. <div id="dropdown-tags-<?php echo $this->entry->id();?>" class="dropdown-target"></div>
  56. <?php echo _i('tag'); ?>
  57. <a class="dropdown-toggle" href="#dropdown-tags-<?php echo $this->entry->id();?>"><?php
  58. echo _t('index.tag.related');
  59. ?></a>
  60. <ul class="dropdown-menu">
  61. <li class="dropdown-close"><a href="#close">❌</a></li><?php
  62. foreach ($tags as $tag) {
  63. ?><li class="item"><a href="<?php echo _url('index', 'index', 'search', '#' . str_replace(' ', '+', htmlspecialchars_decode($tag, ENT_QUOTES))); ?>"><?php echo $tag; ?></a></li><?php
  64. } ?>
  65. </ul>
  66. </div>
  67. </li><?php
  68. }
  69. ?><li class="item"><?php
  70. if ($bottomline_sharing) {
  71. ?><div class="dropdown">
  72. <div id="dropdown-share-<?php echo $this->entry->id();?>" class="dropdown-target"></div>
  73. <a class="dropdown-toggle" href="#dropdown-share-<?php echo $this->entry->id();?>">
  74. <?php echo _i('share'); ?>
  75. <?php echo _t('index.share'); ?>
  76. </a>
  77. <ul class="dropdown-menu">
  78. <li class="dropdown-close"><a href="#close">❌</a></li><?php
  79. $link = $this->entry->link();
  80. $title = $this->entry->title() . ' · ' . $this->feed->name();
  81. foreach (FreshRSS_Context::$user_conf->sharing as $share_options) {
  82. $share = FreshRSS_Share::get($share_options['type']);
  83. if ($share === null) {
  84. continue;
  85. }
  86. $share_options['link'] = $link;
  87. $share_options['title'] = $title;
  88. $share->update($share_options);
  89. ?><li class="item share">
  90. <?php if ('GET' === $share->method()) {?>
  91. <a target="_blank" rel="noreferrer" href="<?php echo $share->url(); ?>"><?php echo $share->name(); ?></a>
  92. <?php } else {?>
  93. <a href="POST"><?php echo $share->name(); ?></a>
  94. <form method="POST" action="<?php echo $share->url(); ?>" disabled="disabled">
  95. <input type="hidden" value="<?php echo $link; ?>" name="<?php echo $share->field(); ?>"/>
  96. </form>
  97. <?php } ?>
  98. </li><?php
  99. }
  100. ?></ul>
  101. </div>
  102. <?php } ?>
  103. </li><?php
  104. if ($bottomline_date) {
  105. ?><li class="item date"><?php echo $this->entry->date(); ?></li><?php
  106. }
  107. if ($bottomline_link) {
  108. ?><li class="item link"><a target="_blank" rel="noreferrer" href="<?php echo $this->entry->link(); ?>"><?php echo _i('link'); ?></a></li><?php
  109. } ?>
  110. </ul>