entry_header.phtml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. $topline_read = FreshRSS_Context::$conf->topline_read;
  3. $topline_favorite = FreshRSS_Context::$conf->topline_favorite;
  4. $topline_date = FreshRSS_Context::$conf->topline_date;
  5. $topline_link = FreshRSS_Context::$conf->topline_link;
  6. ?><ul class="horizontal-list flux_header"><?php
  7. if (FreshRSS_Auth::hasAccess()) {
  8. if ($topline_read) {
  9. ?><li class="item manage"><?php
  10. $arUrl = array('c' => 'entry', 'a' => 'read', 'params' => array('id' => $this->entry->id()));
  11. if ($this->entry->isRead()) {
  12. $arUrl['params']['is_read'] = 0;
  13. }
  14. ?><a class="read" href="<?php echo Minz_Url::display($arUrl); ?>"><?php
  15. echo _i($this->entry->isRead() ? 'read' : 'unread'); ?></a><?php
  16. ?></li><?php
  17. }
  18. if ($topline_favorite) {
  19. ?><li class="item manage"><?php
  20. $arUrl = array('c' => 'entry', 'a' => 'bookmark', 'params' => array('id' => $this->entry->id()));
  21. if ($this->entry->isFavorite()) {
  22. $arUrl['params']['is_favorite'] = 0;
  23. }
  24. ?><a class="bookmark" href="<?php echo Minz_Url::display($arUrl); ?>"><?php
  25. echo _i($this->entry->isFavorite() ? 'starred' : 'non-starred'); ?></a><?php
  26. ?></li><?php
  27. }
  28. }
  29. $feed = FreshRSS_CategoryDAO::findFeed($this->categories, $this->entry->feed()); //We most likely already have the feed object in cache
  30. if ($feed == null) {
  31. $feed = $this->entry->feed(true);
  32. if ($feed == null) {
  33. $feed = FreshRSS_Feed::example();
  34. }
  35. }
  36. ?><li class="item website"><a href="<?php echo _url('index', 'index', 'get', 'f_' . $feed->id()); ?>"><img class="favicon" src="<?php echo $feed->favicon(); ?>" alt="✇" /> <span><?php echo $feed->name(); ?></span></a></li>
  37. <li class="item title"><a target="_blank" href="<?php echo $this->entry->link(); ?>"><?php echo $this->entry->title(); ?></a></li>
  38. <?php if ($topline_date) { ?><li class="item date"><?php echo $this->entry->date(); ?> </li><?php } ?>
  39. <?php if ($topline_link) { ?><li class="item link"><a target="_blank" href="<?php echo $this->entry->link(); ?>"><?php echo _i('link'); ?></a></li><?php } ?>
  40. </ul>