From eaeb6b586db5a06c7d2f91d7f8b8e259be5bea22 Mon Sep 17 00:00:00 2001 From: Christian Weber Date: Fri, 31 Aug 2007 18:04:03 +0000 Subject: Fix title, simplified u() --- it_html.class | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) (limited to 'it_html.class') diff --git a/it_html.class b/it_html.class index af31ee5..79ba540 100644 --- a/it_html.class +++ b/it_html.class @@ -54,6 +54,7 @@ function it_html($p = array()) 'staticallycallable' => 'q,u,select', # Those methods are statically callable (have same arguments as global stubs) but are a bit slower 'use_it_state' => false, # If true, generate code needed by state.js (aka 'history iframe') 'tags' => 'a,b,br,button,div,em,form,h1,h2,h3,h4,h5,h6,hr,input,label,li,meta,p,span,table,td,textarea,th,tr,ul', + 'title' => '', # HTML title (default: empty title) ); # We know these doctypes. If you need something else, supply 'doctype' in p @@ -122,7 +123,6 @@ function html($args) * 'keywords' optional data for tag * 'lang' optional language (defaults to 'de') * 'stylesheets' optional array mediatype => url of styleshests - * 'title' optional HTML title tag (default: empty title) */ function head($args = array()) { @@ -131,10 +131,7 @@ function head($args = array()) list($data, $p) = $this->_parse_args($args); $p += $this->p; - $this->p = $p += array( - 'content-type' => "text/html; charset={$p['charset']}", - 'title' => tag('title', Q($p['title'])) - ); + $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'])) : ""; @@ -152,6 +149,8 @@ function head($args = array()) if (!empty($p['cssinline'])) $header .= tag('style', array('type' => "text/css", "\n" . preg_replace(array('/\s*\/\*[^\*]+\*\//Um', '/\s*\{\s*/', '/;\s+/'), array('', '{', ';'), $p['cssinline']))); + $header .= tag('title', Q($p['title'])); + if($this->p['htmltype'] == "xhtml-mobile" && strpos($_SERVER['HTTP_USER_AGENT'], 'W3C_Validator')) header("Content-Type: application/xhtml+xml; charset={$this->p['charset']}"); # for validation else if (!headers_sent()) # prevent warnings when ED() in use @@ -437,24 +436,7 @@ function q($string) function u(/* ... */) { $args = func_get_args(); - $base = null; - $params = array(); - - foreach($args as $arg) - { - if (is_array($arg)) - { - foreach ($arg as $key => $value) - { - if (is_int($key)) - $base .= $value; - else - $params[$key] = $value; - } - } - else - $base .= $arg; - } + list($base, $params) = it_html::_parse_args($args); if (!isset($base)) $base = $_SERVER['PHP_SELF']; -- cgit v1.2.3