You are here

function views_plugin_display::pre_execute in Views (for Drupal 7) 6.2

Same name and namespace in other branches
  1. 6.3 plugins/views_plugin_display.inc \views_plugin_display::pre_execute()
  2. 7.3 plugins/views_plugin_display.inc \views_plugin_display::pre_execute()

Set up any variables on the view prior to execution. These are separated from execute because they are extremely common and unlikely to be overridden on an individual display.

File

plugins/views_plugin_display.inc, line 1859
Contains the base display plugin.

Class

views_plugin_display
The default display plugin handler. Display plugins handle options and basic mechanisms for different output methods.

Code

function pre_execute() {
  $this->view
    ->set_use_ajax($this
    ->use_ajax());

  // Copy pager information from the display.
  $this->view
    ->set_use_pager($this
    ->use_pager());
  $this->view
    ->set_pager_element($this
    ->get_option('pager_element'));
  $this->view
    ->set_items_per_page($this
    ->get_option('items_per_page'));
  $this->view
    ->set_offset($this
    ->get_option('offset'));
  if ($this
    ->use_more() && !$this
    ->use_more_always()) {
    $this->view->get_total_rows = TRUE;
  }
}