Fix #390 Incorrect number of pages being displayed

This commit is contained in:
Flavio Copes
2016-01-28 14:03:53 +01:00
parent 13c60ed833
commit c62fb6bdb5
3 changed files with 14 additions and 3 deletions

View File

@@ -75,6 +75,11 @@ class Admin
*/
protected $gpm;
/**
* @var int
*/
protected $pages_count;
/**
* Constructor.
*
@@ -404,9 +409,13 @@ class Admin
*
* @return array
*/
public function countPages()
public function pagesCount()
{
return count($this->grav['pages']->all());
if (!$this->pages_count) {
$this->pages_count = count($this->grav['pages']->all());
}
return $this->pages_count;
}
/**