ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilQuestionPageParser.php
Go to the documentation of this file.
1 <?php
2 
20 
28 {
32  protected bool $in_properties;
36  protected bool $in_glossary_definition = false;
37  protected array $media_meta_cache = [];
38  protected bool $media_meta_start = false;
39  protected array $pg_mapping = [];
40  protected array $mobs_with_int_links = [];
41  protected bool $inside_code = false;
42  protected string $coType = "";
43  protected string $import_dir = "";
44  public ilTree $tree;
45  public array $cnt = []; // counts open elements
46  public array $current_element = []; // store current element type
47  public ?ilObjLearningModule $learning_module = null; // current learning module
48  public ?ilPageObject $page_object = null; // current page object
50  public array $structure_objects = []; // array of current structure objects
52  public ?object $current_object = null; // at the time a LearningModule, PageObject or StructureObject
53  public ?ilLMTree $lm_tree = null;
54  public array $pg_into_tree = [];
55  public array $st_into_tree = [];
56  public array $container = [];
57  public bool $in_page_object = false; // are we currently within a PageObject? true/false
58  public bool $in_meta_data = false; // are we currently within MetaData? true/false
59  public bool $in_media_object = false;
60  public bool $in_file_item = false;
61  public bool $in_glossary = false;
62  public bool $in_map_area = false;
63  public ?ilObject $content_object = null;
65  public ?ilObjFile $file_item = null;
66  public array $pages_to_parse = [];
67  public array $mob_mapping = [];
68  public array $file_item_mapping = [];
69  public string $subdir = "";
70  public ?ilMediaItem $media_item = null; // current media item
71  public string $loc_type = ""; // current location type
72  public ?ilMapArea $map_area = null; // current map area
73  public array $link_targets = []; // stores all objects by import id
74  public array $qst_mapping = [];
75  public bool $metadata_parsing_disabled = false;
76  public bool $in_meta_meta_data = false;
77  protected array $glossary_term_map = [];
78  protected ilLogger $log;
79  protected ?ilGlossaryTerm $glossary_term = null;
80  protected ?ilImportMapping $mapping = null;
81  protected string $cur_qid = "";
83  protected string $chr_data = "";
84  protected bool $in_media_item = false;
85 
86  public function __construct(
87  ilObject $a_content_object,
88  string $a_xml_file,
89  string $a_subdir,
90  string $a_import_dir = ""
91  ) {
92  global $DIC;
93 
94  $this->log = $DIC["ilLog"];
95  $lng = $DIC->language();
96  $tree = $DIC->repositoryTree();
97 
98  $this->log = ilLoggerFactory::getLogger('lm');
99 
100  $this->import_dir = ($a_import_dir != "")
101  ? $a_import_dir
102  : $a_content_object->getImportDirectory();
103 
104  parent::__construct($a_xml_file);
105  $this->cnt = array();
106  $this->current_element = array();
107  $this->structure_objects = array();
108  $this->content_object = $a_content_object;
109  $this->st_into_tree = array();
110  $this->pg_into_tree = array();
111  $this->pages_to_parse = array();
112  $this->mobs_with_int_links = array();
113  $this->mob_mapping = array();
114  $this->file_item_mapping = array();
115  $this->pg_mapping = array();
116  $this->link_targets = array();
117  $this->subdir = $a_subdir;
118  $this->lng = $lng;
119  $this->tree = $tree;
120  $this->inside_code = false;
121  $this->qst_mapping = array();
122  $this->coType = $this->content_object->getType();
123  $this->metadata_parsing_disabled = false;
124 
125  if (($this->coType != "tst") && ($this->coType != "qpl")) {
126  $this->lm_tree = new ilLMTree($this->content_object->getId());
127  }
128  }
129 
133  public function setHandlers($a_xml_parser): void
134  {
135  xml_set_object($a_xml_parser, $this);
136  xml_set_element_handler($a_xml_parser, 'handlerBeginTag', 'handlerEndTag');
137  xml_set_character_data_handler($a_xml_parser, 'handlerCharacterData');
138  }
139 
140  public function setImportMapping(ilImportMapping $mapping = null): void
141  {
142  $this->mapping = $mapping;
143  }
144 
145  public function startParsing(): void
146  {
147  $this->log->debug("start");
148 
149  //echo "<b>start parsing</b><br>";
150  parent::startParsing();
151  //echo "<b>storeTree</b><br>";
152  $this->storeTree();
153  //echo "<b>processPagesToParse</b><br>";
154  $this->processPagesToParse();
155  //echo "<b>copyMobFiles</b><br>";
156  $this->copyMobFiles();
157  //echo "<b>copyFileItems</b><br>";
158  $this->copyFileItems();
159  //echo "<br>END Parsing"; exit;
160  }
161 
165  public function storeTree(): void
166  {
167  $ilLog = $this->log;
168 
169  foreach ($this->st_into_tree as $st) {
170  $this->lm_tree->insertNode($st["id"], $st["parent"]);
171  if (is_array($this->pg_into_tree[$st["id"]])) {
172  foreach ($this->pg_into_tree[$st["id"]] as $pg) {
173  $pg_id = 0;
174  switch ($pg["type"]) {
175  case "pg_alias":
176  if ($this->pg_mapping[$pg["id"]] == "") {
177  $ilLog->write("LM Import: No PageObject for PageAlias " .
178  $pg["id"] . " found! (Please update export installation to ILIAS 3.3.0)");
179 
180  // Jump two levels up. First level is switch
181  continue 2;
182  }
183  $pg_id = $this->pg_mapping[$pg["id"]];
184  break;
185 
186  case "pg":
187  $pg_id = $pg["id"];
188  break;
189  }
190  if (!$this->lm_tree->isInTree($pg_id)) {
191  $this->lm_tree->insertNode($pg_id, $st["id"]);
192  }
193  }
194  }
195  }
196  }
197 
201  public function processPagesToParse(): void
202  {
203  // outgoin internal links
204  foreach ($this->pages_to_parse as $page_id) {
205  $page_arr = explode(":", $page_id);
206  $page_obj = null;
207  //echo "<br>resolve:".$this->content_object->getType().":".$page_id; flush();
208  switch ($page_arr[0]) {
209  case "lm":
210  switch ($this->content_object->getType()) {
211  case "lm":
212  $page_obj = new ilLMPage($page_arr[1]);
213  break;
214 
215  default:
216  die("Unknown content type " . $this->content_object->getType());
217  }
218 
219  break;
220 
221  case "gdf":
222  $page_obj = new ilGlossaryDefPage($page_arr[1]);
223  break;
224 
225  case "qpl":
226  $page_obj = new ilAssQuestionPage($page_arr[1]);
227  break;
228  }
229  $page_obj->buildDom();
230  $page_obj->resolveIntLinks();
231  $page_obj->resolveIIMMediaAliases($this->mob_mapping);
232  if ($this->coType == "lm") {
233  $page_obj->resolveQuestionReferences($this->qst_mapping);
234  }
235  $page_obj->update(false);
236 
237  if ($page_arr[0] == "gdf") {
238  $def = new ilGlossaryDefinition($page_arr[1]);
239  $def->updateShortText();
240  }
241 
242  unset($page_obj);
243  }
244 
245  //echo "<br><b>map area internal links</b>"; flush();
246  // outgoins map area (mob) internal links
247  foreach ($this->mobs_with_int_links as $mob_id) {
249  }
250 
251  //echo "<br><b>incoming interna links</b>"; flush();
252  // incoming internal links
253  $done = array();
254  foreach ($this->link_targets as $link_target) {
255  $parsed = $this->parseLinkTarget((string) $link_target);
256  if (!isset($parsed)) {
257  continue;
258  }
259  //echo "doin link target:".$link_target.":<br>";
261  $parsed['target_type'],
262  $parsed['target_id'],
263  $parsed['target_inst']
264  );
265 
266  foreach ($sources as $key => $source) {
267  //echo "got source:".$key.":<br>";
268  if (in_array($key, $done)) {
269  continue;
270  }
271  $type_arr = explode(":", $source["type"]);
272 
273  // content object pages
274  if ($type_arr[1] == "pg") {
275  if (ilPageObject::_exists($type_arr[0], $source["id"])) {
276  $page_object = ilPageObjectFactory::getInstance($type_arr[0], $source["id"]);
277  $page_object->buildDom();
278  $page_object->resolveIntLinks();
279  $page_object->update();
280  unset($page_object);
281  }
282  }
283 
284  // eventually correct links in questions to learning modules
285  if ($type_arr[0] == "qst") {
287  }
288  // eventually correct links in survey questions to learning modules
289  if ($type_arr[0] == "sqst") {
291  }
292  $done[$key] = $key;
293  }
294  }
295  }
296 
297 
301  public function copyMobFiles(): void
302  {
303  $imp_dir = $this->import_dir;
304  foreach ($this->mob_mapping as $origin_id => $mob_id) {
305  if (empty($origin_id)) {
306  continue;
307  }
308 
309  $obj_dir = $origin_id;
310  $source_dir = $imp_dir . "/" . $this->subdir . "/objects/" . $obj_dir;
311  $target_dir = ilFileUtils::getWebspaceDir() . "/mobs/mm_" . $mob_id;
312 
313  if (is_dir($source_dir)) {
314  ilFileUtils::makeDir($target_dir);
315 
316  if (is_dir($target_dir)) {
317  ilLoggerFactory::getLogger("mob")->debug("s:-$source_dir-,t:-$target_dir-");
318  ilFileUtils::rCopy(realpath($source_dir), realpath($target_dir));
319  }
320  }
321  }
322  }
323 
327  public function copyFileItems(): void
328  {
329  $imp_dir = $this->import_dir;
330  foreach ($this->file_item_mapping as $origin_id => $file_id) {
331  if (empty($origin_id)) {
332  continue;
333  }
334  $obj_dir = $origin_id;
335  $source_dir = $imp_dir . "/" . $this->subdir . "/objects/" . $obj_dir;
336 
337  $file_obj = new ilObjFile($file_id, false);
338  if (is_dir($source_dir)) {
339  $files = scandir($source_dir, SCANDIR_SORT_DESCENDING);
340  if ($files !== false && $files !== [] && is_file($source_dir . '/' . $files[0])) {
341  $file = fopen($source_dir . '/' . $files[0], 'rb');
342  $file_stream = Streams::ofResource($file);
343  $file_obj->appendStream($file_stream, $files[0]);
344  }
345  }
346  $file_obj->update();
347  }
348  }
349 
354  public function setQuestionMapping(array $a_map): void
355  {
356  $this->qst_mapping = $a_map;
357  }
358 
359  public function beginElement(string $a_name): void
360  {
361  if (!isset($this->status["$a_name"])) {
362  $this->cnt[$a_name] = 1;
363  } else {
364  $this->cnt[$a_name]++;
365  }
366  $this->current_element[count($this->current_element)] = $a_name;
367  }
368 
369  public function endElement(string $a_name): void
370  {
371  $this->cnt[$a_name]--;
372  unset($this->current_element[count($this->current_element) - 1]);
373  }
374 
375  public function getCurrentElement(): string
376  {
377  return ($this->current_element[count($this->current_element) - 1] ?? "");
378  }
379 
380  public function getOpenCount(string $a_name): int
381  {
382  if (isset($this->cnt[$a_name])) {
383  return $this->cnt[$a_name];
384  }
385  return 0;
386  }
387 
388  public function buildTag(
389  string $type,
390  string $name,
391  array $attr = []
392  ): string {
393  $tag = "<";
394 
395  if ($type == "end") {
396  $tag .= "/";
397  }
398 
399  $tag .= $name;
400 
401  if (is_array($attr)) {
402  foreach ($attr as $k => $v) {
403  $tag .= " " . $k . "=\"$v\"";
404  }
405  }
406 
407  $tag .= ">";
408 
409  return $tag;
410  }
411 
412  public function handlerBeginTag($a_xml_parser, string $a_name, array $a_attribs): void
413  {
414  switch ($a_name) {
415  case "ContentObject":
416  $this->current_object = $this->content_object;
417  if ($a_attribs["Type"] == "Glossary") {
418  $this->glossary_object = $this->content_object;
419  }
420  break;
421 
422  case "StructureObject":
424  $lm = $this->content_object;
425  $this->structure_objects[count($this->structure_objects)]
426  = new ilStructureObject($lm);
427  $this->current_object = $this->structure_objects[count($this->structure_objects) - 1];
428  $this->current_object->setLMId($this->content_object->getId());
429  // new meta data handling: we create the structure
430  // object already here, this should also create a
431  // md entry
432  $this->current_object->create(true);
433  break;
434 
435  case "PageObject":
436  $this->in_page_object = true;
437  $this->cur_qid = "";
438  if (($this->coType != "tst") && ($this->coType != "qpl")) {
440  $lm = $this->content_object;
441  $this->lm_page_object = new ilLMPageObject($lm);
442  $this->page_object = new ilLMPage();
443  $this->lm_page_object->setLMId($this->content_object->getId());
444  $this->lm_page_object->assignPageObject($this->page_object);
445  $this->current_object = $this->lm_page_object;
446  } else {
447  $this->page_object = new ilAssQuestionPage();
448  }
449  break;
450 
451  case "PageAlias":
452  throw new ilLMException("Page Alias not supported.");
453 
454  case "MediaObject":
455  case "InteractiveImage":
456  if ($a_name == "MediaObject") {
457  $this->in_media_object = true;
458  }
459  $this->media_meta_start = true;
460  $this->media_meta_cache = array();
461  $this->media_object = new ilObjMediaObject();
462  break;
463 
464  case "MediaAlias":
465  $this->media_object->setAlias(true);
466  $this->media_object->setImportId($a_attribs["OriginId"]);
467  if (is_object($this->page_object)) {
468  $this->page_object->needsImportParsing(true);
469  }
470  break;
471 
472  case "MediaItem":
473  case "MediaAliasItem":
474  $this->in_media_item = true;
475  $this->media_item = new ilMediaItem();
476  $this->media_item->setPurpose($a_attribs["Purpose"]);
477  break;
478 
479  case "Layout":
480  if (is_object($this->media_object) && $this->in_media_object) {
481  $this->media_item->setWidth($a_attribs["Width"] ?? '');
482  $this->media_item->setHeight($a_attribs["Height"] ?? '');
483  $this->media_item->setHAlign($a_attribs["HorizontalAlign"] ?? '');
484  }
485  break;
486 
487  case "Parameter":
488  if (is_object($this->media_object) && $this->in_media_object) {
489  $this->media_item->setParameter($a_attribs["Name"], $a_attribs["Value"]);
490  }
491  break;
492 
493  case "MapArea":
494  $this->in_map_area = true;
495  $this->map_area = new ilMapArea();
496  $this->map_area->setShape($a_attribs["Shape"]);
497  $this->map_area->setCoords($a_attribs["Coords"]);
498  $this->map_area->setHighlightMode($a_attribs["HighlightMode"]);
499  $this->map_area->setHighlightClass($a_attribs["HighlightClass"]);
500  break;
501 
502  case "Glossary":
503  $this->in_glossary = true;
504  if ($this->content_object->getType() != "glo") {
505  $this->glossary_object = new ilObjGlossary();
506  $this->glossary_object->setTitle("");
507  $this->glossary_object->setDescription("");
508  $this->glossary_object->create(true);
509  $this->glossary_object->createReference();
510  $parent = $this->tree->getParentNodeData($this->content_object->getRefId());
511  $this->glossary_object->putInTree($parent["child"]);
512  $this->glossary_object->setPermissions($parent["child"]);
513  }
514  $this->current_object = $this->glossary_object;
515  break;
516 
517  case "GlossaryItem":
518  $this->glossary_term = new ilGlossaryTerm();
519  $this->glossary_term->setGlossaryId($this->glossary_object->getId());
520  $this->glossary_term->setLanguage($a_attribs["Language"]);
521  $this->glossary_term->setImportId($a_attribs["Id"]);
522  $parsed = $this->parseLinkTarget((string) $a_attribs["Id"]);
523  if (isset($parsed)) {
524  $this->link_targets[$a_attribs["Id"]] = $a_attribs["Id"];
525  }
526  break;
527 
528  case "Definition":
529  $this->in_glossary_definition = true;
530  $this->glossary_definition = new ilGlossaryDefinition();
531  $this->page_object = new ilGlossaryDefPage();
532  $this->page_object->setParentId($this->glossary_term->getGlossaryId());
533  $this->glossary_definition->setTermId($this->glossary_term->getId());
534  $this->glossary_definition->assignPageObject($this->page_object);
535  $this->current_object = $this->glossary_definition;
536  $this->glossary_definition->create(true);
537  // see bug #12465, we need to clear xml after creation, since it will be <PageObject></PageObject>
538  // otherwise, and appendXML calls will lead to "<PageObject></PageObject><PageObject>....</PageObject>"
539  $this->page_object->setXMLContent("");
540  break;
541 
542  case "FileItem":
543  $this->in_file_item = true;
544  $this->file_item = new ilObjFile();
545  $this->file_item->setTitle("dummy");
546  $this->file_item->setMode("filelist");
547  if (is_object($this->page_object)) {
548  $this->page_object->needsImportParsing(true);
549  }
550  break;
551 
552  case "Paragraph":
553  if ($a_attribs["Characteristic"] == "Code") {
554  $this->inside_code = true;
555  }
556  break;
557 
558  case "Properties":
559  $this->in_properties = true;
560  break;
561 
562  case "Property":
563  if ($this->content_object->getType() == "lm") {
564  switch ($a_attribs["Name"]) {
565  case "Layout":
566  $this->content_object->setLayout($a_attribs["Value"]);
567  break;
568 
569  case "PageHeader":
570  $this->content_object->setPageHeader($a_attribs["Value"]);
571  break;
572 
573  case "TOCMode":
574  $this->content_object->setTOCMode($a_attribs["Value"]);
575  break;
576 
577  case "ActiveLMMenu":
578  $this->content_object->setActiveLMMenu(
579  ilUtil::yn2tf($a_attribs["Value"])
580  );
581  break;
582 
583  case "ActiveNumbering":
584  $this->content_object->setActiveNumbering(
585  ilUtil::yn2tf($a_attribs["Value"])
586  );
587  break;
588 
589  case "ActiveTOC":
590  $this->content_object->setActiveTOC(
591  ilUtil::yn2tf($a_attribs["Value"])
592  );
593  break;
594 
595  case "ActivePrintView":
596  $this->content_object->setActivePrintView(
597  ilUtil::yn2tf($a_attribs["Value"])
598  );
599  break;
600 
601  case "CleanFrames":
602  $this->content_object->setCleanFrames(
603  ilUtil::yn2tf($a_attribs["Value"])
604  );
605  break;
606 
607  case "PublicNotes":
608  $this->content_object->setPublicNotes(
609  ilUtil::yn2tf($a_attribs["Value"])
610  );
611  break;
612 
613  case "HistoryUserComments":
614  $this->content_object->setHistoryUserComments(
615  ilUtil::yn2tf($a_attribs["Value"])
616  );
617  break;
618 
619  case "Rating":
620  $this->content_object->setRating(
621  ilUtil::yn2tf($a_attribs["Value"])
622  );
623  break;
624 
625  case "RatingPages":
626  $this->content_object->setRatingPages(
627  ilUtil::yn2tf($a_attribs["Value"])
628  );
629  break;
630 
631  case "HeaderPage":
632  if ($a_attribs["Value"] != "") {
633  if ($this->pg_mapping[$a_attribs["Value"]] > 0) {
634  $this->content_object->setHeaderPage(
635  $this->pg_mapping[$a_attribs["Value"]]
636  );
637  }
638  }
639  break;
640 
641  case "FooterPage":
642  if ($a_attribs["Value"] != "") {
643  if ($this->pg_mapping[$a_attribs["Value"]] > 0) {
644  $this->content_object->setFooterPage(
645  $this->pg_mapping[$a_attribs["Value"]]
646  );
647  }
648  }
649  break;
650 
651  case "LayoutPerPage":
652  $this->content_object->setLayoutPerPage($a_attribs["Value"]);
653  break;
654 
655  case "ProgressIcons":
656  $this->content_object->setProgressIcons($a_attribs["Value"]);
657  break;
658 
659  case "StoreTries":
660  $this->content_object->setStoreTries($a_attribs["Value"]);
661  break;
662 
663  case "RestrictForwardNavigation":
664  $this->content_object->setRestrictForwardNavigation($a_attribs["Value"]);
665  break;
666 
667  case "DisableDefaultFeedback":
668  $this->content_object->setDisableDefaultFeedback($a_attribs["Value"]);
669  break;
670 
671  }
672  }
673  break;
674 
678  case "MetaData":
679  $this->in_meta_data = true;
680  // media obejct meta data handling
681  // is done in the "Identifier" begin tag processing
682  // the rest is done here
683  if (!$this->in_media_object) {
684  if (($this->coType != "tst") && ($this->coType != "qpl")) {
685  // type pg/st
686  if ($this->current_object->getType() == "st" ||
687  $this->current_object->getType() == "pg") {
688  // late creation of page object
689  if ($this->current_object->getType() == "pg") {
690  $this->lm_page_object->create(true);
691  }
692  $this->md = new ilMD(
693  $this->content_object->getId(),
694  $this->current_object->getId(),
695  $this->current_object->getType()
696  );
697  }
698  // type gdf
699  elseif ($this->current_object->getType() == "gdf") {
700  $this->md = new ilMD(
701  $this->glossary_object->getId(),
702  $this->current_object->getId(),
703  $this->current_object->getType()
704  );
705  }
706  // type lm, dbk, glo
707  else {
708  if ($this->processMeta()) {
709  $this->md = new ilMD(
710  $this->current_object->getId(),
711  0,
712  $this->current_object->getType()
713  );
714  }
715  }
716  } else {
717  // type qpl or tst
718  $this->md = new ilMD(
719  $this->content_object->getId(),
720  0,
721  $this->current_object->getType()
722  );
723  if ($this->md->getGeneral() != false) {
724  $this->metadata_parsing_disabled = true;
725  $this->enableMDParsing(false);
726  }
727  }
728  }
729  break;
730 
731  // Identifier
732  case "Identifier":
733 
734  // begin-patch optes_lok_export
735  if ($this->in_meta_data && $this->current_object instanceof ilStructureObject) {
736  if ($this->mapping instanceof ilImportMapping) {
737  $import_id_parsed = ilUtil::parseImportId($a_attribs['Entry']);
738  if ($import_id_parsed['type'] == 'st') {
739  $this->mapping->addMapping(
740  'Modules/LearningModule',
741  'lm_tree',
742  $import_id_parsed['id'],
743  $this->current_object->getId()
744  );
745  }
746  }
747  }
748  // end-patch optes_lok_export
749 
750  // please note: Meta-Metadata and MetaData are different tags!
751  if (!$this->in_meta_meta_data) {
752  if ($this->in_meta_data && !$this->in_glossary_definition) {
753  if (!$this->in_media_object) {
754  $this->current_object->setImportId($a_attribs["Entry"]);
755  }
756  // #40680 add a link target only if it is an internal ILIAS link
757  // Export from IMS UCAN sets something like 'IMSm-i1e79762'
758  $parsed = $this->parseLinkTarget($a_attribs["Entry"]);
759  if (isset($parsed)) {
760  $this->link_targets[$a_attribs["Entry"]] = $a_attribs["Entry"];
761  }
762  }
763  if ($this->in_file_item) {
764  if (!isset($this->file_item_mapping[$a_attribs["Entry"]])
765  || $this->file_item_mapping[$a_attribs["Entry"]] === "") {
766  $this->file_item->create();
767  $this->file_item->setImportId($a_attribs["Entry"]);
768  $this->file_item_mapping[$a_attribs["Entry"]] = $this->file_item->getId();
769  }
770  }
771  if ($this->in_meta_data && $this->in_media_object) {
772  //echo "looking for -".$a_attribs["Entry"]."-<br>";
773 
774  $mob_id = $this->mob_mapping[$a_attribs["Entry"]];
775 
776  // within learning module import, usually a media object
777  // has already been created with a media alias tag
778  if ($mob_id > 0) {
779  $this->media_object = new ilObjMediaObject($mob_id);
780  } else { // in glossaries the media objects precede the definitions
781  // so we don't have an object already
782  $this->media_object = new ilObjMediaObject();
783  $this->media_object->create(true, false);
784  $this->mob_mapping[$a_attribs["Entry"]]
785  = $this->media_object->getId();
786  }
787  $this->media_object->setImportId($a_attribs["Entry"]);
788  $this->md = new ilMD(
789  0,
790  $this->media_object->getId(),
791  "mob"
792  );
793  $this->emptyMediaMetaCache($a_xml_parser);
794  }
795  }
796  break;
797 
798  case "Meta-Metadata":
799  $this->in_meta_meta_data = true;
800  break;
801 
802  // Internal Link
803  case "IntLink":
804  if (is_object($this->page_object)) {
805  $this->page_object->setContainsIntLink(true);
806  }
807  if ($this->in_map_area) {
808  //echo "intlink:maparea:<br>";
809  $this->map_area->setLinkType(IL_INT_LINK);
810  $this->map_area->setTarget($a_attribs["Target"]);
811  $this->map_area->setType($a_attribs["Type"]);
812  $this->map_area->setTargetFrame($a_attribs["TargetFrame"]);
813  if (is_object($this->media_object)) {
814  //echo ":setContainsLink:<br>";
815  $this->media_object->setContainsIntLink(true);
816  }
817  }
818  break;
819 
820  // External Link
821  case "ExtLink":
822  if ($this->in_map_area) {
823  $this->map_area->setLinkType(IL_EXT_LINK);
824  $this->map_area->setHref($a_attribs["Href"]);
825  $this->map_area->setExtTitle($a_attribs["Title"]);
826  }
827  break;
828 
829  // Question
830  case "Question":
831  $this->cur_qid = $a_attribs["QRef"];
832  $this->page_object->setContainsQuestion(true);
833  break;
834 
835  case "Location":
836  $this->loc_type = $a_attribs["Type"];
837  break;
838 
839  }
840  $this->beginElement($a_name);
841 
842  // append content to page xml content
843  if (($this->in_page_object || $this->in_glossary_definition)
844  && !$this->in_meta_data && !$this->in_media_object) {
845  if ($a_name == "Definition") {
846  $app_name = "PageObject";
847  $app_attribs = array();
848  } else {
849  $app_name = $a_name;
850  $app_attribs = $a_attribs;
851  }
852 
853  // change identifier entry of file items to new local file id
854  if ($this->in_file_item && $app_name == "Identifier") {
855  $app_attribs["Entry"] = "il__file_" . $this->file_item_mapping[$a_attribs["Entry"]];
856  //$app_attribs["Entry"] = "il__file_".$this->file_item->getId();
857  }
858 
859  $this->page_object->appendXMLContent($this->buildTag("start", $app_name, $app_attribs));
860  //echo "&nbsp;&nbsp;after append, xml:".$this->page_object->getXMLContent().":<br>";
861  }
862 
863 
864  // call meta data handler
865  if ($this->in_meta_data && $this->processMeta()) {
866  // cache beginning of meta data within media object tags
867  // (we need to know the id at the begin of meta elements within
868  // media objects, after the "Identifier" tag has been processed
869  // we send the cached data to the meta xml handler)
870  if ($this->in_media_object && $this->media_meta_start) {
871  $this->media_meta_cache[] =
872  array("type" => "handlerBeginTag", "par1" => $a_name, "par2" => $a_attribs);
873  } else {
874  if ($a_name == "Identifier") {
875  if (!$this->in_media_object) {
876  $a_attribs["Entry"] = "il__" . $this->current_object->getType() .
877  "_" . $this->current_object->getId();
878  } else {
879  $a_attribs["Entry"] = "il__mob" .
880  "_" . $this->media_object->getId();
881  }
882  $a_attribs["Catalog"] = "ILIAS";
883  }
884 
885  parent::handlerBeginTag($a_xml_parser, $a_name, $a_attribs);
886  }
887  }
888  }
889 
890  public function processMeta(): bool
891  {
892  // do not process second meta block in (ilias3) glossaries
893  // which comes right after the "Glossary" tag
894  if ($this->content_object->getType() == "glo" &&
895  $this->in_glossary && !$this->in_media_object
897  return false;
898  }
899 
900  return true;
901  }
902 
903 
904  public function handlerEndTag($a_xml_parser, string $a_name): void
905  {
906  // call meta data handler
907  if ($this->in_meta_data && $this->processMeta()) {
908  // cache beginning of meta data within media object tags
909  // (we need to know the id, after that we send the cached data
910  // to the meta xml handler)
911  if ($this->in_media_object && $this->media_meta_start) {
912  $this->media_meta_cache[] =
913  array("type" => "handlerEndTag", "par1" => $a_name);
914  } else {
915  parent::handlerEndTag($a_xml_parser, $a_name);
916  }
917  }
918 
919  // append content to page xml content
920  if (($this->in_page_object || $this->in_glossary_definition)
921  && !$this->in_meta_data && !$this->in_media_object) {
922  $app_name = ($a_name == "Definition")
923  ? "PageObject"
924  : $a_name;
925  $this->page_object->appendXMLContent($this->buildTag("end", $app_name));
926  }
927 
928  switch ($a_name) {
929  case "StructureObject":
930  unset($this->structure_objects[count($this->structure_objects) - 1]);
931  break;
932 
933  case "PageObject":
934 
935  $this->in_page_object = false;
936  if (($this->coType != "tst") && ($this->coType != "qpl")) {
937  //if (!$this->lm_page_object->isAlias()) {
938  $this->page_object->updateFromXML();
939  $this->pg_mapping[$this->lm_page_object->getImportId()]
940  = $this->lm_page_object->getId();
941 
942  if ($this->mapping instanceof ilImportMapping) {
943  $import_id_parsed = ilUtil::parseImportId($this->lm_page_object->getImportId());
944  if ($import_id_parsed['type'] == 'pg') {
945  $this->mapping->addMapping(
946  'Modules/LearningModule',
947  'pg',
948  $import_id_parsed['id'],
949  $this->lm_page_object->getId()
950  );
951  }
952  }
953 
954  // collect pages with internal links
955  if ($this->page_object->containsIntLink()) {
956  $this->pages_to_parse["lm:" . $this->page_object->getId()] = "lm:" . $this->page_object->getId();
957  }
958 
959  // collect pages with mobs or files
960  if ($this->page_object->needsImportParsing()) {
961  $this->pages_to_parse["lm:" . $this->page_object->getId()] = "lm:" . $this->page_object->getId();
962  }
963 
964  // collect pages with questions
965  if ($this->page_object->getContainsQuestion()) {
966  $this->pages_to_parse["lm:" . $this->page_object->getId()] = "lm:" . $this->page_object->getId();
967  }
968  //}
969  } else {
970  $xml = $this->page_object->getXMLContent();
971  if ($this->cur_qid != "") {
972  $ids = $this->qst_mapping[$this->cur_qid] ?? ['pool' => 0, 'test' => 0];
973  if ($ids["pool"] > 0) {
974  // question pool question
975  $page = new ilAssQuestionPage($ids["pool"]);
976  $xmlcontent = str_replace(
977  $this->cur_qid,
978  "il__qst_" . $ids["pool"],
979  $xml
980  );
981  $page->setXMLContent($xmlcontent);
982  $page->updateFromXML();
983  if ($this->page_object->needsImportParsing()) {
984  $this->pages_to_parse["qpl:" . $page->getId()] = "qpl:" . $page->getId();
985  }
986  unset($page);
987  }
988  if ($ids["test"] > 0) {
989  // test question
990  $page = new ilAssQuestionPage($ids["test"]);
991  $xmlcontent = str_replace(
992  $this->cur_qid,
993  "il__qst_" . $ids["test"],
994  $xml
995  );
996  $page->setXMLContent($xmlcontent);
997  $page->updateFromXML();
998  if ($this->page_object->needsImportParsing()) {
999  $this->pages_to_parse["qpl:" . $page->getId()] = "qpl:" . $page->getId();
1000  }
1001  unset($page);
1002  }
1003  }
1004  }
1005 
1006  // if we are within a structure object: put page in tree
1007  $cnt = count($this->structure_objects);
1008  if ($cnt > 0) {
1009  $parent_id = $this->structure_objects[$cnt - 1]->getId();
1010  //if ($this->lm_page_object->isAlias()) {
1011  // $this->pg_into_tree[$parent_id][] = array("type" => "pg_alias", "id" => $this->lm_page_object->getOriginId());
1012  //} else {
1013  $this->pg_into_tree[$parent_id][] = array("type" => "pg", "id" => $this->lm_page_object->getId());
1014  //}
1015  }
1016 
1017  unset($this->page_object);
1018  unset($this->lm_page_object);
1019  unset($this->container[count($this->container) - 1]);
1020  break;
1021 
1022  case "MediaObject":
1023  case "InteractiveImage":
1024  if ($a_name == "MediaObject") {
1025  $this->in_media_object = false;
1026  }
1027 
1028  if (empty($this->mob_mapping[$this->media_object->getImportId()])) {
1029  // create media object
1030  // media items are saves for mobs outside of
1031  // pages only
1032  $this->media_object->create(true, false);
1033 
1034  // collect mobs with internal links
1035  if ($this->media_object->containsIntLink()) {
1036  //echo "got int link :".$this->media_object->getId().":<br>";
1037  $this->mobs_with_int_links[] = $this->media_object->getId();
1038  }
1039 
1040  $this->mob_mapping[$this->media_object->getImportId()]
1041  = $this->media_object->getId();
1042  } else {
1043  // get the id from mapping
1044  $this->media_object->setId($this->mob_mapping[$this->media_object->getImportId()]);
1045 
1046  // update "real" (no alias) media object
1047  // (note: we overwrite any data from the media object
1048  // created by an MediaAlias, only the data of the real
1049  // object is stored in db separately; data of the
1050  // MediaAliases are within the page XML
1051  if (!$this->media_object->isAlias()) {
1052  // now the media items are saved within the db
1053  $this->media_object->update();
1054 
1055  //echo "<br>update media object :".$this->media_object->getId().":";
1056 
1057  // collect mobs with internal links
1058  if ($this->media_object->containsIntLink()) {
1059  //echo "got int link :".$this->media_object->getId().":<br>";
1060  $this->mobs_with_int_links[] = $this->media_object->getId();
1061  }
1062  }
1063  }
1064 
1065  // append media alias to page, if we are in a page
1066  if ($this->in_page_object || $this->in_glossary_definition) {
1067  if ($a_name != "InteractiveImage") {
1068  $this->page_object->appendXMLContent($this->media_object->getXML(IL_MODE_ALIAS));
1069  //echo "Appending:".htmlentities($this->media_object->getXML(IL_MODE_ALIAS))."<br>";
1070  }
1071  }
1072 
1073  break;
1074 
1075  case "MediaItem":
1076  case "MediaAliasItem":
1077  $this->in_media_item = false;
1078  $this->media_object->addMediaItem($this->media_item);
1079  break;
1080 
1081  case "MapArea":
1082  $this->in_map_area = false;
1083  $this->media_item->addMapArea($this->map_area);
1084  break;
1085 
1086  case "Properties":
1087  $this->in_properties = false;
1088  if ($this->content_object->getType() == "lm") {
1089  $this->content_object->update();
1090  }
1091  break;
1092 
1093  case "MetaData":
1094  $this->in_meta_data = false;
1095  if (strtolower(get_class($this->current_object)) == "illmpageobject" && !$this->in_media_object) {
1096  // Metadaten eines PageObjects sichern in NestedSet
1097  if (is_object($this->lm_page_object)) {
1098  // update title/description of page object
1099  $this->current_object->MDUpdateListener('General');
1101  $this->current_object->getId(),
1102  $this->current_object->getImportId()
1103  );
1104  }
1105  } elseif ((strtolower(get_class($this->current_object)) == "ilobjquestionpool" ||
1106  strtolower(get_class($this->current_object)) == "ilobjtest") &&
1107  !$this->in_media_object) {
1108  // !$this->in_media_object && !$this->in_page_object)
1109  // changed for imports of ILIAS 2 Tests where PageObjects could have
1110  // Metadata sections (Helmut Schottmüller, 2005-12-02)
1111  if ($this->metadata_parsing_disabled) {
1112  $this->enableMDParsing(true);
1113  } else {
1114  if ($this->in_page_object && !is_null($this->page_object)) {
1115  /*
1116  $this->page_object->MDUpdateListener('General');
1117  ilLMObject::_writeImportId(
1118  $this->page_object->getId(),
1119  $this->page_object->getImportId()
1120  );*/
1121  } else {
1122  $this->current_object->MDUpdateListener('General');
1124  $this->current_object->getId(),
1125  $this->current_object->getImportId()
1126  );
1127  }
1128  }
1129  } elseif (strtolower(get_class($this->current_object)) == "ilstructureobject") { // save structure object at the end of its meta block
1130  // determine parent
1131  $cnt = count($this->structure_objects);
1132  if ($cnt > 1) {
1133  $parent_id = $this->structure_objects[$cnt - 2]->getId();
1134  } else {
1135  $parent_id = $this->lm_tree->getRootId();
1136  }
1137 
1138  $this->st_into_tree[] = array("id" => $this->current_object->getId(),
1139  "parent" => $parent_id);
1140 
1141  // update title/description of structure object
1142  $this->current_object->MDUpdateListener('General');
1144  $this->current_object->getId(),
1145  $this->current_object->getImportId()
1146  );
1147  } elseif (strtolower(get_class($this->current_object)) == "ilobjlearningmodule" ||
1148  strtolower(get_class($this->current_object)) == "ilobjcontentobject" ||
1149  (strtolower(get_class($this->current_object)) == "ilobjglossary" && $this->in_glossary)) {
1150  // todo: saving of md? getting title/descr and
1151  // set it for current object
1152  } elseif (strtolower(get_class($this->current_object)) == "ilglossarydefinition" && !$this->in_media_object) {
1153  // now on top
1154  //$this->glossary_definition->create();
1155 
1156  $this->page_object->setId($this->glossary_definition->getId());
1157  $this->page_object->updateFromXML();
1158 
1159  // todo: saving of md? getting title/descr and
1160  // set it for current object
1161  }
1162 
1163 
1164  if (strtolower(get_class($this->current_object)) == "ilobjlearningmodule" ||
1165  strtolower(get_class($this->current_object)) == "ilobjglossary") {
1166  if (strtolower(get_class($this->current_object)) == "ilobjglossary" &&
1167  $this->content_object->getType() != "glo") {
1168  //echo "<br><b>getting2: ".$this->content_object->getTitle()."</b>";
1169  $this->current_object->setTitle($this->content_object->getTitle() . " - " .
1170  $this->lng->txt("glossary"));
1171  }
1172 
1173  $this->current_object->MDUpdateListener('General');
1174  /*
1175  if (!$this->in_media_object && $this->processMeta())
1176  {
1177  $this->current_object->update();
1178  }
1179  */
1180  }
1181 
1182  if ($this->in_media_object) {
1183  //echo "<br>call media object update listener";
1184  $this->media_object->MDUpdateListener('General');
1185  }
1186 
1187  if ($this->in_glossary_definition) {
1188  $this->glossary_definition->MDUpdateListener('General');
1189  }
1190 
1191  break;
1192 
1193  case "Meta-Metadata":
1194  $this->in_meta_meta_data = false;
1195  break;
1196 
1197  case "FileItem":
1198  $this->in_file_item = false;
1199  // only update new file items
1200  if ($this->file_item->getImportId()) {
1201  $this->file_item->update();
1202  }
1203  break;
1204 
1205 
1206  case "Table":
1207  unset($this->container[count($this->container) - 1]);
1208  break;
1209 
1210  case "Glossary":
1211  $this->in_glossary = false;
1212  break;
1213 
1214  case "GlossaryTerm":
1215  $term = trim($this->chr_data);
1216  $term = str_replace("&lt;", "<", $term);
1217  $term = str_replace("&gt;", ">", $term);
1218  $this->glossary_term->setTerm($term);
1219  $this->glossary_term->create();
1220  $iia = explode("_", $this->glossary_term->getImportId());
1221  $this->glossary_term_map[(int) $iia[count($iia) - 1]] = $this->glossary_term->getId();
1222  break;
1223 
1224  case "Paragraph":
1225  $this->inside_code = false;
1226  break;
1227 
1228  case "Definition":
1229  $this->in_glossary_definition = false;
1230  $this->page_object->updateFromXML();
1231  $this->page_object->buildDom();
1232  $this->glossary_definition->setShortText($this->page_object->getFirstParagraphText());
1233  $this->glossary_definition->update();
1234  if ($this->page_object->containsIntLink()) {
1235  $this->pages_to_parse["gdf:" . $this->page_object->getId()] = "gdf:" . $this->page_object->getId();
1236  }
1237  if ($this->page_object->needsImportParsing()) {
1238  $this->pages_to_parse["gdf:" . $this->page_object->getId()] = "gdf:" . $this->page_object->getId();
1239  }
1240  break;
1241 
1242  case "Format":
1243  if ($this->in_media_item) {
1244  $this->media_item->setFormat(trim($this->chr_data));
1245  }
1246  break;
1247 
1248  case "Title":
1249  if ($this->in_meta_data && !$this->in_media_object) {
1250  $this->current_object->setTitle(trim($this->chr_data));
1251  }
1252  if ($this->in_media_object) {
1253  $this->media_object->setTitle(trim($this->chr_data));
1254  }
1255  break;
1256 
1257  case "Description":
1258  case "Language":
1259  break;
1260 
1261  case "Caption":
1262  if ($this->in_media_object) {
1263  $this->media_item->setCaption(trim($this->chr_data));
1264  }
1265  break;
1266 
1267  case "TextRepresentation":
1268  if ($this->in_media_object) {
1269  $this->media_item->setTextRepresentation(trim($this->chr_data));
1270  }
1271  break;
1272 
1273  // Location
1274  case "Location":
1275  // TODO: adapt for files in "real" subdirectories
1276  if ($this->in_media_item) {
1277  $this->media_item->setLocationType($this->loc_type);
1278  if ($this->loc_type == "Reference") {
1279  $this->media_item->setLocation(str_replace("&", "&amp;", trim($this->chr_data)));
1280  } else {
1281  $this->media_item->setLocation(trim($this->chr_data));
1282  }
1283  }
1284  if ($this->in_file_item) {
1285  // set file name from xml file
1286  $this->file_item->setFileName(trim($this->chr_data));
1287 
1288  // special handling for file names with special characters
1289  // (e.g. "&gt;")
1290  if ($this->file_item->getType() == "file" &&
1291  is_int(strpos($this->chr_data, "&")) &&
1292  is_int(strpos($this->chr_data, ";"))) {
1293  $imp_dir = $this->import_dir;
1294  $source_dir = $imp_dir . "/" . $this->subdir . "/objects/" .
1295  $this->file_item->getImportId();
1296 
1297  // read "physical" file name from directory
1298  if ($dir = opendir($source_dir)) {
1299  while (false !== ($file = readdir($dir))) {
1300  if ($file != "." && $file != "..") {
1301  $this->file_item->setFileName($file);
1302  }
1303  }
1304  closedir($dir);
1305  }
1306  }
1307 
1308  // set file item title
1309  $this->file_item->setTitle(trim($this->chr_data));
1310  }
1311  break;
1312 
1313  }
1314  $this->endElement($a_name);
1315  $this->chr_data = "";
1316  }
1317 
1318  public function handlerCharacterData($a_xml_parser, string $a_data): void
1319  {
1320  // call meta data handler
1321  if ($this->in_meta_data && $this->processMeta()) {
1322  // cache beginning of meta data within media object tags
1323  // (we need to know the id, after that we send the cached data
1324  // to the meta xml handler)
1325  if ($this->in_media_object && $this->media_meta_start) {
1326  $this->media_meta_cache[] =
1327  array("type" => "handlerCharacterData", "par1" => $a_data);
1328  } else {
1329  parent::handlerCharacterData($a_xml_parser, $a_data);
1330  }
1331  }
1332 
1333  // the parser converts "&gt;" to ">" and "&lt;" to "<"
1334  // in character data, but we don't want that, because it's the
1335  // way we mask user html in our content, so we convert back...
1336 
1337  $a_data = str_replace("<", "&lt;", $a_data);
1338  $a_data = str_replace(">", "&gt;", $a_data);
1339 
1340 
1341  // DELETE WHITESPACES AND NEWLINES OF CHARACTER DATA
1342  $a_data = preg_replace("/\n/", "", $a_data);
1343  if (!$this->inside_code) {
1344  $a_data = preg_replace("/\t+/", "", $a_data);
1345  }
1346 
1347  $this->chr_data .= $a_data;
1348 
1349  if (!empty($a_data) || $a_data === "0") {
1350  // append all data to page, if we are within PageObject,
1351  // but not within MetaData or MediaObject
1352  if (($this->in_page_object || $this->in_glossary_definition)
1353  && !$this->in_meta_data && !$this->in_media_object) {
1354  $this->page_object->appendXMLContent($a_data);
1355  }
1356 
1357  switch ($this->getCurrentElement()) {
1358 
1359  case "IntLink":
1360  case "ExtLink":
1361  if ($this->in_map_area) {
1362  $this->map_area->appendTitle($a_data);
1363  }
1364  break;
1365 
1366  }
1367  }
1368  }
1369 
1373  public function emptyMediaMetaCache($a_xml_parser): void
1374  {
1375  foreach ($this->media_meta_cache as $cache_entry) {
1376  switch ($cache_entry["type"]) {
1377  case "handlerBeginTag":
1378  parent::handlerBeginTag(
1379  $a_xml_parser,
1380  $cache_entry["par1"],
1381  $cache_entry["par2"]
1382  );
1383  break;
1384 
1385  case "handlerEndTag":
1386  parent::handlerEndTag(
1387  $a_xml_parser,
1388  $cache_entry["par1"]
1389  );
1390  break;
1391 
1392  case "handlerCharacterData":
1393  parent::handlerCharacterData(
1394  $a_xml_parser,
1395  $cache_entry["par1"]
1396  );
1397  break;
1398  }
1399  }
1400 
1401  $this->media_meta_start = false;
1402  $this->media_meta_cache[] = array();
1403  }
1404 
1408  public function getGlossaryTermMap(): array
1409  {
1410  return $this->glossary_term_map;
1411  }
1412 
1418  private function parseLinkTarget(string $identifier): ?array
1419  {
1420  $link_arr = explode('_', $identifier);
1421 
1422  if (count($link_arr) !== 4
1423  || $link_arr[0] !== 'il'
1424  || !is_numeric($link_arr[1])
1425  || !is_numeric($link_arr[3])
1426  ) {
1427  return null;
1428  }
1429 
1430  return [
1431  'target_inst' => (int) $link_arr[1],
1432  'target_type' => (string) $link_arr[2],
1433  'target_id' => (int) $link_arr[3]
1434  ];
1435  }
1436 }
static getWebspaceDir(string $mode="filesystem")
get webspace directory
processPagesToParse()
parse pages that contain files, mobs and/or internal links
enableMDParsing(bool $a_status)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
buildDom(bool $a_force=false)
static getLogger(string $a_component_id)
Get component logger.
buildTag(string $type, string $name, array $attr=[])
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
handlerEndTag($a_xml_parser, string $a_name)
$type
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
handlerBeginTag($a_xml_parser, string $a_name, array $a_attribs)
resolveIntLinks(array $a_link_map=null)
Resolves all internal link targets of the page, if targets are available (after import) ...
update(bool $a_validate=true, bool $a_no_history=false)
update complete page content in db (dom xml content is used)
create(bool $a_upload=false, bool $a_omit_page_creation=false)
write(string $a_message, $a_level=ilLogLevel::INFO)
write log message
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static rCopy(string $a_sdir, string $a_tdir, bool $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
setImportMapping(ilImportMapping $mapping=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
copyMobFiles()
copy multimedia object files from import zip file to mob directory
ilLanguage $lng
parseLinkTarget(string $identifier)
Parse a string the get the elements of a link target Return null if the string is not a link target...
global $DIC
Definition: feed.php:28
if($format !==null) $name
Definition: metadata.php:247
setQuestionMapping(array $a_map)
set question import ident to pool/test question id mapping
ilGlossaryDefinition $glossary_definition
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(ilObject $a_content_object, string $a_xml_file, string $a_subdir, string $a_import_dir="")
const IL_INT_LINK
_resolveIntLinks(int $question_id)
handlerCharacterData($a_xml_parser, string $a_data)
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists.
Class ilPageObject Handles PageObjects of ILIAS Learning Modules (see ILIAS DTD)
Class ilObjFile.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
string $key
Consumer key/client ID value.
Definition: System.php:193
Legacy Content Object Parser.
static _resolveIntLinks(int $question_id)
$xml
Definition: metadata.php:351
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static parseImportId(string $a_import_id)
Parse an ilias import id Typically of type il_[IL_INST_ID]_[OBJ_TYPE]_[OBJ_ID] returns array( &#39;orig&#39; ...
const IL_MODE_ALIAS
static _writeImportId(int $a_id, string $a_import_id)
static _resolveMapAreaLinks(int $a_mob_id)
resolve internal links of all media items of a media object
ilObjLearningModule $learning_module
copyFileItems()
copy files of file items
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const IL_EXT_LINK
Class ilMapArea.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
static yn2tf(string $a_yn)
$source
Definition: metadata.php:93
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getInstance(string $a_parent_type, int $a_id=0, int $a_old_nr=0, string $a_lang="-")
Get page object instance.
static makeDir(string $a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
storeTree()
insert StructureObjects and PageObjects into tree