1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-12 01:34:31 +02:00
This commit is contained in:
Ryan Cramer
2021-07-30 12:01:58 -04:00
parent 6fa2940f1b
commit 992839e13d

View File

@@ -49,7 +49,7 @@
* @property int|bool $useOther Use the "other" option? (default=false)
* @property bool|int $useVertical Use vertically oriented radio buttons? Applies only if $inputfieldClass is 'InputfieldRadios' (default=false)
* @property bool|int $useDeselect Allow radios or toggles to be de-selected, enabling possibility of no-selection? (default=false)
* @property int|string $defaultOption Default selected value of 0, 1, 2 or '' (default='')
* @property string $defaultOption Default selected value of 'no', 'yes', 'other' or 'none' (default='none')
* @property string $inputfieldClass Inputfield class to use or blank for this toggle buttons (default='')
*
* @method InputfieldSelect|InputfieldRadios getInputfield()
@@ -184,6 +184,8 @@ class InputfieldToggle extends Inputfield {
} else {
if($value > -1) return false;
}
} else if($value && $value !== 'unknown' && isset($this->valueTypes[$value])) {
return false;
}
if($value === self::valueOther && $this->useOther) return false;
return true;