From edf49d091e77488d60539d28d6f862513c065164 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 24 Jul 2014 08:57:49 +0200 Subject: [PATCH] Rewrite addForceCreationCheckbox and move it downwards We should not instantiate form elements directly without any specific reason. refs #5525 --- .../Config/Authentication/BaseBackendForm.php | 36 +++++++++---------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/application/forms/Config/Authentication/BaseBackendForm.php b/application/forms/Config/Authentication/BaseBackendForm.php index 4670017f0..92f231c8f 100644 --- a/application/forms/Config/Authentication/BaseBackendForm.php +++ b/application/forms/Config/Authentication/BaseBackendForm.php @@ -4,32 +4,13 @@ namespace Icinga\Form\Config\Authentication; -use \Zend_Form_Element_Checkbox; use Icinga\Web\Form; -use Icinga\Web\Form\Decorator\HelpText; /** * Base form for authentication backend forms */ abstract class BaseBackendForm extends Form { - /** - * Add checkbox at the beginning of the form which allows to skip logic connection validation - */ - protected function addForceCreationCheckbox() - { - $checkbox = new Zend_Form_Element_Checkbox( - array( - 'name' => 'backend_force_creation', - 'label' => t('Force Changes'), - 'helptext' => t('Check this box to enforce changes without connectivity validation'), - 'order' => 0 - ) - ); - $checkbox->addDecorator(new HelpText()); - $this->addElement($checkbox); - } - /** * @see Form::addSubmitButton() */ @@ -110,4 +91,21 @@ abstract class BaseBackendForm extends Form $config['name'] = $name; $this->populate($config); } + + /** + * Add a checkbox to be displayed at the beginning of the form + * which allows the user to skip the connection validation + */ + protected function addForceCreationCheckbox() + { + $this->addElement( + 'checkbox', + 'force_creation', + array( + 'order' => 0, + 'label' => t('Force Changes'), + 'helptext' => t('Check this box to enforce changes without connectivity validation') + ) + ); + } }