ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilSCORM2004Chapter Class Reference

Class ilSCORM2004Chapter. More...

+ Inheritance diagram for ilSCORM2004Chapter:
+ Collaboration diagram for ilSCORM2004Chapter:

Public Member Functions

 __construct ($a_slm_object, $a_id=0)
 Constructor public. More...
 
 delete ($a_delete_meta_data=true)
 Delete a chapter. More...
 
 create ($a_upload=false, $a_template=false)
 Create asset. More...
 
 insertDefaultSequencingItem ()
 Insert default sequencing item. More...
 
 copy ($a_target_slm)
 Copy chapter. More...
 
 exportXML (&$a_xml_writer, $a_inst, &$expLog)
 Export object to xml (see ilias_co.dtd) More...
 
 exportXMLMetaData (&$a_xml_writer)
 export structure objects meta data to xml (see ilias_co.dtd) More...
 
- Public Member Functions inherited from ilSCORM2004Node
 __construct ($a_slm_object, $a_id=0)
 
 setTitle ($a_title)
 Set title. More...
 
 getTitle ()
 Get title. More...
 
 setDescription ($a_description)
 Set description. More...
 
 getDescription ()
 Get description. More...
 
 setType ($a_type)
 Set type. More...
 
 getType ()
 Get type. More...
 
 setSLMId ($a_slm_id)
 Set ID of parent Scorm Learning Module Object. More...
 
 getSLMId ()
 Get ID of parent Scorm Learning Module Object. More...
 
 setSLMObject ($a_slm_obj)
 Set Scorm Learning Module Object. More...
 
 getSLMObject ()
 Get scorm learning module object. More...
 
 getContentObject ()
 Get Scorm Learning Module Object. More...
 
 setId ($a_id)
 Set Node ID. More...
 
 getId ()
 Get Node ID. More...
 
 getImportId ()
 Set Import ID. More...
 
 setImportId ($a_id)
 Get Import ID. More...
 
 read ()
 Read Data of Node. More...
 
 MDUpdateListener ($a_element)
 Meta data update listener. More...
 
 createMetaData ()
 create meta data entry More...
 
 updateMetaData ()
 update meta data entry More...
 
 deleteMetaData ()
 delete meta data entry More...
 
 setDataRecord ($a_record)
 this method should only be called by class ilSCORM2004NodeFactory More...
 
 create ($a_upload=false)
 Create Node. More...
 
 update ()
 Update Node. More...
 
 delete ()
 Delete Node. More...
 
 getObjectives ()
 
 deleteSeqInfo ()
 
 parentHasSeqTemplate ()
 
 exportAsScorm12 ()
 
 exportAsScorm13 ()
 

Data Fields

 $tree
 
- Data Fields inherited from ilSCORM2004Node
 $slm_id
 
 $type
 
 $id
 
 $slm_object
 

Private Member Functions

 delete_rec ($a_delete_meta_data=true)
 Delete data records of chapter (and nested objects) More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ilSCORM2004Node
static _lookupTitle ($a_obj_id)
 Lookup Title. More...
 
static _lookupType ($a_obj_id)
 Lookup Type. More...
 
static _writeTitle ($a_obj_id, $a_title)
 Write Title. More...
 
static _writeImportId ($a_id, $a_import_id)
 Write import ID. More...
 
static _getIdForImportId ($a_import_id)
 Get Node ID for import ID (static) More...
 
static _exists ($a_id)
 Checks wether a node exists. More...
 
static _deleteAllSLMNodes ($a_slm_object)
 Delete all nodes of Scorm Learning Module. More...
 
static _lookupSLMID ($a_id)
 Lookup Scorm Learning Module ID for node id. More...
 
static putInTree ($a_obj, $a_parent_id="", $a_target_node_id="")
 put this object into content object tree More...
 
static getTree ($a_slm_obj_id)
 Get scorm module editing tree. More...
 
static clipboardCopy ($a_slm_obj_id, $a_ids)
 Copy a set of chapters/pages/scos into the clipboard. More...
 
static clipboardCut ($a_slm_obj_id, $a_ids)
 Cut and copy a set of chapters/pages into the clipboard. More...
 
static uniqueTypesCheck ($a_items)
 Check for unique types (all pages or all chapters or all scos) More...
 
static insertPageClip ($a_slm_obj)
 Insert pages from clipboard. More...
 
static insertAssetClip ($a_slm_obj, $a_type="ass")
 Insert assets from clipboard. More...
 
static insertScoClip ($a_slm_obj)
 Insert scos from clipboard. More...
 
static insertChapterClip ($a_slm_obj, $a_as_sub=false)
 Insert Chapter from clipboard. More...
 
static pasteTree ($a_target_slm, $a_item_id, $a_parent_id, $a_target, $a_insert_time, &$a_copied_nodes, $a_as_copy=false, $a_from_clipboard=true, $a_source_parent_type="")
 Paste item (tree) from clipboard or other learning module to target scorm learning module. More...
 

Detailed Description

Class ilSCORM2004Chapter.

Chapter class for SCORM 2004 Editing

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

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

Constructor & Destructor Documentation

◆ __construct()

ilSCORM2004Chapter::__construct (   $a_slm_object,
  $a_id = 0 
)

Constructor public.

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

References ilSCORM2004Node\setType().

26  {
27  parent::__construct($a_slm_object, $a_id);
28  $this->setType("chap");
29  }
setType($a_type)
Set type.
+ Here is the call graph for this function:

Member Function Documentation

◆ copy()

ilSCORM2004Chapter::copy (   $a_target_slm)

Copy chapter.

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

References ilSCORM2004Node\getDescription(), ilSCORM2004Node\getId(), ilSCORM2004Node\getSLMId(), ilSCORM2004Node\getTitle(), and ilSCORM2004Node\getType().

97  {
98  $chap = new ilSCORM2004Chapter($a_target_slm);
99  $chap->setTitle($this->getTitle());
100  if ($this->getSLMId() != $a_target_slm->getId())
101  {
102  $chap->setImportId("il__chap_".$this->getId());
103  }
104  $chap->setSLMId($a_target_slm->getId());
105  $chap->setType($this->getType());
106  $chap->setDescription($this->getDescription());
107  $chap->create(true);
108  $a_copied_nodes[$this->getId()] = $chap->getId();
109 
110  // copy meta data
111  include_once("Services/MetaData/classes/class.ilMD.php");
112  $md = new ilMD($this->getSLMId(), $this->getId(), $this->getType());
113  $new_md = $md->cloneMD($a_target_slm->getId(), $chap->getId(), $this->getType());
114 
115  return $chap;
116  }
Class ilSCORM2004Chapter.
getSLMId()
Get ID of parent Scorm Learning Module Object.
getDescription()
Get description.
+ Here is the call graph for this function:

◆ create()

ilSCORM2004Chapter::create (   $a_upload = false,
  $a_template = false 
)

Create asset.

Definition at line 70 of file class.ilSCORM2004Chapter.php.

References insertDefaultSequencingItem().

71  {
72  include_once("./Modules/Scorm2004/classes/seq_editor/class.ilSCORM2004Item.php");
73  include_once("./Modules/Scorm2004/classes/seq_editor/class.ilSCORM2004Objective.php");
74  parent::create($a_upload);
75  if (!$a_template) {
77  }
78  }
insertDefaultSequencingItem()
Insert default sequencing item.
+ Here is the call graph for this function:

◆ delete()

ilSCORM2004Chapter::delete (   $a_delete_meta_data = true)

Delete a chapter.

Definition at line 34 of file class.ilSCORM2004Chapter.php.

References delete_rec(), and ilSCORM2004Node\getId().

35  {
36  $node_data = $this->tree->getNodeData($this->getId());
37  $this->delete_rec($a_delete_meta_data);
38  $this->tree->deleteTree($node_data);
39  parent::deleteSeqInfo();
40  }
delete_rec($a_delete_meta_data=true)
Delete data records of chapter (and nested objects)
+ Here is the call graph for this function:

◆ delete_rec()

ilSCORM2004Chapter::delete_rec (   $a_delete_meta_data = true)
private

Delete data records of chapter (and nested objects)

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

References ilSCORM2004Node\getId(), and ilSCORM2004NodeFactory\getInstance().

Referenced by delete().

46  {
47  $childs = $this->tree->getChilds($this->getId());
48  foreach ($childs as $child)
49  {
50  $obj = ilSCORM2004NodeFactory::getInstance($this->slm_object, $child["obj_id"], false);
51  if (is_object($obj))
52  {
53  if ($obj->getType() == "chap")
54  {
55  $obj->delete_rec($a_tree, $a_delete_meta_data);
56  }
57  if ($obj->getType() == "sco")
58  {
59  $obj->delete($a_delete_meta_data);
60  }
61  }
62  unset($obj);
63  }
64  parent::delete($a_delete_meta_data);
65  }
static getInstance($a_slm_object, $a_id=0, $a_halt=true)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportXML()

ilSCORM2004Chapter::exportXML ( $a_xml_writer,
  $a_inst,
$expLog 
)

Export object to xml (see ilias_co.dtd)

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

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

125  {
126 // @todo
127  }

◆ exportXMLMetaData()

ilSCORM2004Chapter::exportXMLMetaData ( $a_xml_writer)

export structure objects meta data to xml (see ilias_co.dtd)

Parameters
object$a_xml_writerilXmlWriter object that receives the xml data

Definition at line 136 of file class.ilSCORM2004Chapter.php.

References ilSCORM2004Node\getId(), ilSCORM2004Node\getSLMId(), and ilSCORM2004Node\getType().

137  {
138  include_once("Services/MetaData/classes/class.ilMD2XML.php");
139  $md2xml = new ilMD2XML($this->getSLMId(), $this->getId(), $this->getType());
140  $md2xml->setExportMode(true);
141  $md2xml->startExport();
142  $a_xml_writer->appendXML($md2xml->getXML());
143  }
getSLMId()
Get ID of parent Scorm Learning Module Object.
+ Here is the call graph for this function:

◆ insertDefaultSequencingItem()

ilSCORM2004Chapter::insertDefaultSequencingItem ( )

Insert default sequencing item.

Parameters

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

References ilSCORM2004Node\getId().

Referenced by create().

87  {
88  $seq_item = new ilSCORM2004Item($this->getId());
89  $seq_item->setDefaultXml(true);
90  $seq_item->insert();
91  }
Class ilSCORM2004Condition.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $tree

ilSCORM2004Chapter::$tree

Definition at line 19 of file class.ilSCORM2004Chapter.php.


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