5 require_once(
"./Modules/Scorm2004/classes/seq_editor/class.ilSCORM2004SeqNode.php");
41 $this->rootLevel = $a_rootlevel;
43 if ($a_treeid != null)
45 $this->treeNodeId = $a_treeid;
47 $this->dom =
new DOMDocument();
122 $this->importSeqXml = $a_val;
127 $this->seqNodeId = $a_seqnodeid;
132 $this->treeNodeId = $a_tree_node;
137 $this->sequencingId = $a_seq_id;
142 $this->nocopy = $a_nocopy;
147 $this->nodelete = $a_nodelete ;
152 $this->nomove = $a_nomove;
157 $this->importid = $a_importid;
162 $this->seqXml = $a_seqxml;
172 $this->rootLevel = $a_rootlevel;
178 $query =
"SELECT * FROM sahs_sc13_seq_item WHERE sahs_sc13_tree_node_id = ".
179 $ilDB->quote($a_node_id,
"integer").
180 " AND rootlevel = ".$ilDB->quote(
false,
"integer");
181 $obj_set = $ilDB->query(
$query);
183 return array(
"copy"=>!$obj_rec[
'nocopy'],
"move"=>!$obj_rec[
'nomove'],
"delete"=>!$obj_rec[
'nodelete']);
197 $element = $this->dom->createElement(
'sequencing');
198 $this->dom->appendChild($element);
214 $xpath_obj =
new DOMXPath($this->dom);
215 $obj_node_list = $xpath_obj->query(
'//objective | //primaryObjective');
216 for ($i=0;$i<$obj_node_list->length;$i++) {
217 $obj_node_list->item($i)->removeAttribute(
"title");
219 $output = $this->dom->saveXML();
221 $output = preg_replace(
'/<\?xml version="1.0"\?>/',
'',$output);
224 $output = preg_replace(
'/(<)([a-z]+|[A-Z]+)/',
'<imsss:$2',$output);
225 $output = preg_replace(
'/(<\/)([a-z]+|[A-Z]+)/',
'</imsss:$2',$output);
227 $output = preg_replace(
'/\n/',
'',$output);
238 $query =
"SELECT * FROM sahs_sc13_seq_item WHERE (sahs_sc13_tree_node_id = ".$ilDB->quote($this->treeNodeId,
"integer").
239 " AND rootlevel =".$ilDB->quote($this->rootLevel,
"integer").
")";
240 $obj_set = $ilDB->query(
$query);
241 $obj_rec = $ilDB->fetchAssoc($obj_set);
242 $this->seqXml = $obj_rec[
'seqxml'];
243 $this->importSeqXml = $obj_rec[
'importseqxml'];
244 $this->importId = $obj_rec[
'importid'];
245 $this->nocopy = $obj_rec[
'nocopy'];
246 $this->nomove = $obj_rec[
'nomove'];
247 $this->nodelete = $obj_rec[
'nodelete'];
261 public function delete($a_insert_node =
false)
265 $query =
"DELETE FROM sahs_sc13_seq_item".
" WHERE (sahs_sc13_tree_node_id = ".$ilDB->quote($this->treeNodeId,
"integer").
266 " AND rootlevel=".$ilDB->quote($this->rootLevel,
"integer").
")";
267 $obj_set = $ilDB->manipulate(
$query);
277 $ilDB->replace(
"sahs_sc13_seq_item",
278 array(
"sahs_sc13_tree_node_id" => array(
"integer", $this->treeNodeId),
279 "rootlevel" => array(
"integer", $this->rootLevel)),
281 "importid" => array(
"text", $this->importId),
282 "seqnodeid" => array(
"integer", (
int) $this->seqNodeId),
283 "sequencingid" => array(
"text", $this->sequencingId),
284 "nocopy" => array(
"integer", $this->nocopy),
285 "nodelete" => array(
"integer", $this->nodelete),
286 "nomove" => array(
"integer", $this->nomove),
287 "seqxml" => array(
"clob", $this->dom->saveXML()),