You are here

function template_preprocess_views_oai_pmh_response in Views OAI-PMH 7.2

Same name and namespace in other branches
  1. 6.2 theme/views_oai_pmh.theme.inc \template_preprocess_views_oai_pmh_response()
  2. 6 theme/views_oai_pmh.theme.inc \template_preprocess_views_oai_pmh_response()
  3. 7 theme/views_oai_pmh.theme.inc \template_preprocess_views_oai_pmh_response()

File

theme/views_oai_pmh.theme.inc, line 157
Theme related functions for processing our output style plugins.

Code

function template_preprocess_views_oai_pmh_response(&$vars) {
  global $base_url;
  $vars['oai_response_date'] = format_xml_elements(array(
    'responseDate' => $vars['oai_args']['response_date'],
  ));
  $request = array(
    'key' => 'request',
    'value' => $base_url,
  );
  $request['attributes'] = array();
  if (!empty($vars['oai_args']['verb'])) {
    $request['attributes']['verb'] = $vars['oai_args']['verb'];
  }
  if (!empty($vars['oai_args']['metadataPrefix'])) {
    $request['attributes']['metadataPrefix'] = $vars['oai_args']['metadataPrefix'];
  }
  $vars['oai_request'] = format_xml_elements(array(
    $request,
  ));
  $vars['oai_verb'] = !empty($vars['oai_args']['verb']) ? $vars['oai_args']['verb'] : '';
  $vars['oai_base_url'] = $base_url;
  $vars['oai_errors'] = format_xml_elements($vars['oai_args']['errors']);
  $vars['oai_content'] = $vars['oai_content'];
  if (!empty($vars['oai_content'])) {
    $vars['oai_resumption_token'] = $vars['resumption_token'];
  }
}