<?php
 namespace Modules\Partners\Trusts; class View_Utils_FormAdmin extends \App\Mvc\View_Utils_FormAbstract { public function getForm() { $cfg = \Entity\Trust::loadCFG(); $form = \Engine\Form\General::create(); $form->setStyle('width', '300'); $form->addContainer(\Engine\Form\Container\Fieldset::create()); $fld = new \Engine\Form\Input\Text($this->lang['formFields']['name'], 'name', $this->values['name']); $fld->importFromConfig($cfg['name']); $form->addElement($fld); $fld = new \Engine\Form\Input\Radio($this->lang['formFields']['type'], 'type', $this->values['type']); $fld->importFromConfig($cfg['type']); $list = ['corporate'=>$this->lang['formFields']['typeCorp'], 'supplier'=>$this->lang['formFields']['typeSupp']]; $fld->setPossibleValues($list); if ($this->controller->getAction()=='update') { $fld->setDisabled(); } $form->addElement($fld); if ($this->controller->getAction()=='update') { $form->addElement(new \Engine\Form\Input\Hidden('', 'id', $this->values['id'])); } $form->addElement(new \Engine\Form\Input\Hidden('', $this->submitButtonName, 1)); return $form; } }