@@ -12,12 +12,20 @@ discard block |
||
12 | 12 | // ok, two things to check. |
13 | 13 | // first, document cannot be moved to itself |
14 | 14 | // second, new parent must be a folder. If not, set it to folder. |
15 | -if($documentID==$newParentID) $modx->webAlertAndQuit($_lang["error_movedocument1"]); |
|
16 | -if($documentID <= 0) $modx->webAlertAndQuit($_lang["error_movedocument2"]); |
|
17 | -if($newParentID < 0) $modx->webAlertAndQuit($_lang["error_movedocument2"]); |
|
15 | +if($documentID==$newParentID) { |
|
16 | + $modx->webAlertAndQuit($_lang["error_movedocument1"]); |
|
17 | +} |
|
18 | +if($documentID <= 0) { |
|
19 | + $modx->webAlertAndQuit($_lang["error_movedocument2"]); |
|
20 | +} |
|
21 | +if($newParentID < 0) { |
|
22 | + $modx->webAlertAndQuit($_lang["error_movedocument2"]); |
|
23 | +} |
|
18 | 24 | |
19 | 25 | $parents = $modx->getParentIds($newParentID); |
20 | -if (in_array($documentID, $parents)) $modx->webAlertAndQuit($_lang["error_movedocument2"]); |
|
26 | +if (in_array($documentID, $parents)) { |
|
27 | + $modx->webAlertAndQuit($_lang["error_movedocument2"]); |
|
28 | +} |
|
21 | 29 | |
22 | 30 | $rs = $modx->db->select('parent', $modx->getFullTableName('site_content'), "id='{$documentID}'"); |
23 | 31 | $oldparent = $modx->db->getValue($rs); |
@@ -42,7 +50,8 @@ discard block |
||
42 | 50 | * @param int $currDocID |
43 | 51 | * @return array |
44 | 52 | */ |
45 | -function allChildren($currDocID) { |
|
53 | +function allChildren($currDocID) |
|
54 | +{ |
|
46 | 55 | global $modx; |
47 | 56 | $children= array(); |
48 | 57 | $currDocID = $modx->db->escape($currDocID); |
@@ -59,11 +68,11 @@ discard block |
||
59 | 68 | "old_parent" => $oldparent, |
60 | 69 | "new_parent" => $newParentID |
61 | 70 | )); |
62 | -if (is_array($evtOut) && count($evtOut) > 0){ |
|
71 | +if (is_array($evtOut) && count($evtOut) > 0) { |
|
63 | 72 | $newParent = array_pop($evtOut); |
64 | 73 | if($newParent == $oldparent) { |
65 | 74 | $modx->webAlertAndQuit($_lang["error_movedocument2"]); |
66 | - }else{ |
|
75 | + } else { |
|
67 | 76 | $newParentID = $newParent; |
68 | 77 | } |
69 | 78 | } |
@@ -340,7 +340,8 @@ discard block |
||
340 | 340 | * @param string $string |
341 | 341 | * @return string |
342 | 342 | */ |
343 | -function save_user_quoted_printable($string) { |
|
343 | +function save_user_quoted_printable($string) |
|
344 | +{ |
|
344 | 345 | $crlf = "\n"; |
345 | 346 | $string = preg_replace('!(\r\n|\r|\n)!', $crlf, $string) . $crlf; |
346 | 347 | $f[] = '/([\000-\010\013\014\016-\037\075\177-\377])/e'; |
@@ -359,7 +360,8 @@ discard block |
||
359 | 360 | * @param string $pwd |
360 | 361 | * @param string $ufn |
361 | 362 | */ |
362 | -function sendMailMessage($email, $uid, $pwd, $ufn) { |
|
363 | +function sendMailMessage($email, $uid, $pwd, $ufn) |
|
364 | +{ |
|
363 | 365 | global $modx, $_lang, $websignupemail_message; |
364 | 366 | global $emailsubject, $emailsender; |
365 | 367 | global $site_name, $site_url; |
@@ -387,7 +389,8 @@ discard block |
||
387 | 389 | } |
388 | 390 | |
389 | 391 | // Save User Settings |
390 | -function saveUserSettings($id) { |
|
392 | +function saveUserSettings($id) |
|
393 | +{ |
|
391 | 394 | global $modx; |
392 | 395 | $tbl_web_user_settings = $modx->getFullTableName('web_user_settings'); |
393 | 396 | |
@@ -416,7 +419,8 @@ discard block |
||
416 | 419 | } |
417 | 420 | |
418 | 421 | // Web alert - sends an alert to web browser |
419 | -function webAlertAndQuit($msg) { |
|
422 | +function webAlertAndQuit($msg) |
|
423 | +{ |
|
420 | 424 | global $id, $modx; |
421 | 425 | $mode = $_POST['mode']; |
422 | 426 | $modx->manager->saveFormValues($mode); |
@@ -424,7 +428,8 @@ discard block |
||
424 | 428 | } |
425 | 429 | |
426 | 430 | // Generate password |
427 | -function generate_password($length = 10) { |
|
431 | +function generate_password($length = 10) |
|
432 | +{ |
|
428 | 433 | $allowable_characters = "abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789"; |
429 | 434 | $ps_len = strlen($allowable_characters); |
430 | 435 | mt_srand((double) microtime() * 1000000); |
@@ -435,7 +440,8 @@ discard block |
||
435 | 440 | return $pass; |
436 | 441 | } |
437 | 442 | |
438 | -function sanitize($str = '', $safecount = 0) { |
|
443 | +function sanitize($str = '', $safecount = 0) |
|
444 | +{ |
|
439 | 445 | global $modx; |
440 | 446 | $safecount++; |
441 | 447 | if(1000 < $safecount) { |
@@ -1,13 +1,17 @@ discard block |
||
1 | 1 | <?php |
2 | -class DATEPICKER { |
|
2 | +class DATEPICKER |
|
3 | +{ |
|
3 | 4 | /** |
4 | 5 | * @return string |
5 | 6 | */ |
6 | - public function getDP() { |
|
7 | + public function getDP() |
|
8 | + { |
|
7 | 9 | global $modx; |
8 | 10 | |
9 | 11 | $load_script = file_get_contents(dirname(__FILE__).'/datepicker.tpl'); |
10 | - if(!isset($modx->config['lang_code'])) $modx->config['lang_code'] = $this->getLangCode(); |
|
12 | + if(!isset($modx->config['lang_code'])) { |
|
13 | + $modx->config['lang_code'] = $this->getLangCode(); |
|
14 | + } |
|
11 | 15 | $modx->config['datetime_format_lc'] = isset($modx->config['datetime_format']) ? strtolower($modx->config['datetime_format']) : 'dd-mm-yyyy'; |
12 | 16 | return $modx->mergeSettingsContent($load_script); |
13 | 17 | } |
@@ -15,13 +19,18 @@ discard block |
||
15 | 19 | /** |
16 | 20 | * @return string |
17 | 21 | */ |
18 | - public function getLangCode() { |
|
22 | + public function getLangCode() |
|
23 | + { |
|
19 | 24 | global $modx, $modx_lang_attribute; |
20 | 25 | |
21 | - if(!$modx_lang_attribute) return 'en'; |
|
26 | + if(!$modx_lang_attribute) { |
|
27 | + return 'en'; |
|
28 | + } |
|
22 | 29 | |
23 | 30 | $lc = $modx_lang_attribute; |
24 | - if($lc === 'uk') return 'ru'; |
|
31 | + if($lc === 'uk') { |
|
32 | + return 'ru'; |
|
33 | + } |
|
25 | 34 | $dp_path = str_replace('\\','/',dirname(__FILE__)); |
26 | 35 | |
27 | 36 | return (is_file("{$dp_path}/i18n/datepicker.{$lc}.js")) ? $modx_lang_attribute : 'en'; |
@@ -50,17 +50,23 @@ discard block |
||
50 | 50 | include_once($autoloader); |
51 | 51 | } |
52 | 52 | |
53 | -if(!isset($_SERVER['REQUEST_TIME_FLOAT'])) $_SERVER['REQUEST_TIME_FLOAT'] = microtime(true); |
|
53 | +if(!isset($_SERVER['REQUEST_TIME_FLOAT'])) { |
|
54 | + $_SERVER['REQUEST_TIME_FLOAT'] = microtime(true); |
|
55 | +} |
|
54 | 56 | |
55 | 57 | $base_path = str_replace('\\','/',dirname(__FILE__)) . '/'; |
56 | -if(is_file($base_path . 'assets/cache/siteManager.php')) |
|
58 | +if(is_file($base_path . 'assets/cache/siteManager.php')) { |
|
57 | 59 | include_once($base_path . 'assets/cache/siteManager.php'); |
58 | -if(!defined('MGR_DIR') && is_dir("{$base_path}manager")) |
|
60 | +} |
|
61 | +if(!defined('MGR_DIR') && is_dir("{$base_path}manager")) { |
|
59 | 62 | define('MGR_DIR', 'manager'); |
60 | -if(is_file($base_path . 'assets/cache/siteHostnames.php')) |
|
63 | +} |
|
64 | +if(is_file($base_path . 'assets/cache/siteHostnames.php')) { |
|
61 | 65 | include_once($base_path . 'assets/cache/siteHostnames.php'); |
62 | -if(!defined('MODX_SITE_HOSTNAMES')) |
|
66 | +} |
|
67 | +if(!defined('MODX_SITE_HOSTNAMES')) { |
|
63 | 68 | define('MODX_SITE_HOSTNAMES', ''); |
69 | +} |
|
64 | 70 | |
65 | 71 | // get start time |
66 | 72 | $mstart = memory_get_usage(); |
@@ -129,7 +135,7 @@ discard block |
||
129 | 135 | @ini_set("display_errors","0"); |
130 | 136 | } |
131 | 137 | |
132 | -if(MODX_CLI){ |
|
138 | +if(MODX_CLI) { |
|
133 | 139 | @set_time_limit(0); |
134 | 140 | @ini_set('max_execution_time',0); |
135 | 141 | } |
@@ -6,8 +6,8 @@ discard block |
||
6 | 6 | /** |
7 | 7 | * @return string |
8 | 8 | */ |
9 | -function genEvoSessionName() |
|
10 | -{ |
|
9 | +function genEvoSessionName() |
|
10 | +{ |
|
11 | 11 | $_ = crc32(__FILE__); |
12 | 12 | $_ = sprintf('%u', $_); |
13 | 13 | |
@@ -17,10 +17,12 @@ discard block |
||
17 | 17 | /** |
18 | 18 | * @return void |
19 | 19 | */ |
20 | -function startCMSSession() |
|
21 | -{ |
|
20 | +function startCMSSession() |
|
21 | +{ |
|
22 | 22 | global $site_sessionname, $https_port, $session_cookie_path, $session_cookie_domain; |
23 | - if(MODX_CLI) return; |
|
23 | + if(MODX_CLI) { |
|
24 | + return; |
|
25 | + } |
|
24 | 26 | |
25 | 27 | session_name($site_sessionname); |
26 | 28 | removeInvalidCmsSessionIds($site_sessionname); |
@@ -31,14 +33,14 @@ discard block |
||
31 | 33 | session_set_cookie_params($cookieExpiration, $cookiePath, $cookieDomain, $secure, true); |
32 | 34 | session_start(); |
33 | 35 | $key = "modx.mgr.session.cookie.lifetime"; |
34 | - if (isset($_SESSION[$key]) && is_numeric($_SESSION[$key])) { |
|
36 | + if (isset($_SESSION[$key]) && is_numeric($_SESSION[$key])) { |
|
35 | 37 | $cookieLifetime = (int)$_SESSION[$key]; |
36 | - if ($cookieLifetime) { |
|
38 | + if ($cookieLifetime) { |
|
37 | 39 | $cookieExpiration = $_SERVER['REQUEST_TIME'] + $cookieLifetime; |
38 | 40 | } |
39 | 41 | setcookie(session_name(), session_id(), $cookieExpiration, $cookiePath, $cookieDomain, $secure, true); |
40 | 42 | } |
41 | - if (!isset($_SESSION['modx.session.created.time'])) { |
|
43 | + if (!isset($_SESSION['modx.session.created.time'])) { |
|
42 | 44 | $_SESSION['modx.session.created.time'] = $_SERVER['REQUEST_TIME']; |
43 | 45 | } |
44 | 46 | } |
@@ -48,9 +50,9 @@ discard block |
||
48 | 50 | * @param $session_name |
49 | 51 | * @return void |
50 | 52 | */ |
51 | -function removeInvalidCmsSessionFromStorage(&$storage, $session_name) |
|
52 | -{ |
|
53 | - if (isset($storage[$session_name]) && ($storage[$session_name] === '' || $storage[$session_name] === 'deleted')) { |
|
53 | +function removeInvalidCmsSessionFromStorage(&$storage, $session_name) |
|
54 | +{ |
|
55 | + if (isset($storage[$session_name]) && ($storage[$session_name] === '' || $storage[$session_name] === 'deleted')) { |
|
54 | 56 | unset($storage[$session_name]); |
55 | 57 | } |
56 | 58 | } |
@@ -59,9 +61,11 @@ discard block |
||
59 | 61 | * @param $session_name |
60 | 62 | * @return void |
61 | 63 | */ |
62 | -function removeInvalidCmsSessionIds($session_name) |
|
63 | -{ |
|
64 | - if(MODX_CLI) return; |
|
64 | +function removeInvalidCmsSessionIds($session_name) |
|
65 | +{ |
|
66 | + if(MODX_CLI) { |
|
67 | + return; |
|
68 | + } |
|
65 | 69 | // session ids is invalid iff it is empty string |
66 | 70 | // storage priorioty can see in PHP source ext/session/session.c |
67 | 71 | removeInvalidCmsSessionFromStorage($_COOKIE, $session_name); |
@@ -1,20 +1,22 @@ |
||
1 | 1 | <?php |
2 | 2 | // Determine upgradeability |
3 | 3 | $upgradeable = 0; |
4 | -if (is_file($base_path . MGR_DIR . '/includes/config.inc.php')) { // Include the file so we can test its validity |
|
4 | +if (is_file($base_path . MGR_DIR . '/includes/config.inc.php')) { |
|
5 | +// Include the file so we can test its validity |
|
5 | 6 | include_once $base_path . MGR_DIR . '/includes/config.inc.php'; |
6 | 7 | // We need to have all connection settings - tho prefix may be empty so we have to ignore it |
7 | 8 | if (isset($dbase)) { |
8 | - if (!$conn = @mysqli_connect($database_server, $database_user, $database_password)) |
|
9 | - $upgradeable = isset($_POST['installmode']) && $_POST['installmode'] == 'new' ? 0 : 2; |
|
10 | - elseif (!@mysqli_select_db($conn, trim($dbase, '`'))) |
|
11 | - $upgradeable = isset($_POST['installmode']) && $_POST['installmode'] == 'new' ? 0 : 2; |
|
12 | - else |
|
13 | - $upgradeable = 1; |
|
9 | + if (!$conn = @mysqli_connect($database_server, $database_user, $database_password)) { |
|
10 | + $upgradeable = isset($_POST['installmode']) && $_POST['installmode'] == 'new' ? 0 : 2; |
|
11 | + } elseif (!@mysqli_select_db($conn, trim($dbase, '`'))) { |
|
12 | + $upgradeable = isset($_POST['installmode']) && $_POST['installmode'] == 'new' ? 0 : 2; |
|
13 | + } else { |
|
14 | + $upgradeable = 1; |
|
15 | + } |
|
16 | + } else { |
|
17 | + $upgradeable = 2; |
|
18 | + } |
|
14 | 19 | } |
15 | - else |
|
16 | - $upgradeable = 2; |
|
17 | -} |
|
18 | 20 | |
19 | 21 | $ph['moduleName'] = $moduleName; |
20 | 22 | $ph['displayNew'] = ($upgradeable!=0) ? 'display:none;' : ''; |
@@ -134,8 +134,7 @@ discard block |
||
134 | 134 | } |
135 | 135 | //end webber |
136 | 136 | } |
137 | -} |
|
138 | -elseif ($alias) { |
|
137 | +} elseif ($alias) { |
|
139 | 138 | $alias = $modx->stripAlias($alias); |
140 | 139 | } |
141 | 140 | |
@@ -149,8 +148,7 @@ discard block |
||
149 | 148 | |
150 | 149 | if ($pub_date < $currentdate) { |
151 | 150 | $published = 1; |
152 | - } |
|
153 | - elseif ($pub_date > $currentdate) { |
|
151 | + } elseif ($pub_date > $currentdate) { |
|
154 | 152 | $published = 0; |
155 | 153 | } |
156 | 154 | } |
@@ -278,8 +276,7 @@ discard block |
||
278 | 276 | case 'new' : |
279 | 277 | |
280 | 278 | // invoke OnBeforeDocFormSave event |
281 | - switch($modx->config['docid_incrmnt_method']) |
|
282 | - { |
|
279 | + switch($modx->config['docid_incrmnt_method']) { |
|
283 | 280 | case '1': |
284 | 281 | $from = "{$tbl_site_content} AS T0 LEFT JOIN {$tbl_site_content} AS T1 ON T0.id + 1 = T1.id"; |
285 | 282 | $where = "T1.id IS NULL"; |
@@ -347,8 +344,9 @@ discard block |
||
347 | 344 | "alias_visible" => $aliasvisible |
348 | 345 | ); |
349 | 346 | |
350 | - if ($id != '') |
|
351 | - $dbInsert["id"] = $id; |
|
347 | + if ($id != '') { |
|
348 | + $dbInsert["id"] = $id; |
|
349 | + } |
|
352 | 350 | |
353 | 351 | $key = $modx->db->insert($dbInsert, $tbl_site_content); |
354 | 352 | |
@@ -424,11 +422,13 @@ discard block |
||
424 | 422 | // redirect/stay options |
425 | 423 | if ($_POST['stay'] != '') { |
426 | 424 | // weblink |
427 | - if ($_POST['mode'] == "72") |
|
428 | - $a = ($_POST['stay'] == '2') ? "27&id=$key" : "72&pid=$parent"; |
|
425 | + if ($_POST['mode'] == "72") { |
|
426 | + $a = ($_POST['stay'] == '2') ? "27&id=$key" : "72&pid=$parent"; |
|
427 | + } |
|
429 | 428 | // document |
430 | - if ($_POST['mode'] == "4") |
|
431 | - $a = ($_POST['stay'] == '2') ? "27&id=$key" : "4&pid=$parent"; |
|
429 | + if ($_POST['mode'] == "4") { |
|
430 | + $a = ($_POST['stay'] == '2') ? "27&id=$key" : "4&pid=$parent"; |
|
431 | + } |
|
432 | 432 | $header = "Location: index.php?a=".$a."&r=1&stay=".$_POST['stay']; |
433 | 433 | } else { |
434 | 434 | $header = "Location: index.php?a=3&id=$key&r=1"; |
@@ -489,10 +489,10 @@ discard block |
||
489 | 489 | if (!$was_published && $published) { |
490 | 490 | $publishedon = $currentdate; |
491 | 491 | $publishedby = $modx->getLoginUserID(); |
492 | - }elseif ((!empty($pub_date)&& $pub_date<=$currentdate && $published)) { |
|
492 | + } elseif ((!empty($pub_date)&& $pub_date<=$currentdate && $published)) { |
|
493 | 493 | $publishedon = $pub_date; |
494 | 494 | $publishedby = $modx->getLoginUserID(); |
495 | - }elseif ($was_published && !$published) { |
|
495 | + } elseif ($was_published && !$published) { |
|
496 | 496 | $publishedon = 0; |
497 | 497 | $publishedby = 0; |
498 | 498 | } else { |
@@ -548,7 +548,9 @@ discard block |
||
548 | 548 | $tvChanges = array(); |
549 | 549 | foreach ($tmplvars as $field => $value) { |
550 | 550 | if (!is_array($value)) { |
551 | - if (isset($tvIds[$value])) $tvDeletions[] = $tvIds[$value]; |
|
551 | + if (isset($tvIds[$value])) { |
|
552 | + $tvDeletions[] = $tvIds[$value]; |
|
553 | + } |
|
552 | 554 | } else { |
553 | 555 | $tvId = $value[0]; |
554 | 556 | $tvVal = $value[1]; |
@@ -596,7 +598,9 @@ discard block |
||
596 | 598 | "((1=".(int)$isManager." AND dgn.private_memgroup) OR (1=".(int)$isWeb." AND dgn.private_webgroup)) AND groups.document = '{$id}'" |
597 | 599 | ); |
598 | 600 | $old_groups = array(); |
599 | - while ($row = $modx->db->getRow($rs)) $old_groups[$row['document_group']] = $row['id']; |
|
601 | + while ($row = $modx->db->getRow($rs)) { |
|
602 | + $old_groups[$row['document_group']] = $row['id']; |
|
603 | + } |
|
600 | 604 | |
601 | 605 | // update the permissions in the database |
602 | 606 | $insertions = $deletions = array(); |
@@ -658,9 +662,9 @@ discard block |
||
658 | 662 | $modx->clearCache('full'); |
659 | 663 | } |
660 | 664 | |
661 | - if ($_POST['refresh_preview'] == '1') |
|
662 | - $header = "Location: ".MODX_SITE_URL."index.php?id=$id&z=manprev"; |
|
663 | - else { |
|
665 | + if ($_POST['refresh_preview'] == '1') { |
|
666 | + $header = "Location: ".MODX_SITE_URL."index.php?id=$id&z=manprev"; |
|
667 | + } else { |
|
664 | 668 | if ($_POST['stay'] != '2' && $id > 0) { |
665 | 669 | $modx->unlockElement(7, $id); |
666 | 670 | } |
@@ -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 | $mxla = $modx_lang_attribute ? $modx_lang_attribute : 'en'; |
@@ -9,23 +9,23 @@ discard block |
||
9 | 9 | $modx_textdir = isset($modx_textdir) ? $modx_textdir : null; |
10 | 10 | $onManagerMainFrameHeaderHTMLBlock = is_array($evtOut) ? implode("\n", $evtOut) : ''; |
11 | 11 | $textdir = $modx_textdir === 'rtl' ? 'rtl' : 'ltr'; |
12 | -if (!isset($modx->config['mgr_jquery_path'])) { |
|
12 | +if (!isset($modx->config['mgr_jquery_path'])) { |
|
13 | 13 | $modx->config['mgr_jquery_path'] = 'media/script/jquery/jquery.min.js'; |
14 | 14 | } |
15 | -if (!isset($modx->config['mgr_date_picker_path'])) { |
|
15 | +if (!isset($modx->config['mgr_date_picker_path'])) { |
|
16 | 16 | $modx->config['mgr_date_picker_path'] = 'media/script/air-datepicker/datepicker.inc.php'; |
17 | 17 | } |
18 | 18 | |
19 | -if (isset($_COOKIE['MODX_themeColor'])) { |
|
19 | +if (isset($_COOKIE['MODX_themeColor'])) { |
|
20 | 20 | $body_class .= ' ' . $_COOKIE['MODX_themeColor']; |
21 | -} else { |
|
21 | +} else { |
|
22 | 22 | $body_class .= ' dark'; |
23 | 23 | } |
24 | 24 | |
25 | 25 | $css = 'media/style/' . $modx->config['manager_theme'] . '/style.css?v=' . $lastInstallTime; |
26 | 26 | |
27 | -if ($modx->config['manager_theme'] == 'default') { |
|
28 | - 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')) { |
|
27 | +if ($modx->config['manager_theme'] == 'default') { |
|
28 | + 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')) { |
|
29 | 29 | require_once MODX_BASE_PATH . 'assets/lib/Formatter/CSSMinify.php'; |
30 | 30 | $minifier = new Formatter\CSSMinify(); |
31 | 31 | $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/bootstrap/css/bootstrap.min.css'); |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | $css = $minifier->minify(); |
43 | 43 | file_put_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css', $css); |
44 | 44 | } |
45 | - if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) { |
|
45 | + if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) { |
|
46 | 46 | $css = 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css?v=' . $lastInstallTime; |
47 | 47 | } |
48 | 48 | } |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | stopWorker(); |
366 | 366 | |
367 | 367 | <?php |
368 | - if (isset($_REQUEST['r']) && preg_match('@^[0-9]+$@', $_REQUEST['r'])) { |
|
368 | + if (isset($_REQUEST['r']) && preg_match('@^[0-9]+$@', $_REQUEST['r'])) { |
|
369 | 369 | echo 'doRefresh(' . $_REQUEST['r'] . ");\n"; |
370 | 370 | } |
371 | 371 | ?> |
@@ -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"); |
@@ -11,22 +11,22 @@ discard block |
||
11 | 11 | |
12 | 12 | $mxla = $modx_lang_attribute ? $modx_lang_attribute : 'en'; |
13 | 13 | |
14 | -if (!isset($modx->config['manager_menu_height'])) { |
|
14 | +if (!isset($modx->config['manager_menu_height'])) { |
|
15 | 15 | $modx->config['manager_menu_height'] = 2.2; // rem |
16 | 16 | } |
17 | 17 | |
18 | -if (!isset($modx->config['manager_tree_width'])) { |
|
18 | +if (!isset($modx->config['manager_tree_width'])) { |
|
19 | 19 | $modx->config['manager_tree_width'] = 20; // rem |
20 | 20 | } |
21 | 21 | |
22 | -if (isset($_SESSION['onLoginForwardToAction']) && is_int($_SESSION['onLoginForwardToAction'])) { |
|
22 | +if (isset($_SESSION['onLoginForwardToAction']) && is_int($_SESSION['onLoginForwardToAction'])) { |
|
23 | 23 | $initMainframeAction = $_SESSION['onLoginForwardToAction']; |
24 | 24 | unset($_SESSION['onLoginForwardToAction']); |
25 | -} else { |
|
25 | +} else { |
|
26 | 26 | $initMainframeAction = 2; // welcome.static |
27 | 27 | } |
28 | 28 | |
29 | -if (!isset($_SESSION['tree_show_only_folders'])) { |
|
29 | +if (!isset($_SESSION['tree_show_only_folders'])) { |
|
30 | 30 | $_SESSION['tree_show_only_folders'] = 0; |
31 | 31 | } |
32 | 32 | |
@@ -35,23 +35,23 @@ discard block |
||
35 | 35 | $tree_width = $modx->config['manager_tree_width']; |
36 | 36 | $tree_min_width = 0; |
37 | 37 | |
38 | -if (isset($_COOKIE['MODX_widthSideBar'])) { |
|
38 | +if (isset($_COOKIE['MODX_widthSideBar'])) { |
|
39 | 39 | $MODX_widthSideBar = $_COOKIE['MODX_widthSideBar']; |
40 | -} else { |
|
40 | +} else { |
|
41 | 41 | $MODX_widthSideBar = $tree_width; |
42 | 42 | } |
43 | 43 | |
44 | -if (!$MODX_widthSideBar) { |
|
44 | +if (!$MODX_widthSideBar) { |
|
45 | 45 | $body_class .= 'sidebar-closed'; |
46 | 46 | } |
47 | 47 | |
48 | -if (isset($_COOKIE['MODX_themeColor'])) { |
|
48 | +if (isset($_COOKIE['MODX_themeColor'])) { |
|
49 | 49 | $body_class .= ' ' . $_COOKIE['MODX_themeColor']; |
50 | -} else { |
|
50 | +} else { |
|
51 | 51 | $body_class .= ' dark'; |
52 | 52 | } |
53 | 53 | |
54 | -if (isset($modx->pluginCache['ElementsInTree'])) { |
|
54 | +if (isset($modx->pluginCache['ElementsInTree'])) { |
|
55 | 55 | $body_class .= ' ElementsInTree'; |
56 | 56 | } |
57 | 57 | |
@@ -67,19 +67,19 @@ discard block |
||
67 | 67 | 'type8' => $_lang["lock_element_type_8"] |
68 | 68 | ); |
69 | 69 | |
70 | -foreach ($unlockTranslations as $key => $value) { |
|
70 | +foreach ($unlockTranslations as $key => $value) { |
|
71 | 71 | $unlockTranslations[$key] = iconv($modx->config["modx_charset"], "utf-8", $value); |
72 | 72 | } |
73 | 73 | |
74 | 74 | $user = $modx->getUserInfo($modx->getLoginUserID()); |
75 | -if ($user['which_browser'] == 'default') { |
|
75 | +if ($user['which_browser'] == 'default') { |
|
76 | 76 | $user['which_browser'] = $modx->config['which_browser']; |
77 | 77 | } |
78 | 78 | |
79 | 79 | $css = 'media/style/' . $modx->config['manager_theme'] . '/css/page.css?v=' . $lastInstallTime; |
80 | 80 | |
81 | -if ($modx->config['manager_theme'] == 'default') { |
|
82 | - 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')) { |
|
81 | +if ($modx->config['manager_theme'] == 'default') { |
|
82 | + 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')) { |
|
83 | 83 | require_once MODX_BASE_PATH . 'assets/lib/Formatter/CSSMinify.php'; |
84 | 84 | $minifier = new Formatter\CSSMinify(); |
85 | 85 | $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/bootstrap/css/bootstrap.min.css'); |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | $css = $minifier->minify(); |
97 | 97 | file_put_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css', $css); |
98 | 98 | } |
99 | - if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) { |
|
99 | + if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) { |
|
100 | 100 | $css = 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css?v=' . $lastInstallTime; |
101 | 101 | } |
102 | 102 | } |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | <?php |
251 | 251 | // invoke OnManagerTopPrerender event |
252 | 252 | $evtOut = $modx->invokeEvent('OnManagerTopPrerender', $_REQUEST); |
253 | - if (is_array($evtOut)) { |
|
253 | + if (is_array($evtOut)) { |
|
254 | 254 | echo implode("\n", $evtOut); |
255 | 255 | } |
256 | 256 | ?> |
@@ -421,9 +421,12 @@ discard block |
||
421 | 421 | <div id="evo-tab-page-home" class="evo-tab-page show"> |
422 | 422 | <iframe id="mainframe" src="index.php?a=<?= $initMainframeAction ?>" scrolling="auto" frameborder="0" onload="modx.main.onload(event);"></iframe> |
423 | 423 | </div> |
424 | - <?php else: ?> |
|
424 | + <?php else { |
|
425 | + : ?> |
|
425 | 426 | <iframe id="mainframe" name="main" src="index.php?a=<?= $initMainframeAction ?>" scrolling="auto" frameborder="0" onload="modx.main.onload(event);"></iframe> |
426 | - <?php endif; ?> |
|
427 | + <?php endif; |
|
428 | +} |
|
429 | +?> |
|
427 | 430 | <div id="mainloader"></div> |
428 | 431 | </div> |
429 | 432 | <div id="resizer"></div> |
@@ -436,11 +439,11 @@ discard block |
||
436 | 439 | 'tree_sortdir', |
437 | 440 | 'tree_nodename' |
438 | 441 | ); |
439 | - foreach ($sortParams as $param) { |
|
440 | - if (isset($_REQUEST[$param])) { |
|
442 | + foreach ($sortParams as $param) { |
|
443 | + if (isset($_REQUEST[$param])) { |
|
441 | 444 | $modx->manager->saveLastUserSetting($param, $_REQUEST[$param]); |
442 | 445 | $_SESSION[$param] = $_REQUEST[$param]; |
443 | - } else if (!isset($_SESSION[$param])) { |
|
446 | + } else if (!isset($_SESSION[$param])) { |
|
444 | 447 | $_SESSION[$param] = $modx->manager->getLastUserSetting($param); |
445 | 448 | } |
446 | 449 | } |
@@ -526,9 +529,9 @@ discard block |
||
526 | 529 | * @param string $text |
527 | 530 | * @param bool $allowed |
528 | 531 | */ |
529 | - function constructLink($action, $img, $text, $allowed) |
|
530 | - { |
|
531 | - if ((bool)$allowed) { |
|
532 | + function constructLink($action, $img, $text, $allowed) |
|
533 | + { |
|
534 | + if ((bool)$allowed) { |
|
532 | 535 | echo sprintf('<div class="menuLink" id="item%s" onclick="modx.tree.menuHandler(%s);">', $action, $action); |
533 | 536 | echo sprintf('<i class="%s"></i> %s</div>', $img, $text); |
534 | 537 | } |
@@ -633,7 +636,7 @@ discard block |
||
633 | 636 | ?> |
634 | 637 | |
635 | 638 | </div> |
636 | -<?php if ($modx->config['show_picker'] != "0") { |
|
639 | +<?php if ($modx->config['show_picker'] != "0") { |
|
637 | 640 | include('media/style/' . $modx->config['manager_theme'] . '/color.switcher.php'); |
638 | 641 | } ?> |
639 | 642 | </body> |