<?php

class Fiktiv_View_Helper_RenderMenu extends Zend_View_Helper_Abstract
{
    public function hasSubmenu()
    {
        $navigation = $this->view->navigation();
        $container  = $navigation->getContainer();
        $active     = $navigation->menu()->findActive($navigation->getContainer());

        if ($active && !($active['page']->getParent() instanceof Zend_Navigation)) {
            return true;
        }
        
        return false;
    }

    public function renderMenu()
    {
        return $this;
    }

    public function __toString()
    {
        return $this->_render();
    }

    private function _render()
    {
        return $this->view->navigation()->menu()->setMaxDepth(0)->setUlClass('')->renderMenu();
    }
}