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);
213 if (!$ilAccess->checkAccess(
'visible',
'', $a_node[
"child"])) {
217 if (
$ilSetting->get(
"repository_tree_pres") ===
"all_types") {
224 if ($container_parent_id > 0) {
226 if ($container_parent_id !== (
int) $a_node[
"child"]) {
228 if (!isset($this->session_materials[$container_parent_id])) {
231 if (in_array($a_node[
"child"], $this->session_materials[$container_parent_id])) {
243 $current_node_id = $node_id;
244 while (isset($this->parent_node_id[$current_node_id])) {
245 $parent_node_id = $this->parent_node_id[$current_node_id];
246 if (isset($this->node_data[$parent_node_id]) && in_array($this->node_data[$parent_node_id][
"type"], [
"grp",
"crs"])) {
255 public function sortChilds(array $a_childs, $a_parent_node_id): array
261 if ($parent_obj_id > 0) {
264 $parent_type =
"dummy";
265 $this->type_grps[
"dummy"] = [
"root" =>
"dummy"];
270 $this->type_grps = [];
272 $this->type_grps[$parent_type] =
273 $objDefinition::getGroupedRepositoryObjectTypes($parent_type);
279 foreach ($a_childs as $child) {
281 if ($child[
"type"] ===
"itgr") {
282 $g = $child[
"child"];
286 $this->type_grps[$parent_type][
"itgr"][
"ref_ids"][] = $g;
289 $may_read = $ilAccess->checkAccess(
'read',
'', $g);
296 foreach ($items as $item) {
297 $in_any_group[] = $item[
"child"];
300 $igroup[$g][] = $item;
301 $group[$g][] = $item;
308 $g = $objDefinition->getGroupOfObj($child[
"type"]);
312 $group[$g][] = $child;
316 $in_any_group = array_unique($in_any_group);
320 $block_pos = $sort->getBlockPositions();
321 if (is_array($block_pos) && count($block_pos) > 0) {
322 $tmp = $this->type_grps[$parent_type];
324 $this->type_grps[$parent_type] = [];
325 foreach ($block_pos as $block_type) {
327 if (!is_numeric($block_type) &&
328 array_key_exists($block_type, $tmp)) {
329 $this->type_grps[$parent_type][$block_type] = $tmp[$block_type];
330 unset($tmp[$block_type]);
335 $this->type_grps[$parent_type][$block_type] = [];
341 foreach ($tmp as $block_type => $grp) {
342 $this->type_grps[$parent_type][$block_type] = $grp;
352 foreach ($this->type_grps[$parent_type] as $t => $g) {
354 if (isset($group[$t]) && is_array($group[$t])) {
357 if (isset($igroup[$t]) && is_array($igroup[$t])) {
358 foreach ($igroup[$t] as $k => $item) {
359 if (!in_array($item[
"child"], $done)) {
361 $done[] = $item[
"child"];
367 $group = $sort->sortItems($group);
371 foreach ($group[$t] as $k => $v) {
373 $group[$t][$k][
"start"] = $app_info[
"start"];
378 foreach ($group[$t] as $k => $item) {
379 if (!in_array($item[
"child"], $done) &&
380 !in_array($item[
"child"], $in_any_group)) {
382 $done[] = $item[
"child"];
388 elseif ($t ===
"itgr" &&
389 isset($g[
"ref_ids"]) &&
390 is_array($g[
"ref_ids"])) {
391 foreach ($g[
"ref_ids"] as
$ref_id) {
392 if (isset($group[$ref_id])) {
393 foreach ($group[$ref_id] as $k => $item) {
394 if (!in_array($item[
"child"], $done)) {
396 $done[] = $item[
"child"];
413 if (!$this->obj_definition->isContainer($a_node[
"type"] ??
"")) {
416 return parent::nodeHasVisibleChilds($a_node);
423 if (!$rbacsystem->
checkAccess(
"read", $a_parent_node_id)) {
432 $childs = parent::getChildsOfNode($a_parent_node_id);
435 $this->parent_node_id[$c[
"child"]] = $a_parent_node_id;
436 $this->node_data[$c[
"child"]] =
$c;
445 $this->
access->checkAccess(
"read",
"", (
int) $a_node[
"child"]) ||
446 $this->
access->checkAccess(
"join",
"", (
int) $a_node[
"child"]);
453 $setting = $DIC->settings();
454 $tree = $DIC->repositoryTree();
457 if ($ref_id > 0 && $setting->get(
"rep_tree_limit_grp_crs")) {
459 foreach (
$path as $n) {
getParentCourseOrGroup(int $node_id)
setSkipRootNode(bool $a_val)
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)
setTypeWhiteList(array $a_val)
Set type white list.
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 ...
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="")
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 _lookupType(int $id, bool $reference=false)
setChildLimit(int $a_val)
sortChilds(array $a_childs, $a_parent_node_id)
__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)