@@ -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); |
@@ -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('messages')) { |
|
5 | +if (!$modx->hasPermission('messages')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
@@ -10,13 +10,13 @@ discard block |
||
10 | 10 | $userid = $_REQUEST['user']; |
11 | 11 | $groupid = $_REQUEST['group']; |
12 | 12 | $subject = $modx->db->escape($_REQUEST['messagesubject']); |
13 | -if($subject=="") $subject="(no subject)"; |
|
13 | +if ($subject == "") $subject = "(no subject)"; |
|
14 | 14 | $message = $modx->db->escape($_REQUEST['messagebody']); |
15 | -if($message=="") $message="(no message)"; |
|
15 | +if ($message == "") $message = "(no message)"; |
|
16 | 16 | $postdate = time(); |
17 | 17 | |
18 | -if($sendto=='u') { |
|
19 | - if($userid==0) { |
|
18 | +if ($sendto == 'u') { |
|
19 | + if ($userid == 0) { |
|
20 | 20 | $modx->webAlertAndQuit($_lang["error_no_user_selected"]); |
21 | 21 | } |
22 | 22 | $modx->db->insert( |
@@ -31,12 +31,12 @@ discard block |
||
31 | 31 | ), $modx->getFullTableName('user_messages')); |
32 | 32 | } |
33 | 33 | |
34 | -if($sendto=='g') { |
|
35 | - if($groupid==0) { |
|
34 | +if ($sendto == 'g') { |
|
35 | + if ($groupid == 0) { |
|
36 | 36 | $modx->webAlertAndQuit($_lang["error_no_group_selected"]); |
37 | 37 | } |
38 | 38 | $rs = $modx->db->select('internalKey', $modx->getFullTableName('user_attributes'), "role='{$groupid}' AND internalKey!='".$modx->getLoginUserID()."'"); |
39 | - while ($row=$modx->db->getRow($rs)) { |
|
39 | + while ($row = $modx->db->getRow($rs)) { |
|
40 | 40 | $modx->db->insert( |
41 | 41 | array( |
42 | 42 | 'recipient' => $row['internalKey'], |
@@ -51,9 +51,9 @@ discard block |
||
51 | 51 | } |
52 | 52 | |
53 | 53 | |
54 | -if($sendto=='a') { |
|
54 | +if ($sendto == 'a') { |
|
55 | 55 | $rs = $modx->db->select('id', $modx->getFullTableName('manager_users'), "id!='".$modx->getLoginUserID()."'"); |
56 | - while ($row=$modx->db->getRow($rs)) { |
|
56 | + while ($row = $modx->db->getRow($rs)) { |
|
57 | 57 | $modx->db->insert( |
58 | 58 | array( |
59 | 59 | 'recipient' => $row['id'], |
@@ -1,11 +1,11 @@ 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 | // invoke OnManagerTreeInit event |
7 | 7 | $evtOut = $modx->invokeEvent('OnManagerTreeInit', $_REQUEST); |
8 | -if(is_array($evtOut)) { |
|
8 | +if (is_array($evtOut)) { |
|
9 | 9 | echo implode("\n", $evtOut); |
10 | 10 | } |
11 | 11 | ?> |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | |
18 | 18 | <a class="treeButton" id="treeMenu_collapsetree" onclick="modx.tree.collapseTree();" title="<?php echo $_lang['collapse_tree']; ?>"><?php echo $_style['collapse_tree']; ?></a> |
19 | 19 | |
20 | - <?php if($modx->hasPermission('new_document')) { ?> |
|
20 | + <?php if ($modx->hasPermission('new_document')) { ?> |
|
21 | 21 | <a class="treeButton" id="treeMenu_addresource" onclick="modx.tabs({url:'<?= MODX_MANAGER_URL ?>?a=4', title: '<?php echo $_lang['add_resource']; ?>'});" title="<?php echo $_lang['add_resource']; ?>"><?php echo $_style['add_doc_tree']; ?></a> |
22 | 22 | <a class="treeButton" id="treeMenu_addweblink" onclick="modx.tabs({url:'<?= MODX_MANAGER_URL ?>?a=72', title: '<?php echo $_lang['add_weblink']; ?>'});" title="<?php echo $_lang['add_weblink']; ?>"><?php echo $_style['add_weblink_tree']; ?></a> |
23 | 23 | <?php } ?> |
@@ -26,23 +26,23 @@ discard block |
||
26 | 26 | |
27 | 27 | <a class="treeButton" id="treeMenu_sortingtree" onclick="modx.tree.showSorter(event);" title="<?php echo $_lang['sort_tree']; ?>"><?php echo $_style['sort_tree']; ?></a> |
28 | 28 | |
29 | - <?php if($modx->hasPermission('edit_document') && $modx->hasPermission('save_document')) { ?> |
|
29 | + <?php if ($modx->hasPermission('edit_document') && $modx->hasPermission('save_document')) { ?> |
|
30 | 30 | <a class="treeButton" id="treeMenu_sortingindex" onclick="modx.tabs({url: '<?= MODX_MANAGER_URL ?>?a=56&id=0', title: '<?php echo $_lang['sort_menuindex']; ?>'});" title="<?php echo $_lang['sort_menuindex']; ?>"><?php echo $_style['sort_menuindex']; ?></a> |
31 | 31 | <?php } ?> |
32 | 32 | |
33 | - <?php if($use_browser && $modx->hasPermission('assets_images')) { ?> |
|
34 | - <a class="treeButton" id="treeMenu_openimages" title="<?php echo $_lang["images_management"] . "\n" . $_lang['em_button_shift'] ?>"><?php echo $_style['images_management']; ?></a> |
|
33 | + <?php if ($use_browser && $modx->hasPermission('assets_images')) { ?> |
|
34 | + <a class="treeButton" id="treeMenu_openimages" title="<?php echo $_lang["images_management"]."\n".$_lang['em_button_shift'] ?>"><?php echo $_style['images_management']; ?></a> |
|
35 | 35 | <?php } ?> |
36 | 36 | |
37 | - <?php if($use_browser && $modx->hasPermission('assets_files')) { ?> |
|
38 | - <a class="treeButton" id="treeMenu_openfiles" title="<?php echo $_lang["files_management"] . "\n" . $_lang['em_button_shift'] ?>"><?php echo $_style['files_management']; ?></a> |
|
37 | + <?php if ($use_browser && $modx->hasPermission('assets_files')) { ?> |
|
38 | + <a class="treeButton" id="treeMenu_openfiles" title="<?php echo $_lang["files_management"]."\n".$_lang['em_button_shift'] ?>"><?php echo $_style['files_management']; ?></a> |
|
39 | 39 | <?php } ?> |
40 | 40 | |
41 | - <?php if($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin')) { ?> |
|
42 | - <a class="treeButton" id="treeMenu_openelements" title="<?php echo $_lang["element_management"] . "\n" . $_lang['em_button_shift'] ?>"><?php echo $_style['element_management']; ?></a> |
|
41 | + <?php if ($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin')) { ?> |
|
42 | + <a class="treeButton" id="treeMenu_openelements" title="<?php echo $_lang["element_management"]."\n".$_lang['em_button_shift'] ?>"><?php echo $_style['element_management']; ?></a> |
|
43 | 43 | <?php } ?> |
44 | 44 | |
45 | - <?php if($modx->hasPermission('empty_trash')) { ?> |
|
45 | + <?php if ($modx->hasPermission('empty_trash')) { ?> |
|
46 | 46 | <a class="treeButton treeButtonDisabled" id="treeMenu_emptytrash" title="<?php echo $_lang['empty_recycle_bin_empty']; ?>"><?php echo $_style['empty_recycle_bin_empty']; ?></a> |
47 | 47 | <?php } ?> |
48 | 48 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | <?php |
55 | 55 | // invoke OnManagerTreePrerender event |
56 | 56 | $evtOut = $modx->invokeEvent('OnManagerTreePrerender', $modx->db->escape($_REQUEST)); |
57 | - if(is_array($evtOut)) { |
|
57 | + if (is_array($evtOut)) { |
|
58 | 58 | echo implode("\n", $evtOut); |
59 | 59 | } |
60 | 60 | ?> |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | <?php |
67 | 67 | // invoke OnManagerTreeRender event |
68 | 68 | $evtOut = $modx->invokeEvent('OnManagerTreeRender', $modx->db->escape($_REQUEST)); |
69 | - if(is_array($evtOut)) { |
|
69 | + if (is_array($evtOut)) { |
|
70 | 70 | echo implode("\n", $evtOut); |
71 | 71 | } |
72 | 72 | ?> |