ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilContObjParser.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 require_once("./Modules/LearningModule/classes/class.ilLMPageObject.php");
5 require_once("./Services/COPage/classes/class.ilPageObject.php");
6 require_once("./Modules/LearningModule/classes/class.ilStructureObject.php");
7 require_once("./Modules/LearningModule/classes/class.ilObjLearningModule.php");
8 require_once("Services/MetaData/classes/class.ilMDLanguageItem.php");
9 require_once("./Services/COPage/classes/class.ilPCParagraph.php");
10 require_once("./Services/COPage/classes/class.ilPCTable.php");
11 require_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
12 require_once("./Services/MediaObjects/classes/class.ilMediaItem.php");
13 require_once("./Services/MediaObjects/classes/class.ilMapArea.php");
14 require_once("./Modules/LearningModule/classes/class.ilBibItem.php");
15 require_once("./Modules/Glossary/classes/class.ilObjGlossary.php");
16 require_once("./Modules/Glossary/classes/class.ilGlossaryTerm.php");
17 require_once("./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
18 require_once("./Services/COPage/classes/class.ilInternalLink.php");
19 require_once("./Modules/File/classes/class.ilObjFile.php");
20 
21 include_once("Services/MetaData/classes/class.ilMDSaxParser.php");
22 include_once("Services/MetaData/classes/class.ilMD.php");
23 
33 {
34  var $lng;
35  var $tree;
36  var $cnt; // counts open elements
37  var $current_element; // store current element type
38  var $learning_module; // current learning module
39  var $page_object; // current page object
41  var $structure_objects; // array of current structure objects
43  var $current_object; // at the time a LearningModule, PageObject or StructureObject
44  var $meta_data; // current meta data object
46  var $table;
47  var $lm_tree;
51  var $in_page_object; // are we currently within a PageObject? true/false
52  var $in_meta_data; // are we currently within MetaData? true/false
64  var $subdir;
65  var $media_item; // current media item
66  var $loc_type; // current location type
67  var $bib_item; // current bib item object
68  var $map_area; // current map area
69  var $in_bib_item; // are we currently within BibItem? true/false
70  var $link_targets; // stores all objects by import id
73  var $in_meta_meta_data = false;
74  protected $glossary_term_map = array();
75 
85  function ilContObjParser(&$a_content_object, $a_xml_file, $a_subdir)
86  {
87  global $lng, $tree;
88 
89  parent::ilMDSaxParser($a_xml_file);
90  $this->cnt = array();
91  $this->current_element = array();
92  $this->structure_objects = array();
93  $this->content_object =& $a_content_object;
94  //$this->lm_id = $a_lm_id;
95  $this->st_into_tree = array();
96  $this->pg_into_tree = array();
97  $this->pages_to_parse = array();
98  $this->mobs_with_int_links = array();
99  $this->mob_mapping = array();
100  $this->file_item_mapping = array();
101  $this->pg_mapping = array();
102  $this->link_targets = array();
103  $this->subdir = $a_subdir;
104  $this->lng =& $lng;
105  $this->tree =& $tree;
106  $this->inside_code = false;
107  $this->qst_mapping = array();
108  $this->coType = $this->content_object->getType();
109  $this->metadata_parsing_disabled = false;
110 
111  if (($this->coType != "tst") and ($this->coType != "qpl"))
112  {
113  $this->lm_tree = new ilTree($this->content_object->getId());
114  $this->lm_tree->setTreeTablePK("lm_id");
115  $this->lm_tree->setTableNames('lm_tree','lm_data');
116  }
117  //$this->lm_tree->addTree($a_lm_id, 1); happens in ilObjLearningModuleGUI
118 
119  }
120 
127  function setHandlers($a_xml_parser)
128  {
129  xml_set_object($a_xml_parser,$this);
130  xml_set_element_handler($a_xml_parser,'handlerBeginTag','handlerEndTag');
131  xml_set_character_data_handler($a_xml_parser,'handlerCharacterData');
132  }
133 
134 
138  function startParsing()
139  {
140 //echo "<b>start parsing</b><br>";
142 //echo "<b>storeTree</b><br>";
143  $this->storeTree();
144 //echo "<b>processPagesToParse</b><br>";
145  $this->processPagesToParse();
146 //echo "<b>copyMobFiles</b><br>";
147  $this->copyMobFiles();
148 //echo "<b>copyFileItems</b><br>";
149  $this->copyFileItems();
150  }
151 
152 
156  function storeTree()
157  {
158  global $ilLog;
159 
160 //echo "<b>Storing the tree</b><br>";
161  foreach($this->st_into_tree as $st)
162  {
163 //echo "insert st id: ".$st["id"].", parent:".$st["parent"]."<br>";
164  $this->lm_tree->insertNode($st["id"], $st["parent"]);
165 //echo "done<br>";
166  if (is_array($this->pg_into_tree[$st["id"]]))
167  {
168  foreach($this->pg_into_tree[$st["id"]] as $pg)
169  {
170  switch ($pg["type"])
171  {
172  case "pg_alias":
173  if ($this->pg_mapping[$pg["id"]] == "")
174  {
175  $ilLog->write("LM Import: No PageObject for PageAlias ".
176  $pg["id"]." found! (Please update export installation to ILIAS 3.3.0)");
177 
178  // Jump two levels up. First level is switch
179  continue 2;
180  }
181  $pg_id = $this->pg_mapping[$pg["id"]];
182  break;
183 
184  case "pg":
185  $pg_id = $pg["id"];
186  break;
187  }
188  if (!$this->lm_tree->isInTree($pg_id))
189  {
190  $this->lm_tree->insertNode($pg_id, $st["id"]);
191  }
192  }
193  }
194  }
195 //echo "<b>END: storing the tree</b>";
196  }
197 
198 
203  {
204  /*
205  $pg_mapping = array();
206  foreach($this->pg_mapping as $key => $value)
207  {
208  $pg_mapping[$key] = "il__pg_".$value;
209  }*/
210 //echo "<br><b>processIntLinks</b>"; flush();
211 
212  // outgoin internal links
213  foreach($this->pages_to_parse as $page_id)
214  {
215  $page_arr = explode(":", $page_id);
216 //echo "<br>resolve:".$this->content_object->getType().":".$page_id; flush();
217  switch($page_arr[0])
218  {
219  case "lm":
220  $page_obj =& new ilPageObject($this->content_object->getType(), $page_arr[1]);
221  break;
222 
223  case "gdf":
224  $page_obj =& new ilPageObject("gdf", $page_arr[1]);
225  break;
226 
227  case "qpl":
228  $page_obj = new ilPageObject("qpl", $page_arr[1]);
229  break;
230  }
231  $page_obj->buildDom();
232  $page_obj->resolveIntLinks();
233  $page_obj->resolveIIMMediaAliases($this->mob_mapping);
234  if (in_array($this->coType, array("lm", "dbk")))
235  {
236  $page_obj->resolveQuestionReferences($this->qst_mapping);
237  }
238  $page_obj->update(false);
239 
240  if ($page_arr[0] == "gdf")
241  {
242  $def =& new ilGlossaryDefinition($page_arr[1]);
243  $def->updateShortText();
244  }
245 
246  unset($page_obj);
247  }
248 
249 //echo "<br><b>map area internal links</b>"; flush();
250  // outgoins map area (mob) internal links
251  foreach($this->mobs_with_int_links as $mob_id)
252  {
254  }
255 
256 //echo "<br><b>incoming interna links</b>"; flush();
257  // incoming internal links
258  $done = array();
259  foreach ($this->link_targets as $link_target)
260  {
261 //echo "doin link target:".$link_target.":<br>";
262  $link_arr = explode("_", $link_target);
263  $target_inst = $link_arr[1];
264  $target_type = $link_arr[2];
265  $target_id = $link_arr[3];
266 //echo "<br>-".$target_type."-".$target_id."-".$target_inst."-";
268  foreach($sources as $key => $source)
269  {
270 //echo "got source:".$key.":<br>";
271  if(in_array($key, $done))
272  {
273  continue;
274  }
275  $type_arr = explode(":", $source["type"]);
276 
277  // content object pages
278  if ($type_arr[1] == "pg")
279  {
280  if (ilPageObject::_exists($type_arr[0], $source["id"]))
281  {
282  $page_object = new ilPageObject($type_arr[0], $source["id"]);
283  $page_object->buildDom();
284  $page_object->resolveIntLinks();
285  $page_object->update();
286  unset($page_object);
287  }
288  }
289 
290  // eventually correct links in questions to learning modules
291  if ($type_arr[0] == "qst")
292  {
293  require_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
294  assQuestion::_resolveIntLinks($source["id"]);
295  }
296  // eventually correct links in survey questions to learning modules
297  if ($type_arr[0] == "sqst")
298  {
299  require_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
300  SurveyQuestion::_resolveIntLinks($source["id"]);
301  }
302  $done[$key] = $key;
303  }
304  }
305  }
306 
307 
311  function copyMobFiles()
312  {
313  $imp_dir = $this->content_object->getImportDirectory();
314 
315  foreach ($this->mob_mapping as $origin_id => $mob_id)
316  {
317  if(empty($origin_id))
318  {
319  continue;
320  }
321 
322  /*
323  $origin_arr = explode("_", $origin_id);
324  if ($origin_arr[2] == "el") // imagemap
325  {
326  $obj_dir = "imagemap".$origin_arr[3];
327  }
328  else // normal media object
329  {
330  $obj_dir = "mm".$origin_arr[3];
331  }*/
332 
333  $obj_dir = $origin_id;
334  $source_dir = $imp_dir."/".$this->subdir."/objects/".$obj_dir;
335  $target_dir = ilUtil::getWebspaceDir()."/mobs/mm_".$mob_id;
336 
337 //echo "copy from $source_dir to $target_dir <br>";
338  if (@is_dir($source_dir))
339  {
340  // make target directory
341  ilUtil::makeDir($target_dir);
342  //@mkdir($target_dir);
343  //@chmod($target_dir, 0755);
344 
345  if (@is_dir($target_dir))
346  {
347  ilUtil::rCopy($source_dir, $target_dir);
348  }
349  }
350  }
351  }
352 
356  function copyFileItems()
357  {
358  $imp_dir = $this->content_object->getImportDirectory();
359  foreach ($this->file_item_mapping as $origin_id => $file_id)
360  {
361  if(empty($origin_id))
362  {
363  continue;
364  }
365  $obj_dir = $origin_id;
366  $source_dir = $imp_dir."/".$this->subdir."/objects/".$obj_dir;
367 
368  include_once("./Modules/File/classes/class.ilObjFile.php");
369  $file_obj = new ilObjFile($file_id, false);
370  //$target_dir = ilUtil::getDataDir()."/files/file_".$file_id;
371  $target_dir = $file_obj->getDirectory();
372  if (@is_dir($source_dir))
373  {
374  // make target directory
375  ilUtil::makeDir($target_dir);
376  //@mkdir($target_dir);
377  //@chmod($target_dir, 0755);
378 
379  if (@is_dir($target_dir))
380  {
381  ilUtil::rCopy($source_dir, $target_dir);
382  }
383  }
384  $test = $file_obj->determineFilesize();
385  $file_obj->update();
386  }
387  }
388 
392  function setQuestionMapping($a_map)
393  {
394  $this->qst_mapping = $a_map;
395  }
396 
397 
398  /*
399  * update parsing status for a element begin
400  */
401  function beginElement($a_name)
402  {
403  if(!isset($this->status["$a_name"]))
404  {
405  $this->cnt[$a_name] == 1;
406  }
407  else
408  {
409  $this->cnt[$a_name]++;
410  }
411  $this->current_element[count($this->current_element)] = $a_name;
412  }
413 
414  /*
415  * update parsing status for an element ending
416  *
417  * @param string $a_name element name
418  */
419  function endElement($a_name)
420  {
421  $this->cnt[$a_name]--;
422  unset ($this->current_element[count($this->current_element) - 1]);
423  }
424 
425  /*
426  * returns current element
427  */
428  function getCurrentElement()
429  {
430  return ($this->current_element[count($this->current_element) - 1]);
431  }
432 
433  /*
434  * returns number of current open elements of type $a_name
435  *
436  * @param string $a_name element name
437  */
438  function getOpenCount($a_name)
439  {
440  if (isset($this->cnt[$a_name]))
441  {
442  return $this->cnt[$a_name];
443  }
444  else
445  {
446  return 0;
447  }
448 
449  }
450 
458  function buildTag ($type, $name, $attr="")
459  {
460  $tag = "<";
461 
462  if ($type == "end")
463  $tag.= "/";
464 
465  $tag.= $name;
466 
467  if (is_array($attr))
468  {
469  while (list($k,$v) = each($attr))
470  $tag.= " ".$k."=\"$v\"";
471  }
472 
473  $tag.= ">";
474 
475  return $tag;
476  }
477 
485  function handlerBeginTag($a_xml_parser,$a_name,$a_attribs)
486  {
487 //echo "<b>BEGIN TAG: $a_name <br></b>"; flush();
488  switch($a_name)
489  {
490  case "ContentObject":
491  $this->current_object =& $this->content_object;
492 //echo "<br>Parser:CObjType:".$a_attribs["Type"];
493  if ($a_attribs["Type"] == "Glossary")
494  {
495  $this->glossary_object =& $this->content_object;
496  }
497  break;
498 
499  case "StructureObject":
500 //echo "<br><br>StructureOB-SET-".count($this->structure_objects)."<br>";
501  $this->structure_objects[count($this->structure_objects)]
502  =& new ilStructureObject($this->content_object);
503  $this->current_object =& $this->structure_objects[count($this->structure_objects) - 1];
504  $this->current_object->setLMId($this->content_object->getId());
505  // new meta data handling: we create the structure
506  // object already here, this should also create a
507  // md entry
508  $this->current_object->create(true);
509  break;
510 
511  case "PageObject":
512  $this->in_page_object = true;
513  $this->cur_qid = "";
514  if (($this->coType != "tst") and ($this->coType != "qpl"))
515  {
516  $this->lm_page_object =& new ilLMPageObject($this->content_object);
517  $this->page_object =& new ilPageObject($this->content_object->getType());
518  $this->lm_page_object->setLMId($this->content_object->getId());
519  $this->lm_page_object->assignPageObject($this->page_object);
520  $this->current_object =& $this->lm_page_object;
521  }
522  else
523  {
524  $this->page_object =& new ilPageObject("qpl");
525  }
526  break;
527 
528  case "PageAlias":
529  if (($this->coType != "tst") and ($this->coType != "qpl"))
530  {
531  $this->lm_page_object->setAlias(true);
532  $this->lm_page_object->setOriginID($a_attribs["OriginId"]);
533  }
534  break;
535 
536  case "MediaObject":
537  $this->in_media_object = true;
538 case "InteractiveImage":
539 
540  $this->media_meta_start = true;
541  $this->media_meta_cache = array();
542  $this->media_object =& new ilObjMediaObject();
543  break;
544 
545  case "MediaAlias":
546 //echo "<br>---NEW MEDIAALIAS---<br>";
547  $this->media_object->setAlias(true);
548  $this->media_object->setImportId($a_attribs["OriginId"]);
549  if (is_object($this->page_object))
550  {
551  $this->page_object->needsImportParsing(true);
552  }
553  break;
554 
555  case "MediaItem":
556  case "MediaAliasItem":
557  $this->in_media_item = true;
558  $this->media_item =& new ilMediaItem();
559  $this->media_item->setPurpose($a_attribs["Purpose"]);
560  /*if ($a_name == "MediaItem")
561  {
562  $this->media_item->setHighlightMode($a_attribs["MapHighlightMode"]);
563  $this->media_item->setHighlightClass($a_attribs["MapHighlightClass"]);
564  }*/
565  break;
566 
567  case "Layout":
568  if (is_object($this->media_object) && $this->in_media_object)
569  {
570  $this->media_item->setWidth($a_attribs["Width"]);
571  $this->media_item->setHeight($a_attribs["Height"]);
572  $this->media_item->setHAlign($a_attribs["HorizontalAlign"]);
573  }
574  break;
575 
576  case "Parameter":
577  if (is_object($this->media_object) && $this->in_media_object)
578  {
579  $this->media_item->setParameter($a_attribs["Name"], $a_attribs["Value"]);
580  }
581  break;
582 
583  case "MapArea":
584  $this->in_map_area = true;
585  $this->map_area =& new ilMapArea();
586  $this->map_area->setShape($a_attribs["Shape"]);
587  $this->map_area->setCoords($a_attribs["Coords"]);
588  $this->map_area->setHighlightMode($a_attribs["HighlightMode"]);
589  $this->map_area->setHighlightClass($a_attribs["HighlightClass"]);
590  break;
591 
592  case "Glossary":
593  $this->in_glossary = true;
594  if ($this->content_object->getType() != "glo")
595  {
596  $this->glossary_object =& new ilObjGlossary();
597  $this->glossary_object->setTitle("");
598  $this->glossary_object->setDescription("");
599  $this->glossary_object->create(true);
600  $this->glossary_object->createReference();
601  $parent =& $this->tree->getParentNodeData($this->content_object->getRefId());
602  $this->glossary_object->putInTree($parent["child"]);
603  $this->glossary_object->setPermissions($parent["child"]);
604  $this->glossary_object->notify("new", $_GET["ref_id"],$_GET["parent_non_rbac_id"],$_GET["ref_id"],$this->glossary_object->getRefId());
605  }
606  $this->current_object =& $this->glossary_object;
607  break;
608 
609  case "GlossaryItem":
610  $this->glossary_term =& new ilGlossaryTerm();
611  $this->glossary_term->setGlossaryId($this->glossary_object->getId());
612  $this->glossary_term->setLanguage($a_attribs["Language"]);
613  $this->glossary_term->setImportId($a_attribs["Id"]);
614  $this->link_targets[$a_attribs["Id"]] = $a_attribs["Id"];
615  break;
616 
617  case "Definition":
618  $this->in_glossary_definition = true;
619  $this->glossary_definition =& new ilGlossaryDefinition();
620  $this->page_object =& new ilPageObject("gdf");
621  $this->page_object->setParentId($this->glossary_term->getGlossaryId());
622  $this->glossary_definition->setTermId($this->glossary_term->getId());
623  $this->glossary_definition->assignPageObject($this->page_object);
624  $this->current_object =& $this->glossary_definition;
625  $this->glossary_definition->create(true);
626  break;
627 
628  case "FileItem":
629  $this->in_file_item = true;
630  $this->file_item =& new ilObjFile();
631  $this->file_item->setTitle("dummy");
632  $this->file_item->setMode("filelist");
633  if (is_object($this->page_object))
634  {
635  $this->page_object->needsImportParsing(true);
636  }
637  break;
638 
639  case "Paragraph":
640  if ($a_attribs["Characteristic"] == "Code")
641  {
642  $this->inside_code = true;
643  }
644  break;
645 
646  case "Properties":
647  $this->in_properties = true;
648  break;
649 
650  case "Property":
651  if ($this->content_object->getType() == "lm"
652  || $this->content_object->getType() == "dbk")
653  {
654  switch($a_attribs["Name"])
655  {
656  case "Layout":
657  $this->content_object->setLayout($a_attribs["Value"]);
658  break;
659 
660  case "PageHeader":
661  $this->content_object->setPageHeader($a_attribs["Value"]);
662  break;
663 
664  case "TOCMode":
665  $this->content_object->setTOCMode($a_attribs["Value"]);
666  break;
667 
668  case "ActiveLMMenu":
669  $this->content_object->setActiveLMMenu(
670  ilUtil::yn2tf($a_attribs["Value"]));
671  break;
672 
673  case "ActiveNumbering":
674  $this->content_object->setActiveNumbering(
675  ilUtil::yn2tf($a_attribs["Value"]));
676  break;
677 
678  case "ActiveTOC":
679  $this->content_object->setActiveTOC(
680  ilUtil::yn2tf($a_attribs["Value"]));
681  break;
682 
683  case "ActivePrintView":
684  $this->content_object->setActivePrintView(
685  ilUtil::yn2tf($a_attribs["Value"]));
686  break;
687 
688  case "CleanFrames":
689  $this->content_object->setCleanFrames(
690  ilUtil::yn2tf($a_attribs["Value"]));
691  break;
692 
693  case "PublicNotes":
694  $this->content_object->setPublicNotes(
695  ilUtil::yn2tf($a_attribs["Value"]));
696  break;
697 
698  case "HistoryUserComments":
699  $this->content_object->setHistoryUserComments(
700  ilUtil::yn2tf($a_attribs["Value"]));
701  break;
702 
703  case "HeaderPage":
704  if ($a_attribs["Value"] != "")
705  {
706  if ($this->pg_mapping[$a_attribs["Value"]] > 0)
707  {
708  $this->content_object->setHeaderPage(
709  $this->pg_mapping[$a_attribs["Value"]]);
710  }
711  }
712  break;
713 
714  case "FooterPage":
715  if ($a_attribs["Value"] != "")
716  {
717  if ($this->pg_mapping[$a_attribs["Value"]] > 0)
718  {
719  $this->content_object->setFooterPage(
720  $this->pg_mapping[$a_attribs["Value"]]);
721  }
722  }
723  break;
724  }
725  //echo "<br>+".$a_attribs["Name"]."+";
726  }
727  break;
728 
732  case "MetaData":
733  $this->in_meta_data = true;
734 //echo "<br>begin meta data section -".$this->current_object->getType()."-";
735  // media obejct meta data handling
736  // is done in the "Identifier" begin tag processing
737  // the rest is done here
738  if(!$this->in_media_object)
739  {
740  if (($this->coType != "tst") and ($this->coType != "qpl"))
741  {
742  // type pg/st
743  if ($this->current_object->getType() == "st" ||
744  $this->current_object->getType() == "pg")
745  {
746  // late creation of page object
747  if ($this->current_object->getType() == "pg")
748  {
749  $this->lm_page_object->create(true);
750  }
751  $this->md =& new ilMD($this->content_object->getId() ,
752  $this->current_object->getId(),
753  $this->current_object->getType());
754  }
755  // type gdf
756  else if ($this->current_object->getType() == "gdf")
757  {
758  $this->md =& new ilMD($this->glossary_object->getId() ,
759  $this->current_object->getId(),
760  $this->current_object->getType());
761  }
762  // type lm, dbk, glo
763  else
764  {
765  if ($this->processMeta())
766  {
767  $this->md =& new ilMD($this->current_object->getId() ,
768  0,
769  $this->current_object->getType());
770  }
771  }
772  }
773  else
774  {
775  // type qpl or tst
776  $this->md =& new ilMD($this->content_object->getId() ,
777  0,
778  $this->current_object->getType()
779  );
780  if ($this->md->getGeneral() != false)
781  {
782  $this->metadata_parsing_disabled = true;
783  $this->enableMDParsing(false);
784  }
785  }
786  }
787  break;
788 
789  // Identifier
790  case "Identifier":
791 
792  // please note: Meta-Metadata and MetaData are different tags!
793  if (!$this->in_meta_meta_data)
794  {
795  if ($this->in_meta_data && !$this->in_glossary_definition)
796  {
797  if (!$this->in_media_object)
798  {
799  $this->current_object->setImportId($a_attribs["Entry"]);
800  }
801  $this->link_targets[$a_attribs["Entry"]] = $a_attribs["Entry"];
802  }
803  if ($this->in_file_item)
804  {
805  if ($this->file_item_mapping[$a_attribs["Entry"]] == "")
806  {
807  $this->file_item->create();
808  $this->file_item->setImportId($a_attribs["Entry"]);
809  $this->file_item_mapping[$a_attribs["Entry"]] = $this->file_item->getId();
810  }
811  }
812  if ($this->in_meta_data && $this->in_media_object)
813  {
814 //echo "looking for -".$a_attribs["Entry"]."-<br>";
815 
816  $mob_id = $this->mob_mapping[$a_attribs["Entry"]];
817 
818  // within learning module import, usually a media object
819  // has already been created with a media alias tag
820  if ($mob_id > 0)
821  {
822  $this->media_object = new ilObjMediaObject($mob_id);
823  }
824  else // in glossaries the media objects precede the definitions
825  // so we don't have an object already
826  {
827  $this->media_object = new ilObjMediaObject();
828  $this->media_object->create(true, false);
829  $this->mob_mapping[$a_attribs["Entry"]]
830  = $this->media_object->getId();
831  }
832  $this->media_object->setImportId($a_attribs["Entry"]);
833  $this->md =& new ilMD(0 ,
834  $this->media_object->getId(),
835  "mob");
836  $this->emptyMediaMetaCache($a_xml_parser);
837  }
838  }
839  break;
840 
841  case "Meta-Metadata":
842  $this->in_meta_meta_data = true;
843  break;
844 
845  // Internal Link
846  case "IntLink":
847  if (is_object($this->page_object))
848  {
849  $this->page_object->setContainsIntLink(true);
850  }
851  if ($this->in_map_area)
852  {
853 //echo "intlink:maparea:<br>";
854  $this->map_area->setLinkType(IL_INT_LINK);
855  $this->map_area->setTarget($a_attribs["Target"]);
856  $this->map_area->setType($a_attribs["Type"]);
857  $this->map_area->setTargetFrame($a_attribs["TargetFrame"]);
858  if (is_object($this->media_object))
859  {
860 //echo ":setContainsLink:<br>";
861  $this->media_object->setContainsIntLink(true);
862  }
863  }
864  break;
865 
866  // External Link
867  case "ExtLink":
868  if ($this->in_map_area)
869  {
870  $this->map_area->setLinkType(IL_EXT_LINK);
871  $this->map_area->setHref($a_attribs["Href"]);
872  $this->map_area->setExtTitle($a_attribs["Title"]);
873  }
874  break;
875 
876  // Question
877  case "Question":
878  $this->cur_qid = $a_attribs["QRef"];
879  $this->page_object->setContainsQuestion(true);
880  break;
881 
882  case "Location":
883  $this->loc_type = $a_attribs["Type"];
884  break;
885 
886  case "Bibliography":
887  $this->in_bib_item = true;
888 //echo "<br>---NEW BIBLIOGRAPHY---<br>";
889  $this->bib_item =& new ilBibItem();
890  break;
891 
892  }
893  $this->beginElement($a_name);
894 
895  // append content to page xml content
896  if(($this->in_page_object || $this->in_glossary_definition)
897  && !$this->in_meta_data && !$this->in_media_object)
898  {
899  if ($a_name == "Definition")
900  {
901  $app_name = "PageObject";
902  $app_attribs = array();
903  }
904  else
905  {
906  $app_name = $a_name;
907  $app_attribs = $a_attribs;
908  }
909 
910  // change identifier entry of file items to new local file id
911  if ($this->in_file_item && $app_name == "Identifier")
912  {
913  $app_attribs["Entry"] = "il__file_".$this->file_item_mapping[$a_attribs["Entry"]];
914  //$app_attribs["Entry"] = "il__file_".$this->file_item->getId();
915  }
916 
917  $this->page_object->appendXMLContent($this->buildTag("start", $app_name, $app_attribs));
918 //echo "&nbsp;&nbsp;after append, xml:".$this->page_object->getXMLContent().":<br>";
919  }
920 
921  // append content to bibitem xml content
922  if ($this->in_bib_item) // && !$this->in_page_object && !$this->in_media_object
923  {
924  $this->bib_item->appendXMLContent("\n".$this->buildTag("start", $a_name, $a_attribs));
925  }
926 
927  // call meta data handler
928  if ($this->in_meta_data && $this->processMeta())
929  {
930  // cache beginning of meta data within media object tags
931  // (we need to know the id at the begin of meta elements within
932  // media objects, after the "Identifier" tag has been processed
933  // we send the cached data to the meta xml handler)
934  if ($this->in_media_object && $this->media_meta_start)
935  {
936  $this->media_meta_cache[] =
937  array("type" => "handlerBeginTag", "par1" => $a_name, "par2" => $a_attribs);
938  }
939  else
940  {
941  if ($a_name == "Identifier")
942  {
943  if (!$this->in_media_object)
944  {
945  $a_attribs["Entry"] = "il__".$this->current_object->getType().
946  "_".$this->current_object->getId();
947  }
948  else
949  {
950  $a_attribs["Entry"] = "il__mob".
951  "_".$this->media_object->getId();
952  }
953  $a_attribs["Catalog"] = "ILIAS";
954  }
955 
956  parent::handlerBeginTag($a_xml_parser,$a_name,$a_attribs);
957  }
958  }
959  }
960 
964  function processMeta()
965  {
966  // do not process second meta block in (ilias3) glossaries
967  // which comes right after the "Glossary" tag
968  if ($this->content_object->getType() == "glo" &&
969  $this->in_glossary && !$this->in_media_object
970  && !$this->in_glossary_definition)
971  {
972  return false;
973  }
974 
975  return true;
976  }
977 
978 
985  function handlerEndTag($a_xml_parser,$a_name)
986  {
987  // call meta data handler
988  if ($this->in_meta_data && $this->processMeta())
989  {
990  // cache beginning of meta data within media object tags
991  // (we need to know the id, after that we send the cached data
992  // to the meta xml handler)
993  if ($this->in_media_object && $this->media_meta_start)
994  {
995  $this->media_meta_cache[] =
996  array("type" => "handlerEndTag", "par1" => $a_name);
997  }
998  else
999  {
1000  parent::handlerEndTag($a_xml_parser,$a_name);
1001  }
1002  }
1003 
1004 //echo "<b>END TAG: $a_name <br></b>"; flush();
1005  // append content to page xml content
1006  if (($this->in_page_object || $this->in_glossary_definition)
1007  && !$this->in_meta_data && !$this->in_media_object)
1008  {
1009  $app_name = ($a_name == "Definition")
1010  ? "PageObject"
1011  : $a_name;
1012  $this->page_object->appendXMLContent($this->buildTag("end", $app_name));
1013  }
1014 
1015  // append content to bibitemxml content
1016  if ($this->in_bib_item) // && !$this->in_page_object && !$this->in_media_object
1017  {
1018  if($a_name == "BibItem")
1019  {
1020  $this->bib_item->appendXMLContent("\n".$this->buildTag("end", $a_name));
1021  }
1022  else
1023  {
1024  $this->bib_item->appendXMLContent($this->buildTag("end", $a_name));
1025  }
1026 
1027  }
1028 
1029  switch($a_name)
1030  {
1031  case "StructureObject":
1032  //unset($this->meta_data);
1033  unset($this->structure_objects[count($this->structure_objects) - 1]);
1034  break;
1035 
1036  case "PageObject":
1037 
1038  $this->in_page_object = false;
1039  if (($this->coType != "tst") and ($this->coType != "qpl"))
1040  {
1041  if (!$this->lm_page_object->isAlias())
1042  {
1043  //$this->page_object->createFromXML();
1044  $this->page_object->updateFromXML();
1045  $this->pg_mapping[$this->lm_page_object->getImportId()]
1046  = $this->lm_page_object->getId();
1047 
1048  // collect pages with internal links
1049  if ($this->page_object->containsIntLink())
1050  {
1051  $this->pages_to_parse["lm:".$this->page_object->getId()] = "lm:".$this->page_object->getId();
1052  }
1053 
1054  // collect pages with mobs or files
1055  if ($this->page_object->needsImportParsing())
1056  {
1057  $this->pages_to_parse["lm:".$this->page_object->getId()] = "lm:".$this->page_object->getId();
1058  }
1059 
1060  // collect pages with questions
1061  if ($this->page_object->getContainsQuestion())
1062  {
1063  $this->pages_to_parse["lm:".$this->page_object->getId()] = "lm:".$this->page_object->getId();
1064  }
1065 
1066  }
1067  }
1068  else
1069  {
1070  $xml = $this->page_object->getXMLContent();
1071  if ($this->cur_qid != "")
1072  {
1073  $ids = $this->qst_mapping[$this->cur_qid];
1074  if ($ids["pool"] > 0)
1075  {
1076  // question pool question
1077  $page = new ilPageObject("qpl", $ids["pool"]);
1078  $xmlcontent = str_replace($this->cur_qid,
1079  "il__qst_".$ids["pool"], $xml);
1080  $page->setXMLContent($xmlcontent);
1081  $page->saveMobUsage($xmlcontent);
1082  $page->updateFromXML();
1083  if( $this->page_object->needsImportParsing() )
1084  {
1085  $this->pages_to_parse["qpl:".$page->getId()] = "qpl:".$page->getId();
1086  }
1087  unset($page);
1088  }
1089  if ($ids["test"] > 0)
1090  {
1091  // test question
1092  $page = new ilPageObject("qpl", $ids["test"]);
1093  $xmlcontent = str_replace($this->cur_qid,
1094  "il__qst_".$ids["test"], $xml);
1095  $page->setXMLContent($xmlcontent);
1096  $page->saveMobUsage($xmlcontent);
1097  $page->updateFromXML();
1098  if( $this->page_object->needsImportParsing() )
1099  {
1100  $this->pages_to_parse["qpl:".$page->getId()] = "qpl:".$page->getId();
1101  }
1102  unset($page);
1103  }
1104  }
1105  }
1106 
1107  // if we are within a structure object: put page in tree
1108  $cnt = count($this->structure_objects);
1109  if ($cnt > 0)
1110  {
1111  $parent_id = $this->structure_objects[$cnt - 1]->getId();
1112  if ($this->lm_page_object->isAlias())
1113  {
1114  $this->pg_into_tree[$parent_id][] = array("type" => "pg_alias", "id" => $this->lm_page_object->getOriginId());
1115  }
1116  else
1117  {
1118  $this->pg_into_tree[$parent_id][] = array("type" => "pg", "id" => $this->lm_page_object->getId());
1119  }
1120  }
1121 
1122  unset($this->page_object);
1123  unset($this->lm_page_object);
1124  unset ($this->container[count($this->container) - 1]);
1125  break;
1126 
1127  case "MediaObject":
1128  $this->in_media_object = false;
1129 case "InteractiveImage":
1130 
1131 //echo "ENDMediaObject:ImportId:".$this->media_object->getImportId()."<br>";
1132  // create media object on first occurence of an Id
1133 
1134 
1135  if(empty($this->mob_mapping[$this->media_object->getImportId()]))
1136  {
1137 //echo "No mapping found --creating media object:title:".$this->media_object->getTitle().":<br>";
1138 
1139  // create media object
1140  // media items are saves for mobs outside of
1141  // pages only
1142  $this->media_object->create(true, false);
1143 
1144 //echo "<br>creating mob ".$this->media_object->getId().":".$this->media_object->getTitle().":";
1145 
1146  // collect mobs with internal links
1147  if ($this->media_object->containsIntLink())
1148  {
1149 //echo "got int link :".$this->media_object->getId().":<br>";
1150  $this->mobs_with_int_links[] = $this->media_object->getId();
1151  }
1152 
1153  $this->mob_mapping[$this->media_object->getImportId()]
1154  = $this->media_object->getId();
1155 //echo "create:import_id:".$this->media_object->getImportId().":ID:".$this->mob_mapping[$this->media_object->getImportId()]."<br>";
1156  }
1157  else
1158  {
1159 //echo "Mapping found<br>";
1160  // get the id from mapping
1161  $this->media_object->setId($this->mob_mapping[$this->media_object->getImportId()]);
1162 
1163  // update "real" (no alias) media object
1164  // (note: we overwrite any data from the media object
1165  // created by an MediaAlias, only the data of the real
1166  // object is stored in db separately; data of the
1167  // MediaAliases are within the page XML
1168  if (!$this->media_object->isAlias())
1169  {
1170  // now the media items are saved within the db
1171  $this->media_object->update();
1172 
1173 //echo "<br>update media object :".$this->media_object->getId().":";
1174 
1175  // collect mobs with internal links
1176  if ($this->media_object->containsIntLink())
1177  {
1178 //echo "got int link :".$this->media_object->getId().":<br>";
1179  $this->mobs_with_int_links[] = $this->media_object->getId();
1180  }
1181  }
1182  }
1183 
1184  // append media alias to page, if we are in a page
1185  if ($this->in_page_object || $this->in_glossary_definition)
1186  {
1187  if ($a_name != "InteractiveImage")
1188  {
1189  $this->page_object->appendXMLContent($this->media_object->getXML(IL_MODE_ALIAS));
1190 //echo "Appending:".htmlentities($this->media_object->getXML(IL_MODE_ALIAS))."<br>";
1191  }
1192  }
1193 
1194  break;
1195 
1196  case "MediaItem":
1197  case "MediaAliasItem":
1198  $this->in_media_item = false;
1199  $this->media_object->addMediaItem($this->media_item);
1200 //echo "adding media item -".$this->media_item->getId()."-".$this->media_item->getLocation()."- to object -".$this->media_object->getId()."-";
1201  break;
1202 
1203  case "MapArea":
1204  $this->in_map_area = false;
1205  $this->media_item->addMapArea($this->map_area);
1206  break;
1207 
1208  case "Properties":
1209  $this->in_properties = false;
1210  if ($this->content_object->getType() == "lm"
1211  || $this->content_object->getType() == "dbk")
1212  {
1213  $this->content_object->update();
1214  }
1215  break;
1216 
1217  case "MetaData":
1218  $this->in_meta_data = false;
1219  if(strtolower(get_class($this->current_object)) == "illmpageobject" && !$this->in_media_object)
1220  {
1221  // Metadaten eines PageObjects sichern in NestedSet
1222  if (is_object($this->lm_page_object))
1223  {
1224  // update title/description of page object
1225  $this->current_object->MDUpdateListener('General');
1226  ilLMObject::_writeImportId($this->current_object->getId(),
1227  $this->current_object->getImportId());
1228  }
1229  }
1230  else if((strtolower(get_class($this->current_object)) == "ilobjquestionpool" ||
1231  strtolower(get_class($this->current_object)) == "ilobjtest") &&
1233 // !$this->in_media_object && !$this->in_page_object)
1234 // changed for imports of ILIAS 2 Tests where PageObjects could have
1235 // Metadata sections (Helmut Schottmüller, 2005-12-02)
1236  {
1237  if ($this->metadata_parsing_disabled)
1238  {
1239  $this->enableMDParsing(true);
1240  }
1241  else
1242  {
1243  if ($this->in_page_object)
1244  {
1245  $this->page_object->MDUpdateListener('General');
1246  ilLMObject::_writeImportId($this->page_object->getId(),
1247  $this->page_object->getImportId());
1248  }
1249  else
1250  {
1251  $this->current_object->MDUpdateListener('General');
1252  ilLMObject::_writeImportId($this->current_object->getId(),
1253  $this->current_object->getImportId());
1254  }
1255  }
1256  }
1257  else if(strtolower(get_class($this->current_object)) == "ilstructureobject")
1258  { // save structure object at the end of its meta block
1259  // determine parent
1260  $cnt = count($this->structure_objects);
1261  if ($cnt > 1)
1262  {
1263  $parent_id = $this->structure_objects[$cnt - 2]->getId();
1264  }
1265  else
1266  {
1267  $parent_id = $this->lm_tree->getRootId();
1268  }
1269 
1270  // create structure object and put it in tree
1271  //$this->current_object->create(true); // now on top
1272  $this->st_into_tree[] = array ("id" => $this->current_object->getId(),
1273  "parent" => $parent_id);
1274 
1275  // update title/description of structure object
1276  $this->current_object->MDUpdateListener('General');
1277  ilLMObject::_writeImportId($this->current_object->getId(),
1278  $this->current_object->getImportId());
1279  }
1280  else if(strtolower(get_class($this->current_object)) == "ilobjdlbook" || strtolower(get_class($this->current_object)) == "ilobjlearningmodule" ||
1281  strtolower(get_class($this->current_object)) == "ilobjcontentobject" ||
1282  (strtolower(get_class($this->current_object)) == "ilobjglossary" && $this->in_glossary))
1283  {
1284  // todo: saving of md? getting title/descr and
1285  // set it for current object
1286  }
1287  else if(strtolower(get_class($this->current_object)) == "ilglossarydefinition" && !$this->in_media_object)
1288  {
1289  // now on top
1290  //$this->glossary_definition->create();
1291 
1292  $this->page_object->setId($this->glossary_definition->getId());
1293  $this->page_object->updateFromXML();
1294 
1295  // todo: saving of md? getting title/descr and
1296  // set it for current object
1297  }
1298 
1299 
1300  if(strtolower(get_class($this->current_object)) == "ilobjlearningmodule" ||
1301  strtolower(get_class($this->current_object)) == "ilobjdlbook" ||
1302  strtolower(get_class($this->current_object)) == "ilobjglossary")
1303  {
1304  if (strtolower(get_class($this->current_object)) == "ilobjglossary" &&
1305  $this->content_object->getType() != "glo")
1306  {
1307 //echo "<br><b>getting2: ".$this->content_object->getTitle()."</b>";
1308  $this->current_object->setTitle($this->content_object->getTitle()." - ".
1309  $this->lng->txt("glossary"));
1310  }
1311 
1312  $this->current_object->MDUpdateListener('General');
1313  /*
1314  if (!$this->in_media_object && $this->processMeta())
1315  {
1316  $this->current_object->update();
1317  }
1318  */
1319  }
1320 
1321  if ($this->in_media_object)
1322  {
1323 //echo "<br>call media object update listener";
1324  $this->media_object->MDUpdateListener('General');
1325  }
1326 
1327  if ($this->in_glossary_definition)
1328  {
1329  $this->glossary_definition->MDUpdateListener('General');
1330  }
1331 
1332  break;
1333 
1334  case "Meta-Metadata":
1335  $this->in_meta_meta_data = false;
1336  break;
1337 
1338  case "FileItem":
1339  $this->in_file_item = false;
1340  // only update new file items
1341  if ($this->file_item->getImportId($a_attribs["Entry"] != ""))
1342  {
1343  $this->file_item->update();
1344  }
1345  break;
1346 
1347  case "Bibliography":
1348 
1349  $this->in_bib_item = false;
1350 
1351  $nested = new ilNestedSetXML();
1352  $nested->import($this->bib_item->getXMLContent(),$this->content_object->getId(),"bib");
1353  break;
1354 
1355  case "Table":
1356  unset ($this->container[count($this->container) - 1]);
1357  break;
1358 
1359  case "Glossary":
1360  $this->in_glossary = false;
1361  break;
1362 
1363  case "GlossaryTerm":
1364  $this->glossary_term->setTerm(trim($this->chr_data));
1365  $this->glossary_term->create();
1366  $iia = explode("_", $this->glossary_term->getImportId());
1367  $this->glossary_term_map[(int) $iia[count($iia) - 1]] = $this->glossary_term->getId();
1368  break;
1369 
1370  case "Paragraph":
1371  $this->inside_code = false;
1372  break;
1373 
1374  case "Definition":
1375  $this->in_glossary_definition = false;
1376  $this->page_object->updateFromXML();
1377  $this->page_object->buildDom();
1378  $this->glossary_definition->setShortText($this->page_object->getFirstParagraphText());
1379  $this->glossary_definition->update();
1380  //$this->pg_mapping[$this->lm_page_object->getImportId()]
1381  // = $this->lm_page_object->getId();
1382  if ($this->page_object->containsIntLink())
1383  {
1384 //echo "<br>Definition contains Int Link:".$this->page_object->getId();
1385  $this->pages_to_parse["gdf:".$this->page_object->getId()] = "gdf:".$this->page_object->getId();
1386  }
1387  if ($this->page_object->needsImportParsing())
1388  {
1389  $this->pages_to_parse["gdf:".$this->page_object->getId()] = "gdf:".$this->page_object->getId();
1390  }
1391  break;
1392 
1393  case "Format":
1394  if ($this->in_media_item)
1395  {
1396  $this->media_item->setFormat(trim($this->chr_data));
1397  }
1398  if ($this->in_file_item)
1399  {
1400  $this->file_item->setFileType(trim($this->chr_data));
1401  }
1402  break;
1403 
1404  case "Title":
1405  if (!$this->in_media_object)
1406  {
1407  $this->current_object->setTitle(trim($this->chr_data));
1408  //$this->meta_data->setTitle(trim($this->chr_data));
1409  }
1410  else
1411  {
1412  $this->media_object->setTitle(trim($this->chr_data));
1413  //$this->meta_data->setTitle(trim($this->chr_data));
1414  }
1415  break;
1416 
1417  case "Language":
1418  /*
1419  if (is_object($this->meta_data))
1420  {
1421  $this->meta_data->setLanguage(trim($this->chr_data));
1422  }*/
1423 
1424  if (is_object($this->bib_item))
1425  {
1426  $this->bib_item->setLanguage(trim($this->chr_data));
1427  }
1428  break;
1429 
1430  case "Description":
1431  //$this->meta_data->setDescription(trim($this->chr_data));
1432  break;
1433 
1434  case "Caption":
1435  if ($this->in_media_object)
1436  {
1437  $this->media_item->setCaption(trim($this->chr_data));
1438  }
1439  break;
1440 
1441  case "TextRepresentation":
1442  if ($this->in_media_object)
1443  {
1444  $this->media_item->setTextRepresentation(trim($this->chr_data));
1445  }
1446  break;
1447 
1448  // Location
1449  case "Location":
1450  // TODO: adapt for files in "real" subdirectories
1451  if ($this->in_media_item)
1452  {
1453  $this->media_item->setLocationType($this->loc_type);
1454  if ($this->loc_type == "Reference")
1455  {
1456  $this->media_item->setLocation(str_replace("&", "&amp;", trim($this->chr_data)));
1457  }
1458  else
1459  {
1460  $this->media_item->setLocation(trim($this->chr_data));
1461  }
1462  //echo "-".$this->media_item->getLocation()."-";
1463  }
1464  if ($this->in_file_item)
1465  {
1466  // set file name from xml file
1467  $this->file_item->setFileName(trim($this->chr_data));
1468 
1469  // special handling for file names with special characters
1470  // (e.g. "&gt;")
1471  if ($this->file_item->getType() == "file" &&
1472  is_int(strpos($this->chr_data, "&")) &&
1473  is_int(strpos($this->chr_data, ";")))
1474  {
1475  $imp_dir = $this->content_object->getImportDirectory();
1476  $source_dir = $imp_dir."/".$this->subdir."/objects/".
1477  $this->file_item->getImportId();
1478 
1479  // read "physical" file name from directory
1480  if ($dir = opendir($source_dir))
1481  {
1482  while (false !== ($file = readdir($dir)))
1483  {
1484  if ($file != "." && $file != "..")
1485  {
1486  $this->file_item->setFileName($file);
1487  }
1488  }
1489  closedir($dir);
1490  }
1491  }
1492 
1493  // set file item title
1494  $this->file_item->setTitle(trim($this->chr_data));
1495  }
1496  break;
1497 
1498  }
1499  $this->endElement($a_name);
1500  $this->chr_data = "";
1501  }
1502 
1509  function handlerCharacterData($a_xml_parser,$a_data)
1510  {
1511  // call meta data handler
1512  if ($this->in_meta_data && $this->processMeta())
1513  {
1514  // cache beginning of meta data within media object tags
1515  // (we need to know the id, after that we send the cached data
1516  // to the meta xml handler)
1517  if ($this->in_media_object && $this->media_meta_start)
1518  {
1519  $this->media_meta_cache[] =
1520  array("type" => "handlerCharacterData", "par1" => $a_data);
1521  }
1522  else
1523  {
1524  parent::handlerCharacterData($a_xml_parser,$a_data);
1525  }
1526  }
1527 
1528  // the parser converts "&gt;" to ">" and "&lt;" to "<"
1529  // in character data, but we don't want that, because it's the
1530  // way we mask user html in our content, so we convert back...
1531 
1532  $a_data = str_replace("<","&lt;",$a_data);
1533  $a_data = str_replace(">","&gt;",$a_data);
1534 
1535 
1536  // DELETE WHITESPACES AND NEWLINES OF CHARACTER DATA
1537  $a_data = preg_replace("/\n/","",$a_data);
1538  if (!$this->inside_code)
1539  {
1540  $a_data = preg_replace("/\t+/","",$a_data);
1541  }
1542 
1543  $this->chr_data .= $a_data;
1544 
1545  if(!empty($a_data) || $a_data === "0")
1546  {
1547  // append all data to page, if we are within PageObject,
1548  // but not within MetaData or MediaObject
1549  if (($this->in_page_object || $this->in_glossary_definition)
1550  && !$this->in_meta_data && !$this->in_media_object)
1551  {
1552  $this->page_object->appendXMLContent($a_data);
1553  }
1554 
1555  if ($this->in_meta_data)
1556  {
1557  //$this->meta_data->appendXMLContent($a_data);
1558 //echo "<br>".$a_data;
1559  }
1560 
1561  if ($this->in_bib_item )
1562  {
1563  $this->bib_item->appendXMLContent($a_data);
1564  }
1565 
1566  switch($this->getCurrentElement())
1567  {
1568 
1569  case "IntLink":
1570  case "ExtLink":
1571  if($this->in_map_area)
1572  {
1573  $this->map_area->appendTitle($a_data);
1574  }
1575  break;
1576 
1577  }
1578  }
1579 
1580  }
1581 
1582 
1587  function emptyMediaMetaCache(&$a_xml_parser)
1588  {
1589  foreach ($this->media_meta_cache as $cache_entry)
1590  {
1591  switch($cache_entry["type"])
1592  {
1593  case "handlerBeginTag":
1594  parent::handlerBeginTag($a_xml_parser,
1595  $cache_entry["par1"], $cache_entry["par2"]);
1596  break;
1597 
1598  case "handlerEndTag":
1599  parent::handlerEndTag($a_xml_parser,
1600  $cache_entry["par1"]);
1601  break;
1602 
1603  case "handlerCharacterData":
1604  parent::handlerCharacterData($a_xml_parser,
1605  $cache_entry["par1"]);
1606  break;
1607  }
1608  }
1609 
1610  $this->media_meta_start = false;
1611  $this->media_meta_cache[] = array();
1612  }
1613 
1621  {
1622  return $this->glossary_term_map;
1623  }
1624 
1625 }
1626 ?>