1 user.module user_login_page_wrapper(array $form)

Shared output for pages related to the user login process.

This callback is shared by "user/login", "user/password", and "user/register" paths. It checks the "user_login_appearance" setting and wraps the form as needed with additional information.

@since 1.30.0 Function added.

Parameters

array $form: The render array for a form to be wrapped.

Return value

string: The rendered content of the page, ready for return by a menu handler.

See also

user_login_page()

user_pass_page()

user_register_page()

File

core/modules/user/user.module, line 1981
Enables the user registration and login system.

Code

function user_login_page_wrapper(array $form) {
  $user_login_appearance = config_get('system.core', 'user_login_appearance');

  // If this page is not specified in hook_user_login_paths() or modified by
  // hook_user_login_paths_alter(), use the default appearance.
  if ($user_login_appearance == 'simplified' && !user_is_login_path()) {
    $user_login_appearance = 'tabs';
  }

  switch ($user_login_appearance) {
    case 'simplified':
      $links = _user_login_links();
      $output = theme('user_simplified_page', array(
        'form' => $form,
        'links' => $links,
      ));
      break;

    case 'links':
      $links = _user_login_links();
      $output = theme('user_links_page', array(
        'form' => $form,
        'links' => $links,
      ));
      break;

    case 'tabs':
    default:
      $output = $form;
  }

  return $output;
}