/** * Show Editing Tree */ function showTree() { global $ilUser, $ilias, $ilCtrl, $lng; $mtree = new ilTree($this->object->getId()); $mtree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node'); $mtree->setTreeTablePK("slm_id"); if ($_POST["expandAll"] != "") { $_GET["scexpand"] = ""; $stree = $mtree->getSubTree($mtree->getNodeData($mtree->readRootId())); $n_arr = array(); foreach ($stree as $n) { $n_arr[] = $n["child"]; } $_SESSION["scexpand"] = $n_arr; } if ($_POST["collapseAll"] != "") { $_GET["scexpand"] = ""; $_SESSION["scexpand"] = array($mtree->readRootId()); } $this->tpl = new ilTemplate("tpl.main.html", true, true); $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation()); $ilCtrl->setParameter($this, "active_node", $_GET["active_node"]); $this->tpl->addBlockFile("CONTENT", "content", "tpl.explorer.html"); $this->tpl->setVariable("IMG_SPACE", ilUtil::getImagePath("spacer.png", false)); $this->tpl->setCurrentBlock("exp2_button"); $this->tpl->setVariable("CMD_EXP2_BTN", "expandAll"); $this->tpl->setVariable("TXT_EXP2_BTN", $lng->txt("expand_all")); $this->tpl->parseCurrentBlock(); $this->tpl->setCurrentBlock("exp2_button"); $this->tpl->setVariable("CMD_EXP2_BTN", "collapseAll"); $this->tpl->setVariable("TXT_EXP2_BTN", $lng->txt("collapse_all")); $this->tpl->parseCurrentBlock(); require_once "./Modules/Scorm2004/classes/class.ilSCORM2004EditorExplorer.php"; $exp = new ilSCORM2004EditorExplorer($this->ctrl->getLinkTarget($this, "edit"), $this->object); $exp->setFrameUpdater("content", "ilHierarchyFormUpdater"); $exp->setTargetGet("obj_id"); $exp->setExpandTarget($this->ctrl->getLinkTarget($this, "showTree")); if ($_GET["scexpand"] == "") { $expanded = $mtree->readRootId(); } else { $expanded = $_GET["scexpand"]; } //echo "-".$_GET["active_node"]."-"; if ($_GET["active_node"] != "") { $path = $mtree->getPathId($_GET["active_node"]); $exp->setForceOpenPath($path); $exp->highlightNode($_GET["active_node"]); } $exp->setExpand($expanded); // build html-output $exp->setOutput(0); $output = $exp->getOutput(); // asynchronous output if ($ilCtrl->isAsynch()) { echo $output; exit; } $this->tpl->setCurrentBlock("content"); $this->tpl->setVariable("TXT_EXPLORER_HEADER", $this->lng->txt("sahs_organization")); $this->tpl->setVariable("EXP_REFRESH", $this->lng->txt("refresh")); $this->tpl->setVariable("EXPLORER", $output); $this->ctrl->setParameter($this, "scexpand", $_GET["scexpand"]); $this->tpl->setVariable("ACTION", $this->ctrl->getLinkTarget($this, "showTree")); $this->tpl->parseCurrentBlock(); include_once "./Services/jQuery/classes/class.iljQueryUtil.php"; iljQueryUtil::initjQuery($this->tpl); $this->tpl->show(false); exit; }