4include_once(
"./Services/Table/classes/class.ilTableGUI.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"]))
 
  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" 
  183                $new_type = (
$_POST[
"new_type"] != 
"" && 
$ilCtrl->getCmd() == 
"create")
 
  187                if ($new_type != 
"" && $new_type != 
"sty")
 
  189                        $this->creation_mode = 
true;
 
  190                        $ilHelp->setScreenIdComponent($new_type);
 
  195                $cmd = $this->ctrl->getCmd();
 
  196                if ((
$cmd == 
"frameset" || 
$_GET[
"rep_frame"] == 1) && 
$_SESSION[
"il_rep_mode"] == 
"tree")
 
  201                else if (
$cmd == 
"frameset" && 
$_SESSION[
"il_rep_mode"] != 
"tree")
 
  203                        $this->ctrl->setCmd(
"");
 
  208                if (
$cmd != 
"frameset")
 
  210                        if ($this->creation_mode)
 
  212                                $obj_type = $new_type;
 
  213                                $class_name = $this->objDefinition->getClassName($obj_type);
 
  214                                if (strtolower($class_name) != 
"user")
 
  216                                        $next_class = strtolower(
"ilObj".$class_name.
"GUI");
 
  220                                        $next_class = $this->ctrl->getNextClass();
 
  231                                if($this->ctrl->getNextClass() != strtolower(
'ilObj'.$class_name.
'GUI'))
 
  233                                        $this->ctrl->setCmdClass($next_class);
 
  236                        else if ((($next_class = $this->ctrl->getNextClass($this)) == 
"")
 
  237                                || ($next_class == 
"ilrepositorygui" && $this->ctrl->getCmd() == 
"return"))
 
  239                                if (
$cmd != 
"frameset" && 
$cmd != 
"showTree")
 
  243                                        $class_name = $this->objDefinition->getClassName($obj_type);
 
  244                                        $next_class = strtolower(
"ilObj".$class_name.
"GUI");
 
  246                                        $this->ctrl->setCmdClass($next_class);
 
  247                                        if ($this->ctrl->getCmd() == 
"return")
 
  249                                                $this->ctrl->setCmd(
"");
 
  258                if (
$cmd == 
"showTree")
 
  267                                if ($next_class != 
"" && $next_class != 
"ilrepositorygui")
 
  269                                        $class_path = $this->ctrl->lookupClassPath($next_class);
 
  271                                        require_once($class_path);
 
  272                                        $class_name = $this->ctrl->getClassForClasspath($class_path);
 
  273                                        if (!$this->creation_mode)
 
  275                                                if(is_subclass_of($class_name, 
"ilObject2GUI"))
 
  281                                                        $this->gui_obj = 
new $class_name(
"", $this->cur_ref_id, 
true, 
false);
 
  286                                                if(is_subclass_of($class_name, 
"ilObject2GUI"))
 
  292                                                        $this->gui_obj = 
new $class_name(
"", 0, 
true, 
false);
 
  298                                        $tabs_out = ($new_type == 
"")
 
  301                                        $this->gui_obj->setCreationMode($this->creation_mode);
 
  302                                        $this->ctrl->setReturn($this, 
"return");
 
  309                                        if ($cmd == 
"frameset")
 
  317                                                $this->ctrl->setCmd(
"");
 
  321                                        if (
$cmd == 
"showTree")
 
  327                                        $cmd = $this->ctrl->getCmd(
"");
 
  330                                        if ($this->cur_ref_id > 0 && !
$rbacsystem->checkAccess(
"read", $this->cur_ref_id))
 
  333                                                $ilias->raiseError(
$lng->txt(
"permission_denied"), 
$ilias->error_obj->MESSAGE);
 
  350                $ret = $this->ctrl->forwardCommand($this->gui_obj);
 
  351                $this->tpl->setVariable(
"OBJECTS", $this->gui_obj->getHTML());
 
  363                $ilCtrl->redirectByClass(
"ilrepositorygui", 
"");
 
  374                $ilCtrl->setParameter($this, 
"active_node", 
$_GET[
"active_node"]);
 
  376                $this->tpl = 
new ilTemplate(
"tpl.main.html", 
true, 
true);
 
  379                $this->tpl->addBlockFile(
"CONTENT", 
"content", 
"tpl.explorer.html");
 
  381                include_once (
"./Services/Repository/classes/class.ilRepositoryExplorer.php");
 
  383                $active_node = (
$_GET[
"active_node"] > 1)
 
  384                        ? 
$_GET[
"active_node"]
 
  385                        : (
$_GET[
"ref_id"] > 1)
 
  389                if (
$ilSetting->get(
"rep_tree_limit_grp_crs") && $active_node > 0)
 
  399                                        array(
"crs", 
"grp")))
 
  407                $exp->setUseStandardFrame(
false);
 
  408                $exp->setExpandTarget(
$ilCtrl->getLinkTarget($this, 
"showTree"));
 
  409                $exp->setFrameUpdater(
"tree", 
"updater");
 
  410                $exp->setTargetGet(
"ref_id");
 
  412                if (
$_GET[
"repexpand"] == 
"")
 
  414                        $expanded = $this->tree->readRootId();
 
  418                        $expanded = 
$_GET[
"repexpand"];
 
  421                $exp->setExpand($expanded);
 
  423                if ($active_node > 0)
 
  428                                $exp->setForceOpenPath(
$path);
 
  429                                $exp->setExpand($expanded);
 
  433                                $exp->setForceOpenPath(
$path + array($top_node));
 
  435                        $exp->highlightNode($active_node);
 
  441                        $head_tpl = 
new ilTemplate(
"tpl.cont_tree_head.html", 
true, 
true,
 
  442                                "Services/Repository");
 
  444                        $nd = 
$tree->getNodeData(ROOT_FOLDER_ID);
 
  450                        $head_tpl->setVariable(
"IMG_SRC", 
$path);
 
  451                        $head_tpl->setVariable(
"ALT_IMG", 
$lng->txt(
"icon").
" ".
$title);
 
  452                        $head_tpl->setVariable(
"LINK_TXT", 
$title);
 
  453                        $ilCtrl->setParameterByClass(
"ilrepositorygui", 
"ref_id", 
"1");
 
  454                        $head_tpl->setVariable(
"LINK_HREF",
 
  455                                $ilCtrl->getLinkTargetByClass(
"ilrepositorygui", 
"frameset"));
 
  456                        $ilCtrl->setParameterByClass(
"ilrepositorygui", 
"ref_id", 
$_GET[
"ref_id"]);
 
  457                        $exp->setTreeLead($head_tpl->get());
 
  459                        $exp->initItemCounter(1);
 
  460                        $exp->setOutput(
$tree->getParentId($top_node), 1,
 
  467                $output = $exp->getOutput(
false);
 
  478                $this->tpl->setCurrentBlock(
"content");
 
  479                $this->tpl->setVariable(
"TXT_EXPLORER_HEADER", $this->lng->txt(
"overview"));
 
  480                $this->tpl->setVariable(
"EXP_REFRESH", $this->lng->txt(
"refresh"));
 
  481                $this->tpl->setVariable(
"EXPLORER",
$output);
 
  482                $ilCtrl->setParameter($this, 
"repexpand", 
$_GET[
"repexpand"]);
 
  483                $this->tpl->setVariable(
"ACTION", 
$ilCtrl->getLinkTarget($this, 
"showTree", 
"", 
false, 
false));
 
  484                $this->tpl->parseCurrentBlock();
 
  486                include_once(
"./Services/jQuery/classes/class.iljQueryUtil.php");
 
  489                $this->tpl->show(
false);
 
An exception for terminatinating execution or to throw for unit testing.
static getLogger($a_component_id)
Get component logger.
static _lookupObjId($a_id)
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
static _lookupType($a_id, $a_reference=false)
lookup object type
frameset()
output tree frameset
__construct()
Constructor @access public.
executeCommand()
execute command
showTree()
display tree view
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
static initjQuery($a_tpl=null)
Init jQuery.
if(!is_dir( $entity_dir)) exit("Fatal Error ([A-Za-z0-9]+)\s+" &#(? foreach( $entity_files as $file) $output
redirection script todo: (a better solution should control the processing via a xml file)