Completed
Push — develop ( 8dee05 )
by Dmytro
20:08
created
manager/processors/delete_user.processor.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,18 +1,18 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5
-if(!$modx->hasPermission('delete_user')) {
5
+if (!$modx->hasPermission('delete_user')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = isset($_GET['id'])? (int)$_GET['id'] : 0;
10
-if($id==0) {
9
+$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
10
+if ($id == 0) {
11 11
 	$modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
14 14
 // delete the user, but first check if we are deleting our own record
15
-if($id==$modx->getLoginUserID()) {
15
+if ($id == $modx->getLoginUserID()) {
16 16
 	$modx->webAlertAndQuit("You can't delete yourself!");
17 17
 }
18 18
 
@@ -50,5 +50,5 @@  discard block
 block discarded – undo
50 50
 		"id"	=> $id
51 51
 	));
52 52
 
53
-$header="Location: index.php?a=75";
53
+$header = "Location: index.php?a=75";
54 54
 header($header);
Please login to merge, or discard this patch.
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -3,17 +3,17 @@  discard block
 block discarded – undo
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if(!$modx->hasPermission('delete_user')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 $id = isset($_GET['id'])? (int)$_GET['id'] : 0;
10 10
 if($id==0) {
11
-	$modx->webAlertAndQuit($_lang["error_no_id"]);
11
+    $modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
14 14
 // delete the user, but first check if we are deleting our own record
15 15
 if($id==$modx->getLoginUserID()) {
16
-	$modx->webAlertAndQuit("You can't delete yourself!");
16
+    $modx->webAlertAndQuit("You can't delete yourself!");
17 17
 }
18 18
 
19 19
 // Set the item name for logger
@@ -22,25 +22,25 @@  discard block
 block discarded – undo
22 22
 
23 23
 // invoke OnBeforeUserFormDelete event
24 24
 $modx->invokeEvent("OnBeforeUserFormDelete",
25
-	array(
26
-		"id"	=> $id
27
-	));
25
+    array(
26
+        "id"	=> $id
27
+    ));
28 28
 
29 29
 // delete the user.
30 30
 EvolutionCMS\Models\ManagerUser::destroy($id);
31 31
 
32 32
 // invoke OnManagerDeleteUser event
33 33
 $modx->invokeEvent("OnManagerDeleteUser",
34
-	array(
35
-		"userid"		=> $id,
36
-		"username"		=> $username
37
-	));
34
+    array(
35
+        "userid"		=> $id,
36
+        "username"		=> $username
37
+    ));
38 38
 
39 39
 // invoke OnUserFormDelete event
40 40
 $modx->invokeEvent("OnUserFormDelete",
41
-	array(
42
-		"id"	=> $id
43
-	));
41
+    array(
42
+        "id"	=> $id
43
+    ));
44 44
 
45 45
 $header="Location: index.php?a=75";
46 46
 header($header);
Please login to merge, or discard this patch.
manager/processors/delete_module.processor.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5
-if(!$modx->hasPermission('delete_module')) {
5
+if (!$modx->hasPermission('delete_module')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = isset($_GET['id'])? (int)$_GET['id'] : 0;
10
-if($id==0) {
9
+$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
10
+if ($id == 0) {
11 11
 	$modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
@@ -40,5 +40,5 @@  discard block
 block discarded – undo
40 40
 $modx->clearCache('full');
41 41
 
42 42
 // finished emptying cache - redirect
43
-$header="Location: index.php?a=106&r=2";
43
+$header = "Location: index.php?a=106&r=2";
44 44
 header($header);
Please login to merge, or discard this patch.
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -3,12 +3,12 @@  discard block
 block discarded – undo
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if(!$modx->hasPermission('delete_module')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 $id = isset($_GET['id'])? (int)$_GET['id'] : 0;
10 10
 if($id==0) {
11
-	$modx->webAlertAndQuit($_lang["error_no_id"]);
11
+    $modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
14 14
 // Set the item name for logger
@@ -17,9 +17,9 @@  discard block
 block discarded – undo
17 17
 
18 18
 // invoke OnBeforeModFormDelete event
19 19
 $modx->invokeEvent("OnBeforeModFormDelete",
20
-	array(
21
-		"id"	=> $id
22
-	));
20
+    array(
21
+        "id"	=> $id
22
+    ));
23 23
 
24 24
 // delete the module.
25 25
 $modx->getDatabase()->delete($modx->getDatabase()->getFullTableName('site_modules'), "id='{$id}'");
@@ -32,9 +32,9 @@  discard block
 block discarded – undo
32 32
 
33 33
 // invoke OnModFormDelete event
34 34
 $modx->invokeEvent("OnModFormDelete",
35
-	array(
36
-		"id"	=> $id
37
-	));
35
+    array(
36
+        "id"	=> $id
37
+    ));
38 38
 
39 39
 // empty cache
40 40
 $modx->clearCache('full');
Please login to merge, or discard this patch.
manager/processors/delete_snippet.processor.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5
-if(!$modx->hasPermission('delete_snippet')) {
5
+if (!$modx->hasPermission('delete_snippet')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = isset($_GET['id'])? (int)$_GET['id'] : 0;
10
-if($id==0) {
9
+$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
10
+if ($id == 0) {
11 11
 	$modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
@@ -34,5 +34,5 @@  discard block
 block discarded – undo
34 34
 $modx->clearCache('full');
35 35
 
36 36
 // finished emptying cache - redirect
37
-$header="Location: index.php?a=76&r=2";
37
+$header = "Location: index.php?a=76&r=2";
38 38
 header($header);
Please login to merge, or discard this patch.
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -3,12 +3,12 @@  discard block
 block discarded – undo
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if(!$modx->hasPermission('delete_snippet')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 $id = isset($_GET['id'])? (int)$_GET['id'] : 0;
10 10
 if($id==0) {
11
-	$modx->webAlertAndQuit($_lang["error_no_id"]);
11
+    $modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
14 14
 // Set the item name for logger
@@ -17,18 +17,18 @@  discard block
 block discarded – undo
17 17
 
18 18
 // invoke OnBeforeSnipFormDelete event
19 19
 $modx->invokeEvent("OnBeforeSnipFormDelete",
20
-	array(
21
-		"id"	=> $id
22
-	));
20
+    array(
21
+        "id"	=> $id
22
+    ));
23 23
 
24 24
 // delete the snippet.
25 25
 EvolutionCMS\Models\SiteSnippet::destroy($id);
26 26
 
27 27
 // invoke OnSnipFormDelete event
28 28
 $modx->invokeEvent("OnSnipFormDelete",
29
-	array(
30
-		"id"	=> $id
31
-	));
29
+    array(
30
+        "id"	=> $id
31
+    ));
32 32
 
33 33
 // empty cache
34 34
 $modx->clearCache('full');
Please login to merge, or discard this patch.
manager/actions/help/version_notices/1.3.6.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 ?>
Please login to merge, or discard this patch.
manager/actions/help/version_notices/1.4.1.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 ?>
Please login to merge, or discard this patch.
manager/actions/help/version_notices/1.4.0.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 ?>
Please login to merge, or discard this patch.
install/cli-install.php 2 patches
Upper-Lower-Casing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 
317 317
 
318 318
 // make sure we can use the database
319
-if ($installMode > 0 && !mysqli_query($conn, "USE {$dbase}")) {
319
+if ($installMode > 0 && !mysqli_query($conn, "use {$dbase}")) {
320 320
     $errors++;
321 321
     echo $_lang['database_use_failed'] . PHP_EOL;
322 322
 }
@@ -1117,7 +1117,7 @@  discard block
 block discarded – undo
1117 1117
 
1118 1118
                 if (mysqli_num_rows($rs)) {
1119 1119
                     if (!mysqli_query($sqlParser->conn,
1120
-                        "UPDATE $dbase.`" . $table_prefix . "site_templates` SET content='$template', description='$desc', category=$category_id, locked='$locked'  WHERE templatename='$name' LIMIT 1;")) {
1120
+                        "update $dbase.`" . $table_prefix . "site_templates` SET content='$template', description='$desc', category=$category_id, locked='$locked'  WHERE templatename='$name' LIMIT 1;")) {
1121 1121
                         $errors += 1;
1122 1122
                         echo mysqli_error($sqlParser->conn) . PHP_EOL;
1123 1123
 
@@ -1181,7 +1181,7 @@  discard block
 block discarded – undo
1181 1181
                 $insert = true;
1182 1182
                 while ($row = mysqli_fetch_assoc($rs)) {
1183 1183
                     if (!mysqli_query($sqlParser->conn,
1184
-                        "UPDATE $dbase.`" . $table_prefix . "site_tmplvars` SET type='$input_type', caption='$caption', description='$desc', category=$category, locked=$locked, elements='$input_options', display='$output_widget', display_params='$output_widget_params', default_text='$input_default' WHERE id={$row['id']};")) {
1184
+                        "update $dbase.`" . $table_prefix . "site_tmplvars` SET type='$input_type', caption='$caption', description='$desc', category=$category, locked=$locked, elements='$input_options', display='$output_widget', display_params='$output_widget_params', default_text='$input_default' WHERE id={$row['id']};")) {
1185 1185
                         echo mysqli_error($sqlParser->conn) . PHP_EOL;
1186 1186
 
1187 1187
                         return;
@@ -1266,7 +1266,7 @@  discard block
 block discarded – undo
1266 1266
                 $update = $count_original_name > 0 && $overwrite == 'true';
1267 1267
                 if ($update) {
1268 1268
                     if (!mysqli_query($sqlParser->conn,
1269
-                        "UPDATE $dbase.`" . $table_prefix . "site_htmlsnippets` SET snippet='$chunk', description='$desc', category=$category_id WHERE name='$name';")) {
1269
+                        "update $dbase.`" . $table_prefix . "site_htmlsnippets` SET snippet='$chunk', description='$desc', category=$category_id WHERE name='$name';")) {
1270 1270
                         $errors += 1;
1271 1271
                         echo mysqli_error($sqlParser->conn) . PHP_EOL;
1272 1272
 
@@ -1322,7 +1322,7 @@  discard block
 block discarded – undo
1322 1322
                     $row = mysqli_fetch_assoc($rs);
1323 1323
                     $props = mysqli_real_escape_string($conn, propUpdate($properties, $row['properties']));
1324 1324
                     if (!mysqli_query($sqlParser->conn,
1325
-                        "UPDATE $dbase.`" . $table_prefix . "site_modules` SET modulecode='$module', description='$desc', properties='$props', enable_sharedparams='$shared' WHERE name='$name';")) {
1325
+                        "update $dbase.`" . $table_prefix . "site_modules` SET modulecode='$module', description='$desc', properties='$props', enable_sharedparams='$shared' WHERE name='$name';")) {
1326 1326
                         echo mysqli_error($sqlParser->conn) . PHP_EOL;
1327 1327
 
1328 1328
                         return;
@@ -1373,7 +1373,7 @@  discard block
 block discarded – undo
1373 1373
 
1374 1374
                 // disable legacy versions based on legacy_names provided
1375 1375
                 if (!empty($leg_names)) {
1376
-                    $update_query = "UPDATE $dbase.`" . $table_prefix . "site_plugins` SET disabled='1' WHERE name IN ($leg_names);";
1376
+                    $update_query = "update $dbase.`" . $table_prefix . "site_plugins` SET disabled='1' WHERE name IN ($leg_names);";
1377 1377
                     $rs = mysqli_query($sqlParser->conn, $update_query);
1378 1378
                 }
1379 1379
 
@@ -1391,7 +1391,7 @@  discard block
 block discarded – undo
1391 1391
                         $props = mysqli_real_escape_string($conn, propUpdate($properties, $row['properties']));
1392 1392
                         if ($row['description'] == $desc) {
1393 1393
                             if (!mysqli_query($sqlParser->conn,
1394
-                                "UPDATE $dbase.`" . $table_prefix . "site_plugins` SET plugincode='$plugin', description='$desc', properties='$props' WHERE id={$row['id']};")) {
1394
+                                "update $dbase.`" . $table_prefix . "site_plugins` SET plugincode='$plugin', description='$desc', properties='$props' WHERE id={$row['id']};")) {
1395 1395
                                 echo mysqli_error($sqlParser->conn) . PHP_EOL;
1396 1396
 
1397 1397
                                 return;
@@ -1399,7 +1399,7 @@  discard block
 block discarded – undo
1399 1399
                             $insert = false;
1400 1400
                         } else {
1401 1401
                             if (!mysqli_query($sqlParser->conn,
1402
-                                "UPDATE $dbase.`" . $table_prefix . "site_plugins` SET disabled='1' WHERE id={$row['id']};")) {
1402
+                                "update $dbase.`" . $table_prefix . "site_plugins` SET disabled='1' WHERE id={$row['id']};")) {
1403 1403
                                 echo mysqli_error($sqlParser->conn) . PHP_EOL;
1404 1404
 
1405 1405
                                 return;
@@ -1478,7 +1478,7 @@  discard block
 block discarded – undo
1478 1478
                     $row = mysqli_fetch_assoc($rs);
1479 1479
                     $props = mysqli_real_escape_string($conn, propUpdate($properties, $row['properties']));
1480 1480
                     if (!mysqli_query($sqlParser->conn,
1481
-                        "UPDATE $dbase.`" . $table_prefix . "site_snippets` SET snippet='$snippet', description='$desc', properties='$props' WHERE name='$name';")) {
1481
+                        "update $dbase.`" . $table_prefix . "site_snippets` SET snippet='$snippet', description='$desc', properties='$props' WHERE name='$name';")) {
1482 1482
                         echo mysqli_error($sqlParser->conn) . PHP_EOL;
1483 1483
 
1484 1484
                         return;
Please login to merge, or discard this patch.
Spacing   +258 added lines, -260 removed lines patch added patch discarded remove patch
@@ -7,8 +7,8 @@  discard block
 block discarded – undo
7 7
  */
8 8
 
9 9
 $self = 'install/cli-install.php';
10
-$path = __DIR__ . '/';
11
-$base_path = dirname(__DIR__) . '/';
10
+$path = __DIR__.'/';
11
+$base_path = dirname(__DIR__).'/';
12 12
 define('MODX_API_MODE', true);
13 13
 define('MODX_BASE_PATH', $base_path);
14 14
 define('MODX_SITE_URL', '/');
@@ -18,22 +18,22 @@  discard block
 block discarded – undo
18 18
 // set error reporting
19 19
 error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED);
20 20
 
21
-if (is_file($base_path . "assets/cache/siteManager.php")) {
22
-    include_once($base_path . "assets/cache/siteManager.php");
21
+if (is_file($base_path."assets/cache/siteManager.php")) {
22
+    include_once($base_path."assets/cache/siteManager.php");
23 23
 }
24
-if (!defined('MGR_DIR') && is_dir($base_path . "manager")) {
24
+if (!defined('MGR_DIR') && is_dir($base_path."manager")) {
25 25
     define('MGR_DIR', 'manager');
26 26
 }
27 27
 
28 28
 require_once 'src/lang.php';
29
-require_once($base_path . MGR_DIR . '/includes/version.inc.php');
29
+require_once($base_path.MGR_DIR.'/includes/version.inc.php');
30 30
 
31 31
 $moduleName = "EVO";
32
-$moduleVersion = $modx_branch . ' ' . $modx_version;
32
+$moduleVersion = $modx_branch.' '.$modx_version;
33 33
 $moduleRelease = $modx_release_date;
34
-$moduleSQLBaseFile = $path . 'stubs/sql/setup.sql';
35
-$moduleSQLDataFile = $path . 'stubs/sql/setup.data.sql';
36
-$moduleSQLResetFile = $path . 'stubs/sql/setup.data.reset.sql';
34
+$moduleSQLBaseFile = $path.'stubs/sql/setup.sql';
35
+$moduleSQLDataFile = $path.'stubs/sql/setup.data.sql';
36
+$moduleSQLResetFile = $path.'stubs/sql/setup.data.reset.sql';
37 37
 
38 38
 $moduleChunks = array(); // chunks - array : name, description, type - 0:file or 1:content, file or content
39 39
 $moduleTemplates = array(); // templates - array : name, description, type - 0:file or 1:content, file or content
@@ -48,29 +48,29 @@  discard block
 block discarded – undo
48 48
 
49 49
 $installMode = 0;
50 50
 $installData = 0;
51
-$tableprefixauto = base_convert(rand(10, 20), 10, 36) . substr(str_shuffle('0123456789abcdefghijklmnopqrstuvwxyz'),
52
-        rand(0, 33), 3) . '_';
51
+$tableprefixauto = base_convert(rand(10, 20), 10, 36).substr(str_shuffle('0123456789abcdefghijklmnopqrstuvwxyz'),
52
+        rand(0, 33), 3).'_';
53 53
 
54 54
 $args = array_slice($argv, 1);
55 55
 
56 56
 if (empty($args)) {
57
-    echo 'Install Evolution CMS' . PHP_EOL;
57
+    echo 'Install Evolution CMS'.PHP_EOL;
58 58
     //$installYes = readline("Type 'y' to continue: ");
59 59
     //if ($installYes != 'y') return;
60 60
 
61 61
     //set param manual
62
-    $databasehost = readline($_lang['connection_screen_database_host'] . ' [localhost] ');
63
-    $databaseloginname = readline($_lang['connection_screen_database_login'] . ' ');
64
-    $databaseloginpassword = readline($_lang['connection_screen_database_pass'] . ' ');
65
-    $database_name = readline($_lang['connection_screen_database_name'] . ' ');
66
-    $tableprefix = readline($_lang['connection_screen_table_prefix'] . ' [' . $tableprefixauto . '] ');
67
-    $database_connection_method = readline($_lang['connection_screen_connection_method'] . ' [SET CHARACTER SET] ');
68
-    $database_collation = readline($_lang['connection_screen_collation'] . ' [utf8mb4_general_ci] ');
69
-    $cmsadmin = readline($_lang['connection_screen_default_admin_login'] . ' [admin] ');
70
-    $cmsadminemail = readline($_lang['connection_screen_default_admin_email'] . ' ');
71
-    $cmspassword = readline($_lang['connection_screen_default_admin_password'] . ' ');
72
-    $managerlanguage = readline('Мanager language:' . ' [en] ');
73
-    $installData = readline('Instal demo-site (y/n):' . ' [n] ');
62
+    $databasehost = readline($_lang['connection_screen_database_host'].' [localhost] ');
63
+    $databaseloginname = readline($_lang['connection_screen_database_login'].' ');
64
+    $databaseloginpassword = readline($_lang['connection_screen_database_pass'].' ');
65
+    $database_name = readline($_lang['connection_screen_database_name'].' ');
66
+    $tableprefix = readline($_lang['connection_screen_table_prefix'].' ['.$tableprefixauto.'] ');
67
+    $database_connection_method = readline($_lang['connection_screen_connection_method'].' [SET CHARACTER SET] ');
68
+    $database_collation = readline($_lang['connection_screen_collation'].' [utf8mb4_general_ci] ');
69
+    $cmsadmin = readline($_lang['connection_screen_default_admin_login'].' [admin] ');
70
+    $cmsadminemail = readline($_lang['connection_screen_default_admin_email'].' ');
71
+    $cmspassword = readline($_lang['connection_screen_default_admin_password'].' ');
72
+    $managerlanguage = readline('Мanager language:'.' [en] ');
73
+    $installData = readline('Instal demo-site (y/n):'.' [n] ');
74 74
 
75 75
 } else {
76 76
 
@@ -169,114 +169,114 @@  discard block
 block discarded – undo
169 169
 // check PHP version
170 170
 define('PHP_MIN_VERSION', '5.4.0');
171 171
 $phpMinVersion = PHP_MIN_VERSION; // Maybe not necessary. For backward compatibility
172
-echo PHP_EOL . $_lang['checking_php_version'];
172
+echo PHP_EOL.$_lang['checking_php_version'];
173 173
 // -1 if left is less, 0 if equal, +1 if left is higher
174 174
 if (version_compare(phpversion(), PHP_MIN_VERSION) < 0) {
175 175
     $errors++;
176
-    $tmp = $_lang['you_running_php'] . phpversion() . str_replace('[+min_version+]', PHP_MIN_VERSION,
176
+    $tmp = $_lang['you_running_php'].phpversion().str_replace('[+min_version+]', PHP_MIN_VERSION,
177 177
             $_lang["modx_requires_php"]);
178
-    echo $_lang['failed'] . ' ' . $tmp . PHP_EOL;
178
+    echo $_lang['failed'].' '.$tmp.PHP_EOL;
179 179
 } else {
180
-    echo $_lang['ok'] . PHP_EOL;
180
+    echo $_lang['ok'].PHP_EOL;
181 181
 }
182 182
 
183 183
 // check directories
184 184
 // cache exists?
185 185
 echo strip_tags($_lang['checking_if_cache_exist']);
186
-if (!file_exists($path . "../assets/cache") || !file_exists($path . "../assets/cache/rss")) {
187
-    echo $_lang['failed'] . PHP_EOL;
186
+if (!file_exists($path."../assets/cache") || !file_exists($path."../assets/cache/rss")) {
187
+    echo $_lang['failed'].PHP_EOL;
188 188
     $errors++;
189 189
 } else {
190
-    echo $_lang['ok'] . PHP_EOL;
190
+    echo $_lang['ok'].PHP_EOL;
191 191
 }
192 192
 
193 193
 
194 194
 // cache writable?
195 195
 echo strip_tags($_lang['checking_if_cache_writable']);
196
-if (!is_writable($path . "../assets/cache")) {
196
+if (!is_writable($path."../assets/cache")) {
197 197
     $errors++;
198
-    echo $_lang['failed'] . PHP_EOL;
198
+    echo $_lang['failed'].PHP_EOL;
199 199
 } else {
200
-    echo $_lang['ok'] . PHP_EOL;
200
+    echo $_lang['ok'].PHP_EOL;
201 201
 }
202 202
 
203 203
 
204 204
 // cache files writable?
205 205
 echo strip_tags($_lang['checking_if_cache_file_writable']);
206
-$tmp = $path . "../assets/cache/siteCache.idx.php";
206
+$tmp = $path."../assets/cache/siteCache.idx.php";
207 207
 if (!file_exists($tmp)) {
208 208
     f_owc($tmp, "<?php //EVO site cache file ?>");
209 209
 }
210 210
 if (!is_writable($tmp)) {
211 211
     $errors++;
212
-    echo $_lang['failed'] . PHP_EOL;
212
+    echo $_lang['failed'].PHP_EOL;
213 213
 } else {
214
-    echo $_lang['ok'] . PHP_EOL;
214
+    echo $_lang['ok'].PHP_EOL;
215 215
 }
216 216
 
217 217
 
218 218
 echo strip_tags($_lang['checking_if_cache_file2_writable']);
219
-if (!is_writable($path . "../assets/cache/sitePublishing.idx.php")) {
219
+if (!is_writable($path."../assets/cache/sitePublishing.idx.php")) {
220 220
     $errors++;
221
-    echo $_lang['failed'] . PHP_EOL;
221
+    echo $_lang['failed'].PHP_EOL;
222 222
 } else {
223
-    echo $_lang['ok'] . PHP_EOL;
223
+    echo $_lang['ok'].PHP_EOL;
224 224
 }
225 225
 
226 226
 
227 227
 // File Browser directories exists?
228 228
 echo strip_tags($_lang['checking_if_images_exist']);
229 229
 switch (true) {
230
-    case !file_exists($path . "../assets/images"):
231
-    case !file_exists($path . "../assets/files"):
232
-    case !file_exists($path . "../assets/backup"):
230
+    case !file_exists($path."../assets/images"):
231
+    case !file_exists($path."../assets/files"):
232
+    case !file_exists($path."../assets/backup"):
233 233
         //case !file_exists("../assets/.thumbs"):
234 234
         $errors++;
235
-        echo $_lang['failed'] . PHP_EOL;
235
+        echo $_lang['failed'].PHP_EOL;
236 236
         break;
237 237
     default:
238
-        echo $_lang['ok'] . PHP_EOL;
238
+        echo $_lang['ok'].PHP_EOL;
239 239
 }
240 240
 
241 241
 
242 242
 // File Browser directories writable?
243 243
 echo strip_tags($_lang['checking_if_images_writable']);
244 244
 switch (true) {
245
-    case !is_writable($path . "../assets/images"):
246
-    case !is_writable($path . "../assets/files"):
247
-    case !is_writable($path . "../assets/backup"):
245
+    case !is_writable($path."../assets/images"):
246
+    case !is_writable($path."../assets/files"):
247
+    case !is_writable($path."../assets/backup"):
248 248
         //case !is_writable("../assets/.thumbs"):
249 249
         $errors++;
250
-        echo $_lang['failed'] . PHP_EOL;
250
+        echo $_lang['failed'].PHP_EOL;
251 251
         break;
252 252
     default:
253
-        echo $_lang['ok'] . PHP_EOL;
253
+        echo $_lang['ok'].PHP_EOL;
254 254
 }
255 255
 
256 256
 
257 257
 // export exists?
258 258
 echo strip_tags($_lang['checking_if_export_exists']);
259
-if (!file_exists($path . "../assets/export")) {
260
-    echo $_lang['failed'] . PHP_EOL;
259
+if (!file_exists($path."../assets/export")) {
260
+    echo $_lang['failed'].PHP_EOL;
261 261
     $errors++;
262 262
 } else {
263
-    echo $_lang['ok'] . PHP_EOL;
263
+    echo $_lang['ok'].PHP_EOL;
264 264
 }
265 265
 
266 266
 
267 267
 // export writable?
268 268
 echo strip_tags($_lang['checking_if_export_writable']);
269
-if (!is_writable($path . "../assets/export")) {
270
-    echo $_lang['failed'] . PHP_EOL;
269
+if (!is_writable($path."../assets/export")) {
270
+    echo $_lang['failed'].PHP_EOL;
271 271
     $errors++;
272 272
 } else {
273
-    echo $_lang['ok'] . PHP_EOL;
273
+    echo $_lang['ok'].PHP_EOL;
274 274
 }
275 275
 
276 276
 
277 277
 // config.inc.php writable?
278 278
 echo strip_tags($_lang['checking_if_config_exist_and_writable']);
279
-$tmp = $path . "../" . MGR_DIR . "/includes/config.inc.php";
279
+$tmp = $path."../".MGR_DIR."/includes/config.inc.php";
280 280
 if (!is_file($tmp)) {
281 281
     f_owc($tmp, "<?php //EVO configuration file ?>", 0666);
282 282
 } else {
@@ -285,15 +285,15 @@  discard block
 block discarded – undo
285 285
 $isWriteable = is_writable($tmp);
286 286
 if (!$isWriteable) {
287 287
     $errors++;
288
-    echo $_lang['failed'] . PHP_EOL;
288
+    echo $_lang['failed'].PHP_EOL;
289 289
 } else {
290
-    echo $_lang['ok'] . PHP_EOL;
290
+    echo $_lang['ok'].PHP_EOL;
291 291
 }
292 292
 
293 293
 
294 294
 // connect to the database
295 295
 if ($installMode == 1) {
296
-    include $path . "../" . MGR_DIR . "/includes/config.inc.php";
296
+    include $path."../".MGR_DIR."/includes/config.inc.php";
297 297
 } else {
298 298
     // get db info from post
299 299
     $database_server = $databasehost;
@@ -303,23 +303,23 @@  discard block
 block discarded – undo
303 303
     $database_charset = substr($database_collation, 0, strpos($database_collation, '_') - 1);
304 304
     $database_connection_charset = $database_collation;
305 305
     $database_connection_method = $database_connection_method;
306
-    $dbase = '`' . $database_name . '`';
306
+    $dbase = '`'.$database_name.'`';
307 307
     $table_prefix = $tableprefix;
308 308
 }
309 309
 echo $_lang['creating_database_connection'];
310 310
 $host = explode(':', $database_server, 2);
311
-if (!$conn = mysqli_connect($host[0], $database_user, $database_password,'', isset($host[1]) ? $host[1] : null)) {
311
+if (!$conn = mysqli_connect($host[0], $database_user, $database_password, '', isset($host[1]) ? $host[1] : null)) {
312 312
     $errors++;
313
-    echo $_lang['database_connection_failed'] . PHP_EOL;
313
+    echo $_lang['database_connection_failed'].PHP_EOL;
314 314
 } else {
315
-    echo $_lang['ok'] . PHP_EOL;
315
+    echo $_lang['ok'].PHP_EOL;
316 316
 }
317 317
 
318 318
 
319 319
 // make sure we can use the database
320 320
 if ($installMode > 0 && !mysqli_query($conn, "USE {$dbase}")) {
321 321
     $errors++;
322
-    echo $_lang['database_use_failed'] . PHP_EOL;
322
+    echo $_lang['database_use_failed'].PHP_EOL;
323 323
 }
324 324
 
325 325
 // check the database collation if not specified in the configuration
@@ -344,22 +344,22 @@  discard block
 block discarded – undo
344 344
 
345 345
 // check table prefix
346 346
 if ($conn && $installMode == 0) {
347
-    echo $_lang['checking_table_prefix'] . $table_prefix . '`: ';
348
-    if ($rs = mysqli_query($conn, "SELECT COUNT(*) FROM $dbase.`" . $table_prefix . "site_content`")) {
349
-        echo $_lang['failed'] . ' ' . $_lang['table_prefix_already_inuse_note'] . PHP_EOL;
347
+    echo $_lang['checking_table_prefix'].$table_prefix.'`: ';
348
+    if ($rs = mysqli_query($conn, "SELECT COUNT(*) FROM $dbase.`".$table_prefix."site_content`")) {
349
+        echo $_lang['failed'].' '.$_lang['table_prefix_already_inuse_note'].PHP_EOL;
350 350
         $errors++;
351 351
 
352 352
     } else {
353
-        echo $_lang['ok'] . PHP_EOL;
353
+        echo $_lang['ok'].PHP_EOL;
354 354
     }
355 355
 } elseif ($conn && $installMode == 2) {
356
-    echo $_lang['checking_table_prefix'] . $table_prefix . '`: ';
357
-    if (!$rs = mysqli_query($conn, "SELECT COUNT(*) FROM $dbase.`" . $table_prefix . "site_content`")) {
358
-        echo $_lang['failed'] . ' ' . $_lang['table_prefix_not_exist'] . PHP_EOL;
356
+    echo $_lang['checking_table_prefix'].$table_prefix.'`: ';
357
+    if (!$rs = mysqli_query($conn, "SELECT COUNT(*) FROM $dbase.`".$table_prefix."site_content`")) {
358
+        echo $_lang['failed'].' '.$_lang['table_prefix_not_exist'].PHP_EOL;
359 359
         $errors++;
360 360
 
361 361
     } else {
362
-        echo $_lang['ok'] . PHP_EOL;
362
+        echo $_lang['ok'].PHP_EOL;
363 363
     }
364 364
 }
365 365
 
@@ -367,10 +367,10 @@  discard block
 block discarded – undo
367 367
 if ($conn) {
368 368
     echo $_lang['checking_mysql_version'];
369 369
     if (version_compare(mysqli_get_server_info($conn), '5.0.51', '=')) {
370
-        echo $_lang['warning'] . ' ' . $_lang['mysql_5051'] . PHP_EOL;
371
-        echo $_lang['mysql_5051_warning'] . PHP_EOL;
370
+        echo $_lang['warning'].' '.$_lang['mysql_5051'].PHP_EOL;
371
+        echo $_lang['mysql_5051_warning'].PHP_EOL;
372 372
     } else {
373
-        echo $_lang['ok'] . ' ' . $_lang['mysql_version_is'] . mysqli_get_server_info($conn) . PHP_EOL;
373
+        echo $_lang['ok'].' '.$_lang['mysql_version_is'].mysqli_get_server_info($conn).PHP_EOL;
374 374
     }
375 375
 }
376 376
 
@@ -384,40 +384,40 @@  discard block
 block discarded – undo
384 384
         // print_r($modes);
385 385
         foreach ($modes as $mode) {
386 386
             if (stristr($mode, "STRICT_TRANS_TABLES") !== false || stristr($mode, "STRICT_ALL_TABLES") !== false) {
387
-                echo $_lang['warning'] . ' ' . $_lang['strict_mode'] . PHP_EOL;
388
-                echo $_lang['strict_mode_error'] . PHP_EOL;
387
+                echo $_lang['warning'].' '.$_lang['strict_mode'].PHP_EOL;
388
+                echo $_lang['strict_mode_error'].PHP_EOL;
389 389
             } else {
390
-                echo $_lang['ok'] . PHP_EOL;
390
+                echo $_lang['ok'].PHP_EOL;
391 391
             }
392 392
         }
393 393
     } else {
394
-        echo $_lang['ok'] . PHP_EOL;
394
+        echo $_lang['ok'].PHP_EOL;
395 395
     }
396 396
 }
397 397
 // Version and strict mode check end
398 398
 
399 399
 // andrazk 20070416 - add install flag and disable manager login
400 400
 // assets/cache writable?
401
-if (is_writable($path . "../assets/cache")) {
402
-    if (file_exists($path . '../assets/cache/installProc.inc.php')) {
403
-        @chmod($path . '../assets/cache/installProc.inc.php', 0755);
404
-        unlink($path . '../assets/cache/installProc.inc.php');
401
+if (is_writable($path."../assets/cache")) {
402
+    if (file_exists($path.'../assets/cache/installProc.inc.php')) {
403
+        @chmod($path.'../assets/cache/installProc.inc.php', 0755);
404
+        unlink($path.'../assets/cache/installProc.inc.php');
405 405
     }
406 406
 
407
-    f_owc($path . "../assets/cache/installProc.inc.php", '<?php $installStartTime = ' . time() . '; ?>');
407
+    f_owc($path."../assets/cache/installProc.inc.php", '<?php $installStartTime = '.time().'; ?>');
408 408
 }
409 409
 
410 410
 if ($installMode > 0 && $_POST['installdata'] == "1") {
411
-    echo $_lang['sample_web_site'] . ': ' . $_lang['sample_web_site_note'] . PHP_EOL;
411
+    echo $_lang['sample_web_site'].': '.$_lang['sample_web_site_note'].PHP_EOL;
412 412
 }
413 413
 
414 414
 if ($errors > 0) {
415
-    echo $_lang['setup_cannot_continue'] . ' ';
415
+    echo $_lang['setup_cannot_continue'].' ';
416 416
 
417 417
     if ($errors > 1) {
418
-        echo $errors . " " . $_lang['errors'] . $_lang['please_correct_errors'] . $_lang['and_try_again_plural'];
418
+        echo $errors." ".$_lang['errors'].$_lang['please_correct_errors'].$_lang['and_try_again_plural'];
419 419
     } else {
420
-        echo $_lang['error'] . $_lang['please_correct_error'] . $_lang['and_try_again'] . PHP_EOL;
420
+        echo $_lang['error'].$_lang['please_correct_error'].$_lang['and_try_again'].PHP_EOL;
421 421
     }
422 422
 
423 423
     die();
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
 
435 435
 
436 436
 if ($installMode == 1) {
437
-    include $path . "../" . MGR_DIR . "/includes/config.inc.php";
437
+    include $path."../".MGR_DIR."/includes/config.inc.php";
438 438
 } else {
439 439
     // get db info from post
440 440
     $database_server = $databasehost;
@@ -444,7 +444,7 @@  discard block
 block discarded – undo
444 444
     $database_charset = substr($database_collation, 0, strpos($database_collation, '_'));
445 445
     $database_connection_charset = $database_charset;
446 446
     $database_connection_method = $database_connection_method;
447
-    $dbase = "`" . $database_name . "`";
447
+    $dbase = "`".$database_name."`";
448 448
     $table_prefix = $tableprefix;
449 449
     $adminname = $cmsadmin;
450 450
     $adminemail = $cmsadminemail;
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
 
456 456
 // set session name variable
457 457
 if (!isset ($site_sessionname)) {
458
-    $site_sessionname = 'SN' . uniqid('');
458
+    $site_sessionname = 'SN'.uniqid('');
459 459
 }
460 460
 
461 461
 // get base path and url
@@ -471,65 +471,65 @@  discard block
 block discarded – undo
471 471
 }
472 472
 $pth = implode("install", $a);
473 473
 unset ($a);
474
-$base_url = $url . (substr($url, -1) != "/" ? "/" : "");
475
-$base_path = $pth . (substr($pth, -1) != "/" ? "/" : "");
474
+$base_url = $url.(substr($url, -1) != "/" ? "/" : "");
475
+$base_path = $pth.(substr($pth, -1) != "/" ? "/" : "");
476 476
 
477 477
 // connect to the database
478
-echo $_lang['setup_database_create_connection'] . ': ';
478
+echo $_lang['setup_database_create_connection'].': ';
479 479
 $host = explode(':', $database_server, 2);
480
-if (!$conn = mysqli_connect($host[0], $database_user, $database_password,'', isset($host[1]) ? $host[1] : null)) {
481
-    echo $_lang["setup_database_create_connection_failed"] . " " . $_lang['setup_database_create_connection_failed_note'] . PHP_EOL;
480
+if (!$conn = mysqli_connect($host[0], $database_user, $database_password, '', isset($host[1]) ? $host[1] : null)) {
481
+    echo $_lang["setup_database_create_connection_failed"]." ".$_lang['setup_database_create_connection_failed_note'].PHP_EOL;
482 482
 
483 483
     return;
484 484
 } else {
485
-    echo $_lang['ok'] . PHP_EOL;
485
+    echo $_lang['ok'].PHP_EOL;
486 486
 }
487 487
 
488 488
 // select database
489
-echo $_lang['setup_database_selection'] . str_replace("`", "", $dbase) . "`: ";
489
+echo $_lang['setup_database_selection'].str_replace("`", "", $dbase)."`: ";
490 490
 if (!mysqli_select_db($conn, str_replace("`", "", $dbase))) {
491
-    echo $_lang['setup_database_selection_failed'] . " " . $_lang['setup_database_selection_failed_note'] . PHP_EOL;
491
+    echo $_lang['setup_database_selection_failed']." ".$_lang['setup_database_selection_failed_note'].PHP_EOL;
492 492
     $create = true;
493 493
 } else {
494 494
     if (function_exists('mysqli_set_charset')) {
495 495
         mysqli_set_charset($conn, $database_charset);
496 496
     }
497 497
     mysqli_query($conn, "{$database_connection_method} {$database_connection_charset}");
498
-    echo $_lang['ok'] . PHP_EOL;
498
+    echo $_lang['ok'].PHP_EOL;
499 499
 }
500 500
 
501 501
 // try to create the database
502 502
 if ($create) {
503
-    echo $_lang['setup_database_creation'] . str_replace("`", "", $dbase) . "`: ";
503
+    echo $_lang['setup_database_creation'].str_replace("`", "", $dbase)."`: ";
504 504
     //  if(!@mysqli_create_db(str_replace("`","",$dbase), $conn)) {
505 505
     if (!mysqli_query($conn,
506 506
         "CREATE DATABASE $dbase DEFAULT CHARACTER SET $database_charset COLLATE $database_collation")) {
507
-        echo $_lang['setup_database_creation_failed'] . " " . $_lang['setup_database_creation_failed_note'] . PHP_EOL;
507
+        echo $_lang['setup_database_creation_failed']." ".$_lang['setup_database_creation_failed_note'].PHP_EOL;
508 508
         $errors += 1;
509 509
 
510
-        echo 'database charset: ' . $database_charset . PHP_EOL;
511
-        echo 'database collation: ' . $database_collation . PHP_EOL;
510
+        echo 'database charset: '.$database_charset.PHP_EOL;
511
+        echo 'database collation: '.$database_collation.PHP_EOL;
512 512
 
513
-        echo $_lang['setup_database_creation_failed_note2'] . PHP_EOL;
513
+        echo $_lang['setup_database_creation_failed_note2'].PHP_EOL;
514 514
 
515 515
         die();
516 516
 
517 517
     } else {
518
-        echo $_lang['ok'] . PHP_EOL;
518
+        echo $_lang['ok'].PHP_EOL;
519 519
     }
520 520
 }
521 521
 
522 522
 // check table prefix
523 523
 if ($installMode == 0) {
524
-    echo $_lang['checking_table_prefix'] . $table_prefix . "`: ";
525
-    if (@ $rs = mysqli_query($conn, "SELECT COUNT(*) FROM $dbase.`" . $table_prefix . "site_content`")) {
526
-        echo $_lang['failed'] . " " . $_lang['table_prefix_already_inuse'] . PHP_EOL;
524
+    echo $_lang['checking_table_prefix'].$table_prefix."`: ";
525
+    if (@ $rs = mysqli_query($conn, "SELECT COUNT(*) FROM $dbase.`".$table_prefix."site_content`")) {
526
+        echo $_lang['failed']." ".$_lang['table_prefix_already_inuse'].PHP_EOL;
527 527
         $errors += 1;
528
-        echo $_lang['table_prefix_already_inuse_note'] . PHP_EOL;
528
+        echo $_lang['table_prefix_already_inuse_note'].PHP_EOL;
529 529
 
530 530
         return;
531 531
     } else {
532
-        echo $_lang['ok'] . PHP_EOL;
532
+        echo $_lang['ok'].PHP_EOL;
533 533
     }
534 534
 }
535 535
 
@@ -571,7 +571,7 @@  discard block
 block discarded – undo
571 571
 $auto_template_logic = 'parent';
572 572
 if ($installMode != 0) {
573 573
     $rs = mysqli_query($conn,
574
-        "SELECT properties, disabled FROM $dbase.`" . $table_prefix . "site_plugins` WHERE name='Inherit Parent Template'");
574
+        "SELECT properties, disabled FROM $dbase.`".$table_prefix."site_plugins` WHERE name='Inherit Parent Template'");
575 575
     $row = mysqli_fetch_row($rs);
576 576
     if (!$row) {
577 577
         // not installed
@@ -595,12 +595,12 @@  discard block
 block discarded – undo
595 595
 
596 596
 // open db connection
597 597
 $setupPath = realpath(__DIR__);
598
-$chunkPath = $path . 'assets/chunks';
599
-$snippetPath = $path . 'assets/snippets';
600
-$pluginPath = $path . 'assets/plugins';
601
-$modulePath = $path . 'assets/modules';
602
-$templatePath = $path . 'assets/templates';
603
-$tvPath = $path . 'assets/tvs';
598
+$chunkPath = $path.'assets/chunks';
599
+$snippetPath = $path.'assets/snippets';
600
+$pluginPath = $path.'assets/plugins';
601
+$modulePath = $path.'assets/modules';
602
+$templatePath = $path.'assets/templates';
603
+$tvPath = $path.'assets/tvs';
604 604
 
605 605
 // setup Template template files - array : name, description, type - 0:file or 1:content, parameters, category
606 606
 $mt = &$moduleTemplates;
@@ -613,8 +613,7 @@  discard block
 block discarded – undo
613 613
         $params = parse_docblock($templatePath, $tplfile);
614 614
         if (is_array($params) && (count($params) > 0)) {
615 615
             $description = empty($params['version']) ? $params['description'] : "<strong>{$params['version']}</strong> {$params['description']}";
616
-            $mt[] = array
617
-            (
616
+            $mt[] = array(
618 617
                 $params['name'],
619 618
                 $description,
620 619
                 // Don't think this is gonna be used ... but adding it just in case 'type'
@@ -654,8 +653,7 @@  discard block
 block discarded – undo
654 653
                 "$templatePath/{$params['filename']}",
655 654
                 /* not currently used */
656 655
                 $params['template_assignments'] != "*" ?
657
-                    $params['template_assignments'] :
658
-                    implode(',', array_map(function($value){return isset($value[0]) && is_scalar($value[0]);},$mt)),
656
+                    $params['template_assignments'] : implode(',', array_map(function($value){return isset($value[0]) && is_scalar($value[0]); },$mt)),
659 657
                 /* comma-separated list of template names */
660 658
                 $params['modx_category'],
661 659
                 $params['lock_tv'],
@@ -735,7 +733,7 @@  discard block
 block discarded – undo
735 733
                 $params['modx_category'],
736 734
                 $params['legacy_names'],
737 735
                 array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : false,
738
-                (int)$params['disabled']
736
+                (int) $params['disabled']
739 737
             );
740 738
         }
741 739
     }
@@ -760,12 +758,12 @@  discard block
 block discarded – undo
760 758
                 "$modulePath/{$params['filename']}",
761 759
                 $params['properties'],
762 760
                 $params['guid'],
763
-                (int)$params['shareparams'],
761
+                (int) $params['shareparams'],
764 762
                 $params['modx_category'],
765 763
                 array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : false
766 764
             );
767 765
         }
768
-        if ((int)$params['shareparams'] || !empty($params['dependencies'])) {
766
+        if ((int) $params['shareparams'] || !empty($params['dependencies'])) {
769 767
             $dependencies = explode(',', $params['dependencies']);
770 768
             foreach ($dependencies as $dependency) {
771 769
                 $dependency = explode(':', $dependency);
@@ -836,7 +834,7 @@  discard block
 block discarded – undo
836 834
 // setup callback function
837 835
 $callBackFnc = "clean_up";
838 836
 
839
-include $path . "src/sqlParser.class.php";
837
+include $path."src/sqlParser.class.php";
840 838
 $sqlParser = new SqlParser($database_server, $database_user, $database_password, str_replace("`", "", $dbase),
841 839
     $table_prefix, $adminname, $adminemail, $adminpass, $database_connection_charset, $managerlanguage,
842 840
     $database_connection_method, $auto_template_logic);
@@ -857,21 +855,21 @@  discard block
 block discarded – undo
857 855
     // display database results
858 856
     if ($sqlParser->installFailed == true) {
859 857
         $errors += 1;
860
-        echo $_lang['database_alerts'] . PHP_EOL;
861
-        echo $_lang['setup_couldnt_install'] . PHP_EOL;
862
-        echo $_lang['installation_error_occured'] . PHP_EOL;
858
+        echo $_lang['database_alerts'].PHP_EOL;
859
+        echo $_lang['setup_couldnt_install'].PHP_EOL;
860
+        echo $_lang['installation_error_occured'].PHP_EOL;
863 861
         for ($i = 0; $i < count($sqlParser->mysqlErrors); $i++) {
864
-            echo $sqlParser->mysqlErrors[$i]["error"] . " " . $_lang['during_execution_of_sql'] . " " . strip_tags($sqlParser->mysqlErrors[$i]["sql"]) . PHP_EOL;
862
+            echo $sqlParser->mysqlErrors[$i]["error"]." ".$_lang['during_execution_of_sql']." ".strip_tags($sqlParser->mysqlErrors[$i]["sql"]).PHP_EOL;
865 863
         }
866
-        echo $_lang['some_tables_not_updated'] . PHP_EOL;
864
+        echo $_lang['some_tables_not_updated'].PHP_EOL;
867 865
         die();
868 866
     } else {
869
-        echo $_lang['ok'] . PHP_EOL;
867
+        echo $_lang['ok'].PHP_EOL;
870 868
     }
871 869
 }
872 870
 
873 871
 // custom or not
874
-if (file_exists($path . "../assets/cache/siteManager.php")) {
872
+if (file_exists($path."../assets/cache/siteManager.php")) {
875 873
     $mgrdir = 'include_once(__DIR__."/../../assets/cache/siteManager.php");';
876 874
 } else {
877 875
     $mgrdir = 'define(\'MGR_DIR\', \'manager\');';
@@ -891,10 +889,10 @@  discard block
 block discarded – undo
891 889
 $confph['lastInstallTime'] = time();
892 890
 $confph['site_sessionname'] = $site_sessionname;
893 891
 
894
-$configString = file_get_contents($path . 'stubs/config.tpl');
892
+$configString = file_get_contents($path.'stubs/config.tpl');
895 893
 $configString = parse($configString, $confph);
896 894
 
897
-$filename = $base_path . MGR_DIR . '/includes/config.inc.php';
895
+$filename = $base_path.MGR_DIR.'/includes/config.inc.php';
898 896
 $configFileFailed = false;
899 897
 if (@ !$handle = fopen($filename, 'w')) {
900 898
     $configFileFailed = true;
@@ -910,38 +908,38 @@  discard block
 block discarded – undo
910 908
 $chmodSuccess = @chmod($filename, 0404);
911 909
 
912 910
 if ($configFileFailed == true) {
913
-    echo $_lang['failed'] . PHP_EOL;
911
+    echo $_lang['failed'].PHP_EOL;
914 912
     $errors += 1;
915 913
 
916
-    echo $_lang['cant_write_config_file'] . ' ' . MGR_DIR . '/includes/config.inc.php' . PHP_EOL;
917
-    echo ' ' . PHP_EOL;
918
-    echo ' ' . PHP_EOL;
914
+    echo $_lang['cant_write_config_file'].' '.MGR_DIR.'/includes/config.inc.php'.PHP_EOL;
915
+    echo ' '.PHP_EOL;
916
+    echo ' '.PHP_EOL;
919 917
     echo $configString;
920
-    echo ' ' . PHP_EOL;
921
-    echo ' ' . PHP_EOL;
922
-    echo $_lang['cant_write_config_file_note'] . PHP_EOL;
918
+    echo ' '.PHP_EOL;
919
+    echo ' '.PHP_EOL;
920
+    echo $_lang['cant_write_config_file_note'].PHP_EOL;
923 921
     die();
924 922
 
925 923
 } else {
926
-    echo $_lang['ok'] . PHP_EOL;
924
+    echo $_lang['ok'].PHP_EOL;
927 925
 }
928 926
 
929 927
 // generate new site_id and set manager theme to default
930 928
 if ($installMode == 0) {
931 929
     $siteid = uniqid('');
932 930
     mysqli_query($sqlParser->conn,
933
-        "REPLACE INTO $dbase.`" . $table_prefix . "system_settings` (setting_name,setting_value) VALUES('site_id','$siteid'),('manager_theme','default')");
931
+        "REPLACE INTO $dbase.`".$table_prefix."system_settings` (setting_name,setting_value) VALUES('site_id','$siteid'),('manager_theme','default')");
934 932
 } else {
935 933
     // update site_id if missing
936 934
     $ds = mysqli_query($sqlParser->conn,
937
-        "SELECT setting_name,setting_value FROM $dbase.`" . $table_prefix . "system_settings` WHERE setting_name='site_id'");
935
+        "SELECT setting_name,setting_value FROM $dbase.`".$table_prefix."system_settings` WHERE setting_name='site_id'");
938 936
     if ($ds) {
939 937
         $r = mysqli_fetch_assoc($ds);
940 938
         $siteid = $r['setting_value'];
941 939
         if ($siteid == '' || $siteid = 'MzGeQ2faT4Dw06+U49x3') {
942 940
             $siteid = uniqid('');
943 941
             mysqli_query($sqlParser->conn,
944
-                "REPLACE INTO $dbase.`" . $table_prefix . "system_settings` (setting_name,setting_value) VALUES('site_id','$siteid')");
942
+                "REPLACE INTO $dbase.`".$table_prefix."system_settings` (setting_name,setting_value) VALUES('site_id','$siteid')");
945 943
         }
946 944
     }
947 945
 }
@@ -953,25 +951,25 @@  discard block
 block discarded – undo
953 951
     // display database results
954 952
     if ($sqlParser->installFailed == true) {
955 953
         $errors += 1;
956
-        echo $_lang['database_alerts'] . PHP_EOL;
957
-        echo $_lang['setup_couldnt_install'] . PHP_EOL;
958
-        echo $_lang['installation_error_occured'] . PHP_EOL . PHP_EOL;
954
+        echo $_lang['database_alerts'].PHP_EOL;
955
+        echo $_lang['setup_couldnt_install'].PHP_EOL;
956
+        echo $_lang['installation_error_occured'].PHP_EOL.PHP_EOL;
959 957
         /*
960 958
         for ($i = 0; $i < count($sqlParser->mysqlErrors); $i++) {
961 959
             echo "<em>" . $sqlParser->mysqlErrors[$i]["error"] . "</em>" . $_lang['during_execution_of_sql'] . "<span class='mono'>" . strip_tags($sqlParser->mysqlErrors[$i]["sql"]) . "</span>.<hr />";
962 960
         }
963 961
         echo "</p>";*/
964
-        echo $_lang['some_tables_not_updated'] . PHP_EOL;
962
+        echo $_lang['some_tables_not_updated'].PHP_EOL;
965 963
         die();
966 964
     } else {
967
-        echo $_lang['ok'] . PHP_EOL;
965
+        echo $_lang['ok'].PHP_EOL;
968 966
     }
969 967
 }
970 968
 
971 969
 // Install Templates
972 970
 $moduleTemplate = $mt;
973 971
 if (!empty($moduleTemplate) || $installData) {
974
-    echo PHP_EOL . $_lang['templates'] . ":" . PHP_EOL;
972
+    echo PHP_EOL.$_lang['templates'].":".PHP_EOL;
975 973
     //$selTemplates = $_POST['template'];
976 974
     foreach ($moduleTemplates as $k => $moduleTemplate) {
977 975
         $installSample = in_array('sample', $moduleTemplate[6]) && $installData == 1;
@@ -983,7 +981,7 @@  discard block
 block discarded – undo
983 981
             $filecontent = $moduleTemplate[3];
984 982
             $save_sql_id_as = $moduleTemplate[7]; // Nessecary for demo-site
985 983
             if (!file_exists($filecontent)) {
986
-                echo "  $name: " . $_lang['unable_install_template'] . " '$filecontent' " . $_lang['not_found'] . PHP_EOL;
984
+                echo "  $name: ".$_lang['unable_install_template']." '$filecontent' ".$_lang['not_found'].PHP_EOL;
987 985
             } else {
988 986
                 // Create the category if it does not already exist
989 987
                 $category_id = getCreateDbCategory($category, $sqlParser);
@@ -994,13 +992,13 @@  discard block
 block discarded – undo
994 992
 
995 993
                 // See if the template already exists
996 994
                 $rs = mysqli_query($sqlParser->conn,
997
-                    "SELECT * FROM $dbase.`" . $table_prefix . "site_templates` WHERE templatename='$name'");
995
+                    "SELECT * FROM $dbase.`".$table_prefix."site_templates` WHERE templatename='$name'");
998 996
 
999 997
                 if (mysqli_num_rows($rs)) {
1000 998
                     if (!mysqli_query($sqlParser->conn,
1001
-                        "UPDATE $dbase.`" . $table_prefix . "site_templates` SET content='$template', description='$desc', category=$category_id, locked='$locked'  WHERE templatename='$name' LIMIT 1;")) {
999
+                        "UPDATE $dbase.`".$table_prefix."site_templates` SET content='$template', description='$desc', category=$category_id, locked='$locked'  WHERE templatename='$name' LIMIT 1;")) {
1002 1000
                         $errors += 1;
1003
-                        echo mysqli_error($sqlParser->conn) . PHP_EOL;
1001
+                        echo mysqli_error($sqlParser->conn).PHP_EOL;
1004 1002
 
1005 1003
                         return;
1006 1004
                     }
@@ -1008,23 +1006,23 @@  discard block
 block discarded – undo
1008 1006
                         $sql_id = @mysqli_insert_id($sqlParser->conn);
1009 1007
                         if (!$sql_id) {
1010 1008
                             $idQuery = mysqli_fetch_assoc(mysqli_query($sqlParser->conn,
1011
-                                "SELECT id FROM $dbase.`" . $table_prefix . "site_templates` WHERE templatename='$name' LIMIT 1;"));
1009
+                                "SELECT id FROM $dbase.`".$table_prefix."site_templates` WHERE templatename='$name' LIMIT 1;"));
1012 1010
                             $sql_id = $idQuery['id'];
1013 1011
                         }
1014 1012
                         $custom_placeholders[$save_sql_id_as] = $sql_id;
1015 1013
                     }
1016
-                    echo "  $name: " . $_lang['upgraded'] . PHP_EOL;
1014
+                    echo "  $name: ".$_lang['upgraded'].PHP_EOL;
1017 1015
                 } else {
1018 1016
                     if (!@ mysqli_query($sqlParser->conn,
1019
-                        "INSERT INTO $dbase.`" . $table_prefix . "site_templates` (templatename,description,content,category,locked) VALUES('$name','$desc','$template',$category_id,'$locked');")) {
1017
+                        "INSERT INTO $dbase.`".$table_prefix."site_templates` (templatename,description,content,category,locked) VALUES('$name','$desc','$template',$category_id,'$locked');")) {
1020 1018
                         $errors += 1;
1021
-                        echo mysqli_error($sqlParser->conn) . PHP_EOL;
1019
+                        echo mysqli_error($sqlParser->conn).PHP_EOL;
1022 1020
                         die();
1023 1021
                     }
1024 1022
                     if (!is_null($save_sql_id_as)) {
1025 1023
                         $custom_placeholders[$save_sql_id_as] = @mysqli_insert_id($sqlParser->conn);
1026 1024
                     }
1027
-                    echo "  $name: " . $_lang['installed'] . PHP_EOL;
1025
+                    echo "  $name: ".$_lang['installed'].PHP_EOL;
1028 1026
                 }
1029 1027
             }
1030 1028
         }
@@ -1034,7 +1032,7 @@  discard block
 block discarded – undo
1034 1032
 // Install Template Variables
1035 1033
 $moduleTVs = $mtv;
1036 1034
 if (is_array($moduleTVs) || $installData) {
1037
-    echo PHP_EOL . $_lang['tvs'] . ': ' . PHP_EOL;
1035
+    echo PHP_EOL.$_lang['tvs'].': '.PHP_EOL;
1038 1036
     //$selTVs = $_POST['tv'];
1039 1037
     foreach ($moduleTVs as $k => $moduleTV) {
1040 1038
         $installSample = in_array('sample', $moduleTV[12]) && $installData == 1;
@@ -1057,27 +1055,27 @@  discard block
 block discarded – undo
1057 1055
             $category = getCreateDbCategory($category, $sqlParser);
1058 1056
 
1059 1057
             $rs = mysqli_query($sqlParser->conn,
1060
-                "SELECT * FROM $dbase.`" . $table_prefix . "site_tmplvars` WHERE name='$name'");
1058
+                "SELECT * FROM $dbase.`".$table_prefix."site_tmplvars` WHERE name='$name'");
1061 1059
             if (mysqli_num_rows($rs)) {
1062 1060
                 $insert = true;
1063 1061
                 while ($row = mysqli_fetch_assoc($rs)) {
1064 1062
                     if (!mysqli_query($sqlParser->conn,
1065
-                        "UPDATE $dbase.`" . $table_prefix . "site_tmplvars` SET type='$input_type', caption='$caption', description='$desc', category=$category, locked=$locked, elements='$input_options', display='$output_widget', display_params='$output_widget_params', default_text='$input_default' WHERE id={$row['id']};")) {
1066
-                        echo mysqli_error($sqlParser->conn) . PHP_EOL;
1063
+                        "UPDATE $dbase.`".$table_prefix."site_tmplvars` SET type='$input_type', caption='$caption', description='$desc', category=$category, locked=$locked, elements='$input_options', display='$output_widget', display_params='$output_widget_params', default_text='$input_default' WHERE id={$row['id']};")) {
1064
+                        echo mysqli_error($sqlParser->conn).PHP_EOL;
1067 1065
 
1068 1066
                         return;
1069 1067
                     }
1070 1068
                     $insert = false;
1071 1069
                 }
1072
-                echo "  $name: " . $_lang['upgraded'] . PHP_EOL;
1070
+                echo "  $name: ".$_lang['upgraded'].PHP_EOL;
1073 1071
             } else {
1074
-                $q = "INSERT INTO $dbase.`" . $table_prefix . "site_tmplvars` (type,name,caption,description,category,locked,elements,display,display_params,default_text) VALUES('$input_type','$name','$caption','$desc',$category,$locked,'$input_options','$output_widget','$output_widget_params','$input_default');";
1072
+                $q = "INSERT INTO $dbase.`".$table_prefix."site_tmplvars` (type,name,caption,description,category,locked,elements,display,display_params,default_text) VALUES('$input_type','$name','$caption','$desc',$category,$locked,'$input_options','$output_widget','$output_widget_params','$input_default');";
1075 1073
                 if (!mysqli_query($sqlParser->conn, $q)) {
1076
-                    echo mysqli_error($sqlParser->conn) . PHP_EOL;
1074
+                    echo mysqli_error($sqlParser->conn).PHP_EOL;
1077 1075
 
1078 1076
                     return;
1079 1077
                 }
1080
-                echo "  $name: " . $_lang['installed'] . PHP_EOL;
1078
+                echo "  $name: ".$_lang['installed'].PHP_EOL;
1081 1079
             }
1082 1080
 
1083 1081
             // add template assignments
@@ -1087,22 +1085,22 @@  discard block
 block discarded – undo
1087 1085
 
1088 1086
                 // remove existing tv -> template assignments
1089 1087
                 $ds = mysqli_query($sqlParser->conn,
1090
-                    "SELECT id FROM $dbase.`" . $table_prefix . "site_tmplvars` WHERE name='$name' AND description='$desc';");
1088
+                    "SELECT id FROM $dbase.`".$table_prefix."site_tmplvars` WHERE name='$name' AND description='$desc';");
1091 1089
                 $row = mysqli_fetch_assoc($ds);
1092 1090
                 $id = $row["id"];
1093 1091
                 mysqli_query($sqlParser->conn,
1094
-                    'DELETE FROM ' . $dbase . '.`' . $table_prefix . 'site_tmplvar_templates` WHERE tmplvarid = \'' . $id . '\'');
1092
+                    'DELETE FROM '.$dbase.'.`'.$table_prefix.'site_tmplvar_templates` WHERE tmplvarid = \''.$id.'\'');
1095 1093
 
1096 1094
                 // add tv -> template assignments
1097 1095
                 foreach ($assignments as $assignment) {
1098 1096
                     $template = mysqli_real_escape_string($conn, $assignment);
1099 1097
                     $ts = mysqli_query($sqlParser->conn,
1100
-                        "SELECT id FROM $dbase.`" . $table_prefix . "site_templates` WHERE templatename='$template';");
1098
+                        "SELECT id FROM $dbase.`".$table_prefix."site_templates` WHERE templatename='$template';");
1101 1099
                     if ($ds && $ts) {
1102 1100
                         $tRow = mysqli_fetch_assoc($ts);
1103 1101
                         $templateId = $tRow['id'];
1104 1102
                         mysqli_query($sqlParser->conn,
1105
-                            "INSERT INTO $dbase.`" . $table_prefix . "site_tmplvar_templates` (tmplvarid, templateid) VALUES($id, $templateId)");
1103
+                            "INSERT INTO $dbase.`".$table_prefix."site_tmplvar_templates` (tmplvarid, templateid) VALUES($id, $templateId)");
1106 1104
                     }
1107 1105
                 }
1108 1106
             }
@@ -1114,7 +1112,7 @@  discard block
 block discarded – undo
1114 1112
 $moduleChunks = $mc;
1115 1113
 // Install Chunks
1116 1114
 if (is_array($moduleChunks) || $installData) {
1117
-    echo PHP_EOL . $_lang['chunks'] . ": " . PHP_EOL;
1115
+    echo PHP_EOL.$_lang['chunks'].": ".PHP_EOL;
1118 1116
     foreach ($moduleChunks as $k => $moduleChunk) {
1119 1117
         $installSample = in_array('sample', $moduleChunk[5]) && $installData == 1;
1120 1118
         $count_new_name = 0;
@@ -1127,7 +1125,7 @@  discard block
 block discarded – undo
1127 1125
             $filecontent = $moduleChunk[2];
1128 1126
 
1129 1127
             if (!file_exists($filecontent)) {
1130
-                echo "  $name: " . $_lang['unable_install_chunk'] . " '$filecontent' " . $_lang['not_found'] . PHP_EOL;
1128
+                echo "  $name: ".$_lang['unable_install_chunk']." '$filecontent' ".$_lang['not_found'].PHP_EOL;
1131 1129
             } else {
1132 1130
 
1133 1131
                 // Create the category if it does not already exist
@@ -1136,36 +1134,36 @@  discard block
 block discarded – undo
1136 1134
                 $chunk = preg_replace("/^.*?\/\*\*.*?\*\/\s+/s", '', file_get_contents($filecontent), 1);
1137 1135
                 $chunk = mysqli_real_escape_string($conn, $chunk);
1138 1136
                 $rs = mysqli_query($sqlParser->conn,
1139
-                    "SELECT * FROM $dbase.`" . $table_prefix . "site_htmlsnippets` WHERE name='$name'");
1137
+                    "SELECT * FROM $dbase.`".$table_prefix."site_htmlsnippets` WHERE name='$name'");
1140 1138
                 $count_original_name = mysqli_num_rows($rs);
1141 1139
                 if ($overwrite == 'false') {
1142
-                    $newname = $name . '-' . str_replace('.', '_', $modx_version);
1140
+                    $newname = $name.'-'.str_replace('.', '_', $modx_version);
1143 1141
                     $rs = mysqli_query($sqlParser->conn,
1144
-                        "SELECT * FROM $dbase.`" . $table_prefix . "site_htmlsnippets` WHERE name='$newname'");
1142
+                        "SELECT * FROM $dbase.`".$table_prefix."site_htmlsnippets` WHERE name='$newname'");
1145 1143
                     $count_new_name = mysqli_num_rows($rs);
1146 1144
                 }
1147 1145
                 $update = $count_original_name > 0 && $overwrite == 'true';
1148 1146
                 if ($update) {
1149 1147
                     if (!mysqli_query($sqlParser->conn,
1150
-                        "UPDATE $dbase.`" . $table_prefix . "site_htmlsnippets` SET snippet='$chunk', description='$desc', category=$category_id WHERE name='$name';")) {
1148
+                        "UPDATE $dbase.`".$table_prefix."site_htmlsnippets` SET snippet='$chunk', description='$desc', category=$category_id WHERE name='$name';")) {
1151 1149
                         $errors += 1;
1152
-                        echo mysqli_error($sqlParser->conn) . PHP_EOL;
1150
+                        echo mysqli_error($sqlParser->conn).PHP_EOL;
1153 1151
 
1154 1152
                         return;
1155 1153
                     }
1156
-                    echo "  $name: " . $_lang['upgraded'] . PHP_EOL;
1154
+                    echo "  $name: ".$_lang['upgraded'].PHP_EOL;
1157 1155
                 } elseif ($count_new_name == 0) {
1158 1156
                     if ($count_original_name > 0 && $overwrite == 'false') {
1159 1157
                         $name = $newname;
1160 1158
                     }
1161 1159
                     if (!mysqli_query($sqlParser->conn,
1162
-                        "INSERT INTO $dbase.`" . $table_prefix . "site_htmlsnippets` (name,description,snippet,category) VALUES('$name','$desc','$chunk',$category_id);")) {
1160
+                        "INSERT INTO $dbase.`".$table_prefix."site_htmlsnippets` (name,description,snippet,category) VALUES('$name','$desc','$chunk',$category_id);")) {
1163 1161
                         $errors += 1;
1164
-                        echo mysqli_error($sqlParser->conn) . PHP_EOL;
1162
+                        echo mysqli_error($sqlParser->conn).PHP_EOL;
1165 1163
 
1166 1164
                         return;
1167 1165
                     }
1168
-                    echo "  $name: " . $_lang['installed'] . PHP_EOL;
1166
+                    echo "  $name: ".$_lang['installed'].PHP_EOL;
1169 1167
                 }
1170 1168
             }
1171 1169
         }
@@ -1175,7 +1173,7 @@  discard block
 block discarded – undo
1175 1173
 // Install Modules
1176 1174
 $moduleModules = $mm;
1177 1175
 if (is_array($moduleModules) || $installData) {
1178
-    echo PHP_EOL . $_lang['modules'] . ":" . PHP_EOL;
1176
+    echo PHP_EOL.$_lang['modules'].":".PHP_EOL;
1179 1177
     //$selModules = $_POST['module'];
1180 1178
     foreach ($moduleModules as $k => $moduleModule) {
1181 1179
         $installSample = in_array('sample', $moduleModule[7]) && $installData == 1;
@@ -1188,7 +1186,7 @@  discard block
 block discarded – undo
1188 1186
             $shared = mysqli_real_escape_string($conn, $moduleModule[5]);
1189 1187
             $category = mysqli_real_escape_string($conn, $moduleModule[6]);
1190 1188
             if (!file_exists($filecontent)) {
1191
-                echo "  $name: " . $_lang['unable_install_module'] . " '$filecontent' " . $_lang['not_found'] . PHP_EOL;
1189
+                echo "  $name: ".$_lang['unable_install_module']." '$filecontent' ".$_lang['not_found'].PHP_EOL;
1192 1190
             } else {
1193 1191
 
1194 1192
                 // Create the category if it does not already exist
@@ -1198,28 +1196,28 @@  discard block
 block discarded – undo
1198 1196
                 // $module = removeDocblock($module, 'module'); // Modules have no fileBinding, keep docblock for info-tab
1199 1197
                 $module = mysqli_real_escape_string($conn, $module);
1200 1198
                 $rs = mysqli_query($sqlParser->conn,
1201
-                    "SELECT * FROM $dbase.`" . $table_prefix . "site_modules` WHERE name='$name'");
1199
+                    "SELECT * FROM $dbase.`".$table_prefix."site_modules` WHERE name='$name'");
1202 1200
                 if (mysqli_num_rows($rs)) {
1203 1201
                     $row = mysqli_fetch_assoc($rs);
1204 1202
                     $props = mysqli_real_escape_string($conn, propUpdate($properties, $row['properties']));
1205 1203
                     if (!mysqli_query($sqlParser->conn,
1206
-                        "UPDATE $dbase.`" . $table_prefix . "site_modules` SET modulecode='$module', description='$desc', properties='$props', enable_sharedparams='$shared' WHERE name='$name';")) {
1207
-                        echo mysqli_error($sqlParser->conn) . PHP_EOL;
1204
+                        "UPDATE $dbase.`".$table_prefix."site_modules` SET modulecode='$module', description='$desc', properties='$props', enable_sharedparams='$shared' WHERE name='$name';")) {
1205
+                        echo mysqli_error($sqlParser->conn).PHP_EOL;
1208 1206
 
1209 1207
                         return;
1210 1208
                     }
1211
-                    echo "  $name: " . $_lang['upgraded'] . PHP_EOL;
1209
+                    echo "  $name: ".$_lang['upgraded'].PHP_EOL;
1212 1210
                 } else {
1213 1211
                     if ($properties != null) {
1214 1212
                         $properties = mysqli_real_escape_string($conn, parseProperties($properties, true));
1215 1213
                     }
1216 1214
                     if (!mysqli_query($sqlParser->conn,
1217
-                        "INSERT INTO $dbase.`" . $table_prefix . "site_modules` (name,description,modulecode,properties,guid,enable_sharedparams,category) VALUES('$name','$desc','$module','$properties','$guid','$shared', $category);")) {
1218
-                        echo "<p>" . mysqli_error($sqlParser->conn) . "</p>";
1215
+                        "INSERT INTO $dbase.`".$table_prefix."site_modules` (name,description,modulecode,properties,guid,enable_sharedparams,category) VALUES('$name','$desc','$module','$properties','$guid','$shared', $category);")) {
1216
+                        echo "<p>".mysqli_error($sqlParser->conn)."</p>";
1219 1217
 
1220 1218
                         return;
1221 1219
                     }
1222
-                    echo "  $name: " . $_lang['installed'] . PHP_EOL;
1220
+                    echo "  $name: ".$_lang['installed'].PHP_EOL;
1223 1221
                 }
1224 1222
             }
1225 1223
         }
@@ -1229,7 +1227,7 @@  discard block
 block discarded – undo
1229 1227
 // Install Plugins
1230 1228
 $modulePlugins = $mp;
1231 1229
 if (is_array($modulePlugins) || $installData) {
1232
-    echo PHP_EOL . $_lang['plugins'] . ":" . PHP_EOL;
1230
+    echo PHP_EOL.$_lang['plugins'].":".PHP_EOL;
1233 1231
     $selPlugs = $_POST['plugin'];
1234 1232
     foreach ($modulePlugins as $k => $modulePlugin) {
1235 1233
         //$installSample = in_array('sample', $modulePlugin[8]) && $installData == 1;
@@ -1245,16 +1243,16 @@  discard block
 block discarded – undo
1245 1243
             $disabled = $modulePlugin[9];
1246 1244
             if (array_key_exists(7, $modulePlugin)) {
1247 1245
                 // parse comma-separated legacy names and prepare them for sql IN clause
1248
-                $leg_names = "'" . implode("','",
1249
-                        preg_split('/\s*,\s*/', mysqli_real_escape_string($conn, $modulePlugin[7]))) . "'";
1246
+                $leg_names = "'".implode("','",
1247
+                        preg_split('/\s*,\s*/', mysqli_real_escape_string($conn, $modulePlugin[7])))."'";
1250 1248
             }
1251 1249
             if (!file_exists($filecontent)) {
1252
-                echo "  $name: " . $_lang['unable_install_plugin'] . " '$filecontent' " . $_lang['not_found'] . PHP_EOL;
1250
+                echo "  $name: ".$_lang['unable_install_plugin']." '$filecontent' ".$_lang['not_found'].PHP_EOL;
1253 1251
             } else {
1254 1252
 
1255 1253
                 // disable legacy versions based on legacy_names provided
1256 1254
                 if (!empty($leg_names)) {
1257
-                    $update_query = "UPDATE $dbase.`" . $table_prefix . "site_plugins` SET disabled='1' WHERE name IN ($leg_names);";
1255
+                    $update_query = "UPDATE $dbase.`".$table_prefix."site_plugins` SET disabled='1' WHERE name IN ($leg_names);";
1258 1256
                     $rs = mysqli_query($sqlParser->conn, $update_query);
1259 1257
                 }
1260 1258
 
@@ -1265,58 +1263,58 @@  discard block
 block discarded – undo
1265 1263
                 $plugin = removeDocblock($plugin, 'plugin');
1266 1264
                 $plugin = mysqli_real_escape_string($conn, $plugin);
1267 1265
                 $rs = mysqli_query($sqlParser->conn,
1268
-                    "SELECT * FROM $dbase.`" . $table_prefix . "site_plugins` WHERE name='$name'");
1266
+                    "SELECT * FROM $dbase.`".$table_prefix."site_plugins` WHERE name='$name'");
1269 1267
                 if (mysqli_num_rows($rs)) {
1270 1268
                     $insert = true;
1271 1269
                     while ($row = mysqli_fetch_assoc($rs)) {
1272 1270
                         $props = mysqli_real_escape_string($conn, propUpdate($properties, $row['properties']));
1273 1271
                         if ($row['description'] == $desc) {
1274 1272
                             if (!mysqli_query($sqlParser->conn,
1275
-                                "UPDATE $dbase.`" . $table_prefix . "site_plugins` SET plugincode='$plugin', description='$desc', properties='$props' WHERE id={$row['id']};")) {
1276
-                                echo mysqli_error($sqlParser->conn) . PHP_EOL;
1273
+                                "UPDATE $dbase.`".$table_prefix."site_plugins` SET plugincode='$plugin', description='$desc', properties='$props' WHERE id={$row['id']};")) {
1274
+                                echo mysqli_error($sqlParser->conn).PHP_EOL;
1277 1275
 
1278 1276
                                 return;
1279 1277
                             }
1280 1278
                             $insert = false;
1281 1279
                         } else {
1282 1280
                             if (!mysqli_query($sqlParser->conn,
1283
-                                "UPDATE $dbase.`" . $table_prefix . "site_plugins` SET disabled='1' WHERE id={$row['id']};")) {
1284
-                                echo mysqli_error($sqlParser->conn) . PHP_EOL;
1281
+                                "UPDATE $dbase.`".$table_prefix."site_plugins` SET disabled='1' WHERE id={$row['id']};")) {
1282
+                                echo mysqli_error($sqlParser->conn).PHP_EOL;
1285 1283
 
1286 1284
                                 return;
1287 1285
                             }
1288 1286
                         }
1289 1287
                     }
1290 1288
                     if ($insert === true) {
1291
-                        if(!mysqli_query($sqlParser->conn, "INSERT INTO $dbase.`".$table_prefix."site_plugins` (name,description,plugincode,properties,moduleguid,disabled,category) VALUES('$name','$desc','$plugin','$props','$guid','0',$category);")) {
1292
-                            echo mysqli_error($sqlParser->conn) . PHP_EOL;
1289
+                        if (!mysqli_query($sqlParser->conn, "INSERT INTO $dbase.`".$table_prefix."site_plugins` (name,description,plugincode,properties,moduleguid,disabled,category) VALUES('$name','$desc','$plugin','$props','$guid','0',$category);")) {
1290
+                            echo mysqli_error($sqlParser->conn).PHP_EOL;
1293 1291
 
1294 1292
                             return;
1295 1293
                         }
1296 1294
                     }
1297
-                    echo "  $name: " . $_lang['upgraded'] . PHP_EOL;
1295
+                    echo "  $name: ".$_lang['upgraded'].PHP_EOL;
1298 1296
                 } else {
1299 1297
                     if ($properties != null) {
1300 1298
                         $properties = mysqli_real_escape_string($conn, parseProperties($properties, true));
1301 1299
                     }
1302 1300
                     if (!mysqli_query($sqlParser->conn,
1303
-                        "INSERT INTO $dbase.`" . $table_prefix . "site_plugins` (name,description,plugincode,properties,moduleguid,category,disabled) VALUES('$name','$desc','$plugin','$properties','$guid',$category,$disabled);")) {
1304
-                        echo mysqli_error($sqlParser->conn) . PHP_EOL;
1301
+                        "INSERT INTO $dbase.`".$table_prefix."site_plugins` (name,description,plugincode,properties,moduleguid,category,disabled) VALUES('$name','$desc','$plugin','$properties','$guid',$category,$disabled);")) {
1302
+                        echo mysqli_error($sqlParser->conn).PHP_EOL;
1305 1303
 
1306 1304
                         return;
1307 1305
                     }
1308
-                    echo "  $name: " . $_lang['installed'] . PHP_EOL;
1306
+                    echo "  $name: ".$_lang['installed'].PHP_EOL;
1309 1307
                 }
1310 1308
                 // add system events
1311 1309
                 if (count($events) > 0) {
1312 1310
                     $ds = mysqli_query($sqlParser->conn,
1313
-                        "SELECT id FROM $dbase.`" . $table_prefix . "site_plugins` WHERE name='$name' AND description='$desc';");
1311
+                        "SELECT id FROM $dbase.`".$table_prefix."site_plugins` WHERE name='$name' AND description='$desc';");
1314 1312
                     if ($ds) {
1315 1313
                         $row = mysqli_fetch_assoc($ds);
1316 1314
                         $id = $row["id"];
1317 1315
                         $_events = implode("','", $events);
1318 1316
                         // add new events
1319
-                        $sql = "INSERT IGNORE INTO $dbase.`" . $table_prefix . "site_plugin_events` (pluginid, evtid) SELECT '$id' as 'pluginid',se.id as 'evtid' FROM $dbase.`" . $table_prefix . "system_eventnames` se WHERE name IN ('{$_events}')";
1317
+                        $sql = "INSERT IGNORE INTO $dbase.`".$table_prefix."site_plugin_events` (pluginid, evtid) SELECT '$id' as 'pluginid',se.id as 'evtid' FROM $dbase.`".$table_prefix."system_eventnames` se WHERE name IN ('{$_events}')";
1320 1318
                         mysqli_query($sqlParser->conn, $sql);
1321 1319
                         // remove absent events
1322 1320
                         $sql = "DELETE `pe` FROM {$dbase}.`{$table_prefix}site_plugin_events` `pe` LEFT JOIN {$dbase}.`{$table_prefix}system_eventnames` `se` ON `pe`.`evtid`=`se`.`id` AND `name` IN ('{$_events}') WHERE ISNULL(`name`) AND `pluginid` = {$id}";
@@ -1331,7 +1329,7 @@  discard block
 block discarded – undo
1331 1329
 // Install Snippets
1332 1330
 $moduleSnippet = $ms;
1333 1331
 if (is_array($moduleSnippet) || $installData) {
1334
-    echo PHP_EOL . $_lang['snippets'] . ":" . PHP_EOL;
1332
+    echo PHP_EOL.$_lang['snippets'].":".PHP_EOL;
1335 1333
     //$selSnips = $_POST['snippet'];
1336 1334
     foreach ($moduleSnippets as $k => $moduleSnippet) {
1337 1335
         $installSample = in_array('sample', $moduleSnippet[5]) && $installData == 1;
@@ -1342,7 +1340,7 @@  discard block
 block discarded – undo
1342 1340
             $properties = $moduleSnippet[3];
1343 1341
             $category = mysqli_real_escape_string($conn, $moduleSnippet[4]);
1344 1342
             if (!file_exists($filecontent)) {
1345
-                echo "  $name: " . $_lang['unable_install_snippet'] . " '$filecontent' " . $_lang['not_found'] . PHP_EOL;
1343
+                echo "  $name: ".$_lang['unable_install_snippet']." '$filecontent' ".$_lang['not_found'].PHP_EOL;
1346 1344
             } else {
1347 1345
 
1348 1346
                 // Create the category if it does not already exist
@@ -1352,28 +1350,28 @@  discard block
 block discarded – undo
1352 1350
                 $snippet = removeDocblock($snippet, 'snippet');
1353 1351
                 $snippet = mysqli_real_escape_string($conn, $snippet);
1354 1352
                 $rs = mysqli_query($sqlParser->conn,
1355
-                    "SELECT * FROM $dbase.`" . $table_prefix . "site_snippets` WHERE name='$name'");
1353
+                    "SELECT * FROM $dbase.`".$table_prefix."site_snippets` WHERE name='$name'");
1356 1354
                 if (mysqli_num_rows($rs)) {
1357 1355
                     $row = mysqli_fetch_assoc($rs);
1358 1356
                     $props = mysqli_real_escape_string($conn, propUpdate($properties, $row['properties']));
1359 1357
                     if (!mysqli_query($sqlParser->conn,
1360
-                        "UPDATE $dbase.`" . $table_prefix . "site_snippets` SET snippet='$snippet', description='$desc', properties='$props' WHERE name='$name';")) {
1361
-                        echo mysqli_error($sqlParser->conn) . PHP_EOL;
1358
+                        "UPDATE $dbase.`".$table_prefix."site_snippets` SET snippet='$snippet', description='$desc', properties='$props' WHERE name='$name';")) {
1359
+                        echo mysqli_error($sqlParser->conn).PHP_EOL;
1362 1360
 
1363 1361
                         return;
1364 1362
                     }
1365
-                    echo "  $name: " . $_lang['upgraded'] . PHP_EOL;
1363
+                    echo "  $name: ".$_lang['upgraded'].PHP_EOL;
1366 1364
                 } else {
1367 1365
                     if ($properties != null) {
1368 1366
                         $properties = mysqli_real_escape_string($conn, parseProperties($properties, true));
1369 1367
                     }
1370 1368
                     if (!mysqli_query($sqlParser->conn,
1371
-                        "INSERT INTO $dbase.`" . $table_prefix . "site_snippets` (name,description,snippet,properties,category) VALUES('$name','$desc','$snippet','$properties',$category);")) {
1372
-                        echo mysqli_error($sqlParser->conn) . PHP_EOL;
1369
+                        "INSERT INTO $dbase.`".$table_prefix."site_snippets` (name,description,snippet,properties,category) VALUES('$name','$desc','$snippet','$properties',$category);")) {
1370
+                        echo mysqli_error($sqlParser->conn).PHP_EOL;
1373 1371
 
1374 1372
                         return;
1375 1373
                     }
1376
-                    echo "  $name: " . $_lang['installed'] . PHP_EOL;
1374
+                    echo "  $name: ".$_lang['installed'].PHP_EOL;
1377 1375
                 }
1378 1376
             }
1379 1377
         }
@@ -1382,19 +1380,19 @@  discard block
 block discarded – undo
1382 1380
 
1383 1381
 // Install demo-site
1384 1382
 if ($installData && $moduleSQLDataFile) {
1385
-    echo PHP_EOL . $_lang['installing_demo_site'];
1383
+    echo PHP_EOL.$_lang['installing_demo_site'];
1386 1384
     $sqlParser->process($moduleSQLDataFile);
1387 1385
     // display database results
1388 1386
     if ($sqlParser->installFailed == true) {
1389 1387
         $errors += 1;
1390
-        echo $_lang['database_alerts'] . PHP_EOL;
1391
-        echo $_lang['setup_couldnt_install'] . PHP_EOL;
1392
-        echo $_lang['installation_error_occured'] . PHP_EOL . PHP_EOL;
1388
+        echo $_lang['database_alerts'].PHP_EOL;
1389
+        echo $_lang['setup_couldnt_install'].PHP_EOL;
1390
+        echo $_lang['installation_error_occured'].PHP_EOL.PHP_EOL;
1393 1391
         for ($i = 0; $i < count($sqlParser->mysqlErrors); $i++) {
1394
-            echo $sqlParser->mysqlErrors[$i]["error"] . " " . $_lang['during_execution_of_sql'] . " " . strip_tags($sqlParser->mysqlErrors[$i]["sql"]) . PHP_EOL;
1392
+            echo $sqlParser->mysqlErrors[$i]["error"]." ".$_lang['during_execution_of_sql']." ".strip_tags($sqlParser->mysqlErrors[$i]["sql"]).PHP_EOL;
1395 1393
         }
1396 1394
 
1397
-        echo $_lang['some_tables_not_updated'] . PHP_EOL;
1395
+        echo $_lang['some_tables_not_updated'].PHP_EOL;
1398 1396
 
1399 1397
         return;
1400 1398
     } else {
@@ -1406,7 +1404,7 @@  discard block
 block discarded – undo
1406 1404
             $sql = sprintf('UPDATE `%ssite_content` SET template=%s WHERE template=4', $sqlParser->prefix, $row['id']);
1407 1405
             mysqli_query($sqlParser->conn, $sql);
1408 1406
         }
1409
-        echo $_lang['ok'] . PHP_EOL;
1407
+        echo $_lang['ok'].PHP_EOL;
1410 1408
     }
1411 1409
 }
1412 1410
 
@@ -1414,9 +1412,9 @@  discard block
 block discarded – undo
1414 1412
 $moduleDependencies = $mdp;
1415 1413
 foreach ($moduleDependencies as $dependency) {
1416 1414
     $ds = mysqli_query($sqlParser->conn,
1417
-        'SELECT id, guid FROM ' . $dbase . '`' . $sqlParser->prefix . 'site_modules` WHERE name="' . $dependency['module'] . '"');
1415
+        'SELECT id, guid FROM '.$dbase.'`'.$sqlParser->prefix.'site_modules` WHERE name="'.$dependency['module'].'"');
1418 1416
     if (!$ds) {
1419
-        echo mysqli_error($sqlParser->conn) . PHP_EOL;
1417
+        echo mysqli_error($sqlParser->conn).PHP_EOL;
1420 1418
 
1421 1419
         return;
1422 1420
     } else {
@@ -1426,9 +1424,9 @@  discard block
 block discarded – undo
1426 1424
     }
1427 1425
     // get extra id
1428 1426
     $ds = mysqli_query($sqlParser->conn,
1429
-        'SELECT id FROM ' . $dbase . '`' . $sqlParser->prefix . 'site_' . $dependency['table'] . '` WHERE ' . $dependency['column'] . '="' . $dependency['name'] . '"');
1427
+        'SELECT id FROM '.$dbase.'`'.$sqlParser->prefix.'site_'.$dependency['table'].'` WHERE '.$dependency['column'].'="'.$dependency['name'].'"');
1430 1428
     if (!$ds) {
1431
-        echo mysqli_error($sqlParser->conn) . PHP_EOL;
1429
+        echo mysqli_error($sqlParser->conn).PHP_EOL;
1432 1430
 
1433 1431
         return;
1434 1432
     } else {
@@ -1437,34 +1435,34 @@  discard block
 block discarded – undo
1437 1435
     }
1438 1436
     // setup extra as module dependency
1439 1437
     $ds = mysqli_query($sqlParser->conn,
1440
-        'SELECT module FROM ' . $dbase . '`' . $sqlParser->prefix . 'site_module_depobj` WHERE module=' . $moduleId . ' AND resource=' . $extraId . ' AND type=' . $dependency['type'] . ' LIMIT 1');
1438
+        'SELECT module FROM '.$dbase.'`'.$sqlParser->prefix.'site_module_depobj` WHERE module='.$moduleId.' AND resource='.$extraId.' AND type='.$dependency['type'].' LIMIT 1');
1441 1439
     if (!$ds) {
1442
-        echo mysqli_error($sqlParser->conn) . PHP_EOL;
1440
+        echo mysqli_error($sqlParser->conn).PHP_EOL;
1443 1441
 
1444 1442
         return;
1445 1443
     } else {
1446 1444
         if (mysqli_num_rows($ds) === 0) {
1447 1445
             mysqli_query($sqlParser->conn,
1448
-                'INSERT INTO ' . $dbase . '`' . $sqlParser->prefix . 'site_module_depobj` (module, resource, type) VALUES(' . $moduleId . ',' . $extraId . ',' . $dependency['type'] . ')');
1449
-            echo $dependency['module'] . ' Module: ' . $_lang['depedency_create'] . PHP_EOL;
1446
+                'INSERT INTO '.$dbase.'`'.$sqlParser->prefix.'site_module_depobj` (module, resource, type) VALUES('.$moduleId.','.$extraId.','.$dependency['type'].')');
1447
+            echo $dependency['module'].' Module: '.$_lang['depedency_create'].PHP_EOL;
1450 1448
         } else {
1451 1449
             mysqli_query($sqlParser->conn,
1452
-                'UPDATE ' . $dbase . '`' . $sqlParser->prefix . 'site_module_depobj` SET module = ' . $moduleId . ', resource = ' . $extraId . ', type = ' . $dependency['type'] . ' WHERE module=' . $moduleId . ' AND resource=' . $extraId . ' AND type=' . $dependency['type']);
1453
-            echo $dependency['module'] . ' Module: ' . $_lang['depedency_update'] . PHP_EOL;
1450
+                'UPDATE '.$dbase.'`'.$sqlParser->prefix.'site_module_depobj` SET module = '.$moduleId.', resource = '.$extraId.', type = '.$dependency['type'].' WHERE module='.$moduleId.' AND resource='.$extraId.' AND type='.$dependency['type']);
1451
+            echo $dependency['module'].' Module: '.$_lang['depedency_update'].PHP_EOL;
1454 1452
         }
1455 1453
         if ($dependency['type'] == 30 || $dependency['type'] == 40) {
1456 1454
             // set extra guid for plugins and snippets
1457 1455
             $ds = mysqli_query($sqlParser->conn,
1458
-                'SELECT id FROM ' . $dbase . '`' . $sqlParser->prefix . 'site_' . $dependency['table'] . '` WHERE id=' . $extraId . ' LIMIT 1');
1456
+                'SELECT id FROM '.$dbase.'`'.$sqlParser->prefix.'site_'.$dependency['table'].'` WHERE id='.$extraId.' LIMIT 1');
1459 1457
             if (!$ds) {
1460
-                echo mysqli_error($sqlParser->conn) . PHP_EOL;
1458
+                echo mysqli_error($sqlParser->conn).PHP_EOL;
1461 1459
 
1462 1460
                 return;
1463 1461
             } else {
1464 1462
                 if (mysqli_num_rows($ds) != 0) {
1465 1463
                     mysqli_query($sqlParser->conn,
1466
-                        'UPDATE ' . $dbase . '`' . $sqlParser->prefix . 'site_' . $dependency['table'] . '` SET moduleguid = ' . $moduleGuid . ' WHERE id=' . $extraId);
1467
-                    echo $dependency['name'] . ': ' . $_lang['guid_set'] . PHP_EOL;
1464
+                        'UPDATE '.$dbase.'`'.$sqlParser->prefix.'site_'.$dependency['table'].'` SET moduleguid = '.$moduleGuid.' WHERE id='.$extraId);
1465
+                    echo $dependency['name'].': '.$_lang['guid_set'].PHP_EOL;
1468 1466
                 }
1469 1467
             }
1470 1468
         }
@@ -1473,58 +1471,58 @@  discard block
 block discarded – undo
1473 1471
 
1474 1472
 // call back function
1475 1473
 if ($callBackFnc != "") {
1476
-    $callBackFnc ($sqlParser);
1474
+    $callBackFnc($sqlParser);
1477 1475
 }
1478 1476
 
1479 1477
 // Setup the MODX API -- needed for the cache processor
1480 1478
 if (!defined('MODX_MANAGER_PATH')) {
1481
-    define('MODX_MANAGER_PATH', $base_path . MGR_DIR . '/');
1479
+    define('MODX_MANAGER_PATH', $base_path.MGR_DIR.'/');
1482 1480
 }
1483 1481
 $database_type = 'mysqli';
1484 1482
 // initiate a new document parser
1485
-include_once($path . '../' . MGR_DIR . '/includes/document.parser.class.inc.php');
1483
+include_once($path.'../'.MGR_DIR.'/includes/document.parser.class.inc.php');
1486 1484
 $modx = new DocumentParser;
1487 1485
 $modx->db->connect();
1488 1486
 // always empty cache after install
1489 1487
 $sync = new EvolutionCMS\Cache();
1490
-$sync->setCachepath($path . "../assets/cache/");
1488
+$sync->setCachepath($path."../assets/cache/");
1491 1489
 $sync->setReport(false);
1492 1490
 $sync->emptyCache(); // first empty the cache
1493 1491
 
1494 1492
 // try to chmod the cache go-rwx (for suexeced php)
1495
-$chmodSuccess = @chmod($path . '../assets/cache/siteCache.idx.php', 0600);
1496
-$chmodSuccess = @chmod($path . '../assets/cache/sitePublishing.idx.php', 0600);
1493
+$chmodSuccess = @chmod($path.'../assets/cache/siteCache.idx.php', 0600);
1494
+$chmodSuccess = @chmod($path.'../assets/cache/sitePublishing.idx.php', 0600);
1497 1495
 
1498 1496
 // remove any locks on the manager functions so initial manager login is not blocked
1499
-mysqli_query($conn, "TRUNCATE TABLE `" . $table_prefix . "active_users`");
1497
+mysqli_query($conn, "TRUNCATE TABLE `".$table_prefix."active_users`");
1500 1498
 
1501 1499
 // close db connection
1502 1500
 $sqlParser->close();
1503 1501
 
1504 1502
 // andrazk 20070416 - release manager access
1505
-if (file_exists($path . '../assets/cache/installProc.inc.php')) {
1506
-    @chmod($path . '../assets/cache/installProc.inc.php', 0755);
1507
-    unlink($path . '../assets/cache/installProc.inc.php');
1503
+if (file_exists($path.'../assets/cache/installProc.inc.php')) {
1504
+    @chmod($path.'../assets/cache/installProc.inc.php', 0755);
1505
+    unlink($path.'../assets/cache/installProc.inc.php');
1508 1506
 }
1509 1507
 
1510 1508
 // setup completed!
1511
-echo PHP_EOL . $_lang['installation_successful'] . PHP_EOL . PHP_EOL;
1509
+echo PHP_EOL.$_lang['installation_successful'].PHP_EOL.PHP_EOL;
1512 1510
 //echo "<p>" . $_lang['to_log_into_content_manager'] . "</p>";
1513 1511
 if ($installMode == 0) {
1514
-    echo strip_tags($_lang['installation_note']) . PHP_EOL;
1512
+    echo strip_tags($_lang['installation_note']).PHP_EOL;
1515 1513
 } else {
1516
-    echo strip_tags($_lang['upgrade_note']) . PHP_EOL;
1514
+    echo strip_tags($_lang['upgrade_note']).PHP_EOL;
1517 1515
 }
1518 1516
 
1519 1517
 
1520 1518
 if (empty($args)) {
1521
-    echo PHP_EOL . 'Remove install folder?' . PHP_EOL;
1519
+    echo PHP_EOL.'Remove install folder?'.PHP_EOL;
1522 1520
     $removeInstall = readline("Type 'y' or 'n' to continue: ");
1523 1521
 }
1524 1522
 //remove installFolder
1525 1523
 if ($removeInstall === 'y') {
1526 1524
     removeFolder($path);
1527
-    removeFolder($base_path . '.tx');
1528
-    unlink($base_path . 'README.md');
1529
-    echo 'Install folder deleted!' . PHP_EOL . PHP_EOL;
1525
+    removeFolder($base_path.'.tx');
1526
+    unlink($base_path.'README.md');
1527
+    echo 'Install folder deleted!'.PHP_EOL.PHP_EOL;
1530 1528
 }
Please login to merge, or discard this patch.
install/src/controllers/language.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-$content = file_get_contents(dirname(__DIR__) . '/template/actions/language.tpl');
3
+$content = file_get_contents(dirname(__DIR__).'/template/actions/language.tpl');
4 4
 $content = parse($content, array(
5 5
     'langOptions' => getLangOptions($install_language))
6 6
 );
7
-$content = parse($content, $_lang,'[%','%]');
7
+$content = parse($content, $_lang, '[%', '%]');
8 8
 
9 9
 echo $content;
Please login to merge, or discard this patch.
install/src/controllers/summary.php 4 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -248,9 +248,9 @@
 block discarded – undo
248 248
         echo '<span class="notok">' . $_lang['failed'] . '</span></b>' . $_lang['table_prefix_not_exist'] . '</p>';
249 249
         $errors++;
250 250
         echo '<p>' . $_lang['table_prefix_not_exist_note'] . '</p>';
251
-  } else {
251
+    } else {
252 252
         echo '<span class="ok">' . $_lang['ok'] . '</span></p>';
253
-  }
253
+    }
254 254
 }
255 255
 
256 256
 // check mysql version
Please login to merge, or discard this patch.
Braces   +35 added lines, -18 removed lines patch added patch discarded remove patch
@@ -1,19 +1,22 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! function_exists('f_owc')){
2
+if( ! function_exists('f_owc')) {
3 3
     /**
4 4
      * @param $path
5 5
      * @param $data
6 6
      * @param null|int $mode
7 7
      */
8
-    function f_owc($path, $data, $mode = null){
8
+    function f_owc($path, $data, $mode = null)
9
+    {
9 10
         try {
10 11
             // make an attempt to create the file
11 12
             $hnd = fopen($path, 'w');
12 13
             fwrite($hnd, $data);
13 14
             fclose($hnd);
14 15
 
15
-            if(null !== $mode) chmod($path, $mode);
16
-        }catch(Exception $e){
16
+            if(null !== $mode) {
17
+                chmod($path, $mode);
18
+            }
19
+        } catch(Exception $e) {
17 20
             // Nothing, this is NOT normal
18 21
             unset($e);
19 22
         }
@@ -21,7 +24,9 @@  discard block
 block discarded – undo
21 24
 }
22 25
 
23 26
 $installMode = isset($_POST['installmode']) ? (int)$_POST['installmode'] : 0;
24
-if( ! isset($_lang)) $_lang = array();
27
+if( ! isset($_lang)) {
28
+    $_lang = array();
29
+}
25 30
 
26 31
 echo '<div class="stepcontainer">
27 32
       <ul class="progressbar">
@@ -57,7 +62,7 @@  discard block
 block discarded – undo
57 62
 // check if iconv is available
58 63
 echo '<p>' . $_lang['checking_iconv'];
59 64
 $iconv = (int) function_exists('iconv');
60
-if ($iconv == '0'){
65
+if ($iconv == '0') {
61 66
     echo '<span class="notok">' . $_lang['failed'].'</span></p><p><strong>'.$_lang['checking_iconv_note'].'</strong></p>';
62 67
     $errors++;
63 68
 } else {
@@ -119,7 +124,7 @@  discard block
 block discarded – undo
119 124
 
120 125
 // File Browser directories exists?
121 126
 echo '<p>'.$_lang['checking_if_images_exist'];
122
-switch(true){
127
+switch(true) {
123 128
     case !file_exists("../assets/images"):
124 129
     case !file_exists("../assets/files"):
125 130
     case !file_exists("../assets/backup"):
@@ -134,7 +139,7 @@  discard block
 block discarded – undo
134 139
 
135 140
 // File Browser directories writable?
136 141
 echo '<p>'.$_lang['checking_if_images_writable'];
137
-switch(true){
142
+switch(true) {
138 143
     case !is_writable("../assets/images"):
139 144
     case !is_writable("../assets/files"):
140 145
     case !is_writable("../assets/backup"):
@@ -268,7 +273,7 @@  discard block
 block discarded – undo
268 273
 if ($conn) {
269 274
     echo '<p>'. $_lang['checking_mysql_strict_mode'];
270 275
     $mysqlmode = mysqli_query($conn, "SELECT @@global.sql_mode");
271
-    if (mysqli_num_rows($mysqlmode) > 0){
276
+    if (mysqli_num_rows($mysqlmode) > 0) {
272 277
         $modes = mysqli_fetch_array($mysqlmode, MYSQLI_NUM);
273 278
         //$modes = array("STRICT_TRANS_TABLES"); // for testing
274 279
         // print_r($modes);
@@ -305,9 +310,9 @@  discard block
 block discarded – undo
305 310
     echo '<p>';
306 311
     echo $_lang['setup_cannot_continue'] . ' ';
307 312
 
308
-    if($errors > 1){
313
+    if($errors > 1) {
309 314
         echo $errors . " " . $_lang['errors'] . $_lang['please_correct_errors'] . $_lang['and_try_again_plural'];
310
-    }else{
315
+    } else {
311 316
         echo $_lang['error'] . $_lang['please_correct_error'] . $_lang['and_try_again'];
312 317
     }
313 318
 
@@ -343,23 +348,35 @@  discard block
 block discarded – undo
343 348
     <input type="hidden" value="<?php echo $_POST['installdata'] ?>" name="installdata" />
344 349
 <?php
345 350
     $templates = isset ($_POST['template']) ? $_POST['template'] : array ();
346
-    foreach ($templates as $i => $template) echo '<input type="hidden" name="template[]" value="'.$template.'" />';
351
+    foreach ($templates as $i => $template) {
352
+        echo '<input type="hidden" name="template[]" value="'.$template.'" />';
353
+    }
347 354
 
348 355
     $tvs = isset ($_POST['tv']) ? $_POST['tv'] : array ();
349
-    foreach ($tvs as $i => $tv) echo '<input type="hidden" name="tv[]" value="'.$tv.'" />';
356
+    foreach ($tvs as $i => $tv) {
357
+        echo '<input type="hidden" name="tv[]" value="'.$tv.'" />';
358
+    }
350 359
 
351 360
     $chunks = isset ($_POST['chunk']) ? $_POST['chunk'] : array ();
352
-    foreach ($chunks as $i => $chunk) echo '<input type="hidden" name="chunk[]" value="'.$chunk.'" />';
361
+    foreach ($chunks as $i => $chunk) {
362
+        echo '<input type="hidden" name="chunk[]" value="'.$chunk.'" />';
363
+    }
353 364
 
354 365
     $snippets = isset ($_POST['snippet']) ? $_POST['snippet'] : array ();
355
-    foreach ($snippets as $i => $snippet) echo '<input type="hidden" name="snippet[]" value="'.$snippet.'" />';
366
+    foreach ($snippets as $i => $snippet) {
367
+        echo '<input type="hidden" name="snippet[]" value="'.$snippet.'" />';
368
+    }
356 369
 
357 370
     $plugins = isset ($_POST['plugin']) ? $_POST['plugin'] : array ();
358
-    foreach ($plugins as $i => $plugin) echo '<input type="hidden" name="plugin[]" value="'.$plugin.'" />';
371
+    foreach ($plugins as $i => $plugin) {
372
+        echo '<input type="hidden" name="plugin[]" value="'.$plugin.'" />';
373
+    }
359 374
 
360 375
     $modules = isset ($_POST['module']) ? $_POST['module'] : array ();
361
-    foreach ($modules as $i => $module) echo '<input type="hidden" name="module[]" value="'.$module.'" />';
362
-?>
376
+    foreach ($modules as $i => $module) {
377
+        echo '<input type="hidden" name="module[]" value="'.$module.'" />';
378
+    }
379
+    ?>
363 380
 </div>
364 381
 
365 382
 <h2><?php echo $_lang['agree_to_terms'];?></h2>
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -207,7 +207,7 @@
 block discarded – undo
207 207
 
208 208
 
209 209
 // make sure we can use the database
210
-if ($installMode > 0 && !mysqli_query($conn, "USE {$dbase}")) {
210
+if ($installMode > 0 && !mysqli_query($conn, "use {$dbase}")) {
211 211
     $errors++;
212 212
     echo '<span class="notok">'.$_lang['database_use_failed'].'</span><p />'.$_lang["database_use_failed_note"].'</p>';
213 213
 }
Please login to merge, or discard this patch.
Spacing   +75 added lines, -75 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! function_exists('f_owc')){
2
+if (!function_exists('f_owc')) {
3 3
     /**
4 4
      * @param $path
5 5
      * @param $data
@@ -12,30 +12,30 @@  discard block
 block discarded – undo
12 12
             fwrite($hnd, $data);
13 13
             fclose($hnd);
14 14
 
15
-            if(null !== $mode) chmod($path, $mode);
16
-        }catch(Exception $e){
15
+            if (null !== $mode) chmod($path, $mode);
16
+        } catch (Exception $e) {
17 17
             // Nothing, this is NOT normal
18 18
             unset($e);
19 19
         }
20 20
     }
21 21
 }
22 22
 
23
-$installMode = isset($_POST['installmode']) ? (int)$_POST['installmode'] : 0;
24
-if( ! isset($_lang)) $_lang = array();
23
+$installMode = isset($_POST['installmode']) ? (int) $_POST['installmode'] : 0;
24
+if (!isset($_lang)) $_lang = array();
25 25
 
26 26
 echo '<div class="stepcontainer">
27 27
       <ul class="progressbar">
28
-          <li class="visited">' . $_lang['choose_language'] . '</li>
29
-          <li class="visited">' . $_lang['installation_mode'] . '</li>
30
-          <li class="visited">' . $_lang['optional_items'] . '</li>
31
-          <li class="active">' . $_lang['preinstall_validation'] . '</li>
32
-          <li>' . $_lang['install_results'] . '</li>
28
+          <li class="visited">' . $_lang['choose_language'].'</li>
29
+          <li class="visited">' . $_lang['installation_mode'].'</li>
30
+          <li class="visited">' . $_lang['optional_items'].'</li>
31
+          <li class="active">' . $_lang['preinstall_validation'].'</li>
32
+          <li>' . $_lang['install_results'].'</li>
33 33
   </ul>
34 34
   <div class="clearleft"></div>
35 35
 </div>';
36 36
 
37
-echo '<h2>' . $_lang['preinstall_validation'] . '</h2>';
38
-echo '<h3>' . $_lang['summary_setup_check'] . '</h3>';
37
+echo '<h2>'.$_lang['preinstall_validation'].'</h2>';
38
+echo '<h3>'.$_lang['summary_setup_check'].'</h3>';
39 39
 
40 40
 $errors = 0;
41 41
 
@@ -43,33 +43,33 @@  discard block
 block discarded – undo
43 43
 // check PHP version
44 44
 define('PHP_MIN_VERSION', '5.4.0');
45 45
 $phpMinVersion = PHP_MIN_VERSION; // Maybe not necessary. For backward compatibility
46
-echo '<p>' . $_lang['checking_php_version'];
46
+echo '<p>'.$_lang['checking_php_version'];
47 47
 // -1 if left is less, 0 if equal, +1 if left is higher
48 48
 if (version_compare(phpversion(), PHP_MIN_VERSION) < 0) {
49 49
     $errors++;
50
-    $tmp = $_lang['you_running_php'] . phpversion() . str_replace('[+min_version+]', PHP_MIN_VERSION, $_lang["modx_requires_php"]);
51
-    echo '<span class="notok">' . $_lang['failed'] . '</span>' . $tmp . '</p>';
50
+    $tmp = $_lang['you_running_php'].phpversion().str_replace('[+min_version+]', PHP_MIN_VERSION, $_lang["modx_requires_php"]);
51
+    echo '<span class="notok">'.$_lang['failed'].'</span>'.$tmp.'</p>';
52 52
 } else {
53
-    echo '<span class="ok">' . $_lang['ok'] . '</span></p>';
53
+    echo '<span class="ok">'.$_lang['ok'].'</span></p>';
54 54
 }
55 55
 
56 56
 
57 57
 // check if iconv is available
58
-echo '<p>' . $_lang['checking_iconv'];
58
+echo '<p>'.$_lang['checking_iconv'];
59 59
 $iconv = (int) function_exists('iconv');
60
-if ($iconv == '0'){
61
-    echo '<span class="notok">' . $_lang['failed'].'</span></p><p><strong>'.$_lang['checking_iconv_note'].'</strong></p>';
60
+if ($iconv == '0') {
61
+    echo '<span class="notok">'.$_lang['failed'].'</span></p><p><strong>'.$_lang['checking_iconv_note'].'</strong></p>';
62 62
     $errors++;
63 63
 } else {
64
-    echo '<span class="ok">' . $_lang['ok'] . '</span></p>';
64
+    echo '<span class="ok">'.$_lang['ok'].'</span></p>';
65 65
 }
66 66
 // check sessions
67
-echo '<p>' . $_lang['checking_sessions'];
67
+echo '<p>'.$_lang['checking_sessions'];
68 68
 if ($_SESSION['test'] != 1) {
69
-    echo '<span class="notok">' . $_lang['failed'].  '</span></p>';
69
+    echo '<span class="notok">'.$_lang['failed'].'</span></p>';
70 70
     $errors++;
71 71
 } else {
72
-    echo '<span class="ok">' . $_lang['ok'] . '</span></p>';
72
+    echo '<span class="ok">'.$_lang['ok'].'</span></p>';
73 73
 }
74 74
 
75 75
 
@@ -85,24 +85,24 @@  discard block
 block discarded – undo
85 85
 
86 86
 
87 87
 // cache writable?
88
-echo '<p>' . $_lang['checking_if_cache_writable'];
88
+echo '<p>'.$_lang['checking_if_cache_writable'];
89 89
 if (!is_writable("../assets/cache")) {
90 90
     $errors++;
91
-    echo '<span class="notok">' . $_lang['failed'] . '</span></p>';
91
+    echo '<span class="notok">'.$_lang['failed'].'</span></p>';
92 92
 } else {
93
-    echo '<span class="ok">' . $_lang['ok'] . '</span></p>';
93
+    echo '<span class="ok">'.$_lang['ok'].'</span></p>';
94 94
 }
95 95
 
96 96
 
97 97
 // cache files writable?
98
-echo '<p>' . $_lang['checking_if_cache_file_writable'];
98
+echo '<p>'.$_lang['checking_if_cache_file_writable'];
99 99
 $tmp = "../assets/cache/siteCache.idx.php";
100
-if ( ! file_exists($tmp)) {
100
+if (!file_exists($tmp)) {
101 101
     f_owc($tmp, "<?php //EVO site cache file ?>");
102 102
 }
103
-if ( ! is_writable($tmp)) {
103
+if (!is_writable($tmp)) {
104 104
     $errors++;
105
-    echo '<span class="notok">' . $_lang['failed'] . '</span></p>';
105
+    echo '<span class="notok">'.$_lang['failed'].'</span></p>';
106 106
 } else {
107 107
     echo '<span class="ok">'.$_lang['ok'].'</span></p>';
108 108
 }
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 
120 120
 // File Browser directories exists?
121 121
 echo '<p>'.$_lang['checking_if_images_exist'];
122
-switch(true){
122
+switch (true) {
123 123
     case !file_exists("../assets/images"):
124 124
     case !file_exists("../assets/files"):
125 125
     case !file_exists("../assets/backup"):
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 
135 135
 // File Browser directories writable?
136 136
 echo '<p>'.$_lang['checking_if_images_writable'];
137
-switch(true){
137
+switch (true) {
138 138
     case !is_writable("../assets/images"):
139 139
     case !is_writable("../assets/files"):
140 140
     case !is_writable("../assets/backup"):
@@ -196,12 +196,12 @@  discard block
 block discarded – undo
196 196
     $database_charset = substr($database_collation, 0, strpos($database_collation, '_') - 1);
197 197
     $database_connection_charset = $_POST['database_connection_charset'];
198 198
     $database_connection_method = $_POST['database_connection_method'];
199
-    $dbase = '`' . $_POST['database_name'] . '`';
199
+    $dbase = '`'.$_POST['database_name'].'`';
200 200
     $table_prefix = $_POST['tableprefix'];
201 201
 }
202 202
 echo '<p>'.$_lang['creating_database_connection'];
203 203
 $host = explode(':', $database_server, 2);
204
-if (!$conn = mysqli_connect($host[0], $database_user, $database_password,'', isset($host[1]) ? $host[1] : null)) {
204
+if (!$conn = mysqli_connect($host[0], $database_user, $database_password, '', isset($host[1]) ? $host[1] : null)) {
205 205
     $errors++;
206 206
     echo '<span class="notok">'.$_lang['database_connection_failed'].'</span><p />'.$_lang['database_connection_failed_note'].'</p>';
207 207
 } else {
@@ -237,54 +237,54 @@  discard block
 block discarded – undo
237 237
 
238 238
 // check table prefix
239 239
 if ($conn && $installMode == 0) {
240
-    echo '<p>' . $_lang['checking_table_prefix'] . $table_prefix . '`: ';
241
-    if ($rs= mysqli_query($conn, "SELECT COUNT(*) FROM $dbase.`" . $table_prefix . "site_content`")) {
242
-        echo '<span class="notok">' . $_lang['failed'] . '</span></b>' . $_lang['table_prefix_already_inuse'] . '</p>';
240
+    echo '<p>'.$_lang['checking_table_prefix'].$table_prefix.'`: ';
241
+    if ($rs = mysqli_query($conn, "SELECT COUNT(*) FROM $dbase.`".$table_prefix."site_content`")) {
242
+        echo '<span class="notok">'.$_lang['failed'].'</span></b>'.$_lang['table_prefix_already_inuse'].'</p>';
243 243
         $errors++;
244
-        echo "<p>" . $_lang['table_prefix_already_inuse_note'] . '</p>';
244
+        echo "<p>".$_lang['table_prefix_already_inuse_note'].'</p>';
245 245
     } else {
246
-        echo '<span class="ok">' . $_lang['ok'] . '</span></p>';
246
+        echo '<span class="ok">'.$_lang['ok'].'</span></p>';
247 247
     }
248 248
 } elseif ($conn && $installMode == 2) {
249
-    echo '<p>' . $_lang['checking_table_prefix'] . $table_prefix . '`: ';
250
-    if (!$rs = mysqli_query($conn, "SELECT COUNT(*) FROM $dbase.`" . $table_prefix . "site_content`")) {
251
-        echo '<span class="notok">' . $_lang['failed'] . '</span></b>' . $_lang['table_prefix_not_exist'] . '</p>';
249
+    echo '<p>'.$_lang['checking_table_prefix'].$table_prefix.'`: ';
250
+    if (!$rs = mysqli_query($conn, "SELECT COUNT(*) FROM $dbase.`".$table_prefix."site_content`")) {
251
+        echo '<span class="notok">'.$_lang['failed'].'</span></b>'.$_lang['table_prefix_not_exist'].'</p>';
252 252
         $errors++;
253
-        echo '<p>' . $_lang['table_prefix_not_exist_note'] . '</p>';
253
+        echo '<p>'.$_lang['table_prefix_not_exist_note'].'</p>';
254 254
   } else {
255
-        echo '<span class="ok">' . $_lang['ok'] . '</span></p>';
255
+        echo '<span class="ok">'.$_lang['ok'].'</span></p>';
256 256
   }
257 257
 }
258 258
 
259 259
 // check mysql version
260 260
 if ($conn) {
261
-    echo '<p>' . $_lang['checking_mysql_version'];
262
-    if ( version_compare(mysqli_get_server_info($conn), '5.0.51', '=') ) {
263
-        echo '<span class="notok">'  . $_lang['warning'] . '</span></b>&nbsp;&nbsp;<strong>' . $_lang['mysql_5051'] . '</strong></p>';
264
-        echo '<p><span class="notok">' . $_lang['mysql_5051_warning'] . '</span></p>';
261
+    echo '<p>'.$_lang['checking_mysql_version'];
262
+    if (version_compare(mysqli_get_server_info($conn), '5.0.51', '=')) {
263
+        echo '<span class="notok">'.$_lang['warning'].'</span></b>&nbsp;&nbsp;<strong>'.$_lang['mysql_5051'].'</strong></p>';
264
+        echo '<p><span class="notok">'.$_lang['mysql_5051_warning'].'</span></p>';
265 265
     } else {
266
-        echo '<span class="ok">' . $_lang['ok'] . '</span>&nbsp;&nbsp;<strong>' . $_lang['mysql_version_is'] . mysqli_get_server_info($conn) . '</strong></p>';
266
+        echo '<span class="ok">'.$_lang['ok'].'</span>&nbsp;&nbsp;<strong>'.$_lang['mysql_version_is'].mysqli_get_server_info($conn).'</strong></p>';
267 267
     }
268 268
 }
269 269
 
270 270
 // check for strict mode
271 271
 if ($conn) {
272
-    echo '<p>'. $_lang['checking_mysql_strict_mode'];
272
+    echo '<p>'.$_lang['checking_mysql_strict_mode'];
273 273
     $mysqlmode = mysqli_query($conn, "SELECT @@global.sql_mode");
274
-    if (mysqli_num_rows($mysqlmode) > 0){
274
+    if (mysqli_num_rows($mysqlmode) > 0) {
275 275
         $modes = mysqli_fetch_array($mysqlmode, MYSQLI_NUM);
276 276
         //$modes = array("STRICT_TRANS_TABLES"); // for testing
277 277
         // print_r($modes);
278 278
         foreach ($modes as $mode) {
279 279
             if (stristr($mode, "STRICT_TRANS_TABLES") !== false || stristr($mode, "STRICT_ALL_TABLES") !== false) {
280
-                echo '<span class="notok">' . $_lang['warning'] . '</span></b> <strong>&nbsp;&nbsp;' . $_lang['strict_mode'] . '</strong></p>';
281
-                echo '<p><span class="notok">' . $_lang['strict_mode_error'] . '</span></p>';
280
+                echo '<span class="notok">'.$_lang['warning'].'</span></b> <strong>&nbsp;&nbsp;'.$_lang['strict_mode'].'</strong></p>';
281
+                echo '<p><span class="notok">'.$_lang['strict_mode_error'].'</span></p>';
282 282
             } else {
283
-                echo '<span class="ok">' . $_lang['ok'] . '</span></p>';
283
+                echo '<span class="ok">'.$_lang['ok'].'</span></p>';
284 284
             }
285 285
         }
286 286
     } else {
287
-        echo '<span class="ok">' . $_lang['ok'] . '</span></p>';
287
+        echo '<span class="ok">'.$_lang['ok'].'</span></p>';
288 288
     }
289 289
 }
290 290
 // Version and strict mode check end
@@ -300,18 +300,18 @@  discard block
 block discarded – undo
300 300
     f_owc("../assets/cache/installProc.inc.php", '<?php $installStartTime = '.time().'; ?>');
301 301
 }
302 302
 
303
-if($installMode > 0 && $_POST['installdata'] == "1") {
304
-    echo '<p class="notes"><strong>' . $_lang['sample_web_site'] . ':</strong> ' . $_lang['sample_web_site_note'] . '</p>';
303
+if ($installMode > 0 && $_POST['installdata'] == "1") {
304
+    echo '<p class="notes"><strong>'.$_lang['sample_web_site'].':</strong> '.$_lang['sample_web_site_note'].'</p>';
305 305
 }
306 306
 
307 307
 if ($errors > 0) {
308 308
     echo '<p>';
309
-    echo $_lang['setup_cannot_continue'] . ' ';
309
+    echo $_lang['setup_cannot_continue'].' ';
310 310
 
311
-    if($errors > 1){
312
-        echo $errors . " " . $_lang['errors'] . $_lang['please_correct_errors'] . $_lang['and_try_again_plural'];
313
-    }else{
314
-        echo $_lang['error'] . $_lang['please_correct_error'] . $_lang['and_try_again'];
311
+    if ($errors > 1) {
312
+        echo $errors." ".$_lang['errors'].$_lang['please_correct_errors'].$_lang['and_try_again_plural'];
313
+    } else {
314
+        echo $_lang['error'].$_lang['please_correct_error'].$_lang['and_try_again'];
315 315
     }
316 316
 
317 317
     echo $_lang['visit_forum'];
@@ -320,10 +320,10 @@  discard block
 block discarded – undo
320 320
 
321 321
 echo '<p>&nbsp;</p>';
322 322
 
323
-$nextAction= $errors > 0 ? 'summary' : 'install';
324
-$nextButton= $errors > 0 ? $_lang['retry'] : $_lang['install'];
325
-$nextVisibility= $errors > 0 || isset($_POST['chkagree']) ? 'visible' : 'hidden';
326
-$agreeToggle= $errors > 0 ? '' : ' onclick="if(document.getElementById(\'chkagree\').checked){document.getElementById(\'nextbutton\').style.visibility=\'visible\';}else{document.getElementById(\'nextbutton\').style.visibility=\'hidden\';}"';
323
+$nextAction = $errors > 0 ? 'summary' : 'install';
324
+$nextButton = $errors > 0 ? $_lang['retry'] : $_lang['install'];
325
+$nextVisibility = $errors > 0 || isset($_POST['chkagree']) ? 'visible' : 'hidden';
326
+$agreeToggle = $errors > 0 ? '' : ' onclick="if(document.getElementById(\'chkagree\').checked){document.getElementById(\'nextbutton\').style.visibility=\'visible\';}else{document.getElementById(\'nextbutton\').style.visibility=\'hidden\';}"';
327 327
 ?>
328 328
 <form name="install" id="install_form" action="index.php?action=<?php echo $nextAction ?>" method="post">
329 329
   <div>
@@ -345,32 +345,32 @@  discard block
 block discarded – undo
345 345
 
346 346
     <input type="hidden" value="<?php echo $_POST['installdata'] ?>" name="installdata" />
347 347
 <?php
348
-    $templates = isset ($_POST['template']) ? $_POST['template'] : array ();
348
+    $templates = isset ($_POST['template']) ? $_POST['template'] : array();
349 349
     foreach ($templates as $i => $template) echo '<input type="hidden" name="template[]" value="'.$template.'" />';
350 350
 
351
-    $tvs = isset ($_POST['tv']) ? $_POST['tv'] : array ();
351
+    $tvs = isset ($_POST['tv']) ? $_POST['tv'] : array();
352 352
     foreach ($tvs as $i => $tv) echo '<input type="hidden" name="tv[]" value="'.$tv.'" />';
353 353
 
354
-    $chunks = isset ($_POST['chunk']) ? $_POST['chunk'] : array ();
354
+    $chunks = isset ($_POST['chunk']) ? $_POST['chunk'] : array();
355 355
     foreach ($chunks as $i => $chunk) echo '<input type="hidden" name="chunk[]" value="'.$chunk.'" />';
356 356
 
357
-    $snippets = isset ($_POST['snippet']) ? $_POST['snippet'] : array ();
357
+    $snippets = isset ($_POST['snippet']) ? $_POST['snippet'] : array();
358 358
     foreach ($snippets as $i => $snippet) echo '<input type="hidden" name="snippet[]" value="'.$snippet.'" />';
359 359
 
360
-    $plugins = isset ($_POST['plugin']) ? $_POST['plugin'] : array ();
360
+    $plugins = isset ($_POST['plugin']) ? $_POST['plugin'] : array();
361 361
     foreach ($plugins as $i => $plugin) echo '<input type="hidden" name="plugin[]" value="'.$plugin.'" />';
362 362
 
363
-    $modules = isset ($_POST['module']) ? $_POST['module'] : array ();
363
+    $modules = isset ($_POST['module']) ? $_POST['module'] : array();
364 364
     foreach ($modules as $i => $module) echo '<input type="hidden" name="module[]" value="'.$module.'" />';
365 365
 ?>
366 366
 </div>
367 367
 
368
-<h2><?php echo $_lang['agree_to_terms'];?></h2>
368
+<h2><?php echo $_lang['agree_to_terms']; ?></h2>
369 369
 <p>
370
-<input type="checkbox" value="1" id="chkagree" name="chkagree" style="line-height:18px" <?php echo isset($_POST['chkagree']) ? 'checked="checked" ':""; ?><?php echo $agreeToggle;?>/><label for="chkagree" style="display:inline;float:none;line-height:18px;"> <?php echo $_lang['iagree_box']?> </label>
370
+<input type="checkbox" value="1" id="chkagree" name="chkagree" style="line-height:18px" <?php echo isset($_POST['chkagree']) ? 'checked="checked" ' : ""; ?><?php echo $agreeToggle; ?>/><label for="chkagree" style="display:inline;float:none;line-height:18px;"> <?php echo $_lang['iagree_box']?> </label>
371 371
 </p>
372 372
     <p class="buttonlinks">
373 373
         <a href="javascript:document.getElementById('install_form').action='index.php?action=options&language=<?php echo $install_language?>';document.getElementById('install_form').submit();" class="prev" title="<?php echo $_lang['btnback_value']?>"><span><?php echo $_lang['btnback_value']?></span></a>
374
-        <a id="nextbutton" href="javascript:document.getElementById('install_form').submit();" title="<?php echo $nextButton ?>" style="visibility:<?php echo $nextVisibility;?>"><span><?php echo $nextButton ?></span></a>
374
+        <a id="nextbutton" href="javascript:document.getElementById('install_form').submit();" title="<?php echo $nextButton ?>" style="visibility:<?php echo $nextVisibility; ?>"><span><?php echo $nextButton ?></span></a>
375 375
     </p>
376 376
 </form>
Please login to merge, or discard this patch.