4 include_once(
"./Services/UIComponent/Explorer2/classes/class.ilTreeExplorerGUI.php");
71 $this->tree = $DIC->repositoryTree();
73 $this->obj_definition = $DIC[
"objDefinition"];
74 $this->lng = $DIC->language();
75 $this->ctrl = $DIC->ctrl();
76 $this->access = $DIC->access();
77 $this->rbacsystem = $DIC->rbac()->system();
78 $this->db = $DIC->database();
79 $this->
user = $DIC->user();
80 $tree = $DIC->repositoryTree();
82 $objDefinition = $DIC[
"objDefinition"];
84 $this->cur_ref_id = (int)
$_GET[
"ref_id"];
86 $this->top_node_id = 0;
87 if (
$ilSetting->get(
"rep_tree_limit_grp_crs") && $this->cur_ref_id > 0) {
97 $this->top_node_id =
$n;
102 parent::__construct(
"rep_exp", $a_parent_obj, $a_parent_cmd,
$tree);
107 if (
$ilSetting->get(
"repository_tree_pres") ==
"" ||
108 (
$ilSetting->get(
"rep_tree_limit_grp_crs") && $this->top_node_id == 0)) {
110 } elseif (
$ilSetting->get(
"repository_tree_pres") ==
"all_types") {
112 foreach ($objDefinition->getSubObjectsRecursively(
"root") as $rtype) {
113 if ( !$objDefinition->isSideBlock($rtype[
"name"])) {
114 $white[] = $rtype[
"name"];
119 if ((
int)
$_GET[
"ref_id"] > 0) {
134 if ($this->top_node_id > 0) {
135 $root_node = $this->
getTree()->getNodeData($this->top_node_id);
137 $root_node = parent::getRootNode();
139 $this->node_data[$root_node[
"child"]] = $root_node;
153 $title = $a_node[
"title"];
159 } elseif ($a_node[
"type"] ==
"sess" &&
162 include_once(
'./Modules/Session/classes/class.ilSessionAppointment.php');
179 return ilObject::_getIcon($obj_id,
"tiny", $a_node[
"type"]);
193 $title = $a_node[
"title"];
201 return parent::getNodeIconAlt($a_node);
212 if ($a_node[
"child"] ==
$_GET[
"ref_id"] ||
229 switch ($a_node[
"type"]) {
231 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $a_node[
"child"]);
232 $link =
$ilCtrl->getLinkTargetByClass(
"ilrepositorygui",
"");
233 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
$_GET[
"ref_id"]);
237 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $a_node[
"child"]);
238 $link =
$ilCtrl->getLinkTargetByClass(
"ilrepositorygui",
"");
239 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
$_GET[
"ref_id"]);
243 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $a_node[
"child"]);
244 $link =
$ilCtrl->getLinkTargetByClass(
"ilrepositorygui",
"redirect");
245 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
$_GET[
"ref_id"]);
249 $ilCtrl->setParameterByClass(
"ilobjgroupgui",
"ref_id", $a_node[
"child"]);
250 $link =
$ilCtrl->getLinkTargetByClass(array(
"ilrepositorygui",
"ilobjgroupgui"),
"");
251 $ilCtrl->setParameterByClass(
"ilobjgroupgui",
"ref_id",
$_GET[
"ref_id"]);
255 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $a_node[
"child"]);
256 $link =
$ilCtrl->getLinkTargetByClass(
"ilrepositorygui",
"redirect");
257 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
$_GET[
"ref_id"]);
261 $ilCtrl->setParameterByClass(
"ilobjcoursegui",
"ref_id", $a_node[
"child"]);
262 $link =
$ilCtrl->getLinkTargetByClass(array(
"ilrepositorygui",
"ilobjcoursegui"),
"view");
263 $ilCtrl->setParameterByClass(
"ilobjcoursegui",
"ref_id",
$_GET[
"ref_id"]);
267 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $a_node[
"child"]);
268 $link =
$ilCtrl->getLinkTargetByClass(
"ilrepositorygui",
"redirect");
269 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
$_GET[
"ref_id"]);
273 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $a_node[
"child"]);
274 $link =
$ilCtrl->getLinkTargetByClass(
"ilrepositorygui",
"infoScreen");
275 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
$_GET[
"ref_id"]);
279 $ilCtrl->setParameterByClass(
"ilobjstudyprogrammegui",
"ref_id", $a_node[
"child"]);
280 $link =
$ilCtrl->getLinkTargetByClass(array(
"ilrepositorygui",
"ilobjstudyprogrammegui"),
"view");
281 $ilCtrl->setParameterByClass(
"ilobjstudyprogrammegui",
"ref_id",
$_GET[
"ref_id"]);
285 include_once(
'./Services/Link/classes/class.ilLink.php');
303 if (!$ilAccess->checkAccess(
'visible',
'', $a_node[
"child"])) {
307 if (
$ilSetting->get(
"repository_tree_pres") ==
"all_types") {
314 if ($container_parent_id > 0) {
316 if ($container_parent_id != $a_node[
"child"]) {
318 if (!isset($this->session_materials[$container_parent_id])) {
319 include_once
'./Modules/Session/classes/class.ilEventItems.php';
322 if (in_array($a_node[
"child"], $this->session_materials[$container_parent_id])) {
340 $current_node_id = $node_id;
341 while (isset($this->parent_node_id[$current_node_id])) {
343 if (isset($this->node_data[
$parent_node_id]) && in_array($this->node_data[$parent_node_id][
"type"], [
"grp",
"crs"])) {
366 if ($parent_obj_id > 0) {
369 $parent_type =
"dummy";
370 $this->type_grps[
"dummy"] = array(
"root" =>
"dummy");
375 $this->type_grps = array();
377 if (empty($this->type_grps[$parent_type])) {
378 $this->type_grps[$parent_type] =
379 $objDefinition->getGroupedRepositoryObjectTypes($parent_type);
383 include_once(
'./Services/Object/classes/class.ilObjectActivation.php');
386 $in_any_group = array();
387 foreach ($a_childs as $child) {
389 if ($child[
"type"] ==
"itgr") {
390 $g = $child[
"child"];
394 $this->type_grps[$parent_type][
"itgr"][
"ref_ids"][] = $g;
397 $may_read = $ilAccess->checkAccess(
'read',
'', $g);
401 include_once(
"./Services/Container/classes/class.ilContainerSorting.php");
405 foreach ($items as $item) {
406 $in_any_group[] = $item[
"child"];
409 $igroup[$g][] = $item;
410 $group[$g][] = $item;
417 $g = $objDefinition->getGroupOfObj($child[
"type"]);
421 $group[$g][] = $child;
425 $in_any_group = array_unique($in_any_group);
428 include_once(
"./Services/Container/classes/class.ilContainerSorting.php");
430 $block_pos = $sort->getBlockPositions();
431 if (is_array($block_pos) && count($block_pos) > 0) {
432 $tmp = $this->type_grps[$parent_type];
434 $this->type_grps[$parent_type] = array();
435 foreach ($block_pos as $block_type) {
437 if (!is_numeric($block_type) &&
438 array_key_exists($block_type, $tmp)) {
439 $this->type_grps[$parent_type][$block_type] = $tmp[$block_type];
440 unset($tmp[$block_type]);
445 $this->type_grps[$parent_type][$block_type] = array();
451 foreach ($tmp as $block_type => $grp) {
452 $this->type_grps[$parent_type][$block_type] = $grp;
462 foreach ($this->type_grps[$parent_type] as
$t => $g) {
464 if (is_array($group[
$t])) {
467 if (is_array($igroup[$t])) {
468 foreach ($igroup[$t] as $k => $item) {
469 if (!in_array($item[
"child"], $done)) {
471 $done[] = $item[
"child"];
476 include_once(
"./Services/Container/classes/class.ilContainer.php");
477 include_once(
"./Services/Container/classes/class.ilContainerSorting.php");
479 $group = $sort->sortItems($group);
485 foreach ($group[$t] as $k => $item) {
486 if (!in_array($item[
"child"], $done) &&
487 !in_array($item[
"child"], $in_any_group)) {
489 $done[] = $item[
"child"];
495 elseif ($t ==
"itgr" &&
496 is_array($g[
"ref_ids"])) {
497 foreach ($g[
"ref_ids"] as $ref_id) {
498 if (isset($group[$ref_id])) {
499 foreach ($group[$ref_id] as $k => $item) {
500 if (!in_array($item[
"child"], $done)) {
502 $done[] = $item[
"child"];
523 if (!
$rbacsystem->checkAccess(
"read", $a_parent_node_id)) {
532 $childs = parent::getChildsOfNode($a_parent_node_id);
535 $this->parent_node_id[$c[
"child"]] = $a_parent_node_id;
536 $this->node_data[$c[
"child"]] =
$c;
561 switch ($a_node[
"type"]) {
563 if (!
$rbacsystem->checkAccess(
"read", $a_node[
"child"])) {
567 $query = sprintf(
"SELECT * FROM tst_tests WHERE obj_fi=%s", $obj_id);
570 return (
bool)
$row->complete;
575 if (!
$rbacsystem->checkAccess(
"read", $a_node[
"child"])) {
579 $query = sprintf(
"SELECT * FROM svy_svy WHERE obj_fi=%s", $obj_id);
582 return (
bool)
$row->complete;
588 if (
$rbacsystem->checkAccess(
"read", $a_node[
"child"])) {
597 include_once(
'./Services/ContainerReference/classes/class.ilContainerReferenceAccess.php');
601 return $rbacsystem->checkAccess(
"read", $a_node[
"child"]);
605 if (
$rbacsystem->checkAccess(
"read", $a_node[
"child"])) {
607 if ($a_node[
"type"] ==
"lm") {
608 include_once(
"./Modules/LearningModule/classes/class.ilObjLearningModule.php");
610 if (($lm_obj->getOfflineStatus()) && (!
$rbacsystem->checkAccess(
'write', $a_node[
"child"]))) {
615 if ($a_node[
"type"] ==
"htlm") {
616 include_once(
"./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLM.php");
618 if (($lm_obj->getOfflineStatus()) && (!
$rbacsystem->checkAccess(
'write', $a_node[
"child"]))) {
623 if ($a_node[
"type"] ==
"sahs") {
624 include_once(
"./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php");
626 if (($lm_obj->getOfflineStatus()) && (!
$rbacsystem->checkAccess(
'write', $a_node[
"child"]))) {
631 if ($a_node[
"type"] ==
"glo") {
633 include_once(
"./Modules/Glossary/classes/class.ilObjGlossary.php");
635 (!
$rbacsystem->checkAccess(
'write', $a_node[
"child"]))) {
getParentCourseOrGroup($node_id)
Get upper course or group.
Class ilObjLearningModule.
getNodeIconAlt($a_node)
Get node icon alt text.
getRootNode()
Get root node.
__construct($a_parent_obj, $a_parent_cmd)
Constructor.
static _getItemsOfContainer($a_ref_id)
static _getStaticLink( $a_ref_id, $a_type='', $a_fallback_goto=true, $append="")
Get static link.
setSkipRootNode($a_val)
Set skip root node.
File Based Learning Module (HTML) object.
getChildsOfNode($a_parent_node_id)
Get childs of node.
setPathOpen($a_id)
Set node path to be opened.
isNodeHighlighted($a_node)
Is node highlighted?
getNodeHref($a_node)
Get href for node.
setTypeWhiteList($a_val)
Set type white list.
static _lookupObjectId($a_ref_id)
lookup object id
foreach($_POST as $key=> $value) $res
static _isAccessible($a_ref_id)
Check if target is accessible and not deleted.
static _lookupObjId($a_id)
Repository explorer GUI class.
static _appointmentToString($start, $end, $fulltime)
sortChilds($a_childs, $a_parent_node_id)
Sort childs.
static _checkAllConditionsOfTarget($a_target_ref_id, $a_target_id, $a_target_type="", $a_usr_id=0)
checks wether all conditions of a target object are fulfilled
getNodeId($a_node)
Get id for node.
static _lookupType($a_id, $a_reference=false)
lookup object type
isNodeClickable($a_node)
Is node clickable?
getNodeContent($a_node)
Get node content.
Explorer class that works on tree objects (Services/Tree)
static _lookupAppointment($a_obj_id)
lookup appointment
setOrderField($a_val, $a_numeric=false)
Set order field.
static getItemsByItemGroup($a_item_group_ref_id)
Get materials of item group.
isNodeVisible($a_node)
Is node visible.
static _getInstance($a_obj_id)
get instance by obj_id
setChildLimit($a_val)
Set child limit.
getNodeIcon($a_node)
Get node icon.
Class ilObjSCORMLearningModule.
static _lookupOnline($a_id)
check wether content object is online