@@ -1,10 +1,10 @@ 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 | |
6 | 6 | // show debug information |
7 | -if(isset($enable_debug) && $enable_debug==true) { |
|
7 | +if (isset($enable_debug) && $enable_debug == true) { |
|
8 | 8 | ?> |
9 | 9 | <script language="javascript"> |
10 | 10 | //document.onload = removeDebug(); |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | } |
36 | 36 | </style> |
37 | 37 | <?php |
38 | - $mtime = microtime(); $mtime = explode(" ",$mtime); $mtime = $mtime[1] + $mtime[0]; $tend = $mtime; $totaltime = ($tend - $tstart); |
|
38 | + $mtime = microtime(); $mtime = explode(" ", $mtime); $mtime = $mtime[1] + $mtime[0]; $tend = $mtime; $totaltime = ($tend - $tstart); |
|
39 | 39 | ?> |
40 | 40 | <div class='debug' id='debug' name='debug' onClick="removeDebugDiv();"> |
41 | 41 | <table border="0" cellspacing="0" cellpadding="0"> |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | </tr> |
45 | 45 | <tr> |
46 | 46 | <td width="70">Time taken</td> |
47 | - <td width="80"><?php echo printf ("%6.5f s", $totaltime); ?></td> |
|
47 | + <td width="80"><?php echo printf("%6.5f s", $totaltime); ?></td> |
|
48 | 48 | </tr> |
49 | 49 | </table> |
50 | 50 | </div> |
@@ -1,10 +1,10 @@ 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 | global $SystemAlertMsgQueque; |
6 | 6 | // display system alert window if messages are available |
7 | -if(count($SystemAlertMsgQueque) > 0) { |
|
7 | +if (count($SystemAlertMsgQueque) > 0) { |
|
8 | 8 | include "sysalert.display.inc.php"; |
9 | 9 | } |
10 | 10 | ?> |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | }); |
19 | 19 | </script> |
20 | 20 | <?php |
21 | -if(in_array($modx->manager->action, array( |
|
21 | +if (in_array($modx->manager->action, array( |
|
22 | 22 | 85, |
23 | 23 | 27, |
24 | 24 | 4, |
@@ -1,8 +1,8 @@ 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('export_static')) { |
|
5 | +if (!$modx->hasPermission('export_static')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
@@ -12,15 +12,15 @@ discard block |
||
12 | 12 | $modx->loadExtension('EXPORT_SITE'); |
13 | 13 | |
14 | 14 | |
15 | -if(is_dir(MODX_BASE_PATH . 'temp')) $export_dir = MODX_BASE_PATH . 'temp/export'; |
|
16 | -elseif(is_dir(MODX_BASE_PATH . 'assets')) $export_dir = MODX_BASE_PATH . 'assets/export'; |
|
15 | +if (is_dir(MODX_BASE_PATH.'temp')) $export_dir = MODX_BASE_PATH.'temp/export'; |
|
16 | +elseif (is_dir(MODX_BASE_PATH.'assets')) $export_dir = MODX_BASE_PATH.'assets/export'; |
|
17 | 17 | $modx->export->targetDir = $export_dir; |
18 | 18 | |
19 | -if(strpos($modx->config['base_path'],"{$export_dir}/")===0 && 0 <= strlen(str_replace("{$export_dir}/",'',$modx->config['base_path']))) |
|
19 | +if (strpos($modx->config['base_path'], "{$export_dir}/") === 0 && 0 <= strlen(str_replace("{$export_dir}/", '', $modx->config['base_path']))) |
|
20 | 20 | return $_lang['export_site.static.php6']; |
21 | -elseif($modx->config['rb_base_dir'] === $export_dir . '/') |
|
22 | - return $modx->parsePlaceholder($_lang['export_site.static.php7'],'rb_base_url=' . $modx->config['base_url'] . $modx->config['rb_base_url']); |
|
23 | -elseif(!is_writable($export_dir)) |
|
21 | +elseif ($modx->config['rb_base_dir'] === $export_dir.'/') |
|
22 | + return $modx->parsePlaceholder($_lang['export_site.static.php7'], 'rb_base_url='.$modx->config['base_url'].$modx->config['rb_base_url']); |
|
23 | +elseif (!is_writable($export_dir)) |
|
24 | 24 | return $_lang['export_site_target_unwritable']; |
25 | 25 | |
26 | 26 | $modx->export->generate_mode = $_POST['generate_mode']; |
@@ -33,10 +33,10 @@ discard block |
||
33 | 33 | $repl_after = $_POST['repl_after']; |
34 | 34 | $includenoncache = $_POST['includenoncache']; |
35 | 35 | |
36 | -if($ignore_ids!==$_POST['ignore_ids'] |
|
37 | - ||$includenoncache!==$_POST['includenoncache'] |
|
38 | - ||$repl_before!==$_POST['repl_before'] |
|
39 | - ||$repl_after !==$_POST['repl_after']) { |
|
36 | +if ($ignore_ids !== $_POST['ignore_ids'] |
|
37 | + ||$includenoncache !== $_POST['includenoncache'] |
|
38 | + ||$repl_before !== $_POST['repl_before'] |
|
39 | + ||$repl_after !== $_POST['repl_after']) { |
|
40 | 40 | $modx->clearCache('full'); |
41 | 41 | } |
42 | 42 | |
@@ -52,5 +52,5 @@ discard block |
||
52 | 52 | |
53 | 53 | $exportend = $modx->export->get_mtime(); |
54 | 54 | $totaltime = ($exportend - $modx->export->exportstart); |
55 | -$output .= sprintf ('<p>'.$_lang["export_site_time"].'</p>', round($totaltime, 3)); |
|
55 | +$output .= sprintf('<p>'.$_lang["export_site_time"].'</p>', round($totaltime, 3)); |
|
56 | 56 | return $output; |
@@ -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 | |
@@ -41,4 +41,4 @@ discard block |
||
41 | 41 | )); |
42 | 42 | |
43 | 43 | // show login screen |
44 | -header('Location: ' . MODX_MANAGER_URL); |
|
44 | +header('Location: '.MODX_MANAGER_URL); |
@@ -1,15 +1,15 @@ 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('save_role')) { |
|
5 | +if (!$modx->hasPermission('save_role')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
9 | 9 | extract($_POST); |
10 | 10 | |
11 | -if($name == '' || !isset ($name)) { |
|
12 | - $modx->webAlertAndQuit("Please enter a name for this role!", "index.php?a={$mode}" . ($mode = 35 ? "&id={$id}" : "")); |
|
11 | +if ($name == '' || !isset ($name)) { |
|
12 | + $modx->webAlertAndQuit("Please enter a name for this role!", "index.php?a={$mode}".($mode = 35 ? "&id={$id}" : "")); |
|
13 | 13 | } |
14 | 14 | |
15 | 15 | // setup fields |
@@ -91,13 +91,13 @@ discard block |
||
91 | 91 | |
92 | 92 | $fields = $modx->db->escape($fields); |
93 | 93 | |
94 | -switch($_POST['mode']) { |
|
94 | +switch ($_POST['mode']) { |
|
95 | 95 | case '38' : |
96 | 96 | $tbl = $modx->getFullTableName("user_roles"); |
97 | 97 | |
98 | 98 | // disallow duplicate names for role |
99 | 99 | $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_roles'), "name='{$fields['name']}'"); |
100 | - if($modx->db->getValue($rs) > 0) { |
|
100 | + if ($modx->db->getValue($rs) > 0) { |
|
101 | 101 | $modx->manager->saveFormValues(38); |
102 | 102 | $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_general'], $_lang['role'], $name), "index.php?a=38"); |
103 | 103 | } |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | |
116 | 116 | // disallow duplicate names for role |
117 | 117 | $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_roles'), "name='{$fields['name']}' AND id!='{$id}'"); |
118 | - if($modx->db->getValue($rs) > 0) { |
|
118 | + if ($modx->db->getValue($rs) > 0) { |
|
119 | 119 | $modx->manager->saveFormValues(35); |
120 | 120 | $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_general'], $_lang['role'], $name), "index.php?a=35&id={$id}"); |
121 | 121 | } |
@@ -1,9 +1,9 @@ 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 | exit(); |
4 | 4 | } |
5 | 5 | |
6 | -if(!$modx->hasPermission('delete_plugin')) { |
|
6 | +if (!$modx->hasPermission('delete_plugin')) { |
|
7 | 7 | $e->setError(3); |
8 | 8 | $e->dumpError(); |
9 | 9 | } |
@@ -14,18 +14,18 @@ discard block |
||
14 | 14 | // Get unique list of latest added plugins by highest sql-id |
15 | 15 | $rs = $modx->db->query("SELECT t1.id FROM {$tbl_site_plugins} t1 LEFT JOIN {$tbl_site_plugins} t2 ON (t1.name = t2.name AND t1.id < t2.id) WHERE t2.id IS NULL;"); |
16 | 16 | $latestIds = array(); |
17 | -while($row = $modx->db->getRow($rs)) { |
|
17 | +while ($row = $modx->db->getRow($rs)) { |
|
18 | 18 | $latestIds[] = $row['id']; |
19 | 19 | } |
20 | 20 | |
21 | 21 | // Get list of plugins with disabled and enabled versions |
22 | 22 | $rs = $modx->db->query("SELECT id FROM {$tbl_site_plugins} t1 WHERE disabled = 1 AND name IN (SELECT name FROM {$tbl_site_plugins} t2 WHERE t1.name = t2.name AND t1.id != t2.id)"); |
23 | 23 | |
24 | -while($row = $modx->db->getRow($rs)) { |
|
24 | +while ($row = $modx->db->getRow($rs)) { |
|
25 | 25 | |
26 | 26 | $id = $row['id']; |
27 | 27 | |
28 | - if(in_array($id,$latestIds)) continue; // Keep latest version of disabled plugins |
|
28 | + if (in_array($id, $latestIds)) continue; // Keep latest version of disabled plugins |
|
29 | 29 | |
30 | 30 | // invoke OnBeforePluginFormDelete event |
31 | 31 | $modx->invokeEvent('OnBeforePluginFormDelete', array('id'=> $id)); |
@@ -1,8 +1,8 @@ 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('delete_document')) { |
|
5 | +if (!$modx->hasPermission('delete_document')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
@@ -42,5 +42,5 @@ discard block |
||
42 | 42 | $modx->clearCache('full'); |
43 | 43 | |
44 | 44 | // finished emptying cache - redirect |
45 | - $header="Location: index.php?a=2&r=1"; |
|
45 | + $header = "Location: index.php?a=2&r=1"; |
|
46 | 46 | header($header); |
@@ -1,8 +1,8 @@ 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('save_password')) { |
|
5 | +if (!$modx->hasPermission('save_password')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
@@ -10,11 +10,11 @@ discard block |
||
10 | 10 | $pass1 = $_POST['pass1']; |
11 | 11 | $pass2 = $_POST['pass2']; |
12 | 12 | |
13 | -if($pass1!=$pass2){ |
|
13 | +if ($pass1 != $pass2) { |
|
14 | 14 | $modx->webAlertAndQuit("Passwords don't match!"); |
15 | 15 | } |
16 | 16 | |
17 | -if(strlen($pass1)<6){ |
|
17 | +if (strlen($pass1) < 6) { |
|
18 | 18 | $modx->webAlertAndQuit("Password is too short. Please specify a password of at least 6 characters."); |
19 | 19 | } |
20 | 20 | |
@@ -23,14 +23,14 @@ discard block |
||
23 | 23 | $uid = $modx->getLoginUserID(); |
24 | 24 | $modx->loadExtension('phpass'); |
25 | 25 | $f['password'] = $modx->phpass->HashPassword($pass1); |
26 | - $modx->db->update($f,$tbl_manager_users,"id='{$uid}'"); |
|
26 | + $modx->db->update($f, $tbl_manager_users, "id='{$uid}'"); |
|
27 | 27 | |
28 | 28 | // invoke OnManagerChangePassword event |
29 | - $modx->invokeEvent('OnManagerChangePassword', array ( |
|
29 | + $modx->invokeEvent('OnManagerChangePassword', array( |
|
30 | 30 | 'userid' => $uid, |
31 | 31 | 'username' => $_SESSION['mgrShortname'], |
32 | 32 | 'userpassword' => $pass1 |
33 | 33 | )); |
34 | 34 | |
35 | -$header="Location: index.php?a=2"; |
|
35 | +$header = "Location: index.php?a=2"; |
|
36 | 36 | header($header); |
@@ -1,12 +1,12 @@ |
||
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 | |
9 | 9 | $modx->db->truncate($modx->getFullTableName('manager_log')); |
10 | 10 | |
11 | -$header="Location: index.php?a=13"; |
|
11 | +$header = "Location: index.php?a=13"; |
|
12 | 12 | header($header); |