53 $this->tree = $DIC->repositoryTree();
55 $this->obj_definition = $DIC[
"objDefinition"];
56 $this->
lng = $DIC->language();
57 $this->
ctrl = $DIC->ctrl();
58 $this->
access = $DIC->access();
59 $this->rbacsystem = $DIC->rbac()->system();
60 $this->db = $DIC->database();
61 $this->
user = $DIC->user();
62 $tree = $DIC->repositoryTree();
64 $objDefinition = $DIC[
"objDefinition"];
65 $this->request = $DIC->repository()->internal()->gui()->standardRequest();
67 $this->cur_ref_id = $this->request->getRefId();
68 $this->top_node_id = self::getTopNodeForRefId($this->cur_ref_id);
76 if (
$ilSetting->get(
"repository_tree_pres") ==
"" ||
77 (
$ilSetting->get(
"rep_tree_limit_grp_crs") && $this->top_node_id === 0)) {
79 } elseif (
$ilSetting->get(
"repository_tree_pres") ===
"all_types") {
81 foreach ($objDefinition->getSubObjectsRecursively(
"root") as $rtype) {
82 if ( !$objDefinition->isSideBlock($rtype[
"name"])) {
83 $white[] = $rtype[
"name"];
89 if ($this->cur_ref_id > 0) {
98 if ($this->top_node_id > 0) {
99 $root_node = $this->
getTree()->getNodeData($this->top_node_id);
101 $root_node = parent::getRootNode();
103 $this->node_data[$root_node[
"child"]] = $root_node;
111 $title = $a_node[
"title"];
114 if ($title ===
"ILIAS") {
115 $title =
$lng->
txt(
"repository");
117 } elseif ($a_node[
"type"] ===
"sess" &&
137 $title = $a_node[
"title"];
138 if ($title ===
"ILIAS") {
139 $title =
$lng->
txt(
"repository");
150 if ((
int) $a_node[
"child"] === $this->cur_ref_id ||
151 ($this->cur_ref_id === 0 && (
int) $a_node[
"child"] === (
int) $this->
getNodeId($this->
getRootNode()))) {
161 switch ($a_node[
"type"]) {
165 $link = $ilCtrl->getLinkTargetByClass(
"ilrepositorygui",
"");
166 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $this->cur_ref_id);
173 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $a_node[
"child"]);
174 $link = $ilCtrl->getLinkTargetByClass(
"ilrepositorygui",
"redirect");
175 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $this->cur_ref_id);
179 $ilCtrl->setParameterByClass(
"ilobjgroupgui",
"ref_id", $a_node[
"child"]);
180 $link = $ilCtrl->getLinkTargetByClass([
"ilrepositorygui",
"ilobjgroupgui"],
"");
181 $ilCtrl->setParameterByClass(
"ilobjgroupgui",
"ref_id", $this->cur_ref_id);
185 $ilCtrl->setParameterByClass(
"ilobjcoursegui",
"ref_id", $a_node[
"child"]);
186 $link = $ilCtrl->getLinkTargetByClass([
"ilrepositorygui",
"ilobjcoursegui"],
"view");
187 $ilCtrl->setParameterByClass(
"ilobjcoursegui",
"ref_id", $this->cur_ref_id);
191 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $a_node[
"child"]);
192 $link = $ilCtrl->getLinkTargetByClass(
"ilrepositorygui",
"infoScreen");
193 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $this->cur_ref_id);
197 $ilCtrl->setParameterByClass(
"ilobjstudyprogrammegui",
"ref_id", $a_node[
"child"]);
198 $link = $ilCtrl->getLinkTargetByClass([
"ilrepositorygui",
"ilobjstudyprogrammegui"],
"view");
199 $ilCtrl->setParameterByClass(
"ilobjstudyprogrammegui",
"ref_id", $this->cur_ref_id);
214 if (!$ilAccess->checkAccess(
'visible',
'', $a_node[
"child"])) {
218 if (
$ilSetting->get(
"repository_tree_pres") ===
"all_types") {
225 if ($container_parent_id > 0) {
227 if ($container_parent_id !== (
int) $a_node[
"child"]) {
229 if (!isset($this->session_materials[$container_parent_id])) {
232 if (in_array($a_node[
"child"], $this->session_materials[$container_parent_id])) {
244 $current_node_id = $node_id;
245 while (isset($this->parent_node_id[$current_node_id])) {
246 $parent_node_id = $this->parent_node_id[$current_node_id];
247 if (isset($this->node_data[$parent_node_id]) && in_array($this->node_data[$parent_node_id][
"type"], [
"grp",
"crs"])) {
256 public function sortChilds(array $a_childs, $a_parent_node_id): array
262 if ($parent_obj_id > 0) {
265 $parent_type =
"dummy";
266 $this->type_grps[
"dummy"] = [
"root" =>
"dummy"];
271 $this->type_grps = [];
273 $this->type_grps[$parent_type] =
274 $objDefinition::getGroupedRepositoryObjectTypes($parent_type);
280 foreach ($a_childs as $child) {
282 if ($child[
"type"] ===
"itgr") {
283 $g = $child[
"child"];
287 $this->type_grps[$parent_type][
"itgr"][
"ref_ids"][] = $g;
290 $may_read = $ilAccess->checkAccess(
'read',
'', $g);
297 foreach ($items as $item) {
298 $in_any_group[] = $item[
"child"];
301 $igroup[$g][] = $item;
302 $group[$g][] = $item;
309 $g = $objDefinition->getGroupOfObj($child[
"type"]);
313 $group[$g][] = $child;
317 $in_any_group = array_unique($in_any_group);
321 $block_pos = $sort->getBlockPositions();
322 if (is_array($block_pos) && count($block_pos) > 0) {
323 $tmp = $this->type_grps[$parent_type];
325 $this->type_grps[$parent_type] = [];
326 foreach ($block_pos as $block_type) {
328 if (!is_numeric($block_type) &&
329 array_key_exists($block_type, $tmp)) {
330 $this->type_grps[$parent_type][$block_type] = $tmp[$block_type];
331 unset($tmp[$block_type]);
336 $this->type_grps[$parent_type][$block_type] = [];
342 foreach ($tmp as $block_type => $grp) {
343 $this->type_grps[$parent_type][$block_type] = $grp;
353 foreach ($this->type_grps[$parent_type] as $t => $g) {
355 if (isset($group[$t]) && is_array($group[$t])) {
358 if (isset($igroup[$t]) && is_array($igroup[$t])) {
359 foreach ($igroup[$t] as $k => $item) {
360 if (!in_array($item[
"child"], $done)) {
362 $done[] = $item[
"child"];
368 $group = $sort->sortItems($group);
372 foreach ($group[$t] as $k => $v) {
374 $group[$t][$k][
"start"] = $app_info[
"start"];
379 foreach ($group[$t] as $k => $item) {
380 if (!in_array($item[
"child"], $done) &&
381 !in_array($item[
"child"], $in_any_group)) {
383 $done[] = $item[
"child"];
389 elseif ($t ===
"itgr" &&
390 isset($g[
"ref_ids"]) &&
391 is_array($g[
"ref_ids"])) {
392 foreach ($g[
"ref_ids"] as
$ref_id) {
393 if (isset($group[$ref_id])) {
394 foreach ($group[$ref_id] as $k => $item) {
395 if (!in_array($item[
"child"], $done)) {
397 $done[] = $item[
"child"];
414 if (!$this->obj_definition->isContainer($a_node[
"type"] ??
"")) {
417 return parent::nodeHasVisibleChilds($a_node);
424 if (!$rbacsystem->
checkAccess(
"read", $a_parent_node_id)) {
433 $childs = parent::getChildsOfNode($a_parent_node_id);
436 $this->parent_node_id[$c[
"child"]] = $a_parent_node_id;
437 $this->node_data[$c[
"child"]] =
$c;
451 && !$rbacsystem->
checkAccess(
'write', $a_node[
"child"])
456 switch ($a_node[
"type"]) {
458 if (!$rbacsystem->
checkAccess(
"read", $a_node[
"child"])) {
462 $query = sprintf(
"SELECT * FROM tst_tests WHERE obj_fi=%s", $obj_id);
465 return (
bool) $row->complete;
470 if (!$rbacsystem->
checkAccess(
"read", $a_node[
"child"])) {
474 $query = sprintf(
"SELECT * FROM svy_svy WHERE obj_fi=%s", $obj_id);
477 return (
bool) $row->complete;
483 if ($rbacsystem->
checkAccess(
"read", $a_node[
"child"])) {
493 return $rbacsystem->
checkAccess(
"read", $a_node[
"child"]);
497 return $rbacsystem->
checkAccess(
"read", $a_node[
"child"]) ||
498 $rbacsystem->
checkAccess(
"join", $a_node[
"child"]);
502 if ($rbacsystem->
checkAccess(
"read", $a_node[
"child"])) {
504 if ($a_node[
"type"] ===
"lm") {
506 if (($lm_obj->getOfflineStatus()) && (!$rbacsystem->
checkAccess(
'write', $a_node[
"child"]))) {
511 if ($a_node[
"type"] ===
"htlm") {
513 if (($lm_obj->getOfflineStatus()) && (!$rbacsystem->
checkAccess(
'write', $a_node[
"child"]))) {
518 if ($a_node[
"type"] ===
"sahs") {
520 if (($lm_obj->getOfflineStatus()) && (!$rbacsystem->
checkAccess(
'write', $a_node[
"child"]))) {
525 if ($a_node[
"type"] ===
"glo") {
528 (!$rbacsystem->
checkAccess(
'write', $a_node[
"child"]))) {
543 $setting = $DIC->settings();
544 $tree = $DIC->repositoryTree();
547 if ($ref_id > 0 && $setting->get(
"rep_tree_limit_grp_crs")) {
549 foreach (
$path as $n) {
getParentCourseOrGroup(int $node_id)
setSkipRootNode(bool $a_val)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static getTopNodeForRefId(int $ref_id)
static _lookupOnline(int $a_id)
setTypeWhiteList(array $a_val)
Set type white list.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getChildsOfNode($a_parent_node_id)
setParameterByClass(string $a_class, string $a_parameter, $a_value)
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)
static _getItemsOfContainer(int $a_ref_id)
static _lookupObjId(int $ref_id)
checkAccess(string $a_operations, int $a_ref_id, string $a_type="")
checkAccess represents the main method of the RBAC-system in ILIAS3 developers want to use With this ...
parses the objects.xml it handles the xml-description of all ilias objects
static _lookupAppointment(int $a_obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Repository explorer GUI class.
static _getStaticLink(?int $a_ref_id, string $a_type='', bool $a_fallback_goto=true, string $append="")
Get static link.
static _lookupObjectId(int $ref_id)
getNodeId($a_node)
Get id for node.
static getItemsByItemGroup(int $item_group_ref_id)
Get materials of item group.
StandardGUIRequest $request
static _appointmentToString(int $start, int $end, bool $fulltime)
getPathId(int $a_endnode_id, int $a_startnode_id=0)
get path from a given startnode to a given endnode if startnode is not given the rootnode is startnod...
static _checkAllConditionsOfTarget(int $a_target_ref_id, int $a_target_id, string $a_target_type="", int $a_usr_id=0)
checks wether all conditions of a target object are fulfilled
Explorer class that works on tree objects (Services/Tree)
__construct(Container $dic, ilPlugin $plugin)
static _getInstance(int $a_obj_id)
setOrderField(string $a_val, bool $a_numeric=false)
static _isAccessible(int $a_ref_id)
Check if target is accessible and not deleted.
static _lookupType(int $id, bool $reference=false)
setChildLimit(int $a_val)
sortChilds(array $a_childs, $a_parent_node_id)
Class ilObjSCORMLearningModule.
__construct(string $a_expl_id, $a_parent_obj, string $a_parent_cmd, ilTree $a_tree, string $a_node_parameter_name="node_id")
ilObjectDefinition $obj_definition
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)