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->resolveIIMMediaAliases($this->mob_mapping);
229 if (in_array($this->coType, array(
"lm",
"dbk")))
231 $page_obj->resolveQuestionReferences($this->qst_mapping);
233 $page_obj->update(
false);
235 if ($page_arr[0] ==
"gdf")
238 $def->updateShortText();
246 foreach($this->mobs_with_int_links as $mob_id)
254 foreach ($this->link_targets as $link_target)
257 $link_arr = explode(
"_", $link_target);
258 $target_inst = $link_arr[1];
262 foreach($sources as $key => $source)
265 if(in_array($key, $done))
269 $type_arr = explode(
":", $source[
"type"]);
272 if ($type_arr[1] ==
"pg")
281 if ($type_arr[0] ==
"qst")
283 require_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
287 if ($type_arr[0] ==
"sqst")
289 require_once
"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
303 $imp_dir = $this->content_object->getImportDirectory();
305 foreach ($this->mob_mapping as $origin_id => $mob_id)
307 if(empty($origin_id))
323 $obj_dir = $origin_id;
324 $source_dir = $imp_dir.
"/".$this->subdir.
"/objects/".$obj_dir;
328 if (@is_dir($source_dir))
335 if (@is_dir($target_dir))
348 $imp_dir = $this->content_object->getImportDirectory();
349 foreach ($this->file_item_mapping as $origin_id => $file_id)
351 if(empty($origin_id))
355 $obj_dir = $origin_id;
356 $source_dir = $imp_dir.
"/".$this->subdir.
"/objects/".$obj_dir;
358 include_once(
"./Modules/File/classes/class.ilObjFile.php");
359 $file_obj =
new ilObjFile($file_id,
false);
361 $target_dir = $file_obj->getDirectory();
362 if (@is_dir($source_dir))
369 if (@is_dir($target_dir))
374 $test = $file_obj->determineFilesize();
384 $this->qst_mapping = $a_map;
393 if(!isset($this->status[
"$a_name"]))
395 $this->cnt[$a_name] == 1;
399 $this->cnt[$a_name]++;
401 $this->current_element[count($this->current_element)] = $a_name;
411 $this->cnt[$a_name]--;
412 unset ($this->current_element[count($this->current_element) - 1]);
420 return ($this->current_element[count($this->current_element) - 1]);
430 if (isset($this->cnt[$a_name]))
432 return $this->cnt[$a_name];
459 while (list($k,$v) = each($attr))
460 $tag.=
" ".$k.
"=\"$v\"";
480 case "ContentObject":
483 if ($a_attribs[
"Type"] ==
"Glossary")
489 case "StructureObject":
491 $this->structure_objects[count($this->structure_objects)]
493 $this->current_object =& $this->structure_objects[count($this->structure_objects) - 1];
494 $this->current_object->setLMId($this->content_object->getId());
498 $this->current_object->create(
true);
502 $this->in_page_object =
true;
504 if (($this->coType !=
"tst") and ($this->coType !=
"qpl"))
506 $this->lm_page_object =&
new ilLMPageObject($this->content_object);
507 $this->page_object =&
new ilPageObject($this->content_object->getType());
508 $this->lm_page_object->setLMId($this->content_object->getId());
509 $this->lm_page_object->assignPageObject($this->page_object);
519 if (($this->coType !=
"tst") and ($this->coType !=
"qpl"))
521 $this->lm_page_object->setAlias(
true);
522 $this->lm_page_object->setOriginID($a_attribs[
"OriginId"]);
527 $this->in_media_object =
true;
528 $this->media_meta_start =
true;
529 $this->media_meta_cache = array();
535 $this->media_object->setAlias(
true);
536 $this->media_object->setImportId($a_attribs[
"OriginId"]);
537 if (is_object($this->page_object))
539 $this->page_object->needsImportParsing(
true);
544 case "MediaAliasItem":
545 $this->in_media_item =
true;
547 $this->media_item->setPurpose($a_attribs[
"Purpose"]);
551 if (is_object($this->media_object) && $this->in_media_object)
553 $this->media_item->setWidth($a_attribs[
"Width"]);
554 $this->media_item->setHeight($a_attribs[
"Height"]);
555 $this->media_item->setHAlign($a_attribs[
"HorizontalAlign"]);
560 if (is_object($this->media_object) && $this->in_media_object)
562 $this->media_item->setParameter($a_attribs[
"Name"], $a_attribs[
"Value"]);
567 $this->in_map_area =
true;
569 $this->map_area->setShape($a_attribs[
"Shape"]);
570 $this->map_area->setCoords($a_attribs[
"Coords"]);
574 $this->in_glossary =
true;
575 if ($this->content_object->getType() !=
"glo")
578 $this->glossary_object->setTitle(
"");
579 $this->glossary_object->setDescription(
"");
580 $this->glossary_object->create(
true);
581 $this->glossary_object->createReference();
582 $parent =& $this->tree->getParentNodeData($this->content_object->getRefId());
583 $this->glossary_object->putInTree($parent[
"child"]);
584 $this->glossary_object->setPermissions($parent[
"child"]);
585 $this->glossary_object->notify(
"new",
$_GET[
"ref_id"],
$_GET[
"parent_non_rbac_id"],
$_GET[
"ref_id"],$this->glossary_object->getRefId());
592 $this->glossary_term->setGlossaryId($this->glossary_object->getId());
593 $this->glossary_term->setLanguage($a_attribs[
"Language"]);
594 $this->glossary_term->setImportId($a_attribs[
"Id"]);
595 $this->link_targets[$a_attribs[
"Id"]] = $a_attribs[
"Id"];
599 $this->in_glossary_definition =
true;
602 $this->page_object->setParentId($this->glossary_term->getGlossaryId());
603 $this->glossary_definition->setTermId($this->glossary_term->getId());
604 $this->glossary_definition->assignPageObject($this->page_object);
605 $this->current_object =& $this->glossary_definition;
606 $this->glossary_definition->create(
true);
610 $this->in_file_item =
true;
612 $this->file_item->setTitle(
"dummy");
613 $this->file_item->setMode(
"filelist");
614 if (is_object($this->page_object))
616 $this->page_object->needsImportParsing(
true);
621 if ($a_attribs[
"Characteristic"] ==
"Code")
623 $this->inside_code =
true;
628 $this->in_properties =
true;
632 if ($this->content_object->getType() ==
"lm"
633 || $this->content_object->getType() ==
"dbk")
635 switch($a_attribs[
"Name"])
638 $this->content_object->setLayout($a_attribs[
"Value"]);
642 $this->content_object->setPageHeader($a_attribs[
"Value"]);
646 $this->content_object->setTOCMode($a_attribs[
"Value"]);
650 $this->content_object->setActiveLMMenu(
654 case "ActiveNumbering":
655 $this->content_object->setActiveNumbering(
660 $this->content_object->setActiveTOC(
664 case "ActivePrintView":
665 $this->content_object->setActivePrintView(
670 $this->content_object->setCleanFrames(
675 $this->content_object->setPublicNotes(
679 case "HistoryUserComments":
680 $this->content_object->setHistoryUserComments(
685 if ($a_attribs[
"Value"] !=
"")
687 if ($this->pg_mapping[$a_attribs[
"Value"]] > 0)
689 $this->content_object->setHeaderPage(
690 $this->pg_mapping[$a_attribs[
"Value"]]);
696 if ($a_attribs[
"Value"] !=
"")
698 if ($this->pg_mapping[$a_attribs[
"Value"]] > 0)
700 $this->content_object->setFooterPage(
701 $this->pg_mapping[$a_attribs[
"Value"]]);
714 $this->in_meta_data =
true;
719 if(!$this->in_media_object)
721 if (($this->coType !=
"tst") and ($this->coType !=
"qpl"))
724 if ($this->current_object->getType() ==
"st" ||
725 $this->current_object->getType() ==
"pg")
728 if ($this->current_object->getType() ==
"pg")
730 $this->lm_page_object->create(
true);
732 $this->md =&
new ilMD($this->content_object->getId() ,
733 $this->current_object->getId(),
734 $this->current_object->getType());
737 else if ($this->current_object->getType() ==
"gdf")
739 $this->md =&
new ilMD($this->glossary_object->getId() ,
740 $this->current_object->getId(),
741 $this->current_object->getType());
748 $this->md =&
new ilMD($this->current_object->getId() ,
750 $this->current_object->getType());
757 $this->md =&
new ilMD($this->content_object->getId() ,
759 $this->current_object->getType()
761 if ($this->md->getGeneral() !=
false)
763 $this->metadata_parsing_disabled =
true;
774 if (!$this->in_meta_meta_data)
776 if ($this->in_meta_data && !$this->in_glossary_definition)
778 if (!$this->in_media_object)
780 $this->current_object->setImportId($a_attribs[
"Entry"]);
782 $this->link_targets[$a_attribs[
"Entry"]] = $a_attribs[
"Entry"];
784 if ($this->in_file_item)
786 if ($this->file_item_mapping[$a_attribs[
"Entry"]] ==
"")
788 $this->file_item->create();
789 $this->file_item->setImportId($a_attribs[
"Entry"]);
790 $this->file_item_mapping[$a_attribs[
"Entry"]] = $this->file_item->getId();
793 if ($this->in_meta_data && $this->in_media_object)
797 $mob_id = $this->mob_mapping[$a_attribs[
"Entry"]];
809 $this->media_object->create(
true,
false);
810 $this->mob_mapping[$a_attribs[
"Entry"]]
811 = $this->media_object->getId();
813 $this->media_object->setImportId($a_attribs[
"Entry"]);
814 $this->md =&
new ilMD(0 ,
815 $this->media_object->getId(),
822 case "Meta-Metadata":
823 $this->in_meta_meta_data =
true;
828 if (is_object($this->page_object))
830 $this->page_object->setContainsIntLink(
true);
832 if ($this->in_map_area)
836 $this->map_area->setTarget($a_attribs[
"Target"]);
837 $this->map_area->setType($a_attribs[
"Type"]);
838 $this->map_area->setTargetFrame($a_attribs[
"TargetFrame"]);
839 if (is_object($this->media_object))
842 $this->media_object->setContainsIntLink(
true);
849 if ($this->in_map_area)
852 $this->map_area->setHref($a_attribs[
"Href"]);
853 $this->map_area->setExtTitle($a_attribs[
"Title"]);
859 $this->cur_qid = $a_attribs[
"QRef"];
860 $this->page_object->setContainsQuestion(
true);
864 $this->loc_type = $a_attribs[
"Type"];
868 $this->in_bib_item =
true;
877 if(($this->in_page_object || $this->in_glossary_definition)
878 && !$this->in_meta_data && !$this->in_media_object)
880 if ($a_name ==
"Definition")
882 $app_name =
"PageObject";
883 $app_attribs = array();
888 $app_attribs = $a_attribs;
892 if ($this->in_file_item && $app_name ==
"Identifier")
894 $app_attribs[
"Entry"] =
"il__file_".$this->file_item_mapping[$a_attribs[
"Entry"]];
898 $this->page_object->appendXMLContent($this->
buildTag(
"start", $app_name, $app_attribs));
903 if ($this->in_bib_item)
905 $this->bib_item->appendXMLContent(
"\n".$this->
buildTag(
"start", $a_name, $a_attribs));
915 if ($this->in_media_object && $this->media_meta_start)
917 $this->media_meta_cache[] =
918 array(
"type" =>
"handlerBeginTag",
"par1" => $a_name,
"par2" => $a_attribs);
922 if ($a_name ==
"Identifier")
924 if (!$this->in_media_object)
926 $a_attribs[
"Entry"] =
"il__".$this->current_object->getType().
927 "_".$this->current_object->getId();
931 $a_attribs[
"Entry"] =
"il__mob".
932 "_".$this->media_object->getId();
934 $a_attribs[
"Catalog"] =
"ILIAS";
949 if ($this->content_object->getType() ==
"glo" &&
950 $this->in_glossary && !$this->in_media_object
951 && !$this->in_glossary_definition)
974 if ($this->in_media_object && $this->media_meta_start)
976 $this->media_meta_cache[] =
977 array(
"type" =>
"handlerEndTag",
"par1" => $a_name);
987 if (($this->in_page_object || $this->in_glossary_definition)
988 && !$this->in_meta_data && !$this->in_media_object)
990 $app_name = ($a_name ==
"Definition")
993 $this->page_object->appendXMLContent($this->
buildTag(
"end", $app_name));
997 if ($this->in_bib_item)
999 if($a_name ==
"BibItem")
1001 $this->bib_item->appendXMLContent(
"\n".$this->
buildTag(
"end", $a_name));
1005 $this->bib_item->appendXMLContent($this->
buildTag(
"end", $a_name));
1012 case "StructureObject":
1014 unset($this->structure_objects[count($this->structure_objects) - 1]);
1019 $this->in_page_object =
false;
1020 if (($this->coType !=
"tst") and ($this->coType !=
"qpl"))
1022 if (!$this->lm_page_object->isAlias())
1025 $this->page_object->updateFromXML();
1026 $this->pg_mapping[$this->lm_page_object->getImportId()]
1027 = $this->lm_page_object->getId();
1030 if ($this->page_object->containsIntLink())
1032 $this->pages_to_parse[
"lm:".$this->page_object->getId()] =
"lm:".$this->page_object->getId();
1036 if ($this->page_object->needsImportParsing())
1038 $this->pages_to_parse[
"lm:".$this->page_object->getId()] =
"lm:".$this->page_object->getId();
1042 if ($this->page_object->getContainsQuestion())
1044 $this->pages_to_parse[
"lm:".$this->page_object->getId()] =
"lm:".$this->page_object->getId();
1051 $xml = $this->page_object->getXMLContent();
1052 if ($this->cur_qid !=
"")
1054 $ids = $this->qst_mapping[$this->cur_qid];
1055 if ($ids[
"pool"] > 0)
1059 $xmlcontent = str_replace($this->cur_qid,
1060 "il__qst_".$ids[
"pool"], $xml);
1061 $page->setXMLContent($xmlcontent);
1062 $page->saveMobUsage($xmlcontent);
1063 $page->updateFromXML();
1066 if ($ids[
"test"] > 0)
1070 $xmlcontent = str_replace($this->cur_qid,
1071 "il__qst_".$ids[
"test"], $xml);
1072 $page->setXMLContent($xmlcontent);
1073 $page->saveMobUsage($xmlcontent);
1074 $page->updateFromXML();
1081 $cnt = count($this->structure_objects);
1084 $parent_id = $this->structure_objects[
$cnt - 1]->getId();
1085 if ($this->lm_page_object->isAlias())
1087 $this->pg_into_tree[$parent_id][] = array(
"type" =>
"pg_alias",
"id" => $this->lm_page_object->getOriginId());
1091 $this->pg_into_tree[$parent_id][] = array(
"type" =>
"pg",
"id" => $this->lm_page_object->getId());
1095 unset($this->page_object);
1096 unset($this->lm_page_object);
1097 unset ($this->container[count($this->container) - 1]);
1101 $this->in_media_object =
false;
1106 if(empty($this->mob_mapping[$this->media_object->getImportId()]))
1113 $this->media_object->create(
true,
false);
1118 if ($this->media_object->containsIntLink())
1121 $this->mobs_with_int_links[] = $this->media_object->getId();
1124 $this->mob_mapping[$this->media_object->getImportId()]
1125 = $this->media_object->getId();
1132 $this->media_object->setId($this->mob_mapping[$this->media_object->getImportId()]);
1139 if (!$this->media_object->isAlias())
1142 $this->media_object->update();
1147 if ($this->media_object->containsIntLink())
1150 $this->mobs_with_int_links[] = $this->media_object->getId();
1156 if ($this->in_page_object || $this->in_glossary_definition)
1158 $this->page_object->appendXMLContent($this->media_object->getXML(
IL_MODE_ALIAS));
1165 case "MediaAliasItem":
1166 $this->in_media_item =
false;
1167 $this->media_object->addMediaItem($this->media_item);
1172 $this->in_map_area =
false;
1173 $this->media_item->addMapArea($this->map_area);
1177 $this->in_properties =
false;
1178 if ($this->content_object->getType() ==
"lm"
1179 || $this->content_object->getType() ==
"dbk")
1181 $this->content_object->update();
1186 $this->in_meta_data =
false;
1187 if(strtolower(get_class($this->current_object)) ==
"illmpageobject" && !$this->in_media_object)
1190 if (is_object($this->lm_page_object))
1193 $this->current_object->MDUpdateListener(
'General');
1195 $this->current_object->getImportId());
1198 else if((strtolower(get_class($this->current_object)) ==
"ilobjquestionpool" ||
1199 strtolower(get_class($this->current_object)) ==
"ilobjtest") &&
1205 if ($this->metadata_parsing_disabled)
1211 if ($this->in_page_object)
1213 $this->page_object->MDUpdateListener(
'General');
1215 $this->page_object->getImportId());
1219 $this->current_object->MDUpdateListener(
'General');
1221 $this->current_object->getImportId());
1225 else if(strtolower(get_class($this->current_object)) ==
"ilstructureobject")
1228 $cnt = count($this->structure_objects);
1231 $parent_id = $this->structure_objects[
$cnt - 2]->getId();
1235 $parent_id = $this->lm_tree->getRootId();
1240 $this->st_into_tree[] = array (
"id" => $this->current_object->getId(),
1241 "parent" => $parent_id);
1244 $this->current_object->MDUpdateListener(
'General');
1246 $this->current_object->getImportId());
1248 else if(strtolower(get_class($this->current_object)) ==
"ilobjdlbook" || strtolower(get_class($this->current_object)) ==
"ilobjlearningmodule" ||
1249 strtolower(get_class($this->current_object)) ==
"ilobjcontentobject" ||
1250 (strtolower(get_class($this->current_object)) ==
"ilobjglossary" &&
$this->in_glossary))
1255 else if(strtolower(get_class($this->current_object)) ==
"ilglossarydefinition" && !$this->in_media_object)
1260 $this->page_object->setId($this->glossary_definition->getId());
1261 $this->page_object->updateFromXML();
1268 if(strtolower(get_class($this->current_object)) ==
"ilobjlearningmodule" ||
1269 strtolower(get_class($this->current_object)) ==
"ilobjdlbook" ||
1270 strtolower(get_class($this->current_object)) ==
"ilobjglossary")
1272 if (strtolower(get_class($this->current_object)) ==
"ilobjglossary" &&
1273 $this->content_object->getType() !=
"glo")
1276 $this->current_object->setTitle($this->content_object->getTitle().
" - ".
1277 $this->lng->txt(
"glossary"));
1280 $this->current_object->MDUpdateListener(
'General');
1289 if ($this->in_media_object)
1292 $this->media_object->MDUpdateListener(
'General');
1295 if ($this->in_glossary_definition)
1297 $this->glossary_definition->MDUpdateListener(
'General');
1302 case "Meta-Metadata":
1303 $this->in_meta_meta_data =
false;
1307 $this->in_file_item =
false;
1309 if ($this->file_item->getImportId($a_attribs[
"Entry"] !=
""))
1311 $this->file_item->update();
1315 case "Bibliography":
1317 $this->in_bib_item =
false;
1320 $nested->import($this->bib_item->getXMLContent(),$this->content_object->getId(),
"bib");
1324 unset ($this->container[count($this->container) - 1]);
1328 $this->in_glossary =
false;
1331 case "GlossaryTerm":
1332 $this->glossary_term->setTerm(trim($this->chr_data));
1333 $this->glossary_term->create();
1337 $this->inside_code =
false;
1341 $this->in_glossary_definition =
false;
1342 $this->page_object->updateFromXML();
1343 $this->page_object->buildDom();
1344 $this->glossary_definition->setShortText($this->page_object->getFirstParagraphText());
1345 $this->glossary_definition->update();
1348 if ($this->page_object->containsIntLink())
1351 $this->pages_to_parse[
"gdf:".$this->page_object->getId()] =
"gdf:".$this->page_object->getId();
1353 if ($this->page_object->needsImportParsing())
1355 $this->pages_to_parse[
"gdf:".$this->page_object->getId()] =
"gdf:".$this->page_object->getId();
1360 if ($this->in_media_item)
1362 $this->media_item->setFormat(trim($this->chr_data));
1364 if ($this->in_file_item)
1366 $this->file_item->setFileType(trim($this->chr_data));
1371 if (!$this->in_media_object)
1373 $this->current_object->setTitle(trim($this->chr_data));
1378 $this->media_object->setTitle(trim($this->chr_data));
1390 if (is_object($this->bib_item))
1392 $this->bib_item->setLanguage(trim($this->chr_data));
1401 if ($this->in_media_object)
1403 $this->media_item->setCaption(trim($this->chr_data));
1407 case "TextRepresentation":
1408 if ($this->in_media_object)
1410 $this->media_item->setTextRepresentation(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();