You are here

public function views_plugin_style_rss::render in Views (for Drupal 7) 7.3

Same name and namespace in other branches
  1. 6.3 plugins/views_plugin_style_rss.inc \views_plugin_style_rss::render()
  2. 6.2 plugins/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 132
Definition of views_plugin_style_rss.

Class

views_plugin_style_rss
Default style plugin to render an RSS feed.

Code

public 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 = 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;
}