'format_container_chunk', 'author' => 'div', 'authorgroup' => 'div', /* DocBook-xsl prints out "by" (i.e. "PHP Manual by ...") */ 'appendix' => 'format_container_chunk', 'application' => 'span', 'bibliography' => array( /* DEFAULT */ 'div', 'article' => 'format_chunk', 'book' => 'format_chunk', 'part' => 'format_chunk', ), 'book' => 'format_container_chunk', 'chapter' => 'format_container_chunk', 'colophon' => 'format_chunk', 'firstname' => 'span', 'surname' => 'span', 'othername' => 'span', 'honorific' => 'span', 'glossary' => array( /* DEFAULT */ 'div', 'article' => 'format_chunk', 'book' => 'format_chunk', 'part' => 'format_chunk', ), 'classname' => 'span', 'code' => 'code', 'collab' => 'span', 'collabname' => 'span', 'command' => 'span', 'computeroutput' => 'span', 'constant' => 'span', 'emphasis' => 'em', 'enumname' => 'span', 'entry' => array ( /* DEFAULT */ 'format_entry', 'row' => array( /* DEFAULT */ 'format_entry', 'thead' => 'format_th_entry', 'tfoot' => 'format_th_entry', 'tbody' => 'format_entry', ), ), 'envar' => 'span', 'filename' => 'span', 'glossterm' => 'span', 'holder' => 'span', 'index' => array( /* DEFAULT */ 'div', 'article' => 'format_chunk', 'book' => 'format_chunk', 'part' => 'format_chunk', ), 'info' => 'div', 'informaltable' => 'table', 'itemizedlist' => 'ul', 'listitem' => array( /* DEFAULT */ 'li', 'varlistentry' => 'format_varlistentry_listitem', ), 'literal' => 'span', 'mediaobject' => 'div', 'methodparam' => 'span', 'member' => 'li', 'note' => 'div', 'option' => 'span', 'orderedlist' => 'ol', 'para' => 'p', 'parameter' => 'tt', 'part' => 'format_container_chunk', 'partintro' => 'div', 'personname' => 'span', 'preface' => 'format_chunk', 'productname' => 'span', 'propname' => 'span', 'property' => 'span', 'proptype' => 'span', 'refentry' => 'format_chunk', 'reference' => 'format_container_chunk', 'sect1' => 'format_chunk', 'sect2' => 'format_chunk', 'sect3' => 'format_chunk', 'sect4' => 'format_chunk', 'sect5' => 'format_chunk', 'section' => 'format_chunk', 'set' => 'format_chunk', 'setindex' => 'format_chunk', 'simplelist' => 'ul', 'simpara' => 'p', 'systemitem' => 'format_systemitem', 'table' => 'format_table', 'term' => 'span', 'tfoot' => 'format_th', 'thead' => 'format_th', 'title' => array( /* DEFAULT */ 'h1', 'legalnotice' => 'h4', 'section' => 'h2', 'sect1' => 'h2', 'sect2' => 'h3', 'sect3' => 'h4', 'refsect1' => 'h3', 'example' => 'h4', 'note' => 'h4', ), 'type' => 'format_type', 'userinput' => 'format_userinput', 'variablelist' => 'format_variablelist', 'varlistentry' => 'format_varlistentry', 'varname' => 'var', 'xref' => 'format_link', 'year' => 'span', ); /* }}} */ protected $CURRENT_ID = ""; protected $ext = "html"; public function __construct(PhDReader $reader, array $IDs, array $IDMap, $ext = "html") { parent::__construct($reader, $IDs, $IDMap, $ext); } /* Overwrite PhDFormat::readContent() to convert special HTML chars */ public function readContent($content = null) { return htmlspecialchars(PhDFormat::readContent($content), ENT_QUOTES, "UTF-8"); } public function __call($func, $args) { if ($args[0]) { trigger_error("No mapper found for '{$func}'", E_USER_WARNING); return "{$args[1]}"; } return "/{$args[1]}"; } public function transformFromMap($open, $tag, $name) { if ($open) { return sprintf('<%s class="%s">', $tag, $name); } return "$tag>"; } public function CDATA($str) { return sprintf('
', $name);
}
return "\n";
}
public function format_systemitem($open, $name) {
if ($open) {
switch($this->readAttribute("role")) {
case "directive":
/* FIXME: Different roles should probably be handled differently */
default:
return sprintf('', $name);
}
}
return "\n";
}
public function format_type($open, $name) {
$type = $this->readContent($name);
$t = strtolower($type);
$href = $fragment = "";
switch($t) {
case "bool":
$href = "language.types.boolean";
break;
case "int":
$href = "language.types.integer";
break;
case "double":
$href = "language.types.float";
break;
case "boolean":
case "integer":
case "float":
case "string":
case "array":
case "object":
case "resource":
case "null":
$href = "language.types.$t";
break;
case "mixed":
case "number":
case "callback":
$href = "language.pseudo-types";
$fragment = "language.types.$t";
break;
}
if ($href) {
return sprintf('%5$s', $href, $this->ext, ($fragment ? "#$fragment" : ""), $name, $type);
}
return sprintf('%2$s', $name, $type);
}
public function format_table($open, $name) {
if ($open) {
return '