diff options
| author | 2013-04-13 13:02:21 +0200 | |
|---|---|---|
| committer | 2013-04-13 13:02:21 +0200 | |
| commit | c2bf3ead8ae15288eb99c82643fb0cbd595e1454 (patch) | |
| tree | 2a4da7c310f3506aa478eade79d8a807d809f2bd /app/controllers | |
| parent | 1cc118acdc52895ca500c93b36bbb5cf3a149bc7 (diff) | |
Export des flux au format RSS pleinement supporté (voir issue #34) - possibilité de les filtrer comme pour la vue principale
Diffstat (limited to 'app/controllers')
| -rwxr-xr-x | app/controllers/indexController.php | 14 | ||||
| -rwxr-xr-x | app/controllers/rssController.php | 35 |
2 files changed, 14 insertions, 35 deletions
diff --git a/app/controllers/indexController.php b/app/controllers/indexController.php index 1eba7231f..a11c26044 100755 --- a/app/controllers/indexController.php +++ b/app/controllers/indexController.php @@ -38,6 +38,9 @@ class indexController extends ActionController { } elseif ($this->get['type'] == 'favoris') { $entries = $entryDAO->listFavorites ($this->mode, $search, $order); View::prependTitle ('Vos favoris - '); + } elseif ($this->get['type'] == 'public') { + $entries = $entryDAO->listPublic ($this->mode, $search, $order); + View::prependTitle ('Public - '); } elseif ($this->get != false) { if ($this->get['type'] == 'c') { $cat = $catDAO->searchById ($this->get['filter']); @@ -81,6 +84,10 @@ class indexController extends ActionController { $this->view->cat_aside = $catDAO->listCategories (); $this->view->nb_favorites = $entryDAO->countFavorites (); $this->view->nb_total = $entryDAO->count (); + + if (Request::param ('output', '') == 'rss') { + $this->view->_useLayout (false); + } } } @@ -161,6 +168,13 @@ class indexController extends ActionController { 'type' => $get, 'filter' => $get ); + } elseif ($get == 'public') { + $this->view->get_c = $get; + + $this->get = array ( + 'type' => $get, + 'filter' => $get + ); } elseif ($get == false) { $this->get = array ( 'type' => 'all', diff --git a/app/controllers/rssController.php b/app/controllers/rssController.php deleted file mode 100755 index 1f66f4517..000000000 --- a/app/controllers/rssController.php +++ /dev/null @@ -1,35 +0,0 @@ -<?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() { - } -} |
