DataTypeHook: Add DataType Hook Datalist

This commit is contained in:
Alexander Fuhr 2015-07-27 17:22:21 +02:00
parent 64eb1dff27
commit 0380e51087
1 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,30 @@
<?php
namespace Icinga\Module\Director\DataType;
use Icinga\Module\Director\Web\Form\QuickForm;
use Icinga\Module\Director\Web\Hook\DataTypeHook;
class DataTypeDatalist extends DataTypeHook
{
public function getFormElement($name, QuickForm $form)
{
$element = $form->createElement('select', $name);
return $element;
}
public static function addSettingsFormFields(QuickForm $form)
{
$form->addElement('select', 'datalist', array(
'label' => 'List name',
'required' => true,
'multiOptions' => array(
null => '- please choose -',
'Foo' => 'Dummy Foo',
'Bar' => 'Dummy Bar'
),
));
return $form;
}
}