cvs: phpweb / docs.php error.php /include shared-manual.inc

From: Date: Wed, 13 Sep 2006 18:53:31 +0000
Subject: cvs: phpweb / docs.php error.php /include shared-manual.inc
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-32606@lists.php.net to get a copy of this message
goba Wed Sep 13 18:53:31 2006 UTC Modified files: /phpweb docs.php error.php /phpweb/include shared-manual.inc Log: getting rid of explicit printer-friendly pages: - remove links from the docs page - remove options from the dropdown (this have the side effect that language stickiness is easier to self-solve for users, as they will see the English language selection on top right away - redirect old print, printwn and html URLs to the manual web addresses http://cvs.php.net/viewvc.cgi/phpweb/docs.php?r1=1.135&r2=1.136&diff_format=u Index: phpweb/docs.php diff -u phpweb/docs.php:1.135 phpweb/docs.php:1.136 --- phpweb/docs.php:1.135 Tue Sep 12 20:37:14 2006 +++ phpweb/docs.php Wed Sep 13 18:53:31 2006 @@ -1,5 +1,5 @@ <?php -// $Id: docs.php,v 1.135 2006/09/12 20:37:14 goba Exp $ +// $Id: docs.php,v 1.136 2006/09/13 18:53:31 goba Exp $ $_SERVER['BASE_PAGE'] = 'docs.php'; include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; @@ -58,10 +58,8 @@ <h1>Documentation</h1> <p> - The PHP manual is available online in a selection of languages. - You can choose between the printer friendly and graphically - designed versions. Please pick a language and format from - the table below. + The PHP Manual is available online in a selection of languages. + Please pick a language from the list below. </p> <p> @@ -109,38 +107,6 @@ </td> </tr> <tr> - <th class="sub">Printer friendly</th> - <td> -<?php - -// List printer friendly pages of all manual languages -foreach ($man_languages as $langnum => $langcode) { - if ($langcode == $LANG) { echo "<b>"; } - echo '<a href="/manual/' . $langcode . '/print/index.php">' . $LANGUAGES[$langcode] . '</a>'; - echo ($lastlang != $langnum) ? ",\n" : "\n"; - if ($langcode == $LANG) { echo "</b>"; } -} - -?> - </td> - </tr> - <tr> - <th class="sub">Printer friendly<br />with notes</th> - <td> -<?php - -// List printer friendly pages with notes of all manual languages -foreach ($man_languages as $langnum => $langcode) { - if ($langcode == $LANG) { echo "<b>"; } - echo '<a href="/manual/' . $langcode . '/printwn/index.php">' . $LANGUAGES[$langcode] . '</a>'; - echo ($lastlang != $langnum) ? ",\n" : "\n"; - if ($langcode == $LANG) { echo "</b>"; } -} - -?> - </td> - </tr> - <tr> <th class="sub">Downloads</th> <td> For downloadable formats, please visit our http://cvs.php.net/viewvc.cgi/phpweb/error.php?r1=1.51&r2=1.52&diff_format=u Index: phpweb/error.php diff -u phpweb/error.php:1.51 phpweb/error.php:1.52 --- phpweb/error.php:1.51 Tue Sep 12 12:34:18 2006 +++ phpweb/error.php Wed Sep 13 18:53:31 2006 @@ -1,6 +1,6 @@ <?php -// $Id: error.php,v 1.51 2006/09/12 12:34:18 goba Exp $ +// $Id: error.php,v 1.52 2006/09/13 18:53:31 goba Exp $ /* @@ -58,14 +58,10 @@ // BC: handle moving english manual down into its own directory (also supports // default language manual accessibilty on mirror sites through /manual/filename) if (preg_match("!^manual(/[^/]*)$!", $URI, $array)) { - // Special case for mirror checking - if ($array[1] == 'mirror-info') { - mirror_redirect("/manual/mirror-info.php"); - } mirror_redirect("/manual/$LANG$array[1]"); } elseif (preg_match("!^manual/html/([^/]+)$!", $URI, $array)) { $array[1] = preg_replace("!.html$!", ".php", $array[1]); - mirror_redirect("/manual/$LANG/print/$array[1]"); + mirror_redirect("/manual/$LANG/$array[1]"); } // ============================================================================ @@ -76,42 +72,12 @@ } // ============================================================================ -// Printer friendly manual page handling. It's important that this is included, -// and not redirected, as this way all relative URL's will retain their meaning -// and point to pages relative to the print dir (which is nonexistent) -// We need to override the 404 status in these cases too. -if (preg_match("!^manual/(\\w+)/(print|printwn)/(.+\\.php)$!", $URI, $parts) && - @file_exists($_SERVER['DOCUMENT_ROOT'] . "/manual/$parts[1]/$parts[3]")) { - status_header(200); - if (in_array($parts[2], array('print', 'printwn'))) { - $PRINT_PAGE = TRUE; - if ($parts[2] == "printwn") { $PRINT_NOTES = TRUE; } - } - include $_SERVER['DOCUMENT_ROOT'] . "/manual/$parts[1]/$parts[3]"; - exit; -} - -// BC: for old HTML directory (.html extension was used in that) -elseif (preg_match("!^manual/(\\w+)/html/(.+)\\.(html|php)$!", $URI, $parts) && - @file_exists($_SERVER['DOCUMENT_ROOT'] . "/manual/$parts[1]/$parts[2].php")) { - status_header(200); - $PRINT_PAGE = TRUE; - include $_SERVER['DOCUMENT_ROOT'] . "/manual/$parts[1]/$parts[2].php"; - exit; -} - -// The index file needs to be handled in a special way -elseif (preg_match("!^manual/(\\w+)/(print|printwn|html)(/)?$!", $URI, $parts) && - @file_exists($_SERVER['DOCUMENT_ROOT'] . "/manual/$parts[1]/index.php")) { - status_header(200); - if (in_array($parts[2], array('print', 'printwn', 'html'))) { - $PRINT_PAGE = TRUE; - if ($parts[2] == "printwn") { $PRINT_NOTES = TRUE; } - } else { - $NOTABLE = TRUE; - } - include $_SERVER['DOCUMENT_ROOT'] . "/manual/$parts[1]/index.php"; - exit; +// BC: Printer friendly manual page handling was separate previously, but we +// only need to redirect the old URLs now. Our pages are now printer friendly +// by design. +if (preg_match("!^manual/(\\w+)/(print|printwn|html)((/.+)|$)!", $URI, $array)) { + $array[3] = preg_replace("!.html$!", ".php", $array[3]); + mirror_redirect("/manual/$array[1]$array[3]"); } // ============================================================================ http://cvs.php.net/viewvc.cgi/phpweb/include/shared-manual.inc?r1=1.226&r2=1.227&diff_format=u Index: phpweb/include/shared-manual.inc diff -u phpweb/include/shared-manual.inc:1.226 phpweb/include/shared-manual.inc:1.227 --- phpweb/include/shared-manual.inc:1.226 Wed Sep 13 16:24:14 2006 +++ phpweb/include/shared-manual.inc Wed Sep 13 18:53:31 2006 @@ -1,6 +1,6 @@ <?php // -*- C++ -*- -// $Id: shared-manual.inc,v 1.226 2006/09/13 16:24:14 goba Exp $ +// $Id: shared-manual.inc,v 1.227 2006/09/13 18:53:31 goba Exp $ /* @@ -176,15 +176,11 @@ echo " <div class=\"langchooser\">\n"; if ($location != 'bottom') { + $links = array(); + // Quick access to filename $filename = $PGI['this'][0]; - // Initial two dropdown menu items - $links = array( - array("$LANG/print/$filename", "printer friendly"), - array("$LANG/printwn/$filename", "printer friendly [+notes]") - ); - // Disable all languages without online content $online_languages = array_diff($LANGUAGES, $INACTIVE_ONLINE_LANGUAGES); @@ -199,14 +195,14 @@ // Print out the form with all the options echo ' <form action="/manual/change.php" method="GET">' . "\n" . - ' view the <select name="page">'. "\n"; + ' view this page in <select name="page">'. "\n"; foreach ($links as $link) { echo ' <option value="' . $link[0] . '">' . $link[1] . "</option>\n"; } echo " </select>\n" . ' <input type="image" src="' . $_SERVER['STATIC_ROOT'] . '/images/small_submit.gif" border="0" width="11" height="11" ' . - 'alt="" align="baseline"> version of this page' . "\n </form>\n"; + 'alt="" align="baseline">' . "\n </form>\n"; } else { echo " &nbsp;\n";

« previous php.mirrors (#32606) next »