SecurityForm: replace create() with createElements() and add addSubmitButton()

refs #5525
This commit is contained in:
Alexander Klimov 2014-08-21 11:48:07 +02:00
parent 11063495b2
commit b81e96574a

View File

@ -15,25 +15,41 @@ class SecurityForm extends Form
protected $config;
/**
* Create this form
*
* @see Icinga\Web\Form::create
* @see Form::createElements()
*/
public function create()
public function createElements(array $formData)
{
$this->addElement(
'text',
'protected_customvars',
array(
'label' => 'Protected Custom Variables',
'required' => true,
'value' => $this->config->protected_customvars,
'helptext' => 'Comma separated case insensitive list of protected custom variables.'
. ' Use * as a placeholder for zero or more wildcard characters.'
. ' Existance of those custom variables will be shown, but their values will be masked.'
return array(
$this->createElement(
'text',
'protected_customvars',
array(
'label' => 'Protected Custom Variables',
'required' => true,
'value' => $this->config->protected_customvars,
'helptext' => 'Comma separated case insensitive list of protected custom variables.'
. ' Use * as a placeholder for zero or more wildcard characters.'
. ' Existance of those custom variables will be shown, but their values will be masked.'
)
)
);
$this->setSubmitLabel('Save');
}
/**
* @see Form::addSubmitButton()
*/
public function addSubmitButton()
{
$this->addElement(
'submit',
'btn_submit',
array(
'ignore' => true,
'label' => t('Save Changes')
)
);
return $this;
}
/**