template::paginator::get_pages (public)

 template::paginator::get_pages name group

Defined in packages/acs-templating/tcl/paginator-procs.tcl

Gets a list of pages in a group, truncating if appropriate at the end.

Parameters:
name (required)
The reference to the paginator object.
group (required)
A number ranging from one to the number of page groups in the query result.
Returns:
A Tcl list of page numbers.

Partial Call Graph (max 5 caller/called nodes):
%3 template::paginator::get_reference template::paginator::get_reference (private) template::paginator::get_pages template::paginator::get_pages template::paginator::get_pages->template::paginator::get_reference

Testcases:
No testcase defined.
Source code:
    get_reference

    set group_count $properties(group_count)
    set group_size $properties(groupsize)
    set page_count $properties(page_count)

    if { $group > $group_count } {
        if { $group_count == 0 } {
            return ""
        }
        error "Group out of bounds ($group > $group_count)"
    }

    set start [expr {($group - 1) * $group_size + 1}]
    set end [expr {$start + $group_size - 1}]

    if { $end > $page_count } { set end $page_count }

    set pages [list]

    for { set i $start } { $i <= $end } { incr i } {
        lappend pages $i
    }

    return $pages
XQL Not present:
PostgreSQL, Oracle
Generic XQL file:
packages/acs-templating/tcl/paginator-procs.xql

[ hide source ] | [ make this the default ]
Show another procedure: