/[drupal]/contributions/modules/location/location.admin.inc
ViewVC logotype

Diff of /contributions/modules/location/location.admin.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.20, Fri Apr 17 19:09:53 2009 UTC revision 1.21, Mon Aug 31 22:09:34 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: location.admin.inc,v 1.19 2009/03/02 20:41:34 bdragon Exp $  // $Id: location.admin.inc,v 1.20 2009/04/17 19:09:53 bdragon Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 21  function location_admin_settings() { Line 21  function location_admin_settings() {
21    $iso_list_sorted = array_merge(array('' => ''), $iso_list_sorted);    $iso_list_sorted = array_merge(array('' => ''), $iso_list_sorted);
22    
23    $form  = array();    $form  = array();
24    $form['location_default_country'] = array(  
25      '#type'           => 'select',    // @@@TODO 7.x -- Verify integrity of site_default_country and direct user
26      '#title'          => t('Default country selection'),    // to the appropriate place to change it if necessary.
27      '#default_value'  => variable_get('location_default_country', 'us'),  
     '#options'        => $iso_list_sorted,  
     '#description'    => t('This will be the country that is automatically selected when a location form is served for a new location.')  
   );  
28    $form['location_display_location'] = array(    $form['location_display_location'] = array(
29      '#type'           => 'radios',      '#type'           => 'radios',
30      '#title'          => t('Toggle location display'),      '#title'          => t('Toggle location display'),
# Line 75  function location_map_link_options_form( Line 72  function location_map_link_options_form(
72    
73    $form['countries'] = array(    $form['countries'] = array(
74      '#type' => 'markup',      '#type' => 'markup',
75      '#value' => ''      '#markup' => ''
76    );    );
77    
78    foreach (_location_supported_countries() as $country_iso => $country_name) {    foreach (_location_supported_countries() as $country_iso => $country_name) {
# Line 83  function location_map_link_options_form( Line 80  function location_map_link_options_form(
80    
81      $form['countries'][$country_iso] = array(      $form['countries'][$country_iso] = array(
82        '#type' => 'markup',        '#type' => 'markup',
83        '#value' => ''        '#markup' => ''
84      );      );
85    
86      $form['countries'][$country_iso]['label_'. $country_iso] = array(      $form['countries'][$country_iso]['label_'. $country_iso] = array(
87        '#type' => 'markup',        '#type' => 'markup',
88        '#value' => $country_name        '#markup' => $country_name
89      );      );
90    
91      // Set up '#options' array for mapping providers for the current country      // Set up '#options' array for mapping providers for the current country
# Line 114  function location_map_link_options_form( Line 111  function location_map_link_options_form(
111      else {      else {
112        $form['countries'][$country_iso]['location_map_link_'. $country_iso] = array(        $form['countries'][$country_iso]['location_map_link_'. $country_iso] = array(
113          '#type' => 'markup',          '#type' => 'markup',
114          '#value' => t('None supported.')          '#markup' => t('None supported.')
115        );        );
116      }      }
117    }    }
# Line 191  function location_geocoding_options_form Line 188  function location_geocoding_options_form
188      else {      else {
189        $form['countries'][$country_iso]['location_geocode_'. $country_iso] = array(        $form['countries'][$country_iso]['location_geocode_'. $country_iso] = array(
190          '#type' => 'markup',          '#type' => 'markup',
191          '#value' => t('None supported.')          '#markup' => t('None supported.')
192        );        );
193      }      }
194    
# Line 199  function location_geocoding_options_form Line 196  function location_geocoding_options_form
196      if ($current_value == 'none') {      if ($current_value == 'none') {
197        $form['countries'][$country_iso]['location_geocode_config_link_'. $country_iso] = array(        $form['countries'][$country_iso]['location_geocode_config_link_'. $country_iso] = array(
198          '#type' => 'markup',          '#type' => 'markup',
199          '#value' => t('No service selected for country.')          '#markup' => t('No service selected for country.')
200        );        );
201      }      }
202      else {      else {
# Line 210  function location_geocoding_options_form Line 207  function location_geocoding_options_form
207        if (function_exists($geocode_settings_form_function_specific)) {        if (function_exists($geocode_settings_form_function_specific)) {
208          $form['countries'][$country_iso]['location_geocode_config_link_'. $country_iso] = array(          $form['countries'][$country_iso]['location_geocode_config_link_'. $country_iso] = array(
209            '#type' => 'markup',            '#type' => 'markup',
210            '#value' => l(t('Configure parameters'), 'admin/settings/location/geocoding/'. $country_iso .'/'. $current_val_chopped)            '#markup' => l(t('Configure parameters'), 'admin/settings/location/geocoding/'. $country_iso .'/'. $current_val_chopped)
211          );          );
212        }        }
213        elseif (function_exists($geocode_settings_form_function_general)) {        elseif (function_exists($geocode_settings_form_function_general)) {
214          $form['countries'][$country_iso]['location_geocode_config_link_'. $country_iso] = array(          $form['countries'][$country_iso]['location_geocode_config_link_'. $country_iso] = array(
215            '#type' => 'markup',            '#type' => 'markup',
216            '#value' => l(t('Configure parameters'), 'admin/settings/location/geocoding/'. $country_iso .'/'. $current_value)            '#markup' => l(t('Configure parameters'), 'admin/settings/location/geocoding/'. $country_iso .'/'. $current_value)
217          );          );
218        }        }
219        else {        else {
220          $form['countries'][$country_iso]['location_geocode_config_link_'. $country_iso] = array(          $form['countries'][$country_iso]['location_geocode_config_link_'. $country_iso] = array(
221            '#type' => 'markup',            '#type' => 'markup',
222            '#value' => t('No configuration necessary for selected service.')            '#markup' => t('No configuration necessary for selected service.')
223          );          );
224        }        }
225      }      }
# Line 264  function theme_location_map_link_options Line 261  function theme_location_map_link_options
261      $rows[] = $row;      $rows[] = $row;
262    }    }
263    $output = theme('table', $header, $rows);    $output = theme('table', $header, $rows);
264    foreach (element_children($form) as $key) {    $output .= drupal_render_children($form);
     $output .= drupal_render($form[$key]);  
   }  
   $output .= drupal_render($form);  
265    return $output;    return $output;
266  }  }
267    
# Line 292  function theme_location_geocoding_option Line 286  function theme_location_geocoding_option
286      $rows[] = $row;      $rows[] = $row;
287    }    }
288    $output = theme('table', $header, $rows);    $output = theme('table', $header, $rows);
289    foreach (element_children($form) as $key) {    $output .= drupal_render_children($form);
     $output .= drupal_render($form[$key]);  
   }  
   $output .= drupal_render($form);  
290    return $output;    return $output;
291  }  }
292    

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.21

  ViewVC Help
Powered by ViewVC 1.1.2