Class: Pager_Common
Source Location: /main/inc/lib/pear/Pager/Common.php
Pager_Common - Common base class for [Sliding|Jumping] Window Pager Extend this class to write a custom paging class
Author(s):
Copyright:
- 2003-2005 Lorenzo Alberton, Richard Heyes
|
|
|
Class Details
Class Variables
Class Methods
method build [line 484]
Generate or refresh the links and paged data after a call to setOptions()
Tags:
Overridden in child classes as:
- Pager_Sliding::build()
- Generate or refresh the links and paged data after a call to setOptions()
- Pager_Jumping::build()
- Generate or refresh the links and paged data after a call to setOptions()
method errorMessage [line 1486]
string errorMessage(
int
$code)
|
|
Return a textual error message for a PAGER error code
Tags:
Parameters:
method getCurrentPageID [line 608]
integer getCurrentPageID(
)
|
|
Returns ID of current page
Tags:
method getLinks [line 593]
array getLinks(
[integer
$pageID = null], [string
$next_html = ''])
|
|
Returns back/next/first/last and page links, both as ordered and associative array. NB: in original PEAR::Pager this method accepted two parameters, $back_html and $next_html. Now the only parameter accepted is an integer ($pageID), since the html text for prev/next links can be set in the factory. If a second parameter is provided, then the method act as it previously did. This hack was done to mantain backward compatibility only.
Tags:
Overridden in child classes as:
- Pager_Sliding::getLinks()
- Returns back/next/first/last and page links, both as ordered and associative array.
- Pager_Jumping::getLinks()
- Returns back/next/first/last and page links, both as ordered and associative array.
Parameters:
method getNextPageID [line 622]
Returns next page ID. If current page is last page this function returns FALSE
Tags:
method getOffsetByPageId [line 543]
array getOffsetByPageId(
[integer
$pageid = null])
|
|
Returns offsets for given pageID. Eg, if you pass it pageID one and your perPage limit is 10 it will return (1, 10). PageID of 2 would give you (11, 20).
Tags:
Parameters:
method getOption [line 1449]
mixed getOption(
string
$name)
|
|
Return the current value of a given option
Tags:
Parameters:
method getOptions [line 1467]
Return an array with all the current pager options
Tags:
method getPageData [line 501]
array getPageData(
[$pageID
$pageID = null])
|
|
Returns an array of current pages data
Tags:
Parameters:
method getPageIdByOffset [line 523]
method getPageRangeByPageId [line 567]
method getPageSelectBox [line 1171]
string getPageSelectBox(
[array
$params = array()], [string
$extraAttributes = ''])
|
|
Returns a string with a XHTML SELECT menu with the page numbers, useful as an alternative to the links
Tags:
Parameters:
method getPerPageSelectBox [line 1147]
string getPerPageSelectBox(
[integer
$start = 5], [integer
$end = 30], [integer
$step = 5], [boolean
$showAllData = false], [array
$extraParams = array()])
|
|
Returns a string with a XHTML SELECT menu, useful for letting the user choose how many items per page should be displayed. If parameter useSessions is TRUE, this value is stored in a session var. The string isn't echoed right now so you can use it with template engines.
Tags:
Parameters:
method getPreviousPageID [line 636]
mixed getPreviousPageID(
)
|
|
Returns previous page ID. If current page is first page this function returns FALSE
Tags:
method isFirstPage [line 675]
Returns whether current page is first page
Tags:
method isLastPage [line 688]
Returns whether current page is last page
Tags:
method isLastPageComplete [line 701]
bool isLastPageComplete(
)
|
|
Returns whether last page is complete
Tags:
method numItems [line 649]
Returns number of items
Tags:
method numPages [line 662]
Returns number of pages
Tags:
method raiseError [line 1342]
void raiseError(
string
$msg, int
$code)
|
|
conditionally includes PEAR base class and raise an error
Tags:
Parameters:
method setOptions [line 1362]
integer setOptions(
mixed
$options)
|
|
Set and sanitize options
Tags:
Parameters:
method _generateFormOnClick [line 801]
string _generateFormOnClick(
string
$formAction, array
$data)
|
|
Mimics http_build_query() behavior in the way the data in $data will appear when it makes it back to the server. For example: $arr = array('array' => array(array('hello', 'world'), 'things' => array('stuff', 'junk')); http_build_query($arr) and _generateFormOnClick('foo.php', $arr) will yield $_REQUEST['array'][0][0] === 'hello' $_REQUEST['array'][0][1] === 'world' $_REQUEST['array']['things'][0] === 'stuff' $_REQUEST['array']['things'][1] === 'junk' However, instead of generating a query string, it generates Javascript to create and submit a form.
Tags:
Parameters:
method _generateFormOnClickHelper [line 846]
string _generateFormOnClickHelper(
data
$data, [prev
$prev = ''])
|
|
This is used by _generateFormOnClick(). Recursively processes the arrays, objects, and literal values.
Tags:
Parameters:
method _generatePageData [line 713]
void _generatePageData(
)
|
|
Calculates all page data
Tags:
method _getBackLink [line 962]
string _getBackLink(
[$url
$url = ''], [$link
$link = ''])
|
|
Returns back link
Tags:
Parameters:
method _getFirstLinkTag [line 1036]
string _getFirstLinkTag(
)
|
|
Tags:
method _getLastLinkTag [line 1094]
string _getLastLinkTag(
)
|
|
Tags:
method _getLinksData [line 887]
Returns the correct link for the back/pages/next links
Tags:
method _getLinkTagUrl [line 1113]
string _getLinkTagUrl(
$pageID)
|
|
Helper method
Tags:
Parameters:
method _getNextLink [line 1009]
string _getNextLink(
[$url
$url = ''], [$link
$link = ''])
|
|
Returns next link
Tags:
Parameters:
method _getNextLinkTag [line 1076]
string _getNextLinkTag(
)
|
|
Returns next link tag
Tags:
method _getPageLinks [line 991]
method _getPrevLinkTag [line 1056]
string _getPrevLinkTag(
)
|
|
Returns previous link tag
Tags:
method _http_build_query_wrapper [line 1257]
string _http_build_query_wrapper(
array
$data)
|
|
This is a slightly modified version of the http_build_query() function; it heavily borrows code from PHP_Compat's http_build_query(). The main change is the usage of htmlentities instead of urlencode, since it's too aggressive
Tags:
Parameters:
method _isEncoded [line 1326]
boolean _isEncoded(
string
$string)
|
|
Helper function Check if a string is an encoded multibyte string
Tags:
Parameters:
method _printFirstPage [line 1188]
string _printFirstPage(
)
|
|
Print [1]
Tags:
method _printLastPage [line 1210]
method _recursive_stripslashes [line 920]
void _recursive_stripslashes(
&$var, mixed
$var)
|
|
Helper method
Tags:
Parameters:
method _recursive_urldecode [line 939]
void _recursive_urldecode(
&$var, mixed
$var)
|
|
Helper method
Tags:
Parameters:
method _renderLink [line 747]
string _renderLink(
altText
$altText, linkText
$linkText)
|
|
Renders a link using the appropriate method
Tags:
Parameters:
method _setFirstLastText [line 1231]
void _setFirstLastText(
)
|
|
sets the private _firstPageText, _lastPageText variables based on whether they were set in the options
Tags:
method __http_build_query [line 1293]
void __http_build_query(
$array,
$name)
|
|
Helper function
Tags:
Parameters:
|
|