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; protected $config;
/** /**
* Create this form * @see Form::createElements()
*
* @see Icinga\Web\Form::create
*/ */
public function create() public function createElements(array $formData)
{ {
$this->addElement( return array(
'text', $this->createElement(
'protected_customvars', 'text',
array( 'protected_customvars',
'label' => 'Protected Custom Variables', array(
'required' => true, 'label' => 'Protected Custom Variables',
'value' => $this->config->protected_customvars, 'required' => true,
'helptext' => 'Comma separated case insensitive list of protected custom variables.' 'value' => $this->config->protected_customvars,
. ' Use * as a placeholder for zero or more wildcard characters.' 'helptext' => 'Comma separated case insensitive list of protected custom variables.'
. ' Existance of those custom variables will be shown, but their values will be masked.' . ' 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;
} }
/** /**