diff options
| author | 2013-03-20 22:56:17 +0100 | |
|---|---|---|
| committer | 2013-03-20 22:56:17 +0100 | |
| commit | bf24aa601f96d184f9635fa72377d7521b324b4f (patch) | |
| tree | 647e17c2a22c0e861c5dbe8f4efef1ea86bf8084 /app/controllers/rssController.php | |
| parent | 80d4f5cf3d2d48fb095d0a2c7013dc3d99ae0065 (diff) | |
Ajout controller Rss pour export au format RSS (très très basique) #34 + ajout lib text pour gérer le bbcode
Diffstat (limited to 'app/controllers/rssController.php')
| -rwxr-xr-x | app/controllers/rssController.php | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/app/controllers/rssController.php b/app/controllers/rssController.php new file mode 100755 index 000000000..1f66f4517 --- /dev/null +++ b/app/controllers/rssController.php @@ -0,0 +1,35 @@ +<?php + +class rssController extends ActionController { + public function firstAction() { + header('Content-Type: text/xml'); + header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); + header('Pragma: public'); + + $this->view->_useLayout (false); + } + + public function publicAction () { + $entryDAO = new EntryDAO (); + $entryDAO->_nbItemsPerPage (-1); + + $items = $entryDAO->listPublic ('low_to_high'); + + try { + $page = Request::param('page', 1); + $nb = Request::param('nb', 15); + $this->view->itemPaginator = new Paginator($items); + $this->view->itemPaginator->_nbItemsPerPage($nb); + $this->view->itemPaginator->_currentPage($page); + } catch(CurrentPagePaginationException $e) { + Error::error( + 404, + array('error' => array('La page que vous cherchez n\'existe pas')) + ); + } + } + + public function getNbNotReadAction() { + } +} |
