4include_once(
"./Services/Table/classes/class.ilTableGUI.php");
 
    5include_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"]))
 
  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();
 
  228                                if($this->ctrl->getNextClass() != strtolower(
'ilObj'.$class_name.
'GUI'))
 
  230                                        $this->ctrl->setCmdClass($next_class);
 
  233                        else if ((($next_class = $this->ctrl->getNextClass($this)) == 
"")
 
  234                                || ($next_class == 
"ilrepositorygui" && $this->ctrl->getCmd() == 
"return"))
 
  236                                if (
$cmd != 
"frameset" && 
$cmd != 
"showTree")
 
  240                                        $class_name = $this->objDefinition->getClassName($obj_type);
 
  241                                        $next_class = strtolower(
"ilObj".$class_name.
"GUI");
 
  243                                        $this->ctrl->setCmdClass($next_class);
 
  244                                        if ($this->ctrl->getCmd() == 
"return")
 
  246                                                $this->ctrl->setCmd(
"");
 
  255                if (
$cmd == 
"showTree")
 
  264                                if ($next_class != 
"" && $next_class != 
"ilrepositorygui")
 
  266                                        $class_path = $this->ctrl->lookupClassPath($next_class);
 
  268                                        require_once($class_path);
 
  269                                        $class_name = $this->ctrl->getClassForClasspath($class_path);
 
  270                                        if (!$this->creation_mode)
 
  272                                                if(is_subclass_of($class_name, 
"ilObject2GUI"))
 
  278                                                        $this->gui_obj = 
new $class_name(
"", $this->cur_ref_id, 
true, 
false);
 
  283                                                if(is_subclass_of($class_name, 
"ilObject2GUI"))
 
  288                                                else if ($class_name == 
'ilObjiLincClassroomGUI')
 
  290                                                        $this->gui_obj = 
new $class_name(
"", $this->cur_ref_id, 
true, 
false);
 
  294                                                        $this->gui_obj = 
new $class_name(
"", 0, 
true, 
false);
 
  300                                        $tabs_out = ($new_type == 
"")
 
  303                                        $this->gui_obj->setCreationMode($this->creation_mode);
 
  304                                        $this->ctrl->setReturn($this, 
"return");
 
  311                                        if ($cmd == 
"frameset")
 
  319                                                $this->ctrl->setCmd(
"");
 
  323                                        if (
$cmd == 
"showTree")
 
  329                                        $cmd = $this->ctrl->getCmd(
"");
 
  332                                        if ($this->cur_ref_id > 0 && !
$rbacsystem->checkAccess(
"read", $this->cur_ref_id))
 
  335                                                $ilias->raiseError(
$lng->txt(
"permission_denied"), 
$ilias->error_obj->MESSAGE);
 
  352                $ret =& $this->ctrl->forwardCommand($this->gui_obj);
 
  353                $this->tpl->setVariable(
"OBJECTS", $this->gui_obj->getHTML());
 
  365$ilCtrl->redirectByClass(
"ilrepositorygui", 
"");
 
  367                include_once(
"Services/Frameset/classes/class.ilFramesetGUI.php");
 
  370                if (
$_GET[
"rep_frame"] == 1)
 
  373                        $anchor = (
$_GET[
"anchor"] != 
"")
 
  374                                ? 
"#".
$_GET[
"anchor"]
 
  376                        $fs_gui->setMainFrameSource(
 
  377                                str_replace(
"rep_frame", 
"rep_frame_done", $_SERVER[
"REQUEST_URI"]).$anchor);
 
  381                        $ilCtrl->setParameterByClass(
"ilrepositorygui", 
"ref_id", $this->cur_ref_id);
 
  382                        $ilCtrl->setParameterByClass(
"ilrepositorygui", 
"getlast", 
"true");
 
  383                        if ($ilAccess->checkAccess(
"read", 
"", $this->cur_ref_id))
 
  385                                $fs_gui->setMainFrameSource(
 
  386                                        $ilCtrl->getLinkTargetByClass(
"ilrepositorygui", 
""));
 
  392                                $ilCtrl->redirectByClass(
"ilrepositorygui", 
"");
 
  394                        $ilCtrl->clearParametersByClass(
"ilrepositorygui");
 
  396                $ilCtrl->setParameterByClass(
"ilrepositorygui", 
"ref_id", $this->cur_ref_id);
 
  397                $fs_gui->setSideFrameSource(
 
  398                        $ilCtrl->getLinkTargetByClass(
"ilrepositorygui", 
"showTree"));
 
  399                $ilCtrl->setParameterByClass(
"ilrepositorygui", 
"ref_id", 
$_GET[
"ref_id"]);
 
  401                $fs_gui->setSideFrameName(
"tree");
 
  402                $fs_gui->setMainFrameName(
"rep_content");
 
  403                $fs_gui->setFramesetTitle($this->lng->txt(
"repository"));
 
  416                $ilCtrl->setParameter($this, 
"active_node", 
$_GET[
"active_node"]);
 
  418                $this->tpl = 
new ilTemplate(
"tpl.main.html", 
true, 
true);
 
  421                $this->tpl->addBlockFile(
"CONTENT", 
"content", 
"tpl.explorer.html");
 
  423                include_once (
"./Services/Repository/classes/class.ilRepositoryExplorer.php");
 
  425                $active_node = (
$_GET[
"active_node"] > 1)
 
  426                        ? 
$_GET[
"active_node"]
 
  427                        : (
$_GET[
"ref_id"] > 1)
 
  431                if (
$ilSetting->get(
"rep_tree_limit_grp_crs") && $active_node > 0)
 
  441                                        array(
"crs", 
"grp")))
 
  449                $exp->setUseStandardFrame(
false);
 
  450                $exp->setExpandTarget(
$ilCtrl->getLinkTarget($this, 
"showTree"));
 
  451                $exp->setFrameUpdater(
"tree", 
"updater");
 
  452                $exp->setTargetGet(
"ref_id");
 
  454                if (
$_GET[
"repexpand"] == 
"")
 
  456                        $expanded = $this->tree->readRootId();
 
  460                        $expanded = 
$_GET[
"repexpand"];
 
  463                $exp->setExpand($expanded);
 
  465                if ($active_node > 0)
 
  470                                $exp->setForceOpenPath(
$path);
 
  471                                $exp->setExpand($expanded);
 
  475                                $exp->setForceOpenPath(
$path + array($top_node));
 
  477                        $exp->highlightNode($active_node);
 
  483                        $head_tpl = 
new ilTemplate(
"tpl.cont_tree_head.html", 
true, 
true,
 
  484                                "Services/Repository");
 
  486                        $nd = 
$tree->getNodeData(ROOT_FOLDER_ID);
 
  487                        $title = 
$nd[
"title"];
 
  488                        if ($title == 
"ILIAS")
 
  490                                $title = 
$lng->txt(
"repository");
 
  492                        $head_tpl->setVariable(
"IMG_SRC", 
$path);
 
  493                        $head_tpl->setVariable(
"ALT_IMG", 
$lng->txt(
"icon").
" ".$title);
 
  494                        $head_tpl->setVariable(
"LINK_TXT", $title);
 
  495                        $ilCtrl->setParameterByClass(
"ilrepositorygui", 
"ref_id", 
"1");
 
  496                        $head_tpl->setVariable(
"LINK_HREF",
 
  497                                $ilCtrl->getLinkTargetByClass(
"ilrepositorygui", 
"frameset"));
 
  498                        $ilCtrl->setParameterByClass(
"ilrepositorygui", 
"ref_id", 
$_GET[
"ref_id"]);
 
  499                        $exp->setTreeLead($head_tpl->get());
 
  501                        $exp->initItemCounter(1);
 
  502                        $exp->setOutput(
$tree->getParentId($top_node), 1,
 
  509                $output = $exp->getOutput(
false);
 
  520                $this->tpl->setCurrentBlock(
"content");
 
  521                $this->tpl->setVariable(
"TXT_EXPLORER_HEADER", $this->lng->txt(
"overview"));
 
  522                $this->tpl->setVariable(
"EXP_REFRESH", $this->lng->txt(
"refresh"));
 
  523                $this->tpl->setVariable(
"EXPLORER",$output);
 
  524                $ilCtrl->setParameter($this, 
"repexpand", 
$_GET[
"repexpand"]);
 
  525                $this->tpl->setVariable(
"ACTION", 
$ilCtrl->getLinkTarget($this, 
"showTree", 
"", 
false, 
false));
 
  526                $this->tpl->parseCurrentBlock();
 
  528                include_once(
"./Services/jQuery/classes/class.iljQueryUtil.php");
 
  531                $this->tpl->show(
false);
 
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
ilRepositoryGUI()
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.
redirection script todo: (a better solution should control the processing via a xml file)