You are here

function _draggableviews_re_execute_view in DraggableViews 7

Same name and namespace in other branches
  1. 6.3 draggableviews.inc \_draggableviews_re_execute_view()

Re-execute View

Parameters

$view: The view object.

$info: The structured info array. Look at _draggableviews_info(..) to learn more.

$items_per_page:

$current_page:

$offset:

1 call to _draggableviews_re_execute_view()
_draggableviews_reload_info in ./draggableviews.inc
Reload Info Array

File

./draggableviews.inc, line 1001
Draggableviews processing functions. Rough summary of what functions in this file do:

Code

function _draggableviews_re_execute_view(&$view, $info, $items_per_page = NULL, $current_page = NULL, $offset = NULL) {
  if ($info['needs_pager_modifications']) {
    if (isset($items_per_page)) {
      $view->query->pager->options['items_per_page'] = $items_per_page;
    }
    if (isset($current_page)) {
      $view->query->pager->current_page = $current_page;

      // Views pager uses global variables where all already known information is dumped in.
      // We need to change the global variable $pager_page_array in order to set the page to 0 because
      // this variable would force the current page to another value. (see views/includes/view.inc:#717, function execute())
      global $pager_page_array;
      $pager_page_array[$view->query->pager->options['id']] = $current_page;
    }
    if (isset($offset)) {
      $view->query->pager->options['offset'] = $offset;
    }
  }
  $view->executed = FALSE;
  $view
    ->execute();
}