From 61855903bd5db816a40a127e234babedb857f527 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Thu, 18 Jun 2015 14:53:14 +0200 Subject: [PATCH] Using new boolean type for options, unified phrase --- .../install/files/acp/templates/booleanOptionType.tpl | 11 ++++++++++- .../acp/templates/userGroupBooleanOptionType.tpl | 6 +++--- .../lib/system/option/BooleanOptionType.class.php | 9 +-------- .../user/group/BooleanUserGroupOptionType.class.php | 10 +--------- wcfsetup/install/lang/de.xml | 6 +++--- wcfsetup/install/lang/en.xml | 6 +++--- 6 files changed, 21 insertions(+), 27 deletions(-) diff --git a/wcfsetup/install/files/acp/templates/booleanOptionType.tpl b/wcfsetup/install/files/acp/templates/booleanOptionType.tpl index 532f54a5c4..22338b3f9a 100644 --- a/wcfsetup/install/files/acp/templates/booleanOptionType.tpl +++ b/wcfsetup/install/files/acp/templates/booleanOptionType.tpl @@ -1 +1,10 @@ - +
    +
  1. + + +
  2. +
  3. + + +
  4. +
diff --git a/wcfsetup/install/files/acp/templates/userGroupBooleanOptionType.tpl b/wcfsetup/install/files/acp/templates/userGroupBooleanOptionType.tpl index 9d2cd5094c..91583a7f46 100644 --- a/wcfsetup/install/files/acp/templates/userGroupBooleanOptionType.tpl +++ b/wcfsetup/install/files/acp/templates/userGroupBooleanOptionType.tpl @@ -1,16 +1,16 @@
  1. - +
  2. - +
  3. {if $group === null || !$group->isEveryone()}
  4. - +
  5. {/if}
diff --git a/wcfsetup/install/files/lib/system/option/BooleanOptionType.class.php b/wcfsetup/install/files/lib/system/option/BooleanOptionType.class.php index 851b67aec9..923406c004 100644 --- a/wcfsetup/install/files/lib/system/option/BooleanOptionType.class.php +++ b/wcfsetup/install/files/lib/system/option/BooleanOptionType.class.php @@ -36,17 +36,10 @@ class BooleanOptionType extends AbstractOptionType implements ISearchableUserOpt * @see \wcf\system\option\IOptionType::getData() */ public function getData(Option $option, $newValue) { - if ($newValue !== null) return 1; + if ($newValue == 1) return 1; return 0; } - /** - * @see \wcf\system\option\IOptionType::getCSSClassName() - */ - public function getCSSClassName() { - return 'reversed'; - } - /** * @see \wcf\system\option\ISearchableUserOption::getSearchFormElement() */ 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 99b647baaa..ecc60d485a 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 @@ -40,15 +40,7 @@ class BooleanUserGroupOptionType extends BooleanOptionType implements IUserGroup * @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() - */ - public function getCSSClassName() { - return ''; + return ($newValue == -1) ? -1 : parent::getData($option, $newValue); } /** diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml index c838057ba9..246ec3c739 100644 --- a/wcfsetup/install/lang/de.xml +++ b/wcfsetup/install/lang/de.xml @@ -440,9 +440,6 @@ - - - @@ -1080,6 +1077,9 @@ GmbH=Gesellschaft mit beschränkter Haftung]]> + + + diff --git a/wcfsetup/install/lang/en.xml b/wcfsetup/install/lang/en.xml index 9067773a95..e4c900f41f 100644 --- a/wcfsetup/install/lang/en.xml +++ b/wcfsetup/install/lang/en.xml @@ -439,9 +439,6 @@ Examples for medium ID detection: - - - @@ -1079,6 +1076,9 @@ GmbH=Gesellschaft mit beschränkter Haftung]]> + + + -- 2.20.1