]> dev.renevier.net Git - syj.git/blobdiff - application/views/helpers/Anchor.php
store lang preference in session instead of url
[syj.git] / application / views / helpers / Anchor.php
index ddfe74479cf29f266c20b876ec2c53ee8e1cc404..6cc59bf0d4a391db43f8ff6dedee214d1b178f44 100644 (file)
@@ -4,21 +4,13 @@
 
 class Syj_View_Helper_Anchor extends Zend_View_Helper_HtmlElement
 {
-    public function Anchor($href, $text = null, array $attribs=array()) {
-        $lang = Zend_Controller_Front::getInstance()->getRequest()->getQuery('lang');
-        if ($lang) {
-            $translator = Zend_Registry::get('Zend_Translate');
-            $adapter = $translator->getAdapter();
-            if ($adapter->isAvailable($lang)) {
-                $href = $this->view->addParamToUrl($href, 'lang', $lang);
-            }
-        }
-
+    public function Anchor($href, $text = null, array $attribs=array(), $escape = true) {
         $attribs = array_merge(array('href' => $href), $attribs);
         if (!isset($text)) {
             $text = $href;
         }
-        $html = '<a' . $this->_htmlAttribs($attribs) . '>' . $this->view->escape($text) . '</a>';
+        $content = $escape ? $this->view->escape($text) : $text;
+        $html = '<a' . $this->_htmlAttribs($attribs) . '>' . $content . '</a>';
         return $html;
     }
 }