* file input support mulitple.
This commit is contained in:
@@ -1,17 +1,10 @@
|
||||
<?php $maxUploadSize = strtoupper(ini_get('upload_max_filesize'));?>
|
||||
<style>
|
||||
.file-input .file-editbox{max-width:40%;}
|
||||
.file-input-list .input-group-btn{float:left}
|
||||
.fileAction {color: #0c64eb !important;}
|
||||
.backgroundColor {background: #eff5ff; }
|
||||
</style>
|
||||
<?php js::set('dangerExtensions', ',' . $this->config->file->dangers . ',');?>
|
||||
<?php js::set('maxUploadSize', $maxUploadSize);?>
|
||||
<div class="file-input-list" data-provide="fileInputList" data-each-file-max-size="<?php echo $maxUploadSize;?>" data-file-size-error="<?php echo sprintf($lang->file->errorFileSize, $maxUploadSize);?>">
|
||||
<?php
|
||||
$maxUploadSize = strtoupper(ini_get('upload_max_filesize'));
|
||||
js::set('dangerExtensions', ',' . $this->config->file->dangers . ',');
|
||||
js::set('maxUploadSize', $maxUploadSize);
|
||||
?>
|
||||
<div class="file-input-list" data-provide="fileInputList" data-each-file-max-size="<?php echo $maxUploadSize; ?>" data-file-size-error="<?php echo sprintf($lang->file->errorFileSize, $maxUploadSize); ?>">
|
||||
<div class="file-input">
|
||||
<div class="file-input-empty">
|
||||
<button type="button" class="btn btn-link file-input-btn"><i class="icon icon-plus"></i> <?php echo $lang->file->addFile;?></button> <small class="muted"><?php echo sprintf($lang->file->maxUploadSize, $maxUploadSize);?></small>
|
||||
</div>
|
||||
<div class="file-input-edit input-group">
|
||||
<div class="input-group-cell"><i class="icon icon-paper-clip text-muted"></i></div>
|
||||
<input type="text" name="<?php echo $labelsName;?>[]" class="form-control file-editbox" placeholder="<?php echo $lang->file->title;?>">
|
||||
@@ -33,7 +26,10 @@
|
||||
</div>
|
||||
<input type="file" name="<?php echo $filesName;?>[]" onchange="checkDangerExtension(this)" />
|
||||
</div>
|
||||
<button type="button" class="btn btn-link file-input-btn"><i class="icon icon-plus"></i> <?php echo $lang->file->addFile;?></button> <small class="muted"><?php echo sprintf($lang->file->maxUploadSize, $maxUploadSize);?></small>
|
||||
<input type="file" id="file-input-multiple" multiple />
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var totalSize = 0;
|
||||
maxUploadSize = unitConversion(maxUploadSize);
|
||||
@@ -66,7 +62,8 @@ function checkDangerExtension(file)
|
||||
var fileName = $(file).val();
|
||||
var index = fileName.lastIndexOf(".");
|
||||
var fileSize = $(file)[0].files[0].size;
|
||||
totalSize += fileSize;
|
||||
|
||||
totalSize += fileSize;
|
||||
|
||||
if(index >= 0)
|
||||
{
|
||||
@@ -95,3 +92,11 @@ function checkDangerExtension(file)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
#file-input-multiple {display: none;}
|
||||
.file-input .file-editbox {max-width: 40%;}
|
||||
.file-input-list .input-group-btn {float: left}
|
||||
.fileAction {color: #0c64eb !important;}
|
||||
.backgroundColor {background: #eff5ff;}
|
||||
</style>
|
||||
|
||||
+4
-4
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user