function views_plugin_style_rss::render

Same name in other branches
  1. 7.x-3.x plugins/views_plugin_style_rss.inc \views_plugin_style_rss::render()

Overrides views_plugin_style::render

File

plugins/views_plugin_style_rss.inc, line 95

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();
    // 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(), $this->view, $this->options, $rows);
    unset($this->view->row_index);
    return $output;
}