ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilRepositoryExplorerGUI Class Reference

Repository explorer GUI class. More...

+ Inheritance diagram for ilRepositoryExplorerGUI:
+ Collaboration diagram for ilRepositoryExplorerGUI:

Public Member Functions

 __construct ($a_parent_obj, $a_parent_cmd)
 Constructor.
 getRootNode ()
 Get root node.
 getNodeContent ($a_node)
 Get node content.
 getNodeIcon ($a_node)
 Get node icon.
 getNodeIconAlt ($a_node)
 Get node icon alt text.
 isNodeHighlighted ($a_node)
 Is node highlighted?
 getNodeHref ($a_node)
 Get href for node.
 isNodeVisible ($a_node)
 Is node visible.
 sortChilds ($a_childs, $a_parent_node_id)
 Sort childs.
 getChildsOfNode ($a_parent_node_id)
 Get childs of node.
 isNodeClickable ($a_node)
 Is node clickable?
- Public Member Functions inherited from ilTreeExplorerGUI
 __construct ($a_expl_id, $a_parent_obj, $a_parent_cmd, $a_tree)
 Constructor.
 getTree ()
 Get tree.
 setOrderField ($a_val, $a_numeric=false)
 Set order field.
 getOrderField ()
 Get order field.
 setTypeWhiteList ($a_val)
 Set type white list.
 getTypeWhiteList ()
 Get type white list.
 setTypeBlackList ($a_val)
 Set type black list.
 getTypeBlackList ()
 Get type black list.
 setPreloadChilds ($a_val)
 Set preload childs.
 getPreloadChilds ()
 Get preload childs.
 getSuccessorNode ($a_node_id, $a_type="")
 Get successor node (currently only(!) based on lft/rgt tree values)
 getNodeId ($a_node)
 Get id for node.
 setPathOpen ($a_id)
 Set node path to be opened.
 getHTML ()
 Get HTML.
- Public Member Functions inherited from ilExplorerBaseGUI
 __construct ($a_expl_id, $a_parent_obj, $a_parent_cmd)
 Constructor.
 nodeHasVisibleChilds ($a_node)
 Node has childs?
 getNodeTarget ($a_node)
 Get node target (frame) attribute.
 getNodeOnClick ($a_node)
 Get node onclick attribute.
 getId ()
 Get id of explorer element.
 setSkipRootNode ($a_val)
 Set skip root node.
 getSkipRootNode ()
 Get skip root node.
 setAjax ($a_val)
 Set ajax.
 getAjax ()
 Get ajax.
 setNodeOpen ($a_id)
 Set node to be opened (additional custom opened node, not standard expand behaviour)
 setSelectMode ($a_postvar, $a_multi=false)
 Set select mode (to deactivate, pass an empty string as postvar)
 setNodeSelected ($a_id)
 Set node to be opened (additional custom opened node, not standard expand behaviour)
 setOfflineMode ($a_val)
 Set offline mode.
 getOfflineMode ()
 Get offline mode.
 handleCommand ()
 Handle explorer internal command.
 getContainerId ()
 Get container id.
 openNode ()
 Open node.
 closeNode ()
 Close node.
 getNodeAsync ()
 Get node asynchronously.
 beforeRendering ()
 Before rendering.
 renderNode ($a_node, $tpl)
 Render node.
 renderChilds ($a_node_id, $tpl)
 Render childs.
 getDomNodeIdForNodeId ($a_node_id)
 Get DOM node id for node id.
 getNodeIdForDomNodeId ($a_dom_node_id)
 Get node id for dom node id.
 listItemStart ($tpl, $a_node)
 List item start.
 listItemEnd ($tpl)
 List item end.
 listStart ($tpl)
 List start.
 listEnd ($tpl)
 List end.

Protected Attributes

 $type_grps = array()
 $session_materials = array()
- Protected Attributes inherited from ilTreeExplorerGUI
 $tree = null
 $order_field = ""
 $order_field_numeric = false
 $type_white_list = array()
 $type_black_list = array()
 $childs = array()
 $preloaded = false
 $preload_childs = false
 $root_node_data = null
 $all_childs = array()
- Protected Attributes inherited from ilExplorerBaseGUI
 $skip_root_node = false
 $ajax = false
 $custom_open_nodes = array()
 $selected_nodes = array()
 $select_postvar = ""
 $offline_mode = false

Additional Inherited Members

- Static Public Member Functions inherited from ilExplorerBaseGUI
static getLocalExplorerJsPath ()
 Get local path of explorer js.
static getLocalJsTreeJsPath ()
 Get local path of jsTree js.
static createHTMLExportDirs ($a_target_dir)
 Create html export directories.
- Protected Member Functions inherited from ilTreeExplorerGUI
 preloadChilds ()
 Preload childs.
- Static Protected Attributes inherited from ilExplorerBaseGUI
static $js_tree_path = "./Services/UIComponent/Explorer2/lib/jstree-v.pre1.0/jquery.jstree.js"
static $js_expl_path = "./Services/UIComponent/Explorer2/js/Explorer2.js"

Detailed Description

Repository explorer GUI class.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$
Todo:
: isClickable, top node id

Definition at line 16 of file class.ilRepositoryExplorerGUI.php.

Constructor & Destructor Documentation

ilRepositoryExplorerGUI::__construct (   $a_parent_obj,
  $a_parent_cmd 
)

Constructor.

Definition at line 24 of file class.ilRepositoryExplorerGUI.php.

References $_GET, $ilSetting, $n, $path, ilTreeExplorerGUI\$tree, ilObject\_lookupObjId(), ilObject\_lookupType(), ilExplorerBaseGUI\setAjax(), ilTreeExplorerGUI\setOrderField(), ilTreeExplorerGUI\setPathOpen(), ilExplorerBaseGUI\setSkipRootNode(), and ilTreeExplorerGUI\setTypeWhiteList().

{
global $tree, $ilSetting, $objDefinition;
$this->cur_ref_id = (int) $_GET["ref_id"];
$this->top_node_id = 0;
if ($ilSetting->get("rep_tree_limit_grp_crs") && $this->cur_ref_id > 0)
{
$path = $tree->getPathId($this->cur_ref_id);
foreach ($path as $n)
{
if ($top_node > 0)
{
break;
}
array("crs", "grp")))
{
$this->top_node_id = $n;
}
}
}
parent::__construct("rep_exp", $a_parent_obj, $a_parent_cmd, $tree);
$this->setSkipRootNode(false);
$this->setAjax(true);
$this->setOrderField("title");
if ($ilSetting->get("repository_tree_pres") == "" ||
($ilSetting->get("rep_tree_limit_grp_crs") && $this->top_node_id == 0))
{
$this->setTypeWhiteList(array("root", "cat", "catr", "grp", "icrs",
"crs", "crsr", "rcrs"));
}
else if ($ilSetting->get("repository_tree_pres") == "all_types")
{
$white = array();
foreach ($objDefinition->getSubObjectsRecursively("root") as $rtype)
{
if (/* $rtype["name"] != "itgr" && */ !$objDefinition->isSideBlock($rtype["name"]))
{
$white[] = $rtype["name"];
}
}
$this->setTypeWhiteList($white);
}
if ((int) $_GET["ref_id"] > 0)
{
$this->setPathOpen((int) $_GET["ref_id"]);
}
}

+ Here is the call graph for this function:

Member Function Documentation

ilRepositoryExplorerGUI::getChildsOfNode (   $a_parent_node_id)

Get childs of node.

Parameters
@return

Reimplemented from ilTreeExplorerGUI.

Definition at line 410 of file class.ilRepositoryExplorerGUI.php.

References ilConditionHandler\_checkAllConditionsOfTarget(), and ilObject\_lookupObjId().

{
global $rbacsystem;
if (!$rbacsystem->checkAccess("read", $a_parent_node_id))
{
return array();
}
$obj_id = ilObject::_lookupObjId($a_parent_node_id);
if (!ilConditionHandler::_checkAllConditionsOfTarget($a_parent_node_id, $obj_id))
{
return array();
}
return parent::getChildsOfNode($a_parent_node_id);
}

+ Here is the call graph for this function:

ilRepositoryExplorerGUI::getNodeContent (   $a_node)

Get node content.

Parameters
array
Returns

Reimplemented from ilExplorerBaseGUI.

Definition at line 103 of file class.ilRepositoryExplorerGUI.php.

References $lng, ilSessionAppointment\_appointmentToString(), ilSessionAppointment\_lookupAppointment(), ilTreeExplorerGUI\getNodeId(), and getRootNode().

{
global $lng;
$title = $a_node["title"];
if ($a_node["child"] == $this->getNodeId($this->getRootNode()))
{
if ($title == "ILIAS")
{
$title = $lng->txt("repository");
}
}
else if($a_node["type"] == "sess" &&
!trim($title))
{
// #14367 - see ilObjSessionListGUI
include_once('./Modules/Session/classes/class.ilSessionAppointment.php');
$app_info = ilSessionAppointment::_lookupAppointment($a_node["obj_id"]);
$title = ilSessionAppointment::_appointmentToString($app_info['start'], $app_info['end'],$app_info['fullday']);
}
return $title;
}

+ Here is the call graph for this function:

ilRepositoryExplorerGUI::getNodeHref (   $a_node)

Get href for node.

Parameters
mixed$a_nodenode object/array
Returns
string href attribute

Reimplemented from ilExplorerBaseGUI.

Definition at line 185 of file class.ilRepositoryExplorerGUI.php.

References $_GET, $ilCtrl, and ilLink\_getStaticLink().

{
global $ilCtrl;
switch($a_node["type"])
{
case "root":
$ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $a_node["child"]);
$link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", "");
$ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
return $link;
case "cat":
$ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $a_node["child"]);
$link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", "");
$ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
return $link;
case "catr":
$ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $a_node["child"]);
$link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", "redirect");
$ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
return $link;
case "grp":
$ilCtrl->setParameterByClass("ilobjgroupgui", "ref_id", $a_node["child"]);
$link = $ilCtrl->getLinkTargetByClass(array("ilrepositorygui", "ilobjgroupgui"), "");
$ilCtrl->setParameterByClass("ilobjgroupgui", "ref_id", $_GET["ref_id"]);
return $link;
case "crs":
$ilCtrl->setParameterByClass("ilobjcoursegui", "ref_id", $a_node["child"]);
$link = $ilCtrl->getLinkTargetByClass(array("ilrepositorygui", "ilobjcoursegui"), "view");
$ilCtrl->setParameterByClass("ilobjcoursegui", "ref_id", $_GET["ref_id"]);
return $link;
case "crsr":
$ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $a_node["child"]);
$link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", "redirect");
$ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
return $link;
case "icrs":
$ilCtrl->setParameterByClass("ilobjilinccoursegui", "ref_id", $a_node["child"]);
$link = $ilCtrl->getLinkTargetByClass(array("ilrepositorygui", "ilobjilinccoursegui"), "");
$ilCtrl->setParameterByClass("ilobjilinccoursegui", "ref_id", $_GET["ref_id"]);
return $link;
case 'rcrs':
$ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $a_node["child"]);
$link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", "infoScreen");
$ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
return $link;
default:
include_once('./Services/Link/classes/class.ilLink.php');
return ilLink::_getStaticLink($a_node["child"], $a_node["type"], true);
}
}

+ Here is the call graph for this function:

ilRepositoryExplorerGUI::getNodeIcon (   $a_node)

Get node icon.

Parameters
array
Returns

Reimplemented from ilExplorerBaseGUI.

Definition at line 133 of file class.ilRepositoryExplorerGUI.php.

References ilObject\_getIcon(), and ilObject\_lookupObjId().

{
$obj_id = ilObject::_lookupObjId($a_node["child"]);
return ilObject::_getIcon($obj_id, "tiny", $a_node["type"]);
}

+ Here is the call graph for this function:

ilRepositoryExplorerGUI::getNodeIconAlt (   $a_node)

Get node icon alt text.

Parameters
arraynode array
Returns
string alt text

Reimplemented from ilTreeExplorerGUI.

Definition at line 145 of file class.ilRepositoryExplorerGUI.php.

References $lng, ilTreeExplorerGUI\getNodeId(), and getRootNode().

{
global $lng;
if ($a_node["child"] == $this->getNodeId($this->getRootNode()))
{
$title = $a_node["title"];
if ($title == "ILIAS")
{
$title = $lng->txt("repository");
}
return $lng->txt("icon")." ".$title;
}
return parent::getNodeIconAlt($a_node);
}

+ Here is the call graph for this function:

ilRepositoryExplorerGUI::getRootNode ( )

Get root node.

Parameters
@return

Reimplemented from ilTreeExplorerGUI.

Definition at line 85 of file class.ilRepositoryExplorerGUI.php.

References ilTreeExplorerGUI\getTree().

Referenced by getNodeContent(), getNodeIconAlt(), and isNodeHighlighted().

{
if ($this->top_node_id > 0)
{
return $this->getTree()->getNodeData($this->top_node_id);
}
else
{
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilRepositoryExplorerGUI::isNodeClickable (   $a_node)

Is node clickable?

Parameters
mixed$a_nodenode object/array
Returns
boolean node clickable true/false

Reimplemented from ilExplorerBaseGUI.

Definition at line 434 of file class.ilRepositoryExplorerGUI.php.

References $ilUser, $query, $res, $row, ilTreeExplorerGUI\$tree, ilConditionHandler\_checkAllConditionsOfTarget(), ilContainerReferenceAccess\_isAccessible(), ilObject\_lookupObjectId(), ilObject\_lookupObjId(), ilObjGlossary\_lookupOnline(), and DB_FETCHMODE_OBJECT.

{
global $rbacsystem,$tree,$ilDB,$ilUser,$ilAccess;
$obj_id = ilObject::_lookupObjId($a_node["child"]);
if (!ilConditionHandler::_checkAllConditionsOfTarget($a_node["child"], $obj_id))
{
return false;
}
switch ($a_node["type"])
{
case "crs":
return $ilAccess->checkAccess("read", "", $a_node["child"]);
// visible groups can allways be clicked; group processing decides
// what happens next
case "grp":
return true;
case 'tst':
if(!$rbacsystem->checkAccess("read", $a_node["child"]))
{
return false;
}
$query = sprintf("SELECT * FROM tst_tests WHERE obj_fi=%s", $obj_id);
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return (bool) $row->complete;
}
return false;
case 'svy':
if(!$rbacsystem->checkAccess("read", $a_node["child"]))
{
return false;
}
$query = sprintf("SELECT * FROM svy_svy WHERE obj_fi=%s", $obj_id);
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return (bool) $row->complete;
}
return false;
// media pools can only be edited
case "mep":
if ($rbacsystem->checkAccess("read", $a_node["child"]))
{
return true;
}
else
{
return false;
}
break;
case 'crsr':
case 'catr':
include_once('./Services/ContainerReference/classes/class.ilContainerReferenceAccess.php');
// all other types are only clickable, if read permission is given
default:
if ($rbacsystem->checkAccess("read", $a_node["child"]))
{
// check if lm is online
if ($a_node["type"] == "lm")
{
include_once("./Modules/LearningModule/classes/class.ilObjLearningModule.php");
$lm_obj =& new ilObjLearningModule($a_node["child"]);
if((!$lm_obj->getOnline()) && (!$rbacsystem->checkAccess('write', $a_node["child"])))
{
return false;
}
}
// check if fblm is online
if ($a_node["type"] == "htlm")
{
include_once("./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLM.php");
$lm_obj =& new ilObjFileBasedLM($a_node["child"]);
if((!$lm_obj->getOnline()) && (!$rbacsystem->checkAccess('write', $a_node["child"])))
{
return false;
}
}
// check if fblm is online
if ($a_node["type"] == "sahs")
{
include_once("./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php");
$lm_obj =& new ilObjSAHSLearningModule($a_node["child"]);
if((!$lm_obj->getOnline()) && (!$rbacsystem->checkAccess('write', $a_node["child"])))
{
return false;
}
}
// check if glossary is online
if ($a_node["type"] == "glo")
{
$obj_id = ilObject::_lookupObjectId($a_node["child"]);
include_once("./Modules/Glossary/classes/class.ilObjGlossary.php");
if((!ilObjGlossary::_lookupOnline($obj_id)) &&
(!$rbacsystem->checkAccess('write', $a_node["child"])))
{
return false;
}
}
return true;
}
else
{
return false;
}
break;
}
}

+ Here is the call graph for this function:

ilRepositoryExplorerGUI::isNodeHighlighted (   $a_node)

Is node highlighted?

Parameters
mixed$a_nodenode object/array
Returns
boolean node visible true/false

Reimplemented from ilExplorerBaseGUI.

Definition at line 169 of file class.ilRepositoryExplorerGUI.php.

References $_GET, ilTreeExplorerGUI\getNodeId(), and getRootNode().

{
if ($a_node["child"] == $_GET["ref_id"] ||
($_GET["ref_id"] == "" && $a_node["child"] == $this->getNodeId($this->getRootNode())))
{
return true;
}
return false;
}

+ Here is the call graph for this function:

ilRepositoryExplorerGUI::isNodeVisible (   $a_node)

Is node visible.

Parameters
@return

Reimplemented from ilExplorerBaseGUI.

Definition at line 252 of file class.ilRepositoryExplorerGUI.php.

References $ilSetting, ilTreeExplorerGUI\$tree, and ilEventItems\_getItemsOfContainer().

{
global $ilAccess,$tree,$ilSetting;
if (!$ilAccess->checkAccess('visible', '', $a_node["child"]))
{
return false;
}
$is_course = false;
$container_parent_id = $tree->checkForParentType($a_node["child"], 'grp');
if(!$container_parent_id)
{
$is_course = true;
$container_parent_id = $tree->checkForParentType($a_node["child"], 'crs');
}
if($container_parent_id)
{
// do not display session materials for container course/group
if($ilSetting->get("repository_tree_pres") == "all_types" && $container_parent_id != $a_node["child"])
{
// get container event items only once
if(!isset($this->session_materials[$container_parent_id]))
{
include_once './Modules/Session/classes/class.ilEventItems.php';
$this->session_materials[$container_parent_id] = ilEventItems::_getItemsOfContainer($container_parent_id);
}
if(in_array($a_node["child"], $this->session_materials[$container_parent_id]))
{
return false;
}
}
}
return true;
}

+ Here is the call graph for this function:

ilRepositoryExplorerGUI::sortChilds (   $a_childs,
  $a_parent_node_id 
)

Sort childs.

Parameters
array$a_childsarray of child nodes
mixed$a_parent_nodeparent node
Returns
array array of childs nodes

Reimplemented from ilExplorerBaseGUI.

Definition at line 297 of file class.ilRepositoryExplorerGUI.php.

References ilTreeExplorerGUI\$childs, $ref_id, $t, ilContainerSorting\_getInstance(), ilObject\_lookupObjId(), ilObject\_lookupType(), and ilObjectActivation\getItemsByItemGroup().

{
global $objDefinition;
$parent_obj_id = ilObject::_lookupObjId($a_parent_node_id);
if ($parent_obj_id > 0)
{
$parent_type = ilObject::_lookupType($parent_obj_id);
}
else
{
$parent_type = "dummy";
$this->type_grps["dummy"] = array("root" => "dummy");
}
if (empty($this->type_grps[$parent_type]))
{
$this->type_grps[$parent_type] =
$objDefinition->getGroupedRepositoryObjectTypes($parent_type);
}
// #14465 - item groups
include_once('./Services/Object/classes/class.ilObjectActivation.php');
$group = array();
foreach ($a_childs as $child)
{
// item group: get childs
if ($child["type"] == "itgr")
{
$g = $child["child"];
if ($items)
{
// add item group ref id to item group block
$this->type_grps[$parent_type]["itgr"]["ref_ids"][] = $g;
foreach($items as $item)
{
$group[$g][] = $item;
}
}
}
// type group
else
{
$g = $objDefinition->getGroupOfObj($child["type"]);
if ($g == "")
{
$g = $child["type"];
}
$group[$g][] = $child;
}
}
$childs = array();
$done = array();
foreach ($this->type_grps[$parent_type] as $t => $g)
{
// type group
if (is_array($group[$t]))
{
// do we have to sort this group??
include_once("./Services/Container/classes/class.ilContainer.php");
include_once("./Services/Container/classes/class.ilContainerSorting.php");
$sort = ilContainerSorting::_getInstance($parent_obj_id);
$group = $sort->sortItems($group);
// need extra session sorting here
if ($t == "sess")
{
}
foreach ($group[$t] as $k => $item)
{
if (!in_array($item["child"], $done))
{
$childs[] = $item;
$done[] = $item["child"];
}
}
}
// item groups
else if ($t == "itgr" &&
is_array($g["ref_ids"]))
{
foreach ($g["ref_ids"] as $ref_id)
{
if (isset($group[$ref_id]))
{
foreach ($group[$ref_id] as $k => $item)
{
if(!in_array($item["child"], $done))
{
$childs[] = $item;
$done[] = $item["child"];
}
}
}
}
}
}
return $childs;
}

+ Here is the call graph for this function:

Field Documentation

ilRepositoryExplorerGUI::$session_materials = array()
protected

Definition at line 19 of file class.ilRepositoryExplorerGUI.php.

ilRepositoryExplorerGUI::$type_grps = array()
protected

Definition at line 18 of file class.ilRepositoryExplorerGUI.php.


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