4 include_once(
"./Services/Table/classes/class.ilTableGUI.php");
83 $this->log = $DIC[
"ilLog"];
84 $this->
user = $DIC->user();
86 $this->help = $DIC[
"ilHelp"];
87 $this->error = $DIC[
"ilErr"];
88 $this->access = $DIC->access();
89 $lng = $DIC->language();
91 $tree = $DIC->repositoryTree();
107 $this->creation_mode =
false;
109 $this->ctrl->saveParameter($this,
array(
"ref_id"));
111 $this->ctrl->setReturn($this,
"");
115 if (!empty(
$_GET[
"ref_id"]) || $this->ctrl->getCmd() ==
"showTree") {
116 $this->cur_ref_id =
$_GET[
"ref_id"];
119 if (!empty(
$_SESSION[
"il_rep_ref_id"]) && !empty(
$_GET[
"getlast"])) {
120 $this->cur_ref_id =
$_SESSION[
"il_rep_ref_id"];
123 $this->cur_ref_id = $this->tree->getRootId();
125 if (
$_GET[
"cmd"] !=
"" &&
$_GET[
"cmd"] !=
"frameset") {
127 $get_str = $post_str =
"";
129 $get_str.=
"-$key:$value";
132 $post_str.=
"-$key:$value";
134 $ilLog->write(
"Repository: command called without ref_id." .
135 "GET:" . $get_str .
"-POST:" . $post_str,
$ilLog->WARNING);
138 $_GET =
array(
"baseClass"=>
"ilRepositoryGUI");
140 $this->ctrl->setCmd(
"frameset");
144 if (!
$tree->isInTree($this->cur_ref_id) && $this->ctrl->getCmd() !=
"showTree") {
145 $this->cur_ref_id = $this->tree->getRootId();
149 if (
$_GET[
"cmd"] !=
"" &&
$_GET[
"cmd"] !=
"frameset") {
150 $get_str = $post_str =
"";
152 $get_str.=
"-$key:$value";
155 $post_str.=
"-$key:$value";
157 $ilLog->write(
"Repository: command called with ref_id that is not in tree." .
158 "GET:" . $get_str .
"-POST:" . $post_str,
$ilLog->WARNING);
162 $this->ctrl->setCmd(
"frameset");
166 if (!empty(
$_GET[
"set_mode"])) {
168 if (
$ilUser->getId() != ANONYMOUS_USER_ID) {
175 if (
$ilUser->getId() != ANONYMOUS_USER_ID) {
185 $this->mode = (
$_SESSION[
"il_rep_mode"] !=
"")
190 if ($this->ctrl->getCmd() !=
"showTree" &&
191 $rbacsystem->checkAccess(
"read", $this->cur_ref_id)) {
194 ||
$type ==
"root") {
216 $new_type = (
$_POST[
"new_type"] !=
"" &&
$ilCtrl->getCmd() ==
"create")
220 if ($new_type !=
"" && $new_type !=
"sty") {
221 $this->creation_mode =
true;
222 $ilHelp->setScreenIdComponent($new_type);
227 $cmd = $this->ctrl->getCmd();
228 if ((
$cmd ==
"frameset" ||
$_GET[
"rep_frame"] == 1) &&
$_SESSION[
"il_rep_mode"] ==
"tree") {
231 } elseif (
$cmd ==
"frameset" &&
$_SESSION[
"il_rep_mode"] !=
"tree") {
232 $this->ctrl->setCmd(
"");
237 if (
$cmd !=
"frameset") {
238 if ($this->creation_mode) {
239 $obj_type = $new_type;
240 $class_name = $this->objDefinition->getClassName($obj_type);
241 if (strtolower($class_name) !=
"user") {
242 $next_class = strtolower(
"ilObj" . $class_name .
"GUI");
244 $next_class = $this->ctrl->getNextClass();
255 if ($this->ctrl->getNextClass() != strtolower(
'ilObj' . $class_name .
'GUI')) {
256 $this->ctrl->setCmdClass($next_class);
258 } elseif ((($next_class = $this->ctrl->getNextClass($this)) ==
"")
259 || ($next_class ==
"ilrepositorygui" && $this->ctrl->getCmd() ==
"return")) {
260 if (
$cmd !=
"frameset" &&
$cmd !=
"showTree") {
263 $class_name = $this->objDefinition->getClassName($obj_type);
264 $next_class = strtolower(
"ilObj" . $class_name .
"GUI");
266 $this->ctrl->setCmdClass($next_class);
267 if ($this->ctrl->getCmd() ==
"return") {
268 $this->ctrl->setCmd(
"");
276 if (
$cmd ==
"showTree") {
280 switch ($next_class) {
283 if ($next_class !=
"" && $next_class !=
"ilrepositorygui") {
284 $class_path = $this->ctrl->lookupClassPath($next_class);
286 require_once($class_path);
287 $class_name = $this->ctrl->getClassForClasspath($class_path);
288 if (!$this->creation_mode) {
289 if (is_subclass_of($class_name,
"ilObject2GUI")) {
292 $this->gui_obj =
new $class_name(
"", $this->cur_ref_id,
true,
false);
295 if (is_subclass_of($class_name,
"ilObject2GUI")) {
298 $this->gui_obj =
new $class_name(
"", 0,
true,
false);
304 $tabs_out = ($new_type ==
"")
307 $this->gui_obj->setCreationMode($this->creation_mode);
308 $this->ctrl->setReturn($this,
"return");
313 if (
$cmd ==
"frameset") {
314 if (
$_SESSION[
"il_rep_mode"] ==
"tree") {
319 $this->ctrl->setCmd(
"");
323 if (
$cmd ==
"showTree") {
328 $cmd = $this->ctrl->getCmd(
"");
331 if ($this->cur_ref_id > 0 && !
$rbacsystem->checkAccess(
"read", $this->cur_ref_id)) {
348 $ret = $this->ctrl->forwardCommand($this->gui_obj);
349 $this->tpl->setVariable(
"OBJECTS", $this->gui_obj->getHTML());
363 $ilCtrl->redirectByClass(
"ilrepositorygui",
"");
377 $ilCtrl->setParameter($this,
"active_node",
$_GET[
"active_node"]);
379 $this->tpl =
new ilTemplate(
"tpl.main.html",
true,
true);
382 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.explorer.html");
384 include_once(
"./Services/Repository/classes/class.ilRepositoryExplorer.php");
386 $active_node = (
$_GET[
"active_node"] > 1)
387 ?
$_GET[
"active_node"]
388 : (
$_GET[
"ref_id"] > 1)
392 if (
$ilSetting->get(
"rep_tree_limit_grp_crs") && $active_node > 0) {
408 $exp->setUseStandardFrame(
false);
409 $exp->setExpandTarget(
$ilCtrl->getLinkTarget($this,
"showTree"));
410 $exp->setFrameUpdater(
"tree",
"updater");
411 $exp->setTargetGet(
"ref_id");
413 if (
$_GET[
"repexpand"] ==
"") {
414 $expanded = $this->tree->readRootId();
416 $expanded =
$_GET[
"repexpand"];
419 $exp->setExpand($expanded);
421 if ($active_node > 0) {
424 $exp->setForceOpenPath(
$path);
425 $exp->setExpand($expanded);
427 $exp->setForceOpenPath(
$path +
array($top_node));
429 $exp->highlightNode($active_node);
435 "tpl.cont_tree_head.html",
438 "Services/Repository" 441 $nd =
$tree->getNodeData(ROOT_FOLDER_ID);
446 $head_tpl->setVariable(
"IMG_SRC",
$path);
447 $head_tpl->setVariable(
"ALT_IMG",
$lng->txt(
"icon") .
" " .
$title);
448 $head_tpl->setVariable(
"LINK_TXT",
$title);
449 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
"1");
450 $head_tpl->setVariable(
452 $ilCtrl->getLinkTargetByClass(
"ilrepositorygui",
"frameset")
454 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
$_GET[
"ref_id"]);
455 $exp->setTreeLead($head_tpl->get());
457 $exp->initItemCounter(1);
459 $tree->getParentId($top_node),
466 $output = $exp->getOutput(
false);
477 $this->tpl->setCurrentBlock(
"content");
478 $this->tpl->setVariable(
"TXT_EXPLORER_HEADER", $this->lng->txt(
"overview"));
479 $this->tpl->setVariable(
"EXP_REFRESH", $this->lng->txt(
"refresh"));
480 $this->tpl->setVariable(
"EXPLORER",
$output);
481 $ilCtrl->setParameter($this,
"repexpand",
$_GET[
"repexpand"]);
482 $this->tpl->setVariable(
"ACTION",
$ilCtrl->getLinkTarget($this,
"showTree",
"",
false,
false));
483 $this->tpl->parseCurrentBlock();
485 include_once(
"./Services/jQuery/classes/class.iljQueryUtil.php");
488 $this->tpl->show(
false);
static _getIcon( $a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
executeCommand()
execute command
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
__construct()
Constructor public.
if(!is_dir( $entity_dir)) exit("Fatal Error ([A-Za-z0-9]+)\+" &#(? foreach( $entity_files as $file) $output
static _lookupObjId($a_id)
special template class to simplify handling of ITX/PEAR
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
static initjQuery($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