protected function addAdminLocatorItems() { $path = $this->tree->getPathFull($_GET["ref_id"], ilObjOrgUnit::getRootOrgRefId()); // add item for each node on path foreach ((array) $path as $key => $row) { if ($row["title"] == "__OrgUnitAdministration") { $row["title"] = $this->lng->txt("objs_orgu"); } $this->ctrl->setParameterByClass("ilobjorgunitgui", "ref_id", $row["child"]); $this->ilLocator->addItem($row["title"], $this->ctrl->getLinkTargetByClass("ilobjorgunitgui", "view"), ilFrameTargetInfo::_getFrame("MainContent"), $row["child"]); $this->ctrl->setParameterByClass("ilobjorgunitgui", "ref_id", $_GET["ref_id"]); } }
function getContextPath($a_endnode_id, $a_startnode_id = 1) { $path = ""; include_once "./Services/Tree/classes/class.ilTree.php"; $tree = new ilTree(1); if (!$tree->isInTree($a_startnode_id) or !$tree->isInTree($a_endnode_id)) { return ''; } $tmpPath = $tree->getPathFull($a_endnode_id, $a_startnode_id); // count -1, to exclude the learning module itself for ($i = 1; $i < count($tmpPath) - 1; $i++) { if ($path != "") { $path .= " > "; } $path .= $tmpPath[$i]["title"]; } return $path; }
/** * get top chapter of page for that any precondition is missing */ function _getMissingPreconditionsTopChapter($cont_obj_ref_id, $cont_obj_id, $page_id) { $lm_tree = new ilTree($cont_obj_id); $lm_tree->setTableNames('lm_tree', 'lm_data'); $lm_tree->setTreeTablePK("lm_id"); $conds = array(); if ($lm_tree->isInTree($page_id)) { // get full path of page $path = $lm_tree->getPathFull($page_id, $lm_tree->readRootId()); foreach ($path as $node) { if ($node["type"] == "st") { // get all preconditions of upper chapters $tconds = ilConditionHandler::_getConditionsOfTarget($cont_obj_ref_id, $node["child"], "st"); foreach ($tconds as $tcond) { // look for missing precondition if (!ilConditionHandler::_checkCondition($tcond["id"])) { return $node["child"]; } } } } } return ""; }
/** * Set Locator Items */ function setLocator() { global $ilLocator, $tpl, $ilCtrl; $ilLocator->addRepositoryItems($_GET["ref_id"]); $this->getParentGUI()->addLocatorItems(); if ($_GET["obj_id"] > 0) { $tree = new ilTree($this->slm_object->getId()); $tree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node'); $tree->setTreeTablePK("slm_id"); $path = $tree->getPathFull($_GET["obj_id"]); for ($i = 1; $i < count($path); $i++) { //var_dump($path[$i]); switch ($path[$i]["type"]) { case "chap": $ilCtrl->setParameterByClass("ilscorm2004chaptergui", "obj_id", $path[$i]["child"]); $ilLocator->addItem($path[$i]["title"], $ilCtrl->getLinkTargetByClass("ilscorm2004chaptergui", "showOrganization"), "", 0, $path[$i]["type"], ilUtil::getImagePath("icon_chap_s.png")); break; case "seqc": $ilCtrl->setParameterByClass("ilscorm2004seqchaptergui", "obj_id", $path[$i]["child"]); $ilLocator->addItem($path[$i]["title"], $ilCtrl->getLinkTargetByClass("ilscorm2004seqchaptergui", "showOrganization"), "", 0, $path[$i]["type"], ilUtil::getImagePath("icon_chap_s.png")); break; case "sco": $ilCtrl->setParameterByClass("ilscorm2004scogui", "obj_id", $path[$i]["child"]); $ilLocator->addItem($path[$i]["title"], $ilCtrl->getLinkTargetByClass("ilscorm2004scogui", "showOrganization"), "", 0, $path[$i]["type"], ilUtil::getImagePath("icon_sco_s.png")); break; case "ass": $ilCtrl->setParameterByClass("ilscorm2004assetgui", "obj_id", $path[$i]["child"]); $ilLocator->addItem($path[$i]["title"], $ilCtrl->getLinkTargetByClass("ilscorm2004assetgui", "showOrganization"), "", 0, $path[$i]["type"], ilUtil::getImagePath("icon_sca_s.png")); break; case "page": $ilCtrl->setParameterByClass("ilscorm2004pagegui", "obj_id", $path[$i]["child"]); $ilLocator->addItem($path[$i]["title"], $ilCtrl->getLinkTargetByClass("ilscorm2004pagegui", "edit"), "", 0, $path[$i]["type"], ilUtil::getImagePath("icon_pg_s.png")); break; } } } $ilCtrl->setParameter($this, "obj_id", $_GET["obj_id"]); $tpl->setLocator(); }