6include_once(
"./Services/Table/classes/class.ilTableGUI.php");
 
   93        $this->log = 
$DIC[
"ilLog"];
 
   94        $this->
user = $DIC->user();
 
   96        $this->
help = $DIC[
"ilHelp"];
 
   97        $this->
error = $DIC[
"ilErr"];
 
   98        $this->access = 
$DIC->access();
 
  104        $ilCtrl = 
$DIC->ctrl();
 
  105        $ilLog = 
$DIC[
"ilLog"];
 
  108        $this->tool_context = 
$DIC->globalScreen()->tool()->context();
 
  109        $this->
http = $DIC->http();
 
  117        $this->ctrl = $ilCtrl;
 
  119        $this->creation_mode = 
false;
 
  121        $this->ctrl->saveParameter($this, array(
"ref_id"));
 
  123            $this->ctrl->setReturn($this, 
"");
 
  127        if (!empty(
$_GET[
"ref_id"]) || $this->ctrl->getCmd() == 
"showTree") {
 
  128            $this->cur_ref_id = 
$_GET[
"ref_id"];
 
  131            if (!empty(
$_SESSION[
"il_rep_ref_id"]) && !empty(
$_GET[
"getlast"])) {
 
  132                $this->cur_ref_id = 
$_SESSION[
"il_rep_ref_id"];
 
  135                $this->cur_ref_id = $this->tree->getRootId();
 
  137                if (
$_GET[
"cmd"] != 
"" && 
$_GET[
"cmd"] != 
"frameset") {
 
  139                    $get_str = $post_str = 
"";
 
  140                    foreach (
$_GET as $key => $value) {
 
  141                        $get_str .= 
"-$key:$value";
 
  143                    foreach (
$_POST as $key => $value) {
 
  144                        $post_str .= 
"-$key:$value";
 
  146                    $ilLog->write(
"Repository: command called without ref_id." .
 
  147                        "GET:" . $get_str . 
"-POST:" . $post_str, $ilLog->WARNING);
 
  150                $_GET = array(
"baseClass" => 
"ilRepositoryGUI");
 
  152                $this->ctrl->setCmd(
"frameset");
 
  156        if (!
$tree->isInTree($this->cur_ref_id) && $this->ctrl->getCmd() != 
"showTree") {
 
  157            $this->cur_ref_id = $this->tree->getRootId();
 
  161            if (
$_GET[
"cmd"] != 
"" && 
$_GET[
"cmd"] != 
"frameset") {
 
  162                $get_str = $post_str = 
"";
 
  163                foreach (
$_GET as $key => $value) {
 
  164                    $get_str .= 
"-$key:$value";
 
  166                foreach (
$_POST as $key => $value) {
 
  167                    $post_str .= 
"-$key:$value";
 
  169                $ilLog->write(
"Repository: command called with ref_id that is not in tree." .
 
  170                    "GET:" . $get_str . 
"-POST:" . $post_str, $ilLog->WARNING);
 
  174            $this->ctrl->setCmd(
"frameset");
 
  178        if (!empty(
$_GET[
"set_mode"])) {
 
  197        $this->mode = (
$_SESSION[
"il_rep_mode"] != 
"")
 
  202        if ($this->ctrl->getCmd() != 
"showTree" &&
 
  203            $rbacsystem->checkAccess(
"read", $this->cur_ref_id)) {
 
  206                || 
$type == 
"root") {
 
  227            ($this->
user->isAnonymous() || !($this->user->getId() >= 1)) &&
 
  229                $this->http->request()->getServerParams()[
'SERVER_NAME']
 
  232            $this->ctrl->redirectToURL(
'./login.php?cmd=force_login');
 
  235        $this->tool_context->claim()->repository();
 
  236        $show_tree = (
$_SESSION[
"il_rep_mode"] == 
"flat")
 
  242        $new_type = (
$_POST[
"new_type"] != 
"" && $ilCtrl->getCmd() == 
"create")
 
  246        if ($new_type != 
"" && $new_type != 
"sty") {
 
  247            $this->creation_mode = 
true;
 
  248            $ilHelp->setScreenIdComponent($new_type);
 
  253        $cmd = $this->ctrl->getCmd();
 
  254        if ((
$cmd == 
"frameset" || 
$_GET[
"rep_frame"] == 1) && 
$_SESSION[
"il_rep_mode"] == 
"tree") {
 
  257        } elseif (
$cmd == 
"frameset" && 
$_SESSION[
"il_rep_mode"] != 
"tree") {
 
  258            $this->ctrl->setCmd(
"");
 
  264        if (
$cmd != 
"frameset") {
 
  265            if ($this->creation_mode) {
 
  266                $obj_type = $new_type;
 
  267                $class_name = $this->objDefinition->getClassName($obj_type);
 
  268                if (strtolower($class_name) != 
"user") {
 
  269                    $next_class = strtolower(
"ilObj" . $class_name . 
"GUI");
 
  271                    $next_class = $this->ctrl->getNextClass();
 
  282                if ($this->ctrl->getNextClass() != strtolower(
'ilObj' . $class_name . 
'GUI')) {
 
  283                    $this->ctrl->setCmdClass($next_class);
 
  285            } elseif ((($next_class = $this->ctrl->getNextClass($this)) == 
"")
 
  286                || ($next_class == 
"ilrepositorygui" && $this->ctrl->getCmd() == 
"return")) {
 
  287                if (
$cmd != 
"frameset" && 
$cmd != 
"showTree") {
 
  290                    $class_name = $this->objDefinition->getClassName($obj_type);
 
  291                    $next_class = strtolower(
"ilObj" . $class_name . 
"GUI");
 
  293                    $this->ctrl->setCmdClass($next_class);
 
  294                    if ($this->ctrl->getCmd() == 
"return") {
 
  295                        $this->ctrl->setCmd(
"");
 
  303        if (
$cmd == 
"showRepTree") {
 
  307        switch ($next_class) {
 
  310                if ($next_class != 
"" && $next_class != 
"ilrepositorygui") {
 
  311                    $class_path = $this->ctrl->lookupClassPath($next_class);
 
  313                    require_once($class_path);
 
  314                    $class_name = $this->ctrl->getClassForClasspath($class_path);
 
  315                    if (!$this->creation_mode) {
 
  316                        if (is_subclass_of($class_name, 
"ilObject2GUI")) {
 
  319                            $this->gui_obj = 
new $class_name(
"", $this->cur_ref_id, 
true, 
false);
 
  322                        if (is_subclass_of($class_name, 
"ilObject2GUI")) {
 
  325                            $this->gui_obj = 
new $class_name(
"", 0, 
true, 
false);
 
  331                    $tabs_out = ($new_type == 
"")
 
  334                    $this->gui_obj->setCreationMode($this->creation_mode);
 
  335                    $this->ctrl->setReturn($this, 
"return");
 
  340                    if (
$cmd == 
"frameset") {
 
  341                        if (
$_SESSION[
"il_rep_mode"] == 
"tree") {
 
  346                        $this->ctrl->setCmd(
"");
 
  350                    if (
$cmd == 
"showTree") {
 
  355                    $cmd = $this->ctrl->getCmd(
"");
 
  358                    if ($this->cur_ref_id > 0 && !
$rbacsystem->checkAccess(
"read", $this->cur_ref_id) && 
$cmd != 
"showRepTree") {
 
  361                        $this->tpl->printToStdout();
 
  375        $ret = $this->ctrl->forwardCommand($this->gui_obj);
 
  376        $this->tpl->setVariable(
"OBJECTS", $this->gui_obj->getHTML());
 
  377        $this->tpl->printToStdout();
 
  389        $ilCtrl->redirectByClass(
"ilrepositorygui", 
"");
 
  403        $ilCtrl->setParameter($this, 
"active_node", 
$_GET[
"active_node"]);
 
  408        $this->tpl->addBlockFile(
"CONTENT", 
"content", 
"tpl.explorer.html");
 
  410        include_once(
"./Services/Repository/classes/class.ilRepositoryExplorer.php");
 
  412        $active_node = (
$_GET[
"active_node"] > 1)
 
  413            ? 
$_GET[
"active_node"]
 
  414            : ((
$_GET[
"ref_id"] > 1)
 
  418        if (
$ilSetting->get(
"rep_tree_limit_grp_crs") && $active_node > 0) {
 
  419            $path = 
$tree->getPathId($active_node);
 
  420            foreach ($path as 
$n) {
 
  434        $exp->setUseStandardFrame(
false);
 
  435        $exp->setExpandTarget($ilCtrl->getLinkTarget($this, 
"showTree"));
 
  436        $exp->setFrameUpdater(
"tree", 
"updater");
 
  437        $exp->setTargetGet(
"ref_id");
 
  439        if (
$_GET[
"repexpand"] == 
"") {
 
  440            $expanded = $this->tree->readRootId();
 
  442            $expanded = 
$_GET[
"repexpand"];
 
  445        $exp->setExpand($expanded);
 
  447        if ($active_node > 0) {
 
  448            $path = 
$tree->getPathId($active_node);
 
  450                $exp->setForceOpenPath($path);
 
  451                $exp->setExpand($expanded);
 
  453                $exp->setForceOpenPath($path + array($top_node));
 
  455            $exp->highlightNode($active_node);
 
  461                "tpl.cont_tree_head.html",
 
  464                "Services/Repository" 
  468            $title = 
$nd[
"title"];
 
  469            if ($title == 
"ILIAS") {
 
  470                $title = 
$lng->txt(
"repository");
 
  472            $head_tpl->setVariable(
"IMG_SRC", $path);
 
  473            $head_tpl->setVariable(
"ALT_IMG", 
$lng->txt(
"icon") . 
" " . $title);
 
  474            $head_tpl->setVariable(
"LINK_TXT", $title);
 
  475            $ilCtrl->setParameterByClass(
"ilrepositorygui", 
"ref_id", 
"1");
 
  476            $head_tpl->setVariable(
 
  478                $ilCtrl->getLinkTargetByClass(
"ilrepositorygui", 
"frameset")
 
  480            $ilCtrl->setParameterByClass(
"ilrepositorygui", 
"ref_id", 
$_GET[
"ref_id"]);
 
  481            $exp->setTreeLead($head_tpl->get());
 
  483            $exp->initItemCounter(1);
 
  485                $tree->getParentId($top_node),
 
  492        $output = $exp->getOutput(
false);
 
  498        if ($ilCtrl->isAsynch()) {
 
  503        $this->tpl->setCurrentBlock(
"content");
 
  504        $this->tpl->setVariable(
"TXT_EXPLORER_HEADER", $this->lng->txt(
"overview"));
 
  505        $this->tpl->setVariable(
"EXP_REFRESH", $this->lng->txt(
"refresh"));
 
  506        $this->tpl->setVariable(
"EXPLORER", $output);
 
  507        $ilCtrl->setParameter($this, 
"repexpand", 
$_GET[
"repexpand"]);
 
  508        $this->tpl->setVariable(
"ACTION", $ilCtrl->getLinkTarget($this, 
"showTree", 
"", 
false, 
false));
 
  509        $this->tpl->parseCurrentBlock();
 
  511        include_once(
"./Services/jQuery/classes/class.iljQueryUtil.php");
 
  514        $this->tpl->printToStdout(
false);
 
  525        $exp->setSkipRootNode(
true);
 
  526        $exp->handleCommand();
 
An exception for terminatinating execution or to throw for unit testing.
error($a_errmsg)
set error message @access public
special template class to simplify handling of ITX/PEAR
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
static getInstance()
Get instance.
Repository explorer GUI class.
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(ilGlobalTemplateInterface $a_tpl=null)
inits and adds the jQuery JS-File to the global or a passed template
static http()
Fetches the global http state from ILIAS.