From be823eddf7c92d4af3bb8755bf45a8bc8bacc84e Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Thu, 18 Jun 2015 13:35:30 +0200 Subject: [PATCH] Fixed boolean user group option type --- .../files/acp/templates/userGroupOption.tpl | 60 +++++++++++++------ .../BooleanUserGroupOptionType.class.php | 8 +++ 2 files changed, 50 insertions(+), 18 deletions(-) diff --git a/wcfsetup/install/files/acp/templates/userGroupOption.tpl b/wcfsetup/install/files/acp/templates/userGroupOption.tpl index ab6cd929d9..94017fec83 100644 --- a/wcfsetup/install/files/acp/templates/userGroupOption.tpl +++ b/wcfsetup/install/files/acp/templates/userGroupOption.tpl @@ -1,26 +1,50 @@ {include file='header'}
diff --git a/wcfsetup/install/files/lib/system/option/user/group/BooleanUserGroupOptionType.class.php b/wcfsetup/install/files/lib/system/option/user/group/BooleanUserGroupOptionType.class.php index 3c72f32731..99b647baaa 100644 --- a/wcfsetup/install/files/lib/system/option/user/group/BooleanUserGroupOptionType.class.php +++ b/wcfsetup/install/files/lib/system/option/user/group/BooleanUserGroupOptionType.class.php @@ -36,6 +36,14 @@ class BooleanUserGroupOptionType extends BooleanOptionType implements IUserGroup return WCF::getTPL()->fetch('userGroupBooleanOptionType'); } + /** + * @see \wcf\system\option\IOptionType::getData() + */ + public function getData(Option $option, $newValue) { + if ($newValue == -1 || $newValue == 1) return $newValue; + return 0; + } + /** * @see \wcf\system\option\IOptionType::getCSSClassName() */ -- 2.20.1