Leave it up to Icinga\Web\Form to instantiate our own form elements
This commit is contained in:
parent
872dce2208
commit
1c4a5ce86f
|
@ -8,7 +8,6 @@ use Exception;
|
|||
use Icinga\Application\Config;
|
||||
use Icinga\Web\Form;
|
||||
use Icinga\Web\Request;
|
||||
use Icinga\Web\Form\Element\Number;
|
||||
use Icinga\Data\ResourceFactory;
|
||||
use Icinga\Application\Platform;
|
||||
|
||||
|
@ -68,14 +67,13 @@ class DbResourceForm extends Form
|
|||
)
|
||||
);
|
||||
$this->addElement(
|
||||
new Number(
|
||||
array(
|
||||
'required' => true,
|
||||
'name' => 'port',
|
||||
'label' => t('Port'),
|
||||
'description' => t('The port to use'),
|
||||
'value' => 3306
|
||||
)
|
||||
'number',
|
||||
'port',
|
||||
array(
|
||||
'required' => true,
|
||||
'label' => t('Port'),
|
||||
'description' => t('The port to use'),
|
||||
'value' => 3306
|
||||
)
|
||||
);
|
||||
$this->addElement(
|
||||
|
|
|
@ -8,7 +8,6 @@ use Exception;
|
|||
use Icinga\Application\Config;
|
||||
use Icinga\Web\Form;
|
||||
use Icinga\Web\Request;
|
||||
use Icinga\Web\Form\Element\Number;
|
||||
use Icinga\Data\ResourceFactory;
|
||||
|
||||
/**
|
||||
|
@ -49,14 +48,13 @@ class LdapResourceForm extends Form
|
|||
)
|
||||
);
|
||||
$this->addElement(
|
||||
new Number(
|
||||
array(
|
||||
'required' => true,
|
||||
'name' => 'port',
|
||||
'label' => t('Port'),
|
||||
'description' => t('The port of the LDAP server to use for authentication'),
|
||||
'value' => 389
|
||||
)
|
||||
'number',
|
||||
'port',
|
||||
array(
|
||||
'required' => true,
|
||||
'label' => t('Port'),
|
||||
'description' => t('The port of the LDAP server to use for authentication'),
|
||||
'value' => 389
|
||||
)
|
||||
);
|
||||
$this->addElement(
|
||||
|
|
|
@ -7,7 +7,6 @@ use Icinga\Application\Logger;
|
|||
use Icinga\Protocol\Ldap\Exception as LdapException;
|
||||
use Icinga\Protocol\Ldap\Connection;
|
||||
use Icinga\Protocol\Dns;
|
||||
use Icinga\Web\Form\Element\Note;
|
||||
use Icinga\Web\Form;
|
||||
|
||||
/**
|
||||
|
@ -68,13 +67,12 @@ class LdapDiscoveryForm extends Form
|
|||
|
||||
if (false) {
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'additional_description',
|
||||
array(
|
||||
'value' => t('No Ldap servers found on this domain.'
|
||||
. ' You can try to specify host and port and try again, or just skip this step and '
|
||||
. 'configure the server manually.'
|
||||
)
|
||||
'note',
|
||||
'additional_description',
|
||||
array(
|
||||
'value' => t('No Ldap servers found on this domain.'
|
||||
. ' You can try to specify host and port and try again, or just skip this step and '
|
||||
. 'configure the server manually.'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
|
||||
namespace Icinga\Web\Form\Element;
|
||||
|
||||
use Zend_Form_Element;
|
||||
use Icinga\Web\Request;
|
||||
use Icinga\Application\Icinga;
|
||||
use Icinga\Web\Form\FormElement;
|
||||
|
||||
/**
|
||||
* A button
|
||||
*/
|
||||
class Button extends Zend_Form_Element
|
||||
class Button extends FormElement
|
||||
{
|
||||
/**
|
||||
* Use formButton view helper by default
|
||||
|
|
|
@ -4,12 +4,12 @@
|
|||
|
||||
namespace Icinga\Web\Form\Element;
|
||||
|
||||
use Zend_Form_Element;
|
||||
use Icinga\Web\Form\FormElement;
|
||||
|
||||
/**
|
||||
* A note
|
||||
*/
|
||||
class Note extends Zend_Form_Element
|
||||
class Note extends FormElement
|
||||
{
|
||||
/**
|
||||
* Form view helper to use for rendering
|
||||
|
|
|
@ -8,7 +8,6 @@ use LogicException;
|
|||
use InvalidArgumentException;
|
||||
use Icinga\Web\Session\SessionNamespace;
|
||||
use Icinga\Web\Form\Decorator\ElementDoubler;
|
||||
use Icinga\Web\Form\Element\Button;
|
||||
|
||||
/**
|
||||
* Container and controller for form based wizards
|
||||
|
@ -427,60 +426,55 @@ class Wizard
|
|||
$index = array_search($page, $pages, true);
|
||||
if ($index === 0) {
|
||||
$page->addElement(
|
||||
new Button(
|
||||
static::BTN_NEXT,
|
||||
array(
|
||||
'type' => 'submit',
|
||||
'value' => $pages[1]->getName(),
|
||||
'label' => t('Next'),
|
||||
'decorators' => array('ViewHelper')
|
||||
)
|
||||
'button',
|
||||
static::BTN_NEXT,
|
||||
array(
|
||||
'type' => 'submit',
|
||||
'value' => $pages[1]->getName(),
|
||||
'label' => t('Next'),
|
||||
'decorators' => array('ViewHelper')
|
||||
)
|
||||
);
|
||||
} elseif ($index < count($pages) - 1) {
|
||||
$page->addElement(
|
||||
new Button(
|
||||
static::BTN_PREV,
|
||||
array(
|
||||
'type' => 'submit',
|
||||
'value' => $pages[$index - 1]->getName(),
|
||||
'label' => t('Back'),
|
||||
'decorators' => array('ViewHelper')
|
||||
)
|
||||
'button',
|
||||
static::BTN_PREV,
|
||||
array(
|
||||
'type' => 'submit',
|
||||
'value' => $pages[$index - 1]->getName(),
|
||||
'label' => t('Back'),
|
||||
'decorators' => array('ViewHelper')
|
||||
)
|
||||
);
|
||||
$page->addElement(
|
||||
new Button(
|
||||
static::BTN_NEXT,
|
||||
array(
|
||||
'type' => 'submit',
|
||||
'value' => $pages[$index + 1]->getName(),
|
||||
'label' => t('Next'),
|
||||
'decorators' => array('ViewHelper')
|
||||
)
|
||||
'button',
|
||||
static::BTN_NEXT,
|
||||
array(
|
||||
'type' => 'submit',
|
||||
'value' => $pages[$index + 1]->getName(),
|
||||
'label' => t('Next'),
|
||||
'decorators' => array('ViewHelper')
|
||||
)
|
||||
);
|
||||
} else {
|
||||
$page->addElement(
|
||||
new Button(
|
||||
static::BTN_PREV,
|
||||
array(
|
||||
'type' => 'submit',
|
||||
'value' => $pages[$index - 1]->getName(),
|
||||
'label' => t('Back'),
|
||||
'decorators' => array('ViewHelper')
|
||||
)
|
||||
'button',
|
||||
static::BTN_PREV,
|
||||
array(
|
||||
'type' => 'submit',
|
||||
'value' => $pages[$index - 1]->getName(),
|
||||
'label' => t('Back'),
|
||||
'decorators' => array('ViewHelper')
|
||||
)
|
||||
);
|
||||
$page->addElement(
|
||||
new Button(
|
||||
static::BTN_NEXT,
|
||||
array(
|
||||
'type' => 'submit',
|
||||
'value' => $page->getName(),
|
||||
'label' => t('Finish'),
|
||||
'decorators' => array('ViewHelper')
|
||||
)
|
||||
'button',
|
||||
static::BTN_NEXT,
|
||||
array(
|
||||
'type' => 'submit',
|
||||
'value' => $page->getName(),
|
||||
'label' => t('Finish'),
|
||||
'decorators' => array('ViewHelper')
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
|
@ -8,8 +8,6 @@ use DateTime;
|
|||
use DateInterval;
|
||||
use Icinga\Module\Monitoring\Command\Instance\DisableNotificationsExpireCommand;
|
||||
use Icinga\Module\Monitoring\Form\Command\CommandForm;
|
||||
use Icinga\Web\Form\Element\DateTimePicker;
|
||||
use Icinga\Web\Form\Element\Note;
|
||||
use Icinga\Web\Notification;
|
||||
use Icinga\Web\Request;
|
||||
|
||||
|
@ -34,27 +32,25 @@ class DisableNotificationsExpireCommandForm extends CommandForm
|
|||
public function createElements(array $formData = array())
|
||||
{
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'command-info',
|
||||
array(
|
||||
'value' => mt(
|
||||
'monitoring',
|
||||
'This command is used to disable host and service notifications for a specific time.'
|
||||
)
|
||||
'note',
|
||||
'command-info',
|
||||
array(
|
||||
'value' => mt(
|
||||
'monitoring',
|
||||
'This command is used to disable host and service notifications for a specific time.'
|
||||
)
|
||||
)
|
||||
);
|
||||
$expireTime = new DateTime();
|
||||
$expireTime->add(new DateInterval('PT1H'));
|
||||
$this->addElement(
|
||||
new DateTimePicker(
|
||||
'expire_time',
|
||||
array(
|
||||
'required' => true,
|
||||
'label' => mt('monitoring', 'Expire Time'),
|
||||
'description' => mt('monitoring', 'Set the expire time.'),
|
||||
'value' => $expireTime
|
||||
)
|
||||
'dateTimePicker',
|
||||
'expire_time',
|
||||
array(
|
||||
'required' => true,
|
||||
'label' => mt('monitoring', 'Expire Time'),
|
||||
'description' => mt('monitoring', 'Set the expire time.'),
|
||||
'value' => $expireTime
|
||||
)
|
||||
);
|
||||
return $this;
|
||||
|
|
|
@ -7,8 +7,6 @@ namespace Icinga\Module\Monitoring\Form\Command\Object;
|
|||
use DateTime;
|
||||
use DateInterval;
|
||||
use Icinga\Module\Monitoring\Command\Object\AcknowledgeProblemCommand;
|
||||
use Icinga\Web\Form\Element\DateTimePicker;
|
||||
use Icinga\Web\Form\Element\Note;
|
||||
use Icinga\Web\Notification;
|
||||
use Icinga\Web\Request;
|
||||
|
||||
|
@ -35,7 +33,8 @@ class AcknowledgeProblemCommandForm extends ObjectsCommandForm
|
|||
public function createElements(array $formData = array())
|
||||
{
|
||||
$this->addElements(array(
|
||||
new Note(
|
||||
array(
|
||||
'note',
|
||||
'command-info',
|
||||
array(
|
||||
'value' => mt(
|
||||
|
@ -86,16 +85,15 @@ class AcknowledgeProblemCommandForm extends ObjectsCommandForm
|
|||
$expireTime = new DateTime();
|
||||
$expireTime->add(new DateInterval('PT1H'));
|
||||
$this->addElement(
|
||||
new DateTimePicker(
|
||||
'expire_time',
|
||||
array(
|
||||
'label' => mt('monitoring', 'Expire Time'),
|
||||
'value' => $expireTime,
|
||||
'description' => mt(
|
||||
'monitoring',
|
||||
'Enter the expire date and time for this acknowledgement here. Icinga will delete the'
|
||||
. ' acknowledgement after this time expired.'
|
||||
)
|
||||
'dateTimePicker',
|
||||
'expire_time',
|
||||
array(
|
||||
'label' => mt('monitoring', 'Expire Time'),
|
||||
'value' => $expireTime,
|
||||
'description' => mt(
|
||||
'monitoring',
|
||||
'Enter the expire date and time for this acknowledgement here. Icinga will delete the'
|
||||
. ' acknowledgement after this time expired.'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
namespace Icinga\Module\Monitoring\Form\Command\Object;
|
||||
|
||||
use Icinga\Module\Monitoring\Command\Object\AddCommentCommand;
|
||||
use Icinga\Web\Form\Element\Note;
|
||||
use Icinga\Web\Notification;
|
||||
use Icinga\Web\Request;
|
||||
|
||||
|
@ -32,7 +31,8 @@ class AddCommentCommandForm extends ObjectsCommandForm
|
|||
public function createElements(array $formData = array())
|
||||
{
|
||||
$this->addElements(array(
|
||||
new Note(
|
||||
array(
|
||||
'note',
|
||||
'command-info',
|
||||
array(
|
||||
'value' => mt(
|
||||
|
|
|
@ -6,8 +6,6 @@ namespace Icinga\Module\Monitoring\Form\Command\Object;
|
|||
|
||||
use Icinga\Module\Monitoring\Command\Object\ScheduleHostCheckCommand;
|
||||
use Icinga\Module\Monitoring\Command\Object\ScheduleServiceCheckCommand;
|
||||
use Icinga\Web\Form\Element\Button;
|
||||
use Icinga\Web\Form\Element\Note;
|
||||
use Icinga\Web\Notification;
|
||||
use Icinga\Web\Request;
|
||||
|
||||
|
@ -34,17 +32,16 @@ class CheckNowCommandForm extends ObjectsCommandForm
|
|||
$iconUrl = $this->getView()->href('img/icons/refresh_petrol.png');
|
||||
|
||||
$this->addElements(array(
|
||||
new Button(
|
||||
'btn_submit',
|
||||
array(
|
||||
'ignore' => true,
|
||||
'type' => 'submit',
|
||||
'value' => mt('monitoring', 'Check now'),
|
||||
'label' => '<img src="'.$iconUrl.'"> ' . mt('monitoring', 'Check now'),
|
||||
'decorators' => array('ViewHelper'),
|
||||
'escape' => false,
|
||||
'class' => 'link-like'
|
||||
)
|
||||
'button',
|
||||
'btn_submit',
|
||||
array(
|
||||
'ignore' => true,
|
||||
'type' => 'submit',
|
||||
'value' => mt('monitoring', 'Check now'),
|
||||
'label' => '<img src="'.$iconUrl.'"> ' . mt('monitoring', 'Check now'),
|
||||
'decorators' => array('ViewHelper'),
|
||||
'escape' => false,
|
||||
'class' => 'link-like'
|
||||
)
|
||||
));
|
||||
return $this;
|
||||
|
|
|
@ -7,8 +7,6 @@ namespace Icinga\Module\Monitoring\Form\Command\Object;
|
|||
use DateTime;
|
||||
use DateInterval;
|
||||
use Icinga\Module\Monitoring\Command\Object\ScheduleServiceCheckCommand;
|
||||
use Icinga\Web\Form\Element\DateTimePicker;
|
||||
use Icinga\Web\Form\Element\Note;
|
||||
use Icinga\Web\Notification;
|
||||
use Icinga\Web\Request;
|
||||
|
||||
|
@ -37,7 +35,8 @@ class ScheduleServiceCheckCommandForm extends ObjectsCommandForm
|
|||
$checkTime = new DateTime();
|
||||
$checkTime->add(new DateInterval('PT1H'));
|
||||
$this->addElements(array(
|
||||
new Note(
|
||||
array(
|
||||
'note',
|
||||
'command-info',
|
||||
array(
|
||||
'value' => mt(
|
||||
|
@ -47,7 +46,8 @@ class ScheduleServiceCheckCommandForm extends ObjectsCommandForm
|
|||
)
|
||||
)
|
||||
),
|
||||
new DateTimePicker(
|
||||
array(
|
||||
'dateTimePicker',
|
||||
'check_time',
|
||||
array(
|
||||
'required' => true,
|
||||
|
|
|
@ -7,9 +7,6 @@ namespace Icinga\Module\Monitoring\Form\Command\Object;
|
|||
use DateTime;
|
||||
use DateInterval;
|
||||
use Icinga\Module\Monitoring\Command\Object\ScheduleServiceDowntimeCommand;
|
||||
use Icinga\Web\Form\Element\DateTimePicker;
|
||||
use Icinga\Web\Form\Element\Note;
|
||||
use Icinga\Web\Form\Element\Number;
|
||||
use Icinga\Web\Notification;
|
||||
use Icinga\Web\Request;
|
||||
|
||||
|
@ -49,7 +46,8 @@ class ScheduleServiceDowntimeCommandForm extends ObjectsCommandForm
|
|||
$end = clone $start;
|
||||
$end->add(new DateInterval('PT1H'));
|
||||
$this->addElements(array(
|
||||
new Note(
|
||||
array(
|
||||
'note',
|
||||
'command-info',
|
||||
array(
|
||||
'value' => mt(
|
||||
|
@ -76,7 +74,8 @@ class ScheduleServiceDowntimeCommandForm extends ObjectsCommandForm
|
|||
)
|
||||
)
|
||||
),
|
||||
new DateTimePicker(
|
||||
array(
|
||||
'dateTimePicker',
|
||||
'start',
|
||||
array(
|
||||
'required' => true,
|
||||
|
@ -85,7 +84,8 @@ class ScheduleServiceDowntimeCommandForm extends ObjectsCommandForm
|
|||
'value' => $start
|
||||
)
|
||||
),
|
||||
new DateTimePicker(
|
||||
array(
|
||||
'dateTimePicker',
|
||||
'end',
|
||||
array(
|
||||
'required' => true,
|
||||
|
@ -134,7 +134,8 @@ class ScheduleServiceDowntimeCommandForm extends ObjectsCommandForm
|
|||
);
|
||||
if (isset($formData['type']) && $formData['type'] === self::FLEXIBLE) {
|
||||
$this->addElements(array(
|
||||
new Number(
|
||||
array(
|
||||
'number',
|
||||
'hours',
|
||||
array(
|
||||
'required' => true,
|
||||
|
@ -143,7 +144,8 @@ class ScheduleServiceDowntimeCommandForm extends ObjectsCommandForm
|
|||
'min' => -1
|
||||
)
|
||||
),
|
||||
new Number(
|
||||
array(
|
||||
'number',
|
||||
'minutes',
|
||||
array(
|
||||
'required' => true,
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
namespace Icinga\Module\Monitoring\Form\Config\Instance;
|
||||
|
||||
use Icinga\Web\Form;
|
||||
use Icinga\Web\Form\Element\Number;
|
||||
|
||||
class RemoteInstanceForm extends Form
|
||||
{
|
||||
|
@ -36,10 +35,11 @@ class RemoteInstanceForm extends Form
|
|||
)
|
||||
)
|
||||
),
|
||||
new Number(
|
||||
array(
|
||||
'number',
|
||||
'port',
|
||||
array(
|
||||
'required' => true,
|
||||
'name' => 'port',
|
||||
'label' => mt('monitoring', 'Port'),
|
||||
'description' => mt('monitoring', 'SSH port to connect to on the remote Icinga instance'),
|
||||
'value' => 22
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
namespace Icinga\Module\Monitoring\Form\Setup;
|
||||
|
||||
use Icinga\Web\Form;
|
||||
use Icinga\Web\Form\Element\Note;
|
||||
use Icinga\Application\Platform;
|
||||
|
||||
class BackendPage extends Form
|
||||
|
@ -18,25 +17,23 @@ class BackendPage extends Form
|
|||
public function createElements(array $formData)
|
||||
{
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'title',
|
||||
array(
|
||||
'value' => mt('monitoring', 'Monitoring Backend', 'setup.page.title'),
|
||||
'decorators' => array(
|
||||
'ViewHelper',
|
||||
array('HtmlTag', array('tag' => 'h2'))
|
||||
)
|
||||
'note',
|
||||
'title',
|
||||
array(
|
||||
'value' => mt('monitoring', 'Monitoring Backend', 'setup.page.title'),
|
||||
'decorators' => array(
|
||||
'ViewHelper',
|
||||
array('HtmlTag', array('tag' => 'h2'))
|
||||
)
|
||||
)
|
||||
);
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'description',
|
||||
array(
|
||||
'value' => mt(
|
||||
'monitoring',
|
||||
'Please configure below how Icinga Web 2 should retrieve monitoring information.'
|
||||
)
|
||||
'note',
|
||||
'description',
|
||||
array(
|
||||
'value' => mt(
|
||||
'monitoring',
|
||||
'Please configure below how Icinga Web 2 should retrieve monitoring information.'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
namespace Icinga\Module\Monitoring\Form\Setup;
|
||||
|
||||
use Icinga\Web\Form;
|
||||
use Icinga\Web\Form\Element\Note;
|
||||
use Icinga\Form\Config\Resource\DbResourceForm;
|
||||
|
||||
class IdoResourcePage extends Form
|
||||
|
@ -26,26 +25,24 @@ class IdoResourcePage extends Form
|
|||
)
|
||||
);
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'title',
|
||||
array(
|
||||
'value' => mt('monitoring', 'Monitoring IDO Resource', 'setup.page.title'),
|
||||
'decorators' => array(
|
||||
'ViewHelper',
|
||||
array('HtmlTag', array('tag' => 'h2'))
|
||||
)
|
||||
'note',
|
||||
'title',
|
||||
array(
|
||||
'value' => mt('monitoring', 'Monitoring IDO Resource', 'setup.page.title'),
|
||||
'decorators' => array(
|
||||
'ViewHelper',
|
||||
array('HtmlTag', array('tag' => 'h2'))
|
||||
)
|
||||
)
|
||||
);
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'description',
|
||||
array(
|
||||
'value' => mt(
|
||||
'monitoring',
|
||||
'Please fill out the connection details below to access'
|
||||
. ' the IDO database of your monitoring environment.'
|
||||
)
|
||||
'note',
|
||||
'description',
|
||||
array(
|
||||
'value' => mt(
|
||||
'monitoring',
|
||||
'Please fill out the connection details below to access'
|
||||
. ' the IDO database of your monitoring environment.'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
namespace Icinga\Module\Monitoring\Form\Setup;
|
||||
|
||||
use Icinga\Web\Form;
|
||||
use Icinga\Web\Form\Element\Note;
|
||||
use Icinga\Module\Monitoring\Form\Config\InstanceConfigForm;
|
||||
|
||||
class InstancePage extends Form
|
||||
|
@ -18,25 +17,23 @@ class InstancePage extends Form
|
|||
public function createElements(array $formData)
|
||||
{
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'title',
|
||||
array(
|
||||
'value' => mt('monitoring', 'Monitoring Instance', 'setup.page.title'),
|
||||
'decorators' => array(
|
||||
'ViewHelper',
|
||||
array('HtmlTag', array('tag' => 'h2'))
|
||||
)
|
||||
'note',
|
||||
'title',
|
||||
array(
|
||||
'value' => mt('monitoring', 'Monitoring Instance', 'setup.page.title'),
|
||||
'decorators' => array(
|
||||
'ViewHelper',
|
||||
array('HtmlTag', array('tag' => 'h2'))
|
||||
)
|
||||
)
|
||||
);
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'description',
|
||||
array(
|
||||
'value' => mt(
|
||||
'monitoring',
|
||||
'Please define the settings specific to your monitoring instance below.'
|
||||
)
|
||||
'note',
|
||||
'description',
|
||||
array(
|
||||
'value' => mt(
|
||||
'monitoring',
|
||||
'Please define the settings specific to your monitoring instance below.'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
namespace Icinga\Module\Monitoring\Form\Setup;
|
||||
|
||||
use Icinga\Web\Form;
|
||||
use Icinga\Web\Form\Element\Note;
|
||||
use Icinga\Form\Config\Resource\LivestatusResourceForm;
|
||||
|
||||
class LivestatusResourcePage extends Form
|
||||
|
@ -26,26 +25,24 @@ class LivestatusResourcePage extends Form
|
|||
)
|
||||
);
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'title',
|
||||
array(
|
||||
'value' => mt('monitoring', 'Monitoring Livestatus Resource', 'setup.page.title'),
|
||||
'decorators' => array(
|
||||
'ViewHelper',
|
||||
array('HtmlTag', array('tag' => 'h2'))
|
||||
)
|
||||
'note',
|
||||
'title',
|
||||
array(
|
||||
'value' => mt('monitoring', 'Monitoring Livestatus Resource', 'setup.page.title'),
|
||||
'decorators' => array(
|
||||
'ViewHelper',
|
||||
array('HtmlTag', array('tag' => 'h2'))
|
||||
)
|
||||
)
|
||||
);
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'description',
|
||||
array(
|
||||
'value' => mt(
|
||||
'monitoring',
|
||||
'Please fill out the connection details below to access the Livestatus'
|
||||
. ' socket interface for your monitoring environment.'
|
||||
)
|
||||
'note',
|
||||
'description',
|
||||
array(
|
||||
'value' => mt(
|
||||
'monitoring',
|
||||
'Please fill out the connection details below to access the Livestatus'
|
||||
. ' socket interface for your monitoring environment.'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
namespace Icinga\Module\Monitoring\Form\Setup;
|
||||
|
||||
use Icinga\Web\Form;
|
||||
use Icinga\Web\Form\Element\Note;
|
||||
use Icinga\Module\Monitoring\Form\Config\SecurityConfigForm;
|
||||
|
||||
class SecurityPage extends Form
|
||||
|
@ -18,25 +17,23 @@ class SecurityPage extends Form
|
|||
public function createElements(array $formData)
|
||||
{
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'title',
|
||||
array(
|
||||
'value' => mt('monitoring', 'Monitoring Security', 'setup.page.title'),
|
||||
'decorators' => array(
|
||||
'ViewHelper',
|
||||
array('HtmlTag', array('tag' => 'h2'))
|
||||
)
|
||||
'note',
|
||||
'title',
|
||||
array(
|
||||
'value' => mt('monitoring', 'Monitoring Security', 'setup.page.title'),
|
||||
'decorators' => array(
|
||||
'ViewHelper',
|
||||
array('HtmlTag', array('tag' => 'h2'))
|
||||
)
|
||||
)
|
||||
);
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'description',
|
||||
array(
|
||||
'value' => mt(
|
||||
'monitoring',
|
||||
'To protect your monitoring environment against prying eyes please fill out the settings below.'
|
||||
)
|
||||
'note',
|
||||
'description',
|
||||
array(
|
||||
'value' => mt(
|
||||
'monitoring',
|
||||
'To protect your monitoring environment against prying eyes please fill out the settings below.'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
namespace Icinga\Module\Monitoring\Form\Setup;
|
||||
|
||||
use Icinga\Web\Form;
|
||||
use Icinga\Web\Form\Element\Note;
|
||||
|
||||
class WelcomePage extends Form
|
||||
{
|
||||
|
@ -17,39 +16,36 @@ class WelcomePage extends Form
|
|||
public function createElements(array $formData)
|
||||
{
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'welcome',
|
||||
array(
|
||||
'value' => mt(
|
||||
'monitoring',
|
||||
'Welcome to the configuration of the monitoring module for Icinga Web 2!'
|
||||
),
|
||||
'decorators' => array(
|
||||
'ViewHelper',
|
||||
array('HtmlTag', array('tag' => 'h2'))
|
||||
)
|
||||
'note',
|
||||
'welcome',
|
||||
array(
|
||||
'value' => mt(
|
||||
'monitoring',
|
||||
'Welcome to the configuration of the monitoring module for Icinga Web 2!'
|
||||
),
|
||||
'decorators' => array(
|
||||
'ViewHelper',
|
||||
array('HtmlTag', array('tag' => 'h2'))
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'core_hint',
|
||||
array(
|
||||
'value' => mt('monitoring', 'This is the core module for Icinga Web 2.')
|
||||
)
|
||||
'note',
|
||||
'core_hint',
|
||||
array(
|
||||
'value' => mt('monitoring', 'This is the core module for Icinga Web 2.')
|
||||
)
|
||||
);
|
||||
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'description',
|
||||
array(
|
||||
'value' => mt(
|
||||
'monitoring',
|
||||
'It offers various status and reporting views with powerful filter capabilities that allow'
|
||||
. ' you to keep track of the most important events in your monitoring environment.'
|
||||
)
|
||||
'note',
|
||||
'description',
|
||||
array(
|
||||
'value' => mt(
|
||||
'monitoring',
|
||||
'It offers various status and reporting views with powerful filter capabilities that allow'
|
||||
. ' you to keep track of the most important events in your monitoring environment.'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
|
|
@ -9,7 +9,6 @@ use LogicException;
|
|||
use Icinga\Application\Config;
|
||||
use Icinga\Web\Form;
|
||||
use Icinga\Data\ResourceFactory;
|
||||
use Icinga\Web\Form\Element\Note;
|
||||
use Icinga\Authentication\Backend\DbUserBackend;
|
||||
use Icinga\Authentication\Backend\LdapUserBackend;
|
||||
|
||||
|
@ -177,28 +176,26 @@ class AdminAccountPage extends Form
|
|||
}
|
||||
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'title',
|
||||
array(
|
||||
'value' => mt('setup', 'Administration', 'setup.page.title'),
|
||||
'decorators' => array(
|
||||
'ViewHelper',
|
||||
array('HtmlTag', array('tag' => 'h2'))
|
||||
)
|
||||
'note',
|
||||
'title',
|
||||
array(
|
||||
'value' => mt('setup', 'Administration', 'setup.page.title'),
|
||||
'decorators' => array(
|
||||
'ViewHelper',
|
||||
array('HtmlTag', array('tag' => 'h2'))
|
||||
)
|
||||
)
|
||||
);
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'description',
|
||||
array(
|
||||
'value' => tp(
|
||||
'Now it\'s time to configure your first administrative account for Icinga Web 2.'
|
||||
. ' Please follow the instructions below:',
|
||||
'Now it\'s time to configure your first administrative account for Icinga Web 2.'
|
||||
. ' Below are several options you can choose from. Select one and follow its instructions:',
|
||||
count($choices)
|
||||
)
|
||||
'note',
|
||||
'description',
|
||||
array(
|
||||
'value' => tp(
|
||||
'Now it\'s time to configure your first administrative account for Icinga Web 2.'
|
||||
. ' Please follow the instructions below:',
|
||||
'Now it\'s time to configure your first administrative account for Icinga Web 2.'
|
||||
. ' Below are several options you can choose from. Select one and follow its instructions:',
|
||||
count($choices)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
|
|
@ -6,7 +6,6 @@ namespace Icinga\Module\Setup\Form;
|
|||
|
||||
use Icinga\Application\Config;
|
||||
use Icinga\Web\Form;
|
||||
use Icinga\Web\Form\Element\Note;
|
||||
use Icinga\Form\Config\Authentication\DbBackendForm;
|
||||
use Icinga\Form\Config\Authentication\LdapBackendForm;
|
||||
use Icinga\Form\Config\Authentication\AutologinBackendForm;
|
||||
|
@ -60,14 +59,13 @@ class AuthBackendPage extends Form
|
|||
public function createElements(array $formData)
|
||||
{
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'title',
|
||||
array(
|
||||
'value' => mt('setup', 'Authentication Backend', 'setup.page.title'),
|
||||
'decorators' => array(
|
||||
'ViewHelper',
|
||||
array('HtmlTag', array('tag' => 'h2'))
|
||||
)
|
||||
'note',
|
||||
'title',
|
||||
array(
|
||||
'value' => mt('setup', 'Authentication Backend', 'setup.page.title'),
|
||||
'decorators' => array(
|
||||
'ViewHelper',
|
||||
array('HtmlTag', array('tag' => 'h2'))
|
||||
)
|
||||
)
|
||||
);
|
||||
|
@ -93,10 +91,9 @@ class AuthBackendPage extends Form
|
|||
}
|
||||
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'description',
|
||||
array('value' => $note)
|
||||
)
|
||||
'note',
|
||||
'description',
|
||||
array('value' => $note)
|
||||
);
|
||||
|
||||
if (isset($formData['skip_validation']) && $formData['skip_validation']) {
|
||||
|
|
|
@ -6,7 +6,6 @@ namespace Icinga\Module\Setup\Form;
|
|||
|
||||
use Icinga\Web\Form;
|
||||
use Icinga\Application\Platform;
|
||||
use Icinga\Web\Form\Element\Note;
|
||||
|
||||
/**
|
||||
* Wizard page to choose an authentication backend
|
||||
|
@ -27,26 +26,24 @@ class AuthenticationPage extends Form
|
|||
public function createElements(array $formData)
|
||||
{
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'title',
|
||||
array(
|
||||
'value' => mt('setup', 'Authentication', 'setup.page.title'),
|
||||
'decorators' => array(
|
||||
'ViewHelper',
|
||||
array('HtmlTag', array('tag' => 'h2'))
|
||||
)
|
||||
'note',
|
||||
'title',
|
||||
array(
|
||||
'value' => mt('setup', 'Authentication', 'setup.page.title'),
|
||||
'decorators' => array(
|
||||
'ViewHelper',
|
||||
array('HtmlTag', array('tag' => 'h2'))
|
||||
)
|
||||
)
|
||||
);
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'description',
|
||||
array(
|
||||
'value' => mt(
|
||||
'setup',
|
||||
'Please choose how you want to authenticate when accessing Icinga Web 2.'
|
||||
. ' Configuring backend specific details follows in a later step.'
|
||||
)
|
||||
'note',
|
||||
'description',
|
||||
array(
|
||||
'value' => mt(
|
||||
'setup',
|
||||
'Please choose how you want to authenticate when accessing Icinga Web 2.'
|
||||
. ' Configuring backend specific details follows in a later step.'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
|
|
@ -6,7 +6,6 @@ namespace Icinga\Module\Setup\Form;
|
|||
|
||||
use PDOException;
|
||||
use Icinga\Web\Form;
|
||||
use Icinga\Web\Form\Element\Note;
|
||||
use Icinga\Module\Setup\Utils\DbTool;
|
||||
|
||||
/**
|
||||
|
@ -88,27 +87,25 @@ class DatabaseCreationPage extends Form
|
|||
public function createElements(array $formData)
|
||||
{
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'title',
|
||||
array(
|
||||
'value' => mt('setup', 'Database Setup', 'setup.page.title'),
|
||||
'decorators' => array(
|
||||
'ViewHelper',
|
||||
array('HtmlTag', array('tag' => 'h2'))
|
||||
)
|
||||
'note',
|
||||
'title',
|
||||
array(
|
||||
'value' => mt('setup', 'Database Setup', 'setup.page.title'),
|
||||
'decorators' => array(
|
||||
'ViewHelper',
|
||||
array('HtmlTag', array('tag' => 'h2'))
|
||||
)
|
||||
)
|
||||
);
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'description',
|
||||
array(
|
||||
'value' => mt(
|
||||
'setup',
|
||||
'It seems that either the database you defined earlier does not yet exist and cannot be created'
|
||||
. ' using the provided access credentials or the database does not have the required schema to '
|
||||
. 'be operated by Icinga Web 2. Please provide appropriate access credentials to solve this.'
|
||||
)
|
||||
'note',
|
||||
'description',
|
||||
array(
|
||||
'value' => mt(
|
||||
'setup',
|
||||
'It seems that either the database you defined earlier does not yet exist and cannot be created'
|
||||
. ' using the provided access credentials or the database does not have the required schema to '
|
||||
. 'be operated by Icinga Web 2. Please provide appropriate access credentials to solve this.'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
|
|
@ -6,7 +6,6 @@ namespace Icinga\Module\Setup\Form;
|
|||
|
||||
use PDOException;
|
||||
use Icinga\Web\Form;
|
||||
use Icinga\Web\Form\Element\Note;
|
||||
use Icinga\Form\Config\Resource\DbResourceForm;
|
||||
use Icinga\Module\Setup\Utils\DbTool;
|
||||
|
||||
|
@ -37,26 +36,24 @@ class DbResourcePage extends Form
|
|||
)
|
||||
);
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'title',
|
||||
array(
|
||||
'value' => mt('setup', 'Database Resource', 'setup.page.title'),
|
||||
'decorators' => array(
|
||||
'ViewHelper',
|
||||
array('HtmlTag', array('tag' => 'h2'))
|
||||
)
|
||||
'note',
|
||||
'title',
|
||||
array(
|
||||
'value' => mt('setup', 'Database Resource', 'setup.page.title'),
|
||||
'decorators' => array(
|
||||
'ViewHelper',
|
||||
array('HtmlTag', array('tag' => 'h2'))
|
||||
)
|
||||
)
|
||||
);
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'description',
|
||||
array(
|
||||
'value' => mt(
|
||||
'setup',
|
||||
'Now please configure your database resource. Note that the database itself does not need to'
|
||||
. ' exist at this time as it is going to be created once the wizard is about to be finished.'
|
||||
)
|
||||
'note',
|
||||
'description',
|
||||
array(
|
||||
'value' => mt(
|
||||
'setup',
|
||||
'Now please configure your database resource. Note that the database itself does not need to'
|
||||
. ' exist at this time as it is going to be created once the wizard is about to be finished.'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
namespace Icinga\Module\Setup\Form;
|
||||
|
||||
use Icinga\Web\Form;
|
||||
use Icinga\Web\Form\Element\Note;
|
||||
use Icinga\Form\Config\General\LoggingConfigForm;
|
||||
|
||||
/**
|
||||
|
@ -27,25 +26,23 @@ class GeneralConfigPage extends Form
|
|||
public function createElements(array $formData)
|
||||
{
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'title',
|
||||
array(
|
||||
'value' => mt('setup', 'Application Configuration', 'setup.page.title'),
|
||||
'decorators' => array(
|
||||
'ViewHelper',
|
||||
array('HtmlTag', array('tag' => 'h2'))
|
||||
)
|
||||
'note',
|
||||
'title',
|
||||
array(
|
||||
'value' => mt('setup', 'Application Configuration', 'setup.page.title'),
|
||||
'decorators' => array(
|
||||
'ViewHelper',
|
||||
array('HtmlTag', array('tag' => 'h2'))
|
||||
)
|
||||
)
|
||||
);
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'description',
|
||||
array(
|
||||
'value' => mt(
|
||||
'setup',
|
||||
'Now please adjust all application and logging related configuration options to fit your needs.'
|
||||
)
|
||||
'note',
|
||||
'description',
|
||||
array(
|
||||
'value' => mt(
|
||||
'setup',
|
||||
'Now please adjust all application and logging related configuration options to fit your needs.'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
|
|
@ -6,7 +6,6 @@ namespace Icinga\Module\Setup\Form;
|
|||
|
||||
use Icinga\Application\Config;
|
||||
use Icinga\Web\Form;
|
||||
use Icinga\Web\Form\Element\Note;
|
||||
|
||||
/**
|
||||
* Wizard page to define the connection details for a LDAP resource
|
||||
|
@ -80,39 +79,36 @@ EOT;
|
|||
$html = str_replace('{user_class}', $backend['user_class'], $html);
|
||||
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'title',
|
||||
array(
|
||||
'value' => mt('setup', 'LDAP Discovery Results', 'setup.page.title'),
|
||||
'decorators' => array(
|
||||
'ViewHelper',
|
||||
array('HtmlTag', array('tag' => 'h2'))
|
||||
)
|
||||
'note',
|
||||
'title',
|
||||
array(
|
||||
'value' => mt('setup', 'LDAP Discovery Results', 'setup.page.title'),
|
||||
'decorators' => array(
|
||||
'ViewHelper',
|
||||
array('HtmlTag', array('tag' => 'h2'))
|
||||
)
|
||||
)
|
||||
);
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'description',
|
||||
array(
|
||||
'value' => sprintf(
|
||||
mt('setup', 'The following directory service has been found on domain "%s":'),
|
||||
$this->config['domain']
|
||||
)
|
||||
'note',
|
||||
'description',
|
||||
array(
|
||||
'value' => sprintf(
|
||||
mt('setup', 'The following directory service has been found on domain "%s":'),
|
||||
$this->config['domain']
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'suggestion',
|
||||
array(
|
||||
'value' => $html,
|
||||
'decorators' => array(
|
||||
'ViewHelper',
|
||||
array(
|
||||
'HtmlTag', array('tag' => 'div')
|
||||
)
|
||||
'note',
|
||||
'suggestion',
|
||||
array(
|
||||
'value' => $html,
|
||||
'decorators' => array(
|
||||
'ViewHelper',
|
||||
array(
|
||||
'HtmlTag', array('tag' => 'div')
|
||||
)
|
||||
)
|
||||
)
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
namespace Icinga\Module\Setup\Form;
|
||||
|
||||
use Icinga\Web\Form;
|
||||
use Icinga\Web\Form\Element\Note;
|
||||
use Icinga\Form\LdapDiscoveryForm;
|
||||
|
||||
/**
|
||||
|
@ -32,26 +31,24 @@ class LdapDiscoveryPage extends Form
|
|||
public function createElements(array $formData)
|
||||
{
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'title',
|
||||
array(
|
||||
'value' => mt('setup', 'LDAP Discovery', 'setup.page.title'),
|
||||
'decorators' => array(
|
||||
'ViewHelper',
|
||||
array('HtmlTag', array('tag' => 'h2'))
|
||||
)
|
||||
'note',
|
||||
'title',
|
||||
array(
|
||||
'value' => mt('setup', 'LDAP Discovery', 'setup.page.title'),
|
||||
'decorators' => array(
|
||||
'ViewHelper',
|
||||
array('HtmlTag', array('tag' => 'h2'))
|
||||
)
|
||||
)
|
||||
);
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'description',
|
||||
array(
|
||||
'value' => mt(
|
||||
'setup',
|
||||
'You can use this page to discover LDAP or ActiveDirectory servers ' .
|
||||
' for authentication. If you don\' want to execute a discovery, just skip this step.'
|
||||
)
|
||||
'note',
|
||||
'description',
|
||||
array(
|
||||
'value' => mt(
|
||||
'setup',
|
||||
'You can use this page to discover LDAP or ActiveDirectory servers ' .
|
||||
' for authentication. If you don\' want to execute a discovery, just skip this step.'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
namespace Icinga\Module\Setup\Form;
|
||||
|
||||
use Icinga\Web\Form;
|
||||
use Icinga\Web\Form\Element\Note;
|
||||
use Icinga\Form\Config\Resource\LdapResourceForm;
|
||||
|
||||
/**
|
||||
|
@ -35,26 +34,24 @@ class LdapResourcePage extends Form
|
|||
)
|
||||
);
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'title',
|
||||
array(
|
||||
'value' => mt('setup', 'LDAP Resource', 'setup.page.title'),
|
||||
'decorators' => array(
|
||||
'ViewHelper',
|
||||
array('HtmlTag', array('tag' => 'h2'))
|
||||
)
|
||||
'note',
|
||||
'title',
|
||||
array(
|
||||
'value' => mt('setup', 'LDAP Resource', 'setup.page.title'),
|
||||
'decorators' => array(
|
||||
'ViewHelper',
|
||||
array('HtmlTag', array('tag' => 'h2'))
|
||||
)
|
||||
)
|
||||
);
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'description',
|
||||
array(
|
||||
'value' => mt(
|
||||
'setup',
|
||||
'Now please configure your AD/LDAP resource. This will later '
|
||||
. 'be used to authenticate users logging in to Icinga Web 2.'
|
||||
)
|
||||
'note',
|
||||
'description',
|
||||
array(
|
||||
'value' => mt(
|
||||
'setup',
|
||||
'Now please configure your AD/LDAP resource. This will later '
|
||||
. 'be used to authenticate users logging in to Icinga Web 2.'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
|
|
@ -6,7 +6,6 @@ namespace Icinga\Module\Setup\Form;
|
|||
|
||||
use Icinga\Web\Form;
|
||||
use Icinga\Application\Platform;
|
||||
use Icinga\Web\Form\Element\Note;
|
||||
|
||||
/**
|
||||
* Wizard page to choose a preference backend
|
||||
|
@ -45,23 +44,21 @@ class PreferencesPage extends Form
|
|||
public function createElements(array $formData)
|
||||
{
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'title',
|
||||
array(
|
||||
'value' => mt('setup', 'Preferences', 'setup.page.title'),
|
||||
'decorators' => array(
|
||||
'ViewHelper',
|
||||
array('HtmlTag', array('tag' => 'h2'))
|
||||
)
|
||||
'note',
|
||||
'title',
|
||||
array(
|
||||
'value' => mt('setup', 'Preferences', 'setup.page.title'),
|
||||
'decorators' => array(
|
||||
'ViewHelper',
|
||||
array('HtmlTag', array('tag' => 'h2'))
|
||||
)
|
||||
)
|
||||
);
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'description',
|
||||
array(
|
||||
'value' => mt('setup', 'Please choose how Icinga Web 2 should store user preferences.')
|
||||
)
|
||||
'note',
|
||||
'description',
|
||||
array(
|
||||
'value' => mt('setup', 'Please choose how Icinga Web 2 should store user preferences.')
|
||||
)
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in New Issue