[web-php] master: Add sidebar to ChangeLog rendering for navigating between versions

From: Date: Fri, 04 Jun 2021 18:52:32 +0000
Subject: [web-php] master: Add sidebar to ChangeLog rendering for navigating between versions
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-29351@lists.php.net to get a copy of this message
Author: Sara Golemon (sgolemon) Date: 2021-06-04T18:52:31Z Commit: https://github.com/php/web-php/commit/99fe519e619fbabd989d6cd4cea706ff775cea2f Raw diff: https://github.com/php/web-php/commit/99fe519e619fbabd989d6cd4cea706ff775cea2f.diff Add sidebar to ChangeLog rendering for navigating between versions Changed paths: M ChangeLog-4.php M ChangeLog-5.php M ChangeLog-7.php M ChangeLog-8.php M include/changelogs.inc Diff: diff --git a/ChangeLog-4.php b/ChangeLog-4.php index 4cf385924..2e8f797d4 100644 --- a/ChangeLog-4.php +++ b/ChangeLog-4.php @@ -3881,4 +3881,6 @@ interface modules (Zeev)</li> <li>First public beta of PHP 4.0</li> </ul> -<?php site_footer(); ?> +<?php + +site_footer(['sidebar' => changelog_sidebar(4)]); diff --git a/ChangeLog-5.php b/ChangeLog-5.php index 56b842380..110be660d 100644 --- a/ChangeLog-5.php +++ b/ChangeLog-5.php @@ -15957,4 +15957,6 @@ functions if "zend" is specified as the module name. (Ilia)</li> </ul> <!-- }}} --></section> -<?php site_footer(); ?> +<?php + +site_footer(['sidebar' => changelog_sidebar(5)]); diff --git a/ChangeLog-7.php b/ChangeLog-7.php index baf721b5a..9b34586fe 100644 --- a/ChangeLog-7.php +++ b/ChangeLog-7.php @@ -10231,4 +10231,6 @@ </ul> <!-- }}} --></section> -<?php site_footer(); ?> +<?php + +site_footer(['sidebar' => changelog_sidebar(7)]); diff --git a/ChangeLog-8.php b/ChangeLog-8.php index fe401a42f..5d99ccc38 100644 --- a/ChangeLog-8.php +++ b/ChangeLog-8.php @@ -753,4 +753,6 @@ </ul> <!-- }}} --></section> -<?php site_footer(); +<?php + +site_footer(['sidebar' => changelog_sidebar(8)]); diff --git a/include/changelogs.inc b/include/changelogs.inc index d0f08440d..e868f9681 100644 --- a/include/changelogs.inc +++ b/include/changelogs.inc @@ -34,4 +34,15 @@ function release_date($in) { echo "<time class='releasedate' datetime='{$for_tools}'>{$human_readable}</time>"; } -?> +function changelog_sidebar(?int $current = null): string { + $majors = [8, 7, 5, 4]; + $ret = "<div class=\"panel\">ChangeLogs<div class=\"body\"><ul>\n"; + foreach ($majors as $major) { + if ($major === $current) { + $ret .= " <li><b>PHP {$major}.x</b></li>\n"; + } else { + $ret .= " <li><a href=\"/ChangeLog-{$major}.php\">PHP {$major}.x</a></li>\n"; + } + } + return $ret .= "</ul></body></body>\n"; +}

« previous php.webmaster (#29351) next »