mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-29 08:44:10 +02:00
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,15 +67,14 @@ class DbResourceForm extends Form
|
||||
)
|
||||
);
|
||||
$this->addElement(
|
||||
new Number(
|
||||
'number',
|
||||
'port',
|
||||
array(
|
||||
'required' => true,
|
||||
'name' => 'port',
|
||||
'label' => t('Port'),
|
||||
'description' => t('The port to use'),
|
||||
'value' => 3306
|
||||
)
|
||||
)
|
||||
);
|
||||
$this->addElement(
|
||||
'text',
|
||||
|
@ -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,15 +48,14 @@ class LdapResourceForm extends Form
|
||||
)
|
||||
);
|
||||
$this->addElement(
|
||||
new Number(
|
||||
'number',
|
||||
'port',
|
||||
array(
|
||||
'required' => true,
|
||||
'name' => 'port',
|
||||
'label' => t('Port'),
|
||||
'description' => t('The port of the LDAP server to use for authentication'),
|
||||
'value' => 389
|
||||
)
|
||||
)
|
||||
);
|
||||
$this->addElement(
|
||||
'text',
|
||||
|
@ -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,7 +67,7 @@ class LdapDiscoveryForm extends Form
|
||||
|
||||
if (false) {
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'note',
|
||||
'additional_description',
|
||||
array(
|
||||
'value' => t('No Ldap servers found on this domain.'
|
||||
@ -76,7 +75,6 @@ class LdapDiscoveryForm extends Form
|
||||
. 'configure the server manually.'
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
$this->addElement(
|
||||
'text',
|
||||
|
@ -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,7 +426,7 @@ class Wizard
|
||||
$index = array_search($page, $pages, true);
|
||||
if ($index === 0) {
|
||||
$page->addElement(
|
||||
new Button(
|
||||
'button',
|
||||
static::BTN_NEXT,
|
||||
array(
|
||||
'type' => 'submit',
|
||||
@ -435,11 +434,10 @@ class Wizard
|
||||
'label' => t('Next'),
|
||||
'decorators' => array('ViewHelper')
|
||||
)
|
||||
)
|
||||
);
|
||||
} elseif ($index < count($pages) - 1) {
|
||||
$page->addElement(
|
||||
new Button(
|
||||
'button',
|
||||
static::BTN_PREV,
|
||||
array(
|
||||
'type' => 'submit',
|
||||
@ -447,10 +445,9 @@ class Wizard
|
||||
'label' => t('Back'),
|
||||
'decorators' => array('ViewHelper')
|
||||
)
|
||||
)
|
||||
);
|
||||
$page->addElement(
|
||||
new Button(
|
||||
'button',
|
||||
static::BTN_NEXT,
|
||||
array(
|
||||
'type' => 'submit',
|
||||
@ -458,11 +455,10 @@ class Wizard
|
||||
'label' => t('Next'),
|
||||
'decorators' => array('ViewHelper')
|
||||
)
|
||||
)
|
||||
);
|
||||
} else {
|
||||
$page->addElement(
|
||||
new Button(
|
||||
'button',
|
||||
static::BTN_PREV,
|
||||
array(
|
||||
'type' => 'submit',
|
||||
@ -470,10 +466,9 @@ class Wizard
|
||||
'label' => t('Back'),
|
||||
'decorators' => array('ViewHelper')
|
||||
)
|
||||
)
|
||||
);
|
||||
$page->addElement(
|
||||
new Button(
|
||||
'button',
|
||||
static::BTN_NEXT,
|
||||
array(
|
||||
'type' => 'submit',
|
||||
@ -481,7 +476,6 @@ class Wizard
|
||||
'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,7 +32,7 @@ class DisableNotificationsExpireCommandForm extends CommandForm
|
||||
public function createElements(array $formData = array())
|
||||
{
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'note',
|
||||
'command-info',
|
||||
array(
|
||||
'value' => mt(
|
||||
@ -42,12 +40,11 @@ class DisableNotificationsExpireCommandForm extends CommandForm
|
||||
'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(
|
||||
'dateTimePicker',
|
||||
'expire_time',
|
||||
array(
|
||||
'required' => true,
|
||||
@ -55,7 +52,6 @@ class DisableNotificationsExpireCommandForm extends CommandForm
|
||||
'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,7 +85,7 @@ class AcknowledgeProblemCommandForm extends ObjectsCommandForm
|
||||
$expireTime = new DateTime();
|
||||
$expireTime->add(new DateInterval('PT1H'));
|
||||
$this->addElement(
|
||||
new DateTimePicker(
|
||||
'dateTimePicker',
|
||||
'expire_time',
|
||||
array(
|
||||
'label' => mt('monitoring', 'Expire Time'),
|
||||
@ -97,7 +96,6 @@ class AcknowledgeProblemCommandForm extends ObjectsCommandForm
|
||||
. ' acknowledgement after this time expired.'
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
$this->addDisplayGroup(
|
||||
array('expire', 'expire_time'),
|
||||
|
@ -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,7 +32,7 @@ class CheckNowCommandForm extends ObjectsCommandForm
|
||||
$iconUrl = $this->getView()->href('img/icons/refresh_petrol.png');
|
||||
|
||||
$this->addElements(array(
|
||||
new Button(
|
||||
'button',
|
||||
'btn_submit',
|
||||
array(
|
||||
'ignore' => true,
|
||||
@ -45,7 +43,6 @@ class CheckNowCommandForm extends ObjectsCommandForm
|
||||
'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,7 +17,7 @@ class BackendPage extends Form
|
||||
public function createElements(array $formData)
|
||||
{
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'note',
|
||||
'title',
|
||||
array(
|
||||
'value' => mt('monitoring', 'Monitoring Backend', 'setup.page.title'),
|
||||
@ -27,10 +26,9 @@ class BackendPage extends Form
|
||||
array('HtmlTag', array('tag' => 'h2'))
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'note',
|
||||
'description',
|
||||
array(
|
||||
'value' => mt(
|
||||
@ -38,7 +36,6 @@ class BackendPage extends Form
|
||||
'Please configure below how Icinga Web 2 should retrieve monitoring information.'
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$this->addElement(
|
||||
|
@ -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,7 +25,7 @@ class IdoResourcePage extends Form
|
||||
)
|
||||
);
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'note',
|
||||
'title',
|
||||
array(
|
||||
'value' => mt('monitoring', 'Monitoring IDO Resource', 'setup.page.title'),
|
||||
@ -35,10 +34,9 @@ class IdoResourcePage extends Form
|
||||
array('HtmlTag', array('tag' => 'h2'))
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'note',
|
||||
'description',
|
||||
array(
|
||||
'value' => mt(
|
||||
@ -47,7 +45,6 @@ class IdoResourcePage extends Form
|
||||
. ' the IDO database of your monitoring environment.'
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
if (isset($formData['skip_validation']) && $formData['skip_validation']) {
|
||||
|
@ -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,7 +17,7 @@ class InstancePage extends Form
|
||||
public function createElements(array $formData)
|
||||
{
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'note',
|
||||
'title',
|
||||
array(
|
||||
'value' => mt('monitoring', 'Monitoring Instance', 'setup.page.title'),
|
||||
@ -27,10 +26,9 @@ class InstancePage extends Form
|
||||
array('HtmlTag', array('tag' => 'h2'))
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'note',
|
||||
'description',
|
||||
array(
|
||||
'value' => mt(
|
||||
@ -38,7 +36,6 @@ class InstancePage extends Form
|
||||
'Please define the settings specific to your monitoring instance below.'
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
if (isset($formData['host'])) {
|
||||
|
@ -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,7 +25,7 @@ class LivestatusResourcePage extends Form
|
||||
)
|
||||
);
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'note',
|
||||
'title',
|
||||
array(
|
||||
'value' => mt('monitoring', 'Monitoring Livestatus Resource', 'setup.page.title'),
|
||||
@ -35,10 +34,9 @@ class LivestatusResourcePage extends Form
|
||||
array('HtmlTag', array('tag' => 'h2'))
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'note',
|
||||
'description',
|
||||
array(
|
||||
'value' => mt(
|
||||
@ -47,7 +45,6 @@ class LivestatusResourcePage extends Form
|
||||
. ' socket interface for your monitoring environment.'
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
if (isset($formData['skip_validation']) && $formData['skip_validation']) {
|
||||
|
@ -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,7 +17,7 @@ class SecurityPage extends Form
|
||||
public function createElements(array $formData)
|
||||
{
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'note',
|
||||
'title',
|
||||
array(
|
||||
'value' => mt('monitoring', 'Monitoring Security', 'setup.page.title'),
|
||||
@ -27,10 +26,9 @@ class SecurityPage extends Form
|
||||
array('HtmlTag', array('tag' => 'h2'))
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'note',
|
||||
'description',
|
||||
array(
|
||||
'value' => mt(
|
||||
@ -38,7 +36,6 @@ class SecurityPage extends Form
|
||||
'To protect your monitoring environment against prying eyes please fill out the settings below.'
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$securityConfigForm = new SecurityConfigForm();
|
||||
|
@ -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,7 +16,7 @@ class WelcomePage extends Form
|
||||
public function createElements(array $formData)
|
||||
{
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'note',
|
||||
'welcome',
|
||||
array(
|
||||
'value' => mt(
|
||||
@ -29,20 +28,18 @@ class WelcomePage extends Form
|
||||
array('HtmlTag', array('tag' => 'h2'))
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'note',
|
||||
'core_hint',
|
||||
array(
|
||||
'value' => mt('monitoring', 'This is the core module for Icinga Web 2.')
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'note',
|
||||
'description',
|
||||
array(
|
||||
'value' => mt(
|
||||
@ -51,7 +48,6 @@ class WelcomePage extends Form
|
||||
. ' you to keep track of the most important events in your monitoring environment.'
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$this->addDisplayGroup(
|
||||
|
@ -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,7 +176,7 @@ class AdminAccountPage extends Form
|
||||
}
|
||||
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'note',
|
||||
'title',
|
||||
array(
|
||||
'value' => mt('setup', 'Administration', 'setup.page.title'),
|
||||
@ -186,10 +185,9 @@ class AdminAccountPage extends Form
|
||||
array('HtmlTag', array('tag' => 'h2'))
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'note',
|
||||
'description',
|
||||
array(
|
||||
'value' => tp(
|
||||
@ -200,7 +198,6 @@ class AdminAccountPage extends Form
|
||||
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,7 +59,7 @@ class AuthBackendPage extends Form
|
||||
public function createElements(array $formData)
|
||||
{
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'note',
|
||||
'title',
|
||||
array(
|
||||
'value' => mt('setup', 'Authentication Backend', 'setup.page.title'),
|
||||
@ -69,7 +68,6 @@ class AuthBackendPage extends Form
|
||||
array('HtmlTag', array('tag' => 'h2'))
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
if ($this->config['type'] === 'db') {
|
||||
@ -93,10 +91,9 @@ class AuthBackendPage extends Form
|
||||
}
|
||||
|
||||
$this->addElement(
|
||||
new 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,7 +26,7 @@ class AuthenticationPage extends Form
|
||||
public function createElements(array $formData)
|
||||
{
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'note',
|
||||
'title',
|
||||
array(
|
||||
'value' => mt('setup', 'Authentication', 'setup.page.title'),
|
||||
@ -36,10 +35,9 @@ class AuthenticationPage extends Form
|
||||
array('HtmlTag', array('tag' => 'h2'))
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'note',
|
||||
'description',
|
||||
array(
|
||||
'value' => mt(
|
||||
@ -48,7 +46,6 @@ class AuthenticationPage extends Form
|
||||
. ' Configuring backend specific details follows in a later step.'
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$backendTypes = array();
|
||||
|
@ -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,7 +87,7 @@ class DatabaseCreationPage extends Form
|
||||
public function createElements(array $formData)
|
||||
{
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'note',
|
||||
'title',
|
||||
array(
|
||||
'value' => mt('setup', 'Database Setup', 'setup.page.title'),
|
||||
@ -97,10 +96,9 @@ class DatabaseCreationPage extends Form
|
||||
array('HtmlTag', array('tag' => 'h2'))
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'note',
|
||||
'description',
|
||||
array(
|
||||
'value' => mt(
|
||||
@ -110,7 +108,6 @@ class DatabaseCreationPage extends Form
|
||||
. 'be operated by Icinga Web 2. Please provide appropriate access credentials to solve this.'
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$skipValidation = isset($formData['skip_validation']) && $formData['skip_validation'];
|
||||
|
@ -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,7 +36,7 @@ class DbResourcePage extends Form
|
||||
)
|
||||
);
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'note',
|
||||
'title',
|
||||
array(
|
||||
'value' => mt('setup', 'Database Resource', 'setup.page.title'),
|
||||
@ -46,10 +45,9 @@ class DbResourcePage extends Form
|
||||
array('HtmlTag', array('tag' => 'h2'))
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'note',
|
||||
'description',
|
||||
array(
|
||||
'value' => mt(
|
||||
@ -58,7 +56,6 @@ class DbResourcePage extends Form
|
||||
. ' exist at this time as it is going to be created once the wizard is about to be finished.'
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
if (isset($formData['skip_validation']) && $formData['skip_validation']) {
|
||||
|
@ -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,7 +26,7 @@ class GeneralConfigPage extends Form
|
||||
public function createElements(array $formData)
|
||||
{
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'note',
|
||||
'title',
|
||||
array(
|
||||
'value' => mt('setup', 'Application Configuration', 'setup.page.title'),
|
||||
@ -36,10 +35,9 @@ class GeneralConfigPage extends Form
|
||||
array('HtmlTag', array('tag' => 'h2'))
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'note',
|
||||
'description',
|
||||
array(
|
||||
'value' => mt(
|
||||
@ -47,7 +45,6 @@ class GeneralConfigPage extends Form
|
||||
'Now please adjust all application and logging related configuration options to fit your needs.'
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$loggingForm = new LoggingConfigForm();
|
||||
|
@ -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,7 +79,7 @@ EOT;
|
||||
$html = str_replace('{user_class}', $backend['user_class'], $html);
|
||||
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'note',
|
||||
'title',
|
||||
array(
|
||||
'value' => mt('setup', 'LDAP Discovery Results', 'setup.page.title'),
|
||||
@ -89,10 +88,9 @@ EOT;
|
||||
array('HtmlTag', array('tag' => 'h2'))
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'note',
|
||||
'description',
|
||||
array(
|
||||
'value' => sprintf(
|
||||
@ -100,11 +98,10 @@ EOT;
|
||||
$this->config['domain']
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'note',
|
||||
'suggestion',
|
||||
array(
|
||||
'value' => $html,
|
||||
@ -115,7 +112,6 @@ EOT;
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$this->addElement(
|
||||
|
@ -5,7 +5,6 @@
|
||||
namespace Icinga\Module\Setup\Form;
|
||||
|
||||
use Icinga\Web\Form;
|
||||
use Icinga\Web\Form\Element\Note;
|
||||
use Icinga\Form\LdapDiscoveryForm;
|
||||
|
||||
/**
|
||||
@ -32,7 +31,7 @@ class LdapDiscoveryPage extends Form
|
||||
public function createElements(array $formData)
|
||||
{
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'note',
|
||||
'title',
|
||||
array(
|
||||
'value' => mt('setup', 'LDAP Discovery', 'setup.page.title'),
|
||||
@ -41,10 +40,9 @@ class LdapDiscoveryPage extends Form
|
||||
array('HtmlTag', array('tag' => 'h2'))
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'note',
|
||||
'description',
|
||||
array(
|
||||
'value' => mt(
|
||||
@ -53,7 +51,6 @@ class LdapDiscoveryPage extends Form
|
||||
' for authentication. If you don\' want to execute a discovery, just skip this step.'
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$this->discoveryForm = new LdapDiscoveryForm();
|
||||
|
@ -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,7 +34,7 @@ class LdapResourcePage extends Form
|
||||
)
|
||||
);
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'note',
|
||||
'title',
|
||||
array(
|
||||
'value' => mt('setup', 'LDAP Resource', 'setup.page.title'),
|
||||
@ -44,10 +43,9 @@ class LdapResourcePage extends Form
|
||||
array('HtmlTag', array('tag' => 'h2'))
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'note',
|
||||
'description',
|
||||
array(
|
||||
'value' => mt(
|
||||
@ -56,7 +54,6 @@ class LdapResourcePage extends Form
|
||||
. 'be used to authenticate users logging in to Icinga Web 2.'
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
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 a preference backend
|
||||
@ -45,7 +44,7 @@ class PreferencesPage extends Form
|
||||
public function createElements(array $formData)
|
||||
{
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'note',
|
||||
'title',
|
||||
array(
|
||||
'value' => mt('setup', 'Preferences', 'setup.page.title'),
|
||||
@ -54,15 +53,13 @@ class PreferencesPage extends Form
|
||||
array('HtmlTag', array('tag' => 'h2'))
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
$this->addElement(
|
||||
new Note(
|
||||
'note',
|
||||
'description',
|
||||
array(
|
||||
'value' => mt('setup', 'Please choose how Icinga Web 2 should store user preferences.')
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$storageTypes = array();
|
||||
|
Loading…
x
Reference in New Issue
Block a user