aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2013-11-28 02:52:30 +0100
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2013-11-28 02:52:30 +0100
commit38b4ba034f1ef9e9861c8891964f87277725e785 (patch)
tree41f223abd8987332592218704a8bffa0985d6433 /app
parentee2c1a8c7888ef16d76a0c03ff2040aaa8a11a94 (diff)
Déplacement de config Shaarli
Page dédiée pour les options de partage Voir #175
Diffstat (limited to 'app')
-rwxr-xr-xapp/controllers/configureController.php33
-rw-r--r--app/layout/aside_configure.phtml7
-rw-r--r--app/layout/header.phtml1
-rw-r--r--app/views/configure/display.phtml8
-rw-r--r--app/views/configure/sharing.phtml22
5 files changed, 58 insertions, 13 deletions
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 ();
diff --git a/app/layout/aside_configure.phtml b/app/layout/aside_configure.phtml
index 0ca2ed099..7dbe445b2 100644
--- a/app/layout/aside_configure.phtml
+++ b/app/layout/aside_configure.phtml
@@ -2,9 +2,12 @@
<li class="nav-header"><?php echo Translate::t ('configuration'); ?></li>
<li class="item<?php echo Request::actionName () == 'display' ? ' active' : ''; ?>">
- <a href="<?php echo Url::display (array ('c' => 'configure', 'a' => 'display')); ?>"><?php echo Translate::t ('general_and_reading'); ?></a>
+ <a href="<?php echo _url ('configure', 'display'); ?>"><?php echo Translate::t ('general_and_reading'); ?></a>
+ </li>
+ <li class="item<?php echo Request::actionName () == 'sharing' ? ' active' : ''; ?>">
+ <a href="<?php echo _url ('configure', 'sharing'); ?>"><?php echo Translate::t ('sharing'); ?></a>
</li>
<li class="item<?php echo Request::actionName () == 'shortcut' ? ' active' : ''; ?>">
- <a href="<?php echo Url::display (array ('c' => 'configure', 'a' => 'shortcut')); ?>"><?php echo Translate::t ('shortcuts'); ?></a>
+ <a href="<?php echo _url ('configure', 'shortcut'); ?>"><?php echo Translate::t ('shortcuts'); ?></a>
</li>
</div>
diff --git a/app/layout/header.phtml b/app/layout/header.phtml
index b0eff4d8b..12af6057a 100644
--- a/app/layout/header.phtml
+++ b/app/layout/header.phtml
@@ -58,6 +58,7 @@
<li class="dropdown-close"><a href="#close">❌</a></li>
<li class="dropdown-header"><?php echo Translate::t ('configuration'); ?></li>
<li class="item"><a href="<?php echo _url ('configure', 'display'); ?>"><?php echo Translate::t ('general_and_reading'); ?></a></li>
+ <li class="item"><a href="<?php echo _url ('configure', 'sharing'); ?>"><?php echo Translate::t ('sharing'); ?></a></li>
<li class="item"><a href="<?php echo _url ('configure', 'shortcut'); ?>"><?php echo Translate::t ('shortcuts'); ?></a></li>
<li class="separator"></li>
<li class="item"><a href="<?php echo _url ('index', 'about'); ?>"><?php echo Translate::t ('about'); ?></a></li>
diff --git a/app/views/configure/display.phtml b/app/views/configure/display.phtml
index 846595895..52fd80185 100644
--- a/app/views/configure/display.phtml
+++ b/app/views/configure/display.phtml
@@ -192,14 +192,6 @@
</table>
</div>
- <legend><?php echo Translate::t ('sharing'); ?></legend>
- <div class="form-group">
- <label class="group-name" for="shaarli"><?php echo Translate::t ('your_shaarli'); ?></label>
- <div class="group-controls">
- <input type="url" id="shaarli" name="shaarli" value="<?php echo $this->conf->urlShaarli (); ?>" placeholder="<?php echo Translate::t ('blank_to_disable'); ?>" size="64" />
- </div>
- </div>
-
<legend><?php echo Translate::t ('advanced'); ?></legend>
<div class="form-group">
<label class="group-name"></label>
diff --git a/app/views/configure/sharing.phtml b/app/views/configure/sharing.phtml
new file mode 100644
index 000000000..e28122b00
--- /dev/null
+++ b/app/views/configure/sharing.phtml
@@ -0,0 +1,22 @@
+<?php $this->partial ('aside_configure'); ?>
+
+<div class="post">
+ <a href="<?php echo _url ('index', 'index'); ?>"><?php echo Translate::t ('back_to_rss_feeds'); ?></a>
+
+ <form method="post" action="<?php echo _url ('configure', 'sharing'); ?>">
+ <legend><?php echo Translate::t ('sharing'); ?></legend>
+ <div class="form-group">
+ <label class="group-name" for="shaarli"><?php echo Translate::t ('your_shaarli'); ?></label>
+ <div class="group-controls">
+ <input type="url" id="shaarli" name="shaarli" value="<?php echo $this->conf->urlShaarli (); ?>" placeholder="<?php echo Translate::t ('blank_to_disable'); ?>" size="64" />
+ </div>
+ </div>
+
+ <div class="form-group form-actions">
+ <div class="group-controls">
+ <button type="submit" class="btn btn-important"><?php echo Translate::t ('save'); ?></button>
+ <button type="reset" class="btn"><?php echo Translate::t ('cancel'); ?></button>
+ </div>
+ </div>
+ </form>
+</div>