From: Alexander Ebert Date: Mon, 22 Jan 2018 11:02:21 +0000 (+0100) Subject: Hide validation pattern for boolean option types X-Git-Tag: 3.1.0_RC_2~19 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=86c5b7ac5d0cee091d2b5fb1d2e106c89583eeff;p=GitHub%2FWoltLab%2FWCF.git Hide validation pattern for boolean option types --- diff --git a/wcfsetup/install/files/acp/templates/customOptionAdd.tpl b/wcfsetup/install/files/acp/templates/customOptionAdd.tpl index c9db2b2dab..f7938db0fb 100644 --- a/wcfsetup/install/files/acp/templates/customOptionAdd.tpl +++ b/wcfsetup/install/files/acp/templates/customOptionAdd.tpl @@ -10,6 +10,8 @@ else { $('#selectOptionsDL').hide(); } + + window[($value === 'boolean' ? 'elHide' : 'elShow')](elById('validationPatternDL')); }); $('#optionType').trigger('change'); }); @@ -108,7 +110,7 @@ - +
diff --git a/wcfsetup/install/files/lib/acp/form/AbstractCustomOptionForm.class.php b/wcfsetup/install/files/lib/acp/form/AbstractCustomOptionForm.class.php index dcf1a0425e..7b635ade7d 100644 --- a/wcfsetup/install/files/lib/acp/form/AbstractCustomOptionForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/AbstractCustomOptionForm.class.php @@ -163,6 +163,8 @@ abstract class AbstractCustomOptionForm extends AbstractAcpForm { if ($this->optionType == 'boolean' || $this->optionType == 'integer') { $this->defaultValue = intval($this->defaultValue); + + if ($this->optionType == 'boolean') $this->validationPattern = ''; } if ($this->optionType == 'float') { $this->defaultValue = floatval($this->defaultValue);