ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilSCORMTree Class Reference

SCORM Object Tree. More...

+ Inheritance diagram for ilSCORMTree:
+ Collaboration diagram for ilSCORMTree:

Public Member Functions

 ilSCORMTree ($a_id=0)
 Constructor.
 getChilds ($a_node_id, $a_order="", $a_direction="ASC")
 get child nodes of given node public
- Public Member Functions inherited from ilTree
 ilTree ($a_tree_id, $a_root_id=0)
 Constructor public.
 useCache ($a_use=true)
 Use Cache (usually activated)
 isCacheUsed ()
 Check if cache is active.
 initLangCode ()
 Store user language.
 setTableNames ($a_table_tree, $a_table_obj_data, $a_table_obj_reference="")
 set table names The primary key of the table containing your object_data must be 'obj_id' You may use a reference table.
 setReferenceTablePK ($a_column_name)
 set column containing primary key in reference table public
 setObjectTablePK ($a_column_name)
 set column containing primary key in object table public
 setTreeTablePK ($a_column_name)
 set column containing primary key in tree table public
 buildJoin ()
 build join depending on table settings private
 getFilteredChilds ($a_filter, $a_node, $a_order="", $a_direction="ASC")
 get child nodes of given node (exclude filtered obj_types) public
 getChildsByType ($a_node_id, $a_type)
 get child nodes of given node by object type public
 getChildsByTypeFilter ($a_node_id, $a_types)
 get child nodes of given node by object type public
 insertNode ($a_node_id, $a_parent_id, $a_pos=IL_LAST_NODE, $a_reset_deletion_date=false)
 insert new node with node_id under parent node with parent_id public
 getFilteredSubTree ($a_node_id, $a_filter=array())
 get filtered subtree
 getSubTreeIds ($a_ref_id)
 Get all ids of subnodes.
 getSubTree ($a_node, $a_with_data=true, $a_type="")
 get all nodes in the subtree under specified node
 getSubTreeTypes ($a_node, $a_filter=0)
 get types of nodes in the subtree under specified node
 deleteTree ($a_node)
 delete node and the whole subtree under this node public
 getPathFull ($a_endnode_id, $a_startnode_id=0)
 get path from a given startnode to a given endnode if startnode is not given the rootnode is startnode.
 getPathIdsUsingNestedSets ($a_endnode_id, $a_startnode_id=0)
 get path from a given startnode to a given endnode if startnode is not given the rootnode is startnode public
 getPathIdsUsingAdjacencyMap ($a_endnode_id, $a_startnode_id=0)
 get path from a given startnode to a given endnode if startnode is not given the rootnode is startnode public
 preloadDepthParent ($a_node_ids)
 Preload depth/parent.
 getPathId ($a_endnode_id, $a_startnode_id=0)
 get path from a given startnode to a given endnode if startnode is not given the rootnode is startnode public
 getNodePathForTitlePath ($titlePath, $a_startnode_id=null)
 Converts a path consisting of object titles into a path consisting of tree nodes.
 getNodePath ($a_endnode_id, $a_startnode_id=0)
 Returns the node path for the specified object reference.
 checkTree ()
 check consistence of tree all left & right values are checked if they are exists only once public
 checkTreeChilds ($a_no_zero_child=true)
 check, if all childs of tree nodes exist in object table
 getMaximumDepth ()
 Return the maximum depth in tree public.
 getDepth ($a_node_id)
 return depth of a node in tree private
 getNodeData ($a_node_id, $a_tree_pk=null)
 get all information of a node.
 fetchNodeData ($a_row)
 get data of parent node from tree and object_data private
 isInTree ($a_node_id)
 get all information of a node.
 getParentNodeData ($a_node_id)
 get data of parent node from tree and object_data public
 isGrandChild ($a_startnode_id, $a_querynode_id)
 checks if a node is in the path of an other node public
 addTree ($a_tree_id, $a_node_id=-1)
 create a new tree to do: ???
 getNodeDataByType ($a_type)
 get nodes by type // TODO: method needs revision
 removeTree ($a_tree_id)
 remove an existing tree
 saveSubTree ($a_node_id, $a_set_deleted=false)
 save subtree: delete a subtree (defined by node_id) to a new tree with $this->tree_id -node_id.
 isDeleted ($a_node_id)
 This is a wrapper for isSaved() with a more useful name.
 isSaved ($a_node_id)
 check if node is saved
 preloadDeleted ($a_node_ids)
 Preload deleted information.
 getSavedNodeData ($a_parent_id)
 get data saved/deleted nodes
 getParentId ($a_node_id)
 get parent id of given node public
 getLeftValue ($a_node_id)
 get left value of given node public
 getChildSequenceNumber ($a_node, $type="")
 get sequence number of node in sibling sequence public
 readRootId ()
 read root id from database
 getRootId ()
 get the root id of tree public
 setRootId ($a_root_id)
 getTreeId ()
 get tree id public
 setTreeId ($a_tree_id)
 set tree id public
 fetchSuccessorNode ($a_node_id, $a_type="")
 get node data of successor node
 fetchPredecessorNode ($a_node_id, $a_type="")
 get node data of predecessor node
 renumber ($node_id=1, $i=1)
 Wrapper for renumber.
 __renumber ($node_id=1, $i=1)
 This method is private.
 checkForParentType ($a_ref_id, $a_type, $a_exclude_source_check=false)
 Check for parent type e.g check if a folder (ref_id 3) is in a parent course obj => checkForParentType(3,'crs');.
 _removeEntry ($a_tree, $a_child, $a_db_table="tree")
 STATIC METHOD Removes a single entry from a tree.
 __isMainTree ()
 Check if operations are done on main tree.
 __checkDelete ($a_node)
 Check for deleteTree() compares a subtree of a given node by checking lft, rgt against parent relation.
 __getSubTreeByParentRelation ($a_node_id, &$parent_childs)
 __validateSubtrees (&$lft_childs, $parent_childs)
 moveTree ($a_source_id, $a_target_id, $a_location=IL_LAST_NODE)
 Move Tree Implementation.
 getRbacSubtreeInfo ($a_endnode_id)
 This method is used for change existing objects and returns all necessary information for this action.

Additional Inherited Members

- Data Fields inherited from ilTree
 $ilias
 $log
 $root_id
 $tree_id
 $table_tree
 $table_obj_data
 $table_obj_reference
 $ref_pk
 $obj_pk
 $tree_pk
 $gap
- Protected Member Functions inherited from ilTree
 fetchTranslationFromObjectDataCache ($a_obj_ids)
 Get translation data from object cache (trigger in object cache on preload)
- Protected Attributes inherited from ilTree
 $depth_cache = array()
 $parent_cache = array()

Detailed Description

SCORM Object Tree.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
Id:
class.ilSCORMTree.php 20408 2009-07-03 10:13:22Z nkrzywon

Definition at line 34 of file class.ilSCORMTree.php.

Member Function Documentation

ilSCORMTree::getChilds (   $a_node_id,
  $a_order = "",
  $a_direction = "ASC" 
)

get child nodes of given node public

Parameters
integernode_id
stringsort order of returned childs, optional (possible values: 'title','desc','last_update' or 'type')
stringsort direction, optional (possible values: 'DESC' or 'ASC'; defalut is 'ASC')
Returns
array with node data of all childs or empty array

Reimplemented from ilTree.

Definition at line 58 of file class.ilSCORMTree.php.

References $ilDB, $row, and ilTree\fetchNodeData().

{
global $ilDB;
if (!isset($a_node_id))
{
$message = get_class($this)."::getChilds(): No node_id given!";
$this->ilErr->raiseError($message,$this->ilErr->WARNING);
}
// init childs
$childs = array();
// number of childs
$count = 0;
// init order_clause
$order_clause = "";
// set order_clause if sort order parameter is given
if (!empty($a_order))
{
$order_clause = "ORDER BY ".$a_order." ".$a_direction;
}
else
{
$order_clause = "ORDER BY ".$this->table_tree.".lft";
}
//666
$r = $ilDB->queryF("
SELECT * FROM ".$this->table_tree." ".
$this->buildJoin().
"WHERE parent = %s ".
"AND ".$this->table_tree.".".$this->tree_pk." = %s ".
$order_clause,
array('integer','integer'),array($a_node_id,$this->tree_id));
$count = $ilDB->numRows($r);
if ($count > 0)
{
while ($row = $ilDB->fetchAssoc($r))
{
$childs[] = $this->fetchNodeData($row);
}
// mark the last child node (important for display)
$childs[$count - 1]["last"] = true;
return $childs;
}
else
{
return $childs;
}
}

+ Here is the call graph for this function:

ilSCORMTree::ilSCORMTree (   $a_id = 0)

Constructor.

Parameters
int$a_idtree id (= SCORM Learning Module Object ID) public

Definition at line 43 of file class.ilSCORMTree.php.

References ilTree\ilTree(), ilTree\setTableNames(), and ilTree\setTreeTablePK().

{
$this->setTableNames('scorm_tree','scorm_object');
$this->setTreeTablePK('slm_id');
}

+ Here is the call graph for this function:


The documentation for this class was generated from the following file: