diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2012-08-16 18:52:01 +0200 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2012-08-16 18:52:01 +0200 |
commit | 0241ac70ab58f00ffadfc3b4c8276f8cc8afd2ac (patch) | |
tree | c091de037c249cbdcd60e771e0395d192da4a1d1 /templates | |
parent | 5c58aa537b9f9d22c80387f8e6eefe2551ca9384 (diff) |
fixed the show only new items drop down
Diffstat (limited to 'templates')
-rw-r--r-- | templates/part.items.header.php | 7 | ||||
-rw-r--r-- | templates/part.items.php | 9 |
2 files changed, 8 insertions, 8 deletions
diff --git a/templates/part.items.header.php b/templates/part.items.header.php index c54a2ae65..8a2043288 100644 --- a/templates/part.items.header.php +++ b/templates/part.items.header.php @@ -17,8 +17,7 @@ if(isset($_['feedid'])){ $unreadItemsCount = 0; } -// FIXME: get this setting from the database -$showOnlyUnread = true; +$showAll = OCP\Config::getUserValue(OCP\USER::getUser(), 'news', 'showAll'); ?> @@ -30,8 +29,8 @@ $showOnlyUnread = true; <div class="controls"> <input type="button" value="<?php echo $l->t('Mark all read'); ?>" id="mark_all_as_read" /> <select id="feed_filter"> - <option value="unread" <?php if($showOnlyUnread){ echo 'selected="selected"'; }; ?>><?php echo $l->t('Show only unread articles'); ?></option> - <option value="all" <?php if(!$showOnlyUnread){ echo 'selected="selected"'; }; ?>><?php echo $l->t('Show read/unread articles'); ?></option> + <option value="unread" <?php if(!$showAll){ echo 'selected="selected"'; }; ?>><?php echo $l->t('Show only unread articles'); ?></option> + <option value="all" <?php if($showAll){ echo 'selected="selected"'; }; ?>><?php echo $l->t('Show read/unread articles'); ?></option> </select> </div> </div>
\ No newline at end of file diff --git a/templates/part.items.php b/templates/part.items.php index 85eb17c08..91bcdfafe 100644 --- a/templates/part.items.php +++ b/templates/part.items.php @@ -4,11 +4,12 @@ $feedId = isset($_['feedid']) ? $_['feedid'] : ''; $itemMapper = new OCA\News\ItemMapper(); -$showOnlyUnread = true; // FIXME: get this from the settings db -if($showOnlyUnread){ - $items = $itemMapper->findAllStatus($feedId, OCA\News\StatusFlag::UNREAD); -} else { +$showAll = OCP\Config::getUserValue(OCP\USER::getUser(), 'news', 'showAll'); + +if($showAll){ $items = $itemMapper->findAll($feedId); +} else { + $items = $itemMapper->findAllStatus($feedId, OCA\News\StatusFlag::UNREAD); } echo '<ul>'; |