@@ -192,9 +192,9 @@ discard block |
||
192 | 192 | echo "<span class=\"notok\">" . $_lang['failed'] . "</span></b>" . $_lang['table_prefix_not_exist'] . "</p>"; |
193 | 193 | $errors += 1; |
194 | 194 | echo "<p>" . $_lang['table_prefix_not_exist_note'] . "</p>"; |
195 | - } else { |
|
195 | + } else { |
|
196 | 196 | echo "<span class=\"ok\">" . $_lang['ok'] . "</span></p>"; |
197 | - } |
|
197 | + } |
|
198 | 198 | } |
199 | 199 | |
200 | 200 | // check mysql version |
@@ -252,16 +252,16 @@ discard block |
||
252 | 252 | ?> |
253 | 253 | <p> |
254 | 254 | <?php |
255 | - echo $_lang['setup_cannot_continue'] . ' '; |
|
256 | - echo $errors > 1 ? $errors." " : ""; |
|
257 | - if ($errors > 1) echo $_lang['errors']; |
|
258 | - else echo $_lang['error']; |
|
259 | - if ($errors > 1) echo $_lang['please_correct_errors']; |
|
260 | - else echo $_lang['please_correct_error']; |
|
261 | - if ($errors > 1) echo $_lang['and_try_again_plural']; |
|
262 | - else echo $_lang['and_try_again']; |
|
263 | - echo $_lang['visit_forum']; |
|
264 | - ?> |
|
255 | + echo $_lang['setup_cannot_continue'] . ' '; |
|
256 | + echo $errors > 1 ? $errors." " : ""; |
|
257 | + if ($errors > 1) echo $_lang['errors']; |
|
258 | + else echo $_lang['error']; |
|
259 | + if ($errors > 1) echo $_lang['please_correct_errors']; |
|
260 | + else echo $_lang['please_correct_error']; |
|
261 | + if ($errors > 1) echo $_lang['and_try_again_plural']; |
|
262 | + else echo $_lang['and_try_again']; |
|
263 | + echo $_lang['visit_forum']; |
|
264 | + ?> |
|
265 | 265 | </p> |
266 | 266 | <?php |
267 | 267 | } |
@@ -2,65 +2,65 @@ discard block |
||
2 | 2 | $installMode = intval($_POST['installmode']); |
3 | 3 | echo "<div class=\"stepcontainer\"> |
4 | 4 | <ul class=\"progressbar\"> |
5 | - <li class=\"visited\">" . $_lang['choose_language'] . "</li> |
|
6 | - <li class=\"visited\">" . $_lang['installation_mode'] . "</li> |
|
7 | - <li class=\"visited\">" . $_lang['optional_items'] . "</li> |
|
8 | - <li class=\"active\">" . $_lang['preinstall_validation'] . "</li> |
|
9 | - <li>" . $_lang['install_results'] . "</li> |
|
5 | + <li class=\"visited\">" . $_lang['choose_language']."</li> |
|
6 | + <li class=\"visited\">" . $_lang['installation_mode']."</li> |
|
7 | + <li class=\"visited\">" . $_lang['optional_items']."</li> |
|
8 | + <li class=\"active\">" . $_lang['preinstall_validation']."</li> |
|
9 | + <li>" . $_lang['install_results']."</li> |
|
10 | 10 | </ul> |
11 | 11 | <div class=\"clearleft\"></div> |
12 | 12 | </div> |
13 | -<h2>" . $_lang['preinstall_validation'] . "</h2>"; |
|
13 | +<h2>" . $_lang['preinstall_validation']."</h2>"; |
|
14 | 14 | |
15 | -echo "<h3>" . $_lang['summary_setup_check'] . "</h3>"; |
|
15 | +echo "<h3>".$_lang['summary_setup_check']."</h3>"; |
|
16 | 16 | $errors = 0; |
17 | 17 | |
18 | 18 | // check PHP version |
19 | -echo "<p>" . $_lang['checking_php_version']; |
|
19 | +echo "<p>".$_lang['checking_php_version']; |
|
20 | 20 | $phpMinVersion = "5.4.0"; |
21 | 21 | // -1 if left is less, 0 if equal, +1 if left is higher |
22 | 22 | if (version_compare(phpversion(), $phpMinVersion) < 0) { |
23 | - echo "<span class=\"notok\">" . $_lang['failed'] . "</span>" . $_lang['you_running_php'] . phpversion() . str_replace('[+min_version+]', $phpMinVersion, $_lang["modx_requires_php"]) . "</p>"; |
|
23 | + echo "<span class=\"notok\">".$_lang['failed']."</span>".$_lang['you_running_php'].phpversion().str_replace('[+min_version+]', $phpMinVersion, $_lang["modx_requires_php"])."</p>"; |
|
24 | 24 | $errors += 1; |
25 | 25 | } else { |
26 | - echo "<span class=\"ok\">" . $_lang['ok'] . "</span></p>"; |
|
26 | + echo "<span class=\"ok\">".$_lang['ok']."</span></p>"; |
|
27 | 27 | } |
28 | 28 | // check if iconv is available |
29 | -echo "<p>" . $_lang['checking_iconv']; |
|
29 | +echo "<p>".$_lang['checking_iconv']; |
|
30 | 30 | $iconv = (int) function_exists('iconv'); |
31 | -if ($iconv == '0'){ |
|
32 | - echo "<span class=\"notok\">" . $_lang['failed']. "</span></p><p><strong>".$_lang['checking_iconv_note']."</strong></p>"; |
|
31 | +if ($iconv == '0') { |
|
32 | + echo "<span class=\"notok\">".$_lang['failed']."</span></p><p><strong>".$_lang['checking_iconv_note']."</strong></p>"; |
|
33 | 33 | $errors += 1; |
34 | 34 | } else { |
35 | - echo "<span class=\"ok\">" . $_lang['ok'] . "</span></p>"; |
|
35 | + echo "<span class=\"ok\">".$_lang['ok']."</span></p>"; |
|
36 | 36 | } |
37 | 37 | // check sessions |
38 | -echo "<p>" . $_lang['checking_sessions']; |
|
38 | +echo "<p>".$_lang['checking_sessions']; |
|
39 | 39 | if ($_SESSION['test'] != 1) { |
40 | - echo "<span class=\"notok\">" . $_lang['failed']. "</span></p>"; |
|
40 | + echo "<span class=\"notok\">".$_lang['failed']."</span></p>"; |
|
41 | 41 | $errors += 1; |
42 | 42 | } else { |
43 | - echo "<span class=\"ok\">" . $_lang['ok'] . "</span></p>"; |
|
43 | + echo "<span class=\"ok\">".$_lang['ok']."</span></p>"; |
|
44 | 44 | } |
45 | 45 | // check directories |
46 | 46 | // cache exists? |
47 | -echo "<p>" . $_lang['checking_if_cache_exist']; |
|
47 | +echo "<p>".$_lang['checking_if_cache_exist']; |
|
48 | 48 | if (!file_exists("../assets/cache") || !file_exists("../assets/cache/rss")) { |
49 | - echo "<span class=\"notok\">" . $_lang['failed'] . "</span></p>"; |
|
49 | + echo "<span class=\"notok\">".$_lang['failed']."</span></p>"; |
|
50 | 50 | $errors += 1; |
51 | 51 | } else { |
52 | - echo "<span class=\"ok\">" . $_lang['ok'] . "</span></p>"; |
|
52 | + echo "<span class=\"ok\">".$_lang['ok']."</span></p>"; |
|
53 | 53 | } |
54 | 54 | // cache writable? |
55 | -echo "<p>" . $_lang['checking_if_cache_writable']; |
|
55 | +echo "<p>".$_lang['checking_if_cache_writable']; |
|
56 | 56 | if (!is_writable("../assets/cache")) { |
57 | - echo "<span class=\"notok\">" . $_lang['failed'] . "</span></p>"; |
|
57 | + echo "<span class=\"notok\">".$_lang['failed']."</span></p>"; |
|
58 | 58 | $errors += 1; |
59 | 59 | } else { |
60 | - echo "<span class=\"ok\">" . $_lang['ok'] . "</span></p>"; |
|
60 | + echo "<span class=\"ok\">".$_lang['ok']."</span></p>"; |
|
61 | 61 | } |
62 | 62 | // cache files writable? |
63 | -echo "<p>" . $_lang['checking_if_cache_file_writable']; |
|
63 | +echo "<p>".$_lang['checking_if_cache_file_writable']; |
|
64 | 64 | if (!file_exists("../assets/cache/siteCache.idx.php")) { |
65 | 65 | // make an attempt to create the file |
66 | 66 | @ $hnd = fopen("../assets/cache/siteCache.idx.php", 'w'); |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | @ fclose($hnd); |
69 | 69 | } |
70 | 70 | if (!is_writable("../assets/cache/siteCache.idx.php")) { |
71 | - echo "<span class=\"notok\">" . $_lang['failed'] . "</span></p>"; |
|
71 | + echo "<span class=\"notok\">".$_lang['failed']."</span></p>"; |
|
72 | 72 | $errors += 1; |
73 | 73 | } else { |
74 | 74 | echo "<span class=\"ok\">".$_lang['ok']."</span></p>"; |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | $database_charset = substr($database_collation, 0, strpos($database_collation, '_') - 1); |
141 | 141 | $database_connection_charset = $_POST['database_connection_charset']; |
142 | 142 | $database_connection_method = $_POST['database_connection_method']; |
143 | - $dbase = '`' . $_POST['database_name'] . '`'; |
|
143 | + $dbase = '`'.$_POST['database_name'].'`'; |
|
144 | 144 | $table_prefix = $_POST['tableprefix']; |
145 | 145 | } |
146 | 146 | echo "<p>".$_lang['creating_database_connection']; |
@@ -178,54 +178,54 @@ discard block |
||
178 | 178 | |
179 | 179 | // check table prefix |
180 | 180 | if ($conn && $installMode == 0) { |
181 | - echo "<p>" . $_lang['checking_table_prefix'] . $table_prefix . "`: "; |
|
182 | - if ($rs= mysqli_query($conn, "SELECT COUNT(*) FROM $dbase.`" . $table_prefix . "site_content`")) { |
|
183 | - echo "<span class=\"notok\">" . $_lang['failed'] . "</span></b>" . $_lang['table_prefix_already_inuse'] . "</p>"; |
|
181 | + echo "<p>".$_lang['checking_table_prefix'].$table_prefix."`: "; |
|
182 | + if ($rs = mysqli_query($conn, "SELECT COUNT(*) FROM $dbase.`".$table_prefix."site_content`")) { |
|
183 | + echo "<span class=\"notok\">".$_lang['failed']."</span></b>".$_lang['table_prefix_already_inuse']."</p>"; |
|
184 | 184 | $errors += 1; |
185 | - echo "<p>" . $_lang['table_prefix_already_inuse_note'] . "</p>"; |
|
185 | + echo "<p>".$_lang['table_prefix_already_inuse_note']."</p>"; |
|
186 | 186 | } else { |
187 | - echo "<span class=\"ok\">" . $_lang['ok'] . "</span></p>"; |
|
187 | + echo "<span class=\"ok\">".$_lang['ok']."</span></p>"; |
|
188 | 188 | } |
189 | 189 | } elseif ($conn && $installMode == 2) { |
190 | - echo "<p>" . $_lang['checking_table_prefix'] . $table_prefix . "`: "; |
|
191 | - if (!$rs = mysqli_query($conn, "SELECT COUNT(*) FROM $dbase.`" . $table_prefix . "site_content`")) { |
|
192 | - echo "<span class=\"notok\">" . $_lang['failed'] . "</span></b>" . $_lang['table_prefix_not_exist'] . "</p>"; |
|
190 | + echo "<p>".$_lang['checking_table_prefix'].$table_prefix."`: "; |
|
191 | + if (!$rs = mysqli_query($conn, "SELECT COUNT(*) FROM $dbase.`".$table_prefix."site_content`")) { |
|
192 | + echo "<span class=\"notok\">".$_lang['failed']."</span></b>".$_lang['table_prefix_not_exist']."</p>"; |
|
193 | 193 | $errors += 1; |
194 | - echo "<p>" . $_lang['table_prefix_not_exist_note'] . "</p>"; |
|
194 | + echo "<p>".$_lang['table_prefix_not_exist_note']."</p>"; |
|
195 | 195 | } else { |
196 | - echo "<span class=\"ok\">" . $_lang['ok'] . "</span></p>"; |
|
196 | + echo "<span class=\"ok\">".$_lang['ok']."</span></p>"; |
|
197 | 197 | } |
198 | 198 | } |
199 | 199 | |
200 | 200 | // check mysql version |
201 | 201 | if ($conn) { |
202 | - echo "<p>" . $_lang['checking_mysql_version']; |
|
203 | - if ( version_compare(mysqli_get_server_info($conn), '5.0.51', '=') ) { |
|
204 | - echo "<span class=\"notok\">" . $_lang['warning'] . "</span></b> <strong>". $_lang['mysql_5051'] . "</strong></p>"; |
|
205 | - echo "<p><span class=\"notok\">" . $_lang['mysql_5051_warning'] . "</span></p>"; |
|
202 | + echo "<p>".$_lang['checking_mysql_version']; |
|
203 | + if (version_compare(mysqli_get_server_info($conn), '5.0.51', '=')) { |
|
204 | + echo "<span class=\"notok\">".$_lang['warning']."</span></b> <strong>".$_lang['mysql_5051']."</strong></p>"; |
|
205 | + echo "<p><span class=\"notok\">".$_lang['mysql_5051_warning']."</span></p>"; |
|
206 | 206 | } else { |
207 | - echo "<span class=\"ok\">" . $_lang['ok'] . "</span> <strong>" . $_lang['mysql_version_is'] . mysqli_get_server_info($conn) . "</strong></p>"; |
|
207 | + echo "<span class=\"ok\">".$_lang['ok']."</span> <strong>".$_lang['mysql_version_is'].mysqli_get_server_info($conn)."</strong></p>"; |
|
208 | 208 | } |
209 | 209 | } |
210 | 210 | |
211 | 211 | // check for strict mode |
212 | 212 | if ($conn) { |
213 | - echo "<p>". $_lang['checking_mysql_strict_mode']; |
|
213 | + echo "<p>".$_lang['checking_mysql_strict_mode']; |
|
214 | 214 | $mysqlmode = mysqli_query($conn, "SELECT @@global.sql_mode"); |
215 | - if (mysqli_num_rows($mysqlmode) > 0){ |
|
215 | + if (mysqli_num_rows($mysqlmode) > 0) { |
|
216 | 216 | $modes = mysqli_fetch_array($mysqlmode, MYSQLI_NUM); |
217 | 217 | //$modes = array("STRICT_TRANS_TABLES"); // for testing |
218 | 218 | // print_r($modes); |
219 | 219 | foreach ($modes as $mode) { |
220 | 220 | if (stristr($mode, "STRICT_TRANS_TABLES") !== false || stristr($mode, "STRICT_ALL_TABLES") !== false) { |
221 | - echo "<span class=\"notok\">" . $_lang['warning'] . "</span></b> <strong> " . $_lang['strict_mode'] . "</strong></p>"; |
|
222 | - echo "<p><span class=\"notok\">" . $_lang['strict_mode_error'] . "</span></p>"; |
|
221 | + echo "<span class=\"notok\">".$_lang['warning']."</span></b> <strong> ".$_lang['strict_mode']."</strong></p>"; |
|
222 | + echo "<p><span class=\"notok\">".$_lang['strict_mode_error']."</span></p>"; |
|
223 | 223 | } else { |
224 | - echo "<span class=\"ok\">" . $_lang['ok'] . "</span></p>"; |
|
224 | + echo "<span class=\"ok\">".$_lang['ok']."</span></p>"; |
|
225 | 225 | } |
226 | 226 | } |
227 | 227 | } else { |
228 | - echo "<span class=\"ok\">" . $_lang['ok'] . "</span></p>"; |
|
228 | + echo "<span class=\"ok\">".$_lang['ok']."</span></p>"; |
|
229 | 229 | } |
230 | 230 | } |
231 | 231 | // Version and strict mode check end |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | @ fclose($hnd); |
245 | 245 | } |
246 | 246 | |
247 | -if($installMode > 0 && $_POST['installdata'] == "1") { |
|
247 | +if ($installMode > 0 && $_POST['installdata'] == "1") { |
|
248 | 248 | echo "<p class=\"notes\"><strong>{$_lang['sample_web_site']}:</strong> {$_lang['sample_web_site_note']}</p>\n"; |
249 | 249 | } |
250 | 250 | |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | ?> |
253 | 253 | <p> |
254 | 254 | <?php |
255 | - echo $_lang['setup_cannot_continue'] . ' '; |
|
255 | + echo $_lang['setup_cannot_continue'].' '; |
|
256 | 256 | echo $errors > 1 ? $errors." " : ""; |
257 | 257 | if ($errors > 1) echo $_lang['errors']; |
258 | 258 | else echo $_lang['error']; |
@@ -268,10 +268,10 @@ discard block |
||
268 | 268 | |
269 | 269 | echo "<p> </p>"; |
270 | 270 | |
271 | -$nextAction= $errors > 0 ? 'summary' : 'install'; |
|
272 | -$nextButton= $errors > 0 ? $_lang['retry'] : $_lang['install']; |
|
273 | -$nextVisibility= $errors > 0 || isset($_POST['chkagree']) ? 'visible' : 'hidden'; |
|
274 | -$agreeToggle= $errors > 0 ? '' : ' onclick="if(document.getElementById(\'chkagree\').checked){document.getElementById(\'nextbutton\').style.visibility=\'visible\';}else{document.getElementById(\'nextbutton\').style.visibility=\'hidden\';}"'; |
|
271 | +$nextAction = $errors > 0 ? 'summary' : 'install'; |
|
272 | +$nextButton = $errors > 0 ? $_lang['retry'] : $_lang['install']; |
|
273 | +$nextVisibility = $errors > 0 || isset($_POST['chkagree']) ? 'visible' : 'hidden'; |
|
274 | +$agreeToggle = $errors > 0 ? '' : ' onclick="if(document.getElementById(\'chkagree\').checked){document.getElementById(\'nextbutton\').style.visibility=\'visible\';}else{document.getElementById(\'nextbutton\').style.visibility=\'hidden\';}"'; |
|
275 | 275 | ?> |
276 | 276 | <form name="install" id="install_form" action="index.php?action=<?php echo $nextAction ?>" method="post"> |
277 | 277 | <div> |
@@ -293,27 +293,27 @@ discard block |
||
293 | 293 | |
294 | 294 | <input type="hidden" value="<?php echo $_POST['installdata'] ?>" name="installdata" /> |
295 | 295 | <?php |
296 | -$templates = isset ($_POST['template']) ? $_POST['template'] : array (); |
|
296 | +$templates = isset ($_POST['template']) ? $_POST['template'] : array(); |
|
297 | 297 | foreach ($templates as $i => $template) echo "<input type=\"hidden\" name=\"template[]\" value=\"$template\" />\n"; |
298 | -$tvs = isset ($_POST['tv']) ? $_POST['tv'] : array (); |
|
298 | +$tvs = isset ($_POST['tv']) ? $_POST['tv'] : array(); |
|
299 | 299 | foreach ($tvs as $i => $tv) echo "<input type=\"hidden\" name=\"tv[]\" value=\"$tv\" />\n"; |
300 | -$chunks = isset ($_POST['chunk']) ? $_POST['chunk'] : array (); |
|
300 | +$chunks = isset ($_POST['chunk']) ? $_POST['chunk'] : array(); |
|
301 | 301 | foreach ($chunks as $i => $chunk) echo "<input type=\"hidden\" name=\"chunk[]\" value=\"$chunk\" />\n"; |
302 | -$snippets = isset ($_POST['snippet']) ? $_POST['snippet'] : array (); |
|
302 | +$snippets = isset ($_POST['snippet']) ? $_POST['snippet'] : array(); |
|
303 | 303 | foreach ($snippets as $i => $snippet) echo "<input type=\"hidden\" name=\"snippet[]\" value=\"$snippet\" />\n"; |
304 | -$plugins = isset ($_POST['plugin']) ? $_POST['plugin'] : array (); |
|
304 | +$plugins = isset ($_POST['plugin']) ? $_POST['plugin'] : array(); |
|
305 | 305 | foreach ($plugins as $i => $plugin) echo "<input type=\"hidden\" name=\"plugin[]\" value=\"$plugin\" />\n"; |
306 | -$modules = isset ($_POST['module']) ? $_POST['module'] : array (); |
|
306 | +$modules = isset ($_POST['module']) ? $_POST['module'] : array(); |
|
307 | 307 | foreach ($modules as $i => $module) echo "<input type=\"hidden\" name=\"module[]\" value=\"$module\" />\n"; |
308 | 308 | ?> |
309 | 309 | </div> |
310 | 310 | |
311 | -<h2><?php echo $_lang['agree_to_terms'];?></h2> |
|
311 | +<h2><?php echo $_lang['agree_to_terms']; ?></h2> |
|
312 | 312 | <p> |
313 | -<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> |
|
313 | +<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> |
|
314 | 314 | </p> |
315 | 315 | <p class="buttonlinks"> |
316 | 316 | <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> |
317 | - <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> |
|
317 | + <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> |
|
318 | 318 | </p> |
319 | 319 | </form> |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | // check if iconv is available |
29 | 29 | echo "<p>" . $_lang['checking_iconv']; |
30 | 30 | $iconv = (int) function_exists('iconv'); |
31 | -if ($iconv == '0'){ |
|
31 | +if ($iconv == '0') { |
|
32 | 32 | echo "<span class=\"notok\">" . $_lang['failed']. "</span></p><p><strong>".$_lang['checking_iconv_note']."</strong></p>"; |
33 | 33 | $errors += 1; |
34 | 34 | } else { |
@@ -119,8 +119,9 @@ discard block |
||
119 | 119 | @ $hnd = fopen("../".MGR_DIR."/includes/config.inc.php", 'w'); |
120 | 120 | @ fwrite($hnd, "<?php //EVO configuration file ?>"); |
121 | 121 | @ fclose($hnd); |
122 | +} else { |
|
123 | + @chmod("../".MGR_DIR."/includes/config.inc.php", 0666); |
|
122 | 124 | } |
123 | -else @chmod("../".MGR_DIR."/includes/config.inc.php", 0666); |
|
124 | 125 | $isWriteable = is_writable("../".MGR_DIR."/includes/config.inc.php"); |
125 | 126 | if (!$isWriteable) { |
126 | 127 | echo "<span class=\"notok\">".$_lang['failed']."</span></p><p><strong>".$_lang['config_permissions_note']."</strong></p>"; |
@@ -212,7 +213,7 @@ discard block |
||
212 | 213 | if ($conn) { |
213 | 214 | echo "<p>". $_lang['checking_mysql_strict_mode']; |
214 | 215 | $mysqlmode = mysqli_query($conn, "SELECT @@global.sql_mode"); |
215 | - if (mysqli_num_rows($mysqlmode) > 0){ |
|
216 | + if (mysqli_num_rows($mysqlmode) > 0) { |
|
216 | 217 | $modes = mysqli_fetch_array($mysqlmode, MYSQLI_NUM); |
217 | 218 | //$modes = array("STRICT_TRANS_TABLES"); // for testing |
218 | 219 | // print_r($modes); |
@@ -254,12 +255,21 @@ discard block |
||
254 | 255 | <?php |
255 | 256 | echo $_lang['setup_cannot_continue'] . ' '; |
256 | 257 | echo $errors > 1 ? $errors." " : ""; |
257 | - if ($errors > 1) echo $_lang['errors']; |
|
258 | - else echo $_lang['error']; |
|
259 | - if ($errors > 1) echo $_lang['please_correct_errors']; |
|
260 | - else echo $_lang['please_correct_error']; |
|
261 | - if ($errors > 1) echo $_lang['and_try_again_plural']; |
|
262 | - else echo $_lang['and_try_again']; |
|
258 | + if ($errors > 1) { |
|
259 | + echo $_lang['errors']; |
|
260 | + } else { |
|
261 | + echo $_lang['error']; |
|
262 | + } |
|
263 | + if ($errors > 1) { |
|
264 | + echo $_lang['please_correct_errors']; |
|
265 | + } else { |
|
266 | + echo $_lang['please_correct_error']; |
|
267 | + } |
|
268 | + if ($errors > 1) { |
|
269 | + echo $_lang['and_try_again_plural']; |
|
270 | + } else { |
|
271 | + echo $_lang['and_try_again']; |
|
272 | + } |
|
263 | 273 | echo $_lang['visit_forum']; |
264 | 274 | ?> |
265 | 275 | </p> |
@@ -294,17 +304,29 @@ discard block |
||
294 | 304 | <input type="hidden" value="<?php echo $_POST['installdata'] ?>" name="installdata" /> |
295 | 305 | <?php |
296 | 306 | $templates = isset ($_POST['template']) ? $_POST['template'] : array (); |
297 | -foreach ($templates as $i => $template) echo "<input type=\"hidden\" name=\"template[]\" value=\"$template\" />\n"; |
|
307 | +foreach ($templates as $i => $template) { |
|
308 | + echo "<input type=\"hidden\" name=\"template[]\" value=\"$template\" />\n"; |
|
309 | +} |
|
298 | 310 | $tvs = isset ($_POST['tv']) ? $_POST['tv'] : array (); |
299 | -foreach ($tvs as $i => $tv) echo "<input type=\"hidden\" name=\"tv[]\" value=\"$tv\" />\n"; |
|
311 | +foreach ($tvs as $i => $tv) { |
|
312 | + echo "<input type=\"hidden\" name=\"tv[]\" value=\"$tv\" />\n"; |
|
313 | +} |
|
300 | 314 | $chunks = isset ($_POST['chunk']) ? $_POST['chunk'] : array (); |
301 | -foreach ($chunks as $i => $chunk) echo "<input type=\"hidden\" name=\"chunk[]\" value=\"$chunk\" />\n"; |
|
315 | +foreach ($chunks as $i => $chunk) { |
|
316 | + echo "<input type=\"hidden\" name=\"chunk[]\" value=\"$chunk\" />\n"; |
|
317 | +} |
|
302 | 318 | $snippets = isset ($_POST['snippet']) ? $_POST['snippet'] : array (); |
303 | -foreach ($snippets as $i => $snippet) echo "<input type=\"hidden\" name=\"snippet[]\" value=\"$snippet\" />\n"; |
|
319 | +foreach ($snippets as $i => $snippet) { |
|
320 | + echo "<input type=\"hidden\" name=\"snippet[]\" value=\"$snippet\" />\n"; |
|
321 | +} |
|
304 | 322 | $plugins = isset ($_POST['plugin']) ? $_POST['plugin'] : array (); |
305 | -foreach ($plugins as $i => $plugin) echo "<input type=\"hidden\" name=\"plugin[]\" value=\"$plugin\" />\n"; |
|
323 | +foreach ($plugins as $i => $plugin) { |
|
324 | + echo "<input type=\"hidden\" name=\"plugin[]\" value=\"$plugin\" />\n"; |
|
325 | +} |
|
306 | 326 | $modules = isset ($_POST['module']) ? $_POST['module'] : array (); |
307 | -foreach ($modules as $i => $module) echo "<input type=\"hidden\" name=\"module[]\" value=\"$module\" />\n"; |
|
327 | +foreach ($modules as $i => $module) { |
|
328 | + echo "<input type=\"hidden\" name=\"module[]\" value=\"$module\" />\n"; |
|
329 | +} |
|
308 | 330 | ?> |
309 | 331 | </div> |
310 | 332 |
@@ -151,7 +151,7 @@ |
||
151 | 151 | echo "<span class=\"ok\">".$_lang['ok']."</span></p>"; |
152 | 152 | } |
153 | 153 | // make sure we can use the database |
154 | -if ($installMode > 0 && !mysqli_query($conn, "USE {$dbase}")) { |
|
154 | +if ($installMode > 0 && !mysqli_query($conn, "use {$dbase}")) { |
|
155 | 155 | $errors += 1; |
156 | 156 | echo "<span class=\"notok\">".$_lang['database_use_failed']."</span><p />".$_lang["database_use_failed_note"]."</p>"; |
157 | 157 | } |
@@ -15,13 +15,13 @@ discard block |
||
15 | 15 | include($base_path.MGR_DIR.'/includes/config.inc.php'); |
16 | 16 | // We need to have all connection settings - but prefix may be empty so we have to ignore it |
17 | 17 | if ($dbase) { |
18 | - $database_name = trim($dbase, '`'); |
|
19 | - if (!$conn = mysqli_connect($database_server, $database_user, $database_password)) |
|
20 | - $upgradeable = (isset($_POST['installmode']) && $_POST['installmode']=='new') ? 0 : 2; |
|
21 | - elseif (! mysqli_select_db($conn, trim($dbase, '`'))) |
|
22 | - $upgradeable = (isset($_POST['installmode']) && $_POST['installmode']=='new') ? 0 : 2; |
|
23 | - else |
|
24 | - $upgradeable = 1; |
|
18 | + $database_name = trim($dbase, '`'); |
|
19 | + if (!$conn = mysqli_connect($database_server, $database_user, $database_password)) |
|
20 | + $upgradeable = (isset($_POST['installmode']) && $_POST['installmode']=='new') ? 0 : 2; |
|
21 | + elseif (! mysqli_select_db($conn, trim($dbase, '`'))) |
|
22 | + $upgradeable = (isset($_POST['installmode']) && $_POST['installmode']=='new') ? 0 : 2; |
|
23 | + else |
|
24 | + $upgradeable = 1; |
|
25 | 25 | } |
26 | 26 | else $upgradable= 2; |
27 | 27 | } |
@@ -75,28 +75,28 @@ discard block |
||
75 | 75 | echo $content; |
76 | 76 | |
77 | 77 | function getLangs($install_language) { |
78 | - if (isset($_POST['managerlanguage'])) $manager_language = $_POST['managerlanguage']; |
|
79 | - elseif(isset($_GET['managerlanguage'])) $manager_language = $_GET['managerlanguage']; |
|
80 | - if ($install_language != "english" && is_file(sprintf("../%s/includes/lang/%s.inc.php",MGR_DIR,$install_language))) |
|
81 | - $manager_language = $install_language; |
|
82 | - else |
|
83 | - $manager_language = "english"; |
|
78 | + if (isset($_POST['managerlanguage'])) $manager_language = $_POST['managerlanguage']; |
|
79 | + elseif(isset($_GET['managerlanguage'])) $manager_language = $_GET['managerlanguage']; |
|
80 | + if ($install_language != "english" && is_file(sprintf("../%s/includes/lang/%s.inc.php",MGR_DIR,$install_language))) |
|
81 | + $manager_language = $install_language; |
|
82 | + else |
|
83 | + $manager_language = "english"; |
|
84 | 84 | |
85 | - $langs = array(); |
|
86 | - if ($handle = opendir("../".MGR_DIR."/includes/lang")) { |
|
87 | - while (false !== ($file = readdir($handle))) { |
|
88 | - if (strpos($file, '.inc.') !== false) |
|
89 | - $langs[] = $file; |
|
90 | - } |
|
91 | - closedir($handle); |
|
92 | - } |
|
93 | - sort($langs); |
|
85 | + $langs = array(); |
|
86 | + if ($handle = opendir("../".MGR_DIR."/includes/lang")) { |
|
87 | + while (false !== ($file = readdir($handle))) { |
|
88 | + if (strpos($file, '.inc.') !== false) |
|
89 | + $langs[] = $file; |
|
90 | + } |
|
91 | + closedir($handle); |
|
92 | + } |
|
93 | + sort($langs); |
|
94 | 94 | |
95 | - $_ = array(); |
|
96 | - foreach ($langs as $language) { |
|
97 | - $abrv_language = explode('.', $language); |
|
98 | - $selected = (strtolower($abrv_language[0]) == strtolower($manager_language)) ? ' selected' : ''; |
|
95 | + $_ = array(); |
|
96 | + foreach ($langs as $language) { |
|
97 | + $abrv_language = explode('.', $language); |
|
98 | + $selected = (strtolower($abrv_language[0]) == strtolower($manager_language)) ? ' selected' : ''; |
|
99 | 99 | $_[] = sprintf('<option value="%s" %s>%s</option>', $abrv_language[0], $selected, ucwords($abrv_language[0])); |
100 | - } |
|
101 | - return join("\n", $_); |
|
100 | + } |
|
101 | + return join("\n", $_); |
|
102 | 102 | } |
@@ -2,11 +2,11 @@ discard block |
||
2 | 2 | $installMode = intval($_POST['installmode']); |
3 | 3 | |
4 | 4 | // Determine upgradeability |
5 | -$upgradeable= 0; |
|
5 | +$upgradeable = 0; |
|
6 | 6 | if ($installMode == 0) { |
7 | - $database_name= ''; |
|
8 | - $database_server= 'localhost'; |
|
9 | - $table_prefix= 'evo_'; |
|
7 | + $database_name = ''; |
|
8 | + $database_server = 'localhost'; |
|
9 | + $table_prefix = 'evo_'; |
|
10 | 10 | } else { |
11 | 11 | $database_name = ''; |
12 | 12 | if (!is_file($base_path.MGR_DIR.'/includes/config.inc.php')) $upgradeable = 0; |
@@ -17,13 +17,13 @@ discard block |
||
17 | 17 | if ($dbase) { |
18 | 18 | $database_name = trim($dbase, '`'); |
19 | 19 | if (!$conn = mysqli_connect($database_server, $database_user, $database_password)) |
20 | - $upgradeable = (isset($_POST['installmode']) && $_POST['installmode']=='new') ? 0 : 2; |
|
21 | - elseif (! mysqli_select_db($conn, trim($dbase, '`'))) |
|
22 | - $upgradeable = (isset($_POST['installmode']) && $_POST['installmode']=='new') ? 0 : 2; |
|
20 | + $upgradeable = (isset($_POST['installmode']) && $_POST['installmode'] == 'new') ? 0 : 2; |
|
21 | + elseif (!mysqli_select_db($conn, trim($dbase, '`'))) |
|
22 | + $upgradeable = (isset($_POST['installmode']) && $_POST['installmode'] == 'new') ? 0 : 2; |
|
23 | 23 | else |
24 | 24 | $upgradeable = 1; |
25 | 25 | } |
26 | - else $upgradable= 2; |
|
26 | + else $upgradable = 2; |
|
27 | 27 | } |
28 | 28 | } |
29 | 29 | // check the database collation if not specified in the configuration |
@@ -48,36 +48,36 @@ discard block |
||
48 | 48 | $database_connection_method = 'SET CHARACTER SET'; |
49 | 49 | } |
50 | 50 | |
51 | -$ph['database_name'] = isset($_POST['database_name']) ? $_POST['database_name']: $database_name; |
|
52 | -$ph['tableprefix'] = isset($_POST['tableprefix']) ? $_POST['tableprefix']: $table_prefix; |
|
51 | +$ph['database_name'] = isset($_POST['database_name']) ? $_POST['database_name'] : $database_name; |
|
52 | +$ph['tableprefix'] = isset($_POST['tableprefix']) ? $_POST['tableprefix'] : $table_prefix; |
|
53 | 53 | $ph['selected_set_character_set'] = isset($database_connection_method) && $database_connection_method == 'SET CHARACTER SET' ? 'selected' : ''; |
54 | 54 | $ph['selected_set_names'] = isset($database_connection_method) && $database_connection_method == 'SET NAMES' ? 'selected' : ''; |
55 | 55 | $ph['show#connection_method'] = (($installMode == 0) || ($installMode == 2)) ? 'block' : 'none'; |
56 | -$ph['database_collation'] = isset($_POST['database_collation']) ? $_POST['database_collation']: $database_collation; |
|
57 | -$ph['show#AUH'] = ($installMode == 0) ? 'block':'none'; |
|
58 | -$ph['cmsadmin'] = isset($_POST['cmsadmin']) ? $_POST['cmsadmin']:'admin'; |
|
59 | -$ph['cmsadminemail'] = isset($_POST['cmsadminemail']) ? $_POST['cmsadminemail']:""; |
|
60 | -$ph['cmspassword'] = isset($_POST['cmspassword']) ? $_POST['cmspassword']:""; |
|
61 | -$ph['cmspasswordconfirm'] = isset($_POST['cmspasswordconfirm']) ? $_POST['cmspasswordconfirm']:""; |
|
56 | +$ph['database_collation'] = isset($_POST['database_collation']) ? $_POST['database_collation'] : $database_collation; |
|
57 | +$ph['show#AUH'] = ($installMode == 0) ? 'block' : 'none'; |
|
58 | +$ph['cmsadmin'] = isset($_POST['cmsadmin']) ? $_POST['cmsadmin'] : 'admin'; |
|
59 | +$ph['cmsadminemail'] = isset($_POST['cmsadminemail']) ? $_POST['cmsadminemail'] : ""; |
|
60 | +$ph['cmspassword'] = isset($_POST['cmspassword']) ? $_POST['cmspassword'] : ""; |
|
61 | +$ph['cmspasswordconfirm'] = isset($_POST['cmspasswordconfirm']) ? $_POST['cmspasswordconfirm'] : ""; |
|
62 | 62 | $ph['managerLangs'] = getLangs($install_language); |
63 | 63 | $ph['install_language'] = $install_language; |
64 | 64 | $ph['installMode'] = $installMode; |
65 | -$ph['checkedChkagree'] = isset($_POST['chkagree']) ? 'checked':""; |
|
65 | +$ph['checkedChkagree'] = isset($_POST['chkagree']) ? 'checked' : ""; |
|
66 | 66 | $ph['database_connection_method'] = isset($database_connection_method) ? $database_connection_method : ''; |
67 | -$ph['databasehost'] = isset($_POST['databasehost']) ? $_POST['databasehost']: $database_server; |
|
68 | -$ph['databaseloginname'] = isset($_SESSION['databaseloginname']) ? $_SESSION['databaseloginname']: ''; |
|
69 | -$ph['databaseloginpassword'] = isset($_SESSION['databaseloginpassword']) ? $_SESSION['databaseloginpassword']: ""; |
|
67 | +$ph['databasehost'] = isset($_POST['databasehost']) ? $_POST['databasehost'] : $database_server; |
|
68 | +$ph['databaseloginname'] = isset($_SESSION['databaseloginname']) ? $_SESSION['databaseloginname'] : ''; |
|
69 | +$ph['databaseloginpassword'] = isset($_SESSION['databaseloginpassword']) ? $_SESSION['databaseloginpassword'] : ""; |
|
70 | 70 | $ph['MGR_DIR'] = MGR_DIR; |
71 | 71 | |
72 | 72 | $content = file_get_contents('./actions/tpl_connection.html'); |
73 | -$content = parse($content, $_lang, '[%','%]'); |
|
73 | +$content = parse($content, $_lang, '[%', '%]'); |
|
74 | 74 | $content = parse($content, $ph); |
75 | 75 | echo $content; |
76 | 76 | |
77 | -function getLangs($install_language) { |
|
77 | +function getLangs($install_language){ |
|
78 | 78 | if (isset($_POST['managerlanguage'])) $manager_language = $_POST['managerlanguage']; |
79 | - elseif(isset($_GET['managerlanguage'])) $manager_language = $_GET['managerlanguage']; |
|
80 | - if ($install_language != "english" && is_file(sprintf("../%s/includes/lang/%s.inc.php",MGR_DIR,$install_language))) |
|
79 | + elseif (isset($_GET['managerlanguage'])) $manager_language = $_GET['managerlanguage']; |
|
80 | + if ($install_language != "english" && is_file(sprintf("../%s/includes/lang/%s.inc.php", MGR_DIR, $install_language))) |
|
81 | 81 | $manager_language = $install_language; |
82 | 82 | else |
83 | 83 | $manager_language = "english"; |
@@ -9,21 +9,24 @@ discard block |
||
9 | 9 | $table_prefix= 'evo_'; |
10 | 10 | } else { |
11 | 11 | $database_name = ''; |
12 | - if (!is_file($base_path.MGR_DIR.'/includes/config.inc.php')) $upgradeable = 0; |
|
13 | - else { |
|
12 | + if (!is_file($base_path.MGR_DIR.'/includes/config.inc.php')) { |
|
13 | + $upgradeable = 0; |
|
14 | + } else { |
|
14 | 15 | // Include the file so we can test its validity |
15 | 16 | include($base_path.MGR_DIR.'/includes/config.inc.php'); |
16 | 17 | // We need to have all connection settings - but prefix may be empty so we have to ignore it |
17 | 18 | if ($dbase) { |
18 | 19 | $database_name = trim($dbase, '`'); |
19 | - if (!$conn = mysqli_connect($database_server, $database_user, $database_password)) |
|
20 | - $upgradeable = (isset($_POST['installmode']) && $_POST['installmode']=='new') ? 0 : 2; |
|
21 | - elseif (! mysqli_select_db($conn, trim($dbase, '`'))) |
|
22 | - $upgradeable = (isset($_POST['installmode']) && $_POST['installmode']=='new') ? 0 : 2; |
|
23 | - else |
|
24 | - $upgradeable = 1; |
|
20 | + if (!$conn = mysqli_connect($database_server, $database_user, $database_password)) { |
|
21 | + $upgradeable = (isset($_POST['installmode']) && $_POST['installmode']=='new') ? 0 : 2; |
|
22 | + } elseif (! mysqli_select_db($conn, trim($dbase, '`'))) { |
|
23 | + $upgradeable = (isset($_POST['installmode']) && $_POST['installmode']=='new') ? 0 : 2; |
|
24 | + } else { |
|
25 | + $upgradeable = 1; |
|
26 | + } |
|
27 | + } else { |
|
28 | + $upgradable= 2; |
|
25 | 29 | } |
26 | - else $upgradable= 2; |
|
27 | 30 | } |
28 | 31 | } |
29 | 32 | // check the database collation if not specified in the configuration |
@@ -74,19 +77,25 @@ discard block |
||
74 | 77 | $content = parse($content, $ph); |
75 | 78 | echo $content; |
76 | 79 | |
77 | -function getLangs($install_language) { |
|
78 | - if (isset($_POST['managerlanguage'])) $manager_language = $_POST['managerlanguage']; |
|
79 | - elseif(isset($_GET['managerlanguage'])) $manager_language = $_GET['managerlanguage']; |
|
80 | - if ($install_language != "english" && is_file(sprintf("../%s/includes/lang/%s.inc.php",MGR_DIR,$install_language))) |
|
81 | - $manager_language = $install_language; |
|
82 | - else |
|
83 | - $manager_language = "english"; |
|
80 | +function getLangs($install_language) |
|
81 | +{ |
|
82 | + if (isset($_POST['managerlanguage'])) { |
|
83 | + $manager_language = $_POST['managerlanguage']; |
|
84 | + } elseif(isset($_GET['managerlanguage'])) { |
|
85 | + $manager_language = $_GET['managerlanguage']; |
|
86 | + } |
|
87 | + if ($install_language != "english" && is_file(sprintf("../%s/includes/lang/%s.inc.php",MGR_DIR,$install_language))) { |
|
88 | + $manager_language = $install_language; |
|
89 | + } else { |
|
90 | + $manager_language = "english"; |
|
91 | + } |
|
84 | 92 | |
85 | 93 | $langs = array(); |
86 | 94 | if ($handle = opendir("../".MGR_DIR."/includes/lang")) { |
87 | 95 | while (false !== ($file = readdir($handle))) { |
88 | - if (strpos($file, '.inc.') !== false) |
|
89 | - $langs[] = $file; |
|
96 | + if (strpos($file, '.inc.') !== false) { |
|
97 | + $langs[] = $file; |
|
98 | + } |
|
90 | 99 | } |
91 | 100 | closedir($handle); |
92 | 101 | } |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | |
81 | 81 | |
82 | 82 | function getTemplates($presets=array()) { |
83 | - if(!count($presets)) return ''; |
|
83 | + if(!count($presets)) return ''; |
|
84 | 84 | $selectedTemplates = isset ($_POST['template']) ? $_POST['template'] : array (); |
85 | 85 | $tpl = '<label><input type="checkbox" name="template[]" value="[+i+]" class="[+class+]" [+checked+] />[%install_update%] <span class="comname">[+name+]</span> - [+desc+]</label><hr />'; |
86 | 86 | $_ = array(); |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | |
119 | 119 | // display chunks |
120 | 120 | function getChunks($presets=array()) { |
121 | - if(!count($presets)) return ''; |
|
121 | + if(!count($presets)) return ''; |
|
122 | 122 | $selected = isset ($_POST['chunk']) ? $_POST['chunk'] : array (); |
123 | 123 | $tpl = '<label><input type="checkbox" name="chunk[]" value="[+i+]" class="[+class+]" [+checked+] />[%install_update%] <span class="comname">[+name+]</span> - [+desc+]</label><hr />'; |
124 | 124 | $_ = array(); |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | |
138 | 138 | // display modules |
139 | 139 | function getModules($presets=array()) { |
140 | - if(!count($presets)) return ''; |
|
140 | + if(!count($presets)) return ''; |
|
141 | 141 | $selected = isset ($_POST['module']) ? $_POST['module'] : array (); |
142 | 142 | $tpl = '<label><input type="checkbox" name="module[]" value="[+i+]" class="[+class+]" [+checked+] />[%install_update%] <span class="comname">[+name+]</span> - [+desc+]</label><hr />'; |
143 | 143 | $_ = array(); |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | |
157 | 157 | // display plugins |
158 | 158 | function getPlugins($presets=array()) { |
159 | - if(!count($presets)) return ''; |
|
159 | + if(!count($presets)) return ''; |
|
160 | 160 | $selected = isset ($_POST['plugin']) ? $_POST['plugin'] : array (); |
161 | 161 | $tpl = '<label><input type="checkbox" name="plugin[]" value="[+i+]" class="[+class+]" [+checked+] />[%install_update%] <span class="comname">[+name+]</span> - [+desc+]</label><hr />'; |
162 | 162 | $_ = array(); |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | |
180 | 180 | // display snippets |
181 | 181 | function getSnippets($presets=array()) { |
182 | - if(!count($presets)) return ''; |
|
182 | + if(!count($presets)) return ''; |
|
183 | 183 | $selected = isset ($_POST['snippet']) ? $_POST['snippet'] : array (); |
184 | 184 | $tpl = '<label><input type="checkbox" name="snippet[]" value="[+i+]" class="[+class+]" [+checked+] />[%install_update%] <span class="comname">[+name+]</span> - [+desc+]</label><hr />'; |
185 | 185 | $_ = array(); |
@@ -5,13 +5,13 @@ discard block |
||
5 | 5 | $database_collation = isset($_POST['database_collation']) ? $_POST['database_collation'] : 'utf8_general_ci'; |
6 | 6 | $database_charset = substr($database_collation, 0, strpos($database_collation, '_')); |
7 | 7 | $_POST['database_connection_charset'] = $database_charset; |
8 | - if(empty($_SESSION['databaseloginpassword'])) |
|
8 | + if (empty($_SESSION['databaseloginpassword'])) |
|
9 | 9 | $_SESSION['databaseloginpassword'] = $_POST['databaseloginpassword']; |
10 | - if(empty($_SESSION['databaseloginname'])) |
|
10 | + if (empty($_SESSION['databaseloginname'])) |
|
11 | 11 | $_SESSION['databaseloginname'] = $_POST['databaseloginname']; |
12 | 12 | } |
13 | 13 | elseif ($installMode == 1) { |
14 | - include $base_path . MGR_DIR . '/includes/config.inc.php'; |
|
14 | + include $base_path.MGR_DIR.'/includes/config.inc.php'; |
|
15 | 15 | if (@ $conn = mysqli_connect($database_server, $database_user, $database_password)) { |
16 | 16 | if (@ mysqli_query($conn, "USE {$dbase}")) { |
17 | 17 | if (!$rs = mysqli_query($conn, "show session variables like 'collation_database'")) { |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | $ph['checked'] = isset ($_POST['installdata']) && $_POST['installdata'] == "1" ? 'checked' : ''; |
64 | 64 | |
65 | 65 | # load setup information file |
66 | -include($base_path . 'install/setup.info.php'); |
|
66 | +include($base_path.'install/setup.info.php'); |
|
67 | 67 | $ph['templates'] = getTemplates($moduleTemplates); |
68 | 68 | $ph['tvs'] = getTVs($moduleTVs); |
69 | 69 | $ph['chunks'] = getChunks($moduleChunks); |
@@ -73,15 +73,15 @@ discard block |
||
73 | 73 | |
74 | 74 | $ph['action'] = ($installMode == 1) ? 'mode' : 'connection'; |
75 | 75 | |
76 | -$tpl = file_get_contents($base_path . 'install/actions/tpl_options.html'); |
|
77 | -$content = parse($tpl,$ph); |
|
78 | -echo parse($content,$_lang,'[%','%]'); |
|
76 | +$tpl = file_get_contents($base_path.'install/actions/tpl_options.html'); |
|
77 | +$content = parse($tpl, $ph); |
|
78 | +echo parse($content, $_lang, '[%', '%]'); |
|
79 | 79 | |
80 | 80 | |
81 | 81 | |
82 | -function getTemplates($presets=array()) { |
|
83 | - if(!count($presets)) return ''; |
|
84 | - $selectedTemplates = isset ($_POST['template']) ? $_POST['template'] : array (); |
|
82 | +function getTemplates($presets = array()){ |
|
83 | + if (!count($presets)) return ''; |
|
84 | + $selectedTemplates = isset ($_POST['template']) ? $_POST['template'] : array(); |
|
85 | 85 | $tpl = '<label><input type="checkbox" name="template[]" value="[+i+]" class="[+class+]" [+checked+] />[%install_update%] <span class="comname">[+name+]</span> - [+desc+]</label><hr />'; |
86 | 86 | $_ = array(); |
87 | 87 | $i = 0; |
@@ -90,16 +90,16 @@ discard block |
||
90 | 90 | $ph['name'] = $preset[0]; |
91 | 91 | $ph['desc'] = $preset[1]; |
92 | 92 | $ph['class'] = !in_array('sample', $preset[6]) ? 'toggle' : 'toggle demo'; |
93 | - $ph['checked'] = in_array($i, $selectedTemplates) || (!isset($_POST['options_selected'])) ? 'checked' : ''; |
|
94 | - $_[] = parse($tpl,$ph); |
|
93 | + $ph['checked'] = in_array($i, $selectedTemplates) || (!isset($_POST['options_selected'])) ? 'checked' : ''; |
|
94 | + $_[] = parse($tpl, $ph); |
|
95 | 95 | $i++; |
96 | 96 | } |
97 | - if(0<count($_)) return '<h3>[%templates%]</h3>' . join("\n", $_); |
|
97 | + if (0 < count($_)) return '<h3>[%templates%]</h3>'.join("\n", $_); |
|
98 | 98 | } |
99 | 99 | |
100 | -function getTVs($presets=array()) { |
|
101 | - if(!count($presets)) return ''; |
|
102 | - $selectedTvs = isset ($_POST['tv']) ? $_POST['tv'] : array (); |
|
100 | +function getTVs($presets = array()){ |
|
101 | + if (!count($presets)) return ''; |
|
102 | + $selectedTvs = isset ($_POST['tv']) ? $_POST['tv'] : array(); |
|
103 | 103 | $tpl = '<label><input type="checkbox" name="tv[]" value="[+i+]" class="[+class+]" [+checked+] />[%install_update%] <span class="comname">[+name+]</span> - [+alterName+] <span class="description">([+desc+])</span></label><hr />'; |
104 | 104 | $_ = array(); |
105 | 105 | $i = 0; |
@@ -109,17 +109,17 @@ discard block |
||
109 | 109 | $ph['alterName'] = $preset[1]; |
110 | 110 | $ph['desc'] = $preset[2]; |
111 | 111 | $ph['class'] = !in_array('sample', $preset[12]) ? 'toggle' : 'toggle demo'; |
112 | - $ph['checked'] = in_array($i, $selectedTvs) || (!isset($_POST['options_selected'])) ? 'checked' : ''; |
|
113 | - $_[] = parse($tpl,$ph); |
|
112 | + $ph['checked'] = in_array($i, $selectedTvs) || (!isset($_POST['options_selected'])) ? 'checked' : ''; |
|
113 | + $_[] = parse($tpl, $ph); |
|
114 | 114 | $i++; |
115 | 115 | } |
116 | - if(0<count($_)) return '<h3>[%tvs%]</h3>' . join("\n", $_); |
|
116 | + if (0 < count($_)) return '<h3>[%tvs%]</h3>'.join("\n", $_); |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | // display chunks |
120 | -function getChunks($presets=array()) { |
|
121 | - if(!count($presets)) return ''; |
|
122 | - $selected = isset ($_POST['chunk']) ? $_POST['chunk'] : array (); |
|
120 | +function getChunks($presets = array()){ |
|
121 | + if (!count($presets)) return ''; |
|
122 | + $selected = isset ($_POST['chunk']) ? $_POST['chunk'] : array(); |
|
123 | 123 | $tpl = '<label><input type="checkbox" name="chunk[]" value="[+i+]" class="[+class+]" [+checked+] />[%install_update%] <span class="comname">[+name+]</span> - [+desc+]</label><hr />'; |
124 | 124 | $_ = array(); |
125 | 125 | $i = 0; |
@@ -128,17 +128,17 @@ discard block |
||
128 | 128 | $ph['name'] = $preset[0]; |
129 | 129 | $ph['desc'] = $preset[1]; |
130 | 130 | $ph['class'] = !in_array('sample', $preset[5]) ? 'toggle' : 'toggle demo'; |
131 | - $ph['checked'] = in_array($i, $selected) || (!isset($_POST['options_selected'])) ? 'checked' : ''; |
|
132 | - $_[] = parse($tpl,$ph); |
|
131 | + $ph['checked'] = in_array($i, $selected) || (!isset($_POST['options_selected'])) ? 'checked' : ''; |
|
132 | + $_[] = parse($tpl, $ph); |
|
133 | 133 | $i++; |
134 | 134 | } |
135 | - if(0<count($_)) return '<h3>[%chunks%]</h3>' . join("\n", $_); |
|
135 | + if (0 < count($_)) return '<h3>[%chunks%]</h3>'.join("\n", $_); |
|
136 | 136 | } |
137 | 137 | |
138 | 138 | // display modules |
139 | -function getModules($presets=array()) { |
|
140 | - if(!count($presets)) return ''; |
|
141 | - $selected = isset ($_POST['module']) ? $_POST['module'] : array (); |
|
139 | +function getModules($presets = array()){ |
|
140 | + if (!count($presets)) return ''; |
|
141 | + $selected = isset ($_POST['module']) ? $_POST['module'] : array(); |
|
142 | 142 | $tpl = '<label><input type="checkbox" name="module[]" value="[+i+]" class="[+class+]" [+checked+] />[%install_update%] <span class="comname">[+name+]</span> - [+desc+]</label><hr />'; |
143 | 143 | $_ = array(); |
144 | 144 | $i = 0; |
@@ -147,17 +147,17 @@ discard block |
||
147 | 147 | $ph['name'] = $preset[0]; |
148 | 148 | $ph['desc'] = $preset[1]; |
149 | 149 | $ph['class'] = !in_array('sample', $preset[7]) ? 'toggle' : 'toggle demo'; |
150 | - $ph['checked'] = in_array($i, $selected) || (!isset($_POST['options_selected'])) ? 'checked' : ''; |
|
151 | - $_[] = parse($tpl,$ph); |
|
150 | + $ph['checked'] = in_array($i, $selected) || (!isset($_POST['options_selected'])) ? 'checked' : ''; |
|
151 | + $_[] = parse($tpl, $ph); |
|
152 | 152 | $i++; |
153 | 153 | } |
154 | - if(0<count($_)) return '<h3>[%modules%]</h3>' . join("\n", $_); |
|
154 | + if (0 < count($_)) return '<h3>[%modules%]</h3>'.join("\n", $_); |
|
155 | 155 | } |
156 | 156 | |
157 | 157 | // display plugins |
158 | -function getPlugins($presets=array()) { |
|
159 | - if(!count($presets)) return ''; |
|
160 | - $selected = isset ($_POST['plugin']) ? $_POST['plugin'] : array (); |
|
158 | +function getPlugins($presets = array()){ |
|
159 | + if (!count($presets)) return ''; |
|
160 | + $selected = isset ($_POST['plugin']) ? $_POST['plugin'] : array(); |
|
161 | 161 | $tpl = '<label><input type="checkbox" name="plugin[]" value="[+i+]" class="[+class+]" [+checked+] />[%install_update%] <span class="comname">[+name+]</span> - [+desc+]</label><hr />'; |
162 | 162 | $_ = array(); |
163 | 163 | $i = 0; |
@@ -167,20 +167,20 @@ discard block |
||
167 | 167 | $ph['desc'] = $preset[1]; |
168 | 168 | if (is_array($preset[8])) { |
169 | 169 | $ph['class'] = !in_array('sample', $preset[8]) ? 'toggle' : 'toggle demo'; |
170 | - }else{ |
|
170 | + } else { |
|
171 | 171 | $ph['class'] = 'toggle demo'; |
172 | 172 | } |
173 | 173 | $ph['checked'] = in_array($i, $selected) || (!isset($_POST['options_selected'])) ? 'checked' : ''; |
174 | - $_[] = parse($tpl,$ph); |
|
174 | + $_[] = parse($tpl, $ph); |
|
175 | 175 | $i++; |
176 | 176 | } |
177 | - if(0<count($_)) return '<h3>[%plugins%]</h3>' . join("\n", $_); |
|
177 | + if (0 < count($_)) return '<h3>[%plugins%]</h3>'.join("\n", $_); |
|
178 | 178 | } |
179 | 179 | |
180 | 180 | // display snippets |
181 | -function getSnippets($presets=array()) { |
|
182 | - if(!count($presets)) return ''; |
|
183 | - $selected = isset ($_POST['snippet']) ? $_POST['snippet'] : array (); |
|
181 | +function getSnippets($presets = array()){ |
|
182 | + if (!count($presets)) return ''; |
|
183 | + $selected = isset ($_POST['snippet']) ? $_POST['snippet'] : array(); |
|
184 | 184 | $tpl = '<label><input type="checkbox" name="snippet[]" value="[+i+]" class="[+class+]" [+checked+] />[%install_update%] <span class="comname">[+name+]</span> - [+desc+]</label><hr />'; |
185 | 185 | $_ = array(); |
186 | 186 | $i = 0; |
@@ -190,8 +190,8 @@ discard block |
||
190 | 190 | $ph['desc'] = $preset[1]; |
191 | 191 | $ph['class'] = !in_array('sample', $preset[5]) ? 'toggle' : 'toggle demo'; |
192 | 192 | $ph['checked'] = in_array($i, $selected) || (!isset($_POST['options_selected'])) ? 'checked' : ''; |
193 | - $_[] = parse($tpl,$ph); |
|
193 | + $_[] = parse($tpl, $ph); |
|
194 | 194 | $i++; |
195 | 195 | } |
196 | - if(0<count($_)) return '<h3>[%snippets%]</h3>' . join("\n", $_); |
|
196 | + if (0 < count($_)) return '<h3>[%snippets%]</h3>'.join("\n", $_); |
|
197 | 197 | } |
@@ -5,12 +5,13 @@ discard block |
||
5 | 5 | $database_collation = isset($_POST['database_collation']) ? $_POST['database_collation'] : 'utf8_general_ci'; |
6 | 6 | $database_charset = substr($database_collation, 0, strpos($database_collation, '_')); |
7 | 7 | $_POST['database_connection_charset'] = $database_charset; |
8 | - if(empty($_SESSION['databaseloginpassword'])) |
|
9 | - $_SESSION['databaseloginpassword'] = $_POST['databaseloginpassword']; |
|
10 | - if(empty($_SESSION['databaseloginname'])) |
|
11 | - $_SESSION['databaseloginname'] = $_POST['databaseloginname']; |
|
12 | -} |
|
13 | -elseif ($installMode == 1) { |
|
8 | + if(empty($_SESSION['databaseloginpassword'])) { |
|
9 | + $_SESSION['databaseloginpassword'] = $_POST['databaseloginpassword']; |
|
10 | + } |
|
11 | + if(empty($_SESSION['databaseloginname'])) { |
|
12 | + $_SESSION['databaseloginname'] = $_POST['databaseloginname']; |
|
13 | + } |
|
14 | + } elseif ($installMode == 1) { |
|
14 | 15 | include $base_path . MGR_DIR . '/includes/config.inc.php'; |
15 | 16 | if (@ $conn = mysqli_connect($database_server, $database_user, $database_password)) { |
16 | 17 | if (@ mysqli_query($conn, "USE {$dbase}")) { |
@@ -22,7 +23,9 @@ discard block |
||
22 | 23 | } |
23 | 24 | } |
24 | 25 | } |
25 | - if (empty ($database_collation)) $database_collation = 'utf8_general_ci'; |
|
26 | + if (empty ($database_collation)) { |
|
27 | + $database_collation = 'utf8_general_ci'; |
|
28 | + } |
|
26 | 29 | |
27 | 30 | $database_charset = substr($database_collation, 0, strpos($database_collation, '_')); |
28 | 31 | if (!isset ($database_connection_charset) || empty ($database_connection_charset)) { |
@@ -31,7 +34,9 @@ discard block |
||
31 | 34 | |
32 | 35 | if (!isset ($database_connection_method) || empty ($database_connection_method)) { |
33 | 36 | $database_connection_method = 'SET CHARACTER SET'; |
34 | - if (function_exists('mysqli_set_charset')) mysqli_set_charset($conn, $database_connection_charset); |
|
37 | + if (function_exists('mysqli_set_charset')) { |
|
38 | + mysqli_set_charset($conn, $database_connection_charset); |
|
39 | + } |
|
35 | 40 | } |
36 | 41 | if ($database_connection_method != 'SET NAMES' && $database_connection_charset != $database_charset) { |
37 | 42 | $database_connection_method = 'SET NAMES'; |
@@ -79,8 +84,11 @@ discard block |
||
79 | 84 | |
80 | 85 | |
81 | 86 | |
82 | -function getTemplates($presets=array()) { |
|
83 | - if(!count($presets)) return ''; |
|
87 | +function getTemplates($presets=array()) |
|
88 | +{ |
|
89 | + if(!count($presets)) { |
|
90 | + return ''; |
|
91 | + } |
|
84 | 92 | $selectedTemplates = isset ($_POST['template']) ? $_POST['template'] : array (); |
85 | 93 | $tpl = '<label><input type="checkbox" name="template[]" value="[+i+]" class="[+class+]" [+checked+] />[%install_update%] <span class="comname">[+name+]</span> - [+desc+]</label><hr />'; |
86 | 94 | $_ = array(); |
@@ -94,11 +102,16 @@ discard block |
||
94 | 102 | $_[] = parse($tpl,$ph); |
95 | 103 | $i++; |
96 | 104 | } |
97 | - if(0<count($_)) return '<h3>[%templates%]</h3>' . join("\n", $_); |
|
98 | -} |
|
105 | + if(0<count($_)) { |
|
106 | + return '<h3>[%templates%]</h3>' . join("\n", $_); |
|
107 | + } |
|
108 | + } |
|
99 | 109 | |
100 | -function getTVs($presets=array()) { |
|
101 | - if(!count($presets)) return ''; |
|
110 | +function getTVs($presets=array()) |
|
111 | +{ |
|
112 | + if(!count($presets)) { |
|
113 | + return ''; |
|
114 | + } |
|
102 | 115 | $selectedTvs = isset ($_POST['tv']) ? $_POST['tv'] : array (); |
103 | 116 | $tpl = '<label><input type="checkbox" name="tv[]" value="[+i+]" class="[+class+]" [+checked+] />[%install_update%] <span class="comname">[+name+]</span> - [+alterName+] <span class="description">([+desc+])</span></label><hr />'; |
104 | 117 | $_ = array(); |
@@ -113,12 +126,17 @@ discard block |
||
113 | 126 | $_[] = parse($tpl,$ph); |
114 | 127 | $i++; |
115 | 128 | } |
116 | - if(0<count($_)) return '<h3>[%tvs%]</h3>' . join("\n", $_); |
|
117 | -} |
|
129 | + if(0<count($_)) { |
|
130 | + return '<h3>[%tvs%]</h3>' . join("\n", $_); |
|
131 | + } |
|
132 | + } |
|
118 | 133 | |
119 | 134 | // display chunks |
120 | -function getChunks($presets=array()) { |
|
121 | - if(!count($presets)) return ''; |
|
135 | +function getChunks($presets=array()) |
|
136 | +{ |
|
137 | + if(!count($presets)) { |
|
138 | + return ''; |
|
139 | + } |
|
122 | 140 | $selected = isset ($_POST['chunk']) ? $_POST['chunk'] : array (); |
123 | 141 | $tpl = '<label><input type="checkbox" name="chunk[]" value="[+i+]" class="[+class+]" [+checked+] />[%install_update%] <span class="comname">[+name+]</span> - [+desc+]</label><hr />'; |
124 | 142 | $_ = array(); |
@@ -132,12 +150,17 @@ discard block |
||
132 | 150 | $_[] = parse($tpl,$ph); |
133 | 151 | $i++; |
134 | 152 | } |
135 | - if(0<count($_)) return '<h3>[%chunks%]</h3>' . join("\n", $_); |
|
136 | -} |
|
153 | + if(0<count($_)) { |
|
154 | + return '<h3>[%chunks%]</h3>' . join("\n", $_); |
|
155 | + } |
|
156 | + } |
|
137 | 157 | |
138 | 158 | // display modules |
139 | -function getModules($presets=array()) { |
|
140 | - if(!count($presets)) return ''; |
|
159 | +function getModules($presets=array()) |
|
160 | +{ |
|
161 | + if(!count($presets)) { |
|
162 | + return ''; |
|
163 | + } |
|
141 | 164 | $selected = isset ($_POST['module']) ? $_POST['module'] : array (); |
142 | 165 | $tpl = '<label><input type="checkbox" name="module[]" value="[+i+]" class="[+class+]" [+checked+] />[%install_update%] <span class="comname">[+name+]</span> - [+desc+]</label><hr />'; |
143 | 166 | $_ = array(); |
@@ -151,12 +174,17 @@ discard block |
||
151 | 174 | $_[] = parse($tpl,$ph); |
152 | 175 | $i++; |
153 | 176 | } |
154 | - if(0<count($_)) return '<h3>[%modules%]</h3>' . join("\n", $_); |
|
155 | -} |
|
177 | + if(0<count($_)) { |
|
178 | + return '<h3>[%modules%]</h3>' . join("\n", $_); |
|
179 | + } |
|
180 | + } |
|
156 | 181 | |
157 | 182 | // display plugins |
158 | -function getPlugins($presets=array()) { |
|
159 | - if(!count($presets)) return ''; |
|
183 | +function getPlugins($presets=array()) |
|
184 | +{ |
|
185 | + if(!count($presets)) { |
|
186 | + return ''; |
|
187 | + } |
|
160 | 188 | $selected = isset ($_POST['plugin']) ? $_POST['plugin'] : array (); |
161 | 189 | $tpl = '<label><input type="checkbox" name="plugin[]" value="[+i+]" class="[+class+]" [+checked+] />[%install_update%] <span class="comname">[+name+]</span> - [+desc+]</label><hr />'; |
162 | 190 | $_ = array(); |
@@ -167,19 +195,24 @@ discard block |
||
167 | 195 | $ph['desc'] = $preset[1]; |
168 | 196 | if (is_array($preset[8])) { |
169 | 197 | $ph['class'] = !in_array('sample', $preset[8]) ? 'toggle' : 'toggle demo'; |
170 | - }else{ |
|
198 | + } else { |
|
171 | 199 | $ph['class'] = 'toggle demo'; |
172 | 200 | } |
173 | 201 | $ph['checked'] = in_array($i, $selected) || (!isset($_POST['options_selected'])) ? 'checked' : ''; |
174 | 202 | $_[] = parse($tpl,$ph); |
175 | 203 | $i++; |
176 | 204 | } |
177 | - if(0<count($_)) return '<h3>[%plugins%]</h3>' . join("\n", $_); |
|
178 | -} |
|
205 | + if(0<count($_)) { |
|
206 | + return '<h3>[%plugins%]</h3>' . join("\n", $_); |
|
207 | + } |
|
208 | + } |
|
179 | 209 | |
180 | 210 | // display snippets |
181 | -function getSnippets($presets=array()) { |
|
182 | - if(!count($presets)) return ''; |
|
211 | +function getSnippets($presets=array()) |
|
212 | +{ |
|
213 | + if(!count($presets)) { |
|
214 | + return ''; |
|
215 | + } |
|
183 | 216 | $selected = isset ($_POST['snippet']) ? $_POST['snippet'] : array (); |
184 | 217 | $tpl = '<label><input type="checkbox" name="snippet[]" value="[+i+]" class="[+class+]" [+checked+] />[%install_update%] <span class="comname">[+name+]</span> - [+desc+]</label><hr />'; |
185 | 218 | $_ = array(); |
@@ -193,5 +226,7 @@ discard block |
||
193 | 226 | $_[] = parse($tpl,$ph); |
194 | 227 | $i++; |
195 | 228 | } |
196 | - if(0<count($_)) return '<h3>[%snippets%]</h3>' . join("\n", $_); |
|
197 | -} |
|
229 | + if(0<count($_)) { |
|
230 | + return '<h3>[%snippets%]</h3>' . join("\n", $_); |
|
231 | + } |
|
232 | + } |
@@ -13,7 +13,7 @@ |
||
13 | 13 | elseif ($installMode == 1) { |
14 | 14 | include $base_path . MGR_DIR . '/includes/config.inc.php'; |
15 | 15 | if (@ $conn = mysqli_connect($database_server, $database_user, $database_password)) { |
16 | - if (@ mysqli_query($conn, "USE {$dbase}")) { |
|
16 | + if (@ mysqli_query($conn, "use {$dbase}")) { |
|
17 | 17 | if (!$rs = mysqli_query($conn, "show session variables like 'collation_database'")) { |
18 | 18 | $rs = mysqli_query($conn, "show session variables like 'collation_server'"); |
19 | 19 | } |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | // Determine upgradeability |
3 | 3 | $upgradeable = 0; |
4 | -if (is_file($base_path . MGR_DIR . '/includes/config.inc.php')) { // Include the file so we can test its validity |
|
5 | - include $base_path . MGR_DIR . '/includes/config.inc.php'; |
|
4 | +if (is_file($base_path.MGR_DIR.'/includes/config.inc.php')) { // Include the file so we can test its validity |
|
5 | + include $base_path.MGR_DIR.'/includes/config.inc.php'; |
|
6 | 6 | // We need to have all connection settings - tho prefix may be empty so we have to ignore it |
7 | 7 | if (isset($dbase)) { |
8 | 8 | if (!$conn = @mysqli_connect($database_server, $database_user, $database_password)) |
@@ -16,16 +16,16 @@ discard block |
||
16 | 16 | $upgradeable = 2; |
17 | 17 | } |
18 | 18 | $ph['moduleName'] = $moduleName; |
19 | -$ph['displayNew'] = ($upgradeable!=0) ? 'display:none;' : ''; |
|
20 | -$ph['displayUpg'] = ($upgradeable==0) ? 'display:none;' : ''; |
|
19 | +$ph['displayNew'] = ($upgradeable != 0) ? 'display:none;' : ''; |
|
20 | +$ph['displayUpg'] = ($upgradeable == 0) ? 'display:none;' : ''; |
|
21 | 21 | $ph['displayAdvUpg'] = $ph['displayUpg']; |
22 | -$ph['checkedNew'] = !$upgradeable ? 'checked' : ''; |
|
23 | -$ph['checkedUpg'] = ($_POST['installmode']==1 || $upgradeable==1) ? 'checked' : ''; |
|
24 | -$ph['checkedAdvUpg'] = ($_POST['installmode']==2 || $upgradeable==2) ? 'checked' : ''; |
|
22 | +$ph['checkedNew'] = !$upgradeable ? 'checked' : ''; |
|
23 | +$ph['checkedUpg'] = ($_POST['installmode'] == 1 || $upgradeable == 1) ? 'checked' : ''; |
|
24 | +$ph['checkedAdvUpg'] = ($_POST['installmode'] == 2 || $upgradeable == 2) ? 'checked' : ''; |
|
25 | 25 | $ph['install_language'] = $install_language; |
26 | -$ph['disabledUpg'] = ($upgradeable!=1) ? 'disabled' : ''; |
|
27 | -$ph['disabledAdvUpg'] = ($upgradeable==0) ? 'disabled' : ''; |
|
26 | +$ph['disabledUpg'] = ($upgradeable != 1) ? 'disabled' : ''; |
|
27 | +$ph['disabledAdvUpg'] = ($upgradeable == 0) ? 'disabled' : ''; |
|
28 | 28 | |
29 | -$tpl = file_get_contents($base_path . 'install/actions/tpl_mode.html'); |
|
30 | -$content = parse($tpl,$ph); |
|
31 | -echo parse($content,$_lang,'[%','%]'); |
|
29 | +$tpl = file_get_contents($base_path.'install/actions/tpl_mode.html'); |
|
30 | +$content = parse($tpl, $ph); |
|
31 | +echo parse($content, $_lang, '[%', '%]'); |
@@ -1,20 +1,22 @@ |
||
1 | 1 | <?php |
2 | 2 | // Determine upgradeability |
3 | 3 | $upgradeable = 0; |
4 | -if (is_file($base_path . MGR_DIR . '/includes/config.inc.php')) { // Include the file so we can test its validity |
|
4 | +if (is_file($base_path . MGR_DIR . '/includes/config.inc.php')) { |
|
5 | +// Include the file so we can test its validity |
|
5 | 6 | include $base_path . MGR_DIR . '/includes/config.inc.php'; |
6 | 7 | // We need to have all connection settings - tho prefix may be empty so we have to ignore it |
7 | 8 | if (isset($dbase)) { |
8 | - if (!$conn = @mysqli_connect($database_server, $database_user, $database_password)) |
|
9 | - $upgradeable = isset($_POST['installmode']) && $_POST['installmode'] == 'new' ? 0 : 2; |
|
10 | - elseif (!@mysqli_select_db($conn, trim($dbase, '`'))) |
|
11 | - $upgradeable = isset($_POST['installmode']) && $_POST['installmode'] == 'new' ? 0 : 2; |
|
12 | - else |
|
13 | - $upgradeable = 1; |
|
9 | + if (!$conn = @mysqli_connect($database_server, $database_user, $database_password)) { |
|
10 | + $upgradeable = isset($_POST['installmode']) && $_POST['installmode'] == 'new' ? 0 : 2; |
|
11 | + } elseif (!@mysqli_select_db($conn, trim($dbase, '`'))) { |
|
12 | + $upgradeable = isset($_POST['installmode']) && $_POST['installmode'] == 'new' ? 0 : 2; |
|
13 | + } else { |
|
14 | + $upgradeable = 1; |
|
15 | + } |
|
16 | + } else { |
|
17 | + $upgradeable = 2; |
|
18 | + } |
|
14 | 19 | } |
15 | - else |
|
16 | - $upgradeable = 2; |
|
17 | -} |
|
18 | 20 | $ph['moduleName'] = $moduleName; |
19 | 21 | $ph['displayNew'] = ($upgradeable!=0) ? 'display:none;' : ''; |
20 | 22 | $ph['displayUpg'] = ($upgradeable==0) ? 'display:none;' : ''; |
@@ -8,10 +8,10 @@ |
||
8 | 8 | $self = 'install/connection.databasetest.php'; |
9 | 9 | $base_path = str_replace($self,'',str_replace('\\','/', __FILE__)); |
10 | 10 | if (is_file("{$base_path}assets/cache/siteManager.php")) { |
11 | - include_once("{$base_path}assets/cache/siteManager.php"); |
|
11 | + include_once("{$base_path}assets/cache/siteManager.php"); |
|
12 | 12 | } |
13 | 13 | if(!defined('MGR_DIR') && is_dir("{$base_path}manager")) { |
14 | - define('MGR_DIR','manager'); |
|
14 | + define('MGR_DIR','manager'); |
|
15 | 15 | } |
16 | 16 | require_once("lang.php"); |
17 | 17 |
@@ -6,12 +6,12 @@ discard block |
||
6 | 6 | $installMode = $_POST['installMode']; |
7 | 7 | |
8 | 8 | $self = 'install/connection.databasetest.php'; |
9 | -$base_path = str_replace($self,'',str_replace('\\','/', __FILE__)); |
|
9 | +$base_path = str_replace($self, '', str_replace('\\', '/', __FILE__)); |
|
10 | 10 | if (is_file("{$base_path}assets/cache/siteManager.php")) { |
11 | 11 | include_once("{$base_path}assets/cache/siteManager.php"); |
12 | 12 | } |
13 | -if(!defined('MGR_DIR') && is_dir("{$base_path}manager")) { |
|
14 | - define('MGR_DIR','manager'); |
|
13 | +if (!defined('MGR_DIR') && is_dir("{$base_path}manager")) { |
|
14 | + define('MGR_DIR', 'manager'); |
|
15 | 15 | } |
16 | 16 | require_once("lang.php"); |
17 | 17 | |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | $database_charset = substr($database_collation, 0, strpos($database_collation, '_')); |
32 | 32 | $query = "CREATE DATABASE `".$database_name."` CHARACTER SET ".$database_charset." COLLATE ".$database_collation.";"; |
33 | 33 | |
34 | - if (! mysqli_query($conn, $query)){ |
|
34 | + if (!mysqli_query($conn, $query)) { |
|
35 | 35 | $output .= '<span id="database_fail" style="color:#FF0000;">'.$_lang['status_failed_could_not_create_database'].'</span>'; |
36 | 36 | } |
37 | 37 | else { |
@@ -18,8 +18,7 @@ discard block |
||
18 | 18 | $output = $_lang["status_checking_database"]; |
19 | 19 | if (!$conn = mysqli_connect($host, $uid, $pwd)) { |
20 | 20 | $output .= '<span id="database_fail" style="color:#FF0000;">'.$_lang['status_failed'].'</span>'; |
21 | -} |
|
22 | -else { |
|
21 | +} else { |
|
23 | 22 | $database_name = mysqli_real_escape_string($conn, $_POST['database_name']); |
24 | 23 | $database_name = str_replace("`", "", $database_name); |
25 | 24 | $tableprefix = mysqli_real_escape_string($conn, $_POST['tableprefix']); |
@@ -31,20 +30,16 @@ discard block |
||
31 | 30 | $database_charset = substr($database_collation, 0, strpos($database_collation, '_')); |
32 | 31 | $query = "CREATE DATABASE `".$database_name."` CHARACTER SET ".$database_charset." COLLATE ".$database_collation.";"; |
33 | 32 | |
34 | - if (! mysqli_query($conn, $query)){ |
|
33 | + if (! mysqli_query($conn, $query)) { |
|
35 | 34 | $output .= '<span id="database_fail" style="color:#FF0000;">'.$_lang['status_failed_could_not_create_database'].'</span>'; |
36 | - } |
|
37 | - else { |
|
35 | + } else { |
|
38 | 36 | $output .= '<span id="database_pass" style="color:#80c000;">'.$_lang['status_passed_database_created'].'</span>'; |
39 | 37 | } |
40 | - } |
|
41 | - elseif (($installMode == 0) && (mysqli_query($conn, "SELECT COUNT(*) FROM {$database_name}.`{$tableprefix}site_content`"))) { |
|
38 | + } elseif (($installMode == 0) && (mysqli_query($conn, "SELECT COUNT(*) FROM {$database_name}.`{$tableprefix}site_content`"))) { |
|
42 | 39 | $output .= '<span id="database_fail" style="color:#FF0000;">'.$_lang['status_failed_table_prefix_already_in_use'].'</span>'; |
43 | - } |
|
44 | - elseif (($database_connection_method != 'SET NAMES') && ($rs = mysqli_query($conn, "show variables like 'collation_database'")) && ($row = mysqli_fetch_row($rs)) && ($row[1] != $database_collation)) { |
|
40 | + } elseif (($database_connection_method != 'SET NAMES') && ($rs = mysqli_query($conn, "show variables like 'collation_database'")) && ($row = mysqli_fetch_row($rs)) && ($row[1] != $database_collation)) { |
|
45 | 41 | $output .= '<span id="database_fail" style="color:#FF0000;">'.sprintf($_lang['status_failed_database_collation_does_not_match'], $row[1]).'</span>'; |
46 | - } |
|
47 | - else { |
|
42 | + } else { |
|
48 | 43 | $output .= '<span id="database_pass" style="color:#80c000;">'.$_lang['status_passed'].'</span>'; |
49 | 44 | } |
50 | 45 | } |
@@ -7,10 +7,10 @@ discard block |
||
7 | 7 | $self = 'install/connection.servertest.php'; |
8 | 8 | $base_path = str_replace($self,'',str_replace('\\','/', __FILE__)); |
9 | 9 | if (is_file("{$base_path}assets/cache/siteManager.php")) { |
10 | - include_once("{$base_path}assets/cache/siteManager.php"); |
|
10 | + include_once("{$base_path}assets/cache/siteManager.php"); |
|
11 | 11 | } |
12 | 12 | if(!defined('MGR_DIR') && is_dir("{$base_path}manager")) { |
13 | - define('MGR_DIR','manager'); |
|
13 | + define('MGR_DIR','manager'); |
|
14 | 14 | } |
15 | 15 | require_once("lang.php"); |
16 | 16 | |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | $modes = mysqli_fetch_array($mysqlmode, MYSQLI_NUM); |
32 | 32 | $strictMode = false; |
33 | 33 | foreach ($modes as $mode) { |
34 | - if (stristr($mode, "STRICT_TRANS_TABLES") !== false || stristr($mode, "STRICT_ALL_TABLES") !== false) $strictMode = true; |
|
34 | + if (stristr($mode, "STRICT_TRANS_TABLES") !== false || stristr($mode, "STRICT_ALL_TABLES") !== false) $strictMode = true; |
|
35 | 35 | } |
36 | 36 | if ($strictMode) $output .= '<br /><span style="color:#FF0000;"> '.$_lang['strict_mode'].'</span>'; |
37 | 37 | } |
@@ -5,12 +5,12 @@ discard block |
||
5 | 5 | $pwd = $_POST['pwd']; |
6 | 6 | |
7 | 7 | $self = 'install/connection.servertest.php'; |
8 | -$base_path = str_replace($self,'',str_replace('\\','/', __FILE__)); |
|
8 | +$base_path = str_replace($self, '', str_replace('\\', '/', __FILE__)); |
|
9 | 9 | if (is_file("{$base_path}assets/cache/siteManager.php")) { |
10 | 10 | include_once("{$base_path}assets/cache/siteManager.php"); |
11 | 11 | } |
12 | -if(!defined('MGR_DIR') && is_dir("{$base_path}manager")) { |
|
13 | - define('MGR_DIR','manager'); |
|
12 | +if (!defined('MGR_DIR') && is_dir("{$base_path}manager")) { |
|
13 | + define('MGR_DIR', 'manager'); |
|
14 | 14 | } |
15 | 15 | require_once("lang.php"); |
16 | 16 | |
@@ -22,12 +22,12 @@ discard block |
||
22 | 22 | $output .= '<span id="server_pass" style="color:#80c000;"> '.$_lang['status_passed_server'].'</span>'; |
23 | 23 | |
24 | 24 | // Mysql version check |
25 | - if ( version_compare(mysqli_get_server_info($conn), '5.0.51', '=') ) { |
|
25 | + if (version_compare(mysqli_get_server_info($conn), '5.0.51', '=')) { |
|
26 | 26 | $output .= '<br /><span style="color:#FF0000;"> '.$_lang['mysql_5051'].'</span>'; |
27 | 27 | } |
28 | 28 | // Mode check |
29 | 29 | $mysqlmode = mysqli_query($conn, "SELECT @@session.sql_mode"); |
30 | - if (@mysqli_num_rows($mysqlmode) > 0){ |
|
30 | + if (@mysqli_num_rows($mysqlmode) > 0) { |
|
31 | 31 | $modes = mysqli_fetch_array($mysqlmode, MYSQLI_NUM); |
32 | 32 | $strictMode = false; |
33 | 33 | foreach ($modes as $mode) { |
@@ -17,8 +17,7 @@ discard block |
||
17 | 17 | $output = $_lang["status_connecting"]; |
18 | 18 | if (!$conn = @mysqli_connect($host, $uid, $pwd)) { |
19 | 19 | $output .= '<span id="server_fail" style="color:#FF0000;"> '.$_lang['status_failed'].'</span>'; |
20 | -} |
|
21 | -else { |
|
20 | +} else { |
|
22 | 21 | $output .= '<span id="server_pass" style="color:#80c000;"> '.$_lang['status_passed_server'].'</span>'; |
23 | 22 | |
24 | 23 | // Mysql version check |
@@ -27,13 +26,17 @@ discard block |
||
27 | 26 | } |
28 | 27 | // Mode check |
29 | 28 | $mysqlmode = mysqli_query($conn, "SELECT @@session.sql_mode"); |
30 | - if (@mysqli_num_rows($mysqlmode) > 0){ |
|
29 | + if (@mysqli_num_rows($mysqlmode) > 0) { |
|
31 | 30 | $modes = mysqli_fetch_array($mysqlmode, MYSQLI_NUM); |
32 | 31 | $strictMode = false; |
33 | 32 | foreach ($modes as $mode) { |
34 | - if (stristr($mode, "STRICT_TRANS_TABLES") !== false || stristr($mode, "STRICT_ALL_TABLES") !== false) $strictMode = true; |
|
33 | + if (stristr($mode, "STRICT_TRANS_TABLES") !== false || stristr($mode, "STRICT_ALL_TABLES") !== false) { |
|
34 | + $strictMode = true; |
|
35 | + } |
|
36 | + } |
|
37 | + if ($strictMode) { |
|
38 | + $output .= '<br /><span style="color:#FF0000;"> '.$_lang['strict_mode'].'</span>'; |
|
35 | 39 | } |
36 | - if ($strictMode) $output .= '<br /><span style="color:#FF0000;"> '.$_lang['strict_mode'].'</span>'; |
|
37 | 40 | } |
38 | 41 | } |
39 | 42 | echo $output; |
@@ -7,10 +7,10 @@ discard block |
||
7 | 7 | $self = 'install/connection.collation.php'; |
8 | 8 | $base_path = str_replace($self,'',str_replace('\\','/', __FILE__)); |
9 | 9 | if (is_file("{$base_path}assets/cache/siteManager.php")) { |
10 | - include_once("{$base_path}assets/cache/siteManager.php"); |
|
10 | + include_once("{$base_path}assets/cache/siteManager.php"); |
|
11 | 11 | } |
12 | 12 | if(!defined('MGR_DIR') && is_dir("{$base_path}manager")) { |
13 | - define('MGR_DIR','manager'); |
|
13 | + define('MGR_DIR','manager'); |
|
14 | 14 | } |
15 | 15 | require_once('lang.php'); |
16 | 16 | |
@@ -59,12 +59,12 @@ discard block |
||
59 | 59 | $rs = array('recommend'=>''); |
60 | 60 | $order = explode(',', $order); |
61 | 61 | foreach($order as $v) { |
62 | - foreach($array as $name=>$sel) { |
|
63 | - if(strpos($name,$v)!==false) { |
|
64 | - $rs[$name] = $array[$name]; |
|
65 | - unset($array[$name]); |
|
66 | - } |
|
67 | - } |
|
62 | + foreach($array as $name=>$sel) { |
|
63 | + if(strpos($name,$v)!==false) { |
|
64 | + $rs[$name] = $array[$name]; |
|
65 | + unset($array[$name]); |
|
66 | + } |
|
67 | + } |
|
68 | 68 | } |
69 | 69 | $rs['unrecommend']=''; |
70 | 70 | return $rs + $array; |
@@ -5,17 +5,17 @@ discard block |
||
5 | 5 | $pwd = $_POST['pwd']; |
6 | 6 | |
7 | 7 | $self = 'install/connection.collation.php'; |
8 | -$base_path = str_replace($self,'',str_replace('\\','/', __FILE__)); |
|
8 | +$base_path = str_replace($self, '', str_replace('\\', '/', __FILE__)); |
|
9 | 9 | if (is_file("{$base_path}assets/cache/siteManager.php")) { |
10 | 10 | include_once("{$base_path}assets/cache/siteManager.php"); |
11 | 11 | } |
12 | -if(!defined('MGR_DIR') && is_dir("{$base_path}manager")) { |
|
13 | - define('MGR_DIR','manager'); |
|
12 | +if (!defined('MGR_DIR') && is_dir("{$base_path}manager")) { |
|
13 | + define('MGR_DIR', 'manager'); |
|
14 | 14 | } |
15 | 15 | require_once('lang.php'); |
16 | 16 | |
17 | 17 | $conn = mysqli_connect($host, $uid, $pwd); |
18 | -if(!$conn) exit('can not connect'); |
|
18 | +if (!$conn) exit('can not connect'); |
|
19 | 19 | |
20 | 20 | // get collation |
21 | 21 | $rs = mysqli_query($conn, "SHOW COLLATION"); |
@@ -29,20 +29,20 @@ discard block |
||
29 | 29 | $database_collation = htmlentities($_POST['database_collation']); |
30 | 30 | $recommend_collation = $_lang['recommend_collation']; |
31 | 31 | |
32 | - if (isset($_[$recommend_collation])) $_[$recommend_collation] = ' selected'; |
|
33 | - elseif(isset($_['utf8mb4_general_ci'])) $_['utf8mb4_general_ci'] = ' selected'; |
|
34 | - elseif(isset($_['utf8_general_ci'])) $_['utf8_general_ci'] = ' selected'; |
|
35 | - elseif(isset($_[$database_collation])) $_[$database_collation] = ' selected'; |
|
32 | + if (isset($_[$recommend_collation])) $_[$recommend_collation] = ' selected'; |
|
33 | + elseif (isset($_['utf8mb4_general_ci'])) $_['utf8mb4_general_ci'] = ' selected'; |
|
34 | + elseif (isset($_['utf8_general_ci'])) $_['utf8_general_ci'] = ' selected'; |
|
35 | + elseif (isset($_[$database_collation])) $_[$database_collation] = ' selected'; |
|
36 | 36 | |
37 | - $_ = sortItem($_,$_lang['recommend_collations_order']); |
|
37 | + $_ = sortItem($_, $_lang['recommend_collations_order']); |
|
38 | 38 | |
39 | - foreach($_ as $collation=>$selected) { |
|
39 | + foreach ($_ as $collation=>$selected) { |
|
40 | 40 | $collation = htmlentities($collation); |
41 | 41 | // if(substr($collation,0,4)!=='utf8') continue; |
42 | - if(strpos($collation,'sjis')===0) continue; |
|
43 | - if($collation=='recommend') |
|
42 | + if (strpos($collation, 'sjis') === 0) continue; |
|
43 | + if ($collation == 'recommend') |
|
44 | 44 | $output .= '<optgroup label="recommend">'; |
45 | - elseif($collation=='unrecommend') |
|
45 | + elseif ($collation == 'unrecommend') |
|
46 | 46 | $output .= '</optgroup><optgroup label="unrecommend">'; |
47 | 47 | else |
48 | 48 | $output .= sprintf('<option value="%s" %s>%s</option>', $collation, $selected, $collation); |
@@ -55,17 +55,17 @@ discard block |
||
55 | 55 | |
56 | 56 | |
57 | 57 | |
58 | -function sortItem($array=array(),$order='utf8mb4,utf8') { |
|
58 | +function sortItem($array = array(), $order = 'utf8mb4,utf8'){ |
|
59 | 59 | $rs = array('recommend'=>''); |
60 | 60 | $order = explode(',', $order); |
61 | - foreach($order as $v) { |
|
62 | - foreach($array as $name=>$sel) { |
|
63 | - if(strpos($name,$v)!==false) { |
|
61 | + foreach ($order as $v) { |
|
62 | + foreach ($array as $name=>$sel) { |
|
63 | + if (strpos($name, $v) !== false) { |
|
64 | 64 | $rs[$name] = $array[$name]; |
65 | 65 | unset($array[$name]); |
66 | 66 | } |
67 | 67 | } |
68 | 68 | } |
69 | - $rs['unrecommend']=''; |
|
69 | + $rs['unrecommend'] = ''; |
|
70 | 70 | return $rs + $array; |
71 | 71 | } |
@@ -15,7 +15,9 @@ discard block |
||
15 | 15 | require_once('lang.php'); |
16 | 16 | |
17 | 17 | $conn = mysqli_connect($host, $uid, $pwd); |
18 | -if(!$conn) exit('can not connect'); |
|
18 | +if(!$conn) { |
|
19 | + exit('can not connect'); |
|
20 | +} |
|
19 | 21 | |
20 | 22 | // get collation |
21 | 23 | $rs = mysqli_query($conn, "SHOW COLLATION"); |
@@ -29,23 +31,31 @@ discard block |
||
29 | 31 | $database_collation = htmlentities($_POST['database_collation']); |
30 | 32 | $recommend_collation = $_lang['recommend_collation']; |
31 | 33 | |
32 | - if (isset($_[$recommend_collation])) $_[$recommend_collation] = ' selected'; |
|
33 | - elseif(isset($_['utf8mb4_general_ci'])) $_['utf8mb4_general_ci'] = ' selected'; |
|
34 | - elseif(isset($_['utf8_general_ci'])) $_['utf8_general_ci'] = ' selected'; |
|
35 | - elseif(isset($_[$database_collation])) $_[$database_collation] = ' selected'; |
|
34 | + if (isset($_[$recommend_collation])) { |
|
35 | + $_[$recommend_collation] = ' selected'; |
|
36 | + } elseif(isset($_['utf8mb4_general_ci'])) { |
|
37 | + $_['utf8mb4_general_ci'] = ' selected'; |
|
38 | + } elseif(isset($_['utf8_general_ci'])) { |
|
39 | + $_['utf8_general_ci'] = ' selected'; |
|
40 | + } elseif(isset($_[$database_collation])) { |
|
41 | + $_[$database_collation] = ' selected'; |
|
42 | + } |
|
36 | 43 | |
37 | 44 | $_ = sortItem($_,$_lang['recommend_collations_order']); |
38 | 45 | |
39 | 46 | foreach($_ as $collation=>$selected) { |
40 | 47 | $collation = htmlentities($collation); |
41 | 48 | // if(substr($collation,0,4)!=='utf8') continue; |
42 | - if(strpos($collation,'sjis')===0) continue; |
|
43 | - if($collation=='recommend') |
|
44 | - $output .= '<optgroup label="recommend">'; |
|
45 | - elseif($collation=='unrecommend') |
|
46 | - $output .= '</optgroup><optgroup label="unrecommend">'; |
|
47 | - else |
|
48 | - $output .= sprintf('<option value="%s" %s>%s</option>', $collation, $selected, $collation); |
|
49 | + if(strpos($collation,'sjis')===0) { |
|
50 | + continue; |
|
51 | + } |
|
52 | + if($collation=='recommend') { |
|
53 | + $output .= '<optgroup label="recommend">'; |
|
54 | + } elseif($collation=='unrecommend') { |
|
55 | + $output .= '</optgroup><optgroup label="unrecommend">'; |
|
56 | + } else { |
|
57 | + $output .= sprintf('<option value="%s" %s>%s</option>', $collation, $selected, $collation); |
|
58 | + } |
|
49 | 59 | } |
50 | 60 | $output .= '</optgroup></select>'; |
51 | 61 | } |
@@ -55,7 +65,8 @@ discard block |
||
55 | 65 | |
56 | 66 | |
57 | 67 | |
58 | -function sortItem($array=array(),$order='utf8mb4,utf8') { |
|
68 | +function sortItem($array=array(),$order='utf8mb4,utf8') |
|
69 | +{ |
|
59 | 70 | $rs = array('recommend'=>''); |
60 | 71 | $order = explode(',', $order); |
61 | 72 | foreach($order as $v) { |
@@ -16,10 +16,10 @@ |
||
16 | 16 | error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED); |
17 | 17 | |
18 | 18 | if (is_file("{$base_path}assets/cache/siteManager.php")) { |
19 | - include_once("{$base_path}assets/cache/siteManager.php"); |
|
19 | + include_once("{$base_path}assets/cache/siteManager.php"); |
|
20 | 20 | } |
21 | 21 | if(!defined('MGR_DIR') && is_dir("{$base_path}manager")) { |
22 | - define('MGR_DIR', 'manager'); |
|
22 | + define('MGR_DIR', 'manager'); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | } |
10 | 10 | |
11 | 11 | $self = 'install/index.php'; |
12 | -$base_path = str_replace($self,'',str_replace('\\','/', __FILE__)); |
|
12 | +$base_path = str_replace($self, '', str_replace('\\', '/', __FILE__)); |
|
13 | 13 | require_once("{$base_path}install/functions.php"); |
14 | 14 | |
15 | 15 | // set error reporting |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | if (is_file("{$base_path}assets/cache/siteManager.php")) { |
19 | 19 | include_once("{$base_path}assets/cache/siteManager.php"); |
20 | 20 | } |
21 | -if(!defined('MGR_DIR') && is_dir("{$base_path}manager")) { |
|
21 | +if (!defined('MGR_DIR') && is_dir("{$base_path}manager")) { |
|
22 | 22 | define('MGR_DIR', 'manager'); |
23 | 23 | } |
24 | 24 | |
@@ -38,26 +38,26 @@ discard block |
||
38 | 38 | $moduleSQLDataFile = "setup.data.sql"; |
39 | 39 | $moduleSQLResetFile = "setup.data.reset.sql"; |
40 | 40 | |
41 | -$moduleChunks = array (); // chunks - array : name, description, type - 0:file or 1:content, file or content |
|
42 | -$moduleTemplates = array (); // templates - array : name, description, type - 0:file or 1:content, file or content |
|
43 | -$moduleSnippets = array (); // snippets - array : name, description, type - 0:file or 1:content, file or content,properties |
|
44 | -$modulePlugins = array (); // plugins - array : name, description, type - 0:file or 1:content, file or content,properties, events,guid |
|
45 | -$moduleModules = array (); // modules - array : name, description, type - 0:file or 1:content, file or content,properties, guid |
|
46 | -$moduleTemplates = array (); // templates - array : name, description, type - 0:file or 1:content, file or content,properties |
|
47 | -$moduleTVs = array (); // template variables - array : name, description, type - 0:file or 1:content, file or content,properties |
|
41 | +$moduleChunks = array(); // chunks - array : name, description, type - 0:file or 1:content, file or content |
|
42 | +$moduleTemplates = array(); // templates - array : name, description, type - 0:file or 1:content, file or content |
|
43 | +$moduleSnippets = array(); // snippets - array : name, description, type - 0:file or 1:content, file or content,properties |
|
44 | +$modulePlugins = array(); // plugins - array : name, description, type - 0:file or 1:content, file or content,properties, events,guid |
|
45 | +$moduleModules = array(); // modules - array : name, description, type - 0:file or 1:content, file or content,properties, guid |
|
46 | +$moduleTemplates = array(); // templates - array : name, description, type - 0:file or 1:content, file or content,properties |
|
47 | +$moduleTVs = array(); // template variables - array : name, description, type - 0:file or 1:content, file or content,properties |
|
48 | 48 | $moduleDependencies = array(); // module depedencies - array : module, table, column, type, name |
49 | 49 | |
50 | -$errors= 0; |
|
50 | +$errors = 0; |
|
51 | 51 | |
52 | 52 | // get post back status |
53 | 53 | $isPostBack = (count($_POST)); |
54 | 54 | |
55 | 55 | $ph = ph(); |
56 | -$ph = array_merge($ph,$_lang); |
|
56 | +$ph = array_merge($ph, $_lang); |
|
57 | 57 | $ph['install_language'] = $install_language; |
58 | 58 | |
59 | 59 | ob_start(); |
60 | -$action= isset ($_GET['action']) ? trim(strip_tags($_GET['action'])) : 'language'; |
|
60 | +$action = isset ($_GET['action']) ? trim(strip_tags($_GET['action'])) : 'language'; |
|
61 | 61 | if (!@include_once("actions/action_{$action}.php")) { |
62 | 62 | die ("Invalid install action attempted. [action={$action}]"); |
63 | 63 | } |
@@ -65,5 +65,5 @@ discard block |
||
65 | 65 | ob_end_clean(); |
66 | 66 | |
67 | 67 | $tpl = file_get_contents("{$base_path}install/template.tpl"); |
68 | -echo parse($tpl,$ph); |
|
68 | +echo parse($tpl, $ph); |
|
69 | 69 |
@@ -16,35 +16,35 @@ discard block |
||
16 | 16 | $install_language = "english"; |
17 | 17 | |
18 | 18 | $_langFiles= array ( |
19 | - "en" => "english", |
|
20 | - "bg" => "bulgarian", |
|
21 | - "cs" => "czech", |
|
22 | - "da" => "danish", |
|
23 | - "fi" => "finnish-utf8", |
|
24 | - "fr" => "francais-utf8", |
|
25 | - "de" => "german", |
|
26 | - "he" => "hebrew", |
|
27 | - "it" => "italian", |
|
28 | - "ja" => "japanese-utf8", |
|
29 | - "nl" => "nederlands-utf8", |
|
30 | - "no" => "norwegian", |
|
31 | - "fa" => "persian", |
|
32 | - "pl" => "polish-utf8", |
|
33 | - "pt" => "portuguese-br-utf8", |
|
19 | + "en" => "english", |
|
20 | + "bg" => "bulgarian", |
|
21 | + "cs" => "czech", |
|
22 | + "da" => "danish", |
|
23 | + "fi" => "finnish-utf8", |
|
24 | + "fr" => "francais-utf8", |
|
25 | + "de" => "german", |
|
26 | + "he" => "hebrew", |
|
27 | + "it" => "italian", |
|
28 | + "ja" => "japanese-utf8", |
|
29 | + "nl" => "nederlands-utf8", |
|
30 | + "no" => "norwegian", |
|
31 | + "fa" => "persian", |
|
32 | + "pl" => "polish-utf8", |
|
33 | + "pt" => "portuguese-br-utf8", |
|
34 | 34 | // "pt" => "portuguese", |
35 | - "ru" => "russian-UTF8", |
|
36 | - "es" => "spanish-utf8", |
|
37 | - "sv" => "svenska" |
|
35 | + "ru" => "russian-UTF8", |
|
36 | + "es" => "spanish-utf8", |
|
37 | + "sv" => "svenska" |
|
38 | 38 | ); |
39 | 39 | $_langISO6391 = substr($_SERVER["HTTP_ACCEPT_LANGUAGE"],0,2); |
40 | 40 | if (!empty($_langFiles[$_langISO6391])) $install_language = $_langFiles[$_langISO6391]; |
41 | 41 | |
42 | 42 | |
43 | 43 | if (isset($_POST['language']) && !stristr($_POST['language'],"..")) { |
44 | - $install_language = $_POST['language']; |
|
44 | + $install_language = $_POST['language']; |
|
45 | 45 | } else { |
46 | - if (isset($_GET['language']) && !stristr($_GET['language'],"..")) |
|
47 | - $install_language = $_GET['language']; |
|
46 | + if (isset($_GET['language']) && !stristr($_GET['language'],"..")) |
|
47 | + $install_language = $_GET['language']; |
|
48 | 48 | } |
49 | 49 | # load language file |
50 | 50 | require_once("lang/english.inc.php"); // As fallback |
@@ -53,15 +53,15 @@ discard block |
||
53 | 53 | $manager_language = $install_language; |
54 | 54 | |
55 | 55 | if (isset($_POST['managerlanguage']) && !stristr($_POST['managerlanguage'],"..")) { |
56 | - $manager_language = $_POST['managerlanguage']; |
|
56 | + $manager_language = $_POST['managerlanguage']; |
|
57 | 57 | } else { |
58 | - if (isset($_GET['managerlanguage']) && !stristr($_GET['managerlanguage'],"..")) |
|
59 | - $manager_language = $_GET['managerlanguage']; |
|
58 | + if (isset($_GET['managerlanguage']) && !stristr($_GET['managerlanguage'],"..")) |
|
59 | + $manager_language = $_GET['managerlanguage']; |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | foreach($_lang as $k=>$v) |
63 | 63 | { |
64 | - if(strpos($v,'[+MGR_DIR+]')!==false) |
|
65 | - $_lang[$k] = str_replace('[+MGR_DIR+]', MGR_DIR, $v); |
|
64 | + if(strpos($v,'[+MGR_DIR+]')!==false) |
|
65 | + $_lang[$k] = str_replace('[+MGR_DIR+]', MGR_DIR, $v); |
|
66 | 66 | } |
67 | 67 | ?> |
68 | 68 | \ No newline at end of file |
@@ -10,12 +10,12 @@ discard block |
||
10 | 10 | * Filename: /install/lang.php |
11 | 11 | */ |
12 | 12 | |
13 | -$_lang = array (); |
|
13 | +$_lang = array(); |
|
14 | 14 | |
15 | 15 | #default fallback language file - english |
16 | 16 | $install_language = "english"; |
17 | 17 | |
18 | -$_langFiles= array ( |
|
18 | +$_langFiles = array( |
|
19 | 19 | "en" => "english", |
20 | 20 | "bg" => "bulgarian", |
21 | 21 | "cs" => "czech", |
@@ -36,14 +36,14 @@ discard block |
||
36 | 36 | "es" => "spanish-utf8", |
37 | 37 | "sv" => "svenska" |
38 | 38 | ); |
39 | -$_langISO6391 = substr($_SERVER["HTTP_ACCEPT_LANGUAGE"],0,2); |
|
39 | +$_langISO6391 = substr($_SERVER["HTTP_ACCEPT_LANGUAGE"], 0, 2); |
|
40 | 40 | if (!empty($_langFiles[$_langISO6391])) $install_language = $_langFiles[$_langISO6391]; |
41 | 41 | |
42 | 42 | |
43 | -if (isset($_POST['language']) && !stristr($_POST['language'],"..")) { |
|
43 | +if (isset($_POST['language']) && !stristr($_POST['language'], "..")) { |
|
44 | 44 | $install_language = $_POST['language']; |
45 | 45 | } else { |
46 | - if (isset($_GET['language']) && !stristr($_GET['language'],"..")) |
|
46 | + if (isset($_GET['language']) && !stristr($_GET['language'], "..")) |
|
47 | 47 | $install_language = $_GET['language']; |
48 | 48 | } |
49 | 49 | # load language file |
@@ -52,16 +52,16 @@ discard block |
||
52 | 52 | |
53 | 53 | $manager_language = $install_language; |
54 | 54 | |
55 | -if (isset($_POST['managerlanguage']) && !stristr($_POST['managerlanguage'],"..")) { |
|
55 | +if (isset($_POST['managerlanguage']) && !stristr($_POST['managerlanguage'], "..")) { |
|
56 | 56 | $manager_language = $_POST['managerlanguage']; |
57 | 57 | } else { |
58 | - if (isset($_GET['managerlanguage']) && !stristr($_GET['managerlanguage'],"..")) |
|
58 | + if (isset($_GET['managerlanguage']) && !stristr($_GET['managerlanguage'], "..")) |
|
59 | 59 | $manager_language = $_GET['managerlanguage']; |
60 | 60 | } |
61 | 61 | |
62 | -foreach($_lang as $k=>$v) |
|
62 | +foreach ($_lang as $k=>$v) |
|
63 | 63 | { |
64 | - if(strpos($v,'[+MGR_DIR+]')!==false) |
|
64 | + if (strpos($v, '[+MGR_DIR+]') !== false) |
|
65 | 65 | $_lang[$k] = str_replace('[+MGR_DIR+]', MGR_DIR, $v); |
66 | 66 | } |
67 | 67 | ?> |
68 | 68 | \ No newline at end of file |
@@ -37,15 +37,18 @@ discard block |
||
37 | 37 | "sv" => "svenska" |
38 | 38 | ); |
39 | 39 | $_langISO6391 = substr($_SERVER["HTTP_ACCEPT_LANGUAGE"],0,2); |
40 | -if (!empty($_langFiles[$_langISO6391])) $install_language = $_langFiles[$_langISO6391]; |
|
40 | +if (!empty($_langFiles[$_langISO6391])) { |
|
41 | + $install_language = $_langFiles[$_langISO6391]; |
|
42 | +} |
|
41 | 43 | |
42 | 44 | |
43 | 45 | if (isset($_POST['language']) && !stristr($_POST['language'],"..")) { |
44 | 46 | $install_language = $_POST['language']; |
45 | 47 | } else { |
46 | - if (isset($_GET['language']) && !stristr($_GET['language'],"..")) |
|
47 | - $install_language = $_GET['language']; |
|
48 | -} |
|
48 | + if (isset($_GET['language']) && !stristr($_GET['language'],"..")) { |
|
49 | + $install_language = $_GET['language']; |
|
50 | + } |
|
51 | + } |
|
49 | 52 | # load language file |
50 | 53 | require_once("lang/english.inc.php"); // As fallback |
51 | 54 | require_once("lang/".$install_language.".inc.php"); |
@@ -55,13 +58,14 @@ discard block |
||
55 | 58 | if (isset($_POST['managerlanguage']) && !stristr($_POST['managerlanguage'],"..")) { |
56 | 59 | $manager_language = $_POST['managerlanguage']; |
57 | 60 | } else { |
58 | - if (isset($_GET['managerlanguage']) && !stristr($_GET['managerlanguage'],"..")) |
|
59 | - $manager_language = $_GET['managerlanguage']; |
|
60 | -} |
|
61 | + if (isset($_GET['managerlanguage']) && !stristr($_GET['managerlanguage'],"..")) { |
|
62 | + $manager_language = $_GET['managerlanguage']; |
|
63 | + } |
|
64 | + } |
|
61 | 65 | |
62 | -foreach($_lang as $k=>$v) |
|
63 | -{ |
|
64 | - if(strpos($v,'[+MGR_DIR+]')!==false) |
|
65 | - $_lang[$k] = str_replace('[+MGR_DIR+]', MGR_DIR, $v); |
|
66 | -} |
|
66 | +foreach($_lang as $k=>$v) { |
|
67 | + if(strpos($v,'[+MGR_DIR+]')!==false) { |
|
68 | + $_lang[$k] = str_replace('[+MGR_DIR+]', MGR_DIR, $v); |
|
69 | + } |
|
70 | + } |
|
67 | 71 | ?> |
68 | 72 | \ No newline at end of file |