From 42d9996f8f5935221d3329a25632ae685f9690e1 Mon Sep 17 00:00:00 2001 From: Beu Date: Thu, 3 Mar 2022 15:03:51 +0100 Subject: [PATCH] Add name property to TextEdit (for Manialink Actions) --- libs/FML/Controls/TextEdit.php | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/libs/FML/Controls/TextEdit.php b/libs/FML/Controls/TextEdit.php index fe3008f9..4f499801 100644 --- a/libs/FML/Controls/TextEdit.php +++ b/libs/FML/Controls/TextEdit.php @@ -101,6 +101,30 @@ class TextEdit extends Control implements MultiLineable, Scriptable, Styleable, */ protected $focusAreaColor = null; + /** + * Get the name + * + * @api + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Set the name + * + * @api + * @param string $name Entry name + * @return static + */ + public function setName($name) + { + $this->name = (string)$name; + return $this; + } + /** * Get the default value * @@ -400,6 +424,9 @@ class TextEdit extends Control implements MultiLineable, Scriptable, Styleable, public function render(\DOMDocument $domDocument) { $domElement = parent::render($domDocument); + if ($this->name) { + $domElement->setAttribute("name", $this->name); + } if ($this->default !== null) { $domElement->setAttribute("default", $this->default); }