1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-30 19:30:25 +02:00

Bugtracker #3513 - show extended user fields in categories during signup

This commit is contained in:
e107steved
2007-07-30 20:25:36 +00:00
parent b63785bb9a
commit 0ebc06b0a6
3 changed files with 60 additions and 23 deletions

View File

@@ -11,9 +11,11 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_files/shortcode/batch/signup_shortcodes.php,v $
| $Revision: 1.6 $
| $Date: 2007-06-25 21:36:15 $
| $Revision: 1.7 $
| $Date: 2007-07-30 20:25:24 $
| $Author: e107steved $
|
| Mods to show extended field categories
+----------------------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
@@ -158,30 +160,52 @@ SC_END
SC_BEGIN SIGNUP_EXTENDED_USER_FIELDS
global $usere, $tp, $SIGNUP_EXTENDED_USER_FIELDS, $EXTENDED_USER_FIELD_REQUIRED;
global $usere, $tp, $SIGNUP_EXTENDED_USER_FIELDS, $EXTENDED_USER_FIELD_REQUIRED, $SIGNUP_EXTENDED_CAT;
$text = "";
$extList = $usere->user_extended_get_fieldList();
$search = array(
'{EXTENDED_USER_FIELD_TEXT}',
'{EXTENDED_USER_FIELD_REQUIRED}',
'{EXTENDED_USER_FIELD_EDIT}'
);
foreach($extList as $ext)
// What we need is a list of fields, ordered first by parent, and then by display order?
// category entries are `user_extended_struct_type` = 0
// 'unallocated' entries are `user_extended_struct_parent` = 0
// Get a list of defined categories
$catList = $usere->user_extended_get_categories(FALSE);
// Add in category zero - the 'no category' category
array_unshift($catList,array('user_extended_struct_parent' => 0, 'user_extended_struct_id' => '0'));
foreach($catList as $cat)
{
if($ext['user_extended_struct_required'] == 1 || $ext['user_extended_struct_required'] == 2)
{
$replace = array(
$tp->toHTML($ext['user_extended_struct_text'], '', 'emotes_off, defs'),
($ext['user_extended_struct_required'] == 1 ? $EXTENDED_USER_FIELD_REQUIRED : ''),
$usere->user_extended_edit($ext, $_POST['ue']['user_'.$ext['user_extended_struct_name']])
);
$text .= str_replace($search, $replace, $SIGNUP_EXTENDED_USER_FIELDS);
}
$extList = $usere->user_extended_get_fieldList($cat['user_extended_struct_id']);
$done_heading = FALSE;
foreach($extList as $ext)
{
if($ext['user_extended_struct_required'] == 1 || $ext['user_extended_struct_required'] == 2)
{
if(!$done_heading && ($cat['user_extended_struct_id'] > 0))
{ // Add in a heading
$text .= str_replace('{EXTENDED_CAT_TEXT}', $tp->toHTML($cat['user_extended_struct_name'], '', 'emotes_off defs'), $SIGNUP_EXTENDED_CAT);
$done_heading = TRUE;
}
$replace = array(
$tp->toHTML($ext['user_extended_struct_text'], '', 'emotes_off defs'),
($ext['user_extended_struct_required'] == 1 ? $EXTENDED_USER_FIELD_REQUIRED : ''),
$usere->user_extended_edit($ext, $_POST['ue']['user_'.$ext['user_extended_struct_name']])
);
$text .= str_replace($search, $replace, $SIGNUP_EXTENDED_USER_FIELDS);
}
}
}
return $text;
return $text;
SC_END
SC_BEGIN SIGNUP_SIGNATURE