cvs: phpweb /include layout.inc shared-manual.inc

From: Date: Sun, 20 Jul 2003 13:44:37 +0000
Subject: cvs: phpweb /include layout.inc shared-manual.inc
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-19408@lists.php.net to get a copy of this message
goba Sun Jul 20 09:44:37 2003 EDT Modified files: /phpweb/include layout.inc shared-manual.inc Log: - Get rid of BASE_FOR_MANPAGE in favor of the more generic _SERVER['BASE_HREF'], which we will use on all pages - Remove the old commented mirror switching part, which was never used, and not going to be used - Also employ BASE_HREF for the printed version, so the right server name will be used, and XHTMLize the printed page's header Index: phpweb/include/layout.inc diff -u phpweb/include/layout.inc:1.169 phpweb/include/layout.inc:1.170 --- phpweb/include/layout.inc:1.169 Sun Jul 13 16:02:09 2003 +++ phpweb/include/layout.inc Sun Jul 20 09:44:36 2003 @@ -1,5 +1,5 @@ <?php -/* $Id: layout.inc,v 1.169 2003/07/13 20:02:09 goba Exp $ */ +/* $Id: layout.inc,v 1.170 2003/07/20 13:44:36 goba Exp $ */ // Set the static content root differently on php.net $_SERVER['STATIC_ROOT'] = ($MYSITE == 'http://www.php.net/') ? @@ -185,7 +185,7 @@ function commonHeader($title="",$dont_enclose=0,$headers_gone=0) { global $MYSITE, $base, $enclosed, $EXPL_LANG, $SIDEBAR_DATA, - $SEARCH_BASE, $ONLOAD, $BASE_FOR_MANPAGE; + $SEARCH_BASE, $ONLOAD; // If no onload event is specified, restore the last search if (empty($ONLOAD)) { $ONLOAD = "searchHistory(); tocImages();"; } @@ -194,7 +194,6 @@ // for BC reasons, until we migrate all the code to use the last one) unset($PBASE); if (!empty($SEARCH_BASE)) { $PBASE = $SEARCH_BASE; } - if (!empty($BASE_FOR_MANPAGE)) { $PBASE = $BASE_FOR_MANPAGE; } if (!empty($_SERVER['BASE_HREF'])) { $PBASE = $_SERVER['BASE_HREF']; } ?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> @@ -287,18 +286,13 @@ </table> </td> <td bgcolor="#cccccc" background="<?php echo $_SERVER['STATIC_ROOT']; ?>/images/checkerboard.gif" width="1"><?php spacer(); ?></td> -<?php endif; ?> +<?php endif; // sidebar printed ?> <td> <table cellpadding="10" cellspacing="0" width="100%"> <tr><td valign="top"> <?php - endif; -/* don't show this yet ... ?> - <div class="mirror"> - You are using <?php echo $MYSITE; ?>. However, foo.php.net is closer. We would appreciate if you could use that mirror. - </div> - -<?php */ } + endif; // enclosed in a multiple column layout +} # commonfooter() Index: phpweb/include/shared-manual.inc diff -u phpweb/include/shared-manual.inc:1.198 phpweb/include/shared-manual.inc:1.199 --- phpweb/include/shared-manual.inc:1.198 Sun Jul 13 15:46:05 2003 +++ phpweb/include/shared-manual.inc Sun Jul 20 09:44:36 2003 @@ -3,7 +3,7 @@ // Set variable defaults $NEXT = $PREV = $UP = $HOME = $PGI = array(false, false); -$TOC = array(); $SIDEBAR_DATA = ''; $BASE_FOR_MANPAGE = ''; +$TOC = array(); $SIDEBAR_DATA = ''; // If we don't know anything about printing, set it to false if (!isset($PRINT_PAGE)) { $PRINT_PAGE = FALSE; } @@ -74,7 +74,7 @@ // Print out manual navigation bar function navigationBar($title,$id,$loc) { global $NEXT, $PREV, $tstamp, $SERVER_NAME, $SERVER_PORT, - $PHP_SELF, $LANGUAGES, $INACTIVE_ONLINE_LANGUAGES, $BASE_FOR_MANPAGE; + $PHP_SELF, $LANGUAGES, $INACTIVE_ONLINE_LANGUAGES; echo '<!--UdmComment-->' . "\n" . '<table border="0" width="100%" bgcolor="#e0e0e0" cellpadding="0" cellspacing="4">'; @@ -102,7 +102,7 @@ // Print out language switch on top of manual pages if ($loc != 'bottom') { $links = array(); - preg_match("!/manual/(.+)/!", $BASE_FOR_MANPAGE, $langcode); + preg_match("!/manual/(.+)/!", $_SERVER['BASE_HREF'], $langcode); $links[] = array("$langcode[1]/print/$id", "printer friendly"); $links[] = array("$langcode[1]/printwn/$id", "printer friendly [+notes]"); // Disable all 'inactive' languages @@ -278,7 +278,7 @@ // Send manual HTTP headers, provide accurate language data function sendManualHeaders($charset,$lang) { - global $LAST_UPDATED, $BASE_FOR_MANPAGE, $MYSITE; + global $LAST_UPDATED, $MYSITE; header("Last-Modified: " . gmdate("D, d M Y H:i:s ", $LAST_UPDATED) . "GMT"); //header("Cache-Control: public, max-age=600"); @@ -286,34 +286,33 @@ header("Content-type: text/html;charset=$charset"); header("Content-language: $lang"); - // Set initial base for manual page + // Set initial base for this manual page // [will be extended in manualHeader()!] - $BASE_FOR_MANPAGE = $MYSITE . 'manual/' . language_convert($lang); + $_SERVER['BASE_HREF'] = $MYSITE . 'manual/' . language_convert($lang); } // Print out manual page header. function manualHeader() { - global $PRINT_PAGE, $PGI, $BASE_FOR_MANPAGE; + global $PRINT_PAGE, $PGI; // XSL [and new DSSSL] sheets provide params in the // 'this' array element configured above, while old // DSSSL sheets provide info via two parameters [title, id] if (func_num_args() > 0) { - list($title, $id) = func_get_args(); + list($title, $filename) = func_get_args(); } else { - list($id, $title) = $PGI; + list($filename, $title) = $PGI; } - // Finalize the manpage base with proper filename - $BASE_FOR_MANPAGE .= '/' . $id; - if ($PRINT_PAGE) { + $_SERVER['BASE_HREF'] .= "/print/$filename"; manualPrintHeader($title); } else { - makeBorderTOC($id); + $_SERVER['BASE_HREF'] .= "/$filename"; + makeBorderTOC($filename); commonHeader ($title. " - Manual"); - navigationBar($title, $id, "top"); + navigationBar($title, $filename, "top"); } } @@ -351,28 +350,29 @@ // ============================================================================= // "Printer optimized" header for manual pages -function manualPrintHeader ($title = '') { - global $REQUEST_URI, $SERVER_NAME, $NEXT, $PREV, $HOME; - $pageurl = "http://$SERVER_NAME$REQUEST_URI"; +function manualPrintHeader($title = '') { + global $NEXT, $PREV, $HOME; + ?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>PHP<?php if ($title) echo ": $title";?></title> - <link rel="prev" href="<?php echo $PREV[0]; ?>"> - <link rel="next" href="<?php echo $NEXT[0]; ?>"> - <link rel="start" href="<?php echo $HOME[0]; ?>"> + <link rel="prev" href="<?php echo $PREV[0]; ?>" /> + <link rel="next" href="<?php echo $NEXT[0]; ?>" /> + <link rel="start" href="<?php echo $HOME[0]; ?>" /> + <base href="<?php echo $_SERVER['BASE_HREF']; ?>" /> </head> <body bgcolor="#ffffff" text="#000000" link="#000099" alink="#0000ff" vlink="#000099"> <table> <tr> <td><a href="/"><?php print_image('php.gif', 'PHP'); ?></a></td> <td> - This is a printer friendly version of the PHP Manual.<br> - Original address of this page: <a href="<?php echo $pageurl; ?>"><?php echo $pageurl; ?></a><br> - <small><?php echo make_link('copyright.php', 'Copyright &copy; 1997-2003 The PHP Documentation Group'); ?><br />All rights reserved.</small> + This is a printer friendly version of the PHP Manual.<br /> + Original address of this page: <?php print_link($_SERVER['BASE_HREF']); ?><br /> + <small><?php print_link('copyright.php', 'Copyright &copy; 1997-2003 The PHP Documentation Group'); ?><br />All rights reserved.</small> </td> </tr> -</table><hr size="1" noshade> +</table><hr size="1" noshade="noshade" /> <?php }

« previous php.mirrors (#19408) next »