Documentation

CRM_Utils_Pager extends Pager_Sliding
in package

Class CRM_Utils_Pager

Table of Contents

Constants

PAGE_ID  = 'crmPID'
Constants for static parameters of the pager
PAGE_ID_BOTTOM  = 'crmPID_B'
Constants for static parameters of the pager
PAGE_ID_TOP  = 'crmPID'
Constants for static parameters of the pager
PAGE_ROWCOUNT  = 'crmRowCount'
Constants for static parameters of the pager
ROWCOUNT  = 50
Deprecated constants that might still be used by extensions but no longer by core

Properties

$_response  : array<string|int, mixed>
The output of the pager. This is a name/value array with various keys that an application could use to display the pager

Methods

__construct()  : CRM_Utils_Pager
The pager constructor. Takes a few values, and then assigns a lot of defaults to the PEAR pager class We have embedded some html in this class. Need to figure out how to export this to the top level at some point in time
getBackPageLink()  : string
getCurrentLocation()  : string
getFirstPageLink()  : string
getLastPageLink()  : string
getNextPageLink()  : string
getOffsetAndRowCount()  : array<string|int, mixed>
Use the pager class to get the pageId and Offset.
getPageID()  : int
Figure out the current page number based on value of GET / POST variables. Hierarchy rules are followed, POST over-rides a GET, a POST at the top overrides a POST at the bottom (of the page)
getPageRowCount()  : int
Get the number of rows to display from either a GET / POST variable
initialize()  : array<string|int, mixed>
Helper function to assign remaining pager options as good default values.
makeURL()  : string
Build a url for pager links.
formatLink()  : string
Output the html pager link.

Constants

PAGE_ID

Constants for static parameters of the pager

public mixed PAGE_ID = 'crmPID'

PAGE_ID_BOTTOM

Constants for static parameters of the pager

public mixed PAGE_ID_BOTTOM = 'crmPID_B'

PAGE_ID_TOP

Constants for static parameters of the pager

public mixed PAGE_ID_TOP = 'crmPID'

PAGE_ROWCOUNT

Constants for static parameters of the pager

public mixed PAGE_ROWCOUNT = 'crmRowCount'

ROWCOUNT

Deprecated constants that might still be used by extensions but no longer by core

public mixed ROWCOUNT = 50

Properties

$_response

The output of the pager. This is a name/value array with various keys that an application could use to display the pager

public array<string|int, mixed> $_response

Methods

__construct()

The pager constructor. Takes a few values, and then assigns a lot of defaults to the PEAR pager class We have embedded some html in this class. Need to figure out how to export this to the top level at some point in time

public __construct(array<string|int, mixed> $params) : CRM_Utils_Pager
Parameters
$params : array<string|int, mixed>
Return values
CRM_Utils_Pager

the newly created and initialized pager object

public getBackPageLink() : string
Return values
string

getCurrentLocation()

public getCurrentLocation() : string
Return values
string
public getFirstPageLink() : string
Return values
string
public getLastPageLink() : string
Return values
string
public getNextPageLink() : string
Return values
string

getOffsetAndRowCount()

Use the pager class to get the pageId and Offset.

public getOffsetAndRowCount() : array<string|int, mixed>
Return values
array<string|int, mixed>

an array of the pageID and offset

getPageID()

Figure out the current page number based on value of GET / POST variables. Hierarchy rules are followed, POST over-rides a GET, a POST at the top overrides a POST at the bottom (of the page)

public getPageID(int $defaultPageId, array<string|int, mixed> &$params) : int
Parameters
$defaultPageId : int

DefaultPageId current pageId.

$params : array<string|int, mixed>
Return values
int

new pageId to display to the user

getPageRowCount()

Get the number of rows to display from either a GET / POST variable

public getPageRowCount([int|null $defaultPageRowCount = NULL ]) : int
Parameters
$defaultPageRowCount : int|null = NULL

The default value if not set.

Return values
int

the rowCount value to use

initialize()

Helper function to assign remaining pager options as good default values.

public initialize(array<string|int, mixed> &$params) : array<string|int, mixed>
Parameters
$params : array<string|int, mixed>

The set of options needed to initialize the parent constructor.

Return values
array<string|int, mixed>

makeURL()

Build a url for pager links.

public makeURL(string $key, string $value) : string
Parameters
$key : string
$value : string
Return values
string

Output the html pager link.

private formatLink(string $href, string $title, string $image) : string
Parameters
$href : string
$title : string
$image : string
Return values
string

        
On this page

Search results