svn: /phd/trunk/phpdotnet/phd/ Index.php Package/Default/XHTML.php

From: Date: Mon, 10 Aug 2009 13:16:10 +0000
Subject: svn: /phd/trunk/phpdotnet/phd/ Index.php Package/Default/XHTML.php
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-4636@lists.php.net to get a copy of this message
moacir Mon, 10 Aug 2009 13:16:10 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=287036 Log: Chunking sections like 0_4 Format_screen like 0_4 Changed paths: U phd/trunk/phpdotnet/phd/Index.php U phd/trunk/phpdotnet/phd/Package/Default/XHTML.php Modified: phd/trunk/phpdotnet/phd/Index.php =================================================================== --- phd/trunk/phpdotnet/phd/Index.php 2009-08-10 12:55:52 UTC (rev 287035) +++ phd/trunk/phpdotnet/phd/Index.php 2009-08-10 13:16:10 UTC (rev 287036) @@ -42,7 +42,6 @@ 'section' => array( /* DEFAULT */ false, 'sect1' => 'format_section_chunk', - 'preface' => 'format_section_chunk', 'chapter' => 'format_section_chunk', 'appendix' => 'format_section_chunk', 'article' => 'format_section_chunk', @@ -250,29 +249,18 @@ } } - public function format_section_chunk($open, $name, $attrs, $props) { - static $sectionChunks = array(); if ($open) { - $sectionChunks[] = $props["sibling"]; - if ($props["sibling"] === $name) { - return $this->format_chunk($open, $name, $attrs, $props); + if (!isset($attrs[Reader::XMLNS_XML]["id"])) { + $this->isSectionChunk[] = false; + return $this->UNDEF($open, $name, $attrs, $props); } - if(isset($attrs[Reader::XMLNS_XML]["id"])) { - $id = $attrs[Reader::XMLNS_XML]["id"]; - return $this->storeInfo($name, $id, $this->currentchunk, false); - } - return $this->UNDEF($open, $name, $attrs, $props); - } - $x = array_pop($sectionChunks); - if ($x == $name) { + $this->isSectionChunk[] = true; return $this->format_chunk($open, $name, $attrs, $props); } - $sectionChunks[] = $x; - if(isset($attrs[Reader::XMLNS_XML]["id"])) { - $id = $attrs[Reader::XMLNS_XML]["id"]; - return $this->appendID(false); - } + if (array_pop($this->isSectionChunk)) { + return $this->format_chunk($open, $name, $attrs, $props); + } return $this->UNDEF($open, $name, $attrs, $props); } public function format_container_chunk($open, $name, $attrs, $props) { Modified: phd/trunk/phpdotnet/phd/Package/Default/XHTML.php =================================================================== --- phd/trunk/phpdotnet/phd/Package/Default/XHTML.php 2009-08-10 12:55:52 UTC (rev 287035) +++ phd/trunk/phpdotnet/phd/Package/Default/XHTML.php 2009-08-10 13:16:10 UTC (rev 287036) @@ -215,7 +215,6 @@ 'section' => array( /* DEFAULT */ 'div', 'sect1' => 'format_section_chunk', - 'preface' => 'format_section_chunk', 'chapter' => 'format_section_chunk', 'appendix' => 'format_section_chunk', 'article' => 'format_section_chunk', @@ -702,19 +701,17 @@ return $this->format_container_chunk_below($open, "reference", $attrs, $props); } public function format_section_chunk($open, $name, $attrs, $props) { - static $a = array(); if ($open) { - $a[] = $props["sibling"]; - if ($props["sibling"] === $name) { - return $this->format_chunk($open, $name, $attrs, $props); + if (!isset($attrs[Reader::XMLNS_XML]["id"])) { + $this->isSectionChunk[] = false; + return $this->transformFromMap($open, "div", $name, $attrs, $props); } - return $this->transformFromMap($open, "div", $name, $attrs, $props); + $this->isSectionChunk[] = true; + return $this->format_chunk($open, $name, $attrs, $props); } - $x = array_pop($a); - if ($x == $name) { - return $this->format_chunk($open, $name, $attrs, $props); - } - $a[] = $x; + if (array_pop($this->isSectionChunk)) { + return $this->format_chunk($open, $name, $attrs, $props); + } return $this->transformFromMap($open, "div", $name, $attrs, $props); } public function format_chunk($open, $name, $attrs, $props) { @@ -1159,9 +1156,9 @@ } public function format_screen($open, $name, $attrs) { if ($open) { - return '<div class="example-contents"><pre>'; + return '<div class="example-contents ' .$name. '">'; } - return '</pre></div>'; + return '</div>'; } public function format_constant($open, $name, $attrs) { if ($open) {

« previous php.doc.cvs (#4636) next »