ILIAS  Release_4_4_x_branch Revision 61816
 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 ()
 getImportSeqXml ()
 Get import seq xml.
 setImportSeqXml ($a_val)
 Set import seq xml.
 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.
 exportAsXML ($add_prefix=true)
 Get sequencing information for export (use imsss namespace prefix)
 loadItem ()
 Read data from DB into object.
 update ()
 Update item.
 delete ($a_insert_node=false)
 Delete item.
 insert ($import=false)
 Insert/replace sequencing item in db.

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

ilSCORM2004Item::delete (   $a_insert_node = false)

Delete item.

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

References $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 (   $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.

{
// remove titles
// @todo: the objectives (titles) text should be stored outside of
// the sequencing information in the future
$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);
if ($add_prefix)
{
$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 175 of file class.ilSCORM2004Item.php.

References $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").
" AND rootlevel = ".$ilDB->quote(false, "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 72 of file class.ilSCORM2004Item.php.

References $importId.

{
}
ilSCORM2004Item::getImportSeqXml ( )

Get import seq xml.

Returns
string xml

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

References $importSeqXml.

Referenced by insert().

{
}

+ Here is the caller graph for this function:

ilSCORM2004Item::getNocopy ( )

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

References $nocopy.

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

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

References $nodelete.

{
}
ilSCORM2004Item::getNomove ( )

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

References $nomove.

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

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

References $rootLevel.

{
}
ilSCORM2004Item::getSeqNodeId ( )

Reimplemented in ilSCORM2004Sequencing.

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

References $seqNodeId.

{
}
ilSCORM2004Item::getSequencingId ( )

Reimplemented in ilSCORM2004Sequencing.

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

References $sequencingId.

{
}
ilSCORM2004Item::getSeqXml ( )

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

References $seqXml.

Referenced by initDom().

{
return $this->seqXml;
}

+ Here is the caller graph for this function:

ilSCORM2004Item::getTreeNodeId ( )

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

References $treeNodeId.

{
}
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(), 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();
$this->initDom();
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilSCORM2004Item::initDom ( )

Init dom.

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

References getSeqXml(), and setSeqXml().

Referenced by ilSCORM2004Item().

{
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)

Insert/replace sequencing item in db.

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

References getImportSeqXml().

Referenced by update().

{
global $ilDB;
$ilDB->replace("sahs_sc13_seq_item",
array("sahs_sc13_tree_node_id" => array("integer", $this->treeNodeId),
"rootlevel" => array("integer", $this->rootLevel)),
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("clob", $this->dom->saveXML()),
"importseqxml" => array("clob", $this->getImportSeqXml())
));
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilSCORM2004Item::loadItem ( )

Read data from DB into object.

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

References $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->importSeqXml = $obj_rec['importseqxml'];
$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 165 of file class.ilSCORM2004Item.php.

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

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

{
$this->importid = $a_importid;
}
ilSCORM2004Item::setImportSeqXml (   $a_val)

Set import seq xml.

Parameters
string$a_valxml

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

{
$this->importSeqXml = $a_val;
}
ilSCORM2004Item::setNocopy (   $a_nocopy)

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

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

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

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

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

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

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

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

Reimplemented in ilSCORM2004Sequencing, and ilSCORM2004Objective.

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

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

Reimplemented in ilSCORM2004Sequencing.

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

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

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

Referenced by initDom().

{
$this->seqXml = $a_seqxml;
}

+ Here is the caller graph for this function:

ilSCORM2004Item::setTreeNodeId (   $a_tree_node)

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

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

Update item.

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

References insert().

Referenced by ilSCORM2004Objective\updateObjective().

{
$this->insert();
}

+ 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 32 of file class.ilSCORM2004Item.php.

ilSCORM2004Item::$id = null
private

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

ilSCORM2004Item::$importId = null
private

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

Referenced by getImportId().

ilSCORM2004Item::$importSeqXml = null
private

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

Referenced by getImportSeqXml().

ilSCORM2004Item::$nocopy = false
private

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

Referenced by getNocopy().

ilSCORM2004Item::$nodelete = false
private

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

Referenced by getNodelete().

ilSCORM2004Item::$nomove = false
private

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

Referenced by getNomove().

ilSCORM2004Item::$rootLevel = false
private

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

Referenced by getRoolLevel().

ilSCORM2004Item::$seqNodeId = null
private

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

Referenced by getSeqNodeId().

ilSCORM2004Item::$sequencingId = null
private

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

Referenced by getSequencingId().

ilSCORM2004Item::$seqXml = null
private

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

Referenced by getSeqXml().

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: