You are here

function staticmap_load_provider in Static Map 7

Load provider.

Parameters

int $provider_id: ID for provider.

Return value

bool Returns provider or FALSE if not found.

3 calls to staticmap_load_provider()
staticmap_ctools_export_ui_form in ./staticmap.module
Form for ctools export UI.
staticmap_field_formatter_settings_summary in ./staticmap.module
Implements hook_field_formatter_settings_summary().
staticmap_field_formatter_view in ./staticmap.module
Implements hook_field_formatter_view().

File

./staticmap.module, line 372
SiteMap module.

Code

function staticmap_load_provider($provider_id) {
  $provider_info = staticmap_load_provider_info($provider_id);
  if ($provider_info) {
    $class_name = $provider_info['class'];
    module_load_include('php', 'staticmap', 'includes/MapProviderBase');
    include_once $provider_info['path'] . '/' . $provider_info['filename'] . '.' . $provider_info['extension'];
    if (class_exists($class_name)) {
      $provider = new $class_name();
      return $provider;
    }
  }
  return FALSE;
}