21 defined(
'XOOPS_ROOT_PATH') or die("XOOPS root path not defined");
38 include_once
$GLOBALS[
'xoops']->path(
'class/xoopsformloader.php');
44 if (!$field->isNew()) {
45 $fieldcat_id = $field->getVar(
'cat_id');
52 $cat_select->addOptionArray($category_handler->getList());
53 $form->addElement($cat_select);
55 if ($field->getVar(
'field_config') || $field->isNew()) {
56 if (!$field->isNew()) {
84 $form->addElement($element_select);
86 switch ($field->getVar(
'field_type')) {
135 if ($field->getVar(
'field_type') ==
"select" || $field->getVar(
'field_type') ==
"select_multi" || $field->getVar(
'field_type') ==
"radio" || $field->getVar(
'field_type') ==
"checkbox") {
136 $options = $field->getVar(
'field_options');
139 $remove_options->columns = 3;
141 foreach (array_keys(
$options) as $key) {
144 $remove_options->addOptionArray(
$options);
145 $form->addElement($remove_options);
149 for (
$i = 0;
$i < 3;
$i++) {
150 $option_text .=
"<tr><td><input type='text' name='addOption[{$i}][key]' id='addOption[{$i}][key]' size='15' /></td><td><input type='text' name='addOption[{$i}][value]' id='addOption[{$i}][value]' size='35' /></td></tr>";
151 $option_text .=
"<tr height='3px'><td colspan='2'> </td></tr>";
153 $option_text .=
"</table>";
158 if ($field->getVar(
'field_edit')) {
159 switch ($field->getVar(
'field_type')) {
169 $def_value = $field->getVar(
'field_default',
'e') != null ? unserialize($field->getVar(
'field_default',
'n')) : null;
171 $options = $field->getVar(
'field_options');
174 if (!in_array(
'', array_keys(
$options))) {
175 $element->addOption(
'',
_NONE);
178 $form->addElement($element);
183 $def_value = $field->getVar(
'field_default',
'e') != null ? $field->getVar(
'field_default') : null;
185 $options = $field->getVar(
'field_options');
188 if (!in_array(
'', array_keys(
$options))) {
189 $element->addOption(
'',
_NONE);
192 $form->addElement($element);
248 $search_groups = $groupperm_handler->getGroupIds(
'profile_search', $field->getVar(
'field_id'),
$GLOBALS[
'xoopsModule']->getVar(
'mid'));
251 if ($field->getVar(
'field_edit') || $field->isNew()) {
252 if (!$field->isNew()) {
254 $editable_groups = $groupperm_handler->getGroupIds(
'profile_edit', $field->getVar(
'field_id'),
$GLOBALS[
'xoopsModule']->getVar(
'mid'));
256 $editable_groups = array();
264 $form->addElement($regstep_select);
282 include_once
$GLOBALS[
'xoops']->path(
'class/xoopsformloader.php');
283 if (empty(
$GLOBALS[
'xoopsConfigUser'])) {
288 $step_no = $step[
'step_no'];
289 $use_token = $step[
'step_no'] > 0 ?
true :
false;
292 if ($step[
'step_desc']) {
302 $elements[0][] = array(
'element' =>
new XoopsFormText(
_US_EMAIL,
'email', 35, 255,
$user->getVar(
'email',
'e') ),
'required' =>
true);
317 if (
$fields[$i]->getVar(
'step_id') == $step[
'step_id']) {
320 if ($fieldinfo[
'required'] =
$fields[$i]->getVar(
'field_required')) {
321 $_SESSION[
'profile_required'][
$fields[
$i]->getVar(
'field_name')] = $fields[
$i]->getVar(
'field_title');
325 $elements[$key][] = $fieldinfo;
326 $weights[$key][] =
$fields[
$i]->getVar(
'field_weight');
333 $categories =
$cat_handler->getObjects(null,
true,
false);
335 foreach (array_keys($elements) as $k) {
336 array_multisort($weights[$k], SORT_ASC, array_keys($elements[$k]), SORT_ASC, $elements[$k]);
341 foreach (array_keys($elements[$k]) as $i) {
342 $reg_form->addElement($elements[$k][$i][
'element'], $elements[$k][$i][
'required']);
347 if ($step_no == 1 &&
$GLOBALS[
'xoopsConfigUser'][
'reg_dispdsclmr'] != 0 &&
$GLOBALS[
'xoopsConfigUser'][
'reg_disclaimer'] !=
'') {
349 $disc_text =
new XoopsFormLabel(
"",
"<div class=\"pad5\">" .
$GLOBALS[
"myts"]->displayTarea(
$GLOBALS[
'xoopsConfigUser'][
'reg_disclaimer'], 1) .
"</div>");
350 $disc_tray->addElement($disc_text);
353 $disc_tray->addElement($agree_chk);
380 if (empty(
$GLOBALS[
'xoopsConfigUser'])) {
385 include_once
$GLOBALS[
'xoops']->path(
'class/xoopsformloader.php');
413 $elements[0][] = array(
'element' =>
$email_tray,
'required' => 0);
416 if (
$GLOBALS[
'xoopsUser']->isAdmin() &&
$user->getVar(
'uid') !=
$GLOBALS[
'xoopsUser']->getVar(
'uid')) {
421 $pwd_tray->addElement($pwd_text);
422 $pwd_tray->addElement($pwd_text2);
423 $elements[0][] = array(
'element' => $pwd_tray,
'required' => 0);
430 $elements[0][] = array(
'element' => $level_radio,
'required' => 0);
434 $elements[0][] = array(
'element' =>
new XoopsFormHidden(
'uid',
$user->getVar(
'uid') ),
'required' => 0);
436 $elements[0][] = array(
'element' =>
new XoopsFormHidden(
'op',
'save'),
'required' => 0);
440 $categories = array();
441 $all_categories =
$cat_handler->getObjects(null,
true,
false);
442 $count_fields = count(
$fields);
445 if ( in_array(
$fields[$i]->getVar(
'field_id'), $editable_fields) ) {
447 if (
$user->isNew()) {
448 $default =
$fields[
$i]->getVar(
'field_default');
449 if ($default !==
'' && $default !== null) {
450 $user->setVar(
$fields[$i]->getVar(
'field_name'), $default);
454 if (
$profile->getVar(
$fields[$i]->getVar(
'field_name'),
'n') === null) {
455 $default =
$fields[
$i]->getVar(
'field_default',
'n');
460 $fieldinfo[
'required'] =
$fields[
$i]->getVar(
'field_required');
462 $key = @$all_categories[
$fields[
$i]->getVar(
'cat_id')][
'cat_weight'] * $count_fields +
$fields[
$i]->getVar(
'cat_id');
463 $elements[$key][] = $fieldinfo;
464 $weights[$key][] =
$fields[
$i]->getVar(
'field_weight');
465 $categories[$key] = @$all_categories[
$fields[
$i]->getVar(
'cat_id')];
473 include_once
$GLOBALS[
'xoops']->path(
'modules/system/constants.php');
477 $elements[0][] = array(
'element' => $group_select,
'required' => 0);
479 $weights[0][] = $count_fields +1;
484 foreach (array_keys($elements) as $k) {
485 array_multisort($weights[$k], SORT_ASC, array_keys($elements[$k]), SORT_ASC, $elements[$k]);
487 $desc = isset($categories[$k]) ? $categories[$k][
'cat_description'] :
"";
489 foreach (array_keys($elements[$k]) as $i) {
490 $form->addElement($elements[$k][$i][
'element'], $elements[$k][$i][
'required']);
511 if (empty(
$GLOBALS[
'xoopsConfigUser'])) {
515 include_once
$GLOBALS[
'xoops']->path(
'class/xoopsformloader.php');
519 if (!$step->isNew()) {