mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
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:
parent
5a510567d1
commit
ebfe89ca32
10 changed files with 243 additions and 120 deletions
|
|
@ -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), '');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue