cvs: pearweb /include pear-format-html.php pear-manual.php
| From: | Martin Jansen | Date: | Mon, 25 Sep 2006 19:34:15 +0000 |
| Subject: | cvs: pearweb /include pear-format-html.php pear-manual.php | ||
| Groups: | php.pear.cvs php.pear.core | ||
| Request: | Send a blank email to pear-cvs+get-42229@lists.php.net to get a copy of this message | ||
mj Mon Sep 25 19:34:15 2006 UTC
Modified files:
/pearweb/include pear-format-html.php pear-manual.php
Log:
* The build process of the manual already provides the information about
the character set which should be used. Thus we don't need to "guess"
it again in pear-format-html.php.
http://cvs.php.net/viewvc.cgi/pearweb/include/pear-format-html.php?r1=1.189&r2=1.190&diff_format=u
Index: pearweb/include/pear-format-html.php
diff -u pearweb/include/pear-format-html.php:1.189 pearweb/include/pear-format-html.php:1.190
--- pearweb/include/pear-format-html.php:1.189 Sat Sep 23 09:29:52 2006
+++ pearweb/include/pear-format-html.php Mon Sep 25 19:34:15 2006
@@ -15,7 +15,7 @@
+----------------------------------------------------------------------+
| Authors: |
+----------------------------------------------------------------------+
- $Id: pear-format-html.php,v 1.189 2006/09/23 09:29:52 mj Exp $
+ $Id: pear-format-html.php,v 1.190 2006/09/25 19:34:15 mj Exp $
*/
PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'error_handler');
@@ -36,24 +36,17 @@
$self = htmlspecialchars($_SERVER['PHP_SELF']);
-$encoding = 'iso-8859-15';
-
// Handling things related to the manual
+$in_manual = false;
+
if (substr($self, 0, 7) == '/manual') {
+ if (substr($self, 7, 10) != "/index.php") {
+ $in_manual = true;
+ }
+
require_once 'pear-manual.php';
extra_styles('/css/manual.css');
-
- // The Japanese manual translation needs UTF-8 encoding
- if (preg_match("=^/manual/ja=", $self)) {
- $encoding = 'utf-8';
-
- // The Russian manual translation needs KOI8-R encoding
- } else if (preg_match("=^/manual/ru=", $self)) {
- $encoding = 'KOI8-R';
- } else if (preg_match("=^/manual/(?:hu|pl)=", $self)) {
- $encoding = 'iso-8859-2';
- }
}
$GLOBALS['_style'] = '';
@@ -68,7 +61,7 @@
*/
function response_header($title = 'The PHP Extension and Application Repository', $style
= false, $extraHeaders = '')
{
- global $_style, $_header_done, $SIDEBAR_DATA, $encoding, $self, $auth_user;
+ global $_style, $_header_done, $SIDEBAR_DATA, $self, $auth_user;
$extra_styles = extra_styles();
@@ -110,8 +103,14 @@
$SIDEBAR_DATA .= draw_navigation('developer_menu_public',
'Developers:');
}
}
-header('Content-Type: text/html; charset=' . $encoding);
-echo '<?xml version="1.0" encoding="' . $encoding . '"
?>';
+
+ if ($GLOBALS['in_manual'] == false) {
+ /* The manual-related code takes care of sending the right
+ * headers.
+ */
+ header('Content-Type: text/html; charset=ISO-8859-15');
+ echo '<?xml version="1.0" encoding="ISO-8859-15" ?>';
+ }
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
http://cvs.php.net/viewvc.cgi/pearweb/include/pear-manual.php?r1=1.56&r2=1.57&diff_format=u
Index: pearweb/include/pear-manual.php
diff -u pearweb/include/pear-manual.php:1.56 pearweb/include/pear-manual.php:1.57
--- pearweb/include/pear-manual.php:1.56 Fri Aug 18 14:07:12 2006
+++ pearweb/include/pear-manual.php Mon Sep 25 19:34:15 2006
@@ -15,7 +15,7 @@
+----------------------------------------------------------------------+
| Authors: |
+----------------------------------------------------------------------+
- $Id: pear-manual.php,v 1.56 2006/08/18 14:07:12 mj Exp $
+ $Id: pear-manual.php,v 1.57 2006/09/25 19:34:15 mj Exp $
*/
require_once 'site.php';
@@ -271,7 +271,7 @@
function manualHeader($title, $id = '')
{
- global $HTDIG, $LANGUAGES, $LANG, $SIDEBAR_DATA, $dbh;
+ global $HTDIG, $LANGUAGES, $LANG, $CHARSET, $SIDEBAR_DATA, $dbh;
makeBorderTOC($title);
@@ -307,6 +307,7 @@
}
}
+ echo '<?xml version="1.0" encoding="' . $CHARSET . '"
?>';
response_header('Manual :: ' . $title);
# create links to plain html and other languages
if (!$HTDIG) {