svn: /web/php/trunk/include/ header.inc layout.inc shared-manual.inc
[email protected] (Hannes Magnusson)
| Newsgroups | php.webmaster |
|---|---|
| Message-ID | <[email protected]> |
bjori Sun, 02 Jan 2011 13:37:29 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=306982
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:
U web/php/trunk/include/header.inc
U web/php/trunk/include/layout.inc
U web/php/trunk/include/shared-manual.inc
Modified: web/php/trunk/include/header.inc
===================================================================
--- web/php/trunk/include/header.inc 2011-01-02 12:35:53 UTC (rev 306981)
+++ web/php/trunk/include/header.inc 2011-01-02 13:37:29 UTC (rev 306982)
@@ -5,20 +5,10 @@
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 @@
<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" />
Modified: web/php/trunk/include/layout.inc
===================================================================
--- web/php/trunk/include/layout.inc 2011-01-02 12:35:53 UTC (rev 306981)
+++ web/php/trunk/include/layout.inc 2011-01-02 13:37:29 UTC (rev 306982)
@@ -788,40 +788,38 @@
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;
- case "mailing-lists.php":
- case "sidebars.php":
- case "sites.php":
- case "support.php":
- case "tips.php":
- case "urlhowto.php":
- $curr = "help";
- break;
- }
- }
+ $lang = language_convert($config["lang"]);
+ $curr = $config["current"];
+
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())
Modified: web/php/trunk/include/shared-manual.inc
===================================================================
--- web/php/trunk/include/shared-manual.inc 2011-01-02 12:35:53 UTC (rev 306981)
+++ web/php/trunk/include/shared-manual.inc 2011-01-02 13:37:29 UTC (rev 306982)
@@ -529,7 +529,19 @@
}
$_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]);