';\r
foreach ($this->forms as $formname => $form) {\r
if ($tab !== 'form') {\r
- echo $this->generateV3Field(['name' => 'section_' . $formname, 'type' => 'FormSection', 'label' => '§!§'.$form['label'].'!§!']);\r
+ echo $this->generateV3Field(['name' => 'section_' . $formname, 'type' => 'FormSection', 'label' => '§!§' . $form['label'] . '!§!']);\r
$_tab = $tab;\r
} else {\r
$_tab = $form['label'];\r
$attributes['tab'] = '§!§' . $tab . '!§!';\r
}\r
$res = " ";\r
- $res .= '$this->addField(' . $this->_varexport($attributes, true) . ');';\r
+ $res .= '$this->addField(\'' . addcslashes($attributes['name'], "'") . '\', ' . $attributes['type'] . '::class';\r
+ if(isset($attributes['label']) && $attributes['label']){\r
+ $res.=', ' . $attributes['label'];\r
+ }\r
+ unset($attributes['name']);\r
+ unset($attributes['type']);\r
+ unset($attributes['label']);\r
+ if (count($attributes)) {\r
+ $res .= ', ' . $this->_varexport($attributes, true);\r
+ }\r
+ $res .= ');';\r
$res .= "\n";\r
\r
+\r
$res = str_replace("'§!§", '__(\'', $res);\r
$res = str_replace("!§!'", '\')', $res);\r
\r
+ $res = preg_replace_callback('/§!§(.*)!§!/u', function ($matches) {\r
+ return '__(\'' . addcslashes($matches[1], "'") . '\')';\r
+ }, $res);\r
+\r
return $res;\r
}\r
\r