/functions/html.php

Description

html.php

The idea is to inlcude here some functions to make easier the right to left implementation by "functionize" some html outputs.

Functions
create_body (line 224)

Generates an opening body tag

  • return: The desired body tag.
  • since: 1.5.2
string create_body ([string $onload = ''], [string $class = ''], [array $aAttribs = array()])
  • string $onload: Body onload JavaScript handler code (OPTIONAL; default not used)
  • string $class: The CSS class name (OPTIONAL; default not used)
  • array $aAttribs: Any extra attributes: this must be an associative array, where keys will be added as the attribute name, and values (which are optional - should be null if none should be used) will be placed in double quotes (pending template implementation) as the attribute value (OPTIONAL; default empty).
create_hyperlink (line 44)

Generates a hyperlink

  • return: The desired hyperlink tag.
  • since: 1.5.2
string create_hyperlink (string $uri, string $text, [string $target = ''], [string $onclick = ''], [string $class = ''], [string $id = ''], [string $name = ''], [array $aAttribs = array()])
  • string $uri: The target link location
  • string $text: The link text
  • string $target: The location where the link should be opened (OPTIONAL; default not used)
  • string $onclick: The onClick JavaScript handler (OPTIONAL; default not used)
  • string $class: The CSS class name (OPTIONAL; default not used)
  • string $id: The ID name (OPTIONAL; default not used)
  • string $name: The anchor name (OPTIONAL; default not used)
  • array $aAttribs: Any extra attributes: this must be an associative array, where keys will be added as the attribute name, and values (which are optional - should be null if none should be used) will be placed in double quotes (pending template implementation) as the attribute value (OPTIONAL; default empty).
create_image (line 108)

Generates an image tag

  • return: The desired hyperlink tag.
  • since: 1.5.2
string create_image (string $src, [string $alt = ''], [string $width = ''], [string $height = ''], [string $border = ''], [string $class = ''], [string $id = ''], [string $onclick = ''], [string $title = ''], [string $align = ''], [string $hspace = ''], [string $vspace = ''], [string $text_alternative = ''], [array $aAttribs = array()])
  • string $src: The image source path
  • string $alt: Alternate link text (OPTIONAL; default not used)
  • string $width: The width the image should be shown in (OPTIONAL; default not used)
  • string $height: The height the image should be shown in (OPTIONAL; default not used)
  • string $border: The image's border attribute value (OPTIONAL; default not used)
  • string $class: The CSS class name (OPTIONAL; default not used)
  • string $id: The ID name (OPTIONAL; default not used)
  • string $onclick: The onClick JavaScript handler (OPTIONAL; default not used)
  • string $title: The image's title attribute value (OPTIONAL; default not used)
  • string $align: The image's alignment attribute value (OPTIONAL; default not used)
  • string $hspace: The image's hspace attribute value (OPTIONAL; default not used)
  • string $vspace: The image's vspace attribute value (OPTIONAL; default not used)
  • string $text_alternative: A text replacement for the entire image tag, to be used at the discretion of the template set, if for some reason the image tag cannot or should not be produced (OPTIONAL; default not used)
  • array $aAttribs: Any extra attributes: this must be an associative array, where keys will be added as the attribute name, and values (which are optional - should be null if none should be used) will be placed in double quotes (pending template implementation) as the attribute value (OPTIONAL; default empty).
create_label (line 155)

Generates a label tag

  • return: The desired label tag.
  • since: 1.5.2
string create_label (string $value, [string $for = ''], [array $aAttribs = array()])
  • string $value: The contents that belong inside the label
  • string $for: The ID to which the label applies (OPTIONAL; default not used)
  • array $aAttribs: Any extra attributes: this must be an associative array, where keys will be added as the attribute name, and values (which are optional - should be null if none should be used) will be placed in double quotes (pending template implementation) as the attribute value (OPTIONAL; default empty).
create_span (line 189)

Generates a span tag

  • return: The desired span tag.
  • since: 1.5.2
string create_span (string $value, [string $class = ''], [string $id = ''], [array $aAttribs = array()])
  • string $value: The contents that belong inside the span
  • string $class: The CSS class name (OPTIONAL; default not used)
  • string $id: The ID name (OPTIONAL; default not used)
  • array $aAttribs: Any extra attributes: this must be an associative array, where keys will be added as the attribute name, and values (which are optional - should be null if none should be used) will be placed in double quotes (pending template implementation) as the attribute value (OPTIONAL; default empty).
html_tag (line 250)

Generates html tags

  • return: HTML ready for output
  • since: 1.3.0
string html_tag (string $tag, [string $val = ''], [string $align = ''], [string $bgcolor = ''], [string $xtra = ''])
  • string $tag: Tag to output
  • string $val: Value between tags
  • string $align: Alignment (left, center, etc)
  • string $bgcolor: Back color in hexadecimal
  • string $xtra: Extra options
set_uri_vars (line 340)

This function is used to add, modify or delete more than one GET variable at a time in a URL. This simply takes an array of variables (key/value pairs) and passes them one at a time to set_url_var.

Note that the value for any one of the variables may be an array, and it will be handled properly.

As with set_url_var, any of the variable values may be set to NULL to remove it from the URI.

Also, to ensure compatibility with older versions, use $val='0' to set $var to 0.

  • return: The modified URI
  • since: 1.5.2
string set_uri_vars (string $uri, array $values, [boolean $sanitize = TRUE])
  • string $uri: URI that must be modified
  • array $values: List of GET variable names and their values
  • boolean $sanitize: Controls sanitizing of ampersand in URIs
set_url_var (line 375)

This function is used to add, modify or delete GET variables in a URL.

It is especially useful when $url = $PHP_SELF

Set $val to NULL to remove $var from $url. To ensure compatibility with older versions, use $val='0' to set $var to 0.

  • return: modified url
  • since: 1.3.0
string set_url_var (string $url, string $var, [string $val = null], [boolean $link = true], [boolean $treat_as_array = false])
  • string $url: url that must be modified
  • string $var: GET variable name
  • string $val: variable value (CANNOT be an array)
  • boolean $link: controls sanitizing of ampersand in urls (since 1.3.2)
  • boolean $treat_as_array: When TRUE, if $var is an array (it occurs one or more times with square brackets after it, e.g. "var[1]"), the whole array will be removed (when $val is NULL) or the given value will be added to the next array slot (@since 1.4.23/1.5.2)

Documentation generated on Mon, 13 Jan 2020 04:22:41 +0100 by phpDocumentor 1.4.3