mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-08-19 00:38:27 +02:00
Add DirectorDatafieldCategoryForm
This commit is contained in:
parent
0fbe693544
commit
1f5224258b
44
application/forms/DirectorDatafieldCategoryForm.php
Normal file
44
application/forms/DirectorDatafieldCategoryForm.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace Icinga\Module\Director\Forms;
|
||||
|
||||
use Icinga\Module\Director\Web\Form\DirectorObjectForm;
|
||||
|
||||
class DirectorDatafieldCategoryForm extends DirectorObjectForm
|
||||
{
|
||||
protected $objectName = 'Data field category';
|
||||
|
||||
protected $listUrl = 'director/data/fieldcategories';
|
||||
|
||||
public function setup()
|
||||
{
|
||||
$this->addHtmlHint(
|
||||
$this->translate(
|
||||
'Data field categories allow to structure Data Fields. Fields with'
|
||||
. ' a category will be shown grouped by category.'
|
||||
)
|
||||
);
|
||||
|
||||
$this->addElement('text', 'category_name', array(
|
||||
'label' => $this->translate('Category name'),
|
||||
'description' => $this->translate(
|
||||
'The unique name of the category used for grouping your custom Data Fields.'
|
||||
),
|
||||
'required' => true,
|
||||
));
|
||||
|
||||
$this->addElement('text', 'description', array(
|
||||
'label' => $this->translate('Description'),
|
||||
'required' => true,
|
||||
));
|
||||
|
||||
$this->setButtons();
|
||||
}
|
||||
|
||||
public function xxxshouldBeRenamed()
|
||||
{
|
||||
$object = $this->object();
|
||||
return $object->hasBeenLoadedFromDb()
|
||||
&& $object->getOriginalProperty('category_name') !== $this->getSentValue('category_name');
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user