cvs: phpweb /include layout.inc shared-manual.inc
| From: | Gabor Hojtsy | Date: | Mon, 21 Jul 2003 13:14:33 +0000 |
| Subject: | cvs: phpweb /include layout.inc shared-manual.inc | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-19432@lists.php.net to get a copy of this message | ||
goba Mon Jul 21 09:14:33 2003 EDT
Modified files:
/phpweb/include layout.inc shared-manual.inc
Log:
Also specify BASE_PAGE on manual pages, so it can
be used to print out the show source link properly on pages
accessed with shortcuts
Use the BASE_HREF on manual pages to provide a backlink
to the previous page after user note submissions, so thse
will work from shortcut accessed pages too
These two fixes hopefully close all the problems related to
manual URL shortcut page displays
Index: phpweb/include/layout.inc
diff -u phpweb/include/layout.inc:1.170 phpweb/include/layout.inc:1.171
--- phpweb/include/layout.inc:1.170 Sun Jul 20 09:44:36 2003
+++ phpweb/include/layout.inc Mon Jul 21 09:14:33 2003
@@ -1,5 +1,5 @@
<?php
-/* $Id: layout.inc,v 1.170 2003/07/20 13:44:36 goba Exp $ */
+/* $Id: layout.inc,v 1.171 2003/07/21 13:14:33 goba Exp $ */
// Set the static content root differently on php.net
$_SERVER['STATIC_ROOT'] = ($MYSITE == 'http://www.php.net/') ?
@@ -302,6 +302,8 @@
function commonFooter() {
global $SCRIPT_NAME, $MYSITE, $LAST_UPDATED, $PHP_SELF,
$enclosed, $RSIDEBAR_DATA, $page_creation_start;
+
+ $URL = (isset($_SERVER['BASE_PAGE']) ? "/" .
$_SERVER['BASE_PAGE'] : $SCRIPT_NAME);
if ($enclosed) {
echo "</td></tr></table></td>";
if (!empty($RSIDEBAR_DATA)) { ?>
@@ -323,7 +325,7 @@
<tr bgcolor="#9999cc">
<td align="right" valign="bottom">
<?php
- print_link('/source.php?url='.$SCRIPT_NAME, 'show source', false,
'class="small"');
+ print_link("/source.php?url=$URL", 'show source', false,
'class="small"');
echo delim();
print_link('/credits.php', 'credits', false,
'class="small"');
echo delim();
Index: phpweb/include/shared-manual.inc
diff -u phpweb/include/shared-manual.inc:1.199 phpweb/include/shared-manual.inc:1.200
--- phpweb/include/shared-manual.inc:1.199 Sun Jul 20 09:44:36 2003
+++ phpweb/include/shared-manual.inc Mon Jul 21 09:14:33 2003
@@ -221,18 +221,15 @@
// Print out all user notes for this manual page
function manualUserNotes($title, $id) {
- global $PHP_SELF, $MYSITE;
-
# don't want .php at the end of the id.
if (substr($id,-4) == '.php') $id = substr($id,0,-4);
$notes = manualGetUserNotes($title, $id);
- $back_url = substr($MYSITE, 0, -1) . $PHP_SELF;
-
// Link target to add a note to the current manual page,
// and it's extended form with a [+] image
- $addnotelink = '/manual/add-note.php?sect=' . $id . '&redirect=' .
$back_url;
+ $addnotelink = '/manual/add-note.php?sect=' . $id .
+ '&redirect=' . $_SERVER['BASE_HREF'];
$addnotesnippet =
make_link($addnotelink, make_image('notes-add.gif', 'add a note')) .
' <small>' .
@@ -288,7 +285,8 @@
// Set initial base for this manual page
// [will be extended in manualHeader()!]
- $_SERVER['BASE_HREF'] = $MYSITE . 'manual/' . language_convert($lang);
+ $_SERVER['BASE_PAGE'] = 'manual/' . language_convert($lang);
+ $_SERVER['BASE_HREF'] = $MYSITE . $_SERVER['BASE_PAGE'];
}
// Print out manual page header.
@@ -306,9 +304,11 @@
}
if ($PRINT_PAGE) {
+ $_SERVER['BASE_PAGE'] .= "/print/$filename";
$_SERVER['BASE_HREF'] .= "/print/$filename";
manualPrintHeader($title);
} else {
+ $_SERVER['BASE_PAGE'] .= "/$filename";
$_SERVER['BASE_HREF'] .= "/$filename";
makeBorderTOC($filename);
commonHeader ($title. " - Manual");