/** * parse pages that contain files, mobs and/or internal links */ function processPagesToParse() { /* $pg_mapping = array(); foreach($this->pg_mapping as $key => $value) { $pg_mapping[$key] = "il__pg_".$value; }*/ //echo "<br><b>processIntLinks</b>"; flush(); // outgoin internal links foreach ($this->pages_to_parse as $page_id) { $page_arr = explode(":", $page_id); //echo "<br>resolve:".$this->content_object->getType().":".$page_id; flush(); switch ($page_arr[0]) { case "lm": $page_obj =& new ilPageObject($this->content_object->getType(), $page_arr[1]); break; case "gdf": $page_obj =& new ilPageObject("gdf", $page_arr[1]); break; } $page_obj->buildDom(); $page_obj->resolveIntLinks(); $page_obj->resolveIIMMediaAliases($this->mob_mapping); if (in_array($this->coType, array("lm", "dbk"))) { $page_obj->resolveQuestionReferences($this->qst_mapping); } $page_obj->update(false); if ($page_arr[0] == "gdf") { $def =& new ilGlossaryDefinition($page_arr[1]); $def->updateShortText(); } unset($page_obj); } //echo "<br><b>map area internal links</b>"; flush(); // outgoins map area (mob) internal links foreach ($this->mobs_with_int_links as $mob_id) { ilMediaItem::_resolveMapAreaLinks($mob_id); } //echo "<br><b>incoming interna links</b>"; flush(); // incoming internal links $done = array(); foreach ($this->link_targets as $link_target) { //echo "doin link target:".$link_target.":<br>"; $link_arr = explode("_", $link_target); $target_inst = $link_arr[1]; $target_type = $link_arr[2]; $target_id = $link_arr[3]; $sources = ilInternalLink::_getSourcesOfTarget($target_type, $target_id, $target_inst); foreach ($sources as $key => $source) { //echo "got source:".$key.":<br>"; if (in_array($key, $done)) { continue; } $type_arr = explode(":", $source["type"]); // content object pages if ($type_arr[1] == "pg") { $page_object = new ilPageObject($type_arr[0], $source["id"]); $page_object->buildDom(); $page_object->resolveIntLinks(); $page_object->update(); unset($page_object); } // eventually correct links in questions to learning modules if ($type_arr[0] == "qst") { require_once "./Modules/TestQuestionPool/classes/class.assQuestion.php"; assQuestion::_resolveIntLinks($source["id"]); } // eventually correct links in survey questions to learning modules if ($type_arr[0] == "sqst") { require_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php"; SurveyQuestion::_resolveIntLinks($source["id"]); } $done[$key] = $key; } } }