add description of function

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@10764 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
chschy 2012-06-05 05:33:14 +00:00
parent 5a510567d1
commit ebfe89ca32
10 changed files with 243 additions and 120 deletions

View file

@ -2,7 +2,7 @@
/**
* @class PageHandler
* @author NHN (developers@xpressengine.com)
* @brief handles page navigation
* handles page navigation
* @version 0.1
*
* @remarks Getting total counts, number of pages, current page number, number of items per page,
@ -20,11 +20,12 @@
var $point = 0; ///< increments per getNextPage()
/**
* @brief constructor
* @param[in] $total_count number of total items
* @param[in] $total_page number of total pages
* @param[in] $cur_page current page number
* @param[in] $page_count number of page links displayed at one time
* constructor
* @param int $total_count number of total items
* @param int $total_page number of total pages
* @param int $cur_page current page number
* @param int $page_count number of page links displayed at one time
* @return void
**/
function PageHandler($total_count, $total_page, $cur_page, $page_count = 10) {
$this->total_count = $total_count;
@ -45,8 +46,8 @@
}
/**
* @brief request next page
* @return next page number
* request next page
* @return int next page number
**/
function getNextPage() {
$page = $this->first_page+$this->point++;
@ -54,6 +55,11 @@
return $page;
}
/**
* return number of page that added offset.
* @param int $offset
* @return int
**/
function getPage($offset)
{
return max(min($this->cur_page + $offset, $this->total_page), '');