.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sh \" Subsection heading
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. | will give a
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
.\" expand to `' in nroff, nothing in troff, for use with C<>.
.tr \(*W-|\(bv\*(Tr
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
'br\}
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. nr % 0
. rr F
.\}
.\"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.hy 0
.if n .na
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
.\}
.if t \{\
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "Gantry::Utils::HTML 3"
.TH Gantry::Utils::HTML 3 "2008-01-18" "perl v5.8.8" "User Contributed Perl Documentation"
.SH "NAME"
Gantry::Utils::HTML \- HTML tag generators.
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.Vb 1
\& use Gantry::Utils::HTML qw( :all );
.Ve
.PP
.Vb 2
\& :common
\& ht_a ht_br ht_img ht_lines ht_qt ht_uqt
.Ve
.PP
.Vb 2
\& :style
\& ht_b ht_h ht_i ht_p ht_up ht_div ht_udiv
.Ve
.PP
.Vb 3
\& :form
\& ht_checkbox ht_form ht_form_js ht_input ht_radio ht_select ht_submit
\& ht_uform
.Ve
.PP
.Vb 2
\& :table
\& ht_table ht_tr ht_td ht_utd ht_utr ht_utable
.Ve
.PP
.Vb 2
\& :jscript
\& ht_popup
.Ve
.PP
.Vb 2
\& ht_a
\& @href = ht_a( $url, $text, @extra )
.Ve
.PP
.Vb 2
\& ht_b
\& @bold = ht_b( @text )
.Ve
.PP
.Vb 2
\& ht_br
\& $br = ht_br()
.Ve
.PP
.Vb 2
\& ht_checkbox
\& $checkbox = ht_checkbox( $name, $value, $form_value, @params )
.Ve
.PP
.Vb 2
\& ht_div
\& @div = ht_div( $options, @data )
.Ve
.PP
.Vb 2
\& ht_form
\& $form = ht_form( $action, @extra )
.Ve
.PP
.Vb 2
\& ht_form_js
\& @form = ht_form_js( $action, @extra )
.Ve
.PP
.Vb 2
\& ht_h
\& @h = ht_h( $level, @text )
.Ve
.PP
.Vb 2
\& ht_help
\& @help = ht_help( $help_root, $type, $ident )
.Ve
.PP
.Vb 2
\& ht_i
\& @i = ht_i( @text )
.Ve
.PP
.Vb 2
\& ht_img
\& @img = ht_img( $url, @extra )
.Ve
.PP
.Vb 2
\& ht_input
\& @input = ht_input( $name, $type, $value @params )
.Ve
.PP
.Vb 2
\& ht_lines
\& $lines = ht_lines( @lines )
.Ve
.PP
.Vb 2
\& ht_p
\& $p = ht_p()
.Ve
.PP
.Vb 2
\& ht_popup
\& @popup = ht_popup( $url, $text, $winname, $height, $width )
.Ve
.PP
.Vb 2
\& ht_qt
\& $string = ht_qt( $string )
.Ve
.PP
.Vb 2
\& ht_radio
\& $radio = ht_radio( $name, $value, $form_value, @params )
.Ve
.PP
.Vb 3
\& ht_select
\& @select = ht_select( $name, $size, $value, $multiple,
\& $opts, @items )
.Ve
.PP
.Vb 2
\& ht_submit
\& $submit = ht_submit( $name, $value )
.Ve
.PP
.Vb 2
\& ht_table
\& $table = ht_table( $options )
.Ve
.PP
.Vb 2
\& ht_tr
\& $tr = ht_tr( $options )
.Ve
.PP
.Vb 2
\& ht_td
\& @td = ht_td( $options, @data )
.Ve
.PP
.Vb 2
\& ht_udiv
\& $udiv = ht_udiv()
.Ve
.PP
.Vb 2
\& ht_uform
\& $uform = ht_uform()
.Ve
.PP
.Vb 2
\& ht_up
\& $up = ht_up()
.Ve
.PP
.Vb 2
\& ht_uqt
\& $string = ht_uqt( $string )
.Ve
.PP
.Vb 2
\& ht_utable
\& $utable = ht_utable()
.Ve
.PP
.Vb 2
\& ht_utd
\& $utd = ht_utd()
.Ve
.PP
.Vb 2
\& ht_utd
\& $utd = ht_utd()
.Ve
.PP
.Vb 2
\& ht_utr
\& $utr = ht_utr()
.Ve
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
Implements \s-1HTML\s0 tags in a browser non-specfic way conforming to
3.2 and above \s-1HTML\s0 specifications.
.ie n .IP "@href = ht_a( $url\fR, \f(CW$text\fR, \f(CW@extra )" 4
.el .IP "@href = ht_a( \f(CW$url\fR, \f(CW$text\fR, \f(CW@extra\fR )" 4
.IX Item "@href = ht_a( $url, $text, @extra )"
This function returns a fully formed href tag. "\f(CW$url\fR\*(L" and \*(R"\f(CW$text\fR\*(L" are
required. \*(R"\f(CW@extra\fR\*(L" can contain any other tags to add to the href such as
\&\*(R"CLASS='my_href_class'" or an other options a href may take.
.ie n .IP "@bold = ht_b( @text )" 4
.el .IP "@bold = ht_b( \f(CW@text\fR )" 4
.IX Item "@bold = ht_b( @text )"
This function takes an array or a string of text and then wraps it in "\f(CW\*(C`"
tags. It will always return an array regardless of the input.
.IP "$br = \fIht_br()\fR" 4
.IX Item "$br = ht_br()"
This function simply returns a "\f(CW\*(C`
" html tag, it takes no arguements.
.ie n .IP "$checkbox = ht_checkbox( $name\fR, \f(CW$value\fR, \f(CW$form_value\fR, \f(CW@params )" 4
.el .IP "$checkbox = ht_checkbox( \f(CW$name\fR, \f(CW$value\fR, \f(CW$form_value\fR, \f(CW@params\fR )" 4
.IX Item "$checkbox = ht_checkbox( $name, $value, $form_value, @params )"
This function generates individual checkboxes. "\f(CW$name\fR\*(L" is the name
of the checkbox. \*(R"\f(CW$value\fR\*(L" is the value to set for this checkbox.
\&\*(R"\f(CW$form_value\fR is the currently selected value, for a checkbox to be
checked the \f(CW$value\fR must be exactly equal to \f(CW$form_value\fR. An \f(CW%in\fR hash
with a key of \f(CW$name\fR may also be used for \f(CW$form_value\fR. \f(CW@params\fR is
passed directly to the end of the checkbox, this can be used for
javascript or arbitrary html.
.ie n .IP "$div = ht_div( %attributes )" 4
.el .IP "$div = ht_div( \f(CW%attributes\fR )" 4
.IX Item "$div = ht_div( %attributes )"
This takes an optional hash of attributes for a div tag and returns a
scalar containing an opening div tag.
.IP "$udiv = ht_udiv( )" 4
.IX Item "$udiv = ht_udiv( )"
Returns an ending div tag.
.ie n .IP "$form = ht_form( $action\fR, \f(CW@extra )" 4
.el .IP "$form = ht_form( \f(CW$action\fR, \f(CW@extra\fR )" 4
.IX Item "$form = ht_form( $action, @extra )"
This function takes the action of the form in the first variable "\f(CW$action\fR\*(L"
any other options should be passed in through \*(R"\f(CW@extra\fR\*(L". The \*(R"\f(CW@extra\fR\*(L"
array should consit of a valid form tag in the form \*(R"method='post'".
.ie n .IP "@form = ht_form_js( $action\fR, \f(CW@extra )" 4
.el .IP "@form = ht_form_js( \f(CW$action\fR, \f(CW@extra\fR )" 4
.IX Item "@form = ht_form_js( $action, @extra )"
This function behaves exactly the same way the \f(CW\*(C`ht_form\*(C'\fR function works, save
this function adds a javascript 'anti\-click' routine which should keep people
from submitting a form more than one for double clicking the submit button.
.ie n .IP "@h = ht_h( $level\fR, \f(CW@text )" 4
.el .IP "@h = ht_h( \f(CW$level\fR, \f(CW@text\fR )" 4
.IX Item "@h = ht_h( $level, @text )"
This function takes a "\f(CW$level\fR\*(L" which is an integer between 1 and 6
corisponding to the h1 ... h6 tag that is used, there is not checking on
the value of the integer so any value of level is acceptable to the function
if not as valid html. The \*(R"\f(CW@text\fR\*(L" is wrapped in the \*(R"h" tags.
.ie n .IP "@help = ht_help( $help_root\fR, \f(CW$type\fR, \f(CW$ident )" 4
.el .IP "@help = ht_help( \f(CW$help_root\fR, \f(CW$type\fR, \f(CW$ident\fR )" 4
.IX Item "@help = ht_help( $help_root, $type, $ident )"
this function takes the help root, generally '$site{help}' a type,
either 'category' or 'item' and the ident of the help item. It returns
and array of html containing a link that will generate a help popup.
.ie n .IP "@i = ht_i( @text )" 4
.el .IP "@i = ht_i( \f(CW@text\fR )" 4
.IX Item "@i = ht_i( @text )"
This function takes "\f(CW@text\fR\*(L" and wraps it in \*(R"\f(CW\*(C`" tags.
.ie n .IP "@img = ht_img( $url\fR, \f(CW@extra )" 4
.el .IP "@img = ht_img( \f(CW$url\fR, \f(CW@extra\fR )" 4
.IX Item "@img = ht_img( $url, @extra )"
This function creates an "\f(CW\*(C`\*(L" tag. \*(R"\f(CW$url\fR\*(L" is the url to the
image, \*(R"\f(CW@extra\fR\*(L" should contain any extra tags that the image tage should
contain. The \*(R"\f(CW@extra\fR\*(L" array should contain values of the form \*(R"WIDTH='10'".
.ie n .IP "@input = ht_input( $name\fR, \f(CW$type\fR, \f(CW$value\fR \f(CW@params )" 4
.el .IP "@input = ht_input( \f(CW$name\fR, \f(CW$type\fR, \f(CW$value\fR \f(CW@params\fR )" 4
.IX Item "@input = ht_input( $name, $type, $value @params )"
This function creates html textareas, checkboxes, text and hidden
elements. "\f(CW$name\fR\*(L" is the name of the element in the html as used in
the form, \*(R"\f(CW$type\fR\*(L" should be the type of the input element, ( ie:
textarea, checkbox, text, radio, or hidden ). \*(R"\f(CW$value\fR\*(L" is either a
hash containing the text as a key, or the variable itself. \*(R"\f(CW@params\fR\*(L"
contains anything else that needs to be passed to the input type such as
length or the like \*(R"LENTGH='1'".
.ie n .IP "$lines = ht_lines( @lines )" 4
.el .IP "$lines = ht_lines( \f(CW@lines\fR )" 4
.IX Item "$lines = ht_lines( @lines )"
This function takes the "\f(CW@lines\fR\*(L" array and concatanates it together with
newlines \*(R"\f(CW\*(C`\en\*(C'\fR" to create a single string.
.IP "$p = \fIht_p()\fR" 4
.IX Item "$p = ht_p()"
This function takes no arguements and returns a simple \f(CW\*(C`
tag. .ie n .IP "@popup = ht_popup( $url\fR, \f(CW$text\fR, \f(CW$winname\fR, \f(CW$height\fR, \f(CW$width )" 4 .el .IP "@popup = ht_popup( \f(CW$url\fR, \f(CW$text\fR, \f(CW$winname\fR, \f(CW$height\fR, \f(CW$width\fR )" 4 .IX Item "@popup = ht_popup( $url, $text, $winname, $height, $width )" This function creates a special html \*(L"ref\*(R" call. It creates a link to a new javascript window with the properties specified. The "\f(CW$url\fR\*(L" is the \s-1URL\s0 of the new window, \*(R"\f(CW$text\fR\*(L" is the text to be displayed by the link. \&\*(R"\f(CW$winname\fR\*(L" is the name of the window that will be created. \*(R"\f(CW$height\fR\*(L" and \&\*(R"\f(CW$width\fR" are the height and the width of the window, respectively. .ie n .IP "$string = ht_qt( $string )" 4 .el .IP "$string = ht_qt( \f(CW$string\fR )" 4 .IX Item "$string = ht_qt( $string )" This function will escape the html special characters in "\f(CW$string\fR" and return the specially formated value of the string. .ie n .IP "$radio = ht_radio( $name\fR, \f(CW$value\fR, \f(CW$form_value\fR, \f(CW@params )" 4 .el .IP "$radio = ht_radio( \f(CW$name\fR, \f(CW$value\fR, \f(CW$form_value\fR, \f(CW@params\fR )" 4 .IX Item "$radio = ht_radio( $name, $value, $form_value, @params )" This function generates individual radio buttons. "\f(CW$name\fR\*(L" is the name of the radio buttion group. \*(R"\f(CW$value\fR\*(L" is the value to set for this radio button. \*(R"\f(CW$form_value\fR is the currently selected value, for a radio button to be checked the \f(CW$value\fR must be exactly equal to \&\f(CW$form_value\fR. An \f(CW%in\fR hash with a key of \f(CW$name\fR may also be used for \&\f(CW$form_value\fR. \f(CW@params\fR is passed directly to the end of the radio button, this can be used for javascript or arbitrary html. .ie n .IP "@select = ht_select( $name\fR, \f(CW$size\fR, \f(CW$value\fR, \f(CW$multiple\fR, \f(CW$opts\fR, \f(CW@items )" 4 .el .IP "@select = ht_select( \f(CW$name\fR, \f(CW$size\fR, \f(CW$value\fR, \f(CW$multiple\fR, \f(CW$opts\fR, \f(CW@items\fR )" 4 .IX Item "@select = ht_select( $name, $size, $value, $multiple, $opts, @items )" This function creates a html select box. "\f(CW$name\fR\*(L" is the name of select box for use in parsing the form. \*(R"\f(CW$size\fR\*(L" is the number of rows to show for the select box. \*(R"\f(CW$value\fR\*(L" is the a hash reference which contains the value that is currently selected with a hash key of the value of \*(R"\f(CW$name\fR\*(L". \&\*(R"\f(CW$multiple\fR\*(L" needs only to be defined to create the select box as a multiple select rather than a single select box. \*(R"\f(CW@items\fR" is an array/hash of the values of the select box. \f(CW$opts\fR will be included directly into the opening of the select, this allows tweaky javascript things. .ie n .IP "$submit = ht_submit( $name\fR, \f(CW$value )" 4 .el .IP "$submit = ht_submit( \f(CW$name\fR, \f(CW$value\fR )" 4 .IX Item "$submit = ht_submit( $name, $value )" This function creates a submit button with the name of "\f(CW$name\fR\*(L" and the value of \*(R"\f(CW$value\fR". .ie n .IP "$table = ht_table( $options )" 4 .el .IP "$table = ht_table( \f(CW$options\fR )" 4 .IX Item "$table = ht_table( $options )" This function creates an open table tag. It takes a hash reference, \&\f(CW$options\fR. The hash reference should contain key value pairs corresponding to the table options ie: 'cellpadding', '0', 'border', '1' or the like. .ie n .IP "$tr = ht_tr( $options )" 4 .el .IP "$tr = ht_tr( \f(CW$options\fR )" 4 .IX Item "$tr = ht_tr( $options )" This function creates an open table row tag, it operates exactly as the \&\f(CW\*(C`ht_table()\*(C'\fR function does. .ie n .IP "@td = ht_td( $options\fR, \f(CW@data )" 4 .el .IP "@td = ht_td( \f(CW$options\fR, \f(CW@data\fR )" 4 .IX Item "@td = ht_td( $options, @data )" This function creates a table data completely from the open td tag to the close td flag. The options flag works like \f(CW\*(C`ht_table()\*(C'\fR and \f(CW\*(C`ht_tr\*(C'\fR. The \&\f(CW@data\fR is what should appear in the table data element. To specify no wrap set 'nowrap' => '0' or any value since the function will ignore the value completely. The \f(CW@data\fR is optional, if it is not provided then the td will just issue an opening