ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups 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.
 getSeqNodeId ()
 getTreeNodeId ()
 getSequencingId ()
 getImportId ()
 getNocopy ()
 getNodelete ()
 getNomove ()
 getSeqXml ()
 getRoolLevel ()
 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)
 exportAsXML ()
 loadItem ()
 update ($a_insert_node=false)
 delete ($a_insert_node=false)
 insert ($import=false)

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
 $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 38 of file class.ilSCORM2004Item.php.

Member Function Documentation

ilSCORM2004Item::delete (   $a_insert_node = false)

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

References $ilDB, and $query.

{
global $ilDB;
$query = "DELETE FROM sahs_sc13_seq_item"." WHERE (sahs_sc13_tree_node_id = ".$ilDB->quote($this->treeNodeId, "integer").
" AND rootlevel=".$ilDB->quote($this->rootLevel, "integer").")";
$obj_set = $ilDB->manipulate($query);
}
ilSCORM2004Item::exportAsXML ( )

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

{
//remove titles
$xpath_obj = new DOMXPath($this->dom);
$obj_node_list = $xpath_obj->query('//objective | //primaryObjective');
for ($i=0;$i<$obj_node_list->length;$i++) {
$obj_node_list->item($i)->removeAttribute("title");
}
$output = $this->dom->saveXML();
$output = preg_replace('/<\?xml version="1.0"\?>/','',$output);
$output = preg_replace('/(<)([a-z]+|[A-Z]+)/','<imsss:$2',$output);
$output = preg_replace('/(<\/)([a-z]+|[A-Z]+)/','</imsss:$2',$output);
$output = preg_replace('/\n/','',$output);
return $output;
}
static ilSCORM2004Item::getAllowedActions (   $a_node_id)
static

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

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

{
global $ilDB,$ilLog;
$query = "SELECT * FROM sahs_sc13_seq_item WHERE sahs_sc13_tree_node_id = ".
$ilDB->quote($a_node_id, "integer");
$obj_set = $ilDB->query($query);
$obj_rec = $obj_set->fetchRow(DB_FETCHMODE_ASSOC);
return array("copy"=>!$obj_rec['nocopy'],"move"=>!$obj_rec['nomove'],"delete"=>!$obj_rec['nodelete']);
}
ilSCORM2004Item::getImportId ( )

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

References $importId.

{
}
ilSCORM2004Item::getNocopy ( )

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

References $nocopy.

{
return $this->nocopy;
}
ilSCORM2004Item::getNodelete ( )

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

References $nodelete.

{
}
ilSCORM2004Item::getNomove ( )

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

References $nomove.

{
return $this->nomove;
}
ilSCORM2004Item::getRoolLevel ( )

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

References $rootLevel.

{
}
ilSCORM2004Item::getSeqNodeId ( )

Reimplemented in ilSCORM2004Sequencing.

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

References $seqNodeId.

{
}
ilSCORM2004Item::getSequencingId ( )

Reimplemented in ilSCORM2004Sequencing.

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

References $sequencingId.

{
}
ilSCORM2004Item::getSeqXml ( )

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

References $seqXml.

Referenced by ilSCORM2004Item().

{
return $this->seqXml;
}

+ Here is the caller graph for this function:

ilSCORM2004Item::getTreeNodeId ( )

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

References $treeNodeId.

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

Constructor public.

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

References getSeqXml(), loadItem(), and setSeqXml().

Referenced by ilSCORM2004Objective\fetchAllObjectives(), ilSCORM2004Objective\ilSCORM2004Objective(), and ilSCORM2004Sequencing\ilSCORM2004Sequencing().

{
//different handling for organization level
$this->rootLevel = $a_rootlevel;
if ($a_treeid !=null) {
$this->treeNodeId = $a_treeid;
$this->loadItem();
$this->dom = new DOMDocument();
if ($this->getSeqXml()!="") {
$this->dom->loadXML($this->getSeqXml());
} else {
$element = $this->dom->createElement('sequencing');
$this->dom->appendChild($element);
$this->setSeqXml($this->dom->saveXML());
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilSCORM2004Item::insert (   $import = false)

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

References $ilDB.

Referenced by ilSCORM13Package\dbImportLM(), and update().

{
global $ilDB;
$ilDB->replace("sahs_sc13_seq_item",
array("sahs_sc13_tree_node_id" => array("integer", $this->treeNodeId)),
array(
"importid" => array("text", $this->importId),
"seqnodeid" => array("integer", (int) $this->seqNodeId),
"sequencingid" => array("text", $this->sequencingId),
"nocopy" => array("integer", $this->nocopy),
"nodelete" => array("integer", $this->nodelete),
"nomove" => array("integer", $this->nomove),
"seqxml" => array("text", $this->dom->saveXML()),
"rootlevel" => array("integer", $this->rootLevel)
));
/* $sql = "REPLACE INTO sahs_sc13_seq_item (`importid`,`seqnodeid`, `sahs_sc13_tree_node_id`".
", `sequencingid` ,`nocopy` ,`nodelete` ,`nomove`,`seqxml`,`rootlevel` )".
" values(".$ilDB->quote($this->importId).",".$ilDB->quote($this->seqNodeId).",".$ilDB->quote($this->treeNodeId).",".
$ilDB->quote($this->sequencingId).",".$ilDB->quote($this->nocopy).",".
$ilDB->quote($this->nodelete).",".$ilDB->quote($this->nomove).",".
$ilDB->quote($this->dom->saveXML()). ",".$ilDB->quote($this->rootLevel).");";
$result = $ilDB->query($sql);*/
return true;
}

+ Here is the caller graph for this function:

ilSCORM2004Item::loadItem ( )

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

References $ilDB, and $query.

Referenced by ilSCORM2004Item().

{
global $ilDB;
$query = "SELECT * FROM sahs_sc13_seq_item WHERE (sahs_sc13_tree_node_id = ".$ilDB->quote($this->treeNodeId, "integer").
" AND rootlevel =".$ilDB->quote($this->rootLevel, "integer").")";
$obj_set = $ilDB->query($query);
$obj_rec = $ilDB->fetchAssoc($obj_set);
$this->seqXml = $obj_rec['seqxml'];
$this->importId = $obj_rec['importid'];
$this->nocopy = $obj_rec['nocopy'];
$this->nomove = $obj_rec['nomove'];
$this->nodelete = $obj_rec['nodelete'];
}

+ Here is the caller graph for this function:

ilSCORM2004Item::setDom (   $a_dom)

Reimplemented in ilSCORM2004Sequencing, and ilSCORM2004Objective.

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

{
$this->dom = $a_dom;
}
ilSCORM2004Item::setImportId (   $a_importid)

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

{
$this->importid = $a_importid;
}
ilSCORM2004Item::setNocopy (   $a_nocopy)

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

{
$this->nocopy = $a_nocopy;
}
ilSCORM2004Item::setNodelete (   $a_nodelete)

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

{
$this->nodelete = $a_nodelete ;
}
ilSCORM2004Item::setNomove (   $a_nomove)

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

{
$this->nomove = $a_nomove;
}
ilSCORM2004Item::setRootLevel (   $a_rootlevel)

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

{
$this->rootLevel = $a_rootlevel;
}
ilSCORM2004Item::setSeqNodeId (   $a_seqnodeid)

Reimplemented in ilSCORM2004Sequencing, and ilSCORM2004Objective.

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

{
$this->seqNodeId = $a_seqnodeid;
}
ilSCORM2004Item::setSequencingId (   $a_seq_id)

Reimplemented in ilSCORM2004Sequencing.

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

{
$this->sequencingId = $a_seq_id;
}
ilSCORM2004Item::setSeqXml (   $a_seqxml)

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

Referenced by ilSCORM2004Item().

{
$this->seqXml = $a_seqxml;
}

+ Here is the caller graph for this function:

ilSCORM2004Item::setTreeNodeId (   $a_tree_node)

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

{
$this->treeNodeId = $a_tree_node;
}
ilSCORM2004Item::update (   $a_insert_node = false)

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

References insert().

Referenced by ilSCORM2004Objective\updateObjective().

{
$this->insert();
/*
global $ilDB;
$query = "UPDATE sahs_sc13_seq_item SET seqxml=".$ilDB->quote($this->dom->saveXML())." WHERE sahs_sc13_tree_node_id = ".$ilDB->quote($this->treeNodeId);
$obj_set = $ilDB->query($query);
*/
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilSCORM2004Item::$dom = null
protected

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

ilSCORM2004Item::$id = null
private

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

ilSCORM2004Item::$importId = null
private

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

Referenced by getImportId().

ilSCORM2004Item::$nocopy = false
private

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

Referenced by getNocopy().

ilSCORM2004Item::$nodelete = false
private

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

Referenced by getNodelete().

ilSCORM2004Item::$nomove = false
private

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

Referenced by getNomove().

ilSCORM2004Item::$rootLevel = false
private

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

Referenced by getRoolLevel().

ilSCORM2004Item::$seqNodeId = null
private

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

Referenced by getSeqNodeId().

ilSCORM2004Item::$sequencingId = null
private

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

Referenced by getSequencingId().

ilSCORM2004Item::$seqXml = null
private

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

Referenced by getSeqXml().

ilSCORM2004Item::$treeNodeId = null
private

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

Referenced by getTreeNodeId().


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