From 0426541acbeb44d240e6dbf7a93f3a104bea61b4 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Mon, 22 Oct 2012 18:00:13 +0200 Subject: Grosse màj : ajout de la configuration + ajouts divers fonctionnalités MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/RSSConfiguration.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'app/models/RSSConfiguration.php') 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) { -- cgit v1.2.3