You are here

function views_oai_pmh_list_metadata_formats in Views OAI-PMH 7.3

Returns the list of metadata formats implemented by all the active modules.

Parameters

bool $with_module_names: If TRUE, returned array will be keyed by format id, and each value will be the module implementing the format. Default is FALSE, meaning the returned array will only contain format ids (as array values).

3 calls to views_oai_pmh_list_metadata_formats()
views_oai_pmh_get_metadata_format in ./views_oai_pmh.module
Returns the metadata format object for a given id.
views_oai_pmh_plugin_style::options_form in plugins/views_oai_pmh_plugin_style.inc
Provide settings for this plugin.
views_oai_pmh_request::parse_metadata_prefix in includes/request.inc
Checks that the metadataPrefix argument matches a supported metadata format.

File

./views_oai_pmh.module, line 100
The Views OAI-PMH module.

Code

function views_oai_pmh_list_metadata_formats($with_module_names = FALSE) {
  $formats =& drupal_static(__FUNCTION__);
  if (!isset($formats)) {

    // Query modules for their supported formats. For each format, keep track
    // of which module provides it.
    foreach (module_implements('views_oai_pmh_metadata_format_info') as $module) {
      $hook = $module . '_views_oai_pmh_metadata_format_info';
      $module_formats = $hook();
      foreach ($module_formats as $id) {
        $formats[$id] = $module;
      }
    }
  }
  if ($with_module_names) {
    return $formats;
  }
  else {
    return array_keys($formats);
  }
}