Completed
Push — develop ( a90c15...940a29 )
by Maxim
22:53 queued 16:45
created
manager/includes/default_config.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-$c  = &$settings;
3
+$c = &$settings;
4 4
 
5 5
 $c['site_name']                = 'My MODX Site';
6 6
 $c['site_start']               = 1;
Please login to merge, or discard this patch.
manager/includes/charsets.php 2 patches
Braces   +31 added lines, -15 removed lines patch added patch discarded remove patch
@@ -65,21 +65,37 @@
 block discarded – undo
65 65
 $_['macintosh']         = 'Western European (Mac) - macintosh';
66 66
 $_['Windows-1252']      = 'Western European (Windows) - Windows-1252';
67 67
 
68
-if($modx_charset     == 'euc-jp')      $_['euc-jp']      = 'Japanese (EUC) - euc-jp';
69
-elseif($modx_charset == 'shift_jis')   $_['shift_jis']   = 'Japanese (Shift-JIS) - shift_jis';
70
-elseif($modx_charset == 'iso-2022-jp') $_['iso-2022-jp'] = 'Japanese (JIS-Allow 1 byte Kana - SO/SI) - iso-2022-jp';
71
-elseif($modx_charset == 'csISO2022JP') $_['csISO2022JP'] = 'Japanese (JIS-Allow 1 byte Kana) - csISO2022JP';
72
-elseif($modx_charset == 'EUC-CN')            $_['EUC-CN']            = 'Chinese Simplified (EUC) - EUC-CN';
73
-elseif($modx_charset == 'hz-gb-2312')        $_['hz-gb-2312']        = 'Chinese Simplified (HZ) - hz-gb-2312';
74
-elseif($modx_charset == 'x-mac-chinesesimp') $_['x-mac-chinesesimp'] = 'Chinese Simplified (Mac) - x-mac-chinesesimp';
75
-elseif($modx_charset == 'x-Chinese-CNS')     $_['x-Chinese-CNS']     = 'Chinese Traditional (CNS) - x-Chinese-CNS';
76
-elseif($modx_charset == 'x-Chinese-Eten')    $_['x-Chinese-Eten']    = 'Chinese Traditional (Eten) - x-Chinese-Eten';
77
-elseif($modx_charset == 'x-mac-chinesetrad') $_['x-mac-chinesetrad'] = 'Chinese Traditional (Mac) - x-mac-chinesetrad';
78
-elseif($modx_charset == 'ks_c_5601-1987') $_['ks_c_5601-1987'] = 'Korean - ks_c_5601-1987';
79
-elseif($modx_charset == 'euc-kr')         $_['euc-kr']         = 'Korean (EUC) - euc-kr';
80
-elseif($modx_charset == 'iso-2022-kr')    $_['iso-2022-kr']    = 'Korean (ISO) - iso-2022-kr';
81
-elseif($modx_charset == 'Johab')          $_['Johab']          = 'Korean (Johab) - Johab';
82
-elseif($modx_charset == 'x-mac-korean')   $_['x-mac-korean']   = 'Korean (Mac) - x-mac-korean';
68
+if($modx_charset     == 'euc-jp') {
69
+    $_['euc-jp']      = 'Japanese (EUC) - euc-jp';
70
+} elseif($modx_charset == 'shift_jis') {
71
+    $_['shift_jis']   = 'Japanese (Shift-JIS) - shift_jis';
72
+} elseif($modx_charset == 'iso-2022-jp') {
73
+    $_['iso-2022-jp'] = 'Japanese (JIS-Allow 1 byte Kana - SO/SI) - iso-2022-jp';
74
+} elseif($modx_charset == 'csISO2022JP') {
75
+    $_['csISO2022JP'] = 'Japanese (JIS-Allow 1 byte Kana) - csISO2022JP';
76
+} elseif($modx_charset == 'EUC-CN') {
77
+    $_['EUC-CN']            = 'Chinese Simplified (EUC) - EUC-CN';
78
+} elseif($modx_charset == 'hz-gb-2312') {
79
+    $_['hz-gb-2312']        = 'Chinese Simplified (HZ) - hz-gb-2312';
80
+} elseif($modx_charset == 'x-mac-chinesesimp') {
81
+    $_['x-mac-chinesesimp'] = 'Chinese Simplified (Mac) - x-mac-chinesesimp';
82
+} elseif($modx_charset == 'x-Chinese-CNS') {
83
+    $_['x-Chinese-CNS']     = 'Chinese Traditional (CNS) - x-Chinese-CNS';
84
+} elseif($modx_charset == 'x-Chinese-Eten') {
85
+    $_['x-Chinese-Eten']    = 'Chinese Traditional (Eten) - x-Chinese-Eten';
86
+} elseif($modx_charset == 'x-mac-chinesetrad') {
87
+    $_['x-mac-chinesetrad'] = 'Chinese Traditional (Mac) - x-mac-chinesetrad';
88
+} elseif($modx_charset == 'ks_c_5601-1987') {
89
+    $_['ks_c_5601-1987'] = 'Korean - ks_c_5601-1987';
90
+} elseif($modx_charset == 'euc-kr') {
91
+    $_['euc-kr']         = 'Korean (EUC) - euc-kr';
92
+} elseif($modx_charset == 'iso-2022-kr') {
93
+    $_['iso-2022-kr']    = 'Korean (ISO) - iso-2022-kr';
94
+} elseif($modx_charset == 'Johab') {
95
+    $_['Johab']          = 'Korean (Johab) - Johab';
96
+} elseif($modx_charset == 'x-mac-korean') {
97
+    $_['x-mac-korean']   = 'Korean (Mac) - x-mac-korean';
98
+}
83 99
 
84 100
 $tpl = '<option value="%s" %s>%s</option>';
85 101
 $options = array();
Please login to merge, or discard this patch.
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -65,26 +65,26 @@
 block discarded – undo
65 65
 $_['macintosh']         = 'Western European (Mac) - macintosh';
66 66
 $_['Windows-1252']      = 'Western European (Windows) - Windows-1252';
67 67
 
68
-if($modx_charset     == 'euc-jp')      $_['euc-jp']      = 'Japanese (EUC) - euc-jp';
69
-elseif($modx_charset == 'shift_jis')   $_['shift_jis']   = 'Japanese (Shift-JIS) - shift_jis';
70
-elseif($modx_charset == 'iso-2022-jp') $_['iso-2022-jp'] = 'Japanese (JIS-Allow 1 byte Kana - SO/SI) - iso-2022-jp';
71
-elseif($modx_charset == 'csISO2022JP') $_['csISO2022JP'] = 'Japanese (JIS-Allow 1 byte Kana) - csISO2022JP';
72
-elseif($modx_charset == 'EUC-CN')            $_['EUC-CN']            = 'Chinese Simplified (EUC) - EUC-CN';
73
-elseif($modx_charset == 'hz-gb-2312')        $_['hz-gb-2312']        = 'Chinese Simplified (HZ) - hz-gb-2312';
74
-elseif($modx_charset == 'x-mac-chinesesimp') $_['x-mac-chinesesimp'] = 'Chinese Simplified (Mac) - x-mac-chinesesimp';
75
-elseif($modx_charset == 'x-Chinese-CNS')     $_['x-Chinese-CNS']     = 'Chinese Traditional (CNS) - x-Chinese-CNS';
76
-elseif($modx_charset == 'x-Chinese-Eten')    $_['x-Chinese-Eten']    = 'Chinese Traditional (Eten) - x-Chinese-Eten';
77
-elseif($modx_charset == 'x-mac-chinesetrad') $_['x-mac-chinesetrad'] = 'Chinese Traditional (Mac) - x-mac-chinesetrad';
78
-elseif($modx_charset == 'ks_c_5601-1987') $_['ks_c_5601-1987'] = 'Korean - ks_c_5601-1987';
79
-elseif($modx_charset == 'euc-kr')         $_['euc-kr']         = 'Korean (EUC) - euc-kr';
80
-elseif($modx_charset == 'iso-2022-kr')    $_['iso-2022-kr']    = 'Korean (ISO) - iso-2022-kr';
81
-elseif($modx_charset == 'Johab')          $_['Johab']          = 'Korean (Johab) - Johab';
82
-elseif($modx_charset == 'x-mac-korean')   $_['x-mac-korean']   = 'Korean (Mac) - x-mac-korean';
68
+if ($modx_charset == 'euc-jp')      $_['euc-jp']      = 'Japanese (EUC) - euc-jp';
69
+elseif ($modx_charset == 'shift_jis')   $_['shift_jis']   = 'Japanese (Shift-JIS) - shift_jis';
70
+elseif ($modx_charset == 'iso-2022-jp') $_['iso-2022-jp'] = 'Japanese (JIS-Allow 1 byte Kana - SO/SI) - iso-2022-jp';
71
+elseif ($modx_charset == 'csISO2022JP') $_['csISO2022JP'] = 'Japanese (JIS-Allow 1 byte Kana) - csISO2022JP';
72
+elseif ($modx_charset == 'EUC-CN')            $_['EUC-CN']            = 'Chinese Simplified (EUC) - EUC-CN';
73
+elseif ($modx_charset == 'hz-gb-2312')        $_['hz-gb-2312']        = 'Chinese Simplified (HZ) - hz-gb-2312';
74
+elseif ($modx_charset == 'x-mac-chinesesimp') $_['x-mac-chinesesimp'] = 'Chinese Simplified (Mac) - x-mac-chinesesimp';
75
+elseif ($modx_charset == 'x-Chinese-CNS')     $_['x-Chinese-CNS']     = 'Chinese Traditional (CNS) - x-Chinese-CNS';
76
+elseif ($modx_charset == 'x-Chinese-Eten')    $_['x-Chinese-Eten']    = 'Chinese Traditional (Eten) - x-Chinese-Eten';
77
+elseif ($modx_charset == 'x-mac-chinesetrad') $_['x-mac-chinesetrad'] = 'Chinese Traditional (Mac) - x-mac-chinesetrad';
78
+elseif ($modx_charset == 'ks_c_5601-1987') $_['ks_c_5601-1987'] = 'Korean - ks_c_5601-1987';
79
+elseif ($modx_charset == 'euc-kr')         $_['euc-kr']         = 'Korean (EUC) - euc-kr';
80
+elseif ($modx_charset == 'iso-2022-kr')    $_['iso-2022-kr']    = 'Korean (ISO) - iso-2022-kr';
81
+elseif ($modx_charset == 'Johab')          $_['Johab']          = 'Korean (Johab) - Johab';
82
+elseif ($modx_charset == 'x-mac-korean')   $_['x-mac-korean']   = 'Korean (Mac) - x-mac-korean';
83 83
 
84 84
 $tpl = '<option value="%s" %s>%s</option>';
85 85
 $options = array();
86
-foreach($_ as $value=>$label) {
87
-    $selected = $value===$modx_charset ? 'selected' : '';
86
+foreach ($_ as $value=>$label) {
87
+    $selected = $value === $modx_charset ? 'selected' : '';
88 88
     $options[] = sprintf($tpl, $value, $selected, $label);
89 89
 }
90 90
 echo implode("\n", $options);
Please login to merge, or discard this patch.
manager/includes/tmplvars.commands.inc.php 5 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
                     $modx->setPlaceholder($rvKey, $rvValue);
56 56
                 }
57 57
                 $param = $modx->mergePlaceholderContent($param);
58
-                $rs = $modx->db->query("SELECT $param;");
58
+                $rs = $modx->db->query("select $param;");
59 59
                 $output = $rs;
60 60
                 break;
61 61
 
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -163,7 +163,7 @@
 block discarded – undo
163 163
  *
164 164
  * @param string $param
165 165
  * @param array $tvsArray
166
- * @return mixed
166
+ * @return string
167 167
  */
168 168
 function parseTvValues($param, $tvsArray)
169 169
 {
Please login to merge, or discard this patch.
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -131,8 +131,8 @@  discard block
 block discarded – undo
131 131
  */
132 132
 function ProcessFile($file) {
133 133
     // get the file
134
-	$buffer = @file_get_contents($file);
135
-	if ($buffer === false) $buffer = " Could not retrieve document '$file'.";
134
+    $buffer = @file_get_contents($file);
135
+    if ($buffer === false) $buffer = " Could not retrieve document '$file'.";
136 136
     return $buffer;
137 137
 }
138 138
 
@@ -168,20 +168,20 @@  discard block
 block discarded – undo
168 168
 function parseTvValues($param, $tvsArray)
169 169
 {
170 170
     $modx = evolutionCMS();
171
-	$tvsArray = is_array($modx->documentObject) ? array_merge($tvsArray, $modx->documentObject) : $tvsArray;
172
-	if (strpos($param, '[*') !== false) {
173
-		$matches = $modx->getTagsFromContent($param, '[*', '*]');
174
-		foreach ($matches[0] as $i=>$match) {
175
-			if(isset($tvsArray[ $matches[1][$i] ])) {
176
-				if(is_array($tvsArray[ $matches[1][$i] ])) {
177
-					$value = $tvsArray[$matches[1][$i]]['value'];
178
-					$value = $value === '' ? $tvsArray[$matches[1][$i]]['default_text'] : $value;
179
-				} else {
180
-					$value = $tvsArray[ $matches[1][$i] ];
181
-				}
182
-				$param = str_replace($match, $value, $param);
183
-			}
184
-		}
185
-	}
186
-	return $param;
171
+    $tvsArray = is_array($modx->documentObject) ? array_merge($tvsArray, $modx->documentObject) : $tvsArray;
172
+    if (strpos($param, '[*') !== false) {
173
+        $matches = $modx->getTagsFromContent($param, '[*', '*]');
174
+        foreach ($matches[0] as $i=>$match) {
175
+            if(isset($tvsArray[ $matches[1][$i] ])) {
176
+                if(is_array($tvsArray[ $matches[1][$i] ])) {
177
+                    $value = $tvsArray[$matches[1][$i]]['value'];
178
+                    $value = $value === '' ? $tvsArray[$matches[1][$i]]['default_text'] : $value;
179
+                } else {
180
+                    $value = $tvsArray[ $matches[1][$i] ];
181
+                }
182
+                $param = str_replace($match, $value, $param);
183
+            }
184
+        }
185
+    }
186
+    return $param;
187 187
 }
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
  * Created by Raymond Irving Feb, 2005
5 5
  */
6 6
 global $BINDINGS; // Array of supported bindings. must be upper case
7
-$BINDINGS = array (
7
+$BINDINGS = array(
8 8
     'FILE',
9 9
     'CHUNK',
10 10
     'DOCUMENT',
@@ -22,13 +22,13 @@  discard block
 block discarded – undo
22 22
  * @param array $tvsArray
23 23
  * @return string
24 24
  */
25
-function ProcessTVCommand($value, $name = '', $docid = '', $src='docform', $tvsArray = array()) {
25
+function ProcessTVCommand($value, $name = '', $docid = '', $src = 'docform', $tvsArray = array()){
26 26
     $modx = evolutionCMS();
27
-    $docid = (int)$docid > 0 ? (int)$docid : $modx->documentIdentifier;
27
+    $docid = (int) $docid > 0 ? (int) $docid : $modx->documentIdentifier;
28 28
     $nvalue = trim($value);
29 29
     if (substr($nvalue, 0, 1) != '@')
30 30
         return $value;
31
-    elseif(isset($modx->config['enable_bindings']) && $modx->config['enable_bindings']!=1 && $src==='docform') {
31
+    elseif (isset($modx->config['enable_bindings']) && $modx->config['enable_bindings'] != 1 && $src === 'docform') {
32 32
         return '@Bindings is disabled.';
33 33
     }
34 34
     else {
@@ -54,8 +54,8 @@  discard block
 block discarded – undo
54 54
                 break;
55 55
 
56 56
             case "SELECT" : // selects a record from the cms database
57
-                $rt = array ();
58
-                $replacementVars = array (
57
+                $rt = array();
58
+                $replacementVars = array(
59 59
                     'DBASE' => $modx->db->config['dbase'],
60 60
                     'PREFIX' => $modx->db->config['table_prefix']
61 61
                 );
@@ -96,8 +96,8 @@  discard block
 block discarded – undo
96 96
                 break;
97 97
 
98 98
             case 'DIRECTORY' :
99
-                $files = array ();
100
-                $path = $modx->config['base_path'] . $param;
99
+                $files = array();
100
+                $path = $modx->config['base_path'].$param;
101 101
                 if (substr($path, -1, 1) != '/') {
102 102
                     $path .= '/';
103 103
                 }
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
  * @param $file
130 130
  * @return string
131 131
  */
132
-function ProcessFile($file) {
132
+function ProcessFile($file){
133 133
     // get the file
134 134
 	$buffer = @file_get_contents($file);
135 135
 	if ($buffer === false) $buffer = " Could not retrieve document '$file'.";
@@ -146,12 +146,12 @@  discard block
 block discarded – undo
146 146
 {
147 147
     global $BINDINGS;
148 148
     $binding_array = array();
149
-    foreach($BINDINGS as $cmd)
149
+    foreach ($BINDINGS as $cmd)
150 150
     {
151
-        if(strpos($binding_string,'@'.$cmd)===0)
151
+        if (strpos($binding_string, '@'.$cmd) === 0)
152 152
         {
153
-            $code = substr($binding_string,strlen($cmd)+1);
154
-            $binding_array = array($cmd,trim($code));
153
+            $code = substr($binding_string, strlen($cmd) + 1);
154
+            $binding_array = array($cmd, trim($code));
155 155
             break;
156 156
         }
157 157
     }
@@ -172,12 +172,12 @@  discard block
 block discarded – undo
172 172
 	if (strpos($param, '[*') !== false) {
173 173
 		$matches = $modx->getTagsFromContent($param, '[*', '*]');
174 174
 		foreach ($matches[0] as $i=>$match) {
175
-			if(isset($tvsArray[ $matches[1][$i] ])) {
176
-				if(is_array($tvsArray[ $matches[1][$i] ])) {
175
+			if (isset($tvsArray[$matches[1][$i]])) {
176
+				if (is_array($tvsArray[$matches[1][$i]])) {
177 177
 					$value = $tvsArray[$matches[1][$i]]['value'];
178 178
 					$value = $value === '' ? $tvsArray[$matches[1][$i]]['default_text'] : $value;
179 179
 				} else {
180
-					$value = $tvsArray[ $matches[1][$i] ];
180
+					$value = $tvsArray[$matches[1][$i]];
181 181
 				}
182 182
 				$param = str_replace($match, $value, $param);
183 183
 			}
Please login to merge, or discard this patch.
Braces   +22 added lines, -18 removed lines patch added patch discarded remove patch
@@ -22,16 +22,16 @@  discard block
 block discarded – undo
22 22
  * @param array $tvsArray
23 23
  * @return string
24 24
  */
25
-function ProcessTVCommand($value, $name = '', $docid = '', $src='docform', $tvsArray = array()) {
25
+function ProcessTVCommand($value, $name = '', $docid = '', $src='docform', $tvsArray = array())
26
+{
26 27
     $modx = evolutionCMS();
27 28
     $docid = (int)$docid > 0 ? (int)$docid : $modx->documentIdentifier;
28 29
     $nvalue = trim($value);
29
-    if (substr($nvalue, 0, 1) != '@')
30
-        return $value;
31
-    elseif(isset($modx->config['enable_bindings']) && $modx->config['enable_bindings']!=1 && $src==='docform') {
30
+    if (substr($nvalue, 0, 1) != '@') {
31
+            return $value;
32
+    } elseif(isset($modx->config['enable_bindings']) && $modx->config['enable_bindings']!=1 && $src==='docform') {
32 33
         return '@Bindings is disabled.';
33
-    }
34
-    else {
34
+    } else {
35 35
         list ($cmd, $param) = ParseCommand($nvalue);
36 36
         $cmd = trim($cmd);
37 37
         $param = parseTvValues($param, $tvsArray);
@@ -47,10 +47,11 @@  discard block
 block discarded – undo
47 47
 
48 48
             case "DOCUMENT" : // retrieve a document and process it's content
49 49
                 $rs = $modx->getDocument($param);
50
-                if (is_array($rs))
51
-                    $output = $rs['content'];
52
-                else
53
-                    $output = "Unable to locate document $param";
50
+                if (is_array($rs)) {
51
+                                    $output = $rs['content'];
52
+                } else {
53
+                                    $output = "Unable to locate document $param";
54
+                }
54 55
                 break;
55 56
 
56 57
             case "SELECT" : // selects a record from the cms database
@@ -80,8 +81,10 @@  discard block
 block discarded – undo
80 81
 
81 82
                     // Grab document regardless of publish status
82 83
                     $doc = $modx->getPageInfo($parent_id, 0, 'id,parent,published');
83
-                    if ($doc['parent'] != 0 && !$doc['published'])
84
-                        continue; // hide unpublished docs if we're not at the top
84
+                    if ($doc['parent'] != 0 && !$doc['published']) {
85
+                                            continue;
86
+                    }
87
+                    // hide unpublished docs if we're not at the top
85 88
 
86 89
                     $tv = $modx->getTemplateVar($name, '*', $doc['id'], $doc['published']);
87 90
 
@@ -129,10 +132,13 @@  discard block
 block discarded – undo
129 132
  * @param $file
130 133
  * @return string
131 134
  */
132
-function ProcessFile($file) {
135
+function ProcessFile($file)
136
+{
133 137
     // get the file
134 138
 	$buffer = @file_get_contents($file);
135
-	if ($buffer === false) $buffer = " Could not retrieve document '$file'.";
139
+	if ($buffer === false) {
140
+	    $buffer = " Could not retrieve document '$file'.";
141
+	}
136 142
     return $buffer;
137 143
 }
138 144
 
@@ -146,10 +152,8 @@  discard block
 block discarded – undo
146 152
 {
147 153
     global $BINDINGS;
148 154
     $binding_array = array();
149
-    foreach($BINDINGS as $cmd)
150
-    {
151
-        if(strpos($binding_string,'@'.$cmd)===0)
152
-        {
155
+    foreach($BINDINGS as $cmd) {
156
+        if(strpos($binding_string,'@'.$cmd)===0) {
153 157
             $code = substr($binding_string,strlen($cmd)+1);
154 158
             $binding_array = array($cmd,trim($code));
155 159
             break;
Please login to merge, or discard this patch.
manager/includes/document.parser.class.inc.php 4 patches
Upper-Lower-Casing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -2224,11 +2224,11 @@  discard block
 block discarded – undo
2224 2224
         if (isset($this->snippetCache[$snip_name])) {
2225 2225
             $snippetObject['name'] = $snip_name;
2226 2226
             $snippetObject['content'] = $this->snippetCache[$snip_name];
2227
-            if (isset($this->snippetCache["{$snip_name}Props"])) {
2228
-                if (!isset($this->snippetCache["{$snip_name}Props"])) {
2229
-                    $this->snippetCache["{$snip_name}Props"] = '';
2227
+            if (isset($this->snippetCache["{$snip_name}props"])) {
2228
+                if (!isset($this->snippetCache["{$snip_name}props"])) {
2229
+                    $this->snippetCache["{$snip_name}props"] = '';
2230 2230
                 }
2231
-                $snippetObject['properties'] = $this->snippetCache["{$snip_name}Props"];
2231
+                $snippetObject['properties'] = $this->snippetCache["{$snip_name}props"];
2232 2232
             }
2233 2233
         } elseif (substr($snip_name, 0, 1) === '@' && isset($this->pluginEvent[trim($snip_name, '@')])) {
2234 2234
             $snippetObject['name'] = trim($snip_name, '@');
@@ -2253,7 +2253,7 @@  discard block
 block discarded – undo
2253 2253
             $snippetObject['content'] = $snip_content;
2254 2254
             $snippetObject['properties'] = $snip_prop;
2255 2255
             $this->snippetCache[$snip_name] = $snip_content;
2256
-            $this->snippetCache["{$snip_name}Props"] = $snip_prop;
2256
+            $this->snippetCache["{$snip_name}props"] = $snip_prop;
2257 2257
         }
2258 2258
         return $snippetObject;
2259 2259
     }
@@ -3569,7 +3569,7 @@  discard block
 block discarded – undo
3569 3569
         }
3570 3570
         // build query
3571 3571
         $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0") . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)");
3572
-        $result = $this->db->select("DISTINCT {$fields}", "{$tblsc} sc
3572
+        $result = $this->db->select("distinct {$fields}", "{$tblsc} sc
3573 3573
                 LEFT JOIN {$tbldg} dg on dg.document = sc.id", "sc.parent = '{$id}' AND ({$access}) GROUP BY sc.id", "{$sort} {$dir}");
3574 3574
         $resourceArray = $this->db->makeArray($result);
3575 3575
         $this->tmpCache[__FUNCTION__][$cacheKey] = $resourceArray;
@@ -3606,7 +3606,7 @@  discard block
 block discarded – undo
3606 3606
         }
3607 3607
         // build query
3608 3608
         $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0") . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)");
3609
-        $result = $this->db->select("DISTINCT {$fields}", "{$tblsc} sc
3609
+        $result = $this->db->select("distinct {$fields}", "{$tblsc} sc
3610 3610
                 LEFT JOIN {$tbldg} dg on dg.document = sc.id", "sc.parent = '{$id}' AND sc.published=1 AND sc.deleted=0 AND ({$access}) GROUP BY sc.id", "{$sort} {$dir}");
3611 3611
         $resourceArray = $this->db->makeArray($result);
3612 3612
 
@@ -3662,7 +3662,7 @@  discard block
 block discarded – undo
3662 3662
         $tblsc = $this->getFullTableName('site_content');
3663 3663
         $tbldg = $this->getFullTableName('document_groups');
3664 3664
 
3665
-        $result = $this->db->select("DISTINCT {$fields}", "{$tblsc} sc
3665
+        $result = $this->db->select("distinct {$fields}", "{$tblsc} sc
3666 3666
                 LEFT JOIN {$tbldg} dg on dg.document = sc.id", "sc.parent = '{$parentid}' {$published} {$deleted} {$where} AND ({$access}) GROUP BY sc.id", ($sort ? "{$sort} {$dir}" : ""), $limit);
3667 3667
 
3668 3668
         $resourceArray = $this->db->makeArray($result);
@@ -3728,7 +3728,7 @@  discard block
 block discarded – undo
3728 3728
             $tblsc = $this->getFullTableName('site_content');
3729 3729
             $tbldg = $this->getFullTableName('document_groups');
3730 3730
 
3731
-            $result = $this->db->select("DISTINCT {$fields}", "{$tblsc} sc
3731
+            $result = $this->db->select("distinct {$fields}", "{$tblsc} sc
3732 3732
                     LEFT JOIN {$tbldg} dg on dg.document = sc.id", "(sc.id IN (" . implode(',', $ids) . ") {$published} {$deleted} {$where}) AND ({$access}) GROUP BY sc.id", ($sort ? "{$sort} {$dir}" : ""), $limit);
3733 3733
 
3734 3734
             $resourceArray = $this->db->makeArray($result);
@@ -4320,7 +4320,7 @@  discard block
 block discarded – undo
4320 4320
                 $template = $doc['content'];
4321 4321
                 break;
4322 4322
             case 'SELECT':
4323
-                $this->db->getValue($this->db->query("SELECT {$template}"));
4323
+                $this->db->getValue($this->db->query("select {$template}"));
4324 4324
                 break;
4325 4325
             default:
4326 4326
                 if (!($template = $this->getChunk($tpl))) {
Please login to merge, or discard this patch.
Braces   +59 added lines, -28 removed lines patch added patch discarded remove patch
@@ -701,13 +701,15 @@  discard block
 block discarded – undo
701 701
             $this->virtualDir = '';
702 702
         }
703 703
 
704
-        if (preg_match('@^[1-9][0-9]*$@', $q) && !isset($this->documentListing[$q])) { /* we got an ID returned, check to make sure it's not an alias */
704
+        if (preg_match('@^[1-9][0-9]*$@', $q) && !isset($this->documentListing[$q])) {
705
+/* we got an ID returned, check to make sure it's not an alias */
705 706
             /* FS#476 and FS#308: check that id is valid in terms of virtualDir structure */
706 707
             if ($this->config['use_alias_path'] == 1) {
707 708
                 if (($this->virtualDir != '' && !isset($this->documentListing[$this->virtualDir . '/' . $q]) || ($this->virtualDir == '' && !isset($this->documentListing[$q]))) && (($this->virtualDir != '' && isset($this->documentListing[$this->virtualDir]) && in_array($q, $this->getChildIds($this->documentListing[$this->virtualDir], 1))) || ($this->virtualDir == '' && in_array($q, $this->getChildIds(0, 1))))) {
708 709
                     $this->documentMethod = 'id';
709 710
                     return $q;
710
-                } else { /* not a valid id in terms of virtualDir, treat as alias */
711
+                } else {
712
+/* not a valid id in terms of virtualDir, treat as alias */
711 713
                     $this->documentMethod = 'alias';
712 714
                     return $q;
713 715
                 }
@@ -715,7 +717,8 @@  discard block
 block discarded – undo
715 717
                 $this->documentMethod = 'id';
716 718
                 return $q;
717 719
             }
718
-        } else { /* we didn't get an ID back, so instead we assume it's an alias */
720
+        } else {
721
+/* we didn't get an ID back, so instead we assume it's an alias */
719 722
             if ($this->config['friendly_alias_urls'] != 1) {
720 723
                 $q = $qOrig;
721 724
             }
@@ -745,13 +748,14 @@  discard block
 block discarded – undo
745 748
      * @param $id
746 749
      * @return array|mixed|null|string
747 750
      */
748
-    public function makePageCacheKey($id){
751
+    public function makePageCacheKey($id)
752
+    {
749 753
         $hash = $id;
750 754
         $tmp = null;
751 755
         $params = array();
752
-        if(!empty($this->systemCacheKey)){
756
+        if(!empty($this->systemCacheKey)) {
753 757
             $hash = $this->systemCacheKey;
754
-        }else {
758
+        } else {
755 759
             if (!empty($_GET)) {
756 760
                 // Sort GET parameters so that the order of parameters on the HTTP request don't affect the generated cache ID.
757 761
                 $params = $_GET;
@@ -760,7 +764,7 @@  discard block
 block discarded – undo
760 764
             }
761 765
         }
762 766
         $evtOut = $this->invokeEvent("OnMakePageCacheKey", array ("hash" => $hash, "id" => $id, 'params' => $params));
763
-        if (is_array($evtOut) && count($evtOut) > 0){
767
+        if (is_array($evtOut) && count($evtOut) > 0) {
764 768
             $tmp = array_pop($evtOut);
765 769
         }
766 770
         return empty($tmp) ? $hash : $tmp;
@@ -1087,7 +1091,8 @@  discard block
 block discarded – undo
1087 1091
         $where = "pub_date <= {$timeNow} AND pub_date!=0 AND published=0";
1088 1092
         $result_pub = $this->db->select( 'id', '[+prefix+]site_content',  $where);
1089 1093
         $this->db->update($field, '[+prefix+]site_content', $where);
1090
-        if ($this->db->getRecordCount($result_pub) >= 1) { //Event unPublished doc
1094
+        if ($this->db->getRecordCount($result_pub) >= 1) {
1095
+//Event unPublished doc
1091 1096
             while ($row_pub = $this->db->getRow($result_pub)) {
1092 1097
                 $this->invokeEvent("OnDocUnPublished", array(
1093 1098
                     "docid" => $row_pub['id']
@@ -1100,7 +1105,8 @@  discard block
 block discarded – undo
1100 1105
         $where = "unpub_date <= {$timeNow} AND unpub_date!=0 AND published=1";
1101 1106
         $result_unpub = $this->db->select( 'id', '[+prefix+]site_content',  $where);
1102 1107
         $this->db->update($field, '[+prefix+]site_content', $where);
1103
-        if ($this->db->getRecordCount($result_unpub) >= 1) { //Event unPublished doc
1108
+        if ($this->db->getRecordCount($result_unpub) >= 1) {
1109
+//Event unPublished doc
1104 1110
             while ($row_unpub = $this->db->getRow($result_unpub)) {
1105 1111
                 $this->invokeEvent("OnDocUnPublished", array(
1106 1112
                     "docid" => $row_unpub['id']
@@ -1187,10 +1193,18 @@  discard block
 block discarded – undo
1187 1193
             return array();
1188 1194
         }
1189 1195
         $spacer = md5('<<<EVO>>>');
1190
-        if($left==='{{' && strpos($content,';}}')!==false)  $content = str_replace(';}}', sprintf(';}%s}',   $spacer),$content);
1191
-        if($left==='{{' && strpos($content,'{{}}')!==false) $content = str_replace('{{}}',sprintf('{%$1s{}%$1s}',$spacer),$content);
1192
-        if($left==='[[' && strpos($content,']]]]')!==false) $content = str_replace(']]]]',sprintf(']]%s]]',  $spacer),$content);
1193
-        if($left==='[[' && strpos($content,']]]')!==false)  $content = str_replace(']]]', sprintf(']%s]]',   $spacer),$content);
1196
+        if($left==='{{' && strpos($content,';}}')!==false) {
1197
+            $content = str_replace(';}}', sprintf(';}%s}',   $spacer),$content);
1198
+        }
1199
+        if($left==='{{' && strpos($content,'{{}}')!==false) {
1200
+            $content = str_replace('{{}}',sprintf('{%$1s{}%$1s}',$spacer),$content);
1201
+        }
1202
+        if($left==='[[' && strpos($content,']]]]')!==false) {
1203
+            $content = str_replace(']]]]',sprintf(']]%s]]',  $spacer),$content);
1204
+        }
1205
+        if($left==='[[' && strpos($content,']]]')!==false) {
1206
+            $content = str_replace(']]]', sprintf(']%s]]',   $spacer),$content);
1207
+        }
1194 1208
 
1195 1209
         $pos['<![CDATA['] = strpos($content, '<![CDATA[');
1196 1210
         $pos[']]>'] = strpos($content, ']]>');
@@ -1243,7 +1257,8 @@  discard block
 block discarded – undo
1243 1257
                         }
1244 1258
                     }
1245 1259
 
1246
-                    if (!in_array($fetch, $tags)) {  // Avoid double Matches
1260
+                    if (!in_array($fetch, $tags)) {
1261
+// Avoid double Matches
1247 1262
                         $tags[] = $fetch; // Fetch
1248 1263
                     };
1249 1264
                     $fetch = ''; // and reset
@@ -1261,7 +1276,9 @@  discard block
 block discarded – undo
1261 1276
             }
1262 1277
         }
1263 1278
         foreach($tags as $i=>$tag) {
1264
-            if(strpos($tag,$spacer)!==false) $tags[$i] = str_replace($spacer, '', $tag);
1279
+            if(strpos($tag,$spacer)!==false) {
1280
+                $tags[$i] = str_replace($spacer, '', $tag);
1281
+            }
1265 1282
         }
1266 1283
         return $tags;
1267 1284
     }
@@ -1301,7 +1318,10 @@  discard block
 block discarded – undo
1301 1318
         }
1302 1319
 
1303 1320
         foreach ($matches[1] as $i => $key) {
1304
-            if(strpos($key,'[+')!==false) continue; // Allow chunk {{chunk?&param=`xxx`}} with [*tv_name_[+param+]*] as content
1321
+            if(strpos($key,'[+')!==false) {
1322
+                continue;
1323
+            }
1324
+            // Allow chunk {{chunk?&param=`xxx`}} with [*tv_name_[+param+]*] as content
1305 1325
             if (substr($key, 0, 1) == '#') {
1306 1326
                 $key = substr($key, 1);
1307 1327
             } // remove # for QuickEdit format
@@ -2026,7 +2046,8 @@  discard block
 block discarded – undo
2026 2046
      * @return mixed|string
2027 2047
      */
2028 2048
     public function _getSGVar($value)
2029
-    { // Get super globals
2049
+    {
2050
+// Get super globals
2030 2051
         $key = $value;
2031 2052
         $_ = $this->config['enable_filter'];
2032 2053
         $this->config['enable_filter'] = 1;
@@ -2430,7 +2451,8 @@  discard block
 block discarded – undo
2430 2451
         if ($this->config['friendly_urls'] == 1) {
2431 2452
             $aliases = array();
2432 2453
             if (is_array($this->documentListing)) {
2433
-                foreach ($this->documentListing as $path => $docid) { // This is big Loop on large site!
2454
+                foreach ($this->documentListing as $path => $docid) {
2455
+// This is big Loop on large site!
2434 2456
                     $aliases[$docid] = $path;
2435 2457
                     $isfolder[$docid] = $this->aliasListing[$docid]['isfolder'];
2436 2458
                 }
@@ -2463,7 +2485,7 @@  discard block
 block discarded – undo
2463 2485
             $isfriendly = ($this->config['friendly_alias_urls'] == 1 ? 1 : 0);
2464 2486
             $pref = $this->config['friendly_url_prefix'];
2465 2487
             $suff = $this->config['friendly_url_suffix'];
2466
-            $documentSource = preg_replace_callback($in, function ($m) use ($aliases, $isfolder, $isfriendly, $pref, $suff) {
2488
+            $documentSource = preg_replace_callback($in, function ($m) use ($aliases, $isfolder, $isfriendly, $pref, $suff){
2467 2489
                 global $modx;
2468 2490
                 $thealias = $aliases[$m[1]];
2469 2491
                 $thefolder = $isfolder[$m[1]];
@@ -4239,7 +4261,8 @@  discard block
 block discarded – undo
4239 4261
         if (isset ($this->snippetCache[$snippetName])) {
4240 4262
             $snippet = $this->snippetCache[$snippetName];
4241 4263
             $properties = !empty($this->snippetCache[$snippetName . "Props"]) ? $this->snippetCache[$snippetName . "Props"] : '';
4242
-        } else { // not in cache so let's check the db
4264
+        } else {
4265
+// not in cache so let's check the db
4243 4266
             $sql = "SELECT ss.`name`, ss.`snippet`, ss.`properties`, sm.properties as `sharedproperties` FROM " . $this->getFullTableName("site_snippets") . " as ss LEFT JOIN " . $this->getFullTableName('site_modules') . " as sm on sm.guid=ss.moduleguid WHERE ss.`name`='" . $this->db->escape($snippetName) . "'  AND ss.disabled=0;";
4244 4267
             $result = $this->db->query($sql);
4245 4268
             if ($this->db->getRecordCount($result) == 1) {
@@ -4740,7 +4763,7 @@  discard block
 block discarded – undo
4740 4763
             $result = $this->db->makeArray($rs);
4741 4764
 
4742 4765
             // get default/built-in template variables
4743
-            if(is_array($docRow)){
4766
+            if(is_array($docRow)) {
4744 4767
                 ksort($docRow);
4745 4768
 
4746 4769
                 foreach ($docRow as $key => $value) {
@@ -5219,12 +5242,16 @@  discard block
 block discarded – undo
5219 5242
             return '';
5220 5243
         } // nothing to register
5221 5244
         if (!is_array($options)) {
5222
-            if (is_bool($options))  // backward compatibility with old plaintext parameter
5245
+            if (is_bool($options)) {
5246
+                // backward compatibility with old plaintext parameter
5223 5247
             {
5224 5248
                 $options = array('plaintext' => $options);
5225
-            } elseif (is_string($options)) // Also allow script name as 2nd param
5249
+            }
5250
+            } elseif (is_string($options)) {
5251
+                // Also allow script name as 2nd param
5226 5252
             {
5227 5253
                 $options = array('name' => $options);
5254
+            }
5228 5255
             } else {
5229 5256
                 $options = array();
5230 5257
             }
@@ -5236,7 +5263,8 @@  discard block
 block discarded – undo
5236 5263
         unset($overwritepos); // probably unnecessary--just making sure
5237 5264
 
5238 5265
         $useThisVer = true;
5239
-        if (isset($this->loadedjscripts[$key])) { // a matching script was found
5266
+        if (isset($this->loadedjscripts[$key])) {
5267
+// a matching script was found
5240 5268
             // if existing script is a startup script, make sure the candidate is also a startup script
5241 5269
             if ($this->loadedjscripts[$key]['startup']) {
5242 5270
                 $startup = true;
@@ -5256,7 +5284,8 @@  discard block
 block discarded – undo
5256 5284
                     // overwrite the old script (the position may be important for dependent scripts)
5257 5285
                     $overwritepos = $this->loadedjscripts[$key]['pos'];
5258 5286
                 }
5259
-            } else { // Use the original version
5287
+            } else {
5288
+// Use the original version
5260 5289
                 if ($startup == true && $this->loadedjscripts[$key]['startup'] == false) {
5261 5290
                     // need to move the exisiting script to the head
5262 5291
                     $version = $this->loadedjscripts[$key][$version];
@@ -5381,7 +5410,8 @@  discard block
 block discarded – undo
5381 5410
         }
5382 5411
 
5383 5412
         $results = null;
5384
-        foreach ($this->pluginEvent[$evtName] as $pluginName) { // start for loop
5413
+        foreach ($this->pluginEvent[$evtName] as $pluginName) {
5414
+// start for loop
5385 5415
             if ($this->dumpPlugins) {
5386 5416
                 $eventtime = $this->getMicroTime();
5387 5417
             }
@@ -5929,7 +5959,8 @@  discard block
 block discarded – undo
5929 5959
      * @return bool
5930 5960
      */
5931 5961
     public function isSafeCode($phpcode = '', $safe_functions = '')
5932
-    { // return true or false
5962
+    {
5963
+// return true or false
5933 5964
         if ($safe_functions == '') {
5934 5965
             return false;
5935 5966
         }
@@ -6345,7 +6376,7 @@  discard block
 block discarded – undo
6345 6376
             $args = array_pad(array(), $_, '$var');
6346 6377
             $args = implode(", ", $args);
6347 6378
             $modx = &$this;
6348
-            $args = preg_replace_callback('/\$var/', function () use ($modx, &$tmp, $val) {
6379
+            $args = preg_replace_callback('/\$var/', function () use ($modx, &$tmp, $val){
6349 6380
                 $arg = $val['args'][$tmp - 1];
6350 6381
                 switch (true) {
6351 6382
                     case is_null($arg): {
Please login to merge, or discard this patch.
Doc Comments   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
      * MODX_MANAGER_PATH."includes/extenders/ex_{$extname}.inc.php"
277 277
      * $extname - extension name in lowercase
278 278
      *
279
-     * @param $extname
279
+     * @param string $extname
280 280
      * @param bool $reload
281 281
      * @return bool
282 282
      */
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
      * @param int $count_attempts
320 320
      * @param string $type $type
321 321
      * @param string $responseCode
322
-     * @return bool|null
322
+     * @return false|null
323 323
      * @global string $base_url
324 324
      * @global string $site_url
325 325
      */
@@ -1021,7 +1021,7 @@  discard block
 block discarded – undo
1021 1021
     }
1022 1022
 
1023 1023
     /**
1024
-     * @param $contents
1024
+     * @param string $contents
1025 1025
      * @return mixed
1026 1026
      */
1027 1027
     public function RecoveryEscapedTags($contents)
@@ -1045,7 +1045,7 @@  discard block
 block discarded – undo
1045 1045
     }
1046 1046
 
1047 1047
     /**
1048
-     * @param $tstart
1048
+     * @param double $tstart
1049 1049
      * @return array
1050 1050
      */
1051 1051
     public function getTimerStats($tstart)
@@ -1813,7 +1813,7 @@  discard block
 block discarded – undo
1813 1813
 
1814 1814
     /**
1815 1815
      * Remove Comment-Tags from output like <!--@- Comment -@-->
1816
-     * @param $content
1816
+     * @param string $content
1817 1817
      * @param string $left
1818 1818
      * @param string $right
1819 1819
      * @return mixed
@@ -1986,7 +1986,7 @@  discard block
 block discarded – undo
1986 1986
     /**
1987 1987
      * Run snippets as per the tags in $documentSource and replace the tags with the returned values.
1988 1988
      *
1989
-     * @param $content
1989
+     * @param string $content
1990 1990
      * @return string
1991 1991
      * @internal param string $documentSource
1992 1992
      */
@@ -3023,7 +3023,7 @@  discard block
 block discarded – undo
3023 3023
 
3024 3024
     /**
3025 3025
      * @param $templateID
3026
-     * @return mixed
3026
+     * @return string
3027 3027
      */
3028 3028
     public function _getTemplateCodeFromDB($templateID)
3029 3029
     {
@@ -3066,7 +3066,7 @@  discard block
 block discarded – undo
3066 3066
     /**
3067 3067
      * @param $id
3068 3068
      * @param int $top
3069
-     * @return mixed
3069
+     * @return string
3070 3070
      */
3071 3071
     public function getUltimateParentId($id, $top = 0)
3072 3072
     {
@@ -3397,7 +3397,7 @@  discard block
 block discarded – undo
3397 3397
      *
3398 3398
      * @param int $type Types: 1=template, 2=tv, 3=chunk, 4=snippet, 5=plugin, 6=module, 7=resource, 8=role
3399 3399
      * @param int $id Element- / Resource-id
3400
-     * @return bool
3400
+     * @return false|null
3401 3401
      */
3402 3402
     public function lockElement($type, $id)
3403 3403
     {
@@ -3419,7 +3419,7 @@  discard block
 block discarded – undo
3419 3419
      * @param int $type Types: 1=template, 2=tv, 3=chunk, 4=snippet, 5=plugin, 6=module, 7=resource, 8=role
3420 3420
      * @param int $id Element- / Resource-id
3421 3421
      * @param bool $includeAllUsers true = Deletes not only own user-locks
3422
-     * @return bool
3422
+     * @return false|null
3423 3423
      */
3424 3424
     public function unlockElement($type, $id, $includeAllUsers = false)
3425 3425
     {
@@ -3527,7 +3527,7 @@  discard block
 block discarded – undo
3527 3527
      * @param array $params
3528 3528
      * @param string $msg
3529 3529
      * @param array $files
3530
-     * @return mixed
3530
+     * @return boolean
3531 3531
      */
3532 3532
     public function sendmail($params = array(), $msg = '', $files = array())
3533 3533
     {
@@ -3931,7 +3931,7 @@  discard block
 block discarded – undo
3931 3931
      *                     Default: 1
3932 3932
      * @param string $fields List of fields
3933 3933
      *                       Default: id, pagetitle, description, alias
3934
-     * @return boolean|array
3934
+     * @return string
3935 3935
      */
3936 3936
     public function getPageInfo($pageid = -1, $active = 1, $fields = 'id, pagetitle, description, alias')
3937 3937
     {
@@ -4023,7 +4023,7 @@  discard block
 block discarded – undo
4023 4023
      *
4024 4024
      * @param string $type
4025 4025
      * @param bool $report
4026
-     * @return bool
4026
+     * @return boolean|null
4027 4027
      */
4028 4028
     public function clearCache($type = '', $report = false)
4029 4029
     {
@@ -4390,7 +4390,7 @@  discard block
 block discarded – undo
4390 4390
      * - Placeholders prefix. Default: '{'.
4391 4391
      * @param string $suffix {string}
4392 4392
      * - Placeholders suffix. Default: '}'.
4393
-     * @return bool|mixed|string {string; false} - Parsed chunk or false if $chunkArr is not array.
4393
+     * @return false|string {string; false} - Parsed chunk or false if $chunkArr is not array.
4394 4394
      * - Parsed chunk or false if $chunkArr is not array.
4395 4395
      */
4396 4396
     public function parseChunk($chunkName, $chunkArr, $prefix = '{', $suffix = '}')
@@ -5366,7 +5366,7 @@  discard block
 block discarded – undo
5366 5366
      * Remove event listener - only for use within the current execution cycle
5367 5367
      *
5368 5368
      * @param string $evtName
5369
-     * @return boolean
5369
+     * @return false|null
5370 5370
      */
5371 5371
     public function removeEventListener($evtName)
5372 5372
     {
@@ -5390,7 +5390,7 @@  discard block
 block discarded – undo
5390 5390
      *
5391 5391
      * @param string $evtName
5392 5392
      * @param array $extParams Parameters available to plugins. Each array key will be the PHP variable name, and the array value will be the variable value.
5393
-     * @return boolean|array
5393
+     * @return false|null
5394 5394
      */
5395 5395
     public function invokeEvent($evtName, $extParams = array())
5396 5396
     {
@@ -5985,7 +5985,7 @@  discard block
 block discarded – undo
5985 5985
 
5986 5986
     /**
5987 5987
      * @param string $str
5988
-     * @return bool|mixed|string
5988
+     * @return string
5989 5989
      */
5990 5990
     public function atBindFileContent($str = '')
5991 5991
     {
@@ -6036,8 +6036,8 @@  discard block
 block discarded – undo
6036 6036
     }
6037 6037
 
6038 6038
     /**
6039
-     * @param $str
6040
-     * @return bool|string
6039
+     * @param string $str
6040
+     * @return false|string
6041 6041
      */
6042 6042
     public function getExtFromFilename($str)
6043 6043
     {
@@ -6065,7 +6065,7 @@  discard block
 block discarded – undo
6065 6065
      * @param string $text Error message
6066 6066
      * @param string $file File where the error was detected
6067 6067
      * @param string $line Line number within $file
6068
-     * @return boolean
6068
+     * @return boolean|null
6069 6069
      */
6070 6070
     public function phpError($nr, $text, $file, $line)
6071 6071
     {
@@ -6117,7 +6117,7 @@  discard block
 block discarded – undo
6117 6117
      * @param string $text
6118 6118
      * @param string $line
6119 6119
      * @param string $output
6120
-     * @return bool
6120
+     * @return null|boolean
6121 6121
      */
6122 6122
     public function messageQuit($msg = 'unspecified error', $query = '', $is_error = true, $nr = '', $file = '', $source = '', $text = '', $line = '', $output = '')
6123 6123
     {
@@ -6539,7 +6539,7 @@  discard block
 block discarded – undo
6539 6539
 
6540 6540
     /**
6541 6541
      * @param string $str
6542
-     * @return bool|mixed|string
6542
+     * @return string
6543 6543
      */
6544 6544
     public function atBindInclude($str = '')
6545 6545
     {
@@ -6590,7 +6590,7 @@  discard block
 block discarded – undo
6590 6590
      * @param $str
6591 6591
      * @param int $flags
6592 6592
      * @param string $encode
6593
-     * @return mixed
6593
+     * @return string
6594 6594
      */
6595 6595
     public function htmlspecialchars($str, $flags = ENT_COMPAT, $encode = '')
6596 6596
     {
@@ -6599,7 +6599,7 @@  discard block
 block discarded – undo
6599 6599
     }
6600 6600
 
6601 6601
     /**
6602
-     * @param $string
6602
+     * @param string $string
6603 6603
      * @param bool $returnData
6604 6604
      * @return bool|mixed
6605 6605
      */
@@ -6763,7 +6763,7 @@  discard block
 block discarded – undo
6763 6763
     }
6764 6764
 
6765 6765
     /**
6766
-     * @return mixed
6766
+     * @return string
6767 6767
      */
6768 6768
     public function getOutput()
6769 6769
     {
Please login to merge, or discard this patch.
Spacing   +269 added lines, -269 removed lines patch added patch discarded remove patch
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
      */
226 226
     function __call($method_name, $arguments)
227 227
     {
228
-        include_once(MODX_MANAGER_PATH . 'includes/extenders/deprecated.functions.inc.php');
228
+        include_once(MODX_MANAGER_PATH.'includes/extenders/deprecated.functions.inc.php');
229 229
         if (method_exists($this->old, $method_name)) {
230 230
             $error_type = 1;
231 231
         } else {
@@ -243,12 +243,12 @@  discard block
 block discarded – undo
243 243
             $info = debug_backtrace();
244 244
             $m[] = $msg;
245 245
             if (!empty($this->currentSnippet)) {
246
-                $m[] = 'Snippet - ' . $this->currentSnippet;
246
+                $m[] = 'Snippet - '.$this->currentSnippet;
247 247
             } elseif (!empty($this->event->activePlugin)) {
248
-                $m[] = 'Plugin - ' . $this->event->activePlugin;
248
+                $m[] = 'Plugin - '.$this->event->activePlugin;
249 249
             }
250 250
             $m[] = $this->decoded_request_uri;
251
-            $m[] = str_replace('\\', '/', $info[0]['file']) . '(line:' . $info[0]['line'] . ')';
251
+            $m[] = str_replace('\\', '/', $info[0]['file']).'(line:'.$info[0]['line'].')';
252 252
             $msg = implode('<br />', $m);
253 253
             $this->logEvent(0, $error_type, $msg, $title);
254 254
         }
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
     {
266 266
         $flag = false;
267 267
         if (is_scalar($connector) && !empty($connector) && isset($this->{$connector}) && $this->{$connector} instanceof DBAPI) {
268
-            $flag = (bool)$this->{$connector}->conn;
268
+            $flag = (bool) $this->{$connector}->conn;
269 269
         }
270 270
         return $flag;
271 271
     }
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
         }
293 293
         if (!$out && $flag) {
294 294
             $extname = trim(str_replace(array('..', '/', '\\'), '', strtolower($extname)));
295
-            $filename = MODX_MANAGER_PATH . "includes/extenders/ex_{$extname}.inc.php";
295
+            $filename = MODX_MANAGER_PATH."includes/extenders/ex_{$extname}.inc.php";
296 296
             $out = is_file($filename) ? include $filename : false;
297 297
         }
298 298
         if ($out && !in_array($extname, $this->extensions)) {
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
     public function getMicroTime()
310 310
     {
311 311
         list ($usec, $sec) = explode(' ', microtime());
312
-        return ((float)$usec + (float)$sec);
312
+        return ((float) $usec + (float) $sec);
313 313
     }
314 314
 
315 315
     /**
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
             // append the redirect count string to the url
334 334
             $currentNumberOfRedirects = isset ($_REQUEST['err']) ? $_REQUEST['err'] : 0;
335 335
             if ($currentNumberOfRedirects > 3) {
336
-                $this->messageQuit('Redirection attempt failed - please ensure the document you\'re trying to redirect to exists. <p>Redirection URL: <i>' . $url . '</i></p>');
336
+                $this->messageQuit('Redirection attempt failed - please ensure the document you\'re trying to redirect to exists. <p>Redirection URL: <i>'.$url.'</i></p>');
337 337
             } else {
338 338
                 $currentNumberOfRedirects += 1;
339 339
                 if (strpos($url, "?") > 0) {
@@ -344,9 +344,9 @@  discard block
 block discarded – undo
344 344
             }
345 345
         }
346 346
         if ($type == 'REDIRECT_REFRESH') {
347
-            $header = 'Refresh: 0;URL=' . $url;
347
+            $header = 'Refresh: 0;URL='.$url;
348 348
         } elseif ($type == 'REDIRECT_META') {
349
-            $header = '<META HTTP-EQUIV="Refresh" CONTENT="0; URL=' . $url . '" />';
349
+            $header = '<META HTTP-EQUIV="Refresh" CONTENT="0; URL='.$url.'" />';
350 350
             echo $header;
351 351
             exit;
352 352
         } elseif ($type == 'REDIRECT_HEADER' || empty ($type)) {
@@ -354,10 +354,10 @@  discard block
 block discarded – undo
354 354
             global $base_url, $site_url;
355 355
             if (substr($url, 0, strlen($base_url)) == $base_url) {
356 356
                 // append $site_url to make it work with Location:
357
-                $url = $site_url . substr($url, strlen($base_url));
357
+                $url = $site_url.substr($url, strlen($base_url));
358 358
             }
359 359
             if (strpos($url, "\n") === false) {
360
-                $header = 'Location: ' . $url;
360
+                $header = 'Location: '.$url;
361 361
             } else {
362 362
                 $this->messageQuit('No newline allowed in redirect url.');
363 363
             }
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
             header($responseCode);
367 367
         }
368 368
 
369
-        if(!empty($header)) {
369
+        if (!empty($header)) {
370 370
             header($header);
371 371
         }
372 372
 
@@ -471,8 +471,8 @@  discard block
 block discarded – undo
471 471
 
472 472
     private function recoverySiteCache()
473 473
     {
474
-        $site_cache_dir = MODX_BASE_PATH . $this->getCacheFolder();
475
-        $site_cache_path = $site_cache_dir . 'siteCache.idx.php';
474
+        $site_cache_dir = MODX_BASE_PATH.$this->getCacheFolder();
475
+        $site_cache_path = $site_cache_dir.'siteCache.idx.php';
476 476
 
477 477
         if (is_file($site_cache_path)) {
478 478
             include($site_cache_path);
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
             return;
482 482
         }
483 483
 
484
-        include_once(MODX_MANAGER_PATH . 'processors/cache_sync.class.processor.php');
484
+        include_once(MODX_MANAGER_PATH.'processors/cache_sync.class.processor.php');
485 485
         $cache = new synccache();
486 486
         $cache->setCachepath($site_cache_dir);
487 487
         $cache->setReport(false);
@@ -533,8 +533,8 @@  discard block
 block discarded – undo
533 533
                 $this->invokeEvent("OnBeforeManagerPageInit");
534 534
             }
535 535
 
536
-            if (isset ($_SESSION[$usrType . 'UsrConfigSet'])) {
537
-                $usrSettings = &$_SESSION[$usrType . 'UsrConfigSet'];
536
+            if (isset ($_SESSION[$usrType.'UsrConfigSet'])) {
537
+                $usrSettings = &$_SESSION[$usrType.'UsrConfigSet'];
538 538
             } else {
539 539
                 if ($usrType == 'web') {
540 540
                     $from = $tbl_web_user_settings;
@@ -554,7 +554,7 @@  discard block
 block discarded – undo
554 554
                     $usrSettings[$row['setting_name']] = $row['setting_value'];
555 555
                 }
556 556
                 if (isset ($usrType)) {
557
-                    $_SESSION[$usrType . 'UsrConfigSet'] = $usrSettings;
557
+                    $_SESSION[$usrType.'UsrConfigSet'] = $usrSettings;
558 558
                 } // store user settings in session
559 559
             }
560 560
         }
@@ -699,10 +699,10 @@  discard block
 block discarded – undo
699 699
         $suf = $this->config['friendly_url_suffix'];
700 700
         $pre = preg_quote($pre, '/');
701 701
         $suf = preg_quote($suf, '/');
702
-        if ($pre && preg_match('@^' . $pre . '(.*)$@', $q, $_)) {
702
+        if ($pre && preg_match('@^'.$pre.'(.*)$@', $q, $_)) {
703 703
             $q = $_[1];
704 704
         }
705
-        if ($suf && preg_match('@(.*)' . $suf . '$@', $q, $_)) {
705
+        if ($suf && preg_match('@(.*)'.$suf.'$@', $q, $_)) {
706 706
             $q = $_[1];
707 707
         }
708 708
 
@@ -724,7 +724,7 @@  discard block
 block discarded – undo
724 724
         if (preg_match('@^[1-9][0-9]*$@', $q) && !isset($this->documentListing[$q])) { /* we got an ID returned, check to make sure it's not an alias */
725 725
             /* FS#476 and FS#308: check that id is valid in terms of virtualDir structure */
726 726
             if ($this->config['use_alias_path'] == 1) {
727
-                if (($this->virtualDir != '' && !isset($this->documentListing[$this->virtualDir . '/' . $q]) || ($this->virtualDir == '' && !isset($this->documentListing[$q]))) && (($this->virtualDir != '' && isset($this->documentListing[$this->virtualDir]) && in_array($q, $this->getChildIds($this->documentListing[$this->virtualDir], 1))) || ($this->virtualDir == '' && in_array($q, $this->getChildIds(0, 1))))) {
727
+                if (($this->virtualDir != '' && !isset($this->documentListing[$this->virtualDir.'/'.$q]) || ($this->virtualDir == '' && !isset($this->documentListing[$q]))) && (($this->virtualDir != '' && isset($this->documentListing[$this->virtualDir]) && in_array($q, $this->getChildIds($this->documentListing[$this->virtualDir], 1))) || ($this->virtualDir == '' && in_array($q, $this->getChildIds(0, 1))))) {
728 728
                     $this->documentMethod = 'id';
729 729
                     return $q;
730 730
                 } else { /* not a valid id in terms of virtualDir, treat as alias */
@@ -758,7 +758,7 @@  discard block
 block discarded – undo
758 758
      */
759 759
     public function getHashFile($key)
760 760
     {
761
-        return $this->getCacheFolder() . "docid_" . $key . ".pageCache.php";
761
+        return $this->getCacheFolder()."docid_".$key.".pageCache.php";
762 762
     }
763 763
 
764 764
     /**
@@ -769,9 +769,9 @@  discard block
 block discarded – undo
769 769
         $hash = $id;
770 770
         $tmp = null;
771 771
         $params = array();
772
-        if(!empty($this->systemCacheKey)){
772
+        if (!empty($this->systemCacheKey)) {
773 773
             $hash = $this->systemCacheKey;
774
-        }else {
774
+        } else {
775 775
             if (!empty($_GET)) {
776 776
                 // Sort GET parameters so that the order of parameters on the HTTP request don't affect the generated cache ID.
777 777
                 $params = $_GET;
@@ -779,8 +779,8 @@  discard block
 block discarded – undo
779 779
                 $hash .= '_'.md5(http_build_query($params));
780 780
             }
781 781
         }
782
-        $evtOut = $this->invokeEvent("OnMakePageCacheKey", array ("hash" => $hash, "id" => $id, 'params' => $params));
783
-        if (is_array($evtOut) && count($evtOut) > 0){
782
+        $evtOut = $this->invokeEvent("OnMakePageCacheKey", array("hash" => $hash, "id" => $id, 'params' => $params));
783
+        if (is_array($evtOut) && count($evtOut) > 0) {
784 784
             $tmp = array_pop($evtOut);
785 785
         }
786 786
         return empty($tmp) ? $hash : $tmp;
@@ -922,12 +922,12 @@  discard block
 block discarded – undo
922 922
         if ($js = $this->getRegisteredClientStartupScripts()) {
923 923
             // change to just before closing </head>
924 924
             // $this->documentContent = preg_replace("/(<head[^>]*>)/i", "\\1\n".$js, $this->documentContent);
925
-            $this->documentOutput = preg_replace("/(<\/head>)/i", $js . "\n\\1", $this->documentOutput);
925
+            $this->documentOutput = preg_replace("/(<\/head>)/i", $js."\n\\1", $this->documentOutput);
926 926
         }
927 927
 
928 928
         // Insert jscripts & html block into template - template must have a </body> tag
929 929
         if ($js = $this->getRegisteredClientScripts()) {
930
-            $this->documentOutput = preg_replace("/(<\/body>)/i", $js . "\n\\1", $this->documentOutput);
930
+            $this->documentOutput = preg_replace("/(<\/body>)/i", $js."\n\\1", $this->documentOutput);
931 931
         }
932 932
         // End fix by sirlancelot
933 933
 
@@ -938,7 +938,7 @@  discard block
 block discarded – undo
938 938
         // send out content-type and content-disposition headers
939 939
         if (IN_PARSER_MODE == "true") {
940 940
             $type = !empty ($this->contentTypes[$this->documentIdentifier]) ? $this->contentTypes[$this->documentIdentifier] : "text/html";
941
-            header('Content-Type: ' . $type . '; charset=' . $this->config['modx_charset']);
941
+            header('Content-Type: '.$type.'; charset='.$this->config['modx_charset']);
942 942
             //            if (($this->documentIdentifier == $this->config['error_page']) || $redirect_error)
943 943
             //                header('HTTP/1.0 404 Not Found');
944 944
             if (!$this->checkPreview() && $this->documentObject['content_dispo'] == 1) {
@@ -956,7 +956,7 @@  discard block
 block discarded – undo
956 956
                     $name = preg_replace('|-+|', '-', $name);
957 957
                     $name = trim($name, '-');
958 958
                 }
959
-                $header = 'Content-Disposition: attachment; filename=' . $name;
959
+                $header = 'Content-Disposition: attachment; filename='.$name;
960 960
                 header($header);
961 961
             }
962 962
         }
@@ -964,7 +964,7 @@  discard block
 block discarded – undo
964 964
 
965 965
         $stats = $this->getTimerStats($this->tstart);
966 966
 
967
-        $out =& $this->documentOutput;
967
+        $out = & $this->documentOutput;
968 968
         $out = str_replace("[^q^]", $stats['queries'], $out);
969 969
         $out = str_replace("[^qt^]", $stats['queryTime'], $out);
970 970
         $out = str_replace("[^p^]", $stats['phpTime'], $out);
@@ -1003,17 +1003,17 @@  discard block
 block discarded – undo
1003 1003
                 $sc .= sprintf("%s. %s (%s)<br>", $s, $sname, sprintf("%2.2f ms", $t)); // currentSnippet
1004 1004
                 $tt += $t;
1005 1005
             }
1006
-            echo "<fieldset><legend><b>Snippets</b> (" . count($this->snippetsTime) . " / " . sprintf("%2.2f ms", $tt) . ")</legend>{$sc}</fieldset><br />";
1006
+            echo "<fieldset><legend><b>Snippets</b> (".count($this->snippetsTime)." / ".sprintf("%2.2f ms", $tt).")</legend>{$sc}</fieldset><br />";
1007 1007
             echo $this->snippetsCode;
1008 1008
         }
1009 1009
         if ($this->dumpPlugins) {
1010 1010
             $ps = "";
1011 1011
             $tt = 0;
1012 1012
             foreach ($this->pluginsTime as $s => $t) {
1013
-                $ps .= "$s (" . sprintf("%2.2f ms", $t * 1000) . ")<br>";
1013
+                $ps .= "$s (".sprintf("%2.2f ms", $t * 1000).")<br>";
1014 1014
                 $tt += $t;
1015 1015
             }
1016
-            echo "<fieldset><legend><b>Plugins</b> (" . count($this->pluginsTime) . " / " . sprintf("%2.2f ms", $tt * 1000) . ")</legend>{$ps}</fieldset><br />";
1016
+            echo "<fieldset><legend><b>Plugins</b> (".count($this->pluginsTime)." / ".sprintf("%2.2f ms", $tt * 1000).")</legend>{$ps}</fieldset><br />";
1017 1017
             echo $this->pluginsCode;
1018 1018
         }
1019 1019
 
@@ -1039,7 +1039,7 @@  discard block
 block discarded – undo
1039 1039
         $srcTags = explode(',', $tags);
1040 1040
         $repTags = array();
1041 1041
         foreach ($srcTags as $tag) {
1042
-            $repTags[] = '\\' . $tag[0] . '\\' . $tag[1];
1042
+            $repTags[] = '\\'.$tag[0].'\\'.$tag[1];
1043 1043
         }
1044 1044
         return array($srcTags, $repTags);
1045 1045
     }
@@ -1061,7 +1061,7 @@  discard block
 block discarded – undo
1061 1061
         $stats['phpTime'] = sprintf("%2.4f s", $stats['phpTime']);
1062 1062
         $stats['source'] = $this->documentGenerated == 1 ? "database" : "cache";
1063 1063
         $stats['queries'] = isset ($this->executedQueries) ? $this->executedQueries : 0;
1064
-        $stats['phpMemory'] = (memory_get_peak_usage(true) / 1024 / 1024) . " mb";
1064
+        $stats['phpMemory'] = (memory_get_peak_usage(true) / 1024 / 1024)." mb";
1065 1065
 
1066 1066
         return $stats;
1067 1067
     }
@@ -1094,7 +1094,7 @@  discard block
 block discarded – undo
1094 1094
     {
1095 1095
         $cacheRefreshTime = 0;
1096 1096
         $recent_update = 0;
1097
-        @include(MODX_BASE_PATH . $this->getCacheFolder() . 'sitePublishing.idx.php');
1097
+        @include(MODX_BASE_PATH.$this->getCacheFolder().'sitePublishing.idx.php');
1098 1098
         $this->recentUpdate = $recent_update;
1099 1099
 
1100 1100
         $timeNow = $_SERVER['REQUEST_TIME'] + $this->config['server_offset_time'];
@@ -1105,7 +1105,7 @@  discard block
 block discarded – undo
1105 1105
         // now, check for documents that need publishing
1106 1106
         $field = array('published' => 1, 'publishedon' => $timeNow);
1107 1107
         $where = "pub_date <= {$timeNow} AND pub_date!=0 AND published=0";
1108
-        $result_pub = $this->db->select( 'id', '[+prefix+]site_content',  $where);
1108
+        $result_pub = $this->db->select('id', '[+prefix+]site_content', $where);
1109 1109
         $this->db->update($field, '[+prefix+]site_content', $where);
1110 1110
         if ($this->db->getRecordCount($result_pub) >= 1) { //Event unPublished doc
1111 1111
             while ($row_pub = $this->db->getRow($result_pub)) {
@@ -1118,7 +1118,7 @@  discard block
 block discarded – undo
1118 1118
         // now, check for documents that need un-publishing
1119 1119
         $field = array('published' => 0, 'publishedon' => 0);
1120 1120
         $where = "unpub_date <= {$timeNow} AND unpub_date!=0 AND published=1";
1121
-        $result_unpub = $this->db->select( 'id', '[+prefix+]site_content',  $where);
1121
+        $result_unpub = $this->db->select('id', '[+prefix+]site_content', $where);
1122 1122
         $this->db->update($field, '[+prefix+]site_content', $where);
1123 1123
         if ($this->db->getRecordCount($result_unpub) >= 1) { //Event unPublished doc
1124 1124
             while ($row_unpub = $this->db->getRow($result_unpub)) {
@@ -1164,8 +1164,8 @@  discard block
 block discarded – undo
1164 1164
                 }
1165 1165
 
1166 1166
                 $docObjSerial = serialize($this->documentObject);
1167
-                $cacheContent = $docObjSerial . "<!--__MODxCacheSpliter__-->" . $this->documentContent;
1168
-                $page_cache_path = MODX_BASE_PATH . $this->getHashFile($this->cacheKey);
1167
+                $cacheContent = $docObjSerial."<!--__MODxCacheSpliter__-->".$this->documentContent;
1168
+                $page_cache_path = MODX_BASE_PATH.$this->getHashFile($this->cacheKey);
1169 1169
                 file_put_contents($page_cache_path, "<?php die('Unauthorized access.'); ?>$cacheContent");
1170 1170
             }
1171 1171
         }
@@ -1207,16 +1207,16 @@  discard block
 block discarded – undo
1207 1207
             return array();
1208 1208
         }
1209 1209
         $spacer = md5('<<<EVO>>>');
1210
-        if($left==='{{' && strpos($content,';}}')!==false)  $content = str_replace(';}}', sprintf(';}%s}',   $spacer),$content);
1211
-        if($left==='{{' && strpos($content,'{{}}')!==false) $content = str_replace('{{}}',sprintf('{%$1s{}%$1s}',$spacer),$content);
1212
-        if($left==='[[' && strpos($content,']]]]')!==false) $content = str_replace(']]]]',sprintf(']]%s]]',  $spacer),$content);
1213
-        if($left==='[[' && strpos($content,']]]')!==false)  $content = str_replace(']]]', sprintf(']%s]]',   $spacer),$content);
1210
+        if ($left === '{{' && strpos($content, ';}}') !== false)  $content = str_replace(';}}', sprintf(';}%s}', $spacer), $content);
1211
+        if ($left === '{{' && strpos($content, '{{}}') !== false) $content = str_replace('{{}}', sprintf('{%$1s{}%$1s}', $spacer), $content);
1212
+        if ($left === '[[' && strpos($content, ']]]]') !== false) $content = str_replace(']]]]', sprintf(']]%s]]', $spacer), $content);
1213
+        if ($left === '[[' && strpos($content, ']]]') !== false)  $content = str_replace(']]]', sprintf(']%s]]', $spacer), $content);
1214 1214
 
1215 1215
         $pos['<![CDATA['] = strpos($content, '<![CDATA[');
1216 1216
         $pos[']]>'] = strpos($content, ']]>');
1217 1217
 
1218 1218
         if ($pos['<![CDATA['] !== false && $pos[']]>'] !== false) {
1219
-            $content = substr($content, 0, $pos['<![CDATA[']) . substr($content, $pos[']]>'] + 3);
1219
+            $content = substr($content, 0, $pos['<![CDATA[']).substr($content, $pos[']]>'] + 3);
1220 1220
         }
1221 1221
 
1222 1222
         $lp = explode($left, $content);
@@ -1280,8 +1280,8 @@  discard block
 block discarded – undo
1280 1280
                 }
1281 1281
             }
1282 1282
         }
1283
-        foreach($tags as $i=>$tag) {
1284
-            if(strpos($tag,$spacer)!==false) $tags[$i] = str_replace($spacer, '', $tag);
1283
+        foreach ($tags as $i=>$tag) {
1284
+            if (strpos($tag, $spacer) !== false) $tags[$i] = str_replace($spacer, '', $tag);
1285 1285
         }
1286 1286
         return $tags;
1287 1287
     }
@@ -1321,7 +1321,7 @@  discard block
 block discarded – undo
1321 1321
         }
1322 1322
 
1323 1323
         foreach ($matches[1] as $i => $key) {
1324
-            if(strpos($key,'[+')!==false) continue; // Allow chunk {{chunk?&param=`xxx`}} with [*tv_name_[+param+]*] as content
1324
+            if (strpos($key, '[+') !== false) continue; // Allow chunk {{chunk?&param=`xxx`}} with [*tv_name_[+param+]*] as content
1325 1325
             if (substr($key, 0, 1) == '#') {
1326 1326
                 $key = substr($key, 1);
1327 1327
             } // remove # for QuickEdit format
@@ -1341,8 +1341,8 @@  discard block
 block discarded – undo
1341 1341
             }
1342 1342
 
1343 1343
             if (is_array($value)) {
1344
-                include_once(MODX_MANAGER_PATH . 'includes/tmplvars.format.inc.php');
1345
-                include_once(MODX_MANAGER_PATH . 'includes/tmplvars.commands.inc.php');
1344
+                include_once(MODX_MANAGER_PATH.'includes/tmplvars.format.inc.php');
1345
+                include_once(MODX_MANAGER_PATH.'includes/tmplvars.commands.inc.php');
1346 1346
                 $value = getTVDisplayFormat($value[0], $value[1], $value[2], $value[3], $value[4]);
1347 1347
             }
1348 1348
 
@@ -1353,8 +1353,8 @@  discard block
 block discarded – undo
1353 1353
 
1354 1354
             if (strpos($content, $s) !== false) {
1355 1355
                 $content = str_replace($s, $value, $content);
1356
-            } elseif($this->debug) {
1357
-                $this->addLog('mergeDocumentContent parse error', $_SERVER['REQUEST_URI'] . $s, 2);
1356
+            } elseif ($this->debug) {
1357
+                $this->addLog('mergeDocumentContent parse error', $_SERVER['REQUEST_URI'].$s, 2);
1358 1358
             }
1359 1359
         }
1360 1360
 
@@ -1521,8 +1521,8 @@  discard block
 block discarded – undo
1521 1521
             $s = &$matches[0][$i];
1522 1522
             if (strpos($content, $s) !== false) {
1523 1523
                 $content = str_replace($s, $value, $content);
1524
-            } elseif($this->debug) {
1525
-                $this->addLog('mergeSettingsContent parse error', $_SERVER['REQUEST_URI'] . $s, 2);
1524
+            } elseif ($this->debug) {
1525
+                $this->addLog('mergeSettingsContent parse error', $_SERVER['REQUEST_URI'].$s, 2);
1526 1526
             }
1527 1527
         }
1528 1528
         return $content;
@@ -1575,7 +1575,7 @@  discard block
 block discarded – undo
1575 1575
             }
1576 1576
 
1577 1577
             $value = $this->parseText($value, $params); // parse local scope placeholers for ConditionalTags
1578
-            $value = $this->mergePlaceholderContent($value, $params);  // parse page global placeholers
1578
+            $value = $this->mergePlaceholderContent($value, $params); // parse page global placeholers
1579 1579
             if ($this->config['enable_at_syntax']) {
1580 1580
                 $value = $this->mergeConditionalTagsContent($value);
1581 1581
             }
@@ -1590,8 +1590,8 @@  discard block
 block discarded – undo
1590 1590
             $s = &$matches[0][$i];
1591 1591
             if (strpos($content, $s) !== false) {
1592 1592
                 $content = str_replace($s, $value, $content);
1593
-            } elseif($this->debug) {
1594
-                $this->addLog('mergeChunkContent parse error', $_SERVER['REQUEST_URI'] . $s, 2);
1593
+            } elseif ($this->debug) {
1594
+                $this->addLog('mergeChunkContent parse error', $_SERVER['REQUEST_URI'].$s, 2);
1595 1595
             }
1596 1596
         }
1597 1597
         return $content;
@@ -1649,8 +1649,8 @@  discard block
 block discarded – undo
1649 1649
             $s = &$matches[0][$i];
1650 1650
             if (strpos($content, $s) !== false) {
1651 1651
                 $content = str_replace($s, $value, $content);
1652
-            } elseif($this->debug) {
1653
-                $this->addLog('mergePlaceholderContent parse error', $_SERVER['REQUEST_URI'] . $s, 2);
1652
+            } elseif ($this->debug) {
1653
+                $this->addLog('mergePlaceholderContent parse error', $_SERVER['REQUEST_URI'].$s, 2);
1654 1654
             }
1655 1655
         }
1656 1656
         return $content;
@@ -1674,7 +1674,7 @@  discard block
 block discarded – undo
1674 1674
             return $content;
1675 1675
         }
1676 1676
 
1677
-        $sp = '#' . md5('ConditionalTags' . $_SERVER['REQUEST_TIME']) . '#';
1677
+        $sp = '#'.md5('ConditionalTags'.$_SERVER['REQUEST_TIME']).'#';
1678 1678
         $content = str_replace(array('<?php', '<?=', '<?', '?>'), array("{$sp}b", "{$sp}p", "{$sp}s", "{$sp}e"), $content);
1679 1679
 
1680 1680
         $pieces = explode('<@IF:', $content);
@@ -1685,7 +1685,7 @@  discard block
 block discarded – undo
1685 1685
             }
1686 1686
             list($cmd, $text) = explode('>', $split, 2);
1687 1687
             $cmd = str_replace("'", "\'", $cmd);
1688
-            $content .= "<?php if(\$this->_parseCTagCMD('" . $cmd . "')): ?>";
1688
+            $content .= "<?php if(\$this->_parseCTagCMD('".$cmd."')): ?>";
1689 1689
             $content .= $text;
1690 1690
         }
1691 1691
         $pieces = explode('<@ELSEIF:', $content);
@@ -1696,13 +1696,13 @@  discard block
 block discarded – undo
1696 1696
             }
1697 1697
             list($cmd, $text) = explode('>', $split, 2);
1698 1698
             $cmd = str_replace("'", "\'", $cmd);
1699
-            $content .= "<?php elseif(\$this->_parseCTagCMD('" . $cmd . "')): ?>";
1699
+            $content .= "<?php elseif(\$this->_parseCTagCMD('".$cmd."')): ?>";
1700 1700
             $content .= $text;
1701 1701
         }
1702 1702
 
1703 1703
         $content = str_replace(array('<@ELSE>', '<@ENDIF>'), array('<?php else:?>', '<?php endif;?>'), $content);
1704 1704
         ob_start();
1705
-        $content = eval('?>' . $content);
1705
+        $content = eval('?>'.$content);
1706 1706
         $content = ob_get_clean();
1707 1707
         $content = str_replace(array("{$sp}b", "{$sp}p", "{$sp}s", "{$sp}e"), array('<?php', '<?=', '<?', '?>'), $content);
1708 1708
 
@@ -1827,7 +1827,7 @@  discard block
 block discarded – undo
1827 1827
         $matches = $this->getTagsFromContent($content, $left, $right);
1828 1828
         if (!empty($matches)) {
1829 1829
             foreach ($matches[0] as $i => $v) {
1830
-                $addBreakMatches[$i] = $v . "\n";
1830
+                $addBreakMatches[$i] = $v."\n";
1831 1831
             }
1832 1832
             $content = str_replace($addBreakMatches, '', $content);
1833 1833
             if (strpos($content, $left) !== false) {
@@ -1860,8 +1860,8 @@  discard block
 block discarded – undo
1860 1860
             $s = &$matches[0][$i];
1861 1861
             if (strpos($content, $s) !== false) {
1862 1862
                 $content = str_replace($s, $v, $content);
1863
-            } elseif($this->debug) {
1864
-                $this->addLog('ignoreCommentedTagsContent parse error', $_SERVER['REQUEST_URI'] . $s, 2);
1863
+            } elseif ($this->debug) {
1864
+                $this->addLog('ignoreCommentedTagsContent parse error', $_SERVER['REQUEST_URI'].$s, 2);
1865 1865
             }
1866 1866
         }
1867 1867
         return $content;
@@ -1925,7 +1925,7 @@  discard block
 block discarded – undo
1925 1925
                 $msg = ($msg === false) ? 'ob_get_contents() error' : $msg;
1926 1926
                 $this->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], 'Plugin', $error_info['message'], $error_info['line'], $msg);
1927 1927
                 if ($this->isBackend()) {
1928
-                    $this->event->alert('An error occurred while loading. Please see the event log for more information.<p>' . $msg . '</p>');
1928
+                    $this->event->alert('An error occurred while loading. Please see the event log for more information.<p>'.$msg.'</p>');
1929 1929
                 }
1930 1930
             }
1931 1931
         } else {
@@ -1971,7 +1971,7 @@  discard block
 block discarded – undo
1971 1971
                 $echo = ($echo === false) ? 'ob_get_contents() error' : $echo;
1972 1972
                 $this->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], 'Snippet', $error_info['message'], $error_info['line'], $echo);
1973 1973
                 if ($this->isBackend()) {
1974
-                    $this->event->alert('An error occurred while loading. Please see the event log for more information<p>' . $echo . $return . '</p>');
1974
+                    $this->event->alert('An error occurred while loading. Please see the event log for more information<p>'.$echo.$return.'</p>');
1975 1975
                 }
1976 1976
             }
1977 1977
         }
@@ -1979,7 +1979,7 @@  discard block
 block discarded – undo
1979 1979
         if (is_array($return) || is_object($return)) {
1980 1980
             return $return;
1981 1981
         } else {
1982
-            return $echo . $return;
1982
+            return $echo.$return;
1983 1983
         }
1984 1984
     }
1985 1985
 
@@ -2017,8 +2017,8 @@  discard block
 block discarded – undo
2017 2017
                 }
2018 2018
                 if (strpos($content, $s) !== false) {
2019 2019
                     $content = str_replace($s, $value, $content);
2020
-                } elseif($this->debug) {
2021
-                    $this->addLog('evalSnippetsSGVar parse error', $_SERVER['REQUEST_URI'] . $s, 2);
2020
+                } elseif ($this->debug) {
2021
+                    $this->addLog('evalSnippetsSGVar parse error', $_SERVER['REQUEST_URI'].$s, 2);
2022 2022
                 }
2023 2023
                 continue;
2024 2024
             }
@@ -2029,8 +2029,8 @@  discard block
 block discarded – undo
2029 2029
 
2030 2030
             if (strpos($content, $s) !== false) {
2031 2031
                 $content = str_replace($s, $value, $content);
2032
-            } elseif($this->debug) {
2033
-                $this->addLog('evalSnippets parse error', $_SERVER['REQUEST_URI'] . $s, 2);
2032
+            } elseif ($this->debug) {
2033
+                $this->addLog('evalSnippets parse error', $_SERVER['REQUEST_URI'].$s, 2);
2034 2034
             }
2035 2035
         }
2036 2036
 
@@ -2121,7 +2121,7 @@  discard block
 block discarded – undo
2121 2121
             $eventtime = sprintf('%2.2f ms', $eventtime * 1000);
2122 2122
             $code = str_replace("\t", '  ', $this->htmlspecialchars($value));
2123 2123
             $piece = str_replace("\t", '  ', $this->htmlspecialchars($piece));
2124
-            $print_r_params = str_replace("\t", '  ', $this->htmlspecialchars('$modx->event->params = ' . print_r($params, true)));
2124
+            $print_r_params = str_replace("\t", '  ', $this->htmlspecialchars('$modx->event->params = '.print_r($params, true)));
2125 2125
             $this->snippetsCode .= sprintf('<fieldset style="margin:1em;"><legend><b>%s</b>(%s)</legend><pre style="white-space: pre-wrap;background-color:#fff;width:90%%;">[[%s]]</pre><pre style="white-space: pre-wrap;background-color:#fff;width:90%%;">%s</pre><pre style="white-space: pre-wrap;background-color:#fff;width:90%%;">%s</pre></fieldset>', $snippetObject['name'], $eventtime, $piece, $print_r_params, $code);
2126 2126
             $this->snippetsTime[] = array('sname' => $key, 'time' => $eventtime);
2127 2127
         }
@@ -2366,7 +2366,7 @@  discard block
 block discarded – undo
2366 2366
             $rs = $this->db->select('name,snippet,properties', '[+prefix+]site_snippets', $where);
2367 2367
             $count = $this->db->getRecordCount($rs);
2368 2368
             if (1 < $count) {
2369
-                exit('Error $modx->_getSnippetObject()' . $snip_name);
2369
+                exit('Error $modx->_getSnippetObject()'.$snip_name);
2370 2370
             }
2371 2371
             if ($count) {
2372 2372
                 $row = $this->db->getRow($rs);
@@ -2392,7 +2392,7 @@  discard block
 block discarded – undo
2392 2392
     public function toAlias($text)
2393 2393
     {
2394 2394
         $suff = $this->config['friendly_url_suffix'];
2395
-        return str_replace(array('.xml' . $suff, '.rss' . $suff, '.js' . $suff, '.css' . $suff, '.txt' . $suff, '.json' . $suff, '.pdf' . $suff), array('.xml', '.rss', '.js', '.css', '.txt', '.json', '.pdf'), $text);
2395
+        return str_replace(array('.xml'.$suff, '.rss'.$suff, '.js'.$suff, '.css'.$suff, '.txt'.$suff, '.json'.$suff, '.pdf'.$suff), array('.xml', '.rss', '.js', '.css', '.txt', '.json', '.pdf'), $text);
2396 2396
     }
2397 2397
 
2398 2398
     /**
@@ -2424,7 +2424,7 @@  discard block
 block discarded – undo
2424 2424
                 $suff = '/';
2425 2425
             }
2426 2426
 
2427
-            $url = ($dir != '' ? $dir . '/' : '') . $pre . $alias . $suff;
2427
+            $url = ($dir != '' ? $dir.'/' : '').$pre.$alias.$suff;
2428 2428
         }
2429 2429
 
2430 2430
         $evtOut = $this->invokeEvent('OnMakeDocUrl', array(
@@ -2461,7 +2461,7 @@  discard block
 block discarded – undo
2461 2461
                 preg_match_all('!\[\~([0-9]+)\~\]!ise', $documentSource, $match);
2462 2462
                 $ids = implode(',', array_unique($match['1']));
2463 2463
                 if ($ids) {
2464
-                    $res = $this->db->select("id,alias,isfolder,parent,alias_visible", $this->getFullTableName('site_content'), "id IN (" . $ids . ") AND isfolder = '0'");
2464
+                    $res = $this->db->select("id,alias,isfolder,parent,alias_visible", $this->getFullTableName('site_content'), "id IN (".$ids.") AND isfolder = '0'");
2465 2465
                     while ($row = $this->db->getRow($res)) {
2466 2466
                         if ($this->config['use_alias_path'] == '1' && $row['parent'] != 0) {
2467 2467
                             $parent = $row['parent'];
@@ -2472,7 +2472,7 @@  discard block
 block discarded – undo
2472 2472
                                 $parent = $this->aliasListing[$parent]['parent'];
2473 2473
                             }
2474 2474
 
2475
-                            $aliases[$row['id']] = $path . '/' . $row['alias'];
2475
+                            $aliases[$row['id']] = $path.'/'.$row['alias'];
2476 2476
                         } else {
2477 2477
                             $aliases[$row['id']] = $row['alias'];
2478 2478
                         }
@@ -2484,7 +2484,7 @@  discard block
 block discarded – undo
2484 2484
             $isfriendly = ($this->config['friendly_alias_urls'] == 1 ? 1 : 0);
2485 2485
             $pref = $this->config['friendly_url_prefix'];
2486 2486
             $suff = $this->config['friendly_url_suffix'];
2487
-            $documentSource = preg_replace_callback($in, function ($m) use ($aliases, $isfolder, $isfriendly, $pref, $suff) {
2487
+            $documentSource = preg_replace_callback($in, function($m) use ($aliases, $isfolder, $isfriendly, $pref, $suff) {
2488 2488
                 global $modx;
2489 2489
                 $thealias = $aliases[$m[1]];
2490 2490
                 $thefolder = $isfolder[$m[1]];
@@ -2500,7 +2500,7 @@  discard block
 block discarded – undo
2500 2500
 
2501 2501
         } else {
2502 2502
             $in = '!\[\~([0-9]+)\~\]!is';
2503
-            $out = "index.php?id=" . '\1';
2503
+            $out = "index.php?id=".'\1';
2504 2504
             $documentSource = preg_replace($in, $out, $documentSource);
2505 2505
         }
2506 2506
 
@@ -2521,7 +2521,7 @@  discard block
 block discarded – undo
2521 2521
         $scheme = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http';
2522 2522
         $len_base_url = strlen($this->config['base_url']);
2523 2523
 
2524
-        $url_path = $q;//LANG
2524
+        $url_path = $q; //LANG
2525 2525
 
2526 2526
         if (substr($url_path, 0, $len_base_url) === $this->config['base_url']) {
2527 2527
             $url_path = substr($url_path, $len_base_url);
@@ -2533,7 +2533,7 @@  discard block
 block discarded – undo
2533 2533
             $strictURL = substr($strictURL, $len_base_url);
2534 2534
         }
2535 2535
         $http_host = $_SERVER['HTTP_HOST'];
2536
-        $requestedURL = "{$scheme}://{$http_host}" . '/' . $q; //LANG
2536
+        $requestedURL = "{$scheme}://{$http_host}".'/'.$q; //LANG
2537 2537
 
2538 2538
         $site_url = $this->config['site_url'];
2539 2539
         $url_query_string = explode('?', $_SERVER['REQUEST_URI']);
@@ -2551,7 +2551,7 @@  discard block
 block discarded – undo
2551 2551
                 }
2552 2552
                 if ($this->config['base_url'] != $_SERVER['REQUEST_URI']) {
2553 2553
                     if (empty($_POST)) {
2554
-                        if (($this->config['base_url'] . '?' . $qstring) != $_SERVER['REQUEST_URI']) {
2554
+                        if (($this->config['base_url'].'?'.$qstring) != $_SERVER['REQUEST_URI']) {
2555 2555
                             $this->sendRedirect($url, 0, 'REDIRECT_HEADER', 'HTTP/1.0 301 Moved Permanently');
2556 2556
                             exit(0);
2557 2557
                         }
@@ -2610,7 +2610,7 @@  discard block
 block discarded – undo
2610 2610
                 $docgrp = implode(",", $docgrp);
2611 2611
             }
2612 2612
             // get document
2613
-            $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0") . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)");
2613
+            $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='".$_SESSION['mgrRole']."' OR sc.privatemgr=0").(!$docgrp ? "" : " OR dg.document_group IN ($docgrp)");
2614 2614
             $rs = $this->db->select('sc.*', "{$tblsc} sc
2615 2615
                 LEFT JOIN {$tbldg} dg ON dg.document = sc.id", "sc.{$method} = '{$identifier}' AND ({$access})", "", 1);
2616 2616
             if ($this->db->getRecordCount($rs) < 1) {
@@ -2646,9 +2646,9 @@  discard block
 block discarded – undo
2646 2646
             }
2647 2647
             if ($documentObject['template']) {
2648 2648
                 // load TVs and merge with document - Orig by Apodigm - Docvars
2649
-                $rs = $this->db->select("tv.*, IF(tvc.value!='',tvc.value,tv.default_text) as value", $this->getFullTableName("site_tmplvars") . " tv
2650
-                INNER JOIN " . $this->getFullTableName("site_tmplvar_templates") . " tvtpl ON tvtpl.tmplvarid = tv.id
2651
-                LEFT JOIN " . $this->getFullTableName("site_tmplvar_contentvalues") . " tvc ON tvc.tmplvarid=tv.id AND tvc.contentid = '{$documentObject['id']}'", "tvtpl.templateid = '{$documentObject['template']}'");
2649
+                $rs = $this->db->select("tv.*, IF(tvc.value!='',tvc.value,tv.default_text) as value", $this->getFullTableName("site_tmplvars")." tv
2650
+                INNER JOIN " . $this->getFullTableName("site_tmplvar_templates")." tvtpl ON tvtpl.tmplvarid = tv.id
2651
+                LEFT JOIN " . $this->getFullTableName("site_tmplvar_contentvalues")." tvc ON tvc.tmplvarid=tv.id AND tvc.contentid = '{$documentObject['id']}'", "tvtpl.templateid = '{$documentObject['template']}'");
2652 2652
                 $tmplvars = array();
2653 2653
                 while ($row = $this->db->getRow($rs)) {
2654 2654
                     $tmplvars[$row['name']] = array(
@@ -2694,7 +2694,7 @@  discard block
 block discarded – undo
2694 2694
                 $st = md5($source);
2695 2695
             }
2696 2696
             if ($this->dumpSnippets == 1) {
2697
-                $this->snippetsCode .= "<fieldset><legend><b style='color: #821517;'>PARSE PASS " . ($i + 1) . "</b></legend><p>The following snippets (if any) were parsed during this pass.</p>";
2697
+                $this->snippetsCode .= "<fieldset><legend><b style='color: #821517;'>PARSE PASS ".($i + 1)."</b></legend><p>The following snippets (if any) were parsed during this pass.</p>";
2698 2698
             }
2699 2699
 
2700 2700
             // invoke OnParseDocument event
@@ -2736,7 +2736,7 @@  discard block
 block discarded – undo
2736 2736
      */
2737 2737
     public function executeParser()
2738 2738
     {
2739
-        if(MODX_CLI) {
2739
+        if (MODX_CLI) {
2740 2740
             throw new RuntimeException('Call DocumentParser::executeParser on CLI mode');
2741 2741
         }
2742 2742
 
@@ -2782,7 +2782,7 @@  discard block
 block discarded – undo
2782 2782
 
2783 2783
             // Check use_alias_path and check if $this->virtualDir is set to anything, then parse the path
2784 2784
             if ($this->config['use_alias_path'] == 1) {
2785
-                $alias = (strlen($this->virtualDir) > 0 ? $this->virtualDir . '/' : '') . $this->documentIdentifier;
2785
+                $alias = (strlen($this->virtualDir) > 0 ? $this->virtualDir.'/' : '').$this->documentIdentifier;
2786 2786
                 if (isset($this->documentListing[$alias])) {
2787 2787
                     $this->documentIdentifier = $this->documentListing[$alias];
2788 2788
                 } else {
@@ -2843,7 +2843,7 @@  discard block
 block discarded – undo
2843 2843
                 } else {
2844 2844
                     $docAlias = $this->db->escape($this->documentIdentifier);
2845 2845
                     $rs = $this->db->select('id', $this->getFullTableName('site_content'), "deleted=0 and alias='{$docAlias}'");
2846
-                    $this->documentIdentifier = (int)$this->db->getValue($rs);
2846
+                    $this->documentIdentifier = (int) $this->db->getValue($rs);
2847 2847
                 }
2848 2848
             }
2849 2849
             $this->documentMethod = 'id';
@@ -2900,7 +2900,7 @@  discard block
 block discarded – undo
2900 2900
                 $_REQUEST[$n] = $_GET[$n] = $v;
2901 2901
             }
2902 2902
         }
2903
-        $_SERVER['PHP_SELF'] = $this->config['base_url'] . $qp['path'];
2903
+        $_SERVER['PHP_SELF'] = $this->config['base_url'].$qp['path'];
2904 2904
         $this->q = $qp['path'];
2905 2905
         return $qp['path'];
2906 2906
     }
@@ -2994,7 +2994,7 @@  discard block
 block discarded – undo
2994 2994
             $this->sendErrorPage();
2995 2995
         } else {
2996 2996
             // Inculde the necessary files to check document permissions
2997
-            include_once(MODX_MANAGER_PATH . 'processors/user_documents_permissions.class.php');
2997
+            include_once(MODX_MANAGER_PATH.'processors/user_documents_permissions.class.php');
2998 2998
             $udperms = new udperms();
2999 2999
             $udperms->user = $this->getLoginUserID();
3000 3000
             $udperms->document = $this->documentIdentifier;
@@ -3048,7 +3048,7 @@  discard block
 block discarded – undo
3048 3048
         while ($id && $height--) {
3049 3049
             $thisid = $id;
3050 3050
             if ($this->config['aliaslistingfolder'] == 1) {
3051
-                $id = isset($this->aliasListing[$id]['parent']) ? $this->aliasListing[$id]['parent'] : $this->db->getValue("SELECT `parent` FROM " . $this->getFullTableName("site_content") . " WHERE `id` = '{$id}' LIMIT 0,1");
3051
+                $id = isset($this->aliasListing[$id]['parent']) ? $this->aliasListing[$id]['parent'] : $this->db->getValue("SELECT `parent` FROM ".$this->getFullTableName("site_content")." WHERE `id` = '{$id}' LIMIT 0,1");
3052 3052
                 if (!$id || $id == '0') {
3053 3053
                     break;
3054 3054
                 }
@@ -3099,15 +3099,15 @@  discard block
 block discarded – undo
3099 3099
 
3100 3100
         if ($this->config['aliaslistingfolder'] == 1) {
3101 3101
 
3102
-            $res = $this->db->select("id,alias,isfolder,parent", $this->getFullTableName('site_content'), "parent IN (" . $id . ") AND deleted = '0'");
3102
+            $res = $this->db->select("id,alias,isfolder,parent", $this->getFullTableName('site_content'), "parent IN (".$id.") AND deleted = '0'");
3103 3103
             $idx = array();
3104 3104
             while ($row = $this->db->getRow($res)) {
3105 3105
                 $pAlias = '';
3106 3106
                 if (isset($this->aliasListing[$row['parent']])) {
3107
-                    $pAlias .= !empty($this->aliasListing[$row['parent']]['path']) ? $this->aliasListing[$row['parent']]['path'] . '/' : '';
3108
-                    $pAlias .= !empty($this->aliasListing[$row['parent']]['alias']) ? $this->aliasListing[$row['parent']]['alias'] . '/' : '';
3107
+                    $pAlias .= !empty($this->aliasListing[$row['parent']]['path']) ? $this->aliasListing[$row['parent']]['path'].'/' : '';
3108
+                    $pAlias .= !empty($this->aliasListing[$row['parent']]['alias']) ? $this->aliasListing[$row['parent']]['alias'].'/' : '';
3109 3109
                 };
3110
-                $children[$pAlias . $row['alias']] = $row['id'];
3110
+                $children[$pAlias.$row['alias']] = $row['id'];
3111 3111
                 if ($row['isfolder'] == 1) {
3112 3112
                     $idx[] = $row['id'];
3113 3113
                 }
@@ -3139,7 +3139,7 @@  discard block
 block discarded – undo
3139 3139
                 $depth--;
3140 3140
 
3141 3141
                 foreach ($documentMap_cache[$id] as $childId) {
3142
-                    $pkey = (strlen($this->aliasListing[$childId]['path']) ? "{$this->aliasListing[$childId]['path']}/" : '') . $this->aliasListing[$childId]['alias'];
3142
+                    $pkey = (strlen($this->aliasListing[$childId]['path']) ? "{$this->aliasListing[$childId]['path']}/" : '').$this->aliasListing[$childId]['alias'];
3143 3143
                     if (!strlen($pkey)) {
3144 3144
                         $pkey = "{$childId}";
3145 3145
                     }
@@ -3176,7 +3176,7 @@  discard block
 block discarded – undo
3176 3176
                 $fnc = 'history.back(-1);';
3177 3177
                 break;
3178 3178
             default:
3179
-                $fnc = "window.location.href='" . addslashes($url) . "';";
3179
+                $fnc = "window.location.href='".addslashes($url)."';";
3180 3180
         }
3181 3181
 
3182 3182
         echo "<html><head>
@@ -3208,9 +3208,9 @@  discard block
 block discarded – undo
3208 3208
         $state = 0;
3209 3209
         $pms = $_SESSION['mgrPermissions'];
3210 3210
         if ($pms) {
3211
-            $state = ((bool)$pms[$pm] === true);
3211
+            $state = ((bool) $pms[$pm] === true);
3212 3212
         }
3213
-        return (int)$state;
3213
+        return (int) $state;
3214 3214
     }
3215 3215
 
3216 3216
     /**
@@ -3223,8 +3223,8 @@  discard block
 block discarded – undo
3223 3223
      */
3224 3224
     public function elementIsLocked($type, $id, $includeThisUser = false)
3225 3225
     {
3226
-        $id = (int)$id;
3227
-        $type = (int)$type;
3226
+        $id = (int) $id;
3227
+        $type = (int) $type;
3228 3228
         if (!$type || !$id) {
3229 3229
             return null;
3230 3230
         }
@@ -3274,7 +3274,7 @@  discard block
 block discarded – undo
3274 3274
             return $lockedElements;
3275 3275
         }
3276 3276
 
3277
-        $type = (int)$type;
3277
+        $type = (int) $type;
3278 3278
         if (isset($lockedElements[$type])) {
3279 3279
             return $lockedElements[$type];
3280 3280
         } else {
@@ -3291,7 +3291,7 @@  discard block
 block discarded – undo
3291 3291
             $this->lockedElements = array();
3292 3292
             $this->cleanupExpiredLocks();
3293 3293
 
3294
-            $rs = $this->db->select('sid,internalKey,elementType,elementId,lasthit,username', $this->getFullTableName('active_user_locks') . " ul
3294
+            $rs = $this->db->select('sid,internalKey,elementType,elementId,lasthit,username', $this->getFullTableName('active_user_locks')." ul
3295 3295
                 LEFT JOIN {$this->getFullTableName('manager_users')} mu on ul.internalKey = mu.id");
3296 3296
             while ($row = $this->db->getRow($rs)) {
3297 3297
                 $this->lockedElements[$row['elementType']][$row['elementId']] = array(
@@ -3314,7 +3314,7 @@  discard block
 block discarded – undo
3314 3314
     public function cleanupExpiredLocks()
3315 3315
     {
3316 3316
         // Clean-up active_user_sessions first
3317
-        $timeout = (int)$this->config['session_timeout'] < 2 ? 120 : $this->config['session_timeout'] * 60; // session.js pings every 10min, updateMail() in mainMenu pings every minute, so 2min is minimum
3317
+        $timeout = (int) $this->config['session_timeout'] < 2 ? 120 : $this->config['session_timeout'] * 60; // session.js pings every 10min, updateMail() in mainMenu pings every minute, so 2min is minimum
3318 3318
         $validSessionTimeLimit = $this->time - $timeout;
3319 3319
         $this->db->delete($this->getFullTableName('active_user_sessions'), "lasthit < {$validSessionTimeLimit}");
3320 3320
 
@@ -3327,7 +3327,7 @@  discard block
 block discarded – undo
3327 3327
             foreach ($rs as $row) {
3328 3328
                 $userSids[] = $row['sid'];
3329 3329
             }
3330
-            $userSids = "'" . implode("','", $userSids) . "'";
3330
+            $userSids = "'".implode("','", $userSids)."'";
3331 3331
             $this->db->delete($this->getFullTableName('active_user_locks'), "sid NOT IN({$userSids})");
3332 3332
         } else {
3333 3333
             $this->db->delete($this->getFullTableName('active_user_locks'));
@@ -3411,8 +3411,8 @@  discard block
 block discarded – undo
3411 3411
     public function lockElement($type, $id)
3412 3412
     {
3413 3413
         $userId = $this->isBackend() && $_SESSION['mgrInternalKey'] ? $_SESSION['mgrInternalKey'] : 0;
3414
-        $type = (int)$type;
3415
-        $id = (int)$id;
3414
+        $type = (int) $type;
3415
+        $id = (int) $id;
3416 3416
         if (!$type || !$id || !$userId) {
3417 3417
             return false;
3418 3418
         }
@@ -3433,8 +3433,8 @@  discard block
 block discarded – undo
3433 3433
     public function unlockElement($type, $id, $includeAllUsers = false)
3434 3434
     {
3435 3435
         $userId = $this->isBackend() && $_SESSION['mgrInternalKey'] ? $_SESSION['mgrInternalKey'] : 0;
3436
-        $type = (int)$type;
3437
-        $id = (int)$id;
3436
+        $type = (int) $type;
3437
+        $id = (int) $id;
3438 3438
         if (!$type || !$id) {
3439 3439
             return false;
3440 3440
         }
@@ -3501,8 +3501,8 @@  discard block
 block discarded – undo
3501 3501
         }
3502 3502
 
3503 3503
         $usertype = $this->isFrontend() ? 1 : 0;
3504
-        $evtid = (int)$evtid;
3505
-        $type = (int)$type;
3504
+        $evtid = (int) $evtid;
3505
+        $type = (int) $type;
3506 3506
 
3507 3507
         // Types: 1 = information, 2 = warning, 3 = error
3508 3508
         if ($type < 1) {
@@ -3524,8 +3524,8 @@  discard block
 block discarded – undo
3524 3524
         if (isset($this->config['send_errormail']) && $this->config['send_errormail'] !== '0') {
3525 3525
             if ($this->config['send_errormail'] <= $type) {
3526 3526
                 $this->sendmail(array(
3527
-                    'subject' => 'MODX System Error on ' . $this->config['site_name'],
3528
-                    'body' => 'Source: ' . $source . ' - The details of the error could be seen in the MODX system events log.',
3527
+                    'subject' => 'MODX System Error on '.$this->config['site_name'],
3528
+                    'body' => 'Source: '.$source.' - The details of the error could be seen in the MODX system events log.',
3529 3529
                     'type' => 'text'
3530 3530
                 ));
3531 3531
             }
@@ -3573,7 +3573,7 @@  discard block
 block discarded – undo
3573 3573
             $p['fromname'] = $userinfo['username'];
3574 3574
         }
3575 3575
         if ($msg === '' && !isset($p['body'])) {
3576
-            $p['body'] = $_SERVER['REQUEST_URI'] . "\n" . $_SERVER['HTTP_USER_AGENT'] . "\n" . $_SERVER['HTTP_REFERER'];
3576
+            $p['body'] = $_SERVER['REQUEST_URI']."\n".$_SERVER['HTTP_USER_AGENT']."\n".$_SERVER['HTTP_REFERER'];
3577 3577
         } elseif (is_string($msg) && 0 < strlen($msg)) {
3578 3578
             $p['body'] = $msg;
3579 3579
         }
@@ -3613,8 +3613,8 @@  discard block
 block discarded – undo
3613 3613
             $files = array();
3614 3614
         }
3615 3615
         foreach ($files as $f) {
3616
-            if (file_exists(MODX_BASE_PATH . $f) && is_file(MODX_BASE_PATH . $f) && is_readable(MODX_BASE_PATH . $f)) {
3617
-                $this->mail->AddAttachment(MODX_BASE_PATH . $f);
3616
+            if (file_exists(MODX_BASE_PATH.$f) && is_file(MODX_BASE_PATH.$f) && is_readable(MODX_BASE_PATH.$f)) {
3617
+                $this->mail->AddAttachment(MODX_BASE_PATH.$f);
3618 3618
             }
3619 3619
         }
3620 3620
         $rs = $this->mail->send();
@@ -3659,7 +3659,7 @@  discard block
 block discarded – undo
3659 3659
      */
3660 3660
     public function isFrontend()
3661 3661
     {
3662
-        return ! $this->isBackend();
3662
+        return !$this->isBackend();
3663 3663
     }
3664 3664
 
3665 3665
     /**
@@ -3684,14 +3684,14 @@  discard block
 block discarded – undo
3684 3684
         $tblsc = $this->getFullTableName("site_content");
3685 3685
         $tbldg = $this->getFullTableName("document_groups");
3686 3686
         // modify field names to use sc. table reference
3687
-        $fields = 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $fields))));
3688
-        $sort = 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $sort))));
3687
+        $fields = 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $fields))));
3688
+        $sort = 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $sort))));
3689 3689
         // get document groups for current user
3690 3690
         if ($docgrp = $this->getUserDocGroups()) {
3691 3691
             $docgrp = implode(",", $docgrp);
3692 3692
         }
3693 3693
         // build query
3694
-        $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0") . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)");
3694
+        $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='".$_SESSION['mgrRole']."' OR sc.privatemgr=0").(!$docgrp ? "" : " OR dg.document_group IN ($docgrp)");
3695 3695
         $result = $this->db->select("DISTINCT {$fields}", "{$tblsc} sc
3696 3696
                 LEFT JOIN {$tbldg} dg on dg.document = sc.id", "sc.parent = '{$id}' AND ({$access}) GROUP BY sc.id", "{$sort} {$dir}");
3697 3697
         $resourceArray = $this->db->makeArray($result);
@@ -3721,14 +3721,14 @@  discard block
 block discarded – undo
3721 3721
         $tbldg = $this->getFullTableName("document_groups");
3722 3722
 
3723 3723
         // modify field names to use sc. table reference
3724
-        $fields = 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $fields))));
3725
-        $sort = 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $sort))));
3724
+        $fields = 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $fields))));
3725
+        $sort = 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $sort))));
3726 3726
         // get document groups for current user
3727 3727
         if ($docgrp = $this->getUserDocGroups()) {
3728 3728
             $docgrp = implode(",", $docgrp);
3729 3729
         }
3730 3730
         // build query
3731
-        $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0") . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)");
3731
+        $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='".$_SESSION['mgrRole']."' OR sc.privatemgr=0").(!$docgrp ? "" : " OR dg.document_group IN ($docgrp)");
3732 3732
         $result = $this->db->select("DISTINCT {$fields}", "{$tblsc} sc
3733 3733
                 LEFT JOIN {$tbldg} dg on dg.document = sc.id", "sc.parent = '{$id}' AND sc.published=1 AND sc.deleted=0 AND ({$access}) GROUP BY sc.id", "{$sort} {$dir}");
3734 3734
         $resourceArray = $this->db->makeArray($result);
@@ -3763,16 +3763,16 @@  discard block
 block discarded – undo
3763 3763
             return $this->tmpCache[__FUNCTION__][$cacheKey];
3764 3764
         }
3765 3765
 
3766
-        $published = ($published !== 'all') ? 'AND sc.published = ' . $published : '';
3767
-        $deleted = ($deleted !== 'all') ? 'AND sc.deleted = ' . $deleted : '';
3766
+        $published = ($published !== 'all') ? 'AND sc.published = '.$published : '';
3767
+        $deleted = ($deleted !== 'all') ? 'AND sc.deleted = '.$deleted : '';
3768 3768
 
3769 3769
         if ($where != '') {
3770
-            $where = 'AND ' . $where;
3770
+            $where = 'AND '.$where;
3771 3771
         }
3772 3772
 
3773 3773
         // modify field names to use sc. table reference
3774
-        $fields = 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $fields))));
3775
-        $sort = ($sort == '') ? '' : 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $sort))));
3774
+        $fields = 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $fields))));
3775
+        $sort = ($sort == '') ? '' : 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $sort))));
3776 3776
 
3777 3777
         // get document groups for current user
3778 3778
         if ($docgrp = $this->getUserDocGroups()) {
@@ -3780,7 +3780,7 @@  discard block
 block discarded – undo
3780 3780
         }
3781 3781
 
3782 3782
         // build query
3783
-        $access = ($this->isFrontend() ? 'sc.privateweb=0' : '1="' . $_SESSION['mgrRole'] . '" OR sc.privatemgr=0') . (!$docgrp ? '' : ' OR dg.document_group IN (' . $docgrp . ')');
3783
+        $access = ($this->isFrontend() ? 'sc.privateweb=0' : '1="'.$_SESSION['mgrRole'].'" OR sc.privatemgr=0').(!$docgrp ? '' : ' OR dg.document_group IN ('.$docgrp.')');
3784 3784
 
3785 3785
         $tblsc = $this->getFullTableName('site_content');
3786 3786
         $tbldg = $this->getFullTableName('document_groups');
@@ -3832,10 +3832,10 @@  discard block
 block discarded – undo
3832 3832
             return false;
3833 3833
         } else {
3834 3834
             // modify field names to use sc. table reference
3835
-            $fields = 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $fields))));
3836
-            $sort = ($sort == '') ? '' : 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $sort))));
3835
+            $fields = 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $fields))));
3836
+            $sort = ($sort == '') ? '' : 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $sort))));
3837 3837
             if ($where != '') {
3838
-                $where = 'AND ' . $where;
3838
+                $where = 'AND '.$where;
3839 3839
             }
3840 3840
 
3841 3841
             $published = ($published !== 'all') ? "AND sc.published = '{$published}'" : '';
@@ -3846,13 +3846,13 @@  discard block
 block discarded – undo
3846 3846
                 $docgrp = implode(',', $docgrp);
3847 3847
             }
3848 3848
 
3849
-            $access = ($this->isFrontend() ? 'sc.privateweb=0' : '1="' . $_SESSION['mgrRole'] . '" OR sc.privatemgr=0') . (!$docgrp ? '' : ' OR dg.document_group IN (' . $docgrp . ')');
3849
+            $access = ($this->isFrontend() ? 'sc.privateweb=0' : '1="'.$_SESSION['mgrRole'].'" OR sc.privatemgr=0').(!$docgrp ? '' : ' OR dg.document_group IN ('.$docgrp.')');
3850 3850
 
3851 3851
             $tblsc = $this->getFullTableName('site_content');
3852 3852
             $tbldg = $this->getFullTableName('document_groups');
3853 3853
 
3854 3854
             $result = $this->db->select("DISTINCT {$fields}", "{$tblsc} sc
3855
-                    LEFT JOIN {$tbldg} dg on dg.document = sc.id", "(sc.id IN (" . implode(',', $ids) . ") {$published} {$deleted} {$where}) AND ({$access}) GROUP BY sc.id", ($sort ? "{$sort} {$dir}" : ""), $limit);
3855
+                    LEFT JOIN {$tbldg} dg on dg.document = sc.id", "(sc.id IN (".implode(',', $ids).") {$published} {$deleted} {$where}) AND ({$access}) GROUP BY sc.id", ($sort ? "{$sort} {$dir}" : ""), $limit);
3856 3856
 
3857 3857
             $resourceArray = $this->db->makeArray($result);
3858 3858
 
@@ -3957,12 +3957,12 @@  discard block
 block discarded – undo
3957 3957
             $tbldg = $this->getFullTableName("document_groups");
3958 3958
             $activeSql = $active == 1 ? "AND sc.published=1 AND sc.deleted=0" : "";
3959 3959
             // modify field names to use sc. table reference
3960
-            $fields = 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $fields))));
3960
+            $fields = 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $fields))));
3961 3961
             // get document groups for current user
3962 3962
             if ($docgrp = $this->getUserDocGroups()) {
3963 3963
                 $docgrp = implode(",", $docgrp);
3964 3964
             }
3965
-            $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0") . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)");
3965
+            $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='".$_SESSION['mgrRole']."' OR sc.privatemgr=0").(!$docgrp ? "" : " OR dg.document_group IN ($docgrp)");
3966 3966
             $result = $this->db->select($fields, "{$tblsc} sc LEFT JOIN {$tbldg} dg on dg.document = sc.id", "(sc.id='{$pageid}' {$activeSql}) AND ({$access})", "", 1);
3967 3967
             $pageInfo = $this->db->getRow($result);
3968 3968
 
@@ -4009,7 +4009,7 @@  discard block
 block discarded – undo
4009 4009
     {
4010 4010
         if ($this->currentSnippet) {
4011 4011
             $tbl = $this->getFullTableName("site_snippets");
4012
-            $rs = $this->db->select('id', $tbl, "name='" . $this->db->escape($this->currentSnippet) . "'", '', 1);
4012
+            $rs = $this->db->select('id', $tbl, "name='".$this->db->escape($this->currentSnippet)."'", '', 1);
4013 4013
             if ($snippetId = $this->db->getValue($rs)) {
4014 4014
                 return $snippetId;
4015 4015
             }
@@ -4036,23 +4036,23 @@  discard block
 block discarded – undo
4036 4036
      */
4037 4037
     public function clearCache($type = '', $report = false)
4038 4038
     {
4039
-        $cache_dir = MODX_BASE_PATH . $this->getCacheFolder();
4039
+        $cache_dir = MODX_BASE_PATH.$this->getCacheFolder();
4040 4040
         if (is_array($type)) {
4041 4041
             foreach ($type as $_) {
4042 4042
                 $this->clearCache($_, $report);
4043 4043
             }
4044 4044
         } elseif ($type == 'full') {
4045
-            include_once(MODX_MANAGER_PATH . 'processors/cache_sync.class.processor.php');
4045
+            include_once(MODX_MANAGER_PATH.'processors/cache_sync.class.processor.php');
4046 4046
             $sync = new synccache();
4047 4047
             $sync->setCachepath($cache_dir);
4048 4048
             $sync->setReport($report);
4049 4049
             $sync->emptyCache();
4050 4050
         } elseif (preg_match('@^[1-9][0-9]*$@', $type)) {
4051 4051
             $key = ($this->config['cache_type'] == 2) ? $this->makePageCacheKey($type) : $type;
4052
-            $file_name = "docid_" . $key . "_*.pageCache.php";
4053
-            $cache_path = $cache_dir . $file_name;
4052
+            $file_name = "docid_".$key."_*.pageCache.php";
4053
+            $cache_path = $cache_dir.$file_name;
4054 4054
             $files = glob($cache_path);
4055
-            $files[] = $cache_dir . "docid_" . $key . ".pageCache.php";
4055
+            $files[] = $cache_dir."docid_".$key.".pageCache.php";
4056 4056
             foreach ($files as $file) {
4057 4057
                 if (!is_file($file)) {
4058 4058
                     continue;
@@ -4060,7 +4060,7 @@  discard block
 block discarded – undo
4060 4060
                 unlink($file);
4061 4061
             }
4062 4062
         } else {
4063
-            $files = glob($cache_dir . '*');
4063
+            $files = glob($cache_dir.'*');
4064 4064
             foreach ($files as $file) {
4065 4065
                 $name = basename($file);
4066 4066
                 if (strpos($name, '.pageCache.php') === false) {
@@ -4129,7 +4129,7 @@  discard block
 block discarded – undo
4129 4129
                         $f_url_suffix = '/';
4130 4130
                     }
4131 4131
 
4132
-                    $alPath = !empty ($al['path']) ? $al['path'] . '/' : '';
4132
+                    $alPath = !empty ($al['path']) ? $al['path'].'/' : '';
4133 4133
 
4134 4134
                     if ($al && $al['alias']) {
4135 4135
                         $alias = $al['alias'];
@@ -4137,7 +4137,7 @@  discard block
 block discarded – undo
4137 4137
 
4138 4138
                 }
4139 4139
 
4140
-                $alias = $alPath . $f_url_prefix . $alias . $f_url_suffix;
4140
+                $alias = $alPath.$f_url_prefix.$alias.$f_url_suffix;
4141 4141
                 $url = "{$alias}{$args}";
4142 4142
             } else {
4143 4143
                 $url = "index.php?id={$id}{$args}";
@@ -4156,7 +4156,7 @@  discard block
 block discarded – undo
4156 4156
             }
4157 4157
 
4158 4158
             //TODO: check to make sure that $site_url incudes the url :port (e.g. :8080)
4159
-            $host = $scheme == 'full' ? $this->config['site_url'] : $scheme . '://' . $_SERVER['HTTP_HOST'] . $host;
4159
+            $host = $scheme == 'full' ? $this->config['site_url'] : $scheme.'://'.$_SERVER['HTTP_HOST'].$host;
4160 4160
         }
4161 4161
 
4162 4162
         //fix strictUrl by Bumkaka
@@ -4165,9 +4165,9 @@  discard block
 block discarded – undo
4165 4165
         }
4166 4166
 
4167 4167
         if ($this->config['xhtml_urls']) {
4168
-            $url = preg_replace("/&(?!amp;)/", "&amp;", $host . $virtualDir . $url);
4168
+            $url = preg_replace("/&(?!amp;)/", "&amp;", $host.$virtualDir.$url);
4169 4169
         } else {
4170
-            $url = $host . $virtualDir . $url;
4170
+            $url = $host.$virtualDir.$url;
4171 4171
         }
4172 4172
 
4173 4173
         $evtOut = $this->invokeEvent('OnMakeDocUrl', array(
@@ -4191,21 +4191,21 @@  discard block
 block discarded – undo
4191 4191
         if (isset($this->aliasListing[$id])) {
4192 4192
             $out = $this->aliasListing[$id];
4193 4193
         } else {
4194
-            $q = $this->db->query("SELECT id,alias,isfolder,parent FROM " . $this->getFullTableName("site_content") . " WHERE id=" . (int)$id);
4194
+            $q = $this->db->query("SELECT id,alias,isfolder,parent FROM ".$this->getFullTableName("site_content")." WHERE id=".(int) $id);
4195 4195
             if ($this->db->getRecordCount($q) == '1') {
4196 4196
                 $q = $this->db->getRow($q);
4197 4197
                 $this->aliasListing[$id] = array(
4198
-                    'id' => (int)$q['id'],
4198
+                    'id' => (int) $q['id'],
4199 4199
                     'alias' => $q['alias'] == '' ? $q['id'] : $q['alias'],
4200
-                    'parent' => (int)$q['parent'],
4201
-                    'isfolder' => (int)$q['isfolder'],
4200
+                    'parent' => (int) $q['parent'],
4201
+                    'isfolder' => (int) $q['isfolder'],
4202 4202
                 );
4203 4203
                 if ($this->aliasListing[$id]['parent'] > 0) {
4204 4204
                     //fix alias_path_usage
4205 4205
                     if ($this->config['use_alias_path'] == '1') {
4206 4206
                         //&& $tmp['path'] != '' - fix error slash with epty path
4207 4207
                         $tmp = $this->getAliasListing($this->aliasListing[$id]['parent']);
4208
-                        $this->aliasListing[$id]['path'] = $tmp['path'] . ($tmp['alias_visible'] ? (($tmp['parent'] > 0 && $tmp['path'] != '') ? '/' : '') . $tmp['alias'] : '');
4208
+                        $this->aliasListing[$id]['path'] = $tmp['path'].($tmp['alias_visible'] ? (($tmp['parent'] > 0 && $tmp['path'] != '') ? '/' : '').$tmp['alias'] : '');
4209 4209
                     } else {
4210 4210
                         $this->aliasListing[$id]['path'] = '';
4211 4211
                     }
@@ -4246,7 +4246,7 @@  discard block
 block discarded – undo
4246 4246
         $out = array();
4247 4247
         if (empty($this->version) || !is_array($this->version)) {
4248 4248
             //include for compatibility modx version < 1.0.10
4249
-            include MODX_MANAGER_PATH . "includes/version.inc.php";
4249
+            include MODX_MANAGER_PATH."includes/version.inc.php";
4250 4250
             $this->version = array();
4251 4251
             $this->version['version'] = isset($modx_version) ? $modx_version : '';
4252 4252
             $this->version['branch'] = isset($modx_branch) ? $modx_branch : '';
@@ -4268,18 +4268,18 @@  discard block
 block discarded – undo
4268 4268
     {
4269 4269
         if (isset ($this->snippetCache[$snippetName])) {
4270 4270
             $snippet = $this->snippetCache[$snippetName];
4271
-            $properties = !empty($this->snippetCache[$snippetName . "Props"]) ? $this->snippetCache[$snippetName . "Props"] : '';
4271
+            $properties = !empty($this->snippetCache[$snippetName."Props"]) ? $this->snippetCache[$snippetName."Props"] : '';
4272 4272
         } else { // not in cache so let's check the db
4273
-            $sql = "SELECT ss.`name`, ss.`snippet`, ss.`properties`, sm.properties as `sharedproperties` FROM " . $this->getFullTableName("site_snippets") . " as ss LEFT JOIN " . $this->getFullTableName('site_modules') . " as sm on sm.guid=ss.moduleguid WHERE ss.`name`='" . $this->db->escape($snippetName) . "'  AND ss.disabled=0;";
4273
+            $sql = "SELECT ss.`name`, ss.`snippet`, ss.`properties`, sm.properties as `sharedproperties` FROM ".$this->getFullTableName("site_snippets")." as ss LEFT JOIN ".$this->getFullTableName('site_modules')." as sm on sm.guid=ss.moduleguid WHERE ss.`name`='".$this->db->escape($snippetName)."'  AND ss.disabled=0;";
4274 4274
             $result = $this->db->query($sql);
4275 4275
             if ($this->db->getRecordCount($result) == 1) {
4276 4276
                 $row = $this->db->getRow($result);
4277 4277
                 $snippet = $this->snippetCache[$snippetName] = $row['snippet'];
4278 4278
                 $mergedProperties = array_merge($this->parseProperties($row['properties']), $this->parseProperties($row['sharedproperties']));
4279
-                $properties = $this->snippetCache[$snippetName . "Props"] = json_encode($mergedProperties);
4279
+                $properties = $this->snippetCache[$snippetName."Props"] = json_encode($mergedProperties);
4280 4280
             } else {
4281 4281
                 $snippet = $this->snippetCache[$snippetName] = "return false;";
4282
-                $properties = $this->snippetCache[$snippetName . "Props"] = '';
4282
+                $properties = $this->snippetCache[$snippetName."Props"] = '';
4283 4283
             }
4284 4284
         }
4285 4285
         // load default params/properties
@@ -4379,8 +4379,8 @@  discard block
 block discarded – undo
4379 4379
             }
4380 4380
             if (strpos($tpl, $s) !== false) {
4381 4381
                 $tpl = str_replace($s, $value, $tpl);
4382
-            } elseif($this->debug) {
4383
-                $this->addLog('parseText parse error', $_SERVER['REQUEST_URI'] . $s, 2);
4382
+            } elseif ($this->debug) {
4383
+                $this->addLog('parseText parse error', $_SERVER['REQUEST_URI'].$s, 2);
4384 4384
             }
4385 4385
         }
4386 4386
 
@@ -4429,7 +4429,7 @@  discard block
 block discarded – undo
4429 4429
             case 'CODE':
4430 4430
                 break;
4431 4431
             case 'FILE':
4432
-                $template = file_get_contents(MODX_BASE_PATH . $template);
4432
+                $template = file_get_contents(MODX_BASE_PATH.$template);
4433 4433
                 break;
4434 4434
             case 'CHUNK':
4435 4435
                 $template = $this->getChunk($template);
@@ -4462,7 +4462,7 @@  discard block
 block discarded – undo
4462 4462
         if ($mode !== 'formatOnly' && empty($timestamp)) {
4463 4463
             return '-';
4464 4464
         }
4465
-        $timestamp = (int)$timestamp;
4465
+        $timestamp = (int) $timestamp;
4466 4466
 
4467 4467
         switch ($this->config['datetime_format']) {
4468 4468
             case 'YYYY/mm/dd':
@@ -4482,7 +4482,7 @@  discard block
 block discarded – undo
4482 4482
         }
4483 4483
 
4484 4484
         if (empty($mode)) {
4485
-            $strTime = strftime($dateFormat . " %H:%M:%S", $timestamp);
4485
+            $strTime = strftime($dateFormat." %H:%M:%S", $timestamp);
4486 4486
         } elseif ($mode == 'dateOnly') {
4487 4487
             $strTime = strftime($dateFormat, $timestamp);
4488 4488
         } elseif ($mode == 'formatOnly') {
@@ -4536,7 +4536,7 @@  discard block
 block discarded – undo
4536 4536
             $S = 0;
4537 4537
         }
4538 4538
         $timeStamp = mktime($H, $M, $S, $m, $d, $Y);
4539
-        $timeStamp = (int)$timeStamp;
4539
+        $timeStamp = (int) $timeStamp;
4540 4540
         return $timeStamp;
4541 4541
     }
4542 4542
 
@@ -4578,7 +4578,7 @@  discard block
 block discarded – undo
4578 4578
                     if ($v === 'value') {
4579 4579
                         unset($_[$i]);
4580 4580
                     } else {
4581
-                        $_[$i] = 'tv.' . $v;
4581
+                        $_[$i] = 'tv.'.$v;
4582 4582
                     }
4583 4583
                 }
4584 4584
                 $fields = implode(',', $_);
@@ -4587,12 +4587,12 @@  discard block
 block discarded – undo
4587 4587
             }
4588 4588
 
4589 4589
             if ($tvsort != '') {
4590
-                $tvsort = 'tv.' . implode(',tv.', array_filter(array_map('trim', explode(',', $tvsort))));
4590
+                $tvsort = 'tv.'.implode(',tv.', array_filter(array_map('trim', explode(',', $tvsort))));
4591 4591
             }
4592 4592
             if ($tvidnames == "*") {
4593 4593
                 $query = "tv.id<>0";
4594 4594
             } else {
4595
-                $query = (is_numeric($tvidnames[0]) ? "tv.id" : "tv.name") . " IN ('" . implode("','", $tvidnames) . "')";
4595
+                $query = (is_numeric($tvidnames[0]) ? "tv.id" : "tv.name")." IN ('".implode("','", $tvidnames)."')";
4596 4596
             }
4597 4597
 
4598 4598
             $this->getUserDocGroups();
@@ -4736,7 +4736,7 @@  discard block
 block discarded – undo
4736 4736
             return $this->tmpCache[__FUNCTION__][$cacheKey];
4737 4737
         }
4738 4738
 
4739
-        if (($idnames != '*' && !is_array($idnames)) || empty($idnames) ) {
4739
+        if (($idnames != '*' && !is_array($idnames)) || empty($idnames)) {
4740 4740
             return false;
4741 4741
         } else {
4742 4742
 
@@ -4754,23 +4754,23 @@  discard block
 block discarded – undo
4754 4754
             }
4755 4755
 
4756 4756
             // get user defined template variables
4757
-            $fields = ($fields == '') ? 'tv.*' : 'tv.' . implode(',tv.', array_filter(array_map('trim', explode(',', $fields))));
4758
-            $sort = ($sort == '') ? '' : 'tv.' . implode(',tv.', array_filter(array_map('trim', explode(',', $sort))));
4757
+            $fields = ($fields == '') ? 'tv.*' : 'tv.'.implode(',tv.', array_filter(array_map('trim', explode(',', $fields))));
4758
+            $sort = ($sort == '') ? '' : 'tv.'.implode(',tv.', array_filter(array_map('trim', explode(',', $sort))));
4759 4759
 
4760 4760
             if ($idnames == '*') {
4761 4761
                 $query = 'tv.id<>0';
4762 4762
             } else {
4763
-                $query = (is_numeric($idnames[0]) ? 'tv.id' : 'tv.name') . " IN ('" . implode("','", $idnames) . "')";
4763
+                $query = (is_numeric($idnames[0]) ? 'tv.id' : 'tv.name')." IN ('".implode("','", $idnames)."')";
4764 4764
             }
4765 4765
 
4766
-            $rs = $this->db->select("{$fields}, IF(tvc.value != '', tvc.value, tv.default_text) as value", $this->getFullTableName('site_tmplvars') . " tv
4767
-                    INNER JOIN " . $this->getFullTableName('site_tmplvar_templates') . " tvtpl ON tvtpl.tmplvarid = tv.id
4768
-                    LEFT JOIN " . $this->getFullTableName('site_tmplvar_contentvalues') . " tvc ON tvc.tmplvarid=tv.id AND tvc.contentid = '{$docid}'", "{$query} AND tvtpl.templateid = '{$docRow['template']}'", ($sort ? "{$sort} {$dir}" : ""));
4766
+            $rs = $this->db->select("{$fields}, IF(tvc.value != '', tvc.value, tv.default_text) as value", $this->getFullTableName('site_tmplvars')." tv
4767
+                    INNER JOIN " . $this->getFullTableName('site_tmplvar_templates')." tvtpl ON tvtpl.tmplvarid = tv.id
4768
+                    LEFT JOIN " . $this->getFullTableName('site_tmplvar_contentvalues')." tvc ON tvc.tmplvarid=tv.id AND tvc.contentid = '{$docid}'", "{$query} AND tvtpl.templateid = '{$docRow['template']}'", ($sort ? "{$sort} {$dir}" : ""));
4769 4769
 
4770 4770
             $result = $this->db->makeArray($rs);
4771 4771
 
4772 4772
             // get default/built-in template variables
4773
-            if(is_array($docRow)){
4773
+            if (is_array($docRow)) {
4774 4774
                 ksort($docRow);
4775 4775
 
4776 4776
                 foreach ($docRow as $key => $value) {
@@ -4808,22 +4808,22 @@  discard block
 block discarded – undo
4808 4808
      */
4809 4809
     public function getTemplateVarOutput($idnames = array(), $docid = '', $published = 1, $sep = '')
4810 4810
     {
4811
-        if (is_array($idnames) && empty($idnames) ) {
4811
+        if (is_array($idnames) && empty($idnames)) {
4812 4812
             return false;
4813 4813
         } else {
4814 4814
             $output = array();
4815 4815
             $vars = ($idnames == '*' || is_array($idnames)) ? $idnames : array($idnames);
4816 4816
 
4817
-            $docid = (int)$docid > 0 ? (int)$docid : $this->documentIdentifier;
4817
+            $docid = (int) $docid > 0 ? (int) $docid : $this->documentIdentifier;
4818 4818
             // remove sort for speed
4819 4819
             $result = $this->getTemplateVars($vars, '*', $docid, $published, '', '');
4820 4820
 
4821 4821
             if ($result == false) {
4822 4822
                 return false;
4823 4823
             } else {
4824
-                $baspath = MODX_MANAGER_PATH . 'includes';
4825
-                include_once $baspath . '/tmplvars.format.inc.php';
4826
-                include_once $baspath . '/tmplvars.commands.inc.php';
4824
+                $baspath = MODX_MANAGER_PATH.'includes';
4825
+                include_once $baspath.'/tmplvars.format.inc.php';
4826
+                include_once $baspath.'/tmplvars.commands.inc.php';
4827 4827
 
4828 4828
                 for ($i = 0; $i < count($result); $i++) {
4829 4829
                     $row = $result[$i];
@@ -4848,7 +4848,7 @@  discard block
 block discarded – undo
4848 4848
      */
4849 4849
     public function getFullTableName($tbl)
4850 4850
     {
4851
-        return $this->db->config['dbase'] . ".`" . $this->db->config['table_prefix'] . $tbl . "`";
4851
+        return $this->db->config['dbase'].".`".$this->db->config['table_prefix'].$tbl."`";
4852 4852
     }
4853 4853
 
4854 4854
     /**
@@ -4927,7 +4927,7 @@  discard block
 block discarded – undo
4927 4927
     public function getCachePath()
4928 4928
     {
4929 4929
         global $base_url;
4930
-        $pth = $base_url . $this->getCacheFolder();
4930
+        $pth = $base_url.$this->getCacheFolder();
4931 4931
         return $pth;
4932 4932
     }
4933 4933
 
@@ -4979,8 +4979,8 @@  discard block
 block discarded – undo
4979 4979
         $out = false;
4980 4980
 
4981 4981
         if (!empty($context)) {
4982
-            if (is_scalar($context) && isset($_SESSION[$context . 'Validated'])) {
4983
-                $out = $_SESSION[$context . 'InternalKey'];
4982
+            if (is_scalar($context) && isset($_SESSION[$context.'Validated'])) {
4983
+                $out = $_SESSION[$context.'InternalKey'];
4984 4984
             }
4985 4985
         } else {
4986 4986
             switch (true) {
@@ -5008,8 +5008,8 @@  discard block
 block discarded – undo
5008 5008
         $out = false;
5009 5009
 
5010 5010
         if (!empty($context)) {
5011
-            if (is_scalar($context) && isset($_SESSION[$context . 'Validated'])) {
5012
-                $out = $_SESSION[$context . 'Shortname'];
5011
+            if (is_scalar($context) && isset($_SESSION[$context.'Validated'])) {
5012
+                $out = $_SESSION[$context.'Shortname'];
5013 5013
             }
5014 5014
         } else {
5015 5015
             switch (true) {
@@ -5080,8 +5080,8 @@  discard block
 block discarded – undo
5080 5080
      */
5081 5081
     public function getWebUserInfo($uid)
5082 5082
     {
5083
-        $rs = $this->db->select('wu.username, wu.password, wua.*', $this->getFullTableName("web_users") . " wu
5084
-                INNER JOIN " . $this->getFullTableName("web_user_attributes") . " wua ON wua.internalkey=wu.id", "wu.id='{$uid}'");
5083
+        $rs = $this->db->select('wu.username, wu.password, wua.*', $this->getFullTableName("web_users")." wu
5084
+                INNER JOIN " . $this->getFullTableName("web_user_attributes")." wua ON wua.internalkey=wu.id", "wu.id='{$uid}'");
5085 5085
         if ($row = $this->db->getRow($rs)) {
5086 5086
             if (!isset($row['usertype']) or !$row["usertype"]) {
5087 5087
                 $row["usertype"] = "web";
@@ -5117,7 +5117,7 @@  discard block
 block discarded – undo
5117 5117
         } else if (is_array($dg)) {
5118 5118
             // resolve ids to names
5119 5119
             $dgn = array();
5120
-            $ds = $this->db->select('name', $this->getFullTableName("documentgroup_names"), "id IN (" . implode(",", $dg) . ")");
5120
+            $ds = $this->db->select('name', $this->getFullTableName("documentgroup_names"), "id IN (".implode(",", $dg).")");
5121 5121
             while ($row = $this->db->getRow($ds)) {
5122 5122
                 $dgn[] = $row['name'];
5123 5123
             }
@@ -5145,7 +5145,7 @@  discard block
 block discarded – undo
5145 5145
         $rt = false;
5146 5146
         if ($_SESSION["webValidated"] == 1) {
5147 5147
             $tbl = $this->getFullTableName("web_users");
5148
-            $ds = $this->db->select('id, username, password', $tbl, "id='" . $this->getLoginUserID() . "'");
5148
+            $ds = $this->db->select('id, username, password', $tbl, "id='".$this->getLoginUserID()."'");
5149 5149
             if ($row = $this->db->getRow($ds)) {
5150 5150
                 if ($row["password"] == md5($oldPwd)) {
5151 5151
                     if (strlen($newPwd) < 6) {
@@ -5155,7 +5155,7 @@  discard block
 block discarded – undo
5155 5155
                     } else {
5156 5156
                         $this->db->update(array(
5157 5157
                             'password' => $this->db->escape($newPwd),
5158
-                        ), $tbl, "id='" . $this->getLoginUserID() . "'");
5158
+                        ), $tbl, "id='".$this->getLoginUserID()."'");
5159 5159
                         // invoke OnWebChangePassword event
5160 5160
                         $this->invokeEvent("OnWebChangePassword", array(
5161 5161
                             "userid" => $row["id"],
@@ -5186,8 +5186,8 @@  discard block
 block discarded – undo
5186 5186
         // check cache
5187 5187
         $grpNames = isset ($_SESSION['webUserGroupNames']) ? $_SESSION['webUserGroupNames'] : false;
5188 5188
         if (!is_array($grpNames)) {
5189
-            $rs = $this->db->select('wgn.name', $this->getFullTableName("webgroup_names") . " wgn
5190
-                    INNER JOIN " . $this->getFullTableName("web_groups") . " wg ON wg.webgroup=wgn.id AND wg.webuser='" . $this->getLoginUserID() . "'");
5189
+            $rs = $this->db->select('wgn.name', $this->getFullTableName("webgroup_names")." wgn
5190
+                    INNER JOIN " . $this->getFullTableName("web_groups")." wg ON wg.webgroup=wgn.id AND wg.webuser='".$this->getLoginUserID()."'");
5191 5191
             $grpNames = $this->db->getColumn("name", $rs);
5192 5192
             // save to cache
5193 5193
             $_SESSION['webUserGroupNames'] = $grpNames;
@@ -5220,7 +5220,7 @@  discard block
 block discarded – undo
5220 5220
         if (strpos(strtolower($src), "<style") !== false || strpos(strtolower($src), "<link") !== false) {
5221 5221
             $this->sjscripts[$nextpos] = $src;
5222 5222
         } else {
5223
-            $this->sjscripts[$nextpos] = "\t" . '<link rel="stylesheet" type="text/css" href="' . $src . '" ' . ($media ? 'media="' . $media . '" ' : '') . '/>';
5223
+            $this->sjscripts[$nextpos] = "\t".'<link rel="stylesheet" type="text/css" href="'.$src.'" '.($media ? 'media="'.$media.'" ' : '').'/>';
5224 5224
         }
5225 5225
     }
5226 5226
 
@@ -5299,7 +5299,7 @@  discard block
 block discarded – undo
5299 5299
         }
5300 5300
 
5301 5301
         if ($useThisVer && $plaintext != true && (strpos(strtolower($src), "<script") === false)) {
5302
-            $src = "\t" . '<script type="text/javascript" src="' . $src . '"></script>';
5302
+            $src = "\t".'<script type="text/javascript" src="'.$src.'"></script>';
5303 5303
         }
5304 5304
         if ($startup) {
5305 5305
             $pos = isset($overwritepos) ? $overwritepos : max(array_merge(array(0), array_keys($this->sjscripts))) + 1;
@@ -5446,7 +5446,7 @@  discard block
 block discarded – undo
5446 5446
                 $eventtime = $this->getMicroTime() - $eventtime;
5447 5447
                 $this->pluginsCode .= sprintf('<fieldset><legend><b>%s / %s</b> (%2.2f ms)</legend>', $evtName, $pluginName, $eventtime * 1000);
5448 5448
                 foreach ($parameter as $k => $v) {
5449
-                    $this->pluginsCode .= "{$k} => " . print_r($v, true) . '<br>';
5449
+                    $this->pluginsCode .= "{$k} => ".print_r($v, true).'<br>';
5450 5450
                 }
5451 5451
                 $this->pluginsCode .= '</fieldset><br />';
5452 5452
                 $this->pluginsTime["{$evtName} / {$pluginName}"] += $eventtime;
@@ -5474,13 +5474,13 @@  discard block
 block discarded – undo
5474 5474
         $plugin = array();
5475 5475
         if (isset ($this->pluginCache[$pluginName])) {
5476 5476
             $pluginCode = $this->pluginCache[$pluginName];
5477
-            $pluginProperties = isset($this->pluginCache[$pluginName . "Props"]) ? $this->pluginCache[$pluginName . "Props"] : '';
5477
+            $pluginProperties = isset($this->pluginCache[$pluginName."Props"]) ? $this->pluginCache[$pluginName."Props"] : '';
5478 5478
         } else {
5479 5479
             $pluginName = $this->db->escape($pluginName);
5480 5480
             $result = $this->db->select('name, plugincode, properties', $this->getFullTableName("site_plugins"), "name='{$pluginName}' AND disabled=0");
5481 5481
             if ($row = $this->db->getRow($result)) {
5482 5482
                 $pluginCode = $this->pluginCache[$row['name']] = $row['plugincode'];
5483
-                $pluginProperties = $this->pluginCache[$row['name'] . "Props"] = $row['properties'];
5483
+                $pluginProperties = $this->pluginCache[$row['name']."Props"] = $row['properties'];
5484 5484
             } else {
5485 5485
                 $pluginCode = $this->pluginCache[$pluginName] = "return false;";
5486 5486
                 $pluginProperties = '';
@@ -5583,7 +5583,7 @@  discard block
 block discarded – undo
5583 5583
     public function parseDocBlockFromFile($element_dir, $filename, $escapeValues = false)
5584 5584
     {
5585 5585
         $params = array();
5586
-        $fullpath = $element_dir . '/' . $filename;
5586
+        $fullpath = $element_dir.'/'.$filename;
5587 5587
         if (is_readable($fullpath)) {
5588 5588
             $tpl = @fopen($fullpath, "r");
5589 5589
             if ($tpl) {
@@ -5750,8 +5750,8 @@  discard block
 block discarded – undo
5750 5750
         $ph = array('site_url' => MODX_SITE_URL);
5751 5751
         $regexUrl = "/((http|https|ftp|ftps)\:\/\/[^\/]+(\/[^\s]+[^,.?!:;\s])?)/";
5752 5752
         $regexEmail = '#([0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-wyz][a-z](fo|g|l|m|mes|o|op|pa|ro|seum|t|u|v|z)?)#i';
5753
-        $emailSubject = isset($parsed['name']) ? '?subject=' . $parsed['name'] : '';
5754
-        $emailSubject .= isset($parsed['version']) ? ' v' . $parsed['version'] : '';
5753
+        $emailSubject = isset($parsed['name']) ? '?subject='.$parsed['name'] : '';
5754
+        $emailSubject .= isset($parsed['version']) ? ' v'.$parsed['version'] : '';
5755 5755
         foreach ($parsed as $key => $val) {
5756 5756
             if (is_array($val)) {
5757 5757
                 foreach ($val as $key2 => $val2) {
@@ -5760,7 +5760,7 @@  discard block
 block discarded – undo
5760 5760
                         $val2 = preg_replace($regexUrl, "<a href=\"{$url[0]}\" target=\"_blank\">{$url[0]}</a> ", $val2);
5761 5761
                     }
5762 5762
                     if (preg_match($regexEmail, $val2, $url)) {
5763
-                        $val2 = preg_replace($regexEmail, '<a href="mailto:\\1' . $emailSubject . '">\\1</a>', $val2);
5763
+                        $val2 = preg_replace($regexEmail, '<a href="mailto:\\1'.$emailSubject.'">\\1</a>', $val2);
5764 5764
                     }
5765 5765
                     $parsed[$key][$key2] = $val2;
5766 5766
                 }
@@ -5770,7 +5770,7 @@  discard block
 block discarded – undo
5770 5770
                     $val = preg_replace($regexUrl, "<a href=\"{$url[0]}\" target=\"_blank\">{$url[0]}</a> ", $val);
5771 5771
                 }
5772 5772
                 if (preg_match($regexEmail, $val, $url)) {
5773
-                    $val = preg_replace($regexEmail, '<a href="mailto:\\1' . $emailSubject . '">\\1</a>', $val);
5773
+                    $val = preg_replace($regexEmail, '<a href="mailto:\\1'.$emailSubject.'">\\1</a>', $val);
5774 5774
                 }
5775 5775
                 $parsed[$key] = $val;
5776 5776
             }
@@ -5784,32 +5784,32 @@  discard block
 block discarded – undo
5784 5784
         );
5785 5785
 
5786 5786
         $nl = "\n";
5787
-        $list = isset($parsed['logo']) ? '<img src="' . $this->config['base_url'] . ltrim($parsed['logo'], "/") . '" style="float:right;max-width:100px;height:auto;" />' . $nl : '';
5788
-        $list .= '<p>' . $nl;
5789
-        $list .= isset($parsed['name']) ? '<strong>' . $parsed['name'] . '</strong><br/>' . $nl : '';
5790
-        $list .= isset($parsed['description']) ? $parsed['description'] . $nl : '';
5791
-        $list .= '</p><br/>' . $nl;
5792
-        $list .= isset($parsed['version']) ? '<p><strong>' . $_lang['version'] . ':</strong> ' . $parsed['version'] . '</p>' . $nl : '';
5793
-        $list .= isset($parsed['license']) ? '<p><strong>' . $_lang['license'] . ':</strong> ' . $parsed['license'] . '</p>' . $nl : '';
5794
-        $list .= isset($parsed['lastupdate']) ? '<p><strong>' . $_lang['last_update'] . ':</strong> ' . $parsed['lastupdate'] . '</p>' . $nl : '';
5795
-        $list .= '<br/>' . $nl;
5787
+        $list = isset($parsed['logo']) ? '<img src="'.$this->config['base_url'].ltrim($parsed['logo'], "/").'" style="float:right;max-width:100px;height:auto;" />'.$nl : '';
5788
+        $list .= '<p>'.$nl;
5789
+        $list .= isset($parsed['name']) ? '<strong>'.$parsed['name'].'</strong><br/>'.$nl : '';
5790
+        $list .= isset($parsed['description']) ? $parsed['description'].$nl : '';
5791
+        $list .= '</p><br/>'.$nl;
5792
+        $list .= isset($parsed['version']) ? '<p><strong>'.$_lang['version'].':</strong> '.$parsed['version'].'</p>'.$nl : '';
5793
+        $list .= isset($parsed['license']) ? '<p><strong>'.$_lang['license'].':</strong> '.$parsed['license'].'</p>'.$nl : '';
5794
+        $list .= isset($parsed['lastupdate']) ? '<p><strong>'.$_lang['last_update'].':</strong> '.$parsed['lastupdate'].'</p>'.$nl : '';
5795
+        $list .= '<br/>'.$nl;
5796 5796
         $first = true;
5797 5797
         foreach ($arrayParams as $param => $label) {
5798 5798
             if (isset($parsed[$param])) {
5799 5799
                 if ($first) {
5800
-                    $list .= '<p><strong>' . $_lang['references'] . '</strong></p>' . $nl;
5801
-                    $list .= '<ul class="docBlockList">' . $nl;
5800
+                    $list .= '<p><strong>'.$_lang['references'].'</strong></p>'.$nl;
5801
+                    $list .= '<ul class="docBlockList">'.$nl;
5802 5802
                     $first = false;
5803 5803
                 }
5804
-                $list .= '    <li><strong>' . $label . '</strong>' . $nl;
5805
-                $list .= '        <ul>' . $nl;
5804
+                $list .= '    <li><strong>'.$label.'</strong>'.$nl;
5805
+                $list .= '        <ul>'.$nl;
5806 5806
                 foreach ($parsed[$param] as $val) {
5807
-                    $list .= '            <li>' . $val . '</li>' . $nl;
5807
+                    $list .= '            <li>'.$val.'</li>'.$nl;
5808 5808
                 }
5809
-                $list .= '        </ul></li>' . $nl;
5809
+                $list .= '        </ul></li>'.$nl;
5810 5810
             }
5811 5811
         }
5812
-        $list .= !$first ? '</ul>' . $nl : '';
5812
+        $list .= !$first ? '</ul>'.$nl : '';
5813 5813
 
5814 5814
         return $list;
5815 5815
     }
@@ -5885,7 +5885,7 @@  discard block
 block discarded – undo
5885 5885
      */
5886 5886
     public function addSnippet($name, $phpCode)
5887 5887
     {
5888
-        $this->snippetCache['#' . $name] = $phpCode;
5888
+        $this->snippetCache['#'.$name] = $phpCode;
5889 5889
     }
5890 5890
 
5891 5891
     /**
@@ -5894,7 +5894,7 @@  discard block
 block discarded – undo
5894 5894
      */
5895 5895
     public function addChunk($name, $text)
5896 5896
     {
5897
-        $this->chunkCache['#' . $name] = $text;
5897
+        $this->chunkCache['#'.$name] = $text;
5898 5898
     }
5899 5899
 
5900 5900
     /**
@@ -5930,7 +5930,7 @@  discard block
 block discarded – undo
5930 5930
         }
5931 5931
 
5932 5932
         if (!$isSafe) {
5933
-            $msg = $phpcode . "\n" . $this->currentSnippet . "\n" . print_r($_SERVER, true);
5933
+            $msg = $phpcode."\n".$this->currentSnippet."\n".print_r($_SERVER, true);
5934 5934
             $title = sprintf('Unknown eval was executed (%s)', $this->htmlspecialchars(substr(trim($phpcode), 0, 50)));
5935 5935
             $this->messageQuit($title, '', true, '', '', 'Parser', $msg);
5936 5936
             return;
@@ -5944,7 +5944,7 @@  discard block
 block discarded – undo
5944 5944
             return 'array()';
5945 5945
         }
5946 5946
 
5947
-        $output = $echo . $return;
5947
+        $output = $echo.$return;
5948 5948
         modx_sanitize_gpc($output);
5949 5949
         return $this->htmlspecialchars($output); // Maybe, all html tags are dangerous
5950 5950
     }
@@ -5962,8 +5962,8 @@  discard block
 block discarded – undo
5962 5962
 
5963 5963
         $safe = explode(',', $safe_functions);
5964 5964
 
5965
-        $phpcode = rtrim($phpcode, ';') . ';';
5966
-        $tokens = token_get_all('<?php ' . $phpcode);
5965
+        $phpcode = rtrim($phpcode, ';').';';
5966
+        $tokens = token_get_all('<?php '.$phpcode);
5967 5967
         foreach ($tokens as $i => $token) {
5968 5968
             if (!is_array($token)) {
5969 5969
                 continue;
@@ -5999,7 +5999,7 @@  discard block
 block discarded – undo
5999 5999
     public function atBindFileContent($str = '')
6000 6000
     {
6001 6001
 
6002
-        $search_path = array('assets/tvs/', 'assets/chunks/', 'assets/templates/', $this->config['rb_base_url'] . 'files/', '');
6002
+        $search_path = array('assets/tvs/', 'assets/chunks/', 'assets/templates/', $this->config['rb_base_url'].'files/', '');
6003 6003
 
6004 6004
         if (stripos($str, '@FILE') !== 0) {
6005 6005
             return $str;
@@ -6022,7 +6022,7 @@  discard block
 block discarded – undo
6022 6022
         $errorMsg = sprintf("Could not retrieve string '%s'.", $str);
6023 6023
 
6024 6024
         foreach ($search_path as $path) {
6025
-            $file_path = MODX_BASE_PATH . $path . $str;
6025
+            $file_path = MODX_BASE_PATH.$path.$str;
6026 6026
             if (strpos($file_path, MODX_MANAGER_PATH) === 0) {
6027 6027
                 return $errorMsg;
6028 6028
             } elseif (is_file($file_path)) {
@@ -6036,7 +6036,7 @@  discard block
 block discarded – undo
6036 6036
             return $errorMsg;
6037 6037
         }
6038 6038
 
6039
-        $content = (string)file_get_contents($file_path);
6039
+        $content = (string) file_get_contents($file_path);
6040 6040
         if ($content === false) {
6041 6041
             return $errorMsg;
6042 6042
         }
@@ -6149,22 +6149,22 @@  discard block
 block discarded – undo
6149 6149
 
6150 6150
         $version = isset ($GLOBALS['modx_version']) ? $GLOBALS['modx_version'] : '';
6151 6151
         $release_date = isset ($GLOBALS['release_date']) ? $GLOBALS['release_date'] : '';
6152
-        $request_uri = "http://" . $_SERVER['HTTP_HOST'] . ($_SERVER["SERVER_PORT"] == 80 ? "" : (":" . $_SERVER["SERVER_PORT"])) . $_SERVER['REQUEST_URI'];
6152
+        $request_uri = "http://".$_SERVER['HTTP_HOST'].($_SERVER["SERVER_PORT"] == 80 ? "" : (":".$_SERVER["SERVER_PORT"])).$_SERVER['REQUEST_URI'];
6153 6153
         $request_uri = $this->htmlspecialchars($request_uri, ENT_QUOTES, $this->config['modx_charset']);
6154 6154
         $ua = $this->htmlspecialchars($_SERVER['HTTP_USER_AGENT'], ENT_QUOTES, $this->config['modx_charset']);
6155 6155
         $referer = $this->htmlspecialchars($_SERVER['HTTP_REFERER'], ENT_QUOTES, $this->config['modx_charset']);
6156 6156
         if ($is_error) {
6157 6157
             $str = '<h2 style="color:red">&laquo; Evo Parse Error &raquo;</h2>';
6158 6158
             if ($msg != 'PHP Parse Error') {
6159
-                $str .= '<h3 style="color:red">' . $msg . '</h3>';
6159
+                $str .= '<h3 style="color:red">'.$msg.'</h3>';
6160 6160
             }
6161 6161
         } else {
6162 6162
             $str = '<h2 style="color:#003399">&laquo; Evo Debug/ stop message &raquo;</h2>';
6163
-            $str .= '<h3 style="color:#003399">' . $msg . '</h3>';
6163
+            $str .= '<h3 style="color:#003399">'.$msg.'</h3>';
6164 6164
         }
6165 6165
 
6166 6166
         if (!empty ($query)) {
6167
-            $str .= '<div style="font-weight:bold;border:1px solid #ccc;padding:8px;color:#333;background-color:#ffffcd;margin-bottom:15px;">SQL &gt; <span id="sqlHolder">' . $query . '</span></div>';
6167
+            $str .= '<div style="font-weight:bold;border:1px solid #ccc;padding:8px;color:#333;background-color:#ffffcd;margin-bottom:15px;">SQL &gt; <span id="sqlHolder">'.$query.'</span></div>';
6168 6168
         }
6169 6169
 
6170 6170
         $errortype = array(
@@ -6187,13 +6187,13 @@  discard block
 block discarded – undo
6187 6187
 
6188 6188
         if (!empty($nr) || !empty($file)) {
6189 6189
             if ($text != '') {
6190
-                $str .= '<div style="font-weight:bold;border:1px solid #ccc;padding:8px;color:#333;background-color:#ffffcd;margin-bottom:15px;">Error : ' . $text . '</div>';
6190
+                $str .= '<div style="font-weight:bold;border:1px solid #ccc;padding:8px;color:#333;background-color:#ffffcd;margin-bottom:15px;">Error : '.$text.'</div>';
6191 6191
             }
6192 6192
             if ($output != '') {
6193
-                $str .= '<div style="font-weight:bold;border:1px solid #ccc;padding:8px;color:#333;background-color:#ffffcd;margin-bottom:15px;">' . $output . '</div>';
6193
+                $str .= '<div style="font-weight:bold;border:1px solid #ccc;padding:8px;color:#333;background-color:#ffffcd;margin-bottom:15px;">'.$output.'</div>';
6194 6194
             }
6195 6195
             if ($nr !== '') {
6196
-                $table[] = array('ErrorType[num]', $errortype [$nr] . "[" . $nr . "]");
6196
+                $table[] = array('ErrorType[num]', $errortype [$nr]."[".$nr."]");
6197 6197
             }
6198 6198
             if ($file) {
6199 6199
                 $table[] = array('File', $file);
@@ -6213,7 +6213,7 @@  discard block
 block discarded – undo
6213 6213
         }
6214 6214
 
6215 6215
         if (!empty($this->event->activePlugin)) {
6216
-            $table[] = array('Current Plugin', $this->event->activePlugin . '(' . $this->event->name . ')');
6216
+            $table[] = array('Current Plugin', $this->event->activePlugin.'('.$this->event->name.')');
6217 6217
         }
6218 6218
 
6219 6219
         $str .= $MakeTable->create($table, array('Error information', ''));
@@ -6223,17 +6223,17 @@  discard block
 block discarded – undo
6223 6223
         $table[] = array('REQUEST_URI', $request_uri);
6224 6224
 
6225 6225
         if ($this->manager->action) {
6226
-            include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php');
6226
+            include_once(MODX_MANAGER_PATH.'includes/actionlist.inc.php');
6227 6227
             global $action_list;
6228 6228
             $actionName = (isset($action_list[$this->manager->action])) ? " - {$action_list[$this->manager->action]}" : '';
6229 6229
 
6230
-            $table[] = array('Manager action', $this->manager->action . $actionName);
6230
+            $table[] = array('Manager action', $this->manager->action.$actionName);
6231 6231
         }
6232 6232
 
6233 6233
         if (preg_match('@^[0-9]+@', $this->documentIdentifier)) {
6234 6234
             $resource = $this->getDocumentObject('id', $this->documentIdentifier);
6235 6235
             $url = $this->makeUrl($this->documentIdentifier, '', '', 'full');
6236
-            $table[] = array('Resource', '[' . $this->documentIdentifier . '] <a href="' . $url . '" target="_blank">' . $resource['pagetitle'] . '</a>');
6236
+            $table[] = array('Resource', '['.$this->documentIdentifier.'] <a href="'.$url.'" target="_blank">'.$resource['pagetitle'].'</a>');
6237 6237
         }
6238 6238
         $table[] = array('Referer', $referer);
6239 6239
         $table[] = array('User Agent', $ua);
@@ -6254,7 +6254,7 @@  discard block
 block discarded – undo
6254 6254
 
6255 6255
         $mem = memory_get_peak_usage(true);
6256 6256
         $total_mem = $mem - $this->mstart;
6257
-        $total_mem = ($total_mem / 1024 / 1024) . ' mb';
6257
+        $total_mem = ($total_mem / 1024 / 1024).' mb';
6258 6258
 
6259 6259
         $queryTime = $this->queryTime;
6260 6260
         $phpTime = $totalTime - $queryTime;
@@ -6275,18 +6275,18 @@  discard block
 block discarded – undo
6275 6275
         $str .= $this->get_backtrace(debug_backtrace());
6276 6276
         // Log error
6277 6277
         if (!empty($this->currentSnippet)) {
6278
-            $source = 'Snippet - ' . $this->currentSnippet;
6278
+            $source = 'Snippet - '.$this->currentSnippet;
6279 6279
         } elseif (!empty($this->event->activePlugin)) {
6280
-            $source = 'Plugin - ' . $this->event->activePlugin;
6280
+            $source = 'Plugin - '.$this->event->activePlugin;
6281 6281
         } elseif ($source !== '') {
6282
-            $source = 'Parser - ' . $source;
6282
+            $source = 'Parser - '.$source;
6283 6283
         } elseif ($query !== '') {
6284 6284
             $source = 'SQL Query';
6285 6285
         } else {
6286 6286
             $source = 'Parser';
6287 6287
         }
6288 6288
         if ($msg) {
6289
-            $source .= ' / ' . $msg;
6289
+            $source .= ' / '.$msg;
6290 6290
         }
6291 6291
         if (isset($actionName) && !empty($actionName)) {
6292 6292
             $source .= $actionName;
@@ -6318,12 +6318,12 @@  discard block
 block discarded – undo
6318 6318
 
6319 6319
         // Display error
6320 6320
         if (isset($_SESSION['mgrValidated'])) {
6321
-            echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html><head><title>EVO Content Manager ' . $version . ' &raquo; ' . $release_date . '</title>
6321
+            echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html><head><title>EVO Content Manager '.$version.' &raquo; '.$release_date.'</title>
6322 6322
                  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6323
-                 <link rel="stylesheet" type="text/css" href="' . $this->config['site_manager_url'] . 'media/style/' . $this->config['manager_theme'] . '/style.css" />
6323
+                 <link rel="stylesheet" type="text/css" href="' . $this->config['site_manager_url'].'media/style/'.$this->config['manager_theme'].'/style.css" />
6324 6324
                  <style type="text/css">body { padding:10px; } td {font:inherit;}</style>
6325 6325
                  </head><body>
6326
-                 ' . $str . '</body></html>';
6326
+                 ' . $str.'</body></html>';
6327 6327
 
6328 6328
         } else {
6329 6329
             echo 'Error';
@@ -6361,7 +6361,7 @@  discard block
 block discarded – undo
6361 6361
             switch ($val['type']) {
6362 6362
                 case '->':
6363 6363
                 case '::':
6364
-                    $functionName = $val['function'] = $val['class'] . $val['type'] . $val['function'];
6364
+                    $functionName = $val['function'] = $val['class'].$val['type'].$val['function'];
6365 6365
                     break;
6366 6366
                 default:
6367 6367
                     $functionName = $val['function'];
@@ -6371,7 +6371,7 @@  discard block
 block discarded – undo
6371 6371
             $args = array_pad(array(), $_, '$var');
6372 6372
             $args = implode(", ", $args);
6373 6373
             $modx = &$this;
6374
-            $args = preg_replace_callback('/\$var/', function () use ($modx, &$tmp, $val) {
6374
+            $args = preg_replace_callback('/\$var/', function() use ($modx, &$tmp, $val) {
6375 6375
                 $arg = $val['args'][$tmp - 1];
6376 6376
                 switch (true) {
6377 6377
                     case is_null($arg): {
@@ -6383,7 +6383,7 @@  discard block
 block discarded – undo
6383 6383
                         break;
6384 6384
                     }
6385 6385
                     case is_scalar($arg): {
6386
-                        $out = strlen($arg) > 20 ? 'string $var' . $tmp : ("'" . $this->htmlspecialchars(str_replace("'", "\\'", $arg)) . "'");
6386
+                        $out = strlen($arg) > 20 ? 'string $var'.$tmp : ("'".$this->htmlspecialchars(str_replace("'", "\\'", $arg))."'");
6387 6387
                         break;
6388 6388
                     }
6389 6389
                     case is_bool($arg): {
@@ -6391,23 +6391,23 @@  discard block
 block discarded – undo
6391 6391
                         break;
6392 6392
                     }
6393 6393
                     case is_array($arg): {
6394
-                        $out = 'array $var' . $tmp;
6394
+                        $out = 'array $var'.$tmp;
6395 6395
                         break;
6396 6396
                     }
6397 6397
                     case is_object($arg): {
6398
-                        $out = get_class($arg) . ' $var' . $tmp;
6398
+                        $out = get_class($arg).' $var'.$tmp;
6399 6399
                         break;
6400 6400
                     }
6401 6401
                     default: {
6402
-                        $out = '$var' . $tmp;
6402
+                        $out = '$var'.$tmp;
6403 6403
                     }
6404 6404
                 }
6405 6405
                 $tmp++;
6406 6406
                 return $out;
6407 6407
             }, $args);
6408 6408
             $line = array(
6409
-                "<strong>" . $functionName . "</strong>(" . $args . ")",
6410
-                $path . " on line " . $val['line']
6409
+                "<strong>".$functionName."</strong>(".$args.")",
6410
+                $path." on line ".$val['line']
6411 6411
             );
6412 6412
             $table[] = array(implode("<br />", $line));
6413 6413
         }
@@ -6448,7 +6448,7 @@  discard block
 block discarded – undo
6448 6448
             $alias = strip_tags($alias); // strip HTML
6449 6449
             $alias = preg_replace('/[^\.A-Za-z0-9 _-]/', '', $alias); // strip non-alphanumeric characters
6450 6450
             $alias = preg_replace('/\s+/', '-', $alias); // convert white-space to dash
6451
-            $alias = preg_replace('/-+/', '-', $alias);  // convert multiple dashes to one
6451
+            $alias = preg_replace('/-+/', '-', $alias); // convert multiple dashes to one
6452 6452
             $alias = trim($alias, '-'); // trim excess
6453 6453
             return $alias;
6454 6454
         }
@@ -6464,7 +6464,7 @@  discard block
 block discarded – undo
6464 6464
         $precisions = count($sizes) - 1;
6465 6465
         foreach ($sizes as $unit => $bytes) {
6466 6466
             if ($size >= $bytes) {
6467
-                return number_format($size / $bytes, $precisions) . ' ' . $unit;
6467
+                return number_format($size / $bytes, $precisions).' '.$unit;
6468 6468
             }
6469 6469
             $precisions--;
6470 6470
         }
@@ -6568,10 +6568,10 @@  discard block
 block discarded – undo
6568 6568
 
6569 6569
         if (strpos($str, MODX_MANAGER_PATH) === 0) {
6570 6570
             return false;
6571
-        } elseif (is_file(MODX_BASE_PATH . $str)) {
6572
-            $file_path = MODX_BASE_PATH . $str;
6573
-        } elseif (is_file(MODX_BASE_PATH . "{$tpl_dir}{$str}")) {
6574
-            $file_path = MODX_BASE_PATH . $tpl_dir . $str;
6571
+        } elseif (is_file(MODX_BASE_PATH.$str)) {
6572
+            $file_path = MODX_BASE_PATH.$str;
6573
+        } elseif (is_file(MODX_BASE_PATH."{$tpl_dir}{$str}")) {
6574
+            $file_path = MODX_BASE_PATH.$tpl_dir.$str;
6575 6575
         } else {
6576 6576
             return false;
6577 6577
         }
@@ -6697,7 +6697,7 @@  discard block
 block discarded – undo
6697 6697
             $title = 'no title';
6698 6698
         }
6699 6699
         if (is_array($msg)) {
6700
-            $msg = '<pre>' . print_r($msg, true) . '</pre>';
6700
+            $msg = '<pre>'.print_r($msg, true).'</pre>';
6701 6701
         } elseif ($msg === '') {
6702 6702
             $msg = $_SERVER['REQUEST_URI'];
6703 6703
         }
@@ -6742,7 +6742,7 @@  discard block
 block discarded – undo
6742 6742
         if (is_array($SystemAlertMsgQueque)) {
6743 6743
             $title = '';
6744 6744
             if ($this->name && $this->activePlugin) {
6745
-                $title = "<div><b>" . $this->activePlugin . "</b> - <span style='color:maroon;'>" . $this->name . "</span></div>";
6745
+                $title = "<div><b>".$this->activePlugin."</b> - <span style='color:maroon;'>".$this->name."</span></div>";
6746 6746
             }
6747 6747
             $SystemAlertMsgQueque[] = "$title<div style='margin-left:10px;margin-top:3px;'>$msg</div>";
6748 6748
         }
Please login to merge, or discard this patch.
manager/includes/sysalert.display.inc.php 2 patches
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -1,30 +1,30 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-	/**
4
-	 *	System Alert Message Queue Display file
5
-	 *	Written By Raymond Irving, April, 2005
6
-	 *
7
-	 *	Used to display system alert messages inside the browser
8
-	 *
9
-	 */
3
+    /**
4
+     *	System Alert Message Queue Display file
5
+     *	Written By Raymond Irving, April, 2005
6
+     *
7
+     *	Used to display system alert messages inside the browser
8
+     *
9
+     */
10 10
 
11
-	require_once(dirname(__FILE__).'/protect.inc.php');
11
+    require_once(dirname(__FILE__).'/protect.inc.php');
12 12
 
13
-	$sysMsgs = "";
14
-	$limit = count($SystemAlertMsgQueque);
15
-	for($i=0;$i<$limit;$i++) {
16
-		$sysMsgs .= $SystemAlertMsgQueque[$i]."<hr sys/>";
17
-	}
18
-	// reset message queque
19
-	unset($_SESSION['SystemAlertMsgQueque']);
20
-	$_SESSION['SystemAlertMsgQueque'] = array();
21
-	$SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque'];
13
+    $sysMsgs = "";
14
+    $limit = count($SystemAlertMsgQueque);
15
+    for($i=0;$i<$limit;$i++) {
16
+        $sysMsgs .= $SystemAlertMsgQueque[$i]."<hr sys/>";
17
+    }
18
+    // reset message queque
19
+    unset($_SESSION['SystemAlertMsgQueque']);
20
+    $_SESSION['SystemAlertMsgQueque'] = array();
21
+    $SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque'];
22 22
 
23
-	if($sysMsgs!="") {
23
+    if($sysMsgs!="") {
24 24
 ?>
25 25
 
26 26
 <?php // fetch the styles
27
-	echo '<link rel="stylesheet" type="text/css" href="'.MODX_MANAGER_URL.'media/style/'.$manager_theme.'/style.css'.'" />';
27
+    echo '<link rel="stylesheet" type="text/css" href="'.MODX_MANAGER_URL.'media/style/'.$manager_theme.'/style.css'.'" />';
28 28
 ?>
29 29
 <script type="text/javascript">
30 30
 // <![CDATA[
@@ -42,5 +42,5 @@  discard block
 block discarded – undo
42 42
 // ]]>
43 43
 </script>
44 44
 <?php
45
-	}
45
+    }
46 46
 ?>
47 47
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 
13 13
 	$sysMsgs = "";
14 14
 	$limit = count($SystemAlertMsgQueque);
15
-	for($i=0;$i<$limit;$i++) {
15
+	for ($i = 0; $i < $limit; $i++) {
16 16
 		$sysMsgs .= $SystemAlertMsgQueque[$i]."<hr sys/>";
17 17
 	}
18 18
 	// reset message queque
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 	$_SESSION['SystemAlertMsgQueque'] = array();
21 21
 	$SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque'];
22 22
 
23
-	if($sysMsgs!="") {
23
+	if ($sysMsgs != "") {
24 24
 ?>
25 25
 
26 26
 <?php // fetch the styles
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 			var sysAlert = new Element('div').setProperties({
33 33
 				'class': 'sysAlert'
34 34
 			});
35
-			sysAlert.innerHTML = '<?php echo $modx->db->escape($sysMsgs);?>';
35
+			sysAlert.innerHTML = '<?php echo $modx->db->escape($sysMsgs); ?>';
36 36
 			var boxHtml = new MooPrompt('<?php echo $_lang['sys_alert']; ?>', sysAlert, {
37 37
 				buttons: 1,
38 38
 				button1: 'Ok',
Please login to merge, or discard this patch.
manager/includes/config_check.inc.php 4 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@
 block discarded – undo
88 88
 }
89 89
 </script>
90 90
 
91
-JS;
91
+js;
92 92
         $modx->regClientScript($script);
93 93
         }
94 94
     }
Please login to merge, or discard this patch.
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -5,14 +5,14 @@  discard block
 block discarded – undo
5 5
 
6 6
 // PROCESSOR FIRST
7 7
 if($_SESSION['mgrRole'] == 1) {
8
-	if($_REQUEST['b'] == 'resetSysfilesChecksum' && $modx->hasPermission('settings')) {
9
-		$current = $modx->manager->getSystemChecksum($modx->config['check_files_onlogin']);
10
-		if(!empty($current)) {
11
-			$modx->manager->setSystemChecksum($current);
12
-			$modx->clearCache('full');
13
-			$modx->config['sys_files_checksum'] = $current;
14
-		};
15
-	}
8
+    if($_REQUEST['b'] == 'resetSysfilesChecksum' && $modx->hasPermission('settings')) {
9
+        $current = $modx->manager->getSystemChecksum($modx->config['check_files_onlogin']);
10
+        if(!empty($current)) {
11
+            $modx->manager->setSystemChecksum($current);
12
+            $modx->clearCache('full');
13
+            $modx->config['sys_files_checksum'] = $current;
14
+        };
15
+    }
16 16
 }
17 17
 
18 18
 // NOW CHECK CONFIG
@@ -20,15 +20,15 @@  discard block
 block discarded – undo
20 20
 
21 21
 $sysfiles_check = $modx->manager->checkSystemChecksum();
22 22
 if ($sysfiles_check!=='0'){
23
-      $warningspresent = 1;
24
-      $warnings[] = array($_lang['configcheck_sysfiles_mod']);
23
+        $warningspresent = 1;
24
+        $warnings[] = array($_lang['configcheck_sysfiles_mod']);
25 25
 }
26 26
 
27 27
 if (is_writable("includes/config.inc.php")){
28 28
     // Warn if world writable
29 29
     if(@fileperms('includes/config.inc.php') & 0x0002) {
30
-      $warningspresent = 1;
31
-      $warnings[] = array($_lang['configcheck_configinc']);
30
+        $warningspresent = 1;
31
+        $warnings[] = array($_lang['configcheck_configinc']);
32 32
     }
33 33
 }
34 34
 
@@ -179,10 +179,10 @@  discard block
 block discarded – undo
179 179
             break;
180 180
         case $_lang['configcheck_sysfiles_mod']:
181 181
             $warnings[$i][1] = $_lang["configcheck_sysfiles_mod_msg"];
182
-			$warnings[$i][2] = '<ul><li>'. implode('</li><li>', $sysfiles_check) .'</li></ul>';
183
-			if($modx->hasPermission('settings')) {
184
-				$warnings[$i][2] .= '<ul class="actionButtons" style="float:right"><li><a href="index.php?a=2&b=resetSysfilesChecksum" onclick="return confirm(\'' . $_lang["reset_sysfiles_checksum_alert"] . '\')">' . $_lang["reset_sysfiles_checksum_button"] . '</a></li></ul>';
185
-			}
182
+            $warnings[$i][2] = '<ul><li>'. implode('</li><li>', $sysfiles_check) .'</li></ul>';
183
+            if($modx->hasPermission('settings')) {
184
+                $warnings[$i][2] .= '<ul class="actionButtons" style="float:right"><li><a href="index.php?a=2&b=resetSysfilesChecksum" onclick="return confirm(\'' . $_lang["reset_sysfiles_checksum_alert"] . '\')">' . $_lang["reset_sysfiles_checksum_button"] . '</a></li></ul>';
185
+            }
186 186
             if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1]." ".implode(', ',$sysfiles_check),$_lang['configcheck_sysfiles_mod']);
187 187
             break;
188 188
         case $_lang['configcheck_lang_difference'] :
Please login to merge, or discard this patch.
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@  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
 
6 6
 // PROCESSOR FIRST
7
-if($_SESSION['mgrRole'] == 1) {
8
-	if($_REQUEST['b'] == 'resetSysfilesChecksum' && $modx->hasPermission('settings')) {
7
+if ($_SESSION['mgrRole'] == 1) {
8
+	if ($_REQUEST['b'] == 'resetSysfilesChecksum' && $modx->hasPermission('settings')) {
9 9
 		$current = $modx->manager->getSystemChecksum($modx->config['check_files_onlogin']);
10
-		if(!empty($current)) {
10
+		if (!empty($current)) {
11 11
 			$modx->manager->setSystemChecksum($current);
12 12
 			$modx->clearCache('full');
13 13
 			$modx->config['sys_files_checksum'] = $current;
@@ -19,14 +19,14 @@  discard block
 block discarded – undo
19 19
 $warningspresent = 0;
20 20
 
21 21
 $sysfiles_check = $modx->manager->checkSystemChecksum();
22
-if ($sysfiles_check!=='0'){
22
+if ($sysfiles_check !== '0') {
23 23
       $warningspresent = 1;
24 24
       $warnings[] = array($_lang['configcheck_sysfiles_mod']);
25 25
 }
26 26
 
27
-if (is_writable("includes/config.inc.php")){
27
+if (is_writable("includes/config.inc.php")) {
28 28
     // Warn if world writable
29
-    if(@fileperms('includes/config.inc.php') & 0x0002) {
29
+    if (@fileperms('includes/config.inc.php') & 0x0002) {
30 30
       $warningspresent = 1;
31 31
       $warnings[] = array($_lang['configcheck_configinc']);
32 32
     }
@@ -42,8 +42,8 @@  discard block
 block discarded – undo
42 42
     $warnings[] = array($_lang['configcheck_php_gdzip']);
43 43
 }
44 44
 
45
-if(!isset($modx->config['_hide_configcheck_validate_referer']) || $modx->config['_hide_configcheck_validate_referer'] !== '1') {
46
-    if(isset($_SESSION['mgrPermissions']['settings']) && $_SESSION['mgrPermissions']['settings'] == '1') {
45
+if (!isset($modx->config['_hide_configcheck_validate_referer']) || $modx->config['_hide_configcheck_validate_referer'] !== '1') {
46
+    if (isset($_SESSION['mgrPermissions']['settings']) && $_SESSION['mgrPermissions']['settings'] == '1') {
47 47
         if ($modx->db->getValue($modx->db->select('COUNT(setting_value)', $modx->getFullTableName('system_settings'), "setting_name='validate_referer' AND setting_value='0'"))) {
48 48
             $warningspresent = 1;
49 49
             $warnings[] = array($_lang['configcheck_validate_referer']);
@@ -52,11 +52,11 @@  discard block
 block discarded – undo
52 52
 }
53 53
 
54 54
 // check for Template Switcher plugin
55
-if(!isset($modx->config['_hide_configcheck_templateswitcher_present']) || $modx->config['_hide_configcheck_templateswitcher_present'] !== '1') {
56
-    if(isset($_SESSION['mgrPermissions']['edit_plugin']) && $_SESSION['mgrPermissions']['edit_plugin'] == '1') {
55
+if (!isset($modx->config['_hide_configcheck_templateswitcher_present']) || $modx->config['_hide_configcheck_templateswitcher_present'] !== '1') {
56
+    if (isset($_SESSION['mgrPermissions']['edit_plugin']) && $_SESSION['mgrPermissions']['edit_plugin'] == '1') {
57 57
         $rs = $modx->db->select('name, disabled', $modx->getFullTableName('site_plugins'), "name IN ('TemplateSwitcher', 'Template Switcher', 'templateswitcher', 'template_switcher', 'template switcher') OR plugincode LIKE '%TemplateSwitcher%'");
58 58
         $row = $modx->db->getRow($rs);
59
-        if($row && $row['disabled'] == 0) {
59
+        if ($row && $row['disabled'] == 0) {
60 60
             $warningspresent = 1;
61 61
             $warnings[] = array($_lang['configcheck_templateswitcher_present']);
62 62
             $tplName = $row['name'];
@@ -120,36 +120,36 @@  discard block
 block discarded – undo
120 120
     /**
121 121
      * @return bool
122 122
      */
123
-    function checkSiteCache() {
123
+    function checkSiteCache(){
124 124
         $modx = evolutionCMS();
125
-        $checked= true;
126
-        if (file_exists($modx->config['base_path'] . 'assets/cache/siteCache.idx.php')) {
127
-            $checked= @include_once ($modx->config['base_path'] . 'assets/cache/siteCache.idx.php');
125
+        $checked = true;
126
+        if (file_exists($modx->config['base_path'].'assets/cache/siteCache.idx.php')) {
127
+            $checked = @include_once ($modx->config['base_path'].'assets/cache/siteCache.idx.php');
128 128
         }
129 129
         return $checked;
130 130
     }
131 131
 }
132 132
 
133
-if (!is_writable(MODX_BASE_PATH . "assets/cache/")) {
133
+if (!is_writable(MODX_BASE_PATH."assets/cache/")) {
134 134
     $warningspresent = 1;
135 135
     $warnings[] = array($_lang['configcheck_cache']);
136 136
 }
137 137
 
138 138
 if (!checkSiteCache()) {
139 139
     $warningspresent = 1;
140
-    $warnings[]= array($lang['configcheck_sitecache_integrity']);
140
+    $warnings[] = array($lang['configcheck_sitecache_integrity']);
141 141
 }
142 142
 
143
-if (!is_writable(MODX_BASE_PATH . "assets/images/")) {
143
+if (!is_writable(MODX_BASE_PATH."assets/images/")) {
144 144
     $warningspresent = 1;
145 145
     $warnings[] = array($_lang['configcheck_images']);
146 146
 }
147 147
 
148
-if(strpos($modx->config['rb_base_dir'],MODX_BASE_PATH)!==0) {
148
+if (strpos($modx->config['rb_base_dir'], MODX_BASE_PATH) !== 0) {
149 149
     $warningspresent = 1;
150 150
     $warnings[] = array($_lang['configcheck_rb_base_dir']);
151 151
 }
152
-if(strpos($modx->config['filemanager_path'],MODX_BASE_PATH)!==0) {
152
+if (strpos($modx->config['filemanager_path'], MODX_BASE_PATH) !== 0) {
153 153
     $warningspresent = 1;
154 154
     $warnings[] = array($_lang['configcheck_filemanager_path']);
155 155
 }
@@ -157,36 +157,36 @@  discard block
 block discarded – undo
157 157
 // clear file info cache
158 158
 clearstatcache();
159 159
 
160
-if ($warningspresent==1) {
160
+if ($warningspresent == 1) {
161 161
 
162
-if(!isset($modx->config['send_errormail'])) $modx->config['send_errormail']='3';
162
+if (!isset($modx->config['send_errormail'])) $modx->config['send_errormail'] = '3';
163 163
 $config_check_results = "<h3>".$_lang['configcheck_notok']."</h3>";
164 164
 
165
-for ($i=0;$i<count($warnings);$i++) {
165
+for ($i = 0; $i < count($warnings); $i++) {
166 166
     switch ($warnings[$i][0]) {
167 167
         case $_lang['configcheck_configinc'];
168 168
             $warnings[$i][1] = $_lang['configcheck_configinc_msg'];
169
-            if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1],$_lang['configcheck_configinc']);
169
+            if (!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0, 3, $warnings[$i][1], $_lang['configcheck_configinc']);
170 170
             break;
171 171
         case $_lang['configcheck_installer'] :
172 172
             $warnings[$i][1] = $_lang['configcheck_installer_msg'];
173
-            if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1],$_lang['configcheck_installer']);
173
+            if (!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0, 3, $warnings[$i][1], $_lang['configcheck_installer']);
174 174
             break;
175 175
         case $_lang['configcheck_cache'] :
176 176
             $warnings[$i][1] = $_lang['configcheck_cache_msg'];
177
-            if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,2,$warnings[$i][1],$_lang['configcheck_cache']);
177
+            if (!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0, 2, $warnings[$i][1], $_lang['configcheck_cache']);
178 178
             break;
179 179
         case $_lang['configcheck_images'] :
180 180
             $warnings[$i][1] = $_lang['configcheck_images_msg'];
181
-            if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,2,$warnings[$i][1],$_lang['configcheck_images']);
181
+            if (!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0, 2, $warnings[$i][1], $_lang['configcheck_images']);
182 182
             break;
183 183
         case $_lang['configcheck_sysfiles_mod']:
184 184
             $warnings[$i][1] = $_lang["configcheck_sysfiles_mod_msg"];
185
-			$warnings[$i][2] = '<ul><li>'. implode('</li><li>', $sysfiles_check) .'</li></ul>';
186
-			if($modx->hasPermission('settings')) {
187
-				$warnings[$i][2] .= '<ul class="actionButtons" style="float:right"><li><a href="index.php?a=2&b=resetSysfilesChecksum" onclick="return confirm(\'' . $_lang["reset_sysfiles_checksum_alert"] . '\')">' . $_lang["reset_sysfiles_checksum_button"] . '</a></li></ul>';
185
+			$warnings[$i][2] = '<ul><li>'.implode('</li><li>', $sysfiles_check).'</li></ul>';
186
+			if ($modx->hasPermission('settings')) {
187
+				$warnings[$i][2] .= '<ul class="actionButtons" style="float:right"><li><a href="index.php?a=2&b=resetSysfilesChecksum" onclick="return confirm(\''.$_lang["reset_sysfiles_checksum_alert"].'\')">'.$_lang["reset_sysfiles_checksum_button"].'</a></li></ul>';
188 188
 			}
189
-            if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1]." ".implode(', ',$sysfiles_check),$_lang['configcheck_sysfiles_mod']);
189
+            if (!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0, 3, $warnings[$i][1]." ".implode(', ', $sysfiles_check), $_lang['configcheck_sysfiles_mod']);
190 190
             break;
191 191
         case $_lang['configcheck_lang_difference'] :
192 192
             $warnings[$i][1] = $_lang['configcheck_lang_difference_msg'];
@@ -208,18 +208,18 @@  discard block
 block discarded – undo
208 208
             break;
209 209
         case $_lang['configcheck_validate_referer'] :
210 210
             $msg = $_lang['configcheck_validate_referer_msg'];
211
-            $msg .= '<br />' . sprintf($_lang["configcheck_hide_warning"], 'validate_referer');
211
+            $msg .= '<br />'.sprintf($_lang["configcheck_hide_warning"], 'validate_referer');
212 212
             $warnings[$i][1] = "<span id=\"validate_referer_warning_wrapper\">{$msg}</span>\n";
213 213
             break;
214 214
         case $_lang['configcheck_templateswitcher_present'] :
215 215
             $msg = $_lang["configcheck_templateswitcher_present_msg"];
216
-            if(isset($_SESSION['mgrPermissions']['save_plugin']) && $_SESSION['mgrPermissions']['save_plugin'] == '1') {
217
-                $msg .= '<br />' . $_lang["configcheck_templateswitcher_present_disable"];
216
+            if (isset($_SESSION['mgrPermissions']['save_plugin']) && $_SESSION['mgrPermissions']['save_plugin'] == '1') {
217
+                $msg .= '<br />'.$_lang["configcheck_templateswitcher_present_disable"];
218 218
             }
219
-            if(isset($_SESSION['mgrPermissions']['delete_plugin']) && $_SESSION['mgrPermissions']['delete_plugin'] == '1') {
220
-                $msg .= '<br />' . $_lang["configcheck_templateswitcher_present_delete"];
219
+            if (isset($_SESSION['mgrPermissions']['delete_plugin']) && $_SESSION['mgrPermissions']['delete_plugin'] == '1') {
220
+                $msg .= '<br />'.$_lang["configcheck_templateswitcher_present_delete"];
221 221
             }
222
-            $msg .= '<br />' . sprintf($_lang["configcheck_hide_warning"], 'templateswitcher_present');
222
+            $msg .= '<br />'.sprintf($_lang["configcheck_hide_warning"], 'templateswitcher_present');
223 223
             $warnings[$i][1] = "<span id=\"templateswitcher_present_warning_wrapper\">{$msg}</span>\n";
224 224
             break;
225 225
         case $_lang['configcheck_rb_base_dir'] :
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
             $warnings[$i][1] = $_lang['configcheck_default_msg'];
233 233
     }
234 234
 
235
-    $admin_warning = $_SESSION['mgrRole']!=1 ? $_lang['configcheck_admin'] : "" ;
235
+    $admin_warning = $_SESSION['mgrRole'] != 1 ? $_lang['configcheck_admin'] : "";
236 236
     $config_check_results .= "
237 237
             <fieldset>
238 238
             <p><strong>".$_lang['configcheck_warning']."</strong> '".$warnings[$i][0]."'</p>
@@ -241,11 +241,11 @@  discard block
 block discarded – undo
241 241
             ".(isset($warnings[$i][2]) ? '<div style="padding-left:1em">'.$warnings[$i][2].'</div>' : '')."
242 242
             </fieldset>
243 243
 ";
244
-        if ($i!=count($warnings)-1) {
244
+        if ($i != count($warnings) - 1) {
245 245
             $config_check_results .= "<br />";
246 246
         }
247 247
     }
248
-    $_SESSION["mgrConfigCheck"]=true;
248
+    $_SESSION["mgrConfigCheck"] = true;
249 249
 } else {
250 250
     $config_check_results = $_lang['configcheck_ok'];
251 251
 }
Please login to merge, or discard this patch.
Braces   +22 added lines, -9 removed lines patch added patch discarded remove patch
@@ -19,12 +19,12 @@  discard block
 block discarded – undo
19 19
 $warningspresent = 0;
20 20
 
21 21
 $sysfiles_check = $modx->manager->checkSystemChecksum();
22
-if ($sysfiles_check!=='0'){
22
+if ($sysfiles_check!=='0') {
23 23
       $warningspresent = 1;
24 24
       $warnings[] = array($_lang['configcheck_sysfiles_mod']);
25 25
 }
26 26
 
27
-if (is_writable("includes/config.inc.php")){
27
+if (is_writable("includes/config.inc.php")) {
28 28
     // Warn if world writable
29 29
     if(@fileperms('includes/config.inc.php') & 0x0002) {
30 30
       $warningspresent = 1;
@@ -120,7 +120,8 @@  discard block
 block discarded – undo
120 120
     /**
121 121
      * @return bool
122 122
      */
123
-    function checkSiteCache() {
123
+    function checkSiteCache()
124
+    {
124 125
         $modx = evolutionCMS();
125 126
         $checked= true;
126 127
         if (file_exists($modx->config['base_path'] . 'assets/cache/siteCache.idx.php')) {
@@ -159,26 +160,36 @@  discard block
 block discarded – undo
159 160
 
160 161
 if ($warningspresent==1) {
161 162
 
162
-if(!isset($modx->config['send_errormail'])) $modx->config['send_errormail']='3';
163
+if(!isset($modx->config['send_errormail'])) {
164
+    $modx->config['send_errormail']='3';
165
+}
163 166
 $config_check_results = "<h3>".$_lang['configcheck_notok']."</h3>";
164 167
 
165 168
 for ($i=0;$i<count($warnings);$i++) {
166 169
     switch ($warnings[$i][0]) {
167 170
         case $_lang['configcheck_configinc'];
168 171
             $warnings[$i][1] = $_lang['configcheck_configinc_msg'];
169
-            if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1],$_lang['configcheck_configinc']);
172
+            if(!$_SESSION["mgrConfigCheck"]) {
173
+                $modx->logEvent(0,3,$warnings[$i][1],$_lang['configcheck_configinc']);
174
+            }
170 175
             break;
171 176
         case $_lang['configcheck_installer'] :
172 177
             $warnings[$i][1] = $_lang['configcheck_installer_msg'];
173
-            if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1],$_lang['configcheck_installer']);
178
+            if(!$_SESSION["mgrConfigCheck"]) {
179
+                $modx->logEvent(0,3,$warnings[$i][1],$_lang['configcheck_installer']);
180
+            }
174 181
             break;
175 182
         case $_lang['configcheck_cache'] :
176 183
             $warnings[$i][1] = $_lang['configcheck_cache_msg'];
177
-            if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,2,$warnings[$i][1],$_lang['configcheck_cache']);
184
+            if(!$_SESSION["mgrConfigCheck"]) {
185
+                $modx->logEvent(0,2,$warnings[$i][1],$_lang['configcheck_cache']);
186
+            }
178 187
             break;
179 188
         case $_lang['configcheck_images'] :
180 189
             $warnings[$i][1] = $_lang['configcheck_images_msg'];
181
-            if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,2,$warnings[$i][1],$_lang['configcheck_images']);
190
+            if(!$_SESSION["mgrConfigCheck"]) {
191
+                $modx->logEvent(0,2,$warnings[$i][1],$_lang['configcheck_images']);
192
+            }
182 193
             break;
183 194
         case $_lang['configcheck_sysfiles_mod']:
184 195
             $warnings[$i][1] = $_lang["configcheck_sysfiles_mod_msg"];
@@ -186,7 +197,9 @@  discard block
 block discarded – undo
186 197
 			if($modx->hasPermission('settings')) {
187 198
 				$warnings[$i][2] .= '<ul class="actionButtons" style="float:right"><li><a href="index.php?a=2&b=resetSysfilesChecksum" onclick="return confirm(\'' . $_lang["reset_sysfiles_checksum_alert"] . '\')">' . $_lang["reset_sysfiles_checksum_button"] . '</a></li></ul>';
188 199
 			}
189
-            if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1]." ".implode(', ',$sysfiles_check),$_lang['configcheck_sysfiles_mod']);
200
+            if(!$_SESSION["mgrConfigCheck"]) {
201
+                $modx->logEvent(0,3,$warnings[$i][1]." ".implode(', ',$sysfiles_check),$_lang['configcheck_sysfiles_mod']);
202
+            }
190 203
             break;
191 204
         case $_lang['configcheck_lang_difference'] :
192 205
             $warnings[$i][1] = $_lang['configcheck_lang_difference_msg'];
Please login to merge, or discard this patch.
manager/includes/debug.inc.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 
4 4
 // show debug information
5 5
 if(isset($enable_debug) && $enable_debug==true) {
6
-	?>
6
+    ?>
7 7
 	<script language="javascript">
8 8
 	//document.onload = removeDebug();
9 9
 	
@@ -33,8 +33,8 @@  discard block
 block discarded – undo
33 33
 	}
34 34
 	</style>
35 35
 	<?php
36
-	$mtime = microtime(); $mtime = explode(" ",$mtime); $mtime = $mtime[1] + $mtime[0]; $tend = $mtime; $totaltime = ($tend - $tstart);
37
-	?>
36
+    $mtime = microtime(); $mtime = explode(" ",$mtime); $mtime = $mtime[1] + $mtime[0]; $tend = $mtime; $totaltime = ($tend - $tstart);
37
+    ?>
38 38
 	<div class='debug' id='debug' name='debug' onClick="removeDebugDiv();">
39 39
 		<table border="0" cellspacing="0" cellpadding="0">
40 40
 		  <tr>
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@  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
 
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
 block discarded – undo
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
 block discarded – undo
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>
Please login to merge, or discard this patch.
manager/includes/controls/contextmenu.php 4 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,4 +69,4 @@
 block discarded – undo
69 69
 		cm.style.visibility = 'hidden';
70 70
 	}
71 71
 </script>
72
-BLOCK;
72
+block;
Please login to merge, or discard this patch.
Indentation   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -4,71 +4,71 @@
 block discarded – undo
4 4
 $ContextMenuCnt = 0;
5 5
 
6 6
 class ContextMenu {
7
-	public $id;
7
+    public $id;
8 8
     /**
9 9
      * @var string
10 10
      */
11
-	public $html = '';
11
+    public $html = '';
12 12
     /**
13 13
      * @var bool
14 14
      */
15
-	public $visible = false;
15
+    public $visible = false;
16 16
     /**
17 17
      * @var int
18 18
      */
19
-	public $width = 120;
19
+    public $width = 120;
20 20
 
21 21
     public function __construct($id = '', $width = 120, $visible = false) {
22
-		global $ContextMenuCnt;
23
-		$ContextMenuCnt++;
24
-		$this->html = "";
25
-		$this->visible = $visible ? $visible : false;
26
-		$this->width = is_numeric($width) ? (int)$width : 120;
27
-		$this->id = $id ? $id : "cntxMnu" . $ContextMenuCnt;    // set id
28
-	}
22
+        global $ContextMenuCnt;
23
+        $ContextMenuCnt++;
24
+        $this->html = "";
25
+        $this->visible = $visible ? $visible : false;
26
+        $this->width = is_numeric($width) ? (int)$width : 120;
27
+        $this->id = $id ? $id : "cntxMnu" . $ContextMenuCnt;    // set id
28
+    }
29 29
 
30 30
     public function addItem($text, $action = "", $img = "", $disabled = 0) {
31
-		global $base_url, $_style;
31
+        global $base_url, $_style;
32 32
         if($disabled) {
33 33
             return;
34 34
         }
35
-		if(!$img) {
36
-			$img = $base_url . $_style['tx'];
37
-		}
38
-		if(substr($action, 0, 3) == "js:") {
39
-			$action = substr($action, 3);
40
-		} else if(substr($action, 0, 3) == "hl:") {
41
-			$action = "window.location.href='" . substr($action, 3) . "'";
42
-		} else {
43
-			$action = "window.location.href='" . $action . "'";
44
-		}
45
-		$action = " onmouseover=\"this.className='cntxMnuItemOver';\" onmouseout=\"this.className='cntxMnuItem';\" onclick=\"$action; hideCntxMenu('" . $this->id . "');\"";
46
-		$this->html .= "<div class='" . ($disabled ? "cntxMnuItemDisabled" : "cntxMnuItem") . "' $action>";
35
+        if(!$img) {
36
+            $img = $base_url . $_style['tx'];
37
+        }
38
+        if(substr($action, 0, 3) == "js:") {
39
+            $action = substr($action, 3);
40
+        } else if(substr($action, 0, 3) == "hl:") {
41
+            $action = "window.location.href='" . substr($action, 3) . "'";
42
+        } else {
43
+            $action = "window.location.href='" . $action . "'";
44
+        }
45
+        $action = " onmouseover=\"this.className='cntxMnuItemOver';\" onmouseout=\"this.className='cntxMnuItem';\" onclick=\"$action; hideCntxMenu('" . $this->id . "');\"";
46
+        $this->html .= "<div class='" . ($disabled ? "cntxMnuItemDisabled" : "cntxMnuItem") . "' $action>";
47 47
         if(substr($img, 0, 5) == 'fa fa') {
48 48
             $img = '<i class="' . $img . '"></i>';
49 49
         } else if(substr($img, 0, 1) != '<') {
50 50
             $img = '<img src="' . $img . '" />';
51 51
         }
52
-		$this->html .= $img . '&nbsp;' . $text . '</div>';
53
-	}
52
+        $this->html .= $img . '&nbsp;' . $text . '</div>';
53
+    }
54 54
 
55 55
     public function addSeparator() {
56
-		$this->html .= "
56
+        $this->html .= "
57 57
 			<div class='cntxMnuSeparator'></div>
58 58
 		";
59
-	}
59
+    }
60 60
 
61 61
     public function render() {
62
-		global $ContextMenuScript;
62
+        global $ContextMenuScript;
63 63
 
64
-		$html = $ContextMenuScript . "<div id='" . $this->id . "' class='contextMenu' style='width:" . $this->width . "px; visibility:" . ($this->visible ? 'visible' : 'hidden') . "'>" . $this->html . "</div>";
65
-		$ContextMenuScript = ""; // reset css
66
-		return $html;
67
-	}
64
+        $html = $ContextMenuScript . "<div id='" . $this->id . "' class='contextMenu' style='width:" . $this->width . "px; visibility:" . ($this->visible ? 'visible' : 'hidden') . "'>" . $this->html . "</div>";
65
+        $ContextMenuScript = ""; // reset css
66
+        return $html;
67
+    }
68 68
 
69 69
     public function getClientScriptObject() {
70
-		return "getCntxMenu('" . $this->id . "')";
71
-	}
70
+        return "getCntxMenu('" . $this->id . "')";
71
+    }
72 72
 }
73 73
 
74 74
 $ContextMenuScript = <<<BLOCK
Please login to merge, or discard this patch.
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 global $ContextMenuCnt;
4 4
 $ContextMenuCnt = 0;
5 5
 
6
-class ContextMenu {
6
+class ContextMenu{
7 7
 	public $id;
8 8
     /**
9 9
      * @var string
@@ -18,56 +18,56 @@  discard block
 block discarded – undo
18 18
      */
19 19
 	public $width = 120;
20 20
 
21
-    public function __construct($id = '', $width = 120, $visible = false) {
21
+    public function __construct($id = '', $width = 120, $visible = false){
22 22
 		global $ContextMenuCnt;
23 23
 		$ContextMenuCnt++;
24 24
 		$this->html = "";
25 25
 		$this->visible = $visible ? $visible : false;
26
-		$this->width = is_numeric($width) ? (int)$width : 120;
27
-		$this->id = $id ? $id : "cntxMnu" . $ContextMenuCnt;    // set id
26
+		$this->width = is_numeric($width) ? (int) $width : 120;
27
+		$this->id = $id ? $id : "cntxMnu".$ContextMenuCnt; // set id
28 28
 	}
29 29
 
30
-    public function addItem($text, $action = "", $img = "", $disabled = 0) {
30
+    public function addItem($text, $action = "", $img = "", $disabled = 0){
31 31
 		global $base_url, $_style;
32
-        if($disabled) {
32
+        if ($disabled) {
33 33
             return;
34 34
         }
35
-		if(!$img) {
36
-			$img = $base_url . $_style['tx'];
35
+		if (!$img) {
36
+			$img = $base_url.$_style['tx'];
37 37
 		}
38
-		if(substr($action, 0, 3) == "js:") {
38
+		if (substr($action, 0, 3) == "js:") {
39 39
 			$action = substr($action, 3);
40
-		} else if(substr($action, 0, 3) == "hl:") {
41
-			$action = "window.location.href='" . substr($action, 3) . "'";
40
+		} else if (substr($action, 0, 3) == "hl:") {
41
+			$action = "window.location.href='".substr($action, 3)."'";
42 42
 		} else {
43
-			$action = "window.location.href='" . $action . "'";
43
+			$action = "window.location.href='".$action."'";
44 44
 		}
45
-		$action = " onmouseover=\"this.className='cntxMnuItemOver';\" onmouseout=\"this.className='cntxMnuItem';\" onclick=\"$action; hideCntxMenu('" . $this->id . "');\"";
46
-		$this->html .= "<div class='" . ($disabled ? "cntxMnuItemDisabled" : "cntxMnuItem") . "' $action>";
47
-        if(substr($img, 0, 5) == 'fa fa') {
48
-            $img = '<i class="' . $img . '"></i>';
49
-        } else if(substr($img, 0, 1) != '<') {
50
-            $img = '<img src="' . $img . '" />';
45
+		$action = " onmouseover=\"this.className='cntxMnuItemOver';\" onmouseout=\"this.className='cntxMnuItem';\" onclick=\"$action; hideCntxMenu('".$this->id."');\"";
46
+		$this->html .= "<div class='".($disabled ? "cntxMnuItemDisabled" : "cntxMnuItem")."' $action>";
47
+        if (substr($img, 0, 5) == 'fa fa') {
48
+            $img = '<i class="'.$img.'"></i>';
49
+        } else if (substr($img, 0, 1) != '<') {
50
+            $img = '<img src="'.$img.'" />';
51 51
         }
52
-		$this->html .= $img . '&nbsp;' . $text . '</div>';
52
+		$this->html .= $img.'&nbsp;'.$text.'</div>';
53 53
 	}
54 54
 
55
-    public function addSeparator() {
55
+    public function addSeparator(){
56 56
 		$this->html .= "
57 57
 			<div class='cntxMnuSeparator'></div>
58 58
 		";
59 59
 	}
60 60
 
61
-    public function render() {
61
+    public function render(){
62 62
 		global $ContextMenuScript;
63 63
 
64
-		$html = $ContextMenuScript . "<div id='" . $this->id . "' class='contextMenu' style='width:" . $this->width . "px; visibility:" . ($this->visible ? 'visible' : 'hidden') . "'>" . $this->html . "</div>";
64
+		$html = $ContextMenuScript."<div id='".$this->id."' class='contextMenu' style='width:".$this->width."px; visibility:".($this->visible ? 'visible' : 'hidden')."'>".$this->html."</div>";
65 65
 		$ContextMenuScript = ""; // reset css
66 66
 		return $html;
67 67
 	}
68 68
 
69
-    public function getClientScriptObject() {
70
-		return "getCntxMenu('" . $this->id . "')";
69
+    public function getClientScriptObject(){
70
+		return "getCntxMenu('".$this->id."')";
71 71
 	}
72 72
 }
73 73
 
Please login to merge, or discard this patch.
Braces   +12 added lines, -6 removed lines patch added patch discarded remove patch
@@ -3,7 +3,8 @@  discard block
 block discarded – undo
3 3
 global $ContextMenuCnt;
4 4
 $ContextMenuCnt = 0;
5 5
 
6
-class ContextMenu {
6
+class ContextMenu
7
+{
7 8
 	public $id;
8 9
     /**
9 10
      * @var string
@@ -18,7 +19,8 @@  discard block
 block discarded – undo
18 19
      */
19 20
 	public $width = 120;
20 21
 
21
-    public function __construct($id = '', $width = 120, $visible = false) {
22
+    public function __construct($id = '', $width = 120, $visible = false)
23
+    {
22 24
 		global $ContextMenuCnt;
23 25
 		$ContextMenuCnt++;
24 26
 		$this->html = "";
@@ -27,7 +29,8 @@  discard block
 block discarded – undo
27 29
 		$this->id = $id ? $id : "cntxMnu" . $ContextMenuCnt;    // set id
28 30
 	}
29 31
 
30
-    public function addItem($text, $action = "", $img = "", $disabled = 0) {
32
+    public function addItem($text, $action = "", $img = "", $disabled = 0)
33
+    {
31 34
 		global $base_url, $_style;
32 35
         if($disabled) {
33 36
             return;
@@ -52,13 +55,15 @@  discard block
 block discarded – undo
52 55
 		$this->html .= $img . '&nbsp;' . $text . '</div>';
53 56
 	}
54 57
 
55
-    public function addSeparator() {
58
+    public function addSeparator()
59
+    {
56 60
 		$this->html .= "
57 61
 			<div class='cntxMnuSeparator'></div>
58 62
 		";
59 63
 	}
60 64
 
61
-    public function render() {
65
+    public function render()
66
+    {
62 67
 		global $ContextMenuScript;
63 68
 
64 69
 		$html = $ContextMenuScript . "<div id='" . $this->id . "' class='contextMenu' style='width:" . $this->width . "px; visibility:" . ($this->visible ? 'visible' : 'hidden') . "'>" . $this->html . "</div>";
@@ -66,7 +71,8 @@  discard block
 block discarded – undo
66 71
 		return $html;
67 72
 	}
68 73
 
69
-    public function getClientScriptObject() {
74
+    public function getClientScriptObject()
75
+    {
70 76
 		return "getCntxMenu('" . $this->id . "')";
71 77
 	}
72 78
 }
Please login to merge, or discard this patch.
manager/includes/controls/phpmailer/OAuth.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -128,10 +128,10 @@
 block discarded – undo
128 128
         }
129 129
 
130 130
         return base64_encode(
131
-            'user=' .
132
-            $this->oauthUserEmail .
133
-            "\001auth=Bearer " .
134
-            $this->oauthToken .
131
+            'user='.
132
+            $this->oauthUserEmail.
133
+            "\001auth=Bearer ".
134
+            $this->oauthToken.
135 135
             "\001\001"
136 136
         );
137 137
     }
Please login to merge, or discard this patch.