From 51ee2a1fa536beeca51bd161f16f2185e4e96c55 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Thu, 15 Oct 2015 23:44:37 +0200 Subject: [PATCH] QuickForm: add buttons to group TODO: create list of buttons, get rid of hardcoded delete --- library/Director/Web/Form/QuickForm.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/library/Director/Web/Form/QuickForm.php b/library/Director/Web/Form/QuickForm.php index b4dc74ff..518c7bf8 100644 --- a/library/Director/Web/Form/QuickForm.php +++ b/library/Director/Web/Form/QuickForm.php @@ -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()