2 /* This file is part of Syj, Copyright (c) 2010 Arnaud Renevier,
3 and is published under the AGPL license. */
5 class Syj_View_Helper_FooterLink extends Zend_View_Helper_Abstract
7 public function FooterLink($routeoptions, $text, $redirect=true) {
8 $page = new Zend_Navigation_Page_Mvc($routeoptions);
9 if ($page->isActive()) {
10 $link = $this->view->escape($text);
12 $href = $page->getHRef();
14 $currentUri = Zend_Controller_Front::getInstance()->getRequest()->getRequestUri();
15 if (strpos($currentUri, '?') !== false) {
16 $currentUri = strstr($currentUri, '?', true);
18 $href = $this->view->addParamToUrl($href, 'redirect', $currentUri, true);
20 $link = $this->view->anchor($href, $text, array('class' => 'footer-anchor'));
22 return '<div class="footer-link">' . $link . '</div>' . PHP_EOL;