com web/php: - Setup default "layout" configuration values properly - Remove outdated workaround for 'current menu item' - Disable static.php.net
(unsure what stuff is actually there, and why) - Add back meta navigation links for documentations: include/header.inc include/layout.inc
include/shared-manual.inc
| From: | Paul Dragoonis | Date: | Sun, 02 Jan 2011 13:37:29 +0000 |
| Subject: | com web/php: - Setup default "layout" configuration values properly - Remove outdated workaround for 'current menu item' - Disable static.php.net (unsure what stuff is actually there, and why) - Add back meta navigation links for documentations: include/header.inc include/layout.inc include/shared-manual.inc |
||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-23668@lists.php.net to get a copy of this message | ||
Commit: bd55d4af5dbf6e929edc5366525d6c0333ffb9fd
Author: Hannes Magnusson <bjori@php.net> Sun, 2 Jan 2011 13:37:29 +0000
Parents: 7d6d11e59d23aeb2998e801a83abe844bf54ae91
Branches: master
Link: http://git.php.net/?p=web/php.git;a=commitdiff;h=bd55d4af5dbf6e929edc5366525d6c0333ffb9fd
Log:
- Setup default "layout" configuration values properly
- Remove outdated workaround for 'current menu item'
- Disable static.php.net (unsure what stuff is actually there, and why)
- Add back meta navigation links for documentations
Changed paths:
M include/header.inc
M include/layout.inc
M include/shared-manual.inc
Diff:
diff --git a/include/header.inc b/include/header.inc
index 9074caf..1b00cdb 100644
--- a/include/header.inc
+++ b/include/header.inc
@@ -5,20 +5,10 @@ header("Expires: Thu, 19 Nov 1981 08:52:00 GMT");
header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0");
header("Pragma: no-cache");
-// shorturl; http://wiki.snaplog.com/short_url
-if ($shortname = get_shortname($_SERVER["BASE_PAGE"])) {
- $shorturl = "http://php.net/" . $shortname;
+if ($shortname) {
header("Link: <$shorturl>; rel=shorturl");
}
-// For static content
-// FIXME: How does static.php.net work? Will it get the /js/ folders?
-$STATIC_ROOT = "/";
-if ($MYSITE == "http://www.php.net/") {
- $STATIC_ROOT = "http://static.php.net/www.php.net/";
-} elseif (!empty($_SERVER["STATIC_ROOT"])) {
- $STATIC_ROOT = $_SERVER["STATIC_ROOT"];
-}
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="<?php
echo $lang?>">
@@ -32,10 +22,13 @@ if ($MYSITE == "http://www.php.net/") {
<link rel="search" type="application/opensearchdescription+xml"
href="http://www.php.net/phpnetimprovedsearch.src"
title="Add PHP.net search" />
<link rel="alternate" type="application/atom+xml" href="<?php echo
$MYSITE ?>releases.atom" title="PHP Release feed" />
<link rel="alternate" type="application/atom+xml" href="<?php echo
$MYSITE ?>feed.atom" title="PHP: Hypertext Preprocessor" />
- <link rel="canonical" href="http://php.net<?php echo
$_SERVER['BASE_PAGE']?>" />
+ <link rel="canonical" href="http://php.net/<?php echo
$_SERVER['BASE_PAGE']?>" />
<?php if ($shortname): ?>
<link rel="shorturl" href="<?php echo $shorturl ?>" />
<?php endif ?>
+<?php foreach($config["meta-navigation"] as $rel => $page): ?>
+ <link rel="<?php echo $rel ?>" href="<?php echo $MYSITE ?><?php
echo $page ?>" />
+<?php endforeach ?>
<link rel="stylesheet" type="text/css" href="<?php echo
$STATIC_ROOT ?>styles/reset.css<?php echo $v?>" media="all" />
<link rel="stylesheet" type="text/css" href="<?php echo
$STATIC_ROOT ?>styles/structure.css<?php echo $v?>" media="screen" />
diff --git a/include/layout.inc b/include/layout.inc
index 6979362..043a76f 100644
--- a/include/layout.inc
+++ b/include/layout.inc
@@ -788,40 +788,38 @@ EOT;
function site_header_beta($title = '', $config = array())
{
global $SIDEBAR_DATA;
- global $setup;
global $MYSITE;
- if ($setup) {
- $lang = language_convert($setup['head'][1]);
- }
- else {
- $lang = myphpnet_language();
- }
+ $defaults = array(
+ "lang" => myphpnet_language(),
+ "current" => "",
+ "meta-navigation" => array(),
+ );
- if (isset($config["current"])) {
- $curr = $config["current"];
- }
- else {
- switch($_SERVER["BASE_PAGE"]) {
- case "privacy.php":
- default:
- $curr = "";
- break;
+ $config += $defaults;
+
+ $lang = language_convert($config["lang"]);
+ $curr = $config["current"];
- case "mailing-lists.php":
- case "sidebars.php":
- case "sites.php":
- case "support.php":
- case "tips.php":
- case "urlhowto.php":
- $curr = "help";
- break;
- }
- }
if (empty($title)) {
$title = "Hypertext Preprocessor";
}
+ // shorturl; http://wiki.snaplog.com/short_url
+ if ($shortname = get_shortname($_SERVER["BASE_PAGE"])) {
+ $shorturl = "http://php.net/" . $shortname;
+ }
+
+ // For static content
+ // FIXME: How does static.php.net work? Will it get the /js/ folders?
+ if (false && $MYSITE == "http://www.php.net/") {
+ $STATIC_ROOT = "http://static.php.net/www.php.net/";
+ } elseif (!empty($_SERVER["STATIC_ROOT"])) {
+ $STATIC_ROOT = $_SERVER["STATIC_ROOT"];
+ } else {
+ $STATIC_ROOT = "/";
+ }
+
require dirname(__FILE__) ."/header.inc";
}
function site_footer_beta($config = array())
diff --git a/include/shared-manual.inc b/include/shared-manual.inc
index b9f46b9..575655c 100644
--- a/include/shared-manual.inc
+++ b/include/shared-manual.inc
@@ -529,7 +529,19 @@ function manual_setup_beta($setup) {
}
$_SERVER["BASE_PAGE"] = "/manual/" . $setup["head"][1] .
"/" . $setup["this"][0];
- site_header($setup["this"][1] . " - Manual ", array("current"
=> "docs", "leftmenu" => $menu));
+
+ $config = array(
+ "current" => "docs",
+ "leftmenu" => $menu,
+ "meta-navigation" => array(
+ "contents" => $setup["home"][0],
+ "index" => $setup["up"][0],
+ "prev" => $setup["prev"][0],
+ "next" => $setup["next"][0],
+ ),
+ "lang" => $setup["head"][1],
+ );
+ site_header($setup["this"][1] . " - Manual ", $config);
echo '<aside id="quicktoc"></aside>';
manual_language_chooser($setup['head'][1], $setup['this'][0]);