ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilSCORM2004Node Class Reference

Class. More...

+ Inheritance diagram for ilSCORM2004Node:
+ Collaboration diagram for ilSCORM2004Node:

Public Member Functions

 ilSCORM2004Node ($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...
 
 _getIdForImportId ($a_import_id)
 Get Node ID for import ID (static) More...
 
 _exists ($a_id)
 Checks wether a node exists. More...
 
 _deleteAllSLMNodes ($a_slm_object)
 Delete all nodes of Scorm Learning Module. More...
 
 _lookupSLMID ($a_id)
 Lookup Scorm Learning Module ID for node id. More...
 
 clipboardCut ($a_slm_obj_id, $a_ids)
 Cut and copy a set of chapters/pages into the clipboard. More...
 
 insertChapterClip ($a_slm_obj, $a_as_sub=false)
 Insert Chapter from clipboard. More...
 
 getObjectives ()
 
 deleteSeqInfo ()
 
 parentHasSeqTemplate ()
 
 exportAsScorm12 ()
 
 exportAsScorm13 ()
 

Static Public Member Functions

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

 $slm_id
 
 $type
 
 $id
 
 $slm_object
 

Detailed Description

Class.

Base class for Scorm 2004 Nodes (Chapters, Pages, SCOs)

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

Definition at line 18 of file class.ilSCORM2004Node.php.

Member Function Documentation

◆ _deleteAllSLMNodes()

ilSCORM2004Node::_deleteAllSLMNodes (   $a_slm_object)

Delete all nodes of Scorm Learning Module.

Parameters
objectScorm 2004 Learning Module Object

Definition at line 522 of file class.ilSCORM2004Node.php.

523 {
524 global $ilDB;
525
526 $query = "SELECT * FROM sahs_sc13_tree_node ".
527 "WHERE slm_id = ".$ilDB->quote($a_slm_object->getId(), "integer")." ";
528 $obj_set = $ilDB->query($query);
529
530 require_once("./Modules/Scorm2004/classes/class.ilSCORM2004NodeFactory.php");
531 while($obj_rec = $ilDB->fetchAssoc($obj_set))
532 {
533 $node_obj = ilSCORM2004NodeFactory::getInstance($a_slm_object, $obj_rec["obj_id"],false);
534
535 if (is_object($node_obj))
536 {
537 $node_obj->delete();
538 }
539 }
540
541 return true;
542 }
static getInstance($a_slm_object, $a_id=0, $a_halt=true)
global $ilDB

References $ilDB, $query, and ilSCORM2004NodeFactory\getInstance().

+ Here is the call graph for this function:

◆ _exists()

ilSCORM2004Node::_exists (   $a_id)

Checks wether a node exists.

Parameters
int$idid
Returns
boolean true, if lm content object exists

Definition at line 492 of file class.ilSCORM2004Node.php.

493 {
494 global $ilDB;
495
496 include_once("./Services/Link/classes/class.ilInternalLink.php");
497 if (is_int(strpos($a_id, "_")))
498 {
500 }
501
502 $q = "SELECT * FROM sahs_sc13_tree_node WHERE obj_id = ".
503 $ilDB->quote($a_id, "integer");
504 $obj_set = $ilDB->query($q);
505 if ($obj_rec = $ilDB->fetchAssoc($obj_set))
506 {
507 return true;
508 }
509 else
510 {
511 return false;
512 }
513
514 }

References $ilDB, and ilInternalLink\_extractObjIdOfTarget().

+ Here is the call graph for this function:

◆ _getIdForImportId()

ilSCORM2004Node::_getIdForImportId (   $a_import_id)

Get Node ID for import ID (static)

import ids can exist multiple times (if the same learning module has been imported multiple times). we get the object id of the last imported object, that is not in trash

Parameters
int$a_import_idimport id
Returns
int id

Definition at line 462 of file class.ilSCORM2004Node.php.

463 {
464 global $ilDB;
465
466 $ilDB->setLimit(1);
467 $q = "SELECT * FROM sahs_sc13_tree_node WHERE import_id = ".
468 $ilDB->quote($a_import_id, "text")." ".
469 " ORDER BY create_date DESC";
470 $obj_set = $ilDB->query($q);
471 while ($obj_rec = $ilDB->fetchAssoc($obj_set))
472 {
473 $slm_id = ilSCORM2004Node::_lookupSLMID($obj_rec["obj_id"]);
474
475 // link only in learning module, that is not trashed
477 {
478 return $obj_rec["obj_id"];
479 }
480 }
481
482 return 0;
483 }
_hasUntrashedReference($a_obj_id)
checks wether an object has at least one reference that is not in trash
_lookupSLMID($a_id)
Lookup Scorm Learning Module ID for node id.

References $ilDB, $slm_id, ilObject\_hasUntrashedReference(), and _lookupSLMID().

+ Here is the call graph for this function:

◆ _lookupSLMID()

ilSCORM2004Node::_lookupSLMID (   $a_id)

Lookup Scorm Learning Module ID for node id.

Definition at line 547 of file class.ilSCORM2004Node.php.

548 {
549 global $ilDB;
550
551 $query = "SELECT * FROM sahs_sc13_tree_node WHERE obj_id = ".
552 $ilDB->quote($a_id, "integer")."";
553 $obj_set = $ilDB->query($query);
554 $obj_rec = $ilDB->fetchAssoc($obj_set);
555
556 return $obj_rec["slm_id"];
557 }

References $ilDB, and $query.

Referenced by _getIdForImportId(), ilObjMediaObject\getParentObjectIdForUsage(), and pasteTree().

+ Here is the caller graph for this function:

◆ _lookupTitle()

static ilSCORM2004Node::_lookupTitle (   $a_obj_id)
static

Lookup Title.

Parameters
intNode ID
Returns
string Title

Definition at line 327 of file class.ilSCORM2004Node.php.

328 {
329 global $ilDB;
330
331 $query = "SELECT * FROM sahs_sc13_tree_node WHERE obj_id = ".
332 $ilDB->quote($a_obj_id, "integer");
333 $obj_set = $ilDB->query($query);
334 $obj_rec = $ilDB->fetchAssoc($obj_set);
335
336 return $obj_rec["title"];
337 }

References $ilDB, and $query.

Referenced by clipboardCopy(), ilTermUsagesTableGUI\fillRow(), ilObjectivesAlignmentTableGUI\fillRow(), and ilNoteGUI\showTargets().

+ Here is the caller graph for this function:

◆ _lookupType()

static ilSCORM2004Node::_lookupType (   $a_obj_id)
static

Lookup Type.

Parameters
intNode ID
Returns
string Type

Definition at line 345 of file class.ilSCORM2004Node.php.

346 {
347 global $ilDB;
348
349 $query = "SELECT * FROM sahs_sc13_tree_node WHERE obj_id = ".
350 $ilDB->quote($a_obj_id, "integer");
351 $obj_set = $ilDB->query($query);
352 $obj_rec = $ilDB->fetchAssoc($obj_set);
353
354 return $obj_rec["type"];
355 }

References $ilDB, and $query.

Referenced by clipboardCopy(), ilObjSCORM2004LearningModuleGUI\editOrganization(), ilObjSCORM2004LearningModuleGUI\frameset(), ilObjSCORM2004LearningModuleGUI\getNotesHTML(), ilObjSCORM2004LearningModuleGUI\jumpToNode(), pasteTree(), and uniqueTypesCheck().

+ Here is the caller graph for this function:

◆ _writeImportId()

static ilSCORM2004Node::_writeImportId (   $a_id,
  $a_import_id 
)
static

Write import ID.

Parameters
int$a_idNode ID
string$a_import_idImport ID

Definition at line 379 of file class.ilSCORM2004Node.php.

380 {
381 global $ilDB;
382
383 $q = "UPDATE sahs_sc13_tree_node ".
384 "SET ".
385 "import_id = ".$ilDB->quote($a_import_id, "text").",".
386 "last_update = ".$ilDB->now().
387 "WHERE obj_id = ".$ilDB->quote($a_id, "integer");
388
389 $ilDB->manipulate($q);
390 }

References $ilDB.

◆ _writeTitle()

static ilSCORM2004Node::_writeTitle (   $a_obj_id,
  $a_title 
)
static

Write Title.

Parameters
intNode ID
stringTitle

Definition at line 363 of file class.ilSCORM2004Node.php.

364 {
365 global $ilDB;
366
367 $query = "UPDATE sahs_sc13_tree_node SET ".
368 " title = ".$ilDB->quote($a_title, "text").
369 " WHERE obj_id = ".$ilDB->quote($a_obj_id, "integer");
370 $ilDB->manipulate($query);
371 }

References $ilDB, and $query.

Referenced by MDUpdateListener(), and ilObjSCORM2004LearningModuleGUI\saveAllTitles().

+ Here is the caller graph for this function:

◆ clipboardCopy()

static ilSCORM2004Node::clipboardCopy (   $a_slm_obj_id,
  $a_ids 
)
static

Copy a set of chapters/pages/scos into the clipboard.

Definition at line 619 of file class.ilSCORM2004Node.php.

620 {
621 global $ilUser;
622
623 $tree = ilSCORM2004Node::getTree($a_slm_obj_id);
624
625 $ilUser->clipboardDeleteObjectsOfType("page");
626 $ilUser->clipboardDeleteObjectsOfType("chap");
627 $ilUser->clipboardDeleteObjectsOfType("sco");
628 $ilUser->clipboardDeleteObjectsOfType("ass");
629
630 // put them into the clipboard
631 $time = date("Y-m-d H:i:s", time());
632 foreach ($a_ids as $id)
633 {
634 $curnode = "";
635 if ($tree->isInTree($id))
636 {
637 $curnode = $tree->getNodeData($id);
638 $subnodes = $tree->getSubTree($curnode);
639 foreach($subnodes as $subnode)
640 {
641 if ($subnode["child"] != $id)
642 {
643 $ilUser->addObjectToClipboard($subnode["child"],
644 $subnode["type"], $subnode["title"],
645 $subnode["parent"], $time, $subnode["lft"]);
646 }
647 }
648 }
649 $order = ($curnode["lft"] > 0)
650 ? $curnode["lft"]
651 : (int) ($order + 1);
652 $ilUser->addObjectToClipboard($id,
654 $order);
655 }
656 }
static _lookupType($a_obj_id)
Lookup Type.
static getTree($a_slm_obj_id)
Get scorm module editing tree.
static _lookupTitle($a_obj_id)
Lookup Title.
global $ilUser
Definition: imgupload.php:15

References $id, $ilUser, _lookupTitle(), _lookupType(), and getTree().

Referenced by clipboardCut(), ilObjSCORM2004LearningModuleGUI\copyItems(), and ilSCORM2004NodeGUI\copyItems().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ clipboardCut()

ilSCORM2004Node::clipboardCut (   $a_slm_obj_id,
  $a_ids 
)

Cut and copy a set of chapters/pages into the clipboard.

Definition at line 661 of file class.ilSCORM2004Node.php.

662 {
663 $tree = ilSCORM2004Node::getTree($a_slm_obj_id);
664
665 if (!is_array($a_ids))
666 {
667 return false;
668 }
669 else
670 {
671 // get all "top" ids, i.e. remove ids, that have a selected parent
672 foreach($a_ids as $id)
673 {
674 $path = $tree->getPathId($id);
675 $take = true;
676 foreach($path as $path_id)
677 {
678 if ($path_id != $id && in_array($path_id, $a_ids))
679 {
680 $take = false;
681 }
682 }
683 if ($take)
684 {
685 $cut_ids[] = $id;
686 }
687 }
688 }
689
690 ilSCORM2004Node::clipboardCopy($a_slm_obj_id, $cut_ids);
691
692 // remove the objects from the tree
693 // note: we are getting chapters, scos and pages which are *not* in the tree
694 // we do not delete any pages/chapters here
695 foreach ($cut_ids as $id)
696 {
697 $curnode = $tree->getNodeData($id);
698 if ($tree->isInTree($id))
699 {
700 $tree->deleteTree($curnode);
701 }
702 }
703
704 }
static clipboardCopy($a_slm_obj_id, $a_ids)
Copy a set of chapters/pages/scos into the clipboard.
$path
Definition: index.php:22

References $id, $path, clipboardCopy(), and getTree().

Referenced by ilObjSCORM2004LearningModuleGUI\cutItems(), and ilSCORM2004NodeGUI\cutItems().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create()

ilSCORM2004Node::create (   $a_upload = false)

Create Node.

Parameters
booleanUpload Mode

Definition at line 397 of file class.ilSCORM2004Node.php.

398 {
399 global $ilDB;
400
401 // insert object data
402 $id = $ilDB->nextId("sahs_sc13_tree_node");
403 $query = "INSERT INTO sahs_sc13_tree_node (obj_id, title, type, slm_id, import_id, create_date) ".
404 "VALUES (".
405 $ilDB->quote($id, "integer").",".
406 $ilDB->quote($this->getTitle(), "text").",".
407 $ilDB->quote($this->getType(), "text").", ".
408 $ilDB->quote($this->getSLMId(), "integer").",".
409 $ilDB->quote($this->getImportId(), "text").
410 ", ".$ilDB->now().")";
411 $ilDB->manipulate($query);
412 $this->setId($id);
413
414 if (!$a_upload)
415 {
416 $this->createMetaData();
417 }
418 }
setId($a_id)
Set Node ID.
getImportId()
Set Import ID.
getSLMId()
Get ID of parent Scorm Learning Module Object.
createMetaData()
create meta data entry

References $id, $ilDB, $query, createMetaData(), getImportId(), getSLMId(), getTitle(), getType(), and setId().

+ Here is the call graph for this function:

◆ createMetaData()

ilSCORM2004Node::createMetaData ( )

create meta data entry

Definition at line 260 of file class.ilSCORM2004Node.php.

261 {
262 global $ilUser;
263
264 include_once 'Services/MetaData/classes/class.ilMDCreator.php';
265 $md_creator = new ilMDCreator($this->getSLMId(), $this->getId(), $this->getType());
266 $md_creator->setTitle($this->getTitle());
267 $md_creator->setTitleLanguage($ilUser->getPref('language'));
268 $md_creator->setDescription($this->getDescription());
269 $md_creator->setDescriptionLanguage($ilUser->getPref('language'));
270 $md_creator->setKeywordLanguage($ilUser->getPref('language'));
271 $md_creator->setLanguage($ilUser->getPref('language'));
272 $md_creator->create();
273
274 return true;
275 }
getDescription()
Get description.

References $ilUser, getDescription(), getId(), getSLMId(), getTitle(), and getType().

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delete()

ilSCORM2004Node::delete ( )

Delete Node.

Reimplemented in ilSCORM2004Sco.

Definition at line 440 of file class.ilSCORM2004Node.php.

441 {
442 global $ilDB;
443
444 $query = "DELETE FROM sahs_sc13_tree_node WHERE obj_id= ".
445 $ilDB->quote($this->getId(), "integer");
446 $ilDB->manipulate($query);
447
448 $this->deleteMetaData();
449 }
deleteMetaData()
delete meta data entry

References $ilDB, $query, deleteMetaData(), and getId().

+ Here is the call graph for this function:

◆ deleteMetaData()

ilSCORM2004Node::deleteMetaData ( )

delete meta data entry

Definition at line 305 of file class.ilSCORM2004Node.php.

306 {
307 // Delete meta data
308 include_once('Services/MetaData/classes/class.ilMD.php');
309 $md = new ilMD($this->getSLMId(), $this->getId(), $this->getType());
310 $md->deleteAll();
311 }

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

Referenced by delete().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteSeqInfo()

ilSCORM2004Node::deleteSeqInfo ( )

Definition at line 1076 of file class.ilSCORM2004Node.php.

1077 {
1078 include_once("./Modules/Scorm2004/classes/seq_editor/class.ilSCORM2004Item.php");
1079 $seq_item = new ilSCORM2004Item($this->getId());
1080 $seq_item -> delete();
1081 }
Class ilSCORM2004Condition.

References getId().

+ Here is the call graph for this function:

◆ exportAsScorm12()

ilSCORM2004Node::exportAsScorm12 ( )

Definition at line 1091 of file class.ilSCORM2004Node.php.

1091 {
1092 //to implement
1093 return;
1094 }

◆ exportAsScorm13()

ilSCORM2004Node::exportAsScorm13 ( )

Definition at line 1096 of file class.ilSCORM2004Node.php.

1096 {
1097 //to implement
1098 return;
1099 }

◆ getContentObject()

ilSCORM2004Node::getContentObject ( )

Get Scorm Learning Module Object.

Returns
int Scorm LM Object

Definition at line 152 of file class.ilSCORM2004Node.php.

153 {
154 return $this->slm_object;
155 }

References $slm_object.

◆ getDescription()

ilSCORM2004Node::getDescription ( )

Get description.

Returns
string Description

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

82 {
83 return $this->description;
84 }

Referenced by ilSCORM2004Asset\copy(), ilSCORM2004Chapter\copy(), ilSCORM2004PageNode\copy(), ilSCORM2004Sco\copy(), and createMetaData().

+ Here is the caller graph for this function:

◆ getId()

◆ getImportId()

ilSCORM2004Node::getImportId ( )

Set Import ID.

Parameters
intImport ID

Definition at line 182 of file class.ilSCORM2004Node.php.

183 {
184 return $this->import_id;
185 }

Referenced by create().

+ Here is the caller graph for this function:

◆ getObjectives()

ilSCORM2004Node::getObjectives ( )

Definition at line 1070 of file class.ilSCORM2004Node.php.

1071 {
1072 include_once("./Modules/Scorm2004/classes/seq_editor/class.ilSCORM2004Objective.php");
1073 return ilSCORM2004Objective::fetchAllObjectives($this->slm_object,$this->getId());
1074 }
static fetchAllObjectives($a_slm_object, $a_tree_node_id)

References ilSCORM2004Objective\fetchAllObjectives(), and getId().

Referenced by ilSCORM2004Asset\exportScorm(), and ilSCORM2004Sco\getMainObjectiveText().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSLMId()

ilSCORM2004Node::getSLMId ( )

Get ID of parent Scorm Learning Module Object.

Parameters
intScorm LM ID

Definition at line 122 of file class.ilSCORM2004Node.php.

123 {
124 return $this->slm_id;
125 }

References $slm_id.

Referenced by ilSCORM2004Asset\copy(), ilSCORM2004Chapter\copy(), ilSCORM2004PageNode\copy(), ilSCORM2004Sco\copy(), create(), ilSCORM2004PageNode\create(), createMetaData(), deleteMetaData(), ilSCORM2004Asset\exportXMLMetaData(), MDUpdateListener(), update(), and updateMetaData().

+ Here is the caller graph for this function:

◆ getSLMObject()

ilSCORM2004Node::getSLMObject ( )

Get scorm learning module object.

Returns
int Scorm LM Object

Definition at line 142 of file class.ilSCORM2004Node.php.

143 {
144 return $this->slm_object;
145 }

References $slm_object.

◆ getTitle()

ilSCORM2004Node::getTitle ( )

Get title.

Returns
string title

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

62 {
63 return $this->title;
64 }

Referenced by ilSCORM2004Asset\copy(), ilSCORM2004Chapter\copy(), ilSCORM2004PageNode\copy(), ilSCORM2004Sco\copy(), create(), createMetaData(), ilSCORM2004Asset\exportHTMLPageObjects(), update(), and updateMetaData().

+ Here is the caller graph for this function:

◆ getTree()

static ilSCORM2004Node::getTree (   $a_slm_obj_id)
static

Get scorm module editing tree.

Parameters
intscorm module object id
Returns
object tree object

Definition at line 606 of file class.ilSCORM2004Node.php.

607 {
608 $tree = new ilTree($a_slm_obj_id);
609 $tree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
610 $tree->setTreeTablePK("slm_id");
611 $tree->readRootId();
612
613 return $tree;
614 }
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...

Referenced by clipboardCopy(), clipboardCut(), insertAssetClip(), insertChapterClip(), and insertPageClip().

+ Here is the caller graph for this function:

◆ getType()

◆ ilSCORM2004Node()

ilSCORM2004Node::ilSCORM2004Node (   $a_slm_object,
  $a_id = 0 
)
Parameters
object$a_slm_objectilObjScorm2004LearningModule object

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

29 {
30 $this->id = $a_id;
31 $this->setSLMObject($a_slm_object);
32 $this->setSLMId($a_slm_object->getId());
33
34 include_once("./Modules/Scorm2004/classes/class.ilSCORM2004Tree.php");
35 $this->tree = new ilSCORM2004Tree($a_slm_object->getId());
36 /*$this->tree = new ilTree($a_slm_object->getId());
37 $this->tree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
38 $this->tree->setTreeTablePK("slm_id");*/
39
40 if($a_id != 0)
41 {
42 $this->read();
43 }
44 }
setSLMId($a_slm_id)
Set ID of parent Scorm Learning Module Object.
read()
Read Data of Node.
setSLMObject($a_slm_obj)
Set Scorm Learning Module Object.
SCORM 2004 Editing tree.

References read(), setSLMId(), and setSLMObject().

+ Here is the call graph for this function:

◆ insertAssetClip()

static ilSCORM2004Node::insertAssetClip (   $a_slm_obj,
  $a_type = "ass" 
)
static

Insert assets from clipboard.

Definition at line 791 of file class.ilSCORM2004Node.php.

792 {
793 global $ilCtrl, $ilUser;
794
795 // @todo: move this to a service since it can be used here, too
796 include_once("./Modules/LearningModule/classes/class.ilEditClipboard.php");
797
798 include_once("./Modules/Scorm2004/classes/class.ilSCORM2004OrganizationHFormGUI.php");
801
802 $tree = ilSCORM2004Node::getTree($a_slm_obj->getId());
803
804 if (!$first_child) // insert after node id
805 {
806 $parent_id = $tree->getParentId($node_id);
807 $target = $node_id;
808 }
809 else // insert as first child
810 {
811 $parent_id = $node_id;
812 $target = IL_FIRST_NODE;
813 }
814
815 // cut and paste
816 $scos = $ilUser->getClipboardObjects($a_type);
817 $copied_nodes = array();
818 foreach ($scos as $sco)
819 {
820 $cid = ilSCORM2004Node::pasteTree($a_slm_obj, $sco["id"], $parent_id, $target,
821 $sco["insert_time"], $copied_nodes,
822 (ilEditClipboard::getAction() == "copy"));
823 $target = $cid;
824 }
825 //ilLMObject::updateInternalLinks($copied_nodes);
826
827 if (ilEditClipboard::getAction() == "cut")
828 {
829 $ilUser->clipboardDeleteObjectsOfType("page");
830 $ilUser->clipboardDeleteObjectsOfType("chap");
831 $ilUser->clipboardDeleteObjectsOfType("sco");
832 $ilUser->clipboardDeleteObjectsOfType("ass");
834 }
835 }
const IL_FIRST_NODE
Definition: class.ilTree.php:5
static getPostNodeId()
Get node ID of _POST input.
static getPostFirstChild()
Should node be inserted as first child of target node (true) or as successor (false)
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.
global $ilCtrl
Definition: ilias.php:18

References $ilCtrl, $ilUser, ilEditClipboard\clear(), ilEditClipboard\getAction(), ilHierarchyFormGUI\getPostFirstChild(), ilHierarchyFormGUI\getPostNodeId(), getTree(), IL_FIRST_NODE, and pasteTree().

Referenced by ilObjSCORM2004LearningModuleGUI\insertAssetClip(), ilSCORM2004NodeGUI\insertAssetClip(), and insertScoClip().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insertChapterClip()

ilSCORM2004Node::insertChapterClip (   $a_slm_obj,
  $a_as_sub = false 
)

Insert Chapter from clipboard.

Definition at line 849 of file class.ilSCORM2004Node.php.

850 {
851 global $ilUser, $ilCtrl, $ilLog;
852
853 // @todo: move this to a service since it can be used here, too
854 include_once("./Modules/LearningModule/classes/class.ilEditClipboard.php");
855
856 include_once("./Modules/Scorm2004/classes/class.ilSCORM2004OrganizationHFormGUI.php");
859
860 $tree = ilSCORM2004Node::getTree($a_slm_obj->getId());
861
862 if ($a_as_sub) // as subchapter
863 {
864 if (!$first_child) // insert under parent
865 {
866 $parent_id = $node_id;
867 $target = "";
868 }
869 else // we shouldnt end up here
870 {
871 return;
872 }
873 }
874 else // as chapter
875 {
876 if (!$first_child) // insert after node id
877 {
878 $parent_id = $tree->getParentId($node_id);
879 $target = $node_id;
880 }
881 else // insert as first child
882 {
883 $parent_id = $node_id;
884 $target = IL_FIRST_NODE;
885
886 // do not move a chapter in front of a sco (maybe never needed)
887 $childs = $tree->getChildsByType($parent_id, "sco");
888 if (count($childs) != 0)
889 {
890 $target = $childs[count($childs) - 1]["obj_id"];
891 }
892 }
893 }
894
895 // copy and paste
896 $chapters = $ilUser->getClipboardObjects("chap", true);
897 $copied_nodes = array();
898 foreach ($chapters as $chap)
899 {
900 $cid = ilSCORM2004Node::pasteTree($a_slm_obj, $chap["id"], $parent_id,
901 $target, $chap["insert_time"], $copied_nodes,
902 (ilEditClipboard::getAction() == "copy"));
903 $target = $cid;
904 }
905 //ilLMObject::updateInternalLinks($copied_nodes);
906
907 if (ilEditClipboard::getAction() == "cut")
908 {
909 $ilUser->clipboardDeleteObjectsOfType("page");
910 $ilUser->clipboardDeleteObjectsOfType("chap");
911 $ilUser->clipboardDeleteObjectsOfType("sco");
912 $ilUser->clipboardDeleteObjectsOfType("ass");
914 }
915 }

References $ilCtrl, $ilLog, $ilUser, ilEditClipboard\clear(), ilEditClipboard\getAction(), ilHierarchyFormGUI\getPostFirstChild(), ilHierarchyFormGUI\getPostNodeId(), getTree(), IL_FIRST_NODE, and pasteTree().

Referenced by ilObjSCORM2004LearningModuleGUI\insertChapterClip().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insertPageClip()

static ilSCORM2004Node::insertPageClip (   $a_slm_obj)
static

Insert pages from clipboard.

Definition at line 731 of file class.ilSCORM2004Node.php.

732 {
733 global $ilUser;
734
735 // @todo: move this to a service since it can be used here, too
736 include_once("./Modules/LearningModule/classes/class.ilEditClipboard.php");
737
738 include_once("./Modules/Scorm2004/classes/class.ilSCORM2004OrganizationHFormGUI.php");
741
742 $tree = ilSCORM2004Node::getTree($a_slm_obj->getId());
743
744 if (!$first_child) // insert after node id
745 {
746 $parent_id = $tree->getParentId($node_id);
747 $target = $node_id;
748 }
749 else // insert as first child
750 {
751 $parent_id = $node_id;
752 $target = IL_FIRST_NODE;
753 }
754
755 // cut and paste
756 $source_parent_type = "";
757 if ($ilUser->getClipboardObjects("page"))
758 {
759 $pages = $ilUser->getClipboardObjects("page");
760 }
761 else if ($ilUser->getClipboardObjects("pg"))
762 {
763 $source_parent_type = "lm";
764 $pages = $ilUser->getClipboardObjects("pg");
765 }
766 $copied_nodes = array();
767
768 foreach ($pages as $pg)
769 {
770 $cid = ilSCORM2004Node::pasteTree($a_slm_obj, $pg["id"], $parent_id, $target,
771 $pg["insert_time"], $copied_nodes,
772 (ilEditClipboard::getAction() == "copy"), true, $source_parent_type);
773 $target = $cid;
774 }
775 //ilLMObject::updateInternalLinks($copied_nodes);
776
777 if (ilEditClipboard::getAction() == "cut")
778 {
779 $ilUser->clipboardDeleteObjectsOfType("page");
780 $ilUser->clipboardDeleteObjectsOfType("chap");
781 $ilUser->clipboardDeleteObjectsOfType("sco");
782 $ilUser->clipboardDeleteObjectsOfType("ass");
783 $ilUser->clipboardDeleteObjectsOfType("pg");
785 }
786 }

References $ilUser, ilEditClipboard\clear(), ilEditClipboard\getAction(), ilHierarchyFormGUI\getPostFirstChild(), ilHierarchyFormGUI\getPostNodeId(), getTree(), IL_FIRST_NODE, and pasteTree().

Referenced by ilObjSCORM2004LearningModuleGUI\insertPageClip(), and ilSCORM2004NodeGUI\insertPageClip().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insertScoClip()

static ilSCORM2004Node::insertScoClip (   $a_slm_obj)
static

Insert scos from clipboard.

Definition at line 840 of file class.ilSCORM2004Node.php.

841 {
842 self::insertAssetClip($a_slm_obj, "sco");
843 }
static insertAssetClip($a_slm_obj, $a_type="ass")
Insert assets from clipboard.

References insertAssetClip().

Referenced by ilObjSCORM2004LearningModuleGUI\insertScoClip(), and ilSCORM2004NodeGUI\insertScoClip().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MDUpdateListener()

ilSCORM2004Node::MDUpdateListener (   $a_element)

Meta data update listener.

Important note: Do never call create() or update() method of ilObject here. It would result in an endless loop: update object -> update meta -> update object -> ... Use static _writeTitle() ... methods instead.

Parameters
string$a_element

Definition at line 228 of file class.ilSCORM2004Node.php.

229 {
230 include_once 'Services/MetaData/classes/class.ilMD.php';
231
232 switch($a_element)
233 {
234 case 'General':
235
236 // Update Title and description
237 $md = new ilMD($this->getSLMId(), $this->getId(), $this->getType());
238 $md_gen = $md->getGeneral();
239
240 ilSCORM2004Node::_writeTitle($this->getId(), $md_gen->getTitle());
241
242 foreach($md_gen->getDescriptionIds() as $id)
243 {
244 $md_des = $md_gen->getDescription($id);
245// ilLMObject::_writeDescription($this->getId(),$md_des->getDescription());
246 break;
247 }
248
249 break;
250
251 default:
252 }
253 return true;
254 }
static _writeTitle($a_obj_id, $a_title)
Write Title.

References $id, _writeTitle(), getId(), getSLMId(), and getType().

+ Here is the call graph for this function:

◆ parentHasSeqTemplate()

ilSCORM2004Node::parentHasSeqTemplate ( )

Definition at line 1084 of file class.ilSCORM2004Node.php.

1084 {
1085 include_once("./Modules/Scorm2004/classes/seq_editor/class.ilSCORM2004Utilities.php");
1086 $seq_util = new ilSCORM2004Utilities($this->getId());
1087 return $seq_util -> parentHasSeqTemplate($this->slm_object);
1088 }
Class ilSCORM2004Utilities.

References getId(), and parentHasSeqTemplate().

Referenced by parentHasSeqTemplate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pasteTree()

static ilSCORM2004Node::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 = "" 
)
static

Paste item (tree) from clipboard or other learning module to target scorm learning module.

Parameters
object$a_target_slmtarget scorm 2004 learning module object
int$a_item_idid of item that should be pasted
int$a_parent_idparent id in target tree,
int$a_targetpredecessor target node, no ID means: last child
string$a_insert_timecliboard insert time (not needed, if $a_from_cliboard is false)
array$a_copied_nodesarray of IDs od copied nodes, key is ID of source node, value is ID of copied node
bool$a_as_copyif true, items are copied otherwise they are moved
bool$a_from_clipboardif true, child node information is read from clipboard, otherwise from source tree

Definition at line 929 of file class.ilSCORM2004Node.php.

931 {
932 global $ilUser, $ilLog;
933
934 $item_type = "";
935
936 if (in_array($a_source_parent_type, array("", "sahs")))
937 {
938 // source lm id, item type and lm object
939 $item_slm_id = ilSCORM2004Node::_lookupSLMID($a_item_id);
940 $item_type = ilSCORM2004Node::_lookupType($a_item_id);
941 //$slm_obj = $ilias->obj_factory->getInstanceByObjId($item_slm_id);
942
943 include_once("./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php");
944 $slm_obj = new ilObjSCORM2004LearningModule($item_slm_id, false);
945
946 $ilLog->write("Getting from clipboard type ".$item_type.", ".
947 "Item ID: ".$a_item_id.", of original SLM: ".$item_slm_id);
948 }
949 else if (in_array($a_source_parent_type, array("lm")))
950 {
951 include_once("./Modules/LearningModule/classes/class.ilLMObject.php");
952 $item_lm_id = ilLMObject::_lookupContObjId($a_item_id);
953 $item_type = ilLMObject::_lookupType($a_item_id, $item_lm_id);
954
955 include_once("./Modules/LearningModule/classes/class.ilObjLearningModule.php");
956 $lm_obj = new ilObjLearningModule($item_lm_id, false);
957
958 $ilLog->write("Getting from clipboard type ".$item_type.", ".
959 "Item ID: ".$a_item_id.", of original SLM: ".$item_lm_id);
960 }
961
962
963
964 if ($item_type == "chap")
965 {
966 include_once("./Modules/Scorm2004/classes/class.ilSCORM2004Chapter.php");
967 $item = new ilSCORM2004Chapter($slm_obj, $a_item_id);
968 }
969 else if ($item_type == "page")
970 {
971 include_once("./Modules/Scorm2004/classes/class.ilSCORM2004PageNode.php");
972 $item = new ilSCORM2004PageNode($slm_obj, $a_item_id);
973 }
974 else if ($item_type == "sco")
975 {
976 include_once("./Modules/Scorm2004/classes/class.ilSCORM2004Sco.php");
977 $item = new ilSCORM2004Sco($slm_obj, $a_item_id);
978 }
979 else if ($item_type == "ass")
980 {
981 include_once("./Modules/Scorm2004/classes/class.ilSCORM2004Asset.php");
982 $item = new ilSCORM2004Asset($slm_obj, $a_item_id);
983 }
984 else if ($item_type == "pg")
985 {
986 include_once("./Modules/LearningModule/classes/class.ilLMPageObject.php");
987 $item = new ilLMPageObject($lm_obj, $a_item_id);
988 }
989
990
991 if ($item_slm_id != $a_target_slm->getId() && !$a_as_copy)
992 {
993 // @todo: check whether st is NOT in tree
994
995 // "move" metadata to new lm
996 include_once("Services/MetaData/classes/class.ilMD.php");
997 $md = new ilMD($item_slm_id, $item->getId(), $item->getType());
998 $new_md = $md->cloneMD($a_target_slm->getId(), $item->getId(), $item->getType());
999
1000 // update lm object
1001 $item->setSLMId($a_target_slm->getId());
1002 $item->setSLMObject($a_target_slm);
1003 $item->update();
1004
1005 // delete old meta data set
1006 $md->deleteAll();
1007
1008 if ($item_type == "page")
1009 {
1010 $page = $item->getPageObject();
1011 $page->buildDom($a_from_clipboard);
1012 $page->setParentId($a_target_slm->getId());
1013 $page->update();
1014 }
1015 }
1016
1017 if ($a_as_copy)
1018 {
1019 if ($a_source_parent_type == "lm")
1020 {
1021 if ($item_type = "pg")
1022 {
1023 include_once("./Modules/Scorm2004/classes/class.ilSCORM2004PageNode.php");
1024 $target_item = ilSCORM2004PageNode::copyPageFromLM($a_target_slm, $item);
1025 }
1026 }
1027 else
1028 {
1029 $target_item = $item->copy($a_target_slm);
1030 }
1031 $a_copied_nodes[$item->getId()] = $target_item->getId();
1032 }
1033 else
1034 {
1035 $target_item = $item;
1036 }
1037
1038 $ilLog->write("Putting into tree type ".$target_item->getType().
1039 "Item ID: ".$target_item->getId().", Parent: ".$a_parent_id.", ".
1040 "Target: ".$a_target.", Item LM:".$target_item->getContentObject()->getId());
1041
1042 ilSCORM2004Node::putInTree($target_item, $a_parent_id, $a_target);
1043
1044 if ($a_from_clipboard)
1045 {
1046 $childs = $ilUser->getClipboardChilds($item->getId(), $a_insert_time);
1047 }
1048 else
1049 {
1050 // get childs of source tree
1051 $source_tree = $slm_obj->getTree();
1052 $childs = $source_tree->getChilds($a_item_id);
1053 }
1054
1055 foreach($childs as $child)
1056 {
1057 $child_id = ($a_from_clipboard)
1058 ? $child["id"]
1059 : $child["child"];
1060 ilSCORM2004Node::pasteTree($a_target_slm, $child_id, $target_item->getId(),
1061 IL_LAST_NODE, $a_insert_time, $a_copied_nodes, $a_as_copy, $a_from_clipboard, $a_source_parent_type);
1062 }
1063
1064 return $target_item->getId();
1065 }
const IL_LAST_NODE
Definition: class.ilTree.php:4
static _lookupType($a_obj_id, $a_lm_id=0)
Lookup type.
Class ilLMPageObject.
Class ilObjLearningModule.
Class ilObjSCORM2004LearningModule.
Class ilSCORM2004Asset.
Class ilSCORM2004Chapter.
static putInTree($a_obj, $a_parent_id="", $a_target_node_id="")
put this object into content object tree
Class ilSCORM2004PageNode.
static copyPageFromLM($a_target_slm, $a_lm_page)
Copy page from learning module.
Class ilSCORM2004Sco.

References $ilLog, $ilUser, _lookupSLMID(), _lookupType(), ilLMObject\_lookupType(), ilSCORM2004PageNode\copyPageFromLM(), IL_LAST_NODE, pasteTree(), and putInTree().

Referenced by ilLMChapterImportForm\addNode(), ilObjSCORM2004LearningModule\copyAuthoredContent(), insertAssetClip(), insertChapterClip(), insertPageClip(), and pasteTree().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ putInTree()

static ilSCORM2004Node::putInTree (   $a_obj,
  $a_parent_id = "",
  $a_target_node_id = "" 
)
static

put this object into content object tree

Definition at line 562 of file class.ilSCORM2004Node.php.

563 {
564 $tree =& new ilTree($a_obj->getSLMId());
565 $tree->setTreeTablePK("slm_id");
566 $tree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
567
568 // determine parent
569 $parent_id = ($a_parent_id != "")
570 ? $a_parent_id
571 : $tree->getRootId();
572
573 // determine target
574 if ($a_target_node_id != "")
575 {
576 $target = $a_target_node_id;
577 }
578 else
579 {
580 // determine last child that serves as predecessor
581 $childs =& $tree->getChilds($parent_id);
582
583 if (count($childs) == 0)
584 {
585 $target = IL_FIRST_NODE;
586 }
587 else
588 {
589 $target = $childs[count($childs) - 1]["obj_id"];
590 }
591 }
592
593 if ($tree->isInTree($parent_id) && !$tree->isInTree($a_obj->getId()))
594 {
595 $tree->insertNode($a_obj->getId(), $parent_id, $target);
596 }
597 }

References IL_FIRST_NODE.

Referenced by ilLMChapterImportForm\addNode(), ilSCORM13Package\dbImportLM(), ilSCORM13Package\dbImportSco(), ilSCORM2004SeqTemplate\importTemplate(), ilObjSCORM2004LearningModuleGUI\insertAsset(), ilObjSCORM2004LearningModuleGUI\insertChapter(), ilObjSCORM2004LearningModuleGUI\insertPage(), ilObjSCORM2004LearningModuleGUI\insertSco(), ilObjSCORM2004LearningModuleGUI\insertTemplate(), and pasteTree().

+ Here is the caller graph for this function:

◆ read()

ilSCORM2004Node::read ( )

Read Data of Node.

Reimplemented in ilSCORM2004PageNode, and ilSCORM2004Sco.

Definition at line 200 of file class.ilSCORM2004Node.php.

201 {
202 global $ilBench, $ilDB;
203
204 if(!isset($this->data_record))
205 {
206 $query = "SELECT * FROM sahs_sc13_tree_node WHERE obj_id = ".
207 $ilDB->quote($this->id, "integer");
208 $obj_set = $ilDB->query($query);
209 $this->data_record = $ilDB->fetchAssoc($obj_set);
210 }
211
212 $this->type = $this->data_record["type"];
213 $this->setImportId($this->data_record["import_id"]);
214 $this->setTitle($this->data_record["title"]);
215 }
setImportId($a_id)
Get Import ID.
setTitle($a_title)
Set title.
global $ilBench
Definition: ilias.php:18

References $ilBench, $ilDB, $query, setImportId(), and setTitle().

Referenced by ilSCORM2004Node().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setDataRecord()

ilSCORM2004Node::setDataRecord (   $a_record)

this method should only be called by class ilSCORM2004NodeFactory

Definition at line 316 of file class.ilSCORM2004Node.php.

317 {
318 $this->data_record = $a_record;
319 }

◆ setDescription()

ilSCORM2004Node::setDescription (   $a_description)

Set description.

Parameters
stringDescription

Definition at line 71 of file class.ilSCORM2004Node.php.

72 {
73 $this->description = $a_description;
74 }

◆ setId()

ilSCORM2004Node::setId (   $a_id)

Set Node ID.

Parameters
intNode ID

Reimplemented in ilSCORM2004PageNode, and ilSCORM2004SeqTemplate.

Definition at line 162 of file class.ilSCORM2004Node.php.

163 {
164 $this->id = $a_id;
165 }

Referenced by create().

+ Here is the caller graph for this function:

◆ setImportId()

ilSCORM2004Node::setImportId (   $a_id)

Get Import ID.

Parameters
intImport ID

Definition at line 192 of file class.ilSCORM2004Node.php.

193 {
194 $this->import_id = $a_id;
195 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setSLMId()

ilSCORM2004Node::setSLMId (   $a_slm_id)

Set ID of parent Scorm Learning Module Object.

Parameters
intScorm LM ID

Definition at line 111 of file class.ilSCORM2004Node.php.

112 {
113 $this->slm_id = $a_slm_id;
114
115 }

Referenced by ilSCORM2004Node().

+ Here is the caller graph for this function:

◆ setSLMObject()

ilSCORM2004Node::setSLMObject (   $a_slm_obj)

Set Scorm Learning Module Object.

Parameters
intScorm LM Object

Definition at line 132 of file class.ilSCORM2004Node.php.

133 {
134 $this->slm_object = $a_slm_obj;
135 }

Referenced by ilSCORM2004Node().

+ Here is the caller graph for this function:

◆ setTitle()

ilSCORM2004Node::setTitle (   $a_title)

Set title.

Parameters
string$a_titletitle

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

52 {
53 $this->title = $a_title;
54 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setType()

ilSCORM2004Node::setType (   $a_type)

◆ uniqueTypesCheck()

static ilSCORM2004Node::uniqueTypesCheck (   $a_items)
static

Check for unique types (all pages or all chapters or all scos)

Definition at line 709 of file class.ilSCORM2004Node.php.

710 {
711 $types = array();
712 if (is_array($a_items))
713 {
714 foreach($a_items as $item)
715 {
717 $types[$type] = $type;
718 }
719 }
720
721 if (count($types) > 1)
722 {
723 return false;
724 }
725 return true;
726 }

References $type, and _lookupType().

Referenced by ilObjSCORM2004LearningModuleGUI\copyItems(), ilSCORM2004NodeGUI\copyItems(), ilObjSCORM2004LearningModuleGUI\cutItems(), and ilSCORM2004NodeGUI\cutItems().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update()

ilSCORM2004Node::update ( )

Update Node.

Reimplemented in ilSCORM2004Sco.

Definition at line 423 of file class.ilSCORM2004Node.php.

424 {
425 global $ilDB;
426
427 $this->updateMetaData();
428
429 $query = "UPDATE sahs_sc13_tree_node SET ".
430 " slm_id = ".$ilDB->quote($this->getSLMId(), "integer").
431 " ,title = ".$ilDB->quote($this->getTitle(), "text").
432 " WHERE obj_id = ".$ilDB->quote($this->getId(), "integer");
433
434 $ilDB->manipulate($query);
435 }
updateMetaData()
update meta data entry

References $ilDB, $query, getId(), getSLMId(), getTitle(), and updateMetaData().

+ Here is the call graph for this function:

◆ updateMetaData()

ilSCORM2004Node::updateMetaData ( )

update meta data entry

Definition at line 280 of file class.ilSCORM2004Node.php.

281 {
282 include_once("Services/MetaData/classes/class.ilMD.php");
283 include_once("Services/MetaData/classes/class.ilMDGeneral.php");
284 include_once("Services/MetaData/classes/class.ilMDDescription.php");
285
286 $md = new ilMD($this->getSLMId(), $this->getId(), $this->getType());
287 $md_gen = $md->getGeneral();
288 $md_gen->setTitle($this->getTitle());
289
290 // sets first description
291 $md_des_ids = $md_gen->getDescriptionIds();
292 if (count($md_des_ids) > 0)
293 {
294 $md_des =& $md_gen->getDescription($md_des_ids[0]);
295// $md_des->setDescription($this->getDescription());
296 $md_des->update();
297 }
298 $md_gen->update();
299 }

References getId(), getSLMId(), getTitle(), and getType().

Referenced by update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $id

ilSCORM2004Node::$id

◆ $slm_id

ilSCORM2004Node::$slm_id

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

Referenced by _getIdForImportId(), and getSLMId().

◆ $slm_object

ilSCORM2004Node::$slm_object

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

Referenced by getContentObject(), and getSLMObject().

◆ $type

ilSCORM2004Node::$type

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