code/pagetypes/BrowseCataloguePage.php
/**
     * Calculates the pagination for the results. We get back a record position so need
     * to convert this in to page numbers using the number of records defined per page.
     *
     * @param  Int  $totalRecords
     * @param  Int  $nextPosition
     * @return Array
     */
Calculates the pagination for the results. We get back a record position so need
to convert this in to page numbers using the number of records defined per page.

@param  Int  $totalRecords
@param  Int  $nextPosition
@return Array
Calculates the pagination for the results . We get back a record position so need to convert this in to page numbers using the number of records defined per page . @param Int $totalRecords @param Int $nextPosition @return Array
protected function calculatePagination($totalRecords, $nextPosition)
    {
        $totalPages = ceil($totalRecords / $this->RecordsPerPage);
        $isLastPage = ($this->PageNumber == $totalPages) ? true : false;
        $currentPage = $this->PageNumber;
        $nextPage = ceil($nextPosition / $this->RecordsPerPage);
        $prevPage = ($this->PageNumber - 1);
        $isFirstPage = $prevPage == 0 ? true : false;
        $pagination = array(
            'isFirstPage'  => $isFirstPage,
            'totalPages'   => $totalPages,
            'isLastPage'   => $isLastPage,
            'currentPage'  => $currentPage,
            'nextPage'     => $nextPage,
            'previousPage' => $prevPage
        );
        return $pagination;
    }
protected function calculatePagination ( $ totalRecords , $ nextPosition ) { $ totalPages = ceil ( $ totalRecords / $ this -> RecordsPerPage ) ; $ isLastPage = ( $ this -> PageNumber == $ totalPages ) ? true : false ; $ currentPage = $ this -> PageNumber ; $ nextPage = ceil ( $ nextPosition / $ this -> RecordsPerPage ) ; $ prevPage = ( $ this -> PageNumber - 1 ) ; $ isFirstPage = $ prevPage == 0 ? true : false ; $ pagination = array ( 'isFirstPage' => $ isFirstPage , 'totalPages' => $ totalPages , 'isLastPage' => $ isLastPage , 'currentPage' => $ currentPage , 'nextPage' => $ nextPage , 'previousPage' => $ prevPage ) ; return $ pagination ; }
Calculates the pagination for the results.
Calculates the pagination for the results .
// Work out some pagination information.