diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2012-08-30 23:00:17 +0200 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2012-09-01 00:31:38 +0200 |
commit | 1430a4eddb4d4f14ad63ac142637dbd597a49530 (patch) | |
tree | c57ad40cec181201a78da9acc466761ccede8f44 /templates/part.listfeed.php | |
parent | ead4172b7eb7a74af48df707efc88c8b208a5986 (diff) |
clone new items in menu from mock objects
Diffstat (limited to 'templates/part.listfeed.php')
-rw-r--r-- | templates/part.listfeed.php | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/templates/part.listfeed.php b/templates/part.listfeed.php index c8d468675..b20cc52b9 100644 --- a/templates/part.listfeed.php +++ b/templates/part.listfeed.php @@ -2,16 +2,26 @@ $l = new OC_l10n('news'); -$feed = isset($_['feed']) ? $_['feed'] : null; -$unreadItemsCount = isset($_['unreadItemsCount']) ? $_['unreadItemsCount'] : null; - -$favicon = $feed->getFavicon(); -if ($favicon == null) { +if(isset($_['mock'])){ + $feedTitle = ''; + $feedId = -1; + $unreadItemsCount = -1; $favicon = OCP\Util::imagePath('core', 'actions/public.svg'); +} else { + $feed = isset($_['feed']) ? $_['feed'] : null; + $feedTitle = htmlspecialchars_decode($feed->getTitle()); + $feedId = $feed->getId(); + $unreadItemsCount = isset($_['unreadItemsCount']) ? $_['unreadItemsCount'] : null; + $favicon = $feed->getFavicon(); + if ($favicon == null) { + $favicon = OCP\Util::imagePath('core', 'actions/public.svg'); + } } -echo '<li class="feed" data-id="' . $feed->getId() . '">'; - echo '<a style="background-image: url(' . $favicon . ');" href="#" class="title">' . htmlspecialchars_decode($feed->getTitle()) .'</a>'; +$mockClass = isset($_['mock']) ? 'mock' : ''; + +echo '<li class="feed ' . $mockClass . '" 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">'; echo '<button class="svg action feeds_delete" title="' . $l->t('Delete feed') . '"></button>'; |