* finish task #2885.

This commit is contained in:
wangyidong
2017-02-08 10:23:33 +08:00
parent 3d380fa3a3
commit 217c6c4795
4 changed files with 24 additions and 1 deletions

View File

@@ -427,6 +427,13 @@ class extension extends control
*/ */
public function upload() public function upload()
{ {
$statusFile = $this->loadModel('upgrade')->checkSafeFile();
if($statusFile)
{
$this->view->error = sprintf($this->lang->extension->noticeOkFile, $statusFile);
die($this->display());
}
if($_FILES) if($_FILES)
{ {
$tmpName = $_FILES['file']['tmp_name']; $tmpName = $_FILES['file']['tmp_name'];

View File

@@ -17,11 +17,21 @@
<strong><?php echo $lang->extension->upload;?></strong> <strong><?php echo $lang->extension->upload;?></strong>
</div> </div>
</div> </div>
<?php if(!empty($error)):?>
<div class='panel panel-body text-left'>
<div class='container mw-500px'>
<p class='text-danger'><?php echo $error;?></p>
</div>
<hr>
<?php echo html::commonButton($lang->extension->refreshPage, 'onclick=location.href=location.href');?>
</div>
<?php else:?>
<form method='post' enctype='multipart/form-data' style='padding: 5% 20%'> <form method='post' enctype='multipart/form-data' style='padding: 5% 20%'>
<div class='input-group'> <div class='input-group'>
<input type='file' name='file' class='form-control' /> <input type='file' name='file' class='form-control' />
<span class='input-group-btn'><?php echo html::submitButton($lang->extension->install);?></span> <span class='input-group-btn'><?php echo html::submitButton($lang->extension->install);?></span>
</div> </div>
</form> </form>
<?php endif;?>
</body> </body>
</html> </html>

View File

@@ -4,6 +4,8 @@ table.fileBox td {padding: 0!important}
.fileBox .input-control > input[type='file'] {width: 100%; height: 100%; height: 26px; line-height: 26px; border: none; position: relative;} .fileBox .input-control > input[type='file'] {width: 100%; height: 100%; height: 26px; line-height: 26px; border: none; position: relative;}
.fileBox td .btn {border-radius: 0; border-left: none} .fileBox td .btn {border-radius: 0; border-left: none}
.file-wrapper.form-control {border-right: 0} .file-wrapper.form-control {border-right: 0}
.file-wrapper.form-control .fileControl {width:100%;}
@-moz-document url-prefix(){.file-wrapper.form-control .fileControl {margin-top:-3px;}}
</style> </style>
<div id='fileform'> <div id='fileform'>
<?php <?php

View File

@@ -311,7 +311,11 @@ fieldset > .content table, fieldset > .article-content table{table-layout: initi
.form-condensed .chosen-container-single .chosen-single {padding: 5px 10px} .form-condensed .chosen-container-single .chosen-single {padding: 5px 10px}
.form-condensed .chosen-container-single .chosen-search:before {top: 10px} .form-condensed .chosen-container-single .chosen-search:before {top: 10px}
@-moz-document url-prefix(){.form-condensed textarea.form-control {height: 30px;min-height: 30px;}} @-moz-document url-prefix()
{
.form-condensed textarea.form-control {height: 30px;min-height: 30px;}
.form-control[type='file']{padding:0px;}
}
/* chosen container in col-side */ /* chosen container in col-side */
.col-side .chosen-single {max-width: 218px} .col-side .chosen-single {max-width: 218px}