You are here

function views_php_handler_sort::php_post_execute in Views PHP 6

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

See also

views_php_views_post_execute()

File

plugins/views/views_php_handler_sort.inc, line 98

Class

views_php_handler_sort
A handler to sort a view using PHP defined by the administrator.

Code

function php_post_execute() {

  // Don't do anything if displaying a summary.
  if (!empty($this->view->build_info['summary'])) {
    return;
  }
  if (!empty($this->options['php_sort']) && $this->view->style_plugin
    ->build_sort()) {
    $this->php_sort_function = create_function('$view, $handler, &$static, $row1, $row2', $this->options['php_sort'] . ';');
    ob_start();
    usort($this->view->result, array(
      $this,
      'php_sort',
    ));
    ob_end_clean();
  }
}