$writePanel = RCCWP_CustomWritePanel::Get($panelID); $exportedFilename = $moduleTmpPath . DIRECTORY_SEPARATOR . '_' . $writePanel->name . '.pnl'; RCCWP_CustomWritePanel::Export($panelID, $exportedFilename); } } // Export duplicates and description $moduleInfoFilename = $moduleTmpPath . DIRECTORY_SEPARATOR . 'module_info.exp'; $moduleInfo_exported_data['duplicates'] = RCCWP_ModuleDuplicate::GetCustomModulesDuplicates($moduleID); $moduleInfo_exported_data['moduleinfo'] = RCCWP_CustomWriteModule::Get($moduleID); $handle = fopen($moduleInfoFilename, "w"); $result = @fwrite($handle, serialize($moduleInfo_exported_data)); @fclose($handle); // -- Create zip file $zipFile = "{$tmpPath}{$module->name}.zip"; chdir($moduleTmpPath . DIRECTORY_SEPARATOR); if (RCCWP_Application::CheckCompressionProgramZip()) { $command = "zip -r {$zipFile} ./*"; } else { _e('Cannot find zip program', $flutter_domain); return; } exec($command, $out, $err); // send file in header header('Content-type: binary'); header('Content-Disposition: attachment; filename="' . $module->name . '.zip"'); readfile($zipFile); // Remove file and directory unlink($zipFile); advancedRmdir($moduleTmpPath); exit; }