From 94a50086d8eb5d3336dff66b2f4efcc7bd3dfa71 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Wed, 21 Aug 2013 15:05:08 +0200 Subject: [PATCH] Ajout conf : token (#127), option load more (#125) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Le token permettra d'accéder aux flux RSS cachés derrière une authentification L'option load more permettra de ne pas charger automatiquement les articles suivants une fois arrivé en bas de la page --- app/models/RSSConfiguration.php | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/app/models/RSSConfiguration.php b/app/models/RSSConfiguration.php index 798ce2d0c..b3df64307 100755 --- a/app/models/RSSConfiguration.php +++ b/app/models/RSSConfiguration.php @@ -19,6 +19,8 @@ class RSSConfiguration extends Model { private $url_shaarli = ''; private $theme; private $anon_access; + private $token; + private $auto_load_more; public function __construct () { $confDAO = new RSSConfigurationDAO (); @@ -36,6 +38,8 @@ class RSSConfiguration extends Model { $this->_urlShaarli ($confDAO->url_shaarli); $this->_theme ($confDAO->theme); $this->_anonAccess ($confDAO->anon_access); + $this->_token ($confDAO->token); + $this->_autoLoadMore ($confDAO->auto_load_more); } public function availableLanguages () { @@ -92,6 +96,12 @@ class RSSConfiguration extends Model { public function anonAccess () { return $this->anon_access; } + public function token () { + return $this->token; + } + public function autoLoadMore () { + return $this->autoLoadMore; + } public function _language ($value) { if (!isset ($this->available_languages[$value])) { @@ -191,6 +201,16 @@ class RSSConfiguration extends Model { $this->anon_access = 'no'; } } + public function _token ($value) { + $this->token = $value; + } + public function _autoLoadMore ($value) { + if ($value == 'yes') { + $this->auto_load_more = 'yes'; + } else { + $this->auto_load_more = 'no'; + } + } } class RSSConfigurationDAO extends Model_array { @@ -220,10 +240,13 @@ class RSSConfigurationDAO extends Model_array { public $url_shaarli = ''; public $theme = 'default'; public $anon_access = 'no'; + public $token = ''; + public $auto_load_more = 'no'; public function __construct () { parent::__construct (PUBLIC_PATH . '/data/Configuration.array.php'); + // TODO : simplifier ce code, une boucle for() devrait suffir ! if (isset ($this->array['language'])) { $this->language = $this->array['language']; } @@ -266,6 +289,12 @@ class RSSConfigurationDAO extends Model_array { if (isset ($this->array['anon_access'])) { $this->anon_access = $this->array['anon_access']; } + 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']; + } } public function update ($values) {