ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
ilSCORM2004Item Class Reference

Class ilSCORM2004Condition. More...

+ Inheritance diagram for ilSCORM2004Item:
+ Collaboration diagram for ilSCORM2004Item:

Public Member Functions

 ilSCORM2004Item ($a_treeid=null, $a_rootlevel=false)
 Constructor public. More...
 
 getSeqNodeId ()
 
 getTreeNodeId ()
 
 getSequencingId ()
 
 getImportId ()
 
 getNocopy ()
 
 getNodelete ()
 
 getNomove ()
 
 getSeqXml ()
 
 getRoolLevel ()
 
 getImportSeqXml ()
 Get import seq xml. More...
 
 setImportSeqXml ($a_val)
 Set import seq xml. More...
 
 setSeqNodeId ($a_seqnodeid)
 
 setTreeNodeId ($a_tree_node)
 
 setSequencingId ($a_seq_id)
 
 setNocopy ($a_nocopy)
 
 setNodelete ($a_nodelete)
 
 setNomove ($a_nomove)
 
 setImportId ($a_importid)
 
 setSeqXml ($a_seqxml)
 
 setDom ($a_dom)
 
 setRootLevel ($a_rootlevel)
 
 initDom ()
 Init dom. More...
 
 exportAsXML ($add_prefix=true)
 Get sequencing information for export (use imsss namespace prefix) More...
 
 loadItem ()
 Read data from DB into object. More...
 
 update ()
 Update item. More...
 
 delete ($a_insert_node=false)
 Delete item. More...
 
 insert ($import=false)
 Insert/replace sequencing item in db. More...
 

Static Public Member Functions

static getAllowedActions ($a_node_id)
 

Protected Attributes

 $dom = null
 

Private Attributes

 $id = null
 
 $seqNodeId = null
 
 $treeNodeId = null
 
 $sequencingId = null
 
 $nocopy = false
 
 $nodelete = false
 
 $nomove = false
 
 $importId = null
 
 $seqXml = null
 
 $importSeqXml = null
 
 $rootLevel = false
 

Detailed Description

Class ilSCORM2004Condition.

Sequencing Template class for SCORM 2004 Editing

Author
Hendrik Holtmann holtm.nosp@m.ann@.nosp@m.me.co.nosp@m.m
Version
$Id$

Definition at line 17 of file class.ilSCORM2004Item.php.

Member Function Documentation

◆ delete()

ilSCORM2004Item::delete (   $a_insert_node = false)

Delete item.

Definition at line 261 of file class.ilSCORM2004Item.php.

References $ilDB, and $query.

262  {
263  global $ilDB;
264 
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);
268  }
global $ilDB

◆ exportAsXML()

ilSCORM2004Item::exportAsXML (   $add_prefix = true)

Get sequencing information for export (use imsss namespace prefix)

Returns
string sequencing xml

Definition at line 209 of file class.ilSCORM2004Item.php.

210  {
211  // remove titles
212  // @todo: the objectives (titles) text should be stored outside of
213  // the sequencing information in the future
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");
218  }
219  $output = $this->dom->saveXML();
220 
221  $output = preg_replace('/<\?xml version="1.0"\?>/','',$output);
222  if ($add_prefix)
223  {
224  $output = preg_replace('/(<)([a-z]+|[A-Z]+)/','<imsss:$2',$output);
225  $output = preg_replace('/(<\/)([a-z]+|[A-Z]+)/','</imsss:$2',$output);
226  }
227  $output = preg_replace('/\n/','',$output);
228 
229  return $output;
230  }

◆ getAllowedActions()

static ilSCORM2004Item::getAllowedActions (   $a_node_id)
static

Definition at line 175 of file class.ilSCORM2004Item.php.

References $ilDB, $ilLog, $query, and DB_FETCHMODE_ASSOC.

176  {
177  global $ilDB,$ilLog;
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);
182  $obj_rec = $obj_set->fetchRow(DB_FETCHMODE_ASSOC);
183  return array("copy"=>!$obj_rec['nocopy'],"move"=>!$obj_rec['nomove'],"delete"=>!$obj_rec['nodelete']);
184  }
const DB_FETCHMODE_ASSOC
Definition: class.ilDB.php:10
global $ilDB

◆ getImportId()

ilSCORM2004Item::getImportId ( )

Definition at line 72 of file class.ilSCORM2004Item.php.

References $importId.

73  {
74  return $this->importId;
75  }

◆ getImportSeqXml()

ilSCORM2004Item::getImportSeqXml ( )

Get import seq xml.

Returns
string xml

Definition at line 106 of file class.ilSCORM2004Item.php.

References $importSeqXml.

Referenced by insert().

107  {
108  return $this->importSeqXml;
109  }
+ Here is the caller graph for this function:

◆ getNocopy()

ilSCORM2004Item::getNocopy ( )

Definition at line 76 of file class.ilSCORM2004Item.php.

References $nocopy.

77  {
78  return $this->nocopy;
79  }

◆ getNodelete()

ilSCORM2004Item::getNodelete ( )

Definition at line 81 of file class.ilSCORM2004Item.php.

References $nodelete.

82  {
83  return $this->nodelete;
84  }

◆ getNomove()

ilSCORM2004Item::getNomove ( )

Definition at line 86 of file class.ilSCORM2004Item.php.

References $nomove.

87  {
88  return $this->nomove;
89  }

◆ getRoolLevel()

ilSCORM2004Item::getRoolLevel ( )

Definition at line 96 of file class.ilSCORM2004Item.php.

References $rootLevel.

97  {
98  return $this->rootLevel;
99  }

◆ getSeqNodeId()

ilSCORM2004Item::getSeqNodeId ( )

Definition at line 56 of file class.ilSCORM2004Item.php.

References $seqNodeId.

57  {
58  return $this->seqNodeId;
59  }

◆ getSequencingId()

ilSCORM2004Item::getSequencingId ( )

Definition at line 67 of file class.ilSCORM2004Item.php.

References $sequencingId.

68  {
69  return $this->sequencingId;
70  }

◆ getSeqXml()

ilSCORM2004Item::getSeqXml ( )

Definition at line 91 of file class.ilSCORM2004Item.php.

References $seqXml.

Referenced by initDom().

92  {
93  return $this->seqXml;
94  }
+ Here is the caller graph for this function:

◆ getTreeNodeId()

ilSCORM2004Item::getTreeNodeId ( )

Definition at line 61 of file class.ilSCORM2004Item.php.

References $treeNodeId.

62  {
63  return $this->treeNodeId;
64  }

◆ ilSCORM2004Item()

ilSCORM2004Item::ilSCORM2004Item (   $a_treeid = null,
  $a_rootlevel = false 
)

Constructor public.

Definition at line 38 of file class.ilSCORM2004Item.php.

References initDom(), and loadItem().

Referenced by ilSCORM2004Objective\fetchAllObjectives().

39  {
40  //different handling for organization level
41  $this->rootLevel = $a_rootlevel;
42 
43  if ($a_treeid != null)
44  {
45  $this->treeNodeId = $a_treeid;
46  $this->loadItem();
47  $this->dom = new DOMDocument();
48  $this->initDom();
49  }
50  }
loadItem()
Read data from DB into object.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initDom()

ilSCORM2004Item::initDom ( )

Init dom.

Definition at line 189 of file class.ilSCORM2004Item.php.

References getSeqXml(), and setSeqXml().

Referenced by ilSCORM2004Item().

190  {
191  if ($this->getSeqXml() != "")
192  {
193  $this->dom->loadXML($this->getSeqXml());
194  }
195  else
196  {
197  $element = $this->dom->createElement('sequencing');
198  $this->dom->appendChild($element);
199  $this->setSeqXml($this->dom->saveXML());
200  }
201  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insert()

ilSCORM2004Item::insert (   $import = false)

Insert/replace sequencing item in db.

Definition at line 273 of file class.ilSCORM2004Item.php.

References $ilDB, and getImportSeqXml().

Referenced by update().

274  {
275  global $ilDB;
276 
277  $ilDB->replace("sahs_sc13_seq_item",
278  array("sahs_sc13_tree_node_id" => array("integer", $this->treeNodeId),
279  "rootlevel" => array("integer", $this->rootLevel)),
280  array(
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()),
288  "importseqxml" => array("clob", $this->getImportSeqXml())
289  ));
290  return true;
291  }
global $ilDB
getImportSeqXml()
Get import seq xml.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadItem()

ilSCORM2004Item::loadItem ( )

Read data from DB into object.

Definition at line 235 of file class.ilSCORM2004Item.php.

References $ilDB, and $query.

Referenced by ilSCORM2004Item().

236  {
237  global $ilDB;
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'];
248  }
global $ilDB
+ Here is the caller graph for this function:

◆ setDom()

ilSCORM2004Item::setDom (   $a_dom)

Definition at line 165 of file class.ilSCORM2004Item.php.

166  {
167  $this->dom = $a_dom;
168  }

◆ setImportId()

ilSCORM2004Item::setImportId (   $a_importid)

Definition at line 155 of file class.ilSCORM2004Item.php.

156  {
157  $this->importid = $a_importid;
158  }

◆ setImportSeqXml()

ilSCORM2004Item::setImportSeqXml (   $a_val)

Set import seq xml.

Parameters
string$a_valxml

Definition at line 120 of file class.ilSCORM2004Item.php.

121  {
122  $this->importSeqXml = $a_val;
123  }

◆ setNocopy()

ilSCORM2004Item::setNocopy (   $a_nocopy)

Definition at line 140 of file class.ilSCORM2004Item.php.

141  {
142  $this->nocopy = $a_nocopy;
143  }

◆ setNodelete()

ilSCORM2004Item::setNodelete (   $a_nodelete)

Definition at line 145 of file class.ilSCORM2004Item.php.

146  {
147  $this->nodelete = $a_nodelete ;
148  }

◆ setNomove()

ilSCORM2004Item::setNomove (   $a_nomove)

Definition at line 150 of file class.ilSCORM2004Item.php.

151  {
152  $this->nomove = $a_nomove;
153  }

◆ setRootLevel()

ilSCORM2004Item::setRootLevel (   $a_rootlevel)

Definition at line 170 of file class.ilSCORM2004Item.php.

171  {
172  $this->rootLevel = $a_rootlevel;
173  }

◆ setSeqNodeId()

ilSCORM2004Item::setSeqNodeId (   $a_seqnodeid)

Definition at line 125 of file class.ilSCORM2004Item.php.

126  {
127  $this->seqNodeId = $a_seqnodeid;
128  }

◆ setSequencingId()

ilSCORM2004Item::setSequencingId (   $a_seq_id)

Definition at line 135 of file class.ilSCORM2004Item.php.

136  {
137  $this->sequencingId = $a_seq_id;
138  }

◆ setSeqXml()

ilSCORM2004Item::setSeqXml (   $a_seqxml)

Definition at line 160 of file class.ilSCORM2004Item.php.

Referenced by initDom().

161  {
162  $this->seqXml = $a_seqxml;
163  }
+ Here is the caller graph for this function:

◆ setTreeNodeId()

ilSCORM2004Item::setTreeNodeId (   $a_tree_node)

Definition at line 130 of file class.ilSCORM2004Item.php.

131  {
132  $this->treeNodeId = $a_tree_node;
133  }

◆ update()

ilSCORM2004Item::update ( )

Update item.

Definition at line 253 of file class.ilSCORM2004Item.php.

References insert().

254  {
255  $this->insert();
256  }
insert($import=false)
Insert/replace sequencing item in db.
+ Here is the call graph for this function:

Field Documentation

◆ $dom

ilSCORM2004Item::$dom = null
protected

Definition at line 32 of file class.ilSCORM2004Item.php.

◆ $id

ilSCORM2004Item::$id = null
private

Definition at line 20 of file class.ilSCORM2004Item.php.

◆ $importId

ilSCORM2004Item::$importId = null
private

Definition at line 27 of file class.ilSCORM2004Item.php.

Referenced by getImportId().

◆ $importSeqXml

ilSCORM2004Item::$importSeqXml = null
private

Definition at line 29 of file class.ilSCORM2004Item.php.

Referenced by getImportSeqXml().

◆ $nocopy

ilSCORM2004Item::$nocopy = false
private

Definition at line 24 of file class.ilSCORM2004Item.php.

Referenced by getNocopy().

◆ $nodelete

ilSCORM2004Item::$nodelete = false
private

Definition at line 25 of file class.ilSCORM2004Item.php.

Referenced by getNodelete().

◆ $nomove

ilSCORM2004Item::$nomove = false
private

Definition at line 26 of file class.ilSCORM2004Item.php.

Referenced by getNomove().

◆ $rootLevel

ilSCORM2004Item::$rootLevel = false
private

Definition at line 30 of file class.ilSCORM2004Item.php.

Referenced by getRoolLevel().

◆ $seqNodeId

ilSCORM2004Item::$seqNodeId = null
private

Definition at line 21 of file class.ilSCORM2004Item.php.

Referenced by getSeqNodeId().

◆ $sequencingId

ilSCORM2004Item::$sequencingId = null
private

Definition at line 23 of file class.ilSCORM2004Item.php.

Referenced by getSequencingId().

◆ $seqXml

ilSCORM2004Item::$seqXml = null
private

Definition at line 28 of file class.ilSCORM2004Item.php.

Referenced by getSeqXml().

◆ $treeNodeId

ilSCORM2004Item::$treeNodeId = null
private

Definition at line 22 of file class.ilSCORM2004Item.php.

Referenced by getTreeNodeId().


The documentation for this class was generated from the following file: