25 lines
458 B
PHP
Raw Normal View History

<?php
class Zend_View_Helper_MenuScript extends Zend_View_Helper_Abstract
{
public function menuScript()
{
$i = 0;
$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;
}
}