24 require_once(
"./Modules/LearningModule/classes/class.ilLMPageObject.php");
25 require_once(
"./Services/COPage/classes/class.ilPageObject.php");
26 require_once(
"./Modules/LearningModule/classes/class.ilStructureObject.php");
27 require_once(
"./Modules/LearningModule/classes/class.ilObjLearningModule.php");
28 require_once(
"Services/MetaData/classes/class.ilMDLanguageItem.php");
29 require_once(
"./Services/COPage/classes/class.ilPCParagraph.php");
30 require_once(
"./Services/COPage/classes/class.ilPCTable.php");
31 require_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
32 require_once(
"./Services/MediaObjects/classes/class.ilMediaItem.php");
33 require_once(
"./Services/MediaObjects/classes/class.ilMapArea.php");
34 require_once(
"./Modules/LearningModule/classes/class.ilBibItem.php");
35 require_once(
"./Modules/Glossary/classes/class.ilObjGlossary.php");
36 require_once(
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
37 require_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
38 require_once(
"./Services/COPage/classes/class.ilInternalLink.php");
39 require_once(
"./Modules/File/classes/class.ilObjFile.php");
41 include_once(
"Services/MetaData/classes/class.ilMDSaxParser.php");
42 include_once(
"Services/MetaData/classes/class.ilMD.php");
109 $this->cnt = array();
110 $this->current_element = array();
111 $this->structure_objects = array();
112 $this->content_object =& $a_content_object;
114 $this->st_into_tree = array();
115 $this->pg_into_tree = array();
116 $this->pages_to_parse = array();
117 $this->mobs_with_int_links = array();
118 $this->mob_mapping = array();
119 $this->file_item_mapping = array();
120 $this->pg_mapping = array();
121 $this->link_targets = array();
122 $this->subdir = $a_subdir;
124 $this->tree =&
$tree;
125 $this->inside_code =
false;
126 $this->qst_mapping = array();
127 $this->coType = $this->content_object->getType();
128 $this->metadata_parsing_disabled =
false;
130 if (($this->coType !=
"tst") and ($this->coType !=
"qpl"))
132 $this->lm_tree =
new ilTree($this->content_object->getId());
134 $this->lm_tree->setTableNames(
'lm_tree',
'lm_data');
148 xml_set_object($a_xml_parser,$this);
149 xml_set_element_handler($a_xml_parser,
'handlerBeginTag',
'handlerEndTag');
150 xml_set_character_data_handler($a_xml_parser,
'handlerCharacterData');
180 foreach($this->st_into_tree as $st)
183 $this->lm_tree->insertNode($st[
"id"], $st[
"parent"]);
185 if (is_array($this->pg_into_tree[$st[
"id"]]))
187 foreach($this->pg_into_tree[$st[
"id"]] as $pg)
192 if ($this->pg_mapping[$pg[
"id"]] ==
"")
194 $ilLog->write(
"LM Import: No PageObject for PageAlias ".
195 $pg[
"id"].
" found! (Please update export installation to ILIAS 3.3.0)");
200 $pg_id = $this->pg_mapping[$pg[
"id"]];
207 if (!$this->lm_tree->isInTree($pg_id))
209 $this->lm_tree->insertNode($pg_id, $st[
"id"]);
232 foreach($this->pages_to_parse as $page_id)
234 $page_arr = explode(
":", $page_id);
239 $page_obj =&
new ilPageObject($this->content_object->getType(), $page_arr[1]);
246 $page_obj->buildDom();
247 $page_obj->resolveIntLinks();
248 $page_obj->update(
false);
250 if ($page_arr[0] ==
"gdf")
253 $def->updateShortText();
261 foreach($this->mobs_with_int_links as $mob_id)
269 foreach ($this->link_targets as $link_target)
272 $link_arr = explode(
"_", $link_target);
273 $target_inst = $link_arr[1];
277 foreach($sources as $key => $source)
280 if(in_array($key, $done))
284 $type_arr = explode(
":", $source[
"type"]);
287 if ($type_arr[1] ==
"pg")
296 if ($type_arr[0] ==
"qst")
298 require_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
302 if ($type_arr[0] ==
"sqst")
304 require_once
"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
318 $imp_dir = $this->content_object->getImportDirectory();
319 foreach ($this->mob_mapping as $origin_id => $mob_id)
321 if(empty($origin_id))
337 $obj_dir = $origin_id;
338 $source_dir = $imp_dir.
"/".$this->subdir.
"/objects/".$obj_dir;
342 if (@is_dir($source_dir))
349 if (@is_dir($target_dir))
362 $imp_dir = $this->content_object->getImportDirectory();
363 foreach ($this->file_item_mapping as $origin_id => $file_id)
365 if(empty($origin_id))
369 $obj_dir = $origin_id;
370 $source_dir = $imp_dir.
"/".$this->subdir.
"/objects/".$obj_dir;
372 include_once(
"./Modules/File/classes/class.ilObjFile.php");
373 $file_obj =
new ilObjFile($file_id,
false);
375 $target_dir = $file_obj->getDirectory();
376 if (@is_dir($source_dir))
383 if (@is_dir($target_dir))
388 $test = $file_obj->determineFilesize();
398 $this->qst_mapping = $a_map;
407 if(!isset($this->status[
"$a_name"]))
409 $this->cnt[$a_name] == 1;
413 $this->cnt[$a_name]++;
415 $this->current_element[count($this->current_element)] = $a_name;
425 $this->cnt[$a_name]--;
426 unset ($this->current_element[count($this->current_element) - 1]);
434 return ($this->current_element[count($this->current_element) - 1]);
444 if (isset($this->cnt[$a_name]))
446 return $this->cnt[$a_name];
473 while (list($k,$v) = each($attr))
474 $tag.=
" ".$k.
"=\"$v\"";
494 case "ContentObject":
497 if ($a_attribs[
"Type"] ==
"Glossary")
503 case "StructureObject":
505 $this->structure_objects[count($this->structure_objects)]
507 $this->current_object =& $this->structure_objects[count($this->structure_objects) - 1];
508 $this->current_object->setLMId($this->content_object->getId());
512 $this->current_object->create(
true);
516 $this->in_page_object =
true;
518 if (($this->coType !=
"tst") and ($this->coType !=
"qpl"))
520 $this->lm_page_object =&
new ilLMPageObject($this->content_object);
521 $this->page_object =&
new ilPageObject($this->content_object->getType());
522 $this->lm_page_object->setLMId($this->content_object->getId());
523 $this->lm_page_object->assignPageObject($this->page_object);
533 if (($this->coType !=
"tst") and ($this->coType !=
"qpl"))
535 $this->lm_page_object->setAlias(
true);
536 $this->lm_page_object->setOriginID($a_attribs[
"OriginId"]);
541 $this->in_media_object =
true;
542 $this->media_meta_start =
true;
543 $this->media_meta_cache = array();
549 $this->media_object->setAlias(
true);
550 $this->media_object->setImportId($a_attribs[
"OriginId"]);
551 if (is_object($this->page_object))
553 $this->page_object->needsImportParsing(
true);
558 case "MediaAliasItem":
559 $this->in_media_item =
true;
561 $this->media_item->setPurpose($a_attribs[
"Purpose"]);
565 if (is_object($this->media_object) && $this->in_media_object)
567 $this->media_item->setWidth($a_attribs[
"Width"]);
568 $this->media_item->setHeight($a_attribs[
"Height"]);
569 $this->media_item->setHAlign($a_attribs[
"HorizontalAlign"]);
574 if (is_object($this->media_object) && $this->in_media_object)
576 $this->media_item->setParameter($a_attribs[
"Name"], $a_attribs[
"Value"]);
581 $this->in_map_area =
true;
583 $this->map_area->setShape($a_attribs[
"Shape"]);
584 $this->map_area->setCoords($a_attribs[
"Coords"]);
588 $this->in_glossary =
true;
589 if ($this->content_object->getType() !=
"glo")
592 $this->glossary_object->setTitle(
"");
593 $this->glossary_object->setDescription(
"");
594 $this->glossary_object->create(
true);
595 $this->glossary_object->createReference();
596 $parent =& $this->tree->getParentNodeData($this->content_object->getRefId());
597 $this->glossary_object->putInTree($parent[
"child"]);
598 $this->glossary_object->setPermissions($parent[
"child"]);
599 $this->glossary_object->notify(
"new",
$_GET[
"ref_id"],
$_GET[
"parent_non_rbac_id"],
$_GET[
"ref_id"],$this->glossary_object->getRefId());
606 $this->glossary_term->setGlossaryId($this->glossary_object->getId());
607 $this->glossary_term->setLanguage($a_attribs[
"Language"]);
608 $this->glossary_term->setImportId($a_attribs[
"Id"]);
609 $this->link_targets[$a_attribs[
"Id"]] = $a_attribs[
"Id"];
613 $this->in_glossary_definition =
true;
616 $this->page_object->setParentId($this->glossary_term->getGlossaryId());
617 $this->glossary_definition->setTermId($this->glossary_term->getId());
618 $this->glossary_definition->assignPageObject($this->page_object);
619 $this->current_object =& $this->glossary_definition;
620 $this->glossary_definition->create(
true);
624 $this->in_file_item =
true;
626 $this->file_item->setTitle(
"dummy");
627 $this->file_item->setMode(
"filelist");
628 if (is_object($this->page_object))
630 $this->page_object->needsImportParsing(
true);
635 if ($a_attribs[
"Characteristic"] ==
"Code")
637 $this->inside_code =
true;
642 $this->in_properties =
true;
646 if ($this->content_object->getType() ==
"lm"
647 || $this->content_object->getType() ==
"dbk")
649 switch($a_attribs[
"Name"])
652 $this->content_object->setLayout($a_attribs[
"Value"]);
656 $this->content_object->setPageHeader($a_attribs[
"Value"]);
660 $this->content_object->setTOCMode($a_attribs[
"Value"]);
664 $this->content_object->setActiveLMMenu(
668 case "ActiveNumbering":
669 $this->content_object->setActiveNumbering(
674 $this->content_object->setActiveTOC(
678 case "ActivePrintView":
679 $this->content_object->setActivePrintView(
684 $this->content_object->setCleanFrames(
689 $this->content_object->setPublicNotes(
693 case "HistoryUserComments":
694 $this->content_object->setHistoryUserComments(
699 if ($a_attribs[
"Value"] !=
"")
701 if ($this->pg_mapping[$a_attribs[
"Value"]] > 0)
703 $this->content_object->setHeaderPage(
704 $this->pg_mapping[$a_attribs[
"Value"]]);
710 if ($a_attribs[
"Value"] !=
"")
712 if ($this->pg_mapping[$a_attribs[
"Value"]] > 0)
714 $this->content_object->setFooterPage(
715 $this->pg_mapping[$a_attribs[
"Value"]]);
728 $this->in_meta_data =
true;
733 if(!$this->in_media_object)
735 if (($this->coType !=
"tst") and ($this->coType !=
"qpl"))
738 if ($this->current_object->getType() ==
"st" ||
739 $this->current_object->getType() ==
"pg")
742 if ($this->current_object->getType() ==
"pg")
744 $this->lm_page_object->create(
true);
746 $this->md =&
new ilMD($this->content_object->getId() ,
747 $this->current_object->getId(),
748 $this->current_object->getType());
751 else if ($this->current_object->getType() ==
"gdf")
753 $this->md =&
new ilMD($this->glossary_object->getId() ,
754 $this->current_object->getId(),
755 $this->current_object->getType());
762 $this->md =&
new ilMD($this->current_object->getId() ,
764 $this->current_object->getType());
771 $this->md =&
new ilMD($this->content_object->getId() ,
773 $this->current_object->getType()
775 if ($this->md->getGeneral() !=
false)
777 $this->metadata_parsing_disabled =
true;
788 if (!$this->in_meta_meta_data)
790 if ($this->in_meta_data && !$this->in_glossary_definition)
792 if (!$this->in_media_object)
794 $this->current_object->setImportId($a_attribs[
"Entry"]);
796 $this->link_targets[$a_attribs[
"Entry"]] = $a_attribs[
"Entry"];
798 if ($this->in_file_item)
800 if ($this->file_item_mapping[$a_attribs[
"Entry"]] ==
"")
802 $this->file_item->create();
803 $this->file_item->setImportId($a_attribs[
"Entry"]);
804 $this->file_item_mapping[$a_attribs[
"Entry"]] = $this->file_item->getId();
807 if ($this->in_meta_data && $this->in_media_object)
811 $mob_id = $this->mob_mapping[$a_attribs[
"Entry"]];
823 $this->media_object->create(
true,
false);
824 $this->mob_mapping[$a_attribs[
"Entry"]]
825 = $this->media_object->getId();
827 $this->media_object->setImportId($a_attribs[
"Entry"]);
828 $this->md =&
new ilMD(0 ,
829 $this->media_object->getId(),
836 case "Meta-Metadata":
837 $this->in_meta_meta_data =
true;
842 if (is_object($this->page_object))
844 $this->page_object->setContainsIntLink(
true);
846 if ($this->in_map_area)
850 $this->map_area->setTarget($a_attribs[
"Target"]);
851 $this->map_area->setType($a_attribs[
"Type"]);
852 $this->map_area->setTargetFrame($a_attribs[
"TargetFrame"]);
853 if (is_object($this->media_object))
856 $this->media_object->setContainsIntLink(
true);
863 if ($this->in_map_area)
866 $this->map_area->setHref($a_attribs[
"Href"]);
867 $this->map_area->setExtTitle($a_attribs[
"Title"]);
873 $this->cur_qid = $a_attribs[
"QRef"];
877 $this->loc_type = $a_attribs[
"Type"];
881 $this->in_bib_item =
true;
890 if(($this->in_page_object || $this->in_glossary_definition)
891 && !$this->in_meta_data && !$this->in_media_object)
893 if ($a_name ==
"Definition")
895 $app_name =
"PageObject";
896 $app_attribs = array();
901 $app_attribs = $a_attribs;
905 if ($this->in_file_item && $app_name ==
"Identifier")
907 $app_attribs[
"Entry"] =
"il__file_".$this->file_item_mapping[$a_attribs[
"Entry"]];
911 $this->page_object->appendXMLContent($this->
buildTag(
"start", $app_name, $app_attribs));
916 if ($this->in_bib_item)
918 $this->bib_item->appendXMLContent(
"\n".$this->
buildTag(
"start", $a_name, $a_attribs));
928 if ($this->in_media_object && $this->media_meta_start)
930 $this->media_meta_cache[] =
931 array(
"type" =>
"handlerBeginTag",
"par1" => $a_name,
"par2" => $a_attribs);
935 if ($a_name ==
"Identifier")
937 if (!$this->in_media_object)
939 $a_attribs[
"Entry"] =
"il__".$this->current_object->getType().
940 "_".$this->current_object->getId();
944 $a_attribs[
"Entry"] =
"il__mob".
945 "_".$this->media_object->getId();
947 $a_attribs[
"Catalog"] =
"ILIAS";
962 if ($this->content_object->getType() ==
"glo" &&
963 $this->in_glossary && !$this->in_media_object
964 && !$this->in_glossary_definition)
987 if ($this->in_media_object && $this->media_meta_start)
989 $this->media_meta_cache[] =
990 array(
"type" =>
"handlerEndTag",
"par1" => $a_name);
1000 if (($this->in_page_object || $this->in_glossary_definition)
1001 && !$this->in_meta_data && !$this->in_media_object)
1003 $app_name = ($a_name ==
"Definition")
1006 $this->page_object->appendXMLContent($this->
buildTag(
"end", $app_name));
1010 if ($this->in_bib_item)
1012 if($a_name ==
"BibItem")
1014 $this->bib_item->appendXMLContent(
"\n".$this->
buildTag(
"end", $a_name));
1018 $this->bib_item->appendXMLContent($this->
buildTag(
"end", $a_name));
1025 case "StructureObject":
1027 unset($this->structure_objects[count($this->structure_objects) - 1]);
1032 $this->in_page_object =
false;
1033 if (($this->coType !=
"tst") and ($this->coType !=
"qpl"))
1035 if (!$this->lm_page_object->isAlias())
1038 $this->page_object->updateFromXML();
1039 $this->pg_mapping[$this->lm_page_object->getImportId()]
1040 = $this->lm_page_object->getId();
1043 if ($this->page_object->containsIntLink())
1045 $this->pages_to_parse[
"lm:".$this->page_object->getId()] =
"lm:".$this->page_object->getId();
1049 if ($this->page_object->needsImportParsing())
1051 $this->pages_to_parse[
"lm:".$this->page_object->getId()] =
"lm:".$this->page_object->getId();
1058 $xml = $this->page_object->getXMLContent();
1059 if ($this->cur_qid !=
"")
1061 $ids = $this->qst_mapping[$this->cur_qid];
1062 if ($ids[
"pool"] > 0)
1066 $xmlcontent = str_replace($this->cur_qid,
1067 "il__qst_".$ids[
"pool"], $xml);
1068 $page->setXMLContent($xmlcontent);
1069 $page->saveMobUsage($xmlcontent);
1070 $page->updateFromXML();
1073 if ($ids[
"test"] > 0)
1077 $xmlcontent = str_replace($this->cur_qid,
1078 "il__qst_".$ids[
"test"], $xml);
1079 $page->setXMLContent($xmlcontent);
1080 $page->saveMobUsage($xmlcontent);
1081 $page->updateFromXML();
1088 $cnt = count($this->structure_objects);
1091 $parent_id = $this->structure_objects[
$cnt - 1]->getId();
1092 if ($this->lm_page_object->isAlias())
1094 $this->pg_into_tree[$parent_id][] = array(
"type" =>
"pg_alias",
"id" => $this->lm_page_object->getOriginId());
1098 $this->pg_into_tree[$parent_id][] = array(
"type" =>
"pg",
"id" => $this->lm_page_object->getId());
1102 unset($this->page_object);
1103 unset($this->lm_page_object);
1104 unset ($this->container[count($this->container) - 1]);
1108 $this->in_media_object =
false;
1113 if(empty($this->mob_mapping[$this->media_object->getImportId()]))
1120 $this->media_object->create(
true,
false);
1125 if ($this->media_object->containsIntLink())
1128 $this->mobs_with_int_links[] = $this->media_object->getId();
1131 $this->mob_mapping[$this->media_object->getImportId()]
1132 = $this->media_object->getId();
1139 $this->media_object->setId($this->mob_mapping[$this->media_object->getImportId()]);
1146 if (!$this->media_object->isAlias())
1149 $this->media_object->update();
1154 if ($this->media_object->containsIntLink())
1157 $this->mobs_with_int_links[] = $this->media_object->getId();
1163 if ($this->in_page_object || $this->in_glossary_definition)
1165 $this->page_object->appendXMLContent($this->media_object->getXML(
IL_MODE_ALIAS));
1172 case "MediaAliasItem":
1173 $this->in_media_item =
false;
1174 $this->media_object->addMediaItem($this->media_item);
1179 $this->in_map_area =
false;
1180 $this->media_item->addMapArea($this->map_area);
1184 $this->in_properties =
false;
1185 if ($this->content_object->getType() ==
"lm"
1186 || $this->content_object->getType() ==
"dbk")
1188 $this->content_object->update();
1193 $this->in_meta_data =
false;
1194 if(strtolower(get_class($this->current_object)) ==
"illmpageobject" && !$this->in_media_object)
1197 if (is_object($this->lm_page_object))
1200 $this->current_object->MDUpdateListener(
'General');
1202 $this->current_object->getImportId());
1205 else if((strtolower(get_class($this->current_object)) ==
"ilobjquestionpool" ||
1206 strtolower(get_class($this->current_object)) ==
"ilobjtest") &&
1212 if ($this->metadata_parsing_disabled)
1218 if ($this->in_page_object)
1220 $this->page_object->MDUpdateListener(
'General');
1222 $this->page_object->getImportId());
1226 $this->current_object->MDUpdateListener(
'General');
1228 $this->current_object->getImportId());
1232 else if(strtolower(get_class($this->current_object)) ==
"ilstructureobject")
1235 $cnt = count($this->structure_objects);
1238 $parent_id = $this->structure_objects[
$cnt - 2]->getId();
1242 $parent_id = $this->lm_tree->getRootId();
1247 $this->st_into_tree[] = array (
"id" => $this->current_object->getId(),
1248 "parent" => $parent_id);
1251 $this->current_object->MDUpdateListener(
'General');
1253 $this->current_object->getImportId());
1255 else if(strtolower(get_class($this->current_object)) ==
"ilobjdlbook" || strtolower(get_class($this->current_object)) ==
"ilobjlearningmodule" ||
1256 strtolower(get_class($this->current_object)) ==
"ilobjcontentobject" ||
1257 (strtolower(get_class($this->current_object)) ==
"ilobjglossary" &&
$this->in_glossary))
1262 else if(strtolower(get_class($this->current_object)) ==
"ilglossarydefinition" && !$this->in_media_object)
1267 $this->page_object->setId($this->glossary_definition->getId());
1268 $this->page_object->updateFromXML();
1275 if(strtolower(get_class($this->current_object)) ==
"ilobjlearningmodule" ||
1276 strtolower(get_class($this->current_object)) ==
"ilobjdlbook" ||
1277 strtolower(get_class($this->current_object)) ==
"ilobjglossary")
1279 if (strtolower(get_class($this->current_object)) ==
"ilobjglossary" &&
1280 $this->content_object->getType() !=
"glo")
1283 $this->current_object->setTitle($this->content_object->getTitle().
" - ".
1284 $this->lng->txt(
"glossary"));
1287 $this->current_object->MDUpdateListener(
'General');
1296 if ($this->in_media_object)
1299 $this->media_object->MDUpdateListener(
'General');
1302 if ($this->in_glossary_definition)
1304 $this->glossary_definition->MDUpdateListener(
'General');
1309 case "Meta-Metadata":
1310 $this->in_meta_meta_data =
false;
1314 $this->in_file_item =
false;
1316 if ($this->file_item->getImportId($a_attribs[
"Entry"] !=
""))
1318 $this->file_item->update();
1322 case "Bibliography":
1324 $this->in_bib_item =
false;
1327 $nested->import($this->bib_item->getXMLContent(),$this->content_object->getId(),
"bib");
1331 unset ($this->container[count($this->container) - 1]);
1335 $this->in_glossary =
false;
1338 case "GlossaryTerm":
1339 $this->glossary_term->setTerm(trim($this->chr_data));
1340 $this->glossary_term->create();
1344 $this->inside_code =
false;
1348 $this->in_glossary_definition =
false;
1349 $this->page_object->updateFromXML();
1350 $this->page_object->buildDom();
1351 $this->glossary_definition->setShortText($this->page_object->getFirstParagraphText());
1352 $this->glossary_definition->update();
1355 if ($this->page_object->containsIntLink())
1358 $this->pages_to_parse[
"gdf:".$this->page_object->getId()] =
"gdf:".$this->page_object->getId();
1360 if ($this->page_object->needsImportParsing())
1362 $this->pages_to_parse[
"gdf:".$this->page_object->getId()] =
"gdf:".$this->page_object->getId();
1367 if ($this->in_media_item)
1369 $this->media_item->setFormat(trim($this->chr_data));
1371 if ($this->in_file_item)
1373 $this->file_item->setFileType(trim($this->chr_data));
1378 if (!$this->in_media_object)
1380 $this->current_object->setTitle(trim($this->chr_data));
1385 $this->media_object->setTitle(trim($this->chr_data));
1397 if (is_object($this->bib_item))
1399 $this->bib_item->setLanguage(trim($this->chr_data));
1408 if ($this->in_media_object)
1410 $this->media_item->setCaption(trim($this->chr_data));
1417 if ($this->in_media_item)
1419 $this->media_item->setLocationType($this->loc_type);
1420 if ($this->loc_type ==
"Reference")
1422 $this->media_item->setLocation(str_replace(
"&",
"&", trim($this->chr_data)));
1426 $this->media_item->setLocation(trim($this->chr_data));
1430 if ($this->in_file_item)
1433 $this->file_item->setFileName(trim($this->chr_data));
1437 if ($this->file_item->getType() ==
"file" &&
1438 is_int(strpos($this->chr_data,
"&")) &&
1439 is_int(strpos($this->chr_data,
";")))
1441 $imp_dir = $this->content_object->getImportDirectory();
1442 $source_dir = $imp_dir.
"/".$this->subdir.
"/objects/".
1443 $this->file_item->getImportId();
1446 if (
$dir = opendir($source_dir))
1448 while (
false !== (
$file = readdir(
$dir)))
1452 $this->file_item->setFileName(
$file);
1460 $this->file_item->setTitle(trim($this->chr_data));
1466 $this->chr_data =
"";
1483 if ($this->in_media_object && $this->media_meta_start)
1485 $this->media_meta_cache[] =
1486 array(
"type" =>
"handlerCharacterData",
"par1" => $a_data);
1498 $a_data = str_replace(
"<",
"<",$a_data);
1499 $a_data = str_replace(
">",
">",$a_data);
1503 $a_data = preg_replace(
"/\n/",
"",$a_data);
1504 if (!$this->inside_code)
1506 $a_data = preg_replace(
"/\t+/",
"",$a_data);
1509 $this->chr_data .= $a_data;
1511 if(!empty($a_data) || $a_data ===
"0")
1515 if (($this->in_page_object || $this->in_glossary_definition)
1516 && !$this->in_meta_data && !$this->in_media_object)
1518 $this->page_object->appendXMLContent($a_data);
1521 if ($this->in_meta_data)
1527 if ($this->in_bib_item )
1529 $this->bib_item->appendXMLContent($a_data);
1537 if($this->in_map_area)
1539 $this->map_area->appendTitle($a_data);
1555 foreach ($this->media_meta_cache as $cache_entry)
1557 switch($cache_entry[
"type"])
1559 case "handlerBeginTag":
1561 $cache_entry[
"par1"], $cache_entry[
"par2"]);
1564 case "handlerEndTag":
1566 $cache_entry[
"par1"]);
1569 case "handlerCharacterData":
1571 $cache_entry[
"par1"]);
1576 $this->media_meta_start =
false;
1577 $this->media_meta_cache[] = array();