public function __construct($options = array()) { parent::__construct($options); $this->setAttrib('id', 'roleForm'); $name = $this->createElement('text', 'name', array('label' => 'model-role-form:roleName')); $name->setRequired(true)->addFilter('StringTrim')->addFilter('StripTags')->addValidator('regex', true, array('pattern' => '/^[a-z0-9\\s\\_\\-]*$/i', 'messages' => 'Contains invalid characters for role name'))->setAttrib('maxlength', '128')->setDescription('Role names can only contain letters, numbers, spaces, dashes and underscores'); $inheritRoleId = $this->createElement('select', 'inheritRoleId', array('label' => 'model-role-form:inheritRoleId')); $acl = Zend_Registry::get('acl'); $roles = $acl->getAvailableRoles(); $inheritRoleId->addMultiOption(0, 'No Inheritance'); foreach ($roles as $r) { if (isset($values['roleId'])) { if (!$acl->inheritsRole($r['roleId'], $values['roleId']) && $r['roleId'] != $values['roleId']) { $inheritRoleId->addMultiOption($r['roleId'], $r['name']); } } else { $inheritRoleId->addMultiOption($r['roleId'], $r['name']); } } $this->addElements(array($name, $inheritRoleId)); $this->addElement('submit', 'submit', array('buttonType' => Twitter_Bootstrap_Form_Element_Submit::BUTTON_PRIMARY, 'label' => 'model-role-form:submit')); $this->addElement('button', 'cancel', array('label' => 'form-button-cancel', 'type' => 'button')); $this->addDisplayGroup(array('submit', 'cancel'), 'actions', array('disableLoadDefaultDecorators' => true, 'decorators' => array('Actions'))); return $this; }
/** * Método construtor, renderiza os campos do formulário * * @return $this|void */ public function init() { parent::init(); // Tradução self::$oTranslate = Zend_Registry::get('Zend_Translate'); // Url base do sistema self::$oBaseUrlHelper = new Zend_View_Helper_BaseUrl(); // Configurações pado do formulário $this->setName('form_consulta'); $this->setMethod(Zend_form::METHOD_POST); $oElm = $this->createElement('text', 'competencia_inicial', array('divspan' => '4')); $oElm->setLabel('Competência Inicial:'); $oElm->setAttrib('class', 'span2 mask-competencia'); $oElm->setAttrib('placeholder', 'Mês/Ano'); $oElm->removeDecorator('errors'); $this->addElement($oElm); $oElm = $this->createElement('text', 'competencia_final', array('divspan' => '4')); $oElm->setLabel('Competência Final:'); $oElm->setAttrib('class', 'span2 mask-competencia'); $oElm->setAttrib('placeholder', 'Mês/Ano'); $oElm->removeDecorator('errors'); $this->addElement($oElm); $oElm = $this->createElement('button', 'btn_consultar', array('label' => 'Consultar', 'class' => 'span2', 'msg-loading' => 'Aguarde...', 'buttonType' => Twitter_Bootstrap_Form_Element_Button::BUTTON_PRIMARY)); $this->addElement($oElm); // Lista de elementos do formulário $aElementos = array('competencia_inicial', 'competencia_final', 'btn_consultar'); // Seta o grupo de elementos $this->addDisplayGroup($aElementos, "consultar"); return $this; }
/** * Construtor * * @param string $sCodigoVerificacao Codigo de verificacao * @param DateTime $dMenorDiaEmissao Menor dia possivel para emissao da nota * @param string $sAction Acao do formulario * @param bool $lRps TRUE se for emissao de RPS */ public function __construct($sCodigoVerificacao, $dMenorDiaEmissao, $sAction = '/contribuinte/nota/index', $lRps = FALSE) { $this->sAction = $sAction; $this->sCodigoVerificacao = $sCodigoVerificacao; $this->lRps = $lRps; $this->dMenorDiaEmissao = $dMenorDiaEmissao; parent::__construct(array('addDecorator' => array(array('Wrapper')))); }
public function __construct($cpfcnpj, $inscricao, $ano_comp, $mes_comp, $total_iss, $total_servico, $options = null) { $this->cpfcnpj = $cpfcnpj; $this->inscricao = $inscricao; $this->ano_comp = $ano_comp; $this->mes_comp = $mes_comp; $this->total_iss = $total_iss; $this->total_servico = $total_servico; parent::__construct($options); }
public function __construct($options = array()) { parent::__construct($options); $this->setAttrib('id', 'importConfigCsvForm')->setAttrib('enctype', 'multipart/form-data'); $file = $this->createElement('file', 'config', array('label' => 'Upload a CSV File:')); $file->addValidator('Count', false, 1)->addValidator('Size', false, 102400)->addValidator('Extension', false, 'csv'); $this->addElements(array($file)); $this->addElement('submit', 'submit', array('buttonType' => Twitter_Bootstrap_Form_Element_Submit::BUTTON_PRIMARY, 'label' => 'Save Configuration')); $this->addElement('button', 'cancel', array('label' => 'form-button-cancel', 'type' => 'button')); $this->addDisplayGroup(array('submit', 'cancel'), 'actions', array('disableLoadDefaultDecorators' => true, 'decorators' => array('Actions'))); return $this; }
public function __construct($options = array()) { parent::__construct($options); $this->setAttrib('id', 'forgotPassword'); // Create and configure username element: $username = $this->createElement('text', 'username', array('label' => 'ot-login-form:username')); $username->setRequired(true)->addFilter('StringTrim'); $this->addElements(array($username)); $this->addElement('submit', 'submit', array('buttonType' => Twitter_Bootstrap_Form_Element_Submit::BUTTON_PRIMARY, 'label' => 'ot-login-forgot:linkReset')); $this->addElement('button', 'cancel', array('label' => 'form-button-cancel', 'type' => 'button')); $this->addDisplayGroup(array('submit', 'cancel'), 'actions', array('disableLoadDefaultDecorators' => true, 'decorators' => array('Actions'))); return $this; }
public function __construct($options = array()) { parent::__construct($options); $this->setAttrib('id', 'signup'); // Create and configure username element: $username = $this->createElement('text', 'username', array('label' => 'model-account-username')); $username->setRequired(true)->addFilter('StringTrim')->addFilter('Alnum')->addFilter('StripTags')->addValidator('StringLength', false, array(3, 64))->setAttrib('maxlength', '64'); // First Name $firstName = $this->createElement('text', 'firstName', array('label' => 'model-account-firstName')); $firstName->setRequired(true)->addFilter('StringToLower')->addFilter('StringTrim')->addFilter('StripTags')->addFilter(new Ot_Filter_Ucwords())->setAttrib('maxlength', '64'); // Last Name $lastName = $this->createElement('text', 'lastName', array('label' => 'model-account-lastName')); $lastName->setRequired(true)->addFilter('StringTrim')->addFilter('StringToLower')->addFilter('StripTags')->addFilter(new Ot_Filter_Ucwords())->setAttrib('maxlength', '64'); // Password field $password = $this->createElement('password', 'password', array('label' => 'model-account-password')); $password->setRequired(true)->addValidator('StringLength', false, array($this->_minPasswordLength, $this->_maxPasswordLength))->addFilter('StringTrim')->addFilter('StripTags'); // Password confirmation field $passwordConf = $this->createElement('password', 'passwordConf', array('label' => 'model-account-passwordConf')); $passwordConf->setRequired(true)->addValidator('StringLength', false, array($this->_minPasswordLength, $this->_maxPasswordLength))->addValidator('Identical', false, array('token' => 'password'))->addFilter('StringTrim')->addFilter('StripTags'); // Email address field $email = $this->createElement('text', 'emailAddress', array('label' => 'model-account-emailAddress')); $email->setRequired(true)->addFilter('StringTrim')->addValidator('EmailAddress'); $timezone = $this->createElement('select', 'timezone', array('label' => 'model-account-timezone')); $timezone->addMultiOptions(Ot_Model_Timezone::getTimezoneList()); $timezone->setValue(date_default_timezone_get()); $this->addElements(array($username, $password, $passwordConf, $firstName, $lastName, $email, $timezone)); $aar = new Ot_Account_Attribute_Register(); $vars = $aar->getVars(); foreach ($vars as $v) { $elm = $v->renderFormElement(); $elm->clearDecorators(); $elm->setBelongsTo('accountAttributes'); $this->addElement($elm); } $cahr = new Ot_CustomAttribute_HostRegister(); $thisHost = $cahr->getHost('Ot_Profile'); if (is_null($thisHost)) { throw new Ot_Exception_Data('msg-error-objectNotSetup'); } $customAttributes = $thisHost->getAttributes(); foreach ($customAttributes as $a) { $elm = $a['var']->renderFormElement(); $elm->clearDecorators(); $elm->setBelongsTo('customAttributes'); $this->addElement($elm); } $this->addElement('submit', 'submit', array('buttonType' => Twitter_Bootstrap_Form_Element_Submit::BUTTON_PRIMARY, 'label' => 'Create My Account')); $this->addElement('button', 'cancel', array('label' => 'form-button-cancel', 'type' => 'button')); $this->addDisplayGroup(array('submit', 'cancel'), 'actions', array('disableLoadDefaultDecorators' => true, 'decorators' => array('Actions'))); return $this; }
public function __construct($options = array()) { parent::__construct($options); $this->setAttrib('id', 'authAdapterForm'); $name = $this->createElement('text', 'name', array('label' => 'Display Name:')); $name->setRequired(true)->addFilter('StringTrim')->addFilter('StripTags')->setAttrib('maxlength', '64'); $description = $this->createElement('textarea', 'description', array('label' => 'Description:')); $description->setRequired(true)->addFilter('StringTrim')->addFilter('StripTags')->setAttrib('maxlength', '64'); $this->addElements(array($name, $description)); $this->addElement('submit', 'submit', array('buttonType' => Twitter_Bootstrap_Form_Element_Submit::BUTTON_PRIMARY, 'label' => 'form-button-save')); $this->addElement('button', 'cancel', array('label' => 'form-button-cancel', 'type' => 'button')); $this->addDisplayGroup(array('submit', 'cancel'), 'actions', array('disableLoadDefaultDecorators' => true, 'decorators' => array('Actions'))); return $this; }
public function __construct($options = array()) { parent::__construct($options); $this->setAttrib('id', 'resetPassword'); $password = $this->createElement('password', 'password', array('label' => 'ot-login-passwordReset:new')); $password->setRequired(true)->addValidator('StringLength', false, array(6, 20))->addFilter('StringTrim')->addFilter('StripTags'); $passwordConf = $this->createElement('password', 'passwordConf', array('label' => 'ot-login-passwordReset:confirm')); $passwordConf->setRequired(true)->addValidator('StringLength', false, array(6, 20))->addFilter('StringTrim')->addFilter('StripTags'); $this->addElements(array($password, $passwordConf)); $this->addElement('submit', 'submit', array('buttonType' => Twitter_Bootstrap_Form_Element_Submit::BUTTON_PRIMARY, 'label' => 'ot-login-passwordReset:linkReset')); $this->addElement('button', 'cancel', array('label' => 'form-button-cancel', 'type' => 'button')); $this->addDisplayGroup(array('submit', 'cancel'), 'actions', array('disableLoadDefaultDecorators' => true, 'decorators' => array('Actions'))); return $this; }
/** * Método construtor, renderiza os campos do formulário * * @return $this|void */ public function init() { parent::init(); // Tradução self::$oTranslate = Zend_Registry::get('Zend_Translate'); // Url base do sistema self::$oBaseUrlHelper = new Zend_View_Helper_BaseUrl(); // Configurações pado do formulário $this->setName('formRelatorio'); $this->setMethod(Zend_form::METHOD_POST); $this->setAction('/fiscal/relatorio-nfse-periodo/consultar'); $oElm = $this->createElement('text', 'data_nota_inicial', array('divspan' => '4')); $oElm->setLabel('Competência Inicial:'); $oElm->setAttrib('class', 'span2'); $oElm->setAttrib('placeholder', 'Dia/Mês/Ano'); $oElm->addValidator(new Zend_Validate_StringLength(array('min' => 10, 'max' => 10))); $oElm->addValidator(new Zend_Validate_Date(array('format' => 'dd/MM/yyyy'))); $oElm->setRequired(TRUE); $oElm->removeDecorator('errors'); $this->addElement($oElm); $oElm = $this->createElement('text', 'data_nota_final', array('divspan' => '4')); $oElm->setLabel('Competência Final:'); $oElm->setAttrib('class', 'span2'); $oElm->setAttrib('placeholder', 'Dia/Mês/Ano'); $oElm->addValidator(new Zend_Validate_StringLength(array('min' => 10, 'max' => 10))); $oElm->addValidator(new Zend_Validate_Date(array('format' => 'dd/MM/yyyy'))); $oElm->setRequired(TRUE); $oElm->removeDecorator('errors'); $this->addElement($oElm); $oElm = $this->createElement('select', 'natureza_operacao', array('divspan' => '4', 'multioptions' => array('' => 'Todos', 1 => 'Tributação no Município', 2 => 'Tributação Fora do Município'))); $oElm->setLabel('Natureza da Operação:'); $oElm->setAttrib('class', 'span2'); $oElm->setRequired(FALSE); $oElm->removeDecorator('errors'); $this->addElement($oElm); $oElm = $this->createElement('select', 's_dados_iss_retido', array('divspan' => '4', 'multioptions' => array('' => 'Todos', 1 => 'Sim', 2 => 'Não'))); $oElm->setLabel('Subst. Tributário (Retido):'); $oElm->setAttrib('class', 'span2'); $oElm->setRequired(FALSE); $oElm->removeDecorator('errors'); $this->addElement($oElm); $oElm = $this->createElement('submit', 'btn_gerar', array('divspan' => 10, 'label' => 'Gerar Relatório', 'class' => 'span2', 'msg-loading' => 'Aguarde...', 'buttonType' => Twitter_Bootstrap_Form_Element_Button::BUTTON_PRIMARY)); $this->addElement($oElm); // Lista de elementos do formulário $aElementos = array('data_nota_inicial', 'data_nota_final', 'natureza_operacao', 's_dados_iss_retido', 'btn_gerar'); // Seta o grupo de elementos $this->addDisplayGroup($aElementos, "relatorio-nfse-periodo"); return $this; }
public function __construct($options = array()) { parent::__construct($options); $this->setAttrib('id', 'apiAppForm')->setAttrib('enctype', 'multipart/form-data'); $name = $this->createElement('text', 'name', array('label' => 'Application Name:')); $name->setRequired(true)->addFilter('StringTrim')->addFilter('StripTags')->setAttrib('maxlength', '128'); $description = $this->createElement('textarea', 'description', array('label' => 'Description:')); $description->setRequired(true)->addFilter('StringTrim')->addFilter('StripTags')->setAttrib('style', 'height: 100px; width: 350px;'); $website = $this->createElement('text', 'website', array('label' => 'Application Website:', 'placeholder' => 'http://')); $website->setRequired(false)->addValidator(new Ot_Validate_Url())->addFilter('StringTrim')->addFilter('StripTags')->setAttrib('maxlength', '255'); $this->addElements(array($name, $description, $website)); $this->addElement('submit', 'submit', array('buttonType' => Twitter_Bootstrap_Form_Element_Submit::BUTTON_PRIMARY, 'label' => 'form-button-save')); $this->addElement('button', 'cancel', array('label' => 'form-button-cancel', 'type' => 'button')); $this->addDisplayGroup(array('submit', 'cancel'), 'actions', array('disableLoadDefaultDecorators' => true, 'decorators' => array('Actions'))); return $this; }
public function __construct($actionTypeSubForm, $options = array()) { parent::__construct($options); $this->setAttrib('id', 'actionForm'); // Create and configure username element: $name = $this->createElement('text', 'name', array('label' => 'Action Nickname:')); $name->setRequired(true)->addFilter('StringTrim')->addFilter('StripTags')->setDescription('A simple identifier to remind you the purpose of this action.'); $actionTypeSubForm->setDecorators(array('FormElements')); $actionTypeSubForm->setElementDecorators(array(array('FieldSize'), array('ViewHelper'), array('Addon'), array('ElementErrors'), array('Description', array('tag' => 'p', 'class' => 'help-block')), array('HtmlTag', array('tag' => 'div', 'class' => 'controls')), array('Label', array('class' => 'control-label')), array('Wrapper'))); $this->addElements(array($name)); $this->addSubForm($actionTypeSubForm, 'actionType'); $this->addElement('submit', 'submit', array('buttonType' => Twitter_Bootstrap_Form_Element_Submit::BUTTON_PRIMARY, 'label' => 'Save Action')); $this->addElement('button', 'cancel', array('label' => 'form-button-cancel', 'type' => 'button')); $this->addDisplayGroup(array('submit', 'cancel'), 'actions', array('disableLoadDefaultDecorators' => true, 'decorators' => array('Actions'))); return $this; }
public function __construct($options = array()) { parent::__construct($options); $acl = Zend_Registry::get('acl'); $form = new Zend_Form(); $form->setAttrib('id', 'account')->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'div', 'class' => 'zend_form')), 'Form')); $authAdapter = new Ot_Model_DbTable_AuthAdapter(); $adapters = $authAdapter->fetchAll(null, 'displayOrder'); // Realm Select box $realmSelect = $form->createElement('select', 'realm', array('label' => 'Login Method')); foreach ($adapters as $adapter) { $realmSelect->addMultiOption($adapter->adapterKey, $adapter->name . (!$adapter->enabled ? ' (Disabled)' : '')); } $realmSelect->setValue(isset($default['realm']) ? $default['realm'] : ''); // Create and configure username element: $username = $form->createElement('text', 'username', array('label' => 'model-account-username')); $username->setRequired(true)->addFilter('StringTrim')->addFilter('Alnum')->addFilter('StripTags')->addValidator('StringLength', false, array(3, 64))->setAttrib('maxlength', '64')->setValue(isset($default['username']) ? $default['username'] : ''); $submit = $form->createElement('submit', 'submit', array('label' => 'Masquerade')); $submit->setDecorators(array(array('ViewHelper', array('helper' => 'formSubmit')))); $form->addElements(array($realmSelect, $username, $submit)); }
/** * Método construtor, renderiza os campos do formulário * * @return $this|void */ public function init() { parent::init(); // Tradução self::$oTranslate = Zend_Registry::get('Zend_Translate'); // Url base do sistema self::$oBaseUrlHelper = new Zend_View_Helper_BaseUrl(); // Configurações pado do formulário $this->setName('formRelatorio'); $this->setMethod(Zend_form::METHOD_POST); $this->setAction('/fiscal/relatorio-webservice/consulta'); $oElm = $this->createElement('select', 'ambiente', array('divspan' => '5', 'multioptions' => array(52 => 'Produção', 51 => 'Homologação'))); $oElm->setLabel('Ambiente:'); $this->addElement($oElm); $oElm = $this->createElement('button', 'btn_gerar', array('divspan' => 5, 'label' => 'Gerar Relatório', 'class' => 'span2', 'msg-loading' => 'Aguarde...', 'buttonType' => Twitter_Bootstrap_Form_Element_Button::BUTTON_PRIMARY)); $this->addElement($oElm); // Lista de elementos do formulário $aElementos = array('ambiente', 'btn_gerar'); // Seta o grupo de elementos $this->addDisplayGroup($aElementos, "relatorio-webservice", array('fieldset' => 'Gerar Relatório')); return $this; }
public function __construct($aOptions = null) { parent::__construct($aOptions); }
public function __construct($action, $user = null, $options = null) { $this->_action = $action; $this->_user = $user; parent::__construct($options); }
/** * Sobrescreve o método construtor da classe pai, para poder adicionar as competencias */ public function __construct(array $aCompetencias) { $this->aCompetencias = $aCompetencias; parent::__construct(); }
public function __construct($sAction = '/contribuinte/tomador/index', $bSubmit = TRUE) { parent::__construct(); $this->sAction = $sAction; $this->bSubmit = $bSubmit; }
public function __construct($new = false, $me = false, $options = array()) { parent::__construct($options); $acl = Zend_Registry::get('acl'); $this->setAttrib('id', 'account'); $authAdapter = new Ot_Model_DbTable_AuthAdapter(); $adapters = $authAdapter->fetchAll(null, 'displayOrder'); // Realm Select box $realmSelect = $this->createElement('select', 'realm', array('label' => 'Login Method')); foreach ($adapters as $adapter) { $realmSelect->addMultiOption($adapter->adapterKey, $adapter->name . (!$adapter->enabled ? ' (Disabled)' : '')); } // Create and configure username element: $username = $this->createElement('text', 'username', array('label' => 'model-account-username')); $username->setRequired(true)->addFilter('StringTrim')->addFilter('Alnum')->addFilter('StripTags')->addValidator('StringLength', false, array(3, 64))->setAttrib('maxlength', '64'); // First Name $firstName = $this->createElement('text', 'firstName', array('label' => 'model-account-firstName')); $firstName->setRequired(true)->addFilter('StringToLower')->addFilter('StringTrim')->addFilter('StripTags')->addFilter(new Ot_Filter_Ucwords())->setAttrib('maxlength', '64'); // Last Name $lastName = $this->createElement('text', 'lastName', array('label' => 'model-account-lastName')); $lastName->setRequired(true)->addFilter('StringTrim')->addFilter('StringToLower')->addFilter('StripTags')->addFilter(new Ot_Filter_Ucwords())->setAttrib('maxlength', '64'); // Email address field $email = $this->createElement('text', 'emailAddress', array('label' => 'model-account-emailAddress')); $email->setRequired(true)->addFilter('StringTrim')->addValidator('EmailAddress'); $timezone = $this->createElement('select', 'timezone', array('label' => 'model-account-timezone')); $timezone->addMultiOptions(Ot_Model_Timezone::getTimezoneList()); $timezone->setValue(date_default_timezone_get()); // Role select box $roleSelect = $this->createElement('multiselect', 'role', array('label' => 'model-account-role')); $roleSelect->setRequired(true); $roleSelect->setDescription('You may select multiple roles for a user'); $roles = $acl->getAvailableRoles(); foreach ($roles as $r) { $roleSelect->addMultiOption($r['roleId'], $r['name']); } if ($new) { $this->addElements(array($realmSelect, $username, $roleSelect, $firstName, $lastName, $email, $timezone)); } else { if ($me) { $this->addElements(array($firstName, $lastName, $email, $timezone)); } else { $realmSelect->setAttrib('disabled', 'disabled'); $username->setAttrib('disabled', 'disabled'); $this->addElements(array($realmSelect, $username, $roleSelect, $firstName, $lastName, $email, $timezone)); } } $aar = new Ot_Account_Attribute_Register(); $vars = $aar->getVars(); foreach ($vars as $v) { $elm = $v->renderFormElement(); $elm->clearDecorators(); $elm->setBelongsTo('accountAttributes'); $this->addElement($elm); } $cahr = new Ot_CustomAttribute_HostRegister(); $thisHost = $cahr->getHost('Ot_Profile'); if (is_null($thisHost)) { throw new Ot_Exception_Data('msg-error-objectNotSetup'); } $customAttributes = $thisHost->getAttributes(); foreach ($customAttributes as $a) { $elm = $a['var']->renderFormElement(); $elm->clearDecorators(); $elm->setBelongsTo('customAttributes'); $this->addElement($elm); } $this->addElement('submit', 'submit', array('buttonType' => Twitter_Bootstrap_Form_Element_Submit::BUTTON_PRIMARY, 'label' => 'form-button-save')); $this->addElement('button', 'cancel', array('label' => 'form-button-cancel', 'type' => 'button')); $this->addDisplayGroup(array('submit', 'cancel'), 'actions', array('disableLoadDefaultDecorators' => true, 'decorators' => array('Actions'))); return $this; }
public function __construct($action, $model = null, $options = null) { $this->_action = $action; $this->_model = $model; parent::__construct($options); }
/** * Monta o formulário de cadastro de perfis * * @param string $sAction * @param null $iId * @param array $values * @return Twitter_Bootstrap_Form_Horizontal */ private function formPerfil($sAction = 'novo', $iId = null, $values = array()) { $oForm = new Twitter_Bootstrap_Form_Horizontal(); $oBaseUrlHelper = new Zend_View_Helper_BaseUrl(); if ($iId !== NULL) { $sAction .= "/id/{$iId}"; } $oForm->setAction($oBaseUrlHelper->baseUrl('/administrativo/perfil/' . $sAction))->setMethod('post'); if ($iId !== NULL) { $oElm = $oForm->createElement('hidden', 'id'); $oElm->setValue($iId); $oForm->addElement($oElm); } $aTipos = Administrativo_Model_TipoUsuario::getLista(); $oElm = $oForm->createElement('select', 'tipo', array('multiOptions' => $aTipos)); $oElm->setLabel('Tipo:'); $oElm->setAttrib('ajax-url', $oBaseUrlHelper->baseUrl('/administrativo/usuario/get-contadores')); $oElm->setRequired(TRUE); if (isset($values['tipo'])) { $oElm->setValue($values['tipo']); } $oForm->addElement($oElm); $oElm = $oForm->createElement('text', 'nome'); $oElm->setLabel('Nome'); $oElm->setRequired(); if (isset($values['nome'])) { $oElm->setValue($values['nome']); } $oForm->addElement($oElm); $oElm = $oForm->createElement('select', 'administrativo', array('multiOptions' => array('1' => 'Sim', '0' => 'Não'))); $oElm->setLabel('Administrativo'); if (isset($values['administrativo']) and $values['administrativo'] == true) { $oElm->setValue('1'); } else { $oElm->setValue('0'); } $oForm->addElement($oElm); $oForm->addElement('submit', 'submit', array('label' => 'Salvar', 'buttonType' => Twitter_Bootstrap_Form_Element_Submit::BUTTON_SUCCESS)); return $oForm; }
public function __construct($action, $type = null, $options = null) { $this->_action = $action; $this->_type = $type; parent::__construct($options); }
public function __construct() { $this->translate = $this->getTranslator(); parent::__construct(); }
/** * Sobrescreve o método para setar a action com a url base do sistema * * (non-PHPdoc) * @see Zend_Form::setAction() */ public function setAction($sUrl = NULL) { parent::setAction(self::$oBaseUrlHelper->baseUrl($sUrl)); }
/** * Construtor da classe, utilizado padrão HTML para uso do TwitterBootstrap * * @param string $aOptions * @see Twitter_Bootstrap_Form_Horizontal */ public function __construct($aOptions = NULL) { parent::__construct($aOptions); }
public function __construct($lConfirmacao = FALSE, $aOptions = NULL) { $this->confirmacao = $lConfirmacao; parent::__construct($aOptions); }