NCCI Perl Documentation NavigationBar(3)
NAME
NavigationBar - Compose HTML text for navigating a set of
pages
SYNOPSIS
# Access to modules (see the NOTES section for setup)
BEGIN {
...
push (@INC, "../sys/csbase/lib");
}
use NavigationBar;
# Build a new object in GIF / block mode.
my ($nav) = new NavitationBar ("block");
# Emit the HTML showing we are currently on page
# 23 of 87, and that there are 20 pages per "group"
# of pages. We will go the the url given in $myURL,
# with the parameter CURRENT_PAGE set to the new
# page number. The images live in the (relative) url
# "images".
print $nav->bar (87, 23, $myURL,
"CURRENT_PAGE", 20, "imgages");
DESCRIPTION
This Perl5 class composes "page navigation" HTML fragments
of the form:
Page: [Prev] 1 2 3 [Next]
Functions
NavigationBar->new ($style)
Create a new NavigationBar object. The $style argument
is optional: it is one of:
"text" for html text page numbers (DEFAULT)
"block" for block images with numbers below
pageNameList (@nameList)
This routine allows a list of page "names" to be
provided. If this routine is called, the page names
will be shown on the interface, rather than the page
numbers. This allows, for example, the list of letters
A-Z to be shown, rather than 26 page numbers.
19/Mar/01 Last change: perl 5.004, patch 01 1
NCCI Perl Documentation NavigationBar(3)
bar ($totalPages, $currentPage, $urlBase, $urlTag,
[$ppg, [$imgDir] ] )
Form a navigation bar.
Returns the HTML text for the bar.
If there is one or less pages ($totalPages <= 1) this
routine returns ""
$totalPages Total number of pages which could be displayed.
$currentPage (one-based) index of the page to display.
$urlBase Leading portion of the URL to emit for links
to other pages.
$urlTag For each link to another page, if $urlTag is
not "", the $urlBase is "augmented" with
"&$urlTag=" plus the selected page number.
$ppg Pages per Group. If there are more than
$ppg pages, we "group" them on the nav bar
in groups of $ppg pages.
The default is 20.
$imgDir The location of images for block mode output.
The default is "../sys/csbase/img".
=back
WARNING
None
NOTES
This module has not yet been set up for "installation" in
your local Perl. We currently use a set of conventions for
access to this module, until the install procedures are
developed:
- The source code lives on development and production hosts
in the directory /Volumes/app/cs/csbase/lib.
- By convention, a project maintains perl scripts in
subdirectories of some top-level directory, which we will
call $TOP.
- By convention, projects establish a $TOP/sys directory
which contains a symbolic link from csbase to
/Volummes/app/cs/csbase.
19/Mar/01 Last change: perl 5.004, patch 01 2
NCCI Perl Documentation NavigationBar(3)
- To get access to the modules, you typically include a
BEGIN of the form:
BEGIN {
...
push (@INC, "../sys/csbase/lib");
}
AUTHOR
Clint Goss <clint@goss.com>, Feb 1997