summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2012-10-13 03:18:58 +0200
committerBernhard Posselt <nukeawhale@gmail.com>2012-10-13 03:18:58 +0200
commit523f5304be09223b3b57a9df0452123e90f627e3 (patch)
tree512e30ce86834933aa3d7e8af21006baa9f384ea /templates
parent8904f6d3f5132529d654c5b5a8b94cec7304b482 (diff)
fixed bug that wouldnt highlight last viewed feed/folder
Diffstat (limited to 'templates')
-rw-r--r--templates/main.php3
-rw-r--r--templates/part.feeds.php13
-rw-r--r--templates/part.listfeed.php3
-rw-r--r--templates/part.listfolder.php2
4 files changed, 15 insertions, 6 deletions
diff --git a/templates/main.php b/templates/main.php
index 8a618d34d..d0b0ec581 100644
--- a/templates/main.php
+++ b/templates/main.php
@@ -5,6 +5,9 @@
<?php
$l = $_['trans'];
+$lastViewedFeedId = $_['lastViewedFeedId'];
+$lastViewedFeedType = $_['lastViewedFeedType'];
+
if($_['showAll']) {
$viewButtonImg = 'eye_all.svg';
diff --git a/templates/part.feeds.php b/templates/part.feeds.php
index e766fb033..12020fa4a 100644
--- a/templates/part.feeds.php
+++ b/templates/part.feeds.php
@@ -1,13 +1,16 @@
<?php
-function print_collection_list($list) {
+function print_collection_list($list, $lastViewedFeedId, $lastViewedFeedType) {
foreach($list as $collection) {
if ($collection instanceOf OCA\News\Folder) {
$tmpl_folder = new OCP\Template("news", "part.listfolder");
$tmpl_folder->assign('folder', $collection);
+ $tmpl_folder->assign('lastViewedFeedId', $lastViewedFeedId);
+ $tmpl_folder->assign('lastViewedFeedType', $lastViewedFeedType);
$tmpl_folder->printpage();
- print_collection_list($collection->getChildren());
+ print_collection_list($collection->getChildren(), $lastViewedFeedId,
+ $lastViewedFeedType);
echo '</ul></li>';
}
elseif ($collection instanceOf OCA\News\Feed) { //onhover $(element).attr('id', 'newID');
@@ -22,6 +25,8 @@ function print_collection_list($list) {
$tmpl_feed = new OCP\Template("news", "part.listfeed");
$tmpl_feed->assign('feed', $collection);
$tmpl_feed->assign('unreadItemsCount',$counter);
+ $tmpl_feed->assign('lastViewedFeedId', $lastViewedFeedId);
+ $tmpl_feed->assign('lastViewedFeedType', $lastViewedFeedType);
$tmpl_feed->printpage();
}
else {
@@ -34,7 +39,7 @@ function print_collection_list($list) {
$allfeeds = isset($_['allfeeds']) ? $_['allfeeds'] : '';
$lastViewedFeedId = $_['lastViewedFeedId'];
$lastViewedFeedType = $_['lastViewedFeedType'];
-$starredCount = $_['starredCount']
+$starredCount = $_['starredCount'];
?>
@@ -50,4 +55,4 @@ $starredCount = $_['starredCount']
</li>
<?php
- print_collection_list($allfeeds);
+ print_collection_list($allfeeds, $lastViewedFeedId, $lastViewedFeedType);
diff --git a/templates/part.listfeed.php b/templates/part.listfeed.php
index 74ad344c8..aef4bb4b3 100644
--- a/templates/part.listfeed.php
+++ b/templates/part.listfeed.php
@@ -16,7 +16,8 @@ if ($favicon == null) {
$lastViewedFeedId = isset($_['lastViewedFeedId']) ? $_['lastViewedFeedId'] : null;
$lastViewedFeedType = isset($_['lastViewedFeedType']) ? $_['lastViewedFeedType'] : null;
-if ($lastViewedFeedType === OCA\News\FeedType::FEED && $lastViewedFeedId === $feedId){
+
+if ($lastViewedFeedType == OCA\News\FeedType::FEED && $lastViewedFeedId == $feedId){
$activeClass = 'active';
} else {
$activeClass = '';
diff --git a/templates/part.listfolder.php b/templates/part.listfolder.php
index 2eea9c7e7..7851d54af 100644
--- a/templates/part.listfolder.php
+++ b/templates/part.listfolder.php
@@ -16,7 +16,7 @@ if($folder->getOpened()){
$lastViewedFeedId = isset($_['lastViewedFeedId']) ? $_['lastViewedFeedId'] : null;
$lastViewedFeedType = isset($_['lastViewedFeedType']) ? $_['lastViewedFeedType'] : null;
-if ($lastViewedFeedType === OCA\News\FeedType::FOLDER && $lastViewedFeedId === $feedId){
+if ($lastViewedFeedType == OCA\News\FeedType::FOLDER && $lastViewedFeedId == $folderId){
$activeClass = 'active';
} else {
$activeClass = '';