Example #1
0
 private function addDropdown(Page $page, array $configuration)
 {
     $dropdownItems = array();
     $children = $page->children();
     foreach ($children as $child) {
         if (!$child->published()) {
             continue;
         }
         $dropdownItems[] = $this->addLink($child, $configuration);
     }
     $dropdown = $this->addLink($page, $configuration, 'dropdown');
     $dropdown['items'] = $dropdownItems;
     return $dropdown;
 }