4 include_once(
"./Services/Table/classes/class.ilTableGUI.php");
5 include_once(
"Services/Payment/classes/class.ilPaymentObject.php");
54 $this->objDefinition =& $objDefinition;
58 $this->creation_mode =
false;
60 $this->ctrl->saveParameter($this, array(
"ref_id"));
62 $this->ctrl->setReturn($this,
"");
65 if (!empty($_GET[
"ref_id"]) || $this->ctrl->getCmd() ==
"showTree")
67 $this->cur_ref_id = $_GET[
"ref_id"];
72 if (!empty(
$_SESSION[
"il_rep_ref_id"]) && !empty($_GET[
"getlast"]))
74 $this->cur_ref_id =
$_SESSION[
"il_rep_ref_id"];
79 $this->cur_ref_id = $this->tree->getRootId();
81 if ($_GET[
"cmd"] !=
"" && $_GET[
"cmd"] !=
"frameset")
84 $get_str = $post_str =
"";
85 foreach($_GET as $key => $value)
87 $get_str.=
"-$key:$value";
89 foreach(
$_POST as $key => $value)
91 $post_str.=
"-$key:$value";
93 $ilLog->write(
"Repository: command called without ref_id.".
94 "GET:".$get_str.
"-POST:".$post_str, $ilLog->WARNING);
97 $_GET = array(
"baseClass"=>
"ilRepositoryGUI");
99 $this->ctrl->setCmd(
"frameset");
103 if (!$tree->isInTree($this->cur_ref_id) && $this->ctrl->getCmd() !=
"showTree")
105 $this->cur_ref_id = $this->tree->getRootId();
109 if ($_GET[
"cmd"] !=
"" && $_GET[
"cmd"] !=
"frameset")
111 $get_str = $post_str =
"";
112 foreach($_GET as $key => $value)
114 $get_str.=
"-$key:$value";
116 foreach(
$_POST as $key => $value)
118 $post_str.=
"-$key:$value";
120 $ilLog->write(
"Repository: command called with ref_id that is not in tree.".
121 "GET:".$get_str.
"-POST:".$post_str, $ilLog->WARNING);
125 $this->ctrl->setCmd(
"frameset");
129 if (!empty($_GET[
"set_mode"]))
131 $_SESSION[
"il_rep_mode"] = $_GET[
"set_mode"];
132 if ($this->ilias->account->getId() != ANONYMOUS_USER_ID)
134 $this->ilias->account->writePref(
"il_rep_mode", $_GET[
"set_mode"]);
141 if ($this->ilias->account->getId() != ANONYMOUS_USER_ID)
143 $_SESSION[
"il_rep_mode"] = $this->ilias->account->getPref(
"il_rep_mode");
150 $_SESSION[
"il_rep_mode"] = $this->ilias->getSetting(
"default_repository_view");
153 $this->mode = (
$_SESSION[
"il_rep_mode"] !=
"")
158 if ($this->ctrl->getCmd() !=
"showTree" &&
159 $rbacsystem->checkAccess(
"read", $this->cur_ref_id))
162 if ($type ==
"cat" || $type ==
"grp" || $type ==
"crs"
182 if($ilUser->getProfileIncomplete())
189 if( $ilUser->isPasswordChangeDemanded() || $ilUser->isPasswordExpired() )
196 $new_type = (
$_POST[
"new_type"] !=
"" && $ilCtrl->getCmd() ==
"create")
200 if ($new_type !=
"" && $new_type !=
"sty")
202 $this->creation_mode =
true;
203 $ilHelp->setScreenIdComponent($new_type);
208 $cmd = $this->ctrl->getCmd();
209 if ((
$cmd ==
"frameset" ||
$_GET[
"rep_frame"] == 1) &&
$_SESSION[
"il_rep_mode"] ==
"tree")
214 else if (
$cmd ==
"frameset" &&
$_SESSION[
"il_rep_mode"] !=
"tree")
216 $this->ctrl->setCmd(
"");
221 if (
$cmd !=
"frameset")
223 if ($this->creation_mode)
225 $obj_type = $new_type;
226 $class_name = $this->objDefinition->getClassName($obj_type);
227 if (strtolower($class_name) !=
"user")
229 $next_class = strtolower(
"ilObj".$class_name.
"GUI");
233 $next_class = $this->ctrl->getNextClass();
241 if($this->ctrl->getNextClass() != strtolower(
'ilObj'.$class_name.
'GUI'))
243 $this->ctrl->setCmdClass($next_class);
246 else if ((($next_class = $this->ctrl->getNextClass($this)) ==
"")
247 || ($next_class ==
"ilrepositorygui" && $this->ctrl->getCmd() ==
"return"))
249 if (
$cmd !=
"frameset" &&
$cmd !=
"showTree")
253 $class_name = $this->objDefinition->getClassName($obj_type);
254 $next_class = strtolower(
"ilObj".$class_name.
"GUI");
256 $this->ctrl->setCmdClass($next_class);
257 if ($this->ctrl->getCmd() ==
"return")
259 $this->ctrl->setCmd(
"");
268 if (
$cmd ==
"showTree")
277 if ($next_class !=
"" && $next_class !=
"ilrepositorygui")
279 $class_path = $this->ctrl->lookupClassPath($next_class);
281 require_once($class_path);
282 $class_name = $this->ctrl->getClassForClasspath($class_path);
283 if (!$this->creation_mode)
285 if(is_subclass_of($class_name,
"ilObject2GUI"))
291 $this->gui_obj =
new $class_name(
"", $this->cur_ref_id,
true,
false);
296 if(is_subclass_of($class_name,
"ilObject2GUI"))
301 else if ($class_name ==
'ilObjiLincClassroomGUI')
303 $this->gui_obj =
new $class_name(
"", $this->cur_ref_id,
true,
false);
307 $this->gui_obj =
new $class_name(
"", 0,
true,
false);
313 $tabs_out = ($new_type ==
"")
316 $this->gui_obj->setCreationMode($this->creation_mode);
317 $this->ctrl->setReturn($this,
"return");
324 if (
$cmd ==
"frameset")
332 $this->ctrl->setCmd(
"");
336 if (
$cmd ==
"showTree")
342 $cmd = $this->ctrl->getCmd(
"");
345 if ($this->cur_ref_id > 0 && !$rbacsystem->checkAccess(
"read", $this->cur_ref_id))
348 $ilias->raiseError($lng->txt(
"permission_denied"), $ilias->error_obj->MESSAGE);
365 $ret =& $this->ctrl->forwardCommand($this->gui_obj);
366 $this->tpl->setVariable(
"OBJECTS", $this->gui_obj->getHTML());
378 include_once(
"Services/Frameset/classes/class.ilFramesetGUI.php");
381 if (
$_GET[
"rep_frame"] == 1)
384 $anchor = (
$_GET[
"anchor"] !=
"")
385 ?
"#".
$_GET[
"anchor"]
387 $fs_gui->setMainFrameSource(
388 str_replace(
"rep_frame",
"rep_frame_done", $_SERVER[
"REQUEST_URI"]).$anchor);
392 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $this->cur_ref_id);
393 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"getlast",
"true");
394 if ($ilAccess->checkAccess(
"read",
"", $this->cur_ref_id))
396 $fs_gui->setMainFrameSource(
397 $ilCtrl->getLinkTargetByClass(
"ilrepositorygui",
""));
403 $ilCtrl->redirectByClass(
"ilrepositorygui",
"");
405 $ilCtrl->clearParametersByClass(
"ilrepositorygui");
407 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $this->cur_ref_id);
408 $fs_gui->setSideFrameSource(
409 $ilCtrl->getLinkTargetByClass(
"ilrepositorygui",
"showTree"));
410 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
$_GET[
"ref_id"]);
412 $fs_gui->setSideFrameName(
"tree");
413 $fs_gui->setMainFrameName(
"rep_content");
414 $fs_gui->setFramesetTitle($this->lng->txt(
"repository"));
427 $ilCtrl->setParameter($this,
"active_node",
$_GET[
"active_node"]);
429 $this->tpl =
new ilTemplate(
"tpl.main.html",
true,
true);
432 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.explorer.html");
434 include_once (
"./Services/Repository/classes/class.ilRepositoryExplorer.php");
436 $active_node = (
$_GET[
"active_node"] > 1)
437 ?
$_GET[
"active_node"]
438 : (
$_GET[
"ref_id"] > 1)
442 if ($ilSetting->get(
"rep_tree_limit_grp_crs") && $active_node > 0)
444 $path = $tree->getPathId($active_node);
452 array(
"crs",
"grp")))
460 $exp->setUseStandardFrame(
false);
461 $exp->setExpandTarget($ilCtrl->getLinkTarget($this,
"showTree"));
462 $exp->setFrameUpdater(
"tree",
"updater");
463 $exp->setTargetGet(
"ref_id");
465 if (
$_GET[
"repexpand"] ==
"")
467 $expanded = $this->tree->readRootId();
471 $expanded =
$_GET[
"repexpand"];
474 $exp->setExpand($expanded);
476 if ($active_node > 0)
478 $path = $tree->getPathId($active_node);
481 $exp->setForceOpenPath(
$path);
482 $exp->setExpand($expanded);
486 $exp->setForceOpenPath(
$path + array($top_node));
488 $exp->highlightNode($active_node);
494 $head_tpl =
new ilTemplate(
"tpl.cont_tree_head.html",
true,
true,
495 "Services/Repository");
497 $nd = $tree->getNodeData(ROOT_FOLDER_ID);
501 $title = $lng->txt(
"repository");
503 $head_tpl->setVariable(
"IMG_SRC",
$path);
504 $head_tpl->setVariable(
"ALT_IMG", $lng->txt(
"icon").
" ".
$title);
505 $head_tpl->setVariable(
"LINK_TXT",
$title);
506 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
"1");
507 $head_tpl->setVariable(
"LINK_HREF",
508 $ilCtrl->getLinkTargetByClass(
"ilrepositorygui",
"frameset"));
509 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
$_GET[
"ref_id"]);
510 $exp->setTreeLead($head_tpl->get());
512 $exp->initItemCounter(1);
513 $exp->setOutput($tree->getParentId($top_node), 1,
520 $output = $exp->getOutput(
false);
526 if ($ilCtrl->isAsynch())
531 $this->tpl->setCurrentBlock(
"content");
532 $this->tpl->setVariable(
"TXT_EXPLORER_HEADER", $this->lng->txt(
"overview"));
533 $this->tpl->setVariable(
"EXP_REFRESH", $this->lng->txt(
"refresh"));
534 $this->tpl->setVariable(
"EXPLORER",$output);
535 $ilCtrl->setParameter($this,
"repexpand",
$_GET[
"repexpand"]);
536 $this->tpl->setVariable(
"ACTION", $ilCtrl->getLinkTarget($this,
"showTree",
"",
false,
false));
537 $this->tpl->parseCurrentBlock();
539 include_once(
"./Services/jQuery/classes/class.iljQueryUtil.php");
542 $this->tpl->show(
false);