ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
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)
 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.

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

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

References $ilDB, and ilInternalLink\_extractObjIdOfTarget().

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  }
global $ilDB
+ 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.

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

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  }
_lookupSLMID($a_id)
Lookup Scorm Learning Module ID for node id.
_hasUntrashedReference($a_obj_id)
checks wether an object has at least one reference that is not in trash
global $ilDB
+ 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.

References $ilDB, and $query.

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

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  }
global $ilDB
+ 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.

References $ilDB, and $query.

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

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  }
global $ilDB
+ 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.

References $ilDB, and $query.

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

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  }
global $ilDB
+ 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.

References $ilDB.

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  }
global $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.

References $ilDB, and $query.

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

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  }
global $ilDB
+ 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.

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

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

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 _lookupTitle($a_obj_id)
Lookup Title.
static getTree($a_slm_obj_id)
Get scorm module editing tree.
static _lookupType($a_obj_id)
Lookup Type.
global $ilUser
Definition: imgupload.php:15
+ 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.

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

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

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.
static getTree($a_slm_obj_id)
Get scorm module editing tree.
$path
Definition: index.php:22
+ 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.

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

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  }
getImportId()
Set Import ID.
getSLMId()
Get ID of parent Scorm Learning Module Object.
setId($a_id)
Set Node ID.
createMetaData()
create meta data entry
global $ilDB
+ Here is the call graph for this function:

◆ createMetaData()

ilSCORM2004Node::createMetaData ( )

create meta data entry

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

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

Referenced by create().

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  }
getSLMId()
Get ID of parent Scorm Learning Module Object.
getDescription()
Get description.
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delete()

ilSCORM2004Node::delete ( )

Delete Node.

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

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

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
global $ilDB
+ Here is the call graph for this function:

◆ deleteMetaData()

ilSCORM2004Node::deleteMetaData ( )

delete meta data entry

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

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

Referenced by delete().

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  }
getSLMId()
Get ID of parent Scorm Learning Module Object.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteSeqInfo()

ilSCORM2004Node::deleteSeqInfo ( )

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

References getId().

1029  {
1030  include_once("./Modules/Scorm2004/classes/seq_editor/class.ilSCORM2004Item.php");
1031  $seq_item = new ilSCORM2004Item($this->getId());
1032  $seq_item -> delete();
1033  }
Class ilSCORM2004Condition.
+ Here is the call graph for this function:

◆ exportAsScorm12()

ilSCORM2004Node::exportAsScorm12 ( )

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

1043  {
1044  //to implement
1045  return;
1046  }

◆ exportAsScorm13()

ilSCORM2004Node::exportAsScorm13 ( )

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

1048  {
1049  //to implement
1050  return;
1051  }

◆ getContentObject()

ilSCORM2004Node::getContentObject ( )

Get Scorm Learning Module Object.

Returns
int Scorm LM Object

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

References $slm_object.

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

◆ getDescription()

ilSCORM2004Node::getDescription ( )

Get description.

Returns
string Description

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

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

82  {
83  return $this->description;
84  }
+ 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.

Referenced by create().

183  {
184  return $this->import_id;
185  }
+ Here is the caller graph for this function:

◆ getObjectives()

ilSCORM2004Node::getObjectives ( )

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

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

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

1023  {
1024  include_once("./Modules/Scorm2004/classes/seq_editor/class.ilSCORM2004Objective.php");
1025  return ilSCORM2004Objective::fetchAllObjectives($this->slm_object,$this->getId());
1026  }
static fetchAllObjectives($a_slm_object, $a_tree_node_id)
+ 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.

References $slm_id.

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

123  {
124  return $this->slm_id;
125  }
+ 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.

References $slm_object.

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

◆ getTitle()

ilSCORM2004Node::getTitle ( )

Get title.

Returns
string title

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

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

62  {
63  return $this->title;
64  }
+ 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.

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

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

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

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  }
SCORM 2004 Editing tree.
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.
+ 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 780 of file class.ilSCORM2004Node.php.

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

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

781  {
782  global $ilCtrl, $ilUser;
783 
784  // @todo: move this to a service since it can be used here, too
785  include_once("./Modules/LearningModule/classes/class.ilEditClipboard.php");
786 
787  include_once("./Modules/Scorm2004/classes/class.ilSCORM2004OrganizationHFormGUI.php");
790 
791  $tree = ilSCORM2004Node::getTree($a_slm_obj->getId());
792 
793  if (!$first_child) // insert after node id
794  {
795  $parent_id = $tree->getParentId($node_id);
796  $target = $node_id;
797  }
798  else // insert as first child
799  {
800  $parent_id = $node_id;
801  $target = IL_FIRST_NODE;
802  }
803 
804  // cut and paste
805  $scos = $ilUser->getClipboardObjects($a_type);
806  $copied_nodes = array();
807  foreach ($scos as $sco)
808  {
809  $cid = ilSCORM2004Node::pasteTree($a_slm_obj, $sco["id"], $parent_id, $target,
810  $sco["insert_time"], $copied_nodes,
811  (ilEditClipboard::getAction() == "copy"));
812  $target = $cid;
813  }
814  //ilLMObject::updateInternalLinks($copied_nodes);
815 
816  if (ilEditClipboard::getAction() == "cut")
817  {
818  $ilUser->clipboardDeleteObjectsOfType("page");
819  $ilUser->clipboardDeleteObjectsOfType("chap");
820  $ilUser->clipboardDeleteObjectsOfType("sco");
821  $ilUser->clipboardDeleteObjectsOfType("ass");
823  }
824  }
static getPostNodeId()
Get node ID of _POST input.
global $ilCtrl
Definition: ilias.php:18
static getPostFirstChild()
Should node be inserted as first child of target node (true) or as successor (false) ...
static getTree($a_slm_obj_id)
Get scorm module editing tree.
const IL_FIRST_NODE
Definition: class.ilTree.php:5
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)
Paste item (tree) from clipboard or other learning module to target scorm learning module...
global $ilUser
Definition: imgupload.php:15
+ 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 838 of file class.ilSCORM2004Node.php.

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

Referenced by ilObjSCORM2004LearningModuleGUI\insertChapterClip().

839  {
840  global $ilUser, $ilCtrl, $ilLog;
841 
842  // @todo: move this to a service since it can be used here, too
843  include_once("./Modules/LearningModule/classes/class.ilEditClipboard.php");
844 
845  include_once("./Modules/Scorm2004/classes/class.ilSCORM2004OrganizationHFormGUI.php");
848 
849  $tree = ilSCORM2004Node::getTree($a_slm_obj->getId());
850 
851  if ($a_as_sub) // as subchapter
852  {
853  if (!$first_child) // insert under parent
854  {
855  $parent_id = $node_id;
856  $target = "";
857  }
858  else // we shouldnt end up here
859  {
860  return;
861  }
862  }
863  else // as chapter
864  {
865  if (!$first_child) // insert after node id
866  {
867  $parent_id = $tree->getParentId($node_id);
868  $target = $node_id;
869  }
870  else // insert as first child
871  {
872  $parent_id = $node_id;
873  $target = IL_FIRST_NODE;
874 
875  // do not move a chapter in front of a sco (maybe never needed)
876  $childs = $tree->getChildsByType($parent_id, "sco");
877  if (count($childs) != 0)
878  {
879  $target = $childs[count($childs) - 1]["obj_id"];
880  }
881  }
882  }
883 
884  // copy and paste
885  $chapters = $ilUser->getClipboardObjects("chap", true);
886  $copied_nodes = array();
887  foreach ($chapters as $chap)
888  {
889  $cid = ilSCORM2004Node::pasteTree($a_slm_obj, $chap["id"], $parent_id,
890  $target, $chap["insert_time"], $copied_nodes,
891  (ilEditClipboard::getAction() == "copy"));
892  $target = $cid;
893  }
894  //ilLMObject::updateInternalLinks($copied_nodes);
895 
896  if (ilEditClipboard::getAction() == "cut")
897  {
898  $ilUser->clipboardDeleteObjectsOfType("page");
899  $ilUser->clipboardDeleteObjectsOfType("chap");
900  $ilUser->clipboardDeleteObjectsOfType("sco");
901  $ilUser->clipboardDeleteObjectsOfType("ass");
903  }
904  }
static getPostNodeId()
Get node ID of _POST input.
global $ilCtrl
Definition: ilias.php:18
static getPostFirstChild()
Should node be inserted as first child of target node (true) or as successor (false) ...
static getTree($a_slm_obj_id)
Get scorm module editing tree.
const IL_FIRST_NODE
Definition: class.ilTree.php:5
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)
Paste item (tree) from clipboard or other learning module to target scorm learning module...
global $ilUser
Definition: imgupload.php:15
+ 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.

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

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

732  {
733  global $ilCtrl, $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  $pages = $ilUser->getClipboardObjects("page");
757  $copied_nodes = array();
758  foreach ($pages as $pg)
759  {
760  $cid = ilSCORM2004Node::pasteTree($a_slm_obj, $pg["id"], $parent_id, $target,
761  $pg["insert_time"], $copied_nodes,
762  (ilEditClipboard::getAction() == "copy"));
763  $target = $cid;
764  }
765  //ilLMObject::updateInternalLinks($copied_nodes);
766 
767  if (ilEditClipboard::getAction() == "cut")
768  {
769  $ilUser->clipboardDeleteObjectsOfType("page");
770  $ilUser->clipboardDeleteObjectsOfType("chap");
771  $ilUser->clipboardDeleteObjectsOfType("sco");
772  $ilUser->clipboardDeleteObjectsOfType("ass");
774  }
775  }
static getPostNodeId()
Get node ID of _POST input.
global $ilCtrl
Definition: ilias.php:18
static getPostFirstChild()
Should node be inserted as first child of target node (true) or as successor (false) ...
static getTree($a_slm_obj_id)
Get scorm module editing tree.
const IL_FIRST_NODE
Definition: class.ilTree.php:5
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)
Paste item (tree) from clipboard or other learning module to target scorm learning module...
global $ilUser
Definition: imgupload.php:15
+ 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 829 of file class.ilSCORM2004Node.php.

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

830  {
831  self::insertAssetClip($a_slm_obj, "sco");
832  }
+ 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.

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

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  }
getSLMId()
Get ID of parent Scorm Learning Module Object.
static _writeTitle($a_obj_id, $a_title)
Write Title.
+ Here is the call graph for this function:

◆ parentHasSeqTemplate()

ilSCORM2004Node::parentHasSeqTemplate ( )

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

References getId().

1036  {
1037  include_once("./Modules/Scorm2004/classes/seq_editor/class.ilSCORM2004Utilities.php");
1038  $seq_util = new ilSCORM2004Utilities($this->getId());
1039  return $seq_util -> parentHasSeqTemplate($this->slm_object);
1040  }
Class ilSCORM2004Utilities.
+ Here is the call 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 
)
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 918 of file class.ilSCORM2004Node.php.

References $ilLog, $ilUser, _lookupSLMID(), _lookupType(), ilMD\cloneMD(), IL_LAST_NODE, and putInTree().

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

920  {
921  global $ilUser, $ilias, $ilLog;
922 
923  // source lm id, item type and lm object
924  $item_slm_id = ilSCORM2004Node::_lookupSLMID($a_item_id);
925  $item_type = ilSCORM2004Node::_lookupType($a_item_id);
926  //$slm_obj = $ilias->obj_factory->getInstanceByObjId($item_slm_id);
927  include_once("./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php");
928  $slm_obj = new ilObjSCORM2004LearningModule($item_slm_id, false);
929 
930  if ($item_type == "chap")
931  {
932  include_once("./Modules/Scorm2004/classes/class.ilSCORM2004Chapter.php");
933  $item = new ilSCORM2004Chapter($slm_obj, $a_item_id);
934  }
935  else if ($item_type == "page")
936  {
937  include_once("./Modules/Scorm2004/classes/class.ilSCORM2004PageNode.php");
938  $item = new ilSCORM2004PageNode($slm_obj, $a_item_id);
939  }
940  else if ($item_type == "sco")
941  {
942  include_once("./Modules/Scorm2004/classes/class.ilSCORM2004Sco.php");
943  $item = new ilSCORM2004Sco($slm_obj, $a_item_id);
944  }
945  else if ($item_type == "ass")
946  {
947  include_once("./Modules/Scorm2004/classes/class.ilSCORM2004Asset.php");
948  $item = new ilSCORM2004Asset($slm_obj, $a_item_id);
949  }
950 
951  $ilLog->write("Getting from clipboard type ".$item_type.", ".
952  "Item ID: ".$a_item_id.", of original SLM: ".$item_slm_id);
953 
954  if ($item_slm_id != $a_target_slm->getId() && !$a_as_copy)
955  {
956  // @todo: check whether st is NOT in tree
957 
958  // "move" metadata to new lm
959  include_once("Services/MetaData/classes/class.ilMD.php");
960  $md = new ilMD($item_slm_id, $item->getId(), $item->getType());
961  $new_md = $md->cloneMD($a_target_slm->getId(), $item->getId(), $item->getType());
962 
963  // update lm object
964  $item->setSLMId($a_target_slm->getId());
965  $item->setSLMObject($a_target_slm);
966  $item->update();
967 
968  // delete old meta data set
969  $md->deleteAll();
970 
971  if ($item_type == "page")
972  {
973  $page = $item->getPageObject();
974  $page->buildDom($a_from_clipboard);
975  $page->setParentId($a_target_slm->getId());
976  $page->update();
977  }
978  }
979 
980  if ($a_as_copy)
981  {
982  $target_item = $item->copy($a_target_slm);
983  $a_copied_nodes[$item->getId()] = $target_item->getId();
984  }
985  else
986  {
987  $target_item = $item;
988  }
989 
990  $ilLog->write("Putting into tree type ".$target_item->getType().
991  "Item ID: ".$target_item->getId().", Parent: ".$a_parent_id.", ".
992  "Target: ".$a_target.", Item LM:".$target_item->getContentObject()->getId());
993 
994  ilSCORM2004Node::putInTree($target_item, $a_parent_id, $a_target);
995 
996  if ($a_from_clipboard)
997  {
998  $childs = $ilUser->getClipboardChilds($item->getId(), $a_insert_time);
999  }
1000  else
1001  {
1002  // get childs of source tree
1003  $source_tree = $slm_obj->getTree();
1004  $childs = $source_tree->getChilds($a_item_id);
1005  }
1006 
1007  foreach($childs as $child)
1008  {
1009  $child_id = ($a_from_clipboard)
1010  ? $child["id"]
1011  : $child["child"];
1012  ilSCORM2004Node::pasteTree($a_target_slm, $child_id, $target_item->getId(),
1013  IL_LAST_NODE, $a_insert_time, $a_copied_nodes, $a_as_copy, $a_from_clipboard);
1014  }
1015 
1016  return $target_item->getId();
1017  }
& cloneMD($a_rbac_id, $a_obj_id, $a_obj_type)
Definition: class.ilMD.php:361
Class ilSCORM2004PageNode.
static putInTree($a_obj, $a_parent_id="", $a_target_node_id="")
put this object into content object tree
Class ilSCORM2004Sco.
Class ilSCORM2004Chapter.
_lookupSLMID($a_id)
Lookup Scorm Learning Module ID for node id.
static _lookupType($a_obj_id)
Lookup Type.
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)
Paste item (tree) from clipboard or other learning module to target scorm learning module...
const IL_LAST_NODE
Definition: class.ilTree.php:4
global $ilUser
Definition: imgupload.php:15
Class ilObjSCORM2004LearningModule.
Class ilSCORM2004Asset.
+ 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.

References IL_FIRST_NODE, and ilTree\setTreeTablePK().

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

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  }
const IL_FIRST_NODE
Definition: class.ilTree.php:5
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
setTreeTablePK($a_column_name)
set column containing primary key in tree table public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read()

ilSCORM2004Node::read ( )

Read Data of Node.

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

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

Referenced by ilSCORM2004Node().

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
global $ilDB
+ 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

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

Referenced by create().

163  {
164  $this->id = $a_id;
165  }
+ 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.

Referenced by read().

193  {
194  $this->import_id = $a_id;
195  }
+ 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.

Referenced by ilSCORM2004Node().

112  {
113  $this->slm_id = $a_slm_id;
114 
115  }
+ 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.

Referenced by ilSCORM2004Node().

133  {
134  $this->slm_object = $a_slm_obj;
135  }
+ 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.

Referenced by read().

52  {
53  $this->title = $a_title;
54  }
+ 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.

References $type, and _lookupType().

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

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  }
static _lookupType($a_obj_id)
Lookup Type.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update()

ilSCORM2004Node::update ( )

Update Node.

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

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

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  }
getSLMId()
Get ID of parent Scorm Learning Module Object.
updateMetaData()
update meta data entry
global $ilDB
+ Here is the call graph for this function:

◆ updateMetaData()

ilSCORM2004Node::updateMetaData ( )

update meta data entry

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

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

Referenced by update().

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  }
getSLMId()
Get ID of parent Scorm Learning Module Object.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $id

ilSCORM2004Node::$id

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

Referenced by clipboardCut(), getId(), and MDUpdateListener().

◆ $slm_id

ilSCORM2004Node::$slm_id

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

Referenced by 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: