Exemple #1
0
 public function test()
 {
     $form = new ctr_form('test');
     $text = new ctr_textbox('textbox');
     $text->configure('LABEL', 'Name');
     $text->configure('ADDON', 'N');
     $btn = new ctr_button('BTN');
     $btn->configure('LABEL', 'Click me!');
     $btn->configure('P_ONCLICK_PLUGIN', 'hello');
     $btn->configure('P_ONCLICK_FUNCTION', 'btn_onclick');
     $form->add_array(array($text, $btn));
     return array('TITTLE', $form->draw());
 }
Exemple #2
0
 protected function view_show($result)
 {
     $form = new ctr_form('login');
     $username = new ctr_textbox();
     $username->configure('NAME', 'username');
     $username->configure('ADDON', 'U');
     $username->configure('LABEL', 'Username:'******'PLACE_HOLDER', 'Username');
     $password = new ctr_textbox();
     $password->configure('NAME', 'password');
     $password->configure('ADDON', 'P');
     $password->configure('STYLE', 'color:red;');
     $password->configure('LABEL', 'Passord:');
     $password->configure('PLACE_HOLDER', 'Password');
     $form->add_array(array($username, $password));
     return array('login', $form->draw());
 }
Exemple #3
0
 protected function view_reset_password()
 {
     $form = new ctr_form('USERS_RESET_PASSWORD');
     //create textbox for enter email or username
     $email = new ctr_textbox();
     $email->configure('NAME', 'txt_email');
     $email->configure('LABEL', _('Username or e-mail address'));
     $email->configure('HELP', _('Enter your Alternate Email Address or username'));
     $email->configure('PLACE_HOLDER', _('Username or e-mail address'));
     $email->configure('ADDON', _('*'));
     $email->configure('SIZE', 8);
     $reset = new ctr_button();
     $reset->configure('NAME', 'btn_reset');
     $reset->configure('LABEL', _('Email new password'));
     $reset->configure('P_ONCLICK_PLUGIN', 'users');
     $reset->configure('P_ONCLICK_FUNCTION', 'btn_reset_password_onclick');
     $reset->configure('TYPE', 'primary');
     $form->add_array(array($email, $reset));
     return array(_('Request new password'), $form->draw());
 }