FormExtensibleSet: fix add button

This commit is contained in:
Thomas Gelf 2016-03-09 09:45:06 +01:00
parent fda920d3ad
commit 6105ae4386
2 changed files with 8 additions and 2 deletions

View File

@ -138,7 +138,9 @@ class Zend_View_Helper_FormExtensibleSet extends Zend_View_Helper_FormElement
. $disabled . $disabled
. $this->_htmlAttribs($attribs) . $this->_htmlAttribs($attribs)
. $this->getClosingBracket() . $this->getClosingBracket()
. '<span class="inline-buttons">'
. $this->renderAddButton($name, $disabled) . $this->renderAddButton($name, $disabled)
. '</span>'
. '</li>'; . '</li>';
} }
@ -207,9 +209,9 @@ class Zend_View_Helper_FormExtensibleSet extends Zend_View_Helper_FormElement
$v = $this->view; $v = $this->view;
return '<input type="submit" class="related-action action-add"' return '<input type="submit" class="related-action action-add"'
. ' name="' . $name . '_ADD"' . ' name="' . $name . '___ADD"'
. ' value="&#xe805;"' . ' value="&#xe805;"'
. ' title="' . $v->translate('Remove this entry') . '"' . ' title="' . $v->translate('Add a new entry') . '"'
. $disabled . $disabled
. ' />'; . ' />';
} }

View File

@ -236,6 +236,10 @@ abstract class DirectorObjectForm extends QuickForm
foreach ($values as $key => $value) { foreach ($values as $key => $value) {
if (substr($key, 0, 4) === 'var_') { if (substr($key, 0, 4) === 'var_') {
if (substr($key, -6) === '___ADD') {
continue;
}
$mykey = substr($key, 4); $mykey = substr($key, 4);
if (property_exists($fields, $mykey) && $fields->$mykey->format === 'json') { if (property_exists($fields, $mykey) && $fields->$mykey->format === 'json') {
$value = json_decode($value); $value = json_decode($value);