Remove remnants of never used boolean label object type container
authorMatthias Schmidt <gravatronics@live.com>
Sun, 2 Oct 2016 13:11:15 +0000 (15:11 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 2 Oct 2016 13:11:15 +0000 (15:11 +0200)
wcfsetup/install/files/lib/acp/form/LabelGroupAddForm.class.php
wcfsetup/install/files/lib/system/label/object/type/LabelObjectTypeContainer.class.php

index 39bef2b23af3ca374f4bb906f76d5b8544d8c8e8..19d3628829ffd1ff782d8a80c5109adb0b412573 100644 (file)
@@ -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);
                                }
                        }
                }
index 838cfa0b7094c62929f98aa25a9e03bde17d1336..180f45c718e62f1d735483c8a4d0b8774e5ad45a 100644 (file)
@@ -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