diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2012-10-13 03:07:34 +0200 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2012-10-13 03:07:34 +0200 |
commit | 8904f6d3f5132529d654c5b5a8b94cec7304b482 (patch) | |
tree | 08ba67467efb0283ee18cde101ec19110bf58734 /templates/part.listfeed.php | |
parent | f3d86d21def0f635a2a8583debcdde5de9ea87e1 (diff) |
preperations for always selecting last feed/folder
Diffstat (limited to 'templates/part.listfeed.php')
-rw-r--r-- | templates/part.listfeed.php | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/templates/part.listfeed.php b/templates/part.listfeed.php index 6012b574d..74ad344c8 100644 --- a/templates/part.listfeed.php +++ b/templates/part.listfeed.php @@ -2,23 +2,27 @@ $l = new OC_l10n('news'); -if(isset($_['mock'])) { - $feedTitle = ''; - $feedId = -1; - $unreadItemsCount = -1; + +$feed = isset($_['feed']) ? $_['feed'] : null; + +htmlspecialchars_decode($feedTitle = $feed->getTitle()); +$feedId = $feed->getId(); +$unreadItemsCount = isset($_['unreadItemsCount']) ? $_['unreadItemsCount'] : null; +$favicon = $feed->getFavicon(); + +if ($favicon == null) { $favicon = OCP\Util::imagePath('core', 'actions/public.svg'); +} + +$lastViewedFeedId = isset($_['lastViewedFeedId']) ? $_['lastViewedFeedId'] : null; +$lastViewedFeedType = isset($_['lastViewedFeedType']) ? $_['lastViewedFeedType'] : null; +if ($lastViewedFeedType === OCA\News\FeedType::FEED && $lastViewedFeedId === $feedId){ + $activeClass = 'active'; } else { - $feed = isset($_['feed']) ? $_['feed'] : null; - htmlspecialchars_decode($feedTitle = $feed->getTitle()); - $feedId = $feed->getId(); - $unreadItemsCount = isset($_['unreadItemsCount']) ? $_['unreadItemsCount'] : null; - $favicon = $feed->getFavicon(); - if ($favicon == null) { - $favicon = OCP\Util::imagePath('core', 'actions/public.svg'); - } + $activeClass = ''; } -echo '<li class="feed" data-id="' . $feedId . '">'; +echo '<li class="feed ' . $activeClass . '" data-id="' . $feedId . '">'; echo '<a style="background-image: url(' . $favicon . ');" href="#" class="title">' . $feedTitle .'</a>'; echo '<span class="unread_items_counter">' . $unreadItemsCount . '</span>'; echo '<span class="buttons">'; |