contenido\classes\widgets\class.widgets.pager.php
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
- Parent(s)
- \cFoldingRow < \cHTML < \HTML_Common
- Author
- Timo A. Hummel
Properties

$_aEventDefinitions- Type
- n/a
- Inherited_from
- \cHTML::$$_aEventDefinitions
- Inherited_from
- \cFoldingRow::$$_aEventDefinitions

$_aStyleDefinitions- Type
- n/a
- Inherited_from
- \cHTML::$$_aStyleDefinitions
- Inherited_from
- \cFoldingRow::$$_aStyleDefinitions

boolean $_contentlessTag- Type
- boolean
- Access
- private
- Inherited_from
- \cHTML::$$_contentlessTag
- Inherited_from
- \cFoldingRow::$$_contentlessTag

array $_requiredScripts- Type
- array
- Access
- private
- Inherited_from
- \cHTML::$$_requiredScripts
- Inherited_from
- \cFoldingRow::$$_requiredScripts

string $_skeleton_close- Type
- string
- Access
- private
- Inherited_from
- \cHTML::$$_skeleton_close
- Inherited_from
- \cFoldingRow::$$_skeleton_close

string $_skeleton_open- Type
- string
- Access
- private
- Inherited_from
- \cHTML::$$_skeleton_open
- Inherited_from
- \cFoldingRow::$$_skeleton_open

string $_skeleton_single- Type
- string
- Access
- private
- Inherited_from
- \cHTML::$$_skeleton_single
- Inherited_from
- \cFoldingRow::$$_skeleton_single

string $_styledefs- Type
- string
- Access
- private
- Inherited_from
- \cHTML::$$_styledefs
- Inherited_from
- \cFoldingRow::$$_styledefs

string $_tag- Type
- string
- Access
- private
- Inherited_from
- \cHTML::$$_tag
- Inherited_from
- \cFoldingRow::$$_tag
Methods

__toString() : stringDirect call of object as string will return it's generated markup.
Inherited from: \cHTML::__toString()\cFoldingRow::__toString()| Type | Description |
|---|---|
| string | Generated markup |

_setContent( $content) : void_setContent: Sets the content of the object
Inherited from: \cHTML::_setContent()\cFoldingRow::_setContent()| Name | Type | Description |
|---|---|---|
| $content | string/object String with the content or an object to render. |

advanceID() : voidadvances 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.

attachEventDefinition( $sName, $sEvent, $sCode) : voidattachEventDefinition: Attaches the code for an event
Inherited from: \cHTML::attachEventDefinition()\cFoldingRow::attachEventDefinition()Example to attach an onClick handler: setEventDefinition("foo", "onClick", "alert('foo');");
| Name | Type | Description |
|---|---|---|
| $sName | string defines the name of the event | |
| $sEvent | string defines the event (e.g. onClick) | |
| $sCode | string defines the code |

attachStyleDefinition( $sName, $sDefinition) : stringattachStyleDefinition: 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;"
| Name | Type | Description |
|---|---|---|
| $sName | string Name for a style definition | |
| $sDefinition | string Definition for the given entity |
| Type | Description |
|---|---|
| string | filled SGML closing skeleton |

cFoldingRow( $uuid, $caption = "", $link_id = "", $bExpanded = null) : void| Name | Type | Description |
|---|---|---|
| $uuid | ||
| $caption | ||
| $link_id | ||
| $bExpanded |

cHTML() : voidConstructor Function Initializes the SGML open/close tags
Inherited from: \cHTML::cHTML()\cFoldingRow::cHTML()
cObjectPager( $uuid, $items, $itemsperpage, $currentpage, $link, $parameterToAdd, $id = '') : void| Name | Type | Description |
|---|---|---|
| $uuid | ||
| $items | ||
| $itemsperpage | ||
| $currentpage | ||
| $link | ||
| $parameterToAdd | ||
| $id |

fillCloseSkeleton() : stringfillCloseSkeleton: Fills the close skeleton
Inherited from: \cHTML::fillCloseSkeleton()\cFoldingRow::fillCloseSkeleton()| Type | Description |
|---|---|
| string | filled SGML closer skeleton |

fillSkeleton( $attributes) : stringfillSkeleton: 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.
| Name | Type | Description |
|---|---|---|
| $attributes | string Attributes to set |
| Type | Description |
|---|---|
| string | filled SGML opener skeleton |

render( $bContentOnly = 0) : stringrender(): Alias for toHtml
| Name | Type | Description |
|---|---|---|
| $bContentOnly |
| Type | Description |
|---|---|
| string | Rendered HTML |

setAlt( $alt) : voidsetAlt: 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.
| Name | Type | Description |
|---|---|---|
| $alt | string Text to set as the "alt" attribute |

setAttribute( $sAttributeName, $sValue) : voidsetAttribte: Sets a specific attribute
Inherited from: \cHTML::setAttribute()\cFoldingRow::setAttribute()| Name | Type | Description |
|---|---|---|
| $sAttributeName | string Name of the attribute | |
| $sValue | string Value of the attribute |

setCaption( $caption) : void| Name | Type | Description |
|---|---|---|
| $caption |

setClass( $class) : void| Name | Type | Description |
|---|---|---|
| $class | string Text to set as the "alt" attribute |

setContentData( $content) : void| Name | Type | Description |
|---|---|---|
| $content |

setEvent( $event, $action) : voidadds an "onXXX" javascript event handler
Inherited from: \cHTML::setEvent()\cFoldingRow::setEvent()example: $item->setEvent("change","document.forms[0].submit");
| Name | Type | Description |
|---|---|---|
| $event | string Type of the event | |
| $action | string Function or action to call (JavaScript Code) |

setExpanded( $expanded = false) : void| Name | Type | Description |
|---|---|---|
| $expanded |

setGenerateXHTML(bool $value) : voidSetter for static $_generateXHTML property
Inherited from: \cHTML::setGenerateXHTML()\cFoldingRow::setGenerateXHTML()| Name | Type | Description |
|---|---|---|
| $value | bool |

setHelpContext( $context = false) : void| Name | Type | Description |
|---|---|---|
| $context |

setIndent( $indent = 0) : void| Name | Type | Description |
|---|---|---|
| $indent |

setStyleDefinition( $entity, $definition) : stringaddStyleDefinition
Inherited from: \cHTML::setStyleDefinition()\cFoldingRow::setStyleDefinition()| Name | Type | Description |
|---|---|---|
| $entity | string Entity to define | |
| $definition | string Definition for the given entity |
| Type | Description |
|---|---|
| string | filled SGML closing skeleton |
\cPager
- Author
- Timo A. Hummel
Properties

integer $_itemPadding- Type
- integer
- Access
- private
Methods

cPager( $items, $itemsPerPage, $currentPage) : voidConstructor Function Initializes the pager
| Name | Type | Description |
|---|---|---|
| $items | int Amount of items | |
| $itemsPerPage | int Items displayed per page | |
| $currentPage | int Defines the current page |

getPagesInRange() : arrayReturns an array with the pager structure.
Array format: Key : Page Number Value: | for "...", "current" for the current item, page number otherwise
| Type | Description |
|---|---|
| array | Pager structure |

isFirstPage() : booleanReturns if the currentPage pointer is the first page.
| Type | Description |
|---|---|
| boolean | True if we're on the first page. |