ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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 @access 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 ()
 
 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...
 
- Protected Attributes inherited from ilSCORM2004Node
 $db
 
 $user
 

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 @access public.

Reimplemented from ilSCORM2004Node.

Reimplemented in ilSCORM2004SeqChapter.

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

26 {
27 parent::__construct($a_slm_object, $a_id);
28 $this->setType("chap");
29 }
setType($a_type)
Set type.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ILIAS\GlobalScreen\Provider\__construct(), and ilSCORM2004Node\setType().

+ Here is the call graph for this function:

Member Function Documentation

◆ copy()

ilSCORM2004Chapter::copy (   $a_target_slm)

Copy chapter.

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

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

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

+ Here is the call graph for this function:

◆ create()

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

Create asset.

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

67 {
68 include_once("./Modules/Scorm2004/classes/seq_editor/class.ilSCORM2004Item.php");
69 include_once("./Modules/Scorm2004/classes/seq_editor/class.ilSCORM2004Objective.php");
70 parent::create($a_upload);
71 if (!$a_template) {
73 }
74 }
insertDefaultSequencingItem()
Insert default sequencing item.

References insertDefaultSequencingItem().

+ 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.

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)

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

+ 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.

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

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

Referenced by delete().

+ 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 119 of file class.ilSCORM2004Chapter.php.

120 {
121 // @todo
122 }

◆ 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 131 of file class.ilSCORM2004Chapter.php.

132 {
133 include_once("Services/MetaData/classes/class.ilMD2XML.php");
134 $md2xml = new ilMD2XML($this->getSLMId(), $this->getId(), $this->getType());
135 $md2xml->setExportMode(true);
136 $md2xml->startExport();
137 $a_xml_writer->appendXML($md2xml->getXML());
138 }

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

+ Here is the call graph for this function:

◆ insertDefaultSequencingItem()

ilSCORM2004Chapter::insertDefaultSequencingItem ( )

Insert default sequencing item.

Parameters

return

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

83 {
84 $seq_item = new ilSCORM2004Item($this->getId());
85 $seq_item->setDefaultXml(true);
86 $seq_item->insert();
87 }
Class ilSCORM2004Condition.

References ilSCORM2004Node\getId().

Referenced by create().

+ 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: