aboutsummaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2013-06-16 20:48:56 +0200
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2013-06-16 20:48:56 +0200
commit48cfe1571ececb9fae0c361d9147690b04d310e0 (patch)
treea14869bc4ec60bdb95dc52b0ecac4993dff570f7 /app/controllers
parent36316a6d7e81c3e73cad1362194e73a9006b0c72 (diff)
Fix issue #67 : différentes vues implémentées + possibilité de choisir la vue par défaut
Diffstat (limited to 'app/controllers')
-rwxr-xr-xapp/controllers/configureController.php3
-rwxr-xr-xapp/controllers/indexController.php8
2 files changed, 10 insertions, 1 deletions
diff --git a/app/controllers/configureController.php b/app/controllers/configureController.php
index 4cfc1c085..9ed0ad1eb 100755
--- a/app/controllers/configureController.php
+++ b/app/controllers/configureController.php
@@ -140,6 +140,7 @@ class configureController extends ActionController {
if (Request::isPost ()) {
$language = Request::param ('language', 'en');
$nb = Request::param ('posts_per_page', 10);
+ $mode = Request::param ('view_mode', 'normal');
$view = Request::param ('default_view', 'all');
$display = Request::param ('display_posts', 'no');
$lazyload = Request::param ('lazyload', 'yes');
@@ -153,6 +154,7 @@ class configureController extends ActionController {
$this->view->conf->_language ($language);
$this->view->conf->_postsPerPage (intval ($nb));
+ $this->view->conf->_viewMode ($mode);
$this->view->conf->_defaultView ($view);
$this->view->conf->_displayPosts ($display);
$this->view->conf->_lazyload ($lazyload);
@@ -169,6 +171,7 @@ class configureController extends ActionController {
$values = array (
'language' => $this->view->conf->language (),
'posts_per_page' => $this->view->conf->postsPerPage (),
+ 'view_mode' => $this->view->conf->viewMode (),
'default_view' => $this->view->conf->defaultView (),
'display_posts' => $this->view->conf->displayPosts (),
'lazyload' => $this->view->conf->lazyload (),
diff --git a/app/controllers/indexController.php b/app/controllers/indexController.php
index 3f10720c2..a5a5501e7 100755
--- a/app/controllers/indexController.php
+++ b/app/controllers/indexController.php
@@ -6,13 +6,19 @@ class indexController extends ActionController {
private $mode = 'all';
public function indexAction () {
- if (Request::param ('output') == 'rss') {
+ $output = Request::param ('output');
+
+ if ($output == 'rss') {
$this->view->_useLayout (false);
} else {
View::appendScript (Url::display ('/scripts/shortcut.js'));
View::appendScript (Url::display (array ('c' => 'javascript', 'a' => 'main')));
View::appendScript (Url::display (array ('c' => 'javascript', 'a' => 'actualize')));
View::appendScript (Url::display ('/scripts/endless_mode.js'));
+
+ if(!$output) {
+ Request::_param ('output', $this->view->conf->viewMode());
+ }
}
$entryDAO = new EntryDAO ();