Skip to content

Commit

Permalink
Update FormHelper.php
Browse files Browse the repository at this point in the history
  • Loading branch information
funadmin authored Aug 26, 2023
1 parent 2f3d544 commit b8aa917
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/helper/FormHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -1106,7 +1106,7 @@ public function upload($name = 'avatar', $options = [], $value = '')
];
$data_value = $this->getOptionsAttr($name,$cops);
$croper_container = <<<EOF
<button type="button" {$data_value} class="layui-btn" id="cropper-{$id}"><i class="layui-icon layui-icon-upload"></i>
<button type="button" {$data_value} class="layui-btn layui-btn-sm" id="cropper-{$id}"><i class="layui-icon layui-icon-upload"></i>
{$this->__('Cropper')}
</button>
EOF;
Expand Down Expand Up @@ -1183,9 +1183,8 @@ public function upload($name = 'avatar', $options = [], $value = '')
if ((isset($options['select']) && $options['select']) || !isset($options['select'])) {
$select_options = $options;
$select_options['filter'] = $options['select'] ?? 'upload-select'; //可选upload-choose
$css .= 'width:53%!important;';
$select_container = <<<EOF
<button id="select-{$id}" type="button" {$this->getOptionsAttr($name,$select_options)} class="layui-btn layui-btn-danger {$options['select']}"><i class="layui-icon layui-icon-radio"></i>{$this->__('Choose')}</button>
<button id="select-{$id}" type="button" {$this->getOptionsAttr($name,$select_options)} class="layui-btn layui-btn-sm layui-btn-danger {$options['select']}"><i class="layui-icon layui-icon-radio"></i>{$this->__('Choose')}</button>
EOF;
}

Expand All @@ -1194,15 +1193,14 @@ public function upload($name = 'avatar', $options = [], $value = '')
<style>
.layui-input-upload{
{$css};
width:65%
}
</style>
<div class="layui-form-item">{$label}
<div class="layui-input-block">
<div class="layui-upload">
<input {$this->getNameValueAttr($name,$value,$options)} lay-verify="{$verify}" type="text" class="layui-input layui-input-upload attach {$this->getClass($options)}" />
{$croper_container}
<button id="upload-{$id}" type="button" {$this->getOptionsAttr($name,$options)} style="margin-left:0px" class="layui-btn layui-btn-normal"><i class="layui-icon layui-icon-upload-drag"></i>{$this->__('Uploads')}</button>
<button id="upload-{$id}" type="button" {$this->getOptionsAttr($name,$options)} style="margin-left:0px" class="layui-btn layui-btn-sm layui-btn-normal "><i class="layui-icon layui-icon-upload-drag"></i>{$this->__('Uploads')}</button>
{$select_container}
<div class="layui-upload-list">{$li}
</div>
Expand Down

0 comments on commit b8aa917

Please sign in to comment.