diff options
| author | 2012-10-25 17:08:17 +0200 | |
|---|---|---|
| committer | 2012-10-25 17:08:17 +0200 | |
| commit | 48a1aa7d52e712d5f64a33a003b31f23a00b99f5 (patch) | |
| tree | ab6e6de44c007836edda8f0b2ded29c8d28ca1a1 /app/models/RSSConfiguration.php | |
| parent | 32ee8feccfb28aa3141469581cd04d4813fd6835 (diff) | |
ajout de la fonctionnalité pour paramétrer les raccourcis
Diffstat (limited to 'app/models/RSSConfiguration.php')
| -rwxr-xr-x | app/models/RSSConfiguration.php | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/app/models/RSSConfiguration.php b/app/models/RSSConfiguration.php index 8ee1717b3..f3e7f9d4a 100755 --- a/app/models/RSSConfiguration.php +++ b/app/models/RSSConfiguration.php @@ -6,6 +6,7 @@ class RSSConfiguration extends Model { private $display_posts; private $sort_order; private $old_entries; + private $shortcuts = array (); public function __construct () { $confDAO = new RSSConfigurationDAO (); @@ -14,6 +15,7 @@ class RSSConfiguration extends Model { $this->_displayPosts ($confDAO->display_posts); $this->_sortOrder ($confDAO->sort_order); $this->_oldEntries ($confDAO->old_entries); + $this->_shortcuts ($confDAO->shortcuts); } public function postsPerPage () { @@ -31,6 +33,9 @@ class RSSConfiguration extends Model { public function oldEntries () { return $this->old_entries; } + public function shortcuts () { + return $this->shortcuts; + } public function _postsPerPage ($value) { if (is_int ($value)) { @@ -67,6 +72,11 @@ class RSSConfiguration extends Model { $this->old_entries = 3; } } + public function _shortcuts ($values) { + foreach ($values as $key => $value) { + $this->shortcuts[$key] = $value; + } + } } class RSSConfigurationDAO extends Model_array { @@ -75,6 +85,15 @@ class RSSConfigurationDAO extends Model_array { public $display_posts = 'no'; public $sort_order = 'low_to_high'; public $old_entries = 3; + public $shortcuts = array ( + 'mark_read' => 'r', + 'mark_favorite' => 'f', + 'go_website' => 'enter', + 'next_entry' => 'page_down', + 'prev_entry' => 'page_up', + 'next_page' => 'right', + 'prev_page' => 'left', + ); public function __construct () { parent::__construct (PUBLIC_PATH . '/data/db/Configuration.array.php'); @@ -94,11 +113,12 @@ class RSSConfigurationDAO extends Model_array { if (isset ($this->array['old_entries'])) { $this->old_entries = $this->array['old_entries']; } + if (isset ($this->array['shortcuts'])) { + $this->shortcuts = $this->array['shortcuts']; + } } - public function save ($values) { - $this->array[0] = array (); - + public function update ($values) { foreach ($values as $key => $value) { $this->array[0][$key] = $value; } |
