use new method getMaximumUploadSize()

This commit is contained in:
Uwe Steinmann 2022-04-29 18:30:46 +02:00
parent 9d2dd94662
commit af6f48db48
6 changed files with 8 additions and 37 deletions

View File

@ -148,7 +148,7 @@ class UI extends UI_Default {
$view->setParam('enablesessionlist', $settings->_enableSessionList);
$view->setParam('workflowmode', $settings->_workflowMode);
$view->setParam('partitionsize', SeedDMS_Core_File::parse_filesize( $settings->_partitionSize));
$view->setParam('maxuploadsize', SeedDMS_Core_File::parse_filesize($settings->_maxUploadSize));
$view->setParam('maxuploadsize', $settings->getMaximumUploadSize());
$view->setParam('showmissingtranslations', $settings->_showMissingTranslations);
$view->setParam('defaultsearchmethod', $settings->_defaultSearchMethod);
$view->setParam('cachedir', $settings->_cacheDir);

View File

@ -172,11 +172,7 @@ console.log(params);
$this->contentStart();
$this->pageNavigation($this->getFolderPathHTML($folder, true), "view_folder", $folder);
$mus2 = SeedDMS_Core_File::parse_filesize(ini_get("upload_max_filesize"));
if($maxuploadsize && $maxuploadsize < $mus2)
$msg = getMLText("max_upload_size").": ".SeedDMS_Core_File::format_filesize($maxuploadsize);
else
$msg = getMLText("max_upload_size").": ".SeedDMS_Core_File::format_filesize($mus2);
$this->warningMsg($msg);
$this->contentHeading(getMLText("add_document"));

View File

@ -126,11 +126,7 @@ $(document).ready( function() {
$this->pageNavigation($this->getFolderPathHTML($folder, true, $document), "view_document", $document);
$this->contentHeading(getMLText("linked_files"));
$mus2 = SeedDMS_Core_File::parse_filesize(ini_get("upload_max_filesize"));
if($maxuploadsize && $maxuploadsize < $mus2)
$msg = getMLText("max_upload_size").": ".SeedDMS_Core_File::format_filesize($maxuploadsize);
else
$msg = getMLText("max_upload_size").": ".SeedDMS_Core_File::format_filesize($mus2);
$this->warningMsg($msg);
?>

View File

@ -194,25 +194,7 @@ console.log(element);
}
}
if($enablelargefileupload) {
if($maxuploadsize) {
$msg = getMLText("max_upload_size").": ".SeedDMS_Core_File::format_filesize($maxuploadsize);
} else {
$msg = '';
}
} else {
$msg = getMLText("max_upload_size").": ".ini_get( "upload_max_filesize");
}
$mus2 = SeedDMS_Core_File::parse_filesize(ini_get("upload_max_filesize"));
if($maxuploadsize && $maxuploadsize < $mus2)
$msg = getMLText("max_upload_size").": ".SeedDMS_Core_File::format_filesize($maxuploadsize);
else
$msg = getMLText("max_upload_size").": ".SeedDMS_Core_File::format_filesize($mus2);
if(0 && $enablelargefileupload) {
$msg .= "<p>".sprintf(getMLText('link_alt_updatedocument'), "out.AddMultiDocument.php?folderid=".$folder->getID()."&showtree=".showtree())."</p>";
}
if($msg)
$this->warningMsg($msg);
?>

View File

@ -204,11 +204,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Theme_Style {
echo "SeedDMSUpload.setUrl('".$this->params['settings']->_httpRoot."op/op.Ajax.php');";
echo "SeedDMSUpload.setAbortBtnLabel('".getMLText("cancel")."');";
echo "SeedDMSUpload.setEditBtnLabel('');";
$mus2 = SeedDMS_Core_File::parse_filesize(ini_get("upload_max_filesize"));
if($maxuploadsize && $maxuploadsize < $mus2)
echo "SeedDMSUpload.setMaxFileSize($maxuploadsize);\n";
else
echo "SeedDMSUpload.setMaxFileSize($mus2);\n";
echo "SeedDMSUpload.setMaxFileSizeMsg('".getMLText("uploading_maxsize")."');";
}
?>

View File

@ -470,11 +470,12 @@ $('body').on('click', '.order-btn', function(ev) {
$dms = $this->params['dms'];
$user = $this->params['user'];
$folder = $this->params['folder'];
$maxuploadsize = $this->params['maxuploadsize'];
$this->contentHeading(getMLText("dropupload"), true);
if ($folder->getAccessMode($user) >= M_READWRITE) {
?>
<div id="draganddrophandler" class="well alert alert-warning" data-droptarget="folder_<?php echo $folder->getID(); ?>" data-target="<?php echo $folder->getID(); ?>" data-uploadformtoken="<?php echo createFormKey(''); ?>"><?php printMLText('drop_files_here'); ?></div>
<div id="draganddrophandler" class="well alert alert-warning" data-droptarget="folder_<?php echo $folder->getID(); ?>" data-target="<?php echo $folder->getID(); ?>" data-uploadformtoken="<?php echo createFormKey(''); ?>"><?php printMLText('drop_files_here', ['maxuploadsize'=>SeedDMS_Core_File::format_filesize($maxuploadsize)]); ?></div>
<?php
} else {
$this->errorMsg(getMLText('access_denied'));