cvs: phpweb(NEW_LOOK_2001) / books.php /include layout.inc shared-manual.inc

From: Date: Thu, 08 Feb 2001 00:47:20 +0000
Subject: cvs: phpweb(NEW_LOOK_2001) / books.php /include layout.inc shared-manual.inc
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-3865@lists.php.net to get a copy of this message
cmv Wed Feb 7 16:47:20 2001 EDT Modified files: (Branch: NEW_LOOK_2001) /phpweb books.php /phpweb/include layout.inc shared-manual.inc Log: changing manual you can now put anything you want in the side bar by setting $SIDEBAR_DATA before calling commonHeader()

Index: phpweb/books.php diff -u phpweb/books.php:1.84.2.4 phpweb/books.php:1.84.2.5 --- phpweb/books.php:1.84.2.4 Wed Feb 7 13:03:14 2001 +++ phpweb/books.php Wed Feb 7 16:47:19 2001 @@ -71,7 +71,7 @@ } echo '<p>'; echo make_link($info_link ? $info_link : $title_link, - make_image('caret-right.gif','>') . 'more info' ); + make_image('caret-rg.gif','>') . 'more info' ); echo "<br>\n"; echo "</p>\n</small>\n"; echo "</td>\n</tr>\n\n"; Index: phpweb/include/layout.inc diff -u phpweb/include/layout.inc:1.1.2.11 phpweb/include/layout.inc:1.1.2.12 --- phpweb/include/layout.inc:1.1.2.11 Wed Feb 7 13:03:14 2001 +++ phpweb/include/layout.inc Wed Feb 7 16:47:19 2001 @@ -1,16 +1,17 @@ <?php -/* $Id: layout.inc,v 1.1.2.11 2001/02/07 21:03:14 cmv Exp $ */ +/* $Id: layout.inc,v 1.1.2.12 2001/02/08 00:47:19 cmv Exp $ */ # spacer() # print a IMG tag for a sized spacer GIF # -function spacer($width=1, $height=1, $align=false) { - printf('<img src="/gifs/spacer.gif" width="%d" height="%d" border="0" alt="" %s>', +function spacer($width=1, $height=1, $align=false, $extras=false) { + printf('<img src="/gifs/spacer.gif" width="%d" height="%d" border="0" alt="" %s%s>', $width, $height, - ($align ? $align : '') + ($align ? 'align="'.$align.'" ' : ''), + ($extras ? $extras : '') ); } @@ -170,13 +171,13 @@ $enclosed = 0; - # commonheader() # # function commonHeader($title="",$dont_enclose=0) { global $MYSITE, $MIRRORS, $COUNTRIES, $enclosed; + global $SIDEBAR_DATA; header("Last-Modified: ".gmdate("D, d M Y H:i:s",getlastmod())." GMT"); ?><html> <head> @@ -239,18 +240,16 @@ $enclosed = 1; ?> -<table width="125" height="100%" bgcolor="#f0f0f0" align="left" cellpadding="0" cellspacing="0"> +<table width="150" height="100%" bgcolor="#f0f0f0" align="left" cellpadding="0" cellspacing="0"> <tr valign="top"> <td> <!-- sidebar table starts --> -<table width="124" align="left" cellpadding="4" cellspacing="0"> +<table width="149" align="left" cellpadding="4" cellspacing="0"> <tr valign="top"> -<td><small> -<p> -Stuff goes in here. -</p> -</small></td> +<td> +<? echo $SIDEBAR_DATA; ?> +</td> </tr> </table> <!-- sidebar table ends --> @@ -263,7 +262,7 @@ <!-- main section --> -<table width="650" +<table width="625" align="left" cellpadding="10" cellspacing="0" ><tr><td valign="top"> @@ -382,5 +381,3 @@ $text = "<tt>".nl2br($text)."</tt>"; return $text; } - - Index: phpweb/include/shared-manual.inc diff -u phpweb/include/shared-manual.inc:1.88.2.1 phpweb/include/shared-manual.inc:1.88.2.2 --- phpweb/include/shared-manual.inc:1.88.2.1 Mon Feb 5 17:05:32 2001 +++ phpweb/include/shared-manual.inc Wed Feb 7 16:47:19 2001 @@ -1,5 +1,5 @@ <?php // -*- C++ -*- -require("shared.inc"); +require_once 'prepend.inc'; $LANGUAGES = array( 'en' => 'English', @@ -18,6 +18,9 @@ $NEXT = $PREV = $UP = $HOME = array(false, false); $TOC = array(); +$SIDEBAR_DATA = ''; + + function setupNavigation($data) { global $NEXT, $PREV, $UP, $HOME, $TOC, $tstamp; $HOME = @$data["home"]; @@ -29,81 +32,115 @@ $tstamp = gmdate("D, d M Y",getlastmod()); } -function makeBorderTOC($this) -{ - global $NEXT, $PREV, $UP, $HOME, $TOC, $PHP_SELF, $DOCUMENT_ROOT; - echo "Top: <b><a href=\"./\">$HOME[1]</a></b><br>\n"; - echo '<form method="GET" action="../../manual-lookup.php">'; -?> - <b><a href="../../quickref.php">quickref:</a></b><br> - <input type="hidden" name="lang" value="$LANG"> - <input type="text" class="small" name="function" size="10"> - <?php echo make_submit('small_submit.gif', 'lookup', 'bottom');?> - </form> -<?php +function makeBorderTOC($this) { + global $NEXT, $PREV, $UP, $HOME, $TOC, $PHP_SELF, $DOCUMENT_ROOT; + global $SIDEBAR_DATA, $LANG; + + $SIDEBAR_DATA = '<form method="GET" action="/manual-lookup.php">' . + $SIDEBAR_DATA.= '<table border="0" CELLPADDING="4" CELLSPACING="0">'; + + $SIDEBAR_DATA.= '<tr valign="top"><td><small>' . + '<input type="hidden" name="lang" value="' . $LANG . '">' . + 'lookup: <input type="text" class="small" name="function" size="10"> ' . + make_submit('small_submit.gif', 'lookup', 'bottom') . + '<br></small></td></tr>'; + + $SIDEBAR_DATA.= '<tr bgcolor="#cccccc"><td></td></tr>'; + + $SIDEBAR_DATA.= '<tr valign="top"><td>' . + make_link('./', make_image('caret-t.gif', $HOME[1]) . $HOME[1] ) . + '<br></td></tr>'; + + $SIDEBAR_DATA.= '<tr bgcolor="#cccccc"><td></td></tr>'; + + if (($HOME[1] != $UP[1]) && $UP[1]) { + $SIDEBAR_DATA.= '<tr valign="top"><td>' . + make_link($UP[0], make_image('caret-u.gif', $UP[1]) . $UP[1] ) . + '<br></td></tr>'; + } - if ($HOME[1] != $UP[1] && $UP[1]) { - echo "Up: <b><a href=\"$UP[0]\">$UP[1]</a></b>\n"; - } + $SIDEBAR_DATA.= '<tr valign="top"><td><small>'; - for ($i = 0; $i < count($TOC); $i++) { - list($url, $title) = $TOC[$i]; - if (!$url || !$title) { - continue; - } - if ($title == $this) { - $type = "w"; - $out = 2; - } else { - $type = "p"; - $out = 0; - } - if ($UP[0] == 'funcref.php') { - $title = eregi_replace(" functions\$", "", $title); + for ($i = 0; $i < count($TOC); $i++) { + list($url, $title) = $TOC[$i]; + if (!$url || !$title) { + continue; + } + $img = 'box-0.gif'; + if ($title == $this) { + $img = 'box-1.gif'; + } + if ($UP[0] == 'funcref.php') { + $title = eregi_replace(" functions\$", "", $title); + } + $SIDEBAR_DATA .= '&nbsp;' . + make_link($url, make_image($img, $title) . $title ) . + '<br>'; } - echo "<li><a href=\"$url\">$title</a></li>"; - } -}; + $SIDEBAR_DATA.= '</small></td></tr>'; + $SIDEBAR_DATA.= '</table></form>'; + +} + function navigationBar($title,$id,$loc) { - global $NEXT, $PREV, $tstamp, $SERVER_NAME,$SERVER_PORT,$PHP_SELF; - echo '<table border="0" width="800" bgcolor="#d0d0d0" cellpadding="4" cellspacing="1"><tr>'; - if ($loc == "bottom") { - echo "<td align=\"middle\" colspan=\"3\">"; - $back_url = "http://$SERVER_NAME".(($SERVER_PORT==80)?"":":".$SERVER_PORT).$PHP_SELF; - echo "<a href=\"../add-note.php?sect=$id&amp;redirect=$back_url\">add note</a> | "; - echo "<a href=\"../about-notes.php\">about notes</a>"; - echo "</td></tr><tr>"; - } - echo "<td align=\"left\" width=\"44%\">"; - if ($PREV[1]) { - echo "Previous: <a href=\"$PREV[0]\">$PREV[1]</a>"; - } - echo "&nbsp;</td>\n"; - echo "<td align=\"center\" width=\"12%\">Updated<br>$tstamp</td>\n"; - echo "<td align=\"right\" width=\"44%\">&nbsp;"; - if ($NEXT[1]) { - echo "Next: <a href=\"$NEXT[0]\">$NEXT[1]</a>"; - } - echo "</td>\n"; - if ($loc == "top") { - echo "</tr><tr>"; - echo "<td colspan=\"3\" align=\"center\">"; - $file = substr($id,0,-4); - echo "View this page in: "; - global $LANGUAGES; - while (list($code,$name) = each($LANGUAGES)) { - if (file_exists("../$code/$id")) { - echo "<a href=\"../$code/$id\">$name</a> | "; - } - } - if (file_exists("html/$file.html")) { - echo "<a href=\"html/$file.html\">Plain HTML </a>"; - } - } - echo "</tr></table>\n"; + global $NEXT, $PREV, $tstamp, $SERVER_NAME,$SERVER_PORT,$PHP_SELF; + + echo '<table border="0" width="620" bgcolor="#e0e0e0" cellpadding="0" cellspacing="4">'; + + echo '<tr>'; + echo '<td align="left">'; + if ($PREV[1]) { + echo make_link( $PREV[0] , make_image('caret-l.gif', 'previous') . $PREV[1] ) ; + } + echo '<br></td>'; + + echo '<td align="right">'; + if ($NEXT[1]) { + echo make_link( $NEXT[0] , $NEXT[1] . make_image('caret-r.gif', 'next') ) ; + } + echo '<br></td>'; + echo '</tr>'; + + echo '<tr bgcolor="#cccccc"><td colspan="2">'; + spacer(1,1); + echo '<br></td></tr>'; + + echo '<tr>'; + echo '<td align="right" colspan="2"><small>Last updated: '.$tstamp.'<br>'; + + if ($loc == 'bottom') { + + $back_url = 'http://' . $SERVER_NAME . + (($SERVER_PORT==80) ? '' : ':'.$SERVER_PORT ) . + $PHP_SELF; + print_link('/manual/add-note.php?sect='.$id.'&redirect='.$back_url, 'add note',false,'class="small"'); + echo delim(); + print_link('/manual/about-notes.php', 'about notes',false,'class="small"',false,'class="small"'); + + } else { + + global $LANGUAGES; + $links = array(); + foreach($LANGUAGES as $code=>$name) { + if (file_exists("../$code/$id")) { + $links[] = make_link("../$code/$id", $name); + } + } + $file = substr($id,0,-4); + if (file_exists("html/$file.html")) { + $links[] = make_link("html/$file.html", 'Plain HTML'); + } + if (count($links)) { + echo 'view this page in ' . join (delim(), $links); + } + } + + echo '<br></small></td></tr>'; + echo "</table>\n"; + } @@ -226,31 +263,23 @@ } function manualHeader($title,$id="") { - global $HTDIG, $LANGUAGES, $LANG; + global $HTDIG, $LANGUAGES, $LANG, $SIDEBAR_DATA; manualLastModified($title,$id); - commonHeader("Manual: $title", 1); + makeBorderTOC($title); + commonHeader('Manual: '.$title); # create links to plain html and other languages - if (!$HTDIG): + if (!$HTDIG) { navigationBar($title, $id, "top"); - endif; - echo '<table width="800" border="0" cellpadding="4" cellspacing="1">'; - echo '<tr>'; - echo '<td valign="top">'; + } } function manualFooter($title,$id="") { - if (!$HTDIG): - manualUserNotes($title,$id); - endif; - echo '</td>'; - echo '<td valign="top" bgcolor="#e0e0e0">'; - makeBorderTOC($title); - echo '</td>'; - echo '</tr></table><!--HITHERE-->'; global $HTDIG; - if (!$HTDIG): + if (!$HTDIG) { + manualUserNotes($title,$id); navigationBar($title, $id, "bottom"); - endif; - commonFooter($title); + } + commonFooter(); + } ?>
« previous php.mirrors (#3865) next »