Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
0
 public function isActive(ZaxCMS\Model\CMS\Entity\Menu $menuItem)
 {
     return $this->request->presenterName === $menuItem->getPresenterName();
 }