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"];
85 $this->top_node_id = self::getTopNodeForRefId($this->cur_ref_id);
93 if (
$ilSetting->get(
"repository_tree_pres") ==
"" ||
94 (
$ilSetting->get(
"rep_tree_limit_grp_crs") && $this->top_node_id == 0)) {
96 } elseif (
$ilSetting->get(
"repository_tree_pres") ==
"all_types") {
98 foreach ($objDefinition->getSubObjectsRecursively(
"root") as $rtype) {
99 if ( !$objDefinition->isSideBlock($rtype[
"name"])) {
100 $white[] = $rtype[
"name"];
105 if ((
int)
$_GET[
"ref_id"] > 0) {
120 if ($this->top_node_id > 0) {
121 $root_node = $this->
getTree()->getNodeData($this->top_node_id);
123 $root_node = parent::getRootNode();
125 $this->node_data[$root_node[
"child"]] = $root_node;
139 $title = $a_node[
"title"];
142 if ($title ==
"ILIAS") {
143 $title =
$lng->txt(
"repository");
145 } elseif ($a_node[
"type"] ==
"sess" &&
148 include_once(
'./Modules/Session/classes/class.ilSessionAppointment.php');
178 $title = $a_node[
"title"];
179 if ($title ==
"ILIAS") {
180 $title =
$lng->txt(
"repository");
197 if ($a_node[
"child"] ==
$_GET[
"ref_id"] ||
214 switch ($a_node[
"type"]) {
216 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $a_node[
"child"]);
217 $link = $ilCtrl->getLinkTargetByClass(
"ilrepositorygui",
"");
218 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
$_GET[
"ref_id"]);
222 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $a_node[
"child"]);
223 $link = $ilCtrl->getLinkTargetByClass(
"ilrepositorygui",
"");
224 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
$_GET[
"ref_id"]);
228 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $a_node[
"child"]);
229 $link = $ilCtrl->getLinkTargetByClass(
"ilrepositorygui",
"redirect");
230 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
$_GET[
"ref_id"]);
234 $ilCtrl->setParameterByClass(
"ilobjgroupgui",
"ref_id", $a_node[
"child"]);
235 $link = $ilCtrl->getLinkTargetByClass(array(
"ilrepositorygui",
"ilobjgroupgui"),
"");
236 $ilCtrl->setParameterByClass(
"ilobjgroupgui",
"ref_id",
$_GET[
"ref_id"]);
240 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $a_node[
"child"]);
241 $link = $ilCtrl->getLinkTargetByClass(
"ilrepositorygui",
"redirect");
242 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
$_GET[
"ref_id"]);
246 $ilCtrl->setParameterByClass(
"ilobjcoursegui",
"ref_id", $a_node[
"child"]);
247 $link = $ilCtrl->getLinkTargetByClass(array(
"ilrepositorygui",
"ilobjcoursegui"),
"view");
248 $ilCtrl->setParameterByClass(
"ilobjcoursegui",
"ref_id",
$_GET[
"ref_id"]);
252 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $a_node[
"child"]);
253 $link = $ilCtrl->getLinkTargetByClass(
"ilrepositorygui",
"redirect");
254 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
$_GET[
"ref_id"]);
258 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $a_node[
"child"]);
259 $link = $ilCtrl->getLinkTargetByClass(
"ilrepositorygui",
"infoScreen");
260 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
$_GET[
"ref_id"]);
264 $ilCtrl->setParameterByClass(
"ilobjstudyprogrammegui",
"ref_id", $a_node[
"child"]);
265 $link = $ilCtrl->getLinkTargetByClass(array(
"ilrepositorygui",
"ilobjstudyprogrammegui"),
"view");
266 $ilCtrl->setParameterByClass(
"ilobjstudyprogrammegui",
"ref_id",
$_GET[
"ref_id"]);
269 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $a_node[
"child"]);
270 $link = $ilCtrl->getLinkTargetByClass(
"ilrepositorygui",
"redirect");
271 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
$_GET[
"ref_id"]);
275 include_once(
'./Services/Link/classes/class.ilLink.php');
293 if (!$ilAccess->checkAccess(
'visible',
'', $a_node[
"child"])) {
297 if (
$ilSetting->get(
"repository_tree_pres") ==
"all_types") {
304 if ($container_parent_id > 0) {
306 if ($container_parent_id != $a_node[
"child"]) {
308 if (!isset($this->session_materials[$container_parent_id])) {
309 include_once
'./Modules/Session/classes/class.ilEventItems.php';
312 if (in_array($a_node[
"child"], $this->session_materials[$container_parent_id])) {
330 $current_node_id = $node_id;
331 while (isset($this->parent_node_id[$current_node_id])) {
333 if (isset($this->node_data[
$parent_node_id]) && in_array($this->node_data[$parent_node_id][
"type"], [
"grp",
"crs"])) {
356 if ($parent_obj_id > 0) {
359 $parent_type =
"dummy";
360 $this->type_grps[
"dummy"] = array(
"root" =>
"dummy");
365 $this->type_grps = array();
367 if (empty($this->type_grps[$parent_type])) {
368 $this->type_grps[$parent_type] =
369 $objDefinition->getGroupedRepositoryObjectTypes($parent_type);
373 include_once(
'./Services/Object/classes/class.ilObjectActivation.php');
376 $in_any_group = array();
377 foreach ($a_childs as $child) {
379 if ($child[
"type"] ==
"itgr") {
380 $g = $child[
"child"];
384 $this->type_grps[$parent_type][
"itgr"][
"ref_ids"][] = $g;
387 $may_read = $ilAccess->checkAccess(
'read',
'', $g);
391 include_once(
"./Services/Container/classes/class.ilContainerSorting.php");
395 foreach ($items as $item) {
396 $in_any_group[] = $item[
"child"];
399 $igroup[$g][] = $item;
400 $group[$g][] = $item;
407 $g = $objDefinition->getGroupOfObj($child[
"type"]);
411 $group[$g][] = $child;
415 $in_any_group = array_unique($in_any_group);
418 include_once(
"./Services/Container/classes/class.ilContainerSorting.php");
420 $block_pos = $sort->getBlockPositions();
421 if (is_array($block_pos) && count($block_pos) > 0) {
422 $tmp = $this->type_grps[$parent_type];
424 $this->type_grps[$parent_type] = array();
425 foreach ($block_pos as $block_type) {
427 if (!is_numeric($block_type) &&
428 array_key_exists($block_type, $tmp)) {
429 $this->type_grps[$parent_type][$block_type] = $tmp[$block_type];
430 unset($tmp[$block_type]);
435 $this->type_grps[$parent_type][$block_type] = array();
441 foreach ($tmp as $block_type => $grp) {
442 $this->type_grps[$parent_type][$block_type] = $grp;
452 foreach ($this->type_grps[$parent_type] as $t => $g) {
454 if (is_array($group[$t])) {
457 if (is_array($igroup[$t])) {
458 foreach ($igroup[$t] as $k => $item) {
459 if (!in_array($item[
"child"], $done)) {
461 $done[] = $item[
"child"];
466 include_once(
"./Services/Container/classes/class.ilContainer.php");
467 include_once(
"./Services/Container/classes/class.ilContainerSorting.php");
469 $group = $sort->sortItems($group);
473 foreach ($group[$t] as $k => $v) {
475 $group[$t][$k][
"start"] = $app_info[
"start"];
480 foreach ($group[$t] as $k => $item) {
481 if (!in_array($item[
"child"], $done) &&
482 !in_array($item[
"child"], $in_any_group)) {
484 $done[] = $item[
"child"];
490 elseif ($t ==
"itgr" &&
491 is_array($g[
"ref_ids"])) {
492 foreach ($g[
"ref_ids"] as $ref_id) {
493 if (isset($group[$ref_id])) {
494 foreach ($group[$ref_id] as $k => $item) {
495 if (!in_array($item[
"child"], $done)) {
497 $done[] = $item[
"child"];
510 if (!$this->obj_definition->isContainer($a_node[
"type"] ??
"")) {
513 return parent::nodeHasVisibleChilds($a_node);
526 if (!
$rbacsystem->checkAccess(
"read", $a_parent_node_id)) {
535 $childs = parent::getChildsOfNode($a_parent_node_id);
538 $this->parent_node_id[$c[
"child"]] = $a_parent_node_id;
539 $this->node_data[$c[
"child"]] =
$c;
562 && !
$rbacsystem->checkAccess(
'write', $a_node[
"child"])
567 switch ($a_node[
"type"]) {
569 if (!
$rbacsystem->checkAccess(
"read", $a_node[
"child"])) {
573 $query = sprintf(
"SELECT * FROM tst_tests WHERE obj_fi=%s", $obj_id);
576 return (
bool) $row->complete;
581 if (!
$rbacsystem->checkAccess(
"read", $a_node[
"child"])) {
585 $query = sprintf(
"SELECT * FROM svy_svy WHERE obj_fi=%s", $obj_id);
588 return (
bool) $row->complete;
594 if (
$rbacsystem->checkAccess(
"read", $a_node[
"child"])) {
603 include_once(
'./Services/ContainerReference/classes/class.ilContainerReferenceAccess.php');
607 return $rbacsystem->checkAccess(
"read", $a_node[
"child"]);
611 if (
$rbacsystem->checkAccess(
"read", $a_node[
"child"])) {
613 if ($a_node[
"type"] ==
"lm") {
614 include_once(
"./Modules/LearningModule/classes/class.ilObjLearningModule.php");
616 if (($lm_obj->getOfflineStatus()) && (!
$rbacsystem->checkAccess(
'write', $a_node[
"child"]))) {
621 if ($a_node[
"type"] ==
"htlm") {
622 include_once(
"./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLM.php");
624 if (($lm_obj->getOfflineStatus()) && (!
$rbacsystem->checkAccess(
'write', $a_node[
"child"]))) {
629 if ($a_node[
"type"] ==
"sahs") {
630 include_once(
"./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php");
632 if (($lm_obj->getOfflineStatus()) && (!
$rbacsystem->checkAccess(
'write', $a_node[
"child"]))) {
637 if ($a_node[
"type"] ==
"glo") {
640 (!
$rbacsystem->checkAccess(
'write', $a_node[
"child"]))) {
657 $setting = $DIC->settings();
658 $tree = $DIC->repositoryTree();
661 if ($setting->get(
"rep_tree_limit_grp_crs") && $ref_id > 0) {
662 $path =
$tree->getPathId($ref_id);
663 foreach ($path as
$n) {
static _getIcon( $a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
getParentCourseOrGroup($node_id)
Get upper course or group.
Class ilObjLearningModule.
static getTopNodeForRefId(int $ref_id)
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.
nodeHasVisibleChilds($a_node)
setNodeOpen($a_id)
Set node to be opened (additional custom opened node, not standard expand behaviour) ...
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)
__construct(Container $dic, ilPlugin $plugin)
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