QuickForm: add buttons to group

TODO: create list of buttons, get rid of hardcoded delete
This commit is contained in:
Thomas Gelf 2015-10-15 23:44:37 +02:00
parent 0adfc66762
commit 51ee2a1fa5
1 changed files with 11 additions and 9 deletions

View File

@ -107,16 +107,18 @@ abstract class QuickForm extends Zend_Form
$this->submitButtonName = $el->getName();
$this->addElement($el);
}
}
// TODO: This is ugly, we need to defer button creation
protected function moveSubmitToBottom()
{
$name = $this->submitButtonName;
if ($name && ($submit = $this->getElement($name))) {
$this->removeElement($name);
$this->addElement($submit);
}
$grp = array(
$this->submitButtonName,
$this->deleteButtonName
);
$this->addDisplayGroup($grp, 'buttons', array(
'decorators' => array(
'FormElements',
'DtDdWrapper',
),
'order' => 1000,
));
}
protected function createIdElement()