From 48a1aa7d52e712d5f64a33a003b31f23a00b99f5 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Thu, 25 Oct 2012 17:08:17 +0200 Subject: ajout de la fonctionnalité pour paramétrer les raccourcis MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/configureController.php | 37 ++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) (limited to 'app/controllers/configureController.php') diff --git a/app/controllers/configureController.php b/app/controllers/configureController.php index daabfd3bb..849066ad7 100755 --- a/app/controllers/configureController.php +++ b/app/controllers/configureController.php @@ -85,7 +85,7 @@ class configureController extends ActionController { ); $confDAO = new RSSConfigurationDAO (); - $confDAO->save ($values); + $confDAO->update ($values); Session::_param ('conf', $this->view->conf); } } @@ -120,4 +120,39 @@ class configureController extends ActionController { } } } + + public function shortcutAction () { + $list_keys = array ('a', 'b', 'backspace', 'c', 'd', 'delete', 'down', 'e', 'end', 'enter', + 'escape', 'f', 'g', 'h', 'i', 'insert', 'j', 'k', 'l', 'left', + 'm', 'n', 'o', 'p', 'page_down', 'page_up', 'q', 'r', 'return', 'right', + 's', 'space', 't', 'tab', 'u', 'up', 'v', 'w', 'x', 'y', + 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', + '9', 'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', + 'f10', 'f11', 'f12'); + $this->view->list_keys = $list_keys; + $list_names = array ('mark_read', 'mark_favorite', 'go_website', 'next_entry', + 'prev_entry', 'next_page', 'prev_page'); + + if (Request::isPost ()) { + $shortcuts = Request::param ('shortcuts'); + $shortcuts_ok = array (); + + foreach ($shortcuts as $key => $value) { + if (in_array ($key, $list_names) + && in_array ($value, $list_keys)) { + $shortcuts_ok[$key] = $value; + } + } + + $this->view->conf->_shortcuts ($shortcuts_ok); + + $values = array ( + 'shortcuts' => $this->view->conf->shortcuts () + ); + + $confDAO = new RSSConfigurationDAO (); + $confDAO->update ($values); + Session::_param ('conf', $this->view->conf); + } + } } -- cgit v1.2.3