From 90d5eeb1d9e543576c82dc0a5073a083c6450a28 Mon Sep 17 00:00:00 2001 From: dgrammatiko Date: Thu, 25 Feb 2021 16:54:25 +0100 Subject: [PATCH] redo --- administrator/index.php | 2 +- build/build-modules-js/error-pages.es6.js | 36 ++++++------- build/build-modules-js/settings.json | 20 +++++-- build/warning_page/template.css | 18 +++---- build/warning_page/template.html | 61 +++++++++++----------- index.php | 2 +- installation/index.php | 4 +- installation/language/en-GB/joomla.ini | 22 ++++++-- installation/language/en-US/joomla.ini | 23 +++++++-- templates/system/build_incomplete.html | 63 +++++++++++------------ templates/system/fatal-error.html | 38 ++++++++++++++ templates/system/incompatible.html | 63 +++++++++++------------ templates/system/js/error-locales.js | 24 --------- 13 files changed, 215 insertions(+), 161 deletions(-) create mode 100644 templates/system/fatal-error.html delete mode 100644 templates/system/js/error-locales.js diff --git a/administrator/index.php b/administrator/index.php index 53110f9a11ea4..cfec264f131a8 100644 --- a/administrator/index.php +++ b/administrator/index.php @@ -15,7 +15,7 @@ { die( str_replace( - '{{PHP_VERSION}}', + '{{phpversion}}', JOOMLA_MINIMUM_PHP, file_get_contents(dirname(__FILE__) . '/../templates/system/incompatible.html') ) diff --git a/build/build-modules-js/error-pages.es6.js b/build/build-modules-js/error-pages.es6.js index 8b6a22dfed0d0..70177aa0ee3ac 100644 --- a/build/build-modules-js/error-pages.es6.js +++ b/build/build-modules-js/error-pages.es6.js @@ -26,17 +26,17 @@ const srcPath = `${RootPath}/build/warning_page`; module.exports.createErrorPages = async (options) => { const iniFilesProcess = []; const processPages = []; - this.incompleteObj = {}; - this.unsupportedObj = {}; - this.fatalObj = {}; - this.noxmlObj = {}; + global.incompleteObj = {}; + global.unsupportedObj = {}; + global.fatalObj = {}; + global.noxmlObj = {}; const initTemplate = await readFile(`${srcPath}/template.html`, { encoding: 'utf8' }); let cssContent = await readFile(`${srcPath}/template.css`, { encoding: 'utf8' }); let jsContent = await readFile(`${srcPath}/template.js`, { encoding: 'utf8' }); const cssMin = await Postcss([Autoprefixer, CssNano]).process(cssContent, { from: undefined }); - /// + cssContent = cssMin.css; jsContent = await minify(jsContent); @@ -46,13 +46,13 @@ module.exports.createErrorPages = async (options) => { // Build the variables into json for the unsupported page if (languageStrings.MIN_PHP_ERROR_LANGUAGE) { const name = dirname(file).replace(/.+\//, '').replace(/.+\\/, ''); - this.unsupportedObj = { - ...this.unsupportedObj, + global.unsupportedObj = { + ...global.unsupportedObj, [name]: { - language: languageStrings.MIN_PHP_ERROR_LANGUAGE, - header: languageStrings.MIN_PHP_ERROR_HEADER, - text1: languageStrings.MIN_PHP_ERROR_TEXT, - 'help-url-text': languageStrings.MIN_PHP_ERROR_URL_TEXT, + language: languageStrings.BUILD_MIN_PHP_ERROR_LANGUAGE, + header: languageStrings.BUILD_MIN_PHP_ERROR_HEADER, + text1: languageStrings.BUILD_MIN_PHP_ERROR_TEXT, + 'help-url-text': languageStrings.BUILD_MIN_PHP_ERROR_URL_TEXT, }, }; } @@ -60,8 +60,8 @@ module.exports.createErrorPages = async (options) => { // Build the variables into json for the build incomplete page if (languageStrings.BUILD_INCOMPLETE_LANGUAGE) { const name = dirname(file).replace(/.+\//, '').replace(/.+\\/, ''); - this.incompleteObj = { - ...this.incompleteObj, + global.incompleteObj = { + ...global.incompleteObj, [name]: { language: languageStrings.BUILD_INCOMPLETE_LANGUAGE, header: languageStrings.BUILD_INCOMPLETE_HEADER, @@ -74,8 +74,8 @@ module.exports.createErrorPages = async (options) => { // Build the variables into json for the fatal error page if (languageStrings.BUILD_FATAL_LANGUAGE) { const name = dirname(file).replace(/.+\//, '').replace(/.+\\/, ''); - this.fatalObj = { - ...this.fatalObj, + global.fatalObj = { + ...global.fatalObj, [name]: { language: languageStrings.BUILD_FATAL_LANGUAGE, header: languageStrings.BUILD_FATAL_HEADER, @@ -88,8 +88,8 @@ module.exports.createErrorPages = async (options) => { // Build the variables into json for the missing XML error page if (languageStrings.BUILD_NOXML_LANGUAGE) { const name = dirname(file).replace(/.+\//, '').replace(/.+\\/, ''); - this.noxmlObj = { - ...this.noxmlObj, + global.noxmlObj = { + ...global.noxmlObj, [name]: { language: languageStrings.BUILD_NOXML_LANGUAGE, header: languageStrings.BUILD_NOXML_HEADER, @@ -112,7 +112,7 @@ module.exports.createErrorPages = async (options) => { }); const processPage = async (name) => { - const jsonContent = `window.errorLocale=${JSON.stringify(this[`${name}Obj`])};`; + const jsonContent = `window.errorLocale=${JSON.stringify(global[`${name}Obj`])};`; let template = initTemplate; diff --git a/build/build-modules-js/settings.json b/build/build-modules-js/settings.json index a7ce4a78595e5..6d9a6a971dd51 100644 --- a/build/build-modules-js/settings.json +++ b/build/build-modules-js/settings.json @@ -763,7 +763,6 @@ }, "errorPages": { "incomplete": { - "phpVersionReplaceble": "", "title": "Joomla: Environment Setup Incomplete", "header": "Environment Setup Incomplete", "text": "It looks like you are trying to run Joomla! from our git repository. To do so requires you complete a couple of extra steps first.", @@ -772,13 +771,28 @@ "destFile": "/templates/system/build_incomplete.html" }, "unsupported": { - "phpVersionReplaceble": "data-php-version=\"{{PHP_VERSION}}\"", "title": "Joomla: unsupported PHP version", "header": "Sorry, your PHP version is not supported", - "text": "Your host needs to use PHP version {{PHP_VERSION}} or newer to run this version of Joomla!", + "text": "Your host needs to use PHP version {{phpversion}} or newer to run this version of Joomla!", "link": "J4.x:Unsupported_PHP_Version", "linkText": "Help me resolve this", "destFile": "/templates/system/incompatible.html" + }, + "noxml": { + "title": "Joomla: Missing PHP-XML library", + "header": "Sorry, your PHP is missing a vital library", + "text": "Your host needs to use PHP with support for the XML library to run this version of Joomla!", + "link": "J4.x:Missing_XML_Library", + "linkText": "Help me resolve this", + "destFile": "/media/system/html/noxml.html" + }, + "fatal": { + "title": "An Error Occurred: {{statusText}}", + "header": "Sorry, there was a problem we could not recover from.", + "text": "The server returned a \"{{statusCode_statusText}}\"", + "link": "J4.x:FatalError", + "linkText": "Help me resolve this", + "destFile": "/templates/system/fatal-error.html" } } } diff --git a/build/warning_page/template.css b/build/warning_page/template.css index 74d5b0dee690a..91d69f52ef633 100644 --- a/build/warning_page/template.css +++ b/build/warning_page/template.css @@ -1,3 +1,12 @@ +html { + background: #ee2a00; + background: -moz-radial-gradient(center, ellipse cover, rgba(241, 241, 241, 1) 0, rgb(238, 42, 0) 100%); + background: -webkit-radial-gradient(center, ellipse cover, rgba(241, 241, 241, 1) 0, rgb(238, 42, 0) 100%); + background: radial-gradient(ellipse at center, rgba(241, 241, 241, 1) 0, rgb(238, 42, 0) 100%); + background-repeat: no-repeat; + background-attachment: fixed +} + body { margin: 0; padding: 0; @@ -6,15 +15,6 @@ body { background-color: transparent } -html { - background: rgb(241,241,241); - background: -moz-radial-gradient(center, ellipse cover, rgba(241,241,241,1) 0%, rgba(58,146,200,1) 100%); - background: -webkit-radial-gradient(center, ellipse cover, rgba(241,241,241,1) 0%,rgba(58,146,200,1) 100%); - background: radial-gradient(ellipse at center, rgba(241,241,241,1) 0%,rgba(58,146,200,1) 100%); - background-repeat: no-repeat; - background-attachment: fixed; -} - ol, ul { padding: 0; margin: 0; diff --git a/build/warning_page/template.html b/build/warning_page/template.html index 95e03353390b2..b490bf9be32d5 100644 --- a/build/warning_page/template.html +++ b/build/warning_page/template.html @@ -1,38 +1,37 @@ - - - - - {{Title}} - - + + + + + {{Title}} + + - +
-
-
-

{{Header}}

-

{{Description}}

-

{{LinkText}}

- - - - - - - - -
- -
+
+
+

{{Header}}

+

{{Description}}

+

{{LinkText}}

+ + + + + + + + +
+ +
diff --git a/index.php b/index.php index 12c609e462fb1..c2b6893a435f6 100644 --- a/index.php +++ b/index.php @@ -15,7 +15,7 @@ { die( str_replace( - '{{PHP_VERSION}}', + '{{phpversion}}', JOOMLA_MINIMUM_PHP, file_get_contents(dirname(__FILE__) . '/templates/system/incompatible.html') ) diff --git a/installation/index.php b/installation/index.php index 410c3bc9bad9a..dc7ebdce1b082 100644 --- a/installation/index.php +++ b/installation/index.php @@ -19,8 +19,8 @@ { die( str_replace( - array('{{PHP_VERSION}}', '{{BASEPATH}}'), - array(JOOMLA_MINIMUM_PHP, 'http://' . $_SERVER['SERVER_NAME'] . '/'), + '{{phpversion}}', + JOOMLA_MINIMUM_PHP, file_get_contents(dirname(__FILE__) . '/../templates/system/incompatible.html') ) ); diff --git a/installation/language/en-GB/joomla.ini b/installation/language/en-GB/joomla.ini index 8ab4098b86f53..3fd261a21af78 100644 --- a/installation/language/en-GB/joomla.ini +++ b/installation/language/en-GB/joomla.ini @@ -3,6 +3,13 @@ ; License GNU General Public License version 2 or later; see LICENSE.txt ; Note : All ini files need to be saved as UTF-8 +; Fatal error page +; These will be processed by the JavaScript Build +BUILD_FATAL_HEADER="Sorry, there was a problem we could not recover from." +BUILD_FATAL_LANGUAGE="English GB" +BUILD_FATAL_TEXT="The server returned a \"{{statusCode_statusText}}\"" +BUILD_FATAL_URL_TEXT="Help me resolve this" + ; Build incomplete error page ; These will be processed by the JavaScript Build BUILD_INCOMPLETE_HEADER="Environment Setup Incomplete" @@ -10,12 +17,19 @@ BUILD_INCOMPLETE_LANGUAGE="English GB" BUILD_INCOMPLETE_TEXT="It looks like you are trying to run Joomla! from our git repository. To do so requires you to complete a couple of extra steps first." BUILD_INCOMPLETE_URL_TEXT="More Details" +; No XML PHP error page +; These will be processed by the JavaScript Build +BUILD_NOXML_HEADER="Sorry, your PHP is missing a vital library" +BUILD_NOXML_LANGUAGE="English GB" +BUILD_NOXML_TEXT="Your host needs to use PHP with support for the XML library to run this version of Joomla!" +BUILD_NOXML_URL_TEXT="Help me resolve this" + ; Minimum PHP error page ; These will be processed by the JavaScript Build -MIN_PHP_ERROR_HEADER="Sorry, your PHP version is not supported." -MIN_PHP_ERROR_LANGUAGE="English GB" -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" +BUILD_MIN_PHP_ERROR_HEADER="Sorry, your PHP version is not supported." +BUILD_MIN_PHP_ERROR_LANGUAGE="English GB" +BUILD_MIN_PHP_ERROR_TEXT="Your host needs to use PHP version {{phpversion}} or newer to run this version of Joomla." +BUILD_MIN_PHP_ERROR_URL_TEXT="Help me resolve this" ; Main Config INSTL_SELECT_INSTALL_LANG="Select Installation Language" diff --git a/installation/language/en-US/joomla.ini b/installation/language/en-US/joomla.ini index d084cb5c4e48b..5ae3a0632dbd8 100644 --- a/installation/language/en-US/joomla.ini +++ b/installation/language/en-US/joomla.ini @@ -3,6 +3,13 @@ ; License GNU General Public License version 2 or later; see LICENSE.txt ; Note : All ini files need to be saved as UTF-8 +; Fatal error page +; These will be processed by the JavaScript Build +BUILD_FATAL_HEADER="Sorry, there was a problem we could not recover from." +BUILD_FATAL_LANGUAGE="English US" +BUILD_FATAL_TEXT="The server returned a \"{{statusCode_statusText}}\"" +BUILD_FATAL_URL_TEXT="Help me resolve this" + ; Build incomplete error page ; These will be processed by the JavaScript Build BUILD_INCOMPLETE_HEADER="Environment Setup Incomplete" @@ -12,10 +19,18 @@ BUILD_INCOMPLETE_URL_TEXT="More Details" ; Minimum PHP error page ; These will be processed by the JavaScript Build -MIN_PHP_ERROR_HEADER="Sorry, your PHP version is not supported." -MIN_PHP_ERROR_LANGUAGE="English US" -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" +BUILD_MIN_PHP_ERROR_HEADER="Sorry, your PHP version is not supported." +BUILD_MIN_PHP_ERROR_LANGUAGE="English US" +BUILD_MIN_PHP_ERROR_TEXT="Your host needs to use PHP version {{phpversion}} or newer to run this version of Joomla." +BUILD_MIN_PHP_ERROR_URL_TEXT="Help me resolve this" + +; No XML PHP error page +; These will be processed by the JavaScript Build +BUILD_NOXML_HEADER="Sorry, your PHP is missing a vital library" +BUILD_NOXML_LANGUAGE="English US" +BUILD_NOXML_TEXT="Your host needs to use PHP with support for the XML library to run this version of Joomla!" +BUILD_NOXML_URL_TEXT="Help me resolve this" + ; Main Config INSTL_SELECT_INSTALL_LANG="Select Installation Language" diff --git a/templates/system/build_incomplete.html b/templates/system/build_incomplete.html index d8d5ff3b7078f..704258b3df6a9 100644 --- a/templates/system/build_incomplete.html +++ b/templates/system/build_incomplete.html @@ -1,39 +1,38 @@ - - - - - Joomla: Environment Setup Incomplete - - + + + + + Joomla: Environment Setup Incomplete + + - +
-
-
-

Environment Setup Incomplete

-

It looks like you are trying to run Joomla! from our git repository. To do so requires you complete a couple of extra steps first.

-

More Details

- - - - - - - - -
- -
+
+
+

Environment Setup Incomplete

+

It looks like you are trying to run Joomla! from our git repository. To do so requires you complete a couple of extra steps first.

+

More Details

+ + + + + + + + +
+ +
- + diff --git a/templates/system/fatal-error.html b/templates/system/fatal-error.html new file mode 100644 index 0000000000000..bb59d99a70a8b --- /dev/null +++ b/templates/system/fatal-error.html @@ -0,0 +1,38 @@ + + + + + + + An Error Occurred: {{statusText}} + + + + +
+
+
+

Sorry, there was a problem we could not recover from.

+

The server returned a "{{statusCode_statusText}}"

+

Help me resolve this

+ + + + + + + + +
+ +
+
+ + + diff --git a/templates/system/incompatible.html b/templates/system/incompatible.html index c802a6c242273..35c19e961079e 100644 --- a/templates/system/incompatible.html +++ b/templates/system/incompatible.html @@ -1,39 +1,38 @@ - - - - - Joomla: unsupported PHP version - - + + + + + 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

- - - - - - - - -
- -
+
+
+

Sorry, your PHP version is not supported

+

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

+

Help me resolve this

+ + + + + + + + +
+ +
- + diff --git a/templates/system/js/error-locales.js b/templates/system/js/error-locales.js deleted file mode 100644 index 9cd3a4690ec33..0000000000000 --- a/templates/system/js/error-locales.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * @package Joomla.Installation - * @subpackage JavaScript - * @copyright (C) 2017 Open Source Matters, Inc. - * @license GNU General Public License version 2 or later; see LICENSE.txt - */ - -/** - * This file is auto generated. Please do not modify it directly, use `node build --installer` - */ -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", - "help-url-text": "Help me resolve this" - }, - "en-US": { - "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", - "help-url-text": "Help me resolve this" - }, -} \ No newline at end of file