/**
  * display tree view
  */
 function showTree()
 {
     global $ilCtrl, $tree, $ilSetting, $lng;
     $ilCtrl->setParameter($this, "active_node", $_GET["active_node"]);
     $this->tpl = new ilTemplate("tpl.main.html", true, true);
     $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
     $this->tpl->addBlockFile("CONTENT", "content", "tpl.explorer.html");
     include_once "./Services/Repository/classes/class.ilRepositoryExplorer.php";
     $active_node = $_GET["active_node"] > 1 ? $_GET["active_node"] : $_GET["ref_id"] > 1 ? $_GET["ref_id"] : 0;
     $top_node = 0;
     if ($ilSetting->get("rep_tree_limit_grp_crs") && $active_node > 0) {
         $path = $tree->getPathId($active_node);
         foreach ($path as $n) {
             if ($top_node > 0) {
                 break;
             }
             if (in_array(ilObject::_lookupType(ilObject::_lookupObjId($n)), array("crs", "grp"))) {
                 $top_node = $n;
             }
         }
     }
     $exp = new ilRepositoryExplorer("ilias.php?baseClass=ilRepositoryGUI&cmd=goto", $top_node);
     $exp->setUseStandardFrame(false);
     $exp->setExpandTarget($ilCtrl->getLinkTarget($this, "showTree"));
     $exp->setFrameUpdater("tree", "updater");
     $exp->setTargetGet("ref_id");
     if ($_GET["repexpand"] == "") {
         $expanded = $this->tree->readRootId();
     } else {
         $expanded = $_GET["repexpand"];
     }
     $exp->setExpand($expanded);
     if ($active_node > 0) {
         $path = $tree->getPathId($active_node);
         if ($top_node > 0) {
             $exp->setForceOpenPath($path);
             $exp->setExpand($expanded);
         } else {
             $exp->setForceOpenPath($path + array($top_node));
         }
         $exp->highlightNode($active_node);
     }
     // build html-output
     if ($top_node > 0) {
         $head_tpl = new ilTemplate("tpl.cont_tree_head.html", true, true, "Services/Repository");
         $path = ilObject::_getIcon(ROOT_FOLDER_ID, "tiny", "root");
         $nd = $tree->getNodeData(ROOT_FOLDER_ID);
         $title = $nd["title"];
         if ($title == "ILIAS") {
             $title = $lng->txt("repository");
         }
         $head_tpl->setVariable("IMG_SRC", $path);
         $head_tpl->setVariable("ALT_IMG", $lng->txt("icon") . " " . $title);
         $head_tpl->setVariable("LINK_TXT", $title);
         $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", "1");
         $head_tpl->setVariable("LINK_HREF", $ilCtrl->getLinkTargetByClass("ilrepositorygui", "frameset"));
         $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
         $exp->setTreeLead($head_tpl->get());
         $exp->initItemCounter(1);
         $exp->setOutput($tree->getParentId($top_node), 1, ilObject::_lookupObjId($tree->getParentId($top_node)));
     } else {
         $exp->setOutput(0);
     }
     $output = $exp->getOutput(false);
     //if ($GLOBALS["ilUser"]->getLogin() == "alex") echo "topnode:$top_node:activenode:$active_node:";
     // asynchronous output
     if ($ilCtrl->isAsynch()) {
         echo $output;
         exit;
     }
     $this->tpl->setCurrentBlock("content");
     $this->tpl->setVariable("TXT_EXPLORER_HEADER", $this->lng->txt("overview"));
     $this->tpl->setVariable("EXP_REFRESH", $this->lng->txt("refresh"));
     $this->tpl->setVariable("EXPLORER", $output);
     $ilCtrl->setParameter($this, "repexpand", $_GET["repexpand"]);
     $this->tpl->setVariable("ACTION", $ilCtrl->getLinkTarget($this, "showTree", "", false, false));
     $this->tpl->parseCurrentBlock();
     include_once "./Services/jQuery/classes/class.iljQueryUtil.php";
     iljQueryUtil::initjQuery($this->tpl);
     $this->tpl->show(false);
     exit;
 }