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, $extraclass=null, $extratext="") {
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 (($pos = strpos($currentUri, '?')) !== false) {
16 $currentUri = substr($currentUri, 0, $pos);
18 $href = $this->view->addParamToUrl($href, 'redirect', $currentUri, true);
20 $link = $this->view->anchor($href, $text, array('class' => 'footer-anchor'));
22 $class = "footer-link";
23 if (isset($extraclass)) {
24 $class = "$class $extraclass";
26 return '<div class="' . $class . '">' . $link . $extratext . '</div>' . PHP_EOL;