Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

cvs: phpdoc /htmlhelp filter_files.php
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

[url]http://cvs.php.net/diff.php/phpdoc/htmlhelp/filter_files.php?r1=1.6&r2=1.7&ty=u[/u
rl]
Index: phpdoc/htmlhelp/filter_files.php
diff -u phpdoc/htmlhelp/filter_files.php:1.6 phpdoc/htmlhelp/filter_files.ph
p: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="pageHea
ders">',
+            $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> )

Report this thread to moderator Post Follow-up to this message
Old Post
Anatoly Techtonik
10-30-04 08:55 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Documentation archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:23 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.