DataTypeHooks: Add name param to getFormElement()
This commit is contained in:
parent
8427f5404d
commit
03009502a9
|
@ -7,18 +7,10 @@ use Icinga\Module\Director\Web\Hook\DataTypeHook;
|
|||
|
||||
class DataTypeNumber extends DataTypeHook
|
||||
{
|
||||
public function getFormElement(QuickForm $form)
|
||||
public function getFormElement($name, QuickForm $form)
|
||||
{
|
||||
$element = $form->createElement('text', 'foo', array(
|
||||
'label' => $this->translate('Number Element..'),
|
||||
'required' => true,
|
||||
));
|
||||
$element = $form->createElement('text', $name);
|
||||
|
||||
return $element;
|
||||
}
|
||||
|
||||
public static function getFormat()
|
||||
{
|
||||
return 'json';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,12 +7,9 @@ use Icinga\Module\Director\Web\Hook\DataTypeHook;
|
|||
|
||||
class DataTypeString extends DataTypeHook
|
||||
{
|
||||
public function getFormElement(QuickForm $form)
|
||||
public function getFormElement($name, QuickForm $form)
|
||||
{
|
||||
$element = $form->createElement('text', 'foo', array(
|
||||
'label' => $this->translate('String Element..'),
|
||||
'required' => true,
|
||||
));
|
||||
$element = $form->createElement('text', $name);
|
||||
|
||||
return $element;
|
||||
}
|
||||
|
|
|
@ -26,5 +26,5 @@ abstract class DataTypeHook
|
|||
return 'string';
|
||||
}
|
||||
|
||||
abstract public function getFormElement(QuickForm $form);
|
||||
abstract public function getFormElement($name, QuickForm $form);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue