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");
21 include_once(
"Services/MetaData/classes/class.ilMDSaxParser.php");
22 include_once(
"Services/MetaData/classes/class.ilMD.php");
90 $this->current_element = array();
91 $this->structure_objects = array();
92 $this->content_object =& $a_content_object;
94 $this->st_into_tree = array();
95 $this->pg_into_tree = array();
96 $this->pages_to_parse = array();
97 $this->mobs_with_int_links = array();
98 $this->mob_mapping = array();
99 $this->file_item_mapping = array();
100 $this->pg_mapping = array();
101 $this->link_targets = array();
102 $this->subdir = $a_subdir;
104 $this->tree =&
$tree;
105 $this->inside_code =
false;
106 $this->qst_mapping = array();
107 $this->coType = $this->content_object->getType();
108 $this->metadata_parsing_disabled =
false;
110 if (($this->coType !=
"tst") and ($this->coType !=
"qpl"))
112 $this->lm_tree =
new ilTree($this->content_object->getId());
114 $this->lm_tree->setTableNames(
'lm_tree',
'lm_data');
128 xml_set_object($a_xml_parser,$this);
129 xml_set_element_handler($a_xml_parser,
'handlerBeginTag',
'handlerEndTag');
130 xml_set_character_data_handler($a_xml_parser,
'handlerCharacterData');
160 foreach($this->st_into_tree as $st)
163 $this->lm_tree->insertNode($st[
"id"], $st[
"parent"]);
165 if (is_array($this->pg_into_tree[$st[
"id"]]))
167 foreach($this->pg_into_tree[$st[
"id"]] as $pg)
172 if ($this->pg_mapping[$pg[
"id"]] ==
"")
174 $ilLog->write(
"LM Import: No PageObject for PageAlias ".
175 $pg[
"id"].
" found! (Please update export installation to ILIAS 3.3.0)");
180 $pg_id = $this->pg_mapping[$pg[
"id"]];
187 if (!$this->lm_tree->isInTree($pg_id))
189 $this->lm_tree->insertNode($pg_id, $st[
"id"]);
212 foreach($this->pages_to_parse as $page_id)
214 $page_arr = explode(
":", $page_id);
219 $page_obj =&
new ilPageObject($this->content_object->getType(), $page_arr[1]);
226 $page_obj->buildDom();
227 $page_obj->resolveIntLinks();
228 $page_obj->update(
false);
230 if ($page_arr[0] ==
"gdf")
233 $def->updateShortText();
241 foreach($this->mobs_with_int_links as $mob_id)
249 foreach ($this->link_targets as $link_target)
252 $link_arr = explode(
"_", $link_target);
253 $target_inst = $link_arr[1];
257 foreach($sources as
$key => $source)
260 if(in_array(
$key, $done))
264 $type_arr = explode(
":", $source[
"type"]);
267 if ($type_arr[1] ==
"pg")
276 if ($type_arr[0] ==
"qst")
278 require_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
282 if ($type_arr[0] ==
"sqst")
284 require_once
"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
298 $imp_dir = $this->content_object->getImportDirectory();
299 foreach ($this->mob_mapping as $origin_id => $mob_id)
301 if(empty($origin_id))
317 $obj_dir = $origin_id;
318 $source_dir = $imp_dir.
"/".$this->subdir.
"/objects/".$obj_dir;
322 if (@is_dir($source_dir))
329 if (@is_dir($target_dir))
342 $imp_dir = $this->content_object->getImportDirectory();
343 foreach ($this->file_item_mapping as $origin_id => $file_id)
345 if(empty($origin_id))
349 $obj_dir = $origin_id;
350 $source_dir = $imp_dir.
"/".$this->subdir.
"/objects/".$obj_dir;
352 include_once(
"./Modules/File/classes/class.ilObjFile.php");
353 $file_obj =
new ilObjFile($file_id,
false);
355 $target_dir = $file_obj->getDirectory();
356 if (@is_dir($source_dir))
363 if (@is_dir($target_dir))
368 $test = $file_obj->determineFilesize();
378 $this->qst_mapping = $a_map;
387 if(!isset($this->status[
"$a_name"]))
389 $this->cnt[$a_name] == 1;
393 $this->cnt[$a_name]++;
395 $this->current_element[count($this->current_element)] = $a_name;
405 $this->cnt[$a_name]--;
406 unset ($this->current_element[count($this->current_element) - 1]);
414 return ($this->current_element[count($this->current_element) - 1]);
424 if (isset($this->cnt[$a_name]))
426 return $this->cnt[$a_name];
453 while (list($k,$v) = each($attr))
454 $tag.=
" ".$k.
"=\"$v\"";
474 case "ContentObject":
477 if ($a_attribs[
"Type"] ==
"Glossary")
483 case "StructureObject":
485 $this->structure_objects[count($this->structure_objects)]
487 $this->current_object =& $this->structure_objects[count($this->structure_objects) - 1];
488 $this->current_object->setLMId($this->content_object->getId());
492 $this->current_object->create(
true);
496 $this->in_page_object =
true;
498 if (($this->coType !=
"tst") and ($this->coType !=
"qpl"))
500 $this->lm_page_object =&
new ilLMPageObject($this->content_object);
501 $this->page_object =&
new ilPageObject($this->content_object->getType());
502 $this->lm_page_object->setLMId($this->content_object->getId());
503 $this->lm_page_object->assignPageObject($this->page_object);
513 if (($this->coType !=
"tst") and ($this->coType !=
"qpl"))
515 $this->lm_page_object->setAlias(
true);
516 $this->lm_page_object->setOriginID($a_attribs[
"OriginId"]);
521 $this->in_media_object =
true;
522 $this->media_meta_start =
true;
523 $this->media_meta_cache = array();
529 $this->media_object->setAlias(
true);
530 $this->media_object->setImportId($a_attribs[
"OriginId"]);
531 if (is_object($this->page_object))
533 $this->page_object->needsImportParsing(
true);
538 case "MediaAliasItem":
539 $this->in_media_item =
true;
541 $this->media_item->setPurpose($a_attribs[
"Purpose"]);
545 if (is_object($this->media_object) && $this->in_media_object)
547 $this->media_item->setWidth($a_attribs[
"Width"]);
548 $this->media_item->setHeight($a_attribs[
"Height"]);
549 $this->media_item->setHAlign($a_attribs[
"HorizontalAlign"]);
554 if (is_object($this->media_object) && $this->in_media_object)
556 $this->media_item->setParameter($a_attribs[
"Name"], $a_attribs[
"Value"]);
561 $this->in_map_area =
true;
563 $this->map_area->setShape($a_attribs[
"Shape"]);
564 $this->map_area->setCoords($a_attribs[
"Coords"]);
568 $this->in_glossary =
true;
569 if ($this->content_object->getType() !=
"glo")
572 $this->glossary_object->setTitle(
"");
573 $this->glossary_object->setDescription(
"");
574 $this->glossary_object->create(
true);
575 $this->glossary_object->createReference();
576 $parent =& $this->tree->getParentNodeData($this->content_object->getRefId());
577 $this->glossary_object->putInTree($parent[
"child"]);
578 $this->glossary_object->setPermissions($parent[
"child"]);
579 $this->glossary_object->notify(
"new",
$_GET[
"ref_id"],
$_GET[
"parent_non_rbac_id"],
$_GET[
"ref_id"],$this->glossary_object->getRefId());
586 $this->glossary_term->setGlossaryId($this->glossary_object->getId());
587 $this->glossary_term->setLanguage($a_attribs[
"Language"]);
588 $this->glossary_term->setImportId($a_attribs[
"Id"]);
589 $this->link_targets[$a_attribs[
"Id"]] = $a_attribs[
"Id"];
593 $this->in_glossary_definition =
true;
596 $this->page_object->setParentId($this->glossary_term->getGlossaryId());
597 $this->glossary_definition->setTermId($this->glossary_term->getId());
598 $this->glossary_definition->assignPageObject($this->page_object);
599 $this->current_object =& $this->glossary_definition;
600 $this->glossary_definition->create(
true);
604 $this->in_file_item =
true;
606 $this->file_item->setTitle(
"dummy");
607 $this->file_item->setMode(
"filelist");
608 if (is_object($this->page_object))
610 $this->page_object->needsImportParsing(
true);
615 if ($a_attribs[
"Characteristic"] ==
"Code")
617 $this->inside_code =
true;
622 $this->in_properties =
true;
626 if ($this->content_object->getType() ==
"lm"
627 || $this->content_object->getType() ==
"dbk")
629 switch($a_attribs[
"Name"])
632 $this->content_object->setLayout($a_attribs[
"Value"]);
636 $this->content_object->setPageHeader($a_attribs[
"Value"]);
640 $this->content_object->setTOCMode($a_attribs[
"Value"]);
644 $this->content_object->setActiveLMMenu(
648 case "ActiveNumbering":
649 $this->content_object->setActiveNumbering(
654 $this->content_object->setActiveTOC(
658 case "ActivePrintView":
659 $this->content_object->setActivePrintView(
664 $this->content_object->setCleanFrames(
669 $this->content_object->setPublicNotes(
673 case "HistoryUserComments":
674 $this->content_object->setHistoryUserComments(
679 if ($a_attribs[
"Value"] !=
"")
681 if ($this->pg_mapping[$a_attribs[
"Value"]] > 0)
683 $this->content_object->setHeaderPage(
684 $this->pg_mapping[$a_attribs[
"Value"]]);
690 if ($a_attribs[
"Value"] !=
"")
692 if ($this->pg_mapping[$a_attribs[
"Value"]] > 0)
694 $this->content_object->setFooterPage(
695 $this->pg_mapping[$a_attribs[
"Value"]]);
708 $this->in_meta_data =
true;
713 if(!$this->in_media_object)
715 if (($this->coType !=
"tst") and ($this->coType !=
"qpl"))
718 if ($this->current_object->getType() ==
"st" ||
719 $this->current_object->getType() ==
"pg")
722 if ($this->current_object->getType() ==
"pg")
724 $this->lm_page_object->create(
true);
726 $this->md =&
new ilMD($this->content_object->getId() ,
727 $this->current_object->getId(),
728 $this->current_object->getType());
731 else if ($this->current_object->getType() ==
"gdf")
733 $this->md =&
new ilMD($this->glossary_object->getId() ,
734 $this->current_object->getId(),
735 $this->current_object->getType());
742 $this->md =&
new ilMD($this->current_object->getId() ,
744 $this->current_object->getType());
751 $this->md =&
new ilMD($this->content_object->getId() ,
753 $this->current_object->getType()
755 if ($this->md->getGeneral() !=
false)
757 $this->metadata_parsing_disabled =
true;
768 if (!$this->in_meta_meta_data)
770 if ($this->in_meta_data && !$this->in_glossary_definition)
772 if (!$this->in_media_object)
774 $this->current_object->setImportId($a_attribs[
"Entry"]);
776 $this->link_targets[$a_attribs[
"Entry"]] = $a_attribs[
"Entry"];
778 if ($this->in_file_item)
780 if ($this->file_item_mapping[$a_attribs[
"Entry"]] ==
"")
782 $this->file_item->create();
783 $this->file_item->setImportId($a_attribs[
"Entry"]);
784 $this->file_item_mapping[$a_attribs[
"Entry"]] = $this->file_item->getId();
787 if ($this->in_meta_data && $this->in_media_object)
791 $mob_id = $this->mob_mapping[$a_attribs[
"Entry"]];
803 $this->media_object->create(
true,
false);
804 $this->mob_mapping[$a_attribs[
"Entry"]]
805 = $this->media_object->getId();
807 $this->media_object->setImportId($a_attribs[
"Entry"]);
808 $this->md =&
new ilMD(0 ,
809 $this->media_object->getId(),
816 case "Meta-Metadata":
817 $this->in_meta_meta_data =
true;
822 if (is_object($this->page_object))
824 $this->page_object->setContainsIntLink(
true);
826 if ($this->in_map_area)
830 $this->map_area->setTarget($a_attribs[
"Target"]);
831 $this->map_area->setType($a_attribs[
"Type"]);
832 $this->map_area->setTargetFrame($a_attribs[
"TargetFrame"]);
833 if (is_object($this->media_object))
836 $this->media_object->setContainsIntLink(
true);
843 if ($this->in_map_area)
846 $this->map_area->setHref($a_attribs[
"Href"]);
847 $this->map_area->setExtTitle($a_attribs[
"Title"]);
853 $this->cur_qid = $a_attribs[
"QRef"];
857 $this->loc_type = $a_attribs[
"Type"];
861 $this->in_bib_item =
true;
870 if(($this->in_page_object || $this->in_glossary_definition)
871 && !$this->in_meta_data && !$this->in_media_object)
873 if ($a_name ==
"Definition")
875 $app_name =
"PageObject";
876 $app_attribs = array();
881 $app_attribs = $a_attribs;
885 if ($this->in_file_item && $app_name ==
"Identifier")
887 $app_attribs[
"Entry"] =
"il__file_".$this->file_item_mapping[$a_attribs[
"Entry"]];
891 $this->page_object->appendXMLContent($this->
buildTag(
"start", $app_name, $app_attribs));
896 if ($this->in_bib_item)
898 $this->bib_item->appendXMLContent(
"\n".$this->
buildTag(
"start", $a_name, $a_attribs));
908 if ($this->in_media_object && $this->media_meta_start)
910 $this->media_meta_cache[] =
911 array(
"type" =>
"handlerBeginTag",
"par1" => $a_name,
"par2" => $a_attribs);
915 if ($a_name ==
"Identifier")
917 if (!$this->in_media_object)
919 $a_attribs[
"Entry"] =
"il__".$this->current_object->getType().
920 "_".$this->current_object->getId();
924 $a_attribs[
"Entry"] =
"il__mob".
925 "_".$this->media_object->getId();
927 $a_attribs[
"Catalog"] =
"ILIAS";
942 if ($this->content_object->getType() ==
"glo" &&
943 $this->in_glossary && !$this->in_media_object
944 && !$this->in_glossary_definition)
967 if ($this->in_media_object && $this->media_meta_start)
969 $this->media_meta_cache[] =
970 array(
"type" =>
"handlerEndTag",
"par1" => $a_name);
980 if (($this->in_page_object || $this->in_glossary_definition)
981 && !$this->in_meta_data && !$this->in_media_object)
983 $app_name = ($a_name ==
"Definition")
986 $this->page_object->appendXMLContent($this->
buildTag(
"end", $app_name));
990 if ($this->in_bib_item)
992 if($a_name ==
"BibItem")
994 $this->bib_item->appendXMLContent(
"\n".$this->
buildTag(
"end", $a_name));
998 $this->bib_item->appendXMLContent($this->
buildTag(
"end", $a_name));
1005 case "StructureObject":
1007 unset($this->structure_objects[count($this->structure_objects) - 1]);
1012 $this->in_page_object =
false;
1013 if (($this->coType !=
"tst") and ($this->coType !=
"qpl"))
1015 if (!$this->lm_page_object->isAlias())
1018 $this->page_object->updateFromXML();
1019 $this->pg_mapping[$this->lm_page_object->getImportId()]
1020 = $this->lm_page_object->getId();
1023 if ($this->page_object->containsIntLink())
1025 $this->pages_to_parse[
"lm:".$this->page_object->getId()] =
"lm:".$this->page_object->getId();
1029 if ($this->page_object->needsImportParsing())
1031 $this->pages_to_parse[
"lm:".$this->page_object->getId()] =
"lm:".$this->page_object->getId();
1038 $xml = $this->page_object->getXMLContent();
1039 if ($this->cur_qid !=
"")
1041 $ids = $this->qst_mapping[$this->cur_qid];
1042 if ($ids[
"pool"] > 0)
1046 $xmlcontent = str_replace($this->cur_qid,
1047 "il__qst_".$ids[
"pool"], $xml);
1048 $page->setXMLContent($xmlcontent);
1049 $page->saveMobUsage($xmlcontent);
1050 $page->updateFromXML();
1053 if ($ids[
"test"] > 0)
1057 $xmlcontent = str_replace($this->cur_qid,
1058 "il__qst_".$ids[
"test"], $xml);
1059 $page->setXMLContent($xmlcontent);
1060 $page->saveMobUsage($xmlcontent);
1061 $page->updateFromXML();
1068 $cnt = count($this->structure_objects);
1071 $parent_id = $this->structure_objects[
$cnt - 1]->getId();
1072 if ($this->lm_page_object->isAlias())
1074 $this->pg_into_tree[$parent_id][] = array(
"type" =>
"pg_alias",
"id" => $this->lm_page_object->getOriginId());
1078 $this->pg_into_tree[$parent_id][] = array(
"type" =>
"pg",
"id" => $this->lm_page_object->getId());
1082 unset($this->page_object);
1083 unset($this->lm_page_object);
1084 unset ($this->container[count($this->container) - 1]);
1088 $this->in_media_object =
false;
1093 if(empty($this->mob_mapping[$this->media_object->getImportId()]))
1100 $this->media_object->create(
true,
false);
1105 if ($this->media_object->containsIntLink())
1108 $this->mobs_with_int_links[] = $this->media_object->getId();
1111 $this->mob_mapping[$this->media_object->getImportId()]
1112 = $this->media_object->getId();
1119 $this->media_object->setId($this->mob_mapping[$this->media_object->getImportId()]);
1126 if (!$this->media_object->isAlias())
1129 $this->media_object->update();
1134 if ($this->media_object->containsIntLink())
1137 $this->mobs_with_int_links[] = $this->media_object->getId();
1143 if ($this->in_page_object || $this->in_glossary_definition)
1145 $this->page_object->appendXMLContent($this->media_object->getXML(
IL_MODE_ALIAS));
1152 case "MediaAliasItem":
1153 $this->in_media_item =
false;
1154 $this->media_object->addMediaItem($this->media_item);
1159 $this->in_map_area =
false;
1160 $this->media_item->addMapArea($this->map_area);
1164 $this->in_properties =
false;
1165 if ($this->content_object->getType() ==
"lm"
1166 || $this->content_object->getType() ==
"dbk")
1168 $this->content_object->update();
1173 $this->in_meta_data =
false;
1174 if(strtolower(get_class($this->current_object)) ==
"illmpageobject" && !$this->in_media_object)
1177 if (is_object($this->lm_page_object))
1180 $this->current_object->MDUpdateListener(
'General');
1182 $this->current_object->getImportId());
1185 else if((strtolower(get_class($this->current_object)) ==
"ilobjquestionpool" ||
1186 strtolower(get_class($this->current_object)) ==
"ilobjtest") &&
1192 if ($this->metadata_parsing_disabled)
1198 if ($this->in_page_object)
1200 $this->page_object->MDUpdateListener(
'General');
1202 $this->page_object->getImportId());
1206 $this->current_object->MDUpdateListener(
'General');
1208 $this->current_object->getImportId());
1212 else if(strtolower(get_class($this->current_object)) ==
"ilstructureobject")
1215 $cnt = count($this->structure_objects);
1218 $parent_id = $this->structure_objects[
$cnt - 2]->getId();
1222 $parent_id = $this->lm_tree->getRootId();
1227 $this->st_into_tree[] = array (
"id" => $this->current_object->getId(),
1228 "parent" => $parent_id);
1231 $this->current_object->MDUpdateListener(
'General');
1233 $this->current_object->getImportId());
1235 else if(strtolower(get_class($this->current_object)) ==
"ilobjdlbook" || strtolower(get_class($this->current_object)) ==
"ilobjlearningmodule" ||
1236 strtolower(get_class($this->current_object)) ==
"ilobjcontentobject" ||
1237 (strtolower(get_class($this->current_object)) ==
"ilobjglossary" &&
$this->in_glossary))
1242 else if(strtolower(get_class($this->current_object)) ==
"ilglossarydefinition" && !$this->in_media_object)
1247 $this->page_object->setId($this->glossary_definition->getId());
1248 $this->page_object->updateFromXML();
1255 if(strtolower(get_class($this->current_object)) ==
"ilobjlearningmodule" ||
1256 strtolower(get_class($this->current_object)) ==
"ilobjdlbook" ||
1257 strtolower(get_class($this->current_object)) ==
"ilobjglossary")
1259 if (strtolower(get_class($this->current_object)) ==
"ilobjglossary" &&
1260 $this->content_object->getType() !=
"glo")
1263 $this->current_object->setTitle($this->content_object->getTitle().
" - ".
1264 $this->lng->txt(
"glossary"));
1267 $this->current_object->MDUpdateListener(
'General');
1276 if ($this->in_media_object)
1279 $this->media_object->MDUpdateListener(
'General');
1282 if ($this->in_glossary_definition)
1284 $this->glossary_definition->MDUpdateListener(
'General');
1289 case "Meta-Metadata":
1290 $this->in_meta_meta_data =
false;
1294 $this->in_file_item =
false;
1296 if ($this->file_item->getImportId($a_attribs[
"Entry"] !=
""))
1298 $this->file_item->update();
1302 case "Bibliography":
1304 $this->in_bib_item =
false;
1307 $nested->import($this->bib_item->getXMLContent(),$this->content_object->getId(),
"bib");
1311 unset ($this->container[count($this->container) - 1]);
1315 $this->in_glossary =
false;
1318 case "GlossaryTerm":
1319 $this->glossary_term->setTerm(trim($this->chr_data));
1320 $this->glossary_term->create();
1324 $this->inside_code =
false;
1328 $this->in_glossary_definition =
false;
1329 $this->page_object->updateFromXML();
1330 $this->page_object->buildDom();
1331 $this->glossary_definition->setShortText($this->page_object->getFirstParagraphText());
1332 $this->glossary_definition->update();
1335 if ($this->page_object->containsIntLink())
1338 $this->pages_to_parse[
"gdf:".$this->page_object->getId()] =
"gdf:".$this->page_object->getId();
1340 if ($this->page_object->needsImportParsing())
1342 $this->pages_to_parse[
"gdf:".$this->page_object->getId()] =
"gdf:".$this->page_object->getId();
1347 if ($this->in_media_item)
1349 $this->media_item->setFormat(trim($this->chr_data));
1351 if ($this->in_file_item)
1353 $this->file_item->setFileType(trim($this->chr_data));
1358 if (!$this->in_media_object)
1360 $this->current_object->setTitle(trim($this->chr_data));
1365 $this->media_object->setTitle(trim($this->chr_data));
1377 if (is_object($this->bib_item))
1379 $this->bib_item->setLanguage(trim($this->chr_data));
1388 if ($this->in_media_object)
1390 $this->media_item->setCaption(trim($this->chr_data));
1394 case "TextRepresentation":
1395 if ($this->in_media_object)
1397 $this->media_item->setTextRepresentation(trim($this->chr_data));
1404 if ($this->in_media_item)
1406 $this->media_item->setLocationType($this->loc_type);
1407 if ($this->loc_type ==
"Reference")
1409 $this->media_item->setLocation(str_replace(
"&",
"&", trim($this->chr_data)));
1413 $this->media_item->setLocation(trim($this->chr_data));
1417 if ($this->in_file_item)
1420 $this->file_item->setFileName(trim($this->chr_data));
1424 if ($this->file_item->getType() ==
"file" &&
1425 is_int(strpos($this->chr_data,
"&")) &&
1426 is_int(strpos($this->chr_data,
";")))
1428 $imp_dir = $this->content_object->getImportDirectory();
1429 $source_dir = $imp_dir.
"/".$this->subdir.
"/objects/".
1430 $this->file_item->getImportId();
1433 if (
$dir = opendir($source_dir))
1435 while (
false !== (
$file = readdir(
$dir)))
1439 $this->file_item->setFileName(
$file);
1447 $this->file_item->setTitle(trim($this->chr_data));
1453 $this->chr_data =
"";
1470 if ($this->in_media_object && $this->media_meta_start)
1472 $this->media_meta_cache[] =
1473 array(
"type" =>
"handlerCharacterData",
"par1" => $a_data);
1485 $a_data = str_replace(
"<",
"<",$a_data);
1486 $a_data = str_replace(
">",
">",$a_data);
1490 $a_data = preg_replace(
"/\n/",
"",$a_data);
1491 if (!$this->inside_code)
1493 $a_data = preg_replace(
"/\t+/",
"",$a_data);
1496 $this->chr_data .= $a_data;
1498 if(!empty($a_data) || $a_data ===
"0")
1502 if (($this->in_page_object || $this->in_glossary_definition)
1503 && !$this->in_meta_data && !$this->in_media_object)
1505 $this->page_object->appendXMLContent($a_data);
1508 if ($this->in_meta_data)
1514 if ($this->in_bib_item )
1516 $this->bib_item->appendXMLContent($a_data);
1524 if($this->in_map_area)
1526 $this->map_area->appendTitle($a_data);
1542 foreach ($this->media_meta_cache as $cache_entry)
1544 switch($cache_entry[
"type"])
1546 case "handlerBeginTag":
1548 $cache_entry[
"par1"], $cache_entry[
"par2"]);
1551 case "handlerEndTag":
1553 $cache_entry[
"par1"]);
1556 case "handlerCharacterData":
1558 $cache_entry[
"par1"]);
1563 $this->media_meta_start =
false;
1564 $this->media_meta_cache[] = array();