6 include_once(
"./Services/Table/classes/class.ilTableGUI.php");
92 $this->log = $DIC[
"ilLog"];
93 $this->
user = $DIC->user();
95 $this->
help = $DIC[
"ilHelp"];
96 $this->error = $DIC[
"ilErr"];
97 $this->access = $DIC->access();
98 $lng = $DIC->language();
100 $tree = $DIC->repositoryTree();
107 $this->tool_context = $DIC->globalScreen()->tool()->context();
108 $this->
http = $DIC->http();
118 $this->creation_mode =
false;
120 $this->ctrl->saveParameter($this, array(
"ref_id"));
122 $this->ctrl->setReturn($this,
"");
126 if (!empty(
$_GET[
"ref_id"]) || $this->ctrl->getCmd() ==
"showTree") {
127 $this->cur_ref_id =
$_GET[
"ref_id"];
130 if (!empty(
$_SESSION[
"il_rep_ref_id"]) && !empty(
$_GET[
"getlast"])) {
131 $this->cur_ref_id =
$_SESSION[
"il_rep_ref_id"];
134 $this->cur_ref_id = $this->tree->getRootId();
136 if (
$_GET[
"cmd"] !=
"" &&
$_GET[
"cmd"] !=
"frameset") {
138 $get_str = $post_str =
"";
139 foreach (
$_GET as $key => $value) {
140 $get_str .=
"-$key:$value";
142 foreach (
$_POST as $key => $value) {
143 $post_str .=
"-$key:$value";
145 $ilLog->write(
"Repository: command called without ref_id." .
146 "GET:" . $get_str .
"-POST:" . $post_str,
$ilLog->WARNING);
149 $_GET = array(
"baseClass" =>
"ilRepositoryGUI");
151 $this->ctrl->setCmd(
"frameset");
155 if (!
$tree->isInTree($this->cur_ref_id) && $this->ctrl->getCmd() !=
"showTree") {
156 $this->cur_ref_id = $this->tree->getRootId();
160 if (
$_GET[
"cmd"] !=
"" &&
$_GET[
"cmd"] !=
"frameset") {
161 $get_str = $post_str =
"";
162 foreach (
$_GET as $key => $value) {
163 $get_str .=
"-$key:$value";
165 foreach (
$_POST as $key => $value) {
166 $post_str .=
"-$key:$value";
168 $ilLog->write(
"Repository: command called with ref_id that is not in tree." .
169 "GET:" . $get_str .
"-POST:" . $post_str,
$ilLog->WARNING);
173 $this->ctrl->setCmd(
"frameset");
177 if (!empty(
$_GET[
"set_mode"])) {
179 if (
$ilUser->getId() != ANONYMOUS_USER_ID) {
186 if (
$ilUser->getId() != ANONYMOUS_USER_ID) {
196 $this->mode = (
$_SESSION[
"il_rep_mode"] !=
"")
201 if ($this->ctrl->getCmd() !=
"showTree" &&
202 $rbacsystem->checkAccess(
"read", $this->cur_ref_id)) {
205 ||
$type ==
"root") {
226 ($this->
user->isAnonymous() || !($this->
user->getId() >= 1)) &&
228 $this->
http->request()->getServerParams()[
'SERVER_NAME']
231 $this->ctrl->redirectToURL(
'./login.php?cmd=force_login');
234 $this->tool_context->claim()->repository();
235 $show_tree = (
$_SESSION[
"il_rep_mode"] ==
"flat")
241 $new_type = (
$_POST[
"new_type"] !=
"" &&
$ilCtrl->getCmd() ==
"create")
245 if ($new_type !=
"" && $new_type !=
"sty") {
246 $this->creation_mode =
true;
247 $ilHelp->setScreenIdComponent($new_type);
252 $cmd = $this->ctrl->getCmd();
253 if ((
$cmd ==
"frameset" ||
$_GET[
"rep_frame"] == 1) &&
$_SESSION[
"il_rep_mode"] ==
"tree") {
256 } elseif (
$cmd ==
"frameset" &&
$_SESSION[
"il_rep_mode"] !=
"tree") {
257 $this->ctrl->setCmd(
"");
263 if (
$cmd !=
"frameset") {
264 if ($this->creation_mode) {
265 $obj_type = $new_type;
266 $class_name = $this->objDefinition->getClassName($obj_type);
267 if (strtolower($class_name) !=
"user") {
268 $next_class = strtolower(
"ilObj" . $class_name .
"GUI");
270 $next_class = $this->ctrl->getNextClass();
281 if ($this->ctrl->getNextClass() != strtolower(
'ilObj' . $class_name .
'GUI')) {
282 $this->ctrl->setCmdClass($next_class);
284 } elseif ((($next_class = $this->ctrl->getNextClass($this)) ==
"")
285 || ($next_class ==
"ilrepositorygui" && $this->ctrl->getCmd() ==
"return")) {
286 if (
$cmd !=
"frameset" &&
$cmd !=
"showTree") {
289 $class_name = $this->objDefinition->getClassName($obj_type);
290 $next_class = strtolower(
"ilObj" . $class_name .
"GUI");
292 $this->ctrl->setCmdClass($next_class);
293 if ($this->ctrl->getCmd() ==
"return") {
294 $this->ctrl->setCmd(
"");
302 if (
$cmd ==
"showRepTree") {
306 switch ($next_class) {
309 if ($next_class !=
"" && $next_class !=
"ilrepositorygui") {
310 $class_path = $this->ctrl->lookupClassPath($next_class);
312 require_once($class_path);
313 $class_name = $this->ctrl->getClassForClasspath($class_path);
314 if (!$this->creation_mode) {
315 if (is_subclass_of($class_name,
"ilObject2GUI")) {
318 $this->gui_obj =
new $class_name(
"", $this->cur_ref_id,
true,
false);
321 if (is_subclass_of($class_name,
"ilObject2GUI")) {
324 $this->gui_obj =
new $class_name(
"", 0,
true,
false);
330 $tabs_out = ($new_type ==
"")
333 $this->gui_obj->setCreationMode($this->creation_mode);
334 $this->ctrl->setReturn($this,
"return");
339 if (
$cmd ==
"frameset") {
340 if (
$_SESSION[
"il_rep_mode"] ==
"tree") {
345 $this->ctrl->setCmd(
"");
349 if (
$cmd ==
"showTree") {
354 $cmd = $this->ctrl->getCmd(
"");
357 if ($this->cur_ref_id > 0 && !
$rbacsystem->checkAccess(
"read", $this->cur_ref_id) &&
$cmd !=
"showRepTree") {
360 $this->tpl->printToStdout();
374 $ret = $this->ctrl->forwardCommand($this->gui_obj);
375 $this->tpl->setVariable(
"OBJECTS", $this->gui_obj->getHTML());
376 $this->tpl->printToStdout();
388 $ilCtrl->redirectByClass(
"ilrepositorygui",
"");
402 $ilCtrl->setParameter($this,
"active_node",
$_GET[
"active_node"]);
407 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.explorer.html");
409 include_once(
"./Services/Repository/classes/class.ilRepositoryExplorer.php");
411 $active_node = (
$_GET[
"active_node"] > 1)
412 ?
$_GET[
"active_node"]
413 : ((
$_GET[
"ref_id"] > 1)
417 if (
$ilSetting->get(
"rep_tree_limit_grp_crs") && $active_node > 0) {
418 $path =
$tree->getPathId($active_node);
419 foreach ($path as
$n) {
433 $exp->setUseStandardFrame(
false);
434 $exp->setExpandTarget(
$ilCtrl->getLinkTarget($this,
"showTree"));
435 $exp->setFrameUpdater(
"tree",
"updater");
436 $exp->setTargetGet(
"ref_id");
438 if (
$_GET[
"repexpand"] ==
"") {
439 $expanded = $this->tree->readRootId();
441 $expanded =
$_GET[
"repexpand"];
444 $exp->setExpand($expanded);
446 if ($active_node > 0) {
447 $path =
$tree->getPathId($active_node);
449 $exp->setForceOpenPath($path);
450 $exp->setExpand($expanded);
452 $exp->setForceOpenPath($path + array($top_node));
454 $exp->highlightNode($active_node);
460 "tpl.cont_tree_head.html",
463 "Services/Repository" 465 $path = ilObject::_getIcon(ROOT_FOLDER_ID,
"tiny",
"root");
466 $nd =
$tree->getNodeData(ROOT_FOLDER_ID);
467 $title =
$nd[
"title"];
468 if ($title ==
"ILIAS") {
469 $title =
$lng->txt(
"repository");
471 $head_tpl->setVariable(
"IMG_SRC", $path);
472 $head_tpl->setVariable(
"ALT_IMG",
$lng->txt(
"icon") .
" " . $title);
473 $head_tpl->setVariable(
"LINK_TXT", $title);
474 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
"1");
475 $head_tpl->setVariable(
477 $ilCtrl->getLinkTargetByClass(
"ilrepositorygui",
"frameset")
479 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
$_GET[
"ref_id"]);
480 $exp->setTreeLead($head_tpl->get());
482 $exp->initItemCounter(1);
484 $tree->getParentId($top_node),
491 $output = $exp->getOutput(
false);
502 $this->tpl->setCurrentBlock(
"content");
503 $this->tpl->setVariable(
"TXT_EXPLORER_HEADER", $this->lng->txt(
"overview"));
504 $this->tpl->setVariable(
"EXP_REFRESH", $this->lng->txt(
"refresh"));
505 $this->tpl->setVariable(
"EXPLORER", $output);
506 $ilCtrl->setParameter($this,
"repexpand",
$_GET[
"repexpand"]);
507 $this->tpl->setVariable(
"ACTION",
$ilCtrl->getLinkTarget($this,
"showTree",
"",
false,
false));
508 $this->tpl->parseCurrentBlock();
510 include_once(
"./Services/jQuery/classes/class.iljQueryUtil.php");
513 $this->tpl->printToStdout(
false);
524 $exp->setSkipRootNode(
true);
525 $exp->handleCommand();
executeCommand()
execute command
special template class to simplify handling of ITX/PEAR
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
__construct()
Constructor public.
static getInstance()
Get instance.
static http()
Fetches the global http state from ILIAS.
static _lookupObjId($a_id)
Repository explorer GUI class.
static _lookupType($a_id, $a_reference=false)
lookup object type
static initjQuery(ilGlobalTemplateInterface $a_tpl=null)
inits and adds the jQuery JS-File to the global or a passed template
static getLogger($a_component_id)
Get component logger.
showTree()
display tree view
frameset()
output tree frameset