$info) { if (user_access('administer profiles') || user_access("edit any $type profile")) { $settings = $info->data; $localized_options = array(); if (isset($settings['registration'])) { $localized_options = array(); $description = t('Add an %user_type entity, creating the user associated to it.', array('%user_type' => $info->label)); } else { $localized_options['query'] = array('profile' => $type); $description = t('Add an %user_type entity, creating the user first.', array('%user_type' => $info->label)); } $items[] = array( 'title' => $info->label, 'href' => 'admin/people/create', 'localized_options' => $localized_options, 'description' => $description, ); } } if (!empty($items)) { $output['workbench_create_profile2'] = array( '#title' => t('Create profile'), '#markup' => theme('node_add_list', array('content' => $items)), '#theme' => 'workbench_element', '#weight' => 1, ); } } } /** * Implements hook_user_insert(). * * Redirect to correct Profile creation after User creation form. */ function workbench_profile_user_insert(&$edit, $account, $category) { if (isset($_GET['profile'])) { $profile_type_info = profile2_get_types(check_plain($_GET['profile'])); if (user_access("edit any $profile_type_info->type profile")) { if ($profile_type_info->data['use_page']) { drupal_goto("profile-$profile_type_info->type/$account->uid/edit"); } else { drupal_goto("user/$account->uid/edit/$profile_type_info->type"); } } } }