Pager.pm
NAME
Communiware::DE::Pager - Dynamic element Pager
SYNOPSIS
<:Pager list_id=some_list_id [per_navigation=N]:> ... <:EndPager:>
DESCRIPTION
Creates context with attributes with are detailed properties of corresponded List assigned by list_id argument. Each page in navigation can be accessed with perl filter ::Pager. This filter can be used only in contex of <:Pager:>.
EXAMPLE
<:Loop some_filter "" "" 10 list_id=mylist:><:Attr SEQ_NO:>:<:Attr TITLE:><br/><:EndLoop:> <:Pager list_id=mylist:> <:If PREV_PAGE:> <:Define PREV_SKIP "@SKIP_NAME=@SKIP_TO_PREV":> <:ItemLink @CURRENT_ITEM_ID "<" "" "" "" @PREV_SKIP:> |&nbps; <:EndIf:> <:Loop ::Pager :> <:If SEQ_NO != 1:> |&nbps;<:EndIf:> <:If THIS_PAGE = @CURRENT_PAGE:> <strong><:Attr THIS_PAGE:></strong> <:Else:> <:ItemLink @CURRENT_ITEM_ID @THIS_PAGE "" "" "" @SKIP_NAME:> <:EndIf:> <:EndLoop:> <:If NEXT_PAGE:> &nbps;|&nbps; <:Define NEXT_SKIP "@SKIP_NAME=@SKIP_TO_NEXT":> <:ItemLink @CURRENT_ITEM_ID ">" "" "" "" @NEXT_SKIP:> <:EndIf:> <:EndPager:>
ARGUMENTS
- list_id
- List identifier. First character of list identifier must be from [:alpha:] class. Rest can contain any latin character, number or '_'.
- per_navigation
- How many links per navigation page will be printed by Pager.
- cut
- How many entries will be on current list. Optional. By default <:Pager:> gets cut number from list defined by previous <:List:> or <:Loop:> but this value can be overridden by this argument. If cut number defined by previous <:List:> was 0, it defaults to global pseudo attribute CHUNK.
CONTEXT ATTRIBUTES
- LIST_ID
- Id of processed list.
- LIST_PAGES
- Simple list of pages in current navigation. With perl-filter ::Pager we can get detailed info of each page.
- PAGES_PER_NAVIGATION
- The number of page numbers displayed on one page. This set by per_navigation argument of dynamic element.
- FIRST_NAVIGATION_PAGE
- Returns the first page in the list of navigation pages.
- LAST_NAVIGATION_PAGE
- The last page in the list of navigation pages.
- FIRST_PAGE
- The first page. This is put in for reasons of symmetry with last_page, as it always returns 1.
- LAST_PAGE
- The total number of pages.
- PREV_PAGE
- The previous page number, if one exists. Otherwise it returns undefined.
- NEXT_PAGE
- The next page number, if one exists. Otherwise it returns undefined.
- CURRENT_PAGE
- The current pager position. The same in top contex of <:Pager:> and in contexts created by perl-filter ::Pager.
- THIS_PAGE
- This page number. In top context of <:Pager:> it equals to CURRENT_PAGE. In context created by perl-filter ::Pager it equal to corresponding number in navigation pages sequence.
- TOTAL_ENTRIES
- The total number of entries.
- ENTRIES_PER_PAGE
- Total number of entries per page. This is value from corresponding list definition.
- ENTRIES_ON_THIS_PAGE
- The number of entries on the this page.
- FIRST_ON_PAGE
- The the number of the first entry on the current page.
- LAST_ON_PAGE
- The number of the last entry on the current page.
- SKIP_NAME
- The name of attribute witch should be passed to global context to skip to next page. You can use it with substitution.
- SKIP_TO_PREV
- The number of entries for switch <:List:> & <:Pager:> to previous page.
- SKIP_TO_NEXT
- The number of entries for switch <:List:> & <:Pager:> to next page.
16 октябрь 2007 13:44