Leave it up to Icinga\Web\Form to instantiate our own form elements

This commit is contained in:
Johannes Meyer 2014-11-14 10:15:11 +01:00
parent 872dce2208
commit 1c4a5ce86f
29 changed files with 342 additions and 411 deletions

View File

@ -8,7 +8,6 @@ use Exception;
use Icinga\Application\Config; use Icinga\Application\Config;
use Icinga\Web\Form; use Icinga\Web\Form;
use Icinga\Web\Request; use Icinga\Web\Request;
use Icinga\Web\Form\Element\Number;
use Icinga\Data\ResourceFactory; use Icinga\Data\ResourceFactory;
use Icinga\Application\Platform; use Icinga\Application\Platform;
@ -68,15 +67,14 @@ class DbResourceForm extends Form
) )
); );
$this->addElement( $this->addElement(
new Number( 'number',
'port',
array( array(
'required' => true, 'required' => true,
'name' => 'port',
'label' => t('Port'), 'label' => t('Port'),
'description' => t('The port to use'), 'description' => t('The port to use'),
'value' => 3306 'value' => 3306
) )
)
); );
$this->addElement( $this->addElement(
'text', 'text',

View File

@ -8,7 +8,6 @@ use Exception;
use Icinga\Application\Config; use Icinga\Application\Config;
use Icinga\Web\Form; use Icinga\Web\Form;
use Icinga\Web\Request; use Icinga\Web\Request;
use Icinga\Web\Form\Element\Number;
use Icinga\Data\ResourceFactory; use Icinga\Data\ResourceFactory;
/** /**
@ -49,15 +48,14 @@ class LdapResourceForm extends Form
) )
); );
$this->addElement( $this->addElement(
new Number( 'number',
'port',
array( array(
'required' => true, 'required' => true,
'name' => 'port',
'label' => t('Port'), 'label' => t('Port'),
'description' => t('The port of the LDAP server to use for authentication'), 'description' => t('The port of the LDAP server to use for authentication'),
'value' => 389 'value' => 389
) )
)
); );
$this->addElement( $this->addElement(
'text', 'text',

View File

@ -7,7 +7,6 @@ use Icinga\Application\Logger;
use Icinga\Protocol\Ldap\Exception as LdapException; use Icinga\Protocol\Ldap\Exception as LdapException;
use Icinga\Protocol\Ldap\Connection; use Icinga\Protocol\Ldap\Connection;
use Icinga\Protocol\Dns; use Icinga\Protocol\Dns;
use Icinga\Web\Form\Element\Note;
use Icinga\Web\Form; use Icinga\Web\Form;
/** /**
@ -68,7 +67,7 @@ class LdapDiscoveryForm extends Form
if (false) { if (false) {
$this->addElement( $this->addElement(
new Note( 'note',
'additional_description', 'additional_description',
array( array(
'value' => t('No Ldap servers found on this domain.' 'value' => t('No Ldap servers found on this domain.'
@ -76,7 +75,6 @@ class LdapDiscoveryForm extends Form
. 'configure the server manually.' . 'configure the server manually.'
) )
) )
)
); );
$this->addElement( $this->addElement(
'text', 'text',

View File

@ -4,14 +4,14 @@
namespace Icinga\Web\Form\Element; namespace Icinga\Web\Form\Element;
use Zend_Form_Element;
use Icinga\Web\Request; use Icinga\Web\Request;
use Icinga\Application\Icinga; use Icinga\Application\Icinga;
use Icinga\Web\Form\FormElement;
/** /**
* A button * A button
*/ */
class Button extends Zend_Form_Element class Button extends FormElement
{ {
/** /**
* Use formButton view helper by default * Use formButton view helper by default

View File

@ -4,12 +4,12 @@
namespace Icinga\Web\Form\Element; namespace Icinga\Web\Form\Element;
use Zend_Form_Element; use Icinga\Web\Form\FormElement;
/** /**
* A note * A note
*/ */
class Note extends Zend_Form_Element class Note extends FormElement
{ {
/** /**
* Form view helper to use for rendering * Form view helper to use for rendering

View File

@ -8,7 +8,6 @@ use LogicException;
use InvalidArgumentException; use InvalidArgumentException;
use Icinga\Web\Session\SessionNamespace; use Icinga\Web\Session\SessionNamespace;
use Icinga\Web\Form\Decorator\ElementDoubler; use Icinga\Web\Form\Decorator\ElementDoubler;
use Icinga\Web\Form\Element\Button;
/** /**
* Container and controller for form based wizards * Container and controller for form based wizards
@ -427,7 +426,7 @@ class Wizard
$index = array_search($page, $pages, true); $index = array_search($page, $pages, true);
if ($index === 0) { if ($index === 0) {
$page->addElement( $page->addElement(
new Button( 'button',
static::BTN_NEXT, static::BTN_NEXT,
array( array(
'type' => 'submit', 'type' => 'submit',
@ -435,11 +434,10 @@ class Wizard
'label' => t('Next'), 'label' => t('Next'),
'decorators' => array('ViewHelper') 'decorators' => array('ViewHelper')
) )
)
); );
} elseif ($index < count($pages) - 1) { } elseif ($index < count($pages) - 1) {
$page->addElement( $page->addElement(
new Button( 'button',
static::BTN_PREV, static::BTN_PREV,
array( array(
'type' => 'submit', 'type' => 'submit',
@ -447,10 +445,9 @@ class Wizard
'label' => t('Back'), 'label' => t('Back'),
'decorators' => array('ViewHelper') 'decorators' => array('ViewHelper')
) )
)
); );
$page->addElement( $page->addElement(
new Button( 'button',
static::BTN_NEXT, static::BTN_NEXT,
array( array(
'type' => 'submit', 'type' => 'submit',
@ -458,11 +455,10 @@ class Wizard
'label' => t('Next'), 'label' => t('Next'),
'decorators' => array('ViewHelper') 'decorators' => array('ViewHelper')
) )
)
); );
} else { } else {
$page->addElement( $page->addElement(
new Button( 'button',
static::BTN_PREV, static::BTN_PREV,
array( array(
'type' => 'submit', 'type' => 'submit',
@ -470,10 +466,9 @@ class Wizard
'label' => t('Back'), 'label' => t('Back'),
'decorators' => array('ViewHelper') 'decorators' => array('ViewHelper')
) )
)
); );
$page->addElement( $page->addElement(
new Button( 'button',
static::BTN_NEXT, static::BTN_NEXT,
array( array(
'type' => 'submit', 'type' => 'submit',
@ -481,7 +476,6 @@ class Wizard
'label' => t('Finish'), 'label' => t('Finish'),
'decorators' => array('ViewHelper') 'decorators' => array('ViewHelper')
) )
)
); );
} }

View File

@ -8,8 +8,6 @@ use DateTime;
use DateInterval; use DateInterval;
use Icinga\Module\Monitoring\Command\Instance\DisableNotificationsExpireCommand; use Icinga\Module\Monitoring\Command\Instance\DisableNotificationsExpireCommand;
use Icinga\Module\Monitoring\Form\Command\CommandForm; 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\Notification;
use Icinga\Web\Request; use Icinga\Web\Request;
@ -34,7 +32,7 @@ class DisableNotificationsExpireCommandForm extends CommandForm
public function createElements(array $formData = array()) public function createElements(array $formData = array())
{ {
$this->addElement( $this->addElement(
new Note( 'note',
'command-info', 'command-info',
array( array(
'value' => mt( 'value' => mt(
@ -42,12 +40,11 @@ class DisableNotificationsExpireCommandForm extends CommandForm
'This command is used to disable host and service notifications for a specific time.' 'This command is used to disable host and service notifications for a specific time.'
) )
) )
)
); );
$expireTime = new DateTime(); $expireTime = new DateTime();
$expireTime->add(new DateInterval('PT1H')); $expireTime->add(new DateInterval('PT1H'));
$this->addElement( $this->addElement(
new DateTimePicker( 'dateTimePicker',
'expire_time', 'expire_time',
array( array(
'required' => true, 'required' => true,
@ -55,7 +52,6 @@ class DisableNotificationsExpireCommandForm extends CommandForm
'description' => mt('monitoring', 'Set the expire time.'), 'description' => mt('monitoring', 'Set the expire time.'),
'value' => $expireTime 'value' => $expireTime
) )
)
); );
return $this; return $this;
} }

View File

@ -7,8 +7,6 @@ namespace Icinga\Module\Monitoring\Form\Command\Object;
use DateTime; use DateTime;
use DateInterval; use DateInterval;
use Icinga\Module\Monitoring\Command\Object\AcknowledgeProblemCommand; 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\Notification;
use Icinga\Web\Request; use Icinga\Web\Request;
@ -35,7 +33,8 @@ class AcknowledgeProblemCommandForm extends ObjectsCommandForm
public function createElements(array $formData = array()) public function createElements(array $formData = array())
{ {
$this->addElements(array( $this->addElements(array(
new Note( array(
'note',
'command-info', 'command-info',
array( array(
'value' => mt( 'value' => mt(
@ -86,7 +85,7 @@ class AcknowledgeProblemCommandForm extends ObjectsCommandForm
$expireTime = new DateTime(); $expireTime = new DateTime();
$expireTime->add(new DateInterval('PT1H')); $expireTime->add(new DateInterval('PT1H'));
$this->addElement( $this->addElement(
new DateTimePicker( 'dateTimePicker',
'expire_time', 'expire_time',
array( array(
'label' => mt('monitoring', 'Expire Time'), 'label' => mt('monitoring', 'Expire Time'),
@ -97,7 +96,6 @@ class AcknowledgeProblemCommandForm extends ObjectsCommandForm
. ' acknowledgement after this time expired.' . ' acknowledgement after this time expired.'
) )
) )
)
); );
$this->addDisplayGroup( $this->addDisplayGroup(
array('expire', 'expire_time'), array('expire', 'expire_time'),

View File

@ -5,7 +5,6 @@
namespace Icinga\Module\Monitoring\Form\Command\Object; namespace Icinga\Module\Monitoring\Form\Command\Object;
use Icinga\Module\Monitoring\Command\Object\AddCommentCommand; use Icinga\Module\Monitoring\Command\Object\AddCommentCommand;
use Icinga\Web\Form\Element\Note;
use Icinga\Web\Notification; use Icinga\Web\Notification;
use Icinga\Web\Request; use Icinga\Web\Request;
@ -32,7 +31,8 @@ class AddCommentCommandForm extends ObjectsCommandForm
public function createElements(array $formData = array()) public function createElements(array $formData = array())
{ {
$this->addElements(array( $this->addElements(array(
new Note( array(
'note',
'command-info', 'command-info',
array( array(
'value' => mt( 'value' => mt(

View File

@ -6,8 +6,6 @@ namespace Icinga\Module\Monitoring\Form\Command\Object;
use Icinga\Module\Monitoring\Command\Object\ScheduleHostCheckCommand; use Icinga\Module\Monitoring\Command\Object\ScheduleHostCheckCommand;
use Icinga\Module\Monitoring\Command\Object\ScheduleServiceCheckCommand; 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\Notification;
use Icinga\Web\Request; use Icinga\Web\Request;
@ -34,7 +32,7 @@ class CheckNowCommandForm extends ObjectsCommandForm
$iconUrl = $this->getView()->href('img/icons/refresh_petrol.png'); $iconUrl = $this->getView()->href('img/icons/refresh_petrol.png');
$this->addElements(array( $this->addElements(array(
new Button( 'button',
'btn_submit', 'btn_submit',
array( array(
'ignore' => true, 'ignore' => true,
@ -45,7 +43,6 @@ class CheckNowCommandForm extends ObjectsCommandForm
'escape' => false, 'escape' => false,
'class' => 'link-like' 'class' => 'link-like'
) )
)
)); ));
return $this; return $this;
} }

View File

@ -7,8 +7,6 @@ namespace Icinga\Module\Monitoring\Form\Command\Object;
use DateTime; use DateTime;
use DateInterval; use DateInterval;
use Icinga\Module\Monitoring\Command\Object\ScheduleServiceCheckCommand; 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\Notification;
use Icinga\Web\Request; use Icinga\Web\Request;
@ -37,7 +35,8 @@ class ScheduleServiceCheckCommandForm extends ObjectsCommandForm
$checkTime = new DateTime(); $checkTime = new DateTime();
$checkTime->add(new DateInterval('PT1H')); $checkTime->add(new DateInterval('PT1H'));
$this->addElements(array( $this->addElements(array(
new Note( array(
'note',
'command-info', 'command-info',
array( array(
'value' => mt( 'value' => mt(
@ -47,7 +46,8 @@ class ScheduleServiceCheckCommandForm extends ObjectsCommandForm
) )
) )
), ),
new DateTimePicker( array(
'dateTimePicker',
'check_time', 'check_time',
array( array(
'required' => true, 'required' => true,

View File

@ -7,9 +7,6 @@ namespace Icinga\Module\Monitoring\Form\Command\Object;
use DateTime; use DateTime;
use DateInterval; use DateInterval;
use Icinga\Module\Monitoring\Command\Object\ScheduleServiceDowntimeCommand; 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\Notification;
use Icinga\Web\Request; use Icinga\Web\Request;
@ -49,7 +46,8 @@ class ScheduleServiceDowntimeCommandForm extends ObjectsCommandForm
$end = clone $start; $end = clone $start;
$end->add(new DateInterval('PT1H')); $end->add(new DateInterval('PT1H'));
$this->addElements(array( $this->addElements(array(
new Note( array(
'note',
'command-info', 'command-info',
array( array(
'value' => mt( 'value' => mt(
@ -76,7 +74,8 @@ class ScheduleServiceDowntimeCommandForm extends ObjectsCommandForm
) )
) )
), ),
new DateTimePicker( array(
'dateTimePicker',
'start', 'start',
array( array(
'required' => true, 'required' => true,
@ -85,7 +84,8 @@ class ScheduleServiceDowntimeCommandForm extends ObjectsCommandForm
'value' => $start 'value' => $start
) )
), ),
new DateTimePicker( array(
'dateTimePicker',
'end', 'end',
array( array(
'required' => true, 'required' => true,
@ -134,7 +134,8 @@ class ScheduleServiceDowntimeCommandForm extends ObjectsCommandForm
); );
if (isset($formData['type']) && $formData['type'] === self::FLEXIBLE) { if (isset($formData['type']) && $formData['type'] === self::FLEXIBLE) {
$this->addElements(array( $this->addElements(array(
new Number( array(
'number',
'hours', 'hours',
array( array(
'required' => true, 'required' => true,
@ -143,7 +144,8 @@ class ScheduleServiceDowntimeCommandForm extends ObjectsCommandForm
'min' => -1 'min' => -1
) )
), ),
new Number( array(
'number',
'minutes', 'minutes',
array( array(
'required' => true, 'required' => true,

View File

@ -5,7 +5,6 @@
namespace Icinga\Module\Monitoring\Form\Config\Instance; namespace Icinga\Module\Monitoring\Form\Config\Instance;
use Icinga\Web\Form; use Icinga\Web\Form;
use Icinga\Web\Form\Element\Number;
class RemoteInstanceForm extends Form class RemoteInstanceForm extends Form
{ {
@ -36,10 +35,11 @@ class RemoteInstanceForm extends Form
) )
) )
), ),
new Number( array(
'number',
'port',
array( array(
'required' => true, 'required' => true,
'name' => 'port',
'label' => mt('monitoring', 'Port'), 'label' => mt('monitoring', 'Port'),
'description' => mt('monitoring', 'SSH port to connect to on the remote Icinga instance'), 'description' => mt('monitoring', 'SSH port to connect to on the remote Icinga instance'),
'value' => 22 'value' => 22

View File

@ -5,7 +5,6 @@
namespace Icinga\Module\Monitoring\Form\Setup; namespace Icinga\Module\Monitoring\Form\Setup;
use Icinga\Web\Form; use Icinga\Web\Form;
use Icinga\Web\Form\Element\Note;
use Icinga\Application\Platform; use Icinga\Application\Platform;
class BackendPage extends Form class BackendPage extends Form
@ -18,7 +17,7 @@ class BackendPage extends Form
public function createElements(array $formData) public function createElements(array $formData)
{ {
$this->addElement( $this->addElement(
new Note( 'note',
'title', 'title',
array( array(
'value' => mt('monitoring', 'Monitoring Backend', 'setup.page.title'), 'value' => mt('monitoring', 'Monitoring Backend', 'setup.page.title'),
@ -27,10 +26,9 @@ class BackendPage extends Form
array('HtmlTag', array('tag' => 'h2')) array('HtmlTag', array('tag' => 'h2'))
) )
) )
)
); );
$this->addElement( $this->addElement(
new Note( 'note',
'description', 'description',
array( array(
'value' => mt( 'value' => mt(
@ -38,7 +36,6 @@ class BackendPage extends Form
'Please configure below how Icinga Web 2 should retrieve monitoring information.' 'Please configure below how Icinga Web 2 should retrieve monitoring information.'
) )
) )
)
); );
$this->addElement( $this->addElement(

View File

@ -5,7 +5,6 @@
namespace Icinga\Module\Monitoring\Form\Setup; namespace Icinga\Module\Monitoring\Form\Setup;
use Icinga\Web\Form; use Icinga\Web\Form;
use Icinga\Web\Form\Element\Note;
use Icinga\Form\Config\Resource\DbResourceForm; use Icinga\Form\Config\Resource\DbResourceForm;
class IdoResourcePage extends Form class IdoResourcePage extends Form
@ -26,7 +25,7 @@ class IdoResourcePage extends Form
) )
); );
$this->addElement( $this->addElement(
new Note( 'note',
'title', 'title',
array( array(
'value' => mt('monitoring', 'Monitoring IDO Resource', 'setup.page.title'), 'value' => mt('monitoring', 'Monitoring IDO Resource', 'setup.page.title'),
@ -35,10 +34,9 @@ class IdoResourcePage extends Form
array('HtmlTag', array('tag' => 'h2')) array('HtmlTag', array('tag' => 'h2'))
) )
) )
)
); );
$this->addElement( $this->addElement(
new Note( 'note',
'description', 'description',
array( array(
'value' => mt( 'value' => mt(
@ -47,7 +45,6 @@ class IdoResourcePage extends Form
. ' the IDO database of your monitoring environment.' . ' the IDO database of your monitoring environment.'
) )
) )
)
); );
if (isset($formData['skip_validation']) && $formData['skip_validation']) { if (isset($formData['skip_validation']) && $formData['skip_validation']) {

View File

@ -5,7 +5,6 @@
namespace Icinga\Module\Monitoring\Form\Setup; namespace Icinga\Module\Monitoring\Form\Setup;
use Icinga\Web\Form; use Icinga\Web\Form;
use Icinga\Web\Form\Element\Note;
use Icinga\Module\Monitoring\Form\Config\InstanceConfigForm; use Icinga\Module\Monitoring\Form\Config\InstanceConfigForm;
class InstancePage extends Form class InstancePage extends Form
@ -18,7 +17,7 @@ class InstancePage extends Form
public function createElements(array $formData) public function createElements(array $formData)
{ {
$this->addElement( $this->addElement(
new Note( 'note',
'title', 'title',
array( array(
'value' => mt('monitoring', 'Monitoring Instance', 'setup.page.title'), 'value' => mt('monitoring', 'Monitoring Instance', 'setup.page.title'),
@ -27,10 +26,9 @@ class InstancePage extends Form
array('HtmlTag', array('tag' => 'h2')) array('HtmlTag', array('tag' => 'h2'))
) )
) )
)
); );
$this->addElement( $this->addElement(
new Note( 'note',
'description', 'description',
array( array(
'value' => mt( 'value' => mt(
@ -38,7 +36,6 @@ class InstancePage extends Form
'Please define the settings specific to your monitoring instance below.' 'Please define the settings specific to your monitoring instance below.'
) )
) )
)
); );
if (isset($formData['host'])) { if (isset($formData['host'])) {

View File

@ -5,7 +5,6 @@
namespace Icinga\Module\Monitoring\Form\Setup; namespace Icinga\Module\Monitoring\Form\Setup;
use Icinga\Web\Form; use Icinga\Web\Form;
use Icinga\Web\Form\Element\Note;
use Icinga\Form\Config\Resource\LivestatusResourceForm; use Icinga\Form\Config\Resource\LivestatusResourceForm;
class LivestatusResourcePage extends Form class LivestatusResourcePage extends Form
@ -26,7 +25,7 @@ class LivestatusResourcePage extends Form
) )
); );
$this->addElement( $this->addElement(
new Note( 'note',
'title', 'title',
array( array(
'value' => mt('monitoring', 'Monitoring Livestatus Resource', 'setup.page.title'), 'value' => mt('monitoring', 'Monitoring Livestatus Resource', 'setup.page.title'),
@ -35,10 +34,9 @@ class LivestatusResourcePage extends Form
array('HtmlTag', array('tag' => 'h2')) array('HtmlTag', array('tag' => 'h2'))
) )
) )
)
); );
$this->addElement( $this->addElement(
new Note( 'note',
'description', 'description',
array( array(
'value' => mt( 'value' => mt(
@ -47,7 +45,6 @@ class LivestatusResourcePage extends Form
. ' socket interface for your monitoring environment.' . ' socket interface for your monitoring environment.'
) )
) )
)
); );
if (isset($formData['skip_validation']) && $formData['skip_validation']) { if (isset($formData['skip_validation']) && $formData['skip_validation']) {

View File

@ -5,7 +5,6 @@
namespace Icinga\Module\Monitoring\Form\Setup; namespace Icinga\Module\Monitoring\Form\Setup;
use Icinga\Web\Form; use Icinga\Web\Form;
use Icinga\Web\Form\Element\Note;
use Icinga\Module\Monitoring\Form\Config\SecurityConfigForm; use Icinga\Module\Monitoring\Form\Config\SecurityConfigForm;
class SecurityPage extends Form class SecurityPage extends Form
@ -18,7 +17,7 @@ class SecurityPage extends Form
public function createElements(array $formData) public function createElements(array $formData)
{ {
$this->addElement( $this->addElement(
new Note( 'note',
'title', 'title',
array( array(
'value' => mt('monitoring', 'Monitoring Security', 'setup.page.title'), 'value' => mt('monitoring', 'Monitoring Security', 'setup.page.title'),
@ -27,10 +26,9 @@ class SecurityPage extends Form
array('HtmlTag', array('tag' => 'h2')) array('HtmlTag', array('tag' => 'h2'))
) )
) )
)
); );
$this->addElement( $this->addElement(
new Note( 'note',
'description', 'description',
array( array(
'value' => mt( 'value' => mt(
@ -38,7 +36,6 @@ class SecurityPage extends Form
'To protect your monitoring environment against prying eyes please fill out the settings below.' 'To protect your monitoring environment against prying eyes please fill out the settings below.'
) )
) )
)
); );
$securityConfigForm = new SecurityConfigForm(); $securityConfigForm = new SecurityConfigForm();

View File

@ -5,7 +5,6 @@
namespace Icinga\Module\Monitoring\Form\Setup; namespace Icinga\Module\Monitoring\Form\Setup;
use Icinga\Web\Form; use Icinga\Web\Form;
use Icinga\Web\Form\Element\Note;
class WelcomePage extends Form class WelcomePage extends Form
{ {
@ -17,7 +16,7 @@ class WelcomePage extends Form
public function createElements(array $formData) public function createElements(array $formData)
{ {
$this->addElement( $this->addElement(
new Note( 'note',
'welcome', 'welcome',
array( array(
'value' => mt( 'value' => mt(
@ -29,20 +28,18 @@ class WelcomePage extends Form
array('HtmlTag', array('tag' => 'h2')) array('HtmlTag', array('tag' => 'h2'))
) )
) )
)
); );
$this->addElement( $this->addElement(
new Note( 'note',
'core_hint', 'core_hint',
array( array(
'value' => mt('monitoring', 'This is the core module for Icinga Web 2.') 'value' => mt('monitoring', 'This is the core module for Icinga Web 2.')
) )
)
); );
$this->addElement( $this->addElement(
new Note( 'note',
'description', 'description',
array( array(
'value' => mt( 'value' => mt(
@ -51,7 +48,6 @@ class WelcomePage extends Form
. ' you to keep track of the most important events in your monitoring environment.' . ' you to keep track of the most important events in your monitoring environment.'
) )
) )
)
); );
$this->addDisplayGroup( $this->addDisplayGroup(

View File

@ -9,7 +9,6 @@ use LogicException;
use Icinga\Application\Config; use Icinga\Application\Config;
use Icinga\Web\Form; use Icinga\Web\Form;
use Icinga\Data\ResourceFactory; use Icinga\Data\ResourceFactory;
use Icinga\Web\Form\Element\Note;
use Icinga\Authentication\Backend\DbUserBackend; use Icinga\Authentication\Backend\DbUserBackend;
use Icinga\Authentication\Backend\LdapUserBackend; use Icinga\Authentication\Backend\LdapUserBackend;
@ -177,7 +176,7 @@ class AdminAccountPage extends Form
} }
$this->addElement( $this->addElement(
new Note( 'note',
'title', 'title',
array( array(
'value' => mt('setup', 'Administration', 'setup.page.title'), 'value' => mt('setup', 'Administration', 'setup.page.title'),
@ -186,10 +185,9 @@ class AdminAccountPage extends Form
array('HtmlTag', array('tag' => 'h2')) array('HtmlTag', array('tag' => 'h2'))
) )
) )
)
); );
$this->addElement( $this->addElement(
new Note( 'note',
'description', 'description',
array( array(
'value' => tp( 'value' => tp(
@ -200,7 +198,6 @@ class AdminAccountPage extends Form
count($choices) count($choices)
) )
) )
)
); );
} }

View File

@ -6,7 +6,6 @@ namespace Icinga\Module\Setup\Form;
use Icinga\Application\Config; use Icinga\Application\Config;
use Icinga\Web\Form; use Icinga\Web\Form;
use Icinga\Web\Form\Element\Note;
use Icinga\Form\Config\Authentication\DbBackendForm; use Icinga\Form\Config\Authentication\DbBackendForm;
use Icinga\Form\Config\Authentication\LdapBackendForm; use Icinga\Form\Config\Authentication\LdapBackendForm;
use Icinga\Form\Config\Authentication\AutologinBackendForm; use Icinga\Form\Config\Authentication\AutologinBackendForm;
@ -60,7 +59,7 @@ class AuthBackendPage extends Form
public function createElements(array $formData) public function createElements(array $formData)
{ {
$this->addElement( $this->addElement(
new Note( 'note',
'title', 'title',
array( array(
'value' => mt('setup', 'Authentication Backend', 'setup.page.title'), 'value' => mt('setup', 'Authentication Backend', 'setup.page.title'),
@ -69,7 +68,6 @@ class AuthBackendPage extends Form
array('HtmlTag', array('tag' => 'h2')) array('HtmlTag', array('tag' => 'h2'))
) )
) )
)
); );
if ($this->config['type'] === 'db') { if ($this->config['type'] === 'db') {
@ -93,10 +91,9 @@ class AuthBackendPage extends Form
} }
$this->addElement( $this->addElement(
new Note( 'note',
'description', 'description',
array('value' => $note) array('value' => $note)
)
); );
if (isset($formData['skip_validation']) && $formData['skip_validation']) { if (isset($formData['skip_validation']) && $formData['skip_validation']) {

View File

@ -6,7 +6,6 @@ namespace Icinga\Module\Setup\Form;
use Icinga\Web\Form; use Icinga\Web\Form;
use Icinga\Application\Platform; use Icinga\Application\Platform;
use Icinga\Web\Form\Element\Note;
/** /**
* Wizard page to choose an authentication backend * Wizard page to choose an authentication backend
@ -27,7 +26,7 @@ class AuthenticationPage extends Form
public function createElements(array $formData) public function createElements(array $formData)
{ {
$this->addElement( $this->addElement(
new Note( 'note',
'title', 'title',
array( array(
'value' => mt('setup', 'Authentication', 'setup.page.title'), 'value' => mt('setup', 'Authentication', 'setup.page.title'),
@ -36,10 +35,9 @@ class AuthenticationPage extends Form
array('HtmlTag', array('tag' => 'h2')) array('HtmlTag', array('tag' => 'h2'))
) )
) )
)
); );
$this->addElement( $this->addElement(
new Note( 'note',
'description', 'description',
array( array(
'value' => mt( 'value' => mt(
@ -48,7 +46,6 @@ class AuthenticationPage extends Form
. ' Configuring backend specific details follows in a later step.' . ' Configuring backend specific details follows in a later step.'
) )
) )
)
); );
$backendTypes = array(); $backendTypes = array();

View File

@ -6,7 +6,6 @@ namespace Icinga\Module\Setup\Form;
use PDOException; use PDOException;
use Icinga\Web\Form; use Icinga\Web\Form;
use Icinga\Web\Form\Element\Note;
use Icinga\Module\Setup\Utils\DbTool; use Icinga\Module\Setup\Utils\DbTool;
/** /**
@ -88,7 +87,7 @@ class DatabaseCreationPage extends Form
public function createElements(array $formData) public function createElements(array $formData)
{ {
$this->addElement( $this->addElement(
new Note( 'note',
'title', 'title',
array( array(
'value' => mt('setup', 'Database Setup', 'setup.page.title'), 'value' => mt('setup', 'Database Setup', 'setup.page.title'),
@ -97,10 +96,9 @@ class DatabaseCreationPage extends Form
array('HtmlTag', array('tag' => 'h2')) array('HtmlTag', array('tag' => 'h2'))
) )
) )
)
); );
$this->addElement( $this->addElement(
new Note( 'note',
'description', 'description',
array( array(
'value' => mt( 'value' => mt(
@ -110,7 +108,6 @@ class DatabaseCreationPage extends Form
. 'be operated by Icinga Web 2. Please provide appropriate access credentials to solve this.' . 'be operated by Icinga Web 2. Please provide appropriate access credentials to solve this.'
) )
) )
)
); );
$skipValidation = isset($formData['skip_validation']) && $formData['skip_validation']; $skipValidation = isset($formData['skip_validation']) && $formData['skip_validation'];

View File

@ -6,7 +6,6 @@ namespace Icinga\Module\Setup\Form;
use PDOException; use PDOException;
use Icinga\Web\Form; use Icinga\Web\Form;
use Icinga\Web\Form\Element\Note;
use Icinga\Form\Config\Resource\DbResourceForm; use Icinga\Form\Config\Resource\DbResourceForm;
use Icinga\Module\Setup\Utils\DbTool; use Icinga\Module\Setup\Utils\DbTool;
@ -37,7 +36,7 @@ class DbResourcePage extends Form
) )
); );
$this->addElement( $this->addElement(
new Note( 'note',
'title', 'title',
array( array(
'value' => mt('setup', 'Database Resource', 'setup.page.title'), 'value' => mt('setup', 'Database Resource', 'setup.page.title'),
@ -46,10 +45,9 @@ class DbResourcePage extends Form
array('HtmlTag', array('tag' => 'h2')) array('HtmlTag', array('tag' => 'h2'))
) )
) )
)
); );
$this->addElement( $this->addElement(
new Note( 'note',
'description', 'description',
array( array(
'value' => mt( '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.' . ' 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']) { if (isset($formData['skip_validation']) && $formData['skip_validation']) {

View File

@ -5,7 +5,6 @@
namespace Icinga\Module\Setup\Form; namespace Icinga\Module\Setup\Form;
use Icinga\Web\Form; use Icinga\Web\Form;
use Icinga\Web\Form\Element\Note;
use Icinga\Form\Config\General\LoggingConfigForm; use Icinga\Form\Config\General\LoggingConfigForm;
/** /**
@ -27,7 +26,7 @@ class GeneralConfigPage extends Form
public function createElements(array $formData) public function createElements(array $formData)
{ {
$this->addElement( $this->addElement(
new Note( 'note',
'title', 'title',
array( array(
'value' => mt('setup', 'Application Configuration', 'setup.page.title'), 'value' => mt('setup', 'Application Configuration', 'setup.page.title'),
@ -36,10 +35,9 @@ class GeneralConfigPage extends Form
array('HtmlTag', array('tag' => 'h2')) array('HtmlTag', array('tag' => 'h2'))
) )
) )
)
); );
$this->addElement( $this->addElement(
new Note( 'note',
'description', 'description',
array( array(
'value' => mt( 'value' => mt(
@ -47,7 +45,6 @@ class GeneralConfigPage extends Form
'Now please adjust all application and logging related configuration options to fit your needs.' 'Now please adjust all application and logging related configuration options to fit your needs.'
) )
) )
)
); );
$loggingForm = new LoggingConfigForm(); $loggingForm = new LoggingConfigForm();

View File

@ -6,7 +6,6 @@ namespace Icinga\Module\Setup\Form;
use Icinga\Application\Config; use Icinga\Application\Config;
use Icinga\Web\Form; use Icinga\Web\Form;
use Icinga\Web\Form\Element\Note;
/** /**
* Wizard page to define the connection details for a LDAP resource * 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); $html = str_replace('{user_class}', $backend['user_class'], $html);
$this->addElement( $this->addElement(
new Note( 'note',
'title', 'title',
array( array(
'value' => mt('setup', 'LDAP Discovery Results', 'setup.page.title'), 'value' => mt('setup', 'LDAP Discovery Results', 'setup.page.title'),
@ -89,10 +88,9 @@ EOT;
array('HtmlTag', array('tag' => 'h2')) array('HtmlTag', array('tag' => 'h2'))
) )
) )
)
); );
$this->addElement( $this->addElement(
new Note( 'note',
'description', 'description',
array( array(
'value' => sprintf( 'value' => sprintf(
@ -100,11 +98,10 @@ EOT;
$this->config['domain'] $this->config['domain']
) )
) )
)
); );
$this->addElement( $this->addElement(
new Note( 'note',
'suggestion', 'suggestion',
array( array(
'value' => $html, 'value' => $html,
@ -115,7 +112,6 @@ EOT;
) )
) )
) )
)
); );
$this->addElement( $this->addElement(

View File

@ -5,7 +5,6 @@
namespace Icinga\Module\Setup\Form; namespace Icinga\Module\Setup\Form;
use Icinga\Web\Form; use Icinga\Web\Form;
use Icinga\Web\Form\Element\Note;
use Icinga\Form\LdapDiscoveryForm; use Icinga\Form\LdapDiscoveryForm;
/** /**
@ -32,7 +31,7 @@ class LdapDiscoveryPage extends Form
public function createElements(array $formData) public function createElements(array $formData)
{ {
$this->addElement( $this->addElement(
new Note( 'note',
'title', 'title',
array( array(
'value' => mt('setup', 'LDAP Discovery', 'setup.page.title'), 'value' => mt('setup', 'LDAP Discovery', 'setup.page.title'),
@ -41,10 +40,9 @@ class LdapDiscoveryPage extends Form
array('HtmlTag', array('tag' => 'h2')) array('HtmlTag', array('tag' => 'h2'))
) )
) )
)
); );
$this->addElement( $this->addElement(
new Note( 'note',
'description', 'description',
array( array(
'value' => mt( 'value' => mt(
@ -53,7 +51,6 @@ class LdapDiscoveryPage extends Form
' for authentication. If you don\' want to execute a discovery, just skip this step.' ' for authentication. If you don\' want to execute a discovery, just skip this step.'
) )
) )
)
); );
$this->discoveryForm = new LdapDiscoveryForm(); $this->discoveryForm = new LdapDiscoveryForm();

View File

@ -5,7 +5,6 @@
namespace Icinga\Module\Setup\Form; namespace Icinga\Module\Setup\Form;
use Icinga\Web\Form; use Icinga\Web\Form;
use Icinga\Web\Form\Element\Note;
use Icinga\Form\Config\Resource\LdapResourceForm; use Icinga\Form\Config\Resource\LdapResourceForm;
/** /**
@ -35,7 +34,7 @@ class LdapResourcePage extends Form
) )
); );
$this->addElement( $this->addElement(
new Note( 'note',
'title', 'title',
array( array(
'value' => mt('setup', 'LDAP Resource', 'setup.page.title'), 'value' => mt('setup', 'LDAP Resource', 'setup.page.title'),
@ -44,10 +43,9 @@ class LdapResourcePage extends Form
array('HtmlTag', array('tag' => 'h2')) array('HtmlTag', array('tag' => 'h2'))
) )
) )
)
); );
$this->addElement( $this->addElement(
new Note( 'note',
'description', 'description',
array( array(
'value' => mt( 'value' => mt(
@ -56,7 +54,6 @@ class LdapResourcePage extends Form
. 'be used to authenticate users logging in to Icinga Web 2.' . 'be used to authenticate users logging in to Icinga Web 2.'
) )
) )
)
); );
if (isset($formData['skip_validation']) && $formData['skip_validation']) { if (isset($formData['skip_validation']) && $formData['skip_validation']) {

View File

@ -6,7 +6,6 @@ namespace Icinga\Module\Setup\Form;
use Icinga\Web\Form; use Icinga\Web\Form;
use Icinga\Application\Platform; use Icinga\Application\Platform;
use Icinga\Web\Form\Element\Note;
/** /**
* Wizard page to choose a preference backend * Wizard page to choose a preference backend
@ -45,7 +44,7 @@ class PreferencesPage extends Form
public function createElements(array $formData) public function createElements(array $formData)
{ {
$this->addElement( $this->addElement(
new Note( 'note',
'title', 'title',
array( array(
'value' => mt('setup', 'Preferences', 'setup.page.title'), 'value' => mt('setup', 'Preferences', 'setup.page.title'),
@ -54,15 +53,13 @@ class PreferencesPage extends Form
array('HtmlTag', array('tag' => 'h2')) array('HtmlTag', array('tag' => 'h2'))
) )
) )
)
); );
$this->addElement( $this->addElement(
new Note( 'note',
'description', 'description',
array( array(
'value' => mt('setup', 'Please choose how Icinga Web 2 should store user preferences.') 'value' => mt('setup', 'Please choose how Icinga Web 2 should store user preferences.')
) )
)
); );
$storageTypes = array(); $storageTypes = array();