Commit 3bf1c719 authored by webchick's avatar webchick

#460706 by wulff and c960657: Don't show surrounding fieldset on user...

#460706 by wulff and c960657: Don't show surrounding fieldset on user registration form when only one profile category exists.
parent 59339ea1
......@@ -913,7 +913,7 @@ function system_user_register(&$edit, &$user, $category = NULL) {
system_user_timezone($edit, $form);
}
else {
$form['timezone'] = array(
$form['account']['timezone'] = array(
'#type' => 'hidden',
'#value' => variable_get('user_default_timezone', DRUPAL_USER_TIMEZONE_DEFAULT) ? '' : variable_get('date_default_timezone', ''),
);
......
......@@ -2893,18 +2893,16 @@ function user_register() {
// Create a dummy variable for pass-by-reference parameters.
$null = NULL;
$extra = _user_forms($null, NULL, NULL, 'register');
// Remove form_group around default fields if there are no other groups.
if (!$extra) {
foreach (array('name', 'mail', 'pass', 'status', 'roles', 'notify') as $key) {
if (isset($form['account'][$key])) {
$form[$key] = $form['account'][$key];
}
}
unset($form['account']);
if ($extra) {
$form = array_merge_recursive($form, $extra);
}
else {
$form = array_merge($form, $extra);
// If the "account" fieldset is the only element at the top level, its
// borders are hidden for aesthetic reasons. We do not remove the fieldset but
// preserve the form structure so that modules implementing
// hook_form_FORM_ID_alter() know where to find the basic elements.
if (count(element_children($form)) == 1) {
$form['account']['#type'] = 'markup';
}
$form['submit'] = array('#type' => 'submit', '#value' => t('Create new account'), '#weight' => 30);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment