com web/master: Fixes blank titles showing the trailing dash and adds ability to permit menu-less header without breaking existing code.:
include/functions.inc
| From: | Daniel P. Brown | Date: | Mon, 25 Jun 2012 18:50:34 +0000 |
| Subject: | com web/master: Fixes blank titles showing the trailing dash and adds ability to permit menu-less header without breaking existing code.: include/functions.inc |
||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-13776@lists.php.net to get a copy of this message | ||
Commit: 2749cfa8cacc38a8dc4eb0048c46419853d5ac25
Author: Daniel P. Brown <danbrown@php.net> Mon, 25 Jun 2012 14:50:34 -0400
Parents: fab48b0e2b827afe4044ad0b5e72fbd3d95f271c
Branches: master
Link: http://git.php.net/?p=web/master.git;a=commitdiff;h=2749cfa8cacc38a8dc4eb0048c46419853d5ac25
Log:
Fixes blank titles showing the trailing dash and adds ability to permit menu-less header without
breaking existing code.
Changed paths:
M include/functions.inc
Diff:
diff --git a/include/functions.inc b/include/functions.inc
index 0b07a73..01db823 100644
--- a/include/functions.inc
+++ b/include/functions.inc
@@ -16,7 +16,7 @@ function require_token()
// -----------------------------------------------------------------------------------
-function head($title="") {
+function head($title="",$private=1) { // Default to $private == true to permit no-menu
headers
header("Content-type: text/html; charset=utf-8");
?>
<html>
@@ -28,7 +28,9 @@ function head($title="") {
</head>
<body>
- <h1 id="header"><a href="http://php.net/index.php">PHP: Hypertext
Preprocessor</a> - <?php echo $title ?></h1>
+ <h1 id="header"><a href="http://php.net/index.php">PHP: Hypertext
Preprocessor</a><?php echo !empty($title) ? ' - '.$title : '';
?></h1>
+<?php
+ if ($private) { ?>
<ul id="mainmenu">
<li><a href="/manage/event.php">Events</a></li>
<li><a href="/manage/mirrors.php">Mirrors</a></li>
@@ -40,8 +42,9 @@ function head($title="") {
<li><a href="/manage/users.php?username=<?php echo
$_SESSION['user']; ?>">My php.net Profile</a></li>
<?php } ?>
</ul>
-<?php warn("Have you changed your password yet?"); ?>
<?php
+ warn("Have you changed your password yet?");
+ } // End if ($private)
}
function foot() {