Renamed group option types
authorMatthias Schmidt <gravatronics@live.com>
Fri, 12 Aug 2011 21:03:12 +0000 (23:03 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Tue, 16 Aug 2011 11:34:05 +0000 (13:34 +0200)
17 files changed:
wcfsetup/install/files/lib/system/option/group/BooleanGroupOptionType.class.php [new file with mode: 0644]
wcfsetup/install/files/lib/system/option/group/GroupOptionTypeBoolean.class.php [deleted file]
wcfsetup/install/files/lib/system/option/group/GroupOptionTypeGroups.class.php [deleted file]
wcfsetup/install/files/lib/system/option/group/GroupOptionTypeInfiniteInteger.class.php [deleted file]
wcfsetup/install/files/lib/system/option/group/GroupOptionTypeInfiniteInverseInteger.class.php [deleted file]
wcfsetup/install/files/lib/system/option/group/GroupOptionTypeInteger.class.php [deleted file]
wcfsetup/install/files/lib/system/option/group/GroupOptionTypeInverseInteger.class.php [deleted file]
wcfsetup/install/files/lib/system/option/group/GroupOptionTypeText.class.php [deleted file]
wcfsetup/install/files/lib/system/option/group/GroupOptionTypeTextarea.class.php [deleted file]
wcfsetup/install/files/lib/system/option/group/GroupsGroupOptionType.class.php [new file with mode: 0644]
wcfsetup/install/files/lib/system/option/group/IGroupOptionType.class.php
wcfsetup/install/files/lib/system/option/group/InfiniteIntegerGroupOptionType.class.php [new file with mode: 0644]
wcfsetup/install/files/lib/system/option/group/InfiniteInverseIntegerGroupOptionType.class.php [new file with mode: 0644]
wcfsetup/install/files/lib/system/option/group/IntegerGroupOptionType.class.php [new file with mode: 0644]
wcfsetup/install/files/lib/system/option/group/InverseIntegerGroupOptionType.class.php [new file with mode: 0644]
wcfsetup/install/files/lib/system/option/group/TextGroupOptionType.class.php [new file with mode: 0644]
wcfsetup/install/files/lib/system/option/group/TextareaGroupOptionType.class.php [new file with mode: 0644]

diff --git a/wcfsetup/install/files/lib/system/option/group/BooleanGroupOptionType.class.php b/wcfsetup/install/files/lib/system/option/group/BooleanGroupOptionType.class.php
new file mode 100644 (file)
index 0000000..44b122f
--- /dev/null
@@ -0,0 +1,27 @@
+<?php
+namespace wcf\system\option\group;
+use wcf\system\option\BooleanOptionType;
+
+/**
+ * BooleanGroupOptionType is an implementation of IGroupOptionType for boolean values.
+ * The merge of option values returns true, if at least one value is true. Otherwise false.
+ *
+ * @author     Marcel Werk
+ * @copyright  2001-2011 WoltLab GmbH
+ * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package    com.woltlab.wcf
+ * @subpackage system.option.group
+ * @category   Community Framework
+ */
+class BooleanGroupOptionType extends BooleanOptionType implements IGroupOptionType {
+       /**
+        * @see wcf\system\option\group\IGroupOptionType::merge()
+        */
+       public function merge(array $values) {
+               foreach ($values as $value) {
+                       if ($value) return true;
+               }
+
+               return false;
+       }
+}
diff --git a/wcfsetup/install/files/lib/system/option/group/GroupOptionTypeBoolean.class.php b/wcfsetup/install/files/lib/system/option/group/GroupOptionTypeBoolean.class.php
deleted file mode 100644 (file)
index 09bcbfa..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php
-namespace wcf\system\option\group;
-use wcf\system\option\OptionTypeBoolean;
-
-/**
- * GroupOptionTypeBoolean is an implementation of GroupOptionType for boolean values.
- * The merge of option values returns true, if at least one value is true. Otherwise false.
- *
- * @author     Marcel Werk
- * @copyright  2001-2011 WoltLab GmbH
- * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package    com.woltlab.wcf
- * @subpackage system.option.group
- * @category   Community Framework
- */
-class GroupOptionTypeBoolean extends OptionTypeBoolean implements IGroupOptionType {
-       /**
-        * @see wcf\system\option\group\IGroupOptionType::merge()
-        */
-       public function merge(array $values) {
-               foreach ($values as $value) {
-                       if ($value) return true;
-               }
-
-               return false;
-       }
-}
diff --git a/wcfsetup/install/files/lib/system/option/group/GroupOptionTypeGroups.class.php b/wcfsetup/install/files/lib/system/option/group/GroupOptionTypeGroups.class.php
deleted file mode 100644 (file)
index 0203fc9..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-<?php
-namespace wcf\system\option\group;
-use wcf\data\option\Option;
-use wcf\data\user\group\UserGroup;
-use wcf\system\option\AbstractOptionType;
-use wcf\util\ArrayUtil;
-use wcf\util\StringUtil;
-
-/**
- * GroupOptionTypeGroups generates a select-list of all available user groups.
- *
- * @author     Marcel Werk
- * @copyright  2001-2011 WoltLab GmbH
- * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package    com.woltlab.wcf
- * @subpackage system.option.group
- * @category   Community Framework
- */
-class GroupOptionTypeGroups extends AbstractOptionType implements IGroupOptionType {
-       /**
-        * @see wcf\system\option\IOptionType::getFormElement()
-        */
-       public function getFormElement(Option $option, $value) {
-               // get selected group
-               $selectedGroups = explode(',', $value);
-               
-               // get all groups
-               $groups = UserGroup::getGroupsByType();
-               
-               // generate html
-               $html = '';
-               foreach ($groups as $group) {
-                       $html .= '<label><input type="checkbox" name="values['.StringUtil::encodeHTML($option->optionName).'][]" value="'.$group->groupID.'" '.(in_array($group->groupID, $selectedGroups) ? 'checked="checked" ' : '').'/> '.StringUtil::encodeHTML($group->groupName).'</label>';
-               }
-               
-               return $html;
-       }
-       
-       /**
-        * @see wcf\system\option\IOptionType::validate()
-        */
-       public function validate(Option $option, $newValue) {
-               // get all groups
-               $groups = UserGroup::getGroupsByType();
-               
-               // get new value
-               if (!is_array($newValue)) $newValue = array();
-               $selectedGroups = ArrayUtil::toIntegerArray($newValue);
-               
-               // check groups
-               foreach ($selectedGroups as $groupID) {
-                       if (!isset($groups[$groupID])) {
-                               throw new UserInputException($option->optionName, 'validationFailed');
-                       }
-               }
-       }
-       
-       /**
-        * @see wcf\system\option\IOptionType::getData()
-        */
-       public function getData(Option $option, $newValue) {
-               if (!is_array($newValue)) $newValue = array();
-               $newValue = ArrayUtil::toIntegerArray($newValue);
-               sort($newValue, SORT_NUMERIC);
-               return implode(',', $newValue);
-       }
-       
-       /**
-        * @see wcf\system\option\group\IGroupOptionType::merge()
-        */
-       public function merge(array $values) {
-               $result = array();
-               foreach ($values as $value) {
-                       $value = explode(',', $value);
-                       $result = array_merge($result, $value);
-               }
-               
-               $result = array_unique($result);
-
-               return implode(',', $result);
-       }
-}
diff --git a/wcfsetup/install/files/lib/system/option/group/GroupOptionTypeInfiniteInteger.class.php b/wcfsetup/install/files/lib/system/option/group/GroupOptionTypeInfiniteInteger.class.php
deleted file mode 100644 (file)
index 6b093c0..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-<?php
-namespace wcf\system\option\group;
-
-/**
- * GroupOptionTypeInfiniteinteger is an implementation of GroupOptionType for integer values with the infinite option.
- * The merge of option values returns true, if at least one value is -1. Otherwise it returns the highest value.
- * 
- * @author     Marcel Werk
- * @copyright  2001-2011 WoltLab GmbH
- * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package    com.woltlab.wcf
- * @subpackage system.option.group
- * @category   Community Framework
- */
-class GroupOptionTypeInfiniteInteger extends GroupOptionTypeInteger {
-       /**
-        * @see wcf\system\option\group\IGroupOptionType::merge()
-        */
-       public function merge(array $values) {
-               if (in_array(-1, $values)) return -1;
-               return parent::merge($values);
-       }
-}
diff --git a/wcfsetup/install/files/lib/system/option/group/GroupOptionTypeInfiniteInverseInteger.class.php b/wcfsetup/install/files/lib/system/option/group/GroupOptionTypeInfiniteInverseInteger.class.php
deleted file mode 100644 (file)
index cc2cd22..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php
-namespace wcf\system\option\group;
-
-/**
- * GroupOptionTypeInfiniteinverseinteger is an implementation of GroupOptionType for integer values.
- * The merge of option values returns -1 if all values are -1 otherwise the lowest value.
- *
- * @author     Marcel Werk
- * @copyright  2001-2011 WoltLab GmbH
- * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package    com.woltlab.wcf
- * @subpackage system.option.group
- * @category   Community Framework
- */
-class GroupOptionTypeInfiniteInverseInteger extends GroupOptionTypeInverseinteger {
-       /**
-        * @see wcf\system\option\group\IGroupOptionType::merge()
-        */
-       public function merge(array $values) {
-               foreach ($values as $key => $value) {
-                       if ($value == -1) unset($values[$key]);
-               }
-               
-               if (count($values) == 0) return -1;
-               return min($values);
-       }
-}
diff --git a/wcfsetup/install/files/lib/system/option/group/GroupOptionTypeInteger.class.php b/wcfsetup/install/files/lib/system/option/group/GroupOptionTypeInteger.class.php
deleted file mode 100644 (file)
index b70913e..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-<?php
-namespace wcf\system\option\group;
-use wcf\system\option\OptionTypeInteger;
-
-/**
- * GroupOptionTypeInteger is an implementation of GroupOptionType for integer values.
- * The merge of option values returns the highest value.
- * 
- * @author     Marcel Werk
- * @copyright  2001-2011 WoltLab GmbH
- * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package    com.woltlab.wcf
- * @subpackage system.option.group
- * @category   Community Framework
- */
-class GroupOptionTypeInteger extends OptionTypeInteger implements IGroupOptionType {
-       /**
-        * @see wcf\system\option\group\IGroupOptionType::merge()
-        */
-       public function merge(array $values) {
-               return max($values);
-       }
-}
diff --git a/wcfsetup/install/files/lib/system/option/group/GroupOptionTypeInverseInteger.class.php b/wcfsetup/install/files/lib/system/option/group/GroupOptionTypeInverseInteger.class.php
deleted file mode 100644 (file)
index 8169a75..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-<?php
-namespace wcf\system\option\group;
-use wcf\system\option\OptionTypeInteger;
-
-/**
- * GroupOptionTypeInverseInteger is an implementation of GroupOptionType for integer values.
- * The merge of option values returns the lowest value.
- *
- * @author     Marcel Werk
- * @copyright  2001-2011 WoltLab GmbH
- * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package    com.woltlab.wcf
- * @subpackage system.option.group
- * @category   Community Framework
- */
-class GroupOptionTypeInverseInteger extends OptionTypeInteger implements IGroupOptionType {
-       /**
-        * @see wcf\system\option\group\IGroupOptionType::merge()
-        */
-       public function merge(array $values) {
-               return min($values);
-       }
-}
diff --git a/wcfsetup/install/files/lib/system/option/group/GroupOptionTypeText.class.php b/wcfsetup/install/files/lib/system/option/group/GroupOptionTypeText.class.php
deleted file mode 100644 (file)
index 826b974..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-<?php
-namespace wcf\system\option\group;
-use wcf\system\option\OptionTypeText;
-
-/**
- * GroupOptionTypeText is an implementation of GroupOptionType for text values.
- * The merge of option values returns merge of all text values.
- * 
- * @author     Marcel Werk
- * @copyright  2001-2011 WoltLab GmbH
- * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package    com.woltlab.wcf
- * @subpackage system.option.group
- * @category   Community Framework
- */
-class GroupOptionTypeText extends OptionTypeText implements IGroupOptionType {
-       /**
-        * @see wcf\system\option\group\IGroupOptionType::merge()
-        */
-       public function merge(array $values) {
-               $result = '';
-               
-               foreach ($values as $value) {
-                       if (!empty($result)) $result .= "\n";
-                       $result .= $value;
-               }
-
-               return $result;
-       }
-}
diff --git a/wcfsetup/install/files/lib/system/option/group/GroupOptionTypeTextarea.class.php b/wcfsetup/install/files/lib/system/option/group/GroupOptionTypeTextarea.class.php
deleted file mode 100644 (file)
index 5685a19..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-<?php
-namespace wcf\system\option\group;
-use wcf\system\option\OptionTypeTextarea;
-
-/**
- * GroupOptionTypeTextarea is an implementation of GroupOptionType for text values.
- * The merge of option values returns merge of all text values.
- * 
- * @author     Marcel Werk
- * @copyright  2001-2011 WoltLab GmbH
- * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package    com.woltlab.wcf
- * @subpackage system.option.group
- * @category   Community Framework
- */
-class GroupOptionTypeTextarea extends OptionTypeTextarea implements IGroupOptionType {
-       /**
-        * @see wcf\system\option\group\IGroupOptionType::merge()
-        */
-       public function merge(array $values) {
-               $result = '';
-               
-               foreach ($values as $value) {
-                       if (!empty($result)) $result .= "\n";
-                       $result .= $value;
-               }
-
-               return $result;
-       }
-}
diff --git a/wcfsetup/install/files/lib/system/option/group/GroupsGroupOptionType.class.php b/wcfsetup/install/files/lib/system/option/group/GroupsGroupOptionType.class.php
new file mode 100644 (file)
index 0000000..ffae580
--- /dev/null
@@ -0,0 +1,82 @@
+<?php
+namespace wcf\system\option\group;
+use wcf\data\option\Option;
+use wcf\data\user\group\UserGroup;
+use wcf\system\option\AbstractOptionType;
+use wcf\util\ArrayUtil;
+use wcf\util\StringUtil;
+
+/**
+ * GroupsGroupOptionType generates a select-list of all available user groups.
+ *
+ * @author     Marcel Werk
+ * @copyright  2001-2011 WoltLab GmbH
+ * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package    com.woltlab.wcf
+ * @subpackage system.option.group
+ * @category   Community Framework
+ */
+class GroupsGroupOptionType extends AbstractOptionType implements IGroupOptionType {
+       /**
+        * @see wcf\system\option\IOptionType::getFormElement()
+        */
+       public function getFormElement(Option $option, $value) {
+               // get selected group
+               $selectedGroups = explode(',', $value);
+               
+               // get all groups
+               $groups = UserGroup::getGroupsByType();
+               
+               // generate html
+               $html = '';
+               foreach ($groups as $group) {
+                       $html .= '<label><input type="checkbox" name="values['.StringUtil::encodeHTML($option->optionName).'][]" value="'.$group->groupID.'" '.(in_array($group->groupID, $selectedGroups) ? 'checked="checked" ' : '').'/> '.StringUtil::encodeHTML($group->groupName).'</label>';
+               }
+               
+               return $html;
+       }
+       
+       /**
+        * @see wcf\system\option\IOptionType::validate()
+        */
+       public function validate(Option $option, $newValue) {
+               // get all groups
+               $groups = UserGroup::getGroupsByType();
+               
+               // get new value
+               if (!is_array($newValue)) $newValue = array();
+               $selectedGroups = ArrayUtil::toIntegerArray($newValue);
+               
+               // check groups
+               foreach ($selectedGroups as $groupID) {
+                       if (!isset($groups[$groupID])) {
+                               throw new UserInputException($option->optionName, 'validationFailed');
+                       }
+               }
+       }
+       
+       /**
+        * @see wcf\system\option\IOptionType::getData()
+        */
+       public function getData(Option $option, $newValue) {
+               if (!is_array($newValue)) $newValue = array();
+               $newValue = ArrayUtil::toIntegerArray($newValue);
+               sort($newValue, SORT_NUMERIC);
+               return implode(',', $newValue);
+       }
+       
+       /**
+        * @see wcf\system\option\group\IGroupOptionType::merge()
+        */
+       public function merge(array $values) {
+               $result = array();
+               foreach ($values as $value) {
+                       $value = explode(',', $value);
+                       $result = array_merge($result, $value);
+               }
+               
+               $result = array_unique($result);
+
+               return implode(',', $result);
+       }
+}
index 8dc31f76dd2b954973108a958cfeb77f1f50e75f..77a64cb6c617fe84ff215f4d2bda903a0570880f 100644 (file)
@@ -17,7 +17,7 @@ interface IGroupOptionType extends IOptionType {
         * Merges the different values of an option to a single value.
         * 
         * @param       array           $values
-        * @return      mixed           $value
+        * @return      mixed
         */
        public function merge(array $values);
 }
diff --git a/wcfsetup/install/files/lib/system/option/group/InfiniteIntegerGroupOptionType.class.php b/wcfsetup/install/files/lib/system/option/group/InfiniteIntegerGroupOptionType.class.php
new file mode 100644 (file)
index 0000000..c88b2b2
--- /dev/null
@@ -0,0 +1,25 @@
+<?php
+namespace wcf\system\option\group;
+
+/**
+ * InfiniteIntegerGroupOptionType is an implementation of IGroupOptionType for
+ * integer values with the infinite option.
+ * The merge of option values returns true, if at least one value is -1. Otherwise
+ * it returns the highest value.
+ * 
+ * @author     Marcel Werk
+ * @copyright  2001-2011 WoltLab GmbH
+ * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package    com.woltlab.wcf
+ * @subpackage system.option.group
+ * @category   Community Framework
+ */
+class InfiniteIntegerGroupOptionType extends IntegerGroupOptionType {
+       /**
+        * @see wcf\system\option\group\IGroupOptionType::merge()
+        */
+       public function merge(array $values) {
+               if (in_array(-1, $values)) return -1;
+               return parent::merge($values);
+       }
+}
diff --git a/wcfsetup/install/files/lib/system/option/group/InfiniteInverseIntegerGroupOptionType.class.php b/wcfsetup/install/files/lib/system/option/group/InfiniteInverseIntegerGroupOptionType.class.php
new file mode 100644 (file)
index 0000000..18d24fb
--- /dev/null
@@ -0,0 +1,27 @@
+<?php
+namespace wcf\system\option\group;
+
+/**
+ * InfiniteInverseIntegerGroupOptionType is an implementation of IGroupOptionType for integer values.
+ * The merge of option values returns -1 if all values are -1 otherwise the lowest value.
+ *
+ * @author     Marcel Werk
+ * @copyright  2001-2011 WoltLab GmbH
+ * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package    com.woltlab.wcf
+ * @subpackage system.option.group
+ * @category   Community Framework
+ */
+class InfiniteInverseIntegerGroupOptionType extends InverseIntegerGroupOptionType {
+       /**
+        * @see wcf\system\option\group\IGroupOptionType::merge()
+        */
+       public function merge(array $values) {
+               foreach ($values as $key => $value) {
+                       if ($value == -1) unset($values[$key]);
+               }
+               
+               if (count($values) == 0) return -1;
+               return min($values);
+       }
+}
diff --git a/wcfsetup/install/files/lib/system/option/group/IntegerGroupOptionType.class.php b/wcfsetup/install/files/lib/system/option/group/IntegerGroupOptionType.class.php
new file mode 100644 (file)
index 0000000..c618038
--- /dev/null
@@ -0,0 +1,23 @@
+<?php
+namespace wcf\system\option\group;
+use wcf\system\option\IntegerOptionType;
+
+/**
+ * IntegerGroupOptionType is an implementation of IGroupOptionType for integer values.
+ * The merge of option values returns the highest value.
+ * 
+ * @author     Marcel Werk
+ * @copyright  2001-2011 WoltLab GmbH
+ * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package    com.woltlab.wcf
+ * @subpackage system.option.group
+ * @category   Community Framework
+ */
+class IntegerGroupOptionType extends IntegerOptionType implements IGroupOptionType {
+       /**
+        * @see wcf\system\option\group\IGroupOptionType::merge()
+        */
+       public function merge(array $values) {
+               return max($values);
+       }
+}
diff --git a/wcfsetup/install/files/lib/system/option/group/InverseIntegerGroupOptionType.class.php b/wcfsetup/install/files/lib/system/option/group/InverseIntegerGroupOptionType.class.php
new file mode 100644 (file)
index 0000000..5f0192a
--- /dev/null
@@ -0,0 +1,23 @@
+<?php
+namespace wcf\system\option\group;
+use wcf\system\option\IntegerOptionType;
+
+/**
+ * InverseIntegerGroupOptionType is an implementation of IGroupOptionType for integer values.
+ * The merge of option values returns the lowest value.
+ *
+ * @author     Marcel Werk
+ * @copyright  2001-2011 WoltLab GmbH
+ * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package    com.woltlab.wcf
+ * @subpackage system.option.group
+ * @category   Community Framework
+ */
+class InverseIntegerGroupOptionType extends IntegerOptionType implements IGroupOptionType {
+       /**
+        * @see wcf\system\option\group\IGroupOptionType::merge()
+        */
+       public function merge(array $values) {
+               return min($values);
+       }
+}
diff --git a/wcfsetup/install/files/lib/system/option/group/TextGroupOptionType.class.php b/wcfsetup/install/files/lib/system/option/group/TextGroupOptionType.class.php
new file mode 100644 (file)
index 0000000..c33c385
--- /dev/null
@@ -0,0 +1,30 @@
+<?php
+namespace wcf\system\option\group;
+use wcf\system\option\TextOptionType;
+
+/**
+ * TextGroupOptionType is an implementation of IGroupOptionType for text values.
+ * The merge of option values returns merge of all text values.
+ * 
+ * @author     Marcel Werk
+ * @copyright  2001-2011 WoltLab GmbH
+ * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package    com.woltlab.wcf
+ * @subpackage system.option.group
+ * @category   Community Framework
+ */
+class TextGroupOptionType extends TextOptionType implements IGroupOptionType {
+       /**
+        * @see wcf\system\option\group\IGroupOptionType::merge()
+        */
+       public function merge(array $values) {
+               $result = '';
+               
+               foreach ($values as $value) {
+                       if (!empty($result)) $result .= "\n";
+                       $result .= $value;
+               }
+
+               return $result;
+       }
+}
diff --git a/wcfsetup/install/files/lib/system/option/group/TextareaGroupOptionType.class.php b/wcfsetup/install/files/lib/system/option/group/TextareaGroupOptionType.class.php
new file mode 100644 (file)
index 0000000..5c35a90
--- /dev/null
@@ -0,0 +1,30 @@
+<?php
+namespace wcf\system\option\group;
+use wcf\system\option\TextareaOptionType;
+
+/**
+ * TextareaGroupOptionType is an implementation of IGroupOptionType for text values.
+ * The merge of option values returns merge of all text values.
+ * 
+ * @author     Marcel Werk
+ * @copyright  2001-2011 WoltLab GmbH
+ * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package    com.woltlab.wcf
+ * @subpackage system.option.group
+ * @category   Community Framework
+ */
+class TextareaGroupOptionType extends TextareaOptionType implements IGroupOptionType {
+       /**
+        * @see wcf\system\option\group\IGroupOptionType::merge()
+        */
+       public function merge(array $values) {
+               $result = '';
+               
+               foreach ($values as $value) {
+                       if (!empty($result)) $result .= "\n";
+                       $result .= $value;
+               }
+
+               return $result;
+       }
+}