Beispiel #1
0
 protected function load()
 {
     if (!$this->loaded) {
         $this->loaded = true;
         $dataRows = TreeView::EXPANDED !== $this->treeView->mode ? $this->getDataRows() : $this->treeView->getDataRows();
         foreach ($dataRows as $dataRow) {
             if (empty($this->dataRow) && empty($dataRow->parentId) || !empty($this->dataRow) && $this->dataRow->id === $dataRow->parentId) {
                 $name = $dataRow[$this->treeView->primaryKey];
                 $node = new TreeViewNode($this, $name, $dataRow);
                 $node['nodeLink'] = clone $this['nodeLink'];
                 if (TreeView::EXPANDED === $this->treeView->mode && ($this->treeView->rememberState && !$node->isSessionState() || !$this->treeView->rememberState)) {
                     $node->expand();
                 }
             }
         }
     }
 }