4 include_once(
"./Services/Table/classes/class.ilTableGUI.php");
5 include_once(
"Services/Payment/classes/class.ilPaymentObject.php");
55 $this->objDefinition =& $objDefinition;
59 $this->creation_mode =
false;
61 $this->ctrl->saveParameter($this, array(
"ref_id"));
63 $this->ctrl->setReturn($this,
"");
66 if (!empty($_GET[
"ref_id"]) || $this->ctrl->getCmd() ==
"showTree")
68 $this->cur_ref_id = $_GET[
"ref_id"];
73 if (!empty(
$_SESSION[
"il_rep_ref_id"]) && !empty($_GET[
"getlast"]))
75 $this->cur_ref_id =
$_SESSION[
"il_rep_ref_id"];
80 $this->cur_ref_id = $this->tree->getRootId();
82 if ($_GET[
"cmd"] !=
"" && $_GET[
"cmd"] !=
"frameset")
85 $get_str = $post_str =
"";
86 foreach($_GET as $key => $value)
88 $get_str.=
"-$key:$value";
90 foreach(
$_POST as $key => $value)
92 $post_str.=
"-$key:$value";
94 $ilLog->write(
"Repository: command called without ref_id.".
95 "GET:".$get_str.
"-POST:".$post_str, $ilLog->WARNING);
98 $_GET = array(
"baseClass"=>
"ilRepositoryGUI");
100 $this->ctrl->setCmd(
"frameset");
104 if (!$tree->isInTree($this->cur_ref_id) && $this->ctrl->getCmd() !=
"showTree")
106 $this->cur_ref_id = $this->tree->getRootId();
110 if ($_GET[
"cmd"] !=
"" && $_GET[
"cmd"] !=
"frameset")
112 $get_str = $post_str =
"";
113 foreach($_GET as $key => $value)
115 $get_str.=
"-$key:$value";
117 foreach(
$_POST as $key => $value)
119 $post_str.=
"-$key:$value";
121 $ilLog->write(
"Repository: command called with ref_id that is not in tree.".
122 "GET:".$get_str.
"-POST:".$post_str, $ilLog->WARNING);
126 $this->ctrl->setCmd(
"frameset");
130 if (!empty($_GET[
"set_mode"]))
132 $_SESSION[
"il_rep_mode"] = $_GET[
"set_mode"];
133 if ($this->
ilias->account->getId() != ANONYMOUS_USER_ID)
135 $this->
ilias->account->writePref(
"il_rep_mode", $_GET[
"set_mode"]);
142 if ($this->
ilias->account->getId() != ANONYMOUS_USER_ID)
144 $_SESSION[
"il_rep_mode"] = $this->
ilias->account->getPref(
"il_rep_mode");
151 $_SESSION[
"il_rep_mode"] = $this->
ilias->getSetting(
"default_repository_view");
154 $this->mode = (
$_SESSION[
"il_rep_mode"] !=
"")
159 if ($this->ctrl->getCmd() !=
"showTree" &&
160 $rbacsystem->checkAccess(
"read", $this->cur_ref_id))
163 if ($type ==
"cat" || $type ==
"grp" || $type ==
"crs" 184 $new_type = (
$_POST[
"new_type"] !=
"" && $ilCtrl->getCmd() ==
"create")
188 if ($new_type !=
"" && $new_type !=
"sty")
190 $this->creation_mode =
true;
191 $ilHelp->setScreenIdComponent($new_type);
196 $cmd = $this->ctrl->getCmd();
197 if (($cmd ==
"frameset" ||
$_GET[
"rep_frame"] == 1) &&
$_SESSION[
"il_rep_mode"] ==
"tree")
202 else if ($cmd ==
"frameset" &&
$_SESSION[
"il_rep_mode"] !=
"tree")
204 $this->ctrl->setCmd(
"");
209 if ($cmd !=
"frameset")
211 if ($this->creation_mode)
213 $obj_type = $new_type;
214 $class_name = $this->objDefinition->getClassName($obj_type);
215 if (strtolower($class_name) !=
"user")
217 $next_class = strtolower(
"ilObj".$class_name.
"GUI");
221 $next_class = $this->ctrl->getNextClass();
232 if($this->ctrl->getNextClass() != strtolower(
'ilObj'.$class_name.
'GUI'))
234 $this->ctrl->setCmdClass($next_class);
237 else if ((($next_class = $this->ctrl->getNextClass($this)) ==
"")
238 || ($next_class ==
"ilrepositorygui" && $this->ctrl->getCmd() ==
"return"))
240 if ($cmd !=
"frameset" && $cmd !=
"showTree")
244 $class_name = $this->objDefinition->getClassName($obj_type);
245 $next_class = strtolower(
"ilObj".$class_name.
"GUI");
247 $this->ctrl->setCmdClass($next_class);
248 if ($this->ctrl->getCmd() ==
"return")
250 $this->ctrl->setCmd(
"");
259 if ($cmd ==
"showTree")
268 if ($next_class !=
"" && $next_class !=
"ilrepositorygui")
270 $class_path = $this->ctrl->lookupClassPath($next_class);
272 require_once($class_path);
273 $class_name = $this->ctrl->getClassForClasspath($class_path);
274 if (!$this->creation_mode)
276 if(is_subclass_of($class_name,
"ilObject2GUI"))
282 $this->gui_obj =
new $class_name(
"", $this->cur_ref_id,
true,
false);
287 if(is_subclass_of($class_name,
"ilObject2GUI"))
293 $this->gui_obj =
new $class_name(
"", 0,
true,
false);
299 $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 $ilCtrl->redirectByClass(
"ilrepositorygui",
"");
366 include_once(
"Services/Frameset/classes/class.ilFramesetGUI.php");
369 if (
$_GET[
"rep_frame"] == 1)
372 $anchor = (
$_GET[
"anchor"] !=
"")
373 ?
"#".
$_GET[
"anchor"]
375 $fs_gui->setMainFrameSource(
376 str_replace(
"rep_frame",
"rep_frame_done",
$_SERVER[
"REQUEST_URI"]).$anchor);
380 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $this->cur_ref_id);
381 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"getlast",
"true");
382 if ($ilAccess->checkAccess(
"read",
"", $this->cur_ref_id))
384 $fs_gui->setMainFrameSource(
385 $ilCtrl->getLinkTargetByClass(
"ilrepositorygui",
""));
391 $ilCtrl->redirectByClass(
"ilrepositorygui",
"");
393 $ilCtrl->clearParametersByClass(
"ilrepositorygui");
395 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $this->cur_ref_id);
396 $fs_gui->setSideFrameSource(
397 $ilCtrl->getLinkTargetByClass(
"ilrepositorygui",
"showTree"));
398 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
$_GET[
"ref_id"]);
400 $fs_gui->setSideFrameName(
"tree");
401 $fs_gui->setMainFrameName(
"rep_content");
402 $fs_gui->setFramesetTitle($this->lng->txt(
"repository"));
415 $ilCtrl->setParameter($this,
"active_node",
$_GET[
"active_node"]);
417 $this->tpl =
new ilTemplate(
"tpl.main.html",
true,
true);
420 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.explorer.html");
422 include_once (
"./Services/Repository/classes/class.ilRepositoryExplorer.php");
424 $active_node = (
$_GET[
"active_node"] > 1)
425 ?
$_GET[
"active_node"]
426 : (
$_GET[
"ref_id"] > 1)
430 if ($ilSetting->get(
"rep_tree_limit_grp_crs") && $active_node > 0)
432 $path = $tree->getPathId($active_node);
440 array(
"crs",
"grp")))
448 $exp->setUseStandardFrame(
false);
449 $exp->setExpandTarget($ilCtrl->getLinkTarget($this,
"showTree"));
450 $exp->setFrameUpdater(
"tree",
"updater");
451 $exp->setTargetGet(
"ref_id");
453 if (
$_GET[
"repexpand"] ==
"")
455 $expanded = $this->tree->readRootId();
459 $expanded =
$_GET[
"repexpand"];
462 $exp->setExpand($expanded);
464 if ($active_node > 0)
466 $path = $tree->getPathId($active_node);
469 $exp->setForceOpenPath(
$path);
470 $exp->setExpand($expanded);
474 $exp->setForceOpenPath(
$path + array($top_node));
476 $exp->highlightNode($active_node);
482 $head_tpl =
new ilTemplate(
"tpl.cont_tree_head.html",
true,
true,
483 "Services/Repository");
485 $nd = $tree->getNodeData(ROOT_FOLDER_ID);
486 $title =
$nd[
"title"];
487 if ($title ==
"ILIAS")
489 $title = $lng->txt(
"repository");
491 $head_tpl->setVariable(
"IMG_SRC",
$path);
492 $head_tpl->setVariable(
"ALT_IMG", $lng->txt(
"icon").
" ".$title);
493 $head_tpl->setVariable(
"LINK_TXT", $title);
494 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
"1");
495 $head_tpl->setVariable(
"LINK_HREF",
496 $ilCtrl->getLinkTargetByClass(
"ilrepositorygui",
"frameset"));
497 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
$_GET[
"ref_id"]);
498 $exp->setTreeLead($head_tpl->get());
500 $exp->initItemCounter(1);
501 $exp->setOutput($tree->getParentId($top_node), 1,
508 $output = $exp->getOutput(
false);
514 if ($ilCtrl->isAsynch())
519 $this->tpl->setCurrentBlock(
"content");
520 $this->tpl->setVariable(
"TXT_EXPLORER_HEADER", $this->lng->txt(
"overview"));
521 $this->tpl->setVariable(
"EXP_REFRESH", $this->lng->txt(
"refresh"));
522 $this->tpl->setVariable(
"EXPLORER",$output);
523 $ilCtrl->setParameter($this,
"repexpand",
$_GET[
"repexpand"]);
524 $this->tpl->setVariable(
"ACTION", $ilCtrl->getLinkTarget($this,
"showTree",
"",
false,
false));
525 $this->tpl->parseCurrentBlock();
527 include_once(
"./Services/jQuery/classes/class.iljQueryUtil.php");
530 $this->tpl->show(
false);
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
& executeCommand()
execute command
static _lookupObjId($a_id)
special template class to simplify handling of ITX/PEAR
redirection script todo: (a better solution should control the processing via a xml file) ...
static _lookupType($a_id, $a_reference=false)
lookup object type
ilRepositoryGUI()
Constructor public.
static initjQuery($a_tpl=null)
Init jQuery.
static getLogger($a_component_id)
Get component logger.
showTree()
display tree view
frameset()
output tree frameset