cvs: phpweb / error.php /include shared-manual.inc
| From: | Gabor Hojtsy | Date: | Tue, 12 Sep 2006 12:34:18 +0000 |
| Subject: | cvs: phpweb / error.php /include shared-manual.inc | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-32532@lists.php.net to get a copy of this message | ||
goba Tue Sep 12 12:34:18 2006 UTC
Modified files:
/phpweb error.php
/phpweb/include shared-manual.inc
Log:
Tableless manual. Tested in Firefox 1.5, Opera 9 and Internet Explorer 6 and all seem to work
nicely.
http://cvs.php.net/viewvc.cgi/phpweb/error.php?r1=1.50&r2=1.51&diff_format=u
Index: phpweb/error.php
diff -u phpweb/error.php:1.50 phpweb/error.php:1.51
--- phpweb/error.php:1.50 Sun Sep 10 06:18:03 2006
+++ phpweb/error.php Tue Sep 12 12:34:18 2006
@@ -1,6 +1,6 @@
<?php
-// $Id: error.php,v 1.50 2006/09/10 06:18:03 rasmus Exp $
+// $Id: error.php,v 1.51 2006/09/12 12:34:18 goba Exp $
/*
@@ -42,7 +42,7 @@
// ============================================================================
// Perform a redirect for manual figures, other images display a 404 automatically
-if (preg_match("!^manual/(\\w+)/(print|printwn|tableless)/figures/(.+)$!", $URI, $parts))
{
+if (preg_match("!^manual/(\\w+)/(print|printwn)/figures/(.+)$!", $URI, $parts)) {
mirror_redirect("/manual/$parts[1]/figures/$parts[3]");
} elseif (preg_match("!\\.(pdf|gif|jpg|png)$!i", $URI)) {
error_404();
@@ -80,14 +80,12 @@
// 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|tableless)/(.+\\.php)$!", $URI, $parts)
&&
+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; }
- } else {
- $NOTABLES = TRUE;
}
include $_SERVER['DOCUMENT_ROOT'] . "/manual/$parts[1]/$parts[3]";
exit;
@@ -103,7 +101,7 @@
}
// The index file needs to be handled in a special way
-elseif (preg_match("!^manual/(\\w+)/(print|printwn|html|tableless)(/)?$!", $URI, $parts)
&&
+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'))) {
http://cvs.php.net/viewvc.cgi/phpweb/include/shared-manual.inc?r1=1.222&r2=1.223&diff_format=u
Index: phpweb/include/shared-manual.inc
diff -u phpweb/include/shared-manual.inc:1.222 phpweb/include/shared-manual.inc:1.223
--- phpweb/include/shared-manual.inc:1.222 Tue Sep 5 19:35:15 2006
+++ phpweb/include/shared-manual.inc Tue Sep 12 12:34:18 2006
@@ -1,6 +1,6 @@
<?php // -*- C++ -*-
-// $Id: shared-manual.inc,v 1.222 2006/09/05 19:35:15 goba Exp $
+// $Id: shared-manual.inc,v 1.223 2006/09/12 12:34:18 goba Exp $
/*
@@ -40,7 +40,7 @@
// already set up
function manual_header()
{
- global $PGI, $LAST_UPDATED, $MYSITE, $PRINT_PAGE, $PRINT_NOTES, $NOTABLES;
+ global $PGI, $LAST_UPDATED, $MYSITE, $PRINT_PAGE, $PRINT_NOTES;
// Get values out of the config array
list($filename, $title) = $PGI['this'];
@@ -61,8 +61,6 @@
} else {
$_SERVER['BASE_PAGE'] .= "/print/$filename";
}
- } elseif ($NOTABLES) {
- $_SERVER['BASE_PAGE'] .= "/tableless/$filename";
} else {
$_SERVER['BASE_PAGE'] .= "/$filename";
}
@@ -72,20 +70,15 @@
manual_header_print();
} else {
manual_sidebar();
- if ($NOTABLES) {
- site_header("$title - Manual", array("noindex"));
- manual_navbar_notables();
- } else {
- commonHeader("$title - Manual");
- manual_navbar();
- }
+ site_header("$title - Manual");
+ manual_navbar();
}
}
// Print out manual page footer
function manual_footer()
{
- global $PRINT_PAGE, $PRINT_NOTES, $PGI, $NOTABLES;
+ global $PRINT_PAGE, $PRINT_NOTES, $PGI;
// Get vars for easy handling
list($filename, $title) = $PGI['this'];
@@ -100,13 +93,8 @@
echo "<br /><br />";
manual_notes();
echo "<br />";
- if ($NOTABLES) {
- manual_navbar_notables("bottom");
- site_footer();
- } else {
- manual_navbar("bottom");
- commonFooter();
- }
+ manual_navbar("bottom");
+ site_footer();
}
}
@@ -159,91 +147,10 @@
$SIDEBAR_DATA = "$BAR</ul><!--/UdmComment-->\n";
}
-// Print out manual navigation bar
function manual_navbar($location = "top")
{
global $PGI, $LANG, $LANGUAGES, $INACTIVE_ONLINE_LANGUAGES;
- echo '<!--UdmComment-->' . "\n" .
- '<table border="0" width="100%" bgcolor="#e0e0e0"
' .
- 'cellpadding="0" cellspacing="4">';
-
- // Print link to previous page if available
- echo '<tr><td>';
- if ($PGI['prev'][1]) {
- print_link(
- $PGI['prev'][0],
- make_image('caret-l.gif', '<') . $PGI['prev'][1]
- );
- }
- echo '</td>';
-
- // Print link to next page if available
- echo '<td align="right">';
- if ($PGI['next'][1]) {
- print_link(
- $PGI['next'][0],
- $PGI['next'][1] . make_image('caret-r.gif', '>')
- );
- }
- echo '</td></tr>';
-
- // Print a spacer row
- echo '<tr bgcolor="#cccccc"><td colspan="2">';
- spacer(1,1);
- echo '</td></tr>';
-
- echo '<tr><td>';
-
- // Print out language switch on top of manual pages
- if ($location != 'bottom') {
-
- // 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);
-
- // Add a dropdown item for all languages left
- foreach ($online_languages as $code => $name) {
- if (!preg_match("!/$code/!", $_SERVER['BASE_PAGE'])
- // && file_exists($_SERVER['DOCUMENT_ROOT'] .
"/$code/$filename")
- ) {
- $links[] = array("$code/$filename", $name);
- }
- }
-
- // Print out the form with all the options
- echo '<form action="/manual/change.php" method="GET"
class="thin">' . "\n" .
- '<small>view the </small><select name="page"
class="small">'. "\n";
- foreach ($links as $link) {
- echo '<option value="' . $link[0] . '">' . $link[1]
. "</option>\n";
- }
- echo '</select>';
- echo '<input type="image" src="' .
$_SERVER['STATIC_ROOT'] .
- '/images/small_submit.gif" border="0" width="11"
height="11" ' .
- 'alt="" align="baseline"> <small>version of this
page</small></form>';
-
- } else {
- echo "<small> </small>";
- }
-
- // Provide last updated information on this page
- echo '</td><td align="right"
valign="bottom"><small>Last updated: ' .
- $PGI['lastmod'] . '</small></td></tr>';
- echo "</table>\n<!--/UdmComment-->\n";
-}
-
-function manual_navbar_notables($location = "top")
-{
- global $PGI, $LANG, $LANGUAGES, $INACTIVE_ONLINE_LANGUAGES;
-
// Start navbar with
echo "<!--UdmComment-->\n<div class=\"manualnavbar\">\n <span
class=\"next\">\n";
if ($PGI['next'][1]) {