Skip to content

Commit

Permalink
Update FormHelper.php
Browse files Browse the repository at this point in the history
  • Loading branch information
funadmin authored Jul 8, 2023
1 parent 171c37e commit 903d492
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions src/helper/FormHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -1014,16 +1014,12 @@ public function upload($name = 'avatar', $options = [], $value = '')
$li = '';
$croper_container = '';
if (isset($options['cropper'])) {
$options['width'] = $options['width'] ?? '300';
$options['height'] = $options['height'] ?? '300';
$options['mark'] = $options['mark'] ?? '1';
$options['area'] = $options['area'] ?? '800px';
$cops = ['name'=>$name,
'path' => $options['path'],
'width' => $options['width'],
'height' => $options['height'],
'mark' => $options['mark'],
'area' => $options['area'],
'width' => $options['saveW'] ?? '300',
'height' => $options['saveW'] ?? '300',
'mark' => $options['mark'] ?? 1,
'area' => $options['area'] ?? '800px',
'filter' => 'cropper',
];
$data_value = $this->getOptionsAttr($name,$cops);
Expand Down Expand Up @@ -1098,17 +1094,19 @@ public function upload($name = 'avatar', $options = [], $value = '')
'chunk' => $options['chunk'] ?? false,
];
$options = array_merge($op, $options);
$label = $this->label($name,$options) ;
$verify = $options['verify']??"";
$options['verify'] = '';
$select_container = '';
if ((isset($options['select']) && $options['select']) || !isset($options['select'])) {
$options['select'] = $options['select'] ?? 'upload-select'; //可选upload-choose
$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" class="layui-btn layui-btn-danger {$options['select']}" lay-filter="{$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-danger {$options['select']}"><i class="layui-icon layui-icon-radio"></i>{$this->__('Choose')}</button>
EOF;
}
$label = $this->label($name,$options) ;
$verify = $options['verify']??"";
$options['verify'] = '';

if (!isset($options['filter'])) $options['filter'] = 'upload'; //监听
$str = <<<EOF
<style>
Expand Down

0 comments on commit 903d492

Please sign in to comment.