DataTypeString/Number-Hook: Add simple hooks

refs #9716
This commit is contained in:
Alexander Fuhr 2015-07-24 14:58:39 +02:00
parent 1e694f2d1b
commit 4f5e0f5918
2 changed files with 43 additions and 0 deletions

View File

@ -0,0 +1,24 @@
<?php
namespace Icinga\Module\Director\DataType;
use Icinga\Module\Director\Web\Form\QuickForm;
use Icinga\Module\Director\Web\Hook\DataTypeHook;
class DataTypeNumber extends DataTypeHook
{
public function getFormElement(QuickForm $form)
{
$element = $form->createElement('text', 'foo', array(
'label' => $this->translate('Number Element..'),
'required' => true,
));
return $element;
}
public static function getFormat()
{
return 'json';
}
}

View File

@ -0,0 +1,19 @@
<?php
namespace Icinga\Module\Director\DataType;
use Icinga\Module\Director\Web\Form\QuickForm;
use Icinga\Module\Director\Web\Hook\DataTypeHook;
class DataTypeString extends DataTypeHook
{
public function getFormElement(QuickForm $form)
{
$element = $form->createElement('text', 'foo', array(
'label' => $this->translate('String Element..'),
'required' => true,
));
return $element;
}
}