35 require_once(
"./Modules/Scorm2004/classes/seq_editor/class.ilSCORM2004SeqNode.php");
62 $this->rootLevel = $a_rootlevel;
64 if ($a_treeid !=null) {
65 $this->treeNodeId = $a_treeid;
67 $this->dom =
new DOMDocument();
71 $element = $this->dom->createElement(
'sequencing');
72 $this->dom->appendChild($element);
136 $this->seqNodeId = $a_seqnodeid;
141 $this->treeNodeId = $a_tree_node;
146 $this->sequencingId = $a_seq_id;
151 $this->nocopy = $a_nocopy;
156 $this->nodelete = $a_nodelete ;
161 $this->nomove = $a_nomove;
166 $this->importid = $a_importid;
171 $this->seqXml = $a_seqxml;
181 $this->rootLevel = $a_rootlevel;
187 $query =
"SELECT * FROM sahs_sc13_seq_item WHERE sahs_sc13_tree_node_id = ".
188 $ilDB->quote($a_node_id,
"integer");
189 $obj_set = $ilDB->query(
$query);
191 return array(
"copy"=>!$obj_rec[
'nocopy'],
"move"=>!$obj_rec[
'nomove'],
"delete"=>!$obj_rec[
'nodelete']);
201 $xpath_obj =
new DOMXPath($this->dom);
202 $obj_node_list = $xpath_obj->query(
'//objective | //primaryObjective');
203 for ($i=0;$i<$obj_node_list->length;$i++) {
204 $obj_node_list->item($i)->removeAttribute(
"title");
206 $output = $this->dom->saveXML();
207 $output = preg_replace(
'/<\?xml version="1.0"\?>/',
'',$output);
208 $output = preg_replace(
'/(<)([a-z]+|[A-Z]+)/',
'<imsss:$2',$output);
209 $output = preg_replace(
'/(<\/)([a-z]+|[A-Z]+)/',
'</imsss:$2',$output);
210 $output = preg_replace(
'/\n/',
'',$output);
221 $query =
"SELECT * FROM sahs_sc13_seq_item WHERE (sahs_sc13_tree_node_id = ".$ilDB->quote($this->treeNodeId,
"integer").
222 " AND rootlevel =".$ilDB->quote($this->rootLevel,
"integer").
")";
223 $obj_set = $ilDB->query(
$query);
224 $obj_rec = $ilDB->fetchAssoc($obj_set);
225 $this->seqXml = $obj_rec[
'seqxml'];
226 $this->importId = $obj_rec[
'importid'];
227 $this->nocopy = $obj_rec[
'nocopy'];
228 $this->nomove = $obj_rec[
'nomove'];
229 $this->nodelete = $obj_rec[
'nodelete'];
233 public function update($a_insert_node =
false)
243 public function delete($a_insert_node =
false)
246 $query =
"DELETE FROM sahs_sc13_seq_item".
" WHERE (sahs_sc13_tree_node_id = ".$ilDB->quote($this->treeNodeId,
"integer").
247 " AND rootlevel=".$ilDB->quote($this->rootLevel,
"integer").
")";
248 $obj_set = $ilDB->manipulate(
$query);
255 $ilDB->replace(
"sahs_sc13_seq_item",
256 array(
"sahs_sc13_tree_node_id" => array(
"integer", $this->treeNodeId)),
258 "importid" => array(
"text", $this->importId),
259 "seqnodeid" => array(
"integer", (
int) $this->seqNodeId),
260 "sequencingid" => array(
"text", $this->sequencingId),
261 "nocopy" => array(
"integer", $this->nocopy),
262 "nodelete" => array(
"integer", $this->nodelete),
263 "nomove" => array(
"integer", $this->nomove),
264 "seqxml" => array(
"text", $this->dom->saveXML()),
265 "rootlevel" => array(
"integer", $this->rootLevel)