From 1ec81b220eac96df49f31231ab69ea146439c66b Mon Sep 17 00:00:00 2001 From: Andrey <0test@mail.ru> Date: Sat, 11 Apr 2026 15:29:15 +0300 Subject: [PATCH] Fix install page Update `not_installed.tpl` to use dynamic placeholders for title, header, message, and button. - Add localization keys and translations for EN, UK, BY, DE --- index.php | 20 +++---- install/index.php | 18 +++++-- install/src/controllers/not_installed.php | 39 ++++++++++++++ install/src/lang/be.inc.php | 7 ++- install/src/lang/bg.inc.php | 4 ++ install/src/lang/cs.inc.php | 4 ++ install/src/lang/da.inc.php | 4 ++ install/src/lang/de.inc.php | 7 ++- install/src/lang/en.inc.php | 4 ++ install/src/lang/es.inc.php | 4 ++ install/src/lang/fa.inc.php | 4 ++ install/src/lang/fi.inc.php | 4 ++ install/src/lang/fr.inc.php | 4 ++ install/src/lang/he.inc.php | 4 ++ install/src/lang/it.inc.php | 4 ++ install/src/lang/ja.inc.php | 4 ++ install/src/lang/nl.inc.php | 4 ++ install/src/lang/nn.inc.php | 4 ++ install/src/lang/pl.inc.php | 4 ++ install/src/lang/pt.inc.php | 4 ++ install/src/lang/ru.inc.php | 7 ++- install/src/lang/sv.inc.php | 4 ++ install/src/lang/uk.inc.php | 7 ++- install/src/lang/zh.inc.php | 4 ++ install/src/template/not_installed.tpl | 63 +++++++++++++++++------ 25 files changed, 203 insertions(+), 33 deletions(-) create mode 100644 install/src/controllers/not_installed.php diff --git a/index.php b/index.php index a24e6abe59..1bc68dcc57 100644 --- a/index.php +++ b/index.php @@ -58,18 +58,20 @@ if (file_exists(__DIR__ . '/config.php')) { $config = array_merge($config, require __DIR__ . '/config.php'); } -if (!defined('IN_INSTALL_MODE') && !file_exists($config['core'] . '/.install')) { +if (!defined('IN_INSTALL_MODE') && !file_exists($config['core'] . '/.install')) { + + if (is_dir(__DIR__ . '/install')) { + header('Location: install/index.php?action=not_installed'); + exit; + } + header('HTTP/1.1 503 Service Temporarily Unavailable'); header('Status: 503 Service Temporarily Unavailable'); header('Retry-After: 3600'); - $path = __DIR__ . '/install/src/template/not_installed.tpl'; - if (file_exists($path)) { - readfile($path); - } else { - echo '

Unable to load configuration settings

'; - echo 'Please run the Evolution CMS install utility'; - } + echo '

Unable to load configuration settings

'; + echo 'Please run the Evolution CMS install utility'; + exit; } @@ -78,7 +80,7 @@ define('IN_INSTALL_MODE', false); } if (IN_INSTALL_MODE) { -// set some settings, and address some IE issues + // set some settings, and address some IE issues @ini_set('url_rewriter.tags', ''); @ini_set('session.use_trans_sid', 0); @ini_set('session.use_only_cookies', 1); diff --git a/install/index.php b/install/index.php index efc14cf3ca..3848e19f39 100644 --- a/install/index.php +++ b/install/index.php @@ -15,6 +15,8 @@ die('MGR_DIR is not defined'); } } + + if (!defined('MODX_MANAGER_PATH')) { define('MODX_MANAGER_PATH', $base_path . MGR_DIR . '/'); } @@ -28,8 +30,10 @@ require_once 'src/lang.php'; require_once 'src/functions.php'; + + if (empty($_GET['s'])) { - require_once '../' . MGR_DIR . '/includes/version.inc.php'; + require_once '../' . MGR_DIR . '/includes/version.inc.php'; // start session session_start(); @@ -74,11 +78,19 @@ $ph = array_merge($ph, $_lang); $ph['install_language'] = $install_language; - ob_start(); + ob_start(); $action = isset($_GET['action']) ? trim(strip_tags($_GET['action'])) : 'language'; - str_replace('.', '', $action); + $action = str_replace('.', '', $action); + $controller = 'src/controllers/' . $action . '.php'; + + if ($action === 'not_installed') { + require_once 'src/controllers/not_installed.php'; + exit; + } + + if (! file_exists($controller)) { die("Invalid install action attempted. [action={$action}]"); } diff --git a/install/src/controllers/not_installed.php b/install/src/controllers/not_installed.php new file mode 100644 index 0000000000..20d5ddd38a --- /dev/null +++ b/install/src/controllers/not_installed.php @@ -0,0 +1,39 @@ +System not installed

Run installer

'; +} +exit; diff --git a/install/src/lang/be.inc.php b/install/src/lang/be.inc.php index 4841a9afc4..02651a2293 100644 --- a/install/src/lang/be.inc.php +++ b/install/src/lang/be.inc.php @@ -1,8 +1,9 @@ - + + - -Evolution CMS is not installed! - - - + + [+not_installed_title+] + + + + -
-

Evolution CMS is not currently installed or the configuration file cannot be found.

-

Do you want to install now?

-
- \ No newline at end of file + + +
+
+ +
+
+ +
+
+
+

[+not_installed_header+]

+

[+not_installed_message+]

+ +
+
+
+ + + + + + + \ No newline at end of file