|
From: Chris W. <la...@us...> - 2001-10-11 15:17:19
|
Update of /cvsroot/openinteract/OpenInteract/template
In directory usw-pr-cvs1:/tmp/cvs-serv17678
Added Files:
page_count
Log Message:
copied page_count component from base_component
--- NEW FILE: page_count ---
[%#########################################
page_count( total_pages, current_pagenum, url, break_count )
Component to display the total number of pages and for each of
the pages not current link it to a URL to display that page.
Parameters:
total_pages - Total number of pages in result set
current_pagenum - Page you are currently on
url - URL to which we append ';pagenum=x'
break_count - number of pages to display on a line
Defaults:
break_count = 20
########################################-%]
[%- DEFAULT break_count = 20 -%]
Page [
[%- FOREACH page_count = [ 1 .. total_pages ] -%]
[%- IF page_count == 1 -%]
[%- IF current_pagenum != 1 -%]
<a href="[% url %];pagenum=[% current_pagenum - 1 %]"><<</a>
[%- ELSE %]<<[% END -%]
[%- END -%]
[%- IF page_count == current_pagenum %][% page_count %]
[%- ELSE %]<a href="[% url %];pagenum=[% page_count %]">[% page_count %]</a>
[%- END -%]
[%- IF page_count mod break_count == 0 -%]<br>[% ELSE %] [% END -%]
[%- IF page_count == total_pages -%]
[%- IF current_pagenum != total_pages -%]
<a href="[% url %];pagenum=[% current_pagenum + 1 %]">>></a>
[%- ELSE %]>>[% END -%]
[%- END -%]
[%- END -%]
]
|