Example #1
0
 public function iterate($iterator, &$allItems)
 {
     while ($iterator->valid()) {
         $key = $iterator->key();
         $current = $iterator->current();
         if ($iterator->hasChildren()) {
             $this->iterate($iterator->getChildren(), $allItems);
         } else {
             if ($current['activable'] === true) {
                 $allItems[] = \vendor\DataPath::getPath();
             }
         }
         $iterator->next();
     }
 }
Example #2
0
 public function current()
 {
     \vendor\DataPath::setPath($this->key(), $this->level);
     $current = $this->data[$this->key()];
     return array('title' => $current['title'], 'href' => $current['href'], 'style' => $current['style'], 'img' => $current['img'], 'cls' => $current['cls'], 'activable' => $current['activable']);
 }