contenido\classes\widgets\class.widgets.pager.php

Show: PublicProtectedPrivateinherited
Table of Contents
Project: Contenido Content Management System

Description: Foldable pager for menus

Requirements:

Author
Timo Hummel  
Con_php_req
5.0  
Copyright
four for business AG  
License
http://www.contenido.org/license/LIZENZ.txt  
Link
http://www.4fb.de  
Link
{@internal created 2005-05-11 $Id: class.widgets.pager.php,v 1.2 2005/05/11 13:28:17 timo.hummel Exp $ }}  
Package
Contenido Backend classes  
Version
1.2  

\cObjectPager

Package: Default
Base class for all Contenido HTML classes
Parent(s)
\cFoldingRow < \cHTML < \HTML_Common
Author
Timo A. Hummel  

Properties

>VPropertypublic$_aEventDefinitions
inherited
Defines which JS events contain which scripts
Inherited from: \cHTML::$$_aEventDefinitions\cFoldingRow::$$_aEventDefinitions
Details
Type
n/a
Inherited_from
\cHTML::$$_aEventDefinitions  
Inherited_from
\cFoldingRow::$$_aEventDefinitions  
>VPropertypublic$_aStyleDefinitions
inherited
Style definitions
Inherited from: \cHTML::$$_aStyleDefinitions\cFoldingRow::$$_aStyleDefinitions
Details
Type
n/a
Inherited_from
\cHTML::$$_aStyleDefinitions  
Inherited_from
\cFoldingRow::$$_aStyleDefinitions  
>VPropertypublic$_content
inherited
The content itself
Inherited from: \cHTML::$$_content\cFoldingRow::$$_content
Details
Type
n/a
Inherited_from
\cHTML::$$_content  
Inherited_from
\cFoldingRow::$$_content  
>VPropertypublicarray $_contentData
inherited
Table content data
Inherited from: \cFoldingRow::$$_contentData
Details
Type
array
Access
private  
Inherited_from
\cFoldingRow::$$_contentData  
>VPropertypublicarray $_contentRow
inherited
Table row with the content
Inherited from: \cFoldingRow::$$_contentRow
Details
Type
array
Access
private  
Inherited_from
\cFoldingRow::$$_contentRow  
>VPropertypublicboolean $_contentlessTag
inherited
Defines if the current tag is a contentless tag
Inherited from: \cHTML::$$_contentlessTag\cFoldingRow::$$_contentlessTag
Details
Type
boolean
Access
private  
Inherited_from
\cHTML::$$_contentlessTag  
Inherited_from
\cFoldingRow::$$_contentlessTag  
>VPropertypublicarray $_headerData
inherited
Table header data
Inherited from: \cFoldingRow::$$_headerData
Details
Type
array
Access
private  
Inherited_from
\cFoldingRow::$$_headerData  
>VPropertypublicarray $_headerRow
inherited
Table row with the header
Inherited from: \cFoldingRow::$$_headerRow
Details
Type
array
Access
private  
Inherited_from
\cFoldingRow::$$_headerRow  
>VPropertypublicstring $_linkId
inherited
ID for link that triggers expandCollapse
Inherited from: \cFoldingRow::$$_linkId
Details
Type
string
Access
private  
Inherited_from
\cFoldingRow::$$_linkId  
>VPropertypublic$_pagerLink
Details
Type
n/a
>VPropertypublic$_parameterToAdd
Details
Type
n/a
>VPropertypublicarray $_requiredScripts
inherited
Defines all scripts which are required by the current element
Inherited from: \cHTML::$$_requiredScripts\cFoldingRow::$$_requiredScripts
Details
Type
array
Access
private  
Inherited_from
\cHTML::$$_requiredScripts  
Inherited_from
\cFoldingRow::$$_requiredScripts  
>VPropertypublicstring $_skeleton_close
inherited
Storage of the close SGML tag
Inherited from: \cHTML::$$_skeleton_close\cFoldingRow::$$_skeleton_close
Details
Type
string
Access
private  
Inherited_from
\cHTML::$$_skeleton_close  
Inherited_from
\cFoldingRow::$$_skeleton_close  
>VPropertypublicstring $_skeleton_open
inherited
Storage of the open SGML tag template
Inherited from: \cHTML::$$_skeleton_open\cFoldingRow::$$_skeleton_open
Details
Type
string
Access
private  
Inherited_from
\cHTML::$$_skeleton_open  
Inherited_from
\cFoldingRow::$$_skeleton_open  
>VPropertypublicstring $_skeleton_single
inherited
Storage of a single SGML tag template
Inherited from: \cHTML::$$_skeleton_single\cFoldingRow::$$_skeleton_single
Details
Type
string
Access
private  
Inherited_from
\cHTML::$$_skeleton_single  
Inherited_from
\cFoldingRow::$$_skeleton_single  
>VPropertypublicstring $_styledefs
inherited
Defines the style definitions
Inherited from: \cHTML::$$_styledefs\cFoldingRow::$$_styledefs
Details
Type
string
Access
private  
Inherited_from
\cHTML::$$_styledefs  
Inherited_from
\cFoldingRow::$$_styledefs  
>VPropertypublicstring $_tag
inherited
Defines which tag to use
Inherited from: \cHTML::$$_tag\cFoldingRow::$$_tag
Details
Type
string
Access
private  
Inherited_from
\cHTML::$$_tag  
Inherited_from
\cFoldingRow::$$_tag  

Methods

methodpublic__toString() : string
inherited

Direct call of object as string will return it's generated markup.

Inherited from: \cHTML::__toString()\cFoldingRow::__toString()
Returns
TypeDescription
stringGenerated markup
methodpublic_setContent( $content) : void
inherited

_setContent: Sets the content of the object

Inherited from: \cHTML::_setContent()\cFoldingRow::_setContent()
Parameters
NameTypeDescription
$content

string/object String with the content or an object to render.

methodpublicaddRequiredScript( $script) : void
Parameters
NameTypeDescription
$script
methodpublicadvanceID() : void
inherited

advances to the next ID available in the system.

Inherited from: \cHTML::advanceID()\cFoldingRow::advanceID()

This function is useful if you need to use HTML elements in a loop, but don't want to re-create new objects each time.

methodpublicattachEventDefinition( $sName,  $sEvent,  $sCode) : void
inherited

attachEventDefinition: Attaches the code for an event

Inherited from: \cHTML::attachEventDefinition()\cFoldingRow::attachEventDefinition()

Example to attach an onClick handler: setEventDefinition("foo", "onClick", "alert('foo');");

Parameters
NameTypeDescription
$sName

string defines the name of the event

$sEvent

string defines the event (e.g. onClick)

$sCode

string defines the code

methodpublicattachStyleDefinition( $sName,  $sDefinition) : string
inherited

attachStyleDefinition: Attaches a style definition.

Inherited from: \cHTML::attachStyleDefinition()\cFoldingRow::attachStyleDefinition()

This function is not restricted to a single style, e.g. you can set multiple style definitions as-is to the handler.

$example->attachStyle("myIdentifier", "border: 1px solid black; white-space: nowrap"); $example->attachStyle("myIdentifier2", "padding: 0px");

Results in:

style="border: 1px solid black; white-space: nowrap; padding: 0px;"

Parameters
NameTypeDescription
$sName

string Name for a style definition

$sDefinition

string Definition for the given entity

Returns
TypeDescription
stringfilled SGML closing skeleton
methodpubliccFoldingRow( $uuid,  $caption = "",  $link_id = "",  $bExpanded = null) : void
inherited

Inherited from: \cFoldingRow::cFoldingRow()
Parameters
NameTypeDescription
$uuid
$caption
$link_id
$bExpanded
methodpubliccHTML() : void
inherited

Constructor Function Initializes the SGML open/close tags

Inherited from: \cHTML::cHTML()\cFoldingRow::cHTML()
methodpubliccObjectPager( $uuid,  $items,  $itemsperpage,  $currentpage,  $link,  $parameterToAdd,  $id = '') : void

Parameters
NameTypeDescription
$uuid
$items
$itemsperpage
$currentpage
$link
$parameterToAdd
$id
methodpublicfillCloseSkeleton() : string
inherited

fillCloseSkeleton: Fills the close skeleton

Inherited from: \cHTML::fillCloseSkeleton()\cFoldingRow::fillCloseSkeleton()
Returns
TypeDescription
stringfilled SGML closer skeleton
methodpublicfillSkeleton( $attributes) : string
inherited

fillSkeleton: Fills the open SGML tag skeleton

Inherited from: \cHTML::fillSkeleton()\cFoldingRow::fillSkeleton()

fillSkeleton fills the SGML opener tag with the specified attributes. Attributes need to be passed in the stringyfied variant.

Parameters
NameTypeDescription
$attributes

string Attributes to set

Returns
TypeDescription
stringfilled SGML opener skeleton
methodpublicgetID() : string
inherited

getID: returns the current ID

Inherited from: \cHTML::getID()\cFoldingRow::getID()
Returns
TypeDescription
stringcurrent ID
methodpublicrender( $bContentOnly = 0) : string

render(): Alias for toHtml

Parameters
NameTypeDescription
$bContentOnly
Returns
TypeDescription
stringRendered HTML
methodpublicsetAlt( $alt) : void
inherited

setAlt: sets the alt and title attributes

Inherited from: \cHTML::setAlt()\cFoldingRow::setAlt()

Sets the "alt" and "title" tags. Usually, "alt" is used for accessibility and "title" for mouse overs.

To set the text for all browsers for mouse over, set "alt" and "title". IE behaves incorrectly and shows "alt" on mouse over. Mozilla browsers only show "title" as mouse over.

Parameters
NameTypeDescription
$alt

string Text to set as the "alt" attribute

methodpublicsetAttribute( $sAttributeName,  $sValue) : void
inherited

setAttribte: Sets a specific attribute

Inherited from: \cHTML::setAttribute()\cFoldingRow::setAttribute()
Parameters
NameTypeDescription
$sAttributeName

string Name of the attribute

$sValue

string Value of the attribute

methodpublicsetCaption( $caption) : void
inherited

Inherited from: \cFoldingRow::setCaption()
Parameters
NameTypeDescription
$caption
methodpublicsetClass( $class) : void
inherited

sets the CSS class

Inherited from: \cHTML::setClass()\cFoldingRow::setClass()
Parameters
NameTypeDescription
$class

string Text to set as the "alt" attribute

methodpublicsetContentData( $content) : void
inherited

Inherited from: \cFoldingRow::setContentData()
Parameters
NameTypeDescription
$content
methodpublicsetContentlessTag( $contentlessTag = true) : void
Parameters
NameTypeDescription
$contentlessTag
methodpublicsetEvent( $event,  $action) : void
inherited

adds an "onXXX" javascript event handler

Inherited from: \cHTML::setEvent()\cFoldingRow::setEvent()

example: $item->setEvent("change","document.forms[0].submit");

Parameters
NameTypeDescription
$event

string Type of the event

$action

string Function or action to call (JavaScript Code)

methodpublicsetExpanded( $expanded = false) : void
inherited

Inherited from: \cFoldingRow::setExpanded()
Parameters
NameTypeDescription
$expanded
methodpublicsetGenerateXHTML(bool $value) : void
staticinherited

Setter for static $_generateXHTML property

Inherited from: \cHTML::setGenerateXHTML()\cFoldingRow::setGenerateXHTML()
Parameters
NameTypeDescription
$valuebool
methodpublicsetHelpContext( $context = false) : void
inherited

Inherited from: \cFoldingRow::setHelpContext()
Parameters
NameTypeDescription
$context
methodpublicsetID( $id) : void
inherited

sets the ID class

Inherited from: \cHTML::setID()\cFoldingRow::setID()
Parameters
NameTypeDescription
$id
methodpublicsetIndent( $indent = 0) : void
inherited

Inherited from: \cFoldingRow::setIndent()
Parameters
NameTypeDescription
$indent
methodpublicsetStyle( $style) : void
inherited

sets the CSS style

Inherited from: \cHTML::setStyle()\cFoldingRow::setStyle()
Parameters
NameTypeDescription
$style
methodpublicsetStyleDefinition( $entity,  $definition) : string
inherited

addStyleDefinition

Inherited from: \cHTML::setStyleDefinition()\cFoldingRow::setStyleDefinition()
Parameters
NameTypeDescription
$entity

string Entity to define

$definition

string Definition for the given entity

Returns
TypeDescription
stringfilled SGML closing skeleton
methodpublictoHTML() : void
inherited

Renders the output If the tag

Inherited from: \cHTML::toHTML()\cFoldingRow::toHTML()
methodpublicunsetEvent( $event) : void
inherited

removes an event handler

Inherited from: \cHTML::unsetEvent()\cFoldingRow::unsetEvent()

example: $item->unsetEvent("change");

Parameters
NameTypeDescription
$event

string Type of the event

\cPager

Package: Default
cPager Basic pager class without presentation logic
Author
Timo A. Hummel  

Properties

>VPropertypublicinteger $_currentPage
Current page
Details
Type
integer
Access
private  
>VPropertypublicinteger $_itemPadding
Item padding (before and after the current item)
Details
Type
integer
Access
private  
>VPropertypublicinteger $_items
Amount of items
Details
Type
integer
Access
private  
>VPropertypublicinteger $_itemsPerPage
Items per page
Details
Type
integer
Access
private  
>VPropertypublicinteger $_nextItems
Items on the right side
Details
Type
integer
Access
private  
>VPropertypublicinteger $_previousItems
Items on the left side
Details
Type
integer
Access
private  

Methods

methodpubliccPager( $items,  $itemsPerPage,  $currentPage) : void

Constructor Function Initializes the pager

Parameters
NameTypeDescription
$items

int Amount of items

$itemsPerPage

int Items displayed per page

$currentPage

int Defines the current page

methodpublicgetMaxPages() : int

Returns the amount of pages.

Returns
TypeDescription
intPage count
methodpublicgetPagesInRange() : array

Returns an array with the pager structure.

Array format: Key : Page Number Value: | for "...", "current" for the current item, page number otherwise

Returns
TypeDescription
arrayPager structure
methodpublicisFirstPage() : boolean

Returns if the currentPage pointer is the first page.

Returns
TypeDescription
booleanTrue if we're on the first page.
methodpublicisLastPage() : boolean

Returns if the currentPage pointer is the last page.

Returns
TypeDescription
booleanTrue if we're on the last page.
Documentation was generated by phpDocumentor 2.0.0a12.