You are here

function views_oai_pmh_plugin_style_dc::render_records in Views OAI-PMH 7

Same name and namespace in other branches
  1. 6.2 plugins/views_oai_pmh_plugin_style_dc.inc \views_oai_pmh_plugin_style_dc::render_records()
  2. 6 plugins/views_oai_pmh_plugin_style_dc.inc \views_oai_pmh_plugin_style_dc::render_records()
  3. 7.2 plugins/views_oai_pmh_plugin_style_dc.inc \views_oai_pmh_plugin_style_dc::render_records()

File

plugins/views_oai_pmh_plugin_style_dc.inc, line 8

Class

views_oai_pmh_plugin_style_dc
@file

Code

function render_records() {
  if (!empty($this->display->handler->oai_args['errors'])) {
    return;
  }

  // $records = array();
  if ($this
    ->uses_row_plugin() && empty($this->row_plugin)) {
    vpr('views_plugin_style_default: Missing row plugin');
    return;
  }
  $records = '';
  if ($this
    ->uses_row_plugin()) {
    $rows = array();
    foreach ($this->view->result as $row_index => $row) {
      $this->view->row_index = $row_index;
      $dc_fields = $this->row_plugin
        ->render($row);
      $records .= theme('views_oai_pmh_dc_record', array(
        'nid' => $row->nid,
        'node_changed' => $row->node_changed,
        'fields' => $dc_fields,
      ));
    }
  }
  return $records;
}