[icinga-checkins] icinga.org: icingaweb2-module-director/master: QuickForm: postpone default submit button creation

git at icinga.org git at icinga.org
Mon Jan 2 10:16:06 CET 2017


Module: icingaweb2-module-director
Branch: master
Commit: c9929f7b17d5cfe373d32c89477f8e2f6b4abbc9
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=c9929f7b17d5cfe373d32c89477f8e2f6b4abbc9

Author: Thomas Gelf <thomas at gelf.net>
Date:   Mon Jan  2 10:14:30 2017 +0100

QuickForm: postpone default submit button creation

This gives more possibilities to override them at a late stage

---

 library/Director/Web/Form/QuickForm.php |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/library/Director/Web/Form/QuickForm.php b/library/Director/Web/Form/QuickForm.php
index 39c1483..59cfe67 100644
--- a/library/Director/Web/Form/QuickForm.php
+++ b/library/Director/Web/Form/QuickForm.php
@@ -309,7 +309,6 @@ abstract class QuickForm extends QuickBaseForm
         if (! $this->didSetup) {
             $this->beforeSetup();
             $this->setup();
-            $this->addSubmitButtonIfSet();
             $this->onSetup();
             $this->didSetup = true;
         }
@@ -326,6 +325,7 @@ abstract class QuickForm extends QuickBaseForm
         }
 
         $this->prepareElements();
+        $this->addSubmitButtonIfSet();
 
         if ($this->hasBeenSent()) {
             $post = $request->getPost();
@@ -447,8 +447,8 @@ abstract class QuickForm extends QuickBaseForm
         }
 
         $this->request = $request;
-        $this->prepareElements();
         $this->onRequest();
+        $this->prepareElements();
         return $this;
     }
 



More information about the icinga-checkins mailing list