DataTypeHooks: Add name param to getFormElement()

This commit is contained in:
Alexander Fuhr 2015-07-27 15:49:59 +02:00
parent 8427f5404d
commit 03009502a9
3 changed files with 5 additions and 16 deletions

View File

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

View File

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

View File

@ -26,5 +26,5 @@ abstract class DataTypeHook
return 'string';
}
abstract public function getFormElement(QuickForm $form);
abstract public function getFormElement($name, QuickForm $form);
}