You are here

function profile2_regpath_menu_alter in Profile2 Registration Path 7

Same name and namespace in other branches
  1. 7.2 profile2_regpath.module \profile2_regpath_menu_alter()

Implements hook_menu_alter().

File

./profile2_regpath.module, line 91
Attach profile2 form to registration form according to path.

Code

function profile2_regpath_menu_alter(&$items) {

  // Check to see if the default 'user' path is being used with Profile2.
  if ($user_paths = profile2_regpath_regpath_load_multiple(array(
    'path' => 'user',
  ))) {
    $regpath = array_shift($user_paths);

    // Build form at user/register using _profile2_regpath_user_register().
    $items['user/register']['page callback'] = '_profile2_regpath_user_register';
    $items['user/register']['page arguments'] = array(
      'regpath' => $regpath,
    );
    $items['user/register']['file'] = 'registration_form.inc';
    $items['user/register']['file path'] = drupal_get_path('module', 'profile2_regpath');
    return $items;
  }
}