/** *__construct * * @param array $xlanguage language options array */ public function __construct($xlanguage) { $xoops = Xoops::getInstance(); parent::__construct('', 'xlanguage_form', $xoops->getEnv('PHP_SELF'), 'post', true, 'horizontal'); $lang_tray = new Xoops\Form\Select(_XLANGUAGE_TINYMCE_SUBTITLE, 'select_language'); $lang_tray->addOption('', _XLANGUAGE_TINYMCE_SELECT); foreach ($xlanguage as $k => $v) { $lang_tray->addOption($v['xlanguage_code'], $v['xlanguage_description']); } $this->addElement($lang_tray, true); $text_tray = new Xoops\Form\TextArea('', 'text_language', '', 7, 7); $text_tray->setExtra('onkeyup="Xoops_xlanguageDialog.onkeyupMLC(this);"'); $this->addElement($text_tray); $this->addElement(new Xoops\Form\Raw('<div id="text_language_msg"><script type="text/javascript">Xoops_xlanguageDialog.onkeyupMLC(this);</script></div>')); /** * Buttons */ $button_tray = new Xoops\Form\ElementTray('', ''); $button = new Xoops\Form\Button('', 'submit', XoopsLocale::A_SUBMIT, 'insert'); $button->setExtra('onclick="Xoops_xlanguageDialog.insertMLC();return false;"'); $button->setClass('btn btn-success'); $button_tray->addElement($button); $button_2 = new Xoops\Form\Button('', 'button', XoopsLocale::A_CLOSE, 'button'); $button_2->setExtra('onclick="tinyMCEPopup.close();"'); $button_2->setClass('btn btn-danger'); $button_tray->addElement($button_2); $this->addElement($button_tray); }
$email_text = new Xoops\Form\Text('', 'email', 25, 60, $myts->htmlSpecialChars($email)); $email_option = new Xoops\Form\Checkbox('', 'user_viewemail', $user_viewemail); $email_option->addOption(1, XoopsLocale::ALLOW_OTHER_USERS_TO_VIEW_EMAIL); $email_tray->addElement($email_text, true); $email_tray->addElement($email_option); $reg_form = new Xoops\Form\ThemeForm(XoopsLocale::USER_REGISTRATION, 'userinfo', 'register.php', 'post', true); $uname_size = $xoopsConfigUser['maxuname'] < 25 ? $xoopsConfigUser['maxuname'] : 25; $reg_form->addElement(new Xoops\Form\Text(XoopsLocale::USERNAME, 'uname', $uname_size, $uname_size, $myts->htmlSpecialChars($uname)), true); $reg_form->addElement($email_tray); $reg_form->addElement(new Xoops\Form\Password(XoopsLocale::PASSWORD, 'pass', 10, 32, $myts->htmlSpecialChars($pass)), true); $reg_form->addElement(new Xoops\Form\Password(XoopsLocale::VERIFY_PASSWORD, 'vpass', 10, 32, $myts->htmlSpecialChars($vpass)), true); $reg_form->addElement(new Xoops\Form\Text(XoopsLocale::WEBSITE, 'url', 25, 255, $myts->htmlSpecialChars($url))); $tzselected = $timezone_offset != '' ? $timezone_offset : $xoopsConfig['default_TZ']; $reg_form->addElement(new Xoops\Form\SelectTimeZone(XoopsLocale::TIME_ZONE, 'timezone_offset', $tzselected)); //$reg_form->addElement($avatar_tray); $reg_form->addElement(new Xoops\Form\RadioYesNo(XoopsLocale::Q_RECEIVE_OCCASIONAL_EMAIL_NOTICES_FROM_ADMINISTRATORS, 'user_mailok', $user_mailok)); if ($xoopsConfigUser['reg_dispdsclmr'] != 0 && $xoopsConfigUser['reg_disclaimer'] != '') { $disc_tray = new Xoops\Form\ElementTray(XoopsLocale::DISCLAIMER, '<br />'); $disc_text = new Xoops\Form\TextArea('', 'disclaimer', $xoopsConfigUser['reg_disclaimer'], 15, 80); $disc_text->setExtra('readonly="readonly"'); $disc_tray->addElement($disc_text); $agree_chk = new Xoops\Form\Checkbox('', 'agree_disc', $agree_disc); $agree_chk->addOption(1, XoopsLocale::I_AGREE_TO_THE_ABOVE); $eltname = $agree_chk->getName(); $eltmsg = str_replace('"', '\\"', stripslashes(sprintf(XoopsLocale::F_ENTER, XoopsLocale::I_AGREE_TO_THE_ABOVE))); $agree_chk->customValidationCode[] = "if ( myform.{$eltname}.checked == false ) { window.alert(\"{$eltmsg}\"); myform.{$eltname}.focus(); return false; }"; $disc_tray->addElement($agree_chk, true); $reg_form->addElement($disc_tray); } $reg_form->addElement(new Xoops\Form\Hidden('op', 'newuser')); $reg_form->addElement(new Xoops\Form\Button('', 'submitButton', XoopsLocale::A_SUBMIT, 'submit'));