/tag_utils/html_utils.inc

Description

This file contains some utility functions to help build some Tag objects that are commonly used in html.

$Id: _tag_utils_html_utils_inc.html,v 1.48.2.1 2005/05/12 01:52:14 hemna Exp $

Functions
html_a (line 30)

build an href with content and attributes.

Atag html_a (string $url, string $content, [string $class = NULL], [string $target = NULL], [string $title = NULL])
  • string $url: - the url to go to.
  • string $content: - the visible link text.
  • string $class: - the css class to use.
  • string $target: - the target browser window/frame for the url.
  • string $title: - the title attribute
html_abbr (line 61)

build an <ABBR> tag with content.

This is to build an abbreviation. normally its just <abbr title="foo bar">foo</abbr>

  • return: object.
ABBRtag html_abbr (string $title, mixed $content)
  • string $title: - the title attribute
  • mixed $content: - the content for the tag
html_acronym (line 78)

build an <ACRONYM> tag with content.

This is to build an acronym. normally its just <acronym title="foo bar">foo</abbr>

  • return: object.
ACRONYMtag html_acronym (string $title, mixed $content)
  • string $title: - the title attribute
  • mixed $content: - the content for the tag
html_address (line 89)

build an <ADDRESS> tag with content.

  • return: object.
ADDRESStag html_address ()
html_applet (line 103)

build an <APPLET> tag with content.

  • return: object.
APPLETtag html_applet ()
html_area (line 128)

build an <AREA> tag with content.

  • return: object.
AREAtag html_area (string $href, string $coords, [string $shape = "rect"], [string $alt = ""], [string $target = ""], [string $title = ""])
  • string $href: - the href for the area
  • string $coords: - the coords value circle x,y,radius poly x1,y1,...xn,yn left,top,right,bottom
  • string $shape: - the shape DEFAULT: rect circle, rect, poly, default
  • string $alt: - the alt text
  • string $target: - the target _blank, _parent, _self, _top
  • string $title: - the title text
html_b (line 156)

build a bold

  • return: object.
  • author: Walt A. Boring
BRtag html_b ()
html_base (line 172)

build a <base> tag.

This tag MUST go in the <head>

  • return: object.
BASEtag html_base (string $href, [string $target = ""])
  • string $href: - the href
  • string $target: - the target _blank, _parent, _self, _top
html_bdo (line 193)

build a <bdo> tag.

dir attribute is required.

  • return: object.
BDOtag html_bdo (string $dir, mixed 1)
  • mixed 1: - any number of text content params.
  • string $dir: - the dir attribute ltr, rtl
html_big (line 213)

build a <big> tag with content.

  • return: object.
  • author: Walt A. Boring
BIGtag html_big ()
html_blockquote (line 226)

build a <blockquote> tag with content.

  • return: object.
  • author: Walt A. Boring
BLOCKQUOTEtag html_blockquote ()
html_body (line 239)

build a <body> tag with content.

  • return: object.
  • author: Walt A. Boring
BODYtag html_body ()
html_br (line 255)

builds n # of
tags.

  • return: - BRtag object. or Container
mixed html_br ([int $num = 1], [mixed $class = null])
  • int $num: - the number of br tags you want
html_button (line 287)

build a <button> tag with content.

  • return: object.
BUTTONtag html_button ([string $type = "button"], mixed 1)
  • mixed 1: - any number of items as content.
  • string $type: - the button type button, reset, submit DEFAULT : button
html_caption (line 303)

build a <caption> tag with content.

  • return: object.
CAPTIONtag html_caption ([mixed 0 = - n number of arguments as content for the tag.])
  • mixed 0: - n number of arguments as content for the tag.
html_center (line 318)

build a <center> tag with some content.

DEPRICATED

  • return: object.
CENTERtag html_center ([mixed 0 = - n number of arguments as content for the tag.])
  • mixed 0: - n number of arguments as content for the tag.
html_cite (line 332)

build a <cite> tag with some content.

  • return: object.
CITEtag html_cite ([mixed 0 = - n number of arguments as content for the tag.])
  • mixed 0: - n number of arguments as content for the tag.
html_code (line 346)

build a

  • return: object.
CODEtag html_code ([mixed 0 = - n number of arguments as content for the tag.])
  • mixed 0: - n number of arguments as content for the tag.
html_col (line 360)

build a <col> tag

  • return: object.
CODEtag html_col ([mixed $width = ''], [mixed $align = ''], [mixed $span = ''])
  • mixed $width: - n number of arguments as content for the tag.
html_colgroup (line 387)

build a <colgroup> tag.

NOTE: The colgroup element is an empty element that contains attributes only. To create columns, you must specify td elements within a tr element.

  • return: object.
COLGROUPEtag html_colgroup (array $attributes)
  • array $attributes: - tag attributes.
html_comment (line 398)

render an html comment string

  • return: - the string wrapped in the html comment block
string html_comment (string $string)
  • string $string: - the string to comment.
html_dd (line 409)

build a <dd> tag with some content.

  • return: object.
DDtag html_dd ([mixed 0 = - n number of arguments as content for the tag.])
  • mixed 0: - n number of arguments as content for the tag.
html_del (line 423)

build a <del> tag with some content.

  • return: object.
DELtag html_del ([mixed 0 = - n number of arguments as content for the tag.])
  • mixed 0: - n number of arguments as content for the tag.
html_dfn (line 438)

build a <dfn> tag with some content.

  • return: object.
DFNtag html_dfn ([mixed 0 = - n number of arguments as content for the tag.])
  • mixed 0: - n number of arguments as content for the tag.
html_dl (line 457)

build a <dl> tag with some content.

  • return: object.
DLtag html_dl ([mixed 0 = - n number of arguments as content for the tag.])
  • mixed 0: - n number of arguments as content for the tag.
html_dt (line 471)

build a <dt> tag with some content.

  • return: object.
DTtag html_dt ([mixed 0 = - n number of arguments as content for the tag.])
  • mixed 0: - n number of arguments as content for the tag.
html_em (line 485)

build a <em> tag with some content.

  • return: object.
EMtag html_em ([mixed 0 = - n number of arguments as content for the tag.])
  • mixed 0: - n number of arguments as content for the tag.
html_fieldset (line 501)

build a <fieldset> tag with some content.

  • return: object.
FIELDSETtag html_fieldset ([mixed $legend = ""], mixed 1)
  • mixed 1: - n number of arguments as content for the tag.
  • mixed $legend: - The legend text, or the LEGENDtag for the fieldset.
html_h1 (line 534)

build an H1 tag object with content.

  • return: object.
  • author: Walt A. Boring
H1tag html_h1 ([mixed 0 = - n number of arguments as content for the tag.])
  • mixed 0: - n number of arguments as content for the tag.
html_h2 (line 550)

build an H2 tag object with content.

  • return: object.
  • author: Walt A. Boring
H2tag html_h2 ([mixed 0 = - n number of arguments as content for the tag.])
  • mixed 0: - n number of arguments as content for the tag.
html_h3 (line 567)

build an H3 tag object with content.

  • return: object.
  • author: Walt A. Boring
H3tag html_h3 ([mixed 0 = - n number of arguments as content for the tag.])
  • mixed 0: - n number of arguments as content for the tag.
html_h4 (line 583)

build an H4 tag object with content.

  • return: object.
  • author: Walt A. Boring
H4tag html_h4 ([mixed 0 = - n number of arguments as content for the tag.])
  • mixed 0: - n number of arguments as content for the tag.
html_h5 (line 599)

build an H5 tag object with content.

  • return: object.
  • author: Walt A. Boring
H5tag html_h5 ([mixed 0 = - n number of arguments as content for the tag.])
  • mixed 0: - n number of arguments as content for the tag.
html_h6 (line 616)

build an H6 tag object with content.

  • return: object.
  • author: Walt A. Boring
H6tag html_h6 ([mixed 0 = - n number of arguments as content for the tag.])
  • mixed 0: - n number of arguments as content for the tag.
html_head (line 632)

build an <head> tag object with content.

  • return: object.
  • author: Walt A. Boring
HEADtag html_head ([mixed 0 = - n number of arguments as content for the tag.])
  • mixed 0: - n number of arguments as content for the tag.
html_hr (line 644)

build an <hr> tag object.

  • return: object.
HRtag html_hr ()
html_html (line 656)

build an <html> tag object.

  • return: object.
  • author: Walt A. Boring
HTMLtag html_html ([mixed 0 = - n number of arguments as content for the tag.])
  • mixed 0: - n number of arguments as content for the tag.
html_i (line 672)

build a

  • return: object.
  • author: Walt A. Boring
Itag html_i ([mixed 0 = - n number of arguments as content for the tag.])
  • mixed 0: - n number of arguments as content for the tag.
html_iframe (line 686)

build a <irame> tag with some content.

  • return: object.
  • author: Walt A. Boring
Itag html_iframe (src $src, [mixed $width = ""], [mixed $height = ""], [mixed $scrolling = ""])
  • src $src: - the url for the iframe
html_img (line 721)

Build an <img> tag.

If width and or height are not provided we do not set them in the tag.

  • return: object.
  • author: Walter A. Boring IV
IMGtag html_img (string $image, [int $width = ''], [int $height = ''], [int $border = 0], [string $alt = ""], [string $usemap = NULL], [string $title = NULL], [string $align = NULL], [mixed $filename = NULL])
  • string $image: - $image - image src
  • int $width: - $width - width of the image.
  • int $height: - $heigth - height of the image
  • int $border: - $border - border flag.
  • string $alt: - $alt - alt tag for the image
  • string $usemap: - $usemap - the image map name
  • string $title: - $align - the align attribute
  • string $align: - $localfilename - the full path to the filename. If this is set and $width == '' and $height == '' then we will try and determine the size attributes of the image.
html_img_href (line 829)

build an hlink for an image.

this automatically turns off indenting and newlines, so it formats well

  • return: object with <img> as content
Atag html_img_href (string $url, string $image, [int $width = ''], [int $height = ''], [int $border = 0], [string $alt = ""], [string $usemap = NULL], [string $target = NULL], [string $title = NULL], [string $align = NULL])
  • string $url: - $url - href for the <a>
  • string $image: - $image - src for the <img>
  • int $width: - $width - width of the image
  • int $height: - $height - height of the image
  • int $border: - $border - for the <img>
  • string $alt: - $alt - for the <img ALT="">
  • string $usemap: - $usemap - the image map name
  • string $target: - $target - the <a target="blah">
  • string $title: - $title - the title attribute
  • string $align: - $align - the align attribute
html_img_local (line 784)

This method is a wrapper for html_img() that allows us to automatically set the width, and height based upon the discovered image attributes.

NOTE: This assumes the $image includes a path which is on the local filesystem based off of the DOCUMENT_ROOT

So if DOCUMENT_ROOT = /www/mysite.com/html and $image = '/images/foo.jpg'

getimagesize will look in $_SERVER['DOCUMENT_ROOT'].$image

  • return: object
IMGtag html_img_local (string $image, [int $border = 0], [string $alt = ''], [string $usemap = NULL], [string $title = NULL], [mixed $align = NULL])
  • string $image: - $image - image src
  • int $border: - $border - border flag.
  • string $alt: - $alt - alt tag for the image
  • string $usemap: - $usemap - the image map name
  • string $title: - $align - the align attribute
html_img_remote (line 804)

This method is similar to html_img_local, but it assumes the image is on a remote server, so it won't prepent $_SERVER['DOCUMENT_ROOT'] to the getimagesize() call. This is purely a wrapper for html_img() eliminating the width, and height attributes.

  • return: object
IMGtag html_img_remote (string $image, [int $border = 0], [string $alt = ''], [string $usemap = NULL], [string $title = NULL], [mixed $align = NULL])
  • string $image: - $image - image src
  • int $border: - $border - border flag.
  • string $alt: - $alt - alt tag for the image
  • string $usemap: - $usemap - the image map name
  • string $title: - $align - the align attribute
html_input (line 851)

This builds an <input> object NOTE: This wrapper automatically calls htmlspecialchars() on the value attribute's data.

  • return: object.
INPUTtag html_input (string $type, string $name, [string $value = ''], [array $attributes = array()])
  • string $type: - the type attribute
  • string $name: - the name attribute
  • string $value: - the value attribute
  • array $attributes: - any other name=>value attributes for the tag
html_ins (line 865)

build a <ins> tag with some content.

  • return: object.
  • author: Walt A. Boring
INStag html_ins ([mixed 0 = - n number of arguments as content for the tag.])
  • mixed 0: - n number of arguments as content for the tag.
html_kbd (line 879)

build a

  • return: object.
KBDtag html_kbd ([mixed 0 = - n number of arguments as content for the tag.])
  • mixed 0: - n number of arguments as content for the tag.
html_label (line 896)

build a <label> tag with some content.

  • return: object.
LABELtag html_label ([string $for = ""], mixed 1)
  • mixed 1: - n number of arguments as content for the tag.
  • string $for: - the id of the form element to tie this label to.
html_legend (line 917)

build a <legend> tag with some content.

  • return: object.
LEGENDtag html_legend ([mixed 0 = - n number of arguments as content for the tag.])
  • mixed 0: - n number of arguments as content for the tag.
html_li (line 933)

build a <LI> tag with some content..

  • return: object.
  • author: Walt A. Boring
LItag html_li ([mixed 0 = - n number of arguments as content for the tag.])
  • mixed 0: - n number of arguments as content for the tag.
html_link (line 948)

build a <LINK> tag with some content..

  • return: object.
LINKtag html_link (string $href, string $rel, string $type)
  • string $href: - the href link
  • string $rel: - the rel attribute
  • string $type: - the type of content.
html_map (line 962)

build a <map> tag with some content.

  • return: object.
MAPtag html_map (string $name, mixed 1)
  • mixed 1: - n number of arguments as content for the tag.
  • string $name: - the name of the map.
html_meta (line 980)

build a <meta> tag..

  • return: object.
METAtag html_meta (string $content, [string $http_equiv = ""], [string $name = ""])
  • string $content: - the content value.
  • string $http_equiv: - the http-equiv value
  • string $name: - the name
html_noframes (line 1002)

build a <noframes> tag with some content..

  • return: object.
NOFRAMEStag html_noframes ([mixed 0 = - n number of arguments as content for the tag.])
  • mixed 0: - n number of arguments as content for the tag.
html_noscript (line 1016)

build a <noscript> tag with some content..

  • return: object.
NOSCRIPTtag html_noscript ([mixed 0 = - n number of arguments as content for the tag.])
  • mixed 0: - n number of arguments as content for the tag.
html_object (line 1030)

build a <object> tag with some content..

  • return: object.
OBJECTtag html_object ([mixed 0 = - n number of arguments as content for the tag.])
  • mixed 0: - n number of arguments as content for the tag.
html_ol (line 1044)

build a

  • return: object.
OLtag html_ol ([mixed 0 = - n number of arguments as content for the tag.])
  • mixed 0: - n number of arguments as content for the tag.
html_optgroup (line 1058)

build a <OPTGROUP> tag with some content..

  • return: object.
OPTGROUPtag html_optgroup (mixed $label)
  • mixed $label: - n number of arguments as content for the tag.
html_option (line 1075)

build a <OPTION> tag with some content..

  • return: object.
OPTIONtag html_option (string $value, string $content, [mixed $selected = FALSE])
  • string $value: - the value attribute
  • string $content: - the content for the tag.
html_p (line 1097)

build a <p> tag.

  • return: object.
Ptag html_p ([mixed 0 = - n number of arguments as content for the tag.])
  • mixed 0: - n number of arguments as content for the tag.
html_param (line 1110)

build a <param> tag.

  • return: object.
PARAMtag html_param (string $name, [mixed $value = ""])
  • string $name: - name of the tag
html_pre (line 1125)

build a

  • return: object.
PREtag html_pre ([mixed 0 = - n number of arguments as content for the tag.])
  • mixed 0: - n number of arguments as content for the tag.
html_q (line 1139)

build a <q> tag with some content..

  • return: object.
Qtag html_q ([mixed 0 = - n number of arguments as content for the tag.])
  • mixed 0: - n number of arguments as content for the tag.
html_samp (line 1153)

build a

  • return: object.
SAMPtag html_samp ([mixed 0 = - n number of arguments as content for the tag.])
  • mixed 0: - n number of arguments as content for the tag.
html_script (line 1167)

build a <script> tag with some content..

  • return: object.
SCRIPTtag html_script ([src $src = ""], [string $type = "text/javascript"])
  • src $src: - the src
  • string $type: - type of script
html_small (line 1188)

build a small <small> tag with content.

  • return: object.
  • author: Suren Markossian
SMALLtag html_small ()
html_span (line 1205)

build a bold <span> tag with content.

  • return: object.
SPANtag html_span ([string $class = ""], mixed 1)
  • mixed 1: - n number of arguments as content for the tag.
  • string $class: - the class for the span.
html_strong (line 1225)

build a <strong> tag with some content..

  • return: object.
STRONGtag html_strong ([mixed 0 = - n number of arguments as content for the tag.])
  • mixed 0: - n number of arguments as content for the tag.
html_style (line 1243)

build a <style> tag with some content.

  • return: object.
STYLEtag html_style ([string $type = "text/css"], mixed 1)
  • mixed 1: - n number of arguments as content for the tag.
  • string $type: - the type text/css (DEFAULT), text/javasript
html_sub (line 1259)

build a <sub> tag with some content..

  • return: object.
SUBtag html_sub ([mixed 0 = - n number of arguments as content for the tag.])
  • mixed 0: - n number of arguments as content for the tag.
html_sup (line 1273)

build a <sup> tag with some content..

  • return: object.
SUPtag html_sup ([mixed 0 = - n number of arguments as content for the tag.])
  • mixed 0: - n number of arguments as content for the tag.
html_table (line 1297)

Build a TABLEtag object with some of the attributes set

  • return: object.
TABLEtag html_table ([mixed $width = "100%"], [mixed $border = "0"], [mixed $cellspacing = "0"], [mixed $cellpadding = "0"], [string $align = NULL])
  • mixed $width: - width attribute default: 100%
  • mixed $border: - border default: 0
  • mixed $cellspacing: - cellspacing default: 0
  • mixed $cellpadding: - cellpadding default: 0
  • string $align: - align the align attribute default: not set.
html_tbody (line 1319)

build a <tbody> tag with some content..

  • return: object.
TBODYtag html_tbody ([mixed 0 = - n number of arguments as content for the tag.])
  • mixed 0: - n number of arguments as content for the tag.
html_td (line 1338)

build an td tag object with content.

  • return: object.
TDtag html_td ([string $class = ""], [string $align = ""], mixed 2)
  • mixed 2: - n number of arguments as content for the tag.
  • string $class: - the class to use
  • string $align: - the alignment left, right
html_tfoot (line 1362)

build a <tfoot> tag with content.

  • return: object.
TFOOTtag html_tfoot ([mixed 0 = - n number of arguments as content for the tag.])
  • mixed 0: - n number of arguments as content for the tag.
html_th (line 1377)

build a <th>$header</th> tag.

  • return: object.
THtag html_th ([mixed 0 = - n number of arguments as content for the tag.])
  • mixed 0: - n number of arguments as content for the tag.
html_thead (line 1391)

build a <thhead> tag.

  • return: object.
THEADtag html_thead ([mixed 0 = - n number of arguments as content for the tag.])
  • mixed 0: - n number of arguments as content for the tag.
html_title (line 1407)

build a <title> tag with some content.

  • return: object.
  • author: Walt A. Boring
TITLEtag html_title ([mixed 0 = - n number of arguments as content for the tag.])
  • mixed 0: - n number of arguments as content for the tag.
html_tr (line 1422)

build a <tr> tag and contents

  • return: object.
TRtag html_tr ([string $class = ""], mixed 1)
  • mixed 1: - n number of arguments as content for the tag.
  • string $class: - class
html_tt (line 1443)

build a <tt> tag and contents

  • return: object.
TTtag html_tt ([mixed 0 = - n number of arguments as content for the tag.])
  • mixed 0: - n number of arguments as content for the tag.
html_u (line 1457)

build a <u> tag and contents

  • return: object.
Utag html_u ([mixed 0 = - n number of arguments as content for the tag.])
  • mixed 0: - n number of arguments as content for the tag.
html_ul (line 1474)

build a

  • return: object.
  • author: Walt A. Boring
ULtag html_ul ([mixed 0 = - n number of arguments as content for the tag.])
  • mixed 0: - n number of arguments as content for the tag.
html_var (line 1488)

build a

  • return: object.
VARtag html_var ([mixed 0 = - n number of arguments as content for the tag.])
  • mixed 0: - n number of arguments as content for the tag.
html_xmp (line 1504)

build a <xmp> tag with some content..

  • return: object.
  • author: Walt A. Boring
XMPtag html_xmp ([mixed 0 = - n number of arguments as content for the tag.])
  • mixed 0: - n number of arguments as content for the tag.
mailto (line 1524)

build a mailto url link .

  • return: object.
  • author: Walt A. Boring
CENTERtag mailto (string $email, [string $subject = NULL], [string $body = NULL], [string $cc = NULL])
  • string $email: - the email address for the mailto
  • string $subject: - the subject for the email
  • string $body: - the body conent for the email
  • string $cc: = the cc email address.

Documentation generated on Wed, 11 May 2005 18:19:17 -0700 by phpDocumentor 1.3.0RC3