diff options
-rw-r--r-- | it_html.class | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/it_html.class b/it_html.class index ec24da6..7ab25a2 100644 --- a/it_html.class +++ b/it_html.class @@ -150,17 +150,18 @@ function configure($p) * * @param any number of text args or array of key => value pairs * Defaults for key => value parameters are inherited from the it_html constructor and should be set there. - * The parameters are $p['lang'], $p['htmltype'] and $p['doctype'] + * The parameters are $p['lang'], $p['htmltype'], $p['doctype'], $p['class'] and $p['manifest'] */ function html($args) { list($data, $p) = it_parse_args($args); $p += $this->p; - $manifest = $p['manifest'] ? ' manifest="' . Q($p['manifest']) . '"' : ""; + foreach (array('class', 'manifest') as $attr) + $attrs .= $p[$attr] ? " $attr=" . '"' . Q($p[$attr]) . '"' : ""; $html = ($p['doctype'] ? $p['doctype'] : $this->doctypes[$p['htmltype']]) . "\n" . - '<html ' . ($p['htmltype'] == "xhtml" ? 'xmlns="http://www.w3.org/1999/xhtml" ' : '') . ($p['htmltype'] == "xhtml-mobile" ? 'xml:lang' : 'lang') . "=\"{$p['lang']}\"$manifest>\n" . $data . ($p['omit_endhtml'] ? '' : "</html>\n"); + '<html ' . ($p['htmltype'] == "xhtml" ? 'xmlns="http://www.w3.org/1999/xhtml" ' : '') . ($p['htmltype'] == "xhtml-mobile" ? 'xml:lang' : 'lang') . "=\"{$p['lang']}\"$attrs>\n" . $data . ($p['omit_endhtml'] ? '' : "</html>\n"); return EDC('upd') ? it::replace(array('<!DOCTYPE.*<head>' => ''), $html, array('singleline' => true)) : $html; } |