public function parentHasSeqTemplate($a_slm_id)
 {
     require_once "./Modules/Scorm2004/classes/seq_editor/class.ilSCORM2004SeqTemplate.php";
     global $ilDB, $ilLog;
     $has_template = false;
     $mtree = new ilTree($a_slm_id);
     $mtree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
     $mtree->setTreeTablePK("slm_id");
     //get all parents for current node
     $parents = $this->getParentsForNode($a_parents = array(), $this->id);
     for ($i = 0; $i < count($parents); $i++) {
         $template = ilSCORM2004SeqTemplate::templateForChapter($parents[$i]);
         if ($template) {
             $has_template = true;
             break;
         }
     }
     return $has_template;
 }
 /**
  * Insert sequencing scenario at node
  */
 function insertScenario()
 {
     global $ilCtrl;
     include_once "./Modules/Scorm2004/classes/class.ilSCORM2004OrganizationHFormGUI.php";
     $slm_tree =& new ilTree($this->object->getId());
     $slm_tree->setTreeTablePK("slm_id");
     $slm_tree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
     $node_id = $_POST["node_id"];
     include_once "./Modules/Scorm2004/classes/class.ilSCORM2004PageNode.php";
     include_once "./Modules/Scorm2004/classes/class.ilSCORM2004Node.php";
     include_once "./Modules/Scorm2004/classes/seq_editor/class.ilSCORM2004SeqTemplate.php";
     if (!$_POST["first_child"]) {
         $parent_id = $slm_tree->getParentId($node_id);
         $target = $node_id;
     } else {
         $parent_id = $node_id;
         $target = IL_FIRST_NODE;
     }
     $template = new ilSCORM2004SeqTemplate($_POST["identifier"]);
     $id = $template->insertTemplateForObjectAtParent($this->object, $parent_id, $target);
     $ilCtrl->setParameter($this, "highlight", $id);
     $ilCtrl->redirect($this, "showOrganization", "node_" . $node_id);
 }
 /**
  * Show Sequencing
  */
 function showProperties()
 {
     include_once "./Modules/Scorm2004/classes/seq_editor/class.ilSCORM2004Objective.php";
     include_once "./Modules/Scorm2004/classes/seq_editor/class.ilSCORM2004SeqTemplate.php";
     global $tpl;
     $this->setTabs();
     $this->setLocator();
     $tpl->addBlockfile("ADM_CONTENT", "adm_content", "tpl.scormeditor_chapter_properties.html", "Modules/Scorm2004");
     $template = ilSCORM2004SeqTemplate::templateForChapter($this->node_object->getId());
     if ($template) {
         $item_data = $template->getMetadataProperties();
         $tpl->setVariable("VAL_DESCRIPTION", $item_data['description']);
         $tpl->setVariable("VAL_TITLE", $item_data['title']);
         $tpl->setVariable("VAL_IMAGE", ilSCORM2004SeqTemplate::SEQ_TEMPLATE_DIR . "/images/" . $item_data['thumbnail']);
     } else {
         $tpl->setContent("No didactical scenario assigned.");
     }
 }