summaryrefslogtreecommitdiff
path: root/it_html.class
diff options
context:
space:
mode:
Diffstat (limited to 'it_html.class')
-rw-r--r--it_html.class11
1 files changed, 6 insertions, 5 deletions
diff --git a/it_html.class b/it_html.class
index 4b9dcf5..fbab0db 100644
--- a/it_html.class
+++ b/it_html.class
@@ -69,7 +69,7 @@ function it_html($p = array())
'charset' => ini_get('default_charset') ?: 'iso-8859-1',
'doctype' => null, # Custom doctype (will usually be calculated from htmltype)
'head' => '', # Code to put into head() section
- 'htmltype' => 'xhtml', # 'html' (=old-style), 'xhtml' or 'xhtml-mobile'
+ 'htmltype' => 'html5', # 'html5', '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'
@@ -90,6 +90,7 @@ function it_html($p = array())
# We know these doctypes. If you need something else, supply 'doctype' in p
$this->doctypes = array(
+ 'html5' => '<!DOCTYPE html>',
'html' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">',
'xhtml' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',
'xhtml-mobile' => '<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">'
@@ -181,7 +182,7 @@ function head($args = array())
$p += $this->p;
$this->p = ($p += array('content-type' => "text/html; charset={$p['charset']}"));
- $header = $p['show_content_type'] ? meta(array('http-equiv' => "Content-Type", 'content' => $p['content-type'])) : "";
+ $header = $p['show_content_type'] ? meta($p['htmltype'] == "html5" ? array('charset' => $p['charset']) : array('http-equiv' => "Content-Type", 'content' => $p['content-type'])) : "";
# Enable latest IE mode
if(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE'))
@@ -305,13 +306,13 @@ function _tag($name, $args)
$result .= " $key=\"$value\"";
}
else # true: tag without value
- $result .= ($this->p['htmltype'] == 'html') ? " $key" : " $key=\"$key\"";
+ $result .= ($this->p['htmltype'][0] != 'x') ? " $key" : " $key=\"$key\"";
}
# Apply a kind of magic... this needs further investigation
if (isset($data) || isset($this->alwaysclose[$name]))
$result .= ">$data</$name>$newline";
- elseif ($this->p['htmltype'] == 'html')
+ elseif ($this->p['htmltype'][0] != 'x')
$result .= ">$newline";
else
$result .= " />$newline";
@@ -556,7 +557,7 @@ static function U(/* ... */)
*/
function js($args)
{
- if (($this->p['htmltype'] != 'html') && $args[0] && ((array)$args[0] === array_values((array)$args[0])))
+ if (($this->p['htmltype'][0] == 'x') && $args[0] && ((array)$args[0] === array_values((array)$args[0])))
{
array_unshift($args, "<!--//--><![CDATA[//><!--\n");
$args[] = "\n//--><!]]>";