function __construct(NavigationItem $item) { $this->item = $item; $this->navigation = $this->item->GetNavigation(); $this->tree = new NavigationTreeProvider($this->item->GetNavigation()); $this->child = $this->tree->FirstChildOf($this->item); }
protected function ItemClasses() { $classes = array(); $classes[] = 'level-' . $this->level; if ($this->naviItem->Equals($this->naviTree->FirstChildOf($this->naviParent))) { $classes[] = 'first-item'; } if ($this->naviTree->NextOf($this->naviItem) == null) { $classes[] = 'last-item'; } if ($this->IsActive()) { $classes[] = 'active'; } else { if ($this->IsTrail()) { $classes[] = 'trail'; } } return join(' ', $classes); }