public function download(){

        if (!$this->hasRequestParameter('uri')) {
            throw new common_exception_MissingParameter('uri', __METHOD__);
        }
        if (!$this->hasRequestParameter('stylesheetUri')) {
            throw new common_exception_MissingParameter('stylesheetUri', __METHOD__);
        }
        if (!$this->hasRequestParameter('lang')) {
            throw new common_exception_MissingParameter('lang', __METHOD__);
        }


        $item = new \core_kernel_classes_Resource($this->getRequestParameter('uri'));
        $lang = $this->getRequestParameter('lang');
        $styleSheet = $this->getRequestParameter('stylesheetUri');

        if (!\tao_helpers_File::securityCheck($styleSheet, true)) {
            throw new \common_exception_Error('invalid stylesheet path "'.$styleSheet.'"');
        }

        header('Set-Cookie: fileDownload=true');
        setcookie('fileDownload','true', 0, '/');
        header('Content-type: application/octet-stream');
        header(sprintf('Content-Disposition: attachment; filename=%s', basename($styleSheet)));
        echo CssHelper::downloadCssFile($item, $lang, $styleSheet);
    }
public function download(){

        if (!$this->hasRequestParameter('uri')) {
            throw new common_exception_MissingParameter('uri', __METHOD__);
        }
        if (!$this->hasRequestParameter('stylesheetUri')) {
            throw new common_exception_MissingParameter('stylesheetUri', __METHOD__);
        }
        if (!$this->hasRequestParameter('lang')) {
            throw new common_exception_MissingParameter('lang', __METHOD__);
        }


        $item = new \core_kernel_classes_Resource($this->getRequestParameter('uri'));
        $lang = $this->getRequestParameter('lang');
        $styleSheet = $this->getRequestParameter('stylesheetUri');

        if (!\tao_helpers_File::securityCheck($styleSheet, true)) {
            throw new \common_exception_Error('invalid stylesheet path "'.$styleSheet.'"');
        }

        header('Set-Cookie: fileDownload=true');
        setcookie('fileDownload','true', 0, '/');
        header('Content-type: application/octet-stream');
        header(sprintf('Content-Disposition: attachment; filename=%s', basename($styleSheet)));
        echo CssHelper::downloadCssFile($item, $lang, $styleSheet);
    }
public function download ( ) { if ( ! $ this -> hasRequestParameter ( 'uri' ) ) { throw new common_exception_MissingParameter ( 'uri' , __METHOD__ ) ; } if ( ! $ this -> hasRequestParameter ( 'stylesheetUri' ) ) { throw new common_exception_MissingParameter ( 'stylesheetUri' , __METHOD__ ) ; } if ( ! $ this -> hasRequestParameter ( 'lang' ) ) { throw new common_exception_MissingParameter ( 'lang' , __METHOD__ ) ; } $ item = new \ core_kernel_classes_Resource ( $ this -> getRequestParameter ( 'uri' ) ) ; $ lang = $ this -> getRequestParameter ( 'lang' ) ; $ styleSheet = $ this -> getRequestParameter ( 'stylesheetUri' ) ; if ( ! \ tao_helpers_File :: securityCheck ( $ styleSheet , true ) ) { throw new \ common_exception_Error ( 'invalid stylesheet path "' . $ styleSheet . '"' ) ; } header ( 'Set-Cookie: fileDownload=true' ) ; setcookie ( 'fileDownload' , 'true' , 0 , '/' ) ; header ( 'Content-type: application/octet-stream' ) ; header ( sprintf ( 'Content-Disposition: attachment; filename=%s' , basename ( $ styleSheet ) ) ) ; echo CssHelper :: downloadCssFile ( $ item , $ lang , $ styleSheet ) ; }
Download custom styles
Download custom styles