protected function saveMenuItem(Model\CMS\Entity\Menu $menuItem, Form $form) { $menuItem->setTranslatableLocale($this->getEditControl()->getLocale()); $this->menuService->getRepository()->persistAsLastChildOf($menuItem, $this->parentMenu); $this->menuService->flush(); $this->flashMessage('common.alert.newEntrySaved', 'success'); $this->getEditControl()->go('this', ['selectItem' => $menuItem->id]); }
protected function saveMenuItem(Model\CMS\Entity\Menu $menuItem, Form $form) { $menuItem->setTranslatableLocale($this->getEditControl()->getLocale()); $this->menuService->persist($menuItem); $this->menuService->flush(); $this->flashMessage('common.alert.changesSaved', 'success'); $this->getEditControl()->go('this', ['selectItem' => $menuItem->id]); }
public function isActive(ZaxCMS\Model\CMS\Entity\Menu $menuItem) { $activePresenter = $this->request->presenterName === $menuItem->getPresenterName(); $actionMatch = $this->request->parameters['action'] === $menuItem->getActionName(); if (!$activePresenter || !$actionMatch) { return FALSE; } $slugs = ['category', 'article', 'author', 'tag']; $isAnySet = FALSE; foreach ($slugs as $slug) { if (isset($menuItem->nhrefParams[$slug . '-slug'])) { $isAnySet = TRUE; if (isset($this->request->parameters[$slug . '-slug']) && $this->request->parameters[$slug . '-slug'] === $menuItem->nhrefParams[$slug . '-slug']) { return TRUE; } } } return !$isAnySet; }
public function __construct(Kdyby\Doctrine\EntityManager $entityManager) { parent::__construct($entityManager); $this->entityClassName = Entity\Menu::getClassName(); }
public function isActive(ZaxCMS\Model\CMS\Entity\Menu $menuItem) { $activePresenter = $this->request->presenterName === $menuItem->getPresenterName(); $activePage = isset($this->request->parameters['page']) && $this->request->parameters['page'] === $menuItem->nhrefParams['page']; return $activePresenter && $activePage; }
public function isActive(ZaxCMS\Model\CMS\Entity\Menu $menuItem) { return $this->request->presenterName === $menuItem->getPresenterName(); }