Exemple #1
0
 /**
  * @return Form
  */
 public function create()
 {
     $form = new Form();
     $form->enableLocalized();
     $form->addText('email')->setRequired('errors.fill_email')->setAttribute('class', 'form-control')->setAttribute('placeholder', 'email')->addRule(Form::EMAIL, 'errors.fill_email_success');
     $form->addPassword('password')->setRequired('errors.fill_password')->setAttribute('class', 'form-control')->setAttribute('placeholder', 'password');
     $form->addCheckbox('remember', 'remember');
     $form->addSubmit('submit', 'login')->setAttribute('class', 'btn btn-primary btn-purple btn-flat');
     $form->onSuccess[] = array($this, 'formSucceeded');
     return $form;
 }
 public function editPass($id)
 {
     $this->user_id = $id;
     $form = new Form();
     $form->enableLocalized();
     $form->addPassword('password')->setRequired('errors.fill_password')->setAttribute('class', 'form-control')->setAttribute('placeholder', 'password');
     $form->addPassword('password2')->setRequired('errors.password_authentication')->setAttribute('class', 'form-control')->addRule(Form::EQUAL, 'errors.passwords_match', $form['password'])->setAttribute('placeholder', 'password_retry');
     $form->addSubmit('submit', 'edit')->setAttribute('class', 'btn btn-primary btn-purple btn-flat');
     $form->onSuccess[] = $this->success_form_pass;
     return $form;
 }
Exemple #3
0
 /**
  * @return Form
  */
 public function create($name)
 {
     $form = new Form();
     $form->enableLocalized();
     $text = $this->textManager->getText($name);
     $this->text = $text;
     $form->addTextArea('text')->setValue($text->text)->setAttribute('id', 'ckeditor');
     $form->addSubmit('submit', 'save')->setAttribute('class', 'btn btn-primary btn-purple btn-flat');
     $form->onSuccess[] = array($this, 'formSucceeded');
     return $form;
 }
Exemple #4
0
 public function create()
 {
     $form = new Form();
     $form->enableLocalized();
     $form->addText('name')->setRequired('errors.fill_role_name')->setAttribute('class', 'form-control')->setAttribute('placeholder', 'role_name');
     $form->addTextArea('access', 'role_access')->setAttribute('class', 'form-control');
     $form->addTextArea('description', 'description')->setAttribute('class', 'form-control');
     $form->addTextArea('access_ban', 'access_ban')->setAttribute('class', 'form-control');
     $form->addSubmit('submit', 'add')->setAttribute('class', 'btn btn-primary btn-purple btn-flat');
     $form->onSuccess[] = $this->success_form_add;
     return $form;
 }
Exemple #5
0
 public function create()
 {
     $form = new Form();
     $form->enableLocalized();
     $form->addText('username')->setRequired('errors.fill_user_name')->setAttribute('class', 'form-control')->setAttribute('placeholder', 'user_name');
     $form->addUpload('img')->setAttribute('class', 'form-control')->setAttribute('placeholder', 'img')->addCondition(Form::FILLED)->addRule(Form::IMAGE, 'errors.img');
     $form->addText('email')->setRequired('errors.fill_email')->setAttribute('class', 'form-control')->setAttribute('placeholder', 'email')->addRule(Form::EMAIL, 'errors.fill_email_success')->addRule($this->checkEmail, 'errors.email_used');
     $form->addSelect('role', $form->translate('role'), $this->getRoleList())->setRequired('errors.role')->setTranslator(null)->setAttribute('class', 'form-control');
     $form->addPassword('password')->setRequired('errors.enter_password')->setAttribute('class', 'form-control')->setAttribute('placeholder', 'password');
     $form->addPassword('password2')->setRequired('errors.enter_password_retry')->setAttribute('class', 'form-control')->addRule(Form::EQUAL, 'errors.password_must_match', $form['password'])->setAttribute('placeholder', 'password_retry');
     $form->addSubmit('submit', 'register')->setAttribute('class', 'btn btn-primary btn-purple btn-flat');
     $form->onSuccess[] = $this->success_form_add;
     return $form;
 }
Exemple #6
0
 /**
  * 
  * @param integer $id
  * @return Form
  */
 public function create($id)
 {
     $this->user_id = $id;
     $user = $this->user_manager->getUser($id);
     $form = new Form();
     $form->enableLocalized();
     $form->addText('name')->setValue($user->name)->setRequired('errors.fill_user_name')->setAttribute('class', 'form-control')->setAttribute('placeholder', 'name_surname');
     $form->addText('email')->setValue($user->email)->setRequired('errors.fill_email')->setAttribute('class', 'form-control')->setAttribute('placeholder', 'email')->addRule(Form::EMAIL, 'errors.fill_email_success')->addRule($this->checkEmailUpdate, 'errors.email_used');
     $form->addPassword('password')->setRequired('errors.fill_password')->setAttribute('class', 'form-control')->setAttribute('placeholder', 'password');
     $form->addUpload('img')->setAttribute('class', 'form-control')->setAttribute('placeholder', 'img')->addCondition(Form::FILLED)->addRule(Form::IMAGE, 'errors.img');
     $form->addPassword('password2')->setRequired('errors.enter_password_retry')->setAttribute('class', 'form-control')->addRule(Form::EQUAL, 'errors.password_must_match', $form['password'])->setAttribute('placeholder', 'password_retry');
     $form->addSubmit('submit', 'edit')->setAttribute('class', 'btn btn-primary btn-purple btn-flat');
     $form->onSuccess[] = $this->success_form;
     return $form;
 }