Skip to content

Commit 67ae96f

Browse files
committed
Use PHP 8.5 styling for all release pages
Enables dark mode, syntax highlighting of variables, and unified design for all release pages. Release pages prior to 8.5 still lack the Key Features section. Also fixed inconsistent i18n language spelling in the PHP 8.4 release page dropdown. No other content has been changed.
1 parent 0d9b533 commit 67ae96f

15 files changed

Lines changed: 2371 additions & 3713 deletions

File tree

include/layout.inc

Lines changed: 401 additions & 1 deletion
Large diffs are not rendered by default.

releases/8.0/common.php

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,22 @@
2222
];
2323

2424
function common_header(string $description): void {
25-
global $MYSITE;
25+
global $MYSITE, $lang;
2626

2727
$meta_image_path = \htmlspecialchars(
2828
\filter_var($MYSITE . 'images/php8/php_8_released.png', \FILTER_VALIDATE_URL));
2929
$meta_description = \htmlspecialchars($description);
3030

31-
\site_header("PHP 8.0.0 Release Announcement", [
32-
'current' => 'php8',
33-
'css' => ['php8.css'],
31+
$languages = [];
32+
foreach (LANGUAGES as $code => $text) {
33+
$languages[] = ['name' => $text, 'selected' => $lang === $code, 'url' => '/releases/8.0/' . $code . '.php'];
34+
}
35+
36+
\site_header("PHP 8.0 Release Announcement", [
37+
'current' => 'php85',
38+
'css' => ['php85.css'],
39+
'language_switcher' => $languages,
40+
'theme_switcher' => true,
3441
'meta_tags' => <<<META
3542
<meta name="twitter:card" content="summary_large_image" />
3643
<meta name="twitter:site" content="@official_php" />
@@ -49,27 +56,6 @@ function common_header(string $description): void {
4956
]);
5057
}
5158

52-
function language_chooser(string $currentLang): void {
53-
// Print out the form with all the options
54-
echo '
55-
<form action="" method="get" id="changelang" name="changelang">
56-
<fieldset>
57-
<label for="changelang-langs">Change language:</label>
58-
<select onchange="location = this.value + \'.php\'" name="lang" id="changelang-langs">
59-
';
60-
61-
$tab = ' ';
62-
foreach (LANGUAGES as $lang => $text) {
63-
$selected = ($lang === $currentLang) ? ' selected="selected"' : '';
64-
echo $tab, "<option value='$lang'$selected>$text</option>\n";
65-
}
66-
67-
echo ' </select>
68-
</fieldset>
69-
</form>
70-
';
71-
}
72-
7359
function message($code, $language = 'en')
7460
{
7561
$original = require __DIR__ . '/languages/en.php';

0 commit comments

Comments
 (0)