function views_plugin_style_rss::render

3.x views_plugin_style_rss.inc views_plugin_style_rss::render()
2.x views_plugin_style_rss.inc views_plugin_style_rss::render()

Render the display in this style.

Overrides views_plugin_style::render

File

plugins/views_plugin_style_rss.inc, line 89
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)) {
    vpr('views_plugin_style_default: Missing row plugin');
    return;
  }
  $rows = '';

  // This will be filled in by the row plugin and is used later on in the
  // theming output.
  $this->namespaces = array('xmlns:dc' => 'http://purl.org/dc/elements/1.1/');

  // Fetch any additional elements for the channel and merge in their
  // namespaces.
  $this->channel_elements = $this->get_channel_elements();
  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;
}