<?php
namespace Modules\Admin\Config\Services\Basic; class View_Utils_AddGroup extends \App\Mvc\View_Utils_FormAbstract { public function getForm() { $form = \Engine\Form\General::create(); $fieldset = \Engine\Form\Container\Fieldset::create(); $form->addContainer($fieldset); $code = new \Engine\Form\Input\Text($this->lang['addGroup']['formFields']['code'], 'code', $this->values['code']); $code->setMandatory(true); $code->setValidatorParam('maxLength', '20'); $code->setValidatorParam('minLength', '1'); if ($this->values['action'] == 'update') { $code->setDisabled(true); } $fieldset->addElement($code); $name = new \Engine\Form\Input\Text($this->lang['addGroup']['formFields']['name'], 'name', $this->values['name']); $name->setMandatory(true); $name->setValidatorParam('maxLength', '100'); $name->setValidatorParam('minLength', '1'); $fieldset->addElement($name); $form->addElement(new \Engine\Form\Input\Hidden('', $this->submitButtonName, 1)); return $form; } }