cvs: phd /themes/pear pearchm.php

From: Date: Sat, 01 Nov 2008 09:32:04 +0000
Subject: cvs: phd /themes/pear pearchm.php
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-2357@lists.php.net to get a copy of this message
cweiske Sat Nov 1 09:32:04 2008 UTC Modified files: /phd/themes/pear pearchm.php Log: Make the index look a bit better in kchmviewer http://cvs.php.net/viewvc.cgi/phd/themes/pear/pearchm.php?r1=1.5&r2=1.6&diff_format=u Index: phd/themes/pear/pearchm.php diff -u phd/themes/pear/pearchm.php:1.5 phd/themes/pear/pearchm.php:1.6 --- phd/themes/pear/pearchm.php:1.5 Sat Nov 1 07:54:50 2008 +++ phd/themes/pear/pearchm.php Sat Nov 1 09:32:04 2008 @@ -227,7 +227,7 @@ if ($hasChild) fwrite($this->hhcStream, "{$this->offset(2)}<ul>\n"); fwrite($this->hhkStream, " <li><object type=\"text/sitemap\">\n" . " <param name=\"Local\" value=\"{$ref}\">\n" . - " <param name=\"Name\" value=\"" . htmlentities($name) . "\">\n" . + " <param name=\"Name\" value=\"" . htmlentities(self::cleanIndexName($name)) . "\">\n" . " </object>\n </li>\n"); break; case PhDReader::CLOSE_CHUNK : @@ -239,6 +239,25 @@ } } + + + /** + * Clean up the index name. + * Newlines and double spaces don't look that good in some chm viewer apps. + * + * @param string $value Value to fix + * + * @return string Fixed/cleaned value + */ + protected static function cleanIndexName($value) + { + return str_replace( + array("\n", "\r", ' '), + array('', '', ' '), + $value + ); + } + protected function headerChm() { $lang = PhDConfig::language(); fwrite($this->hhpStream, '[OPTIONS]

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