From c57d105d6753f435342e01ccb6e4ab14e10dca6d Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sun, 1 Dec 2019 10:37:38 +0100 Subject: [PATCH] Add AbstractFormBuilderForm::$formClassName Close #3111 --- .../files/lib/form/AbstractFormBuilderForm.class.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/form/AbstractFormBuilderForm.class.php b/wcfsetup/install/files/lib/form/AbstractFormBuilderForm.class.php index 1544d95d19..3647ea1fe4 100644 --- a/wcfsetup/install/files/lib/form/AbstractFormBuilderForm.class.php +++ b/wcfsetup/install/files/lib/form/AbstractFormBuilderForm.class.php @@ -25,6 +25,12 @@ abstract class AbstractFormBuilderForm extends AbstractForm { * @var IFormDocument */ public $form; + + /** + * name of the form document class + * @var string + */ + public $formClassName = FormDocument::class; /** * action performed by the form @@ -90,7 +96,7 @@ abstract class AbstractFormBuilderForm extends AbstractForm { $classNamePieces = explode('\\', get_class($this)); $controller = preg_replace('~Form$~', '', end($classNamePieces)); - $this->form = FormDocument::create(lcfirst($controller)); + $this->form = $this->formClassName::create(lcfirst($controller)); if ($this->formObject !== null) { $this->form->formMode(IFormDocument::FORM_MODE_UPDATE); -- 2.20.1