@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if( ! function_exists('f_owc')){ |
|
2 | +if (!function_exists('f_owc')) { |
|
3 | 3 | /** |
4 | 4 | * @param $path |
5 | 5 | * @param $data |
@@ -12,30 +12,30 @@ discard block |
||
12 | 12 | fwrite($hnd, $data); |
13 | 13 | fclose($hnd); |
14 | 14 | |
15 | - if(null !== $mode) chmod($path, $mode); |
|
16 | - }catch(Exception $e){ |
|
15 | + if (null !== $mode) chmod($path, $mode); |
|
16 | + } catch (Exception $e) { |
|
17 | 17 | // Nothing, this is NOT normal |
18 | 18 | unset($e); |
19 | 19 | } |
20 | 20 | } |
21 | 21 | } |
22 | 22 | |
23 | -$installMode = isset($_POST['installmode']) ? (int)$_POST['installmode'] : 0; |
|
24 | -if( ! isset($_lang)) $_lang = array(); |
|
23 | +$installMode = isset($_POST['installmode']) ? (int) $_POST['installmode'] : 0; |
|
24 | +if (!isset($_lang)) $_lang = array(); |
|
25 | 25 | |
26 | 26 | echo '<div class="stepcontainer"> |
27 | 27 | <ul class="progressbar"> |
28 | - <li class="visited">' . $_lang['choose_language'] . '</li> |
|
29 | - <li class="visited">' . $_lang['installation_mode'] . '</li> |
|
30 | - <li class="visited">' . $_lang['optional_items'] . '</li> |
|
31 | - <li class="active">' . $_lang['preinstall_validation'] . '</li> |
|
32 | - <li>' . $_lang['install_results'] . '</li> |
|
28 | + <li class="visited">' . $_lang['choose_language'].'</li> |
|
29 | + <li class="visited">' . $_lang['installation_mode'].'</li> |
|
30 | + <li class="visited">' . $_lang['optional_items'].'</li> |
|
31 | + <li class="active">' . $_lang['preinstall_validation'].'</li> |
|
32 | + <li>' . $_lang['install_results'].'</li> |
|
33 | 33 | </ul> |
34 | 34 | <div class="clearleft"></div> |
35 | 35 | </div>'; |
36 | 36 | |
37 | -echo '<h2>' . $_lang['preinstall_validation'] . '</h2>'; |
|
38 | -echo '<h3>' . $_lang['summary_setup_check'] . '</h3>'; |
|
37 | +echo '<h2>'.$_lang['preinstall_validation'].'</h2>'; |
|
38 | +echo '<h3>'.$_lang['summary_setup_check'].'</h3>'; |
|
39 | 39 | |
40 | 40 | $errors = 0; |
41 | 41 | |
@@ -43,73 +43,73 @@ discard block |
||
43 | 43 | // check PHP version |
44 | 44 | define('PHP_MIN_VERSION', '5.4.0'); |
45 | 45 | $phpMinVersion = PHP_MIN_VERSION; // Maybe not necessary. For backward compatibility |
46 | -echo '<p>' . $_lang['checking_php_version']; |
|
46 | +echo '<p>'.$_lang['checking_php_version']; |
|
47 | 47 | // -1 if left is less, 0 if equal, +1 if left is higher |
48 | 48 | if (version_compare(phpversion(), PHP_MIN_VERSION) < 0) { |
49 | 49 | $errors++; |
50 | - $tmp = $_lang['you_running_php'] . phpversion() . str_replace('[+min_version+]', PHP_MIN_VERSION, $_lang["modx_requires_php"]); |
|
51 | - echo '<span class="notok">' . $_lang['failed'] . '</span>' . $tmp . '</p>'; |
|
50 | + $tmp = $_lang['you_running_php'].phpversion().str_replace('[+min_version+]', PHP_MIN_VERSION, $_lang["modx_requires_php"]); |
|
51 | + echo '<span class="notok">'.$_lang['failed'].'</span>'.$tmp.'</p>'; |
|
52 | 52 | } else { |
53 | - echo '<span class="ok">' . $_lang['ok'] . '</span></p>'; |
|
53 | + echo '<span class="ok">'.$_lang['ok'].'</span></p>'; |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | |
57 | 57 | // check if iconv is available |
58 | -echo '<p>' . $_lang['checking_iconv']; |
|
58 | +echo '<p>'.$_lang['checking_iconv']; |
|
59 | 59 | $iconv = (int) function_exists('iconv'); |
60 | -if ($iconv == '0'){ |
|
61 | - echo '<span class="notok">' . $_lang['failed'].'</span></p><p><strong>'.$_lang['checking_iconv_note'].'</strong></p>'; |
|
60 | +if ($iconv == '0') { |
|
61 | + echo '<span class="notok">'.$_lang['failed'].'</span></p><p><strong>'.$_lang['checking_iconv_note'].'</strong></p>'; |
|
62 | 62 | $errors++; |
63 | 63 | } else { |
64 | - echo '<span class="ok">' . $_lang['ok'] . '</span></p>'; |
|
64 | + echo '<span class="ok">'.$_lang['ok'].'</span></p>'; |
|
65 | 65 | } |
66 | 66 | // check sessions |
67 | -echo '<p>' . $_lang['checking_sessions']; |
|
67 | +echo '<p>'.$_lang['checking_sessions']; |
|
68 | 68 | if ($_SESSION['test'] != 1) { |
69 | - echo '<span class="notok">' . $_lang['failed']. '</span></p>'; |
|
69 | + echo '<span class="notok">'.$_lang['failed'].'</span></p>'; |
|
70 | 70 | $errors++; |
71 | 71 | } else { |
72 | - echo '<span class="ok">' . $_lang['ok'] . '</span></p>'; |
|
72 | + echo '<span class="ok">'.$_lang['ok'].'</span></p>'; |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | |
76 | 76 | // check directories |
77 | 77 | // cache exists? |
78 | -echo '<p>' . $_lang['checking_if_cache_exist']; |
|
78 | +echo '<p>'.$_lang['checking_if_cache_exist']; |
|
79 | 79 | if (!file_exists("../assets/cache") || !file_exists("../assets/cache/rss")) { |
80 | - echo '<span class="notok">' . $_lang['failed'] . '</span></p>'; |
|
80 | + echo '<span class="notok">'.$_lang['failed'].'</span></p>'; |
|
81 | 81 | $errors++; |
82 | 82 | } else { |
83 | - echo '<span class="ok">' . $_lang['ok'] . '</span></p>'; |
|
83 | + echo '<span class="ok">'.$_lang['ok'].'</span></p>'; |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | |
87 | 87 | // cache writable? |
88 | -echo '<p>' . $_lang['checking_if_cache_writable']; |
|
88 | +echo '<p>'.$_lang['checking_if_cache_writable']; |
|
89 | 89 | if (!is_writable("../assets/cache")) { |
90 | 90 | $errors++; |
91 | - echo '<span class="notok">' . $_lang['failed'] . '</span></p>'; |
|
91 | + echo '<span class="notok">'.$_lang['failed'].'</span></p>'; |
|
92 | 92 | } else { |
93 | - echo '<span class="ok">' . $_lang['ok'] . '</span></p>'; |
|
93 | + echo '<span class="ok">'.$_lang['ok'].'</span></p>'; |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | |
97 | 97 | // cache files writable? |
98 | -echo '<p>' . $_lang['checking_if_cache_file_writable']; |
|
98 | +echo '<p>'.$_lang['checking_if_cache_file_writable']; |
|
99 | 99 | $tmp = "../assets/cache/siteCache.idx.php"; |
100 | -if ( ! file_exists($tmp)) { |
|
100 | +if (!file_exists($tmp)) { |
|
101 | 101 | f_owc($tmp, "<?php //EVO site cache file ?>"); |
102 | 102 | } |
103 | -if ( ! is_writable($tmp)) { |
|
103 | +if (!is_writable($tmp)) { |
|
104 | 104 | $errors++; |
105 | - echo '<span class="notok">' . $_lang['failed'] . '</span></p>'; |
|
105 | + echo '<span class="notok">'.$_lang['failed'].'</span></p>'; |
|
106 | 106 | } else { |
107 | 107 | echo '<span class="ok">'.$_lang['ok'].'</span></p>'; |
108 | 108 | } |
109 | 109 | |
110 | 110 | |
111 | 111 | echo '<p>'.$_lang['checking_if_cache_file2_writable']; |
112 | -if ( ! is_writable("../assets/cache/sitePublishing.idx.php")) { |
|
112 | +if (!is_writable("../assets/cache/sitePublishing.idx.php")) { |
|
113 | 113 | $errors++; |
114 | 114 | echo '<span class="notok">'.$_lang['failed'].'</span></p>'; |
115 | 115 | } else { |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | |
120 | 120 | // File Browser directories exists? |
121 | 121 | echo '<p>'.$_lang['checking_if_images_exist']; |
122 | -switch(true){ |
|
122 | +switch (true) { |
|
123 | 123 | case !file_exists("../assets/images"): |
124 | 124 | case !file_exists("../assets/files"): |
125 | 125 | case !file_exists("../assets/backup"): |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | |
135 | 135 | // File Browser directories writable? |
136 | 136 | echo '<p>'.$_lang['checking_if_images_writable']; |
137 | -switch(true){ |
|
137 | +switch (true) { |
|
138 | 138 | case !is_writable("../assets/images"): |
139 | 139 | case !is_writable("../assets/files"): |
140 | 140 | case !is_writable("../assets/backup"): |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | $database_charset = substr($database_collation, 0, strpos($database_collation, '_') - 1); |
195 | 195 | $database_connection_charset = $_POST['database_connection_charset']; |
196 | 196 | $database_connection_method = $_POST['database_connection_method']; |
197 | - $dbase = '`' . $_POST['database_name'] . '`'; |
|
197 | + $dbase = '`'.$_POST['database_name'].'`'; |
|
198 | 198 | $table_prefix = $_POST['tableprefix']; |
199 | 199 | } |
200 | 200 | echo '<p>'.$_lang['creating_database_connection']; |
@@ -234,54 +234,54 @@ discard block |
||
234 | 234 | |
235 | 235 | // check table prefix |
236 | 236 | if ($conn && $installMode == 0) { |
237 | - echo '<p>' . $_lang['checking_table_prefix'] . $table_prefix . '`: '; |
|
238 | - if ($rs= mysqli_query($conn, "SELECT COUNT(*) FROM $dbase.`" . $table_prefix . "site_content`")) { |
|
239 | - echo '<span class="notok">' . $_lang['failed'] . '</span></b>' . $_lang['table_prefix_already_inuse'] . '</p>'; |
|
237 | + echo '<p>'.$_lang['checking_table_prefix'].$table_prefix.'`: '; |
|
238 | + if ($rs = mysqli_query($conn, "SELECT COUNT(*) FROM $dbase.`".$table_prefix."site_content`")) { |
|
239 | + echo '<span class="notok">'.$_lang['failed'].'</span></b>'.$_lang['table_prefix_already_inuse'].'</p>'; |
|
240 | 240 | $errors++; |
241 | - echo "<p>" . $_lang['table_prefix_already_inuse_note'] . '</p>'; |
|
241 | + echo "<p>".$_lang['table_prefix_already_inuse_note'].'</p>'; |
|
242 | 242 | } else { |
243 | - echo '<span class="ok">' . $_lang['ok'] . '</span></p>'; |
|
243 | + echo '<span class="ok">'.$_lang['ok'].'</span></p>'; |
|
244 | 244 | } |
245 | 245 | } elseif ($conn && $installMode == 2) { |
246 | - echo '<p>' . $_lang['checking_table_prefix'] . $table_prefix . '`: '; |
|
247 | - if (!$rs = mysqli_query($conn, "SELECT COUNT(*) FROM $dbase.`" . $table_prefix . "site_content`")) { |
|
248 | - echo '<span class="notok">' . $_lang['failed'] . '</span></b>' . $_lang['table_prefix_not_exist'] . '</p>'; |
|
246 | + echo '<p>'.$_lang['checking_table_prefix'].$table_prefix.'`: '; |
|
247 | + if (!$rs = mysqli_query($conn, "SELECT COUNT(*) FROM $dbase.`".$table_prefix."site_content`")) { |
|
248 | + echo '<span class="notok">'.$_lang['failed'].'</span></b>'.$_lang['table_prefix_not_exist'].'</p>'; |
|
249 | 249 | $errors++; |
250 | - echo '<p>' . $_lang['table_prefix_not_exist_note'] . '</p>'; |
|
250 | + echo '<p>'.$_lang['table_prefix_not_exist_note'].'</p>'; |
|
251 | 251 | } else { |
252 | - echo '<span class="ok">' . $_lang['ok'] . '</span></p>'; |
|
252 | + echo '<span class="ok">'.$_lang['ok'].'</span></p>'; |
|
253 | 253 | } |
254 | 254 | } |
255 | 255 | |
256 | 256 | // check mysql version |
257 | 257 | if ($conn) { |
258 | - echo '<p>' . $_lang['checking_mysql_version']; |
|
259 | - if ( version_compare(mysqli_get_server_info($conn), '5.0.51', '=') ) { |
|
260 | - echo '<span class="notok">' . $_lang['warning'] . '</span></b> <strong>' . $_lang['mysql_5051'] . '</strong></p>'; |
|
261 | - echo '<p><span class="notok">' . $_lang['mysql_5051_warning'] . '</span></p>'; |
|
258 | + echo '<p>'.$_lang['checking_mysql_version']; |
|
259 | + if (version_compare(mysqli_get_server_info($conn), '5.0.51', '=')) { |
|
260 | + echo '<span class="notok">'.$_lang['warning'].'</span></b> <strong>'.$_lang['mysql_5051'].'</strong></p>'; |
|
261 | + echo '<p><span class="notok">'.$_lang['mysql_5051_warning'].'</span></p>'; |
|
262 | 262 | } else { |
263 | - echo '<span class="ok">' . $_lang['ok'] . '</span> <strong>' . $_lang['mysql_version_is'] . mysqli_get_server_info($conn) . '</strong></p>'; |
|
263 | + echo '<span class="ok">'.$_lang['ok'].'</span> <strong>'.$_lang['mysql_version_is'].mysqli_get_server_info($conn).'</strong></p>'; |
|
264 | 264 | } |
265 | 265 | } |
266 | 266 | |
267 | 267 | // check for strict mode |
268 | 268 | if ($conn) { |
269 | - echo '<p>'. $_lang['checking_mysql_strict_mode']; |
|
269 | + echo '<p>'.$_lang['checking_mysql_strict_mode']; |
|
270 | 270 | $mysqlmode = mysqli_query($conn, "SELECT @@global.sql_mode"); |
271 | - if (mysqli_num_rows($mysqlmode) > 0){ |
|
271 | + if (mysqli_num_rows($mysqlmode) > 0) { |
|
272 | 272 | $modes = mysqli_fetch_array($mysqlmode, MYSQLI_NUM); |
273 | 273 | //$modes = array("STRICT_TRANS_TABLES"); // for testing |
274 | 274 | // print_r($modes); |
275 | 275 | foreach ($modes as $mode) { |
276 | 276 | if (stristr($mode, "STRICT_TRANS_TABLES") !== false || stristr($mode, "STRICT_ALL_TABLES") !== false) { |
277 | - echo '<span class="notok">' . $_lang['warning'] . '</span></b> <strong> ' . $_lang['strict_mode'] . '</strong></p>'; |
|
278 | - echo '<p><span class="notok">' . $_lang['strict_mode_error'] . '</span></p>'; |
|
277 | + echo '<span class="notok">'.$_lang['warning'].'</span></b> <strong> '.$_lang['strict_mode'].'</strong></p>'; |
|
278 | + echo '<p><span class="notok">'.$_lang['strict_mode_error'].'</span></p>'; |
|
279 | 279 | } else { |
280 | - echo '<span class="ok">' . $_lang['ok'] . '</span></p>'; |
|
280 | + echo '<span class="ok">'.$_lang['ok'].'</span></p>'; |
|
281 | 281 | } |
282 | 282 | } |
283 | 283 | } else { |
284 | - echo '<span class="ok">' . $_lang['ok'] . '</span></p>'; |
|
284 | + echo '<span class="ok">'.$_lang['ok'].'</span></p>'; |
|
285 | 285 | } |
286 | 286 | } |
287 | 287 | // Version and strict mode check end |
@@ -297,18 +297,18 @@ discard block |
||
297 | 297 | f_owc("../assets/cache/installProc.inc.php", '<?php $installStartTime = '.time().'; ?>'); |
298 | 298 | } |
299 | 299 | |
300 | -if($installMode > 0 && $_POST['installdata'] == "1") { |
|
301 | - echo '<p class="notes"><strong>' . $_lang['sample_web_site'] . ':</strong> ' . $_lang['sample_web_site_note'] . '</p>'; |
|
300 | +if ($installMode > 0 && $_POST['installdata'] == "1") { |
|
301 | + echo '<p class="notes"><strong>'.$_lang['sample_web_site'].':</strong> '.$_lang['sample_web_site_note'].'</p>'; |
|
302 | 302 | } |
303 | 303 | |
304 | 304 | if ($errors > 0) { |
305 | 305 | echo '<p>'; |
306 | - echo $_lang['setup_cannot_continue'] . ' '; |
|
306 | + echo $_lang['setup_cannot_continue'].' '; |
|
307 | 307 | |
308 | - if($errors > 1){ |
|
309 | - echo $errors . " " . $_lang['errors'] . $_lang['please_correct_errors'] . $_lang['and_try_again_plural']; |
|
310 | - }else{ |
|
311 | - echo $_lang['error'] . $_lang['please_correct_error'] . $_lang['and_try_again']; |
|
308 | + if ($errors > 1) { |
|
309 | + echo $errors." ".$_lang['errors'].$_lang['please_correct_errors'].$_lang['and_try_again_plural']; |
|
310 | + } else { |
|
311 | + echo $_lang['error'].$_lang['please_correct_error'].$_lang['and_try_again']; |
|
312 | 312 | } |
313 | 313 | |
314 | 314 | echo $_lang['visit_forum']; |
@@ -317,10 +317,10 @@ discard block |
||
317 | 317 | |
318 | 318 | echo '<p> </p>'; |
319 | 319 | |
320 | -$nextAction= $errors > 0 ? 'summary' : 'install'; |
|
321 | -$nextButton= $errors > 0 ? $_lang['retry'] : $_lang['install']; |
|
322 | -$nextVisibility= $errors > 0 || isset($_POST['chkagree']) ? 'visible' : 'hidden'; |
|
323 | -$agreeToggle= $errors > 0 ? '' : ' onclick="if(document.getElementById(\'chkagree\').checked){document.getElementById(\'nextbutton\').style.visibility=\'visible\';}else{document.getElementById(\'nextbutton\').style.visibility=\'hidden\';}"'; |
|
320 | +$nextAction = $errors > 0 ? 'summary' : 'install'; |
|
321 | +$nextButton = $errors > 0 ? $_lang['retry'] : $_lang['install']; |
|
322 | +$nextVisibility = $errors > 0 || isset($_POST['chkagree']) ? 'visible' : 'hidden'; |
|
323 | +$agreeToggle = $errors > 0 ? '' : ' onclick="if(document.getElementById(\'chkagree\').checked){document.getElementById(\'nextbutton\').style.visibility=\'visible\';}else{document.getElementById(\'nextbutton\').style.visibility=\'hidden\';}"'; |
|
324 | 324 | ?> |
325 | 325 | <form name="install" id="install_form" action="index.php?action=<?php echo $nextAction ?>" method="post"> |
326 | 326 | <div> |
@@ -342,32 +342,32 @@ discard block |
||
342 | 342 | |
343 | 343 | <input type="hidden" value="<?php echo $_POST['installdata'] ?>" name="installdata" /> |
344 | 344 | <?php |
345 | - $templates = isset ($_POST['template']) ? $_POST['template'] : array (); |
|
345 | + $templates = isset ($_POST['template']) ? $_POST['template'] : array(); |
|
346 | 346 | foreach ($templates as $i => $template) echo '<input type="hidden" name="template[]" value="'.$template.'" />'; |
347 | 347 | |
348 | - $tvs = isset ($_POST['tv']) ? $_POST['tv'] : array (); |
|
348 | + $tvs = isset ($_POST['tv']) ? $_POST['tv'] : array(); |
|
349 | 349 | foreach ($tvs as $i => $tv) echo '<input type="hidden" name="tv[]" value="'.$tv.'" />'; |
350 | 350 | |
351 | - $chunks = isset ($_POST['chunk']) ? $_POST['chunk'] : array (); |
|
351 | + $chunks = isset ($_POST['chunk']) ? $_POST['chunk'] : array(); |
|
352 | 352 | foreach ($chunks as $i => $chunk) echo '<input type="hidden" name="chunk[]" value="'.$chunk.'" />'; |
353 | 353 | |
354 | - $snippets = isset ($_POST['snippet']) ? $_POST['snippet'] : array (); |
|
354 | + $snippets = isset ($_POST['snippet']) ? $_POST['snippet'] : array(); |
|
355 | 355 | foreach ($snippets as $i => $snippet) echo '<input type="hidden" name="snippet[]" value="'.$snippet.'" />'; |
356 | 356 | |
357 | - $plugins = isset ($_POST['plugin']) ? $_POST['plugin'] : array (); |
|
357 | + $plugins = isset ($_POST['plugin']) ? $_POST['plugin'] : array(); |
|
358 | 358 | foreach ($plugins as $i => $plugin) echo '<input type="hidden" name="plugin[]" value="'.$plugin.'" />'; |
359 | 359 | |
360 | - $modules = isset ($_POST['module']) ? $_POST['module'] : array (); |
|
360 | + $modules = isset ($_POST['module']) ? $_POST['module'] : array(); |
|
361 | 361 | foreach ($modules as $i => $module) echo '<input type="hidden" name="module[]" value="'.$module.'" />'; |
362 | 362 | ?> |
363 | 363 | </div> |
364 | 364 | |
365 | -<h2><?php echo $_lang['agree_to_terms'];?></h2> |
|
365 | +<h2><?php echo $_lang['agree_to_terms']; ?></h2> |
|
366 | 366 | <p> |
367 | -<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> |
|
367 | +<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> |
|
368 | 368 | </p> |
369 | 369 | <p class="buttonlinks"> |
370 | 370 | <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> |
371 | - <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> |
|
371 | + <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> |
|
372 | 372 | </p> |
373 | 373 | </form> |
@@ -3,11 +3,11 @@ discard block |
||
3 | 3 | $content = parse($content, array( |
4 | 4 | 'langOptions' => getLangOptions($install_language)) |
5 | 5 | ); |
6 | -$content = parse($content, $_lang,'[%','%]'); |
|
6 | +$content = parse($content, $_lang, '[%', '%]'); |
|
7 | 7 | |
8 | 8 | echo $content; |
9 | 9 | |
10 | -if( ! function_exists('getLangOptions')) { |
|
10 | +if (!function_exists('getLangOptions')) { |
|
11 | 11 | /** |
12 | 12 | * @param string $install_language |
13 | 13 | * @return string |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | $abrv_language = explode('-', $language); |
30 | 30 | $selected = ($language === $install_language) ? 'selected' : ''; |
31 | 31 | $_[] = sprintf('<option value="%s" %s>%s</option>', $language, $selected, |
32 | - ucwords($abrv_language[0])) . "\n"; |
|
32 | + ucwords($abrv_language[0]))."\n"; |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | return implode("\n", $_); |
@@ -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)) |
@@ -17,16 +17,16 @@ discard block |
||
17 | 17 | } |
18 | 18 | |
19 | 19 | $ph['moduleName'] = $moduleName; |
20 | -$ph['displayNew'] = ($upgradeable!=0) ? 'display:none;' : ''; |
|
21 | -$ph['displayUpg'] = ($upgradeable==0) ? 'display:none;' : ''; |
|
20 | +$ph['displayNew'] = ($upgradeable != 0) ? 'display:none;' : ''; |
|
21 | +$ph['displayUpg'] = ($upgradeable == 0) ? 'display:none;' : ''; |
|
22 | 22 | $ph['displayAdvUpg'] = $ph['displayUpg']; |
23 | -$ph['checkedNew'] = !$upgradeable ? 'checked' : ''; |
|
24 | -$ph['checkedUpg'] = ($_POST['installmode']==1 || $upgradeable==1) ? 'checked' : ''; |
|
25 | -$ph['checkedAdvUpg'] = ($_POST['installmode']==2 || $upgradeable==2) ? 'checked' : ''; |
|
23 | +$ph['checkedNew'] = !$upgradeable ? 'checked' : ''; |
|
24 | +$ph['checkedUpg'] = ($_POST['installmode'] == 1 || $upgradeable == 1) ? 'checked' : ''; |
|
25 | +$ph['checkedAdvUpg'] = ($_POST['installmode'] == 2 || $upgradeable == 2) ? 'checked' : ''; |
|
26 | 26 | $ph['install_language'] = $install_language; |
27 | -$ph['disabledUpg'] = ($upgradeable!=1) ? 'disabled' : ''; |
|
28 | -$ph['disabledAdvUpg'] = ($upgradeable==0) ? 'disabled' : ''; |
|
27 | +$ph['disabledUpg'] = ($upgradeable != 1) ? 'disabled' : ''; |
|
28 | +$ph['disabledAdvUpg'] = ($upgradeable == 0) ? 'disabled' : ''; |
|
29 | 29 | |
30 | -$tpl = file_get_contents($base_path . 'install/actions/tpl_mode.html'); |
|
30 | +$tpl = file_get_contents($base_path.'install/actions/tpl_mode.html'); |
|
31 | 31 | $content = parse($tpl, $ph); |
32 | -echo parse($content, $_lang,'[%','%]'); |
|
32 | +echo parse($content, $_lang, '[%', '%]'); |
@@ -1,19 +1,19 @@ discard block |
||
1 | 1 | <?php |
2 | -$installMode = isset($_POST['installmode']) ? (int)$_POST['installmode'] : 0; |
|
2 | +$installMode = isset($_POST['installmode']) ? (int) $_POST['installmode'] : 0; |
|
3 | 3 | |
4 | -switch($installMode){ |
|
4 | +switch ($installMode) { |
|
5 | 5 | case 0: |
6 | 6 | case 2: |
7 | 7 | $database_collation = isset($_POST['database_collation']) ? $_POST['database_collation'] : 'utf8_general_ci'; |
8 | 8 | $database_charset = substr($database_collation, 0, strpos($database_collation, '_')); |
9 | 9 | $_POST['database_connection_charset'] = $database_charset; |
10 | - if(empty($_SESSION['databaseloginpassword'])) |
|
10 | + if (empty($_SESSION['databaseloginpassword'])) |
|
11 | 11 | $_SESSION['databaseloginpassword'] = $_POST['databaseloginpassword']; |
12 | - if(empty($_SESSION['databaseloginname'])) |
|
12 | + if (empty($_SESSION['databaseloginname'])) |
|
13 | 13 | $_SESSION['databaseloginname'] = $_POST['databaseloginname']; |
14 | 14 | break; |
15 | 15 | case 1: |
16 | - include $base_path . MGR_DIR . '/includes/config.inc.php'; |
|
16 | + include $base_path.MGR_DIR.'/includes/config.inc.php'; |
|
17 | 17 | if (@ $conn = mysqli_connect($database_server, $database_user, $database_password)) { |
18 | 18 | if (@ mysqli_query($conn, "USE {$dbase}")) { |
19 | 19 | if (!$rs = mysqli_query($conn, "show session variables like 'collation_database'")) { |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | $ph['checked'] = isset ($_POST['installdata']) && $_POST['installdata'] == "1" ? 'checked' : ''; |
69 | 69 | |
70 | 70 | # load setup information file |
71 | -include($base_path . 'install/setup.info.php'); |
|
71 | +include($base_path.'install/setup.info.php'); |
|
72 | 72 | $ph['templates'] = getTemplates($moduleTemplates); |
73 | 73 | $ph['tvs'] = getTVs($moduleTVs); |
74 | 74 | $ph['chunks'] = getChunks($moduleChunks); |
@@ -78,12 +78,12 @@ discard block |
||
78 | 78 | |
79 | 79 | $ph['action'] = ($installMode == 1) ? 'mode' : 'connection'; |
80 | 80 | |
81 | -$tpl = file_get_contents($base_path . 'install/actions/tpl_options.html'); |
|
82 | -$content = parse($tpl,$ph); |
|
83 | -echo parse($content,$_lang,'[%','%]'); |
|
81 | +$tpl = file_get_contents($base_path.'install/actions/tpl_options.html'); |
|
82 | +$content = parse($tpl, $ph); |
|
83 | +echo parse($content, $_lang, '[%', '%]'); |
|
84 | 84 | |
85 | 85 | |
86 | -if( ! function_exists('getTemplates')) { |
|
86 | +if (!function_exists('getTemplates')) { |
|
87 | 87 | /** |
88 | 88 | * @param array $presets |
89 | 89 | * @return string |
@@ -108,12 +108,12 @@ discard block |
||
108 | 108 | $i++; |
109 | 109 | } |
110 | 110 | if (0 < count($_)) { |
111 | - return '<h3>[%templates%]</h3>' . join("\n", $_); |
|
111 | + return '<h3>[%templates%]</h3>'.join("\n", $_); |
|
112 | 112 | } |
113 | 113 | } |
114 | 114 | } |
115 | 115 | |
116 | -if( ! function_exists('getTVs')) { |
|
116 | +if (!function_exists('getTVs')) { |
|
117 | 117 | /** |
118 | 118 | * @param array $presets |
119 | 119 | * @return string |
@@ -138,12 +138,12 @@ discard block |
||
138 | 138 | $i++; |
139 | 139 | } |
140 | 140 | if (0 < count($_)) { |
141 | - return '<h3>[%tvs%]</h3>' . join("\n", $_); |
|
141 | + return '<h3>[%tvs%]</h3>'.join("\n", $_); |
|
142 | 142 | } |
143 | 143 | } |
144 | 144 | } |
145 | 145 | |
146 | -if( ! function_exists('getChunks')) { |
|
146 | +if (!function_exists('getChunks')) { |
|
147 | 147 | /** |
148 | 148 | * display chunks |
149 | 149 | * |
@@ -169,12 +169,12 @@ discard block |
||
169 | 169 | $i++; |
170 | 170 | } |
171 | 171 | if (0 < count($_)) { |
172 | - return '<h3>[%chunks%]</h3>' . join("\n", $_); |
|
172 | + return '<h3>[%chunks%]</h3>'.join("\n", $_); |
|
173 | 173 | } |
174 | 174 | } |
175 | 175 | } |
176 | 176 | |
177 | -if( ! function_exists('getModules')) { |
|
177 | +if (!function_exists('getModules')) { |
|
178 | 178 | /** |
179 | 179 | * display modules |
180 | 180 | * |
@@ -200,12 +200,12 @@ discard block |
||
200 | 200 | $i++; |
201 | 201 | } |
202 | 202 | if (0 < count($_)) { |
203 | - return '<h3>[%modules%]</h3>' . join("\n", $_); |
|
203 | + return '<h3>[%modules%]</h3>'.join("\n", $_); |
|
204 | 204 | } |
205 | 205 | } |
206 | 206 | } |
207 | 207 | |
208 | -if( ! function_exists('getPlugins')) { |
|
208 | +if (!function_exists('getPlugins')) { |
|
209 | 209 | /** |
210 | 210 | * display plugins |
211 | 211 | * |
@@ -235,12 +235,12 @@ discard block |
||
235 | 235 | $i++; |
236 | 236 | } |
237 | 237 | if (0 < count($_)) { |
238 | - return '<h3>[%plugins%]</h3>' . join("\n", $_); |
|
238 | + return '<h3>[%plugins%]</h3>'.join("\n", $_); |
|
239 | 239 | } |
240 | 240 | } |
241 | 241 | } |
242 | 242 | |
243 | -if( ! function_exists('getSnippets')) { |
|
243 | +if (!function_exists('getSnippets')) { |
|
244 | 244 | /** |
245 | 245 | * display snippets |
246 | 246 | * |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | $i++; |
267 | 267 | } |
268 | 268 | if (0 < count($_)) { |
269 | - return '<h3>[%snippets%]</h3>' . join("\n", $_); |
|
269 | + return '<h3>[%snippets%]</h3>'.join("\n", $_); |
|
270 | 270 | } |
271 | 271 | } |
272 | 272 | } |
@@ -1,12 +1,12 @@ discard block |
||
1 | 1 | <?php |
2 | -$installMode = isset($_POST['installmode']) ? (int)$_POST['installmode'] : 0; |
|
2 | +$installMode = isset($_POST['installmode']) ? (int) $_POST['installmode'] : 0; |
|
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= substr(md5(time()), rand(0, 27), rand(3, 5))."_"; |
|
7 | + $database_name = ''; |
|
8 | + $database_server = 'localhost'; |
|
9 | + $table_prefix = substr(md5(time()), rand(0, 27), rand(3, 5))."_"; |
|
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 | |
@@ -49,33 +49,33 @@ discard block |
||
49 | 49 | $database_connection_method = 'SET CHARACTER SET'; |
50 | 50 | } |
51 | 51 | |
52 | -$ph['database_name'] = isset($_POST['database_name']) ? $_POST['database_name']: $database_name; |
|
53 | -$ph['tableprefix'] = isset($_POST['tableprefix']) ? $_POST['tableprefix']: $table_prefix; |
|
52 | +$ph['database_name'] = isset($_POST['database_name']) ? $_POST['database_name'] : $database_name; |
|
53 | +$ph['tableprefix'] = isset($_POST['tableprefix']) ? $_POST['tableprefix'] : $table_prefix; |
|
54 | 54 | $ph['selected_set_character_set'] = isset($database_connection_method) && $database_connection_method == 'SET CHARACTER SET' ? 'selected' : ''; |
55 | 55 | $ph['selected_set_names'] = isset($database_connection_method) && $database_connection_method == 'SET NAMES' ? 'selected' : ''; |
56 | 56 | $ph['show#connection_method'] = (($installMode == 0) || ($installMode == 2)) ? 'block' : 'none'; |
57 | -$ph['database_collation'] = isset($_POST['database_collation']) ? $_POST['database_collation']: $database_collation; |
|
58 | -$ph['show#AUH'] = ($installMode == 0) ? 'block':'none'; |
|
59 | -$ph['cmsadmin'] = isset($_POST['cmsadmin']) ? $_POST['cmsadmin']:'admin'; |
|
60 | -$ph['cmsadminemail'] = isset($_POST['cmsadminemail']) ? $_POST['cmsadminemail']:""; |
|
61 | -$ph['cmspassword'] = isset($_POST['cmspassword']) ? $_POST['cmspassword']:""; |
|
62 | -$ph['cmspasswordconfirm'] = isset($_POST['cmspasswordconfirm']) ? $_POST['cmspasswordconfirm']:""; |
|
57 | +$ph['database_collation'] = isset($_POST['database_collation']) ? $_POST['database_collation'] : $database_collation; |
|
58 | +$ph['show#AUH'] = ($installMode == 0) ? 'block' : 'none'; |
|
59 | +$ph['cmsadmin'] = isset($_POST['cmsadmin']) ? $_POST['cmsadmin'] : 'admin'; |
|
60 | +$ph['cmsadminemail'] = isset($_POST['cmsadminemail']) ? $_POST['cmsadminemail'] : ""; |
|
61 | +$ph['cmspassword'] = isset($_POST['cmspassword']) ? $_POST['cmspassword'] : ""; |
|
62 | +$ph['cmspasswordconfirm'] = isset($_POST['cmspasswordconfirm']) ? $_POST['cmspasswordconfirm'] : ""; |
|
63 | 63 | $ph['managerLangs'] = getLangs($install_language); |
64 | 64 | $ph['install_language'] = $install_language; |
65 | 65 | $ph['installMode'] = $installMode; |
66 | -$ph['checkedChkagree'] = isset($_POST['chkagree']) ? 'checked':""; |
|
66 | +$ph['checkedChkagree'] = isset($_POST['chkagree']) ? 'checked' : ""; |
|
67 | 67 | $ph['database_connection_method'] = isset($database_connection_method) ? $database_connection_method : ''; |
68 | -$ph['databasehost'] = isset($_POST['databasehost']) ? $_POST['databasehost']: $database_server; |
|
69 | -$ph['databaseloginname'] = isset($_SESSION['databaseloginname']) ? $_SESSION['databaseloginname']: ''; |
|
70 | -$ph['databaseloginpassword'] = isset($_SESSION['databaseloginpassword']) ? $_SESSION['databaseloginpassword']: ""; |
|
68 | +$ph['databasehost'] = isset($_POST['databasehost']) ? $_POST['databasehost'] : $database_server; |
|
69 | +$ph['databaseloginname'] = isset($_SESSION['databaseloginname']) ? $_SESSION['databaseloginname'] : ''; |
|
70 | +$ph['databaseloginpassword'] = isset($_SESSION['databaseloginpassword']) ? $_SESSION['databaseloginpassword'] : ""; |
|
71 | 71 | $ph['MGR_DIR'] = MGR_DIR; |
72 | 72 | |
73 | 73 | $content = file_get_contents('./actions/tpl_connection.html'); |
74 | -$content = parse($content, $_lang, '[%','%]'); |
|
74 | +$content = parse($content, $_lang, '[%', '%]'); |
|
75 | 75 | $content = parse($content, $ph); |
76 | 76 | echo $content; |
77 | 77 | |
78 | -if( ! function_exists('getLangs')) { |
|
78 | +if (!function_exists('getLangs')) { |
|
79 | 79 | /** |
80 | 80 | * @param $install_language |
81 | 81 | * @return string |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | } |
90 | 90 | |
91 | 91 | $langs = array(); |
92 | - if ($handle = opendir("../" . MGR_DIR . "/includes/lang")) { |
|
92 | + if ($handle = opendir("../".MGR_DIR."/includes/lang")) { |
|
93 | 93 | while (false !== ($file = readdir($handle))) { |
94 | 94 | if (strpos($file, '.inc.') !== false) { |
95 | 95 | $langs[] = $file; |