Fix ugly positioning of help icons

If an element has a description, the description is now added to the element's label as title.
The CSS class has-feedback ensurers that the help icon is rendererd. If everything is working fine,
I'll the remove the super duper Help decorator.
This commit is contained in:
Eric Lippmann 2014-11-20 13:23:21 +01:00
parent 8b9d86e409
commit bb664a87ea
1 changed files with 8 additions and 2 deletions

View File

@ -116,7 +116,6 @@ class Form extends Zend_Form
public static $defaultElementDecorators = array(
array('ViewHelper', array('separator' => '')),
array('Errors', array('separator' => '')),
array('Help'),
array('Label', array('separator' => '')),
array('HtmlTag', array('tag' => 'div', 'class' => 'element'))
);
@ -512,7 +511,14 @@ class Form extends Zend_Form
$el = parent::createElement($type, $name, $options);
if ($el && $el->getAttrib('autosubmit')) {
if (($description = $el->getDescription()) !== null && ($label = $el->getDecorator('label')) !== null) {
$label->setOptions(array(
'title' => $description,
'class' => 'has-feedback'
));
}
if ($el->getAttrib('autosubmit')) {
$noScript = new NoScriptApply(); // Non-JS environments
$decorators = $el->getDecorators();
$pos = array_search('Zend_Form_Decorator_ViewHelper', array_keys($decorators)) + 1;