Make HTML paging usable.

This commit is contained in:
Sébastien Lucas 2012-10-11 21:14:06 +02:00
parent e498e6325a
commit 3c4f4851a6
5 changed files with 36 additions and 6 deletions

View file

@ -247,7 +247,9 @@ class Page
public function isPaginated ()
{
global $config;
return ($config['cops_max_item_per_page'] != -1 && $this->totalNumber != -1);
return ($config['cops_max_item_per_page'] != -1 &&
$this->totalNumber != -1 &&
$this->totalNumber > $config['cops_max_item_per_page']);
}
public function getNextLink ()
@ -271,6 +273,12 @@ class Page
}
return NULL;
}
public function getMaxPage ()
{
global $config;
return ceil ($this->totalNumber / $config['cops_max_item_per_page']);
}
}