1 views_plugin_style_rss.inc views_plugin_style_rss::render()

Render the display in this style.

Overrides views_plugin_style::render

File

core/modules/views/plugins/views_plugin_style_rss.inc, line 128
Contains the RSS style plugin.

Class

views_plugin_style_rss
Default style plugin to render an RSS feed.

Code

function render() {
  if (empty($this->row_plugin)) {
    watchdog('views', 'views_plugin_style_default: Missing row plugin');
    return;
  }
  $rows = '';

  // This will be filled in by the row plugin, and will be used later on in
  // the theme process.
  $this->namespaces = array(
    'xmlns:dc' => 'http://purl.org/dc/elements/1.1/',
    'xmlns:atom' => 'http://www.w3.org/2005/Atom',
  );

  // Fetch any additional elements for the channel and merge in their
  // namespaces.
  $this->channel_elements = array_merge(
  $this->get_channel_elements(), 
  $this->get_channel_elements_atom_link()
  );
  foreach ($this->channel_elements as $element) {
    if (isset($element['namespace'])) {
      $this->namespaces = array_merge($this->namespaces, $element['namespace']);
    }
  }

  foreach ($this->view->result as $row_index => $row) {
    $this->view->row_index = $row_index;
    $rows .= $this->row_plugin->render($row);
  }

  $output = theme($this->theme_functions(), 
  array(
    'view' => $this->view,
    'options' => $this->options,
    'rows' => $rows
  ));
  unset($this->view->row_index);
  return $output;
}