For Programmers: Free Programming Magazines  


Home > Archive > PHP Documentation > October 2004 > cvs: phpdoc /htmlhelp filter_files.php









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author cvs: phpdoc /htmlhelp filter_files.php
Anatoly Techtonik

2004-10-30, 3:55 pm

techtonik Sat Oct 30 08:55:22 2004 EDT

Modified files:
/phpdoc/htmlhelp filter_files.php
Log:
fix inserting first div to make document invisible by default
add error reporting for this operation

http://cvs.php.net/diff.php/phpdoc/...1.6&r2=1.7&ty=u
Index: phpdoc/htmlhelp/filter_files.php
diff -u phpdoc/htmlhelp/filter_files.php:1.6 phpdoc/htmlhelp/filter_files.php:1.7
--- phpdoc/htmlhelp/filter_files.php:1.6 Fri Oct 29 05:58:18 2004
+++ phpdoc/htmlhelp/filter_files.php Sat Oct 30 08:55:21 2004
@@ -116,19 +116,24 @@
// Add divisions for skin support

// Make the document invisible by default, adding a new first div
- $content = preg_replace(
- '!(<div class="(\w+)"> )!Us',
- '<div id="pageContent" style="display:none;">\1<div id="pageHeaders">',
- $content,
- 1
- );
+ $bodystart_regex = '!(<div class="(\w+)"( lang=\"\w+\")?> )!Us';
+ if (preg_match($bodystart_regex, $content)) {
+ $content = preg_replace(
+ $bodystart_regex,
+ '<div id="pageContent" style="display:none;">\1<div id="pageHeaders">',
+ $content,
+ 1
+ );

- // Put there the end of this pageContent
- $content = str_replace(
- '</body></html>',
- '</div></body></html>',
- $content
- );
+ // Put there the end of this pageContent
+ $content = str_replace(
+ '</body></html>',
+ '</div></body></html>',
+ $content
+ );
+ } else {
+ echo "Can't add first div. No match.\n";
+ }

// For headers we have several possibilities
if (strpos($content, '<div class="refnamediv">') !== FALSE) {
@@ -200,7 +205,7 @@
"formatPre",
$content
);
-
+
//------------------------------------------------------------------
// Put <p> tags after all </ul> or </div> or </table> close tags to
// enable CSS support for those paragraphs (these break a <p> )
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com