]> dev.renevier.net Git - syj.git/commitdiff
use url view helper
authorarno <arno@renevier.net>
Sun, 8 Aug 2010 09:00:49 +0000 (11:00 +0200)
committerarno <arno@renevier.net>
Fri, 13 Aug 2010 11:55:04 +0000 (13:55 +0200)
application/views/helpers/FooterLink.php
application/views/helpers/LogoutLink.php

index 46788c6a63fab9e4f48a5c7b7db5814aab25e185..50a2f0b8abde8b2accf8c8db030fc9503a20a181 100644 (file)
@@ -11,10 +11,7 @@ class Syj_View_Helper_FooterLink extends Zend_View_Helper_Abstract
         } else {
             $href = $page->getHRef();
             if ($redirect) {
-                $currentUri = Zend_Controller_Front::getInstance()->getRequest()->getRequestUri();
-                if (strpos($currentUri, '?') !== false) {
-                    $currentUri = strstr($currentUri, '?', true);
-                }
+                $currentUri = $this->view->url();
                 $href = $this->view->addParamToUrl($href, 'redirect', $currentUri, true);
             }
             $link = $this->view->anchor($href, $text, array('class' => 'footer-anchor'));
index d76682e616aeba87cb3f3f83fbb7366e62022d40..ad6c6e45dc972f17d2aba24fefed1beb2c50c37f 100644 (file)
@@ -6,11 +6,9 @@ class Syj_View_Helper_LogoutLink extends Zend_View_Helper_Abstract
 {
     public function logoutLink() {
         $currentUri = Zend_Controller_Front::getInstance()->getRequest()->getRequestUri();
-        if (strpos($currentUri, '?') !== false) {
-            $currentUri = strstr($currentUri, '?', true);
-        }
+        $encodeduri = implode('/', array_map('urlencode', explode('/', $currentUri)));
         $translatedString = $this->view->translate('logout');
-        $href = $this->view->addParamToUrl('logout', 'redirect', $currentUri, true);
+        $href = $this->view->addParamToUrl('logout', 'redirect', $encodeduri, true);
         return $this->view->anchor($href, $translatedString, array('id' => 'logout', 'class' => 'login-anchor'));
     }
 }