Index: /home/michaelfavia/workspace/openfit.org/sites/all/modules/location/location.info =================================================================== --- /home/michaelfavia/workspace/openfit.org/sites/all/modules/location/location.info (.../home/michaelfavia/workspace/openfit.org/sites/all/modules/location) (working copy) +++ /home/michaelfavia/workspace/openfit.org/sites/all/modules/location/location.info (.../http://labs.insitesinc.com/repository/projects/openfit.org/sites/all/modules/location) (revision 10) @@ -1,3 +0,0 @@ -; $Id$ -name = Location -description = The location module allows you to associate a geographic location with content and users. Users can do proximity searches by postal code. This is useful for organizing communities that have a geographic presence. Index: /home/michaelfavia/workspace/openfit.org/sites/all/modules/location/contrib/location_views/location_views.info =================================================================== --- /home/michaelfavia/workspace/openfit.org/sites/all/modules/location/contrib/location_views/location_views.info (.../home/michaelfavia/workspace/openfit.org/sites/all/modules/location) (working copy) +++ /home/michaelfavia/workspace/openfit.org/sites/all/modules/location/contrib/location_views/location_views.info (.../http://labs.insitesinc.com/repository/projects/openfit.org/sites/all/modules/location) (revision 10) @@ -1,4 +0,0 @@ -; $Id$ -name = Location Views -description = Views-enables the location fields and creates a default location view. Requires the location module and the views module. -dependencies = views Index: /home/michaelfavia/workspace/openfit.org/sites/all/modules/location/contrib/location_views/location_views.module =================================================================== --- /home/michaelfavia/workspace/openfit.org/sites/all/modules/location/contrib/location_views/location_views.module (.../home/michaelfavia/workspace/openfit.org/sites/all/modules/location) (working copy) +++ /home/michaelfavia/workspace/openfit.org/sites/all/modules/location/contrib/location_views/location_views.module (.../http://labs.insitesinc.com/repository/projects/openfit.org/sites/all/modules/location) (revision 10) @@ -11,6 +11,8 @@ */ function location_views_help($section) { switch ($section) { + case 'admin/modules#description': + return t('Views-enables the location fields and creates a default location view. Requires the location module and the views module.'); case 'admin/help#location_views': return t('The Location Views module makes all the location fields available to the Views module, ' . 'and creates a default location view using all the location fields. Set up the default location view by going to '. base_path() . 'admin/views. '); Index: /home/michaelfavia/workspace/openfit.org/sites/all/modules/location/location.module =================================================================== --- /home/michaelfavia/workspace/openfit.org/sites/all/modules/location/location.module (.../home/michaelfavia/workspace/openfit.org/sites/all/modules/location) (working copy) +++ /home/michaelfavia/workspace/openfit.org/sites/all/modules/location/location.module (.../http://labs.insitesinc.com/repository/projects/openfit.org/sites/all/modules/location) (revision 10) @@ -15,7 +15,8 @@ include_once LOCATION_PATH.'/location.inc'; /** - * Implementation of hook_menu(). + * Implementation of hook_menu. + * */ function location_menu($may_cache = FALSE) { $items = array(); @@ -20,14 +21,15 @@ function location_menu($may_cache = FALSE) { $items = array(); if ($may_cache) { - $items[] = array('path' => 'search/location', 'title' => t('By location'), 'callback' => 'drupal_get_form', 'callback arguments' => array('location_search_view'), 'access' => user_access('search content'), 'type' => MENU_LOCAL_TASK, 'weight' => 9,); - $items[] = array('path' => 'admin/settings/location/main', 'title' => t('Main settings'), 'type' => MENU_DEFAULT_LOCAL_TASK,); - $items[] = array('path' => 'admin/settings/location/maplinking', 'title' => t('Map links'), 'callback' => 'drupal_get_form', 'callback arguments' => array('location_map_link_options_page'), 'access' => user_access('administer site configuration'), 'type' => MENU_LOCAL_TASK, 'weight' => 1,); - $items[] = array('path' => 'admin/settings/location/geocoding', 'title' => t('Geocoding options'), 'callback' => 'drupal_get_form', 'callback arguments' => array('location_geocoding_options_page'), 'access' => user_access('administer site configuration'), 'type' => MENU_LOCAL_TASK, 'weight' => 2,); - $items[] = array('path' => 'admin/settings/location', 'title' => t('Location'), 'description' => t('Settings for Location module'), 'callback' => 'drupal_get_form', 'callback arguments' => array('location_admin_settings'), 'access' => user_access('administer site configuration'), 'type' => MENU_NORMAL_ITEM, ); + //$items[] = array('path' => 'search/location', 'title' => t('by location'), 'callback' => 'location_search_form_page', 'access' => user_access('search content'), 'type' => MENU_LOCAL_TASK, 'weight' => 9); + $items[] = array('path' => 'search/location', 'title' => t('by location'), 'callback' => 'location_search_view', 'access' => user_access('search content'), 'type' => MENU_LOCAL_TASK, 'weight' => 9); + $items[] = array('path' => 'admin/settings/location', 'title' => t('location'), 'callback' => 'location_configure'); + $items[] = array('path' => 'admin/settings/location/main', 'title' => t('main settings'), 'type' => MENU_DEFAULT_LOCAL_TASK); + $items[] = array('path' => 'admin/settings/location/maplinking', 'title' => t('map links'), 'callback' => 'location_map_link_options_page', 'access' => user_access('administer site configuration'), 'type' => MENU_LOCAL_TASK, 'weight' => 1); + $items[] = array('path' => 'admin/settings/location/geocoding', 'title' => t('geocoding options'), 'callback' => 'location_geocoding_options_page', 'access' => user_access('administer site configuration'), 'type' => MENU_LOCAL_TASK, 'weight' => 2); } else { - drupal_add_css(drupal_get_path('module', 'location') .'/location.css'); + theme_add_style(drupal_get_path('module', 'location') .'/location.css'); } return $items; } @@ -52,12 +54,14 @@
  • administer locative information at administer >> content types to configure a type and see the locative information.
  • administer location at administer >> settings >> location.
  • use a database dump for a U.S. postal codes table that can be found at zipcode database.
  • -', array('%admin-node-configure-types' => url('admin/content/configure/types'), '%admin-settings-location' => url('admin/settings/location'), '%external-http-trac-civicspacelabs-com-cgi-bin-trac-cgi-file-trunk-database-zipcodes-mysql' => 'http://trac.civicspacelabs.com/cgi-bin/trac.cgi/file/trunk/database/zipcodes.mysql')) .''; +', array('%admin-node-configure-types' => url('admin/node/configure/types'), '%admin-settings-location' => url('admin/settings/location'), '%external-http-trac-civicspacelabs-com-cgi-bin-trac-cgi-file-trunk-database-zipcodes-mysql' => 'http://trac.civicspacelabs.com/cgi-bin/trac.cgi/file/trunk/database/zipcodes.mysql')) .''; $output .= '

    '. t('For more information please read the configuration and customization handbook Location page.', array('%location' => 'http://www.drupal.org/handbook/modules/location/')) .'

    '; return $output; + case 'admin/modules#description': + return t('Enables the location system and allow users to attach locative information to content.'); } } -//TODO: check/fix this: admin/content/configure/types + function location_search_get_form($edit = array()) { $location_form = location_form(array('postal_code', 'country'), $edit, array('postal_code', 'country'), variable_get('location_suppress_country', 0) ? array('country' => variable_get('location_default_country', 'us')) : array(), '', 'location', 'nearby_postalcodes_bylocation'); @@ -85,7 +89,7 @@ } $form['#theme'] = 'location_search'; - return $form; + return drupal_get_form('location_search', $form); } function theme_location_search(&$form) { @@ -90,10 +94,10 @@ function theme_location_search(&$form) { $row = array(); - $row[] = '
    '. drupal_render($form['location']['distance']) . drupal_render($form['location']['distance_unit']) . '
    '; - $row[] = drupal_render($form['location']['postal_code']) . drupal_render($form['location']['country']); - $output = theme('table', NULL, array($row)) . drupal_render($form['op']); - $output .= drupal_render($form); + $row[] = '
    '. form_render($form['location']['distance']) . form_render($form['location']['distance_unit']) . '
    '; + $row[] = form_render($form['location']['postal_code']) . form_render($form['location']['country']); + $output = theme('table', NULL, array($row)) . form_render($form['op']); + $output .= form_render($form); return $output; } @@ -100,15 +104,15 @@ function location_search_view() { if ($edit = $_POST['edit']) { $edit = $edit['location']; - $form = drupal_get_form(array('location_search_get_form', $edit)); + $form = location_search_get_form($edit); } elseif (isset($_GET['postal_code']) && isset($_GET['distance']) && isset($_GET['distance_unit']) && isset($_GET['country'])) { $edit = array('postal_code' => $_GET['postal_code'], 'distance' => $_GET['distance'], 'distance_unit' => $_GET['distance_unit'], 'country' => $_GET['country']); - $form = drupal_get_form(array('location_search_get_form', $edit)); + $form = location_search_get_form($edit); $search_results = location_search_get_results($edit); } else { - $form = drupal_get_form('location_search_get_form'); + $form = location_search_get_form(); } print theme('page', $form . (isset($search_results) ? $search_results : '')); @@ -149,7 +153,7 @@ $results_offset = isset($_GET['from']) ? $_GET['from'] : 0; $postal_data = location_get_postalcode_data($location); $search_results_message = t('Displaying results %a - %b of %count for search on %c', array('%a' => $results_offset + 1, '%b' => $results_offset + $page_count, '%count' => $count->result_count, '%c' => ''. filter_xss($edit['postal_code']) .' ('. $postal_data['city'] . ', '. $postal_data['province'] .')')); - } //TODO: filter_xss? + } else { if (isset($_POST['edit']) && !isset($_GET['from'])) { $search_results .= theme('box', t('Your search yielded no results.'), ''); @@ -172,7 +176,7 @@ ); $extra = t('Local to ') . $result_location['postal_code'] .', ' . $result_location['city'] . ', '. $result_location['province'] .', '. $country_index[$result_location['country']] .' - '. $result_location['distance'] . ' ' . $edit['distance_unit'] .' away.'; - //TODO: shouldn't this use printf style replacement like: %postal (array(%postal=>$result_location['postal_code'])) + $extra = array(); $extra['location'] = t('Local to %place', array('%place' => l($result_location['city'] . ', '. $result_location['province'] .', '. $country_index[$result_location['country']], 'search/location', array(), 'postal_code='. urlencode($result_location['postal_code']) . '&country='. urlencode($result_location['country']) .'&distance='. urlencode($edit['distance']) .'&distance_unit='. urlencode($edit['distance_unit'])))); if ($result_location['postal_code'] == $edit['postal_code'] && $result_location['country'] == $edit['country']) { @@ -185,8 +189,8 @@ else { $distance_unit = ($edit['distance_unit'] == 'km') ? t('km') : t('mile'); } - $extra['distance'] = t('Approximately %distance from %location', array('%distance' => round($result_location['distance']) .' '. $distance_unit, '%location' => $edit['postal_code'])); - } //TODO: removed - because I think they are unnecessary, but maybe they are necessary... + $extra['distance'] = t('Approximately %distance from %location', array('%distance' => ''. round($result_location['distance']) .' '. $distance_unit .'', '%location' => $edit['postal_code'])); + } $item = array('link' => url('node/'. $row->nid), @@ -291,7 +295,7 @@ $form['#theme'] = 'location_map_link_options'; - return $form; + return drupal_get_form('location_map_link_options', $form); } function theme_location_map_link_options(&$form) { @@ -302,10 +306,10 @@ $row = array(); $second_cell = ''; foreach (element_children($form[$key]) as $checkbox_key) { - $second_cell .= drupal_render($form[$key][$checkbox_key]); + $second_cell .= form_render($form[$key][$checkbox_key]); } $row[1] = $second_cell; - $row[0] = drupal_render($form[$key]); + $row[0] = form_render($form[$key]); ksort($row); $rows[] = $row; } @@ -315,11 +319,11 @@ $nontable_elems = ''; foreach (array('form_id', 'save', 'reset') as $key) { - $nontable_elems .= drupal_render($form[$key]); + $nontable_elems .= form_render($form[$key]); } $output = theme('table', $header, $rows) . $nontable_elems; - $output .= drupal_render($form); + $output .= form_render($form); return $output; } @@ -335,7 +339,7 @@ $providers = $provider_function(); drupal_set_title(t('Configure parameters for %service', array('%service' => $providers[$service]['name']))); $breadcrumbs = drupal_get_breadcrumb(); - $breadcrumbs[] = l('location', 'admin/settings/location'); + $breadcrumbs[] = l('location', 'admin/settings/locaiton'); $breadcrumbs[] = l('geocoding', 'admin/settings/location/geocoding'); $countries = location_get_iso3166_list(); $breadcrumbs[] = l($countries[$country_iso], 'admin/settings/location/geocoding', array(), NULL, $country_iso); @@ -444,7 +448,7 @@ $form['#theme'] = 'location_geocoding_options'; - return $form; + return drupal_get_form('location_geocoding_options', $form); } function theme_location_geocoding_options(&$form) { @@ -456,14 +460,14 @@ $second_cell = ''; foreach (element_children($form[$key]) as $checkbox_key) { if ($checkbox_key != 'configure_link') { - $second_cell .= drupal_render($form[$key][$checkbox_key]); + $second_cell .= form_render($form[$key][$checkbox_key]); } else { - $third_cell = drupal_render($form[$key][$checkbox_key]); + $third_cell = form_render($form[$key][$checkbox_key]); } } $row[1] = $second_cell; - $row[0] = drupal_render($form[$key]); + $row[0] = form_render($form[$key]); $row[2] = empty($third_cell) ? t('No service selected for country.') : $third_cell; unset($third_cell); ksort($row); @@ -476,11 +480,11 @@ $nontable_elems = ''; foreach (array('form_id', 'save', 'reset') as $key) { - $nontable_elems .= drupal_render($form[$key]); + $nontable_elems .= form_render($form[$key]); } $output = theme('table', $header, $rows) . $nontable_elems .'















    '; - $output .= drupal_render($form); + $output .= form_render($form); return $output; } @@ -486,9 +490,8 @@ function location_form_alter($form_id, &$form) { - if ($form_id == 'node_type_form') { - $type = $form['#node_type']->type; - error_log("TYPE: $type"); + if (isset($form['type']) && $form['type']['#value'] .'_node_settings' == $form_id) { + $type = $form['type']['#value']; $form['location'] = array( '#type' => 'fieldset', '#title' => t('Locative information'), @@ -496,7 +499,7 @@ '#collapsed' => TRUE, '#weight' => 0 ); - $form['location']['location'] = array( + $form['location']['location_'. $type] = array( '#type' => 'checkbox', '#title' => t('Enable for locations'), '#return_value' => 1, @@ -503,10 +506,10 @@ '#default_value' => variable_get('location_'. $type, 0), '#description' => t('Enable the submission of a location for content of this node type. By checking this box and selecting fields for collection below, users will be able to add a full or partial address to each node of this type (depending on which fields you enable or require here).') ); - for ($i=-10; $i<11; $i++) { + for ($i=-10; $i<11; $i++) { $options[$i] = $i; } - $form['location']['location_weight'] = array( + $form['location']['location_weight_'. $type] = array( '#prefix' => '
    ', '#type' => 'select', '#title' => t('Location weight'), @@ -514,7 +517,7 @@ '#default_value' => variable_get('location_weight_'. $type, 9), '#description' => t('Weight of the location box in the input form. Lowest values will be displayed higher in the form.') ); - $form['location']['location_collapsible'] = array( + $form['location']['location_collapsible_'. $type] = array( '#type' => 'checkbox', '#title' => t('Collapsible'), '#return_value' => 1, @@ -521,7 +524,7 @@ '#default_value' => variable_get('location_collapsible_'. $type, 1), '#description' => t('Make the location box collapsible.') ); - $form['location']['location_collapsed'] = array( + $form['location']['location_collapsed_'. $type] = array( '#type' => 'checkbox', '#title' => t('Collapsed'), '#return_value' => 1, @@ -528,7 +531,7 @@ '#default_value' => variable_get('location_collapsed_'. $type, 1), '#description' => t('Display the location box collapsed.') ); - $form['location']['location_name'] = array( + $form['location']['location_name_'. $type] = array( '#type' => 'radios', '#title' => t('Location names'), '#default_value' => variable_get('location_name_'. $type, $default), @@ -534,7 +537,7 @@ '#default_value' => variable_get('location_name_'. $type, $default), '#options' => array(t('Do not collect location names (e.g. place of business) for this node type.'), t('Allow location names for content of this type.'), t('Require location names for content of this type.')) ); - $form['location']['location_street'] = array( + $form['location']['location_street_'. $type] = array( '#type' => 'radios', '#title' => t('Street locations'), '#default_value' => variable_get('location_street_'. $type, $default), @@ -540,7 +543,7 @@ '#default_value' => variable_get('location_street_'. $type, $default), '#options' => array(t('Do not collect a street location for content of this type.'), t('Allow street locations to be submitted for content of this type.'), t('Require street locations to be submitted for content of this type.')) ); - $form['location']['location_city'] = array( + $form['location']['location_city_'. $type] = array( '#type' => 'radios', '#title' => t('City names'), '#default_value' => variable_get('location_city_'. $type, 0), @@ -546,7 +549,7 @@ '#default_value' => variable_get('location_city_'. $type, 0), '#options' => array(t('Do not collect city names for content of this type.'), t('Allow city names to be submitted for content of this type.'), t('Require city names to be submitted for content of this type.')) ); - $form['location']['location_province'] = array( + $form['location']['location_province_'. $type] = array( '#type' => 'radios', '#title' => 'State/Province names', '#default_value' => variable_get('location_province_'. $type, 0), @@ -552,7 +555,7 @@ '#default_value' => variable_get('location_province_'. $type, 0), '#options' => array(t('Do not collect state/province names for content of this type.'), t('Allow state/province names to be submitted for content of this type.'), t('Require state/province names to be submitted for content of this type.')) ); - $form['location']['location_postal_code'] = array( + $form['location']['location_postal_code_'. $type] = array( '#type' => 'radios', '#title' => 'Postal codes', '#default_value' => variable_get('location_postal_code_'. $type, 0), @@ -558,7 +561,7 @@ '#default_value' => variable_get('location_postal_code_'. $type, 0), '#options' => array(t('Do not collect postal codes for content of this type.'), t('Allow postal codes to be submitted for content of this type.'), t('Require postal codes to be submitted for content of this type.')) ); - $form['location']['location_country'] = array( + $form['location']['location_country_'. $type] = array( '#type' => 'radios', '#title' => 'Country names', '#default_value' => variable_get('location_country_'. $type, 1), @@ -563,7 +566,7 @@ '#title' => 'Country names', '#default_value' => variable_get('location_country_'. $type, 1), '#options' => array(1 => t('Allow country names to be submitted for content of this type.'), 2 => t('Require country names to be submitted for content of this type.')), - '#description' => t('The selection of a country can be hidden and/or forced to a default country selection by going to the location settings page and checking the box marked "Hide country selection" and selecting a country from the drop down select labelled "Default country selection".', array('%location_settings' => 'admin/settings/location')), + '#description' => t('The selection of a country can be hidden and/or forced to a default country selection by going to the %location_settings and checking the box marked "Hide country selection" and selecting a country from the drop down select labelled "Default country selection".', array('%location_settings' => l(t('location settings page'), 'admin/settings/location'))), '#suffix' => '
    ' ); // clear the views cache in case anything was changed @@ -571,7 +574,7 @@ views_invalidate_cache(); } } - else if (isset($form['type']['#value']) && $form['type']['#value']. '_node_form' == $form_id && variable_get('location_'. $form['type']['#value'], 0)) { + else if (isset($form['type']) && $form['type']['#value'] .'_node_form' == $form_id && variable_get('location_'. $form['type']['#value'], 0)) { $node = $form['#node']; $location_fields = array(); $required_fields = array(); @@ -646,7 +649,7 @@ $workflow_setting = variable_get('location_'. $field_name .'_'. $node->type, $field_name == 'country' ? 1 : 0); if (variable_get('location_'. $field_name .'_'. $node->type, 0) == 2) { if (isset($node->location[$field_name]) && !strlen(trim($node->location[$field_name]))) { - form_set_error('location]['. $field_name, t('The field %field is required.', array('%field' => $display_name))); + form_set_error('location]['. $field_name, t('The field %field is required.', array('%field' => theme('placeholder', $display_name)))); } } $node->location[$field_name] = trim($node->location[$field_name]); @@ -668,8 +671,8 @@ if (user_access('submit latitude/longitude')) { if ((!strlen(trim($node->location['latitude'])) && strlen(trim($node->location['longitude']))) || (strlen(trim($node->location['latitude'])) && !strlen(trim($node->location['longitude'])))) { - form_set_error('location][latitude', t('You must fill out both longitude and latitude or you must leave them both blank.')); - form_set_error('location][longitude', NULL); + form_set_error('location][latitude', t('You must fill out both longitude and latitude or')); + form_set_error('location][longitude', t('you must leave them both blank.')); } elseif (strlen(trim($node->location['latitude'])) && strlen(trim($node->location['longitude']))) { if (!is_numeric($node->location['latitude']) || $node->location['latitude'] > 90.0 || $node->location['latitude'] < -90.0) { @@ -887,10 +890,10 @@ /** - * Callback for admin/settings/location + * Implementation of hook_settings(). * */ -function location_admin_settings() { +function location_configure() { $supported_countries = _location_supported_countries(); $default_country = variable_get('location_default_country', 'us'); @@ -924,7 +927,7 @@ '#title' => t('Hide country selection'), '#return_value' => 1, '#default_value' => variable_get('location_suppress_country', 0), - '#description' => t("If your site is specific to a country and you would like to hide the country field on search forms and content creation forms, check this box. Doing so will automatically assume the country to be the country you have chosen for the 'default country selection' above.") + '#description' => t('If your site is specific to a country and you would like to hide the country field on search forms and content creation forms, check this box. Doing so will automatically assume the country to be the country you have chosen for the \'default country selection\' above.') ); $form['location_search_distance_unit'] = array( '#type' => 'radios', @@ -938,10 +941,10 @@ '#title' => t('Toggle location display'), '#default_value' => variable_get('location_display_location', 1), '#options' => array(0 => t('Disable the display of locations.'), 1 => t('Enable the display of locations.')), - '#description' => t('If you are interested in turning off locations and having a custom theme control their display, you may want to disable the display of locations so your theme can take that function.') + '#description' => t('If you are interested in turning off locations and having a custom theme control their display, you may want to disable the display of locations so your theme can take over them.') ); - if (!module_exists('civicrm')) { + if (!module_exist('civicrm')) { $form['location_user'] = array( '#type' => 'radios', '#title' => 'User locations', @@ -954,7 +957,7 @@ $form['location_user'] = array( '#type' => 'item', '#title' => t('User locations'), - '#description' => t("You have enabled the CiviCRM module. This means that CiviCRM will collect user locations for you. To make sure you will be able to use location module features with these user addresses, you should make sure the CiviCRM 'address' profile is marked as active. If you installed CiviCRM on a seperate Drupal installation, please consult the documentation in the README.txt file for the Location module.") + '#description' => t('You have enabled the CiviCRM module. This means that CiviCRM will collect user locations for you. To make sure you will be able to use location module features with these user addresses, you should make sure the CiviCRM \'address\' profile is marked as active. If you are using CivicSpace, this comes activated on a default install. If you installed CiviCRM on a seperate Drupal installation, please consult the documentation in the README file for the location module.') ); } @@ -962,8 +965,8 @@ '#type' => 'checkbox', '#title' => t('Use a Google Map to set latitude and longitude '), '#return_value' => 1, - '#default_value' => variable_get('location_usegmap', 1), - '#description' => t('If the gmap.module is installed and enabled, and this is setting is turned on, users that are allowed to manually enter latitude/longitude coordinates will be able to do so with an interactive Google Map. You should also make sure you have entered a Google Maps API key into your gmap module settings.', array('@enabled' => 'admin/build/modules', '@google_maps_api_key' => 'http://www.google.com/apis/maps', '@gmap_module_settings' => 'admin/settings/gmap')) + '#default_value' => variable_get('location_usegmap',1), + '#description' => t('If the gmap.module is installed and %enabled, and this is setting is turned on, users that are allowed to manually enter latitude/longitude coordinates will be able to do so with an interactive Google Map. You should also make sure you have entered a %google_maps_api_key into your %gmap_module_settings.', array('%enabled' => l('enabled', 'admin/modules'), '%google_maps_api_key' => 'Google Maps API key', '%gmap_module_settings' => l('gmap module settings', 'admin/settings/gmap'))) ); $form['location_configured_countries'] = array( @@ -974,7 +977,7 @@ '#description' => t('Currently, your CivicSpace site is capable of supporting extra features (e.g., postal code proximity searches) for locations from this list of countries. Please narrow the list down to countries for which you want to support these extra features. It may be useful for performance to narrow down this list if most the locations in your system are from only a handful of the listed countries.') ); - return system_settings_form($form); + return system_settings_form('location_configure_settings', $form); } @@ -979,7 +982,7 @@ function _location_effective_user_setting() { - if (module_exists('civicrm')) { + if (module_exist('civicrm')) { return LOCATION_USER_CIVICRM_ONLY; } else { @@ -996,7 +999,7 @@ if ($op == 'form' && $category == 'account' && $user_setting == LOCATION_USER_COLLECT) { $form = array(1 => array()); - $form[0]['location'] = location_form(array('street', 'city', 'province', 'postal_code', 'country'), (isset($user->location) && !_location_is_empty($user->location)) ? location_api2form($user->location) : array('country' => variable_get('location_default_country', 'us')), array(), variable_get('location_suppress_country', 0) ? array('country' => variable_get('location_default_country', 'us')) : array()); + $form[0]['location'] = location_form(array('street', 'city', 'province', 'postal_code', 'country'), (isset($user->location) && !_location_is_empty($user->location)) ? location_api2form($user->location) : array('country' => variable_get('location_default_country', 'us'))); $form[0]['location']['#type'] = 'fieldset'; $form[0]['location']['#title'] = t('Location'); $form[0]['location']['#tree'] = TRUE; @@ -1070,7 +1073,7 @@ if (user_access('submit latitude/longitude')) { if ($user->location['latitude'] != NULL && $user->location['longitude'] != NULL) { $items[] = array('title' => t('Coordinates'), - 'value' => t('lat: %latitude',array('%latitude' => $user->location['latitude'])) .'
    '. t('lon: %longitude', array('%longitude' => $user->location['longitude'])), + 'value' => t('lat: %latitude
    lon: %longitude', array('%latitude' => $user->location['latitude'], '%longitude' => $user->location['longitude'])), 'class' => 'location', ); }