Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r51805 - website/public_html/beta/common/code
From: daniel_james_at_[hidden]
Date: 2009-03-16 16:21:55


Author: danieljames
Date: 2009-03-16 16:21:55 EDT (Mon, 16 Mar 2009)
New Revision: 51805
URL: http://svn.boost.org/trac/boost/changeset/51805

Log:
Include the filename in the title for text and C++ files from the archive.
Text files modified:
   website/public_html/beta/common/code/boost_archive.php | 52 +++++++++++----------------------------
   1 files changed, 15 insertions(+), 37 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 2009-03-16 16:21:55 EDT (Mon, 16 Mar 2009)
@@ -14,7 +14,8 @@
     var $archive_ = NULL;
     var $extractor_ = NULL;
     var $type_ = NULL;
- var $head_content_ = NULL;
+ var $title_ = NULL;
+ var $charset_ = NULL;
     var $content_ = NULL;
     
     function boost_archive(
@@ -97,18 +98,13 @@
     
     function content_head()
     {
- if ($this->head_content_)
- {
- print $this->head_content_;
- }
- else
- {
- print <<<HTML
- <title>Boost C++ Libraries</title>
- <meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-HTML
- ;
- }
+ $charset = $this->charset_ ? $this->charset_ : 'us-ascii';
+ $title = $this->title_ ? 'Boost C++ Libraries - '.$this->title_ : 'Boost C++ Libraries';
+
+ print <<<HTML
+ <meta http-equiv="Content-Type" content="text/html; charset=${charset}" />
+ <title>${title}</title>
+HTML;
     }
     
     function is_basic()
@@ -164,11 +160,12 @@
 
     function _init_text()
     {
+ $this->title_ = htmlentities($this->key_);
     }
     
     function _content_text()
     {
- print "<h3>".$this->key_."</h3>\n";
+ print "<h3>".htmlentities($this->key_)."</h3>\n";
         print "<pre>\n";
         print htmlentities($this->content_);
         print "</pre>\n";
@@ -176,13 +173,14 @@
 
     function _init_cpp()
     {
+ $this->title_ = htmlentities($this->key_);
     }
 
     function _content_cpp()
     {
         $text = htmlentities($this->content_);
         
- print "<h3>".$this->key_."</h3>\n";
+ print "<h3>".htmlentities($this->key_)."</h3>\n";
         print "<pre>\n";
         $root = dirname(preg_replace('@([^/]+/)@','../',$this->key_));
         $text = preg_replace(
@@ -199,36 +197,16 @@
 
     function _init_html_pre()
     {
- $h = '';
-
         preg_match('@text/html; charset=([^\s"\']+)@i',$this->content_,$charset);
         if (isset($charset[1]))
         {
- $h .= <<<HTML
- <meta http-equiv="Content-Type" content="text/html; charset=${charset[1]}" />
-HTML
- ;
+ $this->charset_ = $charset[1];
         }
         
         preg_match('@<title>([^<]+)</title>@i',$this->content_,$title);
         if (isset($title[1]))
         {
- $h .= <<<HTML
- <title>Boost C++ Libraries - ${title[1]}</title>
-HTML
- ;
- }
- else if ($h !== '')
- {
- $h .= <<<HTML
- <title>Boost C++ Libraries</title>
-HTML
- ;
- }
-
- if ($h !== '')
- {
- $this->head_content_ = $h;
+ $this->title_ = $title[1];
         }
     }
     


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