4 include_once(
"./Services/Table/classes/class.ilTableGUI.php");
5 include_once(
"classes/class.ilTabsGUI.php");
6 include_once(
"Services/Payment/classes/class.ilPaymentObject.php");
52 $this->objDefinition =& $objDefinition;
56 $this->creation_mode =
false;
58 $this->ctrl->saveParameter($this, array(
"ref_id"));
60 $this->ctrl->setReturn($this,
"");
63 if (!empty($_GET[
"ref_id"]) || $this->ctrl->getCmd() ==
"showTree")
65 $this->cur_ref_id = $_GET[
"ref_id"];
70 if (!empty(
$_SESSION[
"il_rep_ref_id"]) && !empty($_GET[
"getlast"]))
72 $this->cur_ref_id =
$_SESSION[
"il_rep_ref_id"];
77 $this->cur_ref_id = $this->tree->getRootId();
79 if ($_GET[
"cmd"] !=
"" && $_GET[
"cmd"] !=
"frameset")
82 $get_str = $post_str =
"";
83 foreach($_GET as $key => $value)
85 $get_str.=
"-$key:$value";
87 foreach(
$_POST as $key => $value)
89 $post_str.=
"-$key:$value";
91 $ilLog->write(
"Repository: command called without ref_id.".
92 "GET:".$get_str.
"-POST:".$post_str, $ilLog->WARNING);
96 $this->ctrl->setCmd(
"frameset");
100 if (!$tree->isInTree($this->cur_ref_id) && $this->ctrl->getCmd() !=
"showTree")
102 $this->cur_ref_id = $this->tree->getRootId();
106 if ($_GET[
"cmd"] !=
"" && $_GET[
"cmd"] !=
"frameset")
108 $get_str = $post_str =
"";
109 foreach($_GET as $key => $value)
111 $get_str.=
"-$key:$value";
113 foreach(
$_POST as $key => $value)
115 $post_str.=
"-$key:$value";
117 $ilLog->write(
"Repository: command called with ref_id that is not in tree.".
118 "GET:".$get_str.
"-POST:".$post_str, $ilLog->WARNING);
122 $this->ctrl->setCmd(
"frameset");
126 if (!empty($_GET[
"set_mode"]))
128 $_SESSION[
"il_rep_mode"] = $_GET[
"set_mode"];
129 if ($this->ilias->account->getId() != ANONYMOUS_USER_ID)
131 $this->ilias->account->writePref(
"il_rep_mode", $_GET[
"set_mode"]);
138 if ($this->ilias->account->getId() != ANONYMOUS_USER_ID)
140 $_SESSION[
"il_rep_mode"] = $this->ilias->account->getPref(
"il_rep_mode");
147 $_SESSION[
"il_rep_mode"] = $this->ilias->getSetting(
"default_repository_view");
150 $this->mode = (
$_SESSION[
"il_rep_mode"] !=
"")
155 if ($this->ctrl->getCmd() !=
"showTree" &&
156 $rbacsystem->checkAccess(
"read", $this->cur_ref_id))
178 if($ilUser->getProfileIncomplete())
185 if( $ilUser->isPasswordChangeDemanded() || $ilUser->isPasswordExpired() )
192 $new_type = (
$_POST[
"new_type"] !=
"" && $ilCtrl->getCmd() ==
"create")
196 if ($new_type !=
"" && $new_type !=
"sty")
198 $this->creation_mode =
true;
202 $cmd = $this->ctrl->getCmd();
203 if ((
$cmd ==
"frameset" ||
$_GET[
"rep_frame"] == 1) &&
$_SESSION[
"il_rep_mode"] ==
"tree")
208 else if (
$cmd ==
"frameset" &&
$_SESSION[
"il_rep_mode"] !=
"tree")
210 $this->ctrl->setCmd(
"");
215 if (
$cmd !=
"frameset")
217 if ($this->creation_mode)
219 $obj_type = $new_type;
220 $class_name = $this->objDefinition->getClassName($obj_type);
221 if (strtolower($class_name) !=
"user")
223 $next_class = strtolower(
"ilObj".$class_name.
"GUI");
227 $next_class = $this->ctrl->getNextClass();
235 if($this->ctrl->getNextClass() != strtolower(
'ilObj'.$class_name.
'GUI'))
237 $this->ctrl->setCmdClass($next_class);
240 else if ((($next_class = $this->ctrl->getNextClass($this)) ==
"")
241 || ($next_class ==
"ilrepositorygui" && $this->ctrl->getCmd() ==
"return"))
243 if (
$cmd !=
"frameset" &&
$cmd !=
"showTree")
247 $class_name = $this->objDefinition->getClassName($obj_type);
248 $next_class = strtolower(
"ilObj".$class_name.
"GUI");
250 $this->ctrl->setCmdClass($next_class);
251 if ($this->ctrl->getCmd() ==
"return")
253 $this->ctrl->setCmd(
"");
262 if (
$cmd ==
"showTree")
272 if ($next_class !=
"" && $next_class !=
"ilrepositorygui")
274 $class_path = $this->ctrl->lookupClassPath($next_class);
276 include_once($class_path);
277 $class_name = $this->ctrl->getClassForClasspath($class_path);
278 if (!$this->creation_mode)
280 $this->gui_obj =
new $class_name(
"", $this->cur_ref_id,
true,
false);
285 if ($class_name ==
'ilObjiLincClassroomGUI')
287 $this->gui_obj =
new $class_name(
"", $this->cur_ref_id,
true,
false);
291 $this->gui_obj =
new $class_name(
"", 0,
true,
false);
297 $tabs_out = ($new_type ==
"")
302 $this->gui_obj->setCreationMode($this->creation_mode);
303 $this->ctrl->setReturn($this,
"return");
310 if (
$cmd ==
"frameset")
318 $this->ctrl->setCmd(
"");
322 if (
$cmd ==
"showTree")
328 $cmd = $this->ctrl->getCmd(
"");
331 if ($this->cur_ref_id > 0 && !$rbacsystem->checkAccess(
"read", $this->cur_ref_id))
334 $ilias->raiseError($lng->txt(
"permission_denied"), $ilias->error_obj->MESSAGE);
351 $ret =& $this->ctrl->forwardCommand($this->gui_obj);
352 $this->tpl->setVariable(
"OBJECTS", $this->gui_obj->getHTML());
364 include_once(
"Services/Frameset/classes/class.ilFramesetGUI.php");
367 if (
$_GET[
"rep_frame"] == 1)
370 $anchor = (
$_GET[
"anchor"] !=
"")
371 ?
"#".
$_GET[
"anchor"]
373 $fs_gui->setMainFrameSource(
374 str_replace(
"rep_frame",
"rep_frame_done", $_SERVER[
"REQUEST_URI"]).$anchor);
378 $fs_gui->setMainFrameSource(
379 "repository.php?getlast=true&ref_id=".$this->cur_ref_id);
381 $fs_gui->setSideFrameSource(
382 "repository.php?cmd=showTree&ref_id=".$this->cur_ref_id);
384 $fs_gui->setSideFrameName(
"tree");
385 $fs_gui->setMainFrameName(
"rep_content");
386 $fs_gui->setFramesetTitle($this->lng->txt(
"repository"));
399 $ilCtrl->setParameter($this,
"active_node",
$_GET[
"active_node"]);
401 $this->tpl =
new ilTemplate(
"tpl.main.html",
true,
true);
404 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.explorer.html");
406 include_once (
"./Services/Repository/classes/class.ilRepositoryExplorer.php");
408 $active_node = (
$_GET[
"active_node"] > 1)
409 ?
$_GET[
"active_node"]
410 : (
$_GET[
"ref_id"] > 1)
414 if ($ilSetting->get(
"rep_tree_limit_grp_crs") && $active_node > 0)
416 $path = $tree->getPathId($active_node);
417 foreach (
$path as $n)
424 array(
"crs",
"grp")))
432 $exp->setUseStandardFrame(
false);
433 $exp->setExpandTarget($ilCtrl->getLinkTarget($this,
"showTree"));
434 $exp->setFrameUpdater(
"tree",
"updater");
435 $exp->setTargetGet(
"ref_id");
437 if (
$_GET[
"repexpand"] ==
"")
439 $expanded = $this->tree->readRootId();
443 $expanded =
$_GET[
"repexpand"];
446 $exp->setExpand($expanded);
448 if ($active_node > 0)
450 $path = $tree->getPathId($active_node);
453 $exp->setForceOpenPath(
$path);
454 $exp->setExpand($expanded);
458 $exp->setForceOpenPath(
$path + array($top_node));
460 $exp->highlightNode($active_node);
466 $head_tpl =
new ilTemplate(
"tpl.cont_tree_head.html",
true,
true,
467 "Services/Repository");
469 $nd = $tree->getNodeData(ROOT_FOLDER_ID);
473 $title = $lng->txt(
"repository");
475 $head_tpl->setVariable(
"IMG_SRC",
$path);
476 $head_tpl->setVariable(
"ALT_IMG", $lng->txt(
"icon").
" ".
$title);
477 $head_tpl->setVariable(
"LINK_TXT",
$title);
478 $head_tpl->setVariable(
"LINK_HREF",
"repository.php?cmd=frameset&ref_id=1");
479 $exp->setTreeLead($head_tpl->get());
481 $exp->initItemCounter(1);
482 $exp->setOutput($tree->getParentId($top_node), 1,
489 $output = $exp->getOutput(
false);
495 if ($ilCtrl->isAsynch())
500 $this->tpl->setCurrentBlock(
"content");
501 $this->tpl->setVariable(
"TXT_EXPLORER_HEADER", $this->lng->txt(
"overview"));
502 $this->tpl->setVariable(
"EXP_REFRESH", $this->lng->txt(
"refresh"));
503 $this->tpl->setVariable(
"EXPLORER",$output);
504 $ilCtrl->setParameter($this,
"repexpand",
$_GET[
"repexpand"]);
505 $this->tpl->setVariable(
"ACTION", $ilCtrl->getLinkTarget($this,
"showTree",
"",
false,
false));
506 $this->tpl->parseCurrentBlock();
507 $this->tpl->show(
false);