示例#1
0
							display: none;
							text-align: center;
						}	
						</style>');
        $DIALOG->bodyInclude = WPRO_DIR . 'core/plugins/wproCore_fileBrowser/tpl/upload.tpl.php';
        $DIALOG->formTags = false;
        //if ($EDITOR->_browserType == 'safari') $DIALOG->formOnSubmit = false;
        //$DIALOG->formEnctype = 'multipart/form-data';
        $DIALOG->template->assign('mode', $dir->type);
        $DIALOG->template->assign('dir', $dir);
        $DIALOG->options = array(array('onclick' => 'doUpload()', 'type' => 'button', 'name' => 'ok', 'value' => $DIALOG->langEngine->get('wproCore_fileBrowser', 'upload')), array('onclick' => 'dialog.close()', 'type' => 'button', 'name' => 'close', 'value' => $DIALOG->langEngine->get('core', 'cancel')));
        $fs = new wproFilesystem();
        switch ($dir->type) {
            case 'image':
                /* extensions and file sizes */
                $sizeLimit = $fs->returnBytes($EDITOR->maxImageSize);
                $extensions = $EDITOR->allowedImageExtensions;
                break;
            case 'document':
                $sizeLimit = $fs->returnBytes($EDITOR->maxDocSize);
                $extensions = $EDITOR->allowedDocExtensions;
                break;
            case 'media':
                $sizeLimit = $fs->returnBytes($EDITOR->maxMediaSize);
                $extensions = $EDITOR->allowedMediaExtensions;
                break;
        }
        // calculate max size allowed by server
        // the smaller of these two values is our upload limit -  I think? any PHP experts want to comment on this?
        $php_max_upload = $fs->returnBytes(ini_get('upload_max_filesize'));
        $php_max_post = $fs->returnBytes(ini_get('post_max_size'));