Add name property to TextEdit (for Manialink Actions)

This commit is contained in:
Beu 2022-03-03 15:03:51 +01:00
parent c03b458bb1
commit 42d9996f8f
1 changed files with 27 additions and 0 deletions

View File

@ -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);
}