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

Class ilSCORM2004Asset. More...

+ Inheritance diagram for ilSCORM2004Asset:
+ Collaboration diagram for ilSCORM2004Asset:

Public Member Functions

 __construct ($a_slm_object, $a_id=0)
 Constructor. More...
 
 delete ($a_delete_meta_data=true)
 Delete a SCO. More...
 
 create ($a_upload=false, $a_template=false)
 Create asset. More...
 
 copy ($a_target_slm)
 Copy sco. More...
 
 exportScorm ($a_inst, $a_target_dir, $ver, &$expLog)
 
 exportHTML ($a_inst, $a_target_dir, &$expLog, $a_asset_type="sco", $a_one_file="")
 
 exportHTML4PDF ($a_inst, $a_target_dir, &$expLog)
 
 exportPDF ($a_inst, $a_target_dir, &$expLog)
 
 exportPDFPrepareXmlNFiles ($a_inst, $a_target_dir, &$expLog, &$a_xml_writer)
 
 exportHTMLPageObjects ($a_inst, $a_target_dir, &$expLog, $mode, $a_asset_type="sco", $a_one_file="", $a_sco_tpl=null)
 Export HTML pages of SCO. More...
 
 exportXMLPageObjects ($a_target_dir, &$a_xml_writer, $a_inst, &$expLog)
 
 exportXMLMediaObjects (&$a_xml_writer, $a_inst, $a_target_dir, &$expLog)
 
 exportFileItems ($a_target_dir, &$expLog)
 export files of file itmes More...
 
 exportXMLMetaData (&$a_xml_writer)
 
 getExportFiles ()
 
 getGlossaryTermIds ()
 Get glossary term ids in sco. More...
 
- Public Member Functions inherited from ilSCORM2004Node
 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 renderNavigation ($a_tpl, $a_spacer_img="", $a_lang="")
 Render navigation. More...
 
static renderMetaPage ($a_tpl, $a_sco, $a_asset_type="", $mode="")
 Render meta page (description/objectives at beginning) More...
 
static convertLists ($a_text)
 Convert * and # to lists. 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 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

 $q_media = null
 
- Data Fields inherited from ilSCORM2004Node
 $slm_id
 
 $type
 
 $id
 
 $slm_object
 

Private Member Functions

 delete_rec ($a_delete_meta_data=true)
 Delete Nested Page Objects. More...
 
 fixFullscreeenLink ($matches)
 
 insertQuestion ($matches)
 

Detailed Description

Class ilSCORM2004Asset.

Asset class for SCORM 2004 Editing

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

Definition at line 16 of file class.ilSCORM2004Asset.php.

Constructor & Destructor Documentation

◆ __construct()

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

Constructor.

Reimplemented in ilSCORM2004Sco.

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

24 {
25 parent::ilSCORM2004Node($a_slm_object, $a_id);
26 $this->setType("ass");
27 }
setType($a_type)
Set type.

References ilSCORM2004Node\setType().

+ Here is the call graph for this function:

Member Function Documentation

◆ convertLists()

static ilSCORM2004Asset::convertLists (   $a_text)
static

Convert * and # to lists.

Parameters
string$a_texttext
Returns
string text

Definition at line 668 of file class.ilSCORM2004Asset.php.

669 {
670 include_once("./Services/COPage/classes/class.ilPCParagraph.php");
671 $a_text = nl2br($a_text);
672 $a_text = str_replace(array("\n", "\r"), "", $a_text);
673 $a_text = str_replace("<br>", "<br />", $a_text);
674 $a_text = ilPCParagraph::input2xmlReplaceLists($a_text);
675 $a_text = str_replace(
676 array("<SimpleBulletList>", "</SimpleBulletList>",
677 "<SimpleListItem>", "</SimpleListItem>",
678 "<SimpleNumberedList>", "</SimpleNumberedList>"
679 ),
680 array("<ul class='ilc_list_u_BulletedList'>", "</ul>",
681 "<li class='ilc_list_item_StandardListItem'>", "</li>",
682 "<ol class='ilc_list_o_NumberedList'>", "</ol>"
683 ),
684 $a_text);
685 return $a_text;
686 }
static input2xmlReplaceLists($a_text)
Converts xml from DB to output in edit textarea.

References ilPCParagraph\input2xmlReplaceLists().

Referenced by ilObjectivesAlignmentTableGUI\fillRow().

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

◆ copy()

ilSCORM2004Asset::copy (   $a_target_slm)

Copy sco.

Reimplemented in ilSCORM2004Sco.

Definition at line 78 of file class.ilSCORM2004Asset.php.

79 {
80 $ass = new ilSCORM2004Asset($a_target_slm);
81 $ass->setTitle($this->getTitle());
82 if ($this->getSLMId() != $a_target_slm->getId())
83 {
84 $ass->setImportId("il__ass_".$this->getId());
85 }
86 $ass->setSLMId($a_target_slm->getId());
87 $ass->setType($this->getType());
88 $ass->setDescription($this->getDescription());
89 $ass->create(true);
90 $a_copied_nodes[$this->getId()] = $ass->getId();
91
92 // copy meta data
93 include_once("Services/MetaData/classes/class.ilMD.php");
94 $md = new ilMD($this->getSLMId(), $this->getId(), $this->getType());
95 $new_md = $md->cloneMD($a_target_slm->getId(), $ass->getId(), $this->getType());
96
97 return $ass;
98 }
Class ilSCORM2004Asset.
getSLMId()
Get ID of parent Scorm Learning Module Object.
getDescription()
Get description.

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

Referenced by exportFileItems(), exportHTMLPageObjects(), and exportScorm().

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

◆ create()

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

Create asset.

Reimplemented in ilSCORM2004Sco.

Definition at line 43 of file class.ilSCORM2004Asset.php.

44 {
45 include_once("./Modules/Scorm2004/classes/seq_editor/class.ilSCORM2004Item.php");
46 include_once("./Modules/Scorm2004/classes/seq_editor/class.ilSCORM2004Objective.php");
47 parent::create($a_upload);
48 if (!$a_template) {
49 $seq_item = new ilSCORM2004Item($this->getId());
50 $seq_item->insert();
51 }
52 }
Class ilSCORM2004Condition.

References ilSCORM2004Node\getId().

+ Here is the call graph for this function:

◆ delete()

ilSCORM2004Asset::delete (   $a_delete_meta_data = true)

Delete a SCO.

Definition at line 32 of file class.ilSCORM2004Asset.php.

33 {
34 $node_data = $this->tree->getNodeData($this->getId());
35 $this->delete_rec($a_delete_meta_data);
36 $this->tree->deleteTree($node_data);
37 parent::deleteSeqInfo();
38 }
delete_rec($a_delete_meta_data=true)
Delete Nested Page Objects.

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

+ Here is the call graph for this function:

◆ delete_rec()

ilSCORM2004Asset::delete_rec (   $a_delete_meta_data = true)
private

Delete Nested Page Objects.

Definition at line 57 of file class.ilSCORM2004Asset.php.

58 {
59 $childs = $this->tree->getChilds($this->getId());
60 foreach ($childs as $child)
61 {
62 $obj =& ilSCORM2004NodeFactory::getInstance($this->slm_object, $child["obj_id"], false);
63 if (is_object($obj))
64 {
65 if ($obj->getType() == "page")
66 {
67 $obj->delete($a_delete_meta_data);
68 }
69 }
70 unset($obj);
71 }
72 parent::delete($a_delete_meta_data);
73 }
static getInstance($a_slm_object, $a_id=0, $a_halt=true)

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

Referenced by delete().

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

◆ exportFileItems()

ilSCORM2004Asset::exportFileItems (   $a_target_dir,
$expLog 
)

export files of file itmes

Definition at line 815 of file class.ilSCORM2004Asset.php.

816 {
817 include_once("./Modules/File/classes/class.ilObjFile.php");
818 if(is_array($this->file_ids))
819 foreach ($this->file_ids as $file_id)
820 {
821 $expLog->write(date("[y-m-d H:i:s] ")."File Item ".$file_id);
822 if (ilObject::_lookupType($file_id) == "file")
823 {
824 $file_obj = new ilObjFile($file_id, false);
825 $file_obj->export($a_target_dir);
826 unset($file_obj);
827 }
828 else
829 {
830 $expLog->write(date("[y-m-d H:i:s] ")."File Item not found, ID: ".$file_id);
831 }
832 }
833
834 include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
835 $linked_mobs = array();
836 if(is_array($this->mob_ids ))
837 {
838 // mobs directly embedded into pages
839 foreach ($this->mob_ids as $mob_id)
840 {
841 if ($mob_id > 0 && ilObject::_exists($mob_id))
842 {
843 $expLog->write(date("[y-m-d H:i:s] ")."Media Object ".$mob_id);
844 $media_obj = new ilObjMediaObject($mob_id);
845 $media_obj->exportFiles($a_target_dir, $expLog);
846 $lmobs = $media_obj->getLinkedMediaObjects($this->mob_ids);
847 $linked_mobs = array_merge($linked_mobs, $lmobs);
848
849 unset($media_obj);
850 }
851 }
852
853 // linked mobs (in map areas)
854 foreach ($linked_mobs as $mob_id)
855 {
856 if ($mob_id > 0 && ilObject::_exists($mob_id))
857 {
858 $expLog->write(date("[y-m-d H:i:s] ")."Media Object ".$mob_id);
859 $media_obj = new ilObjMediaObject($mob_id);
860 $media_obj->exportFiles($a_target_dir);
861 unset($media_obj);
862 }
863 }
864 }
865
866 //media files in questions
867 foreach ($this->q_media as $media) {
868 if ($media !="") {
869 error_log($media);
870 if (is_file ($media))
871 {
872 copy($media, $a_target_dir."/objects/".basename($media));
873 }
874 }
875 }
876 }
Class ilObjFile.
Class ilObjMediaObject.
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data@access public
static _lookupType($a_id, $a_reference=false)
lookup object type
copy($a_target_slm)
Copy sco.

References ilObject\_exists(), ilObject\_lookupType(), copy(), and Monolog\Handler\error_log().

Referenced by exportHTMLPageObjects(), and exportPDFPrepareXmlNFiles().

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

◆ exportHTML()

ilSCORM2004Asset::exportHTML (   $a_inst,
  $a_target_dir,
$expLog,
  $a_asset_type = "sco",
  $a_one_file = "" 
)

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

174 {
175
176 $this->slm_object->prepareHTMLExporter($a_target_dir);
177 $this->exportHTMLPageObjects($a_inst, $a_target_dir, $expLog, 'full',
178 $a_asset_type, $a_one_file);
179
180 }
exportHTMLPageObjects($a_inst, $a_target_dir, &$expLog, $mode, $a_asset_type="sco", $a_one_file="", $a_sco_tpl=null)
Export HTML pages of SCO.

References exportHTMLPageObjects().

Referenced by exportScorm(), ilSCORM2004EntryAsset\exportScorm(), and ilSCORM2004FinalAsset\exportScorm().

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

◆ exportHTML4PDF()

ilSCORM2004Asset::exportHTML4PDF (   $a_inst,
  $a_target_dir,
$expLog 
)

Definition at line 183 of file class.ilSCORM2004Asset.php.

184 {
185 ilUtil::makeDir($a_target_dir.'/css');
186 ilUtil::makeDir($a_target_dir.'/objects');
187 ilUtil::makeDir($a_target_dir.'/images');
188 $this->exportHTMLPageObjects($a_inst, $a_target_dir, $expLog, 'pdf');
189 }
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...

References exportHTMLPageObjects(), and ilUtil\makeDir().

Referenced by exportPDFPrepareXmlNFiles().

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

◆ exportHTMLPageObjects()

ilSCORM2004Asset::exportHTMLPageObjects (   $a_inst,
  $a_target_dir,
$expLog,
  $mode,
  $a_asset_type = "sco",
  $a_one_file = "",
  $a_sco_tpl = null 
)

Export HTML pages of SCO.

Definition at line 268 of file class.ilSCORM2004Asset.php.

270 {
271 global $tpl, $ilCtrl, $ilBench,$ilLog, $lng;
272
273 include_once "./Modules/Scorm2004/classes/class.ilSCORM2004PageGUI.php";
274 include_once "./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModuleGUI.php";
275 include_once "./Services/MetaData/classes/class.ilMD.php";
276
277 $output = "";
278 $tree = new ilTree($this->slm_id);
279 $tree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
280 $tree->setTreeTablePK("slm_id");
281
282 // @todo
283 // Why is that much HTML code in an application class?
284 // Please extract all this HTML to a tpl.<t_name>.html file and use
285 // placeholders and the template engine to insert data.
286 //
287 // There copy/paste code residenting in ilSCORM2004ScoGUI. This
288 // should be merged.
289 //
290 // alex, 4 Apr 09
291 //
292
293// if ($a_one_file == "")
294// {
295 $sco_tpl = new ilTemplate("tpl.sco.html", true, true, "Modules/Scorm2004");
296// }
297// else
298// {
299// $sco_tpl = $a_sco_tpl;
300// }
301
302 if ($mode != 'pdf' && $a_one_file == "")
303 {
304 include_once("./Services/COPage/classes/class.ilCOPageHTMLExport.php");
305 $pg_exp = new ilCOPageHTMLExport($a_target_dir);
306 $pg_exp->getPreparedMainTemplate($sco_tpl);
307
308 // init and question lang vars
310 $sco_tpl->setCurrentBlock("init");
311 include_once("./Services/COPage/classes/class.ilPCQuestion.php");
312 $sco_tpl->setVariable("TXT_INIT_CODE",
314 $sco_tpl->parseCurrentBlock();
315
316 // (additional) style sheets needed
317 $styles = array("./css/yahoo/container.css",
318 "./css/question_handling.css");
319 foreach ($styles as $style)
320 {
321 $sco_tpl->setCurrentBlock("css_file");
322 $sco_tpl->setVariable("CSS_FILE", $style);
323 $sco_tpl->parseCurrentBlock();
324 }
325
326 // (additional) scripts needed
327 $scripts = array("./js/scorm.js",
328 "./js/pager.js", "./js/pure.js",
329 "./js/questions_".$this->getId().".js");
330 foreach ($scripts as $script)
331 {
332 $sco_tpl->setCurrentBlock("js_file");
333 $sco_tpl->setVariable("JS_FILE", $script);
334 $sco_tpl->parseCurrentBlock();
335 }
336
337 if ($a_asset_type != "entry_asset" && $a_asset_type != "final_asset")
338 {
339 self::renderNavigation($sco_tpl, "./images/spacer.png", $lk);
340 }
341
342 $sco_tpl->touchBlock("finish");
343 }
344 // render head
345 $sco_tpl->setCurrentBlock("head");
346 $sco_tpl->setVariable("SCO_TITLE", $this->getTitle());
347 $sco_tpl->parseCurrentBlock();
348 $sco_tpl->touchBlock("tail");
349
350 // meta page (meta info at SCO beginning)
351 self::renderMetaPage($sco_tpl, $this, $a_asset_type, $mode);
352 if ($a_one_file != "")
353 {
354 fputs($a_one_file, "<a name='sco".$this->getId()."'></a>");
355 fputs($a_one_file, $sco_tpl->get("meta_page"));
356 }
357
358 //notify Question Exporter of new SCO
359 require_once './Modules/Scorm2004/classes/class.ilQuestionExporter.php';
361
362 // init export (this initialises glossary template)
364 $terms = array();
365 $terms = $this->getGlossaryTermIds();
366 include_once("./Modules/Scorm2004/classes/class.ilSCORM2004ScoGUI.php");
367 $pages = $tree->getSubTree($tree->getNodeData($this->getId()),true,'page');
368 $sco_q_ids = array();
369 foreach($pages as $page)
370 {
371 //echo(print_r($page));
372 $page_obj = new ilSCORM2004PageGUI($this->getType(), $page["obj_id"], 0,
373 $this->slm_object->getId());
374 $page_obj->setPresentationTitle($page["title"]);
375 $page_obj->setOutputMode(IL_PAGE_OFFLINE);
376 $page_obj->setStyleId($this->slm_object->getStyleSheetId());
377 if (count($terms) > 1)
378 {
379 $page_obj->setGlossaryOverviewInfo(
381 }
382
383 $page_output = $page_obj->showPage("export");
384
385 // collect media objects
386 $mob_ids = $page_obj->getSCORM2004Page()->collectMediaObjects(false);
387 foreach($mob_ids as $mob_id)
388 {
389 $this->mob_ids[$mob_id] = $mob_id;
390 $media_obj = new ilObjMediaObject($mob_id);
391 if($media_obj->hasFullscreenItem())
392 $media_obj->exportMediaFullscreen($a_target_dir, $page_obj->getPageObject());
393 }
394
395 // collect glossary items
396 $int_links = $page_obj->getPageObject()->getInternalLinks(true);
397 include_once("./Services/Link/classes/class.ilInternalLink.php");
398 include_once("./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
399 if (is_array($int_links))
400 {
401 foreach ($int_links as $k => $e)
402 {
403 // glossary link
404 if ($e["Type"] == "GlossaryItem")
405 {
406 $karr = explode(":", $k);
409 foreach ($dids as $did)
410 {
411 include_once("./Modules/Glossary/classes/class.ilGlossaryDefPage.php");
412 $def_pg = new ilGlossaryDefPage($did["id"]);
413 $def_pg->buildDom();
414 $mob_ids = $def_pg->collectMediaObjects(false);
415 foreach($mob_ids as $mob_id)
416 {
417 $this->mob_ids[$mob_id] = $mob_id;
418//echo "<br>-$mob_id-";
419 $media_obj = new ilObjMediaObject($mob_id);
420 if($media_obj->hasFullscreenItem())
421 $media_obj->exportMediaFullscreen($a_target_dir, $def_pg);
422 }
423 include_once("./Services/COPage/classes/class.ilPCFileList.php");
424 $file_ids = ilPCFileList::collectFileItems($def_pg, $def_pg->getDomDoc());
425
426 foreach($file_ids as $file_id)
427 {
428 $this->file_ids[$file_id] = $file_id;
429 }
430 }
431 }
432 }
433 }
434//exit;
435 // collect all file items
436 include_once("./Services/COPage/classes/class.ilPCFileList.php");
437 $file_ids = ilPCFileList::collectFileItems($page_obj->getSCORM2004Page(), $page_obj->getSCORM2004Page()->getDomDoc());
438 foreach($file_ids as $file_id)
439 {
440 $this->file_ids[$file_id] = $file_id;
441 }
442
443 if ( $mode == 'pdf')
444 {
445 include_once("./Services/COPage/classes/class.ilPCQuestion.php");
446 $q_ids = ilPCQuestion::_getQuestionIdsForPage("sahs", $page["obj_id"]);
447 foreach ($q_ids as $q_id)
448 {
449 include_once("./Modules/TestQuestionPool/classes/class.assQuestionGUI.php");
450 $q_gui =& assQuestionGUI::_getQuestionGUI("", $q_id);
451 $q_gui->outAdditionalOutput();
452 $html = $q_gui->getPreview(TRUE);
453 $page_output = preg_replace("/{{{{{Question;il__qst_".$q_id."}}}}}/i",$html,$page_output);
454 }
455
456 $sco_tpl->touchBlock("pdf_pg_break");
457 }
458
459 $sco_tpl->setCurrentBlock("page");
460 $sco_tpl->setVariable("PAGE", $page_output);
461 $sco_tpl->parseCurrentBlock();
462
463 // get all question ids of the sco
464 if ($a_one_file != "")
465 {
466 include_once("./Services/COPage/classes/class.ilPCQuestion.php");
467 $q_ids = ilPCQuestion::_getQuestionIdsForPage("sahs", $page["obj_id"]);
468 foreach ($q_ids as $i)
469 {
470 if (!in_array($i, $sco_q_ids))
471 {
472 $sco_q_ids[] = $i;
473 }
474 }
475 }
476 }
477
478 // glossary
479 if ($mode!='pdf')
480 {
481 $sco_tpl->setVariable("GLOSSARY_HTML",
483 }
484
485 if ($a_one_file == "")
486 {
487 $output = $sco_tpl->get();
488 }
489 else
490 {
491 $output = $sco_tpl->get("page");
492 }
493
494 if($mode=='pdf')
495 $output = preg_replace("/<div class=\"ilc_page_title_PageTitle\">(.*?)<\/div>/i","<h2>$1</h2>",$output);
496
497 //$output = preg_replace("/\.\/mobs\/mm_(\d+)\/([^\"]+)/i","./objects/il_".IL_INST_ID."_mob_$1/$2",$output);
498 $output = preg_replace("/mobs\/mm_(\d+)\/([^\"]+)/i","./objects/il_".IL_INST_ID."_mob_$1/$2",$output);
499 $output = preg_replace("/\.\/files\/file_(\d+)\/([^\"]+)/i","./objects/il_".IL_INST_ID."_file_$1/$2",$output);
500 $output = preg_replace("/\.\/Services\/MediaObjects\/flash_mp3_player/i","./players",$output);
501// $output = preg_replace("/\.\/".str_replace("/", "\/", ilPlayerUtil::getFlashVideoPlayerDirectory())."/i","./players",$output);
502 $output = preg_replace("/file=..\/..\/..\/.\//i","file=../",$output);
503
504 if($mode!='pdf')
505 {
506 $output = preg_replace_callback("/href=\"&mob_id=(\d+)&pg_id=(\d+)\"/",array(get_class($this), 'fixFullscreeenLink'),$output);
507 // this one is for fullscreen in glossary entries
508 $output = preg_replace_callback("/href=\"fullscreen_(\d+)\.html\"/",array(get_class($this), 'fixFullscreeenLink'),$output);
509 $output = preg_replace_callback("/{{{{{(Question;)(il__qst_[0-9]+)}}}}}/",array(get_class($this), 'insertQuestion'),$output);
510// $output = preg_replace("/&#123;/","",$output);
511// $output = preg_replace("/&#125;/","",$output);
512 $q_handling = file_get_contents('./Modules/Scorm2004/scripts/questions/question_handling.js');
513 fputs(fopen($a_target_dir.'/js/questions_'.$this->getId().'.js','w+'),ilQuestionExporter::questionsJS().$q_handling);
514 copy("./Modules/Scorm2004/templates/default/question_handling.css",
515 $a_target_dir.'/css/question_handling.css');
516
517 // hack to get the question js into the file and to display the correct answers
518 if ($a_one_file != "")
519 {
520 $output = '<script type="text/javascript">'.ilQuestionExporter::questionsJS().'</script>'.$output;
521 if (count($sco_q_ids) > 0)
522 {
523 $output.= '<script type="text/javascript">';
524 foreach ($sco_q_ids as $i)
525 {
526 if ($i > 0)
527 {
528 $output.= "ilias.questions.showCorrectAnswers(".$i."); \n";
529 }
530 }
531 $output.= '</script>';
532 }
533 }
534
535 foreach(ilQuestionExporter::getMobs() as $mob_id)
536 {
537 $this->mob_ids[$mob_id] = $mob_id;
538 }
539 }
540 $this->q_media = ilQuestionExporter::getFiles();
541 //questions export end
542
543 if ($a_one_file != "")
544 {
545 fputs($a_one_file, $output);
546 }
547 else
548 {
549 fputs(fopen($a_target_dir.'/index.html','w+'),$output);
550 }
551
552 $this->exportFileItems($a_target_dir, $expLog);
553
554 }
global $tpl
Definition: ilias.php:8
const IL_PAGE_OFFLINE
& _getQuestionGUI($question_type, $question_id=-1)
Creates a question gui representation and returns the alias to the question gui note: please do not u...
HTML export class for pages.
Glossary definition page object.
getAffectiveLocalization($a_id)
Get affective localization.
static collectFileItems($a_page, $a_domdoc)
Get all file items that are used within the page.
static getJSTextInitCode($a_lang)
Get js txt init code.
static _getQuestionIdsForPage($a_parent_type, $a_page_id, $a_lang="-")
Get all questions of a page.
static questionsJS(array $a_qids=null)
getGlossaryTermIds()
Get glossary term ids in sco.
static renderMetaPage($a_tpl, $a_sco, $a_asset_type="", $mode="")
Render meta page (description/objectives at beginning)
static renderNavigation($a_tpl, $a_spacer_img="", $a_lang="")
Render navigation.
exportFileItems($a_target_dir, &$expLog)
export files of file itmes
Class ilSCORM2004Page GUI class.
static initExport()
Init export.
static getGlossaryHTML($a_sco)
Get glossary html (only in export mode)
static getGlossaryOverviewId()
Get sco glossary overlay id.
special template class to simplify handling of ITX/PEAR
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
$html
Definition: example_001.php:87
$style
Definition: example_012.php:70
global $ilBench
Definition: ilias.php:18
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:40

References $html, $ilBench, $ilCtrl, $ilLog, $lng, $style, $tpl, ilInternalLink\_extractObjIdOfTarget(), assQuestionGUI\_getQuestionGUI(), ilPCQuestion\_getQuestionIdsForPage(), ilPCFileList\collectFileItems(), copy(), exportFileItems(), ilObjSAHSLearningModule\getAffectiveLocalization(), ilGlossaryDefinition\getDefinitionList(), ilQuestionExporter\getFiles(), ilSCORM2004PageGUI\getGlossaryHTML(), ilSCORM2004ScoGUI\getGlossaryOverviewId(), getGlossaryTermIds(), ilSCORM2004Node\getId(), ilPCQuestion\getJSTextInitCode(), ilQuestionExporter\getMobs(), ilSCORM2004Node\getTitle(), ilSCORM2004Node\getType(), IL_PAGE_OFFLINE, ilQuestionExporter\indicateNewSco(), ilSCORM2004PageGUI\initExport(), ilQuestionExporter\questionsJS(), renderMetaPage(), and renderNavigation().

Referenced by exportHTML(), and exportHTML4PDF().

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

◆ exportPDF()

ilSCORM2004Asset::exportPDF (   $a_inst,
  $a_target_dir,
$expLog 
)

Definition at line 191 of file class.ilSCORM2004Asset.php.

192 {
193 global $tpl, $lng, $ilCtrl;
194 $a_xml_writer = new ilXmlWriter;
195 $a_xml_writer->xmlStartTag("ContentObject", array("Type"=>"SCORM2004SCO"));
196 $this->exportPDFPrepareXmlNFiles($a_inst, $a_target_dir, $expLog,$a_xml_writer);
197 $a_xml_writer->xmlEndTag("ContentObject");
198 include_once 'Services/Transformation/classes/class.ilXML2FO.php';
199 $xml2FO = new ilXML2FO();
200 $xml2FO->setXSLTLocation('./Modules/Scorm2004/templates/xsl/contentobject2fo.xsl');
201 $xml2FO->setXMLString($a_xml_writer->xmlDumpMem());
202 $xml2FO->setXSLTParams(array ('target_dir' => $a_target_dir));
203 $xml2FO->transform();
204 $fo_string = $xml2FO->getFOString();
205 $fo_xml = simplexml_load_string($fo_string);
206 $fo_ext = $fo_xml->xpath("//fo:declarations");
207 $fo_ext = $fo_ext[0];
208 $results = array();
209 include_once "./Services/Utilities/classes/class.ilFileUtils.php";
210 ilFileUtils::recursive_dirscan($a_target_dir."/objects", $results);
211 if (is_array($results["file"]))
212 {
213 foreach ($results["file"] as $key => $value)
214 {
215 $e = $fo_ext->addChild("fox:embedded-file","","http://xml.apache.org/fop/extensions");
216 $e->addAttribute("src",$results[path][$key].$value);
217 $e->addAttribute("name",$value);
218 $e->addAttribute("desc","");
219 }
220 }
221 $fo_string = $fo_xml->asXML();
222 $a_xml_writer->_XmlWriter;
223 return $fo_string;
224 }
recursive_dirscan($dir, &$arr)
Recursively scans a given directory and writes path and filename into referenced array.
exportPDFPrepareXmlNFiles($a_inst, $a_target_dir, &$expLog, &$a_xml_writer)
XML writer class.
xmlStartTag($tag, $attrs=NULL, $empty=FALSE, $encode=TRUE, $escape=TRUE)
Writes a starttag.
$results

References $ilCtrl, $lng, $results, $tpl, exportPDFPrepareXmlNFiles(), ilFileUtils\recursive_dirscan(), and ilXmlWriter\xmlStartTag().

+ Here is the call graph for this function:

◆ exportPDFPrepareXmlNFiles()

ilSCORM2004Asset::exportPDFPrepareXmlNFiles (   $a_inst,
  $a_target_dir,
$expLog,
$a_xml_writer 
)

Definition at line 226 of file class.ilSCORM2004Asset.php.

227 {
228
229 $this->exportHTML4PDF($a_inst, $a_target_dir, $expLog);
230 global $tpl, $lng, $ilCtrl;
231 $this->exportXMLPageObjects($a_target_dir, $a_xml_writer, $a_inst, $expLog);
232 $this->exportXMLMediaObjects($a_xml_writer, $a_inst, $a_target_dir, $expLog);
233 $this->exportFileItems($a_target_dir,$expLog);
234
235 include_once "./Modules/Scorm2004/classes/class.ilSCORM2004PageNode.php";
236 include_once "./Modules/Scorm2004/classes/class.ilSCORM2004Page.php";
237
238 $tree = new ilTree($this->slm_id);
239 $tree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
240 $tree->setTreeTablePK("slm_id");
241 foreach($tree->getSubTree($tree->getNodeData($this->getId()),true,'page') as $page)
242 {
243 $page_obj = new ilSCORM2004Page($page["obj_id"]);
244
245 include_once("./Services/COPage/classes/class.ilPCQuestion.php");
246 $q_ids = ilPCQuestion::_getQuestionIdsForPage("sahs", $page["obj_id"]);
247 if (count($q_ids) > 0)
248 {
249 include_once("./Modules/TestQuestionPool/classes/class.assQuestion.php");
250 foreach ($q_ids as $q_id)
251 {
252 $q_obj =& assQuestion::_instanciateQuestion($q_id);
253 $qti_file = fopen($a_target_dir."/qti_".$q_id.".xml", "w");
254 fwrite($qti_file, $q_obj->toXML());
255 fclose($qti_file);
256 $x = file_get_contents($a_target_dir."/qti_".$q_id.".xml");
257 $x = str_replace('<?xml version="1.0" encoding="utf-8"?>', '', $x);
258 $a_xml_writer->appendXML($x);
259 }
260 }
261 unset($page_obj);
262 }
263 }
static _instanciateQuestion($question_id)
Creates an instance of a question with a given question id.
exportXMLMediaObjects(&$a_xml_writer, $a_inst, $a_target_dir, &$expLog)
exportXMLPageObjects($a_target_dir, &$a_xml_writer, $a_inst, &$expLog)
exportHTML4PDF($a_inst, $a_target_dir, &$expLog)
Class ilSCORM2004Page.
$x
Definition: example_009.php:98

References $ilCtrl, $lng, $tpl, $x, ilPCQuestion\_getQuestionIdsForPage(), assQuestion\_instanciateQuestion(), exportFileItems(), exportHTML4PDF(), exportXMLMediaObjects(), and exportXMLPageObjects().

Referenced by exportPDF().

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

◆ exportScorm()

ilSCORM2004Asset::exportScorm (   $a_inst,
  $a_target_dir,
  $ver,
$expLog 
)

Definition at line 102 of file class.ilSCORM2004Asset.php.

103 {
104 copy('./xml/ilias_co_3_7.dtd',$a_target_dir.'/ilias_co_3_7.dtd');
105 copy('./Modules/Scorm2004/templates/xsl/sco.xsl',$a_target_dir.'/sco.xsl');
106
107 $a_xml_writer = new ilXmlWriter;
108 // MetaData
109 //file_put_contents($a_target_dir.'/indexMD.xml','<lom xmlns="http://ltsc.ieee.org/xsd/LOM"><general/><classification/></lom>');
110 $this->exportXMLMetaData($a_xml_writer);
111 $metadata_xml = $a_xml_writer->xmlDumpMem(false);
112 $a_xml_writer->_XmlWriter;
113 $xsl = file_get_contents("./Modules/Scorm2004/templates/xsl/metadata.xsl");
114 $args = array( '/_xml' => $metadata_xml , '/_xsl' => $xsl );
115 $xh = xslt_create();
116 $output = xslt_process($xh,"arg:/_xml","arg:/_xsl",NULL,$args,NULL);
117 xslt_free($xh);
118 file_put_contents($a_target_dir.'/indexMD.xml',$output);
119
120 $a_xml_writer = new ilXmlWriter;
121 // set dtd definition
122 $a_xml_writer->xmlSetDtdDef("<!DOCTYPE ContentObject SYSTEM \"http://www.ilias.de/download/dtd/ilias_co_3_7.dtd\">");
123
124 // set generated comment
125 $a_xml_writer->xmlSetGenCmt("Export of ILIAS Content Module ". $this->getId()." of installation ".$a_inst.".");
126
127 // set xml header
128 $a_xml_writer->xmlHeader();
129
130 global $ilBench;
131
132 $a_xml_writer->xmlStartTag("ContentObject", array("Type"=>"SCORM2004SCO"));
133
134 $this->exportXMLMetaData($a_xml_writer);
135
136 $this->exportXMLPageObjects($a_target_dir, $a_xml_writer, $a_inst, $expLog);
137
138 $this->exportXMLMediaObjects($a_xml_writer, $a_inst, $a_target_dir, $expLog);
139
140 $this->exportHTML($a_inst, $a_target_dir, $expLog);
141
142 //overwrite scorm.js for scrom 1.2
143 if ($ver=="12")
144 copy('./Modules/Scorm2004/scripts/scorm_12.js',$a_target_dir.'/js/scorm.js');
145
146 $a_xml_writer->xmlEndTag("ContentObject");
147
148 $a_xml_writer->xmlDumpFile($a_target_dir.'/index.xml', false);
149
150 $a_xml_writer->_XmlWriter;
151
152 // export sco data (currently only objective) to sco.xml
153 if ($this->getType() == "sco")
154 {
155 $objectives_text = "";
156 $a_xml_writer = new ilXmlWriter;
157
158 $tr_data = $this->getObjectives();
159 foreach ($tr_data as $data)
160 {
161 $objectives_text.= $data->getObjectiveID();
162 }
163 $a_xml_writer->xmlStartTag("sco");
164 $a_xml_writer->xmlElement("objective", null, $objectives_text);
165 $a_xml_writer->xmlEndTag("sco");
166 $a_xml_writer->xmlDumpFile($a_target_dir.'/sco.xml', false);
167 $a_xml_writer->_XmlWriter;
168 }
169 }
exportXMLMetaData(&$a_xml_writer)
exportHTML($a_inst, $a_target_dir, &$expLog, $a_asset_type="sco", $a_one_file="")
xmlSetDtdDef($dtdDef)
Sets dtd definition.
$data
xslt_free(&$proc)
xslt_create()

References $data, $ilBench, copy(), exportHTML(), exportXMLMediaObjects(), exportXMLMetaData(), exportXMLPageObjects(), ilSCORM2004Node\getId(), ilSCORM2004Node\getObjectives(), ilSCORM2004Node\getType(), ilXmlWriter\xmlSetDtdDef(), xslt_create(), and xslt_free().

+ Here is the call graph for this function:

◆ exportXMLMediaObjects()

ilSCORM2004Asset::exportXMLMediaObjects ( $a_xml_writer,
  $a_inst,
  $a_target_dir,
$expLog 
)

Definition at line 764 of file class.ilSCORM2004Asset.php.

765 {
766 include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
767 include_once("./Modules/File/classes/class.ilObjFile.php");
768 $linked_mobs = array();
769 if(is_array($this->mob_ids ))
770 {
771 // mobs directly embedded into pages
772 foreach ($this->mob_ids as $mob_id)
773 {
774 if ($mob_id > 0)
775 {
776 $expLog->write(date("[y-m-d H:i:s] ")."Media Object ".$mob_id);
777 $media_obj = new ilObjMediaObject($mob_id);
778 $media_obj->exportXML($a_xml_writer, $a_inst);
779 $lmobs = $media_obj->getLinkedMediaObjects($this->mob_ids);
780 $linked_mobs = array_merge($linked_mobs, $lmobs);
781 unset($media_obj);
782 }
783 }
784
785 // linked mobs (in map areas)
786 foreach ($linked_mobs as $mob_id)
787 {
788 if ($mob_id > 0)
789 {
790 $expLog->write(date("[y-m-d H:i:s] ")."Media Object ".$mob_id);
791 $media_obj = new ilObjMediaObject($mob_id);
792 $media_obj->exportXML($a_xml_writer, $a_inst);
793 unset($media_obj);
794 }
795 }
796 }
797 if(is_array($this->file_ids))
798 foreach ($this->file_ids as $file_id)
799 {
800 if (ilObject::_lookupType($file_id) == "file")
801 {
802 $expLog->write(date("[y-m-d H:i:s] ")."File Item ".$file_id);
803 $file_obj = new ilObjFile($file_id, false);
804 $file_obj->export($a_target_dir);
805 unset($file_obj);
806 }
807 }
808
809 }

References ilObject\_lookupType().

Referenced by exportPDFPrepareXmlNFiles(), and exportScorm().

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

◆ exportXMLMetaData()

ilSCORM2004Asset::exportXMLMetaData ( $a_xml_writer)

Definition at line 883 of file class.ilSCORM2004Asset.php.

884 {
885 include_once("Services/MetaData/classes/class.ilMD2XML.php");
886 $md2xml = new ilMD2XML($this->getSLMId(), $this->getId(), $this->getType());
887 $md2xml->setExportMode(true);
888 $md2xml->startExport();
889 $a_xml_writer->appendXML($md2xml->getXML());
890 }

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

Referenced by exportScorm().

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

◆ exportXMLPageObjects()

ilSCORM2004Asset::exportXMLPageObjects (   $a_target_dir,
$a_xml_writer,
  $a_inst,
$expLog 
)

Definition at line 707 of file class.ilSCORM2004Asset.php.

708 {
709 global $ilBench;
710
711 include_once "./Modules/Scorm2004/classes/class.ilSCORM2004PageNode.php";
712 include_once "./Modules/Scorm2004/classes/class.ilSCORM2004Page.php";
713
714 $tree = new ilTree($this->slm_id);
715 $tree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
716 $tree->setTreeTablePK("slm_id");
717
718 $pages = $tree->getSubTree($tree->getNodeData($this->getId()),true,'page');
719 foreach($pages as $page)
720 {
721 $expLog->write(date("[y-m-d H:i:s] ")."Page Object ".$page["obj_id"]);
722
723 // export xml to writer object
724 $page_obj = new ilSCORM2004Page($page["obj_id"]);
725 $page_obj->exportXML($a_xml_writer, "normal", $a_inst);
726
727 //collect media objects
728 $mob_ids = $page_obj->getMediaObjectIds();
729 foreach($mob_ids as $mob_id)
730 {
731 $this->mob_ids[$mob_id] = $mob_id;
732 }
733
734 // collect all file items
735 $file_ids = $page_obj->getFileItemIds();
736 foreach($file_ids as $file_id)
737 {
738 $this->file_ids[$file_id] = $file_id;
739 }
740
741 include_once("./Services/COPage/classes/class.ilPCQuestion.php");
742 $q_ids = ilPCQuestion::_getQuestionIdsForPage("sahs", $page["obj_id"]);
743 if (count($q_ids) > 0)
744 {
745 include_once("./Modules/TestQuestionPool/classes/class.assQuestion.php");
746 foreach ($q_ids as $q_id)
747 {
748 $q_obj = assQuestion::_instantiateQuestion($q_id);
749 // see #16557
750 if (is_object($q_obj))
751 {
752 $qti_file = fopen($a_target_dir."/qti_".$q_id.".xml", "w");
753 fwrite($qti_file, $q_obj->toXML());
754 fclose($qti_file);
755 }
756 }
757 }
758
759 unset($page_obj);
760
761 }
762 }
static _instantiateQuestion($question_id)

References $ilBench, ilPCQuestion\_getQuestionIdsForPage(), and assQuestion\_instantiateQuestion().

Referenced by exportPDFPrepareXmlNFiles(), and exportScorm().

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

◆ fixFullscreeenLink()

ilSCORM2004Asset::fixFullscreeenLink (   $matches)
private

Definition at line 688 of file class.ilSCORM2004Asset.php.

689 {
690 $media_obj = new ilObjMediaObject($matches[1]);
691 if($media_obj->hasFullscreenItem())
692 {
693 return "href=\"./objects/il_".IL_INST_ID."_mob_".$matches[1]."/fullscreen.html\"";
694 //return "href=\"./objects/il_".IL_INST_ID."_mob_".$matches[1]."/".$media_obj->getMediaItem("Fullscreen")->getLocation()."\"";
695 }
696 }

◆ getExportFiles()

ilSCORM2004Asset::getExportFiles ( )

Definition at line 892 of file class.ilSCORM2004Asset.php.

893 {
894 $file = array();
895
896 require_once("./Modules/Scorm2004/classes/class.ilSCORM2004Export.php");
897
898 $export = new ilSCORM2004Export($this);
899 foreach ($export->getSupportedExportTypes() as $type)
900 {
901 $dir = $export->getExportDirectoryForType($type);
902 // quit if import dir not available
903 if (!@is_dir($dir) or !is_writeable($dir))
904 {
905 continue;
906 }
907 // open directory
908 $cdir = dir($dir);
909
910 // get files and save the in the array
911 while ($entry = $cdir->read())
912 {
913 if ($entry != "." and
914 $entry != ".." and
915 (
916 ereg("^[0-9]{10}_{2}[0-9]+_{2}(".$this->getType()."_)".$this->getId()."+\.zip\$", $entry) or
917 ereg("^[0-9]{10}_{2}[0-9]+_{2}(".$this->getType()."_)".$this->getId()."+\.pdf\$", $entry) or
918 ereg("^[0-9]{10}_{2}[0-9]+_{2}(".$this->getType()."_)".$this->getId()."+\.iso\$", $entry)
919 ))
920 {
921 $file[$entry.$type] = array("type" => $type, "file" => $entry,
922 "size" => filesize($dir."/".$entry));
923 }
924 }
925
926 // close import directory
927 $cdir->close();
928 }
929
930 // sort files
931 ksort ($file);
932 reset ($file);
933 return $file;
934 }
print $file

References $file, ilSCORM2004Node\$type, ilSCORM2004Node\getId(), and ilSCORM2004Node\getType().

+ Here is the call graph for this function:

◆ getGlossaryTermIds()

ilSCORM2004Asset::getGlossaryTermIds ( )

Get glossary term ids in sco.

Parameters

return

Definition at line 942 of file class.ilSCORM2004Asset.php.

943 {
944 include_once("./Modules/Glossary/classes/class.ilGlossaryTerm.php");
945 $childs = $this->tree->getChilds($this->getId());
946 $ids = array();
947 foreach ($childs as $c)
948 {
949 $links = ilInternalLink::_getTargetsOfSource("sahs".":pg",
950 $c["child"]);
951 foreach ($links as $l)
952 {
953 if ($l["type"] == "git" && (int) $l["inst"] == 0 && !isset($ids[$l["id"]]))
954 {
955 $ids[$l["id"]] = ilGlossaryTerm::_lookGlossaryTerm($l["id"]);
956 }
957 }
958
959 }
960 asort($ids);
961 return $ids;
962 }
global $l
Definition: afr.php:30
static _lookGlossaryTerm($term_id)
get glossary term

References $l, ilInternalLink\_getTargetsOfSource(), ilGlossaryTerm\_lookGlossaryTerm(), and ilSCORM2004Node\getId().

Referenced by exportHTMLPageObjects().

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

◆ insertQuestion()

ilSCORM2004Asset::insertQuestion (   $matches)
private

Definition at line 699 of file class.ilSCORM2004Asset.php.

699 {
700 $q_exporter = new ilQuestionExporter();
701
702 $ret = $q_exporter->exportQuestion($matches[2], "./objects/", "offline");
703
704 return $ret;
705 }
Scorm 2004 Question Exporter.

References $ret.

◆ renderMetaPage()

static ilSCORM2004Asset::renderMetaPage (   $a_tpl,
  $a_sco,
  $a_asset_type = "",
  $mode = "" 
)
static

Render meta page (description/objectives at beginning)

Parameters
object$a_tpltemplate
object$a_scoSCO
string$a_asset_typeasset type
string$a_modemode

Definition at line 595 of file class.ilSCORM2004Asset.php.

596 {
597 global $lng;
598
599 if ($a_sco->getType() != "sco" || $a_sco->getHideObjectivePage())
600 {
601 return;
602 }
603
604 if ($a_asset_type != "entry_asset" && $a_asset_type != "final_asset")
605 {
606 $meta = new ilMD($a_sco->getSLMId(), $a_sco->getId(), $a_sco->getType());
607 $desc_ids = $meta->getGeneral()->getDescriptionIds();
608 $sco_description = $meta->getGeneral()->getDescription($desc_ids[0])->getDescription();
609 }
610
611 if ($mode != 'pdf')
612 {
613 // title
614 if ($a_asset_type != "entry_asset" && $a_asset_type != "final_asset")
615 {
616 $a_tpl->setCurrentBlock("title");
617 $a_tpl->setVariable("SCO_TITLE", $a_sco->getTitle());
618 $a_tpl->parseCurrentBlock();
619 }
620 }
621 else
622 {
623 // title
624 $a_tpl->setCurrentBlock("pdf_title");
625 $a_tpl->setVariable("SCO_TITLE", $a_sco->getTitle());
626 $a_tpl->parseCurrentBlock();
627 $a_tpl->touchBlock("pdf_break");
628 }
629
630 // sco description
631 if (trim($sco_description) != "")
632 {
633 $a_tpl->setCurrentBlock("sco_desc");
634 $a_tpl->setVariable("TXT_DESC", $lng->txt("description"));
635 include_once("./Services/COPage/classes/class.ilPCParagraph.php");
636 $a_tpl->setVariable("VAL_DESC", self::convertLists($sco_description));
637 $a_tpl->parseCurrentBlock();
638 }
639
640 if ($a_asset_type == "sco")
641 {
642 // sco objective(s)
643 $objs = $a_sco->getObjectives();
644 if (count($objs) > 0)
645 {
646 foreach ($objs as $objective)
647 {
648 $a_tpl->setCurrentBlock("sco_obj");
649 $a_tpl->setVariable("VAL_OBJECTIVE", self::convertLists($objective->getObjectiveID()));
650 $a_tpl->parseCurrentBlock();
651 }
652 $a_tpl->setCurrentBlock("sco_objs");
653 $a_tpl->setVariable("TXT_OBJECTIVES", $lng->txt("sahs_objectives"));
654 $a_tpl->parseCurrentBlock();
655 }
656 }
657 $a_tpl->setCurrentBlock("meta_page");
658 $a_tpl->parseCurrentBlock();
659 }

References $lng.

Referenced by exportHTMLPageObjects(), and ilSCORM2004ScoGUI\sco_preview().

+ Here is the caller graph for this function:

◆ renderNavigation()

static ilSCORM2004Asset::renderNavigation (   $a_tpl,
  $a_spacer_img = "",
  $a_lang = "" 
)
static

Render navigation.

Parameters
object$a_tpltemplate
string$a_spacer_imgpath to spacer image

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

563 {
564 global $lng;
565
566 if ($a_spacer_img == "")
567 {
568 $a_spacer_img = ilUtil::getImagePath("spacer.png");
569 }
570 if ($a_lang == "")
571 {
572 $a_lang = $lng->getLangKey();
573 }
574 // previous/next navigation
575 $a_tpl->setCurrentBlock("ilLMNavigation");
576 $a_tpl->setVariable("TXT_PREVIOUS", $lng->txtlng("content", 'scplayer_previous', $a_lang));
577 $a_tpl->setVariable("SRC_SPACER", $a_spacer_img);
578 $a_tpl->setVariable("TXT_NEXT", $lng->txtlng("content", 'scplayer_next', $a_lang));
579 $a_tpl->parseCurrentBlock();
580 $a_tpl->setCurrentBlock("ilLMNavigation2");
581 $a_tpl->setVariable("TXT_PREVIOUS", $lng->txtlng("content", 'scplayer_previous', $a_lang));
582 $a_tpl->setVariable("SRC_SPACER", $a_spacer_img);
583 $a_tpl->setVariable("TXT_NEXT", $lng->txtlng("content", 'scplayer_next', $a_lang));
584 $a_tpl->parseCurrentBlock();
585 }
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)

References $lng, and ilUtil\getImagePath().

Referenced by exportHTMLPageObjects(), and ilSCORM2004ScoGUI\sco_preview().

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

Field Documentation

◆ $q_media

ilSCORM2004Asset::$q_media = null

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


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