entry_bottom.phtml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. $share_options['link'] = $link;
  50. $share_options['title'] = $title;
  51. $share->update($share_options);
  52. ?><li class="item share">
  53. <?php if ('GET' === $share->method()) {?>
  54. <a target="_blank" rel="noreferrer" href="<?php echo $share->url(); ?>"><?php echo $share->name(); ?></a>
  55. <?php } else {?>
  56. <a href="POST"><?php echo $share->name(); ?></a>
  57. <form method="POST" data-url="<?php echo $share->url(); ?>">
  58. <input type="hidden" value="<?php echo $link; ?>" name="<?php echo $share->field(); ?>"/>
  59. </form>
  60. <?php } ?>
  61. </li><?php
  62. }
  63. ?></ul>
  64. </div>
  65. <?php } ?>
  66. </li><?php
  67. $tags = $bottomline_tags ? $this->entry->tags() : null;
  68. if (!empty($tags)) {
  69. ?><li class="item">
  70. <div class="dropdown">
  71. <div id="dropdown-tags-<?php echo $this->entry->id();?>" class="dropdown-target"></div>
  72. <?php echo _i('tag'); ?>
  73. <a class="dropdown-toggle" href="#dropdown-tags-<?php echo $this->entry->id();?>"><?php
  74. echo _t('index.tag.related');
  75. ?></a>
  76. <ul class="dropdown-menu">
  77. <li class="dropdown-close"><a href="#close">❌</a></li><?php
  78. foreach($tags as $tag) {
  79. ?><li class="item"><a href="<?php echo _url('index', 'index', 'search', '#' . htmlspecialchars_decode($tag)); ?>"><?php echo $tag; ?></a></li><?php
  80. } ?>
  81. </ul>
  82. </div>
  83. </li><?php
  84. }
  85. if ($bottomline_date) {
  86. ?><li class="item date"><?php echo $this->entry->date(); ?></li><?php
  87. }
  88. if ($bottomline_link) {
  89. ?><li class="item link"><a target="_blank" rel="noreferrer" href="<?php echo $this->entry->link(); ?>"><?php echo _i('link'); ?></a></li><?php
  90. } ?>
  91. </ul>