26 public function register($doctype, $xml =
true, $modules = array(),
27 $tidy_modules = array(),
$aliases = array(), $dtd_public = null, $dtd_system = null
29 if (!is_array($modules)) $modules = array($modules);
30 if (!is_array($tidy_modules)) $tidy_modules = array($tidy_modules);
32 if (!is_object($doctype)) {
34 $doctype, $xml, $modules, $tidy_modules,
$aliases, $dtd_public, $dtd_system
37 $this->doctypes[$doctype->name] = $doctype;
38 $name = $doctype->name;
40 foreach ($doctype->aliases as $alias) {
41 if (isset($this->doctypes[$alias]))
continue;
42 $this->aliases[$alias] = $name;
45 if (isset($this->aliases[$name])) unset($this->aliases[$name]);
56 public function get($doctype) {
57 if (isset($this->aliases[$doctype])) $doctype = $this->aliases[$doctype];
58 if (!isset($this->doctypes[$doctype])) {
59 trigger_error(
'Doctype ' . htmlspecialchars($doctype) .
' does not exist', E_USER_ERROR);
63 return $this->doctypes[$doctype];
83 $doctype =
$config->get(
'HTML.Doctype');
84 if (!empty($doctype))
return $doctype;
85 $doctype =
$config->get(
'HTML.CustomDoctype');
86 if (!empty($doctype))
return $doctype;
88 if (
$config->get(
'HTML.XHTML')) {
89 $doctype =
'XHTML 1.0';
91 $doctype =
'HTML 4.01';
93 if (
$config->get(
'HTML.Strict')) {
94 $doctype .=
' Strict';
96 $doctype .=
' Transitional';