2015-09-07 16:58:22 +02:00
|
|
|
<?php
|
|
|
|
/* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
|
|
|
|
|
|
|
|
namespace Icinga\Forms\Navigation;
|
|
|
|
|
|
|
|
use Icinga\Web\Form;
|
|
|
|
|
|
|
|
class NavigationItemForm extends Form
|
|
|
|
{
|
2015-09-18 09:48:22 +02:00
|
|
|
/**
|
|
|
|
* Whether to create a select input to choose a parent for a navigation item of a particular type
|
|
|
|
*
|
|
|
|
* @var bool
|
|
|
|
*/
|
|
|
|
protected $requiresParentSelection = false;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return whether to create a select input to choose a parent for a navigation item of a particular type
|
|
|
|
*
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function requiresParentSelection()
|
|
|
|
{
|
|
|
|
return $this->requiresParentSelection;
|
|
|
|
}
|
|
|
|
|
2015-09-07 16:58:22 +02:00
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
|
|
|
public function createElements(array $formData)
|
|
|
|
{
|
|
|
|
$this->addElement(
|
|
|
|
'text',
|
|
|
|
'url',
|
|
|
|
array(
|
|
|
|
'allowEmpty' => true,
|
|
|
|
'label' => $this->translate('Url'),
|
|
|
|
'description' => $this->translate(
|
|
|
|
'The url of this navigation item. Leave blank if you only want the name being displayed.'
|
|
|
|
)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
$this->addElement(
|
|
|
|
'text',
|
|
|
|
'icon',
|
|
|
|
array(
|
|
|
|
'allowEmpty' => true,
|
|
|
|
'label' => $this->translate('Icon'),
|
|
|
|
'description' => $this->translate(
|
|
|
|
'The icon of this navigation item. Leave blank if you do not want a icon being displayed.'
|
|
|
|
)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|