/** * write item hierarchy (Recursive Style) * */ function writeItemHierarchyRec($tree, $a_parent_node) { foreach ($tree->getFilteredChilds(array('page'), $a_parent_node) as $obj) { if ($obj['type'] == '') { continue; } $attrs = array(); $attrs["identifier"] = "il_" . IL_INST_ID . "_" . $obj['type'] . "_" . $obj['obj_id']; if ($obj['type'] == 'sco' || $obj['type'] == 'ass') { $attrs["identifierref"] = $attrs["identifier"] . "_ref"; } $this->writer->xmlStartTag("item", $attrs); $attrs = array(); $this->writer->xmlElement("title", $attrs, $obj['title']); if ($tree->getFilteredChilds(array('page'), $obj['obj_id'])) { $this->writeItemHierarchyRec($tree, $obj['obj_id']); } if ($this->version == "2004") { if ($obj['type'] == 'sco' || $obj['type'] == 'ass') { $this->writer->xmlStartTag("metadata"); $this->writer->xmlElement("adlcp:location", null, $obj['obj_id'] . "/indexMD.xml"); $this->writer->xmlEndTag("metadata"); } require_once "./Modules/Scorm2004/classes/seq_editor/class.ilSCORM2004Item.php"; $seq_item = new ilSCORM2004Item($obj['obj_id']); $this->writer->xmlData($this->writer->xmlFormatData($seq_item->exportAsXML()), false, false); } $this->writer->xmlEndTag("item"); } }
/** * Show Sequencing */ function showSequencing() { global $tpl, $lng, $ilTabs, $ilToolbar, $ilCtrl; $ilTabs->setTabActive("sahs_sequencing"); include_once "./Modules/Scorm2004/classes/seq_editor/class.ilSCORM2004Item.php"; if (!$this->object->getSequencingExpertMode()) { $ilToolbar->addButton($lng->txt("sahs_activate_expert_mode"), $ilCtrl->getLinkTarget($this, "confirmExpertMode")); } else { include_once "./Services/UIComponent/NestedList/classes/class.ilNestedList.php"; $list = new ilNestedList(); $t = $this->object->getTree(); $root_node = $t->getNodeData($t->getRootId()); $nodes = $this->object->getTree()->getSubtree($root_node); foreach ($nodes as $node) { if (in_array($node["type"], array("", "chap", "sco"))) { $ntpl = new ilTemplate("tpl.seq_node.html", true, true, "Modules/Scorm2004"); $ntpl->setVariable("NODE_ID", $node["child"]); if ($node["type"] == "") { $ntpl->setVariable("TITLE", $this->object->getTitle()); $item = new ilSCORM2004Item($this->object->getId(), true); } else { $ntpl->setVariable("TITLE", $node["title"]); $item = new ilSCORM2004Item($node["child"]); } $ntpl->setVariable("SEQ_INFO", ilUtil::prepareFormOutput($item->exportAsXML(false))); $list->addListNode($ntpl->get(), $node["child"], $node["parent"]); } } $tb = new ilToolbarGUI(); $tb->addFormButton($lng->txt("save"), "saveSequencing"); $ftpl = new ilTemplate("tpl.sequencing.html", true, true, "Modules/Scorm2004"); $ftpl->setVariable("CONTENT", $list->getHTML()); $ftpl->setVariable("FORM_ACTION", $ilCtrl->getFormAction($this)); $ftpl->setVariable("TB", $tb->getHTML()); $tpl->setContent($ftpl->get()); } }