You are here

function profile2_regpath_menu_alter in Profile2 Registration Path 7.2

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

Implements hook_menu_alter().

File

./profile2_regpath.module, line 106
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_get_profiles('user')) {

    // 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(
      'profiles' => $user_paths,
    );
    $items['user/register']['file'] = 'profile2_regpath.inc';
    $items['user/register']['file path'] = drupal_get_path('module', 'profile2_regpath');
    return $items;
  }
}