Commit 2f820dd2 authored by webchick's avatar webchick
Browse files

Issue #2002898 by Joe9, Psikik, kevin.reiss, rootwork | heddn: Rename Views...

Issue #2002898 by Joe9, Psikik, kevin.reiss, rootwork | heddn: Rename Views method get_current_page() to getCurrentPage().
parent 8a86fa02
......@@ -50,7 +50,7 @@ public function get_value($values, $field = NULL) {
$pager = $this->view->pager;
// Get the base count of the pager.
if ($pager->usePager()) {
$count += ($pager->get_items_per_page() * $pager->get_current_page() + $pager->set_offset());
$count += ($pager->get_items_per_page() * $pager->getCurrentPage() + $pager->set_offset());
}
// Add the counter for the current site.
$count += $this->view->row_index + 1;
......
......@@ -57,7 +57,7 @@ public function query() {
// Don't query for the next page if we have a pager that has a limited
// amount of pages.
if (empty($this->options['total_pages']) || ($this->get_current_page() < $this->options['total_pages'])) {
if (empty($this->options['total_pages']) || ($this->getCurrentPage() < $this->options['total_pages'])) {
// Increase the items in the query in order to be able to find out whether
// there is another page.
$limit = $this->view->query->getLimit();
......
......@@ -103,7 +103,7 @@ function set_offset($offset) {
*
* If NULL, we do not know what the current page is.
*/
function get_current_page() {
public function getCurrentPage() {
return $this->current_page;
}
......
......@@ -284,7 +284,7 @@ function testPagerApi() {
$this->assertEqual($view->getCurrentPage(), NULL, 'If the pager is not initialized and no manual override there is no current page.');
$rand_number = rand(1, 5);
$view->setCurrentPage($rand_number);
$this->assertEqual($view->getCurrentPage(), $rand_number, 'Make sure get_current_page uses the settings of set_current_page.');
$this->assertEqual($view->getCurrentPage(), $rand_number, 'Make sure getCurrentPage uses the settings of set_current_page.');
$view->destroy();
......@@ -312,7 +312,7 @@ function testPagerApi() {
$view->setCurrentPage($rand_number);
$rand_number = rand(6, 11);
$view->pager->set_current_page($rand_number);
$this->assertEqual($view->getCurrentPage(), $rand_number, 'Make sure get_current_page uses the settings of set_current_page.');
$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.
$view->setCurrentPage(-1);
......
......@@ -460,7 +460,7 @@ public function setCurrentPage($page) {
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();
return $this->pager->getCurrentPage();
}
if (isset($this->current_page)) {
......
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