From: Matthias Schmidt Date: Mon, 26 Aug 2019 17:39:13 +0000 (+0200) Subject: Add hidden form field X-Git-Tag: 5.2.0_Beta_2~88 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=bf4cd1bf37c8c3127558e856c99bf83f73726b9e;p=GitHub%2FWoltLab%2FWCF.git Add hidden form field Close #3053 --- diff --git a/com.woltlab.wcf/templates/__hiddenFormField.tpl b/com.woltlab.wcf/templates/__hiddenFormField.tpl new file mode 100644 index 0000000000..7f92db9891 --- /dev/null +++ b/com.woltlab.wcf/templates/__hiddenFormField.tpl @@ -0,0 +1,5 @@ + diff --git a/wcfsetup/install/files/acp/templates/__hiddenFormField.tpl b/wcfsetup/install/files/acp/templates/__hiddenFormField.tpl new file mode 100644 index 0000000000..7f92db9891 --- /dev/null +++ b/wcfsetup/install/files/acp/templates/__hiddenFormField.tpl @@ -0,0 +1,5 @@ + diff --git a/wcfsetup/install/files/lib/system/form/builder/field/HiddenFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/HiddenFormField.class.php new file mode 100644 index 0000000000..ca6438d5de --- /dev/null +++ b/wcfsetup/install/files/lib/system/form/builder/field/HiddenFormField.class.php @@ -0,0 +1,29 @@ + + * @package WoltLabSuite\Core\System\Form\Builder\Field + * @since 5.2 + */ +class HiddenFormField extends AbstractFormField { + /** + * @inheritDoc + */ + protected $templateName = '__hiddenFormField'; + + /** + * @inheritDoc + */ + public function readValue() { + if ($this->getDocument()->hasRequestData($this->getPrefixedId())) { + $this->value = $this->getDocument()->getRequestData($this->getPrefixedId()); + } + + return $this; + } +}