/** * Build the tree. * * @return TreeToolsTree Tree object */ public function buildTree() { Tools::atkdebug('treenode::buildtree() ' . $this->m_parent); $recordset = $this->select(Tools::atkArrayNvl($this->m_postvars, 'atkfilter', ''))->excludes($this->m_listExcludes)->mode('admin')->getAllRows(); $treeobject = new TreeToolsTree(); for ($i = 0; $i < count($recordset); ++$i) { $treeobject->addNode($recordset[$i][$this->m_primaryKey[0]], $recordset[$i], $recordset[$i][$this->m_parent][$this->m_primaryKey[0]]); } return $treeobject; }
/** * Create all the options. * * @param array $recordset * * @return string The HTML code for the options */ public function createdd($recordset) { $t = new TreeToolsTree(); for ($i = 0; $i < count($recordset); ++$i) { $group = $recordset[$i]; $t->addNode($recordset[$i][$this->m_destInstance->m_primaryKey[0]], $this->m_destInstance->descriptor($group), $recordset[$i][$this->m_destInstance->m_parent][$this->m_destInstance->m_primaryKey[0]]); } $tmp = $this->render($t->m_tree); return $tmp; }