Skip to content

Commit 3abe40d

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 dropdowns on a few release pages, and corrected an English grammar typo on the PHP 8.1 page. No other content has been changed.
1 parent f5020dd commit 3abe40d

17 files changed

Lines changed: 2406 additions & 3719 deletions

File tree

releases/8.0/common.php

Lines changed: 12 additions & 26 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,28 +56,7 @@ 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-
73-
function message($code, $language = 'en')
59+
function message($code, $language = 'en'): string
7460
{
7561
$original = require __DIR__ . '/languages/en.php';
7662
if (($language !== 'en') && file_exists(__DIR__ . '/languages/' . $language . '.php')) {

0 commit comments

Comments
 (0)