diff --git a/Gruntfile.js b/Gruntfile.js index 31028034c280f..5519f0b583e1f 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -811,7 +811,7 @@ window.errorLocale = {`; }`; // Write the file - grunt.file.write('installation/template/js/error-locales.js', template); + grunt.file.write('templates/system/js/error-locales.js', template); }); }; diff --git a/administrator/index.php b/administrator/index.php index ae41f14457b38..cf170d34a22b2 100644 --- a/administrator/index.php +++ b/administrator/index.php @@ -17,7 +17,7 @@ if (version_compare(PHP_VERSION, JOOMLA_MINIMUM_PHP, '<')) { - die('Your host needs to use PHP ' . JOOMLA_MINIMUM_PHP . ' or higher to run this version of Joomla!'); + die(str_replace(['{{PHP_VERSION}}', '{{BASEPATH}}'], [JOOMLA_MINIMUM_PHP, 'http://' . $_SERVER['SERVER_NAME'] . '/'], file_get_contents(dirname(__FILE__) . '/../templates/system/incompatible.html'))); } /** diff --git a/index.php b/index.php index 4d1c9c8b9e624..a3688abb13e4b 100644 --- a/index.php +++ b/index.php @@ -17,7 +17,7 @@ if (version_compare(PHP_VERSION, JOOMLA_MINIMUM_PHP, '<')) { - die('Your host needs to use PHP ' . JOOMLA_MINIMUM_PHP . ' or higher to run this version of Joomla!'); + die(str_replace(['{{PHP_VERSION}}', '{{BASEPATH}}'], [JOOMLA_MINIMUM_PHP, 'http://' . $_SERVER['SERVER_NAME'] . '/'], file_get_contents(dirname(__FILE__) . '/templates/system/incompatible.html'))); } /** diff --git a/installation/index.php b/installation/index.php index 5e0bd447fdfda..a9742ea5f9552 100644 --- a/installation/index.php +++ b/installation/index.php @@ -17,7 +17,7 @@ if (version_compare(PHP_VERSION, JOOMLA_MINIMUM_PHP, '<')) { - die(str_replace('{{PHP_VERSION}}', JOOMLA_MINIMUM_PHP, file_get_contents(dirname(__FILE__) . '/template/incompatible.html'))); + die(str_replace(['{{PHP_VERSION}}', '{{BASEPATH}}'], [JOOMLA_MINIMUM_PHP, 'http://' . $_SERVER['SERVER_NAME'] . '/'], file_get_contents(dirname(__FILE__) . '/../templates/system/incompatible.html'))); } /** diff --git a/installation/language/en-US/en-US.ini b/installation/language/en-US/en-US.ini index db2c3ced7b193..7c22c90236ca9 100644 --- a/installation/language/en-US/en-US.ini +++ b/installation/language/en-US/en-US.ini @@ -5,7 +5,7 @@ ;Minimum PHP error page ;These will be processed by Grunt -MIN_PHP_ERROR_LANGUAGE="English GB" +MIN_PHP_ERROR_LANGUAGE="English US" MIN_PHP_ERROR_HEADER="Sorry, your PHP version is not supported" MIN_PHP_ERROR_TEXT="Your host needs to use PHP version {{phpversion}} or newer to run this version of Joomla" MIN_PHP_ERROR_URL_TEXT="Help me resolve this" diff --git a/installation/template/css/error.css b/installation/template/css/error.css deleted file mode 100644 index 7e88430afeb06..0000000000000 --- a/installation/template/css/error.css +++ /dev/null @@ -1,161 +0,0 @@ -body { - margin: 0; - padding: 0; - font: 14px / 18px sans-serif; - color: #555; - background-color: transparent -} - -html { - background-color: #3a92c8; - background: radial-gradient(circle, #fdfdfd, #f1f1f1); - background-repeat: no-repeat; - background-attachment: fixed; - * background-image: none -} - -ol, ul { - padding: 0; - margin: 0; - list-style: none -} - -a { - color: #0084b4; - text-decoration: none; - outline: 0 -} - -a:hover, a:focus { - text-decoration: underline -} - -p a { - line-height: inherit -} - -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - position: relative; - margin: 0 auto; - width: 100%; - height: 100vh; - overflow: hidden; -} - -.alert-main { - display: block; - position: relative; - background: #fff; - border: 1px solid rgba(0,0,0,0.1); - border-radius: 5px; - padding: 20px 60px; - margin: 0 20px; - box-shadow: 0 0 10px rgba(0,0,0,0.05); -} - -svg { - position: absolute; - bottom: -120px; - right: -70px; - width: 400px; - transform: rotate(10deg); - z-index: -1; -} - -h1, p { - position: relative; - z-index: 10; - text-align: center; - text-rendering: optimizeLegibility -} - -h1 { - margin: 18px 0 0; - font-size: 40px; - font-weight: 200; - line-height: 1; - text-shadow: 0 1px 2px rgba(0, 0, 0, .2) -} - -p, label { - margin: 10px 0 20px; - font-size: 18px; - font-weight: 300; - line-height: 25px; - color: #777 -} - -p a { - font-weight: bold; - color: #1C3D5C -} - -.link-help { - padding: .4rem .85rem; - font-size: 1rem; - font-weight: normal; - border-radius: .25rem; - text-decoration: none; - background-color: #f5f5f5; - border: 1px solid rgba(0,0,0,0.1); -} -.link-help:hover { - background-color: #eee; - text-decoration: none; -} - -.footer { - margin: 8px 20px; - text-align: left; - font-size: 11px -} - -.footer ul { - margin-bottom: 5px; -} - -.footer li { - display: inline; - margin: 0 5px; - line-height: 20px -} - -.footer li, .footer a { - color: #1C3D5C -} - -.footer a:hover { - color: #59B0FF -} - -.links { - display: block; - text-align: center; - margin-top: 4rem; - margin-left: auto; - margin-right: auto; - font-size: 1rem -} -.links li { - display: inline-block; - margin-top: 20px; -} - -@media screen and (max-width:480px) { - .container { - height: auto; - padding-top: 20px; - padding-bottom: 20px; - } - h1 { - font-size: 30px - } - - .link-help { - white-space: nowrap; - } -} diff --git a/installation/template/incompatible.html b/installation/template/incompatible.html deleted file mode 100644 index 31c6ec9c473c3..0000000000000 --- a/installation/template/incompatible.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - Joomla Installation Error - - - - - -
-
-
-

Sorry, your PHP version is not supported

-

Your host needs to use PHP version {{PHP_VERSION}} or newer to run this version of Joomla!

-

Help me resolve this

- - - - - - - - -
- -
-
- - - - \ No newline at end of file diff --git a/installation/template/js/error.js b/installation/template/js/error.js deleted file mode 100644 index 78d218b097c2b..0000000000000 --- a/installation/template/js/error.js +++ /dev/null @@ -1,70 +0,0 @@ -/** - * @package Joomla.Installation - * @copyright Copyright (C) 2005 - 2017 Open Source Matters. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE.txt - */ -(function() { - "use strict"; - if (errorLocale) { - var header = document.getElementById('headerText'), - text1 = document.getElementById('descText1'); - - // Get the minimum PHP version - window.phpVersion = document.body.getAttribute('data-php-version') || '7.0'; - - // Create links for all the languages - Object.keys(errorLocale).forEach(function(key) { - var sel = document.getElementById('translatedLanguagesSelect'); - var opt = document.createElement('option'); - opt.text = errorLocale[key].language; - opt.value = key; - - if (key === 'en-GB') { - opt.setAttribute('selected', 'selected'); - } - - document.getElementById('translatedLanguagesSelect').addEventListener('change', function(e) { - var ref = e.target.value; - if (ref) { - header.innerHTML = errorLocale[ref].header; - text1.innerHTML = errorLocale[ref].text1.replace('{{phpversion}}', phpVersion); - } - - var helpLink = document.getElementById('linkHelp'); - if (helpLink) { - helpLink.innerText = errorLocale[ref]["help-url-text"]; - } - - var meta = document.querySelector('[http-equiv="Content-Language"]'); - if (meta) { - meta.setAttribute('content', ref); - } - }); - - sel.appendChild(opt) - }); - - // Select language based on Browser's language - Object.keys(errorLocale).forEach(function(key) { - if (navigator.language === key) { - // Remove the selected property - document.querySelector('#translatedLanguagesSelect option[value="en-GB"]').removeAttribute('selected'); - document.querySelector("#translatedLanguagesSelect option[value='" + key + "']").setAttribute('selected', 'selected'); - - // Append the translated strings - header.innerHTML = errorLocale[key].header; - text1.innerHTML = errorLocale[key].text1.replace('{{phpversion}}', phpVersion); - - var helpLink = document.getElementById('linkHelp'); - if (helpLink) { - helpLink.innerText = errorLocale[key]["help-url-text"]; - } - - var meta = document.querySelector('[http-equiv="Content-Language"]'); - if (meta) { - meta.setAttribute('content', key); - } - } - }); - } -})(); diff --git a/templates/system/incompatible.html b/templates/system/incompatible.html new file mode 100644 index 0000000000000..84cfd95233126 --- /dev/null +++ b/templates/system/incompatible.html @@ -0,0 +1,269 @@ + + + + + + + + Joomla: unsupported PHP version + + + + +
+
+
+

Sorry, your PHP version is not supported

+

Your host needs to use PHP version {{PHP_VERSION}} or newer to run this version of Joomla!

+

Help me resolve this

+ + + + + + + + +
+ +
+
+ + + + \ No newline at end of file diff --git a/installation/template/js/error-locales.js b/templates/system/js/error-locales.js similarity index 79% rename from installation/template/js/error-locales.js rename to templates/system/js/error-locales.js index 0f46d67e17e68..67607fd5e3012 100644 --- a/installation/template/js/error-locales.js +++ b/templates/system/js/error-locales.js @@ -3,13 +3,13 @@ window.errorLocale = { "en-GB": { "language": "English GB", "header": "Sorry, your PHP version is not supported", - "text1": "Your host needs to use PHP version {{phpversion}} or newer to run this version of Joomla!", + "text1": "Your host needs to use PHP version {{phpversion}} or newer to run this version of Joomla", "help-url-text": "Help me resolve this" }, "en-US": { - "language": "English GB", + "language": "English US", "header": "Sorry, your PHP version is not supported", - "text1": "Your host needs to use PHP version {{phpversion}} or newer to run this version of Joomla!", + "text1": "Your host needs to use PHP version {{phpversion}} or newer to run this version of Joomla", "help-url-text": "Help me resolve this" }, } \ No newline at end of file