notifs =& $notifs; $this->it = new PlArrayIterator($notifs->_data, 3); } public function next() { $data = $this->it->next(); if (is_null($data)) { return null; } $cid = $data['keys'][0]; $x = $data['value']; global $globals; @require_once 'Date.php'; @$date = new Date($x['date']); @$date = $date->format('%e %B %Y'); $author = $x['prenom'] . ' ' . $x['nom'] . ' (X' . $x['promo'] . ')'; return array_merge($x, array('author' => $author, 'publication' => $x['known'], 'id' => 'carnet' . $x['known'] . $cid . $x['bestalias'], 'link' => $globals->baseurl . '/profile/private/' . $x['bestalias'], 'title' => '[' . $this->notifs->_cats[$cid]['short'] . '] ' . $author . ' - le ' . $date)); } public function total() { return $this->it->total(); } public function first() { return $this->it->first(); } public function last() { return $this->it->last(); } } class CarnetFeed extends PlFeed { public function __construct() { global $globals; parent::__construct($globals->core->sitename . ' :: Carnet', $globals->baseurl . '/carnet/panel', 'Ton carnet polytechnicien', $globals->baseurl . '/images/logo.png', 'carnet/rss.tpl'); } protected function fetch($user) { return new CarnetFeedIterator(new Notifs($user, false)); } } // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: ?>