Pager
[ class tree: Pager ] [ index: Pager ] [ all elements ]

Class: Pager_Jumping

Source Location: /main/inc/lib/pear/Pager/Jumping.php

Class Overview

Pager_Common
   |
   --Pager_Jumping

Pager_Jumping - Generic data paging class ("jumping window" style) Handles paging a set of data. For usage see the example.php provided.


Author(s):

Copyright:

  • 2003-2005 Lorenzo Alberton, Richard Heyes

Methods


Inherited Variables

Class: Pager_Common

Pager_Common::$links
Pager_Common::$linkTags
Pager_Common::$range
Pager_Common::$_accesskey
Pager_Common::$_allowed_options
Pager_Common::$_altFirst
Pager_Common::$_altLast
Pager_Common::$_altNext
Pager_Common::$_altPage
Pager_Common::$_altPrev
Pager_Common::$_append
Pager_Common::$_attributes
Pager_Common::$_classString
Pager_Common::$_clearIfVoid
Pager_Common::$_closeSession
Pager_Common::$_curPageLinkClassName
Pager_Common::$_curPageSpanPost
Pager_Common::$_curPageSpanPre
Pager_Common::$_currentPage
Pager_Common::$_delta
Pager_Common::$_excludeVars
Pager_Common::$_expanded
Pager_Common::$_extraVars
Pager_Common::$_fileName
Pager_Common::$_firstLinkTitle
Pager_Common::$_firstPagePost
Pager_Common::$_firstPagePre
Pager_Common::$_firstPageText
Pager_Common::$_fixFileName
Pager_Common::$_formID
Pager_Common::$_httpMethod
Pager_Common::$_importQuery
Pager_Common::$_itemData
Pager_Common::$_lastLinkTitle
Pager_Common::$_lastPagePost
Pager_Common::$_lastPagePre
Pager_Common::$_lastPageText
Pager_Common::$_linkClass
Pager_Common::$_linkData
Pager_Common::$_nextImg
Pager_Common::$_nextLinkTitle
Pager_Common::$_path
Pager_Common::$_pearErrorMode
Pager_Common::$_perPage
Pager_Common::$_prevImg
Pager_Common::$_prevLinkTitle
Pager_Common::$_separator
Pager_Common::$_sessionVar
Pager_Common::$_showAllText
Pager_Common::$_spacesAfter
Pager_Common::$_spacesAfterSeparator
Pager_Common::$_spacesBefore
Pager_Common::$_spacesBeforeSeparator
Pager_Common::$_totalItems
Pager_Common::$_totalPages
Pager_Common::$_urlVar
Pager_Common::$_useSessions

Inherited Methods

Class: Pager_Common

Pager_Common::build()
Generate or refresh the links and paged data after a call to setOptions()
Pager_Common::errorMessage()
Return a textual error message for a PAGER error code
Pager_Common::getCurrentPageID()
Returns ID of current page
Pager_Common::getLinks()
Returns back/next/first/last and page links, both as ordered and associative array.
Pager_Common::getNextPageID()
Returns next page ID. If current page is last page this function returns FALSE
Pager_Common::getOffsetByPageId()
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).
Pager_Common::getOption()
Return the current value of a given option
Pager_Common::getOptions()
Return an array with all the current pager options
Pager_Common::getPageData()
Returns an array of current pages data
Pager_Common::getPageIdByOffset()
Returns pageID for given offset
Pager_Common::getPageRangeByPageId()
Pager_Common::getPageSelectBox()
Returns a string with a XHTML SELECT menu with the page numbers, useful as an alternative to the links
Pager_Common::getPerPageSelectBox()
Returns a string with a XHTML SELECT menu,
Pager_Common::getPreviousPageID()
Returns previous page ID. If current page is first page this function returns FALSE
Pager_Common::isFirstPage()
Returns whether current page is first page
Pager_Common::isLastPage()
Returns whether current page is last page
Pager_Common::isLastPageComplete()
Returns whether last page is complete
Pager_Common::numItems()
Returns number of items
Pager_Common::numPages()
Returns number of pages
Pager_Common::raiseError()
conditionally includes PEAR base class and raise an error
Pager_Common::setOptions()
Set and sanitize options
Pager_Common::_generateFormOnClick()
Mimics http_build_query() behavior in the way the data in $data will appear when it makes it back to the server.
Pager_Common::_generateFormOnClickHelper()
This is used by _generateFormOnClick().
Pager_Common::_generatePageData()
Calculates all page data
Pager_Common::_getBackLink()
Returns back link
Pager_Common::_getFirstLinkTag()
Pager_Common::_getLastLinkTag()
Pager_Common::_getLinksData()
Returns the correct link for the back/pages/next links
Pager_Common::_getLinkTagUrl()
Helper method
Pager_Common::_getNextLink()
Returns next link
Pager_Common::_getNextLinkTag()
Returns next link tag
Pager_Common::_getPageLinks()
Returns pages link
Pager_Common::_getPrevLinkTag()
Returns previous link tag
Pager_Common::_http_build_query_wrapper()
This is a slightly modified version of the http_build_query() function; it heavily borrows code from PHP_Compat's http_build_query().
Pager_Common::_isEncoded()
Helper function
Pager_Common::_printFirstPage()
Print [1]
Pager_Common::_printLastPage()
Print [numPages()]
Pager_Common::_recursive_stripslashes()
Helper method
Pager_Common::_recursive_urldecode()
Helper method
Pager_Common::_renderLink()
Renders a link using the appropriate method
Pager_Common::_setFirstLastText()
sets the private _firstPageText, _lastPageText variables based on whether they were set in the options
Pager_Common::__http_build_query()
Helper function

Class Details

[line 57]
Pager_Jumping - Generic data paging class ("jumping window" style) Handles paging a set of data. For usage see the example.php provided.



Tags:

author:  Lorenzo Alberton <dot alberton at quipo dot it l dot alberton at quipo dot it>
author:  Richard Heyes <richard@phpguru.org>,
copyright:  2003-2005 Lorenzo Alberton, Richard Heyes
link:  http://pear.php.net/package/Pager
license:  PHP License 3.0


[ Top ]


Class Methods


constructor Pager_Jumping [line 68]

Pager_Jumping Pager_Jumping( [array $options = array()])

Constructor



Tags:

access:  public


Parameters:

array   $options   An associative array of option names and their values

[ Top ]

method build [line 85]

void build( )

Generate or refresh the links and paged data after a call to setOptions()



Tags:

access:  public


Overrides Pager_Common::build() (Generate or refresh the links and paged data after a call to setOptions())

[ Top ]

method getLinks [line 180]

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 constructor. If a second parameter is provided, then the method act as it previously did. This hack's only purpose is to mantain backward compatibility.




Tags:

return:  Back/pages/next links


Overrides Pager_Common::getLinks() (Returns back/next/first/last and page links, both as ordered and associative array.)

Parameters:

integer   $pageID   Optional pageID. If specified, links for that page are provided instead of current one. [ADDED IN NEW PAGER VERSION]
string   $next_html   HTML to put inside the next link [deprecated: use the constructor instead]

[ Top ]

method getPageIdByOffset [line 113]

int getPageIdByOffset( $index $index)

Returns pageID for given offset



Tags:

return:  PageID for given offset


Overrides Pager_Common::getPageIdByOffset() (Returns pageID for given offset)

Parameters:

$index   $index   Offset to get pageID for

[ Top ]

method getPageRangeByPageId [line 143]

array getPageRangeByPageId( [integer $pageid = null])

Given a PageId, it returns the limits of the range of pages displayed.

While getOffsetByPageId() returns the offset of the data within the current page, this method returns the offsets of the page numbers interval. E.g., if you have pageId=3 and delta=10, it will return (1, 10). PageID of 8 would give you (1, 10) as well, because 1 <= 8 <= 10. PageID of 11 would give you (11, 20). If the method is called without parameter, pageID is set to currentPage#.




Tags:

return:  First and last offsets
access:  public


Overrides Pager_Common::getPageRangeByPageId() (parent method not documented)

Parameters:

integer   $pageid   PageID to get offsets for

[ Top ]

method _getPageLinks [line 247]

string _getPageLinks( [$url $url = ''])

Returns pages link



Tags:

return:  Links
access:  private


Overrides Pager_Common::_getPageLinks() (Returns pages link)

Parameters:

$url   $url   URL to use in the link [deprecated: use the constructor instead]

[ Top ]


Documentation generated on Thu, 12 Jun 2008 13:53:49 -0500 by phpDocumentor 1.4.1