function views_plugin_pager_full::query

Overrides views_plugin_pager::query

File

plugins/views_plugin_pager_full.inc, line 255

Class

views_plugin_pager_full
The plugin to handle full pager.

Code

public function query() {
    if ($this->items_per_page_exposed()) {
        if (!empty($_GET['items_per_page']) && $_GET['items_per_page'] > 0) {
            $this->options['items_per_page'] = (int) $_GET['items_per_page'];
        }
        elseif (!empty($_GET['items_per_page']) && $_GET['items_per_page'] == 'All' && $this->options['expose']['items_per_page_options_all']) {
            $this->options['items_per_page'] = 0;
        }
    }
    if ($this->offset_exposed()) {
        if (isset($_GET['offset']) && $_GET['offset'] >= 0) {
            $this->options['offset'] = (int) $_GET['offset'];
        }
    }
    $limit = $this->get_items_per_page();
    $offset = $this->current_page * $limit + $this->get_offset();
    if (!empty($this->options['total_pages'])) {
        if ($this->current_page >= $this->options['total_pages']) {
            $offset = $this->options['total_pages'] * $limit;
        }
    }
    $this->view->query
        ->set_limit($limit);
    $this->view->query
        ->set_offset($offset);
}