ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilSCORM2004PageNode Class Reference

Class ilSCORM2004PageNode. More...

+ Inheritance diagram for ilSCORM2004PageNode:
+ Collaboration diagram for ilSCORM2004PageNode:

Public Member Functions

 __construct ($a_slm_object, $a_id=0)
 Constructor @access public. More...
 
 __destruct ()
 Destructor. More...
 
 read ()
 Read data from database. More...
 
 create ($a_upload=false, $a_layout_id=0)
 Create Scorm Page. More...
 
 delete ($a_delete_meta_data=true)
 Delete Scorm Page. More...
 
 copy ($a_target_slm)
 copy page node More...
 
copyToOtherContObject (&$a_cont_obj)
 copy a page to another content object (learning module / dlib book) More...
 
 assignPageObject (&$a_page_obj)
 Assign page object. More...
 
getPageObject ()
 Get assigned page object. More...
 
 setId ($a_id)
 Set id. More...
 
 getId ()
 Get id. More...
 
 setAlias ($a_is_alias)
 Set wether page object is an alias. More...
 
 isAlias ()
 
 setOriginID ($a_id)
 
 getOriginID ()
 
 getMediaObjectIds ()
 get ids of all media objects within the page More...
 
 getFileItemIds ()
 get ids of all file items within the page 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 ()
 

Static Public Member Functions

static copyPageFromLM ($a_target_slm, $a_lm_page)
 Copy page from learning module. More...
 
- 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...
 

Data Fields

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

Additional Inherited Members

- Protected Attributes inherited from ilSCORM2004Node
 $db
 
 $user
 

Detailed Description

Class ilSCORM2004PageNode.

Handles Pages for SCORM 2004 Editing

Note: This class has a member variable that contains an instance of class ilSCORM2004Page and provides the method getPageObject() to access this instance. ilSCORM2004Page handles page objects and their content.

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

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

Constructor & Destructor Documentation

◆ __construct()

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

Constructor @access public.

Reimplemented from ilSCORM2004Node.

Definition at line 36 of file class.ilSCORM2004PageNode.php.

37 {
38 parent::__construct($a_slm_object, $a_id);
39 $this->setType("page");
40 $this->id = $a_id;
41
42 $this->mobs_contained = array();
43 $this->files_contained = array();
44
45 if ($a_id != 0) {
46 $this->read();
47 }
48 }
setType($a_type)
Set type.
read()
Read data from database.

References read(), and ilSCORM2004Node\setType().

+ Here is the call graph for this function:

◆ __destruct()

ilSCORM2004PageNode::__destruct ( )

Destructor.

Definition at line 53 of file class.ilSCORM2004PageNode.php.

54 {
55 if (is_object($this->page_object)) {
56 unset($this->page_object);
57 }
58 }

Member Function Documentation

◆ assignPageObject()

ilSCORM2004PageNode::assignPageObject ( $a_page_obj)

Assign page object.

Parameters
object$a_page_objpage object

Definition at line 205 of file class.ilSCORM2004PageNode.php.

206 {
207 $this->page_object = $a_page_obj;
208 }

◆ copy()

ilSCORM2004PageNode::copy (   $a_target_slm)

copy page node

Definition at line 108 of file class.ilSCORM2004PageNode.php.

109 {
110 // copy page
111 $slm_page = new ilSCORM2004PageNode($a_target_slm);
112 $slm_page->setTitle($this->getTitle());
113 $slm_page->setSLMId($a_target_slm->getId());
114 $slm_page->setType($this->getType());
115 $slm_page->setDescription($this->getDescription());
116 $slm_page->setImportId("il__page_" . $this->getId());
117 $slm_page->create(true); // setting "upload" flag to true prevents creating of meta data
118
119 // copy meta data
120 include_once("Services/MetaData/classes/class.ilMD.php");
121 $md = new ilMD($this->getSLMId(), $this->getId(), $this->getType());
122 $new_md = $md->cloneMD($a_target_slm->getId(), $slm_page->getId(), $this->getType());
123
124 // copy page content
125 $page = $slm_page->getPageObject();
126 // clone media objects, if source and target lm are not the same
127 $clone_mobs = ($this->getSLMId() == $a_target_slm->getId())
128 ? false
129 : true;
130
131 $this->page_object->copy($page->getId(), $page->getParentType(), $page->getParentId(), $clone_mobs);
132
133 //$page->setXMLContent($this->page_object->copyXMLContent($clone_mobs));
134 //$page->buildDom();
135 //$page->update();
136
137 return $slm_page;
138 }
getSLMId()
Get ID of parent Scorm Learning Module Object.
getDescription()
Get description.
Class ilSCORM2004PageNode.

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

+ Here is the call graph for this function:

◆ copyPageFromLM()

static ilSCORM2004PageNode::copyPageFromLM (   $a_target_slm,
  $a_lm_page 
)
static

Copy page from learning module.

Definition at line 143 of file class.ilSCORM2004PageNode.php.

144 {
145 // copy page
146 $slm_page = new ilSCORM2004PageNode($a_target_slm);
147 $slm_page->setTitle($a_lm_page->getTitle());
148 $slm_page->setSLMId($a_target_slm->getId());
149 $slm_page->setType("page");
150 $slm_page->create(true); // setting "upload" flag to true prevents creating of meta data
151
152 // copy meta data
153 include_once("Services/MetaData/classes/class.ilMD.php");
154 $md = new ilMD($a_lm_page->getLMId(), $a_lm_page->getId(), $a_lm_page->getType());
155 $md->cloneMD($a_target_slm->getId(), $slm_page->getId(), "page");
156
157 // copy page content
158 $page = $slm_page->getPageObject();
159 $clone_mobs = true;
160 $a_lm_page->getPageObject()->copy($page->getId(), $page->getParentType(), $page->getParentId(), $clone_mobs);
161
162 $slm_page = new ilSCORM2004PageNode($a_target_slm, $slm_page->getId());
163 $slm_page->getPageObject()->removeInvalidLinks();
164
165 return $slm_page;
166 }

Referenced by ilSCORM2004Node\pasteTree().

+ Here is the caller graph for this function:

◆ copyToOtherContObject()

& ilSCORM2004PageNode::copyToOtherContObject ( $a_cont_obj)

copy a page to another content object (learning module / dlib book)

Definition at line 172 of file class.ilSCORM2004PageNode.php.

173 {
174 // @todo
175 /*
176 // copy page
177 $lm_page = new ilLMPageObject($a_cont_obj);
178 $lm_page->setTitle($this->getTitle());
179 $lm_page->setLMId($a_cont_obj->getId());
180 $lm_page->setType($this->getType());
181 $lm_page->setDescription($this->getDescription());
182 $lm_page->create(true); // setting "upload" flag to true prevents creating of meta data
183
184 // copy meta data
185 include_once("Services/MetaData/classes/class.ilMD.php");
186 $md = new ilMD($this->getLMId(), $this->getId(), $this->getType());
187 $new_md =& $md->cloneMD($a_cont_obj->getId(), $lm_page->getId(), $this->getType());
188
189 // copy page content
190 $page =& $lm_page->getPageObject();
191 $page->setXMLContent($this->page_object->getXMLContent());
192 $page->buildDom();
193 $page->update();
194
195 return $lm_page;
196 */
197 }

◆ create()

ilSCORM2004PageNode::create (   $a_upload = false,
  $a_layout_id = 0 
)

Create Scorm Page.

Parameters
booleanUpload Mode

Definition at line 75 of file class.ilSCORM2004PageNode.php.

76 {
77 parent::create($a_upload);
78
79 // create scorm2004 page
80 include_once("./Modules/Scorm2004/classes/class.ilSCORM2004Page.php");
81 if (!is_object($this->page_object)) {
82 $this->page_object = new ilSCORM2004Page($this->slm_object->getType());
83 }
84 $this->page_object->setId($this->getId());
85 $this->page_object->setParentId($this->getSLMId());
86 if ($a_layout_id == 0) {
87 $this->page_object->create($a_upload);
88 } else {
89 $this->page_object->createWithLayoutId($a_layout_id);
90 }
91 }
Class ilSCORM2004Page.

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

+ Here is the call graph for this function:

◆ delete()

ilSCORM2004PageNode::delete (   $a_delete_meta_data = true)

Delete Scorm Page.

Parameters
booleanDelete also metadata.

Definition at line 98 of file class.ilSCORM2004PageNode.php.

99 {
100 parent::delete($a_delete_meta_data);
101 $this->page_object->delete();
102 }

◆ getFileItemIds()

ilSCORM2004PageNode::getFileItemIds ( )

get ids of all file items within the page

note: this method must be called afer exportXMLPageContent

Definition at line 282 of file class.ilSCORM2004PageNode.php.

283 {
284 return $this->files_contained;
285 }

◆ getId()

ilSCORM2004PageNode::getId ( )

Get id.

Returns
int Page ID

Reimplemented from ilSCORM2004Node.

Definition at line 237 of file class.ilSCORM2004PageNode.php.

References $id.

Referenced by copy(), and create().

+ Here is the caller graph for this function:

◆ getMediaObjectIds()

ilSCORM2004PageNode::getMediaObjectIds ( )

get ids of all media objects within the page

note: this method must be called afer exportXMLPageContent

Definition at line 272 of file class.ilSCORM2004PageNode.php.

273 {
274 return $this->mobs_contained;
275 }

◆ getOriginID()

ilSCORM2004PageNode::getOriginID ( )

Definition at line 262 of file class.ilSCORM2004PageNode.php.

263 {
264 return $this->origin_id;
265 }

◆ getPageObject()

& ilSCORM2004PageNode::getPageObject ( )

Get assigned page object.

Returns
object page object

Definition at line 216 of file class.ilSCORM2004PageNode.php.

References $page_object.

◆ isAlias()

ilSCORM2004PageNode::isAlias ( )

Definition at line 250 of file class.ilSCORM2004PageNode.php.

251 {
252 return $this->is_alias;
253 }

◆ read()

ilSCORM2004PageNode::read ( )

Read data from database.

Reimplemented from ilSCORM2004Node.

Definition at line 63 of file class.ilSCORM2004PageNode.php.

64 {
65 parent::read();
66
67 $this->page_object = new ilSCORM2004Page($this->id, 0);
68 }

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setAlias()

ilSCORM2004PageNode::setAlias (   $a_is_alias)

Set wether page object is an alias.

Definition at line 245 of file class.ilSCORM2004PageNode.php.

246 {
247 $this->is_alias = $a_is_alias;
248 }

◆ setId()

ilSCORM2004PageNode::setId (   $a_id)

Set id.

Parameters
intPage ID

Reimplemented from ilSCORM2004Node.

Definition at line 227 of file class.ilSCORM2004PageNode.php.

228 {
229 $this->id = $a_id;
230 }

◆ setOriginID()

ilSCORM2004PageNode::setOriginID (   $a_id)

Definition at line 256 of file class.ilSCORM2004PageNode.php.

257 {
258 return $this->origin_id = $a_id;
259 }

Field Documentation

◆ $id

ilSCORM2004PageNode::$id

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

Referenced by getId().

◆ $page_object

ilSCORM2004PageNode::$page_object

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

Referenced by getPageObject().


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