Mercurial > defr > DualBlog
comparison includes/class.skeleton.php @ 36:a6c3716cab6a
Ajout de la date de dernière mise à jour de la feed.
author | Franck Deroche <webmaster@defr.org> |
---|---|
date | Mon, 05 Nov 2007 10:41:27 +0100 |
parents | e776701841ba |
children | 33d1c5a13acd |
comparison
equal
deleted
inserted
replaced
35:e776701841ba | 36:a6c3716cab6a |
---|---|
1 <?php | 1 <?php |
2 class Skeleton extends Template { | 2 class Skeleton extends Template { |
3 | 3 |
4 private $styleSheets; | 4 private $styleSheets; |
5 private $blogPosts; | 5 private $blogPosts; |
6 private $lastUpdate = 0; | |
6 private $showCalendar = false; | 7 private $showCalendar = false; |
7 private $calendarMonth; | 8 private $calendarMonth; |
8 private $calendarYear; | 9 private $calendarYear; |
9 private $useXML; | 10 private $useXML; |
10 | 11 |
169 | 170 |
170 public function addBlogPost(Template $blogPost) { | 171 public function addBlogPost(Template $blogPost) { |
171 $this->blogPosts[] = $blogPost; | 172 $this->blogPosts[] = $blogPost; |
172 } | 173 } |
173 | 174 |
175 public function checkUpdateTime($time) { | |
176 if($time > $this->lastUpdate) | |
177 $this->lastUpdate = $time; | |
178 } | |
179 | |
174 public function showCalendar($newValue = false) { | 180 public function showCalendar($newValue = false) { |
175 $this->showCalendar = $newValue; | 181 $this->showCalendar = $newValue; |
176 } | 182 } |
177 | 183 |
178 public function setCalendarMonth($month, $year) { | 184 public function setCalendarMonth($month, $year) { |
208 $params['#Posts'] = array(); | 214 $params['#Posts'] = array(); |
209 foreach($this->blogPosts as $blogPost) { | 215 foreach($this->blogPosts as $blogPost) { |
210 $params['#Posts'][] = array('post' => $blogPost); | 216 $params['#Posts'][] = array('post' => $blogPost); |
211 } | 217 } |
212 | 218 |
219 // Date de dernière modification | |
220 $params['modifiedDate'] = date('c', $this->lastUpdate); | |
221 | |
213 // Application des l'ensemble de ces paramètres | 222 // Application des l'ensemble de ces paramètres |
214 $this->setParams($params); | 223 $this->setParams($params); |
215 } | 224 } |
216 | 225 |
217 public function __toString() { | 226 public function __toString() { |