function doStartTag() { parent::doStartTag(); if (!$this->getAncestorByClassName('wallelementdocument')) { trigger_error("tag 'head' must be nested inside a 'document' tag", E_USER_ERROR); } if (defined('WALL_USE_TERA_WURFL') && WALL_USE_TERA_WURFL && TERA_WURFL_VERSION >= 2) { $this->uplink = TagUtil::isUpLink($this->_wall->wurfl->userAgent); } else { $this->uplink = TagUtil::isUpLink($this->_wall->wurfl->user_agent); } if (strpos($this->preferred_markup, 'xhtmlmp') !== false || strpos($this->preferred_markup, 'chtml') !== false) { if (strpos($this->preferred_markup, 'xhtmlmp') !== false) { $this->writeln('<html xmlns="http://www.w3.org/1999/xhtml">'); } else { $this->writeln('<html>'); } $this->write('<head>'); } else { if (strpos($this->preferred_markup, 'wml') !== false) { $this->writeln('<wml>'); $this->write('<head>'); } } }
function doStartTag() { parent::doStartTag(); if (defined('WALL_USE_TERA_WURFL') && WALL_USE_TERA_WURFL && TERA_WURFL_VERSION >= 2) { $this->uplink = TagUtil::isUpLink($this->_wall->wurfl->userAgent); } else { $this->uplink = TagUtil::isUpLink($this->_wall->wurfl->user_agent); } #header('X-test', $this->_wall->getCapa('xhtmlmp_preferred_mime_type')); if (strpos($this->preferred_markup, 'xhtmlmp') !== false) { if (!defined('WALL_SUPRESS_HEADERS') || !WALL_SUPRESS_HEADERS) { $hdr = $this->_wall->getCapa('xhtmlmp_preferred_mime_type'); $chr = $this->_wall->getCapa('xhtml_preferred_charset'); # error_log($chr); if ($chr && $chr != 'utf8') { $chr = false; } if (!$hdr) { $hdr = 'text/html'; } # error_log($this->_wall->ua . ' gets Content-Type: ' . $hdr . ($chr ? '; charset=' . $chr : '')); #header('Content-Type: ' . $hdr . ($chr ? '; charset=' . $chr : '')); header('Content-Type: ' . $hdr); } $this->_wall->use_xhtml_extensions = !$this->disable_xhtml_extensions && $this->uplink && $this->_wall->getCapa('opwv_xhtml_extensions_support'); } else { if (strpos($this->preferred_markup, 'wml') !== false) { if (!defined('WALL_SUPRESS_HEADERS') || !WALL_SUPRESS_HEADERS) { error_log($this->_wall->ua . ' gets Content-Type: text/vnd.wap.wml; charset=utf-8'); header('Content-Type: text/vnd.wap.wml; charset=utf-8'); } $this->_wall->use_wml_extensions = !$this->disable_wml_extensions && $this->uplink && $this->_wall->getCapa('opwv_wml_extensions_support'); } else { if (strpos($this->preferred_markup, 'chtml') !== false) { if (!defined('WALL_SUPRESS_HEADERS') || !WALL_SUPRESS_HEADERS) { error_log($this->_wall->ua . ' gets Content-Type: text/html; charset=utf-8'); header('Content-Type: text/html; charset=utf-8'); } } else { trigger_error('No valid markup found: ' . $this->preferred_markup, E_USER_ERROR); } } } }