A free, self-hostable aggregator…
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1021 B

12 years ago
<?php
class indexController extends ActionController {
public function indexAction () {
$entryDAO = new EntryDAO ();
$mode = Session::param ('mode', $this->view->conf->defaultView ());
if ($mode == 'not_read') {
$entries = $entryDAO->listNotReadEntries ();
} elseif ($mode == 'all') {
$entries = $entryDAO->listEntries ();
}
if ($this->view->conf->sortOrder () == 'high_to_low') {
usort ($entries, 'sortReverseEntriesByDate');
} else {
usort ($entries, 'sortEntriesByDate');
}
12 years ago
//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);
}
public function changeModeAction () {
$mode = Request::param ('mode');
if ($mode == 'not_read') {
Session::_param ('mode', 'not_read');
} else {
Session::_param ('mode', 'all');
}
Request::forward (array (), true);
}
}