/** * Delete files */ function delete() { global $ilCtrl; foreach ($_POST["file"] as $file) { $file = explode(":", $file); include_once "./Services/Export/classes/class.ilExport.php"; $export_dir = ilExport::_getExportDirectory($this->obj->getId(), str_replace("..", "", $file[0]), $this->obj->getType()); $exp_file = $export_dir . "/" . str_replace("..", "", $file[1]); $exp_dir = $export_dir . "/" . substr($file[1], 0, strlen($file[1]) - 4); if (@is_file($exp_file)) { unlink($exp_file); } if (@is_dir($exp_dir)) { ilUtil::delDir($exp_dir); } // delete entry in database include_once './Services/Export/classes/class.ilExportFileInfo.php'; $info = new ilExportFileInfo($this->obj->getId(), $file[0], $file[1]); $info->delete(); } $ilCtrl->redirect($this, "listExportFiles"); }