summaryrefslogtreecommitdiffstats
path: root/templates/part.listfeed.php
diff options
context:
space:
mode:
authorGregor Tätzner <gregor@freenet.de>2012-08-03 14:59:43 +0200
committerGregor Tätzner <gregor@freenet.de>2012-08-03 14:59:43 +0200
commitdf3cf447b79d81569dbf7485d6d5844120c369b2 (patch)
tree0038ca23255967a37161c96df3061fb9d82f6965 /templates/part.listfeed.php
parent96088f65675d3306bebd0d2a271866dbe18ea926 (diff)
Move unreaditemcounter code into listfeed
Diffstat (limited to 'templates/part.listfeed.php')
-rw-r--r--templates/part.listfeed.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/templates/part.listfeed.php b/templates/part.listfeed.php
index b2ee7c0d2..cd280c111 100644
--- a/templates/part.listfeed.php
+++ b/templates/part.listfeed.php
@@ -1,18 +1,21 @@
<?php
-// FIXME: somehow gets included twice
-include_once("part.itemcounter.php");
-
$l = new OC_l10n('news');
$child = isset($_['child']) ? $_['child'] : null;
+$unreadItems = isset($_['unreadItems']) ? $_['unreadItems'] : null;
$favicon = $child->getFavicon();
if ($favicon == null) {
$favicon = OCP\Util::imagePath('news', 'rss.svg');
}
echo '<li class="feeds_list" data-id="' . $child->getId() . '"><a href="' . OCP\Util::linkTo('news', 'index.php'). '?feedid=' . $child->getId() . '" style="background: url(' . $favicon . ') left center no-repeat; background-size:16px 16px;">' . $child->getTitle() .'</a>';
-countUnreadItems($child->getId());
+if ($unreadItems > 0) {
+ echo '<span id="unreaditemcounter" class="nonzero">' . $unreadItems . '</span>';
+}
+else {
+ echo '<span id="unreaditemcounter" class="zero"></span>';
+}
echo '<button class="svg action" id="feeds_delete" onClick="(News.Feed.delete(' . $child->getId(). '))" title="' . $l->t('Delete feed') . '"></button>';
echo '<button class="svg action" id="feeds_edit" title="' . $l->t('Edit feed') . '"></button>';
echo '</li>';