Browse code

Add used fieldGroups in correct order to template

Benjamin Roth authored on21/02/2020 12:38:11
Showing1 changed files
... ...
@@ -55,6 +55,7 @@ class ModuleRegistration extends \Contao\ModuleRegistration
55 55
     $this->originalDca = $GLOBALS['TL_DCA']['tl_member'];
56 56
 
57 57
     $arrEditable = [];
58
+    $arrFieldgroups = [];
58 59
     foreach ($this->editable as $key=>$fielddata)
59 60
     {
60 61
       // Split formilicious editable data in single vars
... ...
@@ -65,6 +66,11 @@ class ModuleRegistration extends \Contao\ModuleRegistration
65 66
         continue;
66 67
       }
67 68
 
69
+      if (!\in_array($fieldGroup,$arrFieldgroups))
70
+      {
71
+        $arrFieldgroups[] = $fieldGroup;
72
+      }
73
+
68 74
       $GLOBALS['TL_DCA']['tl_member']['fields'][$field]['eval']['eSM_fl_class'] = $fieldClass;
69 75
       $GLOBALS['TL_DCA']['tl_member']['fields'][$field]['eval']['eSM_fl_width'] = $fieldWidth;
70 76
       $GLOBALS['TL_DCA']['tl_member']['fields'][$field]['eval']['eSM_fl_clear'] = $fieldClr;
... ...
@@ -86,6 +92,8 @@ class ModuleRegistration extends \Contao\ModuleRegistration
86 92
       \Input::setPost('username',\Input::post('email'));
87 93
     }
88 94
 
95
+    $this->Template->fieldGroups = $arrFieldgroups;
96
+
89 97
     parent::compile();
90 98
 
91 99
   }