]> dev.renevier.net Git - syj.git/blob - application/views/helpers/LogoutLink.php
version 0.1
[syj.git] / application / views / helpers / LogoutLink.php
1 <?php
2 /*  This file is part of Syj, Copyright (c) 2010 Arnaud Renevier,
3     and is published under the AGPL license. */
4
5 class Syj_View_Helper_LogoutLink extends Zend_View_Helper_Abstract
6 {
7     public function logoutLink() {
8         $currentUri = Zend_Controller_Front::getInstance()->getRequest()->getRequestUri();
9         if (strpos($currentUri, '?') !== false) {
10             $currentUri = strstr($currentUri, '?', true);
11         }
12         $translatedString = $this->view->translate('logout');
13         $href = $this->view->addParamToUrl('logout', 'redirect', $currentUri, true);
14         return $this->view->anchor($href, $translatedString, array('id' => 'logout', 'class' => 'login-anchor'));
15     }
16 }