diff options
| author | 2013-08-21 15:05:08 +0200 | |
|---|---|---|
| committer | 2013-08-21 15:05:08 +0200 | |
| commit | 94a50086d8eb5d3336dff66b2f4efcc7bd3dfa71 (patch) | |
| tree | be1e366b1f3ead5f0c94a22f9425f9b5528f6270 | |
| parent | aa94bdaeff370ca88fef9fa3d3414ab0e61da0a8 (diff) | |
Ajout conf : token (#127), option load more (#125)
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
| -rwxr-xr-x | app/models/RSSConfiguration.php | 29 |
1 files changed, 29 insertions, 0 deletions
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) { |
