]> dev.renevier.net Git - syj.git/blobdiff - application/views/helpers/FooterLink.php
store lang preference in session instead of url
[syj.git] / application / views / helpers / FooterLink.php
index 46788c6a63fab9e4f48a5c7b7db5814aab25e185..0a2a4752a7ad0416ca5ece1aea1fc92ed8b99dc2 100644 (file)
@@ -4,17 +4,14 @@
 
 class Syj_View_Helper_FooterLink extends Zend_View_Helper_Abstract
 {
-    public function FooterLink($routeoptions, $text, $redirect=true, $extraclass=null) {
+    public function FooterLink($routeoptions, $text, $redirect=true, $extraclass=null, $extratext="") {
         $page = new Zend_Navigation_Page_Mvc($routeoptions);
         if ($page->isActive()) {
             $link = $this->view->escape($text);
         } else {
             $href = $page->getHRef();
             if ($redirect) {
-                $currentUri = Zend_Controller_Front::getInstance()->getRequest()->getRequestUri();
-                if (strpos($currentUri, '?') !== false) {
-                    $currentUri = strstr($currentUri, '?', true);
-                }
+                $currentUri = $this->view->UriPath(true);
                 $href = $this->view->addParamToUrl($href, 'redirect', $currentUri, true);
             }
             $link = $this->view->anchor($href, $text, array('class' => 'footer-anchor'));
@@ -23,7 +20,7 @@ class Syj_View_Helper_FooterLink extends Zend_View_Helper_Abstract
         if (isset($extraclass)) {
             $class = "$class $extraclass";
         }
-        return '<div class="' . $class . '">' . $link . '</div>' . PHP_EOL;
+        return '<div class="' . $class . '">' . $link . $extratext . '</div>' . PHP_EOL;
     }
 }