Commit cf23ee6e authored by alexpott's avatar alexpott

Issue #2003292 by ricky.middaugh, elvis2, jibran: Rename Views method...

Issue #2003292 by ricky.middaugh, elvis2, jibran: Rename Views method set_current_page() to setCurrentPage().
parent 99c2b590
......@@ -114,7 +114,7 @@ public function getCurrentPage() {
* If provided, the page number will be set to this. If NOT provided,
* the page number will be set from the global page array.
*/
function set_current_page($number = NULL) {
public function setCurrentPage($number = NULL) {
if (!is_numeric($number) || $number < 0) {
$number = 0;
}
......
......@@ -249,7 +249,7 @@ public function query() {
* If provided, the page number will be set to this. If NOT provided,
* the page number will be set from the global page array.
*/
function set_current_page($number = NULL) {
public function setCurrentPage($number = NULL) {
if (isset($number)) {
$this->current_page = max(0, $number);
return;
......@@ -314,7 +314,7 @@ public function updatePageInfo() {
// See if the requested page was within range:
if ($this->current_page >= $pager_total[$this->options['id']]) {
// Pages are numbered from 0 so if there are 10 pages, the last page is 9.
$this->set_current_page($pager_total[$this->options['id']] - 1);
$this->setCurrentPage($pager_total[$this->options['id']] - 1);
}
// Put this number in to guarantee that we do not generate notices when the pager
......
......@@ -311,7 +311,7 @@ function testPagerApi() {
$rand_number = rand(1, 5);
$view->setCurrentPage($rand_number);
$rand_number = rand(6, 11);
$view->pager->set_current_page($rand_number);
$view->pager->setCurrentPage($rand_number);
$this->assertEqual($view->getCurrentPage(), $rand_number, 'Make sure getCurrentPage uses the settings of set_current_page.');
// Set an invalid page and make sure the method takes care about it.
......
......@@ -450,7 +450,7 @@ public function setCurrentPage($page) {
// If the pager is already initialized, pass it through to the pager.
if (!empty($this->pager)) {
return $this->pager->set_current_page($page);
return $this->pager->setCurrentPage($page);
}
}
......@@ -730,7 +730,7 @@ public function initPager() {
$this->pager = $this->display_handler->getPlugin('pager');
if ($this->pager->usePager()) {
$this->pager->set_current_page($this->current_page);
$this->pager->setCurrentPage($this->current_page);
}
// These overrides may have been set earlier via $view->set_*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment