function views_plugin_style::render

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

Render the display in this style.

4 methods override views_plugin_style::render()
views_plugin_style_jump_menu::render in plugins/views_plugin_style_jump_menu.inc
Render the display in this style.
views_plugin_style_rss::render in plugins/views_plugin_style_rss.inc
Render the display in this style.
views_plugin_style_summary::render in plugins/views_plugin_style_summary.inc
Render the display in this style.
views_plugin_style_summary_jump_menu::render in plugins/views_plugin_style_summary_jump_menu.inc
Render the display in this style.

File

plugins/views_plugin_style.inc, line 134

Class

views_plugin_style
Base class to define a style plugin handler.

Code

function render() {
  if ($this->uses_row_plugin() && empty($this->row_plugin)) {
    vpr('views_plugin_style_default: Missing row plugin');
    return;
  }

  // Group the rows according to the grouping field, if specified.
  $sets = $this->render_grouping($this->view->result, $this->options['grouping']);

  // Render each group separately and concatenate.  Plugins may override this
  // method if they wish some other way of handling grouping.
  $output = '';
  foreach ($sets as $title => $records) {
    if ($this->uses_row_plugin()) {
      $rows = array();
      foreach ($records as $row_index => $row) {
        $this->view->row_index = $row_index;
        $rows[] = $this->row_plugin->render($row);
      }
    }
    else {
      $rows = $records;
    }

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