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

View File

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