summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrandon Bergren2008-10-21 23:47:36 (GMT)
committer Brandon Bergren2008-10-21 23:47:36 (GMT)
commit7d1dbcb6632c15386694fb6995342f7cff771045 (patch)
treed613afd2cae5e200d9cf54743cb402b41d3ddf12
parent120efdb978d45557adec77ca464b3db266675a01 (diff)
#286450, requested by mr.andrey: Allow collecting user locations during registration.
-rw-r--r--location.module15
1 files changed, 15 insertions, 0 deletions
diff --git a/location.module b/location.module
index 665e164..edb7bf5 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)) {