Пример #1
0
 /**
  * Get tail dependencies
  *
  * @param		string		entity
  * @param		string		target release
  * @param		array		ids
  * @return		array		array of array with keys "component", entity", "ids"
  */
 function getXmlExportTailDependencies($a_entity, $a_target_release, $a_ids)
 {
     if ($a_target_release == "4.3.0") {
         if ($a_entity == "help") {
             $lm_node_ids = array();
             include_once "./Modules/LearningModule/classes/class.ilLMObject.php";
             foreach ($a_ids as $lm_id) {
                 $chaps = ilLMObject::getObjectList($lm_id, "st");
                 foreach ($chaps as $chap) {
                     $lm_node_ids[] = $chap["obj_id"];
                 }
             }
             return array(array("component" => "Services/Help", "entity" => "help_map", "ids" => $lm_node_ids), array("component" => "Services/Help", "entity" => "help_tooltip", "ids" => $a_ids));
         }
     }
     return array();
 }
Пример #2
0
 /**
  * static
  */
 function getPageList($lm_id)
 {
     return ilLMObject::getObjectList($lm_id, "pg");
 }
 /**
  * Import lm from zip file
  *
  * @param
  * @return
  */
 function importFromZipFile($a_tmp_file, $a_filename, $a_validate = true, $a_import_into_help_module = 0)
 {
     global $lng;
     // create import directory
     $this->createImportDirectory();
     // copy uploaded file to import directory
     $file = pathinfo($a_filename);
     $full_path = $this->getImportDirectory() . "/" . $a_filename;
     ilUtil::moveUploadedFile($a_tmp_file, $a_filename, $full_path);
     // unzip file
     ilUtil::unzip($full_path);
     $subdir = basename($file["basename"], "." . $file["extension"]);
     $mess = $this->importFromDirectory($this->getImportDirectory() . "/" . $subdir, $a_validate);
     // this should only be true for help modules
     if ($a_import_into_help_module > 0) {
         // search the zip file
         $dir = $this->getImportDirectory() . "/" . $subdir;
         $files = ilUtil::getDir($dir);
         foreach ($files as $file) {
             if (is_int(strpos($file["entry"], "__help_")) && is_int(strpos($file["entry"], ".zip"))) {
                 include_once "./Services/Export/classes/class.ilImport.php";
                 $imp = new ilImport();
                 $imp->getMapping()->addMapping('Services/Help', 'help_module', 0, $a_import_into_help_module);
                 include_once "./Modules/LearningModule/classes/class.ilLMObject.php";
                 $chaps = ilLMObject::getObjectList($this->getId(), "st");
                 foreach ($chaps as $chap) {
                     $chap_arr = explode("_", $chap["import_id"]);
                     $imp->getMapping()->addMapping('Services/Help', 'help_chap', $chap_arr[count($chap_arr) - 1], $chap["obj_id"]);
                 }
                 $imp->importEntity($dir . "/" . $file["entry"], $file["entry"], "help", "Services/Help", true);
             }
         }
     }
     // delete import directory
     ilUtil::delDir($this->getImportDirectory());
     return $mess;
 }