From: Marcel Werk Date: Mon, 23 May 2016 09:51:12 +0000 (+0200) Subject: Added default values for output class X-Git-Tag: 3.0.0_Beta_1~1655 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=85fc3b968cda8216caad32b2f42bdf2d1b7ce15d;p=GitHub%2FWoltLab%2FWCF.git Added default values for output class --- diff --git a/wcfsetup/install/files/lib/acp/form/UserOptionAddForm.class.php b/wcfsetup/install/files/lib/acp/form/UserOptionAddForm.class.php index 823af49173..ff956dc68e 100644 --- a/wcfsetup/install/files/lib/acp/form/UserOptionAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UserOptionAddForm.class.php @@ -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 */ diff --git a/wcfsetup/install/files/lib/acp/form/UserOptionEditForm.class.php b/wcfsetup/install/files/lib/acp/form/UserOptionEditForm.class.php index 9e35c52786..617d9d99bc 100644 --- a/wcfsetup/install/files/lib/acp/form/UserOptionEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UserOptionEditForm.class.php @@ -48,6 +48,11 @@ class UserOptionEditForm extends UserOptionAddForm { } } + /** + * @inheritDoc + */ + protected function setDefaultOutputClass() {} + /** * @inheritDoc */