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: ');
 }
Example #2
0
 public function init()
 {
     $this->setMethod('post')->setAttrib('id', 'frmRegistrar');
     $e = new Zend_Form_Element_Text('nombre');
     $e->setRequired();
     $e->setLabel('Nombre');
     $e->addValidator(new Zend_Validate_StringLength(array('min' => 5, 'max' => 25)));
     $e->addValidator(new My_Validate_NoX());
     $e->addValidator(new Zend_Validate_Db_NoRecordExists(array('table' => 'usuario', 'field' => 'nombre')));
     $this->addElement($e);
     $e = new Zend_Form_Element_Text('login');
     $e->setRequired();
     $e->setLabel('Login');
     $e->addValidator(new Zend_Validate_Alnum());
     $e->addValidator(new Zend_Validate_Db_NoRecordExists(array('table' => 'usuario', 'field' => 'login')));
     $e->addValidator(new Zend_Validate_StringLength(array('min' => 5, 'max' => 25)));
     $this->addElement($e);
     $e = new Zend_Form_Element_Password('pwd');
     $e->setRequired();
     $e->setLabel('Password');
     $this->addElement($e);
     $e = new Zend_Form_Element_Password('pwd_2');
     $e->setRequired();
     $e->setLabel('Confirmación Password');
     $e->addValidator(new My_Validate_PasswordConfirmation());
     $this->addElement($e);
     $this->addElement('submit', 'Enviar');
 }
Example #3
0
		function setForm()
		{
			$form=new Zend_Form;
			 
			$form->setMethod('post')->setAction('');
			
			$user_login = new Zend_Form_Element_Text('user_login');
			$user_login->setRequired(true)->addValidator('NotEmpty',true,array('messages'=>'Tên đăng nhập không được để trống'));
			
			$user_pass = new Zend_Form_Element_Password('user_pass');
			$user_pass->setAttrib('renderPassword', true);
			$user_pass->setRequired(true)->addValidator('NotEmpty',true,array('messages'=>'Mật khẩu không được để trống'));
			
			$user_fullname = new Zend_Form_Element_Text('user_fullname');
			$user_fullname->setRequired(true)->addValidator('NotEmpty',true,array('messages'=>'Tên người dùng không được để trống'));
			
			$user_email = new Zend_Form_Element_Text('user_email');
			$user_email->addValidator('EmailAddress',true,array('messages'=>'Địa chỉ email không hợp lệ'));
			$user_email->setRequired(true)->addValidator('NotEmpty',true,array('messages'=>'Email không được để trống'));
			
			$user_address = new Zend_Form_Element_Text('user_address');
			$user_address->setRequired(true)->addValidator('NotEmpty',true,array('messages'=>'Địa chỉ không được để trống'));
			
			$user_login->removeDecorator('HtmlTag')->removeDecorator('Label');	
			$user_pass->removeDecorator('HtmlTag')->removeDecorator('Label');
			$user_fullname->removeDecorator('HtmlTag')->removeDecorator('Label');
			$user_email->removeDecorator('HtmlTag')->removeDecorator('Label');
			$user_address->removeDecorator('HtmlTag')->removeDecorator('Label');	
			
			$form->addElements(array($user_login,$user_pass,$user_fullname,$user_email,$user_address));
			return $form;
		}
Example #4
0
    public function init()
    {
        $tr = Zend_Registry::get('tr');
        
        $handle = new Zend_Form_Element_Text('handle');
        $handle->setLabel($tr->_('HANDLE'));
        $handle->setRequired(true);
        $handle->addValidator('NotEmpty', true, array('messages' => $tr->_('GENERAL_MISSING_TEXT_VALUE')));
        $this->addElement($handle);

        $password = new Zend_Form_Element_Password('password');
        $password->setLabel($tr->_('PASSWORD'));
        $password->setRequired(true);
        $password->addValidator('NotEmpty', true, array('messages' => $tr->_('GENERAL_MISSING_TEXT_VALUE')));
        $this->addElement($password);

        $password1 = new Zend_Form_Element_Password('password_again');
        $password1->setLabel($tr->_('RETYPE') . ' ' . $tr->_('PASSWORD'));
        $password1->setRequired(true);
        $password1->addValidator('NotEmpty', true, array('messages' => $tr->_('GENERAL_MISSING_TEXT_VALUE')));
        $this->addElement($password1);

        $this->addElement(new Zend_Form_Element_Submit($tr->_('SUBMIT')));

        parent::init();
    }
Example #5
0
 function editUserPassword()
 {
     $this->setMethod('post');
     $this->addAttribs(array('id' => 'formAccountEditPassword', 'class' => ''));
     $filters = array(new Zend_Filter_StringTrim(), new Zend_Filter_StripTags());
     $control = new Zend_Form_Element_Hidden('control');
     $control->setValue('editPassword');
     $this->addElement($control);
     $oldPassword = new Zend_Form_Element_Password('oldPassword');
     $oldPassword->setLabel('Old password');
     $oldPassword->addValidator(new Zend_Validate_StringLength(6, 32));
     $oldPassword->setAttribs(array('class' => 'text validate[required,minSize[6],maxSize[32]] rightAdd', 'minlenght' => '6', 'maxlenght' => '32', 'autocomplete' => 'off', 'oncontextmenu' => 'return false', 'data-prompt-position' => 'topLeft:0'));
     $oldPassword->setRequired(true);
     $this->addElement($oldPassword);
     $password = new Zend_Form_Element_Password('password');
     $password->setLabel(Zend_Registry::get('translate')->_('admin_administrators_new_password'));
     $password->addValidator(new Zend_Validate_StringLength(6, 32));
     $password->setAttribs(array('class' => 'text validate[required] rightAdd', 'maxlenght' => '32', 'autocomplete' => 'off', 'oncontextmenu' => 'return false', 'ondrop' => 'return false', 'onpaste' => 'return false'));
     $password->setRequired(true);
     $this->addElement($password);
     $retypePassword = new Zend_Form_Element_Password('retypePassword');
     $retypePassword->setLabel(Zend_Registry::get('translate')->_('admin_administrators_retype_new_password'));
     $retypePassword->addValidator(new Zend_Validate_Identical('password'));
     $retypePassword->addValidator(new Zend_Validate_StringLength(6, 32));
     $retypePassword->setAttribs(array('class' => 'text validate[required] rightAdd', 'maxlenght' => '32', 'autocomplete' => 'off', 'oncontextmenu' => 'return false', 'ondrop' => 'return false', 'onpaste' => 'return false'));
     $retypePassword->setRequired(true);
     $retypePassword->setIgnore(true);
     $this->addElement($retypePassword);
     $submit = new Zend_Form_Element_Submit('savePassword');
     $submit->setValue(Zend_Registry::get('translate')->_('apply_password'));
     $submit->setAttribs(array('class' => 'submit tsSubmitLogin fL'));
     $submit->setIgnore(true);
     $this->addElement($submit);
     $this->setElementFilters($filters);
 }
Example #6
0
 private function _getPasswordElement()
 {
     $credentialsVaidator = new Form_Validate_Credentials();
     $passwordElement = new Zend_Form_Element_Password('password');
     $passwordElement->setRequired(true)->setLabel('Password')->addValidator($credentialsVaidator);
     return $passwordElement;
 }
 private function _setupElements()
 {
     $translate = Zend_Registry::get('Zend_Translate');
     $this->setAttrib('id', 'signupForm');
     $this->setTranslator($translate);
     $email = new Zend_Form_Element_Text('email');
     $email->setRequired(true)->addFilter('StringTrim')->addFilter('StripTags')->addValidator('NotEmpty')->removeDecorator('HtmlTag')->removeDecorator('DtDWrapper')->removeDecorator('label')->setAttrib('id', 'email')->addValidator('EmailAddress');
     $email->addValidator(new Ziown_Form_Validate_EmailAddress(), false);
     $email->getValidator('NotEmpty')->setMessage('Email Address is Required', 'isEmpty');
     $username = new Zend_Form_Element_Text('username');
     $username->setRequired(true)->addFilter('StringTrim')->addFilter('StripTags')->addValidator('NotEmpty')->removeDecorator('HtmlTag')->removeDecorator('DtDWrapper')->removeDecorator('label')->setAttrib('id', 'username');
     $username->addValidator(new Ziown_Form_Validate_UserName());
     $username->getValidator('NotEmpty')->setMessage('User name is Required', 'isEmpty');
     $password = new Zend_Form_Element_Password('password');
     $password->setRequired(true)->removeDecorator('HtmlTag')->removeDecorator('DtDWrapper')->removeDecorator('label')->setAttrib('id', 'txt-password')->setErrorMessages(array('Password is required'));
     $identValidator = new Zend_Validate_Identical($_POST['password']);
     $identValidator->setMessages(array('notSame' => 'Password doesn\'t match!', 'missingToken' => 'Password doesn\'t match!'));
     $confirm_password = new Zend_Form_Element_Password('confirm_password');
     $confirm_password->setRequired(true)->removeDecorator('HtmlTag')->removeDecorator('DtDWrapper')->removeDecorator('label')->setAttrib('id', 'txt-confirm-password')->addValidator($identValidator);
     $signup = new Zend_Form_Element_Submit('signup');
     $signup->setLabel('Sign Up');
     $signup->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->setAttrib('class', 'u-login');
     $this->setDecorators(array(array('ViewScript', array('script' => 'signup.phtml'))));
     $this->addElements(array($username, $password, $confirm_password, $signup, $email));
 }
Example #8
0
 /**
  * Creates the form to log in.
  * @see Zend_Form::init()
  */
 public function init()
 {
     $this->setMethod('post');
     $this->setAction("/auth/login/");
     $usernameElement = new Zend_Form_Element_Text('username');
     $usernameElement->setLabel("Benutzername");
     $usernameElement->addValidator('regex', false, array('/^[a-z0-9]/i'));
     $usernameElement->addValidator('stringLength', false, array(2, 64));
     $usernameElement->setAttrib('maxLength', 64);
     $usernameElement->setRequired(true);
     $passwordElement = new Zend_Form_Element_Password('password');
     $passwordElement->setLabel("Passwort");
     $passwordElement->addValidator('regex', false, array('/^[a-z0-9]/i'));
     $passwordElement->addValidator('stringLength', false, array(8, 32));
     $passwordElement->setAttrib('maxLength', 32);
     $passwordElement->setRequired(true);
     $submitElement = new Zend_Form_Element_Submit('submit');
     $submitElement->setLabel('Anmelden');
     $submitElement->setIgnore(true);
     $submitElement->setAttrib('class', 'submit');
     $submitElement->removeDecorator('DtDdWrapper');
     $this->addElements(array($usernameElement, $passwordElement));
     $this->addDisplayGroup(array('username', 'password'), 'credentialGroup', array('legend' => 'Zugangsdaten'));
     $this->addElements(array($submitElement));
 }
Example #9
0
 public function init()
 {
     $this->setName('registerForm');
     $this->setMethod('post');
     $this->setAction('/user/register/');
     $user = new Zend_Form_Element_Text('user');
     $user->setLabel('Username');
     $user->setRequired(true);
     $user->addValidator('Alnum', false);
     $user->addValidator('StringLength', true, array(3, 30));
     //$user->addValidator('Db_NoRecordExists', true, array('user', 'user') );
     $password = new Zend_Form_Element_Password('password');
     $password->setLabel('Password');
     $password->setRenderPassword(true);
     $password->setRequired(true);
     $password->addValidator('StringLength', true, array(5, 50));
     $name = new Zend_Form_Element_Text('name');
     $name->setLabel('Full Name');
     $name->setRequired(true);
     $name->addValidator('StringLength', true, array(3, 128));
     $email = new Zend_Form_Element_Text('email');
     $email->setLabel('Email');
     $email->setRequired(true);
     $email->addValidator('EmailAddress', true);
     $email->addValidator('StringLength', true, array(3, 128));
     $submit = new Zend_Form_Element_Submit('register');
     $submit->setLabel('Register');
     $hash = new Zend_Form_Element_Hash('hash');
     $this->setElements(array($user, $password, $name, $email, $submit, $hash));
 }
 /**
  * Create user details form (single user).
  *
  * @return void
  */
 public function init()
 {
     // Invoke the agent user manager
     $agentUserManager = new Manager_Core_Agent_User();
     // Create array of possible security questions
     $securityQuestions = array('' => '--- please select ---');
     $securityQuestions += $agentUserManager->getUserSecurityAllQuestions();
     // Add real name element
     $this->addElement('text', 'realname', array('label' => 'Full name', 'required' => true, 'filters' => array('StringTrim'), 'validators' => array(array('NotEmpty', true, array('messages' => array('isEmpty' => 'Please enter your full name', 'notEmptyInvalid' => 'Please enter your full name'))), array('regex', true, array('pattern' => '/^[a-z\\-\\ \']{2,}$/i', 'messages' => 'Name must contain at least two alphabetic characters and only basic punctuation (hyphen, space and single quote)')))));
     // Add username element
     $this->addElement('text', 'username', array('label' => 'Username', 'required' => false, 'filters' => array('StringTrim'), 'validators' => array(array('NotEmpty', true, array('messages' => array('isEmpty' => 'Please enter your username', 'notEmptyInvalid' => 'Please enter your username'))), array('regex', true, array('pattern' => '/^[a-z0-9]{1,64}$/i', 'messages' => 'Username must contain between 1 and 64 alphanumeric characters')))));
     if ($this->_role == Model_Core_Agent_UserRole::MASTER) {
         $this->getElement('username')->setRequired(true);
     } else {
         $this->getElement('username')->setAttrib('disabled', 'disabled');
     }
     // Add password1 element
     $passwordElement1 = new Zend_Form_Element_Password('password1');
     $passwordElement1->setRequired(false);
     $passwordElement1->setLabel('New password:'******'password2');
     $validator->setMessage('Passwords are not the same', Zend_Validate_Identical::NOT_SAME);
     $passwordElement1->addValidator($validator);
     $passwordElement2 = new Zend_Form_Element_Password('password2');
     $passwordElement2->setRequired(false);
     $passwordElement2->setLabel('New password (again)');
     $this->addElement($passwordElement2);
     // Add e-mail element
     $this->addElement('text', 'email', array('label' => 'E-mail address', 'required' => false, 'filters' => array('StringTrim'), 'validators' => array(array('NotEmpty', true, array('messages' => array('isEmpty' => 'Please enter your e-mail address'))))));
     $emailValidator = new Zend_Validate_EmailAddress();
     $emailValidator->setMessages(array(Zend_Validate_EmailAddress::INVALID_HOSTNAME => 'Domain name invalid in e-mail address', Zend_Validate_EmailAddress::INVALID_FORMAT => 'Invalid e-mail address'));
     $this->getElement('email')->addValidator($emailValidator);
     if ($this->_role == Model_Core_Agent_UserRole::MASTER) {
         $this->getElement('email')->setRequired(true);
     } else {
         $this->getElement('email')->setAttrib('disabled', 'disabled');
     }
     // Add e-mail element
     $this->addElement('text', 'emailcopyto', array('label' => 'Copy e-mail to', 'required' => false, 'filters' => array('StringTrim'), 'validators' => array(array('NotEmpty', true, array('messages' => array('isEmpty' => 'Please enter a copy-to e-mail address'))))));
     $emailCopyToValidator = new Zend_Validate_EmailAddress();
     $emailCopyToValidator->setMessages(array(Zend_Validate_EmailAddress::INVALID_HOSTNAME => 'Domain name invalid in copy-to e-mail address', Zend_Validate_EmailAddress::INVALID_FORMAT => 'Invalid copy-to e-mail address'));
     $this->getElement('emailcopyto')->addValidator($emailCopyToValidator);
     // Add security question element
     $this->addElement('select', 'question', array('label' => 'Security question', 'required' => false, 'multiOptions' => $securityQuestions));
     // Add security answer element
     $this->addElement('text', 'answer', array('label' => 'Security answer', 'required' => false, 'filters' => array('StringTrim'), 'validators' => array(array('regex', true, array('pattern' => '/^[\\w\\ \\.\\-\'\\,]{2,}$/i', 'messages' => 'Security answer must contain at least two characters and only basic punctuation (hyphen, apostrophe, comma, full stop and space)')))));
     // Add master user element
     $this->addElement('checkbox', 'master', array('label' => 'Master user', 'required' => false, 'checkedValue' => '1', 'uncheckedValue' => '0'));
     // Add agent reports element
     $this->addElement('checkbox', 'reports', array('label' => 'Agent reports', 'required' => false, 'checkedValue' => '1', 'uncheckedValue' => '0'));
     // Add status element
     $this->addElement('checkbox', 'status', array('label' => 'Active', 'required' => false, 'checkedValue' => '1', 'uncheckedValue' => '0'));
     // Set custom subform decorator
     $this->setDecorators(array(array('ViewScript', array('viewScript' => 'settings/subforms/useraccount.phtml', 'role' => $this->_role))));
     $this->setElementFilters(array('StripTags'));
     $this->setElementDecorators(array(array('ViewHelper', array('escape' => false)), array('Label', array('escape' => false))));
 }
Example #11
0
 public function __construct($option = null)
 {
     parent::__construct($option);
     $this->setName('register');
     $this->setAttrib('class', 'input-group');
     $username = new Zend_Form_Element_Text('username');
     $username->setRequired(true)->setAttrib('class', "form-control")->addFilter(new Zend_Filter_StringTrim())->addValidator(new Zend_Validate_StringLength(4, 20))->addValidator('regex', true, array('/^[(a-zA-Z0-9)]+$/'))->setAttrib('placeholder', "Хэрэглэгчийн нэр")->addValidator('Db_NoRecordExists', true, array('table' => 'users', 'field' => 'username'))->setLabel("Дүн.мн хэрэглэгчийн бүртгүүлэх хэсэг");
     $password = new Zend_Form_Element_Password('password');
     $password->setRequired(true)->setAttrib('placeholder', "Нууц үг")->setAttrib('class', "form-control")->addFilter(new Zend_Filter_StringTrim())->addValidator(new Zend_Validate_StringLength(8, 20));
     $confirmPassword = new Zend_Form_Element_Password('confirm_password');
     $confirmPassword->setAttrib('class', "form-control");
     $token = Zend_Controller_Front::getInstance()->getRequest()->getPost('password');
     $confirmPassword->setRequired(true)->setAttrib('placeholder', "Нууц үгээ давтана уу?")->setAttrib('class', "form-control")->addFilter(new Zend_Filter_StringTrim())->addValidator(new Zend_Validate_Identical(trim($token)));
     $firstname = new Zend_Form_Element_Text('firstname');
     $firstname->setAttrib('placeholder', "Таны нэр")->addFilter(new Zend_Filter_StringTrim())->addValidator(new Zend_Validate_NotEmpty())->setAttrib('class', "form-control");
     $lastname = new Zend_Form_Element_Text('lastname');
     $lastname->setAttrib('placeholder', "Таны овог")->addFilter(new Zend_Filter_StringTrim())->addValidator(new Zend_Validate_NotEmpty())->setAttrib('class', "form-control");
     $date = new Zend_Form_Element_Text('date');
     $date->setAttrib('placeholder', "Төрсөн он сар өдөр (он-сар-өдөр)")->addFilter(new Zend_Filter_StringTrim())->addValidator(new Zend_Validate_NotEmpty())->setAttrib('class', "form-control");
     $email = new Zend_Form_Element_Text('email');
     $email->addFilters(array('StringTrim', 'StripTags'))->setAttrib('placeholder', "Таны цахим хаяг")->addValidator('EmailAddress', TRUE)->addValidator('Db_NoRecordExists', true, array('table' => 'users', 'field' => 'E-mail'))->addValidator(new Zend_Validate_NotEmpty())->setAttrib('class', "form-control");
     $submit = new Zend_Form_Element_Submit('register');
     $submit->setLabel('Бүртгүүлэх')->setAttrib('class', 'btn');
     $this->addElement($username);
     $this->addElement($password);
     $this->addElement($confirmPassword);
     $this->addElement($firstname);
     $this->addElement($lastname);
     $this->addElement($date);
     $this->addElement($email);
     $this->addElement($submit);
     $this->setMethod('post');
 }
Example #12
0
 private function getFormLogin()
 {
     $form = new Zend_Form(array('disableLoadDefaultDecorators' => true));
     $email = new Zend_Form_Element_Text('login', array('disableLoadDefaultDecorators' => true));
     $email->addDecorator('ViewHelper');
     $email->addDecorator('Errors');
     $email->setRequired(true);
     $email->setAttrib('class', 'form-control');
     $email->setAttrib('placeholder', 'Login');
     $email->setAttrib('required', 'required');
     $email->setAttrib('autofocus', 'autofocus');
     $password = new Zend_Form_Element_Password('password', array('disableLoadDefaultDecorators' => true));
     $password->addDecorator('ViewHelper');
     $password->addDecorator('Errors');
     $password->setRequired(true);
     $password->setAttrib('class', 'form-control');
     $password->setAttrib('placeholder', 'Hasło');
     $password->setAttrib('required', 'required');
     $password->setAttrib('autofocus', 'autofocus');
     $submit = new Zend_Form_Element_Submit('submit', array('disableLoadDefaultDecorators' => true));
     $submit->setAttrib('class', 'btn btn-lg btn-primary btn-block');
     $submit->setOptions(array('label' => 'Zaloguj'));
     $submit->addDecorator('ViewHelper')->addDecorator('Errors');
     $form->addElement($email)->addElement($password)->addElement($submit);
     return $form;
 }
Example #13
0
 public function init()
 {
     $this->setMethod('post');
     //The password element.
     $passwordElement = new Zend_Form_Element_Password('password');
     $passwordElement->setRequired(true);
     $passwordElement->setLabel('New Password:'******'confirm_password');
     $validator->setMessage('Passwords are not the same', Zend_Validate_Identical::NOT_SAME);
     $passwordElement->addValidator($validator);
     $this->addElement($passwordElement);
     //The confirm password element.
     $confirmPasswordElement = new Zend_Form_Element_Password('confirm_password');
     $confirmPasswordElement->setRequired(true);
     $confirmPasswordElement->setLabel('Confirm New Password:'******'Please confirm your password');
     $confirmPasswordElement->addValidator($validator);
     $this->addElement($confirmPasswordElement);
     // Security question & answer
     $this->addElement('select', 'security_question', array('label' => 'Security Question', 'required' => true, 'multiOptions' => array(0 => 'Please select'), 'decorators' => array(array('ViewHelper', array('escape' => false)), array('Label', array('escape' => false)))));
     $this->addElement('text', 'security_answer', array('label' => 'Answer', 'required' => true, 'filters' => array('StringTrim'), 'attribs' => array('data-ctfilter' => 'yes')));
     $this->addElement('hidden', 'instruction', array('required' => false));
     $this->addElement('submit', 'submit', array('ignore' => true, 'label' => 'Save', 'class' => 'button'));
     $this->setElementDecorators(array('ViewHelper', 'Label', 'Errors', array('HtmlTag', array('tag' => 'div'))));
     // Set up the decorator on the form and add in decorators which are removed
     $this->addDecorator('FormElements')->addDecorator('HtmlTag', array('tag' => 'div', 'class' => 'form_section one-col'))->addDecorator('Form');
     $element = $this->getElement('submit');
     $element->removeDecorator('label');
     // Remove the label from the submit button
 }
Example #14
0
 public function init()
 {
     $obj = new Application_Model_DbTable_User();
     $primaryKey = $obj->getPrimaryKey();
     $this->setMethod('post');
     $this->setEnctype('multipart/form-data');
     $this->setAttrib('codempr', $primaryKey);
     $this->setAction('/admin/index/update-pass');
     $e = new Zend_Form_Element_Password('password');
     $e->setRequired(true);
     $e->setAttrib('class', 'inpt-medium');
     $e->setAttrib('placeholder', 'Contraseña actual');
     $this->addElement($e);
     $e = new Zend_Form_Element_Password('confirmone');
     $e->setRequired(true);
     $e->setAttrib('class', 'inpt-medium');
     $e->setAttrib('placeholder', 'Nueva Contraseña');
     $this->addElement($e);
     $e = new Zend_Form_Element_Password('confirmtwo');
     $e->setRequired(true);
     $e->setAttrib('class', 'inpt-medium');
     $e->setAttrib('placeholder', 'Repetir Nueva Contraseña');
     $this->addElement($e);
     $e = new Zend_Form_Element_Submit('Cambiar');
     $this->addElement($e);
     foreach ($this->getElements() as $element) {
         $element->removeDecorator('Label');
         $element->removeDecorator('DtDdWrapper');
         $element->removeDecorator('HtmlTag');
     }
 }
Example #15
0
 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));
 }
Example #16
0
 public function init()
 {
     global $mySession;
     $db = new Db();
     # FORM ELEMENT:Public Name
     # TYPE : text
     $publicname = new Zend_Form_Element_Text('publicname');
     $publicname->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Public name is required'))->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib('class', 'logintextbox');
     # FORM ELEMENT:Email ID
     # TYPE : text
     $signupemailid = new Zend_Form_Element_Text('signupemailid');
     $signupemailid->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Email Id is required'))->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib('class', 'logintextbox');
     //->setAttrib("onchange","validval(this.value);")
     //->setAttrib("onclick","changeborder(this.id);")
     if (@$_REQUEST['signupemailid'] != "") {
         $signupemailid->addValidator('EmailAddress', true)->addDecorator('Errors', array('class' => 'errmsg'))->addErrorMessage('Please enter a valid email address');
     }
     # FORM ELEMENT:password
     # TYPE : text
     $signuppass = new Zend_Form_Element_Password('signuppass');
     $signuppass->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Password is required'))->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib('class', 'logintextbox');
     if (@$_REQUEST['signuppass'] != "") {
         $signuppass->addValidator('StringLength', 0, 6, true)->addErrorMessage('Password must be atleast 6 characters');
     }
     # FORM ELEMENT: confirm password
     # TYPE : text
     $signupcnfrmpass = new Zend_Form_Element_Password('signupcnfrmpass');
     $signupcnfrmpass->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Confirm Password is required'))->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib('class', 'logintextbox');
     if (@$_REQUEST['signupcnfrmpass'] != "") {
         $signupcnfrmpass->addValidator('StringLength', 0, 6, true)->addErrorMessage('Password must be atleast 6 characters');
     }
     $this->addElements(array($publicname, $signupemailid, $signuppass, $signupcnfrmpass));
 }
 /**
  *
  * 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();
 }
Example #18
0
 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;
 }
Example #19
0
 public function init()
 {
     $this->setMethod('post');
     //        $this->setAction('/index/login');
     $this->setAttrib('id', 'msform');
     $email = new Zend_Form_Element_Text('email');
     $email->setAttrib('placeholder', 'E-mail');
     $email->setAttrib('autocomplete', 'off');
     $email->addFilter('StripTags');
     $email->addFilter('HtmlEntities');
     $email->addFilter('StringTrim');
     $email->setRequired(true)->addErrorMessage('Username Required');
     $email->addValidator('EmailAddress')->addErrorMessage('Invalid Email used');
     $email->addValidator('StringLength', true, array(0, 255))->addErrorMessage('Required Field');
     $password = new Zend_Form_Element_Password('password');
     $password->setAttrib('placeholder', 'Password');
     $password->setAttrib('autocomplete', 'off');
     $password->addFilter('StripTags');
     $password->addFilter('HtmlEntities');
     $password->addFilter('StringTrim');
     $password->setRequired(true)->addErrorMessage('Password Required');
     $password->addValidator('StringLength', true, array(0, 255))->addErrorMessage('Required Field');
     $link = new Zend_Form_Element_Note('forgot_password', array('value' => '<a href="#" id="link">Forgot your password ?</a>'));
     $submit = new Zend_Form_Element_Submit('SignIn');
     $submit->setLabel('Sign In');
     $submit->setAttrib('class', 'btn btn-info');
     $register = new Zend_Form_Element_Button('register');
     $register->setLabel('Register');
     $register->setAttrib('class', 'btn btn-warning');
     $this->addElements(array($email, $password, $submit, $register, $link));
     $this->setElementDecorators(array('ViewHelper'));
     $submit->setDecorators(array('ViewHelper'));
     $register->setDecorators(array('ViewHelper'));
     $this->setDecorators(array('FormElements', 'Form'));
 }
Example #20
0
 private function _getPasswordElement()
 {
     $passwordLengthValidator = new Zend_Validate_StringLength();
     $passwordLengthValidator->setMin(4)->setMax(20);
     $passwordElement = new Zend_Form_Element_Password('Password');
     $passwordElement->setRequired()->setLabel('Password')->addValidator($passwordLengthValidator);
     return $passwordElement;
 }
Example #21
0
 public function init()
 {
     global $mySession;
     $new_password = new Zend_Form_Element_Password('new_password');
     $new_password->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'New password is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "mws-textinput required")->setAttrib("id", "new_password");
     $confirm_new_password = new Zend_Form_Element_Password('confirm_new_password');
     $confirm_new_password->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Confirm new password is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "mws-textinput equals required")->setAttrib("id", "confirm_new_password");
     $this->addElements(array($new_password, $confirm_new_password));
 }
Example #22
0
 /**
  * (non-PHPdoc)
  * @see library/Zend/Form/Zend_Form_Element#setRequired()
  */
 public function setRequired($flag = true)
 {
     // call the CrFramework form element common setRequired function
     // refer to CrFramework_Form_Element_ElementCommon.php
     CrFramework_Form_Element_ElementCommon::setRequired($this, $flag);
     // call parent's method
     parent::setRequired($flag);
     return $this;
 }
Example #23
0
 public function init()
 {
     global $mySession;
     $email_address = new Zend_Form_Element_Text('email_address');
     $email_address->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Email address is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("id", "email_address")->setAttrib("class", "mws-textinput required noSpace");
     $password = new Zend_Form_Element_Password('password');
     $password->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Password is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("id", "password")->setAttrib("class", "mws-textinput required");
     $this->addElements(array($email_address, $password));
 }
Example #24
0
 public function init()
 {
     global $mySession;
     $db = new Db();
     $admin_username = new Zend_Form_Element_Text('admin_username');
     $admin_username->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Fill me please'))->addDecorator('Errors', array('class' => 'error1'))->setAttrib("class", "span12 text ");
     $admin_password = new Zend_Form_Element_Password('admin_password');
     $admin_password->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Please provide a password'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "span12 password valid");
     $this->addElements(array($admin_username, $admin_password));
 }
Example #25
0
 public function init()
 {
     global $mySession;
     $db = new Db();
     $new_password = new Zend_Form_Element_Password('new_password');
     $new_password->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Please enter you new password.'))->addDecorator('Errors', array('class' => 'errormsg'))->setAttrib("class", "mws-textinput required");
     $confirm_new_password = new Zend_Form_Element_Password('confirm_new_password');
     $confirm_new_password->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Please confirm your new password.'))->addDecorator('Errors', array('class' => 'errormsg'))->setAttrib("class", "mws-textinput required");
     $this->addElements(array($new_password, $confirm_new_password));
 }
Example #26
0
 /** Main form */
 public function createMigrateForm($assetstores)
 {
     // Setup the form
     $form = new Zend_Form();
     $form->setAction('migratemidas2');
     $form->setName('migrateForm');
     $form->setMethod('post');
     $form->setAttrib('class', 'migrateForm');
     // Input directory
     $midas2_hostname = new Zend_Form_Element_Text('midas2_hostname', array('label' => $this->t('MIDAS2 Hostname'), 'size' => 60, 'value' => 'localhost'));
     $midas2_hostname->setRequired(true);
     $form->addElement($midas2_hostname);
     $midas2_port = new Zend_Form_Element_Text('midas2_port', array('label' => $this->t('MIDAS2 Port'), 'size' => 4, 'value' => '5432'));
     $midas2_port->setRequired(true);
     $midas2_port->setValidators(array(new Zend_Validate_Digits()));
     $form->addElement($midas2_port);
     $midas2_user = new Zend_Form_Element_Text('midas2_user', array('label' => $this->t('MIDAS2 User'), 'size' => 60, 'value' => 'midas'));
     $midas2_user->setRequired(true);
     $form->addElement($midas2_user);
     $midas2_password = new Zend_Form_Element_Password('midas2_password', array('label' => $this->t('MIDAS2 Password'), 'size' => 60, 'value' => 'midas'));
     $midas2_password->setRequired(true);
     $form->addElement($midas2_password);
     $midas2_database = new Zend_Form_Element_Text('midas2_database', array('label' => $this->t('MIDAS2 Database'), ' size' => 60, 'value' => 'midas'));
     $midas2_database->setRequired(true);
     $form->addElement($midas2_database);
     $midas2_assetstore = new Zend_Form_Element_Text('midas2_assetstore', array('label' => $this->t('MIDAS2 Assetstore Path'), 'size' => 60, 'value' => 'C:/xampp/midas/assetstore'));
     $midas2_assetstore->setRequired(true);
     $form->addElement($midas2_assetstore);
     // Button to select the directory on the server
     $midas2_assetstore_button = new Zend_Form_Element_Button('midas2_assetstore_button', $this->t('Choose'));
     $midas2_assetstore_button->setDecorators(array('ViewHelper', array('HtmlTag', array('tag' => 'div', 'class' => 'browse-button')), array('Label', array('tag' => 'div', 'style' => 'display:none'))));
     $form->addElement($midas2_assetstore_button);
     // Assetstore
     $assetstoredisplay = array();
     $assetstoredisplay[0] = $this->t('Choose one...');
     // Initialize with the first type (MIDAS)
     foreach ($assetstores as $assetstore) {
         if ($assetstore->getType() == 0) {
             $assetstoredisplay[$assetstore->getAssetstoreId()] = $assetstore->getName();
         }
     }
     $assetstore = new Zend_Form_Element_Select('assetstore');
     $assetstore->setLabel($this->t('MIDAS3 Assetstore'));
     $assetstore->setMultiOptions($assetstoredisplay);
     $assetstore->setDescription(' <a class="load-newassetstore" href="#newassetstore-form" rel="#newassetstore-form" title="' . $this->t('Add a new assetstore') . '"> ' . $this->t('Add a new assetstore') . '</a>')->setDecorators(array('ViewHelper', array('Description', array('escape' => false, 'tag' => false)), array('HtmlTag', array('tag' => 'dd')), array('Label', array('tag' => 'dt')), 'Errors'));
     $assetstore->setRequired(true);
     $assetstore->setValidators(array(new Zend_Validate_GreaterThan(array('min' => 0))));
     $assetstore->setRegisterInArrayValidator(false);
     // This array is dynamic so we disable the validator
     $form->addElement($assetstore);
     // Submit
     $submit = new Zend_Form_Element_Button('migratesubmit', $this->t('Migrate'));
     $form->addElement($submit);
     return $form;
 }
Example #27
0
 public function init()
 {
     /* Form Elements & Other Definitions Here ... */
     $this->setMethod("POST");
     $uid = new Zend_Form_Element_Hidden("user_id");
     //add firstname
     $f_name = new Zend_Form_Element_Text("f_name");
     $f_name->setRequired();
     $f_name->setLabel("first Name:");
     $f_name->setAttrib("placeholder", "Enter Your first Name");
     $f_name->addValidator(new Zend_Validate_Alnum("true"));
     $f_name->setAttrib("class", "form-control");
     $f_name->getDecorator("Label")->setOption("class", "control-label");
     $f_name->getDecorator("Errors")->setOption("class", "alert alert-danger");
     $f_name->getDecorator("Errors")->setOption("style", " list-style-type:none");
     //add lastname
     $l_name = new Zend_Form_Element_Text("l_name");
     $l_name->setRequired();
     $l_name->setLabel("Last Name");
     $l_name->setAttrib("placeholder", "Enter Your last Name");
     $l_name->addValidator(new Zend_Validate_Alnum("true"));
     $l_name->setAttrib("class", "form-control");
     $l_name->getDecorator("Label")->setOption("class", "control-label");
     $l_name->getDecorator("Errors")->setOption("class", "alert alert-danger");
     $l_name->getDecorator("Errors")->setOption("style", " list-style-type:none");
     //add mail
     $username = new Zend_Form_Element_Text("username");
     $username->setRequired();
     $username->setLabel("E-Mail");
     $username->setAttrib("placeholder", "Enter Your E-Mail");
     $username->addValidator(new Zend_Validate_EmailAddress());
     $username->getDecorator("Label")->setOption("class", "control-label");
     $username->getDecorator("Errors")->setOption("class", "alert alert-danger");
     $username->getDecorator("Errors")->setOption("style", " list-style-type:none");
     $password = new Zend_Form_Element_Password("password");
     $password->setRequired();
     $password->setLabel("Password");
     $password->setAttrib("placeholder", "Enter Your Password");
     $password->setAttrib("class", "form-control");
     $password->getDecorator("Label")->setOption("class", "control-label");
     $password->getDecorator("Errors")->setOption("class", "alert alert-danger");
     $password->getDecorator("Errors")->setOption("style", " list-style-type:none");
     $re_password = new Zend_Form_Element_Password("re_password");
     $re_password->setRequired();
     $re_password->setLabel("Retype Your Password");
     $re_password->addValidator('identical', false, array('token' => 'password'));
     $re_password->setAttrib("placeholder", "Re-enter Your Password");
     $re_password->setAttrib("class", "form-control");
     $re_password->getDecorator("Label")->setOption("class", "control-label");
     $re_password->getDecorator("Errors")->setOption("class", "alert alert-danger");
     $re_password->getDecorator("Errors")->setOption("style", " list-style-type:none");
     $submit = new Zend_Form_Element_Submit("submit");
     $submit->setAttrib("class", "btn btn-xl center-block");
     $this->addElements(array($uid, $f_name, $l_name, $username, $password, $re_password, $submit));
 }
Example #28
0
 public function init()
 {
     $obj = new Application_Model_DbTable_User();
     $primaryKey = $obj->getPrimaryKey();
     $this->setMethod('post');
     $this->setEnctype('multipart/form-data');
     $this->setAttrib('iduser', $primaryKey);
     $this->setAction('/admin/usuarios/edit');
     $e = new Zend_Form_Element_Hidden($primaryKey);
     $this->addElement($e);
     $objType = new Admin_Model_Role();
     $e = new Zend_Form_Element_Select('idrol');
     $e->setMultiOptions($objType->getRoleAll());
     $this->addElement($e);
     $e = new Zend_Form_Element_Text('email');
     $e->setAttrib('class', 'inpt-medium');
     $e->setAttrib('placeholder', 'Correo');
     $this->addElement($e);
     $e = new Zend_Form_Element_Text('login');
     $e->setAttrib('class', 'inpt-medium');
     $e->setAttrib('placeholder', 'usuario');
     $this->addElement($e);
     $e = new Zend_Form_Element_Text('name');
     $e->setAttrib('class', 'inpt-medium');
     $e->setAttrib('placeholder', 'nombre');
     $this->addElement($e);
     $e = new Zend_Form_Element_Text('apepat');
     $e->setAttrib('class', 'inpt-medium');
     $e->setAttrib('placeholder', 'Apellido Paterno');
     $this->addElement($e);
     $e = new Zend_Form_Element_Text('apemat');
     $e->setAttrib('class', 'inpt-medium');
     $e->setAttrib('placeholder', 'Apellido Materno');
     $this->addElement($e);
     $e = new Zend_Form_Element_Submit('Guardar');
     $this->addElement($e);
     $e = new Zend_Form_Element_Checkbox('state');
     $e->setValue(true);
     $this->addElement($e);
     $e = new Zend_Form_Element_Password('confirmone');
     $e->setRequired(false);
     $e->setAttrib('class', 'inpt-medium');
     $e->setAttrib('placeholder', 'Contraseña');
     $this->addElement($e);
     $e = new Zend_Form_Element_Password('confirmtwo');
     $e->setRequired(false);
     $e->setAttrib('class', 'inpt-medium');
     $e->setAttrib('placeholder', 'Repetir Contraseña');
     $this->addElement($e);
     foreach ($this->getElements() as $element) {
         $element->removeDecorator('Label');
         $element->removeDecorator('DtDdWrapper');
         $element->removeDecorator('HtmlTag');
     }
 }
Example #29
0
 public function init()
 {
     $element = new Zend_Form_Element_Password('passwordnew');
     $element->setRequired();
     $element->setAttrib('placeholder', $this->_t('******'));
     $element->setLabel($this->_t('New Password'));
     $this->addElement($element);
     $this->addConfirmPassword();
     $this->addSubmit($this->_t('Update Password'));
     $this->setMethod('post');
 }
Example #30
0
 public function __construct($options = null, $memberOfGroups = array(), $modeEdit = false)
 {
     parent::__construct($options);
     // get request
     $request = UsersFormOp::getParams('request');
     $this->setAttrib('accept-charset', 'UTF-8');
     $this->setName('users');
     $this->setAction('/publicms/profile/processuser/format/json');
     $id = new Zend_Form_Element_Hidden('id');
     $module = new Zend_Form_Element_Hidden('module');
     $module->setValue($request->module);
     $controller = new Zend_Form_Element_Hidden('controller');
     $controller->setValue($request->controller);
     $login = new Zend_Form_Element_Text('login');
     $login->setLabel('E-mail');
     $login->addValidator(new Zend_Validate_EmailAddress());
     //$login->setDescription('Must be a valid e-mail address');
     if ($modeEdit) {
         $login->setAttrib('disabled', true);
         $login->setAttrib('readonly', true);
     } else {
         $login->setRequired();
     }
     /**
      * Password field
      * @var void
      */
     $password = new Zend_Form_Element_Password('password');
     $password->setLabel('password');
     $password->addValidator(new Zend_Validate_StringLength(array('min' => 6, 'max' => 12)));
     $password2 = new Zend_Form_Element_Password('password2');
     $password2->setLabel('password2');
     $this->password = $password;
     $this->password2 = $password2;
     if (!$modeEdit) {
         $password->setRequired();
         $password2->setRequired();
     }
     $fileName = new Zend_Form_Element_Text('fname');
     $fileName->setLabel('fname');
     $fileName->setRequired();
     $lastName = new Zend_Form_Element_Text('lname');
     $lastName->setLabel('lname');
     $lastName->setRequired();
     $submit = new Zend_Form_Element_Submit('submit', 'Save user');
     $submit->setAttrib('id', 'submitbuttonuser');
     // Init list of elements
     $elementsList[0] = array($login, $password, $password2);
     $elementsList[1] = array($fileName, $lastName, $submit, $id, $module, $controller);
     $this->addElements($elementsList[0]);
     $this->addElements($elementsList[1]);
 }