require_once 'DataObjects/Objectclass.php'; class Ldap_objectclass extends HTML_FlexyFramework_Page { var $template = 'ldap/objectclass.html'; var $loadmodules = array('Navigation'); function getAuth() { return; } function start($request) { if (!$request) { return $this->showList(); } $this->object = new DataObjects_Objectclass; $this->object->get('cn',$request); $this->object->getSup(); $this->object->getAttributes(); $this->object->flattenAttributes(); $this->object->loadSups(); // echo "
";
// print_r($this->object);
}
var $classes = array();
function showList() {
$this->template = 'ldap/objectclassTree.html';
//DB_DataObject::debuglevel(1);
$obj = new DataObjects_Objectclass;
$obj->selectAdd();
$obj->selectAdd("sup,cn");
$obj->orderBy('cn');
$obj->find();
while($obj->fetch()) {
$obj->children = array();
$this->classes[$obj->cn] = clone($obj);
}
// echo "" ; print_r($this->classes);
$this->tree = array();
foreach(array_keys($this->classes) as $cn) {
if (empty($this->classes[$cn]->sup[0])) {
// top level;
$this->tree[] = $this->classes[$cn];
continue;
}
$this->classes[$this->classes[$cn]->sup]->children[] = &$this->classes[$cn];
}
// $this->outputTree();
}
function outputTree($base = false) {
//echo "TREE";
if ($base === false) {
$base = $this->tree;
}
echo "";
// print_r($ar);
//echo "";
$this->tree = array($ar);
$this->outputTree();
}
}