Get the current page from the pager.
public function getCurrentPage() {
// If the pager is already initialized, pass it through to the pager.
if (!empty($this->pager)) {
return $this->pager
->get_current_page();
}
if (isset($this->current_page)) {
return $this->current_page;
}
}