protected function view_msg($header, $body, $type) { $label = new ctr_label($body); $label->configure('TYPE', $type); $form = new ctr_form('msg'); $form->add($label); $form->configure('PANEL', TRUE); $form->configure('LABEL', $header); $form->configure('TYPE', $type); return ['', $form->draw()]; }
protected function view_register() { $form = new ctr_form('USERS_REGISTER'); $form->configure('LABEL', _('Register')); $username = new ctr_textbox(); $username->configure('NAME', 'txt_username'); $username->configure('LABEL', _('Username:'******'ADDON', _('*')); $username->configure('PLACE_HOLDER', _('Username')); $username->configure('HELP', _('Spaces are allowed; punctuation is not allowed except for periods, hyphens, apostrophes, and underscores.')); $username->configure('SIZE', 4); $email = new ctr_textbox(); $email->configure('NAME', 'txt_email'); $email->configure('LABEL', _('Email:')); $email->configure('ADDON', _('*')); $email->configure('PLACE_HOLDER', _('Email')); $email->configure('HELP', _('A valid e-mail address. All e-mails from the system will be sent to this address. The e-mail address is not made public and will only be used if you wish to receive a new password or wish to receive certain news or notifications by e-mail.')); $email->configure('SIZE', 6); $form->add_array(array($username, $email)); $password = new ctr_textbox(); $password->configure('NAME', 'txt_password'); $password->configure('LABEL', _('Password:'******'ADDON', _('*')); $password->configure('PLACE_HOLDER', _('Password')); $password->configure('PASSWORD', true); $password->configure('SIZE', 4); $repassword = new ctr_textbox(); $repassword->configure('NAME', 'txt_repassword'); $repassword->configure('LABEL', _('Confirm password :'******'ADDON', _('*')); $repassword->configure('PLACE_HOLDER', _('Password')); $repassword->configure('PASSWORD', true); $repassword->configure('SIZE', 4); $signup = new ctr_button(); $signup->configure('NAME', 'btn_signup'); $signup->configure('TYPE', 'primary'); $signup->configure('LABEL', _('Create new account')); $signup->configure('P_ONCLICK_PLUGIN', 'users'); $signup->configure('P_ONCLICK_FUNCTION', 'btn_signup_onclick'); $cancel = new ctr_button(); $cancel->configure('NAME', 'btn_cancel'); $cancel->configure('TYPE', 'warning'); $cancel->configure('LABEL', _('Cancel')); $cancel->configure('HREF', '?'); $row = new ctr_row(); $row->add($signup, 3); $row->add($cancel, 2); $form->add_array(array($password, $repassword)); $form->add_spc(); $form->add($row); return array(_('Sign up'), $form->draw()); }