You are here

function getlocations_defaults in Get Locations 6

Same name and namespace in other branches
  1. 6.2 getlocations.module \getlocations_defaults()
  2. 7.2 getlocations.module \getlocations_defaults()
  3. 7 getlocations.module \getlocations_defaults()

Some defaults.

Return value

Returns the current settings

10 calls to getlocations_defaults()
getlocations_get_markertypes in ./getlocations.module
getlocations_load_location in ./getlocations.module
getlocations_nodemap in ./getlocations.module
Menu callback
getlocations_plugin_style_map::option_definition in ./getlocations_plugin_style_map.inc
getlocations_setlocations in ./getlocations.module
Set up javascript settings and map

... See full list

File

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

Code

function getlocations_defaults() {
  $defaults = array(
    'api_version' => 3,
    'width' => '300px',
    'height' => '200px',
    'zoom' => 3,
    'controltype' => 'small',
    'pancontrol' => 1,
    'latlong' => '40,0',
    'maptype' => 'Map',
    'mtc' => 'standard',
    'baselayers' => array(
      'Map' => 1,
      'Satellite' => 1,
      'Hybrid' => 1,
      'Physical' => 1,
    ),
    'behavior' => array(
      'scale' => 0,
      'overview' => 0,
      'overview_opened' => 0,
      'scrollwheel' => 0,
    ),
    'streetview_show' => 0,
    'trafficinfo' => 0,
    'trafficinfo_state' => 0,
    'bicycleinfo' => 0,
    'bicycleinfo_state' => 0,
    'transitinfo' => 0,
    'transitinfo_state' => 0,
    'panoramio_use' => 0,
    'panoramio_show' => 0,
    'panoramio_state' => 0,
    'places' => 0,
    'poi_show' => 1,
    'transit_show' => 1,
    'node_map_marker' => 'drupal',
    'user_map_marker' => 'drupal',
    'markeraction' => 0,
    'markeractiontype' => 1,
    'minzoom' => 6,
    'maxzoom' => 16,
    'nodezoom' => 12,
    'markermanagertype' => 1,
    'usemarkermanager' => 1,
    'useclustermanager' => 0,
    'markerclusterer_style' => -1,
    'markerclusterer_zoom' => -1,
    'markerclusterer_size' => -1,
    'markerclusterer_minsize' => -1,
    'pansetting' => 2,
    'draggable' => 1,
    'styles' => '',
    'returnlink_page_enable' => 0,
    'returnlink_page_link' => t('Return to Page'),
    'returnlink_user_enable' => 0,
    'returnlink_user_link' => t('Return to User'),
    'use_https' => isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 1 : 0,
    'custom_content_enable' => 0,
    'custom_content_source' => '',
    'weather_use' => 0,
    'weather_show' => 0,
    'weather_state' => 0,
    'weather_temp' => 1,
    'weather_speed' => 1,
    'weather_label' => 0,
    'weather_cloud' => 1,
    'weather_cloud_state' => 0,
    'weather_clickable' => 1,
    'weather_info' => 1,
    'map_backgroundcolor' => '',
  );
  $getlocations_defaults = variable_get('getlocations_default', array());

  // array_merge deletes things in $defaults that are not in $getlocations_defaults ;-/
  // roll my own
  $newdefaults = array();
  foreach ($defaults as $k => $v) {
    if (is_array($v)) {
      foreach ($defaults[$k] as $k1 => $v1) {
        if (isset($getlocations_defaults[$k][$k1])) {
          $newdefaults[$k][$k1] = $getlocations_defaults[$k][$k1];
        }
        else {
          $newdefaults[$k][$k1] = $v1;
        }
      }
    }
    else {
      if (isset($getlocations_defaults[$k])) {
        $newdefaults[$k] = $getlocations_defaults[$k];
      }
      else {
        $newdefaults[$k] = $v;
      }
    }
  }
  return $newdefaults;
}