Form: Only add a form header if a description is set

refs #8369
This commit is contained in:
Johannes Meyer 2015-08-21 13:34:17 +02:00
parent 1cb2009dcd
commit fbca28c024
1 changed files with 7 additions and 4 deletions

View File

@ -1206,16 +1206,19 @@ class Form extends Zend_Form
'form' => $this
));
} else {
$this->addDecorator('Description', array('tag' => 'h1', 'escape' => !$this->getUseFormAutosubmit()))
->addDecorator(
if ($this->getDescription() !== null) {
$this->addDecorator('Description', array('tag' => 'h1', 'escape' => !$this->getUseFormAutosubmit()))
->addDecorator(
'HtmlTag',
array(
'tag' => 'div',
'class' => 'header',
'id' => 'header-' . $this->getId()
)
)
->addDecorator('FormDescriptions')
);
}
$this->addDecorator('FormDescriptions')
->addDecorator('FormNotifications')
->addDecorator('FormErrors', array('onlyCustomFormErrors' => true))
->addDecorator('FormElements')