From 2d330e43f23ba8d600e9fd20b8f5799fb4afb8ab Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Fri, 8 Nov 2013 22:38:38 +0100 Subject: Fix issue #236: balise link pour flux rss Ajout d'une balise link pour indiquer l'url du flux RSS --- app/controllers/indexController.php | 19 +++++++++++++++++++ app/layout/layout.phtml | 3 +++ app/layout/nav_menu.phtml | 22 +--------------------- 3 files changed, 23 insertions(+), 21 deletions(-) (limited to 'app') diff --git a/app/controllers/indexController.php b/app/controllers/indexController.php index 17feaf94b..c818f1170 100755 --- a/app/controllers/indexController.php +++ b/app/controllers/indexController.php @@ -12,6 +12,7 @@ class indexController extends ActionController { $token_param = Request::param ('token', ''); $token_is_ok = ($token != '' && $token == $token_param); + // check if user is log in if(login_is_conf ($this->view->conf) && !is_logged() && $this->view->conf->anonAccess() == 'no' && @@ -19,7 +20,25 @@ class indexController extends ActionController { return; } + // construction of RSS url of this feed + $params = Request::params (); + $params['output'] = 'rss'; + if (isset ($params['search'])) { + $params['search'] = urlencode ($params['search']); + } + if (login_is_conf($this->view->conf) && + $this->view->conf->anonAccess() == 'no' && + $token != '') { + $params['token'] = $token; + } + $this->view->rss_url = array ( + 'c' => 'index', + 'a' => 'index', + 'params' => $params + ); + if ($output == 'rss') { + // no layout for RSS output $this->view->_useLayout (false); } else { if(!$output) { diff --git a/app/layout/layout.phtml b/app/layout/layout.phtml index f958acb46..192a6d73f 100644 --- a/app/layout/layout.phtml +++ b/app/layout/layout.phtml @@ -5,6 +5,9 @@ + rss_url)) { ?> + + diff --git a/app/layout/nav_menu.phtml b/app/layout/nav_menu.phtml index 93287b84c..de327f040 100644 --- a/app/layout/nav_menu.phtml +++ b/app/layout/nav_menu.phtml @@ -122,27 +122,7 @@
  • - conf->token (); - if (login_is_conf($this->conf) && - $this->conf->anonAccess() == 'no' && - $token != '') { - $params['token'] = $token; - } - - $url = array ( - 'c' => 'index', - 'a' => 'index', - 'params' => $params - ); - ?> - +
  • -- cgit v1.2.3