Skip to content
This repository was archived by the owner on Sep 10, 2021. It is now read-only.

Commit d84a378

Browse files
author
Charles Marion
committed
ENH: 0009602: Add a new icon in the global feed
1 parent 70c07df commit d84a378

File tree

4 files changed

+22
-0
lines changed

4 files changed

+22
-0
lines changed

core/controllers/FeedController.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,17 @@ public function indexAction()
2525
$this->view->nItems = $this->Item->getCountAll();
2626
$this->view->notifications = array();
2727
$this->view->header = $this->t('Feed');
28+
29+
if($this->logged)
30+
{
31+
$request = $this->getRequest();
32+
$cookieData = $request->getCookie('newFeed'.$this->userSession->Dao->getKey());
33+
if(isset($cookieData) && is_numeric($cookieData))
34+
{
35+
$this->view->lastFeedVisit = $cookieData;
36+
}
37+
setcookie('newFeed'.$this->userSession->Dao->getKey(), strtotime("now"), time() + 60 * 60 * 24 * 300, '/'); //30 days
38+
}
2839
}
2940

3041
/** get getfolders Items' size */

core/public/css/common/common.feed.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,11 @@ div.feedDelete{
3434
right:0px;
3535
width:10px;
3636
height: 10px;
37+
}
38+
39+
img.newFeedElement{
40+
float:right;
41+
position:relative;
42+
left: -13px;
43+
top: 2px;
3744
}

core/public/images/icons/new.png

378 Bytes
Loading

core/views/element/feed.phtml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
foreach($feeds as $key => $feed)
1616
{
1717
echo "<div class='feedElement' element='{$feed->getKey()}'>";
18+
if(isset($this->lastFeedVisit) && $this->lastFeedVisit < strtotime($feed->getDate()))
19+
{
20+
echo "<img class='newFeedElement' src='{$this->coreWebroot}/public/images/icons/new.png' alt=''/>";
21+
}
1822
echo createFeedElement($this,$feed);
1923
echo "</div>";
2024
}

0 commit comments

Comments
 (0)