Completed
Pull Request — develop (#711)
by Agel_Nash
07:58
created
install/actions/action_options.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-$installMode = isset($_POST['installmode']) ? (int)$_POST['installmode'] : 0;
2
+$installMode = isset($_POST['installmode']) ? (int) $_POST['installmode'] : 0;
3 3
 
4
-if( ! function_exists('getTemplates')) {
4
+if (!function_exists('getTemplates')) {
5 5
     /**
6 6
      * @param array $presets
7 7
      * @return string
@@ -25,11 +25,11 @@  discard block
 block discarded – undo
25 25
             $_[] = parse($tpl, $ph);
26 26
             $i++;
27 27
         }
28
-        return (0 < count($_)) ? '<h3>[%templates%]</h3>' . implode("\n", $_) : '';
28
+        return (0 < count($_)) ? '<h3>[%templates%]</h3>'.implode("\n", $_) : '';
29 29
     }
30 30
 }
31 31
 
32
-if( ! function_exists('getTVs')) {
32
+if (!function_exists('getTVs')) {
33 33
     /**
34 34
      * @param array $presets
35 35
      * @return string
@@ -54,11 +54,11 @@  discard block
 block discarded – undo
54 54
             $_[] = parse($tpl, $ph);
55 55
             $i++;
56 56
         }
57
-        return (0 < count($_)) ? '<h3>[%tvs%]</h3>' . implode("\n", $_) : '';
57
+        return (0 < count($_)) ? '<h3>[%tvs%]</h3>'.implode("\n", $_) : '';
58 58
     }
59 59
 }
60 60
 
61
-if( ! function_exists('getChunks')) {
61
+if (!function_exists('getChunks')) {
62 62
     /**
63 63
      * display chunks
64 64
      *
@@ -84,11 +84,11 @@  discard block
 block discarded – undo
84 84
             $_[] = parse($tpl, $ph);
85 85
             $i++;
86 86
         }
87
-        return (0 < count($_)) ? '<h3>[%chunks%]</h3>' . implode("\n", $_) : '';
87
+        return (0 < count($_)) ? '<h3>[%chunks%]</h3>'.implode("\n", $_) : '';
88 88
     }
89 89
 }
90 90
 
91
-if( ! function_exists('getModules')) {
91
+if (!function_exists('getModules')) {
92 92
     /**
93 93
      * display modules
94 94
      *
@@ -114,11 +114,11 @@  discard block
 block discarded – undo
114 114
             $_[] = parse($tpl, $ph);
115 115
             $i++;
116 116
         }
117
-        return (0 < count($_)) ? '<h3>[%modules%]</h3>' . implode("\n", $_) : '';
117
+        return (0 < count($_)) ? '<h3>[%modules%]</h3>'.implode("\n", $_) : '';
118 118
     }
119 119
 }
120 120
 
121
-if( ! function_exists('getPlugins')) {
121
+if (!function_exists('getPlugins')) {
122 122
     /**
123 123
      * display plugins
124 124
      *
@@ -148,11 +148,11 @@  discard block
 block discarded – undo
148 148
             $_[] = parse($tpl, $ph);
149 149
             $i++;
150 150
         }
151
-        return (0 < count($_)) ? '<h3>[%plugins%]</h3>' . implode("\n", $_) : '';
151
+        return (0 < count($_)) ? '<h3>[%plugins%]</h3>'.implode("\n", $_) : '';
152 152
     }
153 153
 }
154 154
 
155
-if( ! function_exists('getSnippets')) {
155
+if (!function_exists('getSnippets')) {
156 156
     /**
157 157
      * display snippets
158 158
      *
@@ -178,23 +178,23 @@  discard block
 block discarded – undo
178 178
             $_[] = parse($tpl, $ph);
179 179
             $i++;
180 180
         }
181
-        return (0 < count($_)) ? '<h3>[%snippets%]</h3>' . implode("\n", $_) : '';
181
+        return (0 < count($_)) ? '<h3>[%snippets%]</h3>'.implode("\n", $_) : '';
182 182
     }
183 183
 }
184 184
 
185
-switch($installMode){
185
+switch ($installMode) {
186 186
     case 0:
187 187
     case 2:
188 188
         $database_collation = isset($_POST['database_collation']) ? $_POST['database_collation'] : 'utf8_general_ci';
189 189
         $database_charset = substr($database_collation, 0, strpos($database_collation, '_'));
190 190
         $_POST['database_connection_charset'] = $database_charset;
191
-        if(!empty($_POST['databaseloginpassword']))
191
+        if (!empty($_POST['databaseloginpassword']))
192 192
             $_SESSION['databaseloginpassword'] = $_POST['databaseloginpassword'];
193
-        if(!empty($_POST['databaseloginname']))
193
+        if (!empty($_POST['databaseloginname']))
194 194
             $_SESSION['databaseloginname'] = $_POST['databaseloginname'];
195 195
         break;
196 196
     case 1:
197
-        include $base_path . MGR_DIR . '/includes/config.inc.php';
197
+        include $base_path.MGR_DIR.'/includes/config.inc.php';
198 198
         if (@ $conn = mysqli_connect($database_server, $database_user, $database_password)) {
199 199
             if (@ mysqli_query($conn, "USE {$dbase}")) {
200 200
                 if (!$rs = mysqli_query($conn, "show session variables like 'collation_database'")) {
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 $ph['checked'] = isset ($_POST['installdata']) && $_POST['installdata'] == "1" ? 'checked' : '';
250 250
 
251 251
 # load setup information file
252
-include($base_path . 'install/setup.info.php');
252
+include($base_path.'install/setup.info.php');
253 253
 $ph['templates'] = getTemplates($moduleTemplates);
254 254
 $ph['tvs']       = getTVs($moduleTVs);
255 255
 $ph['chunks']    = getChunks($moduleChunks);
@@ -259,6 +259,6 @@  discard block
 block discarded – undo
259 259
 
260 260
 $ph['action'] = ($installMode == 1) ? 'mode' : 'connection';
261 261
 
262
-$tpl = file_get_contents($base_path . 'install/actions/tpl_options.html');
263
-$content = parse($tpl,$ph);
264
-echo parse($content,$_lang,'[%','%]');
262
+$tpl = file_get_contents($base_path.'install/actions/tpl_options.html');
263
+$content = parse($tpl, $ph);
264
+echo parse($content, $_lang, '[%', '%]');
Please login to merge, or discard this patch.