You are here

function template_preprocess_views_oai_pmh_response in Views OAI-PMH 7

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.2 theme/views_oai_pmh.theme.inc \template_preprocess_views_oai_pmh_response()

File

theme/views_oai_pmh.theme.inc, line 44
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 += !empty($vars['oai_args']['verb']) ? array(
    'attributes' => array(
      'verb' => $vars['oai_args']['verb'],
    ),
  ) : array();
  $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;
  if (isset($vars['oai_args']['errors'])) {
    $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'];
  }
}