From 38b4ba034f1ef9e9861c8891964f87277725e785 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Thu, 28 Nov 2013 02:52:30 +0100 Subject: Déplacement de config Shaarli MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Page dédiée pour les options de partage Voir #175 --- app/controllers/configureController.php | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) (limited to 'app/controllers/configureController.php') diff --git a/app/controllers/configureController.php b/app/controllers/configureController.php index c0a630257..b50b243cf 100755 --- a/app/controllers/configureController.php +++ b/app/controllers/configureController.php @@ -171,7 +171,6 @@ class configureController extends ActionController { $openArticle = Request::param ('mark_open_article', 'no'); $openSite = Request::param ('mark_open_site', 'no'); $scroll = Request::param ('mark_scroll', 'no'); - $urlShaarli = Request::param ('shaarli', ''); $theme = Request::param ('theme', 'default'); $topline_read = Request::param ('topline_read', 'no'); $topline_favorite = Request::param ('topline_favorite', 'no'); @@ -202,7 +201,6 @@ class configureController extends ActionController { 'site' => $openSite, 'scroll' => $scroll, )); - $this->view->conf->_urlShaarli ($urlShaarli); $this->view->conf->_theme ($theme); $this->view->conf->_topline_read ($topline_read); $this->view->conf->_topline_favorite ($topline_favorite); @@ -230,7 +228,6 @@ class configureController extends ActionController { 'anon_access' => $this->view->conf->anonAccess (), 'token' => $this->view->conf->token (), 'mark_when' => $this->view->conf->markWhen (), - 'url_shaarli' => $this->view->conf->urlShaarli (), 'theme' => $this->view->conf->theme (), 'topline_read' => $this->view->conf->toplineRead () ? 'yes' : 'no', 'topline_favorite' => $this->view->conf->toplineFavorite () ? 'yes' : 'no', @@ -270,6 +267,36 @@ class configureController extends ActionController { $this->view->nb_total = $entryDAO->count (); } + public function sharingAction () { + if (Request::isPost ()) { + $urlShaarli = Request::param ('shaarli', ''); + + $this->view->conf->_urlShaarli ($urlShaarli); + + $values = array ( + 'url_shaarli' => $this->view->conf->urlShaarli () + ); + + $confDAO = new RSSConfigurationDAO (); + $confDAO->update ($values); + Session::_param ('conf', $this->view->conf); + + // notif + $notif = array ( + 'type' => 'good', + 'content' => Translate::t ('configuration_updated') + ); + Session::_param ('notification', $notif); + + Request::forward (array ('c' => 'configure', 'a' => 'sharing'), true); + } + + View::prependTitle (Translate::t ('sharing_management') . ' - '); + + $entryDAO = new EntryDAO (); + $this->view->nb_total = $entryDAO->count (); + } + public function importExportAction () { $catDAO = new CategoryDAO (); $this->view->categories = $catDAO->listCategories (); -- cgit v1.2.3