From e3dd067cefe120216adf7407de7c97081a680b2b Mon Sep 17 00:00:00 2001 From: Karson Date: Wed, 14 Jan 2026 11:24:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96Form::switcher=E7=94=9F?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extend/fast/Form.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/extend/fast/Form.php b/extend/fast/Form.php index 31d259ca..3260c4df 100644 --- a/extend/fast/Form.php +++ b/extend/fast/Form.php @@ -520,14 +520,22 @@ class FormBuilder $yes = $options['yes']; $no = $options['no']; } - $grayclass = $yes == $value ? "": "fa-flip-horizontal text-gray"; $disabled = (isset($options['disabled']) && $options['disabled']) || in_array('disabled', $options) ? "disabled" : ''; $color = $options['color'] ?? 'success'; unset($options['yes'], $options['no'], $options['color'], $options['disabled']); $attr = $this->attributes($options); + if (in_array($value, [(string)$yes, (string)$no])) { + $grayclass = $yes == $value ? "" : "fa-flip-horizontal text-gray"; + $innerElement = ""; + } else { + $title = __('Status unknown, please manually change the status'); + $innerElement = << +EOD; + } $html = << +{$innerElement} EOD; return $html; }