@@ -1,27 +1,27 @@ 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 | 5 | $upgradeable = 0; |
6 | 6 | if ($installMode === 0) { |
7 | 7 | $database_name = ''; |
8 | 8 | $database_server = 'localhost'; |
9 | - $table_prefix = base_convert(mt_rand(10, 20), 10, 36) . |
|
10 | - substr(str_shuffle('0123456789abcdefghijklmnopqrstuvwxyz'), mt_rand(0, 33), 3) . |
|
9 | + $table_prefix = base_convert(mt_rand(10, 20), 10, 36). |
|
10 | + substr(str_shuffle('0123456789abcdefghijklmnopqrstuvwxyz'), mt_rand(0, 33), 3). |
|
11 | 11 | '_'; |
12 | 12 | } else { |
13 | 13 | $database_name = ''; |
14 | - if (! is_file($base_path . MGR_DIR . '/includes/config.inc.php')) { |
|
14 | + if (!is_file($base_path.MGR_DIR.'/includes/config.inc.php')) { |
|
15 | 15 | $upgradeable = 0; |
16 | 16 | } else { |
17 | 17 | // Include the file so we can test its validity |
18 | - include $base_path . MGR_DIR . '/includes/config.inc.php'; |
|
18 | + include $base_path.MGR_DIR.'/includes/config.inc.php'; |
|
19 | 19 | // We need to have all connection settings - but prefix may be empty so we have to ignore it |
20 | 20 | if ($dbase) { |
21 | 21 | $database_name = trim($dbase, '`'); |
22 | 22 | if (!$conn = mysqli_connect($database_server, $database_user, $database_password)) { |
23 | 23 | $upgradeable = (isset($_POST['installmode']) && $_POST['installmode'] === 'new') ? 0 : 2; |
24 | - } elseif (! mysqli_select_db($conn, trim($dbase, '`'))) { |
|
24 | + } elseif (!mysqli_select_db($conn, trim($dbase, '`'))) { |
|
25 | 25 | $upgradeable = (isset($_POST['installmode']) && $_POST['installmode'] === 'new') ? 0 : 2; |
26 | 26 | } else { |
27 | 27 | $upgradeable = 1; |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | } |
34 | 34 | |
35 | 35 | // check the database collation if not specified in the configuration |
36 | -if ($upgradeable && (! isset($database_connection_charset) || empty($database_connection_charset))) { |
|
36 | +if ($upgradeable && (!isset($database_connection_charset) || empty($database_connection_charset))) { |
|
37 | 37 | if (!$rs = mysqli_query($conn, "show session variables like 'collation_database'")) { |
38 | 38 | $rs = mysqli_query($conn, "show session variables like 'collation_server'"); |
39 | 39 | } |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | $ph['databaseloginpassword'] = isset($_SESSION['databaseloginpassword']) ? $_SESSION['databaseloginpassword'] : ""; |
78 | 78 | $ph['MGR_DIR'] = MGR_DIR; |
79 | 79 | |
80 | -$content = file_get_contents(dirname(__DIR__) . '/template/actions/connection.tpl'); |
|
80 | +$content = file_get_contents(dirname(__DIR__).'/template/actions/connection.tpl'); |
|
81 | 81 | $content = parse($content, $_lang, '[%', '%]'); |
82 | 82 | $content = parse($content, $ph); |
83 | 83 |
@@ -248,9 +248,9 @@ |
||
248 | 248 | echo '<span class="notok">' . $_lang['failed'] . '</span></b>' . $_lang['table_prefix_not_exist'] . '</p>'; |
249 | 249 | $errors++; |
250 | 250 | echo '<p>' . $_lang['table_prefix_not_exist_note'] . '</p>'; |
251 | - } else { |
|
251 | + } else { |
|
252 | 252 | echo '<span class="ok">' . $_lang['ok'] . '</span></p>'; |
253 | - } |
|
253 | + } |
|
254 | 254 | } |
255 | 255 | |
256 | 256 | // check mysql version |
@@ -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> |
@@ -1,19 +1,22 @@ 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 |
6 | 6 | * @param null|int $mode |
7 | 7 | */ |
8 | - function f_owc($path, $data, $mode = null){ |
|
8 | + function f_owc($path, $data, $mode = null) |
|
9 | + { |
|
9 | 10 | try { |
10 | 11 | // make an attempt to create the file |
11 | 12 | $hnd = fopen($path, 'w'); |
12 | 13 | fwrite($hnd, $data); |
13 | 14 | fclose($hnd); |
14 | 15 | |
15 | - if(null !== $mode) chmod($path, $mode); |
|
16 | - }catch(Exception $e){ |
|
16 | + if(null !== $mode) { |
|
17 | + chmod($path, $mode); |
|
18 | + } |
|
19 | + } catch(Exception $e) { |
|
17 | 20 | // Nothing, this is NOT normal |
18 | 21 | unset($e); |
19 | 22 | } |
@@ -21,7 +24,9 @@ discard block |
||
21 | 24 | } |
22 | 25 | |
23 | 26 | $installMode = isset($_POST['installmode']) ? (int)$_POST['installmode'] : 0; |
24 | -if( ! isset($_lang)) $_lang = array(); |
|
27 | +if( ! isset($_lang)) { |
|
28 | + $_lang = array(); |
|
29 | +} |
|
25 | 30 | |
26 | 31 | echo '<div class="stepcontainer"> |
27 | 32 | <ul class="progressbar"> |
@@ -57,7 +62,7 @@ discard block |
||
57 | 62 | // check if iconv is available |
58 | 63 | echo '<p>' . $_lang['checking_iconv']; |
59 | 64 | $iconv = (int) function_exists('iconv'); |
60 | -if ($iconv == '0'){ |
|
65 | +if ($iconv == '0') { |
|
61 | 66 | echo '<span class="notok">' . $_lang['failed'].'</span></p><p><strong>'.$_lang['checking_iconv_note'].'</strong></p>'; |
62 | 67 | $errors++; |
63 | 68 | } else { |
@@ -119,7 +124,7 @@ discard block |
||
119 | 124 | |
120 | 125 | // File Browser directories exists? |
121 | 126 | echo '<p>'.$_lang['checking_if_images_exist']; |
122 | -switch(true){ |
|
127 | +switch(true) { |
|
123 | 128 | case !file_exists("../assets/images"): |
124 | 129 | case !file_exists("../assets/files"): |
125 | 130 | case !file_exists("../assets/backup"): |
@@ -134,7 +139,7 @@ discard block |
||
134 | 139 | |
135 | 140 | // File Browser directories writable? |
136 | 141 | echo '<p>'.$_lang['checking_if_images_writable']; |
137 | -switch(true){ |
|
142 | +switch(true) { |
|
138 | 143 | case !is_writable("../assets/images"): |
139 | 144 | case !is_writable("../assets/files"): |
140 | 145 | case !is_writable("../assets/backup"): |
@@ -268,7 +273,7 @@ discard block |
||
268 | 273 | if ($conn) { |
269 | 274 | echo '<p>'. $_lang['checking_mysql_strict_mode']; |
270 | 275 | $mysqlmode = mysqli_query($conn, "SELECT @@global.sql_mode"); |
271 | - if (mysqli_num_rows($mysqlmode) > 0){ |
|
276 | + if (mysqli_num_rows($mysqlmode) > 0) { |
|
272 | 277 | $modes = mysqli_fetch_array($mysqlmode, MYSQLI_NUM); |
273 | 278 | //$modes = array("STRICT_TRANS_TABLES"); // for testing |
274 | 279 | // print_r($modes); |
@@ -305,9 +310,9 @@ discard block |
||
305 | 310 | echo '<p>'; |
306 | 311 | echo $_lang['setup_cannot_continue'] . ' '; |
307 | 312 | |
308 | - if($errors > 1){ |
|
313 | + if($errors > 1) { |
|
309 | 314 | echo $errors . " " . $_lang['errors'] . $_lang['please_correct_errors'] . $_lang['and_try_again_plural']; |
310 | - }else{ |
|
315 | + } else { |
|
311 | 316 | echo $_lang['error'] . $_lang['please_correct_error'] . $_lang['and_try_again']; |
312 | 317 | } |
313 | 318 | |
@@ -343,23 +348,35 @@ discard block |
||
343 | 348 | <input type="hidden" value="<?php echo $_POST['installdata'] ?>" name="installdata" /> |
344 | 349 | <?php |
345 | 350 | $templates = isset ($_POST['template']) ? $_POST['template'] : array (); |
346 | - foreach ($templates as $i => $template) echo '<input type="hidden" name="template[]" value="'.$template.'" />'; |
|
351 | + foreach ($templates as $i => $template) { |
|
352 | + echo '<input type="hidden" name="template[]" value="'.$template.'" />'; |
|
353 | + } |
|
347 | 354 | |
348 | 355 | $tvs = isset ($_POST['tv']) ? $_POST['tv'] : array (); |
349 | - foreach ($tvs as $i => $tv) echo '<input type="hidden" name="tv[]" value="'.$tv.'" />'; |
|
356 | + foreach ($tvs as $i => $tv) { |
|
357 | + echo '<input type="hidden" name="tv[]" value="'.$tv.'" />'; |
|
358 | + } |
|
350 | 359 | |
351 | 360 | $chunks = isset ($_POST['chunk']) ? $_POST['chunk'] : array (); |
352 | - foreach ($chunks as $i => $chunk) echo '<input type="hidden" name="chunk[]" value="'.$chunk.'" />'; |
|
361 | + foreach ($chunks as $i => $chunk) { |
|
362 | + echo '<input type="hidden" name="chunk[]" value="'.$chunk.'" />'; |
|
363 | + } |
|
353 | 364 | |
354 | 365 | $snippets = isset ($_POST['snippet']) ? $_POST['snippet'] : array (); |
355 | - foreach ($snippets as $i => $snippet) echo '<input type="hidden" name="snippet[]" value="'.$snippet.'" />'; |
|
366 | + foreach ($snippets as $i => $snippet) { |
|
367 | + echo '<input type="hidden" name="snippet[]" value="'.$snippet.'" />'; |
|
368 | + } |
|
356 | 369 | |
357 | 370 | $plugins = isset ($_POST['plugin']) ? $_POST['plugin'] : array (); |
358 | - foreach ($plugins as $i => $plugin) echo '<input type="hidden" name="plugin[]" value="'.$plugin.'" />'; |
|
371 | + foreach ($plugins as $i => $plugin) { |
|
372 | + echo '<input type="hidden" name="plugin[]" value="'.$plugin.'" />'; |
|
373 | + } |
|
359 | 374 | |
360 | 375 | $modules = isset ($_POST['module']) ? $_POST['module'] : array (); |
361 | - foreach ($modules as $i => $module) echo '<input type="hidden" name="module[]" value="'.$module.'" />'; |
|
362 | -?> |
|
376 | + foreach ($modules as $i => $module) { |
|
377 | + echo '<input type="hidden" name="module[]" value="'.$module.'" />'; |
|
378 | + } |
|
379 | + ?> |
|
363 | 380 | </div> |
364 | 381 | |
365 | 382 | <h2><?php echo $_lang['agree_to_terms'];?></h2> |
@@ -207,7 +207,7 @@ |
||
207 | 207 | |
208 | 208 | |
209 | 209 | // make sure we can use the database |
210 | -if ($installMode > 0 && !mysqli_query($conn, "USE {$dbase}")) { |
|
210 | +if ($installMode > 0 && !mysqli_query($conn, "use {$dbase}")) { |
|
211 | 211 | $errors++; |
212 | 212 | echo '<span class="notok">'.$_lang['database_use_failed'].'</span><p />'.$_lang["database_use_failed_note"].'</p>'; |
213 | 213 | } |
@@ -4,141 +4,141 @@ |
||
4 | 4 | // SNUFFKIN/ Alex 2004 |
5 | 5 | |
6 | 6 | class SqlParser { |
7 | - public $host; |
|
8 | - public $dbname; |
|
9 | - public $prefix; |
|
10 | - public $user; |
|
11 | - public $password; |
|
12 | - public $mysqlErrors; |
|
13 | - public $conn; |
|
14 | - public $installFailed; |
|
15 | - public $sitename; |
|
16 | - public $adminname; |
|
17 | - public $adminemail; |
|
18 | - public $adminpass; |
|
19 | - public $managerlanguage; |
|
20 | - public $mode; |
|
21 | - public $fileManagerPath; |
|
22 | - public $imgPath; |
|
23 | - public $imgUrl; |
|
24 | - public $dbMODx; |
|
25 | - public $dbVersion; |
|
7 | + public $host; |
|
8 | + public $dbname; |
|
9 | + public $prefix; |
|
10 | + public $user; |
|
11 | + public $password; |
|
12 | + public $mysqlErrors; |
|
13 | + public $conn; |
|
14 | + public $installFailed; |
|
15 | + public $sitename; |
|
16 | + public $adminname; |
|
17 | + public $adminemail; |
|
18 | + public $adminpass; |
|
19 | + public $managerlanguage; |
|
20 | + public $mode; |
|
21 | + public $fileManagerPath; |
|
22 | + public $imgPath; |
|
23 | + public $imgUrl; |
|
24 | + public $dbMODx; |
|
25 | + public $dbVersion; |
|
26 | 26 | public $connection_charset; |
27 | 27 | public $connection_method; |
28 | 28 | public $ignoreDuplicateErrors; |
29 | 29 | public $autoTemplateLogic; |
30 | 30 | |
31 | - public function __construct($host, $user, $password, $db, $prefix='modx_', $adminname, $adminemail, $adminpass, $connection_charset= 'utf8', $managerlanguage='english', $connection_method = 'SET CHARACTER SET', $auto_template_logic = 'parent') { |
|
32 | - $this->host = $host; |
|
33 | - $this->dbname = $db; |
|
34 | - $this->prefix = $prefix; |
|
35 | - $this->user = $user; |
|
36 | - $this->password = $password; |
|
37 | - $this->adminpass = $adminpass; |
|
38 | - $this->adminname = $adminname; |
|
39 | - $this->adminemail = $adminemail; |
|
40 | - $this->connection_charset = $connection_charset; |
|
41 | - $this->connection_method = $connection_method; |
|
42 | - $this->ignoreDuplicateErrors = false; |
|
43 | - $this->managerlanguage = $managerlanguage; |
|
31 | + public function __construct($host, $user, $password, $db, $prefix='modx_', $adminname, $adminemail, $adminpass, $connection_charset= 'utf8', $managerlanguage='english', $connection_method = 'SET CHARACTER SET', $auto_template_logic = 'parent') { |
|
32 | + $this->host = $host; |
|
33 | + $this->dbname = $db; |
|
34 | + $this->prefix = $prefix; |
|
35 | + $this->user = $user; |
|
36 | + $this->password = $password; |
|
37 | + $this->adminpass = $adminpass; |
|
38 | + $this->adminname = $adminname; |
|
39 | + $this->adminemail = $adminemail; |
|
40 | + $this->connection_charset = $connection_charset; |
|
41 | + $this->connection_method = $connection_method; |
|
42 | + $this->ignoreDuplicateErrors = false; |
|
43 | + $this->managerlanguage = $managerlanguage; |
|
44 | 44 | $this->autoTemplateLogic = $auto_template_logic; |
45 | - } |
|
45 | + } |
|
46 | 46 | |
47 | - public function connect() { |
|
48 | - $this->conn = mysqli_connect($this->host, $this->user, $this->password); |
|
49 | - mysqli_select_db($this->conn, $this->dbname); |
|
50 | - if (function_exists('mysqli_set_charset')) mysqli_set_charset($this->conn, $this->connection_charset); |
|
47 | + public function connect() { |
|
48 | + $this->conn = mysqli_connect($this->host, $this->user, $this->password); |
|
49 | + mysqli_select_db($this->conn, $this->dbname); |
|
50 | + if (function_exists('mysqli_set_charset')) mysqli_set_charset($this->conn, $this->connection_charset); |
|
51 | 51 | |
52 | - $this->dbVersion = 3.23; // assume version 3.23 |
|
53 | - if(function_exists("mysqli_get_server_info")) { |
|
54 | - $ver = mysqli_get_server_info($this->conn); |
|
55 | - $this->dbMODx = version_compare($ver,"4.0.2"); |
|
56 | - $this->dbVersion = (float) $ver; // Typecasting (float) instead of floatval() [PHP < 4.2] |
|
57 | - } |
|
52 | + $this->dbVersion = 3.23; // assume version 3.23 |
|
53 | + if(function_exists("mysqli_get_server_info")) { |
|
54 | + $ver = mysqli_get_server_info($this->conn); |
|
55 | + $this->dbMODx = version_compare($ver,"4.0.2"); |
|
56 | + $this->dbVersion = (float) $ver; // Typecasting (float) instead of floatval() [PHP < 4.2] |
|
57 | + } |
|
58 | 58 | |
59 | 59 | mysqli_query($this->conn,"{$this->connection_method} {$this->connection_charset}"); |
60 | - } |
|
60 | + } |
|
61 | 61 | |
62 | 62 | public function process($filename) { |
63 | - global $custom_placeholders; |
|
64 | - |
|
65 | - // check to make sure file exists |
|
66 | - if (!file_exists($filename)) { |
|
67 | - $this->mysqlErrors[] = array("error" => "File '$filename' not found"); |
|
68 | - $this->installFailed = true ; |
|
69 | - return false; |
|
70 | - } |
|
71 | - |
|
72 | - $fh = fopen($filename, 'r'); |
|
73 | - $idata = ''; |
|
74 | - |
|
75 | - while (!feof($fh)) { |
|
76 | - $idata .= fread($fh, 1024); |
|
77 | - } |
|
78 | - |
|
79 | - fclose($fh); |
|
80 | - $idata = str_replace("\r", '', $idata); |
|
81 | - |
|
82 | - // check if in upgrade mode |
|
83 | - if ($this->mode === 'upd') { |
|
84 | - // remove non-upgradeable parts |
|
85 | - $s = strpos($idata,'non-upgrade-able[['); |
|
86 | - $e = strpos($idata,']]non-upgrade-able') + 17; |
|
87 | - if($s && $e) { |
|
88 | - $idata = str_replace(substr($idata, $s,$e-$s),' Removed non upgradeable items', $idata); |
|
63 | + global $custom_placeholders; |
|
64 | + |
|
65 | + // check to make sure file exists |
|
66 | + if (!file_exists($filename)) { |
|
67 | + $this->mysqlErrors[] = array("error" => "File '$filename' not found"); |
|
68 | + $this->installFailed = true ; |
|
69 | + return false; |
|
70 | + } |
|
71 | + |
|
72 | + $fh = fopen($filename, 'r'); |
|
73 | + $idata = ''; |
|
74 | + |
|
75 | + while (!feof($fh)) { |
|
76 | + $idata .= fread($fh, 1024); |
|
77 | + } |
|
78 | + |
|
79 | + fclose($fh); |
|
80 | + $idata = str_replace("\r", '', $idata); |
|
81 | + |
|
82 | + // check if in upgrade mode |
|
83 | + if ($this->mode === 'upd') { |
|
84 | + // remove non-upgradeable parts |
|
85 | + $s = strpos($idata,'non-upgrade-able[['); |
|
86 | + $e = strpos($idata,']]non-upgrade-able') + 17; |
|
87 | + if($s && $e) { |
|
88 | + $idata = str_replace(substr($idata, $s,$e-$s),' Removed non upgradeable items', $idata); |
|
89 | 89 | } |
90 | - } |
|
91 | - |
|
92 | - // replace {} tags |
|
93 | - $idata = str_replace('{PREFIX}', $this->prefix, $idata); |
|
94 | - $idata = str_replace('{ADMIN}', $this->adminname, $idata); |
|
95 | - $idata = str_replace('{ADMINEMAIL}', $this->adminemail, $idata); |
|
96 | - $idata = str_replace('{ADMINPASS}', $this->adminpass, $idata); |
|
97 | - $idata = str_replace('{IMAGEPATH}', $this->imgPath, $idata); |
|
98 | - $idata = str_replace('{IMAGEURL}', $this->imgUrl, $idata); |
|
99 | - $idata = str_replace('{FILEMANAGERPATH}', $this->fileManagerPath, $idata); |
|
100 | - $idata = str_replace('{MANAGERLANGUAGE}', $this->managerlanguage, $idata); |
|
101 | - $idata = str_replace('{AUTOTEMPLATELOGIC}', $this->autoTemplateLogic, $idata); |
|
102 | - /*$idata = str_replace('{VERSION}', $modx_version, $idata);*/ |
|
103 | - |
|
104 | - // Replace custom placeholders |
|
105 | - foreach($custom_placeholders as $key=>$val) { |
|
106 | - if (strpos($idata, '{'.$key.'}') !== false) { |
|
107 | - $idata = str_replace('{'.$key.'}', $val, $idata); |
|
108 | - } |
|
109 | - } |
|
110 | - |
|
111 | - $sql_array = explode("\n\n", $idata); |
|
112 | - |
|
113 | - $num = 0; |
|
114 | - foreach($sql_array as $sql_entry) { |
|
115 | - $sql_do = trim($sql_entry, "\r\n; "); |
|
116 | - |
|
117 | - if (preg_match('/^\#/', $sql_do)) continue; |
|
118 | - |
|
119 | - // strip out comments and \n for mysql 3.x |
|
120 | - if ($this->dbVersion <4.0) { |
|
121 | - $sql_do = preg_replace("~COMMENT.*[^']?'.*[^']?'~","",$sql_do); |
|
122 | - $sql_do = str_replace('\r', "", $sql_do); |
|
123 | - $sql_do = str_replace('\n', "", $sql_do); |
|
124 | - } |
|
125 | - |
|
126 | - |
|
127 | - $num = $num + 1; |
|
128 | - if ($sql_do) mysqli_query($this->conn, $sql_do); |
|
129 | - if(mysqli_error($this->conn)) { |
|
130 | - // Ignore duplicate and drop errors - Raymond |
|
131 | - if ($this->ignoreDuplicateErrors){ |
|
132 | - if (mysqli_errno($this->conn) == 1060 || mysqli_errno($this->conn) == 1061 || mysqli_errno($this->conn) == 1062 ||mysqli_errno($this->conn) == 1091) continue; |
|
133 | - } |
|
134 | - // End Ignore duplicate |
|
135 | - $this->mysqlErrors[] = array("error" => mysqli_error($this->conn), "sql" => $sql_do); |
|
136 | - $this->installFailed = true; |
|
137 | - } |
|
138 | - } |
|
139 | - } |
|
90 | + } |
|
91 | + |
|
92 | + // replace {} tags |
|
93 | + $idata = str_replace('{PREFIX}', $this->prefix, $idata); |
|
94 | + $idata = str_replace('{ADMIN}', $this->adminname, $idata); |
|
95 | + $idata = str_replace('{ADMINEMAIL}', $this->adminemail, $idata); |
|
96 | + $idata = str_replace('{ADMINPASS}', $this->adminpass, $idata); |
|
97 | + $idata = str_replace('{IMAGEPATH}', $this->imgPath, $idata); |
|
98 | + $idata = str_replace('{IMAGEURL}', $this->imgUrl, $idata); |
|
99 | + $idata = str_replace('{FILEMANAGERPATH}', $this->fileManagerPath, $idata); |
|
100 | + $idata = str_replace('{MANAGERLANGUAGE}', $this->managerlanguage, $idata); |
|
101 | + $idata = str_replace('{AUTOTEMPLATELOGIC}', $this->autoTemplateLogic, $idata); |
|
102 | + /*$idata = str_replace('{VERSION}', $modx_version, $idata);*/ |
|
103 | + |
|
104 | + // Replace custom placeholders |
|
105 | + foreach($custom_placeholders as $key=>$val) { |
|
106 | + if (strpos($idata, '{'.$key.'}') !== false) { |
|
107 | + $idata = str_replace('{'.$key.'}', $val, $idata); |
|
108 | + } |
|
109 | + } |
|
110 | + |
|
111 | + $sql_array = explode("\n\n", $idata); |
|
112 | + |
|
113 | + $num = 0; |
|
114 | + foreach($sql_array as $sql_entry) { |
|
115 | + $sql_do = trim($sql_entry, "\r\n; "); |
|
116 | + |
|
117 | + if (preg_match('/^\#/', $sql_do)) continue; |
|
118 | + |
|
119 | + // strip out comments and \n for mysql 3.x |
|
120 | + if ($this->dbVersion <4.0) { |
|
121 | + $sql_do = preg_replace("~COMMENT.*[^']?'.*[^']?'~","",$sql_do); |
|
122 | + $sql_do = str_replace('\r', "", $sql_do); |
|
123 | + $sql_do = str_replace('\n', "", $sql_do); |
|
124 | + } |
|
125 | + |
|
126 | + |
|
127 | + $num = $num + 1; |
|
128 | + if ($sql_do) mysqli_query($this->conn, $sql_do); |
|
129 | + if(mysqli_error($this->conn)) { |
|
130 | + // Ignore duplicate and drop errors - Raymond |
|
131 | + if ($this->ignoreDuplicateErrors){ |
|
132 | + if (mysqli_errno($this->conn) == 1060 || mysqli_errno($this->conn) == 1061 || mysqli_errno($this->conn) == 1062 ||mysqli_errno($this->conn) == 1091) continue; |
|
133 | + } |
|
134 | + // End Ignore duplicate |
|
135 | + $this->mysqlErrors[] = array("error" => mysqli_error($this->conn), "sql" => $sql_do); |
|
136 | + $this->installFailed = true; |
|
137 | + } |
|
138 | + } |
|
139 | + } |
|
140 | 140 | |
141 | 141 | public function close() { |
142 | - mysqli_close($this->conn); |
|
143 | - } |
|
142 | + mysqli_close($this->conn); |
|
143 | + } |
|
144 | 144 | } |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | // MySQL Dump Parser |
4 | 4 | // SNUFFKIN/ Alex 2004 |
5 | 5 | |
6 | -class SqlParser { |
|
6 | +class SqlParser{ |
|
7 | 7 | public $host; |
8 | 8 | public $dbname; |
9 | 9 | public $prefix; |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | public $ignoreDuplicateErrors; |
29 | 29 | public $autoTemplateLogic; |
30 | 30 | |
31 | - public function __construct($host, $user, $password, $db, $prefix='modx_', $adminname, $adminemail, $adminpass, $connection_charset= 'utf8', $managerlanguage='english', $connection_method = 'SET CHARACTER SET', $auto_template_logic = 'parent') { |
|
31 | + public function __construct($host, $user, $password, $db, $prefix = 'modx_', $adminname, $adminemail, $adminpass, $connection_charset = 'utf8', $managerlanguage = 'english', $connection_method = 'SET CHARACTER SET', $auto_template_logic = 'parent'){ |
|
32 | 32 | $this->host = $host; |
33 | 33 | $this->dbname = $db; |
34 | 34 | $this->prefix = $prefix; |
@@ -44,28 +44,28 @@ discard block |
||
44 | 44 | $this->autoTemplateLogic = $auto_template_logic; |
45 | 45 | } |
46 | 46 | |
47 | - public function connect() { |
|
47 | + public function connect(){ |
|
48 | 48 | $this->conn = mysqli_connect($this->host, $this->user, $this->password); |
49 | 49 | mysqli_select_db($this->conn, $this->dbname); |
50 | 50 | if (function_exists('mysqli_set_charset')) mysqli_set_charset($this->conn, $this->connection_charset); |
51 | 51 | |
52 | 52 | $this->dbVersion = 3.23; // assume version 3.23 |
53 | - if(function_exists("mysqli_get_server_info")) { |
|
53 | + if (function_exists("mysqli_get_server_info")) { |
|
54 | 54 | $ver = mysqli_get_server_info($this->conn); |
55 | - $this->dbMODx = version_compare($ver,"4.0.2"); |
|
55 | + $this->dbMODx = version_compare($ver, "4.0.2"); |
|
56 | 56 | $this->dbVersion = (float) $ver; // Typecasting (float) instead of floatval() [PHP < 4.2] |
57 | 57 | } |
58 | 58 | |
59 | - mysqli_query($this->conn,"{$this->connection_method} {$this->connection_charset}"); |
|
59 | + mysqli_query($this->conn, "{$this->connection_method} {$this->connection_charset}"); |
|
60 | 60 | } |
61 | 61 | |
62 | - public function process($filename) { |
|
62 | + public function process($filename){ |
|
63 | 63 | global $custom_placeholders; |
64 | 64 | |
65 | 65 | // check to make sure file exists |
66 | 66 | if (!file_exists($filename)) { |
67 | 67 | $this->mysqlErrors[] = array("error" => "File '$filename' not found"); |
68 | - $this->installFailed = true ; |
|
68 | + $this->installFailed = true; |
|
69 | 69 | return false; |
70 | 70 | } |
71 | 71 | |
@@ -82,10 +82,10 @@ discard block |
||
82 | 82 | // check if in upgrade mode |
83 | 83 | if ($this->mode === 'upd') { |
84 | 84 | // remove non-upgradeable parts |
85 | - $s = strpos($idata,'non-upgrade-able[['); |
|
86 | - $e = strpos($idata,']]non-upgrade-able') + 17; |
|
87 | - if($s && $e) { |
|
88 | - $idata = str_replace(substr($idata, $s,$e-$s),' Removed non upgradeable items', $idata); |
|
85 | + $s = strpos($idata, 'non-upgrade-able[['); |
|
86 | + $e = strpos($idata, ']]non-upgrade-able') + 17; |
|
87 | + if ($s && $e) { |
|
88 | + $idata = str_replace(substr($idata, $s, $e - $s), ' Removed non upgradeable items', $idata); |
|
89 | 89 | } |
90 | 90 | } |
91 | 91 | |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | /*$idata = str_replace('{VERSION}', $modx_version, $idata);*/ |
103 | 103 | |
104 | 104 | // Replace custom placeholders |
105 | - foreach($custom_placeholders as $key=>$val) { |
|
105 | + foreach ($custom_placeholders as $key=>$val) { |
|
106 | 106 | if (strpos($idata, '{'.$key.'}') !== false) { |
107 | 107 | $idata = str_replace('{'.$key.'}', $val, $idata); |
108 | 108 | } |
@@ -111,14 +111,14 @@ discard block |
||
111 | 111 | $sql_array = explode("\n\n", $idata); |
112 | 112 | |
113 | 113 | $num = 0; |
114 | - foreach($sql_array as $sql_entry) { |
|
114 | + foreach ($sql_array as $sql_entry) { |
|
115 | 115 | $sql_do = trim($sql_entry, "\r\n; "); |
116 | 116 | |
117 | 117 | if (preg_match('/^\#/', $sql_do)) continue; |
118 | 118 | |
119 | 119 | // strip out comments and \n for mysql 3.x |
120 | - if ($this->dbVersion <4.0) { |
|
121 | - $sql_do = preg_replace("~COMMENT.*[^']?'.*[^']?'~","",$sql_do); |
|
120 | + if ($this->dbVersion < 4.0) { |
|
121 | + $sql_do = preg_replace("~COMMENT.*[^']?'.*[^']?'~", "", $sql_do); |
|
122 | 122 | $sql_do = str_replace('\r', "", $sql_do); |
123 | 123 | $sql_do = str_replace('\n', "", $sql_do); |
124 | 124 | } |
@@ -126,10 +126,10 @@ discard block |
||
126 | 126 | |
127 | 127 | $num = $num + 1; |
128 | 128 | if ($sql_do) mysqli_query($this->conn, $sql_do); |
129 | - if(mysqli_error($this->conn)) { |
|
129 | + if (mysqli_error($this->conn)) { |
|
130 | 130 | // Ignore duplicate and drop errors - Raymond |
131 | - if ($this->ignoreDuplicateErrors){ |
|
132 | - if (mysqli_errno($this->conn) == 1060 || mysqli_errno($this->conn) == 1061 || mysqli_errno($this->conn) == 1062 ||mysqli_errno($this->conn) == 1091) continue; |
|
131 | + if ($this->ignoreDuplicateErrors) { |
|
132 | + if (mysqli_errno($this->conn) == 1060 || mysqli_errno($this->conn) == 1061 || mysqli_errno($this->conn) == 1062 || mysqli_errno($this->conn) == 1091) continue; |
|
133 | 133 | } |
134 | 134 | // End Ignore duplicate |
135 | 135 | $this->mysqlErrors[] = array("error" => mysqli_error($this->conn), "sql" => $sql_do); |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | } |
139 | 139 | } |
140 | 140 | |
141 | - public function close() { |
|
141 | + public function close(){ |
|
142 | 142 | mysqli_close($this->conn); |
143 | 143 | } |
144 | 144 | } |
@@ -3,7 +3,8 @@ discard block |
||
3 | 3 | // MySQL Dump Parser |
4 | 4 | // SNUFFKIN/ Alex 2004 |
5 | 5 | |
6 | -class SqlParser { |
|
6 | +class SqlParser |
|
7 | +{ |
|
7 | 8 | public $host; |
8 | 9 | public $dbname; |
9 | 10 | public $prefix; |
@@ -28,7 +29,8 @@ discard block |
||
28 | 29 | public $ignoreDuplicateErrors; |
29 | 30 | public $autoTemplateLogic; |
30 | 31 | |
31 | - public function __construct($host, $user, $password, $db, $prefix='modx_', $adminname, $adminemail, $adminpass, $connection_charset= 'utf8', $managerlanguage='english', $connection_method = 'SET CHARACTER SET', $auto_template_logic = 'parent') { |
|
32 | + public function __construct($host, $user, $password, $db, $prefix='modx_', $adminname, $adminemail, $adminpass, $connection_charset= 'utf8', $managerlanguage='english', $connection_method = 'SET CHARACTER SET', $auto_template_logic = 'parent') |
|
33 | + { |
|
32 | 34 | $this->host = $host; |
33 | 35 | $this->dbname = $db; |
34 | 36 | $this->prefix = $prefix; |
@@ -44,10 +46,13 @@ discard block |
||
44 | 46 | $this->autoTemplateLogic = $auto_template_logic; |
45 | 47 | } |
46 | 48 | |
47 | - public function connect() { |
|
49 | + public function connect() |
|
50 | + { |
|
48 | 51 | $this->conn = mysqli_connect($this->host, $this->user, $this->password); |
49 | 52 | mysqli_select_db($this->conn, $this->dbname); |
50 | - if (function_exists('mysqli_set_charset')) mysqli_set_charset($this->conn, $this->connection_charset); |
|
53 | + if (function_exists('mysqli_set_charset')) { |
|
54 | + mysqli_set_charset($this->conn, $this->connection_charset); |
|
55 | + } |
|
51 | 56 | |
52 | 57 | $this->dbVersion = 3.23; // assume version 3.23 |
53 | 58 | if(function_exists("mysqli_get_server_info")) { |
@@ -59,7 +64,8 @@ discard block |
||
59 | 64 | mysqli_query($this->conn,"{$this->connection_method} {$this->connection_charset}"); |
60 | 65 | } |
61 | 66 | |
62 | - public function process($filename) { |
|
67 | + public function process($filename) |
|
68 | + { |
|
63 | 69 | global $custom_placeholders; |
64 | 70 | |
65 | 71 | // check to make sure file exists |
@@ -114,7 +120,9 @@ discard block |
||
114 | 120 | foreach($sql_array as $sql_entry) { |
115 | 121 | $sql_do = trim($sql_entry, "\r\n; "); |
116 | 122 | |
117 | - if (preg_match('/^\#/', $sql_do)) continue; |
|
123 | + if (preg_match('/^\#/', $sql_do)) { |
|
124 | + continue; |
|
125 | + } |
|
118 | 126 | |
119 | 127 | // strip out comments and \n for mysql 3.x |
120 | 128 | if ($this->dbVersion <4.0) { |
@@ -125,11 +133,15 @@ discard block |
||
125 | 133 | |
126 | 134 | |
127 | 135 | $num = $num + 1; |
128 | - if ($sql_do) mysqli_query($this->conn, $sql_do); |
|
136 | + if ($sql_do) { |
|
137 | + mysqli_query($this->conn, $sql_do); |
|
138 | + } |
|
129 | 139 | if(mysqli_error($this->conn)) { |
130 | 140 | // Ignore duplicate and drop errors - Raymond |
131 | - if ($this->ignoreDuplicateErrors){ |
|
132 | - if (mysqli_errno($this->conn) == 1060 || mysqli_errno($this->conn) == 1061 || mysqli_errno($this->conn) == 1062 ||mysqli_errno($this->conn) == 1091) continue; |
|
141 | + if ($this->ignoreDuplicateErrors) { |
|
142 | + if (mysqli_errno($this->conn) == 1060 || mysqli_errno($this->conn) == 1061 || mysqli_errno($this->conn) == 1062 ||mysqli_errno($this->conn) == 1091) { |
|
143 | + continue; |
|
144 | + } |
|
133 | 145 | } |
134 | 146 | // End Ignore duplicate |
135 | 147 | $this->mysqlErrors[] = array("error" => mysqli_error($this->conn), "sql" => $sql_do); |
@@ -138,7 +150,8 @@ discard block |
||
138 | 150 | } |
139 | 151 | } |
140 | 152 | |
141 | - public function close() { |
|
153 | + public function close() |
|
154 | + { |
|
142 | 155 | mysqli_close($this->conn); |
143 | 156 | } |
144 | 157 | } |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | 'sv' => 'svenska' |
38 | 38 | ); |
39 | 39 | $_langISO6391 = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); |
40 | -if (! empty($_langFiles[$_langISO6391])) { |
|
40 | +if (!empty($_langFiles[$_langISO6391])) { |
|
41 | 41 | $install_language = $_langFiles[$_langISO6391]; |
42 | 42 | } |
43 | 43 | |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | } |
52 | 52 | # load language file |
53 | 53 | require_once 'lang/english.inc.php'; // As fallback |
54 | -require_once 'lang/' . $install_language . '.inc.php'; |
|
54 | +require_once 'lang/'.$install_language.'.inc.php'; |
|
55 | 55 | |
56 | 56 | $manager_language = $install_language; |
57 | 57 |
@@ -15,7 +15,7 @@ |
||
15 | 15 | * |
16 | 16 | * Please commit your language changes on Transifex (https://www.transifex.com/projects/p/modx-evolution/) or on GitHub (https://github.com/modxcms/evolution). |
17 | 17 | */ |
18 | -setlocale (LC_ALL, 'ru_RU.UTF-8'); |
|
18 | +setlocale(LC_ALL, 'ru_RU.UTF-8'); |
|
19 | 19 | $_lang["agree_to_terms"] = 'Согласиться с условиями лицензии и приступить к установке'; |
20 | 20 | $_lang["alert_database_test_connection"] = 'Вы должны создать базу данных или выбрать базу данных для проверки!'; |
21 | 21 | $_lang["alert_database_test_connection_failed"] = 'Неудачная проверка выбранной базы данных!'; |
@@ -1,21 +1,21 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | //:: EVO Installer Setup file |
3 | 3 | //::::::::::::::::::::::::::::::::::::::::: |
4 | -if (is_file($base_path . 'assets/cache/siteManager.php')) { |
|
5 | - include_once($base_path . 'assets/cache/siteManager.php'); |
|
4 | +if (is_file($base_path.'assets/cache/siteManager.php')) { |
|
5 | + include_once($base_path.'assets/cache/siteManager.php'); |
|
6 | 6 | } |
7 | 7 | if (!defined('MGR_DIR')) { |
8 | 8 | define('MGR_DIR', 'manager'); |
9 | 9 | } |
10 | 10 | |
11 | -require_once(dirname(dirname(dirname(__DIR__))) . '/' . MGR_DIR . '/includes/version.inc.php'); |
|
11 | +require_once(dirname(dirname(dirname(__DIR__))).'/'.MGR_DIR.'/includes/version.inc.php'); |
|
12 | 12 | |
13 | -$chunkPath = $base_path . 'install/assets/chunks'; |
|
14 | -$snippetPath = $base_path . 'install/assets/snippets'; |
|
15 | -$pluginPath = $base_path . 'install/assets/plugins'; |
|
16 | -$modulePath = $base_path . 'install/assets/modules'; |
|
17 | -$templatePath = $base_path . 'install/assets/templates'; |
|
18 | -$tvPath = $base_path . 'install/assets/tvs'; |
|
13 | +$chunkPath = $base_path.'install/assets/chunks'; |
|
14 | +$snippetPath = $base_path.'install/assets/snippets'; |
|
15 | +$pluginPath = $base_path.'install/assets/plugins'; |
|
16 | +$modulePath = $base_path.'install/assets/modules'; |
|
17 | +$templatePath = $base_path.'install/assets/templates'; |
|
18 | +$tvPath = $base_path.'install/assets/tvs'; |
|
19 | 19 | |
20 | 20 | // setup Template template files - array : name, description, type - 0:file or 1:content, parameters, category |
21 | 21 | $mt = &$moduleTemplates; |
@@ -28,8 +28,7 @@ discard block |
||
28 | 28 | $params = parse_docblock($templatePath, $tplfile); |
29 | 29 | if (is_array($params) && (count($params) > 0)) { |
30 | 30 | $description = empty($params['version']) ? $params['description'] : "<strong>{$params['version']}</strong> {$params['description']}"; |
31 | - $mt[] = array |
|
32 | - ( |
|
31 | + $mt[] = array( |
|
33 | 32 | $params['name'], |
34 | 33 | $description, |
35 | 34 | // Don't think this is gonna be used ... but adding it just in case 'type' |
@@ -149,7 +148,7 @@ discard block |
||
149 | 148 | $params['modx_category'], |
150 | 149 | $params['legacy_names'], |
151 | 150 | array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : false, |
152 | - (int)$params['disabled'] |
|
151 | + (int) $params['disabled'] |
|
153 | 152 | ); |
154 | 153 | } |
155 | 154 | } |
@@ -174,12 +173,12 @@ discard block |
||
174 | 173 | "$modulePath/{$params['filename']}", |
175 | 174 | $params['properties'], |
176 | 175 | $params['guid'], |
177 | - (int)$params['shareparams'], |
|
176 | + (int) $params['shareparams'], |
|
178 | 177 | $params['modx_category'], |
179 | 178 | array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : false |
180 | 179 | ); |
181 | 180 | } |
182 | - if ((int)$params['shareparams'] || !empty($params['dependencies'])) { |
|
181 | + if ((int) $params['shareparams'] || !empty($params['dependencies'])) { |
|
183 | 182 | $dependencies = explode(',', $params['dependencies']); |
184 | 183 | foreach ($dependencies as $dependency) { |
185 | 184 | $dependency = explode(':', $dependency); |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | * |
173 | 173 | * @param string $param |
174 | 174 | * @param array $tvsArray |
175 | - * @return mixed |
|
175 | + * @return string |
|
176 | 176 | */ |
177 | 177 | function parseTvValues($param, $tvsArray) |
178 | 178 | { |
@@ -566,7 +566,7 @@ discard block |
||
566 | 566 | /** |
567 | 567 | * returns an array if a delimiter is present. returns array is a recordset is present |
568 | 568 | * |
569 | - * @param $src |
|
569 | + * @param string $src |
|
570 | 570 | * @param string $delim |
571 | 571 | * @param string $type |
572 | 572 | * @param bool $columns |
@@ -1022,7 +1022,7 @@ discard block |
||
1022 | 1022 | |
1023 | 1023 | if (! function_exists('ParseIntputOptions')) { |
1024 | 1024 | /** |
1025 | - * @param string|array|mysqli_result $v |
|
1025 | + * @param string $v |
|
1026 | 1026 | * @return array |
1027 | 1027 | */ |
1028 | 1028 | function ParseIntputOptions($v) |
@@ -573,7 +573,8 @@ |
||
573 | 573 | * @return array|string |
574 | 574 | */ |
575 | 575 | function parseInput($src, $delim = "||", $type = "string", $columns = true) |
576 | - { // type can be: string, array |
|
576 | + { |
|
577 | +// type can be: string, array |
|
577 | 578 | $modx = evolutionCMS(); |
578 | 579 | if ($modx->getDatabase()->isResult($src)) { |
579 | 580 | // must be a recordset |
@@ -51,7 +51,7 @@ |
||
51 | 51 | $modx->setPlaceholder($rvKey, $rvValue); |
52 | 52 | } |
53 | 53 | $param = $modx->mergePlaceholderContent($param); |
54 | - $rs = $modx->getDatabase()->query("SELECT $param;"); |
|
54 | + $rs = $modx->getDatabase()->query("select $param;"); |
|
55 | 55 | $output = $rs; |
56 | 56 | break; |
57 | 57 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (! function_exists('ProcessTVCommand')) { |
|
3 | +if (!function_exists('ProcessTVCommand')) { |
|
4 | 4 | /** |
5 | 5 | * @param string $value |
6 | 6 | * @param string $name |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | function ProcessTVCommand($value, $name = '', $docid = '', $src = 'docform', $tvsArray = array()) |
13 | 13 | { |
14 | 14 | $modx = evolutionCMS(); |
15 | - $docid = (int)$docid > 0 ? (int)$docid : $modx->documentIdentifier; |
|
15 | + $docid = (int) $docid > 0 ? (int) $docid : $modx->documentIdentifier; |
|
16 | 16 | $nvalue = trim($value); |
17 | 17 | if (substr($nvalue, 0, 1) != '@') { |
18 | 18 | return $value; |
@@ -77,8 +77,8 @@ discard block |
||
77 | 77 | // if an inherited value is found and if there is content following the @INHERIT binding |
78 | 78 | // remove @INHERIT and output that following content. This content could contain other |
79 | 79 | // @ bindings, that are processed in the next step |
80 | - if ((string)$tv['value'] !== '' && !preg_match('%^@INHERIT[\s\n\r]*$%im', $tv['value'])) { |
|
81 | - $output = trim(str_replace('@INHERIT', '', (string)$tv['value'])); |
|
80 | + if ((string) $tv['value'] !== '' && !preg_match('%^@INHERIT[\s\n\r]*$%im', $tv['value'])) { |
|
81 | + $output = trim(str_replace('@INHERIT', '', (string) $tv['value'])); |
|
82 | 82 | break 2; |
83 | 83 | } |
84 | 84 | } |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | |
87 | 87 | case 'DIRECTORY' : |
88 | 88 | $files = array(); |
89 | - $path = $modx->config['base_path'] . $param; |
|
89 | + $path = $modx->config['base_path'].$param; |
|
90 | 90 | if (substr($path, -1, 1) != '/') { |
91 | 91 | $path .= '/'; |
92 | 92 | } |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | } |
118 | 118 | } |
119 | 119 | |
120 | -if (! function_exists('ProcessFile')) { |
|
120 | +if (!function_exists('ProcessFile')) { |
|
121 | 121 | /** |
122 | 122 | * @param $file |
123 | 123 | * @return string |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | } |
135 | 135 | } |
136 | 136 | |
137 | -if (! function_exists('ParseCommand')) { |
|
137 | +if (!function_exists('ParseCommand')) { |
|
138 | 138 | /** |
139 | 139 | * ParseCommand - separate @ cmd from params |
140 | 140 | * |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | |
156 | 156 | $binding_array = array(); |
157 | 157 | foreach ($BINDINGS as $cmd) { |
158 | - if (strpos($binding_string, '@' . $cmd) === 0) { |
|
158 | + if (strpos($binding_string, '@'.$cmd) === 0) { |
|
159 | 159 | $code = substr($binding_string, strlen($cmd) + 1); |
160 | 160 | $binding_array = array($cmd, trim($code)); |
161 | 161 | break; |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | } |
167 | 167 | } |
168 | 168 | |
169 | -if (! function_exists('parseTvValues')) { |
|
169 | +if (!function_exists('parseTvValues')) { |
|
170 | 170 | /** |
171 | 171 | * Parse MODX Template-Variables |
172 | 172 | * |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | } |
198 | 198 | } |
199 | 199 | |
200 | -if (! function_exists('getTVDisplayFormat')) { |
|
200 | +if (!function_exists('getTVDisplayFormat')) { |
|
201 | 201 | /** |
202 | 202 | * @param string $name |
203 | 203 | * @param string $value |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | $o = ''; |
216 | 216 | |
217 | 217 | // process any TV commands in value |
218 | - $docid = (int)$docid > 0 ? (int)$docid : $modx->documentIdentifier; |
|
218 | + $docid = (int) $docid > 0 ? (int) $docid : $modx->documentIdentifier; |
|
219 | 219 | $value = ProcessTVCommand($value, $name, $docid); |
220 | 220 | |
221 | 221 | $params = array(); |
@@ -254,12 +254,12 @@ discard block |
||
254 | 254 | $attr['align'] = $params['align']; |
255 | 255 | } |
256 | 256 | foreach ($attr as $k => $v) { |
257 | - $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : ''); |
|
257 | + $attributes .= ($v ? ' '.$k.'="'.$v.'"' : ''); |
|
258 | 258 | } |
259 | - $attributes .= ' ' . $params['attrib']; |
|
259 | + $attributes .= ' '.$params['attrib']; |
|
260 | 260 | |
261 | 261 | // Output the image with attributes |
262 | - $o .= '<img' . rtrim($attributes) . ' />'; |
|
262 | + $o .= '<img'.rtrim($attributes).' />'; |
|
263 | 263 | } |
264 | 264 | } |
265 | 265 | break; |
@@ -331,12 +331,12 @@ discard block |
||
331 | 331 | 'target' => $params['target'], |
332 | 332 | ); |
333 | 333 | foreach ($attr as $k => $v) { |
334 | - $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : ''); |
|
334 | + $attributes .= ($v ? ' '.$k.'="'.$v.'"' : ''); |
|
335 | 335 | } |
336 | - $attributes .= ' ' . $params['attrib']; // add extra |
|
336 | + $attributes .= ' '.$params['attrib']; // add extra |
|
337 | 337 | |
338 | 338 | // Output the link |
339 | - $o .= '<a' . rtrim($attributes) . '>' . ($params['text'] ? $modx->getPhpCompat()->htmlspecialchars($params['text']) : $name) . '</a>'; |
|
339 | + $o .= '<a'.rtrim($attributes).'>'.($params['text'] ? $modx->getPhpCompat()->htmlspecialchars($params['text']) : $name).'</a>'; |
|
340 | 340 | } |
341 | 341 | } |
342 | 342 | break; |
@@ -362,12 +362,12 @@ discard block |
||
362 | 362 | 'style' => $params['style'], |
363 | 363 | ); |
364 | 364 | foreach ($attr as $k => $v) { |
365 | - $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : ''); |
|
365 | + $attributes .= ($v ? ' '.$k.'="'.$v.'"' : ''); |
|
366 | 366 | } |
367 | - $attributes .= ' ' . $params['attrib']; // add extra |
|
367 | + $attributes .= ' '.$params['attrib']; // add extra |
|
368 | 368 | |
369 | 369 | // Output the HTML Tag |
370 | - $o .= '<' . $tagname . rtrim($attributes) . '>' . $tagvalue . '</' . $tagname . '>'; |
|
370 | + $o .= '<'.$tagname.rtrim($attributes).'>'.$tagvalue.'</'.$tagname.'>'; |
|
371 | 371 | } |
372 | 372 | break; |
373 | 373 | |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | $w = $params['w'] ? $params['w'] : '100%'; |
377 | 377 | $h = $params['h'] ? $params['h'] : '400px'; |
378 | 378 | $richtexteditor = $params['edt'] ? $params['edt'] : ""; |
379 | - $o = '<div class="MODX_RichTextWidget"><textarea id="' . $id . '" name="' . $id . '" style="width:' . $w . '; height:' . $h . ';">'; |
|
379 | + $o = '<div class="MODX_RichTextWidget"><textarea id="'.$id.'" name="'.$id.'" style="width:'.$w.'; height:'.$h.';">'; |
|
380 | 380 | $o .= $modx->getPhpCompat()->htmlspecialchars($value); |
381 | 381 | $o .= '</textarea></div>'; |
382 | 382 | $replace_richtext = array($id); |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | |
404 | 404 | case "viewport": |
405 | 405 | $value = parseInput($value); |
406 | - $id = '_' . time(); |
|
406 | + $id = '_'.time(); |
|
407 | 407 | if (!$params['vpid']) { |
408 | 408 | $params['vpid'] = $id; |
409 | 409 | } |
@@ -417,35 +417,35 @@ discard block |
||
417 | 417 | $h = "100%"; |
418 | 418 | } |
419 | 419 | if ($params['asize'] == 'Yes' || ($params['awidth'] == 'Yes' && $params['aheight'] == 'Yes')) { |
420 | - $autoMode = "3"; //both |
|
420 | + $autoMode = "3"; //both |
|
421 | 421 | } else { |
422 | 422 | if ($params['awidth'] == 'Yes') { |
423 | 423 | $autoMode = "1"; //width only |
424 | 424 | } else { |
425 | 425 | if ($params['aheight'] == 'Yes') { |
426 | - $autoMode = "2"; //height only |
|
426 | + $autoMode = "2"; //height only |
|
427 | 427 | } |
428 | 428 | } |
429 | 429 | } |
430 | 430 | |
431 | - $modx->regClientStartupScript(MODX_MANAGER_URL . "media/script/bin/viewport.js", array( |
|
431 | + $modx->regClientStartupScript(MODX_MANAGER_URL."media/script/bin/viewport.js", array( |
|
432 | 432 | 'name' => 'viewport', |
433 | 433 | 'version' => '0', |
434 | 434 | 'plaintext' => false |
435 | 435 | )); |
436 | - $o = $sTag . " id='" . $params['vpid'] . "' name='" . $params['vpid'] . "' "; |
|
436 | + $o = $sTag." id='".$params['vpid']."' name='".$params['vpid']."' "; |
|
437 | 437 | if ($params['class']) { |
438 | - $o .= " class='" . $params['class'] . "' "; |
|
438 | + $o .= " class='".$params['class']."' "; |
|
439 | 439 | } |
440 | 440 | if ($params['style']) { |
441 | - $o .= " style='" . $params['style'] . "' "; |
|
441 | + $o .= " style='".$params['style']."' "; |
|
442 | 442 | } |
443 | 443 | if ($params['attrib']) { |
444 | - $o .= $params['attrib'] . " "; |
|
444 | + $o .= $params['attrib']." "; |
|
445 | 445 | } |
446 | - $o .= "scrolling='" . ($params['sbar'] == 'No' ? "no" : ($params['sbar'] == 'Yes' ? "yes" : "auto")) . "' "; |
|
447 | - $o .= "src='" . $value . "' frameborder='" . $params['borsize'] . "' "; |
|
448 | - $o .= "onload=\"window.setTimeout('ResizeViewPort(\\'" . $params['vpid'] . "\\'," . $autoMode . ")',100);\" width='" . $w . "' height='" . $h . "' "; |
|
446 | + $o .= "scrolling='".($params['sbar'] == 'No' ? "no" : ($params['sbar'] == 'Yes' ? "yes" : "auto"))."' "; |
|
447 | + $o .= "src='".$value."' frameborder='".$params['borsize']."' "; |
|
448 | + $o .= "onload=\"window.setTimeout('ResizeViewPort(\\'".$params['vpid']."\\',".$autoMode.")',100);\" width='".$w."' height='".$h."' "; |
|
449 | 449 | $o .= ">"; |
450 | 450 | $o .= $eTag; |
451 | 451 | break; |
@@ -497,16 +497,16 @@ discard block |
||
497 | 497 | $o = ''; |
498 | 498 | /* If we are loading a file */ |
499 | 499 | if (substr($params['output'], 0, 5) == "@FILE") { |
500 | - $file_name = MODX_BASE_PATH . trim(substr($params['output'], 6)); |
|
500 | + $file_name = MODX_BASE_PATH.trim(substr($params['output'], 6)); |
|
501 | 501 | if (!file_exists($file_name)) { |
502 | - $widget_output = $file_name . ' does not exist'; |
|
502 | + $widget_output = $file_name.' does not exist'; |
|
503 | 503 | } else { |
504 | 504 | $widget_output = file_get_contents($file_name); |
505 | 505 | } |
506 | 506 | } elseif (substr($params['output'], 0, 8) == '@INCLUDE') { |
507 | - $file_name = MODX_BASE_PATH . trim(substr($params['output'], 9)); |
|
507 | + $file_name = MODX_BASE_PATH.trim(substr($params['output'], 9)); |
|
508 | 508 | if (!file_exists($file_name)) { |
509 | - $widget_output = $file_name . ' does not exist'; |
|
509 | + $widget_output = $file_name.' does not exist'; |
|
510 | 510 | } else { |
511 | 511 | /* The included file needs to set $widget_output. Can be string, array, object */ |
512 | 512 | include $file_name; |
@@ -548,7 +548,7 @@ discard block |
||
548 | 548 | } |
549 | 549 | } |
550 | 550 | |
551 | -if (! function_exists('decodeParamValue')) { |
|
551 | +if (!function_exists('decodeParamValue')) { |
|
552 | 552 | /** |
553 | 553 | * @param string $s |
554 | 554 | * @return string |
@@ -561,7 +561,7 @@ discard block |
||
561 | 561 | } |
562 | 562 | } |
563 | 563 | |
564 | -if (! function_exists('parseInput')) { |
|
564 | +if (!function_exists('parseInput')) { |
|
565 | 565 | /** |
566 | 566 | * returns an array if a delimiter is present. returns array is a recordset is present |
567 | 567 | * |
@@ -593,7 +593,7 @@ discard block |
||
593 | 593 | } |
594 | 594 | } |
595 | 595 | |
596 | -if (! function_exists('getUnixtimeFromDateString')) { |
|
596 | +if (!function_exists('getUnixtimeFromDateString')) { |
|
597 | 597 | /** |
598 | 598 | * @param string $value |
599 | 599 | * @return bool|false|int |
@@ -621,7 +621,7 @@ discard block |
||
621 | 621 | } |
622 | 622 | } |
623 | 623 | |
624 | -if (! function_exists('renderFormElement')) { |
|
624 | +if (!function_exists('renderFormElement')) { |
|
625 | 625 | /** |
626 | 626 | * DISPLAY FORM ELEMENTS |
627 | 627 | * |
@@ -644,7 +644,7 @@ discard block |
||
644 | 644 | $field_style = '', |
645 | 645 | $row = array(), |
646 | 646 | $tvsArray = array() |
647 | - ) { |
|
647 | + ){ |
|
648 | 648 | $modx = evolutionCMS(); |
649 | 649 | global $_style; |
650 | 650 | global $_lang; |
@@ -664,22 +664,22 @@ discard block |
||
664 | 664 | |
665 | 665 | case "text": // handler for regular text boxes |
666 | 666 | case "rawtext"; // non-htmlentity converted text boxes |
667 | - $field_html .= '<input type="text" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $modx->getPhpCompat()->htmlspecialchars($field_value) . '" ' . $field_style . ' tvtype="' . $field_type . '" onchange="documentDirty=true;" style="width:100%" />'; |
|
667 | + $field_html .= '<input type="text" id="tv'.$field_id.'" name="tv'.$field_id.'" value="'.$modx->getPhpCompat()->htmlspecialchars($field_value).'" '.$field_style.' tvtype="'.$field_type.'" onchange="documentDirty=true;" style="width:100%" />'; |
|
668 | 668 | break; |
669 | 669 | case "email": // handles email input fields |
670 | - $field_html .= '<input type="email" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $modx->getPhpCompat()->htmlspecialchars($field_value) . '" ' . $field_style . ' tvtype="' . $field_type . '" onchange="documentDirty=true;" style="width:100%"/>'; |
|
670 | + $field_html .= '<input type="email" id="tv'.$field_id.'" name="tv'.$field_id.'" value="'.$modx->getPhpCompat()->htmlspecialchars($field_value).'" '.$field_style.' tvtype="'.$field_type.'" onchange="documentDirty=true;" style="width:100%"/>'; |
|
671 | 671 | break; |
672 | 672 | case "number": // handles the input of numbers |
673 | - $field_html .= '<input type="number" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $modx->getPhpCompat()->htmlspecialchars($field_value) . '" ' . $field_style . ' tvtype="' . $field_type . '" onchange="documentDirty=true;" style="width:100%" onkeyup="this.value=this.value.replace(/[^\d-,.+]/,\'\')"/>'; |
|
673 | + $field_html .= '<input type="number" id="tv'.$field_id.'" name="tv'.$field_id.'" value="'.$modx->getPhpCompat()->htmlspecialchars($field_value).'" '.$field_style.' tvtype="'.$field_type.'" onchange="documentDirty=true;" style="width:100%" onkeyup="this.value=this.value.replace(/[^\d-,.+]/,\'\')"/>'; |
|
674 | 674 | break; |
675 | 675 | case "textareamini": // handler for textarea mini boxes |
676 | - $field_html .= '<textarea id="tv' . $field_id . '" name="tv' . $field_id . '" cols="40" rows="5" onchange="documentDirty=true;" style="width:100%">' . $modx->getPhpCompat()->htmlspecialchars($field_value) . '</textarea>'; |
|
676 | + $field_html .= '<textarea id="tv'.$field_id.'" name="tv'.$field_id.'" cols="40" rows="5" onchange="documentDirty=true;" style="width:100%">'.$modx->getPhpCompat()->htmlspecialchars($field_value).'</textarea>'; |
|
677 | 677 | break; |
678 | 678 | case "textarea": // handler for textarea boxes |
679 | 679 | case "rawtextarea": // non-htmlentity convertex textarea boxes |
680 | 680 | case "htmlarea": // handler for textarea boxes (deprecated) |
681 | 681 | case "richtext": // handler for textarea boxes |
682 | - $field_html .= '<textarea id="tv' . $field_id . '" name="tv' . $field_id . '" cols="40" rows="15" onchange="documentDirty=true;" style="width:100%">' . $modx->getPhpCompat()->htmlspecialchars($field_value) . '</textarea>'; |
|
682 | + $field_html .= '<textarea id="tv'.$field_id.'" name="tv'.$field_id.'" cols="40" rows="15" onchange="documentDirty=true;" style="width:100%">'.$modx->getPhpCompat()->htmlspecialchars($field_value).'</textarea>'; |
|
683 | 683 | break; |
684 | 684 | case "date": |
685 | 685 | $field_id = str_replace(array( |
@@ -689,12 +689,12 @@ discard block |
||
689 | 689 | if ($field_value == '') { |
690 | 690 | $field_value = 0; |
691 | 691 | } |
692 | - $field_html .= '<input id="tv' . $field_id . '" name="tv' . $field_id . '" class="DatePicker" type="text" value="' . ($field_value == 0 || !isset($field_value) ? "" : $field_value) . '" onblur="documentDirty=true;" />'; |
|
693 | - $field_html .= ' <a onclick="document.forms[\'mutate\'].elements[\'tv' . $field_id . '\'].value=\'\';document.forms[\'mutate\'].elements[\'tv' . $field_id . '\'].onblur(); return true;" onmouseover="window.status=\'clear the date\'; return true;" onmouseout="window.status=\'\'; return true;" style="cursor:pointer; cursor:hand"><i class="' . $_style["actions_calendar_delete"] . '"></i></a>'; |
|
692 | + $field_html .= '<input id="tv'.$field_id.'" name="tv'.$field_id.'" class="DatePicker" type="text" value="'.($field_value == 0 || !isset($field_value) ? "" : $field_value).'" onblur="documentDirty=true;" />'; |
|
693 | + $field_html .= ' <a onclick="document.forms[\'mutate\'].elements[\'tv'.$field_id.'\'].value=\'\';document.forms[\'mutate\'].elements[\'tv'.$field_id.'\'].onblur(); return true;" onmouseover="window.status=\'clear the date\'; return true;" onmouseout="window.status=\'\'; return true;" style="cursor:pointer; cursor:hand"><i class="'.$_style["actions_calendar_delete"].'"></i></a>'; |
|
694 | 694 | |
695 | 695 | break; |
696 | 696 | case "dropdown": // handler for select boxes |
697 | - $field_html .= '<select id="tv' . $field_id . '" name="tv' . $field_id . '" size="1" onchange="documentDirty=true;">'; |
|
697 | + $field_html .= '<select id="tv'.$field_id.'" name="tv'.$field_id.'" size="1" onchange="documentDirty=true;">'; |
|
698 | 698 | $index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform', |
699 | 699 | $tvsArray)); |
700 | 700 | while (list($item, $itemvalue) = each($index_list)) { |
@@ -702,12 +702,12 @@ discard block |
||
702 | 702 | if (strlen($itemvalue) == 0) { |
703 | 703 | $itemvalue = $item; |
704 | 704 | } |
705 | - $field_html .= '<option value="' . $modx->getPhpCompat()->htmlspecialchars($itemvalue) . '"' . ($itemvalue == $field_value ? ' selected="selected"' : '') . '>' . $modx->getPhpCompat()->htmlspecialchars($item) . '</option>'; |
|
705 | + $field_html .= '<option value="'.$modx->getPhpCompat()->htmlspecialchars($itemvalue).'"'.($itemvalue == $field_value ? ' selected="selected"' : '').'>'.$modx->getPhpCompat()->htmlspecialchars($item).'</option>'; |
|
706 | 706 | } |
707 | 707 | $field_html .= "</select>"; |
708 | 708 | break; |
709 | 709 | case "listbox": // handler for select boxes |
710 | - $field_html .= '<select id="tv' . $field_id . '" name="tv' . $field_id . '" onchange="documentDirty=true;" size="8">'; |
|
710 | + $field_html .= '<select id="tv'.$field_id.'" name="tv'.$field_id.'" onchange="documentDirty=true;" size="8">'; |
|
711 | 711 | $index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform', |
712 | 712 | $tvsArray)); |
713 | 713 | while (list($item, $itemvalue) = each($index_list)) { |
@@ -715,13 +715,13 @@ discard block |
||
715 | 715 | if (strlen($itemvalue) == 0) { |
716 | 716 | $itemvalue = $item; |
717 | 717 | } |
718 | - $field_html .= '<option value="' . $modx->getPhpCompat()->htmlspecialchars($itemvalue) . '"' . ($itemvalue == $field_value ? ' selected="selected"' : '') . '>' . $modx->getPhpCompat()->htmlspecialchars($item) . '</option>'; |
|
718 | + $field_html .= '<option value="'.$modx->getPhpCompat()->htmlspecialchars($itemvalue).'"'.($itemvalue == $field_value ? ' selected="selected"' : '').'>'.$modx->getPhpCompat()->htmlspecialchars($item).'</option>'; |
|
719 | 719 | } |
720 | 720 | $field_html .= "</select>"; |
721 | 721 | break; |
722 | 722 | case "listbox-multiple": // handler for select boxes where you can choose multiple items |
723 | 723 | $field_value = explode("||", $field_value); |
724 | - $field_html .= '<select id="tv' . $field_id . '" name="tv' . $field_id . '[]" multiple="multiple" onchange="documentDirty=true;" size="8">'; |
|
724 | + $field_html .= '<select id="tv'.$field_id.'" name="tv'.$field_id.'[]" multiple="multiple" onchange="documentDirty=true;" size="8">'; |
|
725 | 725 | $index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform', |
726 | 726 | $tvsArray)); |
727 | 727 | while (list($item, $itemvalue) = each($index_list)) { |
@@ -729,8 +729,8 @@ discard block |
||
729 | 729 | if (strlen($itemvalue) == 0) { |
730 | 730 | $itemvalue = $item; |
731 | 731 | } |
732 | - $field_html .= '<option value="' . $modx->getPhpCompat()->htmlspecialchars($itemvalue) . '"' . (in_array($itemvalue, |
|
733 | - $field_value) ? ' selected="selected"' : '') . '>' . $modx->getPhpCompat()->htmlspecialchars($item) . '</option>'; |
|
732 | + $field_html .= '<option value="'.$modx->getPhpCompat()->htmlspecialchars($itemvalue).'"'.(in_array($itemvalue, |
|
733 | + $field_value) ? ' selected="selected"' : '').'>'.$modx->getPhpCompat()->htmlspecialchars($item).'</option>'; |
|
734 | 734 | } |
735 | 735 | $field_html .= "</select>"; |
736 | 736 | break; |
@@ -742,17 +742,17 @@ discard block |
||
742 | 742 | 'ftp://' => 'ftp://', |
743 | 743 | 'mailto:' => 'mailto:' |
744 | 744 | ); |
745 | - $field_html = '<table border="0" cellspacing="0" cellpadding="0"><tr><td><select id="tv' . $field_id . '_prefix" name="tv' . $field_id . '_prefix" onchange="documentDirty=true;">'; |
|
745 | + $field_html = '<table border="0" cellspacing="0" cellpadding="0"><tr><td><select id="tv'.$field_id.'_prefix" name="tv'.$field_id.'_prefix" onchange="documentDirty=true;">'; |
|
746 | 746 | foreach ($urls as $k => $v) { |
747 | 747 | if (strpos($field_value, $v) === false) { |
748 | - $field_html .= '<option value="' . $v . '">' . $k . '</option>'; |
|
748 | + $field_html .= '<option value="'.$v.'">'.$k.'</option>'; |
|
749 | 749 | } else { |
750 | 750 | $field_value = str_replace($v, '', $field_value); |
751 | - $field_html .= '<option value="' . $v . '" selected="selected">' . $k . '</option>'; |
|
751 | + $field_html .= '<option value="'.$v.'" selected="selected">'.$k.'</option>'; |
|
752 | 752 | } |
753 | 753 | } |
754 | 754 | $field_html .= '</select></td><td>'; |
755 | - $field_html .= '<input type="text" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $modx->getPhpCompat()->htmlspecialchars($field_value) . '" width="100" ' . $field_style . ' onchange="documentDirty=true;" /></td></tr></table>'; |
|
755 | + $field_html .= '<input type="text" id="tv'.$field_id.'" name="tv'.$field_id.'" value="'.$modx->getPhpCompat()->htmlspecialchars($field_value).'" width="100" '.$field_style.' onchange="documentDirty=true;" /></td></tr></table>'; |
|
756 | 756 | break; |
757 | 757 | case 'checkbox': // handles check boxes |
758 | 758 | $values = !is_array($field_value) ? explode('||', $field_value) : $field_value; |
@@ -794,7 +794,7 @@ discard block |
||
794 | 794 | if (strlen($itemvalue) == 0) { |
795 | 795 | $itemvalue = $item; |
796 | 796 | } |
797 | - $field_html .= '<input type="radio" value="' . $modx->getPhpCompat()->htmlspecialchars($itemvalue) . '" id="tv_' . $i . '" name="tv' . $field_id . '" ' . ($itemvalue == $field_value ? 'checked="checked"' : '') . ' onchange="documentDirty=true;" /><label for="tv_' . $i . '" class="radio">' . $item . '</label><br />'; |
|
797 | + $field_html .= '<input type="radio" value="'.$modx->getPhpCompat()->htmlspecialchars($itemvalue).'" id="tv_'.$i.'" name="tv'.$field_id.'" '.($itemvalue == $field_value ? 'checked="checked"' : '').' onchange="documentDirty=true;" /><label for="tv_'.$i.'" class="radio">'.$item.'</label><br />'; |
|
798 | 798 | $i++; |
799 | 799 | } |
800 | 800 | break; |
@@ -824,13 +824,13 @@ discard block |
||
824 | 824 | lastImageCtrl = ctrl; |
825 | 825 | var w = screen.width * 0.5; |
826 | 826 | var h = screen.height * 0.5; |
827 | - OpenServerBrowser('" . MODX_MANAGER_URL . "media/browser/{$which_browser}/browser.php?Type=images', w, h); |
|
827 | + OpenServerBrowser('" . MODX_MANAGER_URL."media/browser/{$which_browser}/browser.php?Type=images', w, h); |
|
828 | 828 | } |
829 | 829 | function BrowseFileServer(ctrl) { |
830 | 830 | lastFileCtrl = ctrl; |
831 | 831 | var w = screen.width * 0.5; |
832 | 832 | var h = screen.height * 0.5; |
833 | - OpenServerBrowser('" . MODX_MANAGER_URL . "media/browser/{$which_browser}/browser.php?Type=files', w, h); |
|
833 | + OpenServerBrowser('".MODX_MANAGER_URL."media/browser/{$which_browser}/browser.php?Type=files', w, h); |
|
834 | 834 | } |
835 | 835 | function SetUrlChange(el) { |
836 | 836 | if ('createEvent' in document) { |
@@ -864,7 +864,7 @@ discard block |
||
864 | 864 | </script>"; |
865 | 865 | $ResourceManagerLoaded = true; |
866 | 866 | } |
867 | - $field_html .= '<input type="text" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $field_value . '" ' . $field_style . ' onchange="documentDirty=true;" /><input type="button" value="' . $_lang['insert'] . '" onclick="BrowseServer(\'tv' . $field_id . '\')" />'; |
|
867 | + $field_html .= '<input type="text" id="tv'.$field_id.'" name="tv'.$field_id.'" value="'.$field_value.'" '.$field_style.' onchange="documentDirty=true;" /><input type="button" value="'.$_lang['insert'].'" onclick="BrowseServer(\'tv'.$field_id.'\')" />'; |
|
868 | 868 | break; |
869 | 869 | case "file": // handles the input of file uploads |
870 | 870 | /* Modified by Timon for use with resource browser */ |
@@ -894,13 +894,13 @@ discard block |
||
894 | 894 | lastImageCtrl = ctrl; |
895 | 895 | var w = screen.width * 0.5; |
896 | 896 | var h = screen.height * 0.5; |
897 | - OpenServerBrowser('" . MODX_MANAGER_URL . "media/browser/{$which_browser}/browser.php?Type=images', w, h); |
|
897 | + OpenServerBrowser('" . MODX_MANAGER_URL."media/browser/{$which_browser}/browser.php?Type=images', w, h); |
|
898 | 898 | } |
899 | 899 | function BrowseFileServer(ctrl) { |
900 | 900 | lastFileCtrl = ctrl; |
901 | 901 | var w = screen.width * 0.5; |
902 | 902 | var h = screen.height * 0.5; |
903 | - OpenServerBrowser('" . MODX_MANAGER_URL . "media/browser/{$which_browser}/browser.php?Type=files', w, h); |
|
903 | + OpenServerBrowser('".MODX_MANAGER_URL."media/browser/{$which_browser}/browser.php?Type=files', w, h); |
|
904 | 904 | } |
905 | 905 | function SetUrlChange(el) { |
906 | 906 | if ('createEvent' in document) { |
@@ -934,7 +934,7 @@ discard block |
||
934 | 934 | </script>"; |
935 | 935 | $ResourceManagerLoaded = true; |
936 | 936 | } |
937 | - $field_html .= '<input type="text" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $field_value . '" ' . $field_style . ' onchange="documentDirty=true;" /><input type="button" value="' . $_lang['insert'] . '" onclick="BrowseFileServer(\'tv' . $field_id . '\')" />'; |
|
937 | + $field_html .= '<input type="text" id="tv'.$field_id.'" name="tv'.$field_id.'" value="'.$field_value.'" '.$field_style.' onchange="documentDirty=true;" /><input type="button" value="'.$_lang['insert'].'" onclick="BrowseFileServer(\'tv'.$field_id.'\')" />'; |
|
938 | 938 | |
939 | 939 | break; |
940 | 940 | |
@@ -942,16 +942,16 @@ discard block |
||
942 | 942 | $custom_output = ''; |
943 | 943 | /* If we are loading a file */ |
944 | 944 | if (substr($field_elements, 0, 5) == "@FILE") { |
945 | - $file_name = MODX_BASE_PATH . trim(substr($field_elements, 6)); |
|
945 | + $file_name = MODX_BASE_PATH.trim(substr($field_elements, 6)); |
|
946 | 946 | if (!file_exists($file_name)) { |
947 | - $custom_output = $file_name . ' does not exist'; |
|
947 | + $custom_output = $file_name.' does not exist'; |
|
948 | 948 | } else { |
949 | 949 | $custom_output = file_get_contents($file_name); |
950 | 950 | } |
951 | 951 | } elseif (substr($field_elements, 0, 8) == '@INCLUDE') { |
952 | - $file_name = MODX_BASE_PATH . trim(substr($field_elements, 9)); |
|
952 | + $file_name = MODX_BASE_PATH.trim(substr($field_elements, 9)); |
|
953 | 953 | if (!file_exists($file_name)) { |
954 | - $custom_output = $file_name . ' does not exist'; |
|
954 | + $custom_output = $file_name.' does not exist'; |
|
955 | 955 | } else { |
956 | 956 | ob_start(); |
957 | 957 | include $file_name; |
@@ -962,7 +962,7 @@ discard block |
||
962 | 962 | $chunk_name = trim(substr($field_elements, 7)); |
963 | 963 | $chunk_body = $modx->getChunk($chunk_name); |
964 | 964 | if ($chunk_body == false) { |
965 | - $custom_output = $_lang['chunk_no_exist'] . '(' . $_lang['htmlsnippet_name'] . ':' . $chunk_name . ')'; |
|
965 | + $custom_output = $_lang['chunk_no_exist'].'('.$_lang['htmlsnippet_name'].':'.$chunk_name.')'; |
|
966 | 966 | } else { |
967 | 967 | $custom_output = $chunk_body; |
968 | 968 | } |
@@ -987,15 +987,15 @@ discard block |
||
987 | 987 | break; |
988 | 988 | |
989 | 989 | default: // the default handler -- for errors, mostly |
990 | - $field_html .= '<input type="text" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $modx->getPhpCompat()->htmlspecialchars($field_value) . '" ' . $field_style . ' onchange="documentDirty=true;" />'; |
|
990 | + $field_html .= '<input type="text" id="tv'.$field_id.'" name="tv'.$field_id.'" value="'.$modx->getPhpCompat()->htmlspecialchars($field_value).'" '.$field_style.' onchange="documentDirty=true;" />'; |
|
991 | 991 | |
992 | 992 | } // end switch statement |
993 | 993 | } else { |
994 | 994 | $custom = explode(":", $field_type); |
995 | 995 | $custom_output = ''; |
996 | - $file_name = MODX_BASE_PATH . 'assets/tvs/' . $custom['1'] . '/' . $custom['1'] . '.customtv.php'; |
|
996 | + $file_name = MODX_BASE_PATH.'assets/tvs/'.$custom['1'].'/'.$custom['1'].'.customtv.php'; |
|
997 | 997 | if (!file_exists($file_name)) { |
998 | - $custom_output = $file_name . ' does not exist'; |
|
998 | + $custom_output = $file_name.' does not exist'; |
|
999 | 999 | } else { |
1000 | 1000 | ob_start(); |
1001 | 1001 | include $file_name; |
@@ -1019,7 +1019,7 @@ discard block |
||
1019 | 1019 | } // end renderFormElement function |
1020 | 1020 | } |
1021 | 1021 | |
1022 | -if (! function_exists('ParseIntputOptions')) { |
|
1022 | +if (!function_exists('ParseIntputOptions')) { |
|
1023 | 1023 | /** |
1024 | 1024 | * @param string|array|mysqli_result $v |
1025 | 1025 | * @return array |
@@ -237,7 +237,7 @@ |
||
237 | 237 | /** |
238 | 238 | * build siteCache file |
239 | 239 | * @param DocumentParser $modx |
240 | - * @return boolean success |
|
240 | + * @return null|boolean success |
|
241 | 241 | */ |
242 | 242 | public function buildCache($modx) |
243 | 243 | { |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | if (isset($this->aliases[$id])) { |
101 | 101 | if ($this->aliasVisible[$id] == 1) { |
102 | 102 | if ($path != '') { |
103 | - $path = $this->aliases[$id] . '/' . $path; |
|
103 | + $path = $this->aliases[$id].'/'.$path; |
|
104 | 104 | } else { |
105 | 105 | $path = $this->aliases[$id]; |
106 | 106 | } |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | $modx->messageQuit("Cache path not set."); |
125 | 125 | } |
126 | 126 | |
127 | - $files = glob(realpath($this->cachePath) . '/*.pageCache.php'); |
|
127 | + $files = glob(realpath($this->cachePath).'/*.pageCache.php'); |
|
128 | 128 | $filesincache = count($files); |
129 | 129 | $deletedfiles = array(); |
130 | 130 | while ($file = array_shift($files)) { |
@@ -159,9 +159,9 @@ discard block |
||
159 | 159 | if (isset($opcache)) { |
160 | 160 | echo '<p>Opcache empty.</p>'; |
161 | 161 | } |
162 | - echo '<p>' . $_lang['cache_files_deleted'] . '</p><ul>'; |
|
162 | + echo '<p>'.$_lang['cache_files_deleted'].'</p><ul>'; |
|
163 | 163 | foreach ($deletedfiles as $deletedfile) { |
164 | - echo '<li>' . $deletedfile . '</li>'; |
|
164 | + echo '<li>'.$deletedfile.'</li>'; |
|
165 | 165 | } |
166 | 166 | echo '</ul>'; |
167 | 167 | } |
@@ -180,11 +180,11 @@ discard block |
||
180 | 180 | |
181 | 181 | |
182 | 182 | // write the file |
183 | - $content = '<?php' . "\n"; |
|
184 | - $content .= '$recent_update=\'' . $this->request_time . '\';' . "\n"; |
|
185 | - $content .= '$cacheRefreshTime=\'' . $cacheRefreshTime . '\';' . "\n"; |
|
183 | + $content = '<?php'."\n"; |
|
184 | + $content .= '$recent_update=\''.$this->request_time.'\';'."\n"; |
|
185 | + $content .= '$cacheRefreshTime=\''.$cacheRefreshTime.'\';'."\n"; |
|
186 | 186 | |
187 | - $filename = $this->cachePath . '/sitePublishing.idx.php'; |
|
187 | + $filename = $this->cachePath.'/sitePublishing.idx.php'; |
|
188 | 188 | if (!$handle = fopen($filename, 'w')) { |
189 | 189 | exit("Cannot open file ({$filename}"); |
190 | 190 | } |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | $result = $modx->getDatabase()->select( |
211 | 211 | 'MIN(pub_date) AS minpub', |
212 | 212 | $modx->getDatabase()->getFullTableName('site_content'), |
213 | - 'pub_date>' . $this->request_time |
|
213 | + 'pub_date>'.$this->request_time |
|
214 | 214 | ); |
215 | 215 | if (!$result) { |
216 | 216 | echo "Couldn't determine next publish event!"; |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | $result = $modx->getDatabase()->select( |
225 | 225 | 'MIN(unpub_date) AS minunpub', |
226 | 226 | $modx->getDatabase()->getFullTableName('site_content'), |
227 | - 'unpub_date>' . $this->request_time |
|
227 | + 'unpub_date>'.$this->request_time |
|
228 | 228 | ); |
229 | 229 | if (!$result) { |
230 | 230 | echo "Couldn't determine next unpublish event!"; |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | $config = array(); |
265 | 265 | $content .= '$c=&$this->config;'; |
266 | 266 | while (list($key, $value) = $modx->getDatabase()->getRow($rs, 'num')) { |
267 | - $content .= '$c[\'' . $key . '\']="' . $this->escapeDoubleQuotes($value) . '";'; |
|
267 | + $content .= '$c[\''.$key.'\']="'.$this->escapeDoubleQuotes($value).'";'; |
|
268 | 268 | $config[$key] = $value; |
269 | 269 | } |
270 | 270 | |
@@ -285,8 +285,8 @@ discard block |
||
285 | 285 | $f['isfolder'] = 'c.isfolder'; |
286 | 286 | $f['alias_visible'] = 'c.alias_visible'; |
287 | 287 | $from = array(); |
288 | - $from[] = $modx->getDatabase()->getFullTableName('site_content') . ' c'; |
|
289 | - $from[] = 'LEFT JOIN ' . $modx->getDatabase()->getFullTableName('site_content') . ' p ON p.id=c.parent'; |
|
288 | + $from[] = $modx->getDatabase()->getFullTableName('site_content').' c'; |
|
289 | + $from[] = 'LEFT JOIN '.$modx->getDatabase()->getFullTableName('site_content').' p ON p.id=c.parent'; |
|
290 | 290 | $where = 'c.deleted=0 AND (c.isfolder=1 OR p.alias_visible=0)'; |
291 | 291 | $rs = $modx->getDatabase()->select($f, $from, $where, 'c.parent, c.menuindex'); |
292 | 292 | } else { |
@@ -308,16 +308,16 @@ discard block |
||
308 | 308 | $docid = $doc['id']; |
309 | 309 | if ($use_alias_path) { |
310 | 310 | $tmpPath = $this->getParents($doc['parent']); |
311 | - $alias = (strlen($tmpPath) > 0 ? "$tmpPath/" : '') . $doc['alias']; |
|
311 | + $alias = (strlen($tmpPath) > 0 ? "$tmpPath/" : '').$doc['alias']; |
|
312 | 312 | $key = $alias; |
313 | 313 | } else { |
314 | 314 | $key = $doc['alias']; |
315 | 315 | } |
316 | 316 | |
317 | 317 | $doc['path'] = $tmpPath; |
318 | - $content .= '$a[' . $docid . ']=array(\'id\'=>' . $docid . ',\'alias\'=>\'' . $doc['alias'] . '\',\'path\'=>\'' . $doc['path'] . '\',\'parent\'=>' . $doc['parent'] . ',\'isfolder\'=>' . $doc['isfolder'] . ',\'alias_visible\'=>' . $doc['alias_visible'] . ');'; |
|
319 | - $content .= '$d[\'' . $key . '\']=' . $docid . ';'; |
|
320 | - $content .= '$m[]=array(' . $doc['parent'] . '=>' . $docid . ');'; |
|
318 | + $content .= '$a['.$docid.']=array(\'id\'=>'.$docid.',\'alias\'=>\''.$doc['alias'].'\',\'path\'=>\''.$doc['path'].'\',\'parent\'=>'.$doc['parent'].',\'isfolder\'=>'.$doc['isfolder'].',\'alias_visible\'=>'.$doc['alias_visible'].');'; |
|
319 | + $content .= '$d[\''.$key.'\']='.$docid.';'; |
|
320 | + $content .= '$m[]=array('.$doc['parent'].'=>'.$docid.');'; |
|
321 | 321 | } |
322 | 322 | |
323 | 323 | // get content types |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | ); |
329 | 329 | $content .= '$c=&$this->contentTypes;'; |
330 | 330 | while ($doc = $modx->getDatabase()->getRow($rs)) { |
331 | - $content .= '$c[\'' . $doc['id'] . '\']=\'' . $doc['contentType'] . '\';'; |
|
331 | + $content .= '$c[\''.$doc['id'].'\']=\''.$doc['contentType'].'\';'; |
|
332 | 332 | } |
333 | 333 | |
334 | 334 | // WRITE Chunks to cache file |
@@ -338,30 +338,30 @@ discard block |
||
338 | 338 | if ($modx->config['minifyphp_incache']) { |
339 | 339 | $doc['snippet'] = $this->php_strip_whitespace($doc['snippet']); |
340 | 340 | } |
341 | - $content .= '$c[\'' . $doc['name'] . '\']=\'' . ($doc['disabled'] ? '' : $this->escapeSingleQuotes($doc['snippet'])) . '\';'; |
|
341 | + $content .= '$c[\''.$doc['name'].'\']=\''.($doc['disabled'] ? '' : $this->escapeSingleQuotes($doc['snippet'])).'\';'; |
|
342 | 342 | } |
343 | 343 | |
344 | 344 | // WRITE snippets to cache file |
345 | 345 | $f = 'ss.*, sm.properties as sharedproperties'; |
346 | - $from = $modx->getDatabase()->getFullTableName('site_snippets') . ' ss LEFT JOIN ' . |
|
347 | - $modx->getDatabase()->getFullTableName('site_modules') . ' sm on sm.guid=ss.moduleguid'; |
|
346 | + $from = $modx->getDatabase()->getFullTableName('site_snippets').' ss LEFT JOIN '. |
|
347 | + $modx->getDatabase()->getFullTableName('site_modules').' sm on sm.guid=ss.moduleguid'; |
|
348 | 348 | $rs = $modx->getDatabase()->select($f, $from); |
349 | 349 | $content .= '$s=&$this->snippetCache;'; |
350 | 350 | while ($row = $modx->getDatabase()->getRow($rs)) { |
351 | 351 | $key = $row['name']; |
352 | 352 | if ($row['disabled']) { |
353 | - $content .= '$s[\'' . $key . '\']=\'return false;\';'; |
|
353 | + $content .= '$s[\''.$key.'\']=\'return false;\';'; |
|
354 | 354 | } else { |
355 | 355 | $value = trim($row['snippet']); |
356 | 356 | if ($modx->config['minifyphp_incache']) { |
357 | 357 | $value = $this->php_strip_whitespace($value); |
358 | 358 | } |
359 | - $content .= '$s[\'' . $key . '\']=\'' . $this->escapeSingleQuotes($value) . '\';'; |
|
359 | + $content .= '$s[\''.$key.'\']=\''.$this->escapeSingleQuotes($value).'\';'; |
|
360 | 360 | $properties = $modx->parseProperties($row['properties']); |
361 | 361 | $sharedproperties = $modx->parseProperties($row['sharedproperties']); |
362 | 362 | $properties = array_merge($sharedproperties, $properties); |
363 | 363 | if (0 < count($properties)) { |
364 | - $content .= '$s[\'' . $key . 'Props\']=\'' . $this->escapeSingleQuotes(json_encode($properties)) . '\';'; |
|
364 | + $content .= '$s[\''.$key.'Props\']=\''.$this->escapeSingleQuotes(json_encode($properties)).'\';'; |
|
365 | 365 | } |
366 | 366 | } |
367 | 367 | } |
@@ -369,8 +369,8 @@ discard block |
||
369 | 369 | // WRITE plugins to cache file |
370 | 370 | $f = 'sp.*, sm.properties as sharedproperties'; |
371 | 371 | $from = array(); |
372 | - $from[] = $modx->getDatabase()->getFullTableName('site_plugins') . ' sp'; |
|
373 | - $from[] = 'LEFT JOIN ' . $modx->getDatabase()->getFullTableName('site_modules') . ' sm on sm.guid=sp.moduleguid'; |
|
372 | + $from[] = $modx->getDatabase()->getFullTableName('site_plugins').' sp'; |
|
373 | + $from[] = 'LEFT JOIN '.$modx->getDatabase()->getFullTableName('site_modules').' sm on sm.guid=sp.moduleguid'; |
|
374 | 374 | $rs = $modx->getDatabase()->select($f, $from, 'sp.disabled=0'); |
375 | 375 | $content .= '$p=&$this->pluginCache;'; |
376 | 376 | while ($row = $modx->getDatabase()->getRow($rs)) { |
@@ -379,13 +379,13 @@ discard block |
||
379 | 379 | if ($modx->config['minifyphp_incache']) { |
380 | 380 | $value = $this->php_strip_whitespace($value); |
381 | 381 | } |
382 | - $content .= '$p[\'' . $key . '\']=\'' . $this->escapeSingleQuotes($value) . '\';'; |
|
382 | + $content .= '$p[\''.$key.'\']=\''.$this->escapeSingleQuotes($value).'\';'; |
|
383 | 383 | if ($row['properties'] != '' || $row['sharedproperties'] != '') { |
384 | 384 | $properties = $modx->parseProperties($row['properties']); |
385 | 385 | $sharedproperties = $modx->parseProperties($row['sharedproperties']); |
386 | 386 | $properties = array_merge($sharedproperties, $properties); |
387 | 387 | if (0 < count($properties)) { |
388 | - $content .= '$p[\'' . $key . 'Props\']=\'' . $this->escapeSingleQuotes(json_encode($properties)) . '\';'; |
|
388 | + $content .= '$p[\''.$key.'Props\']=\''.$this->escapeSingleQuotes(json_encode($properties)).'\';'; |
|
389 | 389 | } |
390 | 390 | } |
391 | 391 | } |
@@ -393,9 +393,9 @@ discard block |
||
393 | 393 | // WRITE system event triggers |
394 | 394 | $f = 'sysevt.name as evtname, event.pluginid, plugin.name as pname'; |
395 | 395 | $from = array(); |
396 | - $from[] = $modx->getDatabase()->getFullTableName('system_eventnames') . ' sysevt'; |
|
397 | - $from[] = 'INNER JOIN ' . $modx->getDatabase()->getFullTableName('site_plugin_events') . ' event ON event.evtid=sysevt.id'; |
|
398 | - $from[] = 'INNER JOIN ' . $modx->getDatabase()->getFullTableName('site_plugins') . ' plugin ON plugin.id=event.pluginid'; |
|
396 | + $from[] = $modx->getDatabase()->getFullTableName('system_eventnames').' sysevt'; |
|
397 | + $from[] = 'INNER JOIN '.$modx->getDatabase()->getFullTableName('site_plugin_events').' event ON event.evtid=sysevt.id'; |
|
398 | + $from[] = 'INNER JOIN '.$modx->getDatabase()->getFullTableName('site_plugins').' plugin ON plugin.id=event.pluginid'; |
|
399 | 399 | $rs = $modx->getDatabase()->select($f, $from, 'plugin.disabled=0', 'sysevt.name, event.priority'); |
400 | 400 | $content .= '$e=&$this->pluginEvent;'; |
401 | 401 | $events = array(); |
@@ -408,14 +408,14 @@ discard block |
||
408 | 408 | } |
409 | 409 | foreach ($events as $evtname => $pluginnames) { |
410 | 410 | $events[$evtname] = $pluginnames; |
411 | - $content .= '$e[\'' . $evtname . '\']=array(\'' . implode('\',\'', |
|
412 | - $this->escapeSingleQuotes($pluginnames)) . '\');'; |
|
411 | + $content .= '$e[\''.$evtname.'\']=array(\''.implode('\',\'', |
|
412 | + $this->escapeSingleQuotes($pluginnames)).'\');'; |
|
413 | 413 | } |
414 | 414 | |
415 | 415 | $content .= "\n"; |
416 | 416 | |
417 | 417 | // close and write the file |
418 | - $filename = $this->cachePath . 'siteCache.idx.php'; |
|
418 | + $filename = $this->cachePath.'siteCache.idx.php'; |
|
419 | 419 | |
420 | 420 | // invoke OnBeforeCacheUpdate event |
421 | 421 | if ($modx) { |
@@ -426,8 +426,8 @@ discard block |
||
426 | 426 | exit("Cannot write main MODX cache file! Make sure the assets/cache directory is writable!"); |
427 | 427 | } |
428 | 428 | |
429 | - if (!is_file($this->cachePath . '/.htaccess')) { |
|
430 | - file_put_contents($this->cachePath . '/.htaccess', "order deny,allow\ndeny from all\n"); |
|
429 | + if (!is_file($this->cachePath.'/.htaccess')) { |
|
430 | + file_put_contents($this->cachePath.'/.htaccess', "order deny,allow\ndeny from all\n"); |
|
431 | 431 | } |
432 | 432 | |
433 | 433 | // invoke OnCacheUpdate event |
@@ -449,7 +449,7 @@ discard block |
||
449 | 449 | |
450 | 450 | $source = trim($source); |
451 | 451 | if (substr($source, 0, 5) !== '<?php') { |
452 | - $source = '<?php ' . $source; |
|
452 | + $source = '<?php '.$source; |
|
453 | 453 | } |
454 | 454 | |
455 | 455 | $tokens = token_get_all($source); |
@@ -507,7 +507,7 @@ discard block |
||
507 | 507 | } |
508 | 508 | } |
509 | 509 | $source = preg_replace(array('@^<\?php@i', '|\s+|', '|<!--|', '|-->|', '|-->\s+<!--|'), |
510 | - array('', ' ', "\n" . '<!--', '-->' . "\n", '-->' . "\n" . '<!--'), $_); |
|
510 | + array('', ' ', "\n".'<!--', '-->'."\n", '-->'."\n".'<!--'), $_); |
|
511 | 511 | $source = trim($source); |
512 | 512 | |
513 | 513 | return $source; |
@@ -82,7 +82,8 @@ discard block |
||
82 | 82 | * @return string |
83 | 83 | */ |
84 | 84 | public function getParents($id, $path = '') |
85 | - { // modx:returns child's parent |
|
85 | + { |
|
86 | +// modx:returns child's parent |
|
86 | 87 | $modx = evolutionCMS(); |
87 | 88 | if (empty($this->aliases)) { |
88 | 89 | $rs = $modx->getDatabase()->select( |
@@ -481,7 +482,8 @@ discard block |
||
481 | 482 | $_ = trim($_); |
482 | 483 | } |
483 | 484 | $lastChar = substr($_, -1); |
484 | - if (!in_array($lastChar, $chars)) {// ,320,327,288,284,289 |
|
485 | + if (!in_array($lastChar, $chars)) { |
|
486 | +// ,320,327,288,284,289 |
|
485 | 487 | if (!in_array($prev_token, |
486 | 488 | array(T_FOREACH, T_WHILE, T_FOR, T_BOOLEAN_AND, T_BOOLEAN_OR, T_DOUBLE_ARROW))) { |
487 | 489 | $_ .= ' '; |
@@ -63,7 +63,7 @@ |
||
63 | 63 | } |
64 | 64 | |
65 | 65 | /** |
66 | - * @return mixed |
|
66 | + * @return string |
|
67 | 67 | */ |
68 | 68 | public function getOutput() |
69 | 69 | { |
@@ -35,7 +35,7 @@ |
||
35 | 35 | if (is_array($SystemAlertMsgQueque)) { |
36 | 36 | $title = ''; |
37 | 37 | if ($this->name && $this->activePlugin) { |
38 | - $title = "<div><b>" . $this->activePlugin . "</b> - <span style='color:maroon;'>" . $this->name . "</span></div>"; |
|
38 | + $title = "<div><b>".$this->activePlugin."</b> - <span style='color:maroon;'>".$this->name."</span></div>"; |
|
39 | 39 | } |
40 | 40 | $SystemAlertMsgQueque[] = "$title<div style='margin-left:10px;margin-top:3px;'>$msg</div>"; |
41 | 41 | } |