From 33e8695833b94fd1c83e37d7c7de9ced4edbb673 Mon Sep 17 00:00:00 2001
From: Christian Schneider
Date: Tue, 30 Sep 2014 14:14:04 +0200
Subject: Add $p["class"] support to add class to html tag, document class and
 manifest parameter

---
 it_html.class | 7 ++++---
 1 file 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;
 }
-- 
cgit v1.2.3