Added default values for output class
authorMarcel Werk <burntime@woltlab.com>
Mon, 23 May 2016 09:51:12 +0000 (11:51 +0200)
committerMarcel Werk <burntime@woltlab.com>
Mon, 23 May 2016 10:04:26 +0000 (12:04 +0200)
wcfsetup/install/files/lib/acp/form/UserOptionAddForm.class.php
wcfsetup/install/files/lib/acp/form/UserOptionEditForm.class.php

index 823af491734b1214b4b02bebddf6ed3987240f91..ff956dc68eb1ca6c92c76c038112628bc1175091 100644 (file)
@@ -214,6 +214,25 @@ class UserOptionAddForm extends AbstractForm {
                }
        }
        
+       /**
+        * Sets the default output class.
+        */
+       protected function setDefaultOutputClass() {
+               if (empty($this->outputClass)) {
+                       if (in_array($this->optionType, self::$optionTypesUsingSelectOptions)) {
+                               $this->outputClass = 'wcf\system\option\user\SelectOptionsUserOptionOutput';
+                       }
+                       
+                       if ($this->optionType == 'date') {
+                               $this->outputClass = 'wcf\system\option\user\DateUserOptionOutput';
+                       }
+                       
+                       if ($this->optionType == 'URL') {
+                               $this->outputClass = 'wcf\system\option\user\URLUserOptionOutput';
+                       }
+               }
+       }
+       
        /**
         * @inheritDoc
         */
index 9e35c52786fe106b0f253e8d134b0437edf10529..617d9d99bca33e4ca1ed88eeff7d9b1d32d30755 100644 (file)
@@ -48,6 +48,11 @@ class UserOptionEditForm extends UserOptionAddForm {
                }
        }
        
+       /**
+        * @inheritDoc
+        */
+       protected function setDefaultOutputClass() {}
+       
        /**
         * @inheritDoc
         */