From e71df1bb7078c73639f77193658d4e1415cad8ce Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sat, 13 Apr 2019 12:54:34 +0200 Subject: [PATCH] Add `CustomFormNode` See #2509 --- .../form/builder/CustomFormNode.class.php | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 wcfsetup/install/files/lib/system/form/builder/CustomFormNode.class.php diff --git a/wcfsetup/install/files/lib/system/form/builder/CustomFormNode.class.php b/wcfsetup/install/files/lib/system/form/builder/CustomFormNode.class.php new file mode 100644 index 0000000000..6bd0c5d248 --- /dev/null +++ b/wcfsetup/install/files/lib/system/form/builder/CustomFormNode.class.php @@ -0,0 +1,59 @@ + + * @package WoltLabSuite\Core\System\Form\Builder + * @since 5.2 + */ +class CustomFormNode implements IFormChildNode { + use TFormChildNode; + use TFormNode; + + /** + * content of the custom form node + * @var string + */ + protected $content = ''; + + /** + * Sets the content of this form node and returns this form node. + * + * @param string $content + * @return static this form node + */ + public function content($content) { + $this->content = $content; + + return $this; + } + + /** + * Returns the content of the custom form node. + * + * @return string + */ + public function getContent() { + return $this->content; + } + + /** + * @inheritDoc + */ + public function getHtml() { + return $this->getContent(); + } + + /** + * @inheritDoc + */ + public function validate() { + // does nothing + } +} -- 2.20.1