Hannes Magnusson wrote:
> While writing a reply I realized something... that index.html file you
> are getting in REF_STRUCT_DEV is broken.
> The files are named by their IDs and since we don't have an "index" ID
> we copy (thank you Windows, I have a great respect for you!) the
> (believed-to-be-index) manual.html as index.html.
> Now, in the REF_STRUCT_DEV we however have an index ID, which does get
> generated with a normal TOC - but it gets overwritten since the theme
> blindly copys manual.html to index.html ;)
Patch fixing this attached. I presume that non-REF_STRUCT_DEV still
needs to preserve the old behavior, so we unlink index.html before we
begin generation.
--
Edward Z. Yang GnuPG: 0x869C48DA
HTML Purifier <http://htmlpurifier.org> Anti-XSS Filter
[[ 3FA8 E9A9 7385 B691 A6FC B3CB A933 BE7D 869C 48DA ]]
Index: chunkedhtml.php
===================================================================
RCS file: /repository/phd/themes/php/chunkedhtml.php,v
retrieving revision 1.7
diff -u -r1.7 chunkedhtml.php
--- chunkedhtml.php 5 Nov 2007 19:49:04 -0000 1.7
+++ chunkedhtml.php 5 Nov 2007 20:34:48 -0000
@@ -8,6 +8,7 @@
public function __construct(array $IDs, $filename, $ext = "html") {
phpdotnet::__construct($IDs, $filename, $ext, true);
if(!file_exists("html") || is_file("html")) mkdir("html") or
die("Can't create the cache directory");
+ elseif (file_exists('html/index.html')) unlink('html/index.html'); //
preserve back-compat
}
public function header($id) {
$title = PhDHelper::getDescription($id, true);
@@ -47,7 +48,7 @@
return "<hr />$nav</body></html>\n";
}
public function __destruct() {
- if (file_exists("html/manual.html")) {
+ if (file_exists("html/manual.html") &&
!file_exists('html/index.html')) {
copy("html/manual.html", "html/index.html");
}
}