public function pimcoreNavigation($activeDocument = null, $navigationRootDocument = null, $htmlMenuIdPrefix = null, $pageCallback = null, $cache = true)
{
$controller = self::getController();
if ($activeDocument) {
// this is the new more convenient way of creating a navigation
$navContainer = $controller->getNavigation($activeDocument, $navigationRootDocument, $htmlMenuIdPrefix, $pageCallback, $cache);
$this->navigation($navContainer);
$this->setUseTranslator(false);
$this->setInjectTranslator(false);
// now we need to refresh the container in all helpers, since the container can change from call to call
// see also https://www.pimcore.org/issues/browse/PIMCORE-2636 which describes this problem in detail
foreach ($this->_helpers as $helper) {
$helper->setContainer($this->getContainer());
}
// just to be sure, ... load the menu helper and set the container
$menu = $this->findHelper("menu");
if ($menu) {
$menu->setContainer($this->getContainer());
}
return $this;
} else {
// this is the old-style navigation
return $controller;
}
}