Class html

Description

Experimental html output class

Located in /nasmail/class/html.class.php (line 19)


	
			
Variable Summary
 string $class
 array $html_el
 string $id
 array $javascript
 string|array $style
 string $tag
 string $text
 array $xtr_prop
Method Summary
 void html ([string $tag = ''], [string $text = ''], [string|array $style = ''], [string $class = ''], [string $id = ''], [array $xtr_prop = ''], [array $javascript = ''])
 void AddChild ([string $tag = ''], [string $text = ''], [string|array $style = ''], [string $class = ''], [string $id = ''], [array $xtr_prop = ''], [array $javascript = ''])
 void echoHtml ([boolean $usecss = false], [string $indent = 'x'])
 boolean|object html FindId (string $id)
 void htmlAdd (object html $el, [boolean $last = true])
 void InsToId (object html $el, string $id, [boolean $last = true])
 void scriptAdd ( $script, string $string)
Variables
string $class = '' (line 40)
  • var: class assigned to html object
array $html_el = array() (line 48)
  • var: nested html objects
string $id = '' (line 44)
  • var: id assigned to html object
array $javascript = '' (line 54)

Keys should store javascript events (onclick, onmouseover and others).

Values should store javascript call without trailing semicolon

  • var: JavaScript events
string|array $style = '' (line 36)

If array is used, keys should store html elements and values should control closing of these elements.

For example: array('b'=>true,'img src="../images/plus.png"'=>false) add bold tag and close it. also add img tag and don't close it

  • var: style attributes
string $tag = '' (line 23)
  • var: html element in lowercase
string $text = '' (line 28)

If tag is not pre or code, text is automatically wordwrapped at 75 bytes and indented

  • var: text
array $xtr_prop = '' (line 60)

Key should contain property name and value should contain value.

If key is integer, only value is printed

  • var: extra properties
Methods
Constructor html (line 73)

Constructor function

void html ([string $tag = ''], [string $text = ''], [string|array $style = ''], [string $class = ''], [string $id = ''], [array $xtr_prop = ''], [array $javascript = ''])
  • string $tag: html element. It is automatically converted to lowercase.
  • string $text
  • string|array $style: style attributes
  • string $class: style class
  • string $id: object id
  • array $xtr_prop: extra properties
  • array $javascript: JavaScript events
AddChild (line 115)

Adds nested html element

void AddChild ([string $tag = ''], [string $text = ''], [string|array $style = ''], [string $class = ''], [string $id = ''], [array $xtr_prop = ''], [array $javascript = ''])
  • string $tag: html element
  • string $text
  • string|array $style: style attributes
  • string $class: style class
  • string $id: object id
  • array $xtr_prop: extra properties
  • array $javascript: JavaScript events
echoHtml (line 181)

Prints html object

void echoHtml ([boolean $usecss = false], [string $indent = 'x'])
  • boolean $usecss: controls use of style attributes and elements. If option is set to true, custom styles are not added and formating depends only on class tags.
  • string $indent: initial identation string. If set to 'x', identation is not used
FindId (line 127)

Locate nested object

  • return: object with selected id. boolean false, if object does not exist.
boolean|object html FindId (string $id)
  • string $id: object id
htmlAdd (line 91)
void htmlAdd (object html $el, [boolean $last = true])
  • object html $el: added html object
  • boolean $last: Inserts object as first nested object (false) or as last one (true)
InsToId (line 152)

Adds nested objects to selected child object

void InsToId (object html $el, string $id, [boolean $last = true])
  • object html $el
  • string $id
  • boolean $last: Inserts object as first nested object (false) or as last one (true)
scriptAdd (line 164)

Adds html script element

void scriptAdd ( $script, string $string)
  • string $string: JavaScript. html tags and comments are added automatically
  • $script

Documentation generated on Sun, 22 Nov 2009 17:36:37 +0200 by phpDocumentor 1.4.3