aboutsummaryrefslogtreecommitdiff
path: root/app/controllers/indexController.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-11-30 22:47:48 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-11-30 22:47:48 +0100
commit1e077160fca3306a273ecae5a366fd756c32baee (patch)
tree942066b18dbf63c63f2dbddb547ed3e9bcc66d8d /app/controllers/indexController.php
parent37ce14c093c3dd009bcd7b627c5e819ac88dd5b7 (diff)
Optimisation recherche et pagination
* Optimisation recherche SQL avec utilisation de HAVING plutôt que WHERE * Simplification et amélioration des performances en supprimant de RSSPaginator qui n'aidait plus vraiment et nécessitait plus de code et des copies de données. * Correction d'un bug dans le titre de la page introduit récemment, et simplification
Diffstat (limited to 'app/controllers/indexController.php')
-rwxr-xr-xapp/controllers/indexController.php33
1 files changed, 15 insertions, 18 deletions
diff --git a/app/controllers/indexController.php b/app/controllers/indexController.php
index cf0e5024a..b3ae40847 100755
--- a/app/controllers/indexController.php
+++ b/app/controllers/indexController.php
@@ -46,8 +46,6 @@ class indexController extends ActionController {
'params' => $params
);
- $this->view->rss_title = View::title();
-
if ($output === 'rss') {
// no layout for RSS output
$this->view->_useLayout (false);
@@ -67,19 +65,6 @@ class indexController extends ActionController {
$this->view->get_c = '';
$this->view->get_f = '';
- // mise à jour des titres
- $this->view->nb_not_read = HelperCategory::CountUnreads($this->view->cat_aside, 1);
- if ($this->view->nb_not_read > 0) {
- View::appendTitle (' (' . $this->view->nb_not_read . ')');
- }
- View::prependTitle (' - ');
-
- $this->view->rss_title = $this->view->currentName . ' - ' . $this->view->rss_title;
- View::prependTitle (
- $this->view->currentName .
- ($this->nb_not_read_cat > 0 ? ' (' . $this->nb_not_read_cat . ')' : '')
- );
-
$get = Request::param ('get', 'a');
$getType = $get[0];
$getId = substr ($get, 2);
@@ -92,6 +77,18 @@ class indexController extends ActionController {
return;
}
+ $this->view->nb_not_read = HelperCategory::CountUnreads($this->view->cat_aside, 1);
+
+ // mise à jour des titres
+ if ($this->view->nb_not_read > 0) {
+ View::appendTitle (' (' . $this->view->nb_not_read . ')');
+ }
+ View::prependTitle (
+ $this->view->currentName .
+ ($this->nb_not_read_cat > 0 ? ' (' . $this->nb_not_read_cat . ')' : '') .
+ ' - '
+ );
+
// On récupère les différents éléments de filtrage
$this->view->state = $state = Request::param ('state', $this->view->conf->defaultView ());
$filter = Request::param ('search', '');
@@ -138,13 +135,13 @@ class indexController extends ActionController {
}
if (count($entries) <= $nb) {
- $next = '';
+ $this->view->nextId = '';
} else { //We have more elements for pagination
$lastEntry = array_pop($entries);
- $next = $lastEntry->id();
+ $this->view->nextId = $lastEntry->id();
}
- $this->view->entryPaginator = new RSSPaginator ($entries, $next);
+ $this->view->entries = $entries;
} catch (EntriesGetterException $e) {
Minz_Log::record ($e->getMessage (), Minz_Log::NOTICE);
Error::error (