From 2fbf5c66d46783e998d177f8432a0602b3ea698e Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sun, 2 Oct 2016 15:11:15 +0200 Subject: [PATCH] Remove remnants of never used boolean label object type container --- .../lib/acp/form/LabelGroupAddForm.class.php | 28 +++++---------- .../type/LabelObjectTypeContainer.class.php | 36 +------------------ 2 files changed, 9 insertions(+), 55 deletions(-) diff --git a/wcfsetup/install/files/lib/acp/form/LabelGroupAddForm.class.php b/wcfsetup/install/files/lib/acp/form/LabelGroupAddForm.class.php index 39bef2b23a..19d3628829 100644 --- a/wcfsetup/install/files/lib/acp/form/LabelGroupAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/LabelGroupAddForm.class.php @@ -273,27 +273,15 @@ class LabelGroupAddForm extends AbstractForm { $data = &$this->objectTypes; } - // no data provided and no POST data exists - /*if ($data === null || !is_array($data)) { - // nothing to do here - return; - }*/ - foreach ($this->labelObjectTypeContainers as $objectTypeID => $container) { - if ($container->isBooleanOption()) { - $optionValue = isset($data[$objectTypeID]) ? 1 : 0; - $container->setOptionValue($optionValue); - } - else { - $hasData = isset($data[$objectTypeID]); - foreach ($container as $object) { - if (!$hasData) { - $object->setOptionValue(0); - } - else { - $optionValue = in_array($object->getObjectID(), $data[$objectTypeID]) ? 1 : 0; - $object->setOptionValue($optionValue); - } + $hasData = isset($data[$objectTypeID]); + foreach ($container as $object) { + if (!$hasData) { + $object->setOptionValue(0); + } + else { + $optionValue = in_array($object->getObjectID(), $data[$objectTypeID]) ? 1 : 0; + $object->setOptionValue($optionValue); } } } diff --git a/wcfsetup/install/files/lib/system/label/object/type/LabelObjectTypeContainer.class.php b/wcfsetup/install/files/lib/system/label/object/type/LabelObjectTypeContainer.class.php index 838cfa0b70..180f45c718 100644 --- a/wcfsetup/install/files/lib/system/label/object/type/LabelObjectTypeContainer.class.php +++ b/wcfsetup/install/files/lib/system/label/object/type/LabelObjectTypeContainer.class.php @@ -11,12 +11,6 @@ use wcf\data\object\type\ObjectTypeCache; * @package WoltLabSuite\Core\System\Label\Object\Type */ class LabelObjectTypeContainer implements \Countable, \Iterator { - /** - * true if container represents only a boolean option - * @var boolean - */ - public $isBooleanOption = false; - /** * list of object types * @var LabelObjectType[] @@ -29,12 +23,6 @@ class LabelObjectTypeContainer implements \Countable, \Iterator { */ public $objectTypeID = 0; - /** - * option value if container is a boolean option itself - * @var boolean - */ - public $optionValue = false; - /** * iterator position * @var integer @@ -45,13 +33,9 @@ class LabelObjectTypeContainer implements \Countable, \Iterator { * Creates a new LabelObjectTypeContainer object. * * @param integer $objectTypeID - * @param boolean $isBooleanOption - * @param boolean $optionValue */ - public function __construct($objectTypeID, $isBooleanOption = false, $optionValue = false) { + public function __construct($objectTypeID) { $this->objectTypeID = $objectTypeID; - $this->isBooleanOption = $isBooleanOption; - $this->optionValue = $optionValue; } /** @@ -81,24 +65,6 @@ class LabelObjectTypeContainer implements \Countable, \Iterator { return ObjectTypeCache::getInstance()->getObjectType($this->getObjectTypeID())->objectType; } - /** - * Returns true, if container represents only a boolean option. - * - * @return boolean - */ - public function isBooleanOption() { - return $this->isBooleanOption; - } - - /** - * Returns option value. - * - * @return boolean - */ - public function getOptionValue() { - return $this->optionValue; - } - /** * @inheritDoc * @return LabelObjectType -- 2.20.1