diff --git a/location.module b/location.module index 665e164e6e8843e5637118288d3a3e461c090d93..edb7bf5de2ba6ac59027472a608f572331259195 100644 --- a/location.module +++ b/location.module @@ -702,6 +702,13 @@ function _location_user_settings_form_alter($form_id, &$form) { $form['location_settings_user'] = location_settings($settings); $form['location_settings_user']['#title'] = t('User locations'); + + $form['location_settings_user']['form']['register'] = array( + '#type' => 'checkbox', + '#title' => t('Collect during registration'), + '#default_value' => isset($settings['form']['register']) ? $settings['form']['register'] : FALSE, + '#weight' => -5, + ); } /** @@ -1009,6 +1016,14 @@ function location_user($op, &$edit, &$account, $category = NULL) { } break; + case 'register': + $settings = variable_get('location_settings_user', array()); + if (isset($settings['form']['register']) && $settings['form']['register']) { + $form['locations'] = location_form($settings, array()); + return $form; + } + break; + case 'view': if ((($user->uid == $account->uid) && user_access('view own user location')) || user_access('administer users') || user_access('view all user locations') || user_access('administer user locations')) { if (variable_get('location_display_location', 1) && isset($account->locations) && count($account->locations)) {