geo

geo/geo.module, line 17

Versions
6
geo($op = NULL)

Call an API function from the geo backend databases. This function will find and load the database backend files, and call the requested op from the backend or the default library, as needed.

Return value

mixed The result of the database operation execution.

▾ 22 functions call geo()

geo_data_admin in geo/modules/geo_data/geo_data.admin.inc
Put together a form of all the spatial columns.
geo_data_admin in geo/modules/geo_data/geo_data.admin.inc
Put together a form of all the spatial columns.
geo_data_field in geo/modules/geo_data/geo_data.module
Implementation of hook_field().
geo_data_field in geo/modules/geo_data/geo_data.module
Implementation of hook_field().
geo_data_field_settings in geo/modules/geo_data/geo_data.module
Implementation of hook_field_settings().
geo_data_field_settings in geo/modules/geo_data/geo_data.module
Implementation of hook_field_settings().
geo_data_views_data in geo/modules/geo_data/includes/views/geo_data.views.inc
geo_data_views_data in geo/modules/geo_data/includes/views/geo_data.views.inc
geo_field in geo/modules/geo_field/geo_field.module
Implementation of hook_field().
geo_field in geo/modules/geo_field/geo_field.module
Implementation of hook_field().
geo_field_nodeapi in geo/modules/geo_field/geo_field.module
Implementation of hook_nodeapi(). Append microformats onto geo node feeds.
geo_field_nodeapi in geo/modules/geo_field/geo_field.module
Implementation of hook_nodeapi(). Append microformats onto geo node feeds.
geo_field_settings in geo/modules/geo_field/geo_field.module
Implementation of hook_field_settings().
geo_field_settings in geo/modules/geo_field/geo_field.module
Implementation of hook_field_settings().
geo_shp2sql in geo/includes/shp2sql.inc
geo_shp2sql in geo/includes/shp2sql.inc
openlayers_layers_openlayers_layers_info in openlayers/modules/openlayers_layers/openlayers_layers.module
Implementation of hook_openlayers_layers_info
openlayers_layers_openlayers_layers_info in openlayers/modules/openlayers_layers/openlayers_layers.module
Implementation of hook_openlayers_layers_info
openlayers_layers_process_geo_data_layers in openlayers/modules/openlayers_layers/includes/openlayers_layers.layers.inc
Speicifc Layer Callback for Geo Table Layers
openlayers_layers_process_geo_data_layers in openlayers/modules/openlayers_layers/includes/openlayers_layers.layers.inc
Speicifc Layer Callback for Geo Table Layers
_geo_field_init in geo/modules/geo_field/geo_field.module
_geo_field_init in geo/modules/geo_field/geo_field.module

Code

<?php
function geo($op = NULL) {
  static $backend;

  // Load common functions.
  module_load_include('inc', 'geo');

  // Load database-specific functions.
  if (!isset($backend)) {
    $backend = geo_backend_type();
    module_load_include('inc', 'geo', 'db/'. $backend);
  }

  // Call the appropriate API function: If geo_$backend_$op exists, call that.
  // Otherwise, resort to geo_$op.  This creates a sort of inheritence system.
  $args = func_get_args();
  if($args) {
    $op = array_shift($args);
    if (!function_exists($func = 'geo_'. $backend .'_'. $op)) {
      $func = 'geo_'. $op;
    }
    if (!function_exists($func)) {
      drupal_set_message(t('Call to undefined geo operation %op', array('%op' => $op)), 'error');
      return FALSE;
    }
    return call_user_func_array($func, $args);
  }
}
?>