public function init() { $this->setMethod('post'); $this->setAction('/login'); $this->setOptions(array('class' => 'niceform', 'id' => 'form1')); $this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table')), 'Form')); //$this->getDecorator('HtmlTag')->setOptions(array('tag' => 'fieldset')); /*$this->setDecorators(array( 'Errors', 'FormElements', array('HtmlTag', array('tag' => 'fieldset')), 'Form' ));*/ $username = new Zend_Form_Element_Text('username'); $username->setLabel('username'); $username->setRequired(true); $username->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'class' => 'element')), array('Label', array('tag' => 'td'), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))); $pass = new Zend_Form_Element_Password('password'); $pass->setlabel('password'); $pass->setRequired(true); $pass->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'class' => 'element')), array('Label', array('tag' => 'td'), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))); /* $pass->setDecorators(array( 'ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'class' => 'element')), array(array('label' => 'HtmlTag'), array('tag' => 'td', 'placement' => 'prepend')), array(array('row' => 'HtmlTag'), array('tag' => 'tr')), )); */ $submit = new Zend_Form_Element_Submit('login'); $submit->setLabel('login'); $submit->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'class' => 'element')), array(array('label' => 'HtmlTag'), array('tag' => 'td', 'placement' => 'prepend')), array(array('row' => 'HtmlTag'), array('tag' => 'tr')))); $this->addElements(array($username, $pass, $submit)); }
/** * * Change password form * */ public function init() { $cname = explode('_', get_class()); $this->preInit(end($cname)); // use template file $this->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/ChangePassword.phtml')))); $Profiles = new Application_Model_Profiles(); // fields $password_old = new Zend_Form_Element_Password('passwordold'); $password_old->setDecorators(array('ViewHelper', 'Errors'))->setAttrib('autocomplete', 'off')->setRequired(true)->setErrorMessages(array($this->translator->translate('Password is required')))->setLabel($this->translator->translate('Old Password:'******'class', 'form-control'); // check if blank password (facebook-registered user) and remove old password field if so if (Zend_Auth::getInstance()->hasIdentity()) { $profile = $Profiles->getProfile(Zend_Auth::getInstance()->getIdentity()->name); if ($profile->password == '') { $password_old->setAttrib('class', 'hidden'); $password_old->setRequired(false); $password_old->setLabel(''); } } $password1 = new Zend_Form_Element_Password('password1'); $password1->setDecorators(array('ViewHelper', 'Errors'))->setAttrib('autocomplete', 'off')->setRequired(true)->addValidator('StringLength', false, array(5))->setErrorMessages(array($this->translator->translate('Min 5 characters')))->setLabel($this->translator->translate('New Password:'******'class', 'form-control'); $password2 = new Zend_Form_Element_Password('password2'); $password2->setDecorators(array('ViewHelper', 'Errors'))->setAttrib('autocomplete', 'off')->setRequired(true)->addValidator('Identical', false, array('token' => 'password1'))->setErrorMessages(array($this->translator->translate('The passwords do not match')))->setLabel($this->translator->translate('Confirm Password:'******'class', 'form-control'); $submit = new Zend_Form_Element_Submit('changepass'); $submit->setDecorators(array('ViewHelper'))->setLabel($this->translator->translate('Change Password'))->setAttrib('class', 'submit btn btn-default'); $this->addElements(array($password_old, $password1, $password2, $submit)); $this->postInit(); }
function getForm() { $form = new Cible_Form(array('disabledDefaultActions' => true)); $base_dir = $this->getFrontController()->getBaseUrl(); $redirect = str_replace($base_dir, '', $this->_request->getParam('redirect')); $form->setAction("{$base_dir}/auth/login")->setMethod('post'); $form->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table')), 'Form')); $form->setAttrib('class', 'auth-form'); $username = new Zend_Form_Element_Text('username'); $username->setLabel(Cible_Translation::getCibleText('form_label_username')); $username->setRequired(true); $username->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => Cible_Translation::getCibleText('error_field_required')))); $username->setAttrib('class', 'loginTextInput'); $username->setDecorators(array('ViewHelper', 'Description', 'Errors', 'Label', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'class' => 'username')), array(array('row' => 'HtmlTag'), array('tag' => 'tr', 'openOnly' => true)))); $form->addElement($username); $password = new Zend_Form_Element_Password('password'); $password->setLabel(Cible_Translation::getCibleText('form_label_password')); $password->setRequired(true); $password->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => Cible_Translation::getCibleText('error_field_required')))); $password->setAttrib('class', 'loginTextInput'); $password->setDecorators(array('ViewHelper', 'Description', 'Errors', 'Label', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'class' => 'password')), array(array('row' => 'HtmlTag'), array('tag' => 'tr', 'closeOnly' => true)))); $form->addElement($password); $submit = new Zend_Form_Element_Submit('submit'); $submit->setLabel(Cible_Translation::getCibleText('button_authenticate'))->setAttrib('class', 'loginButton')->setAttrib('onmouseover', 'this.className=\'loginButtonOver\';')->setAttrib('onmouseout', 'this.className=\'loginButton\';')->removeDecorator('label')->setDecorators(array('ViewHelper', 'Description', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'colspan' => '2', 'align' => 'right', 'class' => 'submit')), array(array('row' => 'HtmlTag'), array('tag' => 'tr')))); $form->addElement($submit); $redirect_hidden = new Zend_Form_Element_Hidden('redirect'); $redirect_hidden->setValue($redirect)->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'colspan' => '2')), array(array('row' => 'HtmlTag'), array('tag' => 'tr')))); $form->addElement($redirect_hidden); return $form; }
public function init() { $this->clearDecorators(); $this->addElementPrefixPath('Pas_Validate', 'Pas/Validate/', 'validate'); $this->addPrefixPath('Pas_Form_Element', 'Pas/Form/Element/', 'element'); $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'append', 'class' => 'error', 'tag' => 'li')), array('Label', array('separator' => ' ', 'requiredSuffix' => ' *', 'class' => 'leftalign')), array('HtmlTag', array('tag' => 'li'))); $oldpassword = new Zend_Form_Element_Password('oldpassword'); $oldpassword->setLabel('Your old password: '******'RightPassword')->addFilters(array('StripTags', 'StringTrim')); $oldpassword->setDecorators($decorators); $password = new Zend_Form_Element_Password("password"); $password->setLabel("New password:"******"NotEmpty")->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators)->addValidator('IdenticalField', false, array('password2', ' confirm password field')); // identical field validator with custom messages $hash = new Zend_Form_Element_Hash('csrf'); $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(60); $this->addElement($hash); $password2 = new Zend_Form_Element_Password("password2"); $password2->setLabel("Confirm password:"******"NotEmpty")->addFilters(array('StripTags', 'StringTrim'))->setRequired(true)->setDecorators($decorators); $submit = new Zend_Form_Element_Submit('submit'); $submit->clearDecorators(); $submit->addDecorators(array(array('ViewHelper'), array('HtmlTag', array('tag' => 'div', 'class' => 'submit')))); $submit->setAttrib('class', 'large')->setLabel('Change password'); $this->addElement($submit); $this->addElements(array($oldpassword, $password, $password2, $submit)); $this->addDisplayGroup(array('oldpassword', 'password', 'password2'), 'userdetails'); $this->addDecorator('FormElements')->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'div'))->addDecorator('FieldSet')->addDecorator('Form'); $this->userdetails->removeDecorator('DtDdWrapper'); $this->userdetails->removeDecorator('FieldSet'); $this->userdetails->addDecorator(array('DtDdWrapper' => 'HtmlTag'), array('tag' => 'ul')); $this->addDisplayGroup(array('submit'), 'submit'); $this->setLegend('Edit account details: '); }
public function init() { /* $email = $this->addElement('text', 'email', array( 'filters' => array('StringTrim', 'StringToLower'), 'validators' => array( 'EmailAddress', ), 'required' => true, 'label' => $this->translate->_("Email"), 'decorators' => $this->elementDecorators, 'description'=>"mustbe lower..." )); */ $email = new Zend_Form_Element_Text("email"); $email->setLabel('Email'); $email->setDecorators($this->elementDecorators); $email->addValidator("EmailAddress"); $email->addValidator("ExistUser", false, array("email")); $email->addPrefixPath('VC_Validate', 'VC/Validate/', 'validate'); $this->addElements(array($email)); /*$username = $this->addElement('text', 'username', array( 'filters' => array('StringTrim', 'StringToLower'), 'validators' => array( 'Alpha', array('StringLength', false, array(3, 20)), ), 'required' => true, 'label' => $this->translate->_("Username"), 'decorators' => $this->elementDecorators, )); */ $token = $this->addElement('hidden', 'token', array('disableLoadDefaultDecorators' => true)); $password = $this->addElement('password', 'password', array('filters' => array('StringTrim'), 'validators' => array(array('StringLength', false, array(6, 20))), 'required' => true, 'label' => $this->translate->_("Password"), 'decorators' => $this->elementDecorators)); /* $re_password = $this->addElement('password', 'password_confirm', array( 'filters' => array('StringTrim'), 'validators' => array( array('SL_ValidatorMatch', false, array("password")), ), 'required' => true, 'label' => $this->translate->_("Confirm password"), 'decorators' => $this->elementDecorators, )); */ $re_password = new Zend_Form_Element_Password("password_confirm"); $re_password->setLabel('Confirm Password'); $re_password->setDecorators($this->elementDecorators); $re_password->addValidator("PasswordConfirmation", false, array("password")); $re_password->addPrefixPath('VC_Validate', 'VC/Validate/', 'validate'); $this->addElements(array($re_password)); $username = $this->addElement('text', 'fullname', array('filters' => array('StringTrim'), 'validators' => array(array('StringLength', false, array(3, 70))), 'required' => true, 'label' => $this->translate->_("Full name"), 'decorators' => $this->elementDecorators)); // Add a captcha $this->addElement('captcha', 'captcha', array('label' => $this->translate->_("Please enter the 5 letters displayed below:"), 'required' => true, 'captcha' => array('captcha' => 'Figlet', 'wordLen' => 5, 'timeout' => 300))); $login = $this->addElement('submit', 'login', array('required' => false, 'ignore' => true, 'label' => $this->translate->_("Register"), 'decorators' => $this->buttonDecorators)); }
public function init() { // administrador_email $administrador_email = new Zend_Form_Element_Text('administrador_email'); $administrador_email->setRequired(); $administrador_email->setDecorators(App_Forms_Decorators::$simpleElementDecorators); $administrador_email->setAttribs(array('class' => 'form-control', 'placeholder' => 'Informe seu e-mail')); // administrador_senha $administrador_senha = new Zend_Form_Element_Password('administrador_senha'); $administrador_senha->setRequired(); $administrador_senha->setDecorators(App_Forms_Decorators::$simpleElementDecorators); $administrador_senha->setAttribs(array('class' => 'form-control', 'placeholder' => 'Informe sua senha')); $this->addElements(array($administrador_email, $administrador_senha)); parent::init(); }
/** * * Forgot password form * */ public function init() { $cname = explode('_', get_class()); $this->preInit(end($cname)); // use template file $this->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/ChangeForgottenPassword.phtml')))); // fields $password1 = new Zend_Form_Element_Password('password1'); $password1->setDecorators(array('ViewHelper', 'Errors'))->setAttrib('autocomplete', 'off')->setRequired(true)->addValidator('StringLength', false, array(5))->setErrorMessages(array($this->translator->translate('Min 5 characters')))->setLabel($this->translator->translate('New Password:'******'class', 'form-control'); $password2 = new Zend_Form_Element_Password('password2'); $password2->setDecorators(array('ViewHelper', 'Errors'))->setAttrib('autocomplete', 'off')->setRequired(true)->addValidator('Identical', false, array('token' => 'password1'))->setErrorMessages(array($this->translator->translate('The passwords do not match')))->setLabel($this->translator->translate('Confirm Password:'******'class', 'form-control'); $submit = new Zend_Form_Element_Submit('changepass'); $submit->setDecorators(array('ViewHelper'))->setLabel($this->translator->translate('Change Password'))->setAttrib('class', 'submit btn btn-default'); $this->addElements(array($password1, $password2, $submit)); $this->postInit(); }
public function init() { // usuario_nome $usuario_nome = new Zend_Form_Element_Text('usuario_nome'); $usuario_nome->setLabel('Nome Completo: '); $usuario_nome->setRequired(); $usuario_nome->addErrorMessages(array(Zend_Validate_NotEmpty::IS_EMPTY => "Campo obrigatório!")); $usuario_nome->setAttribs(array('class' => 'form-control', 'placeholder' => 'Informe seu nome')); $usuario_nome->setDecorators(App_Forms_Decorators::$simpleElementDecorators); // usuario_email $usuario_email = new Zend_Form_Element_Text('usuario_email'); $usuario_email->setLabel('E-mail: '); $usuario_email->addValidator(new App_Validate_UsuarioEmail()); $usuario_email->setRequired(); $usuario_email->addValidator('EmailAddress'); $usuario_email->setAttribs(array('class' => 'form-control', 'placeholder' => 'Informe seu e-mail')); $usuario_email->setDecorators(App_Forms_Decorators::$simpleElementDecorators); // usuario_cep $usuario_cep = new Zend_Form_Element_Text('usuario_cep'); $usuario_cep->setLabel('CEP: '); $usuario_cep->setRequired(); $usuario_cep->addValidator(new App_Validate_Cep()); $usuario_cep->setAttribs(array('class' => 'form-control', 'placeholder' => 'Informe seu CEP')); $usuario_cep->setDecorators(App_Forms_Decorators::$simpleElementDecorators); // usuario_senha $usuario_senha = new Zend_Form_Element_Password("usuario_senha"); $usuario_senha->setLabel("Senha: "); $usuario_senha->setRequired(); $usuario_senha->setAttribs(array('class' => 'form-control', 'placeholder' => 'Informe sua senha')); $usuario_senha->setDecorators(App_Forms_Decorators::$simpleElementDecorators); // usuario_politica_termo $usuario_politica_termo = new Zend_Form_Element_Checkbox('usuario_politica_termo'); $usuario_politica_termo->setLabel(" \n Li e concordo com a \n <a href='' data-toggle='modal' data-target='#modal-politica'>Política de Privacidade</a> e \n <a href='' data-toggle='modal' data-target='#modal-termo'>Termo de Uso</a>.\n "); $usuario_politica_termo->setDecorators(App_Forms_Decorators::$checkboxElementDecorators_termo); //$usuario_politica_termo->addDecorator(); //$usuario_politica_termo->setValue(0); //$usuario_politica_termo->setCheckedValue('') ; $usuario_politica_termo->setUnCheckedValue(''); $usuario_politica_termo->setRequired(); $usuario_politica_termo->addErrorMessage('Você precisa concordar com nossa Pólitica de Privacidade e Termo de Uso'); // captcha $captcha = new Zend_Form_Element_Captcha('captcha', array('label' => 'Informe os careacteres da imagem: ', 'class' => 'form-control', 'captcha' => array('captcha' => 'Image', 'wordLen' => 3, 'timeout' => 300, 'font' => APPLICATION_PATH . '/../public/views/fonts/Exo-SemiBold.ttf', 'imgDir' => APPLICATION_PATH . '/../public/views/captcha/', 'imgUrl' => '/../public/views/captcha/'))); $captcha->removeDecorator('ViewHelper'); $this->addElements(array($usuario_nome, $usuario_email, $usuario_cep, $usuario_senha, $usuario_politica_termo)); parent::init(); $this->getElement('submit')->setLabel('Cadastrar'); }
public function init() { // senha $senha = new Zend_Form_Element_Password('senha'); $senha->setLabel('Nova senha: '); $senha->setRequired(); $senha->setDecorators(App_Forms_Decorators::$simpleElementDecorators); $senha->setAttribs(array('class' => 'form-control', 'placeholder' => 'Informe sua nova senha')); // confirma a senha $confirma_senha = new Zend_Form_Element_Password('confirma_senha'); $confirma_senha->setLabel('Confirme a nova senha: '); $confirma_senha->setRequired(); $confirma_senha->setDecorators(App_Forms_Decorators::$simpleElementDecorators); $confirma_senha->addValidator(new App_Validate_RecuperaSenha()); $confirma_senha->setAttribs(array('class' => 'form-control', 'placeholder' => 'Confirme sua nova senha')); $this->addElements(array($senha, $confirma_senha)); parent::init(); }
/** * * Login page form * */ public function init() { $cname = explode('_', get_class()); $this->preInit(end($cname), true, false); // use template file $this->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/Login.phtml')))); // fields $name = new Zend_Form_Element_Text('name'); $name->setDecorators(array('ViewHelper', 'Errors'))->setLabel($this->translator->translate('Username or email'))->addFilter('StringToLower')->setErrorMessages(array($this->translator->translate('Enter your username or email')))->setAttrib('class', 'form-control')->setRequired(true); $password = new Zend_Form_Element_Password('password'); $password->setDecorators(array('ViewHelper', 'Errors'))->setLabel($this->translator->translate('Password'))->setErrorMessages(array($this->translator->translate('Enter your password')))->setAttrib('class', 'form-control')->setAttrib('autocomplete', 'off')->setRequired(true); $remember = new Zend_Form_Element_Checkbox('remember_me'); $remember->setDecorators(array('ViewHelper', 'Errors'))->setValue('1')->setLabel($this->translator->translate('Remember me')); $login = new Zend_Form_Element_Submit('loginbtn'); $login->setDecorators(array('ViewHelper'))->setLabel($this->translator->translate('Sign In'))->setAttrib('class', 'submit btn btn-default'); $this->addElements(array($name, $password, $login, $remember)); $this->postInit(); }
/** * * Small register form on login page * */ public function init() { $cname = explode('_', get_class()); $this->preInit(end($cname), true, false); // use template file $this->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/Register.phtml')))); $username_minchars = Zend_Registry::get('config')->get('username_minchars'); $username_maxchars = Zend_Registry::get('config')->get('username_maxchars'); // fields // lowercase, alnum without whitespaces $name = new Zend_Form_Element_Text('regname'); $name->setDecorators(array('ViewHelper', 'Errors'))->setRequired(true)->addFilter('StringToLower')->addValidator('alnum', false, array('allowWhiteSpace' => false))->addValidator('stringLength', false, array($username_minchars, $username_maxchars))->setErrorMessages(array(sprintf($this->translator->translate('Please choose a valid username between %d and %d characters'), $username_minchars, $username_maxchars)))->setAttrib('class', 'form-control alnum-only')->setLabel($this->translator->translate('Username')); $email = new Zend_Form_Element_Text('regemail'); $email->setDecorators(array('ViewHelper', 'Errors'))->addFilter('StringToLower')->setRequired(true)->addValidator('EmailAddress', true)->setLabel($this->translator->translate('Email'))->setAttrib('class', 'form-control')->setErrorMessages(array($this->translator->translate('Enter a valid email address'))); $password = new Zend_Form_Element_Password('regpassword'); $password->setDecorators(array('ViewHelper', 'Errors'))->setLabel($this->translator->translate('Password'))->setErrorMessages(array($this->translator->translate('Password is required')))->setAttrib('class', 'form-control')->setAttrib('autocomplete', 'off')->setRequired(true); $register = new Zend_Form_Element_Submit('registerbtn'); $register->setDecorators(array('ViewHelper'))->setLabel($this->translator->translate('Create Account'))->setAttrib('class', 'submit btn btn-default'); $this->addElements(array($name, $email, $password, $register)); $this->postInit(); }
public function init() { // administrador_email $administrador_email = new Zend_Form_Element_Text('administrador_email'); $administrador_email->setLabel('E-mail: '); $administrador_email->setRequired(); $administrador_email->setAttrib('class', 'form-control'); $administrador_email->setDecorators(Form_Decorators::$simpleElementDecorators); // administrador_senha $administrador_senha = new Zend_Form_Element_Password('administrador_senha'); $administrador_senha->setLabel('Senha: '); $administrador_senha->setRequired(); $administrador_senha->setAttrib('class', 'form-control'); $administrador_senha->setDecorators(Form_Decorators::$simpleElementDecorators); // submit $submit = new Zend_Form_Element_Submit('submit'); $submit->setLabel('Logar'); $submit->setAttrib('class', 'form-control btn btn-info'); // add elements $this->addElements(array($administrador_email, $administrador_senha, $submit)); }
public function init() { $url = Zend_Layout::getMvcInstance()->getView(); $this->setMethod('post'); $this->setAction($url->url(array('controller' => 'autenticacao', 'action' => 'login'), 'default', true)); // autenticacao_email $autenticacao_email = new Zend_Form_Element_Text('autenticacao_email'); $autenticacao_email->setLabel('E-mail: '); $autenticacao_email->setAttribs(array('class' => 'form-control', 'placeholder' => 'Informe seu e-mail')); $autenticacao_email->setRequired(); $autenticacao_email->setDecorators(App_Forms_Decorators::$simpleElementDecorators); $autenticacao_email->addErrorMessage("Preecnha o login"); // autenticacao_senha $autenticacao_senha = new Zend_Form_Element_Password('autenticacao_senha'); $autenticacao_senha->setLabel('Senha: '); $autenticacao_senha->setAttribs(array('class' => 'form-control', 'placeholder' => 'Informe sua senha')); $autenticacao_senha->setRequired(); $autenticacao_senha->setDecorators(App_Forms_Decorators::$simpleElementDecorators); $autenticacao_senha->addErrorMessage("Preencha a senha"); $this->addElements(array($autenticacao_email, $autenticacao_senha)); parent::init(); }
public function init() { // autenticacao_senha_atual $autenticacao_senhaAtual = new Zend_Form_Element_Password("autenticacao_senha_atual"); $autenticacao_senhaAtual->setLabel("Senha atual: "); $autenticacao_senhaAtual->setRequired(); $autenticacao_senhaAtual->setDecorators(App_Forms_Decorators::$simpleElementDecorators); $autenticacao_senhaAtual->setAttribs(array('class' => 'form-control', 'placeholder' => 'Digite a senha atual')); // autenticacao_senha $autenticacao_senha = new Zend_Form_Element_Password("autenticacao_senha"); $autenticacao_senha->setLabel("Nova Senha: "); $autenticacao_senha->setRequired(); $autenticacao_senha->setDecorators(App_Forms_Decorators::$simpleElementDecorators); $autenticacao_senha->setAttribs(array('class' => 'form-control', 'placeholder' => 'Digite a nova senha')); // autenticacao_senha_repetir $autenticacao_senha_repetir = new Zend_Form_Element_Password("autenticacao_senha_repetir"); $autenticacao_senha_repetir->setLabel("Repita a nova Senha: "); $autenticacao_senha_repetir->setRequired(); $autenticacao_senha_repetir->setDecorators(App_Forms_Decorators::$simpleElementDecorators); $autenticacao_senha_repetir->setAttribs(array('class' => 'form-control', 'placeholder' => 'Repita a nova senha')); $this->addElements(array($autenticacao_senha, $autenticacao_senha_repetir)); parent::init(); }
/** * * Mail settings * */ public function init() { $cname = explode('_', get_class()); $this->preInit(end($cname)); // use template file $this->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/Settings.phtml')))); // load settings $AppOptions = new Application_Model_AppOptions(); $all_meta = $AppOptions->getAllOptions(); // fields $mail_adapters = array('smtp' => 'smtp', 'mail' => 'php mail()'); $mail_adapter = new Zend_Form_Element_Select('mail_adapter'); $mail_adapter->setDecorators(array('ViewHelper', 'Errors'))->setMultiOptions($mail_adapters)->setLabel($this->translator->translate('Email adapter'))->setRequired(true)->setValue(isset($all_meta['mail_adapter']) ? $all_meta['mail_adapter'] : 'Zend_Mail_Transport_Smtp')->setAttrib('class', 'form-control'); $mail_host = new Zend_Form_Element_Text('mail_host'); $mail_host->setDecorators(array('ViewHelper', 'Errors'))->setLabel($this->translator->translate('(smtp) host'))->setValue(isset($all_meta['mail_host']) ? $all_meta['mail_host'] : 'example.com')->setAttrib('class', 'form-control'); $mail_port = new Zend_Form_Element_Text('mail_port'); $mail_port->setDecorators(array('ViewHelper', 'Errors'))->setLabel($this->translator->translate('(smtp) port (25/465/587)'))->setValidators(array('digits'))->setValue(isset($all_meta['mail_port']) ? $all_meta['mail_port'] : '465')->setAttrib('class', 'form-control'); $mail_login = new Zend_Form_Element_Select('mail_login'); $mail_login->setDecorators(array('ViewHelper', 'Errors'))->setMultiOptions(array('login' => 'login', '' => 'open'))->setLabel($this->translator->translate('(smtp) auth method'))->setValue(isset($all_meta['mail_login']) ? $all_meta['mail_login'] : '******')->setAttrib('class', 'form-control'); $mail_security_methods = array('ssl' => 'ssl', 'tls' => 'tls', '' => 'none'); $mail_security = new Zend_Form_Element_Select('mail_security'); $mail_security->setDecorators(array('ViewHelper', 'Errors'))->setMultiOptions($mail_security_methods)->setLabel($this->translator->translate('(smtp) security'))->setValue(isset($all_meta['mail_security']) ? $all_meta['mail_security'] : 'ssl')->setAttrib('class', 'form-control'); $mail_username = new Zend_Form_Element_Text('mail_username'); $mail_username->setDecorators(array('ViewHelper', 'Errors'))->setLabel($this->translator->translate('name'))->setValue(isset($all_meta['mail_username']) ? $all_meta['mail_username'] : '')->setAttrib('class', 'form-control'); $mail_password = new Zend_Form_Element_Password('mail_password'); $mail_password->setDecorators(array('ViewHelper', 'Errors'))->setLabel($this->translator->translate('(smtp) auth password'))->setAttrib('autocomplete', 'off')->setRenderPassword(true)->setValue(isset($all_meta['mail_password']) ? $all_meta['mail_password'] : '')->setAttrib('class', 'form-control'); $mail_username = new Zend_Form_Element_Text('mail_username'); $mail_username->setDecorators(array('ViewHelper', 'Errors'))->setLabel($this->translator->translate('(smtp) auth username'))->setValue(isset($all_meta['mail_username']) ? $all_meta['mail_username'] : '')->setAttrib('class', 'form-control'); $mail_from = new Zend_Form_Element_Text('mail_from'); $mail_from->setDecorators(array('ViewHelper', 'Errors'))->setLabel($this->translator->translate('from'))->setValue(isset($all_meta['mail_from']) ? $all_meta['mail_from'] : '')->setAttrib('class', 'form-control'); $mail_from_name = new Zend_Form_Element_Text('mail_from_name'); $mail_from_name->setDecorators(array('ViewHelper', 'Errors'))->setLabel($this->translator->translate('from name'))->setValue(isset($all_meta['mail_from_name']) ? $all_meta['mail_from_name'] : '')->setAttrib('class', 'form-control'); $submit = new Zend_Form_Element_Submit('submitbtn'); $submit->setDecorators(array('ViewHelper'))->setLabel($this->translator->translate('Update'))->setAttrib('class', 'submit btn btn-default'); $this->addElements(array($mail_adapter, $mail_from, $mail_from_name, $mail_host, $mail_port, $mail_security, $mail_login, $mail_username, $mail_password, $submit)); $this->postInit(); }
public function init() { $this->setMethod('post'); $this->setEnctype('multipart/form-data'); $this->setName('edit_profile_form'); $this->setAttrib('id', 'edit-profile-form'); $this->addElementPrefixPath('Oibs_Form_Decorator', 'Oibs/Form/Decorator/', 'decorator'); $mailvalid = new Zend_Validate_EmailAddress(); $mailvalid->setMessage('email-invalid', Zend_Validate_EmailAddress::INVALID); $mailvalid->setMessage('email-invalid-hostname', Zend_Validate_EmailAddress::INVALID_HOSTNAME); $mailvalid->setMessage('email-invalid-mx-record', Zend_Validate_EmailAddress::INVALID_MX_RECORD); $mailvalid->setMessage('email-dot-atom', Zend_Validate_EmailAddress::DOT_ATOM); $mailvalid->setMessage('email-quoted-string', Zend_Validate_EmailAddress::QUOTED_STRING); $mailvalid->setMessage('email-invalid-local-part', Zend_Validate_EmailAddress::INVALID_LOCAL_PART); $mailvalid->setMessage('email-length-exceeded', Zend_Validate_EmailAddress::LENGTH_EXCEEDED); $mailvalid->hostnameValidator->setMessage('hostname-invalid-hostname', Zend_Validate_Hostname::INVALID_HOSTNAME); $mailvalid->hostnameValidator->setMessage('hostname-local-name-not-allowed', Zend_Validate_Hostname::LOCAL_NAME_NOT_ALLOWED); $mailvalid->hostnameValidator->setMessage('hostname-unknown-tld', Zend_Validate_Hostname::UNKNOWN_TLD); $mailvalid->hostnameValidator->setMessage('hostname-invalid-local-name', Zend_Validate_Hostname::INVALID_LOCAL_NAME); $mailvalid->hostnameValidator->setMessage('hostname-undecipherable-tld', Zend_Validate_Hostname::UNDECIPHERABLE_TLD); // Clear div $clear = '<div class="clear"></div>'; // Headers $accountInformation = new Oibs_Form_Element_Note('accountinformation'); $accountInformation->setValue($clear . '<h3>Account information</h3>' . $clear); $personalInformation = new Oibs_Form_Element_Note('personalinformation'); $personalInformation->setValue('<h3>Personal Information</h3>' . $clear); $locationInformation = new Oibs_Form_Element_Note('locationinformation'); $locationInformation->setValue('<h3>Location Information</h3>' . $clear); $employmentInformation = new Oibs_Form_Element_Note('employmentinformation'); $employmentInformation->setValue('<h3>Employment Information</h3>' . $clear); $subscribeInformation = new Oibs_Form_Element_Note('subscribeinformation'); $subscribeInformation->setValue('<h3>Subscribe settings</h3>' . $clear); // Public text $publictext = 'Public'; // Username for description $auth = Zend_Auth::getInstance(); $identity = $auth->getIdentity(); $usernametext = $identity->username; $username = new Zend_Form_Element_Hidden('username'); $username->setLabel('Username')->setDescription($usernametext); $usernamepublic = new Zend_Form_Element_Hidden('username_publicity'); $usernamepublic->setLabel($publictext); $openid = new Zend_Form_Element_Text('openid'); $openid->setLabel('Open-ID')->setAttrib('id', 'open-ID')->addValidators(array(new Oibs_Validators_OpenidExists())); $openidclear = new Oibs_Form_Element_Note('openidclear'); $openidclear->setValue($clear); $password = new Zend_Form_Element_Password('password'); $password->setLabel('New password')->setAttrib('id', 'password')->addValidators(array(new Oibs_Validators_RepeatValidator('confirm_password'), array('NotEmpty', true, array('messages' => array('isEmpty' => 'Empty'))), array('StringLength', false, array(4, 22, 'messages' => array('stringLengthTooShort' => 'Password too short (4-22 characters)', 'stringLengthTooLong' => 'Password too long (4-22 characters)'))))); $passwordclear = new Oibs_Form_Element_Note('passwordclear'); $passwordclear->setValue($clear); $confirmpassword = new Zend_Form_Element_Password('confirm_password'); $confirmpassword->setLabel('Confirm password')->setAttrib('id', 'confirm-password')->addValidators(array(array('NotEmpty', true, array('messages' => array('isEmpty' => 'Empty'))), array('StringLength', false, array(4, 22, 'messages' => array('stringLengthTooShort' => 'Password too short (4-22 characters)', 'stringLengthTooLong' => 'Password too long (4-22 characters)'))))); $confirmpasswordclear = new Oibs_Form_Element_Note('confirm_passwordclear'); $confirmpasswordclear->setValue($clear); $email = new Zend_Form_Element_Text('email'); $email->setLabel('Email')->setAttrib('id', 'email')->setRequired(true)->addFilter('StringtoLower')->addValidators(array($mailvalid, array('NotEmpty', true, array('messages' => array('isEmpty' => 'Email empty'))), array('StringLength', false, array(6, 50, 'messages' => array('stringLengthTooShort' => 'Email too short (6-50 characters)', 'stringLengthTooLong' => 'Email too long (6-50 characters)'))))); $emailclear = new Oibs_Form_Element_Note('emailclear'); $emailclear->setValue($clear); $gravatar = new Zend_Form_Element_Hidden('gravatartext'); $gravatar->setLabel('Gravatar')->setDescription('<div style="text-align: right;">Enable <a href="http://www.gravatar.com">gravatar</a></div>'); $gravatarcheck = new Zend_Form_Element_Checkbox('gravatar'); $phone = new Zend_Form_Element_Text('phone'); $phone->setLabel('Phone')->setAttrib('id', 'phone'); $phonepublic = new Zend_Form_Element_Checkbox('phone_publicity'); $phonepublic->setLabel($publictext); $firstname = new Zend_Form_Element_Text('firstname'); $firstname->setLabel('First name')->setAttrib('id', 'first-name'); $firstnamepublic = new Zend_Form_Element_Checkbox('firstname_publicity'); $firstnamepublic->setLabel($publictext); // DB: surname $lastname = new Zend_Form_Element_Text('surname'); $lastname->setLabel('Last name')->setAttrib('id', 'last-name'); $lastnamepublic = new Zend_Form_Element_Checkbox('surname_publicity'); $lastnamepublic->setLabel($publictext); $gender = new Zend_Form_Element_Select('gender'); $gender->setLabel('Gender')->setAttrib('id', 'gender')->addMultiOptions(array('Select', 'Male', 'Female')); $genderpublic = new Zend_Form_Element_Checkbox('gender_publicity'); $genderpublic->setLabel($publictext); $birthday = new Zend_Form_Element_Text('birthday'); $birthday->setLabel('Date of Birth')->setAttrib('id', 'birthday')->setValidators(array(new Zend_Validate_Date('birthday'))); $birthdaypublic = new Zend_Form_Element_Checkbox('birthday_publicity'); $birthdaypublic->setLabel($publictext); $biography = new Zend_Form_Element_Textarea('biography'); $biography->setLabel('Biography')->setAttrib('id', 'biography')->setAttrib('rows', 30)->setAttrib('cols', 45)->addValidators(array(array('StringLength', false, array(0, 4000, 'messages' => array('stringLengthTooLong' => 'Biography too long'))))); //->setDescription('<div id="progressbar_biography" class="progress_ok"></div>'); $biographypublic = new Zend_Form_Element_Checkbox('biography_publicity'); $biographypublic->setLabel($publictext); $intereststext = new Oibs_Form_Element_Note('intereststext'); $intereststext->setValue('<div class="input-column1"></div>' . '<div class="input-column2 help">(Use commas to separate tags)</div><div class="clear"></div>'); $interests = new Zend_Form_Element_Text('interests'); $interests->setLabel('My interest (tags)')->setAttrib('id', 'interests'); $interestsclear = new Oibs_Form_Element_Note('interestsclear'); $interestsclear->setValue($clear); $weblinks_websites = new Oibs_Form_Element_Note('weblinks_websites'); $weblinks_websites->setValue('<div class="input-column-website1"><label><strong>Links to my websites:</strong></label></div>'); $weblinks_name = new Oibs_Form_Element_Note('weblinks_name'); $weblinks_name->setValue('<div class="input-column-website2">Name</div>'); $weblinks_url = new Oibs_Form_Element_Note('weblinks_url'); $weblinks_url->setValue('<div class="input-column-website3">Url</div><div class="clear"></div>'); $nameTooLongText = 'Name too long (max 45)'; $urlTooLongText = 'URL too long (max 150)'; $weblinks_name_site1 = new Zend_Form_Element_Text('weblinks_name_site1'); $weblinks_name_site1->setLabel('Web site 1')->setAttrib('id', 'website1-name')->addValidators(array(array('StringLength', false, array(0, 45, 'messages' => array('stringLengthTooLong' => $nameTooLongText))))); $weblinks_url_site1 = new Zend_Form_Element_Text('weblinks_url_site1'); $weblinks_url_site1->setAttrib('id', 'website1-url')->addValidators(array(new Oibs_Validators_UrlValidator(), array('StringLength', false, array(0, 150, 'messages' => array('stringLengthTooLong' => $urlTooLongText))))); $weblinks_name_site2 = new Zend_Form_Element_Text('weblinks_name_site2'); $weblinks_name_site2->setLabel('Web site 2')->setAttrib('id', 'website2-name')->addValidators(array(array('StringLength', false, array(0, 45, 'messages' => array('stringLengthTooLong' => $nameTooLongText))))); $weblinks_url_site2 = new Zend_Form_Element_Text('weblinks_url_site2'); $weblinks_url_site2->setAttrib('id', 'website2-url')->addValidators(array(new Oibs_Validators_UrlValidator(), array('StringLength', false, array(0, 150, 'messages' => array('stringLengthTooLong' => $urlTooLongText))))); $weblinks_name_site3 = new Zend_Form_Element_Text('weblinks_name_site3'); $weblinks_name_site3->setLabel('Web site 3')->setAttrib('id', 'website3-name')->setAttrib('id', 'website2-name')->addValidators(array(array('StringLength', false, array(0, 45, 'messages' => array('stringLengthTooLong' => $nameTooLongText))))); $weblinks_url_site3 = new Zend_Form_Element_Text('weblinks_url_site3'); $weblinks_url_site3->setAttrib('id', 'website3-url')->addValidators(array(new Oibs_Validators_UrlValidator(), array('StringLength', false, array(0, 150, 'messages' => array('stringLengthTooLong' => $urlTooLongText))))); $weblinks_name_site4 = new Zend_Form_Element_Text('weblinks_name_site4'); $weblinks_name_site4->setLabel('Web site 4')->setAttrib('id', 'website4-name')->setAttrib('id', 'website2-name')->addValidators(array(array('StringLength', false, array(0, 45, 'messages' => array('stringLengthTooLong' => $nameTooLongText))))); $weblinks_url_site4 = new Zend_Form_Element_Text('weblinks_url_site4'); $weblinks_url_site4->setAttrib('id', 'website4-url')->addValidators(array(new Oibs_Validators_UrlValidator(), array('StringLength', false, array(0, 150, 'messages' => array('stringLengthTooLong' => $urlTooLongText))))); $weblinks_name_site5 = new Zend_Form_Element_Text('weblinks_name_site5'); $weblinks_name_site5->setLabel('Web site 5')->setAttrib('id', 'website5-name')->setAttrib('id', 'website2-name')->addValidators(array(array('StringLength', false, array(0, 45, 'messages' => array('stringLengthTooLong' => $nameTooLongText))))); $weblinks_url_site5 = new Zend_Form_Element_Text('weblinks_url_site5'); $weblinks_url_site5->setAttrib('id', 'website5-url')->addValidators(array(new Oibs_Validators_UrlValidator(), array('StringLength', false, array(0, 150, 'messages' => array('stringLengthTooLong' => $urlTooLongText))))); $languages = new Default_Model_Languages(); $allLanguages = $languages->getAllNamesAndIds(); $userlanguage = new Zend_Form_Element_Select('userlanguage'); $userlanguage->setLabel('User interface language')->setAttrib('id', 'user-interface-language')->addMultiOption('', 'Select'); foreach ($allLanguages as $language) { $userlanguage->addMultiOption($language['id_lng'], $language['name_lng']); } $userlanguageclear = new Oibs_Form_Element_Note('userlanguageclear'); $userlanguageclear->setValue($clear); /* $avatar = new Zend_Form_Element_File('avatar'); $avatar->setLabel('Avatar image'); */ // DB: city $hometown = new Zend_Form_Element_Text('city'); $hometown->setLabel('Hometown')->setAttrib('id', 'hometown')->setRequired(true)->addValidators(array(array('NotEmpty', true, array('messages' => array('isEmpty' => 'Hometown empty'))), array('Regex', true, array('/^[\\p{L}0-9.\\- ]*$/')))); $hometownpublic = new Zend_Form_Element_Checkbox('city_publicity'); $hometownpublic->setLabel($publictext); $hometownpublic->helper = 'FormHidden'; $address = new Zend_Form_Element_Text('address'); $address->setLabel('Address')->setAttrib('id', 'address'); $addresspublic = new Zend_Form_Element_Checkbox('address_publicity'); $addresspublic->setLabel($publictext)->setAttrib('checked', 'checked')->setValue(1); $addresspublic->helper = 'FormHidden'; $country_model = new Default_Model_Countries(); $allCountries = $country_model->getAllCountries(); $usercountry = new Zend_Form_Element_Select('country'); $usercountry->setLabel('Country of Residence')->setAttrib('id', 'country')->addMultiOption('', 'Select'); foreach ($allCountries as $country) { $usercountry->addMultiOption($country['iso_ctr'], $country['printable_name_ctr']); } $usercountrypublic = new Zend_Form_Element_Checkbox('country_publicity'); $usercountrypublic->setLabel($publictext); $timezone_model = new Default_Model_Timezones(); $allTimezones = $timezone_model->getAllTimezones(); $usertimezone = new Zend_Form_Element_Select('usertimezone'); $usertimezone->setLabel('Time Zone')->setAttrib('id', 'time-zone')->addMultiOption('', 'Select'); foreach ($allTimezones as $timezone) { $usertimezone->addMultiOption($timezone['id_tmz'], $timezone['gmt_tmz'] . ' ' . $timezone['timezone_location_tmz']); } $usertimezonepublic = new Zend_Form_Element_Checkbox('usertimezone_publicity'); $usertimezonepublic->setLabel($publictext); $userProfilesModel = new Default_Model_UserProfiles(); $employments = $userProfilesModel->getEmployments(); $employments = array_merge(array('' => 'Select'), $employments); $employment = new Zend_Form_Element_Select('employment'); $employment->setLabel('I am currently')->setAttrib('id', 'status')->setRequired(true)->addMultiOptions($employments)->setErrorMessages(array('Select status')); $employmentpublic = new Zend_Form_Element_Checkbox('employment_publicity'); $employmentpublic->setLabel($publictext); // DB: company $employer_organization = new Zend_Form_Element_Text('company'); $employer_organization->setLabel('Employer / Organization')->setAttrib('id', 'employer-organization'); $employer_organizationpublic = new Zend_Form_Element_Checkbox('company_publicity'); $employer_organizationpublic->setLabel($publictext); //Subscribe things $favouritesModel = new Default_Model_UserHasFavourites(); $subscribeOptions = $favouritesModel->getFollows(); unset($subscribeOptions['8']); //Unsetting the translation box till its in use. //print_r($subscribeOptions);die; $test = new Zend_Form_Element_MultiCheckbox('lol'); //$test->setV $subscribeClasses = array("own_follows" => "Own contents", "fvr_follows" => "Favourite contents"); foreach ($subscribeClasses as $key => $value) { $subscribe[$key] = new Zend_Form_Element_MultiCheckbox($key); $subscribe[$key]->setLabel('Activities you want to follow in your ' . $value); $subscribe[$key]->addMultiOptions($subscribeOptions); } $subscribeclear = new Oibs_Form_Element_Note('subscribeclear'); $subscribeclear->setValue($clear); $save = new Zend_Form_Element_Submit('save'); $save->setLabel('Save profile')->setAttrib('id', 'save-profile')->setAttrib('class', 'submit-button'); $cancel = new Zend_Form_Element_Submit('cancel'); $cancel->setLabel('Cancel')->setAttrib('id', 'cancel')->setAttrib('class', 'submit-button'); $this->addElements(array($accountInformation, $username, $usernamepublic, $openid, $openidclear, $password, $passwordclear, $confirmpassword, $confirmpasswordclear, $personalInformation, $email, $emailclear, $gravatar, $gravatarcheck, $phone, $phonepublic, $firstname, $firstnamepublic, $lastname, $lastnamepublic, $gender, $genderpublic, $birthday, $birthdaypublic, $biography, $biographypublic, $weblinks_websites, $weblinks_name, $weblinks_url, $weblinks_name_site1, $weblinks_url_site1, $weblinks_name_site2, $weblinks_url_site2, $weblinks_name_site3, $weblinks_url_site3, $weblinks_name_site4, $weblinks_url_site4, $weblinks_name_site5, $weblinks_url_site5, $userlanguage, $userlanguageclear, $locationInformation, $hometown, $hometownpublic, $address, $addresspublic, $usercountry, $usercountrypublic, $usertimezone, $usertimezonepublic, $employmentInformation, $employment, $employmentpublic, $employer_organization, $employer_organizationpublic, $save, $cancel)); $accountInformation->setDecorators(array('ViewHelper')); $personalInformation->setDecorators(array('ViewHelper')); $locationInformation->setDecorators(array('ViewHelper')); $employmentInformation->setDecorators(array('ViewHelper')); $subscribeInformation->setDecorators(array('ViewHelper')); $username->setDecorators(array('InputDecorator')); $usernamepublic->setDecorators(array('PublicDecorator')); $openid->setDecorators(array('InputDecorator')); $openidclear->setDecorators(array('ViewHelper')); $password->setDecorators(array('InputDecorator')); $passwordclear->setDecorators(array('ViewHelper')); $confirmpassword->setDecorators(array('InputDecorator')); $confirmpasswordclear->setDecorators(array('ViewHelper')); $email->setDecorators(array('InputDecorator')); $emailclear->setDecorators(array('ViewHelper')); $gravatar->setDecorators(array('InputDecorator')); $gravatarcheck->setDecorators(array('PublicDecorator')); $phone->setDecorators(array('InputDecorator')); $phonepublic->setDecorators(array('PublicDecorator')); $firstname->setDecorators(array('InputDecorator')); $firstnamepublic->setDecorators(array('PublicDecorator')); $lastname->setDecorators(array('InputDecorator')); $lastnamepublic->setDecorators(array('PublicDecorator')); $gender->setDecorators(array('InputDecorator')); $genderpublic->setDecorators(array('PublicDecorator')); $birthday->setDecorators(array('InputDecorator')); $birthdaypublic->setDecorators(array('PublicDecorator')); $biography->setDecorators(array('InputDecorator')); $biographypublic->setDecorators(array('PublicDecorator')); $intereststext->setDecorators(array('ViewHelper')); $interests->setDecorators(array('InputDecorator')); $interestsclear->setDecorators(array('ViewHelper')); $weblinks_websites->setDecorators(array('ViewHelper')); $weblinks_name->setDecorators(array('ViewHelper')); $weblinks_url->setDecorators(array('ViewHelper')); $weblinks_name_site1->setDecorators(array('InputWebsiteNameDecorator')); $weblinks_url_site1->setDecorators(array('InputWebsiteUrlDecorator')); $weblinks_name_site2->setDecorators(array('InputWebsiteNameDecorator')); $weblinks_url_site2->setDecorators(array('InputWebsiteUrlDecorator')); $weblinks_name_site3->setDecorators(array('InputWebsiteNameDecorator')); $weblinks_url_site3->setDecorators(array('InputWebsiteUrlDecorator')); $weblinks_name_site4->setDecorators(array('InputWebsiteNameDecorator')); $weblinks_url_site4->setDecorators(array('InputWebsiteUrlDecorator')); $weblinks_name_site5->setDecorators(array('InputWebsiteNameDecorator')); $weblinks_url_site5->setDecorators(array('InputWebsiteUrlDecorator')); $userlanguage->setDecorators(array('InputDecorator')); $userlanguageclear->setDecorators(array('ViewHelper')); $hometown->setDecorators(array('InputDecorator')); $hometownpublic->setDecorators(array('PublicDecorator')); $address->setDecorators(array('InputDecorator')); $addresspublic->setDecorators(array('PublicDecorator')); $usercountry->setDecorators(array('InputDecorator')); $usercountrypublic->setDecorators(array('PublicDecorator')); $usertimezone->setDecorators(array('InputDecorator')); $usertimezonepublic->setDecorators(array('PublicDecorator')); $employment->setDecorators(array('InputDecorator')); $employmentpublic->setDecorators(array('PublicDecorator')); $employer_organization->setDecorators(array('InputDecorator')); $employer_organizationpublic->setDecorators(array('PublicDecorator')); $subscribe['own_follows']->setDecorators(array('InputDecorator')); $subscribe['fvr_follows']->setDecorators(array('InputDecorator')); $subscribeclear->setDecorators(array('ViewHelper')); $save->setDecorators(array('ViewHelper', array('HtmlTag', array('tag' => 'div', 'openOnly' => true, 'id' => 'save_changes')))); $cancel->setDecorators(array('ViewHelper', array('HtmlTag', array('tag' => 'div', 'closeOnly' => true)))); $this->setDecorators(array('FormElements', 'Form')); }
public function init() { /** * salao_cnpj */ $salao_cnpj = new Zend_Form_Element_Text("salao_cnpj"); $salao_cnpj->setLabel("CNPJ: "); $salao_cnpj->setRequired(); $salao_cnpj->addValidator(new App_Validate_Cnpj()); $salao_cnpj->setAttribs(array('class' => 'form-control', 'placeholder' => 'Informe o CNPJ')); $salao_cnpj->setDecorators(App_Forms_Decorators::$simpleElementDecorators); /** * salao_salao */ $salao_salao = new Zend_Form_Element_Text('salao_nome'); $salao_salao->setLabel('Nome do Salão: '); $salao_salao->setAttribs(array('class' => 'form-control', 'placeholder' => 'Informe o nome do salão')); $salao_salao->setRequired(); $salao_salao->addErrorMessages(array(Zend_Validate_NotEmpty::IS_EMPTY => "Campo obrigatório!")); $salao_salao->setDecorators(App_Forms_Decorators::$simpleElementDecorators); /** * salao_nome */ $salao_nome = new Zend_Form_Element_Text('salao_proprietario'); $salao_nome->setLabel('Nome Proprietário: '); $salao_nome->setAttribs(array('class' => 'form-control', 'placeholder' => 'Informe o nome do proprietário')); $salao_nome->setRequired(); $salao_nome->addErrorMessages(array(Zend_Validate_NotEmpty::IS_EMPTY => "Campo obrigatório!")); $salao_nome->setDecorators(App_Forms_Decorators::$simpleElementDecorators); /** * salao_email */ $salao_email = new Zend_Form_Element_Text('salao_email'); $salao_email->setLabel('E-mail: '); $salao_email->setAttribs(array('class' => 'form-control', 'placeholder' => 'Informe o e-mail de contato')); $salao_email->setRequired(); $salao_email->addValidator(new App_Validate_Salao()); $salao_email->setDecorators(App_Forms_Decorators::$simpleElementDecorators); /** * senha */ $senha = new Zend_Form_Element_Password('senha'); $senha->setLabel("Senha: "); $senha->setAttribs(array('class' => 'form-control', 'placeholder' => 'Informe a senha')); $senha->setRequired(); $senha->setDecorators(App_Forms_Decorators::$simpleElementDecorators); /** * salao_contato */ $salao_contato = new Zend_Form_Element_Text('salao_contato'); $salao_contato->setLabel('Telefone: '); $salao_contato->setAttribs(array('class' => 'form-control', 'placeholder' => 'Informe um telefone de contato')); $salao_contato->setRequired(); $salao_contato->addErrorMessages(array(Zend_Validate_NotEmpty::IS_EMPTY => "Campo obrigatório!")); $salao_contato->setDecorators(App_Forms_Decorators::$simpleElementDecorators); /** * profisional_cep */ $salao_cep = new Zend_Form_Element_Text('salao_cep'); $salao_cep->setLabel('CEP: '); $salao_cep->setAttribs(array('class' => 'form-control', 'placeholder' => 'Informe o cep do salão')); $salao_cep->setRequired(); $salao_cep->addValidator(new App_Validate_Cep()); $salao_cep->setDecorators(App_Forms_Decorators::$simpleElementDecorators); /** * profisional_logradouro */ $salao_logradouro = new Zend_Form_Element_Text('salao_logradouro'); $salao_logradouro->setLabel("Logradouro: "); $salao_logradouro->setAttribs(array('class' => 'form-control', 'placeholder' => 'Informe o logradouro', 'readonly' => true)); $salao_logradouro->setRequired(); $salao_logradouro->addErrorMessages(array(Zend_Validate_NotEmpty::IS_EMPTY => "Campo obrigatório!")); $salao_logradouro->setDecorators(App_Forms_Decorators::$simpleElementDecorators); //$salao_logradouro->setOrder(7); /** * sala_numero */ $salao_numero = new Zend_Form_Element_Text('salao_numero'); $salao_numero->setLabel('Número: '); $salao_numero->setAttribs(array('class' => 'form-control', 'placeholder' => 'Informe o numero')); $salao_numero->setDecorators(App_Forms_Decorators::$simpleElementDecorators); $salao_numero->setRequired(); $salao_numero->addErrorMessages(array(Zend_Validate_NotEmpty::IS_EMPTY => "Campo obrigatório!")); /** * sala_complemento */ $salao_complemento = new Zend_Form_Element_Text('salao_complemento'); $salao_complemento->setLabel('Complemento: '); $salao_complemento->setAttribs(array('class' => 'form-control', 'placeholder' => 'Informe o complemento')); //$salao_complemento->setRequired(); /** * profisional_bairro */ $salao_bairro = new Zend_Form_Element_Text('salao_bairro'); $salao_bairro->setLabel("Bairro: "); $salao_bairro->setAttribs(array('class' => 'form-control', 'placeholder' => 'Informe o bairro', 'readonly' => true)); $salao_bairro->setDecorators(App_Forms_Decorators::$simpleElementDecorators); $salao_bairro->setRequired(); $salao_bairro->addErrorMessages(array(Zend_Validate_NotEmpty::IS_EMPTY => "Campo obrigatório!")); /** * profisional_cidade */ $salao_cidade = new Zend_Form_Element_Text('salao_cidade'); $salao_cidade->setLabel('Cidade: '); $salao_cidade->setAttribs(array('class' => 'form-control', 'placeholder' => 'Informe a cidade', 'readonly' => true)); $salao_cidade->setDecorators(App_Forms_Decorators::$simpleElementDecorators); $salao_cidade->setRequired(); $salao_cidade->addErrorMessages(array(Zend_Validate_NotEmpty::IS_EMPTY => "Campo obrigatório!")); /** * estado_id */ $formEstado = new App_Forms_Estado("estado_id"); $estado_id = $formEstado->elementEstado(); $estado_id->setLabel('Estado: '); $estado_id->setDecorators(App_Forms_Decorators::$simpleElementDecorators); $estado_id->setRequired(); $estado_id->addErrorMessages(array(Zend_Validate_NotEmpty::IS_EMPTY => "Campo obrigatório!")); $estado_id->setAttribs(array('class' => 'form-control', 'placeholder' => 'Informe o estado', 'readonly' => true)); /** * salao_cupom */ $salao_cupom = new Zend_Form_Element_Text('salao_cupom'); $salao_cupom->setLabel('Cupom Promocional: '); $salao_cupom->setAttribs(array('class' => 'form-control', 'placeholder' => 'Tem cupom promocional?')); $salao_cupom->setDecorators(App_Forms_Decorators::$simpleElementDecorators); // salao_politica_termo $salao_politica_termo = new Zend_Form_Element_Checkbox('salao_politica_termo'); $salao_politica_termo->setLabel(" \n Li e concordo com a \n <a href='' data-toggle='modal' data-target='#modal-politica'>Política de Privacidade</a> e \n <a href='' data-toggle='modal' data-target='#modal-termo'>Termo de Uso</a>.\n "); $salao_politica_termo->setDecorators(App_Forms_Decorators::$checkboxElementDecorators_termo); //$salao_politica_termo->addDecorator(); //$salao_politica_termo->setValue(0); //$salao_politica_termo->setCheckedValue('') ; $salao_politica_termo->setUnCheckedValue(''); $salao_politica_termo->setRequired(); $salao_politica_termo->addErrorMessage('Você precisa concordar com nossa Pólitica de Privacidade e Termo de Uso'); /** * Add elements */ $this->addElements(array($salao_salao, $salao_nome, $salao_contato, $salao_email, $senha, $salao_cep, $salao_logradouro, $salao_numero, $salao_complemento, $salao_bairro, $salao_cidade, $estado_id, $salao_cupom, $salao_politica_termo)); parent::init(); $this->getElement('submit')->setLabel('Cadastrar'); }
public function __construct($options = null) { parent::__construct($options); $translate = Zend_Registry::get('Zend_Translate'); $this->removeDecorator('DtDdWrapper'); $this->setName('register_form'); $this->setAttrib('id', 'register_form'); $this->addElementPrefixPath('Oibs_Decorators', 'Oibs/Decorators/', 'decorator'); $this->addElementPrefixPath('Oibs_Validators', 'OIBS/Validators/', 'validate'); $city = new Zend_Form_Element_Text('city'); $city->setLabel($translate->_("account-register-city"))->setRequired(true)->addValidators(array(array('NotEmpty', true, array('messages' => array('isEmpty' => 'field-empty'))), array('Regex', true, array('/^[\\p{L}0-9.\\- ]*$/'))))->setDecorators(array('RegistrationDecorator')); $mailvalid = new Zend_Validate_EmailAddress(); $mailvalid->setMessage('email-invalid', Zend_Validate_EmailAddress::INVALID); $mailvalid->setMessage('email-invalid-hostname', Zend_Validate_EmailAddress::INVALID_HOSTNAME); $mailvalid->setMessage('email-invalid-mx-record', Zend_Validate_EmailAddress::INVALID_MX_RECORD); $mailvalid->setMessage('email-dot-atom', Zend_Validate_EmailAddress::DOT_ATOM); $mailvalid->setMessage('email-quoted-string', Zend_Validate_EmailAddress::QUOTED_STRING); $mailvalid->setMessage('email-invalid-local-part', Zend_Validate_EmailAddress::INVALID_LOCAL_PART); $mailvalid->setMessage('email-length-exceeded', Zend_Validate_EmailAddress::LENGTH_EXCEEDED); $mailvalid->hostnameValidator->setMessage('hostname-invalid-hostname', Zend_Validate_Hostname::INVALID_HOSTNAME); $mailvalid->hostnameValidator->setMessage('hostname-local-name-not-allowed', Zend_Validate_Hostname::LOCAL_NAME_NOT_ALLOWED); $mailvalid->hostnameValidator->setMessage('hostname-unknown-tld', Zend_Validate_Hostname::UNKNOWN_TLD); $mailvalid->hostnameValidator->setMessage('hostname-invalid-local-name', Zend_Validate_Hostname::INVALID_LOCAL_NAME); $mailvalid->hostnameValidator->setMessage('hostname-undecipherable-tld', Zend_Validate_Hostname::UNDECIPHERABLE_TLD); $email = new Zend_Form_Element_Text('email'); $email->setLabel($translate->_("account-register-email"))->setRequired(true)->addFilter('StringtoLower')->addValidators(array($mailvalid))->addErrorMessage('email-invalid')->setDecorators(array('RegistrationDecorator')); $e_options = array("" => "account-select", "private_sector" => "account-register_private_sector", "public_sector" => "account-register_public_sector", "education_sector" => "account-register_education_sector", "student" => "account-register_student", "pentioner" => "account-register_pentioner", "other" => "account-register_other"); $employment = new Zend_Form_Element_Select('employment'); $employment->setLabel($translate->_("account-register-employment"))->setRequired(true)->addValidators(array(array('NotEmpty', true, array('messages' => array('isEmpty' => 'field-empty')))))->addMultiOptions($e_options)->setDecorators(array('RegistrationDecorator')); $username = new Zend_Form_Element_Text('username'); $username->setLabel($translate->_("account-register-username"))->setRequired(true)->addValidators(array(array('NotEmpty', true, array('messages' => array('isEmpty' => 'field-empty'))), array('StringLength', false, array(4, 16, 'messages' => array('stringLengthTooShort' => 'field-too-short', 'stringLengthTooLong' => 'field-too-long'))), new Oibs_Validators_UsernameExists('username'), new Oibs_Validators_Username('username')))->setDecorators(array('RegistrationDecorator')); $password = new Zend_Form_Element_Password('password'); $password->setLabel($translate->_("account-register-password")); $password->setRequired(true); $password->addValidators(array(new Oibs_Validators_RepeatValidator('confirm_password'), array('NotEmpty', true, array('messages' => array('isEmpty' => 'field-empty'))), array('StringLength', false, array(4, 16, 'messages' => array('stringLengthTooShort' => 'field-too-short', 'stringLengthTooLong' => 'field-too-long'))))); $password->setDecorators(array('RegistrationDecorator')); $confirm_password = new Zend_Form_Element_Password('confirm_password'); $confirm_password->setLabel($translate->_("account-register-password_confirm")); $confirm_password->setRequired(true); $confirm_password->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'field-empty'))); $confirm_password->addValidator('StringLength', false, array(4, 16, 'messages' => array('stringLengthTooShort' => 'field-too-short', 'stringLengthTooLong' => 'field-too-long'))); $confirm_password->setDecorators(array('RegistrationDecorator')); $captcha = new Zend_Form_Element('captcha'); $captcha->setDecorators(array('CaptchaDecorator')); $captcha_text = new Zend_Form_Element_Text('captcha_text'); $captcha_text->setLabel($translate->_("account-register-enter_text"))->addValidators(array(new Oibs_Validators_CaptchaValidator(), array('NotEmpty', true, array('messages' => array('isEmpty' => 'field-empty')))))->setRequired(true)->setDecorators(array('RegistrationDecorator')); $text = sprintf($translate->_("account-register-terms_and_privacy"), "terms", "privacy"); // this solution sucks. the codes are in the translate block directly. // anyone think of a fix to move codes out of there? // - Joel $terms = new Zend_Form_Element_Checkbox('terms'); $terms->setDescription($text)->setLabel("account-register-terms")->setChecked(false)->setRequired(true)->addValidators(array(new Oibs_Validators_CheckboxValidator()))->setDecorators(array('RegistrationTermsDecorator')); // checkboxes always have a value of 1or0, this is a "feature" in ZF // custom validator is a workaround // -Joel $submit = new Zend_Form_Element_Submit('submit'); $submit->setLabel($translate->_("account-register-submit"))->removeDecorator('DtDdWrapper')->setDecorators(array('ViewHelper', array('HtmlTag', array('tag' => 'div', 'class' => 'registration_submit_div'))))->setAttrib('class', 'registration_form_submit_' . $translate->getLocale()); $this->addElements(array($username, $password, $confirm_password, $city, $email, $employment, $captcha, $captcha_text, $terms, $submit)); /*$this->addDisplayGroup(array('username', 'password', 'confirm_password'), 'account_information'); $this->account_information->setLegend('register-account-information'); $this->account_information->removeDecorator('DtDdWrapper'); $this->addDisplayGroup(array('city', 'email', 'employment'), 'personal_information'); $this->personal_information->removeDecorator('DtDdWrapper'); $this->personal_information->setLegend('register-personal-information'); $this->addDisplayGroup(array('captcha', 'captcha_text', 'terms', 'submit'), 'confirmations'); $this->confirmations->removeDecorator('DtDdWrapper'); $this->confirmations->setLegend('register-confirmations');*/ }
public function getForm($data, $protection = 0) { $elementDecorators = array(array('Label'), array('ViewHelper'), array('Errors')); $form = new Zend_Form(); $form->setAction('/user/registration/first-form/')->setMethod('post'); //firstname field $firstName = new Zend_Form_Element_Text('firstname', array('maxLength' => '30', 'id' => 'name', 'validators' => array(array('stringLength', false, array(3, 100)), array('Alpha')))); if (isset($data['u_name'])) { $firstName->setValue($data['u_name']); } if ($protection) { $firstName->setAttrib('readonly', 'true'); } $firstName->setDecorators($elementDecorators); //lastname field $lastName = new Zend_Form_Element_Text('lastname', array('maxLength' => '30', 'id' => 'lname', 'validators' => array(array('stringLength', false, array(3, 100)), array('Alpha')))); $lastName->setDecorators($elementDecorators); if (isset($data['u_family_name'])) { $lastName->setValue($data['u_family_name']); } if ($protection) { $lastName->setAttrib('readonly', 'true'); } //selecting gender: Male (1) or Female (0) $gender = new Zend_Form_Element_Radio('sex', array('separator' => '', 'multiOptions' => array('1' => 'זכר ', '0' => 'נקבה'))); $gender->setDecorators($elementDecorators); $gender->setValue($data['u_sex_id']); if (isset($data['u_sex_id'])) { $gender->setValue($data['u_sex_id']); } if ($protection) { $gender->setAttrib('readonly', 'true'); } //birthday field: validation for yyyy-mm-dd input $birthday = new Zend_Form_Element_Text('datepicker', array('size' => 10)); $birthday->setDecorators($elementDecorators); if (isset($data['u_date_of_birth'])) { $birthday->setValue(date("d/m/Y", strtotime($data['u_date_of_birth']))); } if ($protection) { $birthday->setAttrib('readonly', 'true'); } //heigth $heigth = new Zend_Form_Element_Select('heigth', array()); for ($i = 120; $i <= 300; $i++) { $heigth->addMultiOption($i, $i); } $heigth->setDecorators($elementDecorators); if (isset($data['uht_height'])) { $heigth->setValue($data['uht_height']); } if ($protection) { $heigth->setAttrib('disabled', 'true'); } //weight $weight = new Zend_Form_Element_Select('weight', array('label' => '')); for ($i = 20; $i <= 300; $i++) { $weight->addMultiOption($i, $i); } $weight->setDecorators($elementDecorators); if (isset($data['uht_weight'])) { $weight->setValue($data['uht_weight']); } //email field with validation $email = new Zend_Form_Element_Text('email', array()); $email->addValidator(new Zend_Validate_EmailAddress()); $email->setDecorators($elementDecorators); if (isset($data['u_email'])) { $email->setValue($data['u_email']); } if ($protection) { $email->setAttrib('readonly', 'true'); } // password field $password1 = new Zend_Form_Element_Password('password1', array('id' => 'pass')); $password1->setDecorators($elementDecorators); // password confirmation field $password2 = new Zend_Form_Element_Password('password2', array('id' => 'c_pass')); $password2->addValidator(new User_Form_UserFirstFormPasswordValidator('password1')); $password2->setDecorators($elementDecorators); $state = new Zend_Form_Element_Select('state', array('requred' => true)); $state->setMultiOptions(array('1' => 'מדינה:')); $state->setDecorators($elementDecorators); if (isset($data['u_state'])) { $state->setValue($data['u_state']); } $address = new Zend_Form_Element_Text('address', array('required' => false, 'id' => 'full_adr')); $address->setDecorators($elementDecorators); if (isset($data['u_address'])) { $address->setValue($data['u_address']); } $pregnant = new Zend_Form_Element_Radio('pregnant', array('separator' => '', 'multioptions' => array('Yes' => 'לא', 'No' => 'כן'))); $pregnant->setDecorators($elementDecorators); if ($data['uht_pregnant']) { $pregnant->setValue($data['uht_pregnant']); } $pregnantSince = new Zend_Form_Element_Select('pregnantsince', array('id' => 'hz1')); $pregnantSince->setMultiOptions(array('1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5', '6' => '6', '7' => '7', '8' => '8', '9' => '9')); $pregnantSince->setDecorators($elementDecorators); if ($data['uht_pregnant']) { $pregnant->setValue($data['uht_pregnant']); } if ($data['uht_pregnant_since']) { $pregnantSince->setValue($data['uht_pregnant_since']); } $objectives = new Zend_Form_Element_Textarea('objectives', array('id' => 'obj', 'rows' => '20', 'cols' => '20')); if ($data['u_objectives']) { $objectives->setValue($data['u_objectives']); } $terms = new Zend_Form_Element_Checkbox('terms', array('required' => 'true,')); $heartPressure = new Zend_Form_Element_Checkbox('heartpressure', array()); $heartPressure->setDecorators($elementDecorators); if ($data['uht_heart_or_pb']) { $heartPressure->setChecked(true); } $diabetes = new Zend_Form_Element_Checkbox('diabetes', array()); $diabetes->setDecorators($elementDecorators); if ($data['uht_diabetes']) { $diabetes->setChecked(true); } $migrene = new Zend_Form_Element_Checkbox('migrene', array()); $migrene->setDecorators($elementDecorators); if ($data['uht_migrene']) { $migrene->setChecked(true); } $babies = new Zend_Form_Element_Checkbox('babies', array()); $babies->setDecorators($elementDecorators); if ($data['uht_babies']) { $babies->setChecked(true); } $nosleep = new Zend_Form_Element_Checkbox('nosleep', array()); $nosleep->setDecorators($elementDecorators); if ($data['uht_nosleep']) { $nosleep->setChecked(true); } $digestion = new Zend_Form_Element_Checkbox('digestion', array()); $digestion->setDecorators($elementDecorators); if ($data['uht_digestion']) { $digestion->setChecked(true); } $menopause = new Zend_Form_Element_Checkbox('menopause', array()); $menopause->setDecorators($elementDecorators); if ($data['uht_menopause']) { $menopause->setChecked(true); } $sclorosies = new Zend_Form_Element_Checkbox('sclorosies', array()); $sclorosies->setDecorators($elementDecorators); if ($data['uht_sclorosies']) { $sclorosies->setChecked(true); } $epilepsy = new Zend_Form_Element_Checkbox('epilepsy', array()); $epilepsy->setDecorators($elementDecorators); if ($data['uht_epilepsy']) { $epilepsy->setChecked(true); } $cancer = new Zend_Form_Element_Checkbox('cancer', array()); $cancer->setDecorators($elementDecorators); if ($data['uht_cancer']) { $cancer->setChecked(true); } $asthma = new Zend_Form_Element_Checkbox('asthma', array()); $asthma->setDecorators($elementDecorators); if ($data['uht_asthma']) { $asthma->setChecked(true); } $artritis = new Zend_Form_Element_Checkbox('artritis', array()); $artritis->setDecorators($elementDecorators); if ($data['uht_Artritis']) { $artritis->setChecked(true); } $hernia = new Zend_Form_Element_Checkbox('hernia', array()); $hernia->setDecorators($elementDecorators); if ($data['uht_hernia']) { $hernia->setChecked(true); } $depression = new Zend_Form_Element_Checkbox('depression', array()); $depression->setDecorators($elementDecorators); if ($data['uht_depression_or_anxiety']) { $depression->setChecked(true); } $headaches = new Zend_Form_Element_Checkbox('headaches', array()); $headaches->setDecorators($elementDecorators); if ($data['uht_headaches']) { $headaches->setChecked(true); } $fatigue = new Zend_Form_Element_Checkbox('fatigue', array()); $fatigue->setDecorators($elementDecorators); if ($data['uht_fatigue']) { $fatigue->setChecked(true); } $injury = new Zend_Form_Element_Checkbox('injury', array()); $injury->setDecorators($elementDecorators); if ($data['uht_injury']) { $injury->setChecked(true); } $injuryText = new Zend_Form_Element_Textarea('injurytext', array('id' => 'obj', 'rows' => '20', 'cols' => '20')); if ($data['uht_injury_text']) { $injuryText->setValue($data['uht_injury_text']); } $medication = new Zend_Form_Element_Checkbox('medication', array()); $medication->setDecorators($elementDecorators); if ($data['uht_medication']) { $medication->setChecked(true); } $medicationText = new Zend_Form_Element_Textarea('medicationtext', array('id' => 'obj', 'rows' => '20', 'cols' => '20')); if ($data['uht_which_medication']) { $medicationText->setValue($data['uht_which_medication']); } $walk = new Zend_Form_Element_Radio('walk', array('label' => '', 'separator' => '', 'multiOptions' => array('Yes' => 'כן', 'No' => 'לא'))); if ($data['uht_walk']) { $walk->setValue($data['uht_walk']); } $walk->setDecorators($elementDecorators); $hands = new Zend_Form_Element_Radio('hands', array('label' => '', 'separator' => '', 'multiOptions' => array('Yes' => 'כן', 'No' => 'לא'))); if ($data['uht_hands']) { $hands->setValue($data['uht_hands']); } $hands->setDecorators($elementDecorators); $legs = new Zend_Form_Element_Radio('legs', array('label' => '', 'separator' => '', 'multiOptions' => array('Yes' => 'כן', 'No' => 'לא'))); if ($data['uht_sit']) { $legs->setValue($data['uht_sit']); } $legs->setDecorators($elementDecorators); $backashes = new Zend_Form_Element_Radio('backashes', array('label' => '', 'separator' => '', 'multiOptions' => array('Yes' => 'כן', 'No' => 'לא'))); if ($data['uht_backashes']) { $backashes->setValue($data['uht_backashes']); } $backashes->setDecorators($elementDecorators); if ($protection) { $backashes->setAttrib('disabled', 'true'); } $slippedDisk = new Zend_Form_Element_Radio('disc', array('label' => '', 'separator' => '', 'multiOptions' => array('Yes' => 'כן', 'No' => 'לא'))); if ($protection) { $slippedDisk->setAttrib('disabled', 'true'); } if ($data['uht_slipped_disk']) { $slippedDisk->setValue($data['uht_slipped_disk']); } $slippedDisk->setDecorators($elementDecorators); $generalQuestionsText1 = new Zend_Form_Element_Text('general1', array('id' => 'f_1')); $generalQuestionsText2 = new Zend_Form_Element_Text('general2', array('id' => 'f_2')); $generalQuestionsText3 = new Zend_Form_Element_Text('general3', array('id' => 'f_3')); $generalQuestionsText1->setDecorators($elementDecorators); if ($protection) { $generalQuestionsText1->setAttrib('readonly', 'true'); $generalQuestionsText2->setAttrib('readonly', 'true'); $generalQuestionsText3->setAttrib('readonly', 'true'); } $generalQuestionsText2->setDecorators($elementDecorators); $generalQuestionsText3->setDecorators($elementDecorators); if (isset($data['uht_general1'])) { $generalQuestionsText1->setValue($data['uht_general1']); } if (isset($data['uht_general2'])) { $generalQuestionsText2->setValue($data['uht_general2']); } if (isset($data['uht_general3'])) { $generalQuestionsText3->setValue($data['uht_general3']); } $lowerback = new Zend_Form_Element_Checkbox('lowerback', array()); $lowerback->setDecorators($elementDecorators); if ($data['uht_lower_back']) { $lowerback->setChecked(true); } $upperback = new Zend_Form_Element_Checkbox('upperback', array()); $upperback->setDecorators($elementDecorators); if ($data['uht_upper_back']) { $upperback->setChecked(true); } $feet = new Zend_Form_Element_Checkbox('feet', array()); $feet->setDecorators($elementDecorators); if ($data['uht_ankles_and_feet']) { $feet->setChecked(true); } $neck = new Zend_Form_Element_Checkbox('neck', array()); $neck->setDecorators($elementDecorators); if ($data['uht_neck_and_shoulders']) { $neck->setChecked(true); } $breath = new Zend_Form_Element_Checkbox('breath', array()); $breath->setDecorators($elementDecorators); if ($data['uht_breath']) { $breath->setChecked(true); } $pelvis = new Zend_Form_Element_Checkbox('pelvis', array()); $pelvis->setDecorators($elementDecorators); if ($data['uht_thighs_or_pelvis']) { $pelvis->setChecked(true); } $knees = new Zend_Form_Element_Checkbox('knees', array()); $knees->setDecorators($elementDecorators); if ($data['uht_thighs_or_pelvis']) { $knees->setChecked(true); } $wrists = new Zend_Form_Element_Checkbox('wrists', array()); $wrists->setDecorators($elementDecorators); if ($data['uht_wrists']) { $wrists->setChecked(true); } $head = new Zend_Form_Element_Checkbox('head', array()); $head->setDecorators($elementDecorators); if ($data['uht_head']) { $head->setChecked(true); } $ankles = new Zend_Form_Element_Checkbox('ankles', array()); $ankles->setDecorators($elementDecorators); if ($data['uht_ankles']) { $ankles->setChecked(true); } $externalMails = new Zend_Form_Element_Checkbox('external', array()); $externalMails->setDecorators($elementDecorators); if ($data['u_external_emails']) { $externalMails->setChecked(true); } $moreInfo = new Zend_Form_Element_Textarea('moreinfo', array('id' => 'obj', 'rows' => '20', 'cols' => '20')); if ($data['uht_more_info']) { $moreInfo->setValue($data['uht_more_info']); } $form->addElements(array($firstName, $lastName, $gender, $birthday, $heigth, $weight, $email, $password1, $password2, $state, $address, $pregnant, $pregnantSince, $objectives, $terms, $heartPressure, $diabetes, $migrene, $babies, $nosleep, $digestion, $menopause, $sclorosies, $epilepsy, $cancer, $asthma, $artritis, $hernia, $depression, $fatigue, $headaches, $injury, $injuryText, $medication, $medicationText, $walk, $hands, $legs, $backashes, $slippedDisk, $generalQuestionsText1, $generalQuestionsText2, $generalQuestionsText3, $lowerback, $upperback, $feet, $neck, $breath, $pelvis, $knees, $wrists, $head, $ankles, $moreInfo, $externalMails)); return $form; }
public function init() { /* $this->addElementPrefixPath('Application_Validate', '../application/validate', 'validate'); * */ $currentUser = Application_Model_User::getCurrentUser(); $currentUserId = $currentUser->getId(); $userData = Application_Model_User::GetUserData($currentUserId); $notEmptyValidator = Application_Form_Helper_ValidationTypes::overrideNotEmptyValidator(); $emailValidator = Application_Form_Helper_ValidationTypes::overrideEmailAddressValidator(); $notDemoValidator = new Application_Validate_NotDemoValidate(); $this->setDecorators(array(array('ViewScript', array('viewScript' => 'form/edit-user.phtml', "currentUser" => $currentUser->getLogin())))); $this->setAttrib('id', 'current-user-form'); $hidden = new Zend_Form_Element_Hidden('cu_user_id'); $hidden->setDecorators(array('ViewHelper')); $hidden->setValue($userData["id"]); $this->addElement($hidden); $login = new Zend_Form_Element_Text('cu_login'); $login->setLabel(_('Username:'******'class', 'input_text'); $login->setAttrib('readonly', 'readonly'); $login->setRequired(true); $login->addValidator($notEmptyValidator); $login->addFilter('StringTrim'); $login->setDecorators(array('viewHelper')); $this->addElement($login); $password = new Zend_Form_Element_Password('cu_password'); $password->setLabel(_('Password:'******'class', 'input_text'); $password->setRequired(true); $password->addFilter('StringTrim'); $password->addValidator($notEmptyValidator); $password->setDecorators(array('viewHelper')); $this->addElement($password); $passwordVerify = new Zend_Form_Element_Password('cu_passwordVerify'); $passwordVerify->setLabel(_('Verify Password:'******'class', 'input_text'); $passwordVerify->setRequired(true); $passwordVerify->addFilter('StringTrim'); $passwordVerify->addValidator($notEmptyValidator); $passwordVerify->addValidator($notDemoValidator); $passwordVerify->setDecorators(array('viewHelper')); $this->addElement($passwordVerify); $firstName = new Zend_Form_Element_Text('cu_first_name'); $firstName->setLabel(_('Firstname:')); $firstName->setValue($userData["first_name"]); $firstName->setAttrib('class', 'input_text'); $firstName->addFilter('StringTrim'); $firstName->setDecorators(array('viewHelper')); $this->addElement($firstName); $lastName = new Zend_Form_Element_Text('cu_last_name'); $lastName->setLabel(_('Lastname:')); $lastName->setValue($userData["last_name"]); $lastName->setAttrib('class', 'input_text'); $lastName->addFilter('StringTrim'); $lastName->setDecorators(array('viewHelper')); $this->addElement($lastName); $email = new Zend_Form_Element_Text('cu_email'); $email->setLabel(_('Email:')); $email->setValue($userData["email"]); $email->setAttrib('class', 'input_text'); $email->addFilter('StringTrim'); $email->setRequired(true); $email->addValidator($notEmptyValidator); $email->addValidator($emailValidator); $email->setDecorators(array('viewHelper')); $this->addElement($email); $cellPhone = new Zend_Form_Element_Text('cu_cell_phone'); $cellPhone->setLabel(_('Mobile Phone:')); $cellPhone->setValue($userData["cell_phone"]); $cellPhone->setAttrib('class', 'input_text'); $cellPhone->addFilter('StringTrim'); $cellPhone->setDecorators(array('viewHelper')); $this->addElement($cellPhone); $skype = new Zend_Form_Element_Text('cu_skype'); $skype->setLabel(_('Skype:')); $skype->setValue($userData["skype_contact"]); $skype->setAttrib('class', 'input_text'); $skype->addFilter('StringTrim'); $skype->setDecorators(array('viewHelper')); $this->addElement($skype); $jabber = new Zend_Form_Element_Text('cu_jabber'); $jabber->setLabel(_('Jabber:')); $jabber->setValue($userData["jabber_contact"]); $jabber->setAttrib('class', 'input_text'); $jabber->addFilter('StringTrim'); $jabber->addValidator($emailValidator); $jabber->setDecorators(array('viewHelper')); $this->addElement($jabber); $locale = new Zend_Form_Element_Select("cu_locale"); $locale->setLabel(_("Language:")); $locale->setMultiOptions(Application_Model_Locale::getLocales()); $locale->setValue(Application_Model_Preference::GetUserLocale($currentUserId)); $locale->setDecorators(array('ViewHelper')); $this->addElement($locale); $timezone = new Zend_Form_Element_Select("cu_timezone"); $timezone->setLabel(_("Interface Timezone:")); $timezone->setMultiOptions(Application_Common_Timezone::getTimezones()); $timezone->setValue(Application_Model_Preference::GetUserTimezone($currentUserId)); $timezone->setDecorators(array('ViewHelper')); $this->addElement($timezone); }
public function init() { //setting method and action of the form $this->setAction('/user/registration/first-form/')->setAttrib('enctype', 'multipart/form-data')->setDecorators($this->formDecorators)->setMethod('post'); //firstname field $firstName = new Zend_Form_Element_Text('firstname', array('required' => true, 'label' => 'שם פרטי:', 'maxLength' => '30', 'validators' => array(array('stringLength', false, array(3, 100)), array('Alpha')))); $firstName->setDecorators($this->elementDecorators); //last- or familyname field $familyName = new Zend_Form_Element_Text('familyname', array('required' => true, 'label' => 'שם משפחה:', 'validators' => array(array('stringLength', false, array(3, 100)), array('Alpha')))); $familyName->setDecorators($this->elementDecorators); // status field goes here /* * TODO */ //selecting gender: Male (1) or Female (0) $gender = new Zend_Form_Element_Radio('sex', array('required' => true, 'label' => 'מין:', 'separator' => '', 'multiOptions' => array('1' => 'זכר ', '0' => 'נקבה'))); $gender->setDecorators($this->elementDecorators); //birthday field: validation for yyyy-mm-dd input $birthday = new Zend_Form_Element_Text('datepicker', array('required' => true, 'label' => 'שנת לידה:', 'size' => 10)); $birthday->setDecorators($this->elementDecorators); $birthday->addValidator(new Zend_Validate_Date()); $weight = new Zend_Form_Element_Select('weight', array('label' => 'שקל')); for ($i = 20; $i <= 300; $i++) { $weight->addMultiOption($i, $i); } $weight->setDecorators($this->elementDecorators); $heigth = new Zend_Form_Element_Select('heigth', array('label' => 'גובה:')); for ($i = 120; $i <= 300; $i++) { $heigth->addMultiOption($i, $i); } $heigth->setDecorators($this->elementDecorators); //email field with validation $email = new Zend_Form_Element_Text('email', array('required' => true, 'size' => 50, 'label' => 'אימייל: ')); $email->addValidator(new Zend_Validate_EmailAddress()); $email->addValidator(new Zend_Validate_Db_NoRecordExists(array('table' => 'users', 'field' => 'u_email'))); $email->setDecorators($this->elementDecorators); // password field $password1 = new Zend_Form_Element_Password('password1', array('required' => true, 'size' => 50, 'label' => 'סיסמא')); $password1->setDecorators($this->elementDecorators); // password confirmation field $password2 = new Zend_Form_Element_Password('password2', array('required' => true, 'size' => 50, 'label' => 'אימות סיסמא')); $password2->addValidator(new User_Form_UserFirstFormPasswordValidator('password1')); $password2->setDecorators($this->elementDecorators); $country_list = $this->getCountriesList(); $state = new Zend_Form_Element_Select('state', array('requred' => true, 'label' => 'מדינה:')); $state->setMultiOptions(array($country_list)); $state->setDecorators($this->elementDecorators); $address = new Zend_Form_Element_Text('address', array('required' => false, 'size' => 50, 'label' => 'כתובת מלאה:')); $address->setDecorators($this->elementDecorators); //selecting gender: Male (1) or Female (0) $pregnant = new Zend_Form_Element_Radio('pregnant', array('label' => 'לנשים: האם את בהריון?', 'separator' => '', 'multiOptions' => array('Yes' => 'Yes', 'No' => 'No'))); $pregnant->setDecorators($this->elementDecorators); $pregnantSince = new Zend_Form_Element_Select('pregnantsince', array('label' => 'מספר חודשים שעברו מהלידה האחרונה:')); $pregnantSince->setMultiOptions(array('1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5', '6' => '6', '7' => '7', '8' => '8', '9' => '9')); $pregnantSince->setDecorators($this->elementDecorators); $objectives = new Zend_Form_Element_Textarea('objectives', array('label' => 'מהן המטרות שלך בתרגול איתנו?')); $terms = new Zend_Form_Element_Checkbox('terms', array('label' => "<a target='new' href='http://lc.tipulitonline.co.il/pages/takanon.html'>אישור הסכמה לתנאים וההגבלות</a>", 'required' => 'true,')); $terms->setDecorators($this->elementDecorators); $terms->addDecorator('Label', array('escape' => false)); $terms->addValidator(new User_Form_UserTermsConditionsValidator()); //submit the form $submit = new Zend_Form_Element_Submit('submit'); $submit->setLabel('שלח '); $this->addElements(array($firstName, $familyName, $gender, $weight, $heigth, $birthday, $email, $password1, $password2, $state, $address, $pregnant, $pregnantSince, $objectives, $terms, $submit)); }
/** * * Edit User (admin only) * */ public function init() { $cname = explode('_', get_class()); $this->preInit(end($cname)); // use template file $this->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/AdminUser.phtml')))); $request = Zend_Controller_Front::getInstance()->getRequest(); $request_profile_id = $request->getParam('id'); // get user from database $Profiles = new Application_Model_Profiles(); $ProfilesMeta = new Application_Model_ProfilesMeta(); $profile = $Profiles->getProfileByField('id', $request_profile_id); $all_meta = $ProfilesMeta->getMetaValues($profile->id); if (isset($all_meta['bulk_notifications'])) { $notifications_meta = json_decode($all_meta['bulk_notifications'], true); } // fields $role = new Zend_Form_Element_Select('role'); $role->setDecorators(array('ViewHelper', 'Errors'))->setMultiOptions(array('user' => 'User', 'subscriber' => 'Subscriber', 'reviewer' => 'Reviewer', 'admin' => 'Admin'))->setErrorMessages(array($this->translator->translate('User Role is requiered')))->setLabel($this->translator->translate('User Role'))->setRequired(true)->setValue($profile->role)->setAttrib('class', 'form-control'); $profile_id = new Zend_Form_Element_Text('id'); $profile_id->setDecorators(array('ViewHelper', 'Errors'))->setLabel($this->translator->translate('Id'))->setValue($profile->id)->setIgnore(true)->setAttrib('readonly', true)->setAttrib('class', 'form-control'); $username_minchars = Zend_Registry::get('config')->get('username_minchars'); $username_maxchars = Zend_Registry::get('config')->get('username_maxchars'); // lowercase, alnum without whitespaces $name = new Zend_Form_Element_Text('name'); $name->setDecorators(array('ViewHelper', 'Errors'))->setRequired(true)->addFilter('StringToLower')->addValidator('alnum', false, array('allowWhiteSpace' => false))->addValidator('stringLength', false, array($username_minchars, $username_maxchars))->setErrorMessages(array(sprintf($this->translator->translate('Please choose a valid username between %d and %d characters'), $username_minchars, $username_maxchars)))->setAttrib('class', 'form-control alnum-only')->setValue($profile->name)->setLabel($this->translator->translate('Name')); $email = new Zend_Form_Element_Text('email'); $email->setDecorators(array('ViewHelper', 'Errors'))->setLabel($this->translator->translate('Email'))->setValue($profile->email)->setAttrib('class', 'form-control'); $screenname = new Zend_Form_Element_Text('screen_name'); $screenname->setDecorators(array('ViewHelper', 'Errors'))->addFilter('StringTrim')->setValue($profile->screen_name)->addValidator('alnum', false, array('allowWhiteSpace' => true))->addValidator('stringLength', false, array($username_minchars, $username_maxchars))->setErrorMessages(array(sprintf($this->translator->translate('Please choose a valid name between %d and %d characters'), $username_minchars, $username_maxchars)))->setLabel($this->translator->translate('Screen Name'))->setRequired(true)->setAttrib('class', 'form-control'); $description = new Zend_Form_Element_Textarea('description'); $description->setDecorators(array('ViewHelper', 'Errors'))->setAttrib('COLS', '')->setAttrib('ROWS', '4')->setValue(isset($all_meta['description']) ? $all_meta['description'] : '')->setLabel($this->translator->translate('Description'))->setAttrib('class', 'form-control'); $profile_privacy = new Zend_Form_Element_Select('profile_privacy'); $profile_privacy->setDecorators(array('ViewHelper', 'Errors'))->setMultiOptions(Zend_Registry::get('profile_privacy_all'))->setErrorMessages(array($this->translator->translate('Select profile visibility')))->setLabel($this->translator->translate('Profile visibility'))->setRequired(true)->setValue($profile->profile_privacy)->setAttrib('class', 'form-control'); $default_privacy = new Zend_Form_Element_Select('default_privacy'); $default_privacy->setDecorators(array('ViewHelper', 'Errors'))->setMultiOptions(Zend_Registry::get('post_privacy_array'))->setLabel($this->translator->translate('Default visibility'))->setRequired(true)->setValue($profile->default_privacy)->setAttrib('class', 'form-control'); $language = new Zend_Form_Element_Select('language'); $language->setDecorators(array('ViewHelper', 'Errors'))->setMultiOptions(Zend_Registry::get('languages_array'))->setLabel($this->translator->translate('Language'))->setRequired(true)->setValue($profile->language)->setAttrib('class', 'form-control'); $birthday = new Application_Form_Element_Date('birthday'); $birthday->setDecorators(array('ViewHelper', 'Errors'))->setLabel($this->translator->translate('Date of birth'))->setErrorMessages(array($this->translator->translate('Please enter a valid date'))); $birthday->setYearSpan(1920, date('Y') - 1); if (isset($all_meta['birthday'])) { $timestamp = strtotime($all_meta['birthday']); $birthday->setValue(array('day' => date('d', $timestamp), 'month' => date('m', $timestamp), 'year' => date('Y', $timestamp))); } $password1 = new Zend_Form_Element_Password('password1'); $password1->setDecorators(array('ViewHelper', 'Errors'))->setAttrib('autocomplete', 'off')->setLabel($this->translator->translate('New Password:'******'class', 'form-control'); $activation = new Zend_Form_Element_Text('activationkey'); $activation->setDecorators(array('ViewHelper', 'Errors'))->setLabel($this->translator->translate('Activation key (or "activated")'))->setValue($profile->activationkey)->setAttrib('class', 'form-control'); $gender = new Zend_Form_Element_Select('gender'); $gender->setDecorators(array('ViewHelper', 'Errors'))->setMultiOptions(Zend_Registry::get('genders_array'))->setErrorMessages(array($this->translator->translate('Please select something')))->setLabel($this->translator->translate('Gender'))->setRequired(true)->setValue(isset($all_meta['gender']) ? $all_meta['gender'] : '')->setAttrib('class', 'form-control'); $online_status = new Zend_Form_Element_Select('show_online_status'); $online_status->setDecorators(array('ViewHelper', 'Errors'))->setMultiOptions(Zend_Registry::get('onlinestatus_array'))->setErrorMessages(array($this->translator->translate('Select profile visibility')))->setLabel($this->translator->translate('Online Status'))->setRequired(true)->setValue(isset($all_meta['show_online_status']) ? $all_meta['show_online_status'] : 's')->setAttrib('class', 'form-control'); $contact_privacy = new Zend_Form_Element_Select('contact_privacy'); $contact_privacy->setDecorators(array('ViewHelper', 'Errors'))->setMultiOptions(Zend_Registry::get('contactprivacy_array'))->setErrorMessages(array($this->translator->translate('Please select something')))->setLabel($this->translator->translate('Who can contact me?'))->setRequired(true)->setValue(isset($all_meta['contact_privacy']) ? $all_meta['contact_privacy'] : 'e')->setAttrib('class', 'form-control'); $location = new Zend_Form_Element_Text('location'); $location->setDecorators(array('ViewHelper', 'Errors'))->setRequired(false)->setLabel($this->translator->translate('Location'))->setAttrib('class', 'form-control')->addFilter('StripTags')->setValue(isset($all_meta['location']) ? $all_meta['location'] : '')->setErrorMessages(array($this->translator->translate('Enter a valid location'))); $website = new Zend_Form_Element_Text('website'); $website->setDecorators(array('ViewHelper', 'Errors'))->setRequired(false)->setLabel($this->translator->translate('Website'))->setAttrib('class', 'form-control')->addFilter('StripTags')->setValue(isset($all_meta['website']) ? $all_meta['website'] : '')->setErrorMessages(array($this->translator->translate('Enter a valid website'))); $badges = new Zend_Form_Element_Text('badges'); $badges->setDecorators(array('ViewHelper', 'Errors'))->setLabel($this->translator->translate('Badges based on Glyphicon font separated by comma (e.g. "bullhorn,earphone")'))->setValue(isset($all_meta['badges']) ? $all_meta['badges'] : '')->setAttrib('class', 'form-control'); $n1 = new Zend_Form_Element_Checkbox('notification_email_1'); $n1->setDecorators(array('ViewHelper', 'Errors'))->setValue(isset($notifications_meta['notification_email_1']) && $notifications_meta['notification_email_1'] == 1 ? 1 : 0)->setLabel($this->translator->translate('Email when someone posts a new comment'))->setCheckedValue("1")->setUncheckedValue("0"); $n2 = new Zend_Form_Element_Checkbox('notification_email_2'); $n2->setDecorators(array('ViewHelper', 'Errors'))->setValue(isset($notifications_meta['notification_email_2']) && $notifications_meta['notification_email_2'] == 1 ? 1 : 0)->setLabel($this->translator->translate('Email when someone likes your post'))->setCheckedValue("1")->setUncheckedValue("0"); $n3 = new Zend_Form_Element_Checkbox('notification_email_3'); $n3->setDecorators(array('ViewHelper', 'Errors'))->setValue(isset($notifications_meta['notification_email_3']) && $notifications_meta['notification_email_3'] == 1 ? 1 : 0)->setLabel($this->translator->translate('Email when someone follows you'))->setCheckedValue("1")->setUncheckedValue("0"); $n4 = new Zend_Form_Element_Checkbox('notification_email_4'); $n4->setDecorators(array('ViewHelper', 'Errors'))->setValue(isset($notifications_meta['notification_email_4']) && $notifications_meta['notification_email_4'] == 1 ? 1 : 0)->setLabel($this->translator->translate('Email on new friends'))->setCheckedValue("1")->setUncheckedValue("0"); $n6 = new Zend_Form_Element_Checkbox('notification_email_6'); $n6->setDecorators(array('ViewHelper', 'Errors'))->setValue(isset($notifications_meta['notification_email_6']) && $notifications_meta['notification_email_6'] == 1 ? 1 : 0)->setLabel($this->translator->translate('Email when you lose a follower'))->setCheckedValue("1")->setUncheckedValue("0"); $n7 = new Zend_Form_Element_Checkbox('notification_email_7'); $n7->setDecorators(array('ViewHelper', 'Errors'))->setValue(isset($notifications_meta['notification_email_7']) && $notifications_meta['notification_email_7'] == 1 ? 1 : 0)->setLabel($this->translator->translate('Email when someone posts on your wall'))->setCheckedValue("1")->setUncheckedValue("0"); $n8 = new Zend_Form_Element_Checkbox('notification_email_8'); $n8->setDecorators(array('ViewHelper', 'Errors'))->setValue(isset($notifications_meta['notification_email_8']) && $notifications_meta['notification_email_8'] == 1 ? 1 : 0)->setLabel($this->translator->translate('Email when someone sends you a private message'))->setCheckedValue("1")->setUncheckedValue("0"); $is_hidden = new Zend_Form_Element_Checkbox('is_hidden'); $is_hidden->setDecorators(array('ViewHelper', 'Errors'))->setValue(isset($profile->is_hidden) && $profile->is_hidden == 1 ? 1 : 0)->setLabel($this->translator->translate('Hide?'))->setCheckedValue("1")->setUncheckedValue("0"); $submit = new Zend_Form_Element_Submit('formsubmit'); $submit->setDecorators(array('ViewHelper'))->setLabel($this->translator->translate('Save'))->setAttrib('class', 'submit btn btn-default'); $this->addElements(array($profile_id, $role, $name, $email, $screenname, $description, $profile_privacy, $default_privacy, $language, $gender, $online_status, $contact_privacy, $location, $website, $birthday, $password1, $activation, $badges, $n1, $n2, $n3, $n4, $n6, $n7, $n8, $is_hidden, $submit)); $this->postInit(); }