svn: /phd/trunk/phpdotnet/phd/Package/PHP/ CHM.php

From: Date: Fri, 25 Sep 2009 08:13:27 +0000
Subject: svn: /phd/trunk/phpdotnet/phd/Package/PHP/ CHM.php
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-4980@lists.php.net to get a copy of this message
rquadling Fri, 25 Sep 2009 08:13:27 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=288724 Log: Correct Charlist URL, format_varlistentry only outputs once to hhk file, links starting with # are not external and no need for format_imagedata if chm builder is ran from the same directory as the res folder. Changed paths: U phd/trunk/phpdotnet/phd/Package/PHP/CHM.php Modified: phd/trunk/phpdotnet/phd/Package/PHP/CHM.php =================================================================== --- phd/trunk/phpdotnet/phd/Package/PHP/CHM.php 2009-09-25 08:01:00 UTC (rev 288723) +++ phd/trunk/phpdotnet/phd/Package/PHP/CHM.php 2009-09-25 08:13:27 UTC (rev 288724) @@ -9,7 +9,7 @@ // Array to manual code -> HTML Help Code conversion // Code list: http://www.helpware.net/htmlhelp/hh_info.htm - // Charset list: http://www.microsoft.com/globaldev/nlsweb/default.asp + // Charset list: http://msdn.microsoft.com/en-us/goglobal/bb896001.aspx // Language code: http://www.unicode.org/unicode/onlinedat/languages.html // MIME preferred charset list: http://www.iana.org/assignments/character-sets // Font list: http://www.microsoft.com/office/ork/xp/three/inte03.htm @@ -297,7 +297,6 @@ Default Window=doc Display compile progress=Yes Enhanced decompilation=Yes -Flat=Yes Full-text search=Yes Index file=php_manual_' . $lang . '.hhk Language=' . $this->LANGUAGES[$lang]["langcode"] . ' @@ -368,16 +367,18 @@ } public function format_varlistentry($open, $name, $attrs) { - $this->collectContent($attrs); - $charset = $this->LANGUAGES[Config::language()]["preferred_charset"]; - $content = htmlspecialchars(iconv('UTF-8', $charset, $this->lastContent["name"]), ENT_QUOTES); + if ($open) { + $this->collectContent($attrs); + $charset = $this->LANGUAGES[Config::language()]["preferred_charset"]; + $content = htmlspecialchars(iconv('UTF-8', $charset, $this->lastContent["name"]), ENT_QUOTES); - if ($content) { - fwrite($this->hhkStream, - " <LI><OBJECT type=\"text/sitemap\">\n" . - " <param name=\"Local\" value=\"{$this->lastContent["reference"]}\">\n" . - " <param name=\"Name\" value=\"{$content}\">\n" . - " </OBJECT>\n"); + if ($content) { + fwrite($this->hhkStream, + " <LI><OBJECT type=\"text/sitemap\">\n" . + " <param name=\"Local\" value=\"{$this->lastContent["reference"]}\">\n" . + " <param name=\"Name\" value=\"{$content}\">\n" . + " </OBJECT>\n"); + } } return parent::format_varlistentry($open, $name, $attrs); } @@ -422,23 +423,12 @@ public function format_link($open, $name, $attrs, $props) { $link = parent::format_link($open, $name, $attrs, $props); - // Add title attribute so address can be seen in CHM files. - $search = '<a href="([^"]++)" class="link external">'; + // Add title attribute to external links so address can be seen in CHM files. + $search = '<a href="([^#"][^"]++)" class="link external">'; $replacement = '<a href="\1" class="link external" title="Link : \1">'; $link = preg_replace($search, $replacement, $link); return $link; } - - public function format_imagedata($open, $name, $attrs) { - // Due to flattening of the CHM build process, the links to the images cannot be relative. - preg_match('src="([^"]++)"', $image = parent::format_imagedata($open, $name, $attrs), $imageMatches); - $image = str_replace($imageMatches[1], basename($imageMatches[1]), $image); - - // Add the image to the hhp project file as the automatic build won't find it. - fwrite($this->hhpStream, 'res\\images\\' . basename($imageMatches[1]) . "\n"); - - return $image; - } } /*

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