/**
  * delete export files
  */
 function deleteExportFile()
 {
     include_once "./Services/Utilities/classes/class.ilUtil.php";
     $export = new ilSCORM2004Export($this->object);
     foreach ($_POST['file'] as $idx => $file) {
         $export_dir = $export->getExportDirectoryForType($_POST['type'][$idx]);
         $exp_file = $export_dir . "/" . $file;
         if (@is_file($exp_file)) {
             unlink($exp_file);
         }
     }
     ilUtil::sendSuccess($this->lng->txt('msg_deleted_export_files'), true);
     $this->ctrl->redirect($this, "showExportList");
 }
Пример #2
0
 function getExportFiles()
 {
     $file = array();
     require_once "./Modules/Scorm2004/classes/class.ilSCORM2004Export.php";
     $export = new ilSCORM2004Export($this);
     foreach ($export->getSupportedExportTypes() as $type) {
         $dir = $export->getExportDirectoryForType($type);
         // quit if import dir not available
         if (!@is_dir($dir) or !is_writeable($dir)) {
             continue;
         }
         // open directory
         $cdir = dir($dir);
         // get files and save the in the array
         while ($entry = $cdir->read()) {
             if ($entry != "." and $entry != ".." and (ereg("^[0-9]{10}_{2}[0-9]+_{2}(" . $this->getType() . "_)" . $this->getId() . "+\\.zip\$", $entry) or ereg("^[0-9]{10}_{2}[0-9]+_{2}(" . $this->getType() . "_)" . $this->getId() . "+\\.pdf\$", $entry) or ereg("^[0-9]{10}_{2}[0-9]+_{2}(" . $this->getType() . "_)" . $this->getId() . "+\\.iso\$", $entry))) {
                 $file[$entry . $type] = array("type" => $type, "file" => $entry, "size" => filesize($dir . "/" . $entry));
             }
         }
         // close import directory
         $cdir->close();
     }
     // sort files
     ksort($file);
     reset($file);
     return $file;
 }