Exemplo n.º 1
0
 public static function createForm()
 {
     $form = new \Ip\Form();
     $form->addAttribute('autocomplete', 'off');
     $field = new \Ip\Form\Field\Text(array('name' => 'username', 'label' => __('User name', 'Ip-admin', false)));
     $field->addValidator("Required");
     $field->addValidator(array('Unique', array('table' => 'administrator')));
     $form->addField($field);
     $field = new \Ip\Form\Field\Text(array('name' => 'email', 'label' => __('Email', 'Ip-admin', false)));
     $field->addValidator("Required");
     $form->addField($field);
     $field = new \Ip\Form\Field\Password(array('name' => 'password', 'label' => __('Password', 'Ip-admin', false)));
     $field->addValidator("Required");
     $form->addField($field);
     $field = new \Ip\Form\Field\Hidden(array('name' => 'aa', 'value' => 'Administrators.add'));
     $form->addField($field);
     return $form;
 }
Exemplo n.º 2
0
 public static function createForm()
 {
     $form = new \Ip\Form();
     // Password input
     $field = new \Ip\Form\Field\Password(array('layout' => \Ip\Form\Field::LAYOUT_NO_LABEL, 'name' => 'pagePassword', 'label' => __('Password', 'PagePassword', false), 'validators' => array('Required')));
     $field->addAttribute('id', 'auth_password');
     $field->addClass('auth_password');
     $form->addField($field);
     // Submit Button
     $field = new \Ip\Form\Field\Submit(array('value' => __('Authenticate', 'PagePassword', false)));
     $field->addAttribute('id', 'auth_submit');
     $field->addClass('auth_submit');
     $form->addField($field);
     $form->addAttribute('id', 'auth_form');
     $form->addClass('auth_form');
     $curUrl = \Ip\Internal\UrlHelper::getCurrentUrl();
     $form->setAction($curUrl);
     $form->setAjaxSubmit(false);
     return $form;
 }
Exemplo n.º 3
0
 public function createField()
 {
     $field = new \Ip\Form\Field\Password(array('label' => $this->label, 'name' => $this->field, 'layout' => $this->layout, 'attributes' => $this->attributes));
     $field->setValue($this->defaultValue);
     return $field;
 }
Exemplo n.º 4
0
 public static function getPasswordResetForm2()
 {
     //create form object
     $form = new \Ip\Form();
     //add text field to form object
     $field = new \Ip\Form\Field\Hidden(array('name' => 'sa', 'value' => 'Admin.passwordResetAjax2'));
     $form->addfield($field);
     //add text field to form object
     $field = new \Ip\Form\Field\Hidden(array('name' => 'secret', 'value' => ipRequest()->getQuery('secret', '')));
     $form->addfield($field);
     //add text field to form object
     $field = new \Ip\Form\Field\Hidden(array('name' => 'userId', 'value' => ipRequest()->getQuery('id', '')));
     $form->addfield($field);
     //add text field to form object
     $field = new \Ip\Form\Field\Blank(array('name' => 'global_error'));
     $form->addfield($field);
     //add text field to form object
     $field = new \Ip\Form\Field\Password(array('name' => 'password', 'label' => __('New password', 'Ip-admin', false)));
     $field->addValidator('Required');
     $form->addField($field);
     //add text field to form object
     $field = new \Ip\Form\Field\Submit(array('value' => __('Save', 'Ip-admin', false)));
     $field->addClass('ipsLoginButton');
     $form->addField($field);
     $form->addClass('ipsPasswordResetForm2');
     return $form;
 }