Commit: 8fb9b79ca8779fae61c57d54f072212d9cc9382a
Author: Levi Morrison <[email protected]> Sun, 27 Apr 2014 23:14:11 -0600
Parents: d216fe9e02f0c3c143f999b498098922de48930c
Branches: master
Link:
http://git.php.net/?p=web/php.git;a=commitdiff;h=8fb9b79ca8779fae61c57d54f072212d9cc9382a
Log:
Related functions now on right; some homepage fixes.
Changed paths:
M include/footer.inc
M include/header.inc
M include/shared-manual.inc
M index.php
M styles/home.css
M styles/theme-base.css
M styles/theme-medium.css
diff --git a/include/footer.inc b/include/footer.inc
index 369663c..4eb0870 100644
--- a/include/footer.inc
+++ b/include/footer.inc
@@ -7,12 +7,41 @@
}
?>
-<?php if (!empty($config['sidebar'])): ?>
- <aside class="tips">
- <div class="inner"><?php echo $config['sidebar']; ?></div>
+<?php if (!empty($config['related_menu'])): ?>
+ <aside class='layout-menu'>
+
+ <ul class='parent-menu-list'>
+ <?php foreach($config['related_menu'] as $section): ?>
+ <li>
+ <a href="<?php echo $section['link']; ?>"><?php echo
$section['title']; ?></a>
+
+ <?php if ($section['children']): ?>
+ <ul class='child-menu-list'>
+
+ <?php
+ foreach($section['children'] as $item):
+ $cleanTitle = $item['title'];
+ ?>
+ <li class="<?php echo ($item['current']) ? 'current' :
''; ?>">
+ <a href="<?php echo $item['link']; ?>"
title="<?php echo $cleanTitle; ?>"><?php echo $cleanTitle; ?></a>
+ </li>
+ <?php endforeach; ?>
+
+ </ul>
+ <?php endif; ?>
+
+ </li>
+ <?php endforeach; ?>
+ </ul>
</aside>
<?php endif; ?>
+<?php if (!empty($config['sidebar'])): ?>
+<aside class="tips">
+ <div class="inner"><?php echo $config['sidebar']; ?></div>
+</aside>
+<?php endif; ?>
+
</div><!-- layout -->
<footer>
diff --git a/include/header.inc b/include/header.inc
index 71d19ae..e7d7b15 100644
--- a/include/header.inc
+++ b/include/header.inc
@@ -156,34 +156,4 @@ if ($config["cache"]) {
<div id="layout">
-
-<?php if (!empty($config["leftmenu"])): ?>
- <aside class='layout-menu'>
-
- <ul class='parent-menu-list'>
- <?php foreach($config['leftmenu'] as $section): ?>
- <li>
- <a href="<?php echo $section['link']; ?>"><?php echo
$section['title']; ?></a>
-
- <?php if ($section['children']): ?>
- <ul class='child-menu-list'>
-
- <?php
- foreach($section['children'] as $item):
- $cleanTitle = $item['title'];
- ?>
- <li class="<?php echo ($item['current']) ? 'current' :
''; ?>">
- <a href="<?php echo $item['link']; ?>"
title="<?php echo $cleanTitle; ?>"><?php echo $cleanTitle; ?></a>
- </li>
- <?php endforeach; ?>
-
- </ul>
- <?php endif; ?>
-
- </li>
- <?php endforeach; ?>
- </ul>
- </aside>
-<?php endif; ?>
-
-<section id="layout-content">
+ <section id="layout-content">
diff --git a/include/shared-manual.inc b/include/shared-manual.inc
index b66003c..8fc2c08 100644
--- a/include/shared-manual.inc
+++ b/include/shared-manual.inc
@@ -314,50 +314,42 @@ USER_NOTE_TEXT;
}
-// Set up variables important for this page
-// including HTTP header information
-function manual_setup($setup) {
- global $PGI, $MYSITE, $USERNOTES;
-
- $PGI = $setup;
- // Set base href for this manual page
- $_SERVER['BASE_PAGE'] = 'manual/' . language_convert($setup['head'][1]) .
"/" . $setup['this'][0];
- $_SERVER['BASE_HREF'] = $MYSITE . $_SERVER['BASE_PAGE'];
- // Load user note for this page
- list($filename, $title) = $PGI['this'];
-
- // Drop file extension from the name
- if (substr($filename, -4) == '.php') {
- $filename = substr($filename, 0, -4);
- }
- $USERNOTES = manual_notes_load($filename);
- $note = current($USERNOTES);
- $lastusernote = $note["xwhen"];
+function manual_navigation_breadcrumbs(array $setup) {
+ $menu = array();
+ foreach(array_reverse($setup["parents"]) as $parent) {
+ $menu[] = array(
+ "title" => $parent[1],
+ "link" => $parent[0],
+ );
+ }
+ // The index manual page has no parent..
+ if ($setup["up"][0]) {
+ $last_item = array(
+ "title" => $setup["up"][1],
+ "link" => $setup["up"][0],
+ );
+ $menu[] = $last_item;
+ }
+ return $menu;
+}
+function manual_navigation_related(array $setup) {
$siblings = array();
foreach($setup["toc"] as $entry) {
// We strip out any class prefix here, we only want method names
$methodname = $entry[1];
if(strpos($entry[1], '::') !== false && strpos($entry[1], ' ') ===
false) {
- list($classname, $methodname) = explode('::', $entry[1]);
- }
+ list($classname, $methodname) = explode('::', $entry[1]);
+ }
//add zero-width spaces to allow line-breaks at various characters
$methodname = str_replace(array('-','_'),
array('-​','_​'), $methodname);
$siblings[] = array(
"title" => $methodname,
"link" => $entry[0],
"current" => $setup["this"][0] == $entry[0],
- );
- }
-
- $menu = array();
- foreach(array_reverse($setup["parents"]) as $parent) {
- $menu[] = array(
- "title" => $parent[1],
- "link" => $parent[0],
- );
+ );
}
// The index manual page has no parent..
@@ -367,9 +359,35 @@ function manual_setup($setup) {
"link" => $setup["up"][0],
);
$siblings = array(array_merge($last_item, array("children" =>
$siblings)));
- $menu[] = $last_item;
}
-
+ return $siblings;
+}
+
+
+// Set up variables important for this page
+// including HTTP header information
+function manual_setup($setup) {
+ global $PGI, $MYSITE, $USERNOTES;
+
+ //TODO: get rid of this hack to get the related items into manual_footer
+ global $__RELATED;
+
+ $PGI = $setup;
+ // Set base href for this manual page
+ $_SERVER['BASE_PAGE'] = 'manual/' . language_convert($setup['head'][1]) .
"/" . $setup['this'][0];
+ $_SERVER['BASE_HREF'] = $MYSITE . $_SERVER['BASE_PAGE'];
+
+ // Load user note for this page
+ list($filename, $title) = $PGI['this'];
+
+ // Drop file extension from the name
+ if (substr($filename, -4) == '.php') {
+ $filename = substr($filename, 0, -4);
+ }
+ $USERNOTES = manual_notes_load($filename);
+ $note = current($USERNOTES);
+ $lastusernote = $note["xwhen"];
+
$base = "manual/" . $setup["head"][1] . "/";
$_SERVER["BASE_PAGE"] = "/" . $base . $setup["this"][0];
$timestamps = array(
@@ -380,10 +398,12 @@ function manual_setup($setup) {
);
$lastmod = max($timestamps);
+ $breadcrumbs = manual_navigation_breadcrumbs($setup);
+ $__RELATED = manual_navigation_related($setup);
+
$config = array(
"current" => "docs",
- "leftmenu" => $siblings,
- "breadcrumbs" => $menu,
+ "breadcrumbs" => $breadcrumbs,
"meta-navigation" => array(
"contents" => $base . $setup["home"][0],
"index" => $base . $setup["up"][0],
@@ -452,11 +472,13 @@ CHANGE_LANG;
function manual_header(){}
function manual_footer() {
- global $USERNOTES;
+ global $USERNOTES, $__RELATED;
manual_notes($USERNOTES);
echo "</section>";
- $config = array();
+ $config = array(
+ 'related_menu' => $__RELATED
+ );
site_footer($config);
}
diff --git a/index.php b/index.php
index 2c49e36..9666739 100644
--- a/index.php
+++ b/index.php
@@ -92,7 +92,6 @@ $intro = <<<EOF
<p>Fast, flexible and pragmatic, PHP powers everything from your blog to
the most popular websites in the world.</p>
</div>
<div class="download">
- <h2><a href="/downloads.php">Download PHP</a></h2>
EOF;
if(!empty($RELEASES[5])) {
diff --git a/styles/home.css b/styles/home.css
index 426c908..5410821 100644
--- a/styles/home.css
+++ b/styles/home.css
@@ -3,7 +3,7 @@
complimentary greens: 9FB553 7B8851 61761B C6DA82 CCDA99
*/
-#intro {
+#intro p{
color:#fff;
}
#intro p,
@@ -11,12 +11,15 @@ complimentary greens: 9FB553 7B8851 61761B C6DA82
CCDA99
text-shadow:0 1px 2px rgba(0,0,0,.5);
font-size:1.125rem;
}
+#intro .row .blurb p:first-child {
+ margin-top:1.5rem;
+}
#intro .row .blurb,
#intro .row .download {
display:table-cell;
float:none;
vertical-align: middle;
- padding:.75em 1.5rem 0;
+ padding:0 1.5rem;
}
#intro h2 {
color:#ccc;
@@ -38,6 +41,10 @@ complimentary greens: 9FB553 7B8851 61761B C6DA82
CCDA99
list-style:none;
word-spacing:.25rem;
margin-left:0;
+ margin-top:1.5rem;
+}
+#intro .download {
+ text-align:center;
}
#intro .download a.notes {
font-size:.75em;
@@ -55,9 +62,6 @@ complimentary greens: 9FB553 7B8851 61761B C6DA82
CCDA99
#intro .download a.download-link {
color:#fff;
}
-#intro .download a.download-link:before {
- content: "\21AF \2003";
-}
#layout-content {
border-right:.25rem solid #666;
diff --git a/styles/theme-base.css b/styles/theme-base.css
index 7a87366..ccf763e 100755
--- a/styles/theme-base.css
+++ b/styles/theme-base.css
@@ -1438,13 +1438,14 @@ div.soft-deprecation-notice blockquote.sidebar {
}
#breadcrumbs .prev {
- -moz-box-sizing: border-box;
- box-sizing: border-box;
+ float:left;
}
#breadcrumbs .next {
- float: right;
-}
-@media (max-width:767px) {
+ float: right;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ width:25%;
+ text-align:right;
}
@media (min-width: 768px) {
@@ -1460,7 +1461,6 @@ div.soft-deprecation-notice blockquote.sidebar {
#breadcrumbs {
display:block;
}
- #breadcrumbs .prev,
.navbar-search,
#intro .download,
#intro .background,
@@ -1698,6 +1698,9 @@ aside.tips p {
aside.tips .panel {
margin:0 0 1.5rem;
}
+aside.tips .panel .body {
+ font-size:.875rem;
+}
aside.tips a {
color:#ccc;
@@ -1706,9 +1709,9 @@ aside.tips a {
aside.tips .panel > a {
display: block;
}
-aside.tips .panel > a:hover,
-aside.tips .panel > a:focus {
- color:#369;
+aside.tips a:hover,
+aside.tips a:focus {
+ color:#AE508D;
}
/* Announcement Area */
diff --git a/styles/theme-medium.css b/styles/theme-medium.css
index cce45be..ec7c75e 100755
--- a/styles/theme-medium.css
+++ b/styles/theme-medium.css
@@ -16,10 +16,8 @@ html {
background: #333 url('/images/bg-texture-00.svg');
color: #CCC;
}
-.layout-menu + #layout-content {
- border-left:.25rem solid #666;
-}
#layout-content {
+ border-right:.25rem solid #666;
background:#F2F2F2;
color:#333;
}--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php