|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r59467 - website/public_html/beta/common/code
From: daniel_james_at_[hidden]
Date: 2010-02-04 03:56:41
Author: danieljames
Date: 2010-02-04 03:56:40 EST (Thu, 04 Feb 2010)
New Revision: 59467
URL: http://svn.boost.org/trac/boost/changeset/59467
Log:
Only apply the basic style when we have a body tag.
Text files modified:
website/public_html/beta/common/code/boost_archive.php | 37 ++++++++++++++++++++++++-------------
1 files changed, 24 insertions(+), 13 deletions(-)
Modified: website/public_html/beta/common/code/boost_archive.php
==============================================================================
--- website/public_html/beta/common/code/boost_archive.php (original)
+++ website/public_html/beta/common/code/boost_archive.php 2010-02-04 03:56:40 EST (Thu, 04 Feb 2010)
@@ -499,22 +499,33 @@
$is_xhtml = preg_match('@<!DOCTYPE[^>]*xhtml_at_i', $text);
$tag_end = $is_xhtml ? '/>' : '>';
- $text = preg_split('@(</head>|<body[^>]*>)@i',$text,-1,PREG_SPLIT_DELIM_CAPTURE);
- $state = 0;
- foreach($text as $section) {
- print($section);
- switch($state) {
- case 0:
- print '<link rel="icon" href="/favicon.ico" type="image/ico"'.$tag_end;
- print '<link rel="stylesheet" type="text/css" href="/style/section-basic.css"'.$tag_end;
- $state = 1;
+ $sections = preg_split('@(</head>|<body[^>]*>)@i',$text,-1,PREG_SPLIT_DELIM_CAPTURE);
+
+ $body_index = 0;
+ $index = 0;
+ foreach($sections as $section) {
+ if(stripos($section, '<body') === 0) {
+ $body_index = $index;
break;
- case 1:
- if(stripos($section, '<body') === 0) {
- $state = 2;
+ }
+ ++$index;
+ }
+
+ if(!$body_index) {
+ print($text);
+ }
+ else {
+ $index = 0;
+ foreach($sections as $section) {
+ print($section);
+ if($index == 0) {
+ print '<link rel="icon" href="/favicon.ico" type="image/ico"'.$tag_end;
+ print '<link rel="stylesheet" type="text/css" href="/style/section-basic.css"'.$tag_end;
+ }
+ else if($index == $body_index) {
virtual("/common/heading-doc.html");
}
- break;
+ ++$index;
}
}
}
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk