XOOPS 2.5.6  Final
 All Classes Namespaces Files Functions Variables Pages
registerform.php
Go to the documentation of this file.
1 <?php
18 defined('XOOPS_ROOT_PATH') or die('Restricted access');
19 
20 include_once $GLOBALS['xoops']->path('class/xoopslists.php');
21 include_once $GLOBALS['xoops']->path('class/xoopsformloader.php');
22 
24 $email_text = new XoopsFormText('', 'email', 25, 60, $myts->htmlSpecialChars($email));
25 $email_option = new XoopsFormCheckBox('', 'user_viewemail', $user_viewemail);
26 $email_option->addOption(1, _US_ALLOWVIEWEMAIL);
27 $email_tray->addElement($email_text, true);
28 $email_tray->addElement($email_option);
29 
30 $reg_form = new XoopsThemeForm(_US_USERREG, 'userinfo', 'register.php', 'post', true);
31 $uname_size = $xoopsConfigUser['maxuname'] < 25 ? $xoopsConfigUser['maxuname'] : 25;
32 $reg_form->addElement(new XoopsFormText(_US_NICKNAME, 'uname', $uname_size, $uname_size, $myts->htmlSpecialChars($uname)), true);
33 $reg_form->addElement($email_tray);
34 $reg_form->addElement(new XoopsFormPassword(_US_PASSWORD, 'pass', 10, 32, $myts->htmlSpecialChars($pass)), true);
35 $reg_form->addElement(new XoopsFormPassword(_US_VERIFYPASS, 'vpass', 10, 32, $myts->htmlSpecialChars($vpass)), true);
36 $reg_form->addElement(new XoopsFormText(_US_WEBSITE, 'url', 25, 255, $myts->htmlSpecialChars($url)));
38 $reg_form->addElement(new XoopsFormSelectTimezone(_US_TIMEZONE, 'timezone_offset', $tzselected));
39 //$reg_form->addElement($avatar_tray);
40 $reg_form->addElement(new XoopsFormRadioYN(_US_MAILOK, 'user_mailok', $user_mailok));
41 if ($xoopsConfigUser['reg_dispdsclmr'] != 0 && $xoopsConfigUser['reg_disclaimer'] != '') {
42  $disc_tray = new XoopsFormElementTray(_US_DISCLAIMER, '<br />');
43  $disc_text = new XoopsFormTextarea('', 'disclaimer', $xoopsConfigUser['reg_disclaimer'], 15, 80);
44  $disc_text->setExtra('readonly="readonly"');
45  $disc_tray->addElement($disc_text);
46  $agree_chk = new XoopsFormCheckBox('', 'agree_disc', $agree_disc);
47  $agree_chk->addOption(1, _US_IAGREE);
48  $eltname = $agree_chk->getName();
49  $eltmsg = str_replace('"', '\"', stripslashes(sprintf(_FORM_ENTER, _US_IAGREE)));
50  $agree_chk->customValidationCode[] = "if ( myform.{$eltname}.checked == false ) { window.alert(\"{$eltmsg}\"); myform.{$eltname}.focus(); return false; }";
51  $disc_tray->addElement($agree_chk, true);
52  $reg_form->addElement($disc_tray);
53 }
54 $reg_form->addElement(new XoopsFormHidden('op', 'newuser'));
55 $reg_form->addElement(new XoopsFormButton('', 'submitButton', _US_SUBMIT, 'submit'));
56 ?>