change call for inserting fine uploader template and js code

This commit is contained in:
Uwe Steinmann 2017-03-15 16:40:41 +01:00
parent 8ebe59c399
commit 6266fee9e7
3 changed files with 23 additions and 7 deletions

View File

@ -34,11 +34,12 @@ class SeedDMS_View_AddDocument extends SeedDMS_Bootstrap_Style {
function js() { /* {{{ */
$dropfolderdir = $this->params['dropfolderdir'];
$partitionsize = $this->params['partitionsize'];
$maxuploadsize = $this->params['maxuploadsize'];
$enablelargefileupload = $this->params['enablelargefileupload'];
header('Content-Type: application/javascript; charset=UTF-8');
if($enablelargefileupload)
$this->printFineUploaderJs('../op/op.UploadChunks.php', $partitionsize);
$this->printFineUploaderJs('../op/op.UploadChunks.php', $partitionsize, $maxuploadsize);
?>
$(document).ready(function() {
$('#new-file').click(function(event) {
@ -146,8 +147,10 @@ $(document).ready(function() {
$folderid = $folder->getId();
$this->htmlAddHeader('<script type="text/javascript" src="../styles/'.$this->theme.'/validate/jquery.validate.js"></script>'."\n", 'js');
if($enablelargefileupload)
if($enablelargefileupload) {
$this->htmlAddHeader('<script type="text/javascript" src="../styles/'.$this->theme.'/fine-uploader/jquery.fine-uploader.min.js"></script>'."\n", 'js');
$this->htmlAddHeader($this->getFineUploaderTemplate(), 'js');
}
$this->htmlStartPage(getMLText("folder_title", array("foldername" => htmlspecialchars($folder->getName()))));
$this->globalNavigation($folder);

View File

@ -34,9 +34,10 @@ class SeedDMS_View_AddFile extends SeedDMS_Bootstrap_Style {
function js() { /* {{{ */
$enablelargefileupload = $this->params['enablelargefileupload'];
$partitionsize = $this->params['partitionsize'];
$maxuploadsize = $this->params['maxuploadsize'];
header('Content-Type: application/javascript');
if($enablelargefileupload)
$this->printFineUploaderJs('../op/op.UploadChunks.php', $partitionsize);
$this->printFineUploaderJs('../op/op.UploadChunks.php', $partitionsize, $maxuploadsize);
?>
$(document).ready( function() {
@ -119,8 +120,10 @@ $(document).ready( function() {
$enablelargefileupload = $this->params['enablelargefileupload'];
$this->htmlAddHeader('<script type="text/javascript" src="../styles/'.$this->theme.'/validate/jquery.validate.js"></script>'."\n", 'js');
if($enablelargefileupload)
if($enablelargefileupload) {
$this->htmlAddHeader('<script type="text/javascript" src="../styles/'.$this->theme.'/fine-uploader/jquery.fine-uploader.min.js"></script>'."\n", 'js');
$this->htmlAddHeader($this->getFineUploaderTemplate(), 'js');
}
$this->htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))));
$this->globalNavigation($folder);

View File

@ -36,13 +36,14 @@ class SeedDMS_View_UpdateDocument extends SeedDMS_Bootstrap_Style {
$dropfolderdir = $this->params['dropfolderdir'];
$enablelargefileupload = $this->params['enablelargefileupload'];
$partitionsize = $this->params['partitionsize'];
$maxuploadsize = $this->params['maxuploadsize'];
header('Content-Type: application/javascript');
$this->printDropFolderChooserJs("form1");
$this->printSelectPresetButtonJs();
$this->printInputPresetButtonJs();
$this->printCheckboxPresetButtonJs();
if($enablelargefileupload)
$this->printFineUploaderJs('../op/op.UploadChunks.php', $partitionsize, false);
$this->printFineUploaderJs('../op/op.UploadChunks.php', $partitionsize, $maxuploadsize, false);
?>
$(document).ready( function() {
jQuery.validator.addMethod("alternatives", function(value, element, params) {
@ -129,6 +130,7 @@ console.log(element);
$document = $this->params['document'];
$strictformcheck = $this->params['strictformcheck'];
$enablelargefileupload = $this->params['enablelargefileupload'];
$maxuploadsize = $this->params['maxuploadsize'];
$enableadminrevapp = $this->params['enableadminrevapp'];
$enableownerrevapp = $this->params['enableownerrevapp'];
$enableselfrevapp = $this->params['enableselfrevapp'];
@ -138,8 +140,10 @@ console.log(element);
$documentid = $document->getId();
$this->htmlAddHeader('<script type="text/javascript" src="../styles/'.$this->theme.'/validate/jquery.validate.js"></script>'."\n", 'js');
if($enablelargefileupload)
if($enablelargefileupload) {
$this->htmlAddHeader('<script type="text/javascript" src="../styles/'.$this->theme.'/fine-uploader/jquery.fine-uploader.min.js"></script>'."\n", 'js');
$this->htmlAddHeader($this->getFineUploaderTemplate(), 'js');
}
$this->htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))));
$this->globalNavigation($folder);
@ -182,8 +186,14 @@ console.log(element);
}
}
$msg = getMLText("max_upload_size").": ".ini_get( "upload_max_filesize");
if($enablelargefileupload) {
if($maxuploadsize) {
$msg = getMLText("max_upload_size").": ".SeedDMS_Core_File::format_filesize($maxuploadsize);
}
} else {
$msg = getMLText("max_upload_size").": ".ini_get( "upload_max_filesize");
}
if(0 && $enablelargefileupload) {
$msg .= "<p>".sprintf(getMLText('link_alt_updatedocument'), "out.AddMultiDocument.php?folderid=".$folder->getID()."&showtree=".showtree())."</p>";
}
$this->warningMsg($msg);