@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if(!function_exists('createGUID')) { |
|
3 | +if (!function_exists('createGUID')) { |
|
4 | 4 | /** |
5 | 5 | * create globally unique identifiers (guid) |
6 | 6 | * |
@@ -8,22 +8,22 @@ discard block |
||
8 | 8 | */ |
9 | 9 | function createGUID() |
10 | 10 | { |
11 | - srand((double)microtime() * 1000000); |
|
11 | + srand((double) microtime() * 1000000); |
|
12 | 12 | $r = rand(); |
13 | - $u = uniqid(getmypid() . $r . (double)microtime() * 1000000, 1); |
|
13 | + $u = uniqid(getmypid().$r.(double) microtime() * 1000000, 1); |
|
14 | 14 | $m = md5($u); |
15 | 15 | |
16 | 16 | return $m; |
17 | 17 | } |
18 | 18 | } |
19 | 19 | |
20 | -if(!function_exists('generate_password')) { |
|
20 | +if (!function_exists('generate_password')) { |
|
21 | 21 | // Generate password |
22 | 22 | function generate_password($length = 10) |
23 | 23 | { |
24 | 24 | $allowable_characters = "abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789"; |
25 | 25 | $ps_len = strlen($allowable_characters); |
26 | - mt_srand((double)microtime() * 1000000); |
|
26 | + mt_srand((double) microtime() * 1000000); |
|
27 | 27 | $pass = ""; |
28 | 28 | for ($i = 0; $i < $length; $i++) { |
29 | 29 | $pass .= $allowable_characters[mt_rand(0, $ps_len - 1)]; |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | } |
34 | 34 | } |
35 | 35 | |
36 | -if (! function_exists('entities')) { |
|
36 | +if (!function_exists('entities')) { |
|
37 | 37 | /** |
38 | 38 | * @param string $string |
39 | 39 | * @param string $charset |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | } |
46 | 46 | } |
47 | 47 | |
48 | -if (! function_exists('get_by_key')) { |
|
48 | +if (!function_exists('get_by_key')) { |
|
49 | 49 | /** |
50 | 50 | * @param mixed $data |
51 | 51 | * @param string|int $key |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | if (is_array($data) && (is_int($key) || is_string($key)) && $key !== '' && array_key_exists($key, $data)) { |
60 | 60 | $out = $data[$key]; |
61 | 61 | } |
62 | - if (! empty($validate) && is_callable($validate)) { |
|
62 | + if (!empty($validate) && is_callable($validate)) { |
|
63 | 63 | $out = (($validate($out) === true) ? $out : $default); |
64 | 64 | } |
65 | 65 | return $out; |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | $pre = null, |
34 | 34 | $charset = '', |
35 | 35 | $connection_method = 'SET CHARACTER SET' |
36 | - ) { |
|
36 | + ){ |
|
37 | 37 | $this->config['host'] = $host ? $host : $GLOBALS['database_server']; |
38 | 38 | $this->config['dbase'] = $dbase ? $dbase : $GLOBALS['dbase']; |
39 | 39 | $this->config['user'] = $uid ? $uid : $GLOBALS['database_user']; |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | $ua = $modx->getPhpCompat()->htmlspecialchars($_SERVER['HTTP_USER_AGENT']); |
74 | 74 | $referer = $modx->getPhpCompat()->htmlspecialchars($_SERVER['HTTP_REFERER']); |
75 | 75 | $modx->sendmail(array( |
76 | - 'subject' => 'Missing to create the database connection! from ' . $modx->getPhpCompat()->entities($modx->config['site_name']), |
|
76 | + 'subject' => 'Missing to create the database connection! from '.$modx->getPhpCompat()->entities($modx->config['site_name']), |
|
77 | 77 | 'body' => "{$logtitle}\n{$request_uri}\n{$ua}\n{$referer}", |
78 | 78 | 'type' => 'text' |
79 | 79 | )); |
@@ -88,8 +88,8 @@ discard block |
||
88 | 88 | $tend = $modx->getMicroTime(); |
89 | 89 | $totaltime = $tend - $tstart; |
90 | 90 | if ($modx->dumpSQL) { |
91 | - $modx->queryCode .= "<fieldset style='text-align:left'><legend>Database connection</legend>" . sprintf("Database connection was created in %2.4f s", |
|
92 | - $totaltime) . "</fieldset><br />"; |
|
91 | + $modx->queryCode .= "<fieldset style='text-align:left'><legend>Database connection</legend>".sprintf("Database connection was created in %2.4f s", |
|
92 | + $totaltime)."</fieldset><br />"; |
|
93 | 93 | } |
94 | 94 | $this->conn->set_charset($this->config['charset']); |
95 | 95 | $this->isConnected = true; |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | if (1000 < $safeCount) { |
123 | 123 | exit("Too many loops '{$safeCount}'"); |
124 | 124 | } |
125 | - if ( ! ($this->conn instanceof mysqli)) { |
|
125 | + if (!($this->conn instanceof mysqli)) { |
|
126 | 126 | $this->connect(); |
127 | 127 | } |
128 | 128 | if (is_array($s)) { |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | public function query($sql, $watchError = true) |
149 | 149 | { |
150 | 150 | $modx = evolutionCMS(); |
151 | - if ( ! ($this->conn instanceof mysqli)) { |
|
151 | + if (!($this->conn instanceof mysqli)) { |
|
152 | 152 | $this->connect(); |
153 | 153 | } |
154 | 154 | $tStart = $modx->getMicroTime(); |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | case 1091: |
169 | 169 | break; |
170 | 170 | default: |
171 | - $modx->messageQuit('Execution of a query to the database failed - ' . $this->getLastError(), $sql); |
|
171 | + $modx->messageQuit('Execution of a query to the database failed - '.$this->getLastError(), $sql); |
|
172 | 172 | } |
173 | 173 | } else { |
174 | 174 | $tend = $modx->getMicroTime(); |
@@ -182,24 +182,24 @@ discard block |
||
182 | 182 | $debug_path[] = $line['function']; |
183 | 183 | } |
184 | 184 | $debug_path = implode(' > ', array_reverse($debug_path)); |
185 | - $modx->queryCode .= "<fieldset style='text-align:left'><legend>Query " . ($modx->executedQueries + 1) . " - " . sprintf("%2.2f ms", |
|
186 | - $totalTime * 1000) . "</legend>"; |
|
187 | - $modx->queryCode .= $sql . '<br><br>'; |
|
185 | + $modx->queryCode .= "<fieldset style='text-align:left'><legend>Query ".($modx->executedQueries + 1)." - ".sprintf("%2.2f ms", |
|
186 | + $totalTime * 1000)."</legend>"; |
|
187 | + $modx->queryCode .= $sql.'<br><br>'; |
|
188 | 188 | if ($modx->event->name) { |
189 | - $modx->queryCode .= 'Current Event => ' . $modx->event->name . '<br>'; |
|
189 | + $modx->queryCode .= 'Current Event => '.$modx->event->name.'<br>'; |
|
190 | 190 | } |
191 | 191 | if ($modx->event->activePlugin) { |
192 | - $modx->queryCode .= 'Current Plugin => ' . $modx->event->activePlugin . '<br>'; |
|
192 | + $modx->queryCode .= 'Current Plugin => '.$modx->event->activePlugin.'<br>'; |
|
193 | 193 | } |
194 | 194 | if ($modx->currentSnippet) { |
195 | - $modx->queryCode .= 'Current Snippet => ' . $modx->currentSnippet . '<br>'; |
|
195 | + $modx->queryCode .= 'Current Snippet => '.$modx->currentSnippet.'<br>'; |
|
196 | 196 | } |
197 | 197 | if (stripos($sql, 'select') === 0) { |
198 | - $modx->queryCode .= 'Record Count => ' . $this->getRecordCount($result) . '<br>'; |
|
198 | + $modx->queryCode .= 'Record Count => '.$this->getRecordCount($result).'<br>'; |
|
199 | 199 | } else { |
200 | - $modx->queryCode .= 'Affected Rows => ' . $this->getAffectedRows() . '<br>'; |
|
200 | + $modx->queryCode .= 'Affected Rows => '.$this->getAffectedRows().'<br>'; |
|
201 | 201 | } |
202 | - $modx->queryCode .= 'Functions Path => ' . $debug_path . '<br>'; |
|
202 | + $modx->queryCode .= 'Functions Path => '.$debug_path.'<br>'; |
|
203 | 203 | $modx->queryCode .= "</fieldset><br />"; |
204 | 204 | } |
205 | 205 | $modx->executedQueries++; |
@@ -306,9 +306,9 @@ discard block |
||
306 | 306 | if ($value === null || strtolower($value) === 'null') { |
307 | 307 | $f = 'NULL'; |
308 | 308 | } else { |
309 | - $f = "'" . $value . "'"; |
|
309 | + $f = "'".$value."'"; |
|
310 | 310 | } |
311 | - $fields[$key] = "`{$key}` = " . $f; |
|
311 | + $fields[$key] = "`{$key}` = ".$f; |
|
312 | 312 | } |
313 | 313 | $fields = implode(',', $fields); |
314 | 314 | } |
@@ -343,12 +343,12 @@ discard block |
||
343 | 343 | $this->query("INSERT INTO {$intotable} {$fields}"); |
344 | 344 | } else { |
345 | 345 | if (empty($fromtable)) { |
346 | - $fields = "(`" . implode("`, `", array_keys($fields)) . "`) VALUES('" . implode("', '", |
|
347 | - array_values($fields)) . "')"; |
|
346 | + $fields = "(`".implode("`, `", array_keys($fields))."`) VALUES('".implode("', '", |
|
347 | + array_values($fields))."')"; |
|
348 | 348 | $this->query("INSERT INTO {$intotable} {$fields}"); |
349 | 349 | } else { |
350 | 350 | $fromtable = $this->replaceFullTableName($fromtable); |
351 | - $fields = "(" . implode(",", array_keys($fields)) . ")"; |
|
351 | + $fields = "(".implode(",", array_keys($fields)).")"; |
|
352 | 352 | $where = trim($where); |
353 | 353 | $limit = trim($limit); |
354 | 354 | if ($where !== '' && stripos($where, 'WHERE') !== 0) { |
@@ -442,8 +442,8 @@ discard block |
||
442 | 442 | */ |
443 | 443 | public function getInsertId($conn = null) |
444 | 444 | { |
445 | - if (! ($conn instanceof mysqli)) { |
|
446 | - $conn =& $this->conn; |
|
445 | + if (!($conn instanceof mysqli)) { |
|
446 | + $conn = & $this->conn; |
|
447 | 447 | } |
448 | 448 | |
449 | 449 | return $conn->insert_id; |
@@ -455,8 +455,8 @@ discard block |
||
455 | 455 | */ |
456 | 456 | public function getAffectedRows($conn = null) |
457 | 457 | { |
458 | - if (! ($conn instanceof mysqli)) { |
|
459 | - $conn =& $this->conn; |
|
458 | + if (!($conn instanceof mysqli)) { |
|
459 | + $conn = & $this->conn; |
|
460 | 460 | } |
461 | 461 | |
462 | 462 | return $conn->affected_rows; |
@@ -468,8 +468,8 @@ discard block |
||
468 | 468 | */ |
469 | 469 | public function getLastError($conn = null) |
470 | 470 | { |
471 | - if (! ($conn instanceof mysqli)) { |
|
472 | - $conn =& $this->conn; |
|
471 | + if (!($conn instanceof mysqli)) { |
|
472 | + $conn = & $this->conn; |
|
473 | 473 | } |
474 | 474 | |
475 | 475 | return $conn->error; |
@@ -493,7 +493,7 @@ discard block |
||
493 | 493 | { |
494 | 494 | $out = false; |
495 | 495 | if ($ds instanceof mysqli_result) { |
496 | - switch($mode){ |
|
496 | + switch ($mode) { |
|
497 | 497 | case 'assoc': |
498 | 498 | $out = $ds->fetch_assoc(); |
499 | 499 | break; |
@@ -523,7 +523,7 @@ discard block |
||
523 | 523 | public function getColumn($name, $dsq) |
524 | 524 | { |
525 | 525 | $col = array(); |
526 | - if ( ! ($dsq instanceof mysqli_result)) { |
|
526 | + if (!($dsq instanceof mysqli_result)) { |
|
527 | 527 | $dsq = $this->query($dsq); |
528 | 528 | } |
529 | 529 | if ($dsq) { |
@@ -542,7 +542,7 @@ discard block |
||
542 | 542 | public function getColumnNames($dsq) |
543 | 543 | { |
544 | 544 | $names = array(); |
545 | - if ( ! ($dsq instanceof mysqli_result)) { |
|
545 | + if (!($dsq instanceof mysqli_result)) { |
|
546 | 546 | $dsq = $this->query($dsq); |
547 | 547 | } |
548 | 548 | if ($dsq) { |
@@ -562,7 +562,7 @@ discard block |
||
562 | 562 | public function getValue($dsq) |
563 | 563 | { |
564 | 564 | $out = false; |
565 | - if ( ! ($dsq instanceof mysqli_result)) { |
|
565 | + if (!($dsq instanceof mysqli_result)) { |
|
566 | 566 | $dsq = $this->query($dsq); |
567 | 567 | } |
568 | 568 | if ($dsq) { |
@@ -660,7 +660,7 @@ discard block |
||
660 | 660 | $tableName = trim($tableName); |
661 | 661 | $dbase = trim($this->config['dbase'], '`'); |
662 | 662 | $prefix = $this->config['table_prefix']; |
663 | - if ((bool)$force === true) { |
|
663 | + if ((bool) $force === true) { |
|
664 | 664 | $result = "`{$dbase}`.`{$prefix}{$tableName}`"; |
665 | 665 | } elseif (strpos($tableName, '[+prefix+]') !== false) { |
666 | 666 | $result = preg_replace('@\[\+prefix\+\]([0-9a-zA-Z_]+)@', "`{$dbase}`.`{$prefix}$1`", $tableName); |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | |
74 | 74 | // Set line feed |
75 | 75 | $lf = "\n"; |
76 | - $tempfile_path = $modx->config['base_path'] . 'assets/backup/temp.php'; |
|
76 | + $tempfile_path = $modx->config['base_path'].'assets/backup/temp.php'; |
|
77 | 77 | |
78 | 78 | $result = $modx->getDatabase()->query('SHOW TABLES'); |
79 | 79 | $tables = $this->result2Array(0, $result); |
@@ -86,15 +86,15 @@ discard block |
||
86 | 86 | |
87 | 87 | // Set header |
88 | 88 | $output = "#{$lf}"; |
89 | - $output .= "# " . addslashes($modx->getPhpCompat()->entities($modx->config['site_name'])) . " Database Dump{$lf}"; |
|
89 | + $output .= "# ".addslashes($modx->getPhpCompat()->entities($modx->config['site_name']))." Database Dump{$lf}"; |
|
90 | 90 | $output .= "# MODX Version:{$version['version']}{$lf}"; |
91 | 91 | $output .= "# {$lf}"; |
92 | 92 | $output .= "# Host: {$this->database_server}{$lf}"; |
93 | - $output .= "# Generation Time: " . $modx->toDateFormat(time()) . $lf; |
|
94 | - $output .= "# Server version: " . $modx->getDatabase()->getVersion() . $lf; |
|
95 | - $output .= "# PHP Version: " . phpversion() . $lf; |
|
93 | + $output .= "# Generation Time: ".$modx->toDateFormat(time()).$lf; |
|
94 | + $output .= "# Server version: ".$modx->getDatabase()->getVersion().$lf; |
|
95 | + $output .= "# PHP Version: ".phpversion().$lf; |
|
96 | 96 | $output .= "# Database: `{$this->dbname}`{$lf}"; |
97 | - $output .= "# Description: " . trim($_REQUEST['backup_title']) . "{$lf}"; |
|
97 | + $output .= "# Description: ".trim($_REQUEST['backup_title'])."{$lf}"; |
|
98 | 98 | $output .= "#"; |
99 | 99 | file_put_contents($tempfile_path, $output, FILE_APPEND | LOCK_EX); |
100 | 100 | $output = ''; |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | } |
114 | 114 | } |
115 | 115 | if ($callBack === 'snapshot') { |
116 | - if (!preg_match('@^' . $modx->getDatabase()->config['table_prefix'] . '@', $tblval)) { |
|
116 | + if (!preg_match('@^'.$modx->getDatabase()->config['table_prefix'].'@', $tblval)) { |
|
117 | 117 | continue; |
118 | 118 | } |
119 | 119 | } |
@@ -150,9 +150,9 @@ discard block |
||
150 | 150 | ), '\\n', $value); |
151 | 151 | $value = "'{$value}'"; |
152 | 152 | } |
153 | - $insertdump .= $value . ','; |
|
153 | + $insertdump .= $value.','; |
|
154 | 154 | } |
155 | - $output .= rtrim($insertdump, ',') . ");\n"; |
|
155 | + $output .= rtrim($insertdump, ',').");\n"; |
|
156 | 156 | if (1048576 < strlen($output)) { |
157 | 157 | file_put_contents($tempfile_path, $output, FILE_APPEND | LOCK_EX); |
158 | 158 | $output = ''; |
@@ -1,75 +1,75 @@ |
||
1 | 1 | <?php |
2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | 5 | |
6 | -if($modx->getManagerApi()->action!='8' && isset($_SESSION['mgrValidated'])){ |
|
6 | +if ($modx->getManagerApi()->action != '8' && isset($_SESSION['mgrValidated'])) { |
|
7 | 7 | |
8 | - $homeurl = $modx->makeUrl($manager_login_startup>0 ? $manager_login_startup:$site_start); |
|
8 | + $homeurl = $modx->makeUrl($manager_login_startup > 0 ? $manager_login_startup : $site_start); |
|
9 | 9 | $logouturl = MODX_MANAGER_URL.'index.php?a=8'; |
10 | 10 | |
11 | - $modx->setPlaceholder('modx_charset',$modx_manager_charset); |
|
12 | - $modx->setPlaceholder('theme',$manager_theme); |
|
11 | + $modx->setPlaceholder('modx_charset', $modx_manager_charset); |
|
12 | + $modx->setPlaceholder('theme', $manager_theme); |
|
13 | 13 | |
14 | - $modx->setPlaceholder('site_name',$modx->getPhpCompat()->entities($site_name)); |
|
15 | - $modx->setPlaceholder('logo_slogan',$_lang["logo_slogan"]); |
|
16 | - $modx->setPlaceholder('manager_lockout_message',$_lang["manager_lockout_message"]); |
|
14 | + $modx->setPlaceholder('site_name', $modx->getPhpCompat()->entities($site_name)); |
|
15 | + $modx->setPlaceholder('logo_slogan', $_lang["logo_slogan"]); |
|
16 | + $modx->setPlaceholder('manager_lockout_message', $_lang["manager_lockout_message"]); |
|
17 | 17 | |
18 | - $modx->setPlaceholder('home',$_lang["home"]); |
|
19 | - $modx->setPlaceholder('homeurl',$homeurl); |
|
20 | - $modx->setPlaceholder('logout',$_lang["logout"]); |
|
21 | - $modx->setPlaceholder('logouturl',$logouturl); |
|
22 | - $modx->setPlaceholder('manager_theme_url',MODX_MANAGER_URL . 'media/style/' . $modx->config['manager_theme'] . '/'); |
|
23 | - $modx->setPlaceholder('year',date('Y')); |
|
18 | + $modx->setPlaceholder('home', $_lang["home"]); |
|
19 | + $modx->setPlaceholder('homeurl', $homeurl); |
|
20 | + $modx->setPlaceholder('logout', $_lang["logout"]); |
|
21 | + $modx->setPlaceholder('logouturl', $logouturl); |
|
22 | + $modx->setPlaceholder('manager_theme_url', MODX_MANAGER_URL.'media/style/'.$modx->config['manager_theme'].'/'); |
|
23 | + $modx->setPlaceholder('year', date('Y')); |
|
24 | 24 | |
25 | 25 | // load template |
26 | - if(!isset($modx->config['manager_lockout_tpl']) || empty($modx->config['manager_lockout_tpl'])) { |
|
27 | - $modx->config['manager_lockout_tpl'] = MODX_MANAGER_PATH . 'media/style/common/manager.lockout.tpl'; |
|
26 | + if (!isset($modx->config['manager_lockout_tpl']) || empty($modx->config['manager_lockout_tpl'])) { |
|
27 | + $modx->config['manager_lockout_tpl'] = MODX_MANAGER_PATH.'media/style/common/manager.lockout.tpl'; |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | $target = $modx->config['manager_lockout_tpl']; |
31 | 31 | $target = str_replace('[+base_path+]', MODX_BASE_PATH, $target); |
32 | 32 | $target = $modx->mergeSettingsContent($target); |
33 | 33 | |
34 | - if(substr($target,0,1)==='@') { |
|
35 | - if(substr($target,0,6)==='@CHUNK') { |
|
36 | - $target = trim(substr($target,7)); |
|
34 | + if (substr($target, 0, 1) === '@') { |
|
35 | + if (substr($target, 0, 6) === '@CHUNK') { |
|
36 | + $target = trim(substr($target, 7)); |
|
37 | 37 | $lockout_tpl = $modx->getChunk($target); |
38 | 38 | } |
39 | - elseif(substr($target,0,5)==='@FILE') { |
|
40 | - $target = trim(substr($target,6)); |
|
39 | + elseif (substr($target, 0, 5) === '@FILE') { |
|
40 | + $target = trim(substr($target, 6)); |
|
41 | 41 | $lockout_tpl = file_get_contents($target); |
42 | 42 | } |
43 | 43 | } else { |
44 | 44 | $chunk = $modx->getChunk($target); |
45 | - if($chunk!==false && !empty($chunk)) { |
|
45 | + if ($chunk !== false && !empty($chunk)) { |
|
46 | 46 | $lockout_tpl = $chunk; |
47 | 47 | } |
48 | - elseif(is_file(MODX_BASE_PATH . $target)) { |
|
49 | - $target = MODX_BASE_PATH . $target; |
|
48 | + elseif (is_file(MODX_BASE_PATH.$target)) { |
|
49 | + $target = MODX_BASE_PATH.$target; |
|
50 | 50 | $lockout_tpl = file_get_contents($target); |
51 | 51 | } |
52 | - elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/manager.lockout.tpl')) { |
|
53 | - $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/manager.lockout.tpl'; |
|
52 | + elseif (is_file(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/manager.lockout.tpl')) { |
|
53 | + $target = MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/manager.lockout.tpl'; |
|
54 | 54 | $lockout_tpl = file_get_contents($target); |
55 | 55 | } |
56 | - elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/templates/actions/manager.lockout.tpl')) { |
|
57 | - $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/templates/actions/manager.lockout.tpl'; |
|
56 | + elseif (is_file(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/templates/actions/manager.lockout.tpl')) { |
|
57 | + $target = MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/templates/actions/manager.lockout.tpl'; |
|
58 | 58 | $login_tpl = file_get_contents($target); |
59 | 59 | } |
60 | - elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/manager.lockout.html')) { // ClipperCMS compatible |
|
61 | - $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/manager.lockout.html'; |
|
60 | + elseif (is_file(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/html/manager.lockout.html')) { // ClipperCMS compatible |
|
61 | + $target = MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/html/manager.lockout.html'; |
|
62 | 62 | $lockout_tpl = file_get_contents($target); |
63 | 63 | } |
64 | 64 | else { |
65 | - $target = MODX_MANAGER_PATH . 'media/style/common/manager.lockout.tpl'; |
|
65 | + $target = MODX_MANAGER_PATH.'media/style/common/manager.lockout.tpl'; |
|
66 | 66 | $lockout_tpl = file_get_contents($target); |
67 | 67 | } |
68 | 68 | } |
69 | 69 | |
70 | 70 | // merge placeholders |
71 | 71 | $lockout_tpl = $modx->mergePlaceholderContent($lockout_tpl); |
72 | - $regx = strpos($lockout_tpl,'[[+')!==false ? '~\[\[\+(.*?)\]\]~' : '~\[\+(.*?)\+\]~'; // little tweak for newer parsers |
|
72 | + $regx = strpos($lockout_tpl, '[[+') !== false ? '~\[\[\+(.*?)\]\]~' : '~\[\+(.*?)\+\]~'; // little tweak for newer parsers |
|
73 | 73 | $lockout_tpl = preg_replace($regx, '', $lockout_tpl); //cleanup |
74 | 74 | |
75 | 75 | echo $lockout_tpl; |
@@ -1,12 +1,12 @@ discard block |
||
1 | 1 | <?php |
2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | 5 | if (!$modx->hasPermission('edit_document') || !$modx->hasPermission('save_document')) { |
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
9 | -$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : null; |
|
9 | +$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : null; |
|
10 | 10 | $reset = isset($_POST['reset']) && $_POST['reset'] == 'true' ? 1 : 0; |
11 | 11 | $items = isset($_POST['list']) ? $_POST['list'] : ''; |
12 | 12 | $ressourcelist = ''; |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | } |
24 | 24 | |
25 | 25 | if (isset($_POST['listSubmitted'])) { |
26 | - $updateMsg .= '<div class="text-success" id="updated">' . $_lang['sort_updated'] . '</div>'; |
|
26 | + $updateMsg .= '<div class="text-success" id="updated">'.$_lang['sort_updated'].'</div>'; |
|
27 | 27 | if (strlen($items) > 0) { |
28 | 28 | $items = explode(';', $items); |
29 | 29 | foreach ($items as $key => $value) { |
@@ -43,15 +43,15 @@ discard block |
||
43 | 43 | $tblsc = $modx->getFullTableName('site_content'); |
44 | 44 | $tbldg = $modx->getFullTableName('document_groups'); |
45 | 45 | |
46 | - $rs = $modx->getDatabase()->select('pagetitle', $tblsc, 'id=' . $id . ''); |
|
46 | + $rs = $modx->getDatabase()->select('pagetitle', $tblsc, 'id='.$id.''); |
|
47 | 47 | $pagetitle = $modx->getDatabase()->getValue($rs); |
48 | 48 | |
49 | 49 | $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(',', $_SESSION['mgrDocgroups']) : ''; |
50 | 50 | $docgrp_cond = $docgrp ? "OR dg.document_group IN ({$docgrp})" : ''; |
51 | - $mgrRole = (isset ($_SESSION['mgrRole']) && (string)$_SESSION['mgrRole'] === '1') ? '1' : '0'; |
|
52 | - $access = " AND (1={$mgrRole} OR sc.privatemgr=0" . (!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))"); |
|
51 | + $mgrRole = (isset ($_SESSION['mgrRole']) && (string) $_SESSION['mgrRole'] === '1') ? '1' : '0'; |
|
52 | + $access = " AND (1={$mgrRole} OR sc.privatemgr=0".(!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))"); |
|
53 | 53 | |
54 | - $rs = $modx->getDatabase()->select('sc.id, sc.pagetitle, sc.parent, sc.menuindex, sc.published, sc.hidemenu, sc.deleted, sc.isfolder', $tblsc . 'AS sc LEFT JOIN ' . $tbldg . ' dg ON dg.document=sc.id', 'sc.parent=' . $id . $access . ' GROUP BY sc.id', 'menuindex ASC'); |
|
54 | + $rs = $modx->getDatabase()->select('sc.id, sc.pagetitle, sc.parent, sc.menuindex, sc.published, sc.hidemenu, sc.deleted, sc.isfolder', $tblsc.'AS sc LEFT JOIN '.$tbldg.' dg ON dg.document=sc.id', 'sc.parent='.$id.$access.' GROUP BY sc.id', 'menuindex ASC'); |
|
55 | 55 | |
56 | 56 | if ($modx->getDatabase()->getRecordCount($rs)) { |
57 | 57 | $ressourcelist .= '<div class="clearfix"><ul id="sortlist" class="sortableList">'; |
@@ -60,12 +60,12 @@ discard block |
||
60 | 60 | $classes .= ($row['hidemenu']) ? ' notInMenuNode ' : ' inMenuNode'; |
61 | 61 | $classes .= ($row['published']) ? ' publishedNode ' : ' unpublishedNode '; |
62 | 62 | $classes = ($row['deleted']) ? ' deletedNode ' : $classes; |
63 | - $icon = $row['isfolder'] ? '<i class="' . $_style['files_folder'] . '"></i> ' : ' <i class="' . $_style['files_page_html'] . '"></i> '; |
|
64 | - $ressourcelist .= '<li id="item_' . $row['id'] . '" class="' . $classes . '">' . $icon . $row['pagetitle'] . ' <small>(' . $row['id'] . ')</small></li>'; |
|
63 | + $icon = $row['isfolder'] ? '<i class="'.$_style['files_folder'].'"></i> ' : ' <i class="'.$_style['files_page_html'].'"></i> '; |
|
64 | + $ressourcelist .= '<li id="item_'.$row['id'].'" class="'.$classes.'">'.$icon.$row['pagetitle'].' <small>('.$row['id'].')</small></li>'; |
|
65 | 65 | } |
66 | 66 | $ressourcelist .= '</ul></div>'; |
67 | 67 | } else { |
68 | - $updateMsg = '<p class="text-danger">' . $_lang['sort_nochildren'] . '</p>'; |
|
68 | + $updateMsg = '<p class="text-danger">'.$_lang['sort_nochildren'].'</p>'; |
|
69 | 69 | } |
70 | 70 | } |
71 | 71 | |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | </script> |
149 | 149 | |
150 | 150 | <h1> |
151 | - <i class="fa fa-sort-numeric-asc"></i><?= ($pagetitle ? $modx->getPhpCompat()->entities($pagetitle) . '<small>(' . $id . ')</small>' : $_lang['sort_menuindex']) ?> |
|
151 | + <i class="fa fa-sort-numeric-asc"></i><?= ($pagetitle ? $modx->getPhpCompat()->entities($pagetitle).'<small>('.$id.')</small>' : $_lang['sort_menuindex']) ?> |
|
152 | 152 | </h1> |
153 | 153 | |
154 | 154 | <?= $_style['actionbuttons']['dynamic']['save'] ?> |
@@ -1,46 +1,46 @@ discard block |
||
1 | 1 | <?php |
2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | -if(!$modx->hasPermission('settings')) { |
|
5 | +if (!$modx->hasPermission('settings')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | $data = $_POST; |
9 | 9 | // lose the POST now, gets rid of quirky issue with Safari 3 - see FS#972 |
10 | 10 | unset($_POST); |
11 | 11 | |
12 | -if($data['friendly_urls']==='1' && strpos($_SERVER['SERVER_SOFTWARE'],'IIS')===false) |
|
12 | +if ($data['friendly_urls'] === '1' && strpos($_SERVER['SERVER_SOFTWARE'], 'IIS') === false) |
|
13 | 13 | { |
14 | - $htaccess = $modx->config['base_path'] . '.htaccess'; |
|
15 | - $sample_htaccess = $modx->config['base_path'] . 'ht.access'; |
|
16 | - $dir = '/' . trim($modx->config['base_url'],'/'); |
|
17 | - if(is_file($htaccess)) |
|
14 | + $htaccess = $modx->config['base_path'].'.htaccess'; |
|
15 | + $sample_htaccess = $modx->config['base_path'].'ht.access'; |
|
16 | + $dir = '/'.trim($modx->config['base_url'], '/'); |
|
17 | + if (is_file($htaccess)) |
|
18 | 18 | { |
19 | 19 | $_ = file_get_contents($htaccess); |
20 | - if(strpos($_,'RewriteBase')===false) |
|
20 | + if (strpos($_, 'RewriteBase') === false) |
|
21 | 21 | { |
22 | 22 | $warnings[] = $_lang["settings_friendlyurls_alert2"]; |
23 | 23 | } |
24 | - elseif(is_writable($htaccess)) |
|
24 | + elseif (is_writable($htaccess)) |
|
25 | 25 | { |
26 | - $_ = preg_replace('@RewriteBase.+@',"RewriteBase {$dir}", $_); |
|
27 | - if(!@file_put_contents($htaccess,$_)) |
|
26 | + $_ = preg_replace('@RewriteBase.+@', "RewriteBase {$dir}", $_); |
|
27 | + if (!@file_put_contents($htaccess, $_)) |
|
28 | 28 | { |
29 | 29 | $warnings[] = $_lang["settings_friendlyurls_alert2"]; |
30 | 30 | } |
31 | 31 | } |
32 | 32 | } |
33 | - elseif(is_file($sample_htaccess)) |
|
33 | + elseif (is_file($sample_htaccess)) |
|
34 | 34 | { |
35 | - if(!@rename($sample_htaccess,$htaccess)) |
|
35 | + if (!@rename($sample_htaccess, $htaccess)) |
|
36 | 36 | { |
37 | 37 | $warnings[] = $_lang["settings_friendlyurls_alert"]; |
38 | 38 | } |
39 | - elseif($modx->config['base_url']!=='/') |
|
39 | + elseif ($modx->config['base_url'] !== '/') |
|
40 | 40 | { |
41 | 41 | $_ = file_get_contents($htaccess); |
42 | - $_ = preg_replace('@RewriteBase.+@',"RewriteBase {$dir}", $_); |
|
43 | - if(!@file_put_contents($htaccess,$_)) |
|
42 | + $_ = preg_replace('@RewriteBase.+@', "RewriteBase {$dir}", $_); |
|
43 | + if (!@file_put_contents($htaccess, $_)) |
|
44 | 44 | { |
45 | 45 | $warnings[] = $_lang["settings_friendlyurls_alert2"]; |
46 | 46 | } |
@@ -48,17 +48,17 @@ discard block |
||
48 | 48 | } |
49 | 49 | } |
50 | 50 | |
51 | -if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) { |
|
52 | - unlink(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css'); |
|
51 | +if (file_exists(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css')) { |
|
52 | + unlink(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css'); |
|
53 | 53 | } |
54 | 54 | |
55 | -$data['filemanager_path'] = str_replace('[(base_path)]',MODX_BASE_PATH,$data['filemanager_path']); |
|
56 | -$data['rb_base_dir'] = str_replace('[(base_path)]',MODX_BASE_PATH,$data['rb_base_dir']); |
|
55 | +$data['filemanager_path'] = str_replace('[(base_path)]', MODX_BASE_PATH, $data['filemanager_path']); |
|
56 | +$data['rb_base_dir'] = str_replace('[(base_path)]', MODX_BASE_PATH, $data['rb_base_dir']); |
|
57 | 57 | |
58 | 58 | if (isset($data) && count($data) > 0) { |
59 | - if(isset($data['manager_language'])) { |
|
60 | - $lang_path = MODX_MANAGER_PATH . 'includes/lang/' . $data['manager_language'] . '.inc.php'; |
|
61 | - if(is_file($lang_path)) { |
|
59 | + if (isset($data['manager_language'])) { |
|
60 | + $lang_path = MODX_MANAGER_PATH.'includes/lang/'.$data['manager_language'].'.inc.php'; |
|
61 | + if (is_file($lang_path)) { |
|
62 | 62 | include($lang_path); |
63 | 63 | global $modx_lang_attribute; |
64 | 64 | $data['lang_code'] = !$modx_lang_attribute ? 'en' : $modx_lang_attribute; |
@@ -66,12 +66,12 @@ discard block |
||
66 | 66 | } |
67 | 67 | $savethese = array(); |
68 | 68 | $data['sys_files_checksum'] = $modx->getManagerApi()->getSystemChecksum($data['check_files_onlogin']); |
69 | - $data['mail_check_timeperiod'] = (int)$data['mail_check_timeperiod'] < 60 ? 60 : $data['mail_check_timeperiod']; // updateMail() in mainMenu no faster than every minute |
|
69 | + $data['mail_check_timeperiod'] = (int) $data['mail_check_timeperiod'] < 60 ? 60 : $data['mail_check_timeperiod']; // updateMail() in mainMenu no faster than every minute |
|
70 | 70 | foreach ($data as $k => $v) { |
71 | 71 | switch ($k) { |
72 | 72 | case 'settings_version':{ |
73 | - if($modx->getVersionData('version')!=$data['settings_version']){ |
|
74 | - $modx->logEvent(17,2,'<pre>'.var_export($data['settings_version'],true).'</pre>','fake settings_version'); |
|
73 | + if ($modx->getVersionData('version') != $data['settings_version']) { |
|
74 | + $modx->logEvent(17, 2, '<pre>'.var_export($data['settings_version'], true).'</pre>', 'fake settings_version'); |
|
75 | 75 | $v = $modx->getVersionData('version'); |
76 | 76 | } |
77 | 77 | break; |
@@ -92,21 +92,21 @@ discard block |
||
92 | 92 | case 'rb_base_url': |
93 | 93 | case 'filemanager_path': |
94 | 94 | $v = trim($v); |
95 | - $v = rtrim($v,'/') . '/'; |
|
95 | + $v = rtrim($v, '/').'/'; |
|
96 | 96 | break; |
97 | 97 | case 'manager_language': |
98 | - $langDir = realpath(MODX_MANAGER_PATH . 'includes/lang'); |
|
99 | - $langFile = realpath(MODX_MANAGER_PATH . 'includes/lang/' . $v . '.inc.php'); |
|
98 | + $langDir = realpath(MODX_MANAGER_PATH.'includes/lang'); |
|
99 | + $langFile = realpath(MODX_MANAGER_PATH.'includes/lang/'.$v.'.inc.php'); |
|
100 | 100 | $langFileDir = dirname($langFile); |
101 | - if($langDir !== $langFileDir || !file_exists($langFile)) { |
|
101 | + if ($langDir !== $langFileDir || !file_exists($langFile)) { |
|
102 | 102 | $v = 'english'; |
103 | 103 | } |
104 | 104 | break; |
105 | 105 | case 'smtppw': |
106 | 106 | if ($v !== '********************' && $v !== '') { |
107 | 107 | $v = trim($v); |
108 | - $v = base64_encode($v) . substr(str_shuffle('abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789'), 0, 7); |
|
109 | - $v = str_replace('=','%',$v); |
|
108 | + $v = base64_encode($v).substr(str_shuffle('abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789'), 0, 7); |
|
109 | + $v = str_replace('=', '%', $v); |
|
110 | 110 | } elseif ($v === '********************') { |
111 | 111 | $k = ''; |
112 | 112 | } |
@@ -115,14 +115,14 @@ discard block |
||
115 | 115 | $v = str_replace(array(' ,', ', '), ',', $v); |
116 | 116 | if ($v !== ',') { |
117 | 117 | $v = ($v != 'MODX_SITE_HOSTNAMES') ? $v : ''; |
118 | - $configString = '<?php' . "\n" . 'define(\'MODX_SITE_HOSTNAMES\', \'' . $v . '\');' . "\n"; |
|
119 | - @file_put_contents(MODX_BASE_PATH . 'assets/cache/siteHostnames.php', $configString); |
|
118 | + $configString = '<?php'."\n".'define(\'MODX_SITE_HOSTNAMES\', \''.$v.'\');'."\n"; |
|
119 | + @file_put_contents(MODX_BASE_PATH.'assets/cache/siteHostnames.php', $configString); |
|
120 | 120 | } |
121 | 121 | $k = ''; |
122 | 122 | break; |
123 | 123 | case 'session_timeout': |
124 | 124 | $mail_check_timeperiod = $data['mail_check_timeperiod']; |
125 | - $v = (int)$v < ($data['mail_check_timeperiod']/60+1) ? ($data['mail_check_timeperiod']/60+1) : $v; // updateMail() in mainMenu pings as per mail_check_timeperiod, so +1min is minimum |
|
125 | + $v = (int) $v < ($data['mail_check_timeperiod'] / 60 + 1) ? ($data['mail_check_timeperiod'] / 60 + 1) : $v; // updateMail() in mainMenu pings as per mail_check_timeperiod, so +1min is minimum |
|
126 | 126 | break; |
127 | 127 | default: |
128 | 128 | break; |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | |
132 | 132 | $modx->config[$k] = $v; |
133 | 133 | |
134 | - if(!empty($k)) $savethese[] = '(\''.$modx->getDatabase()->escape($k).'\', \''.$modx->getDatabase()->escape($v).'\')'; |
|
134 | + if (!empty($k)) $savethese[] = '(\''.$modx->getDatabase()->escape($k).'\', \''.$modx->getDatabase()->escape($v).'\')'; |
|
135 | 135 | } |
136 | 136 | |
137 | 137 | // Run a single query to save all the values |
@@ -141,16 +141,16 @@ discard block |
||
141 | 141 | |
142 | 142 | // Reset Template Pages |
143 | 143 | if (isset($data['reset_template'])) { |
144 | - $newtemplate = (int)$data['default_template']; |
|
145 | - $oldtemplate = (int)$data['old_template']; |
|
144 | + $newtemplate = (int) $data['default_template']; |
|
145 | + $oldtemplate = (int) $data['old_template']; |
|
146 | 146 | $tbl = $modx->getFullTableName('site_content'); |
147 | 147 | $reset = $data['reset_template']; |
148 | - if($reset==1) $modx->getDatabase()->update(array('template' => $newtemplate), $tbl, "type='document'"); |
|
149 | - else if($reset==2) $modx->getDatabase()->update(array('template' => $newtemplate), $tbl, "template='{$oldtemplate}'"); |
|
148 | + if ($reset == 1) $modx->getDatabase()->update(array('template' => $newtemplate), $tbl, "type='document'"); |
|
149 | + else if ($reset == 2) $modx->getDatabase()->update(array('template' => $newtemplate), $tbl, "template='{$oldtemplate}'"); |
|
150 | 150 | } |
151 | 151 | |
152 | 152 | // empty cache |
153 | 153 | $modx->clearCache('full'); |
154 | 154 | } |
155 | -$header="Location: index.php?a=7&r=10"; |
|
155 | +$header = "Location: index.php?a=7&r=10"; |
|
156 | 156 | header($header); |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | 5 | header("X-XSS-Protection: 0"); |
@@ -47,9 +47,9 @@ discard block |
||
47 | 47 | |
48 | 48 | $theme_modes = array('', 'lightness', 'light', 'dark', 'darkness'); |
49 | 49 | if (!empty($theme_modes[$_COOKIE['MODX_themeMode']])) { |
50 | - $body_class .= ' ' . $theme_modes[$_COOKIE['MODX_themeMode']]; |
|
50 | + $body_class .= ' '.$theme_modes[$_COOKIE['MODX_themeMode']]; |
|
51 | 51 | } elseif (!empty($theme_modes[$modx->config['manager_theme_mode']])) { |
52 | - $body_class .= ' ' . $theme_modes[$modx->config['manager_theme_mode']]; |
|
52 | + $body_class .= ' '.$theme_modes[$modx->config['manager_theme_mode']]; |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | $navbar_position = $modx->config['manager_menu_position']; |
@@ -82,36 +82,36 @@ discard block |
||
82 | 82 | $user['which_browser'] = $modx->config['which_browser']; |
83 | 83 | } |
84 | 84 | |
85 | -$css = 'media/style/' . $modx->config['manager_theme'] . '/css/page.css?v=' . $lastInstallTime; |
|
85 | +$css = 'media/style/'.$modx->config['manager_theme'].'/css/page.css?v='.$lastInstallTime; |
|
86 | 86 | |
87 | 87 | if ($modx->config['manager_theme'] == 'default') { |
88 | - if (!file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css') && is_writable(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css')) { |
|
89 | - require_once MODX_BASE_PATH . 'assets/lib/Formatter/CSSMinify.php'; |
|
88 | + if (!file_exists(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css') && is_writable(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css')) { |
|
89 | + require_once MODX_BASE_PATH.'assets/lib/Formatter/CSSMinify.php'; |
|
90 | 90 | $minifier = new Formatter\CSSMinify(); |
91 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/bootstrap/css/bootstrap.min.css'); |
|
92 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/font-awesome/css/font-awesome.min.css'); |
|
93 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/fonts.css'); |
|
94 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/forms.css'); |
|
95 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/mainmenu.css'); |
|
96 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/tree.css'); |
|
97 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/custom.css'); |
|
98 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/tabpane.css'); |
|
99 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/contextmenu.css'); |
|
100 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/index.css'); |
|
101 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/main.css'); |
|
91 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/common/bootstrap/css/bootstrap.min.css'); |
|
92 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/common/font-awesome/css/font-awesome.min.css'); |
|
93 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/fonts.css'); |
|
94 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/forms.css'); |
|
95 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/mainmenu.css'); |
|
96 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/tree.css'); |
|
97 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/custom.css'); |
|
98 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/tabpane.css'); |
|
99 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/contextmenu.css'); |
|
100 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/index.css'); |
|
101 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/main.css'); |
|
102 | 102 | $css = $minifier->minify(); |
103 | - file_put_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css', $css); |
|
103 | + file_put_contents(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css', $css); |
|
104 | 104 | } |
105 | - if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) { |
|
106 | - $css = 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css?v=' . $lastInstallTime; |
|
105 | + if (file_exists(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css')) { |
|
106 | + $css = 'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css?v='.$lastInstallTime; |
|
107 | 107 | } |
108 | 108 | } |
109 | 109 | |
110 | -$modx->config['global_tabs'] = (int)($modx->config['global_tabs'] && ($user['role'] == 1 || $modx->hasPermission('edit_template') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_plugin'))); |
|
110 | +$modx->config['global_tabs'] = (int) ($modx->config['global_tabs'] && ($user['role'] == 1 || $modx->hasPermission('edit_template') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_plugin'))); |
|
111 | 111 | |
112 | 112 | ?> |
113 | 113 | <!DOCTYPE html> |
114 | -<html <?= (isset($modx_textdir) && $modx_textdir ? 'dir="rtl" lang="' : 'lang="') . $mxla . '" xml:lang="' . $mxla . '"' ?>> |
|
114 | +<html <?= (isset($modx_textdir) && $modx_textdir ? 'dir="rtl" lang="' : 'lang="').$mxla.'" xml:lang="'.$mxla.'"' ?>> |
|
115 | 115 | <head> |
116 | 116 | <title><?= $modx->getPhpCompat()->entities($site_name) ?>- (EVO CMS Manager)</title> |
117 | 117 | <meta http-equiv="Content-Type" content="text/html; charset=<?= $modx_manager_charset ?>" /> |
@@ -142,21 +142,21 @@ discard block |
||
142 | 142 | MODX_SITE_URL: '<?= MODX_SITE_URL ?>', |
143 | 143 | MODX_MANAGER_URL: '<?= MODX_MANAGER_URL ?>', |
144 | 144 | user: { |
145 | - role: <?= (int)$user['role'] ?>, |
|
145 | + role: <?= (int) $user['role'] ?>, |
|
146 | 146 | username: '<?= $user['username'] ?>' |
147 | 147 | }, |
148 | 148 | config: { |
149 | 149 | mail_check_timeperiod: <?= $modx->config['mail_check_timeperiod'] ?>, |
150 | - menu_height: <?= (int)$menu_height ?>, |
|
151 | - tree_width: <?= (int)$tree_width ?>, |
|
152 | - tree_min_width: <?= (int)$tree_min_width ?>, |
|
153 | - session_timeout: <?= (int)$modx->config['session_timeout'] ?>, |
|
154 | - site_start: <?= (int)$modx->config['site_start'] ?>, |
|
155 | - tree_page_click: <?=(!empty($modx->config['tree_page_click']) ? (int)$modx->config['tree_page_click'] : 27) ?>, |
|
150 | + menu_height: <?= (int) $menu_height ?>, |
|
151 | + tree_width: <?= (int) $tree_width ?>, |
|
152 | + tree_min_width: <?= (int) $tree_min_width ?>, |
|
153 | + session_timeout: <?= (int) $modx->config['session_timeout'] ?>, |
|
154 | + site_start: <?= (int) $modx->config['site_start'] ?>, |
|
155 | + tree_page_click: <?=(!empty($modx->config['tree_page_click']) ? (int) $modx->config['tree_page_click'] : 27) ?>, |
|
156 | 156 | theme: '<?= $modx->config['manager_theme'] ?>', |
157 | 157 | theme_mode: '<?= $modx->config['manager_theme_mode'] ?>', |
158 | 158 | which_browser: '<?= $user['which_browser'] ?>', |
159 | - layout: <?= (int)$manager_layout ?>, |
|
159 | + layout: <?= (int) $manager_layout ?>, |
|
160 | 160 | textdir: '<?= $modx_textdir ?>', |
161 | 161 | global_tabs: <?= $modx->config['global_tabs'] ?> |
162 | 162 | |
@@ -241,11 +241,11 @@ discard block |
||
241 | 241 | delete a[b]; |
242 | 242 | }, |
243 | 243 | openedArray: [], |
244 | - lockedElementsTranslation: <?= json_encode($unlockTranslations, JSON_FORCE_OBJECT | JSON_UNESCAPED_UNICODE) . "\n" ?> |
|
244 | + lockedElementsTranslation: <?= json_encode($unlockTranslations, JSON_FORCE_OBJECT | JSON_UNESCAPED_UNICODE)."\n" ?> |
|
245 | 245 | }; |
246 | 246 | <?php |
247 | 247 | $opened = array_filter(array_map('intval', explode('|', $_SESSION['openedArray']))); |
248 | - echo (empty($opened) ? '' : 'modx.openedArray[' . implode("] = 1;\n modx.openedArray[", $opened) . '] = 1;') . "\n"; |
|
248 | + echo (empty($opened) ? '' : 'modx.openedArray['.implode("] = 1;\n modx.openedArray[", $opened).'] = 1;')."\n"; |
|
249 | 249 | ?> |
250 | 250 | </script> |
251 | 251 | <script src="media/style/<?= $modx->config['manager_theme'] ?>/js/modx.min.js?v=<?= $lastInstallTime ?>"></script> |
@@ -327,7 +327,7 @@ discard block |
||
327 | 327 | <a href="javascript:;" class="dropdown-toggle" onclick="return false;"> |
328 | 328 | <span class="username"><?= $user['username'] ?></span> |
329 | 329 | <?php if ($user['photo']) { ?> |
330 | - <span class="icon photo" style="background-image: url(<?= MODX_SITE_URL . $user['photo'] ?>);"></span> |
|
330 | + <span class="icon photo" style="background-image: url(<?= MODX_SITE_URL.$user['photo'] ?>);"></span> |
|
331 | 331 | <?php } else { ?> |
332 | 332 | <span class="icon"><?= $_style['menu_user'] ?></span> |
333 | 333 | <?php } ?> |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | $version = 'Evolution'; |
355 | 355 | ?> |
356 | 356 | <?php |
357 | - echo sprintf('<li><span class="dropdown-item" title="%s – %s" %s>' . $version . ' %s</span></li>', $modx->getPhpCompat()->entities($site_name), $modx->getVersionData('full_appname'), $style, $modx->config['settings_version']); |
|
357 | + echo sprintf('<li><span class="dropdown-item" title="%s – %s" %s>'.$version.' %s</span></li>', $modx->getPhpCompat()->entities($site_name), $modx->getVersionData('full_appname'), $style, $modx->config['settings_version']); |
|
358 | 358 | ?> |
359 | 359 | </ul> |
360 | 360 | </li> |
@@ -506,7 +506,7 @@ discard block |
||
506 | 506 | </div> |
507 | 507 | |
508 | 508 | <?php |
509 | - if(!function_exists('constructLink')) { |
|
509 | + if (!function_exists('constructLink')) { |
|
510 | 510 | /** |
511 | 511 | * @param string $action |
512 | 512 | * @param string $img |
@@ -515,7 +515,7 @@ discard block |
||
515 | 515 | */ |
516 | 516 | function constructLink($action, $img, $text, $allowed) |
517 | 517 | { |
518 | - if ((bool)$allowed) { |
|
518 | + if ((bool) $allowed) { |
|
519 | 519 | echo sprintf('<div class="menuLink" id="item%s" onclick="modx.tree.menuHandler(%s);">', $action, |
520 | 520 | $action); |
521 | 521 | echo sprintf('<i class="%s"></i> %s</div>', $img, $text); |
@@ -556,7 +556,7 @@ discard block |
||
556 | 556 | <script type="text/javascript"> |
557 | 557 | |
558 | 558 | if (document.getElementById('treeMenu')) { |
559 | - <?php if($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin')) { ?> |
|
559 | + <?php if ($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin')) { ?> |
|
560 | 560 | |
561 | 561 | document.getElementById('treeMenu_openelements').onclick = function(e) { |
562 | 562 | e.preventDefault(); |
@@ -574,12 +574,12 @@ discard block |
||
574 | 574 | } |
575 | 575 | }; |
576 | 576 | <?php } ?> |
577 | - <?php if($use_browser && $modx->hasPermission('assets_images')) { ?> |
|
577 | + <?php if ($use_browser && $modx->hasPermission('assets_images')) { ?> |
|
578 | 578 | |
579 | 579 | document.getElementById('treeMenu_openimages').onclick = function(e) { |
580 | 580 | e.preventDefault(); |
581 | 581 | if (modx.config.global_tabs && !e.shiftKey) { |
582 | - modx.tabs({url: '<?= MODX_MANAGER_URL . 'media/browser/' . $which_browser . '/browse.php?filemanager=media/browser/' . $which_browser . '/browse.php&type=images' ?>', title: '<?= $_lang["images_management"] ?>'}); |
|
582 | + modx.tabs({url: '<?= MODX_MANAGER_URL.'media/browser/'.$which_browser.'/browse.php?filemanager=media/browser/'.$which_browser.'/browse.php&type=images' ?>', title: '<?= $_lang["images_management"] ?>'}); |
|
583 | 583 | } else { |
584 | 584 | var randomNum = '<?= $_lang["files_files"] ?>'; |
585 | 585 | if (e.shiftKey) { |
@@ -592,12 +592,12 @@ discard block |
||
592 | 592 | } |
593 | 593 | }; |
594 | 594 | <?php } ?> |
595 | - <?php if($use_browser && $modx->hasPermission('assets_files')) { ?> |
|
595 | + <?php if ($use_browser && $modx->hasPermission('assets_files')) { ?> |
|
596 | 596 | |
597 | 597 | document.getElementById('treeMenu_openfiles').onclick = function(e) { |
598 | 598 | e.preventDefault(); |
599 | 599 | if (modx.config.global_tabs && !e.shiftKey) { |
600 | - modx.tabs({url: '<?= MODX_MANAGER_URL . 'media/browser/' . $which_browser . '/browse.php?filemanager=media/browser/' . $which_browser . '/browse.php&type=files' ?>', title: '<?= $_lang["files_files"] ?>'}); |
|
600 | + modx.tabs({url: '<?= MODX_MANAGER_URL.'media/browser/'.$which_browser.'/browse.php?filemanager=media/browser/'.$which_browser.'/browse.php&type=files' ?>', title: '<?= $_lang["files_files"] ?>'}); |
|
601 | 601 | } else { |
602 | 602 | var randomNum = '<?= $_lang["files_files"] ?>'; |
603 | 603 | if (e.shiftKey) { |
@@ -651,7 +651,7 @@ discard block |
||
651 | 651 | |
652 | 652 | </div> |
653 | 653 | <?php if ($modx->config['show_picker'] != "0") { |
654 | - include('media/style/' . $modx->config['manager_theme'] . '/color.switcher.php'); |
|
654 | + include('media/style/'.$modx->config['manager_theme'].'/color.switcher.php'); |
|
655 | 655 | } ?> |
656 | 656 | </body> |
657 | 657 | </html> |