File tree 2 files changed +11
-4
lines changed
library/Director/Web/Form
2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ public function setup()
51
51
$ loader = new IcingaObjectFieldLoader ($ object );
52
52
$ loader ->prepareElements ($ this );
53
53
$ loader ->addFieldsToForm ($ this );
54
+ $ this ->varNameMap = $ loader ->getNameMap ();
54
55
55
56
if ($ form = $ this ->relatedForm ) {
56
57
if ($ form instanceof DirectorObjectForm) {
@@ -237,10 +238,6 @@ protected function makeVariants(ZfElement $element)
237
238
$ this ->removeElement ($ key );
238
239
$ label = $ element ->getLabel ();
239
240
240
- if ($ this ->isCustomVar ($ key )) {
241
- $ this ->varNameMap [$ key ] = $ label ;
242
- }
243
-
244
241
$ group = $ this ->getDisplayGroupForElement ($ element );
245
242
$ description = $ element ->getDescription ();
246
243
Original file line number Diff line number Diff line change @@ -60,6 +60,16 @@ public function addFieldsToForm(DirectorObjectForm $form)
60
60
return $ this ;
61
61
}
62
62
63
+ /**
64
+ * Get element names to variable names map (Example: ['elName' => 'varName'])
65
+ *
66
+ * @return array
67
+ */
68
+ public function getNameMap (): array
69
+ {
70
+ return $ this ->nameMap ;
71
+ }
72
+
63
73
public function loadFieldsForMultipleObjects ($ objects )
64
74
{
65
75
$ fields = array ();
You can’t perform that action at this time.
0 commit comments