Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 require_once ("classes/class.ilTree.php");
00025
00035 class ilSCORMTree extends ilTree
00036 {
00037
00044 function ilSCORMTree($a_id = 0)
00045 {
00046 parent::ilTree($a_id);
00047 $this->setTableNames('scorm_tree','scorm_object');
00048 $this->setTreeTablePK('slm_id');
00049 }
00050
00059 function getChilds($a_node_id, $a_order = "", $a_direction = "ASC")
00060 {
00061 if (!isset($a_node_id))
00062 {
00063 $message = get_class($this)."::getChilds(): No node_id given!";
00064 $this->ilErr->raiseError($message,$this->ilErr->WARNING);
00065 }
00066
00067
00068 $childs = array();
00069
00070
00071 $count = 0;
00072
00073
00074 $order_clause = "";
00075
00076
00077 if (!empty($a_order))
00078 {
00079 $order_clause = "ORDER BY ".$a_order." ".$a_direction;
00080 }
00081 else
00082 {
00083 $order_clause = "ORDER BY ".$this->table_tree.".lft";
00084 }
00085
00086
00087 $q = "SELECT * FROM ".$this->table_tree." ".
00088 $this->buildJoin().
00089 "WHERE parent = '".$a_node_id."' ".
00090 "AND ".$this->table_tree.".".$this->tree_pk." = '".$this->tree_id."' ".
00091 $order_clause;
00092
00093 $r = $this->ilDB->query($q);
00094
00095 $count = $r->numRows();
00096
00097
00098 if ($count > 0)
00099 {
00100 while ($row = $r->fetchRow(DB_FETCHMODE_ASSOC))
00101 {
00102 $childs[] = $this->fetchNodeData($row);
00103 }
00104
00105
00106 $childs[$count - 1]["last"] = true;
00107
00108 return $childs;
00109 }
00110 else
00111 {
00112 return $childs;
00113 }
00114 }
00115 }
00116 ?>