cvs: phd /themes/php phpdotnet.php
| From: | Hannes Magnusson | Date: | Sun, 30 Sep 2007 20:00:10 +0000 |
| Subject: | cvs: phd /themes/php phpdotnet.php | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-112@lists.php.net to get a copy of this message | ||
bjori Sun Sep 30 20:00:10 2007 UTC
Modified files:
/phd/themes/php phpdotnet.php
Log:
Fix the TOC on non-reference pages
http://cvs.php.net/viewvc.cgi/phd/themes/php/phpdotnet.php?r1=1.19&r2=1.20&diff_format=u
Index: phd/themes/php/phpdotnet.php
diff -u phd/themes/php/phpdotnet.php:1.19 phd/themes/php/phpdotnet.php:1.20
--- phd/themes/php/phpdotnet.php:1.19 Sun Sep 30 18:30:03 2007
+++ phd/themes/php/phpdotnet.php Sun Sep 30 20:00:10 2007
@@ -1,5 +1,5 @@
<?php
-/* $Id: phpdotnet.php,v 1.19 2007/09/30 18:30:03 bjori Exp $ */
+/* $Id: phpdotnet.php,v 1.20 2007/09/30 20:00:10 bjori Exp $ */
class phpdotnet extends PhDHelper {
protected $elementmap = array(
@@ -7,6 +7,21 @@
'function' => 'format_suppressed_tags',
'link' => 'format_link',
'refpurpose' => 'format_refpurpose',
+ 'title' => array(
+ /* DEFAULT */ false,
+ 'article' => 'format_container_chunk_title',
+ 'appendix' => 'format_container_chunk_title',
+ 'chapter' => 'format_container_chunk_title',
+ 'part' => 'format_container_chunk_title',
+ 'info' => array(
+ /* DEFAULT */ false,
+ 'article' => 'format_container_chunk_title',
+ 'appendix' => 'format_container_chunk_title',
+ 'chapter' => 'format_container_chunk_title',
+ 'part' => 'format_container_chunk_title',
+ ),
+ ),
+
'titleabbrev' => 'format_suppressed_tags',
'type' => array(
/* DEFAULT */ 'format_suppressed_tags',
@@ -72,6 +87,7 @@
'methodsynopsis' => false,
),
'refname' => 'format_refname_text',
+
'titleabbrev' => 'format_suppressed_tags',
);
private $versions = array();
@@ -214,17 +230,19 @@
public function format_container_chunk($open, $name, $attrs) {
$this->CURRENT_ID = $id = $attrs[PhDReader::XMLNS_XML]["id"];
if ($open) {
- $content = "<div>";
-
if ($name != "reference") {
$chunks = PhDHelper::getChildren($id);
- $content .= '<ul class="chunklist
chunklist_'.$name.'">';
+ if (!count($chunks)) {
+ return "<div>";
+ }
+ $content = '<ul class="chunklist
chunklist_'.$name.'">';
foreach($chunks as $chunkid => $junk) {
$content .= sprintf('<li><a
href="%s%s.%s">%s</a></li>', $this->chunked ? "" :
"#", $chunkid, $this->ext, PhDHelper::getDescription($chunkid, true));
}
$content .= "</ul>\n";
+ $this->tmp["container_chunk"] = $content;
}
- return $content;
+ return "<div>";
}
$content = "";
@@ -242,6 +260,17 @@
return $content;
}
+ public function format_container_chunk_title($open, $name, $attrs) {
+ if ($open) {
+ return "<h1>";
+ }
+ $ret = "";
+ if ($this->tmp["container_chunk"]) {
+ $ret = $this->tmp["container_chunk"];
+ $this->tmp["container_chunk"] = null;
+ }
+ return "</h1>\n" .$ret;
+ }
public function format_root_chunk($open, $name, $attrs) {
$this->CURRENT_ID = $id = $attrs[PhDReader::XMLNS_XML]["id"];
if ($open) {
@@ -358,7 +387,7 @@
}
public function format_qandaentry($open, $name, $attrs) {
if ($open) {
- $this->tmp["qandaentry"][] = $attrs[PhDReader::XMLNS_XML]["id"];
+ $this->tmp["qandaentry"][] = $attrs[PhDReader::XMLNS_XML]["id"];
return '<dl>';
}
return '</dl>';