<?php
 namespace Modules\Admin\Config\ImportedOrders\Services\Attributes; class View_Utils_FormAdmin extends \App\Mvc\View_Utils_FormAbstract { public function getForm() { $form = \Engine\Form\General::create(); $fieldset = \Engine\Form\Container\Fieldset::create($this->lang['fieldsets']['main']); $form->addContainer($fieldset); $attributes = $this->values['attributes']; if(!empty($attributes)) { foreach($attributes as $key => $values) { if (!array_key_exists($values['key'], $this->values['notCategorizedPossibleAttributesList'])) { $attributes[$key]['key'] = ''; } } } $this->values['attributes'] = $attributes; $attributesFld = \App\Form\Input\Cloned_KeyValueTextSelector::create($this->lang['labels']['attribute']['general'], "attributes", $this->values['attributes']); $attributesFld->setSelectValues($this->values['possibleAttributesList']); $attributesFld->showDefaultOption(); $elementLabels = [ 'value' => $this->lang['labels']['attribute']['externalCode'], 'key' => '', ]; $attributesFld->setElementLabels($elementLabels); $fieldset->addElement($attributesFld); $form->addElement(new \Engine\Form\Input\Hidden('', 'idSystem', $this->values['idSystem'])); $form->addElement(new \Engine\Form\Input\Hidden('', 'idExternalService', $this->values['idExternalService'])); $form->addElement(new \Engine\Form\Input\Hidden('', $this->submitButtonName, 1)); return $form; } }