mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-24 22:34:24 +02:00
Form: Show the form autosubmit warning in the header tag...
...and use a unique id for the progress element. refs #8369
This commit is contained in:
parent
89bc1f13ed
commit
747f6dcf77
@ -669,7 +669,7 @@ class Form extends Zend_Form
|
||||
{
|
||||
$this->useFormAutosubmit = (bool) $state;
|
||||
if ($this->useFormAutosubmit) {
|
||||
$this->setAttrib('data-progress-element', 'form-header');
|
||||
$this->setAttrib('data-progress-element', 'header-' . $this->getId());
|
||||
} else {
|
||||
$this->removeAttrib('data-progress-element');
|
||||
}
|
||||
@ -1206,13 +1206,16 @@ class Form extends Zend_Form
|
||||
'form' => $this
|
||||
));
|
||||
} else {
|
||||
$this->addDecorator('Description', array('tag' => 'h1'));
|
||||
if ($this->getUseFormAutosubmit()) {
|
||||
$this->addDecorator('Autosubmit', array('accessible' => true))
|
||||
->addDecorator('HtmlTag', array('tag' => 'div', 'class' => 'header', 'id' => 'form-header'));
|
||||
}
|
||||
|
||||
$this->addDecorator('FormDescriptions')
|
||||
$this->addDecorator('Description', array('tag' => 'h1', 'escape' => !$this->getUseFormAutosubmit()))
|
||||
->addDecorator(
|
||||
'HtmlTag',
|
||||
array(
|
||||
'tag' => 'div',
|
||||
'class' => 'header',
|
||||
'id' => 'header-' . $this->getId()
|
||||
)
|
||||
)
|
||||
->addDecorator('FormDescriptions')
|
||||
->addDecorator('FormNotifications')
|
||||
->addDecorator('FormErrors', array('onlyCustomFormErrors' => true))
|
||||
->addDecorator('FormElements')
|
||||
@ -1256,6 +1259,25 @@ class Form extends Zend_Form
|
||||
return $name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve form description
|
||||
*
|
||||
* This will return the escaped description with the autosubmit warning icon if form autosubmit is enabled.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDescription()
|
||||
{
|
||||
$description = parent::getDescription();
|
||||
if ($description && $this->getUseFormAutosubmit()) {
|
||||
$autosubmit = $this->_getDecorator('Autosubmit', array('accessible' => true));
|
||||
$autosubmit->setElement($this);
|
||||
$description = $autosubmit->render($this->getView()->escape($description));
|
||||
}
|
||||
|
||||
return $description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the action to submit this form against
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user