4 include_once(
"./Services/UIComponent/Explorer2/classes/class.ilTreeExplorerGUI.php");
68 $this->tree = $DIC->repositoryTree();
70 $this->obj_definition = $DIC[
"objDefinition"];
71 $this->lng = $DIC->language();
72 $this->ctrl = $DIC->ctrl();
73 $this->access = $DIC->access();
74 $this->rbacsystem = $DIC->rbac()->system();
75 $this->db = $DIC->database();
76 $this->
user = $DIC->user();
77 $tree = $DIC->repositoryTree();
79 $objDefinition = $DIC[
"objDefinition"];
81 $this->cur_ref_id = (int)
$_GET[
"ref_id"];
83 $this->top_node_id = 0;
84 if (
$ilSetting->get(
"rep_tree_limit_grp_crs") && $this->cur_ref_id > 0) {
94 $this->top_node_id =
$n;
99 parent::__construct(
"rep_exp", $a_parent_obj, $a_parent_cmd,
$tree);
104 if (
$ilSetting->get(
"repository_tree_pres") ==
"" ||
105 (
$ilSetting->get(
"rep_tree_limit_grp_crs") && $this->top_node_id == 0)) {
107 } elseif (
$ilSetting->get(
"repository_tree_pres") ==
"all_types") {
109 foreach ($objDefinition->getSubObjectsRecursively(
"root") as $rtype) {
110 if ( !$objDefinition->isSideBlock($rtype[
"name"])) {
111 $white[] = $rtype[
"name"];
116 if ((
int)
$_GET[
"ref_id"] > 0) {
129 if ($this->top_node_id > 0) {
130 return $this->
getTree()->getNodeData($this->top_node_id);
132 return parent::getRootNode();
146 $title = $a_node[
"title"];
152 } elseif ($a_node[
"type"] ==
"sess" &&
155 include_once(
'./Modules/Session/classes/class.ilSessionAppointment.php');
186 $title = $a_node[
"title"];
194 return parent::getNodeIconAlt($a_node);
205 if ($a_node[
"child"] ==
$_GET[
"ref_id"] ||
222 switch ($a_node[
"type"]) {
224 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $a_node[
"child"]);
225 $link =
$ilCtrl->getLinkTargetByClass(
"ilrepositorygui",
"");
226 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
$_GET[
"ref_id"]);
230 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $a_node[
"child"]);
231 $link =
$ilCtrl->getLinkTargetByClass(
"ilrepositorygui",
"");
232 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
$_GET[
"ref_id"]);
236 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $a_node[
"child"]);
237 $link =
$ilCtrl->getLinkTargetByClass(
"ilrepositorygui",
"redirect");
238 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
$_GET[
"ref_id"]);
242 $ilCtrl->setParameterByClass(
"ilobjgroupgui",
"ref_id", $a_node[
"child"]);
243 $link =
$ilCtrl->getLinkTargetByClass(
array(
"ilrepositorygui",
"ilobjgroupgui"),
"");
244 $ilCtrl->setParameterByClass(
"ilobjgroupgui",
"ref_id",
$_GET[
"ref_id"]);
248 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $a_node[
"child"]);
249 $link =
$ilCtrl->getLinkTargetByClass(
"ilrepositorygui",
"redirect");
250 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
$_GET[
"ref_id"]);
254 $ilCtrl->setParameterByClass(
"ilobjcoursegui",
"ref_id", $a_node[
"child"]);
255 $link =
$ilCtrl->getLinkTargetByClass(
array(
"ilrepositorygui",
"ilobjcoursegui"),
"view");
256 $ilCtrl->setParameterByClass(
"ilobjcoursegui",
"ref_id",
$_GET[
"ref_id"]);
260 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $a_node[
"child"]);
261 $link =
$ilCtrl->getLinkTargetByClass(
"ilrepositorygui",
"redirect");
262 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
$_GET[
"ref_id"]);
266 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $a_node[
"child"]);
267 $link =
$ilCtrl->getLinkTargetByClass(
"ilrepositorygui",
"infoScreen");
268 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
$_GET[
"ref_id"]);
272 $ilCtrl->setParameterByClass(
"ilobjstudyprogrammegui",
"ref_id", $a_node[
"child"]);
273 $link =
$ilCtrl->getLinkTargetByClass(
array(
"ilrepositorygui",
"ilobjstudyprogrammegui"),
"view");
274 $ilCtrl->setParameterByClass(
"ilobjstudyprogrammegui",
"ref_id",
$_GET[
"ref_id"]);
278 include_once(
'./Services/Link/classes/class.ilLink.php');
296 if (!$ilAccess->checkAccess(
'visible',
'', $a_node[
"child"])) {
301 $container_parent_id =
$tree->checkForParentType($a_node[
"child"],
'grp');
302 if (!$container_parent_id) {
304 $container_parent_id =
$tree->checkForParentType($a_node[
"child"],
'crs');
306 if ($container_parent_id) {
308 if (
$ilSetting->get(
"repository_tree_pres") ==
"all_types" && $container_parent_id != $a_node[
"child"]) {
310 if (!isset($this->session_materials[$container_parent_id])) {
311 include_once
'./Modules/Session/classes/class.ilEventItems.php';
314 if (in_array($a_node[
"child"], $this->session_materials[$container_parent_id])) {
337 if ($parent_obj_id > 0) {
340 $parent_type =
"dummy";
341 $this->type_grps[
"dummy"] =
array(
"root" =>
"dummy");
346 $this->type_grps =
array();
348 if (empty($this->type_grps[$parent_type])) {
349 $this->type_grps[$parent_type] =
350 $objDefinition->getGroupedRepositoryObjectTypes($parent_type);
354 include_once(
'./Services/Object/classes/class.ilObjectActivation.php');
357 $in_any_group =
array();
358 foreach ($a_childs as $child) {
360 if ($child[
"type"] ==
"itgr") {
361 $g = $child[
"child"];
365 $this->type_grps[$parent_type][
"itgr"][
"ref_ids"][] = $g;
368 $may_read = $ilAccess->checkAccess(
'read',
'', $g);
372 include_once(
"./Services/Container/classes/class.ilContainerSorting.php");
376 foreach ($items as $item) {
377 $in_any_group[] = $item[
"child"];
380 $igroup[$g][] = $item;
381 $group[$g][] = $item;
388 $g = $objDefinition->getGroupOfObj($child[
"type"]);
392 $group[$g][] = $child;
396 $in_any_group = array_unique($in_any_group);
399 include_once(
"./Services/Container/classes/class.ilContainerSorting.php");
401 $block_pos = $sort->getBlockPositions();
402 if (is_array($block_pos) && count($block_pos) > 0) {
403 $tmp = $this->type_grps[$parent_type];
405 $this->type_grps[$parent_type] =
array();
406 foreach ($block_pos as $block_type) {
408 if (!is_numeric($block_type) &&
409 array_key_exists($block_type, $tmp)) {
410 $this->type_grps[$parent_type][$block_type] = $tmp[$block_type];
411 unset($tmp[$block_type]);
416 $this->type_grps[$parent_type][$block_type] =
array();
422 foreach ($tmp as $block_type => $grp) {
423 $this->type_grps[$parent_type][$block_type] = $grp;
433 foreach ($this->type_grps[$parent_type] as
$t => $g) {
435 if (is_array($group[
$t])) {
438 if (is_array($igroup[$t])) {
439 foreach ($igroup[$t] as $k => $item) {
440 if (!in_array($item[
"child"], $done)) {
442 $done[] = $item[
"child"];
447 include_once(
"./Services/Container/classes/class.ilContainer.php");
448 include_once(
"./Services/Container/classes/class.ilContainerSorting.php");
450 $group = $sort->sortItems($group);
456 foreach ($group[$t] as $k => $item) {
457 if (!in_array($item[
"child"], $done) &&
458 !in_array($item[
"child"], $in_any_group)) {
460 $done[] = $item[
"child"];
466 elseif ($t ==
"itgr" &&
467 is_array($g[
"ref_ids"])) {
468 foreach ($g[
"ref_ids"] as $ref_id) {
469 if (isset($group[$ref_id])) {
470 foreach ($group[$ref_id] as $k => $item) {
471 if (!in_array($item[
"child"], $done)) {
473 $done[] = $item[
"child"];
494 if (!
$rbacsystem->checkAccess(
"read", $a_parent_node_id)) {
503 return parent::getChildsOfNode($a_parent_node_id);
525 switch ($a_node[
"type"]) {
527 if (!
$rbacsystem->checkAccess(
"read", $a_node[
"child"])) {
531 $query = sprintf(
"SELECT * FROM tst_tests WHERE obj_fi=%s", $obj_id);
534 return (
bool)
$row->complete;
539 if (!
$rbacsystem->checkAccess(
"read", $a_node[
"child"])) {
543 $query = sprintf(
"SELECT * FROM svy_svy WHERE obj_fi=%s", $obj_id);
546 return (
bool)
$row->complete;
552 if (
$rbacsystem->checkAccess(
"read", $a_node[
"child"])) {
561 include_once(
'./Services/ContainerReference/classes/class.ilContainerReferenceAccess.php');
565 return $rbacsystem->checkAccess(
"read", $a_node[
"child"]);
569 if (
$rbacsystem->checkAccess(
"read", $a_node[
"child"])) {
571 if ($a_node[
"type"] ==
"lm") {
572 include_once(
"./Modules/LearningModule/classes/class.ilObjLearningModule.php");
574 if ((!$lm_obj->getOnline()) && (!
$rbacsystem->checkAccess(
'write', $a_node[
"child"]))) {
579 if ($a_node[
"type"] ==
"htlm") {
580 include_once(
"./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLM.php");
582 if ((!$lm_obj->getOnline()) && (!
$rbacsystem->checkAccess(
'write', $a_node[
"child"]))) {
587 if ($a_node[
"type"] ==
"sahs") {
588 include_once(
"./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php");
590 if ((!$lm_obj->getOnline()) && (!
$rbacsystem->checkAccess(
'write', $a_node[
"child"]))) {
595 if ($a_node[
"type"] ==
"glo") {
597 include_once(
"./Modules/Glossary/classes/class.ilObjGlossary.php");
599 (!
$rbacsystem->checkAccess(
'write', $a_node[
"child"]))) {
static _getIcon( $a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
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.
Create styles array
The data for the language used.
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
getNodeIcon($a_node)
Get node icon.
Class ilObjSCORMLearningModule.
static _lookupOnline($a_id)
check wether content object is online