You are here

protected function views_oai_pmh_plugin_style::list_metadata_formats_render in Views OAI-PMH 7.3

Renders a response to the 'ListMetadataFormats' OAI-PMH request.

The request's 'identifier' argument, if present, is just ignored here since the same formats are supported regardless of the requested node.

File

plugins/views_oai_pmh_plugin_style.inc, line 342
Contains the base OAI-PMH style plugin.

Class

views_oai_pmh_plugin_style
Views OAI-PMH_plugin style.

Code

protected function list_metadata_formats_render() {
  $this
    ->xml_append_verb();
  $enabled_formats = $this
    ->get_metadata_prefixes();
  foreach ($enabled_formats as $metadata_prefix => $format_id) {
    if ($format = views_oai_pmh_get_metadata_format($format_id)) {
      $format_element = $this->xml
        ->createElement('metadataFormat');
      $this->xml_verb
        ->appendChild($format_element);
      $elements = array(
        'metadataPrefix' => $metadata_prefix,
        'schema' => $format->schema,
        'metadataNamespace' => $format
          ->get_metadata_namespace(),
      );
      $this
        ->xml_append_children($format_element, $elements);
    }
  }
}