name.DIRECTORY_SEPARATOR; $tmpPath = sys_get_temp_dir().DIRECTORY_SEPARATOR; // Copy dir to tmp folder dircopy($modulePath, $tmpPath. $module->name); $moduleTmpPath = "$tmpPath{$module->name}"; chmod_R($moduleTmpPath, 0777); // Export write panels foreach($write_panels as $panelID){ $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{ echo "Cannot find zip program"; 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(); } $customWritePanels = RCCWP_CustomWritePanel::GetCustomWritePanels(); ?> >