diff options
| author | 2012-10-23 18:29:43 +0200 | |
|---|---|---|
| committer | 2012-10-23 18:29:43 +0200 | |
| commit | fca236dc6d6ff6e09182c560f3566904cbc7a70a (patch) | |
| tree | 850bfab52359702dad2a9eccd03f01b5c68c9bcb /app/controllers/indexController.php | |
| parent | 9a95cb844e80512205c519da69ec373e046b7f52 (diff) | |
affichage par catégories + meilleur exportation opml
Diffstat (limited to 'app/controllers/indexController.php')
| -rwxr-xr-x | app/controllers/indexController.php | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/app/controllers/indexController.php b/app/controllers/indexController.php index b9d770e81..b8908dee3 100755 --- a/app/controllers/indexController.php +++ b/app/controllers/indexController.php @@ -3,25 +3,38 @@ class indexController extends ActionController { public function indexAction () { $entryDAO = new EntryDAO (); + $catDAO = new CategoryDAO (); $mode = Session::param ('mode', $this->view->conf->defaultView ()); - if ($mode == 'not_read') { - $entries = $entryDAO->listNotReadEntries (); - } elseif ($mode == 'all') { - $entries = $entryDAO->listEntries (); + $get = Request::param ('get'); + + // Récupère les flux par catégorie, favoris ou tous + if ($get == 'favoris') { + $entries = $entryDAO->listFavorites ($mode); + } elseif ($get != false) { + $entries = $entryDAO->listByCategory ($get, $mode); } + // Cas où on ne choisie ni catégorie ni les favoris + // ou si la catégorie ne correspond à aucune + if (!isset ($entries)) { + $entries = $entryDAO->listEntries ($mode); + } + + // Tri par date if ($this->view->conf->sortOrder () == 'high_to_low') { usort ($entries, 'sortReverseEntriesByDate'); } else { usort ($entries, 'sortEntriesByDate'); } - //gestion pagination + // Gestion pagination $page = Request::param ('page', 1); $this->view->entryPaginator = new Paginator ($entries); $this->view->entryPaginator->_nbItemsPerPage ($this->view->conf->postsPerPage ()); $this->view->entryPaginator->_currentPage ($page); + + $this->view->cat_aside = $catDAO->listCategories (); } public function changeModeAction () { |
