diff options
author | Christian Schneider | 2007-09-03 16:16:14 +0000 |
---|---|---|
committer | Christian Schneider | 2007-09-03 16:16:14 +0000 |
commit | e8eae647761d294a4b6c09bd8ac7afce88e87db5 (patch) | |
tree | c519d17e897f50a747a97e0aacffab267378626b | |
parent | ad0a7f85a2328837dfde92974979809121e76c40 (diff) | |
download | itools-e8eae647761d294a4b6c09bd8ac7afce88e87db5.tar.gz itools-e8eae647761d294a4b6c09bd8ac7afce88e87db5.tar.bz2 itools-e8eae647761d294a4b6c09bd8ac7afce88e87db5.zip |
Make default xhtml again, added configure()
-rw-r--r-- | it_html.class | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/it_html.class b/it_html.class index 7acaa69..76152d9 100644 --- a/it_html.class +++ b/it_html.class @@ -31,7 +31,7 @@ class it_html * Create a HTML object and global functions for all methods (exlcluding * methods starting with '_') in this class plus the default tags (see below). * - * @param $p Configuration settings. Can be set/overridden in constructor, html() or head(). + * @param $p Configuration settings. Can be set/overridden in constructor, configure(), html() or head(). * See source code for a list of supported values */ function it_html($p = array()) @@ -40,13 +40,13 @@ function it_html($p = array()) $this->p = $p + array( 'charset' => 'iso-8859-1', 'doctype' => null, # Custom doctype (will usually be calculated from htmltype) - 'htmltype' => 'html', # 'html' (=old-style), 'xhtml' or 'xhtml-mobile' + 'htmltype' => 'xhtml', # 'html' (=old-style), 'xhtml' or 'xhtml-mobile' 'lang' => 'de', # Language code to use in <html lang="..."> tag 'ie_png_fix' => false, # To enable, supply URL of a transparent gif (like /images/0.gif) 'moretags' => '', # Comma-separated list of tag-functions to generate additionally to 'tags' - 'name' => 'it_html', # Name of global variable $this is assigned to (string) + 'name' => 'it_html', # Name of global variable $this is assigned to (string), XXX Copy and paste in configure() to keep PHP4 compatibility 'nonewlinetags' => 'a,b,em,img,input,span', # tags that do not like newlines after them - 'notexported' => 'sanitize', # Those methods are not exported + 'notexported' => 'configure,sanitize', # Those methods are not exported 'prettyprint' => false, # Should output be prettily indented? 'show_boot_dom' => false, # If true, append invisible <div id="it_boot_dom"> at the end of body 'show_content_type' => true, # If true, add <meta http-equiv="Content-Type" ...> header @@ -96,6 +96,17 @@ function it_html($p = array()) /** + * Modify configuration of it_html, e.g. htmltype after it was instantiated. + * @param $p Configuration settings. Can be set/overridden in constructor, configure(), html() or head(). + * See constructor for a list of supported values + */ +function configure($p) +{ + $p += array('name' => "it_html"); # XXX Copy and paste from constructor to keep PHP4 compatibility + $GLOBALS[$p['name']]->p = $p + (array)$GLOBALS[$p['name']]->p; +} + +/** * Return doctype and entire HTML page. * Example application code to render page: * echo html(head(...), body(...)); |