entry_bottom.phtml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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_tags = FreshRSS_Context::$user_conf->bottomline_tags;
  10. $bottomline_date = FreshRSS_Context::$user_conf->bottomline_date;
  11. $bottomline_link = FreshRSS_Context::$user_conf->bottomline_link;
  12. ?><ul class="horizontal-list bottom"><?php
  13. if (FreshRSS_Auth::hasAccess()) {
  14. if ($bottomline_read) {
  15. ?><li class="item manage"><?php
  16. $arUrl = array('c' => 'entry', 'a' => 'read', 'params' => array('id' => $this->entry->id()));
  17. if ($this->entry->isRead()) {
  18. $arUrl['params']['is_read'] = 0;
  19. }
  20. ?><a class="read" href="<?php echo Minz_Url::display($arUrl); ?>"><?php
  21. echo _i($this->entry->isRead() ? 'read' : 'unread'); ?></a><?php
  22. ?></li><?php
  23. }
  24. if ($bottomline_favorite) {
  25. ?><li class="item manage"><?php
  26. $arUrl = array('c' => 'entry', 'a' => 'bookmark', 'params' => array('id' => $this->entry->id()));
  27. if ($this->entry->isFavorite()) {
  28. $arUrl['params']['is_favorite'] = 0;
  29. }
  30. ?><a class="bookmark" href="<?php echo Minz_Url::display($arUrl); ?>"><?php
  31. echo _i($this->entry->isFavorite() ? 'starred' : 'non-starred'); ?></a><?php
  32. ?></li><?php
  33. }
  34. } ?>
  35. <li class="item"><?php
  36. if ($bottomline_sharing) {
  37. ?><div class="dropdown">
  38. <div id="dropdown-share-<?php echo $this->entry->id();?>" class="dropdown-target"></div>
  39. <a class="dropdown-toggle" href="#dropdown-share-<?php echo $this->entry->id();?>">
  40. <?php echo _i('share'); ?>
  41. <?php echo _t('index.share'); ?>
  42. </a>
  43. <ul class="dropdown-menu">
  44. <li class="dropdown-close"><a href="#close">❌</a></li><?php
  45. $link = $this->entry->link();
  46. $title = $this->entry->title() . ' · ' . $this->feed->name();
  47. foreach (FreshRSS_Context::$user_conf->sharing as $share_options) {
  48. $share = FreshRSS_Share::get($share_options['type']);
  49. if ($share === null) {
  50. continue;
  51. }
  52. $share_options['link'] = $link;
  53. $share_options['title'] = $title;
  54. $share->update($share_options);
  55. ?><li class="item share">
  56. <?php if ('GET' === $share->method()) {?>
  57. <a target="_blank" rel="noreferrer" href="<?php echo $share->url(); ?>"><?php echo $share->name(); ?></a>
  58. <?php } else {?>
  59. <a href="POST"><?php echo $share->name(); ?></a>
  60. <form method="POST" data-url="<?php echo $share->url(); ?>">
  61. <input type="hidden" value="<?php echo $link; ?>" name="<?php echo $share->field(); ?>"/>
  62. </form>
  63. <?php } ?>
  64. </li><?php
  65. }
  66. ?></ul>
  67. </div>
  68. <?php } ?>
  69. </li><?php
  70. $tags = $bottomline_tags ? $this->entry->tags() : null;
  71. if (!empty($tags)) {
  72. ?><li class="item">
  73. <div class="dropdown">
  74. <div id="dropdown-tags-<?php echo $this->entry->id();?>" class="dropdown-target"></div>
  75. <?php echo _i('tag'); ?>
  76. <a class="dropdown-toggle" href="#dropdown-tags-<?php echo $this->entry->id();?>"><?php
  77. echo _t('index.tag.related');
  78. ?></a>
  79. <ul class="dropdown-menu">
  80. <li class="dropdown-close"><a href="#close">❌</a></li><?php
  81. foreach($tags as $tag) {
  82. ?><li class="item"><a href="<?php echo _url('index', 'index', 'search', '#' . htmlspecialchars_decode($tag)); ?>"><?php echo $tag; ?></a></li><?php
  83. } ?>
  84. </ul>
  85. </div>
  86. </li><?php
  87. }
  88. if ($bottomline_date) {
  89. ?><li class="item date"><?php echo $this->entry->date(); ?></li><?php
  90. }
  91. if ($bottomline_link) {
  92. ?><li class="item link"><a target="_blank" rel="noreferrer" href="<?php echo $this->entry->link(); ?>"><?php echo _i('link'); ?></a></li><?php
  93. } ?>
  94. </ul>