]> git.andy128k.dev Git - ipf-legacy-orm.git/commitdiff
pass extras to admin form
authorAndrey Kutejko <andy128k@gmail.com>
Sat, 16 Mar 2019 17:24:39 +0000 (18:24 +0100)
committerAndrey Kutejko <andy128k@gmail.com>
Sat, 16 Mar 2019 17:30:28 +0000 (18:30 +0100)
src/adminmodel.php
src/modelform.php

index 491f4cc6d4ceb91b931f55dcb4a3df9f7df8ab68..47c0a2c9ce10aa8b8be23bb9df6c290c1a6b7fe6 100644 (file)
@@ -196,12 +196,10 @@ class IPF_Admin_Model extends IPF_Admin_Component
 
     /* edit */
 
-    protected function _getForm($model, $data)
+    protected function _getForm($model, $data, $extra)
     {
-        $extra = array(
-            'user_fields' => $this->fields(),
-            'inlines' => $this->inlines(),
-        );
+        $extra['user_fields'] = $this->fields();
+        $extra['inlines'] = $this->inlines();
         return new IPF_Admin_ModelForm($data, $model, $this->modelName, $extra);
     }
 
index 939d6ffb511a31a99a854b6558cf16a0fe00f500..01563dffd29f88024e371727d6c6b8a0ac7cc7f3 100644 (file)
@@ -42,7 +42,7 @@ class IPF_Form_Model extends IPF_Form
                     if ($f)
                         $field = array($name, $f);
                 } else {
-                    $field = self::createDBField($name, $table, $col);
+                    $field = self::createDBField($name, $table, $col, $extra);
                 }
 
                 if ($field)