当前位置: 首页>>代码示例>>PHP>>正文


PHP ilUtil::getDir方法代码示例

本文整理汇总了PHP中ilUtil::getDir方法的典型用法代码示例。如果您正苦于以下问题:PHP ilUtil::getDir方法的具体用法?PHP ilUtil::getDir怎么用?PHP ilUtil::getDir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ilUtil的用法示例。


在下文中一共展示了ilUtil::getDir方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getFiles

 /**
  * Get files
  *
  * @access public
  * 
  */
 public function getFiles()
 {
     if (!@is_dir($this->export_dir)) {
         return array();
     }
     foreach (ilUtil::getDir($this->export_dir) as $file_name => $file_data) {
         $files[$file_name] = $file_data;
     }
     return $files ? $files : array();
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:16,代码来源:class.ilAdvancedMDRecordExportFiles.php

示例2: getFiles

 /**
  * Get files
  */
 function getFiles($a_files)
 {
     $files = array();
     foreach ($a_files as $f) {
         if (is_file($this->upload_dir . "/" . $f)) {
             $files[] = $f;
         } else {
             if (is_dir($this->upload_dir . "/" . $f)) {
                 $dir = ilUtil::getDir($this->upload_dir . "/" . $f, true);
                 foreach ($dir as $d) {
                     if ($d["type"] == "file") {
                         $files[] = $f . $d["subdir"] . "/" . $d["entry"];
                     }
                 }
             }
         }
     }
     return $files;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:22,代码来源:class.ilUploadDirFilesTableGUI.php

示例3: getEntries

 /**
  * Get entries
  */
 function getEntries()
 {
     if (is_dir($this->cur_dir)) {
         $entries = ilUtil::getDir($this->cur_dir);
     } else {
         $entries = array(array("type" => "dir", "entry" => ".."));
     }
     $items = array();
     //var_dump($entries);
     foreach ($entries as $e) {
         if ($e["entry"] == "." || $e["entry"] == ".." && empty($this->cur_subdir)) {
             continue;
         }
         $cfile = !empty($this->cur_subdir) ? $this->cur_subdir . "/" . $e["entry"] : $e["entry"];
         if ($this->label_enable) {
             $label = is_array($this->file_labels[$cfile]) ? implode($this->file_labels[$cfile], ", ") : "";
         }
         $pref = $e["type"] == "dir" ? $this->getOrderDirection() != "desc" ? "1_" : "9_" : "5_";
         $items[] = array("file" => $cfile, "entry" => $e["entry"], "type" => $e["type"], "label" => $label, "size" => $e["size"], "name" => $pref . $e["entry"]);
     }
     $this->setData($items);
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:25,代码来源:class.ilFileSystemTableGUI.php

示例4: getImages

 /**
  * Get images of style
  */
 function getImages()
 {
     $dir = $this->getImagesDirectory();
     $images = array();
     if (is_dir($dir)) {
         $entries = ilUtil::getDir($dir);
         foreach ($entries as $entry) {
             if (substr($entry["entry"], 0, 1) == ".") {
                 continue;
             }
             if ($entry["type"] != "dir") {
                 $images[] = $entry;
             }
         }
     }
     return $images;
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:20,代码来源:class.ilObjStyleSheet.php

示例5: getSrtFiles

 /**
  * Get srt files
  */
 function getSrtFiles()
 {
     $srt_dir = ilObjMediaObject::_getDirectory($this->getId()) . "/srt";
     if (!is_dir($srt_dir)) {
         return array();
     }
     $items = ilUtil::getDir($srt_dir);
     $srt_files = array();
     foreach ($items as $i) {
         if (!in_array($i["entry"], array(".", "..")) && $i["type"] == "file") {
             $name = explode(".", $i["entry"]);
             if ($name[1] == "srt" && substr($name[0], 0, 9) == "subtitle_") {
                 $srt_files[] = array("file" => $i["entry"], "full_path" => "srt/" . $i["entry"], "language" => substr($name[0], 9, 2));
             }
         }
     }
     return $srt_files;
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:21,代码来源:class.ilObjMediaObject.php

示例6: getMultiFeedbackFiles

 /**
  * Get multi feedback files (of uploader)
  *
  * @param int $a_user_id user id of uploader
  * @return array array of user files (keys: lastname, firstname, user_id, login, file)
  */
 function getMultiFeedbackFiles($a_user_id = 0)
 {
     global $ilUser;
     if ($a_user_id == 0) {
         $a_user_id = $ilUser->getId();
     }
     $mf_files = array();
     // get members
     $exc = new ilObjExercise($this->getExerciseId(), false);
     include_once "./Modules/Exercise/classes/class.ilExerciseMembers.php";
     $exmem = new ilExerciseMembers($exc);
     $mems = $exmem->getMembers();
     // read mf directory
     include_once "./Modules/Exercise/classes/class.ilFSStorageExercise.php";
     $storage = new ilFSStorageExercise($this->getExerciseId(), $this->getId());
     $mfu = $storage->getMultiFeedbackUploadPath($ilUser->getId());
     // get subdir that starts with multi_feedback
     $subdirs = ilUtil::getDir($mfu);
     $subdir = "notfound";
     foreach ($subdirs as $s => $j) {
         if ($j["type"] == "dir" && substr($s, 0, 14) == "multi_feedback") {
             $subdir = $s;
         }
     }
     $items = ilUtil::getDir($mfu . "/" . $subdir);
     foreach ($items as $k => $i) {
         // check directory
         if ($i["type"] == "dir" && !in_array($k, array(".", ".."))) {
             // check if valid member id is given
             $parts = explode("_", $i["entry"]);
             $user_id = (int) $parts[count($parts) - 1];
             if (in_array($user_id, $mems)) {
                 // read dir of user
                 $name = ilObjUser::_lookupName($user_id);
                 $files = ilUtil::getDir($mfu . "/" . $subdir . "/" . $k);
                 foreach ($files as $k2 => $f) {
                     // append files to array
                     if ($f["type"] == "file" && substr($k2, 0, 1) != ".") {
                         $mf_files[] = array("lastname" => $name["lastname"], "firstname" => $name["firstname"], "login" => $name["login"], "user_id" => $name["user_id"], "full_path" => $mfu . "/" . $subdir . "/" . $k . "/" . $k2, "file" => $k2);
                     }
                 }
             }
         }
     }
     return $mf_files;
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:52,代码来源:class.ilExAssignment.php

示例7: importFromZipFile

 /**
  * 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;
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:43,代码来源:class.ilObjContentObject.php

示例8: cleanImagefiles

 protected function cleanImagefiles()
 {
     if ($this->getOrderingType() == OQ_PICTURES) {
         if (@file_exists($this->getImagePath())) {
             $contents = ilUtil::getDir($this->getImagePath());
             foreach ($contents as $f) {
                 if (strcmp($f['type'], 'file') == 0) {
                     $found = false;
                     foreach ($this->getAnswers() as $answer) {
                         if (strcmp($f['entry'], $answer->getAnswertext()) == 0) {
                             $found = true;
                         }
                         if (strcmp($f['entry'], $this->getThumbPrefix() . $answer->getAnswertext()) == 0) {
                             $found = true;
                         }
                     }
                     if (!$found) {
                         if (@file_exists($this->getImagePath() . $f['entry'])) {
                             @unlink($this->getImagePath() . $f['entry']);
                         }
                     }
                 }
             }
         }
     } else {
         if (@file_exists($this->getImagePath())) {
             ilUtil::delDir($this->getImagePath());
         }
     }
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:30,代码来源:class.assOrderingQuestion.php

示例9: editFilesObject

 /**
  * administrate files of media object
  */
 function editFilesObject()
 {
     // standard item
     $std_item =& $this->object->getMediaItem("Standard");
     if ($this->object->hasFullscreenItem()) {
         $full_item =& $this->object->getMediaItem("Fullscreen");
     }
     // create table
     require_once "./Services/Table/classes/class.ilTableGUI.php";
     $tbl = new ilTableGUI();
     // determine directory
     $cur_subdir = $_GET["cdir"];
     if ($_GET["newdir"] == "..") {
         $cur_subdir = substr($cur_subdir, 0, strrpos($cur_subdir, "/"));
     } else {
         if (!empty($_GET["newdir"])) {
             if (!empty($cur_subdir)) {
                 $cur_subdir = $cur_subdir . "/" . $_GET["newdir"];
             } else {
                 $cur_subdir = $_GET["newdir"];
             }
         }
     }
     $cur_subdir = str_replace(".", "", $cur_subdir);
     $mob_dir = ilUtil::getWebspaceDir() . "/mobs/mm_" . $this->object->getId();
     $cur_dir = !empty($cur_subdir) ? $mob_dir . "/" . $cur_subdir : $mob_dir;
     // load files templates
     $this->tpl->addBlockfile("ADM_CONTENT", "adm_content", "tpl.mob_files.html", "Services/MediaObjects");
     $this->ctrl->setParameter($this, "cdir", urlencode($cur_subdir));
     $this->tpl->setVariable("FORMACTION1", $this->ctrl->getFormAction($this));
     //echo "--".$this->getTargetScript().
     //"&hier_id=".$_GET["hier_id"]."&cdir=".$cur_subdir."&cmd=post"."--<br>";
     $this->tpl->setVariable("TXT_NEW_DIRECTORY", $this->lng->txt("cont_new_dir"));
     $this->tpl->setVariable("TXT_NEW_FILE", $this->lng->txt("cont_new_file"));
     $this->tpl->setVariable("CMD_NEW_DIR", "createDirectory");
     $this->tpl->setVariable("CMD_NEW_FILE", "uploadFile");
     $this->tpl->setVariable("BTN_NEW_DIR", $this->lng->txt("create"));
     $this->tpl->setVariable("BTN_NEW_FILE", $this->lng->txt("upload"));
     //
     $this->tpl->addBlockfile("FILE_TABLE", "files", "tpl.table.html");
     // load template for table content data
     $this->tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.mob_file_row.html", "Services/MediaObjects");
     $num = 0;
     $obj_str = $this->call_by_reference ? "" : "&obj_id=" . $this->obj_id;
     $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
     $tbl->setTitle($this->lng->txt("cont_files") . " " . $cur_subdir);
     //$tbl->setHelp("tbl_help.php","icon_help.gif",$this->lng->txt("help"));
     $tbl->setHeaderNames(array("", "", $this->lng->txt("cont_dir_file"), $this->lng->txt("cont_size"), $this->lng->txt("cont_purpose")));
     $cols = array("", "", "dir_file", "size", "purpose");
     $header_params = array("ref_id" => $_GET["ref_id"], "obj_id" => $_GET["obj_id"], "cmd" => "editFiles", "hier_id" => $_GET["hier_id"], "item_id" => $_GET["item_id"]);
     $tbl->setHeaderVars($cols, $header_params);
     $tbl->setColumnWidth(array("1%", "1%", "33%", "33%", "32%"));
     // control
     $tbl->setOrderColumn($_GET["sort_by"]);
     $tbl->setOrderDirection($_GET["sort_order"]);
     $tbl->setLimit($_GET["limit"]);
     $tbl->setOffset($_GET["offset"]);
     $tbl->setMaxCount($this->maxcount);
     // ???
     //$tbl->setMaxCount(30);		// ???
     $this->tpl->setVariable("COLUMN_COUNTS", 5);
     // delete button
     $this->tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_downright.svg"));
     $this->tpl->setCurrentBlock("tbl_action_btn");
     $this->tpl->setVariable("BTN_NAME", "deleteFile");
     $this->tpl->setVariable("BTN_VALUE", $this->lng->txt("delete"));
     $this->tpl->parseCurrentBlock();
     $this->tpl->setCurrentBlock("tbl_action_btn");
     $this->tpl->setVariable("BTN_NAME", "assignStandard");
     $this->tpl->setVariable("BTN_VALUE", $this->lng->txt("cont_assign_std"));
     $this->tpl->parseCurrentBlock();
     $this->tpl->setCurrentBlock("tbl_action_btn");
     $this->tpl->setVariable("BTN_NAME", "assignFullscreen");
     $this->tpl->setVariable("BTN_VALUE", $this->lng->txt("cont_assign_full"));
     $this->tpl->parseCurrentBlock();
     // footer
     $tbl->setFooter("tblfooter", $this->lng->txt("previous"), $this->lng->txt("next"));
     //$tbl->disable("footer");
     $entries = ilUtil::getDir($cur_dir);
     //$objs = ilUtil::sortArray($objs, $_GET["sort_by"], $_GET["sort_order"]);
     $tbl->setMaxCount(count($entries));
     $entries = array_slice($entries, $_GET["offset"], $_GET["limit"]);
     $tbl->render();
     if (count($entries) > 0) {
         $i = 0;
         foreach ($entries as $entry) {
             if ($entry["entry"] == "." || $entry["entry"] == ".." && empty($cur_subdir)) {
                 continue;
             }
             //$this->tpl->setVariable("ICON", $obj["title"]);
             if ($entry["type"] == "dir") {
                 $this->tpl->setCurrentBlock("FileLink");
                 $this->ctrl->setParameter($this, "cdir", $cur_subdir);
                 $this->ctrl->setParameter($this, "newdir", rawurlencode($entry["entry"]));
                 $this->tpl->setVariable("LINK_FILENAME", $this->ctrl->getLinkTarget($this, "editFiles"));
                 $this->tpl->setVariable("TXT_FILENAME", $entry["entry"]);
                 $this->tpl->parseCurrentBlock();
//.........这里部分代码省略.........
开发者ID:arlendotcn,项目名称:ilias,代码行数:101,代码来源:class.ilObjMediaObjectGUI.php

示例10: getAttachmentPathByMD5Filename

 /**
  * get the path of a specific attachment
  * @param string md5 encrypted filename
  * @param integer mail_id
  * @access	public
  * @return string path
  */
 public function getAttachmentPathByMD5Filename($a_filename, $a_mail_id)
 {
     global $ilDB;
     /*		$query = "SELECT path FROM mail_attachment ".
     			"WHERE mail_id = ".$ilDB->quote($a_mail_id)."";
     		
     		$row = $this->ilias->db->getRow($query,DB_FETCHMODE_OBJECT);
     		$path = $this->getMailPath().'/'.$row->path;
     */
     $query = $ilDB->query("SELECT path FROM mail_attachment \n\t\t\t\t  WHERE mail_id = " . $ilDB->quote($a_mail_id, 'integer') . "");
     $rel_path = "";
     while ($row = $ilDB->fetchObject($query)) {
         $rel_path = $row->path;
         $path = $this->getMailPath() . '/' . $row->path;
     }
     $files = ilUtil::getDir($path);
     foreach ((array) $files as $file) {
         if ($file['type'] == 'file' && md5($file['entry']) == $a_filename) {
             return array('path' => $this->getMailPath() . '/' . $rel_path . '/' . $file['entry'], 'filename' => $file['entry']);
         }
     }
     return '';
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:30,代码来源:class.ilFileDataMail.php

示例11: getFilesOfDirectory

 /**
  * Get files of directory
  *
  * @param string $a_subdir subdirectry
  * @return array array of files
  */
 function getFilesOfDirectory($a_subdir = "")
 {
     $a_subdir = str_replace("..", "", $a_subdir);
     $dir = ilObjMediaObject::_getDirectory($this->getId());
     if ($a_subdir != "") {
         $dir .= "/" . $a_subdir;
     }
     $files = array();
     if (is_dir($dir)) {
         $entries = ilUtil::getDir($dir);
         foreach ($entries as $e) {
             if (is_file($dir . "/" . $e["entry"]) && $e["entry"] != "." && $e["entry"] != "..") {
                 $files[] = $e["entry"];
             }
         }
     }
     return $files;
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:24,代码来源:class.ilObjMediaObject.php

示例12: importCertificate

 /**
  * Reads an import ZIP file and creates a certificate of it
  *
  * @return boolean TRUE if the import succeeds, FALSE otherwise
  */
 public function importCertificate($zipfile, $filename)
 {
     include_once "./Services/Utilities/classes/class.ilUtil.php";
     $importpath = $this->createArchiveDirectory();
     if (!ilUtil::moveUploadedFile($zipfile, $filename, $importpath . $filename)) {
         ilUtil::delDir($importpath);
         return FALSE;
     }
     ilUtil::unzip($importpath . $filename, TRUE);
     $subdir = str_replace(".zip", "", strtolower($filename)) . "/";
     $copydir = "";
     if (is_dir($importpath . $subdir)) {
         $dirinfo = ilUtil::getDir($importpath . $subdir);
         $copydir = $importpath . $subdir;
     } else {
         $dirinfo = ilUtil::getDir($importpath);
         $copydir = $importpath;
     }
     $xmlfiles = 0;
     $otherfiles = 0;
     foreach ($dirinfo as $file) {
         if (strcmp($file["type"], "file") == 0) {
             if (strpos($file["entry"], ".xml") !== FALSE) {
                 $xmlfiles++;
             } else {
                 if (strpos($file["entry"], ".zip") !== FALSE) {
                 } else {
                     $otherfiles++;
                 }
             }
         }
     }
     // if one XML file is in the archive, we try to import it
     if ($xmlfiles == 1) {
         foreach ($dirinfo as $file) {
             if (strcmp($file["type"], "file") == 0) {
                 if (strpos($file["entry"], ".xml") !== FALSE) {
                     $xsl = file_get_contents($copydir . $file["entry"]);
                     // as long as we cannot make RPC calls in a given directory, we have
                     // to add the complete path to every url
                     $xsl = preg_replace("/url\\([']{0,1}(.*?)[']{0,1}\\)/", "url(" . $this->getAdapter()->getCertificatePath() . "\${1})", $xsl);
                     $this->saveCertificate($xsl);
                 } else {
                     if (strpos($file["entry"], ".zip") !== FALSE) {
                     } else {
                         @copy($copydir . $file["entry"], $this->getAdapter()->getCertificatePath() . $file["entry"]);
                         if (strcmp($this->getBackgroundImagePath(), $this->getAdapter()->getCertificatePath() . $file["entry"]) == 0) {
                             // upload of the background image, create a preview
                             ilUtil::convertImage($this->getBackgroundImagePath(), $this->getBackgroundImageThumbPath(), "JPEG", 100);
                         }
                     }
                 }
             }
         }
     } else {
         ilUtil::delDir($importpath);
         return FALSE;
     }
     ilUtil::delDir($importpath);
     return TRUE;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:66,代码来源:class.ilCertificate.php

示例13: getPersonalDataExportFile

 /**
  * Get personal data export file
  *
  * @param
  * @return
  */
 function getPersonalDataExportFile()
 {
     include_once "./Services/Export/classes/class.ilExport.php";
     $dir = ilExport::_getExportDirectory($this->getId(), "xml", "usr", "personal_data");
     if (!is_dir($dir)) {
         return "";
     }
     foreach (ilUtil::getDir($dir) as $entry) {
         if (is_int(strpos($entry["entry"], ".zip"))) {
             return $entry["entry"];
         }
     }
     return "";
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:20,代码来源:class.ilObjUser.php

示例14: unlinkFilesByMD5Filenames

 /**
  * get file data of a specific attachment
  * @param string|array md5 encrypted filename or array of multiple md5 encrypted files
  * @access public
  * @return boolean status
  */
 function unlinkFilesByMD5Filenames($a_md5_filename)
 {
     $files = ilUtil::getDir($this->forum_path);
     if (is_array($a_md5_filename)) {
         foreach ((array) $files as $file) {
             if ($file['type'] == 'file' && in_array(md5($file['entry']), $a_md5_filename)) {
                 unlink($this->forum_path . '/' . $file['entry']);
             }
         }
         return true;
     } else {
         foreach ((array) $files as $file) {
             if ($file['type'] == 'file' && md5($file['entry']) == $a_md5_filename) {
                 return unlink($this->forum_path . '/' . $file['entry']);
             }
         }
     }
     return false;
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:25,代码来源:class.ilFileDataForum.php

示例15: dbImportSco

 public function dbImportSco($slm, $sco, $asset = false)
 {
     $qtis = array();
     $d = ilUtil::getDir($this->packageFolder);
     foreach ($d as $f) {
         //continue;
         if ($f[type] == 'file' && substr($f[entry], 0, 4) == 'qti_') {
             include_once "./Services/QTI/classes/class.ilQTIParser.php";
             include_once "./Modules/Test/classes/class.ilObjTest.php";
             $qtiParser = new ilQTIParser($this->packageFolder . "/" . $f[entry], IL_MO_VERIFY_QTI, 0, "");
             $result = $qtiParser->startParsing();
             $founditems =& $qtiParser->getFoundItems();
             //					die(print_r($founditems));
             foreach ($founditems as $qp) {
                 $newObj = new ilObjTest(0, true);
                 // This creates a lot of invalid repository objects for each question
                 // question are not repository objects (see e.g. table object_data), alex 29 Sep 2009
                 //					$newObj->setType ( $qp ['type'] );
                 //					$newObj->setTitle ( $qp ['title'] );
                 //					$newObj->create ( true );
                 //					$newObj->createReference ();
                 //					$newObj->putInTree ($_GET ["ref_id"]);
                 //					$newObj->setPermissions ( $sco->getId ());
                 //					$newObj->notify ("new", $_GET["ref_id"], $sco->getId (), $_GET["ref_id"], $newObj->getRefId () );
                 //					$newObj->mark_schema->flush ();
                 $qtiParser = new ilQTIParser($this->packageFolder . "/" . $f[entry], IL_MO_PARSE_QTI, 0, "");
                 $qtiParser->setTestObject($newObj);
                 $result = $qtiParser->startParsing();
                 //					$newObj->saveToDb ();
                 $qtis = array_merge($qtis, $qtiParser->getImportMapping());
             }
         }
     }
     //exit;
     include_once 'Modules/Scorm2004/classes/class.ilSCORM2004Page.php';
     $doc = new SimpleXMLElement($this->imsmanifest->saveXml());
     $l = $doc->xpath("/ContentObject/MetaData");
     if ($l[0]) {
         include_once 'Services/MetaData/classes/class.ilMDXMLCopier.php';
         $mdxml =& new ilMDXMLCopier($l[0]->asXML(), $slm->getId(), $sco->getId(), $sco->getType());
         $mdxml->startParsing();
         $mdxml->getMDObject()->update();
     }
     $l = $doc->xpath("/ContentObject/PageObject");
     foreach ($l as $page_xml) {
         $tnode = $page_xml->xpath('MetaData/General/Title');
         $page = new ilSCORM2004PageNode($slm);
         $page->setTitle($tnode[0]);
         $page->setSLMId($slm->getId());
         $page->create(true);
         ilSCORM2004Node::putInTree($page, $sco->getId(), $target);
         $pmd = $page_xml->xpath("MetaData");
         if ($pmd[0]) {
             include_once 'Services/MetaData/classes/class.ilMDXMLCopier.php';
             $mdxml =& new ilMDXMLCopier($pmd[0]->asXML(), $slm->getId(), $page->getId(), $page->getType());
             $mdxml->startParsing();
             $mdxml->getMDObject()->update();
         }
         $tnode = $page_xml->xpath("//MediaObject/MediaAlias | //InteractiveImage/MediaAlias");
         foreach ($tnode as $ttnode) {
             include_once './Services/MediaObjects/classes/class.ilObjMediaObject.php';
             $OriginId = $ttnode[OriginId];
             $medianodes = $doc->xpath("//MediaObject[MetaData/General/Identifier/@Entry='" . $OriginId . "']");
             $medianode = $medianodes[0];
             if ($medianode) {
                 $media_object = new ilObjMediaObject();
                 $media_object->setTitle($medianode->MetaData->General->Title);
                 $media_object->setDescription($medianode->MetaData->General->Description);
                 $media_object->create(false);
                 $mmd = $medianode->xpath("MetaData");
                 if ($mmd[0]) {
                     include_once 'Services/MetaData/classes/class.ilMDXMLCopier.php';
                     $mdxml =& new ilMDXMLCopier($mmd[0]->asXML(), 0, $media_object->getId(), $media_object->getType());
                     $mdxml->startParsing();
                     $mdxml->getMDObject()->update();
                 }
                 // determine and create mob directory, move uploaded file to directory
                 $media_object->createDirectory();
                 $mob_dir = ilObjMediaObject::_getDirectory($media_object->getId());
                 foreach ($medianode->MediaItem as $xMediaItem) {
                     $media_item =& new ilMediaItem();
                     $media_object->addMediaItem($media_item);
                     $media_item->setPurpose($xMediaItem[Purpose]);
                     $media_item->setFormat($xMediaItem->Format);
                     $media_item->setLocation($xMediaItem->Location);
                     $media_item->setLocationType($xMediaItem->Location[Type]);
                     $media_item->setWidth($xMediaItem->Layout[Width]);
                     $media_item->setHeight($xMediaItem->Layout[Height]);
                     $media_item->setHAlign($xMediaItem->Layout[HorizontalAlign]);
                     $media_item->setCaption($xMediaItem->Caption);
                     $media_item->setTextRepresentation($xMediaItem->TextRepresentation);
                     $nr = 0;
                     // add map areas (external links only)
                     foreach ($xMediaItem->MapArea as $n => $v) {
                         if ($v->ExtLink[Href] != "") {
                             include_once "./Services/MediaObjects/classes/class.ilMapArea.php";
                             $ma = new ilMapArea();
                             $map_area = new ilMapArea();
                             $map_area->setShape($v[Shape]);
                             $map_area->setCoords($v[Coords]);
//.........这里部分代码省略.........
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:101,代码来源:ilSCORM13Package.php


注:本文中的ilUtil::getDir方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。