diff options
| author | 2012-10-22 18:00:13 +0200 | |
|---|---|---|
| committer | 2012-10-22 18:00:13 +0200 | |
| commit | 0426541acbeb44d240e6dbf7a93f3a104bea61b4 (patch) | |
| tree | 209a425c5afee9e627d11023b262326812be1fbc /app/models/RSSConfiguration.php | |
| parent | fb57be5a5af3a2fb46b2dbf2b503ffe78eb5cf49 (diff) | |
Grosse màj : ajout de la configuration + ajouts divers fonctionnalités
Diffstat (limited to 'app/models/RSSConfiguration.php')
| -rwxr-xr-x | app/models/RSSConfiguration.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/app/models/RSSConfiguration.php b/app/models/RSSConfiguration.php index f42f1283c..da5028da3 100755 --- a/app/models/RSSConfiguration.php +++ b/app/models/RSSConfiguration.php @@ -4,12 +4,14 @@ class RSSConfiguration extends Model { private $posts_per_page; private $default_view; private $display_posts; + private $sort_order; public function __construct () { $confDAO = new RSSConfigurationDAO (); $this->_postsPerPage ($confDAO->posts_per_page); $this->_defaultView ($confDAO->default_view); $this->_displayPosts ($confDAO->display_posts); + $this->_sortOrder ($confDAO->sort_order); } public function postsPerPage () { @@ -21,6 +23,9 @@ class RSSConfiguration extends Model { public function displayPosts () { return $this->display_posts; } + public function sortOrder () { + return $this->sort_order; + } public function _postsPerPage ($value) { if (is_int ($value)) { @@ -43,12 +48,20 @@ class RSSConfiguration extends Model { $this->display_posts = 'no'; } } + public function _sortOrder ($value) { + if ($value == 'high_to_low') { + $this->sort_order = 'high_to_low'; + } else { + $this->sort_order = 'low_to_high'; + } + } } class RSSConfigurationDAO extends Model_array { public $posts_per_page = 10; public $default_view = 'all'; public $display_posts = 'no'; + public $sort_order = 'low_to_high'; public function __construct () { parent::__construct (PUBLIC_PATH . '/data/db/Configuration.array.php'); @@ -62,6 +75,9 @@ class RSSConfigurationDAO extends Model_array { if (isset ($this->array['display_posts'])) { $this->display_posts = $this->array['display_posts']; } + if (isset ($this->array['sort_order'])) { + $this->sort_order = $this->array['sort_order']; + } } public function save ($values) { |
