* zin: optimize the use of thinkchecklist wg.

This commit is contained in:
wangzemei
2024-05-11 15:11:09 +08:00
parent 04fcab3a87
commit d541f304ca
2 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -74,7 +74,7 @@ class thinkCheckList extends wg
(
set(array(
'rows' => 1,
'class' => 'hidden',
'class' => isset($item['checked']) && $item['checked'] ? '' : 'hidden',
'name' => 'other',
'value' => isset($item['showText']) ? $item['showText'] : '',
'placeholder' => $lang->thinkrun->placeholder->otherOption
+4 -3
View File
@@ -2,7 +2,7 @@
declare(strict_types=1);
namespace zin;
require_once dirname(__DIR__) . DS . 'thinkradiolist' . DS . 'v1.php';
require_once dirname(__DIR__) . DS . 'thinkchecklist' . DS . 'v1.php';
class thinkRun extends wg
{
protected static array $defineProps = array(
@@ -17,7 +17,7 @@ class thinkRun extends wg
$options = json_decode($item->options);
$answer = json_decode($item->answer);
if($options->questionType == 'radio')
if($options->questionType == 'radio' || $options->questionType == 'checkbox')
{
$fields = $options->fields ? explode(', ', $options->fields) : array();
$showFields = array();
@@ -25,8 +25,9 @@ class thinkRun extends wg
if($options->enableOther) $showFields[] = array('text' => $lang->thinkwizard->step->other, 'value' => 'other', 'isOther' => '1', 'showText' => isset($answer->other) ? $answer->other : '');
return new thinkRadioList
return new thinkCheckList
(
set::type($options->questionType),
setClass('mt-6'),
set::items($showFields),
set::name('result'),