Completed
Push — develop ( d568f8...c061fc )
by Agel_Nash
06:25
created
manager/processors/save_settings.processor.php 2 patches
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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('settings')) {
@@ -9,13 +9,13 @@  discard block
 block discarded – undo
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) {
13
-    $htaccess        = $modx->config['base_path'] . '.htaccess';
14
-    $sample_htaccess = $modx->config['base_path'] . 'ht.access';
15
-    $dir = '/' . trim($modx->config['base_url'], '/');
12
+if ($data['friendly_urls'] === '1' && strpos($_SERVER['SERVER_SOFTWARE'], 'IIS') === false) {
13
+    $htaccess        = $modx->config['base_path'].'.htaccess';
14
+    $sample_htaccess = $modx->config['base_path'].'ht.access';
15
+    $dir = '/'.trim($modx->config['base_url'], '/');
16 16
     if (is_file($htaccess)) {
17 17
         $_ = file_get_contents($htaccess);
18
-        if (strpos($_, 'RewriteBase')===false) {
18
+        if (strpos($_, 'RewriteBase') === false) {
19 19
             $warnings[] = $_lang["settings_friendlyurls_alert2"];
20 20
         } elseif (is_writable($htaccess)) {
21 21
             $_ = preg_replace('@RewriteBase.+@', "RewriteBase {$dir}", $_);
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
     } elseif (is_file($sample_htaccess)) {
27 27
         if (!@rename($sample_htaccess, $htaccess)) {
28 28
             $warnings[] = $_lang["settings_friendlyurls_alert"];
29
-        } elseif ($modx->config['base_url']!=='/') {
29
+        } elseif ($modx->config['base_url'] !== '/') {
30 30
             $_ = file_get_contents($htaccess);
31 31
             $_ = preg_replace('@RewriteBase.+@', "RewriteBase {$dir}", $_);
32 32
             if (!@file_put_contents($htaccess, $_)) {
@@ -36,8 +36,8 @@  discard block
 block discarded – undo
36 36
     }
37 37
 }
38 38
 
39
-if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) {
40
-    unlink(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css');
39
+if (file_exists(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css')) {
40
+    unlink(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css');
41 41
 }
42 42
 
43 43
 $data['filemanager_path'] = str_replace('[(base_path)]', MODX_BASE_PATH, $data['filemanager_path']);
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 
46 46
 if (isset($data) && count($data) > 0) {
47 47
     if (isset($data['manager_language'])) {
48
-        $lang_path = MODX_MANAGER_PATH . 'includes/lang/' . $data['manager_language'] . '.inc.php';
48
+        $lang_path = MODX_MANAGER_PATH.'includes/lang/'.$data['manager_language'].'.inc.php';
49 49
         if (is_file($lang_path)) {
50 50
             include($lang_path);
51 51
             global $modx_lang_attribute;
@@ -54,15 +54,15 @@  discard block
 block discarded – undo
54 54
     }
55 55
     $savethese = array();
56 56
     $data['sys_files_checksum'] = $modx->manager->getSystemChecksum($data['check_files_onlogin']);
57
-    $data['mail_check_timeperiod'] = (int)$data['mail_check_timeperiod'] < 60 ? 60 : $data['mail_check_timeperiod']; // updateMail() in mainMenu no faster than every minute
57
+    $data['mail_check_timeperiod'] = (int) $data['mail_check_timeperiod'] < 60 ? 60 : $data['mail_check_timeperiod']; // updateMail() in mainMenu no faster than every minute
58 58
     foreach ($data as $k => $v) {
59 59
         switch ($k) {
60 60
             case 'site_name':
61 61
                 $v = htmlspecialchars($v);
62 62
                 break;
63 63
             case 'settings_version':{
64
-                if ($modx->getVersionData('version')!=$data['settings_version']) {
65
-                    $modx->logEvent(17, 2, '<pre>' . var_export($data['settings_version'], true) . '</pre>', 'fake settings_version');
64
+                if ($modx->getVersionData('version') != $data['settings_version']) {
65
+                    $modx->logEvent(17, 2, '<pre>'.var_export($data['settings_version'], true).'</pre>', 'fake settings_version');
66 66
                     $v = $modx->getVersionData('version');
67 67
                 }
68 68
                 break;
@@ -83,11 +83,11 @@  discard block
 block discarded – undo
83 83
             case 'rb_base_url':
84 84
             case 'filemanager_path':
85 85
                 $v = trim($v);
86
-                $v = rtrim($v, '/') . '/';
86
+                $v = rtrim($v, '/').'/';
87 87
                 break;
88 88
             case 'manager_language':
89
-                $langDir = realpath(MODX_MANAGER_PATH . 'includes/lang');
90
-                $langFile = realpath(MODX_MANAGER_PATH . 'includes/lang/' . $v . '.inc.php');
89
+                $langDir = realpath(MODX_MANAGER_PATH.'includes/lang');
90
+                $langFile = realpath(MODX_MANAGER_PATH.'includes/lang/'.$v.'.inc.php');
91 91
                 $langFileDir = dirname($langFile);
92 92
                 if ($langDir !== $langFileDir || !file_exists($langFile)) {
93 93
                     $v = 'english';
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
             case 'smtppw':
97 97
                 if ($v !== '********************' && $v !== '') {
98 98
                     $v = trim($v);
99
-                    $v = base64_encode($v) . substr(str_shuffle('abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789'), 0, 7);
99
+                    $v = base64_encode($v).substr(str_shuffle('abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789'), 0, 7);
100 100
                     $v = str_replace('=', '%', $v);
101 101
                 } elseif ($v === '********************') {
102 102
                     $k = '';
@@ -106,14 +106,14 @@  discard block
 block discarded – undo
106 106
                 $v = str_replace(array(' ,', ', '), ',', $v);
107 107
                 if ($v !== ',') {
108 108
                     $v = ($v != 'MODX_SITE_HOSTNAMES') ? $v : '';
109
-                    $configString = '<?php' . "\n" . 'define(\'MODX_SITE_HOSTNAMES\', \'' . $v . '\');' . "\n";
110
-                    @file_put_contents(MODX_BASE_PATH . 'assets/cache/siteHostnames.php', $configString);
109
+                    $configString = '<?php'."\n".'define(\'MODX_SITE_HOSTNAMES\', \''.$v.'\');'."\n";
110
+                    @file_put_contents(MODX_BASE_PATH.'assets/cache/siteHostnames.php', $configString);
111 111
                 }
112 112
                 $k = '';
113 113
                 break;
114 114
             case 'session_timeout':
115 115
                 $mail_check_timeperiod = $data['mail_check_timeperiod'];
116
-                $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
116
+                $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
117 117
                 break;
118 118
             default:
119 119
             break;
@@ -123,24 +123,24 @@  discard block
 block discarded – undo
123 123
         $modx->config[$k] = $v;
124 124
 
125 125
         if (!empty($k)) {
126
-            $savethese[] = '(\'' . $modx->db->escape($k) . '\', \'' . $modx->db->escape($v) . '\')';
126
+            $savethese[] = '(\''.$modx->db->escape($k).'\', \''.$modx->db->escape($v).'\')';
127 127
         }
128 128
     }
129 129
 
130 130
     // Run a single query to save all the values
131
-    $sql = "REPLACE INTO " . $modx->getFullTableName("system_settings") . " (setting_name, setting_value)
131
+    $sql = "REPLACE INTO ".$modx->getFullTableName("system_settings")." (setting_name, setting_value)
132 132
 		VALUES " . implode(', ', $savethese);
133 133
     $modx->db->query($sql);
134 134
 
135 135
     // Reset Template Pages
136 136
     if (isset($data['reset_template'])) {
137
-        $newtemplate = (int)$data['default_template'];
138
-        $oldtemplate = (int)$data['old_template'];
137
+        $newtemplate = (int) $data['default_template'];
138
+        $oldtemplate = (int) $data['old_template'];
139 139
         $tbl = $modx->getFullTableName('site_content');
140 140
         $reset = $data['reset_template'];
141
-        if ($reset==1) {
141
+        if ($reset == 1) {
142 142
             $modx->db->update(array('template' => $newtemplate), $tbl, "type='document'");
143
-        } elseif ($reset==2) {
143
+        } elseif ($reset == 2) {
144 144
             $modx->db->update(array('template' => $newtemplate), $tbl, "template='{$oldtemplate}'");
145 145
         }
146 146
     }
@@ -148,5 +148,5 @@  discard block
 block discarded – undo
148 148
     // empty cache
149 149
     $modx->clearCache('full');
150 150
 }
151
-$header="Location: index.php?a=7&r=10";
151
+$header = "Location: index.php?a=7&r=10";
152 152
 header($header);
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
         if (strpos($_, 'RewriteBase')===false) {
19 19
             $warnings[] = $_lang["settings_friendlyurls_alert2"];
20 20
         } elseif (is_writable($htaccess)) {
21
-            $_ = preg_replace('@RewriteBase.+@', "RewriteBase {$dir}", $_);
21
+            $_ = preg_replace('@RewriteBase.+@', "rewritebase {$dir}", $_);
22 22
             if (!@file_put_contents($htaccess, $_)) {
23 23
                 $warnings[] = $_lang["settings_friendlyurls_alert2"];
24 24
             }
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
             $warnings[] = $_lang["settings_friendlyurls_alert"];
29 29
         } elseif ($modx->config['base_url']!=='/') {
30 30
             $_ = file_get_contents($htaccess);
31
-            $_ = preg_replace('@RewriteBase.+@', "RewriteBase {$dir}", $_);
31
+            $_ = preg_replace('@RewriteBase.+@', "rewritebase {$dir}", $_);
32 32
             if (!@file_put_contents($htaccess, $_)) {
33 33
                 $warnings[] = $_lang["settings_friendlyurls_alert2"];
34 34
             }
Please login to merge, or discard this patch.
manager/processors/delete_template.processor.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@  discard block
 block discarded – undo
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('delete_template')) {
6 6
     $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = isset($_GET['id']) ? (int)$_GET['id'] : 0;
9
+$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
10 10
 if ($id == 0) {
11 11
     $modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 			<ul>
29 29
 				<?php
30 30
                 while ($row = $modx->db->getRow($rs)) {
31
-                    echo '<li><span style="width: 200px"><a href="index.php?id=' . $row['id'] . '&a=27">' . $row['pagetitle'] . '</a></span>' . ($row['introtext'] != '' ? ' - ' . $row['introtext'] : '') . '</li>';
31
+                    echo '<li><span style="width: 200px"><a href="index.php?id='.$row['id'].'&a=27">'.$row['pagetitle'].'</a></span>'.($row['introtext'] != '' ? ' - '.$row['introtext'] : '').'</li>';
32 32
                 } ?>
33 33
 			</ul>
34 34
 		</div>
Please login to merge, or discard this patch.
manager/processors/duplicate_plugin.processor.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,21 +1,21 @@  discard block
 block discarded – undo
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('new_plugin')) {
6 6
     $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = isset($_GET['id'])? (int)$_GET['id'] : 0;
10
-if ($id==0) {
9
+$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
10
+if ($id == 0) {
11 11
     $modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
14 14
 // count duplicates
15 15
 $name = $modx->db->getValue($modx->db->select('name', $modx->getFullTableName('site_plugins'), "id='{$id}'"));
16 16
 $count = $modx->db->getRecordCount($modx->db->select('name', $modx->getFullTableName('site_plugins'), "name LIKE '{$name} {$_lang['duplicated_el_suffix']}%'"));
17
-if ($count>=1) {
18
-    $count = ' ' . ($count+1);
17
+if ($count >= 1) {
18
+    $count = ' '.($count + 1);
19 19
 } else {
20 20
     $count = '';
21 21
 }
@@ -47,5 +47,5 @@  discard block
 block discarded – undo
47 47
 $_SESSION['itemname'] = $name;
48 48
 
49 49
 // finish duplicating - redirect to new plugin
50
-$header="Location: index.php?r=2&a=102&id=$newid";
50
+$header = "Location: index.php?r=2&a=102&id=$newid";
51 51
 header($header);
Please login to merge, or discard this patch.
manager/processors/delete_eventlog.processor.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@  discard block
 block discarded – undo
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('delete_eventlog')) {
6 6
     $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-if (isset($_GET['cls']) && $_GET['cls']==1) {
9
+if (isset($_GET['cls']) && $_GET['cls'] == 1) {
10 10
     $where = '';
11 11
 } else {
12
-    $id = isset($_GET['id'])? (int)$_GET['id'] : 0;
13
-    if ($id==0) {
12
+    $id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
13
+    if ($id == 0) {
14 14
         $modx->webAlertAndQuit($_lang["error_no_id"]);
15 15
     }
16 16
     $where = "id='{$id}'";
@@ -19,5 +19,5 @@  discard block
 block discarded – undo
19 19
 // delete event log
20 20
 $modx->db->delete($modx->getFullTableName('event_log'), $where);
21 21
 
22
-$header="Location: index.php?a=114";
22
+$header = "Location: index.php?a=114";
23 23
 header($header);
Please login to merge, or discard this patch.
manager/processors/web_access_groups.processor.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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('web_access_permissions')) {
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
     break;
51 51
     case "delete_user_group":
52 52
         $updategroupaccess = true;
53
-        $usergroup = (int)$_REQUEST['usergroup'];
53
+        $usergroup = (int) $_REQUEST['usergroup'];
54 54
         if (empty($usergroup)) {
55 55
             $modx->webAlertAndQuit("No user group id specified for deletion.");
56 56
         } else {
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
         }
63 63
     break;
64 64
     case "delete_document_group":
65
-        $group = (int)$_REQUEST['documentgroup'];
65
+        $group = (int) $_REQUEST['documentgroup'];
66 66
         if (empty($group)) {
67 67
             $modx->webAlertAndQuit("No document group id specified for deletion.");
68 68
         } else {
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
         if (empty($newgroupname)) {
79 79
             $modx->webAlertAndQuit("No group name specified.");
80 80
         }
81
-        $groupid = (int)$_REQUEST['groupid'];
81
+        $groupid = (int) $_REQUEST['groupid'];
82 82
         if (empty($groupid)) {
83 83
             $modx->webAlertAndQuit("No user group id specified for rename.");
84 84
         }
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
         if (empty($newgroupname)) {
90 90
             $modx->webAlertAndQuit("No group name specified.");
91 91
         }
92
-        $groupid = (int)$_REQUEST['groupid'];
92
+        $groupid = (int) $_REQUEST['groupid'];
93 93
         if (empty($groupid)) {
94 94
             $modx->webAlertAndQuit("No document group id specified for rename.");
95 95
         }
@@ -97,11 +97,11 @@  discard block
 block discarded – undo
97 97
     break;
98 98
     case "add_document_group_to_user_group":
99 99
         $updategroupaccess = true;
100
-        $usergroup = (int)$_REQUEST['usergroup'];
101
-        $docgroup = (int)$_REQUEST['docgroup'];
100
+        $usergroup = (int) $_REQUEST['usergroup'];
101
+        $docgroup = (int) $_REQUEST['docgroup'];
102 102
         $rs = $modx->db->select('COUNT(*)', $tbl_webgroup_access, "webgroup='{$usergroup}' AND documentgroup='{$docgroup}'");
103 103
         $limit = $modx->db->getValue($rs);
104
-        if ($limit<=0) {
104
+        if ($limit <= 0) {
105 105
             $modx->db->insert(array('webgroup'=>$usergroup, 'documentgroup'=>$docgroup), $tbl_webgroup_access);
106 106
         } else {
107 107
             //alert user that coupling already exists?
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
     break;
110 110
     case "remove_document_group_from_user_group":
111 111
         $updategroupaccess = true;
112
-        $coupling = (int)$_REQUEST['coupling'];
112
+        $coupling = (int) $_REQUEST['coupling'];
113 113
         $modx->db->delete($tbl_webgroup_access, "id='{$coupling}'");
114 114
     break;
115 115
     default:
@@ -117,8 +117,8 @@  discard block
 block discarded – undo
117 117
 }
118 118
 
119 119
 // secure web documents - flag as private
120
-if ($updategroupaccess==true) {
121
-    include MODX_MANAGER_PATH . "includes/secure_web_documents.inc.php";
120
+if ($updategroupaccess == true) {
121
+    include MODX_MANAGER_PATH."includes/secure_web_documents.inc.php";
122 122
     secureWebDocument();
123 123
 
124 124
     // Update the private group column
Please login to merge, or discard this patch.
manager/processors/delete_content.processor.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -1,25 +1,25 @@  discard block
 block discarded – undo
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('delete_document')) {
6 6
     $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = isset($_GET['id'])? (int)$_GET['id'] : 0;
10
-if ($id==0) {
9
+$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
10
+if ($id == 0) {
11 11
     $modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
14 14
 /*******ищем родителя чтобы к нему вернуться********/
15
-$content=$modx->db->getRow($modx->db->select('parent, pagetitle', $modx->getFullTableName('site_content'), "id='{$id}'"));
16
-$pid=($content['parent']==0?$id:$content['parent']);
15
+$content = $modx->db->getRow($modx->db->select('parent, pagetitle', $modx->getFullTableName('site_content'), "id='{$id}'"));
16
+$pid = ($content['parent'] == 0 ? $id : $content['parent']);
17 17
 
18 18
 /************ а заодно и путь возврата (сам путь внизу файла) **********/
19
-$sd=isset($_REQUEST['dir'])?'&dir=' . $_REQUEST['dir']:'&dir=DESC';
20
-$sb=isset($_REQUEST['sort'])?'&sort=' . $_REQUEST['sort']:'&sort=createdon';
21
-$pg=isset($_REQUEST['page'])?'&page=' . (int)$_REQUEST['page']:'';
22
-$add_path=$sd . $sb . $pg;
19
+$sd = isset($_REQUEST['dir']) ? '&dir='.$_REQUEST['dir'] : '&dir=DESC';
20
+$sb = isset($_REQUEST['sort']) ? '&sort='.$_REQUEST['sort'] : '&sort=createdon';
21
+$pg = isset($_REQUEST['page']) ? '&page='.(int) $_REQUEST['page'] : '';
22
+$add_path = $sd.$sb.$pg;
23 23
 
24 24
 /*****************************/
25 25
 
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 $children = array();
28 28
 
29 29
 // check permissions on the document
30
-include_once MODX_MANAGER_PATH . "processors/user_documents_permissions.class.php";
30
+include_once MODX_MANAGER_PATH."processors/user_documents_permissions.class.php";
31 31
 $udperms = new udperms();
32 32
 $udperms->user = $modx->getLoginUserID();
33 33
 $udperms->document = $id;
@@ -52,17 +52,17 @@  discard block
 block discarded – undo
52 52
     $parent = $modx->db->escape($parent);
53 53
     $rs = $modx->db->select('id', $modx->getFullTableName('site_content'), "parent={$parent} AND deleted=0");
54 54
     // the document has children documents, we'll need to delete those too
55
-    while ($childid=$modx->db->getValue($rs)) {
56
-        if ($childid==$site_start) {
55
+    while ($childid = $modx->db->getValue($rs)) {
56
+        if ($childid == $site_start) {
57 57
             $modx->webAlertAndQuit("The document you are trying to delete is a folder containing document {$childid}. This document is registered as the 'Site start' document, and cannot be deleted. Please assign another document as your 'Site start' document and try again.");
58 58
         }
59
-        if ($childid==$site_unavailable_page) {
59
+        if ($childid == $site_unavailable_page) {
60 60
             $modx->webAlertAndQuit("The document you are trying to delete is a folder containing document {$childid}. This document is registered as the 'Site unavailable page' document, and cannot be deleted. Please assign another document as your 'Site unavailable page' document and try again.");
61 61
         }
62
-        if ($childid==$error_page) {
62
+        if ($childid == $error_page) {
63 63
             $modx->webAlertAndQuit("The document you are trying to delete is a folder containing document {$childid}. This document is registered as the 'Site error page' document, and cannot be deleted. Please assign another document as your 'Site error page' document and try again.");
64 64
         }
65
-        if ($childid==$unauthorized_page) {
65
+        if ($childid == $unauthorized_page) {
66 66
             $modx->webAlertAndQuit("The document you are trying to delete is a folder containing document {$childid}. This document is registered as the 'Site unauthorized page' document, and cannot be deleted. Please assign another document as your 'Site unauthorized page' document and try again.");
67 67
         }
68 68
         $children[] = $childid;
@@ -80,28 +80,28 @@  discard block
 block discarded – undo
80 80
                             "children"=>$children
81 81
                         ));
82 82
 
83
-if (count($children)>0) {
83
+if (count($children) > 0) {
84 84
     $modx->db->update(
85 85
         array(
86 86
             'deleted'   => 1,
87 87
             'deletedby' => $modx->getLoginUserID(),
88 88
             'deletedon' => $deltime,
89
-        ), $modx->getFullTableName('site_content'), "id IN (" . implode(", ", $children) . ")");
89
+        ), $modx->getFullTableName('site_content'), "id IN (".implode(", ", $children).")");
90 90
 }
91 91
 
92
-if ($site_start==$id) {
92
+if ($site_start == $id) {
93 93
     $modx->webAlertAndQuit("Document is 'Site start' and cannot be deleted!");
94 94
 }
95 95
 
96
-if ($site_unavailable_page==$id) {
96
+if ($site_unavailable_page == $id) {
97 97
     $modx->webAlertAndQuit("Document is used as the 'Site unavailable page' and cannot be deleted!");
98 98
 }
99 99
 
100
-if ($error_page==$id) {
100
+if ($error_page == $id) {
101 101
     $modx->webAlertAndQuit("Document is used as the 'Site error page' and cannot be deleted!");
102 102
 }
103 103
 
104
-if ($unauthorized_page==$id) {
104
+if ($unauthorized_page == $id) {
105 105
     $modx->webAlertAndQuit("Document is used as the 'Site unauthorized page' and cannot be deleted!");
106 106
 }
107 107
 
@@ -127,5 +127,5 @@  discard block
 block discarded – undo
127 127
 $modx->clearCache('full');
128 128
 
129 129
 // finished emptying cache - redirect
130
-$header="Location: index.php?a=3&id=$pid&r=1" . $add_path;
130
+$header = "Location: index.php?a=3&id=$pid&r=1".$add_path;
131 131
 header($header);
Please login to merge, or discard this patch.
manager/processors/delete_user.processor.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,18 +1,18 @@  discard block
 block discarded – undo
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('delete_user')) {
6 6
     $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = isset($_GET['id'])? (int)$_GET['id'] : 0;
10
-if ($id==0) {
9
+$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
10
+if ($id == 0) {
11 11
     $modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
14 14
 // delete the user, but first check if we are deleting our own record
15
-if ($id==$modx->getLoginUserID()) {
15
+if ($id == $modx->getLoginUserID()) {
16 16
     $modx->webAlertAndQuit("You can't delete yourself!");
17 17
 }
18 18
 
@@ -50,5 +50,5 @@  discard block
 block discarded – undo
50 50
         "id"	=> $id
51 51
     ));
52 52
 
53
-$header="Location: index.php?a=75";
53
+$header = "Location: index.php?a=75";
54 54
 header($header);
Please login to merge, or discard this patch.
manager/processors/remove_content.processor.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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('delete_document')) {
@@ -17,15 +17,15 @@  discard block
 block discarded – undo
17 17
 
18 18
 // remove the document groups link.
19 19
 $sql = "DELETE document_groups
20
-		FROM " . $modx->getFullTableName('document_groups') . " AS document_groups
21
-		INNER JOIN " . $modx->getFullTableName('site_content') . " AS site_content ON site_content.id = document_groups.document
20
+		FROM " . $modx->getFullTableName('document_groups')." AS document_groups
21
+		INNER JOIN " . $modx->getFullTableName('site_content')." AS site_content ON site_content.id = document_groups.document
22 22
 		WHERE site_content.deleted=1";
23 23
 $modx->db->query($sql);
24 24
 
25 25
 // remove the TV content values.
26 26
 $sql = "DELETE site_tmplvar_contentvalues
27
-		FROM " . $modx->getFullTableName('site_tmplvar_contentvalues') . " AS site_tmplvar_contentvalues
28
-		INNER JOIN " . $modx->getFullTableName('site_content') . " AS site_content ON site_content.id = site_tmplvar_contentvalues.contentid
27
+		FROM " . $modx->getFullTableName('site_tmplvar_contentvalues')." AS site_tmplvar_contentvalues
28
+		INNER JOIN " . $modx->getFullTableName('site_content')." AS site_content ON site_content.id = site_tmplvar_contentvalues.contentid
29 29
 		WHERE site_content.deleted=1";
30 30
 $modx->db->query($sql);
31 31
 
@@ -42,5 +42,5 @@  discard block
 block discarded – undo
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);
Please login to merge, or discard this patch.
manager/processors/undelete_content.processor.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -1,31 +1,31 @@  discard block
 block discarded – undo
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('delete_document')) {
6 6
     $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = isset($_REQUEST['id'])? (int)$_REQUEST['id'] : 0;
10
-if ($id==0) {
9
+$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0;
10
+if ($id == 0) {
11 11
     $modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
14 14
 /************ webber ********/
15
-$content=$modx->db->getRow($modx->db->select('parent, pagetitle', $modx->getFullTableName('site_content'), "id='{$id}'"));
16
-$pid=($content['parent']==0?$id:$content['parent']);
15
+$content = $modx->db->getRow($modx->db->select('parent, pagetitle', $modx->getFullTableName('site_content'), "id='{$id}'"));
16
+$pid = ($content['parent'] == 0 ? $id : $content['parent']);
17 17
 
18 18
 /************** webber *************/
19
-$sd=isset($_REQUEST['dir'])?'&dir=' . $_REQUEST['dir']:'&dir=DESC';
20
-$sb=isset($_REQUEST['sort'])?'&sort=' . $_REQUEST['sort']:'&sort=createdon';
21
-$pg=isset($_REQUEST['page'])?'&page=' . (int)$_REQUEST['page']:'';
22
-$add_path=$sd . $sb . $pg;
19
+$sd = isset($_REQUEST['dir']) ? '&dir='.$_REQUEST['dir'] : '&dir=DESC';
20
+$sb = isset($_REQUEST['sort']) ? '&sort='.$_REQUEST['sort'] : '&sort=createdon';
21
+$pg = isset($_REQUEST['page']) ? '&page='.(int) $_REQUEST['page'] : '';
22
+$add_path = $sd.$sb.$pg;
23 23
 
24 24
 /***********************************/
25 25
 
26 26
 
27 27
 // check permissions on the document
28
-include_once MODX_MANAGER_PATH . "processors/user_documents_permissions.class.php";
28
+include_once MODX_MANAGER_PATH."processors/user_documents_permissions.class.php";
29 29
 $udperms = new udperms();
30 30
 $udperms->user = $modx->getLoginUserID();
31 31
 $udperms->document = $id;
@@ -53,9 +53,9 @@  discard block
 block discarded – undo
53 53
     global $children;
54 54
     global $deltime;
55 55
 
56
-    $rs = $modx->db->select('id', $modx->getFullTableName('site_content'), "parent='" . (int)$parent . "' AND deleted=1 AND deletedon='" . (int)$deltime . "'");
56
+    $rs = $modx->db->select('id', $modx->getFullTableName('site_content'), "parent='".(int) $parent."' AND deleted=1 AND deletedon='".(int) $deltime."'");
57 57
     // the document has children documents, we'll need to delete those too
58
-    while ($row=$modx->db->getRow($rs)) {
58
+    while ($row = $modx->db->getRow($rs)) {
59 59
         $children[] = $row['id'];
60 60
         getChildren($row['id']);
61 61
         //echo "Found childNode of parentNode $parent: ".$row['id']."<br />";
@@ -64,13 +64,13 @@  discard block
 block discarded – undo
64 64
 
65 65
 getChildren($id);
66 66
 
67
-if (count($children)>0) {
67
+if (count($children) > 0) {
68 68
     $modx->db->update(
69 69
         array(
70 70
             'deleted'   => 0,
71 71
             'deletedby' => 0,
72 72
             'deletedon' => 0,
73
-        ), $modx->getFullTableName('site_content'), "id IN(" . implode(", ", $children) . ")");
73
+        ), $modx->getFullTableName('site_content'), "id IN(".implode(", ", $children).")");
74 74
 }
75 75
 //'undelete' the document.
76 76
 $modx->db->update(
@@ -93,5 +93,5 @@  discard block
 block discarded – undo
93 93
 $modx->clearCache('full');
94 94
 
95 95
 // finished emptying cache - redirect
96
-$header="Location: index.php?a=3&id=$pid&r=1" . $add_path;
96
+$header = "Location: index.php?a=3&id=$pid&r=1".$add_path;
97 97
 header($header);
Please login to merge, or discard this patch.