2015-07-03 10:49:12 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Icinga\Module\Director\Forms;
|
|
|
|
|
2015-07-03 13:17:05 +02:00
|
|
|
use Icinga\Module\Director\Web\Form\DirectorObjectForm;
|
2015-07-03 10:49:12 +02:00
|
|
|
|
2015-07-03 13:17:05 +02:00
|
|
|
class DirectorDatafieldForm extends DirectorObjectForm
|
2015-07-03 10:49:12 +02:00
|
|
|
{
|
|
|
|
public function setup()
|
|
|
|
{
|
|
|
|
$this->addElement('text', 'varname', array(
|
2015-07-03 12:05:48 +02:00
|
|
|
'required' => true,
|
2015-07-03 11:41:47 +02:00
|
|
|
'label' => $this->translate('Field name'),
|
|
|
|
'description' => $this->translate('The unique name of the field')
|
2015-07-03 10:49:12 +02:00
|
|
|
));
|
|
|
|
|
|
|
|
$this->addElement('text', 'caption', array(
|
2015-07-03 11:41:47 +02:00
|
|
|
'label' => $this->translate('Caption'),
|
|
|
|
'description' => $this->translate('The caption which should be displayed')
|
2015-07-03 10:49:12 +02:00
|
|
|
));
|
|
|
|
|
|
|
|
$this->addElement('textarea', 'description', array(
|
2015-07-03 11:41:47 +02:00
|
|
|
'label' => $this->translate('Description'),
|
|
|
|
'description' => $this->translate('A description about the field')
|
2015-07-03 10:49:12 +02:00
|
|
|
));
|
|
|
|
|
|
|
|
$this->addElement('text', 'datatype', array(
|
2015-07-03 11:41:47 +02:00
|
|
|
'label' => $this->translate('Data type'),
|
2015-07-03 12:05:48 +02:00
|
|
|
'description' => $this->translate('Field type')
|
2015-07-03 10:49:12 +02:00
|
|
|
));
|
|
|
|
|
|
|
|
$this->addElement('text', 'format', array(
|
|
|
|
'label' => $this->translate('Format'),
|
2015-07-03 12:05:48 +02:00
|
|
|
'description' => $this->translate('Field format (string, json, expression)')
|
2015-07-03 10:49:12 +02:00
|
|
|
));
|
|
|
|
}
|
|
|
|
}
|