You are here

function views_php_handler_filter::php_pre_execute in Views PHP 6

Same name and namespace in other branches
  1. 7.2 plugins/views/views_php_handler_filter.inc \views_php_handler_filter::php_pre_execute()
  2. 7 plugins/views/views_php_handler_filter.inc \views_php_handler_filter::php_pre_execute()

See also

views_php_views_pre_execute()

File

plugins/views/views_php_handler_filter.inc, line 82

Class

views_php_handler_filter
A handler to filter a view using PHP defined by the administrator.

Code

function php_pre_execute() {

  // Don't do anything if displaying a summary.
  if (!empty($this->view->build_info['summary'])) {
    return;
  }

  // Ecexute static PHP code.
  if (!empty($this->options['php_setup'])) {
    $function = create_function('$view, $handler, &$static', $this->options['php_setup'] . ';');
    ob_start();
    $function($this->view, $this, $this->php_static_variable);
    ob_end_clean();
  }
  if (!empty($this->options['php_filter'])) {
    $this->view->use_php_pager = TRUE;
  }
}