pa_pagination_bar (public)
pa_pagination_bar cur_id all_ids link [ what ]
Defined in packages/photo-album/tcl/photo-album-procs.tcl
given a current photo_id and an ordered list of all the photo_id in an album creates an html fragment that allows user to navigate to any photo by number next/previous
- Parameters:
- cur_id (required)
- all_ids (required)
- link (required)
- what (optional)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: if { $cur_id eq "" || [llength $all_ids] < 2 } { return "" } set cur_index [lsearch -exact $all_ids $cur_id] set prev_id [lindex $all_ids $cur_index-1] set next_id [lindex $all_ids $cur_index+1] set photo_nav_html "" if {$what ne ""} { set what " $what" } # append the 'prev' link append photo_nav_html "<div class=\"photo_album_nav\">\n" if { $prev_id ne "" } { append photo_nav_html [subst { <div style="text-align: left; float: left; margin-right: 1em; margin-bottom: 1em"> <a href="[ns_quotehtml ${link}$prev_id]"><< [_ photo-album.Prev]$what</a> </div> }] } # append the 'next' link if { $next_id ne "" } { append photo_nav_html [subst { <div style="text-align: right; float: right; margin-left: 1em; margin-bottom: 1em"> <a href="[ns_quotehtml ${link}$next_id]">[_ photo-album.Netx]$what >></a> </div> }] } # append page number links for all pages except for this page append photo_nav_html "\t<div style=\"text-align: center\">\n" set i 0 set last {} foreach {id i} [pa_pagination_context_ids $cur_id $all_ids 4] { if {$last ne "" && ($last + 1) != $i} { append photo_nav_html "•" } set last $i if { $cur_id == $id } { append photo_nav_html "\t\t<strong>$i</strong>\n" } else { append photo_nav_html [subst {<a href="[ns_quotehtml ${link}$id]">$i</a>}] } } append photo_nav_html "\t</div>\n" append photo_nav_html "</div>\n" return $photo_nav_htmlGeneric XQL file: packages/photo-album/tcl/photo-album-procs.xql
PostgreSQL XQL file: packages/photo-album/tcl/photo-album-procs-postgresql.xql
Oracle XQL file: packages/photo-album/tcl/photo-album-procs-oracle.xql