entry_bottom.phtml 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. <a target="_blank" href="<?php echo $share->url(); ?>"><?php echo $share->name(); ?></a>
  54. </li><?php
  55. }
  56. ?></ul>
  57. </div>
  58. <?php } ?>
  59. </li><?php
  60. $tags = $bottomline_tags ? $this->entry->tags() : null;
  61. if (!empty($tags)) {
  62. ?><li class="item">
  63. <div class="dropdown">
  64. <div id="dropdown-tags-<?php echo $this->entry->id();?>" class="dropdown-target"></div>
  65. <?php echo _i('tag'); ?>
  66. <a class="dropdown-toggle" href="#dropdown-tags-<?php echo $this->entry->id();?>"><?php
  67. echo _t('index.tag.related');
  68. ?></a>
  69. <ul class="dropdown-menu">
  70. <li class="dropdown-close"><a href="#close">❌</a></li><?php
  71. foreach($tags as $tag) {
  72. ?><li class="item"><a href="<?php echo _url('index', 'index', 'search', '#' . htmlspecialchars_decode($tag)); ?>"><?php echo $tag; ?></a></li><?php
  73. } ?>
  74. </ul>
  75. </div>
  76. </li><?php
  77. }
  78. if ($bottomline_date) {
  79. ?><li class="item date"><?php echo $this->entry->date(); ?></li><?php
  80. }
  81. if ($bottomline_link) {
  82. ?><li class="item link"><a target="_blank" href="<?php echo $this->entry->link(); ?>"><?php echo _i('link'); ?></a></li><?php
  83. } ?>
  84. </ul>