Example #1
0
 public function initialize($entity = null, $user_options = null)
 {
     //no need for it
     $this->setCsrf(false);
     //delete button
     $delete = new Element\Submit('submit_delete');
     $delete->setLabel('delete');
     $delete->setUserOption('icon', 'trash');
     $delete->setAttributes(array('value' => 'Delete', 'class' => 'btn btn-danger btn-xs pull-left margin-right-xs'));
     $this->add($delete);
 }
Example #2
0
 public function initialize($entity = null, $options = null)
 {
     // Name
     $name = new Text('nome', ['class' => 'form-control']);
     $name->setLabel('Nome');
     $name->setFilters(array('striptags', 'string'));
     $name->addValidators(array(new PresenceOf(array('message' => 'É necessário preencher o Nome'))));
     $this->add($name);
     // Email
     $email = new Text('email', ['class' => 'form-control']);
     $email->setLabel('E-Mail');
     $email->setFilters('email');
     $email->addValidators(array(new PresenceOf(array('message' => 'É necessário preencher o E-mail')), new Email(array('message' => 'Formato de E-mail inválido'))));
     $this->add($email);
     // Password
     $password = new Password('senha', ['class' => 'form-control']);
     $password->setLabel('Senha');
     $password->addValidators(array(new PresenceOf(array('message' => 'É necessário preencher a Senha'))));
     $this->add($password);
     // Confirm Password
     $repeatPassword = new Password('confirmar', ['class' => 'form-control']);
     $repeatPassword->setLabel('Confirmar Senha');
     $repeatPassword->addValidators(array(new PresenceOf(array('message' => 'É necessário preencher Confirmar Senha')), new Confirmation(['message' => 'Erro na Confirmação da Senha', 'with' => 'senha'])));
     $this->add($repeatPassword);
     // CPF
     $cpf = new Text('cpf', ['class' => 'form-control']);
     $cpf->setLabel('CPF');
     $cpf->setFilters(array('striptags', 'string'));
     $cpf->addValidators(array(new PresenceOf(array('message' => 'É necessário preencher o CPF')), new Cpf()));
     $this->add($cpf);
     // RG
     /*
     $rg = new Text('rg', ['class' => 'form-control']);
     $rg->setLabel('RG');
     $rg->setFilters(array('striptags', 'string'));
     $this->add($rg);
     */
     // Telefone
     $telefone = new Text('telefone', ['class' => 'form-control']);
     $telefone->setLabel('Telefone');
     $telefone->setFilters(array('striptags', 'string'));
     $this->add($telefone);
     // Celular
     $celular = new Text('celular', ['class' => 'form-control']);
     $celular->setLabel('celular');
     $celular->setFilters(array('striptags', 'string'));
     $this->add($celular);
     // Submit
     $submit = new Submit('Enviar', ['class' => 'btn btn-default']);
     $submit->setLabel(' ');
     $this->add($submit);
 }
Example #3
0
 public function initialize()
 {
     // CSRF
     $csrf = new Hidden('csrf');
     $csrf->addValidator(new Identical(array('value' => $this->security->getSessionToken(), 'message' => t('CSRF validation failed'))));
     $this->add($csrf);
     $unauthor = new Submit('unauthor', ['name' => 'unauthor', 'value' => 'Go to setting', 'class' => 'btn btn-sm btn-warning']);
     $unauthor->setLabel("This feature need to be configured");
     $this->add($unauthor);
     $profile = new Submit('profile', ['name' => 'profile', 'value' => 'Go to setting', 'class' => 'btn btn-sm btn-warning']);
     $profile->setLabel("You must select view before use this feature");
     $this->add($profile);
 }
Example #4
0
 public function initialize($entity = null, $user_options = null)
 {
     //no need for it
     $this->setCsrf(false);
     //keyword
     $keyword = new Element\Text('keyword');
     $keyword->setLabel('keyword');
     $keyword->setFilters(array('striptags', 'trim'));
     $this->add($keyword);
     //search button
     $submit_search = new Element\Submit('submit_search');
     $submit_search->setLabel('search');
     $submit_search->setUserOption('icon', 'search');
     $submit_search->setAttributes(array('value' => $this->translator->_('search'), 'class' => 'btn btn-primary'));
     $this->add($submit_search);
 }
Example #5
0
 public function initialize($para, $analytic)
 {
     $trackingID = Settings::getAnalyticTrackingID();
     $accountID = Settings::getAnalyticAccountID();
     // CSRF
     $csrf = new Hidden('csrf');
     $csrf->addValidator(new Identical(array('value' => $this->security->getSessionToken(), 'message' => t('CSRF validation failed'))));
     $this->add($csrf);
     $this->add(new Submit('save', ['name' => 'save', 'value' => 'Save Changes', 'class' => 'btn btn-sm btn-info']));
     $author = new Submit('author', ['name' => 'author', 'value' => 'Authorization', 'class' => 'btn btn-sm btn-info']);
     $author->setLabel("Authorization this feature with Google");
     $this->add($author);
     $unauthor = new Submit('unauthor', ['name' => 'unauthor', 'value' => 'Clear Authorization', 'class' => 'btn btn-sm btn-warning']);
     $unauthor->setLabel("This feature had been actived. Clear authorization ?");
     $this->add($unauthor);
     $accessCode = new Text('accessCode', ['placeholder' => t('Access Code'), 'class' => 'form-control', 'value' => '']);
     $accessCode->setLabel('Access Code');
     $this->add($accessCode);
     $listView = $analytic->getListView();
     $listViewDisplay = [];
     if ($listView['state']) {
         foreach ($listView['listView'] as $view) {
             $parse = parse_url($view['profileURL']);
             $listViewDisplay[$view['webPropertyId'] . "_._" . $view['accountID']] = $parse['host'] . " => " . $view['profileName'];
         }
     }
     $selectView = new Select("selectView", $listViewDisplay, ['class' => 'form-control', 'useEmpty' => true, 'emptyText' => 'Please, choose one...']);
     $selectView->setLabel('Select View ');
     $selectView->setDefault($trackingID . "_._" . $accountID);
     $this->add($selectView);
     $data = Settings::getListTopActivity();
     $listTopActivity = [];
     $listDefaultActivity = [];
     foreach ($data as $activity) {
         $listTopActivity[$activity->code] = $activity->name;
         if ($activity->default == 1) {
             $listDefaultActivity[] = $activity->code;
         }
     }
     $topActivity = new Select("topActivity", $listTopActivity, ['name' => 'topActivity[]', 'class' => 'form-control', 'multiple' => 'multiple']);
     $topActivity->setLabel('Select 4 activity on top of dashboard');
     $topActivity->setDefault($listDefaultActivity);
     $this->add($topActivity);
 }
 public function initialize()
 {
     $login = new Text('login', array('required' => true));
     $login->setLabel($this->helper->translate('Login'));
     $email = new Email('email', array('required' => true));
     $email->addValidator(new ValidatorEmail(array('message' => $this->helper->translate('Email format required'))));
     $email->addValidator(new PresenceOf(array('message' => $this->helper->translate('Email is required'))));
     $email->setLabel('Email');
     $password = new Password('password');
     $password->setLabel($this->helper->translate('Password'));
     $active = new Check('active');
     $active->setLabel($this->helper->translate('Active'));
     $submit = new Submit('submit', array('class' => 'btn btn-primary'));
     $submit->setDefault($this->helper->translate('Save'));
     $this->add($login);
     $this->add($email);
     $this->add($password);
     $this->add($active);
     $this->add($submit);
 }
 public function initialize()
 {
     $old_password = new Password('old_password');
     $old_password->setLabel('原始密码');
     $old_password->setFilters('trim');
     $old_password->addValidators([new PresenceOf(['message' => '原始密码必填']), new StringLength(['min' => 6, 'messageMinimum' => '原始密码长度应大于6'])]);
     $this->add($old_password);
     $new_password = new Password('new_password');
     $new_password->setLabel('新密码');
     $old_password->setFilters('trim');
     $new_password->addValidators([new PresenceOf(['message' => '新密码必填']), new StringLength(['min' => 6, 'messageMinimum' => '新密码长度应大于6'])]);
     $this->add($new_password);
     $new_password_confirm = new Password('new_password_confirm');
     $new_password_confirm->setLabel('确认新密码');
     $old_password->setFilters('trim');
     $new_password_confirm->addValidators([new PresenceOf(['message' => '确认新密码必填']), new StringLength(['min' => 6, 'messageMinimum' => '确认新密码长度应大于6']), new Confirmation(['message' => '新密码必须和确认密码一致', 'with' => 'new_password'])]);
     $this->add($new_password_confirm);
     $submit = new Submit('submit');
     $submit->setAttribute('value', '保存');
     $this->add($submit);
 }
Example #8
0
 public function initialize($entity = null, $user_options = array())
 {
     $curr_password = new Element\Password('current_password');
     $curr_password->setLabel('Current Password');
     $curr_password->setFilters(array('striptags', 'trim'));
     $curr_password->addValidators(array(new EveValidator\User\PasswordCheck()));
     $this->add($curr_password);
     $password = new Element\Password('password');
     $password->setLabel('New Password');
     $password->setFilters(array('striptags', 'trim'));
     $password->addValidators(array(new Validator\Regex(array('pattern' => '/[A-Za-z\\d\\W]+/i', 'message' => 'Password must be greater than 6 characters')), new Validator\StringLength(array('max' => 100, 'min' => 6, 'messageMaximum' => 'Password is too long', 'messageMinimum' => 'Password is too short'))));
     $password->setAttributes(array('data-toggle' => 'popover', 'data-content' => 'Password must be greater than 6 characters', 'data-title' => 'Help'));
     $this->add($password);
     $password_again = new Element\Password('password_again');
     $password_again->setLabel('Re-enter New Password');
     $password_again->setFilters(array('striptags', 'trim'));
     $password_again->addValidators(array(new Validator\Confirmation(array('message' => 'Passwords do not match', 'with' => 'password'))));
     $this->add($password_again);
     $submit = new Element\Submit('submit');
     $submit->setLabel('Save');
     $submit->setUserOption('icon', 'user');
     $submit->setAttribute('value', 'Save');
     $submit->setAttribute('class', 'btn btn-primary');
     $this->add($submit);
 }
Example #9
0
 public function initialize($entity = null, $options = null)
 {
     // Name
     $name = new Text('key', ['class' => 'form-control']);
     $name->setLabel('Chave');
     $name->setFilters(array('striptags', 'string'));
     $name->addValidators(array(new PresenceOf(array('message' => 'É necessário preencher a Chave'))));
     //$this->add($name);
     // Email
     $email = new Text('email', ['class' => 'form-control']);
     $email->setLabel('E-Mail');
     $email->setFilters('email');
     $email->addValidators(array(new PresenceOf(array('message' => 'É necessário preencher o E-mail')), new Email(array('message' => 'Formato de E-mail inválido'))));
     $this->add($email);
     // Password
     $password = new Password('senha', ['class' => 'form-control']);
     $password->setLabel('Senha');
     $password->addValidators(array(new PresenceOf(array('message' => 'É necessário preencher a Senha'))));
     $this->add($password);
     // Submit
     $submit = new Submit('Enviar', ['class' => 'btn btn-default']);
     $submit->setLabel(' ');
     $this->add($submit);
 }
Example #10
0
 public function initialize($entity = null, $user_options = array())
 {
     $fit = new EveElement\Select('fit_id', new ChoiceList\CharacterFit($this->session->get('auth')));
     $fit->setLabel('Character / Fit');
     $fit->addValidator(new Validator\PresenceOf(array('message' => 'This field is required')));
     $this->add($fit);
     $submit = new Element\Submit('list_add_submit');
     $submit->setLabel('Add to List');
     $submit->setUserOption('icon', 'plus');
     $submit->setAttribute('value', 'Add to List');
     $submit->setAttribute('class', 'btn btn-primary');
     $this->add($submit);
 }
Example #11
0
 public function initialize($entity = null, $user_options = array())
 {
     $mission = new EveElement\Select('mission', new ChoiceList\Mission());
     $mission->setLabel('Choose a mission');
     $mission->addValidator(new Validator\PresenceOf(array('message' => 'This field is required')));
     $this->add($mission);
     $submit = new Element\Submit('mission_submit');
     $submit->setLabel('Go');
     $submit->setUserOption('icon', 'plus');
     $submit->setAttribute('value', 'Go');
     $submit->setAttribute('class', 'btn btn-primary');
     $this->add($submit);
 }
Example #12
0
 public function initialize($entity = null, $user_options = array())
 {
     // Login details
     $username = new Element\Text('username');
     $username->setLabel('Email');
     $username->setFilters(array('striptags', 'trim'));
     $username->addValidators(array(new Validator\Email(array('message' => 'This is not a valid email')), new EveValidator\User\Unique(array('message' => 'Email already registered'))));
     $username->setAttributes(array('data-toggle' => 'popover', 'data-content' => 'Enter an email address', 'data-title' => 'Help'));
     $this->add($username);
     $username_again = new Element\Text('username_again');
     $username_again->setLabel('Re-enter email');
     $username_again->setFilters(array('striptags', 'trim'));
     $username_again->addValidators(array(new Validator\Confirmation(array('message' => 'Emails do not match', 'with' => 'username'))));
     $this->add($username_again);
     $password = new Element\Password('password');
     $password->setLabel('Password');
     $password->setFilters(array('striptags', 'trim'));
     $password->addValidators(array(new Validator\Regex(array('pattern' => '/[A-Za-z\\d\\W]+/i', 'message' => 'Password must be greater than 6 characters')), new Validator\StringLength(array('max' => 100, 'min' => 6, 'messageMaximum' => 'Password is too long', 'messageMinimum' => 'Password is too short'))));
     $password->setAttributes(array('data-toggle' => 'popover', 'data-content' => 'Password must be greater than 6 characters', 'data-title' => 'Help'));
     $this->add($password);
     $password_again = new Element\Password('password_again');
     $password_again->setLabel('Re-enter password');
     $password_again->setFilters(array('striptags', 'trim'));
     $password_again->addValidators(array(new Validator\Confirmation(array('message' => 'Passwords do not match', 'with' => 'password'))));
     $this->add($password_again);
     $name = new Element\Text('name');
     $name->setLabel('Name');
     $name->setFilters(array('striptags', 'trim'));
     $this->add($name);
     $teamspeak = new Element\Text('teamspeak');
     $teamspeak->setLabel('Teamspeak');
     $teamspeak->setFilters(array('striptags', 'trim'));
     $this->add($teamspeak);
     $character = new Element\Text('character');
     $character->setLabel('Character name');
     $character->setFilters(array('striptags', 'trim'));
     $character->addValidator(new Validator\PresenceOf(array('message' => 'This field is required')));
     $this->add($character);
     $game_id = new Element\Text('game_id');
     $game_id->setLabel('Character In-Game ID');
     $game_id->setFilters(array('striptags', 'trim'));
     $game_id->addValidator(new Validator\PresenceOf(array('message' => 'This field is required')));
     $this->add($game_id);
     $submit = new Element\Submit('submit');
     $submit->setLabel('Register');
     $submit->setUserOption('icon', 'user');
     $submit->setAttribute('value', 'Register');
     $submit->setAttribute('class', 'btn btn-primary');
     $this->add($submit);
 }
Example #13
0
 public function initialize($entity = null, $user_options = array())
 {
     $name = new Element\Text('name');
     $name->setLabel('Name');
     $name->setFilters(array('striptags', 'trim'));
     $this->add($name);
     $teamspeak = new Element\Text('teamspeak');
     $teamspeak->setLabel('Teamspeak');
     $teamspeak->setFilters(array('striptags', 'trim'));
     $this->add($teamspeak);
     $submit = new Element\Submit('submit');
     $submit->setLabel('Save');
     $submit->setUserOption('icon', 'user');
     $submit->setAttribute('value', 'Save');
     $submit->setAttribute('class', 'btn btn-primary');
     $this->add($submit);
 }
Example #14
0
 public function initialize($entity = null, $user_options = array())
 {
     $character = new EveElement\Select('character_id', new ChoiceList\Character($this->session->get('auth')));
     $character->setLabel('Character name');
     $character->addValidator(new Validator\PresenceOf(array('message' => 'This field is required')));
     $this->add($character);
     $data_string = new Element\Text('data_string');
     $data_string->setLabel('Fit Data');
     $data_string->addValidator(new Validator\PresenceOf(array('message' => 'This field is required')));
     $this->add($data_string);
     $submit = new Element\Submit('submit');
     $submit->setLabel('Save');
     $submit->setUserOption('icon', 'floppy-o');
     $submit->setAttribute('value', 'Save');
     $submit->setAttribute('class', 'btn btn-primary');
     $this->add($submit);
 }
Example #15
0
 public function initialize($entity = null, $user_options = array())
 {
     $name = new Element\Text('name');
     $name->setLabel('Name');
     $name->setFilters(array('striptags', 'trim'));
     $name->addValidator(new Validator\PresenceOf(array('message' => 'This field is required')));
     $this->add($name);
     $active = new Element\Check('active');
     $active->setLabel('Activate Now?');
     $this->add($active);
     $submit = new Element\Submit('submit');
     $submit->setLabel('Save');
     $submit->setUserOption('icon', 'floppy-o');
     $submit->setAttribute('value', 'Save');
     $submit->setAttribute('class', 'btn btn-primary');
     $this->add($submit);
 }
Example #16
0
 public function initialize($entity = null, $user_options = array())
 {
     $character = new Element\Text('name');
     $character->setLabel('Character name');
     $character->setFilters(array('striptags', 'trim'));
     $character->addValidator(new Validator\PresenceOf(array('message' => 'This field is required')));
     $this->add($character);
     $game_id = new Element\Text('game_id');
     $game_id->setLabel('Character In-Game ID');
     $game_id->setFilters(array('striptags', 'trim'));
     $game_id->addValidator(new Validator\PresenceOf(array('message' => 'This field is required')));
     $this->add($game_id);
     $submit = new Element\Submit('submit');
     $submit->setLabel('Register');
     $submit->setUserOption('icon', 'user');
     $submit->setAttribute('value', 'Register');
     $submit->setAttribute('class', 'btn btn-primary');
     $this->add($submit);
 }
Example #17
0
 public function initialize($entity = null, $user_options = array())
 {
     // Login details
     $username = new Element\Text('username');
     $username->setLabel('Username');
     $username->setFilters(array('striptags', 'trim', 'string', 'lower'));
     $username->addValidators(array(new Validator\PresenceOf(array('message' => 'Username is required')), new EveValidator\User\Exists(array('message' => 'Username or password incorrect'))));
     $this->add($username);
     $password = new Element\Password('password');
     $password->setLabel('Password');
     $password->setFilters(array('striptags', 'trim'));
     $password->addValidators(array(new Validator\PresenceOf(array('message' => 'Username or password incorrect'))));
     $this->add($password);
     $redirect = new Element\Hidden('redirect');
     $redirect->setFilters(array('striptags', 'trim'));
     $this->add($redirect);
     $submit = new Element\Submit('submit');
     $submit->setLabel('Login');
     $submit->setUserOption('icon', 'user');
     $submit->setAttribute('value', 'Login');
     $submit->setAttribute('class', 'btn btn-primary');
     $this->add($submit);
 }