debug("Entering __construct() method...."); $this->exposeMethod('downloadModuleZip'); $log->debug("Exiting __construct() method...."); } /** * Function to check permission for the User */ function checkPermission(Vtiger_Request $request) { global $log; $log->debug("Entering checkPermission(request attay()) method...."); $log->debug("Exiting checkPermission(request attay()) method...."); return true; } /** * Function to download the module zip */ public function downloadModuleZip(Vtiger_Request $request) { global $log; $log->debug("Entering downloadModuleZip(request attay()) method...."); global $site_URL; $moduleName = $request->get('srcModule'); $zipname = 'test/vtlib/modules/'. ucfirst( strtolower( $moduleName ) ).'.zip'; header( 'Content-Description: File Transfer' ); header( 'Content-Type: application/zip' ); header( 'Content-Disposition: attachment; filename='.basename( $zipname ) ); header( 'Content-Transfer-Encoding: binary' ); header( 'Expires: 0' ); header( 'Cache-Control: must-revalidate, post-check=0, pre-check=0' ); header( 'Pragma: public'); header( 'Content-Length: ' . filesize( $zipname ) ); ob_clean(); flush(); readfile( $zipname ); @unlink( $zipname ); $log->debug("Exiting downloadModuleZip(request attay()) method...."); exit(); } }