cvs: phd /themes/pear peartheme.php
| From: | Christian Weiske | Date: | Thu, 30 Oct 2008 18:20:51 +0000 |
| Subject: | cvs: phd /themes/pear peartheme.php | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-2346@lists.php.net to get a copy of this message | ||
cweiske Thu Oct 30 18:20:51 2008 UTC
Modified files:
/phd/themes/pear peartheme.php
Log:
Implement phd:toc-depth for the pear theme.
This partially fixes bug #46412: Allow random TOC depths
http://bugs.php.net/?id=46412
http://cvs.php.net/viewvc.cgi/phd/themes/pear/peartheme.php?r1=1.12&r2=1.13&diff_format=u
Index: phd/themes/pear/peartheme.php
diff -u phd/themes/pear/peartheme.php:1.12 phd/themes/pear/peartheme.php:1.13
--- phd/themes/pear/peartheme.php:1.12 Thu Oct 30 18:10:35 2008
+++ phd/themes/pear/peartheme.php Thu Oct 30 18:20:51 2008
@@ -237,19 +237,6 @@
}
/**
- * Determines if the second level of a TOC should be displayed
- *
- * @param string $id xml:id value
- * @param string $name Tag name
- *
- * @return boolean true if the second level should be displayed.
- */
- protected function displayTocSecondLevel($id, $name)
- {
- return $id == 'index';
- }
-
- /**
* Creates a table of contents for the given id.
* Also creates nested TOCs if that's wanted ($depth)
*
@@ -343,7 +330,11 @@
$this->cchunk = $this->dchunk;
}
- $toc = $this->createToc($id, $name, $props);
+ $toc = $this->createToc(
+ $id, $name, $props,
+ isset($attrs[PhDReader::XMLNS_PHD]['toc-depth'])
+ ? (int)$attrs[PhDReader::XMLNS_PHD]['toc-depth'] : 1
+ );
if ($toc) {
$toc = "<div class=\"TOC\">\n" . $toc .
"</div>\n";
}
@@ -364,7 +355,8 @@
$content = $this->createToc(
$id, $name, $props,
- $this->displayTocSecondLevel($id, $name) ? 2 : 1
+ isset($attrs[PhDReader::XMLNS_PHD]['toc-depth'])
+ ? (int)$attrs[PhDReader::XMLNS_PHD]['toc-depth'] : 1
);
$content .= "</div>\n";