From 65068c9a29f9a64630cbab9568df76f88080c8ac Mon Sep 17 00:00:00 2001 From: Karson Date: Fri, 7 Jul 2023 16:09:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dcheckbox=E5=92=8Cradio?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/common.php | 4 ++-- extend/fast/Form.php | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/application/admin/common.php b/application/admin/common.php index 502c5348..a034f038 100755 --- a/application/admin/common.php +++ b/application/admin/common.php @@ -39,7 +39,7 @@ if (!function_exists('build_radios')) { $selected = is_null($selected) ? key($list) : $selected; $selected = is_array($selected) ? $selected : explode(',', $selected); foreach ($list as $k => $v) { - $html[] = sprintf(Form::label("{$name}-{$k}", "%s {$v}"), Form::radio($name, $k, in_array($k, $selected), ['id' => "{$name}-{$k}"])); + $html[] = sprintf(Form::label("{$name}-{$k}", "%s " . str_replace('%', '%%', $v)), Form::radio($name, $k, in_array($k, $selected), ['id' => "{$name}-{$k}"])); } return '
' . implode(' ', $html) . '
'; } @@ -60,7 +60,7 @@ if (!function_exists('build_checkboxs')) { $selected = is_null($selected) ? [] : $selected; $selected = is_array($selected) ? $selected : explode(',', $selected); foreach ($list as $k => $v) { - $html[] = sprintf(Form::label("{$name}-{$k}", "%s {$v}"), Form::checkbox($name, $k, in_array($k, $selected), ['id' => "{$name}-{$k}"])); + $html[] = sprintf(Form::label("{$name}-{$k}", "%s " . str_replace('%', '%%', $v)), Form::checkbox($name, $k, in_array($k, $selected), ['id' => "{$name}-{$k}"])); } return '
' . implode(' ', $html) . '
'; } diff --git a/extend/fast/Form.php b/extend/fast/Form.php index 173b7380..e1041a17 100644 --- a/extend/fast/Form.php +++ b/extend/fast/Form.php @@ -870,7 +870,7 @@ EOD; $checked = is_array($checked) ? $checked : explode(',', $checked); foreach ($list as $k => $v) { $options['id'] = "{$name}-{$k}"; - $html[] = sprintf(Form::label("{$name}-{$k}", "%s {$v}"), Form::checkbox("{$name}[{$k}]", $k, in_array($k, $checked), $options)); + $html[] = sprintf(Form::label("{$name}-{$k}", "%s " . str_replace('%', '%%', $v)), Form::checkbox("{$name}[{$k}]", $k, in_array($k, $checked), $options)); } return '
' . implode(' ', $html) . '
'; } @@ -913,7 +913,7 @@ EOD; $checked = is_array($checked) ? $checked : explode(',', $checked); foreach ($list as $k => $v) { $options['id'] = "{$name}-{$k}"; - $html[] = sprintf(Form::label("{$name}-{$k}", "%s {$v}"), Form::radio($name, $k, in_array($k, $checked), $options)); + $html[] = sprintf(Form::label("{$name}-{$k}", "%s " . str_replace('%', '%%', $v)), Form::radio($name, $k, in_array($k, $checked), $options)); } return '
' . implode(' ', $html) . '
'; } @@ -1002,8 +1002,8 @@ EOD; { $domname = str_replace(['[', ']', '.'], '', $name); $options = [ - 'id' => "plupload-{$domname}", - 'class' => "btn btn-danger plupload", + 'id' => "faupload-{$domname}", + 'class' => "btn btn-danger faupload", 'data-input-id' => "c-{$domname}", ]; $upload = $uploadAttr === false ? false : true; @@ -1023,7 +1023,7 @@ EOD; } $chooseBtn = $choose ? $this->button(' ' . __('Choose'), array_merge($options, $chooseAttr)) : ''; $previewAttrHtml = $this->attributes($previewAttr); - $previewArea = $preview ? '' : ''; + $previewArea = $preview ? '' : ''; $input = $this->text($name, $value, array_merge(['size' => 50, 'id' => "c-{$domname}"], $inputAttr)); $html = <<