Exemplo n.º 1
0
 static function _handleImportRepositoryLinks($a_rep_import_id, $a_rep_type, $a_rep_ref_id)
 {
     include_once "./Services/Link/classes/class.ilInternalLink.php";
     //echo "-".$a_rep_import_id."-".$a_rep_ref_id."-";
     $sources = ilInternalLink::_getSourcesOfTarget("obj", ilInternalLink::_extractObjIdOfTarget($a_rep_import_id), ilInternalLink::_extractInstOfTarget($a_rep_import_id));
     //var_dump($sources);
     foreach ($sources as $source) {
         //echo "A";
         if ($source["type"] == "lm:pg") {
             //echo "B";
             include_once "./Modules/LearningModule/classes/class.ilLMPage.php";
             if (self::_exists("lm", $source["id"], $source["lang"])) {
                 $page_obj = new ilLMPage($source["id"], 0, $source["lang"]);
                 if (!$page_obj->page_not_found) {
                     //echo "C";
                     $page_obj->handleImportRepositoryLink($a_rep_import_id, $a_rep_type, $a_rep_ref_id);
                 }
                 $page_obj->update();
             }
         }
     }
 }