cvs: phd /phpdotnet/phd/Format/Abstract XHTML.php /phpdotnet/phd/Package/Default XHTML.php
| From: | Moacir de Oliveira Miranda Júnior | Date: | Sun, 05 Jul 2009 06:35:05 +0000 |
| Subject: | cvs: phd /phpdotnet/phd/Format/Abstract XHTML.php /phpdotnet/phd/Package/Default XHTML.php | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-4331@lists.php.net to get a copy of this message | ||
moacir Sun Jul 5 06:35:05 2009 UTC
Modified files:
/phd/phpdotnet/phd/Format/Abstract XHTML.php
/phd/phpdotnet/phd/Package/Default XHTML.php
Log:
chunk arrays now in the default xhtml
http://cvs.php.net/viewvc.cgi/phd/phpdotnet/phd/Format/Abstract/XHTML.php?r1=1.3&r2=1.4&diff_format=u Index: phd/phpdotnet/phd/Format/Abstract/XHTML.php diff -u phd/phpdotnet/phd/Format/Abstract/XHTML.php:1.3 phd/phpdotnet/phd/Format/Abstract/XHTML.php:1.4 --- phd/phpdotnet/phd/Format/Abstract/XHTML.php:1.3 Mon Jun 22 02:31:42 2009 +++ phd/phpdotnet/phd/Format/Abstract/XHTML.php Sun Jul 5 06:35:05 2009 @@ -19,40 +19,6 @@ protected $mediamanager = null; protected $lang = 'en'; - /* Current Chunk variables */ - protected $cchunk = array(); - /* Default Chunk variables */ - protected $dchunk = array( - "classsynopsis" => array( - "close" => false, - "classname" => false, - ), - "classsynopsisinfo" => array( - "implements" => false, - "ooclass" => false, - ), - "examples" => 0, - "fieldsynopsis" => array( - "modifier" => "public", - ), - "co" => 0, - "callouts" => 0, - "segmentedlist" => array( - "seglistitem" => 0, - "segtitle" => array( - ), - ), - "table" => false, - "procedure" => false, - "mediaobject" => array( - "alt" => false, - ), - "footnote" => array( - ), - "tablefootnotes" => array( - ), - ); - public function __construct() { parent::__construct(); parent::registerFormatName($this->formatname); @@ -94,10 +60,6 @@ } } - public function getChunkInfo() { - return $this->cchunk; - } - /* Functions from PhDThemeXhtml */ /** http://cvs.php.net/viewvc.cgi/phd/phpdotnet/phd/Package/Default/XHTML.php?r1=1.4&r2=1.5&diff_format=u Index: phd/phpdotnet/phd/Package/Default/XHTML.php diff -u phd/phpdotnet/phd/Package/Default/XHTML.php:1.4 phd/phpdotnet/phd/Package/Default/XHTML.php:1.5 --- phd/phpdotnet/phd/Package/Default/XHTML.php:1.4 Mon Jun 22 02:31:42 2009 +++ phd/phpdotnet/phd/Package/Default/XHTML.php Sun Jul 5 06:35:05 2009 @@ -8,6 +8,7 @@ 'acronym' => 'acronym', 'affiliation' => 'format_suppressed_tags', 'alt' => 'format_suppressed_tags', + 'arg' => 'format_suppressed_tags', 'article' => 'format_container_chunk_top', 'author' => array( /* DEFAULT */ 'format_author', @@ -18,7 +19,7 @@ 'application' => 'span', 'blockquote' => 'blockquote', 'bibliography' => array( - /* DEFAULT */ 'div', + /* DEFAULT */ 'format_div', 'article' => 'format_chunk', 'book' => 'format_chunk', 'part' => 'format_chunk', @@ -26,6 +27,7 @@ 'book' => 'format_container_chunk_top', 'chapter' => 'format_container_chunk_top', 'citetitle' => 'i', + 'cmdsynopsis' => 'format_cmdsynopsis', 'co' => 'format_co', 'colophon' => 'format_chunk', 'copyright' => 'format_copyright', @@ -46,7 +48,7 @@ 'optional' => 'span', 'honorific' => 'span', 'glossary' => array( - /* DEFAULT */ 'div', + /* DEFAULT */ 'format_div', 'article' => 'format_chunk', 'book' => 'format_chunk', 'part' => 'format_chunk', @@ -96,39 +98,39 @@ 'envar' => 'span', 'errortype' => 'span', 'errorcode' => 'span', - 'example' => 'div', + 'example' => 'format_div', 'formalpara' => 'p', 'fieldsynopsis' => array( /* DEFAULT */ 'format_fieldsynopsis', - 'entry' => 'div', + 'entry' => 'format_div', ), 'figure' => 'div', 'filename' => 'var', 'glossentry' => 'li', 'glossdef' => 'p', - 'glosslist' => 'ul', + 'glosslist' => 'format_itemizedlist', 'glossterm' => 'span', 'holder' => 'span', - 'imageobject' => 'div', + 'imageobject' => 'format_div', 'imagedata' => 'format_imagedata', 'important' => 'format_admonition', 'index' => array( - /* DEFAULT */ 'div', + /* DEFAULT */ 'format_div', 'article' => 'format_chunk', 'book' => 'format_chunk', 'part' => 'format_chunk', ), 'info' => array( - /* DEFAULT */ 'div', + /* DEFAULT */ 'format_div', 'note' => 'span', ), - 'informalexample' => 'div', - 'informaltable' => 'table', - 'indexdiv' => 'dl', + 'informalexample' => 'format_div', + 'informaltable' => 'format_table', + 'indexdiv' => 'format_dl', 'indexentry' => 'dd', 'initializer' => 'format_initializer', - 'itemizedlist' => 'ul', - 'legalnotice' => 'format_chunk', + 'itemizedlist' => 'format_itemizedlist', + 'legalnotice' => 'format_legalnotice_chunk', 'listitem' => array( /* DEFAULT */ 'li', 'varlistentry' => 'format_varlistentry_listitem', @@ -147,10 +149,10 @@ 'modifier' => 'span', 'note' => 'format_note', 'orgname' => 'span', - 'othercredit' => 'div', + 'othercredit' => 'format_div', 'ooclass' => array( /* DEFAULT */ 'span', - 'classsynopsis' => 'div', + 'classsynopsis' => 'format_div', ), 'oointerface' => array( /* DEFAULT */ 'span', @@ -158,7 +160,7 @@ ), 'interfacename' => 'span', 'option' => 'span', - 'orderedlist' => 'ol', + 'orderedlist' => 'format_orderedlist', 'para' => array( /* DEFAULT */ 'p', 'example' => 'format_example_content', @@ -173,9 +175,9 @@ 'methodparam' => 'format_methodparam_parameter', ), 'part' => 'format_container_chunk_top', - 'partintro' => 'div', + 'partintro' => 'format_div', 'personname' => 'format_personname', - 'personblurb' => 'div', + 'personblurb' => 'format_div', 'phrase' => 'span', 'preface' => 'format_chunk', 'primaryie' => 'format_suppressed_tags', @@ -189,7 +191,7 @@ 'classsynopsisinfo' => 'format_varname', ), 'proptype' => 'span', - 'pubdate' => 'div', /* Docbook-XSL prints "published" */ + 'pubdate' => 'format_div', /* Docbook-XSL prints "published" */ 'refentry' => 'format_chunk', 'refentrytitle' => 'span', 'refpurpose' => 'p', @@ -204,7 +206,8 @@ 'replaceable' => 'span', 'row' => 'format_row', 'screen' => 'format_screen', - 'sect1' => 'format_section_chunk', + 'screenshot' => 'format_div', + 'sect1' => 'format_chunk', 'sect2' => 'div', 'sect3' => 'div', 'sect4' => 'div', @@ -235,7 +238,7 @@ 'set' => 'format_container_chunk_top', 'setindex' => 'format_chunk', 'shortaffil' => 'format_suppressed_tags', - 'simplelist' => 'ul', /* FIXME: simplelists has few attributes that need to be implemented */ + 'simplelist' => 'format_itemizedlist', /* FIXME: simplelists has few attributes that need to be implemented */ 'simpara' => array( /* DEFAULT */ 'p', 'note' => 'span', @@ -280,6 +283,7 @@ 'indexdiv' => 'dt', 'legalnotice' => 'h4', 'note' => 'format_note_title', + 'phd:toc' => 'strong', 'procedure' => 'b', 'refsect1' => 'h3', 'refsect2' => 'h4', @@ -300,6 +304,7 @@ 'set' => 'format_container_chunk_top_title', ), 'titleabbrev' => 'format_suppressed_tags', + 'token' => 'tt', 'type' => 'span', 'userinput' => 'format_userinput', 'uri' => 'tt', @@ -370,7 +375,43 @@ 'titleabbrev' => 'format_suppressed_text', ); - //protected $flags; + /* Current Chunk variables */ + protected $cchunk = array(); + /* Default Chunk variables */ + private $dchunk = array( + "classsynopsis" => array( + "close" => false, + "classname" => false, + ), + "classsynopsisinfo" => array( + "implements" => false, + "ooclass" => false, + ), + "examples" => 0, + "fieldsynopsis" => array( + "modifier" => "public", + ), + "co" => 0, + "callouts" => 0, + "segmentedlist" => array( + "seglistitem" => 0, + "segtitle" => array( + ), + ), + "table" => false, + "procedure" => false, + "mediaobject" => array( + "alt" => false, + ), + "footnote" => array( + ), + "tablefootnotes" => array( + ), + "chunk_id" => null, + "varlistentry" => array( + "listitems" => array(), + ), + ); public function __construct() { parent::__construct(); @@ -384,6 +425,14 @@ return $this->mytextmap; } + public function getChunkInfo() { + return $this->cchunk; + } + + public function getDefaultChunkInfo() { + return $this->dchunk; + } + protected function createTOC($id, $lang) { if (!$this->getChildrens($id)) { return ""; @@ -762,7 +811,6 @@ return $this->TEXT($value); } - public function format_fieldsynopsis($open, $name, $attrs) { $this->cchunk["fieldsynopsis"] = $this->dchunk["fieldsynopsis"]; if ($open) { @@ -770,10 +818,12 @@ } return ";</div>\n"; } + public function format_fieldsynopsis_modifier_text($value, $tag) { $this->cchunk["fieldsynopsis"]["modifier"] = trim($value); return $this->TEXT($value); } + public function format_methodsynopsis($open, $name, $attrs) { if ($open) { $this->params = array("count" => 0, "opt" => 0, "content" => ""); @@ -1164,7 +1214,7 @@ } $this->cchunk["table"] = false; $str = ""; - if ($this->cchunk["tablefootnotes"]) { + if (isset($this->cchunk["tablefootnotes"]) && $this->cchunk["tablefootnotes"]) { $opts = array(Reader::XMLNS_DOCBOOK => array()); $str = $this->format_tbody(true, "footnote", $opts, $props); @@ -1334,4 +1384,101 @@ return '<<a href="mailto:' . $value . '">' . $value . '</a>>'; } + /** + * Functions from the old XHTMLPhDFormat + */ + public function format_legalnotice_chunk($open, $name, $attrs) { + if ($open) { + return '<div id="legalnotice">'; + } + return "</div>\n"; + } + + public function format_div($open, $name, $attrs, $props) { + if ($open) { + return '<div class="' . $name . '">'; + } + return '</div>'; + } + + public function format_screen_text($value, $tag) { + return nl2br($this->TEXT($value)); + } + + /** + * Renders a <tag class=""> tag. + * + * @return string HTML code + */ + public function format_tag($open, $name, $attrs, $props) { + static $arFixes = array( + 'attribute' => array('', ''), + 'attvalue' => array('"', '"'), + 'comment' => array('<!--', '-->'), + 'element' => array('', ''), + 'emptytag' => array('<', '/>'), + 'endtag' => array('</', '>'), + 'genentity' => array('&', ';'), + 'localname' => array('', ''), + 'namespace' => array('', ''), + 'numcharref' => array('&#', ';'), + 'paramentity' => array('%', ';'), + 'pi' => array('<?', '?>'), + 'prefix' => array('', ''), + 'starttag' => array('<', '>'), + 'xmlpi' => array('<?', '?>'), + ); + if ($props['empty']) { + return ''; + } + $class = $attrs['class']; + if (!isset($arFixes[$class])) { + trigger_error('Unknown tag class "' . $class . '"', E_USER_WARNING); + $class = 'starttag'; + } + if (!$open) { + return $arFixes[$class][1] . '</code>'; + } + + return '<code>' . $arFixes[$class][0]; + } + + public function format_dl($open, $name, $attrs, $props) { + if ($open) { + return '<dl class="' . $name . '">'; + } + return '</dl>'; + } + + public function format_itemizedlist($open, $name, $attrs, $props) { + if ($open) { + return '<ul class="' . $name . '">'; + } + return '</ul>'; + } + + public function format_orderedlist($open, $name, $attrs, $props) { + if ($open) { + $numeration = "1"; + if (isset($attrs[Reader::XMLNS_DOCBOOK]["numeration"])) { + switch($attrs[Reader::XMLNS_DOCBOOK]["numeration"]) { + case "upperalpha": + $numeration = "A"; + break; + case "loweralpha": + $numeration = "a"; + break; + case "upperroman": + $numeration = "I"; + break; + case "lowerroman": + $numeration = "i"; + break; + } + } + return '<ol type="' .$numeration. '">'; + } + return '</ol>'; + } + }
http://cvs.php.net/viewvc.cgi/phd/phpdotnet/phd/Format/Abstract/XHTML.php?r1=1.3&r2=1.4&diff_format=u Index: phd/phpdotnet/phd/Format/Abstract/XHTML.php diff -u phd/phpdotnet/phd/Format/Abstract/XHTML.php:1.3 phd/phpdotnet/phd/Format/Abstract/XHTML.php:1.4 --- phd/phpdotnet/phd/Format/Abstract/XHTML.php:1.3 Mon Jun 22 02:31:42 2009 +++ phd/phpdotnet/phd/Format/Abstract/XHTML.php Sun Jul 5 06:35:05 2009 @@ -19,40 +19,6 @@ protected $mediamanager = null; protected $lang = 'en'; - /* Current Chunk variables */ - protected $cchunk = array(); - /* Default Chunk variables */ - protected $dchunk = array( - "classsynopsis" => array( - "close" => false, - "classname" => false, - ), - "classsynopsisinfo" => array( - "implements" => false, - "ooclass" => false, - ), - "examples" => 0, - "fieldsynopsis" => array( - "modifier" => "public", - ), - "co" => 0, - "callouts" => 0, - "segmentedlist" => array( - "seglistitem" => 0, - "segtitle" => array( - ), - ), - "table" => false, - "procedure" => false, - "mediaobject" => array( - "alt" => false, - ), - "footnote" => array( - ), - "tablefootnotes" => array( - ), - ); - public function __construct() { parent::__construct(); parent::registerFormatName($this->formatname); @@ -94,10 +60,6 @@ } } - public function getChunkInfo() { - return $this->cchunk; - } - /* Functions from PhDThemeXhtml */ /** http://cvs.php.net/viewvc.cgi/phd/phpdotnet/phd/Package/Default/XHTML.php?r1=1.4&r2=1.5&diff_format=u Index: phd/phpdotnet/phd/Package/Default/XHTML.php diff -u phd/phpdotnet/phd/Package/Default/XHTML.php:1.4 phd/phpdotnet/phd/Package/Default/XHTML.php:1.5 --- phd/phpdotnet/phd/Package/Default/XHTML.php:1.4 Mon Jun 22 02:31:42 2009 +++ phd/phpdotnet/phd/Package/Default/XHTML.php Sun Jul 5 06:35:05 2009 @@ -8,6 +8,7 @@ 'acronym' => 'acronym', 'affiliation' => 'format_suppressed_tags', 'alt' => 'format_suppressed_tags', + 'arg' => 'format_suppressed_tags', 'article' => 'format_container_chunk_top', 'author' => array( /* DEFAULT */ 'format_author', @@ -18,7 +19,7 @@ 'application' => 'span', 'blockquote' => 'blockquote', 'bibliography' => array( - /* DEFAULT */ 'div', + /* DEFAULT */ 'format_div', 'article' => 'format_chunk', 'book' => 'format_chunk', 'part' => 'format_chunk', @@ -26,6 +27,7 @@ 'book' => 'format_container_chunk_top', 'chapter' => 'format_container_chunk_top', 'citetitle' => 'i', + 'cmdsynopsis' => 'format_cmdsynopsis', 'co' => 'format_co', 'colophon' => 'format_chunk', 'copyright' => 'format_copyright', @@ -46,7 +48,7 @@ 'optional' => 'span', 'honorific' => 'span', 'glossary' => array( - /* DEFAULT */ 'div', + /* DEFAULT */ 'format_div', 'article' => 'format_chunk', 'book' => 'format_chunk', 'part' => 'format_chunk', @@ -96,39 +98,39 @@ 'envar' => 'span', 'errortype' => 'span', 'errorcode' => 'span', - 'example' => 'div', + 'example' => 'format_div', 'formalpara' => 'p', 'fieldsynopsis' => array( /* DEFAULT */ 'format_fieldsynopsis', - 'entry' => 'div', + 'entry' => 'format_div', ), 'figure' => 'div', 'filename' => 'var', 'glossentry' => 'li', 'glossdef' => 'p', - 'glosslist' => 'ul', + 'glosslist' => 'format_itemizedlist', 'glossterm' => 'span', 'holder' => 'span', - 'imageobject' => 'div', + 'imageobject' => 'format_div', 'imagedata' => 'format_imagedata', 'important' => 'format_admonition', 'index' => array( - /* DEFAULT */ 'div', + /* DEFAULT */ 'format_div', 'article' => 'format_chunk', 'book' => 'format_chunk', 'part' => 'format_chunk', ), 'info' => array( - /* DEFAULT */ 'div', + /* DEFAULT */ 'format_div', 'note' => 'span', ), - 'informalexample' => 'div', - 'informaltable' => 'table', - 'indexdiv' => 'dl', + 'informalexample' => 'format_div', + 'informaltable' => 'format_table', + 'indexdiv' => 'format_dl', 'indexentry' => 'dd', 'initializer' => 'format_initializer', - 'itemizedlist' => 'ul', - 'legalnotice' => 'format_chunk', + 'itemizedlist' => 'format_itemizedlist', + 'legalnotice' => 'format_legalnotice_chunk', 'listitem' => array( /* DEFAULT */ 'li', 'varlistentry' => 'format_varlistentry_listitem', @@ -147,10 +149,10 @@ 'modifier' => 'span', 'note' => 'format_note', 'orgname' => 'span', - 'othercredit' => 'div', + 'othercredit' => 'format_div', 'ooclass' => array( /* DEFAULT */ 'span', - 'classsynopsis' => 'div', + 'classsynopsis' => 'format_div', ), 'oointerface' => array( /* DEFAULT */ 'span', @@ -158,7 +160,7 @@ ), 'interfacename' => 'span', 'option' => 'span', - 'orderedlist' => 'ol', + 'orderedlist' => 'format_orderedlist', 'para' => array( /* DEFAULT */ 'p', 'example' => 'format_example_content', @@ -173,9 +175,9 @@ 'methodparam' => 'format_methodparam_parameter', ), 'part' => 'format_container_chunk_top', - 'partintro' => 'div', + 'partintro' => 'format_div', 'personname' => 'format_personname', - 'personblurb' => 'div', + 'personblurb' => 'format_div', 'phrase' => 'span', 'preface' => 'format_chunk', 'primaryie' => 'format_suppressed_tags', @@ -189,7 +191,7 @@ 'classsynopsisinfo' => 'format_varname', ), 'proptype' => 'span', - 'pubdate' => 'div', /* Docbook-XSL prints "published" */ + 'pubdate' => 'format_div', /* Docbook-XSL prints "published" */ 'refentry' => 'format_chunk', 'refentrytitle' => 'span', 'refpurpose' => 'p', @@ -204,7 +206,8 @@ 'replaceable' => 'span', 'row' => 'format_row', 'screen' => 'format_screen', - 'sect1' => 'format_section_chunk', + 'screenshot' => 'format_div', + 'sect1' => 'format_chunk', 'sect2' => 'div', 'sect3' => 'div', 'sect4' => 'div', @@ -235,7 +238,7 @@ 'set' => 'format_container_chunk_top', 'setindex' => 'format_chunk', 'shortaffil' => 'format_suppressed_tags', - 'simplelist' => 'ul', /* FIXME: simplelists has few attributes that need to be implemented */ + 'simplelist' => 'format_itemizedlist', /* FIXME: simplelists has few attributes that need to be implemented */ 'simpara' => array( /* DEFAULT */ 'p', 'note' => 'span', @@ -280,6 +283,7 @@ 'indexdiv' => 'dt', 'legalnotice' => 'h4', 'note' => 'format_note_title', + 'phd:toc' => 'strong', 'procedure' => 'b', 'refsect1' => 'h3', 'refsect2' => 'h4', @@ -300,6 +304,7 @@ 'set' => 'format_container_chunk_top_title', ), 'titleabbrev' => 'format_suppressed_tags', + 'token' => 'tt', 'type' => 'span', 'userinput' => 'format_userinput', 'uri' => 'tt', @@ -370,7 +375,43 @@ 'titleabbrev' => 'format_suppressed_text', ); - //protected $flags; + /* Current Chunk variables */ + protected $cchunk = array(); + /* Default Chunk variables */ + private $dchunk = array( + "classsynopsis" => array( + "close" => false, + "classname" => false, + ), + "classsynopsisinfo" => array( + "implements" => false, + "ooclass" => false, + ), + "examples" => 0, + "fieldsynopsis" => array( + "modifier" => "public", + ), + "co" => 0, + "callouts" => 0, + "segmentedlist" => array( + "seglistitem" => 0, + "segtitle" => array( + ), + ), + "table" => false, + "procedure" => false, + "mediaobject" => array( + "alt" => false, + ), + "footnote" => array( + ), + "tablefootnotes" => array( + ), + "chunk_id" => null, + "varlistentry" => array( + "listitems" => array(), + ), + ); public function __construct() { parent::__construct(); @@ -384,6 +425,14 @@ return $this->mytextmap; } + public function getChunkInfo() { + return $this->cchunk; + } + + public function getDefaultChunkInfo() { + return $this->dchunk; + } + protected function createTOC($id, $lang) { if (!$this->getChildrens($id)) { return ""; @@ -762,7 +811,6 @@ return $this->TEXT($value); } - public function format_fieldsynopsis($open, $name, $attrs) { $this->cchunk["fieldsynopsis"] = $this->dchunk["fieldsynopsis"]; if ($open) { @@ -770,10 +818,12 @@ } return ";</div>\n"; } + public function format_fieldsynopsis_modifier_text($value, $tag) { $this->cchunk["fieldsynopsis"]["modifier"] = trim($value); return $this->TEXT($value); } + public function format_methodsynopsis($open, $name, $attrs) { if ($open) { $this->params = array("count" => 0, "opt" => 0, "content" => ""); @@ -1164,7 +1214,7 @@ } $this->cchunk["table"] = false; $str = ""; - if ($this->cchunk["tablefootnotes"]) { + if (isset($this->cchunk["tablefootnotes"]) && $this->cchunk["tablefootnotes"]) { $opts = array(Reader::XMLNS_DOCBOOK => array()); $str = $this->format_tbody(true, "footnote", $opts, $props); @@ -1334,4 +1384,101 @@ return '<<a href="mailto:' . $value . '">' . $value . '</a>>'; } + /** + * Functions from the old XHTMLPhDFormat + */ + public function format_legalnotice_chunk($open, $name, $attrs) { + if ($open) { + return '<div id="legalnotice">'; + } + return "</div>\n"; + } + + public function format_div($open, $name, $attrs, $props) { + if ($open) { + return '<div class="' . $name . '">'; + } + return '</div>'; + } + + public function format_screen_text($value, $tag) { + return nl2br($this->TEXT($value)); + } + + /** + * Renders a <tag class=""> tag. + * + * @return string HTML code + */ + public function format_tag($open, $name, $attrs, $props) { + static $arFixes = array( + 'attribute' => array('', ''), + 'attvalue' => array('"', '"'), + 'comment' => array('<!--', '-->'), + 'element' => array('', ''), + 'emptytag' => array('<', '/>'), + 'endtag' => array('</', '>'), + 'genentity' => array('&', ';'), + 'localname' => array('', ''), + 'namespace' => array('', ''), + 'numcharref' => array('&#', ';'), + 'paramentity' => array('%', ';'), + 'pi' => array('<?', '?>'), + 'prefix' => array('', ''), + 'starttag' => array('<', '>'), + 'xmlpi' => array('<?', '?>'), + ); + if ($props['empty']) { + return ''; + } + $class = $attrs['class']; + if (!isset($arFixes[$class])) { + trigger_error('Unknown tag class "' . $class . '"', E_USER_WARNING); + $class = 'starttag'; + } + if (!$open) { + return $arFixes[$class][1] . '</code>'; + } + + return '<code>' . $arFixes[$class][0]; + } + + public function format_dl($open, $name, $attrs, $props) { + if ($open) { + return '<dl class="' . $name . '">'; + } + return '</dl>'; + } + + public function format_itemizedlist($open, $name, $attrs, $props) { + if ($open) { + return '<ul class="' . $name . '">'; + } + return '</ul>'; + } + + public function format_orderedlist($open, $name, $attrs, $props) { + if ($open) { + $numeration = "1"; + if (isset($attrs[Reader::XMLNS_DOCBOOK]["numeration"])) { + switch($attrs[Reader::XMLNS_DOCBOOK]["numeration"]) { + case "upperalpha": + $numeration = "A"; + break; + case "loweralpha": + $numeration = "a"; + break; + case "upperroman": + $numeration = "I"; + break; + case "lowerroman": + $numeration = "i"; + break; + } + } + return '<ol type="' .$numeration. '">'; + } + return '</ol>'; + } + }