芝麻web文件管理V1.00
编辑当前文件:/home/strato/chroot/opt/RZphp5/includes/Tree/Memory/MDBnested.php
* @param array the result of a query which retreives (all) * the tree data from a DB * @return array the result */ function setup($res = null) { if ($res == null) { // $whereAddOn = ''; if ($this->options['whereAddOn']) { $whereAddOn = 'WHERE '.$this->getOption('whereAddOn'); } // $orderBy = 'left'; if ($order=$this->getOption('order')) { $orderBy = $order; } // build the query this way, that the root, which has no parent // (parentId=0) is first $query = sprintf('SELECT * FROM %s %s ORDER BY %s', $this->table, $whereAddOn, // sort by the left-column, so we have the data //sorted as it is supposed to be :-) $this->_getColName($orderBy) ); if (MDB::isError($res = $this->dbh->getAll($query))) { return $this->_throwError($res->getMessage(), __LINE__); } } return $this->_prepareResults($res); } }