File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed
library/Director/Web/Form Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ public function setup()
5151 $ loader = new IcingaObjectFieldLoader ($ object );
5252 $ loader ->prepareElements ($ this );
5353 $ loader ->addFieldsToForm ($ this );
54+ $ this ->varNameMap = $ loader ->getNameMap ();
5455
5556 if ($ form = $ this ->relatedForm ) {
5657 if ($ form instanceof DirectorObjectForm) {
@@ -237,10 +238,6 @@ protected function makeVariants(ZfElement $element)
237238 $ this ->removeElement ($ key );
238239 $ label = $ element ->getLabel ();
239240
240- if ($ this ->isCustomVar ($ key )) {
241- $ this ->varNameMap [$ key ] = $ label ;
242- }
243-
244241 $ group = $ this ->getDisplayGroupForElement ($ element );
245242 $ description = $ element ->getDescription ();
246243
Original file line number Diff line number Diff line change @@ -60,6 +60,16 @@ public function addFieldsToForm(DirectorObjectForm $form)
6060 return $ this ;
6161 }
6262
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+
6373 public function loadFieldsForMultipleObjects ($ objects )
6474 {
6575 $ fields = array ();
You can’t perform that action at this time.
0 commit comments