You are here

function webform_export_fetch_definition in Webform 7.4

Same name and namespace in other branches
  1. 5.2 webform_export.inc \webform_export_fetch_definition()
  2. 6.3 includes/webform.export.inc \webform_export_fetch_definition()
  3. 6.2 webform_export.inc \webform_export_fetch_definition()
  4. 7.3 includes/webform.export.inc \webform_export_fetch_definition()

Returns a Webform exporter definition.

3 calls to webform_export_fetch_definition()
webform_export_create_handler in includes/webform.export.inc
Instantiates a new Webform handler based on the format.
webform_export_list in includes/webform.export.inc
Return a list of exporters suitable for display in a select list.
webform_results_download_default_options in includes/webform.report.inc
Get options for creating downloadable versions of the webform data.

File

includes/webform.export.inc, line 70
Provides several different handlers for exporting webform results.

Code

function webform_export_fetch_definition($format = NULL) {
  static $cache;
  if (!isset($cache)) {
    $cache = module_invoke_all('webform_exporters');
    drupal_alter('webform_exporters', $cache);
    foreach ($cache as $key => $exporter) {
      $cache[$key] += array(
        'weight' => 0,
      );

      // Used in sorting.
      $cache[$key]['name'] = $key;
    }
    uasort($cache, '_webform_components_sort');
  }
  if (isset($format)) {
    if (isset($cache[$format])) {
      return $cache[$format];
    }
  }
  else {
    return $cache;
  }
}