2014-09-02 15:39:21 +02:00
|
|
|
<?php
|
|
|
|
// {{{ICINGA_LICENSE_HEADER}}}
|
|
|
|
// {{{ICINGA_LICENSE_HEADER}}}
|
|
|
|
|
|
|
|
namespace Icinga\Form\Config\Resource;
|
|
|
|
|
|
|
|
use Icinga\Web\Form;
|
|
|
|
use Icinga\Application\Icinga;
|
|
|
|
use Icinga\Web\Form\Validator\ReadablePathValidator;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Form class for adding/modifying statusdat resources
|
|
|
|
*/
|
|
|
|
class StatusdatResourceForm extends Form
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Initialize this form
|
|
|
|
*/
|
|
|
|
public function init()
|
|
|
|
{
|
|
|
|
$this->setName('form_config_resource_statusdat');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @see Form::createElements()
|
|
|
|
*/
|
|
|
|
public function createElements(array $formData)
|
|
|
|
{
|
|
|
|
return array(
|
|
|
|
$this->createElement(
|
|
|
|
'text',
|
|
|
|
'status_file',
|
|
|
|
array(
|
|
|
|
'required' => true,
|
|
|
|
'label' => t('Filepath'),
|
2014-09-02 17:03:32 +02:00
|
|
|
'description' => t('Location of your icinga status.dat file'),
|
2014-09-02 15:39:21 +02:00
|
|
|
'value' => realpath(Icinga::app()->getApplicationDir() . '/../var/status.dat'),
|
|
|
|
'validators' => array(new ReadablePathValidator())
|
|
|
|
)
|
|
|
|
),
|
|
|
|
$this->createElement(
|
|
|
|
'text',
|
|
|
|
'object_file',
|
|
|
|
array(
|
|
|
|
'required' => true,
|
|
|
|
'label' => t('Filepath'),
|
2014-09-02 17:03:32 +02:00
|
|
|
'description' => t('Location of your icinga objects.cache file'),
|
2014-09-02 15:39:21 +02:00
|
|
|
'value' => realpath(Icinga::app()->getApplicationDir() . '/../var/objects.cache'),
|
|
|
|
'validators' => array(new ReadablePathValidator())
|
|
|
|
)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|