2011-01-10 10:19:09 +00:00

27 lines
570 B
PHP

<?php
class Zend_View_Helper_MenuScript extends Zend_View_Helper_Abstract
{
public function menuScript()
{
$i = 0;
$request = Zend_Controller_Front::getInstance()->getRequest();
$controller = $request->getControllerName();
$container = $this->view->navigation()->getContainer();
$submenu = $this->view->navigation()->findActive($container);
if ($submenu != null){
$parentLabel = $submenu['page']->getParent()->getLabel();
foreach($container as $page){
if ($page->label == $parentLabel){
break;
}
$i++;
}
}
return $i;
}
}