You are here

function getlocations_map_display_options_form in Get Locations 6

Same name and namespace in other branches
  1. 6.2 getlocations.module \getlocations_map_display_options_form()
  2. 7.2 getlocations.module \getlocations_map_display_options_form()
  3. 7 getlocations.module \getlocations_map_display_options_form()
2 calls to getlocations_map_display_options_form()
getlocations_plugin_style_map::options_form in ./getlocations_plugin_style_map.inc
getlocations_settings_form in ./getlocations.admin.inc
Function to display the getlocations admin settings form

File

./getlocations.module, line 1501
Displays locations on a map. for Drupal 6 using version 3 googlemaps API

Code

function getlocations_map_display_options_form($defaults, $config = TRUE, $extras = TRUE) {
  $form = array();
  $form['controltype'] = getlocations_element_map_zoom_controltype($defaults['controltype']);
  $form['pancontrol'] = getlocations_element_map_checkbox(t('Show Pan control'), $defaults['pancontrol']);
  $form['mtc'] = getlocations_element_map_mtc($defaults['mtc']);
  $form['maptype'] = getlocations_element_map_maptype($defaults['maptype'], $defaults['baselayers']);
  foreach ($defaults['baselayers'] as $key => $value) {
    $layer = getlocations_element_map_baselayers($key, $value);
    if ($layer) {
      $form['baselayers'][$key] = $layer;
    }
  }
  foreach ($defaults['behavior'] as $key => $value) {
    $layer = getlocations_element_map_behavior($key, $value);
    if ($layer) {
      $form['behavior'][$key] = $layer;
    }
  }
  $form['draggable'] = getlocations_element_map_checkbox(t('Draggable'), $defaults['draggable'], t('Enable dragging the map.'));
  $form['map_backgroundcolor'] = getlocations_element_map_tf(t('Map background color'), $defaults['map_backgroundcolor'], 10, 128, t('Can be a color name or HTML hex, eg #FF0000. Leave empty for the default color.'), FALSE);
  if ($extras) {
    $form['streetview_show'] = getlocations_element_map_checkbox(t('Show streetview button'), $defaults['streetview_show']);
    $form['trafficinfo'] = getlocations_element_map_checkbox(t('Enable Traffic information'), $defaults['trafficinfo'], t('Google trafficinfo layer, limited availability.'));
    $form['trafficinfo']['#suffix'] = '<div id="wrap-getlocations-trafficinfo">';
    $form['trafficinfo_state'] = getlocations_element_map_checkbox(t('Activate Traffic information'), $defaults['trafficinfo_state'], t('Activate Traffic layer when map is first displayed.'));
    $form['trafficinfo_state']['#suffix'] = '</div>';
    $form['bicycleinfo'] = getlocations_element_map_checkbox(t('Enable Bicycling information'), $defaults['bicycleinfo'], t('Google bicycling layer, limited availability.'));
    $form['bicycleinfo']['#suffix'] = '<div id="wrap-getlocations-bicycleinfo">';
    $form['bicycleinfo_state'] = getlocations_element_map_checkbox(t('Activate Bicycle information'), $defaults['bicycleinfo_state'], t('Activate Bicycling layer when map is first displayed.'));
    $form['bicycleinfo_state']['#suffix'] = '</div>';
    $form['transitinfo'] = getlocations_element_map_checkbox(t('Enable Public transport information'), $defaults['transitinfo'], t('Google Transit layer, limited availability.'));
    $form['transitinfo']['#suffix'] = '<div id="wrap-getlocations-transitinfo">';
    $form['transitinfo_state'] = getlocations_element_map_checkbox(t('Activate Public transport information'), $defaults['transitinfo_state'], t('Activate Transit layer when map is first displayed.'));
    $form['transitinfo_state']['#suffix'] = '</div>';
    if ($config) {
      $form['panoramio_use'] = getlocations_element_map_checkbox(t('Load Panoramio Library'), $defaults['panoramio_use'], t('Provide Google panoramio library to all maps.'));
      $form['panoramio_use']['#suffix'] = '<div id="wrap-getlocations-panoramio-use">';
      $form['panoramio_show'] = getlocations_element_map_checkbox(t('Enable Panoramio'), $defaults['panoramio_show'], t('Google panoramio picture links.'));
      $form['panoramio_show']['#suffix'] = '<div id="wrap-getlocations-panoramio">';
      $form['panoramio_state'] = getlocations_element_map_checkbox(t('Activate Panoramio'), $defaults['panoramio_state'], t('Activate Panoramio when map is first displayed.'));
      $form['panoramio_state']['#suffix'] = '</div></div>';
    }
    elseif ($defaults['panoramio_use']) {
      $form['panoramio_show'] = getlocations_element_map_checkbox(t('Enable Panoramio'), $defaults['panoramio_show'], t('Google panoramio picture links.'));
      $form['panoramio_show']['#suffix'] = '<div id="wrap-getlocations-panoramio">';
      $form['panoramio_state'] = getlocations_element_map_checkbox(t('Activate Panoramio'), $defaults['panoramio_state'], t('Activate Panoramio when map is first displayed.'));
      $form['panoramio_state']['#suffix'] = '</div>';
    }

    // weather
    if ($config) {
      $form['weather_use'] = getlocations_element_map_checkbox(t('Load Weather Library'), $defaults['weather_use'], t('Provide Google Weather library to all maps.'));
      $form['weather_use']['#suffix'] = '<div id="wrap-getlocations-weather-use">';
      $form['weather_show'] = getlocations_element_map_checkbox(t('Enable Weather information'), $defaults['weather_show'], t('Google Weather information.'));
      $form['weather_show']['#suffix'] = '<div id="wrap-getlocations-weather">';
      $form['weather_state'] = getlocations_element_map_checkbox(t('Activate Weather information'), $defaults['weather_state'], t('Activate Weather information when map is first displayed.'));
      $form['weather_state']['#suffix'] = '</div>';
      $form['weather_temp'] = getlocations_element_dd(t('Temperature units'), $defaults['weather_temp'], array(
        1 => t('Celsius'),
        2 => t('Fahrenheit'),
      ));
      $form['weather_speed'] = getlocations_element_dd(t('Windspeed units'), $defaults['weather_speed'], array(
        1 => t('Kilometers per hour'),
        2 => t('Meters per second'),
        3 => t('Miles per hour'),
      ));
      $form['weather_label'] = getlocations_element_dd(t('Label colour'), $defaults['weather_label'], array(
        0 => 'Auto',
        1 => t('Black'),
        2 => t('White'),
      ));
      $form['weather_cloud'] = getlocations_element_map_checkbox(t('Enable Cloud Layer'), $defaults['weather_cloud'], t('Google Cloud information.'));
      $form['weather_cloud']['#suffix'] = '<div id="wrap-getlocations-weather-cloud">';
      $form['weather_cloud_state'] = getlocations_element_map_checkbox(t('Activate Cloud Layer'), $defaults['weather_cloud_state'], t('Activate Cloud layer when map is first displayed.'));
      $form['weather_cloud_state']['#suffix'] = '</div>';
      $form['weather_clickable'] = getlocations_element_map_checkbox(t('Enable clicking on maps'), $defaults['weather_clickable']);
      $form['weather_info'] = getlocations_element_map_checkbox(t('Enable weather InfoWindows'), $defaults['weather_info']);
      $form['weather_info']['#suffix'] = '</div>';
    }
    elseif ($defaults['weather_use']) {
      $form['weather_show'] = getlocations_element_map_checkbox(t('Enable Weather information'), $defaults['weather_show'], t('Google Weather information.'));
      $form['weather_show']['#suffix'] = '<div id="wrap-getlocations-weather">';
      $form['weather_state'] = getlocations_element_map_checkbox(t('Activate Weather information'), $defaults['weather_state'], t('Activate Weather information when map is first displayed.'));
      $form['weather_cloud'] = getlocations_element_map_checkbox(t('Enable Cloud Layer'), $defaults['weather_cloud'], t('Google cloud information.'));
      $form['weather_cloud']['#suffix'] = '<div id="wrap-getlocations-weather-cloud">';
      $form['weather_cloud_state'] = getlocations_element_map_checkbox(t('Activate Cloud Layer'), $defaults['weather_cloud_state'], t('Activate Cloud layer when map is first displayed.'));
      $form['weather_cloud_state']['#suffix'] = '</div></div>';
    }
    $form['poi_show'] = getlocations_element_map_checkbox(t('Show Points of Interest'), $defaults['poi_show'], t('Show Google points of interest icons.'));
    $form['transit_show'] = getlocations_element_map_checkbox(t('Show Transit Points'), $defaults['transit_show'], t('Show Google transit points icons.'));
  }
  return $form;
}