Просмотр исходного кода

Refactorisation FreshRSS_Configuration

Implémente https://github.com/marienfressinaud/FreshRSS/issues/260
(évite les comparaisons de chaînes au profit des vrais booléens et
entiers)
Grosse simplification et réduction du code relatif à la configuration.
Supprime ConfigurationDAO.
Permet de simplifier considérablement configureController.
Évite de multiples copies des mêmes données en mémoire.
Évite de garder plusieurs versions de la configuration en mémoire
(auparavant : dans un tableau au niveau de ModelArray + au niveau de
FreshRSS_Configuration + en Session + des copies temporaires comme
ConfigurationDAO).
Ne stocke plus 'conf' en Session (n'était presque pas utilisé).
Évite de recharger plusieurs fois Translate inutilement.
Contribue à https://github.com/marienfressinaud/FreshRSS/issues/303
Alexandre Alapetite 12 лет назад
Родитель
Сommit
96bdbafcea

+ 52 - 142
app/Controllers/configureController.php

@@ -52,7 +52,6 @@ class FreshRSS_configure_Controller extends Minz_ActionController {
 				}
 			}
 
-			// notif
 			$notif = array (
 				'type' => 'good',
 				'content' => Minz_Translate::t ('categories_updated')
@@ -139,94 +138,40 @@ class FreshRSS_configure_Controller extends Minz_ActionController {
 	}
 
 	public function displayAction () {
-		if (Minz_Request::isPost ()) {
-			$current_token = $this->view->conf->token ();
-
-			$language = Minz_Request::param ('language', 'en');
-			$nb = Minz_Request::param ('posts_per_page', 10);
-			$mode = Minz_Request::param ('view_mode', 'normal');
-			$view = Minz_Request::param ('default_view', 'a');
-			$auto_load_more = Minz_Request::param ('auto_load_more', 'no');
-			$display = Minz_Request::param ('display_posts', 'no');
-			$onread_jump_next = Minz_Request::param ('onread_jump_next', 'no');
-			$lazyload = Minz_Request::param ('lazyload', 'no');
-			$sort = Minz_Request::param ('sort_order', 'DESC');
-			$openArticle = Minz_Request::param ('mark_open_article', 'no');
-			$openSite = Minz_Request::param ('mark_open_site', 'no');
-			$scroll = Minz_Request::param ('mark_scroll', 'no');
-			$reception = Minz_Request::param ('mark_upon_reception', 'no');
-			$theme = Minz_Request::param ('theme', 'default');
-			$topline_read = Minz_Request::param ('topline_read', 'no');
-			$topline_favorite = Minz_Request::param ('topline_favorite', 'no');
-			$topline_date = Minz_Request::param ('topline_date', 'no');
-			$topline_link = Minz_Request::param ('topline_link', 'no');
-			$bottomline_read = Minz_Request::param ('bottomline_read', 'no');
-			$bottomline_favorite = Minz_Request::param ('bottomline_favorite', 'no');
-			$bottomline_sharing = Minz_Request::param ('bottomline_sharing', 'no');
-			$bottomline_tags = Minz_Request::param ('bottomline_tags', 'no');
-			$bottomline_date = Minz_Request::param ('bottomline_date', 'no');
-			$bottomline_link = Minz_Request::param ('bottomline_link', 'no');
-
-			$this->view->conf->_language ($language);
-			$this->view->conf->_postsPerPage ($nb);
-			$this->view->conf->_viewMode ($mode);
-			$this->view->conf->_defaultView ($view);
-			$this->view->conf->_autoLoadMore ($auto_load_more);
-			$this->view->conf->_displayPosts ($display);
-			$this->view->conf->_onread_jump_next ($onread_jump_next);
-			$this->view->conf->_lazyload ($lazyload);
-			$this->view->conf->_sortOrder ($sort);
-			$this->view->conf->_markWhen (array (
-				'article' => $openArticle,
-				'site' => $openSite,
-				'scroll' => $scroll,
-				'reception' => $reception,
+		if (Minz_Request::isPost()) {
+			$this->view->conf->_language(Minz_Request::param('language', 'en'));
+			$this->view->conf->_posts_per_page(Minz_Request::param('posts_per_page', 10));
+			$this->view->conf->_view_mode(Minz_Request::param('view_mode', 'normal'));
+			$this->view->conf->_default_view (Minz_Request::param('default_view', 'a'));
+			$this->view->conf->_auto_load_more(Minz_Request::param('auto_load_more', false));
+			$this->view->conf->_display_posts(Minz_Request::param('display_posts', false));
+			$this->view->conf->_onread_jump_next(Minz_Request::param('onread_jump_next', false));
+			$this->view->conf->_lazyload (Minz_Request::param('lazyload', false));
+			$this->view->conf->_sort_order(Minz_Request::param('sort_order', 'DESC'));
+			$this->view->conf->_mark_when (array(
+				'article' => Minz_Request::param('mark_open_article', false),
+				'site' => Minz_Request::param('mark_open_site', false),
+				'scroll' => Minz_Request::param('mark_scroll', false),
+				'reception' => Minz_Request::param('mark_upon_reception', false),
 			));
-			$this->view->conf->_theme ($theme);
-			$this->view->conf->_topline_read ($topline_read);
-			$this->view->conf->_topline_favorite ($topline_favorite);
-			$this->view->conf->_topline_date ($topline_date);
-			$this->view->conf->_topline_link ($topline_link);
-			$this->view->conf->_bottomline_read ($bottomline_read);
-			$this->view->conf->_bottomline_favorite ($bottomline_favorite);
-			$this->view->conf->_bottomline_sharing ($bottomline_sharing);
-			$this->view->conf->_bottomline_tags ($bottomline_tags);
-			$this->view->conf->_bottomline_date ($bottomline_date);
-			$this->view->conf->_bottomline_link ($bottomline_link);
-
-			$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 (),
-				'auto_load_more' => $this->view->conf->autoLoadMore (),
-				'display_posts' => $this->view->conf->displayPosts (),
-				'onread_jump_next' => $this->view->conf->onread_jump_next (),
-				'lazyload' => $this->view->conf->lazyload (),
-				'sort_order' => $this->view->conf->sortOrder (),
-				'mark_when' => $this->view->conf->markWhen (),
-				'theme' => $this->view->conf->theme (),
-				'topline_read' => $this->view->conf->toplineRead () ? 'yes' : 'no',
-				'topline_favorite' => $this->view->conf->toplineFavorite () ? 'yes' : 'no',
-				'topline_date' => $this->view->conf->toplineDate () ? 'yes' : 'no',
-				'topline_link' => $this->view->conf->toplineLink () ? 'yes' : 'no',
-				'bottomline_read' => $this->view->conf->bottomlineRead () ? 'yes' : 'no',
-				'bottomline_favorite' => $this->view->conf->bottomlineFavorite () ? 'yes' : 'no',
-				'bottomline_sharing' => $this->view->conf->bottomlineSharing () ? 'yes' : 'no',
-				'bottomline_tags' => $this->view->conf->bottomlineTags () ? 'yes' : 'no',
-				'bottomline_date' => $this->view->conf->bottomlineDate () ? 'yes' : 'no',
-				'bottomline_link' => $this->view->conf->bottomlineLink () ? 'yes' : 'no',
-			);
-
-			$confDAO = new FreshRSS_ConfigurationDAO ();
-			$confDAO->update ($values);
-			Minz_Session::_param ('conf', $this->view->conf);
-			Minz_Session::_param ('mail', $this->view->conf->mailLogin ());
-
-			Minz_Session::_param ('language', $this->view->conf->language ());
+			$this->view->conf->_theme(Minz_Request::param('theme', 'default'));
+			$this->view->conf->_topline_read(Minz_Request::param('topline_read', false));
+			$this->view->conf->_topline_favorite(Minz_Request::param('topline_favorite', false));
+			$this->view->conf->_topline_date(Minz_Request::param('topline_date', false));
+			$this->view->conf->_topline_link(Minz_Request::param('topline_link', false));
+			$this->view->conf->_bottomline_read(Minz_Request::param('bottomline_read', false));
+			$this->view->conf->_bottomline_favorite(Minz_Request::param('bottomline_favorite', false));
+			$this->view->conf->_bottomline_sharing(Minz_Request::param('bottomline_sharing', false));
+			$this->view->conf->_bottomline_tags(Minz_Request::param('bottomline_tags', false));
+			$this->view->conf->_bottomline_date(Minz_Request::param('bottomline_date', false));
+			$this->view->conf->_bottomline_link(Minz_Request::param('bottomline_link', false));
+			$this->view->conf->save();
+
+			Minz_Session::_param ('mail', $this->view->conf->mail_login);
+
+			Minz_Session::_param ('language', $this->view->conf->language);
 			Minz_Translate::reset ();
 
-			// notif
 			$notif = array (
 				'type' => 'good',
 				'content' => Minz_Translate::t ('configuration_updated')
@@ -243,22 +188,18 @@ class FreshRSS_configure_Controller extends Minz_ActionController {
 
 	public function sharingAction () {
 		if (Minz_Request::isPost ()) {
-			$this->view->conf->_sharing (array (
-				'shaarli' => Minz_Request::param ('shaarli', ''),
-				'poche' => Minz_Request::param ('poche', ''),
-				'diaspora' => Minz_Request::param ('diaspora', ''),
-				'twitter' => Minz_Request::param ('twitter', 'no') === 'yes',
-				'g+' => Minz_Request::param ('g+', 'no') === 'yes',
-				'facebook' => Minz_Request::param ('facebook', 'no') === 'yes',
-				'email' => Minz_Request::param ('email', 'no') === 'yes',
-				'print' => Minz_Request::param ('print', 'no') === 'yes'
+			$this->view->conf->_sharing (array(
+				'shaarli' => Minz_Request::param ('shaarli', false),
+				'poche' => Minz_Request::param ('poche', false),
+				'diaspora' => Minz_Request::param ('diaspora', false),
+				'twitter' => Minz_Request::param ('twitter', false),
+				'g+' => Minz_Request::param ('g+', false),
+				'facebook' => Minz_Request::param ('facebook', false),
+				'email' => Minz_Request::param ('email', false),
+				'print' => Minz_Request::param ('print', false),
 			));
+			$this->view->conf->save();
 
-			$confDAO = new FreshRSS_ConfigurationDAO ();
-			$confDAO->update ($this->view->conf->sharing ());
-			Minz_Session::_param ('conf', $this->view->conf);
-
-			// notif
 			$notif = array (
 				'type' => 'good',
 				'content' => Minz_Translate::t ('configuration_updated')
@@ -269,9 +210,6 @@ class FreshRSS_configure_Controller extends Minz_ActionController {
 		}
 
 		Minz_View::prependTitle (Minz_Translate::t ('sharing_management') . ' - ');
-
-		$entryDAO = new FreshRSS_EntryDAO ();
-		$this->view->nb_total = $entryDAO->count ();
 	}
 
 	public function importExportAction () {
@@ -347,32 +285,20 @@ class FreshRSS_configure_Controller extends Minz_ActionController {
 		                    '9', 'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9',
 		                    'f10', 'f11', 'f12');
 		$this->view->list_keys = $list_keys;
-		$list_names = array ('mark_read', 'mark_favorite', 'go_website', 'next_entry',
-		                     'prev_entry', 'next_page', 'prev_page', 'collapse_entry',
-		                     'load_more');
 
 		if (Minz_Request::isPost ()) {
 			$shortcuts = Minz_Request::param ('shortcuts');
 			$shortcuts_ok = array ();
 
 			foreach ($shortcuts as $key => $value) {
-				if (in_array ($key, $list_names)
-				 && in_array ($value, $list_keys)) {
+				if (in_array($value, $list_keys)) {
 					$shortcuts_ok[$key] = $value;
 				}
 			}
 
 			$this->view->conf->_shortcuts ($shortcuts_ok);
+			$this->view->conf->save();
 
-			$values = array (
-				'shortcuts' => $this->view->conf->shortcuts ()
-			);
-
-			$confDAO = new FreshRSS_ConfigurationDAO ();
-			$confDAO->update ($values);
-			Minz_Session::_param ('conf', $this->view->conf);
-
-			// notif
 			$notif = array (
 				'type' => 'good',
 				'content' => Minz_Translate::t ('shortcuts_updated')
@@ -388,26 +314,20 @@ class FreshRSS_configure_Controller extends Minz_ActionController {
 	public function usersAction() {
 		if (Minz_Request::isPost()) {
 			$ok = true;
-			$current_token = $this->view->conf->token();
+			$current_token = $this->view->conf->token;
 
 			$mail = Minz_Request::param('mail_login', false);
 			$token = Minz_Request::param('token', $current_token);
 
-			$this->view->conf->_mailLogin($mail);
+			$this->view->conf->_mail_login($mail);
 			$this->view->conf->_token($token);
+			$ok &= $this->view->conf->save();
 
-			$values = array(
-				'mail_login' => $this->view->conf->mailLogin(),
-				'token' => $this->view->conf->token(),
-			);
-
-			$confDAO = new FreshRSS_ConfigurationDAO();
-			$ok &= $confDAO->update($values);
-			Minz_Session::_param('conf', $this->view->conf);
-			Minz_Session::_param('mail', $this->view->conf->mailLogin());
+			Minz_Session::_param('mail', $this->view->conf->mail_login);
 
 			if (Minz_Configuration::isAdmin()) {
-				$anon = (bool)(Minz_Request::param('anon_access', false));
+				$anon = (Minz_Request::param('anon_access', false));
+				$anon = ((bool)$anon) && ($anon !== 'no');
 				if ($anon != Minz_Configuration::allowAnonymous()) {
 					Minz_Configuration::_allowAnonymous($anon);
 					$ok &= Minz_Configuration::writeFile();
@@ -432,20 +352,10 @@ class FreshRSS_configure_Controller extends Minz_ActionController {
 			$old = Minz_Request::param('old_entries', 3);
 			$keepHistoryDefault = Minz_Request::param('keep_history_default', 0);
 
-			$this->view->conf->_oldEntries($old);
-			$this->view->conf->_keepHistoryDefault($keepHistoryDefault);
-
-			$values = array(
-				'old_entries' => $this->view->conf->oldEntries(),
-				'keep_history_default' => $this->view->conf->keepHistoryDefault(),
-			);
-
-			$confDAO = new FreshRSS_ConfigurationDAO();
-			$confDAO->update($values);
-			Minz_Session::_param('conf', $this->view->conf);
-			Minz_Session::_param('mail', $this->view->conf->mailLogin ());
+			$this->view->conf->_old_entries($old);
+			$this->view->conf->_keep_history_default($keepHistoryDefault);
+			$this->view->conf->save();
 
-			// notif
 			$notif = array(
 				'type' => 'good',
 				'content' => Minz_Translate::t('configuration_updated')

+ 2 - 2
app/Controllers/entryController.php

@@ -113,7 +113,7 @@ class FreshRSS_entry_Controller extends Minz_ActionController {
 	public function purgeAction() {
 		@set_time_limit(300);
 
-		$nb_month_old = max($this->view->conf->oldEntries(), 1);
+		$nb_month_old = max($this->view->conf->old_entries, 1);
 		$date_min = time() - (3600 * 24 * 30 * $nb_month_old);
 
 		$feedDAO = new FreshRSS_FeedDAO();
@@ -125,7 +125,7 @@ class FreshRSS_entry_Controller extends Minz_ActionController {
 		foreach ($feeds as $feed) {
 			$feedHistory = $feed->keepHistory();
 			if ($feedHistory == -2) {	//default
-				$feedHistory = $this->view->conf->keepHistoryDefault();
+				$feedHistory = $this->view->conf->keep_history_default;
 			}
 			if ($feedHistory >= 0) {
 				$nb = $feedDAO->cleanOldEntries($feed->id(), $date_min, $feedHistory);

+ 7 - 8
app/Controllers/feedController.php

@@ -2,7 +2,7 @@
 
 class FreshRSS_feed_Controller extends Minz_ActionController {
 	public function firstAction () {
-		$token = $this->view->conf->token();
+		$token = $this->view->conf->token;
 		$token_param = Minz_Request::param ('token', '');
 		$token_is_ok = ($token != '' && $token == $token_param);
 		$action = Minz_Request::actionName ();
@@ -79,13 +79,13 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
 						$feed->_id ($id);
 						$feed->faviconPrepare();
 
-						$is_read = $this->view->conf->markUponReception() === 'yes' ? 1 : 0;
+						$is_read = $this->view->conf->mark_when['reception'] ? 1 : 0;
 
 						$entryDAO = new FreshRSS_EntryDAO ();
 						$entries = array_reverse($feed->entries());	//We want chronological order and SimplePie uses reverse order
 
 						// on calcule la date des articles les plus anciens qu'on accepte
-						$nb_month_old = $this->view->conf->oldEntries ();
+						$nb_month_old = $this->view->conf->old_entries;
 						$date_min = time () - (3600 * 24 * 30 * $nb_month_old);
 
 						$transactionStarted = true;
@@ -182,26 +182,25 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
 		}
 
 		// on calcule la date des articles les plus anciens qu'on accepte
-		$nb_month_old = max($this->view->conf->oldEntries(), 1);
+		$nb_month_old = max($this->view->conf->old_entries, 1);
 		$date_min = time () - (3600 * 24 * 30 * $nb_month_old);
 
 		$i = 0;
 		$flux_update = 0;
+		$is_read = $this->view->conf->mark_when['reception'] ? 1 : 0;
 		foreach ($feeds as $feed) {
 			try {
 				$url = $feed->url();
 				$feed->load(false);
 				$entries = array_reverse($feed->entries());	//We want chronological order and SimplePie uses reverse order
 
-				$is_read = $this->view->conf->markUponReception() === 'yes' ? 1 : 0;
-
 				//For this feed, check last n entry GUIDs already in database
 				$existingGuids = array_fill_keys ($entryDAO->listLastGuidsByFeed ($feed->id (), count($entries) + 10), 1);
 				$useDeclaredDate = empty($existingGuids);
 
 				$feedHistory = $feed->keepHistory();
 				if ($feedHistory == -2) {	//default
-					$feedHistory = $this->view->conf->keepHistoryDefault();
+					$feedHistory = $this->view->conf->keep_history_default;
 				}
 
 				// On ne vérifie pas strictement que l'article n'est pas déjà en BDD
@@ -309,7 +308,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
 		$this->addCategories ($categories);
 
 		// on calcule la date des articles les plus anciens qu'on accepte
-		$nb_month_old = $this->view->conf->oldEntries ();
+		$nb_month_old = $this->view->conf->old_entries;
 		$date_min = time () - (3600 * 24 * 30 * $nb_month_old);
 
 		// la variable $error permet de savoir si une erreur est survenue

+ 7 - 7
app/Controllers/indexController.php

@@ -17,7 +17,7 @@ class FreshRSS_index_Controller extends Minz_ActionController {
 	public function indexAction () {
 		$output = Minz_Request::param ('output');
 
-		$token = $this->view->conf->token();
+		$token = $this->view->conf->token;
 		$token_param = Minz_Request::param ('token', '');
 		$token_is_ok = ($token != '' && $token === $token_param);
 
@@ -91,13 +91,13 @@ class FreshRSS_index_Controller extends Minz_ActionController {
 		);
 
 		// On récupère les différents éléments de filtrage
-		$this->view->state = $state = Minz_Request::param ('state', $this->view->conf->defaultView ());
+		$this->view->state = $state = Minz_Request::param ('state', $this->view->conf->default_view);
 		$filter = Minz_Request::param ('search', '');
 		if (!empty($filter)) {
 			$state = 'all';	//Search always in read and unread articles
 		}
-		$this->view->order = $order = Minz_Request::param ('order', $this->view->conf->sortOrder ());
-		$nb = Minz_Request::param ('nb', $this->view->conf->postsPerPage ());
+		$this->view->order = $order = Minz_Request::param ('order', $this->view->conf->sort_order);
+		$nb = Minz_Request::param ('nb', $this->view->conf->posts_per_page);
 		$first = Minz_Request::param ('next', '');
 
 		if ($state === 'not_read') {	//Any unread article in this category at all?
@@ -128,9 +128,9 @@ class FreshRSS_index_Controller extends Minz_ActionController {
 		$this->view->today = $today;
 
 		// on calcule la date des articles les plus anciens qu'on affiche
-		$nb_month_old = $this->view->conf->oldEntries ();
+		$nb_month_old = $this->view->conf->old_entries;
 		$date_min = $today - (3600 * 24 * 30 * $nb_month_old);	//Do not use a fast changing value such as time() to allow SQL caching
-		$keepHistoryDefault = $this->view->conf->keepHistoryDefault();
+		$keepHistoryDefault = $this->view->conf->keep_history_default;
 
 		try {
 			$entries = $this->entryDAO->listWhere($getType, $getId, $state, $order, $nb + 1, $first, $filter, $date_min, $keepHistoryDefault);
@@ -253,7 +253,7 @@ class FreshRSS_index_Controller extends Minz_ActionController {
 		curl_close ($ch);
 
 		$res = json_decode ($result, true);
-		if ($res['status'] === 'okay' && $res['email'] === $this->view->conf->mailLogin ()) {
+		if ($res['status'] === 'okay' && $res['email'] === $this->view->conf->mail_login) {
 			Minz_Session::_param ('mail', $res['email']);
 			invalidateHttpCache();
 		} else {

+ 8 - 9
app/FreshRSS.php

@@ -2,7 +2,6 @@
 class FreshRSS extends Minz_FrontController {
 	public function init () {
 		Minz_Session::init ('FreshRSS');
-		Minz_Translate::init ();
 
 		$this->loadParamsView ();
 		$this->loadStylesAndScripts ();
@@ -11,26 +10,26 @@ class FreshRSS extends Minz_FrontController {
 
 	private function loadParamsView () {
 		try {
-			$this->conf = Minz_Session::param ('conf', new FreshRSS_Configuration ());
+			$this->conf = new FreshRSS_Configuration();
 		} catch (Minz_Exception $e) {
 			// Permission denied or conf file does not exist
 			// it's critical!
-			print $e->getMessage();
-			exit();
+			die($e->getMessage());
 		}
 
 		Minz_View::_param ('conf', $this->conf);
-		Minz_Session::_param ('language', $this->conf->language ());
+		Minz_Session::_param ('language', $this->conf->language);
+		Minz_Translate::init();
 
 		$output = Minz_Request::param ('output');
-		if(!$output) {
-			$output = $this->conf->viewMode();
+		if (!$output) {
+			$output = $this->conf->view_mode;
 			Minz_Request::_param ('output', $output);
 		}
 	}
 
 	private function loadStylesAndScripts () {
-		$theme = FreshRSS_Themes::get_infos($this->conf->theme());
+		$theme = FreshRSS_Themes::get_infos($this->conf->theme);
 		if ($theme) {
 			foreach($theme["files"] as $file) {
 				Minz_View::appendStyle (Minz_Url::display ('/themes/' . $theme['path'] . '/' . $file . '?' . @filemtime(PUBLIC_PATH . '/themes/' . $theme['path'] . '/' . $file)));
@@ -40,7 +39,7 @@ class FreshRSS extends Minz_FrontController {
 		if (login_is_conf ($this->conf)) {
 			Minz_View::appendScript ('https://login.persona.org/include.js');
 		}
-		$includeLazyLoad = $this->conf->lazyload () === 'yes' && ($this->conf->displayPosts () === 'yes' || Minz_Request::param ('output') === 'reader');
+		$includeLazyLoad = $this->conf->lazyload && ($this->conf->display_posts || Minz_Request::param ('output') === 'reader');
 		Minz_View::appendScript (Minz_Url::display ('/scripts/jquery.min.js?' . @filemtime(PUBLIC_PATH . '/scripts/jquery.min.js')), false, !$includeLazyLoad, !$includeLazyLoad);
 		if ($includeLazyLoad) {
 			Minz_View::appendScript (Minz_Url::display ('/scripts/jquery.lazyload.min.js?' . @filemtime(PUBLIC_PATH . '/scripts/jquery.lazyload.min.js')));

+ 153 - 244
app/Models/Configuration.php

@@ -1,258 +1,171 @@
 <?php
 
-class FreshRSS_Configuration extends Minz_Model {
-	private $available_languages = array (
+class FreshRSS_Configuration extends Minz_ModelArray {
+	private $data = array(
+		'language' => 'en',
+		'old_entries' => 3,
+		'keep_history_default' => 0,
+		'mail_login' => '',
+		'token' => '',
+		'posts_per_page' => 20,
+		'view_mode' => 'normal',
+		'default_view' => 'not_read',
+		'auto_load_more' => true,
+		'display_posts' => false,
+		'onread_jump_next' => true,
+		'lazyload' => true,
+		'sort_order' => 'DESC',
+		'anon_access' => false,
+		'mark_when' => array(
+			'article' => true,
+			'site' => true,
+			'scroll' => false,
+			'reception' => false,
+		),
+		'theme' => 'default',
+		'shortcuts' => array(
+			'mark_read' => 'r',
+			'mark_favorite' => 'f',
+			'go_website' => 'space',
+			'next_entry' => 'j',
+			'prev_entry' => 'k',
+			'collapse_entry' => 'c',
+			'load_more' => 'm',
+		),
+		'topline_read' => true,
+		'topline_favorite' => true,
+		'topline_date' => true,
+		'topline_link' => true,
+		'bottomline_read' => true,
+		'bottomline_favorite' => true,
+		'bottomline_sharing' => true,
+		'bottomline_tags' => true,
+		'bottomline_date' => true,
+		'bottomline_link' => true,
+		'sharing' => array(
+			'shaarli' => '',
+			'poche' => '',
+			'diaspora' => '',
+			'twitter' => true,
+			'g+' => true,
+			'facebook' => true,
+			'email' => true,
+			'print' => true,
+		),
+	);
+
+	private $available_languages = array(
 		'en' => 'English',
 		'fr' => 'Français',
 	);
-	private $language;
-	private $posts_per_page;
-	private $view_mode;
-	private $default_view;
-	private $display_posts;
-	private $onread_jump_next;
-	private $lazyload;
-	private $sort_order;
-	private $old_entries;
-	private $keep_history_default;
-	private $shortcuts = array ();
-	private $mail_login = '';
-	private $mark_when = array ();
-	private $sharing = array ();
-	private $theme;
-	private $token;
-	private $auto_load_more;
-	private $topline_read;
-	private $topline_favorite;
-	private $topline_date;
-	private $topline_link;
-	private $bottomline_read;
-	private $bottomline_favorite;
-	private $bottomline_sharing;
-	private $bottomline_tags;
-	private $bottomline_date;
-	private $bottomline_link;
 
-	public function __construct () {
-		$confDAO = new FreshRSS_ConfigurationDAO ();
-		$this->_language ($confDAO->language);
-		$this->_postsPerPage ($confDAO->posts_per_page);
-		$this->_viewMode ($confDAO->view_mode);
-		$this->_defaultView ($confDAO->default_view);
-		$this->_displayPosts ($confDAO->display_posts);
-		$this->_onread_jump_next ($confDAO->onread_jump_next);
-		$this->_lazyload ($confDAO->lazyload);
-		$this->_sortOrder ($confDAO->sort_order);
-		$this->_oldEntries ($confDAO->old_entries);
-		$this->_keepHistoryDefault($confDAO->keep_history_default);
-		$this->_shortcuts ($confDAO->shortcuts);
-		$this->_mailLogin ($confDAO->mail_login);
-		$this->_markWhen ($confDAO->mark_when);
-		$this->_sharing ($confDAO->sharing);
-		$this->_theme ($confDAO->theme);
-		FreshRSS_Themes::setThemeId ($confDAO->theme);
-		$this->_token ($confDAO->token);
-		$this->_autoLoadMore ($confDAO->auto_load_more);
-		$this->_topline_read ($confDAO->topline_read);
-		$this->_topline_favorite ($confDAO->topline_favorite);
-		$this->_topline_date ($confDAO->topline_date);
-		$this->_topline_link ($confDAO->topline_link);
-		$this->_bottomline_read ($confDAO->bottomline_read);
-		$this->_bottomline_favorite ($confDAO->bottomline_favorite);
-		$this->_bottomline_sharing ($confDAO->bottomline_sharing);
-		$this->_bottomline_tags ($confDAO->bottomline_tags);
-		$this->_bottomline_date ($confDAO->bottomline_date);
-		$this->_bottomline_link ($confDAO->bottomline_link);
-	}
+	public function __construct ($filename = '') {
+		if (empty($filename)) {
+			$filename = DATA_PATH . '/' . Minz_Configuration::currentUser () . '_user.php';
+		}
+		parent::__construct($filename);
+		$data = parent::loadArray();
 
-	public function availableLanguages () {
-		return $this->available_languages;
-	}
-	public function language () {
-		return $this->language;
-	}
-	public function postsPerPage () {
-		return $this->posts_per_page;
-	}
-	public function viewMode () {
-		return $this->view_mode;
-	}
-	public function defaultView () {
-		return $this->default_view;
-	}
-	public function displayPosts () {
-		return $this->display_posts;
-	}
-	public function onread_jump_next () {
-		return $this->onread_jump_next;
-	}
-	public function lazyload () {
-		return $this->lazyload;
-	}
-	public function sortOrder () {
-		return $this->sort_order;
-	}
-	public function oldEntries () {
-		return $this->old_entries;
-	}
-	public function keepHistoryDefault() {
-		return $this->keep_history_default;
-	}
-	public function shortcuts () {
-		return $this->shortcuts;
-	}
-	public function mailLogin () {
-		return $this->mail_login;
-	}
-	public function markWhen () {
-		return $this->mark_when;
-	}
-	public function markWhenArticle () {
-		return $this->mark_when['article'];
-	}
-	public function markWhenSite () {
-		return $this->mark_when['site'];
+		foreach ($data as $key => $value) {
+			if (isset($this->data[$key])) {
+				$function = '_' . $key;
+				$this->$function($value);
+			}
+		}
 	}
-	public function markWhenScroll () {
-		return $this->mark_when['scroll'];
+
+	public function save() {
+		invalidateHttpCache();
+		return parent::writeArray($this->data);
 	}
-	public function markUponReception () {
-		return $this->mark_when['reception'];
+
+	public function __get($name) {
+		if (array_key_exists($name, $this->data)) {
+			return $this->data[$name];
+		} else {
+			$trace = debug_backtrace();
+			trigger_error('Undefined FreshRSS_Configuration->' . $name . 'in ' . $trace[0]['file'] . ' line ' . $trace[0]['line'], E_USER_NOTICE);	//TODO: Use Minz exceptions
+			return null;
+		}
 	}
-	public function sharing ($key = false) {
+
+	public function sharing($key = false) {
 		if ($key === false) {
-			return $this->sharing;
-		} elseif (isset ($this->sharing[$key])) {
-			return $this->sharing[$key];
+			return $this->data['sharing'];
+		}
+		if (isset($this->data['sharing'][$key])) {
+			return $this->data['sharing'][$key];
 		}
 		return false;
 	}
-	public function theme () {
-		return $this->theme;
-	}
-	public function token () {
-		return $this->token;
-	}
-	public function autoLoadMore () {
-		return $this->auto_load_more;
-	}
-	public function toplineRead () {
-		return $this->topline_read;
-	}
-	public function toplineFavorite () {
-		return $this->topline_favorite;
-	}
-	public function toplineDate () {
-		return $this->topline_date;
-	}
-	public function toplineLink () {
-		return $this->topline_link;
-	}
-	public function bottomlineRead () {
-		return $this->bottomline_read;
-	}
-	public function bottomlineFavorite () {
-		return $this->bottomline_favorite;
-	}
-	public function bottomlineSharing () {
-		return $this->bottomline_sharing;
-	}
-	public function bottomlineTags () {
-		return $this->bottomline_tags;
-	}
-	public function bottomlineDate () {
-		return $this->bottomline_date;
-	}
-	public function bottomlineLink () {
-		return $this->bottomline_link;
+
+	public function availableLanguages() {
+		return $this->available_languages;
 	}
 
-	public function _language ($value) {
-		if (!isset ($this->available_languages[$value])) {
+	public function _language($value) {
+		if (!isset($this->available_languages[$value])) {
 			$value = 'en';
 		}
-		$this->language = $value;
+		$this->data['language'] = $value;
 	}
-	public function _postsPerPage ($value) {
+	public function _posts_per_page ($value) {
 		$value = intval($value);
-		$this->posts_per_page = $value > 0 ? $value : 10;
+		$this->data['posts_per_page'] = $value > 0 ? $value : 10;
 	}
-	public function _viewMode ($value) {
-		if ($value == 'global' || $value == 'reader') {
-			$this->view_mode = $value;
+	public function _view_mode ($value) {
+		if ($value === 'global' || $value === 'reader') {
+			$this->data['view_mode'] = $value;
 		} else {
-			$this->view_mode = 'normal';
+			$this->data['view_mode'] = 'normal';
 		}
 	}
-	public function _defaultView ($value) {
-		if ($value == 'not_read') {
-			$this->default_view = 'not_read';
-		} else {
-			$this->default_view = 'all';
-		}
+	public function _default_view ($value) {
+		$this->data['default_view'] = $value === 'all' ? 'all' : 'not_read';
 	}
-	public function _displayPosts ($value) {
-		if ($value == 'yes') {
-			$this->display_posts = 'yes';
-		} else {
-			$this->display_posts = 'no';
-		}
+	public function _display_posts ($value) {
+		$this->data['display_posts'] = ((bool)$value) && $value !== 'no';
 	}
 	public function _onread_jump_next ($value) {
-		if ($value == 'no') {
-			$this->onread_jump_next = 'no';
-		} else {
-			$this->onread_jump_next = 'yes';
-		}
+		$this->data['onread_jump_next'] = ((bool)$value) && $value !== 'no';
 	}
 	public function _lazyload ($value) {
-		if ($value == 'no') {
-			$this->lazyload = 'no';
-		} else {
-			$this->lazyload = 'yes';
-		}
+		$this->data['lazyload'] = ((bool)$value) && $value !== 'no';
 	}
-	public function _sortOrder ($value) {
-		$this->sort_order = $value === 'ASC' ? 'ASC' : 'DESC';
+	public function _sort_order ($value) {
+		$this->data['sort_order'] = $value === 'ASC' ? 'ASC' : 'DESC';
 	}
-	public function _oldEntries($value) {
+	public function _old_entries($value) {
 		$value = intval($value);
-		$this->old_entries = $value > 0 ? $value : 3;
+		$this->data['old_entries'] = $value > 0 ? $value : 3;
 	}
-	public function _keepHistoryDefault($value) {
+	public function _keep_history_default($value) {
 		$value = intval($value);
-		$this->keep_history_default = $value >= -1 ? $value : 0;
+		$this->data['keep_history_default'] = $value >= -1 ? $value : 0;
 	}
 	public function _shortcuts ($values) {
 		foreach ($values as $key => $value) {
-			$this->shortcuts[$key] = $value;
+			if (isset($this->data['shortcuts'][$key])) {
+				$this->data['shortcuts'][$key] = $value;
+			}
 		}
 	}
-	public function _mailLogin ($value) {
-		if (filter_var ($value, FILTER_VALIDATE_EMAIL)) {
+	public function _mail_login ($value) {
+		if (filter_var($value, FILTER_VALIDATE_EMAIL)) {
 			$this->mail_login = $value;
-		} elseif ($value == false) {
-			$this->mail_login = false;
+		} else {
+			$this->mail_login = '';
 		}
 	}
-	public function _markWhen ($values) {
-		if(!isset($values['article'])) {
-			$values['article'] = 'yes';
-		}
-		if(!isset($values['site'])) {
-			$values['site'] = 'yes';
-		}
-		if(!isset($values['scroll'])) {
-			$values['scroll'] = 'yes';
-		}
-		if(!isset($values['reception'])) {
-			$values['reception'] = 'no';
+	public function _anon_access ($value) {
+		$this->data['anon_access'] = ((bool)$value) && $value !== 'no';
+	}
+	public function _mark_when ($values) {
+		foreach ($values as $key => $value) {
+			if (isset($this->data['mark_when'][$key])) {
+				$this->data['mark_when'][$key] = ((bool)$value) && $value !== 'no';
+			}
 		}
-
-		$this->mark_when['article'] = $values['article'];
-		$this->mark_when['site'] = $values['site'];
-		$this->mark_when['scroll'] = $values['scroll'];
-		$this->mark_when['reception'] = $values['reception'];
 	}
 	public function _sharing ($values) {
 		$are_url = array ('shaarli', 'poche', 'diaspora');
@@ -268,54 +181,50 @@ class FreshRSS_Configuration extends Minz_Model {
 				if (!$is_url) {
 					$value = '';
 				}
-			} elseif(!is_bool ($value)) {
+			} elseif (!is_bool($value)) {
 				$value = true;
 			}
 
-			$this->sharing[$key] = $value;
+			$this->data['sharing'][$key] = $value;
 		}
 	}
-	public function _theme ($value) {
-		$this->theme = $value;
+	public function _theme($value) {
+		$this->data['theme'] = $value;
 	}
-	public function _token ($value) {
-		$this->token = $value;
+	public function _token($value) {
+		$this->data['token'] = $value;
 	}
-	public function _autoLoadMore ($value) {
-		if ($value == 'yes') {
-			$this->auto_load_more = 'yes';
-		} else {
-			$this->auto_load_more = 'no';
-		}
+	public function _auto_load_more($value) {
+		$this->data['auto_load_more'] = ((bool)$value) && $value !== 'no';
 	}
-	public function _topline_read ($value) {
-		$this->topline_read = $value === 'yes';
+	public function _topline_read($value) {
+		$this->data['topline_read'] = ((bool)$value) && $value !== 'no';
 	}
-	public function _topline_favorite ($value) {
-		$this->topline_favorite = $value === 'yes';
+	public function _topline_favorite($value) {
+		$this->data['topline_favorite'] = ((bool)$value) && $value !== 'no';
 	}
-	public function _topline_date ($value) {
-		$this->topline_date = $value === 'yes';
+	public function _topline_date($value) {
+		$this->data['topline_date'] = ((bool)$value) && $value !== 'no';
 	}
-	public function _topline_link ($value) {
-		$this->topline_link = $value === 'yes';
+	public function _topline_link($value) {
+		$this->data['topline_link'] = ((bool)$value) && $value !== 'no';
 	}
-	public function _bottomline_read ($value) {
-		$this->bottomline_read = $value === 'yes';
+	public function _bottomline_read($value) {
+		$this->data['bottomline_read'] = ((bool)$value) && $value !== 'no';
 	}
-	public function _bottomline_favorite ($value) {
-		$this->bottomline_favorite = $value === 'yes';
+	public function _bottomline_favorite($value) {
+		$this->data['bottomline_favorite'] = ((bool)$value) && $value !== 'no';
 	}
-	public function _bottomline_sharing ($value) {
-		$this->bottomline_sharing = $value === 'yes';
+	public function _bottomline_sharing($value) {
+		$this->data['bottomline_sharing'] = ((bool)$value) && $value !== 'no';
 	}
-	public function _bottomline_tags ($value) {
-		$this->bottomline_tags = $value === 'yes';
+	public function _bottomline_tags($value) {
+		$this->data['bottomline_tags'] = ((bool)$value) && $value !== 'no';
 	}
-	public function _bottomline_date ($value) {
-		$this->bottomline_date = $value === 'yes';
+	public function _bottomline_date($value) {
+		$this->data['bottomline_date'] = ((bool)$value) && $value !== 'no';
 	}
-	public function _bottomline_link ($value) {
-		$this->bottomline_link = $value === 'yes';
+	public function _bottomline_link($value) {
+		$this->data['bottomline_link'] = ((bool)$value) && $value !== 'no';
 	}
 }

+ 0 - 154
app/Models/ConfigurationDAO.php

@@ -1,154 +0,0 @@
-<?php
-
-class FreshRSS_ConfigurationDAO extends Minz_ModelArray {
-	public $language = 'en';
-	public $posts_per_page = 20;
-	public $view_mode = 'normal';
-	public $default_view = 'not_read';
-	public $display_posts = 'no';
-	public $onread_jump_next = 'yes';
-	public $lazyload = 'yes';
-	public $sort_order = 'DESC';
-	public $old_entries = 3;
-	public $keep_history_default = 0;
-	public $shortcuts = array (
-		'mark_read' => 'r',
-		'mark_favorite' => 'f',
-		'go_website' => 'space',
-		'next_entry' => 'j',
-		'prev_entry' => 'k',
-		'collapse_entry' => 'c',
-		'load_more' => 'm'
-	);
-	public $mail_login = '';
-	public $mark_when = array (
-		'article' => 'yes',
-		'site' => 'yes',
-		'scroll' => 'no',
-		'reception' => 'no'
-	);
-	public $sharing = array (
-		'shaarli' => '',
-		'poche' => '',
-		'diaspora' => '',
-		'twitter' => true,
-		'g+' => true,
-		'facebook' => true,
-		'email' => true,
-		'print' => true
-	);
-	public $theme = 'default';
-	public $token = '';
-	public $auto_load_more = 'yes';
-	public $topline_read = 'yes';
-	public $topline_favorite = 'yes';
-	public $topline_date = 'yes';
-	public $topline_link = 'yes';
-	public $bottomline_read = 'yes';
-	public $bottomline_favorite = 'yes';
-	public $bottomline_sharing = 'yes';
-	public $bottomline_tags = 'yes';
-	public $bottomline_date = 'yes';
-	public $bottomline_link = 'yes';
-
-	public function __construct ($nameFile = '') {
-		if (empty($nameFile)) {
-			$nameFile = DATA_PATH . '/' . Minz_Configuration::currentUser () . '_user.php';
-		}
-		parent::__construct ($nameFile);
-
-		// TODO : simplifier ce code, une boucle for() devrait suffire !
-		if (isset ($this->array['language'])) {
-			$this->language = $this->array['language'];
-		}
-		if (isset ($this->array['posts_per_page'])) {
-			$this->posts_per_page = intval($this->array['posts_per_page']);
-		}
-		if (isset ($this->array['view_mode'])) {
-			$this->view_mode = $this->array['view_mode'];
-		}
-		if (isset ($this->array['default_view'])) {
-			$this->default_view = $this->array['default_view'];
-		}
-		if (isset ($this->array['display_posts'])) {
-			$this->display_posts = $this->array['display_posts'];
-		}
-		if (isset ($this->array['onread_jump_next'])) {
-			$this->onread_jump_next = $this->array['onread_jump_next'];
-		}
-		if (isset ($this->array['lazyload'])) {
-			$this->lazyload = $this->array['lazyload'];
-		}
-		if (isset ($this->array['sort_order'])) {
-			$this->sort_order = $this->array['sort_order'];
-		}
-		if (isset ($this->array['old_entries'])) {
-			$this->old_entries = intval($this->array['old_entries']);
-		}
-		if (isset ($this->array['keep_history_default'])) {
-			$this->keep_history_default = intval($this->array['keep_history_default']);
-		}
-		if (isset ($this->array['shortcuts'])) {
-			$this->shortcuts = array_merge (
-				$this->shortcuts, $this->array['shortcuts']
-			);
-		}
-		if (isset ($this->array['mail_login'])) {
-			$this->mail_login = $this->array['mail_login'];
-		}
-		if (isset ($this->array['mark_when'])) {
-			$this->mark_when = $this->array['mark_when'];
-		}
-		if (isset ($this->array['sharing'])) {
-			$this->sharing = array_merge (
-				$this->sharing, $this->array['sharing']
-			);
-		}
-		if (isset ($this->array['theme'])) {
-			$this->theme = $this->array['theme'];
-		}
-		if (isset ($this->array['token'])) {
-			$this->token = $this->array['token'];
-		}
-		if (isset ($this->array['auto_load_more'])) {
-			$this->auto_load_more = $this->array['auto_load_more'];
-		}
-
-		if (isset ($this->array['topline_read'])) {
-			$this->topline_read = $this->array['topline_read'];
-		}
-		if (isset ($this->array['topline_favorite'])) {
-			$this->topline_favorite = $this->array['topline_favorite'];
-		}
-		if (isset ($this->array['topline_date'])) {
-			$this->topline_date = $this->array['topline_date'];
-		}
-		if (isset ($this->array['topline_link'])) {
-			$this->topline_link = $this->array['topline_link'];
-		}
-		if (isset ($this->array['bottomline_read'])) {
-			$this->bottomline_read = $this->array['bottomline_read'];
-		}
-		if (isset ($this->array['bottomline_favorite'])) {
-			$this->bottomline_favorite = $this->array['bottomline_favorite'];
-		}
-		if (isset ($this->array['bottomline_sharing'])) {
-			$this->bottomline_sharing = $this->array['bottomline_sharing'];
-		}
-		if (isset ($this->array['bottomline_tags'])) {
-			$this->bottomline_tags = $this->array['bottomline_tags'];
-		}
-		if (isset ($this->array['bottomline_date'])) {
-			$this->bottomline_date = $this->array['bottomline_date'];
-		}
-		if (isset ($this->array['bottomline_link'])) {
-			$this->bottomline_link = $this->array['bottomline_link'];
-		}
-	}
-
-	public function update($values) {
-		$this->array = array_merge($this->array, $values);
-		invalidateHttpCache();
-		return parent::writeFile();
-	}
-}

+ 1 - 1
app/i18n/en.php

@@ -159,7 +159,7 @@ return array (
 	'current_user'			=> 'Current user',
 	'default_user'			=> 'Username of the default user (maximum 16 alphanumeric characters)',
 	'persona_connection_email'	=> 'Login mail address (use <a href="https://persona.org/">Mozilla Persona</a>)',
-	'allow_anonymous'		=> 'Allow anonymous reading',
+	'allow_anonymous'		=> 'Allow anonymous reading for the default user (%s)',
 	'auth_token'			=> 'Authentication token',
 	'explain_token'			=> 'Allows to access RSS output without authentication.<br />%s?token=%s',
 	'login_configuration'		=> 'Login',

+ 1 - 1
app/i18n/fr.php

@@ -159,7 +159,7 @@ return array (
 	'current_user'			=> 'Utilisateur actuel',
 	'default_user'			=> 'Nom de l’utilisateur par défaut (16 caractères alphanumériques maximum)',
 	'persona_connection_email'	=> 'Adresse courriel de connexion (utilise <a href="https://persona.org/">Mozilla Persona</a>)',
-	'allow_anonymous'		=> 'Autoriser la lecture anonyme',
+	'allow_anonymous'		=> 'Autoriser la lecture anonyme pour l’utilisateur par défaut (%s)',
 	'auth_token'			=> 'Jeton d’identification',
 	'explain_token'			=> 'Permet d’accéder à la sortie RSS sans besoin de s’authentifier.<br />%s?output=rss&token=%s',
 	'login_configuration'		=> 'Identification',

+ 1 - 1
app/layout/layout.phtml

@@ -1,5 +1,5 @@
 <!DOCTYPE html>
-<html lang="<?php echo $this->conf->language (); ?>" xml:lang="<?php echo $this->conf->language (); ?>">
+<html lang="<?php echo $this->conf->language; ?>" xml:lang="<?php echo $this->conf->language; ?>">
 	<head>
 		<meta charset="UTF-8" />
 		<meta name="viewport" content="initial-scale=1.0" />

+ 1 - 1
app/layout/nav_menu.phtml

@@ -19,7 +19,7 @@
 			$string_mark = Minz_Translate::t ('mark_cat_read');
 		}
 		$nextGet = $get;
-		if (($this->conf->onread_jump_next () === 'yes') && (strlen ($get) > 2)) {
+		if ($this->conf->onread_jump_next && (strlen ($get) > 2)) {
 			$anotherUnreadId = '';
 			$foundCurrent = false;
 			switch ($get[0]) {

+ 4 - 4
app/views/configure/archiving.phtml

@@ -10,18 +10,18 @@
 		<div class="form-group">
 			<label class="group-name" for="old_entries"><?php echo Minz_Translate::t('delete_articles_every'); ?></label>
 			<div class="group-controls">
-				<input type="number" id="old_entries" name="old_entries" min="1" max="1200" value="<?php echo $this->conf->oldEntries(); ?>" /> <?php echo Minz_Translate::t('month'); ?>
+				<input type="number" id="old_entries" name="old_entries" min="1" max="1200" value="<?php echo $this->conf->old_entries; ?>" /> <?php echo Minz_Translate::t('month'); ?>
 				  <a class="btn confirm" href="<?php echo _url('entry', 'purge'); ?>"><?php echo Minz_Translate::t('purge_now'); ?></a>
 			</div>
 		</div>
 		<div class="form-group">
-			<label class="group-name" for="keep_history_default"><?php echo Minz_Translate::t('keep_history'), ' ', Minz_Translate::t('by_feed'); ?>(<?php echo Minz_Translate::t('by_default'); ?>)</label>
+			<label class="group-name" for="keep_history_default"><?php echo Minz_Translate::t('keep_history'), ' ', Minz_Translate::t('by_feed'); ?></label>
 			<div class="group-controls">
 				<select class="number" name="keep_history_default" id="keep_history_default"><?php
 					foreach (array(-3 => '', 0 => '0', 10 => '10', 50 => '50', 100 => '100', 500 => '500', 1000 => '1 000', 5000 => '5 000', 10000 => '10 000', -1 => '∞') as $v => $t) {
-						echo '<option value="' . $v . ($this->conf->keepHistoryDefault() == $v ? '" selected="selected' : '') . '">' . $t . ' </option>';
+						echo '<option value="' . $v . ($this->conf->keep_history_default == $v ? '" selected="selected' : '') . '">' . $t . ' </option>';
 					}
-				?></select>
+				?></select> (<?php echo Minz_Translate::t('by_default'); ?>)
 			</div>
 		</div>
 

+ 31 - 31
app/views/configure/display.phtml

@@ -12,7 +12,7 @@
 				<select name="language" id="language">
 				<?php $languages = $this->conf->availableLanguages (); ?>
 				<?php foreach ($languages as $short => $lib) { ?>
-				<option value="<?php echo $short; ?>"<?php echo $this->conf->language () == $short ? ' selected="selected"' : ''; ?>><?php echo $lib; ?></option>
+				<option value="<?php echo $short; ?>"<?php echo $this->conf->language === $short ? ' selected="selected"' : ''; ?>><?php echo $lib; ?></option>
 				<?php } ?>
 				</select>
 			</div>
@@ -23,7 +23,7 @@
 			<div class="group-controls">
 				<select name="theme" id="theme">
 				<?php foreach ($this->themes as $theme) { ?>
-				<option value="<?php echo $theme['path']; ?>"<?php echo $this->conf->theme () == $theme['path'] ? ' selected="selected"' : ''; ?>>
+				<option value="<?php echo $theme['path']; ?>"<?php echo $this->conf->theme === $theme['path'] ? ' selected="selected"' : ''; ?>>
 					<?php echo $theme['name'] . ' ' . Minz_Translate::t ('by') . ' ' . $theme['author']; ?> 
 				</option>
 				<?php } ?>
@@ -43,7 +43,7 @@
 		<div class="form-group">
 			<label class="group-name" for="posts_per_page"><?php echo Minz_Translate::t ('articles_per_page'); ?></label>
 			<div class="group-controls">
-				<input type="number" id="posts_per_page" name="posts_per_page" value="<?php echo $this->conf->postsPerPage (); ?>" />
+				<input type="number" id="posts_per_page" name="posts_per_page" value="<?php echo $this->conf->posts_per_page; ?>" />
 			</div>
 		</div>
 
@@ -51,8 +51,8 @@
 			<label class="group-name" for="sort_order"><?php echo Minz_Translate::t ('sort_order'); ?></label>
 			<div class="group-controls">
 				<select name="sort_order" id="sort_order">
-					<option value="DESC"<?php echo $this->conf->sortOrder () === 'DESC' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('newer_first'); ?></option>
-					<option value="ASC"<?php echo $this->conf->sortOrder () === 'ASC' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('older_first'); ?></option>
+					<option value="DESC"<?php echo $this->conf->sort_order === 'DESC' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('newer_first'); ?></option>
+					<option value="ASC"<?php echo $this->conf->sort_order === 'ASC' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('older_first'); ?></option>
 				</select>
 			</div>
 		</div>
@@ -61,16 +61,16 @@
 			<label class="group-name" for="view_mode"><?php echo Minz_Translate::t ('default_view'); ?></label>
 			<div class="group-controls">
 				<select name="view_mode" id="view_mode">
-					<option value="normal"<?php echo $this->conf->viewMode () == 'normal' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('normal_view'); ?></option>
-					<option value="reader"<?php echo $this->conf->viewMode () == 'reader' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('reader_view'); ?></option>
-					<option value="global"<?php echo $this->conf->viewMode () == 'global' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('global_view'); ?></option>
+					<option value="normal"<?php echo $this->conf->view_mode === 'normal' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('normal_view'); ?></option>
+					<option value="reader"<?php echo $this->conf->view_mode === 'reader' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('reader_view'); ?></option>
+					<option value="global"<?php echo $this->conf->view_mode === 'global' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('global_view'); ?></option>
 				</select>
 				<label class="radio" for="radio_all">
-					<input type="radio" name="default_view" id="radio_all" value="all"<?php echo $this->conf->defaultView () == 'all' ? ' checked="checked"' : ''; ?> />
+					<input type="radio" name="default_view" id="radio_all" value="all"<?php echo $this->conf->default_view === 'all' ? ' checked="checked"' : ''; ?> />
 					<?php echo Minz_Translate::t ('show_all_articles'); ?>
 				</label>
 				<label class="radio" for="radio_not_read">
-					<input type="radio" name="default_view" id="radio_not_read" value="not_read"<?php echo $this->conf->defaultView () == 'not_read' ? ' checked="checked"' : ''; ?> />
+					<input type="radio" name="default_view" id="radio_not_read" value="not_read"<?php echo $this->conf->default_view === 'not_read' ? ' checked="checked"' : ''; ?> />
 					<?php echo Minz_Translate::t ('show_not_reads'); ?>
 				</label>
 			</div>
@@ -79,9 +79,9 @@
 		<div class="form-group">
 			<div class="group-controls">
 				<label class="checkbox" for="auto_load_more">
-					<input type="checkbox" name="auto_load_more" id="auto_load_more" value="yes"<?php echo $this->conf->autoLoadMore () == 'yes' ? ' checked="checked"' : ''; ?> />
+					<input type="checkbox" name="auto_load_more" id="auto_load_more" value="1"<?php echo $this->conf->auto_load_more ? ' checked="checked"' : ''; ?> />
 					<?php echo Minz_Translate::t ('auto_load_more'); ?>
-					<?php echo $this->conf->displayPosts () == 'no' ? '<noscript> - <b>' . Minz_Translate::t ('javascript_should_be_activated') . '</b></noscript>' : ''; ?>
+					<noscript> - <strong><?php echo Minz_Translate::t ('javascript_should_be_activated'); ?></strong></noscript>
 				</label>
 			</div>
 		</div>
@@ -89,9 +89,9 @@
 		<div class="form-group">
 			<div class="group-controls">
 				<label class="checkbox" for="display_posts">
-					<input type="checkbox" name="display_posts" id="display_posts" value="yes"<?php echo $this->conf->displayPosts () == 'yes' ? ' checked="checked"' : ''; ?> />
+					<input type="checkbox" name="display_posts" id="display_posts" value="1"<?php echo $this->conf->display_posts ? ' checked="checked"' : ''; ?> />
 					<?php echo Minz_Translate::t ('display_articles_unfolded'); ?>
-					<?php echo $this->conf->displayPosts () == 'no' ? '<noscript> - <b>' . Minz_Translate::t ('javascript_should_be_activated') . '</b></noscript>' : ''; ?>
+					<noscript> - <strong><?php echo Minz_Translate::t ('javascript_should_be_activated'); ?></strong></noscript>
 				</label>
 			</div>
 		</div>
@@ -99,9 +99,9 @@
 		<div class="form-group">
 			<div class="group-controls">
 				<label class="checkbox" for="lazyload">
-					<input type="checkbox" name="lazyload" id="lazyload" value="yes"<?php echo $this->conf->lazyload () == 'yes' ? ' checked="checked"' : ''; ?> />
+					<input type="checkbox" name="lazyload" id="lazyload" value="1"<?php echo $this->conf->lazyload ? ' checked="checked"' : ''; ?> />
 					<?php echo Minz_Translate::t ('img_with_lazyload'); ?>
-					<?php echo $this->conf->lazyload () == 'yes' ? '<noscript> - <b>' . Minz_Translate::t ('javascript_should_be_activated') . '</b></noscript>' : ''; ?>
+					<noscript> - <strong><?php echo Minz_Translate::t ('javascript_should_be_activated'); ?></strong></noscript>
 				</label>
 			</div>
 		</div>
@@ -110,19 +110,19 @@
 			<label class="group-name"><?php echo Minz_Translate::t ('auto_read_when'); ?></label>
 			<div class="group-controls">
 				<label class="checkbox" for="check_open_article">
-					<input type="checkbox" name="mark_open_article" id="check_open_article" value="yes"<?php echo $this->conf->markWhenArticle () == 'yes' ? ' checked="checked"' : ''; ?> />
+					<input type="checkbox" name="mark_open_article" id="check_open_article" value="1"<?php echo $this->conf->mark_when['article'] ? ' checked="checked"' : ''; ?> />
 					<?php echo Minz_Translate::t ('article_selected'); ?>
 				</label>
 				<label class="checkbox" for="check_open_site">
-					<input type="checkbox" name="mark_open_site" id="check_open_site" value="yes"<?php echo $this->conf->markWhenSite () == 'yes' ? ' checked="checked"' : ''; ?> />
+					<input type="checkbox" name="mark_open_site" id="check_open_site" value="1"<?php echo $this->conf->mark_when['site'] ? ' checked="checked"' : ''; ?> />
 					<?php echo Minz_Translate::t ('article_open_on_website'); ?>
 				</label>
 				<label class="checkbox" for="check_scroll">
-					<input type="checkbox" name="mark_scroll" id="check_scroll" value="yes"<?php echo $this->conf->markWhenScroll () == 'yes' ? ' checked="checked"' : ''; ?> />
+					<input type="checkbox" name="mark_scroll" id="check_scroll" value="1"<?php echo $this->conf->mark_when['scroll'] ? ' checked="checked"' : ''; ?> />
 					<?php echo Minz_Translate::t ('scroll'); ?>
 				</label>
 				<label class="checkbox" for="check_reception">
-					<input type="checkbox" name="mark_upon_reception" id="check_reception" value="yes"<?php echo $this->conf->markUponReception () == 'yes' ? ' checked="checked"' : ''; ?> />
+					<input type="checkbox" name="mark_upon_reception" id="check_reception" value="1"<?php echo $this->conf->mark_when['reception'] ? ' checked="checked"' : ''; ?> />
 					<?php echo Minz_Translate::t ('upon_reception'); ?>
 				</label>
 			</div>
@@ -132,7 +132,7 @@
 			<label class="group-name"><?php echo Minz_Translate::t ('after_onread'); ?></label>
 			<div class="group-controls">
 				<label class="checkbox" for="onread_jump_next">
-					<input type="checkbox" name="onread_jump_next" id="onread_jump_next" value="yes"<?php echo $this->conf->onread_jump_next () == 'yes' ? ' checked="checked"' : ''; ?> />
+					<input type="checkbox" name="onread_jump_next" id="onread_jump_next" value="1"<?php echo $this->conf->onread_jump_next ? ' checked="checked"' : ''; ?> />
 					<?php echo Minz_Translate::t ('jump_next'); ?>
 				</label>
 			</div>
@@ -162,20 +162,20 @@
 				<tbody>
 					<tr>
 						<th><?php echo Minz_Translate::t ('top_line'); ?></th>
-						<td><input type="checkbox" name="topline_read" value="yes"<?php echo $this->conf->toplineRead () ? ' checked="checked"' : ''; ?> /></td>
-						<td><input type="checkbox" name="topline_favorite" value="yes"<?php echo $this->conf->toplineFavorite () ? ' checked="checked"' : ''; ?> /></td>
+						<td><input type="checkbox" name="topline_read" value="1"<?php echo $this->conf->topline_read ? ' checked="checked"' : ''; ?> /></td>
+						<td><input type="checkbox" name="topline_favorite" value="1"<?php echo $this->conf->topline_favorite ? ' checked="checked"' : ''; ?> /></td>
 						<td><input type="checkbox" disabled="disabled" /></td>
 						<td><input type="checkbox" disabled="disabled" /></td>
-						<td><input type="checkbox" name="topline_date" value="yes"<?php echo $this->conf->toplineDate () ? ' checked="checked"' : ''; ?> /></td>
-						<td><input type="checkbox" name="topline_link" value="yes"<?php echo $this->conf->toplineLink () ? ' checked="checked"' : ''; ?> /></td>
+						<td><input type="checkbox" name="topline_date" value="1"<?php echo $this->conf->topline_date ? ' checked="checked"' : ''; ?> /></td>
+						<td><input type="checkbox" name="topline_link" value="1"<?php echo $this->conf->topline_link ? ' checked="checked"' : ''; ?> /></td>
 					</tr><tr>
 						<th><?php echo Minz_Translate::t ('bottom_line'); ?></th>
-						<td><input type="checkbox" name="bottomline_read" value="yes"<?php echo $this->conf->bottomlineRead () ? ' checked="checked"' : ''; ?> /></td>
-						<td><input type="checkbox" name="bottomline_favorite" value="yes"<?php echo $this->conf->bottomlineFavorite () ? ' checked="checked"' : ''; ?> /></td>
-						<td><input type="checkbox" name="bottomline_sharing" value="yes"<?php echo $this->conf->bottomlineSharing () ? ' checked="checked"' : ''; ?> /></td>
-						<td><input type="checkbox" name="bottomline_tags" value="yes"<?php echo $this->conf->bottomlineTags () ? ' checked="checked"' : ''; ?> /></td>
-						<td><input type="checkbox" name="bottomline_date" value="yes"<?php echo $this->conf->bottomlineDate () ? ' checked="checked"' : ''; ?> /></td>
-						<td><input type="checkbox" name="bottomline_link" value="yes"<?php echo $this->conf->bottomlineLink () ? ' checked="checked"' : ''; ?> /></td>
+						<td><input type="checkbox" name="bottomline_read" value="1"<?php echo $this->conf->bottomline_read ? ' checked="checked"' : ''; ?> /></td>
+						<td><input type="checkbox" name="bottomline_favorite" value="1"<?php echo $this->conf->bottomline_favorite ? ' checked="checked"' : ''; ?> /></td>
+						<td><input type="checkbox" name="bottomline_sharing" value="1"<?php echo $this->conf->bottomline_sharing ? ' checked="checked"' : ''; ?> /></td>
+						<td><input type="checkbox" name="bottomline_tags" value="1"<?php echo $this->conf->bottomline_tags ? ' checked="checked"' : ''; ?> /></td>
+						<td><input type="checkbox" name="bottomline_date" value="1"<?php echo $this->conf->bottomline_date ? ' checked="checked"' : ''; ?> /></td>
+						<td><input type="checkbox" name="bottomline_link" value="1"<?php echo $this->conf->bottomline_link ? ' checked="checked"' : ''; ?> /></td>
 					</tr>
 				</tbody>
 			</table><br />

+ 1 - 1
app/views/configure/sharing.phtml

@@ -47,7 +47,7 @@
 					foreach ($services as $service) {
 				?>
 				<label class="checkbox" for="<?php echo $service; ?>">
-					<input type="checkbox" name="<?php echo $service; ?>" id="<?php echo $service; ?>" value="yes"<?php echo $this->conf->sharing ($service) ? ' checked="checked"' : ''; ?> />
+					<input type="checkbox" name="<?php echo $service; ?>" id="<?php echo $service; ?>" value="1"<?php echo $this->conf->sharing($service) ? ' checked="checked"' : ''; ?> />
 					<?php echo Minz_Translate::t ($service); ?>
 				</label>
 				<?php } ?>

+ 1 - 1
app/views/configure/shortcut.phtml

@@ -9,7 +9,7 @@
 		<?php } ?>
 	</datalist>
 
-	<?php $s = $this->conf->shortcuts (); ?>
+	<?php $s = $this->conf->shortcuts; ?>
 
 	<form method="post" action="<?php echo _url ('configure', 'shortcut'); ?>">
 		<legend><?php echo Minz_Translate::t ('shortcuts_management'); ?></legend>

+ 3 - 3
app/views/configure/users.phtml

@@ -20,7 +20,7 @@
 
 		<div class="form-group">
 			<label class="group-name" for="mail_login"><?php echo Minz_Translate::t('persona_connection_email'); ?></label>
-			<?php $mail = $this->conf->mailLogin(); ?>
+			<?php $mail = $this->conf->mail_login; ?>
 			<div class="group-controls">
 				<input type="email" id="mail_login" name="mail_login" value="<?php echo $mail ? $mail : ''; ?>" placeholder="<?php echo Minz_Translate::t('blank_to_disable'); ?>" />
 				<noscript><b><?php echo Minz_Translate::t('javascript_should_be_activated'); ?></b></noscript>
@@ -29,7 +29,7 @@
 
 		<div class="form-group">
 			<label class="group-name" for="token"><?php echo Minz_Translate::t('auth_token'); ?></label>
-			<?php $token = $this->conf->token(); ?>
+			<?php $token = $this->conf->token; ?>
 			<div class="group-controls">
 				<input type="text" id="token" name="token" value="<?php echo $token; ?>"  placeholder="<?php echo Minz_Translate::t('blank_to_disable'); ?>"/>
 				<?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t('explain_token', Minz_Url::display(null, 'html', true), $token); ?>
@@ -51,7 +51,7 @@
 			<div class="group-controls">
 				<label class="checkbox" for="anon_access">
 					<input type="checkbox" name="anon_access" id="anon_access" value="1"<?php echo Minz_Configuration::allowAnonymous() ? ' checked="checked"' : ''; ?> />
-					<?php echo Minz_Translate::t('allow_anonymous'); ?>
+					<?php echo Minz_Translate::t('allow_anonymous', Minz_Configuration::defaultUser()); ?>
 				</label>
 			</div>
 		</div>

+ 9 - 9
app/views/helpers/javascript_vars.phtml

@@ -1,16 +1,16 @@
 <?php
 	echo '"use strict";', "\n";
-	$mark = $this->conf->markWhen ();
+	$mark = $this->conf->mark_when;
 	echo 'var ',
-		'hide_posts=', ($this->conf->displayPosts () === 'yes' || Minz_Request::param ('output') === 'reader') ? 'false' : 'true',
-		',auto_mark_article=', $mark['article'] === 'yes' ? 'true' : 'false',
-		',auto_mark_site=', $mark['site'] === 'yes' ? 'true' : 'false',
-		',auto_mark_scroll=', $mark['scroll'] === 'yes' ? 'true' : 'false',
-		',auto_load_more=', $this->conf->autoLoadMore () === 'yes' ? 'true' : 'false',
-		',full_lazyload=', $this->conf->lazyload () === 'yes' && ($this->conf->displayPosts () === 'yes' || Minz_Request::param ('output') === 'reader') ? 'true' : 'false',
-		',does_lazyload=', $this->conf->lazyload() === 'yes' ? 'true' : 'false';
+		'hide_posts=', ($this->conf->display_posts || Minz_Request::param('output') === 'reader') ? 'false' : 'true',
+		',auto_mark_article=', $mark['article'] ? 'true' : 'false',
+		',auto_mark_site=', $mark['site'] ? 'true' : 'false',
+		',auto_mark_scroll=', $mark['scroll'] ? 'true' : 'false',
+		',auto_load_more=', $this->conf->auto_load_more ? 'true' : 'false',
+		',full_lazyload=', $this->conf->lazyload && ($this->conf->display_posts || Minz_Request::param('output') === 'reader') ? 'true' : 'false',
+		',does_lazyload=', $this->conf->lazyload ? 'true' : 'false';
 
-	$s = $this->conf->shortcuts ();
+	$s = $this->conf->shortcuts;
 	echo ',shortcuts={',
 			'mark_read:"', $s['mark_read'], '",',
 			'mark_favorite:"', $s['mark_favorite'], '",',

+ 2 - 2
app/views/helpers/view/global_view.phtml

@@ -31,6 +31,6 @@
 </div>
 
 <div id="overlay"></div>
-<div id="panel"<?php echo $this->conf->displayPosts () === 'no' ? ' class="hide_posts"' : ''; ?>>
+<div id="panel"<?php echo $this->conf->display_posts ? '' : ' class="hide_posts"'; ?>>
 	<a class="close" href="#"><?php echo FreshRSS_Themes::icon('close'); ?></a>
-</div>
+</div>

+ 12 - 12
app/views/helpers/view/normal_view.phtml

@@ -18,8 +18,8 @@ if (!empty($this->entries)) {
 	$email = $this->conf->sharing ('email');
 	$print = $this->conf->sharing ('print');
 	$today = $this->today;
-	$hidePosts = $this->conf->displayPosts() === 'no';
-	$lazyload = $this->conf->lazyload() === 'yes';
+	$hidePosts = !$this->conf->display_posts;
+	$lazyload = $this->conf->lazyload;
 ?>
 
 <div id="stream" class="normal<?php echo $hidePosts ? ' hide_posts' : ''; ?>">
@@ -49,13 +49,13 @@ if (!empty($this->entries)) {
 	<div class="flux<?php echo !$item->isRead () ? ' not_read' : ''; ?><?php echo $item->isFavorite () ? ' favorite' : ''; ?>" id="flux_<?php echo $item->id (); ?>">
 		<ul class="horizontal-list flux_header"><?php
 			if ($logged) {
-				if ($this->conf->toplineRead ()) {
+				if ($this->conf->topline_read) {
 					?><li class="item manage"><?php
 						?><a class="read" href="<?php echo _url ('entry', 'read', 'id', $item->id (), 'is_read', $item->isRead () ? 0 : 1); ?>"><?php
 							echo FreshRSS_Themes::icon($item->isRead () ? 'read' : 'unread'); ?></a><?php
 					?></li><?php
 				}
-				if ($this->conf->toplineFavorite ()) {
+				if ($this->conf->topline_favorite) {
 					 ?><li class="item manage"><?php
 						?><a class="bookmark" href="<?php echo _url ('entry', 'bookmark', 'id', $item->id (), 'is_favorite', $item->isFavorite () ? 0 : 1); ?>"><?php
 							echo FreshRSS_Themes::icon($item->isFavorite () ? 'starred' : 'non-starred'); ?></a><?php
@@ -67,8 +67,8 @@ if (!empty($this->entries)) {
 			?>
 			<li class="item website"><a href="<?php echo _url ('index', 'index', 'get', 'f_' . $feed->id ()); ?>"><img class="favicon" src="<?php echo $feed->favicon (); ?>" alt="✇" /> <span><?php echo $feed->name(); ?></span></a></li>
 			<li class="item title"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo $item->title (); ?></a></li>
-			<?php if ($this->conf->toplineDate ()) { ?><li class="item date"><?php echo $item->date (); ?> </li><?php } ?>
-			<?php if ($this->conf->toplineLink ()) { ?><li class="item link"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a></li><?php } ?>
+			<?php if ($this->conf->topline_date) { ?><li class="item date"><?php echo $item->date (); ?> </li><?php } ?>
+			<?php if ($this->conf->topline_link) { ?><li class="item link"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a></li><?php } ?>
 		</ul>
 
 		<div class="flux_content">
@@ -86,13 +86,13 @@ if (!empty($this->entries)) {
 			</div>
 			<ul class="horizontal-list bottom"><?php
 				if ($logged) {
-					if ($this->conf->bottomlineRead ()) {
+					if ($this->conf->bottomline_read) {
 						?><li class="item manage"><?php
 							?><a class="read" href="<?php echo _url ('entry', 'read', 'id', $item->id (), 'is_read', $item->isRead () ? 0 : 1); ?>"><?php
 								echo FreshRSS_Themes::icon($item->isRead () ? 'read' : 'unread'); ?></a><?php
 						?></li><?php
 					}
-					if ($this->conf->bottomlineFavorite ()) {
+					if ($this->conf->bottomline_favorite) {
 						?><li class="item manage"><?php
 							?><a class="bookmark" href="<?php echo _url ('entry', 'bookmark', 'id', $item->id (), 'is_favorite', $item->isFavorite () ? 0 : 1); ?>"><?php
 								echo FreshRSS_Themes::icon($item->isFavorite () ? 'starred' : 'non-starred'); ?></a><?php
@@ -101,7 +101,7 @@ if (!empty($this->entries)) {
 				} ?>
 				<li class="item">
 					<?php
-						if ($this->conf->bottomlineSharing () && (
+						if ($this->conf->bottomline_sharing && (
 								$shaarli || $poche || $diaspora || $twitter ||
 								$google_plus || $facebook || $email
 							)) {
@@ -171,7 +171,7 @@ if (!empty($this->entries)) {
 					<?php } ?>
 				</li>
 				<?php
-					$tags = $this->conf->bottomlineTags () ? $item->tags() : null;
+					$tags = $this->conf->bottomline_tags ? $item->tags() : null;
 					if (!empty($tags)) {
 				?>
 				<li class="item">
@@ -190,8 +190,8 @@ if (!empty($this->entries)) {
 					</div>
 				</li>
 				<?php } ?>
-				<?php if ($this->conf->bottomlineDate ()) { ?><li class="item date"><?php echo $item->date (); ?> </li><?php } ?>
-				<?php if ($this->conf->bottomlineLink ()) { ?><li class="item link"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a></li><?php } ?>
+				<?php if ($this->conf->bottomline_date) { ?><li class="item date"><?php echo $item->date (); ?> </li><?php } ?>
+				<?php if ($this->conf->bottomline_link) { ?><li class="item link"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a></li><?php } ?>
 			</ul>
 		</div>
 	</div>

+ 1 - 1
app/views/helpers/view/reader_view.phtml

@@ -2,7 +2,7 @@
 $this->partial ('nav_menu');
 
 if (!empty($this->entries)) {
-	$lazyload = $this->conf->lazyload() === 'yes';
+	$lazyload = $this->conf->lazyload;
 ?>
 
 <div id="stream" class="reader">

+ 1 - 1
app/views/index/index.phtml

@@ -1,7 +1,7 @@
 <?php
 
 $output = Minz_Request::param ('output', 'normal');
-$token = $this->conf->token();
+$token = $this->conf->token;
 $token_param = Minz_Request::param ('token', '');
 $token_is_ok = ($token != '' && $token == $token_param);
 

+ 2 - 2
lib/Minz/Configuration.php

@@ -225,14 +225,14 @@ class Minz_Configuration {
 			}
 		}
 		if (isset ($general['delay_cache'])) {
-			self::$delay_cache = $general['delay_cache'];
+			self::$delay_cache = inval($general['delay_cache']);
 		}
 		if (isset ($general['default_user'])) {
 			self::$default_user = $general['default_user'];
 			self::$current_user = self::$default_user;
 		}
 		if (isset ($general['allow_anonymous'])) {
-			self::$allow_anonymous = (bool)($general['allow_anonymous']);
+			self::$allow_anonymous = ((bool)($general['allow_anonymous'])) && ($general['allow_anonymous'] !== 'no');
 		}
 
 		// Base de données

+ 9 - 11
lib/Minz/ModelArray.php

@@ -8,11 +8,6 @@
  * La classe Model_array représente le modèle interragissant avec les fichiers de type texte gérant des tableaux php
  */
 class Minz_ModelArray {
-	/**
-	 * $array Le tableau php contenu dans le fichier $filename
-	 */
-	protected $array = array ();
-
 	/**
 	 * $filename est le nom du fichier
 	 */
@@ -25,29 +20,32 @@ class Minz_ModelArray {
 	 */
 	public function __construct ($filename) {
 		$this->filename = $filename;
+	}
 
+	protected function loadArray() {
 		if (!file_exists($this->filename)) {
 			throw new Minz_FileNotExistException($this->filename, Minz_Exception::WARNING);
 		}
 		elseif (($handle = $this->getLock()) === false) {
 			throw new Minz_PermissionDeniedException($this->filename);
 		} else {
-			$this->array = include($this->filename);
+			$data = include($this->filename);
 			$this->releaseLock($handle);
 
-			if ($this->array === false) {
+			if ($data === false) {
 				throw new Minz_PermissionDeniedException($this->filename);
-			} elseif (!is_array($this->array)) {
-				$this->array = array();
+			} elseif (!is_array($data)) {
+				$data = array();
 			}
+			return $data;
 		}
 	}
 
 	/**
 	 * Sauve le tableau $array dans le fichier $filename
 	 **/
-	protected function writeFile() {
-		if (!file_put_contents($this->filename, "<?php\n return " . var_export($this->array, true) . ';', LOCK_EX)) {
+	protected function writeArray($array) {
+		if (!file_put_contents($this->filename, "<?php\n return " . var_export($array, true) . ';', LOCK_EX)) {
 			throw new Minz_PermissionDeniedException($this->filename);
 		}
 		return true;

+ 1 - 5
lib/Minz/Session.php

@@ -55,11 +55,6 @@ class Minz_Session {
 		} else {
 			$_SESSION[$p] = $v;
 			self::$session[$p] = $v;
-
-			if($p == 'language') {
-				// reset pour remettre à jour le fichier de langue à utiliser
-				Minz_Translate::reset ();
-			}
 		}
 	}
 
@@ -76,6 +71,7 @@ class Minz_Session {
 
 		if (!$force) {
 			self::_param ('language', $language);
+			Minz_Translate::reset ();
 		}
 	}
 }

+ 1 - 1
lib/lib_rss.php

@@ -63,7 +63,7 @@ function is_logged () {
 
 // vérifie que le système d'authentification est configuré
 function login_is_conf ($conf) {
-	return $conf->mailLogin () != false;
+	return $conf->mail_login != '';
 }
 
 // tiré de Shaarli de Seb Sauvage	//Format RFC 4648 base64url