当前位置: 首页>>代码示例>>PHP>>正文


PHP JUDownloadHelper::getPostMaxSize方法代码示例

本文整理汇总了PHP中JUDownloadHelper::getPostMaxSize方法的典型用法代码示例。如果您正苦于以下问题:PHP JUDownloadHelper::getPostMaxSize方法的具体用法?PHP JUDownloadHelper::getPostMaxSize怎么用?PHP JUDownloadHelper::getPostMaxSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JUDownloadHelper的用法示例。


在下文中一共展示了JUDownloadHelper::getPostMaxSize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: uploadFileScript

    public function uploadFileScript($doc_id = null, $selector = "#judl-files")
    {
        $params = JUDownloadHelper::getParams(null, $doc_id);
        $max_upload_file_size = (int) $params->get("max_upload_file_size", 10) * 1024 * 1024;
        $post_max_size = JUDownloadHelper::getPostMaxSize();
        if ($max_upload_file_size < $post_max_size) {
            $runtimes = 'html5,flash,silverlight,html4';
        } else {
            $runtimes = 'html5,silverlight,html4';
        }
        $chunk_size = JUDownloadHelper::getPostMaxSize() - 4000;
        $max_upload_files = 1;
        $legal_upload_extensions = $params->get("legal_upload_extensions", "bmp,csv,doc,gif,ico,jpg,jpeg,odg,odp,ods,odt,pdf,png,ppt,swf,txt,xcf,xls,zip,rar");
        $legal_upload_extensions = str_replace("\n", ",", trim($legal_upload_extensions));
        $check_mime_uploaded_file = (int) $params->get("check_mime_uploaded_file", 0);
        $legal_mime_types = $check_mime_uploaded_file ? $params->get("legal_mime_types", 'image/jpeg,image/gif,image/png,image/bmp,application/x-shockwave-flash,application/msword,application/excel,application/pdf,application/powerpoint,text/plain,application/zip,application/zip') : "";
        if ($legal_mime_types) {
            $legal_mime_types = str_replace("\n", ",", trim($legal_mime_types));
        }
        $requiredFile = $params->get("document_require_file", 1);
        $time = time();
        $secret = JFactory::getConfig()->get('secret');
        $code = md5($time . $secret);
        $document = JFactory::getDocument();
        $app = JFactory::getApplication();
        $script = '
			jQuery(document).ready(function ($) {
				var options = {
					doc_id                   : ' . (int) $doc_id . ',
					juri_root                : "' . JUri::root() . '",
					juri_base                : "' . JUri::base() . '",
					runtimes                 : "' . $runtimes . '",
					chunk_size               : "' . $chunk_size . '",
					max_upload_file_size     : ' . $max_upload_file_size . ',
					max_upload_files         : ' . $max_upload_files . ',
					extensions               : "' . $legal_upload_extensions . '",
					mime_types               : "' . $legal_mime_types . '",
					is_required              : ' . (int) $requiredFile . ',
					time                     : ' . $time . ',
					code                     : "' . $code . '",
					is_site                  : ' . (int) $app->isSite() . '
				};
				$("' . $selector . '").files(options);
			});';
        $document->addScriptDeclaration($script);
    }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:46,代码来源:document.php


注:本文中的JUDownloadHelper::getPostMaxSize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。