You are here

function views_php_handler_field::php_pre_execute in Views PHP 6

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

See also

views_php_views_pre_execute()

self::php_post_execute()

File

plugins/views/views_php_handler_field.inc, line 112

Class

views_php_handler_field
A handler to provide a field that is constructed by the administrator using PHP.

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();
  }

  // Prepare for sorting if needed.
  if (!empty($this->options['use_php_click_sortable']) && !empty($this->php_click_sort_order)) {
    $this->view->use_php_pager = TRUE;
  }
}