Completed
Push — develop ( 8dee05 )
by Dmytro
20:08
created
core/functions/actions/import.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -357,7 +357,7 @@
 block discarded – undo
357 357
 if(!function_exists('getFileContent')) {
358 358
     /**
359 359
      * @param string $filepath
360
-     * @return bool|string
360
+     * @return null|string
361 361
      */
362 362
     function getFileContent($filepath)
363 363
     {
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -114,9 +114,9 @@
 block discarded – undo
114 114
                 $field['menuindex'] = 1;
115 115
                 $find = false;
116 116
                 foreach (array(
117
-                             'index.html',
118
-                             'index.htm'
119
-                         ) as $filename) {
117
+                                'index.html',
118
+                                'index.htm'
119
+                            ) as $filename) {
120 120
                     $filepath = $filedir . $alias . '/' . $filename;
121 121
                     if ($find === false && file_exists($filepath)) {
122 122
                         $file = getFileContent($filepath);
Please login to merge, or discard this patch.
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!function_exists('run')) {
2
+if (!function_exists('run')) {
3 3
     /**
4 4
      * @return string
5 5
      */
@@ -28,12 +28,12 @@  discard block
 block discarded – undo
28 28
             $modx->getDatabase()->query("ALTER TABLE {$tbl_site_content} AUTO_INCREMENT = 1");
29 29
         }
30 30
 
31
-        $parent = (int)$_POST['parent'];
31
+        $parent = (int) $_POST['parent'];
32 32
 
33
-        if (is_dir(MODX_BASE_PATH . 'temp/import')) {
34
-            $filedir = MODX_BASE_PATH . 'temp/import/';
35
-        } elseif (is_dir(MODX_BASE_PATH . 'assets/import')) {
36
-            $filedir = MODX_BASE_PATH . 'assets/import/';
33
+        if (is_dir(MODX_BASE_PATH.'temp/import')) {
34
+            $filedir = MODX_BASE_PATH.'temp/import/';
35
+        } elseif (is_dir(MODX_BASE_PATH.'assets/import')) {
36
+            $filedir = MODX_BASE_PATH.'assets/import/';
37 37
         } else {
38 38
             $filedir = '';
39 39
         }
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
         $files = pop_index($files);
45 45
 
46 46
         // no. of files to import
47
-        $output .= sprintf('<p>' . $_lang['import_files_found'] . '</p>', $filesfound);
47
+        $output .= sprintf('<p>'.$_lang['import_files_found'].'</p>', $filesfound);
48 48
 
49 49
         // import files
50 50
         if (0 < count($files)) {
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
         $mtime = $mtime[1] + $mtime[0];
58 58
         $importend = $mtime;
59 59
         $totaltime = ($importend - $importstart);
60
-        $output .= sprintf('<p>' . $_lang['import_site_time'] . '</p>', round($totaltime, 3));
60
+        $output .= sprintf('<p>'.$_lang['import_site_time'].'</p>', round($totaltime, 3));
61 61
 
62 62
         if ($_POST['convert_link'] == 'on') {
63 63
             convertLink();
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
     }
68 68
 }
69 69
 
70
-if(!function_exists('importFiles')) {
70
+if (!function_exists('importFiles')) {
71 71
     /**
72 72
      * @param int $parent
73 73
      * @param string $filedir
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
             if (is_array($value)) {
99 99
                 // create folder
100 100
                 $alias = $id;
101
-                printf('<span>' . $_lang['import_site_importing_document'] . '</span>', $alias);
101
+                printf('<span>'.$_lang['import_site_importing_document'].'</span>', $alias);
102 102
                 $field = array();
103 103
                 $field['type'] = 'document';
104 104
                 $field['contentType'] = 'text/html';
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
                              'index.html',
118 118
                              'index.htm'
119 119
                          ) as $filename) {
120
-                    $filepath = $filedir . $alias . '/' . $filename;
120
+                    $filepath = $filedir.$alias.'/'.$filename;
121 121
                     if ($find === false && file_exists($filepath)) {
122 122
                         $file = getFileContent($filepath);
123 123
                         list($pagetitle, $content, $description) = treatContent($file, $filename, $alias);
@@ -132,10 +132,10 @@  discard block
 block discarded – undo
132 132
                         $newid = $modx->getDatabase()->insert($field, $tbl_site_content);
133 133
                         if ($newid) {
134 134
                             $find = true;
135
-                            echo ' - <span class="success">' . $_lang['import_site_success'] . '</span><br />' . "\n";
136
-                            importFiles($newid, $filedir . $alias . '/', $value, 'sub');
135
+                            echo ' - <span class="success">'.$_lang['import_site_success'].'</span><br />'."\n";
136
+                            importFiles($newid, $filedir.$alias.'/', $value, 'sub');
137 137
                         } else {
138
-                            echo '<span class="fail">' . $_lang["import_site_failed"] . "</span> " . $_lang["import_site_failed_db_error"] . $modx->getDatabase()->getLastError();
138
+                            echo '<span class="fail">'.$_lang["import_site_failed"]."</span> ".$_lang["import_site_failed_db_error"].$modx->getDatabase()->getLastError();
139 139
                             exit;
140 140
                         }
141 141
                     }
@@ -150,10 +150,10 @@  discard block
 block discarded – undo
150 150
                     $newid = $modx->getDatabase()->insert($field, $tbl_site_content);
151 151
                     if ($newid) {
152 152
                         $find = true;
153
-                        echo ' - <span class="success">' . $_lang['import_site_success'] . '</span><br />' . "\n";
154
-                        importFiles($newid, $filedir . $alias . '/', $value, 'sub');
153
+                        echo ' - <span class="success">'.$_lang['import_site_success'].'</span><br />'."\n";
154
+                        importFiles($newid, $filedir.$alias.'/', $value, 'sub');
155 155
                     } else {
156
-                        echo '<span class="fail">' . $_lang["import_site_failed"] . "</span> " . $_lang["import_site_failed_db_error"] . $modx->getDatabase()->getLastError();
156
+                        echo '<span class="fail">'.$_lang["import_site_failed"]."</span> ".$_lang["import_site_failed_db_error"].$modx->getDatabase()->getLastError();
157 157
                         exit;
158 158
                     }
159 159
                 }
@@ -166,12 +166,12 @@  discard block
 block discarded – undo
166 166
                 $fparts = explode('.', $value);
167 167
                 $alias = $fparts[0];
168 168
                 $ext = (count($fparts) > 1) ? $fparts[count($fparts) - 1] : "";
169
-                printf("<span>" . $_lang['import_site_importing_document'] . "</span>", $filename);
169
+                printf("<span>".$_lang['import_site_importing_document']."</span>", $filename);
170 170
 
171 171
                 if (!in_array($ext, $allowedfiles)) {
172
-                    echo ' - <span class="fail">' . $_lang["import_site_skip"] . '</span><br />' . "\n";
172
+                    echo ' - <span class="fail">'.$_lang["import_site_skip"].'</span><br />'."\n";
173 173
                 } else {
174
-                    $filepath = $filedir . $filename;
174
+                    $filepath = $filedir.$filename;
175 175
                     $file = getFileContent($filepath);
176 176
                     list($pagetitle, $content, $description) = treatContent($file, $filename, $alias);
177 177
 
@@ -197,9 +197,9 @@  discard block
 block discarded – undo
197 197
                     $field['menuindex'] = ($alias == 'index') ? 0 : 2;
198 198
                     $newid = $modx->getDatabase()->insert($field, $tbl_site_content);
199 199
                     if ($newid) {
200
-                        echo ' - <span class="success">' . $_lang['import_site_success'] . '</span><br />' . "\n";
200
+                        echo ' - <span class="success">'.$_lang['import_site_success'].'</span><br />'."\n";
201 201
                     } else {
202
-                        echo '<span class="fail">' . $_lang["import_site_failed"] . "</span> " . $_lang["import_site_failed_db_error"] . $modx->getDatabase()->getLastError();
202
+                        echo '<span class="fail">'.$_lang["import_site_failed"]."</span> ".$_lang["import_site_failed_db_error"].$modx->getDatabase()->getLastError();
203 203
                         exit;
204 204
                     }
205 205
 
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
     }
219 219
 }
220 220
 
221
-if(!function_exists('getFiles')) {
221
+if (!function_exists('getFiles')) {
222 222
     /**
223 223
      * @param string $directory
224 224
      * @param array $listing
@@ -234,10 +234,10 @@  discard block
 block discarded – undo
234 234
             foreach ($files as $file) {
235 235
                 if ($file == '.' || $file == '..') {
236 236
                     continue;
237
-                } elseif ($h = @opendir($directory . $file . "/")) {
237
+                } elseif ($h = @opendir($directory.$file."/")) {
238 238
                     closedir($h);
239 239
                     $count = -1;
240
-                    $listing[$file] = getFiles($directory . $file . "/", array(), $count + 1);
240
+                    $listing[$file] = getFiles($directory.$file."/", array(), $count + 1);
241 241
                 } elseif (strpos($file, '.htm') !== false) {
242 242
                     $listing[$dummy] = $file;
243 243
                     $dummy = $dummy + 1;
@@ -245,14 +245,14 @@  discard block
 block discarded – undo
245 245
                 }
246 246
             }
247 247
         } else {
248
-            echo '<p><span class="fail">' . $_lang["import_site_failed"] . "</span> " . $_lang["import_site_failed_no_open_dir"] . $directory . ".</p>";
248
+            echo '<p><span class="fail">'.$_lang["import_site_failed"]."</span> ".$_lang["import_site_failed_no_open_dir"].$directory.".</p>";
249 249
         }
250 250
 
251 251
         return ($listing);
252 252
     }
253 253
 }
254 254
 
255
-if(!function_exists('getFileContent')) {
255
+if (!function_exists('getFileContent')) {
256 256
     /**
257 257
      * @param string $filepath
258 258
      * @return bool|string
@@ -262,14 +262,14 @@  discard block
 block discarded – undo
262 262
         global $_lang;
263 263
         // get the file
264 264
         if (!$buffer = file_get_contents($filepath)) {
265
-            echo '<p><span class="fail">' . $_lang['import_site_failed'] . "</span> " . $_lang["import_site_failed_no_retrieve_file"] . $filepath . ".</p>";
265
+            echo '<p><span class="fail">'.$_lang['import_site_failed']."</span> ".$_lang["import_site_failed_no_retrieve_file"].$filepath.".</p>";
266 266
         } else {
267 267
             return $buffer;
268 268
         }
269 269
     }
270 270
 }
271 271
 
272
-if(!function_exists('pop_index')) {
272
+if (!function_exists('pop_index')) {
273 273
     /**
274 274
      * @param array $array
275 275
      * @return array
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
     }
295 295
 }
296 296
 
297
-if(!function_exists('treatContent')) {
297
+if (!function_exists('treatContent')) {
298 298
     /**
299 299
      * @param string $src
300 300
      * @param string $filename
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
         } else {
330 330
             $content = $src;
331 331
             $s = '/(<meta[^>]+charset\s*=)[^>"\'=]+(.+>)/i';
332
-            $r = '$1' . $modx->getConfig('modx_charset') . '$2';
332
+            $r = '$1'.$modx->getConfig('modx_charset').'$2';
333 333
             $content = preg_replace($s, $r, $content);
334 334
             $content = preg_replace('@<title>.*</title>@i', "<title>[*pagetitle*]</title>", $content);
335 335
         }
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
     }
346 346
 }
347 347
 
348
-if(!function_exists('convertLink')) {
348
+if (!function_exists('convertLink')) {
349 349
     /**
350 350
      * @return void
351 351
      */
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
                     list($href, $v) = explode('"', $v, 2);
369 369
                     $_ = $href;
370 370
                     if (strpos($_, MODX_SITE_URL) !== false) {
371
-                        $_ = MODX_BASE_URL . str_replace(MODX_SITE_URL, '', $_);
371
+                        $_ = MODX_BASE_URL.str_replace(MODX_SITE_URL, '', $_);
372 372
                     }
373 373
                     if ($_[0] === '/') {
374 374
                         $_ = substr($_, 1);
@@ -395,15 +395,15 @@  discard block
 block discarded – undo
395 395
                     if (strpos($_, '/') !== false) {
396 396
                         $_ = substr($_, strrpos($_, '/'));
397 397
                     }
398
-                    $_ = $dir . str_replace('.html', '', $_);
398
+                    $_ = $dir.str_replace('.html', '', $_);
399 399
                     if (!isset($target[$_])) {
400 400
                         $target[$_] = $modx->getIdFromAlias($_);
401 401
                     }
402 402
                     $target[$_] = trim($target[$_]);
403 403
                     if (!empty($target[$_])) {
404
-                        $href = '[~' . $target[$_] . '~]';
404
+                        $href = '[~'.$target[$_].'~]';
405 405
                     }
406
-                    $array[$c] = '<a href="' . $href . '"' . $v;
406
+                    $array[$c] = '<a href="'.$href.'"'.$v;
407 407
                 }
408 408
                 $c++;
409 409
             }
Please login to merge, or discard this patch.
core/functions/preload.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@
 block discarded – undo
109 109
 
110 110
 if (!function_exists('modx_sanitize_gpc')) {
111 111
     /**
112
-     * @param array|string $values
112
+     * @param string $values
113 113
      * @param int $depth
114 114
      * @return array|string
115 115
      */
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
         $_ = crc32(__FILE__);
38 38
         $_ = sprintf('%u', $_);
39 39
 
40
-        return 'evo' . base_convert($_, 10, 36);
40
+        return 'evo'.base_convert($_, 10, 36);
41 41
     }
42 42
 }
43 43
 
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
         session_start();
64 64
         $key = "modx.mgr.session.cookie.lifetime";
65 65
         if (isset($_SESSION[$key]) && is_numeric($_SESSION[$key])) {
66
-            $cookieLifetime = (int)$_SESSION[$key];
66
+            $cookieLifetime = (int) $_SESSION[$key];
67 67
             if ($cookieLifetime) {
68 68
                 $cookieExpiration = $_SERVER['REQUEST_TIME'] + $cookieLifetime;
69 69
             }
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
     }
136 136
 }
137 137
 
138
-if (! function_exists('getSanitizedValue')) {
138
+if (!function_exists('getSanitizedValue')) {
139 139
     /**
140 140
      * @param string $value
141 141
      * @return string
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
         return $value;
165 165
     }
166 166
 }
167
-if (! function_exists('removeSanitizeSeed')) {
167
+if (!function_exists('removeSanitizeSeed')) {
168 168
     /**
169 169
      * @param string $string
170 170
      * @return string
Please login to merge, or discard this patch.
core/functions/tv.php 4 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
      *
173 173
      * @param string $param
174 174
      * @param array $tvsArray
175
-     * @return mixed
175
+     * @return string
176 176
      */
177 177
     function parseTvValues($param, $tvsArray)
178 178
     {
@@ -566,7 +566,7 @@  discard block
 block discarded – undo
566 566
     /**
567 567
      * returns an array if a delimiter is present. returns array is a recordset is present
568 568
      *
569
-     * @param $src
569
+     * @param string $src
570 570
      * @param string $delim
571 571
      * @param string $type
572 572
      * @param bool $columns
@@ -1022,7 +1022,7 @@  discard block
 block discarded – undo
1022 1022
 
1023 1023
 if (! function_exists('ParseIntputOptions')) {
1024 1024
     /**
1025
-     * @param string|array|mysqli_result $v
1025
+     * @param string $v
1026 1026
      * @return array
1027 1027
      */
1028 1028
     function ParseIntputOptions($v)
Please login to merge, or discard this patch.
Spacing   +79 added lines, -79 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (! function_exists('ProcessTVCommand')) {
3
+if (!function_exists('ProcessTVCommand')) {
4 4
     /**
5 5
      * @param string $value
6 6
      * @param string $name
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
     function ProcessTVCommand($value, $name = '', $docid = '', $src = 'docform', $tvsArray = array())
13 13
     {
14 14
         $modx = evolutionCMS();
15
-        $docid = (int)$docid > 0 ? (int)$docid : $modx->documentIdentifier;
15
+        $docid = (int) $docid > 0 ? (int) $docid : $modx->documentIdentifier;
16 16
         $nvalue = trim($value);
17 17
         if (substr($nvalue, 0, 1) != '@') {
18 18
             return $value;
@@ -77,8 +77,8 @@  discard block
 block discarded – undo
77 77
                         // if an inherited value is found and if there is content following the @INHERIT binding
78 78
                         // remove @INHERIT and output that following content. This content could contain other
79 79
                         // @ bindings, that are processed in the next step
80
-                        if ((string)$tv['value'] !== '' && !preg_match('%^@INHERIT[\s\n\r]*$%im', $tv['value'])) {
81
-                            $output = trim(str_replace('@INHERIT', '', (string)$tv['value']));
80
+                        if ((string) $tv['value'] !== '' && !preg_match('%^@INHERIT[\s\n\r]*$%im', $tv['value'])) {
81
+                            $output = trim(str_replace('@INHERIT', '', (string) $tv['value']));
82 82
                             break 2;
83 83
                         }
84 84
                     }
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 
87 87
                 case 'DIRECTORY' :
88 88
                     $files = array();
89
-                    $path = MODX_BASE_PATH . $param;
89
+                    $path = MODX_BASE_PATH.$param;
90 90
                     if (substr($path, -1, 1) != '/') {
91 91
                         $path .= '/';
92 92
                     }
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
     }
118 118
 }
119 119
 
120
-if (! function_exists('ProcessFile')) {
120
+if (!function_exists('ProcessFile')) {
121 121
     /**
122 122
      * @param $file
123 123
      * @return string
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
     }
135 135
 }
136 136
 
137
-if (! function_exists('ParseCommand')) {
137
+if (!function_exists('ParseCommand')) {
138 138
     /**
139 139
      * ParseCommand - separate @ cmd from params
140 140
      *
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 
156 156
         $binding_array = array();
157 157
         foreach ($BINDINGS as $cmd) {
158
-            if (strpos($binding_string, '@' . $cmd) === 0) {
158
+            if (strpos($binding_string, '@'.$cmd) === 0) {
159 159
                 $code = substr($binding_string, strlen($cmd) + 1);
160 160
                 $binding_array = array($cmd, trim($code));
161 161
                 break;
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
     }
167 167
 }
168 168
 
169
-if (! function_exists('parseTvValues')) {
169
+if (!function_exists('parseTvValues')) {
170 170
     /**
171 171
      * Parse Evolution CMS Template-Variables
172 172
      *
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
     }
198 198
 }
199 199
 
200
-if (! function_exists('getTVDisplayFormat')) {
200
+if (!function_exists('getTVDisplayFormat')) {
201 201
     /**
202 202
      * @param string $name
203 203
      * @param string $value
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
         $o = '';
216 216
 
217 217
         // process any TV commands in value
218
-        $docid = (int)$docid > 0 ? (int)$docid : $modx->documentIdentifier;
218
+        $docid = (int) $docid > 0 ? (int) $docid : $modx->documentIdentifier;
219 219
         $value = ProcessTVCommand($value, $name, $docid);
220 220
 
221 221
         $params = array();
@@ -254,12 +254,12 @@  discard block
 block discarded – undo
254 254
                             $attr['align'] = $params['align'];
255 255
                         }
256 256
                         foreach ($attr as $k => $v) {
257
-                            $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : '');
257
+                            $attributes .= ($v ? ' '.$k.'="'.$v.'"' : '');
258 258
                         }
259
-                        $attributes .= ' ' . $params['attrib'];
259
+                        $attributes .= ' '.$params['attrib'];
260 260
 
261 261
                         // Output the image with attributes
262
-                        $o .= '<img' . rtrim($attributes) . ' />';
262
+                        $o .= '<img'.rtrim($attributes).' />';
263 263
                     }
264 264
                 }
265 265
                 break;
@@ -331,12 +331,12 @@  discard block
 block discarded – undo
331 331
                             'target' => $params['target'],
332 332
                         );
333 333
                         foreach ($attr as $k => $v) {
334
-                            $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : '');
334
+                            $attributes .= ($v ? ' '.$k.'="'.$v.'"' : '');
335 335
                         }
336
-                        $attributes .= ' ' . $params['attrib']; // add extra
336
+                        $attributes .= ' '.$params['attrib']; // add extra
337 337
 
338 338
                         // Output the link
339
-                        $o .= '<a' . rtrim($attributes) . '>' . ($params['text'] ? $modx->getPhpCompat()->htmlspecialchars($params['text']) : $name) . '</a>';
339
+                        $o .= '<a'.rtrim($attributes).'>'.($params['text'] ? $modx->getPhpCompat()->htmlspecialchars($params['text']) : $name).'</a>';
340 340
                     }
341 341
                 }
342 342
                 break;
@@ -362,12 +362,12 @@  discard block
 block discarded – undo
362 362
                         'style' => $params['style'],
363 363
                     );
364 364
                     foreach ($attr as $k => $v) {
365
-                        $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : '');
365
+                        $attributes .= ($v ? ' '.$k.'="'.$v.'"' : '');
366 366
                     }
367
-                    $attributes .= ' ' . $params['attrib']; // add extra
367
+                    $attributes .= ' '.$params['attrib']; // add extra
368 368
 
369 369
                     // Output the HTML Tag
370
-                    $o .= '<' . $tagname . rtrim($attributes) . '>' . $tagvalue . '</' . $tagname . '>';
370
+                    $o .= '<'.$tagname.rtrim($attributes).'>'.$tagvalue.'</'.$tagname.'>';
371 371
                 }
372 372
                 break;
373 373
 
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
                 $w = $params['w'] ? $params['w'] : '100%';
377 377
                 $h = $params['h'] ? $params['h'] : '400px';
378 378
                 $richtexteditor = $params['edt'] ? $params['edt'] : "";
379
-                $o = '<div class="MODX_RichTextWidget"><textarea id="' . $id . '" name="' . $id . '" style="width:' . $w . '; height:' . $h . ';">';
379
+                $o = '<div class="MODX_RichTextWidget"><textarea id="'.$id.'" name="'.$id.'" style="width:'.$w.'; height:'.$h.';">';
380 380
                 $o .= $modx->getPhpCompat()->htmlspecialchars($value);
381 381
                 $o .= '</textarea></div>';
382 382
                 $replace_richtext = array($id);
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
 
404 404
             case "viewport":
405 405
                 $value = parseInput($value);
406
-                $id = '_' . time();
406
+                $id = '_'.time();
407 407
                 if (!$params['vpid']) {
408 408
                     $params['vpid'] = $id;
409 409
                 }
@@ -417,35 +417,35 @@  discard block
 block discarded – undo
417 417
                     $h = "100%";
418 418
                 }
419 419
                 if ($params['asize'] == 'Yes' || ($params['awidth'] == 'Yes' && $params['aheight'] == 'Yes')) {
420
-                    $autoMode = "3";  //both
420
+                    $autoMode = "3"; //both
421 421
                 } else {
422 422
                     if ($params['awidth'] == 'Yes') {
423 423
                         $autoMode = "1"; //width only
424 424
                     } else {
425 425
                         if ($params['aheight'] == 'Yes') {
426
-                            $autoMode = "2";    //height only
426
+                            $autoMode = "2"; //height only
427 427
                         }
428 428
                     }
429 429
                 }
430 430
 
431
-                $modx->regClientStartupScript(MODX_MANAGER_URL . "media/script/bin/viewport.js", array(
431
+                $modx->regClientStartupScript(MODX_MANAGER_URL."media/script/bin/viewport.js", array(
432 432
                     'name'      => 'viewport',
433 433
                     'version'   => '0',
434 434
                     'plaintext' => false
435 435
                 ));
436
-                $o = $sTag . " id='" . $params['vpid'] . "' name='" . $params['vpid'] . "' ";
436
+                $o = $sTag." id='".$params['vpid']."' name='".$params['vpid']."' ";
437 437
                 if ($params['class']) {
438
-                    $o .= " class='" . $params['class'] . "' ";
438
+                    $o .= " class='".$params['class']."' ";
439 439
                 }
440 440
                 if ($params['style']) {
441
-                    $o .= " style='" . $params['style'] . "' ";
441
+                    $o .= " style='".$params['style']."' ";
442 442
                 }
443 443
                 if ($params['attrib']) {
444
-                    $o .= $params['attrib'] . " ";
444
+                    $o .= $params['attrib']." ";
445 445
                 }
446
-                $o .= "scrolling='" . ($params['sbar'] == 'No' ? "no" : ($params['sbar'] == 'Yes' ? "yes" : "auto")) . "' ";
447
-                $o .= "src='" . $value . "' frameborder='" . $params['borsize'] . "' ";
448
-                $o .= "onload=\"window.setTimeout('ResizeViewPort(\\'" . $params['vpid'] . "\\'," . $autoMode . ")',100);\" width='" . $w . "' height='" . $h . "' ";
446
+                $o .= "scrolling='".($params['sbar'] == 'No' ? "no" : ($params['sbar'] == 'Yes' ? "yes" : "auto"))."' ";
447
+                $o .= "src='".$value."' frameborder='".$params['borsize']."' ";
448
+                $o .= "onload=\"window.setTimeout('ResizeViewPort(\\'".$params['vpid']."\\',".$autoMode.")',100);\" width='".$w."' height='".$h."' ";
449 449
                 $o .= ">";
450 450
                 $o .= $eTag;
451 451
                 break;
@@ -497,16 +497,16 @@  discard block
 block discarded – undo
497 497
                 $o = '';
498 498
                 /* If we are loading a file */
499 499
                 if (substr($params['output'], 0, 5) == "@FILE") {
500
-                    $file_name = MODX_BASE_PATH . trim(substr($params['output'], 6));
500
+                    $file_name = MODX_BASE_PATH.trim(substr($params['output'], 6));
501 501
                     if (!file_exists($file_name)) {
502
-                        $widget_output = $file_name . ' does not exist';
502
+                        $widget_output = $file_name.' does not exist';
503 503
                     } else {
504 504
                         $widget_output = file_get_contents($file_name);
505 505
                     }
506 506
                 } elseif (substr($params['output'], 0, 8) == '@INCLUDE') {
507
-                    $file_name = MODX_BASE_PATH . trim(substr($params['output'], 9));
507
+                    $file_name = MODX_BASE_PATH.trim(substr($params['output'], 9));
508 508
                     if (!file_exists($file_name)) {
509
-                        $widget_output = $file_name . ' does not exist';
509
+                        $widget_output = $file_name.' does not exist';
510 510
                     } else {
511 511
                         /* The included file needs to set $widget_output. Can be string, array, object */
512 512
                         include $file_name;
@@ -548,7 +548,7 @@  discard block
 block discarded – undo
548 548
     }
549 549
 }
550 550
 
551
-if (! function_exists('decodeParamValue')) {
551
+if (!function_exists('decodeParamValue')) {
552 552
     /**
553 553
      * @param string $s
554 554
      * @return string
@@ -561,7 +561,7 @@  discard block
 block discarded – undo
561 561
     }
562 562
 }
563 563
 
564
-if (! function_exists('parseInput')) {
564
+if (!function_exists('parseInput')) {
565 565
     /**
566 566
      * returns an array if a delimiter is present. returns array is a recordset is present
567 567
      *
@@ -593,7 +593,7 @@  discard block
 block discarded – undo
593 593
     }
594 594
 }
595 595
 
596
-if (! function_exists('getUnixtimeFromDateString')) {
596
+if (!function_exists('getUnixtimeFromDateString')) {
597 597
     /**
598 598
      * @param string $value
599 599
      * @return bool|false|int
@@ -621,7 +621,7 @@  discard block
 block discarded – undo
621 621
     }
622 622
 }
623 623
 
624
-if (! function_exists('renderFormElement')) {
624
+if (!function_exists('renderFormElement')) {
625 625
     /**
626 626
      * DISPLAY FORM ELEMENTS
627 627
      *
@@ -644,7 +644,7 @@  discard block
 block discarded – undo
644 644
         $field_style = '',
645 645
         $row = array(),
646 646
         $tvsArray = array()
647
-    ) {
647
+    ){
648 648
         $modx = evolutionCMS();
649 649
         global $_style;
650 650
         global $_lang;
@@ -664,22 +664,22 @@  discard block
 block discarded – undo
664 664
 
665 665
                 case "text": // handler for regular text boxes
666 666
                 case "rawtext"; // non-htmlentity converted text boxes
667
-                    $field_html .= '<input type="text" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $modx->getPhpCompat()->htmlspecialchars($field_value) . '" ' . $field_style . ' tvtype="' . $field_type . '" onchange="documentDirty=true;" style="width:100%" />';
667
+                    $field_html .= '<input type="text" id="tv'.$field_id.'" name="tv'.$field_id.'" value="'.$modx->getPhpCompat()->htmlspecialchars($field_value).'" '.$field_style.' tvtype="'.$field_type.'" onchange="documentDirty=true;" style="width:100%" />';
668 668
                     break;
669 669
                 case "email": // handles email input fields
670
-                    $field_html .= '<input type="email" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $modx->getPhpCompat()->htmlspecialchars($field_value) . '" ' . $field_style . ' tvtype="' . $field_type . '" onchange="documentDirty=true;" style="width:100%"/>';
670
+                    $field_html .= '<input type="email" id="tv'.$field_id.'" name="tv'.$field_id.'" value="'.$modx->getPhpCompat()->htmlspecialchars($field_value).'" '.$field_style.' tvtype="'.$field_type.'" onchange="documentDirty=true;" style="width:100%"/>';
671 671
                     break;
672 672
                 case "number": // handles the input of numbers
673
-                    $field_html .= '<input type="number" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $modx->getPhpCompat()->htmlspecialchars($field_value) . '" ' . $field_style . ' tvtype="' . $field_type . '" onchange="documentDirty=true;" style="width:100%" onkeyup="this.value=this.value.replace(/[^\d-,.+]/,\'\')"/>';
673
+                    $field_html .= '<input type="number" id="tv'.$field_id.'" name="tv'.$field_id.'" value="'.$modx->getPhpCompat()->htmlspecialchars($field_value).'" '.$field_style.' tvtype="'.$field_type.'" onchange="documentDirty=true;" style="width:100%" onkeyup="this.value=this.value.replace(/[^\d-,.+]/,\'\')"/>';
674 674
                     break;
675 675
                 case "textareamini": // handler for textarea mini boxes
676
-                    $field_html .= '<textarea id="tv' . $field_id . '" name="tv' . $field_id . '" cols="40" rows="5" onchange="documentDirty=true;" style="width:100%">' . $modx->getPhpCompat()->htmlspecialchars($field_value) . '</textarea>';
676
+                    $field_html .= '<textarea id="tv'.$field_id.'" name="tv'.$field_id.'" cols="40" rows="5" onchange="documentDirty=true;" style="width:100%">'.$modx->getPhpCompat()->htmlspecialchars($field_value).'</textarea>';
677 677
                     break;
678 678
                 case "textarea": // handler for textarea boxes
679 679
                 case "rawtextarea": // non-htmlentity convertex textarea boxes
680 680
                 case "htmlarea": // handler for textarea boxes (deprecated)
681 681
                 case "richtext": // handler for textarea boxes
682
-                    $field_html .= '<textarea id="tv' . $field_id . '" name="tv' . $field_id . '" cols="40" rows="15" onchange="documentDirty=true;" style="width:100%">' . $modx->getPhpCompat()->htmlspecialchars($field_value) . '</textarea>';
682
+                    $field_html .= '<textarea id="tv'.$field_id.'" name="tv'.$field_id.'" cols="40" rows="15" onchange="documentDirty=true;" style="width:100%">'.$modx->getPhpCompat()->htmlspecialchars($field_value).'</textarea>';
683 683
                     break;
684 684
                 case "date":
685 685
                     $field_id = str_replace(array(
@@ -689,48 +689,48 @@  discard block
 block discarded – undo
689 689
                     if ($field_value == '') {
690 690
                         $field_value = 0;
691 691
                     }
692
-                    $field_html .= '<input id="tv' . $field_id . '" name="tv' . $field_id . '" class="DatePicker" type="text" value="' . ($field_value == 0 || !isset($field_value) ? "" : $field_value) . '" onblur="documentDirty=true;" />';
693
-                    $field_html .= ' <a onclick="document.forms[\'mutate\'].elements[\'tv' . $field_id . '\'].value=\'\';document.forms[\'mutate\'].elements[\'tv' . $field_id . '\'].onblur(); return true;" onmouseover="window.status=\'clear the date\'; return true;" onmouseout="window.status=\'\'; return true;" style="cursor:pointer; cursor:hand"><i class="' . $_style["actions_calendar_delete"] . '"></i></a>';
692
+                    $field_html .= '<input id="tv'.$field_id.'" name="tv'.$field_id.'" class="DatePicker" type="text" value="'.($field_value == 0 || !isset($field_value) ? "" : $field_value).'" onblur="documentDirty=true;" />';
693
+                    $field_html .= ' <a onclick="document.forms[\'mutate\'].elements[\'tv'.$field_id.'\'].value=\'\';document.forms[\'mutate\'].elements[\'tv'.$field_id.'\'].onblur(); return true;" onmouseover="window.status=\'clear the date\'; return true;" onmouseout="window.status=\'\'; return true;" style="cursor:pointer; cursor:hand"><i class="'.$_style["actions_calendar_delete"].'"></i></a>';
694 694
 
695 695
                     break;
696 696
                 case "dropdown": // handler for select boxes
697
-                    $field_html .= '<select id="tv' . $field_id . '" name="tv' . $field_id . '" size="1" onchange="documentDirty=true;">';
697
+                    $field_html .= '<select id="tv'.$field_id.'" name="tv'.$field_id.'" size="1" onchange="documentDirty=true;">';
698 698
                     $index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform',
699 699
                         $tvsArray));
700
-                    foreach($index_list as $item => $itemvalue) {
700
+                    foreach ($index_list as $item => $itemvalue) {
701 701
                         list($item, $itemvalue) = (is_array($itemvalue)) ? $itemvalue : explode("==", $itemvalue);
702 702
                         if (strlen($itemvalue) == 0) {
703 703
                             $itemvalue = $item;
704 704
                         }
705
-                        $field_html .= '<option value="' . $modx->getPhpCompat()->htmlspecialchars($itemvalue) . '"' . ($itemvalue == $field_value ? ' selected="selected"' : '') . '>' . $modx->getPhpCompat()->htmlspecialchars($item) . '</option>';
705
+                        $field_html .= '<option value="'.$modx->getPhpCompat()->htmlspecialchars($itemvalue).'"'.($itemvalue == $field_value ? ' selected="selected"' : '').'>'.$modx->getPhpCompat()->htmlspecialchars($item).'</option>';
706 706
                     }
707 707
                     $field_html .= "</select>";
708 708
                     break;
709 709
                 case "listbox": // handler for select boxes
710
-                    $field_html .= '<select id="tv' . $field_id . '" name="tv' . $field_id . '" onchange="documentDirty=true;" size="8">';
710
+                    $field_html .= '<select id="tv'.$field_id.'" name="tv'.$field_id.'" onchange="documentDirty=true;" size="8">';
711 711
                     $index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform',
712 712
                         $tvsArray));
713
-                    foreach($index_list as $item => $itemvalue) {
713
+                    foreach ($index_list as $item => $itemvalue) {
714 714
                         list($item, $itemvalue) = (is_array($itemvalue)) ? $itemvalue : explode("==", $itemvalue);
715 715
                         if (strlen($itemvalue) == 0) {
716 716
                             $itemvalue = $item;
717 717
                         }
718
-                        $field_html .= '<option value="' . $modx->getPhpCompat()->htmlspecialchars($itemvalue) . '"' . ($itemvalue == $field_value ? ' selected="selected"' : '') . '>' . $modx->getPhpCompat()->htmlspecialchars($item) . '</option>';
718
+                        $field_html .= '<option value="'.$modx->getPhpCompat()->htmlspecialchars($itemvalue).'"'.($itemvalue == $field_value ? ' selected="selected"' : '').'>'.$modx->getPhpCompat()->htmlspecialchars($item).'</option>';
719 719
                     }
720 720
                     $field_html .= "</select>";
721 721
                     break;
722 722
                 case "listbox-multiple": // handler for select boxes where you can choose multiple items
723 723
                     $field_value = explode("||", $field_value);
724
-                    $field_html .= '<select id="tv' . $field_id . '" name="tv' . $field_id . '[]" multiple="multiple" onchange="documentDirty=true;" size="8">';
724
+                    $field_html .= '<select id="tv'.$field_id.'" name="tv'.$field_id.'[]" multiple="multiple" onchange="documentDirty=true;" size="8">';
725 725
                     $index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform',
726 726
                         $tvsArray));
727
-                    foreach($index_list as $item => $itemvalue) {
727
+                    foreach ($index_list as $item => $itemvalue) {
728 728
                         list($item, $itemvalue) = (is_array($itemvalue)) ? $itemvalue : explode("==", $itemvalue);
729 729
                         if (strlen($itemvalue) == 0) {
730 730
                             $itemvalue = $item;
731 731
                         }
732
-                        $field_html .= '<option value="' . $modx->getPhpCompat()->htmlspecialchars($itemvalue) . '"' . (in_array($itemvalue,
733
-                                $field_value) ? ' selected="selected"' : '') . '>' . $modx->getPhpCompat()->htmlspecialchars($item) . '</option>';
732
+                        $field_html .= '<option value="'.$modx->getPhpCompat()->htmlspecialchars($itemvalue).'"'.(in_array($itemvalue,
733
+                                $field_value) ? ' selected="selected"' : '').'>'.$modx->getPhpCompat()->htmlspecialchars($item).'</option>';
734 734
                     }
735 735
                     $field_html .= "</select>";
736 736
                     break;
@@ -742,17 +742,17 @@  discard block
 block discarded – undo
742 742
                         'ftp://'   => 'ftp://',
743 743
                         'mailto:'  => 'mailto:'
744 744
                     );
745
-                    $field_html = '<table border="0" cellspacing="0" cellpadding="0"><tr><td><select id="tv' . $field_id . '_prefix" name="tv' . $field_id . '_prefix" onchange="documentDirty=true;">';
745
+                    $field_html = '<table border="0" cellspacing="0" cellpadding="0"><tr><td><select id="tv'.$field_id.'_prefix" name="tv'.$field_id.'_prefix" onchange="documentDirty=true;">';
746 746
                     foreach ($urls as $k => $v) {
747 747
                         if (strpos($field_value, $v) === false) {
748
-                            $field_html .= '<option value="' . $v . '">' . $k . '</option>';
748
+                            $field_html .= '<option value="'.$v.'">'.$k.'</option>';
749 749
                         } else {
750 750
                             $field_value = str_replace($v, '', $field_value);
751
-                            $field_html .= '<option value="' . $v . '" selected="selected">' . $k . '</option>';
751
+                            $field_html .= '<option value="'.$v.'" selected="selected">'.$k.'</option>';
752 752
                         }
753 753
                     }
754 754
                     $field_html .= '</select></td><td>';
755
-                    $field_html .= '<input type="text" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $modx->getPhpCompat()->htmlspecialchars($field_value) . '" width="100" ' . $field_style . ' onchange="documentDirty=true;" /></td></tr></table>';
755
+                    $field_html .= '<input type="text" id="tv'.$field_id.'" name="tv'.$field_id.'" value="'.$modx->getPhpCompat()->htmlspecialchars($field_value).'" width="100" '.$field_style.' onchange="documentDirty=true;" /></td></tr></table>';
756 756
                     break;
757 757
                 case 'checkbox': // handles check boxes
758 758
                     $values = !is_array($field_value) ? explode('||', $field_value) : $field_value;
@@ -789,12 +789,12 @@  discard block
 block discarded – undo
789 789
                     $index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform',
790 790
                         $tvsArray));
791 791
                     static $i = 0;
792
-                    foreach($index_list as $item => $itemvalue) {
792
+                    foreach ($index_list as $item => $itemvalue) {
793 793
                         list($item, $itemvalue) = (is_array($itemvalue)) ? $itemvalue : explode("==", $itemvalue);
794 794
                         if (strlen($itemvalue) == 0) {
795 795
                             $itemvalue = $item;
796 796
                         }
797
-                        $field_html .= '<input type="radio" value="' . $modx->getPhpCompat()->htmlspecialchars($itemvalue) . '" id="tv_' . $i . '" name="tv' . $field_id . '" ' . ($itemvalue == $field_value ? 'checked="checked"' : '') . ' onchange="documentDirty=true;" /><label for="tv_' . $i . '" class="radio">' . $item . '</label><br />';
797
+                        $field_html .= '<input type="radio" value="'.$modx->getPhpCompat()->htmlspecialchars($itemvalue).'" id="tv_'.$i.'" name="tv'.$field_id.'" '.($itemvalue == $field_value ? 'checked="checked"' : '').' onchange="documentDirty=true;" /><label for="tv_'.$i.'" class="radio">'.$item.'</label><br />';
798 798
                         $i++;
799 799
                     }
800 800
                     break;
@@ -824,13 +824,13 @@  discard block
 block discarded – undo
824 824
 									lastImageCtrl = ctrl;
825 825
 									var w = screen.width * 0.5;
826 826
 									var h = screen.height * 0.5;
827
-									OpenServerBrowser('" . MODX_MANAGER_URL . "media/browser/{$which_browser}/browser.php?Type=images', w, h);
827
+									OpenServerBrowser('" . MODX_MANAGER_URL."media/browser/{$which_browser}/browser.php?Type=images', w, h);
828 828
 								}
829 829
 								function BrowseFileServer(ctrl) {
830 830
 									lastFileCtrl = ctrl;
831 831
 									var w = screen.width * 0.5;
832 832
 									var h = screen.height * 0.5;
833
-									OpenServerBrowser('" . MODX_MANAGER_URL . "media/browser/{$which_browser}/browser.php?Type=files', w, h);
833
+									OpenServerBrowser('".MODX_MANAGER_URL."media/browser/{$which_browser}/browser.php?Type=files', w, h);
834 834
 								}
835 835
 								function SetUrlChange(el) {
836 836
 									if ('createEvent' in document) {
@@ -864,7 +864,7 @@  discard block
 block discarded – undo
864 864
 						</script>";
865 865
                         $ResourceManagerLoaded = true;
866 866
                     }
867
-                    $field_html .= '<input type="text" id="tv' . $field_id . '" name="tv' . $field_id . '"  value="' . $field_value . '" ' . $field_style . ' onchange="documentDirty=true;" /><input type="button" value="' . $_lang['insert'] . '" onclick="BrowseServer(\'tv' . $field_id . '\')" />';
867
+                    $field_html .= '<input type="text" id="tv'.$field_id.'" name="tv'.$field_id.'"  value="'.$field_value.'" '.$field_style.' onchange="documentDirty=true;" /><input type="button" value="'.$_lang['insert'].'" onclick="BrowseServer(\'tv'.$field_id.'\')" />';
868 868
                     break;
869 869
                 case "file": // handles the input of file uploads
870 870
                     /* Modified by Timon for use with resource browser */
@@ -894,13 +894,13 @@  discard block
 block discarded – undo
894 894
 									lastImageCtrl = ctrl;
895 895
 									var w = screen.width * 0.5;
896 896
 									var h = screen.height * 0.5;
897
-									OpenServerBrowser('" . MODX_MANAGER_URL . "media/browser/{$which_browser}/browser.php?Type=images', w, h);
897
+									OpenServerBrowser('" . MODX_MANAGER_URL."media/browser/{$which_browser}/browser.php?Type=images', w, h);
898 898
 								}
899 899
 								function BrowseFileServer(ctrl) {
900 900
 									lastFileCtrl = ctrl;
901 901
 									var w = screen.width * 0.5;
902 902
 									var h = screen.height * 0.5;
903
-									OpenServerBrowser('" . MODX_MANAGER_URL . "media/browser/{$which_browser}/browser.php?Type=files', w, h);
903
+									OpenServerBrowser('".MODX_MANAGER_URL."media/browser/{$which_browser}/browser.php?Type=files', w, h);
904 904
 								}
905 905
 								function SetUrlChange(el) {
906 906
 									if ('createEvent' in document) {
@@ -934,7 +934,7 @@  discard block
 block discarded – undo
934 934
 						</script>";
935 935
                         $ResourceManagerLoaded = true;
936 936
                     }
937
-                    $field_html .= '<input type="text" id="tv' . $field_id . '" name="tv' . $field_id . '"  value="' . $field_value . '" ' . $field_style . ' onchange="documentDirty=true;" /><input type="button" value="' . $_lang['insert'] . '" onclick="BrowseFileServer(\'tv' . $field_id . '\')" />';
937
+                    $field_html .= '<input type="text" id="tv'.$field_id.'" name="tv'.$field_id.'"  value="'.$field_value.'" '.$field_style.' onchange="documentDirty=true;" /><input type="button" value="'.$_lang['insert'].'" onclick="BrowseFileServer(\'tv'.$field_id.'\')" />';
938 938
 
939 939
                     break;
940 940
 
@@ -942,16 +942,16 @@  discard block
 block discarded – undo
942 942
                     $custom_output = '';
943 943
                     /* If we are loading a file */
944 944
                     if (substr($field_elements, 0, 5) == "@FILE") {
945
-                        $file_name = MODX_BASE_PATH . trim(substr($field_elements, 6));
945
+                        $file_name = MODX_BASE_PATH.trim(substr($field_elements, 6));
946 946
                         if (!file_exists($file_name)) {
947
-                            $custom_output = $file_name . ' does not exist';
947
+                            $custom_output = $file_name.' does not exist';
948 948
                         } else {
949 949
                             $custom_output = file_get_contents($file_name);
950 950
                         }
951 951
                     } elseif (substr($field_elements, 0, 8) == '@INCLUDE') {
952
-                        $file_name = MODX_BASE_PATH . trim(substr($field_elements, 9));
952
+                        $file_name = MODX_BASE_PATH.trim(substr($field_elements, 9));
953 953
                         if (!file_exists($file_name)) {
954
-                            $custom_output = $file_name . ' does not exist';
954
+                            $custom_output = $file_name.' does not exist';
955 955
                         } else {
956 956
                             ob_start();
957 957
                             include $file_name;
@@ -962,7 +962,7 @@  discard block
 block discarded – undo
962 962
                         $chunk_name = trim(substr($field_elements, 7));
963 963
                         $chunk_body = $modx->getChunk($chunk_name);
964 964
                         if ($chunk_body == false) {
965
-                            $custom_output = $_lang['chunk_no_exist'] . '(' . $_lang['htmlsnippet_name'] . ':' . $chunk_name . ')';
965
+                            $custom_output = $_lang['chunk_no_exist'].'('.$_lang['htmlsnippet_name'].':'.$chunk_name.')';
966 966
                         } else {
967 967
                             $custom_output = $chunk_body;
968 968
                         }
@@ -987,15 +987,15 @@  discard block
 block discarded – undo
987 987
                     break;
988 988
 
989 989
                 default: // the default handler -- for errors, mostly
990
-                    $field_html .= '<input type="text" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $modx->getPhpCompat()->htmlspecialchars($field_value) . '" ' . $field_style . ' onchange="documentDirty=true;" />';
990
+                    $field_html .= '<input type="text" id="tv'.$field_id.'" name="tv'.$field_id.'" value="'.$modx->getPhpCompat()->htmlspecialchars($field_value).'" '.$field_style.' onchange="documentDirty=true;" />';
991 991
 
992 992
             } // end switch statement
993 993
         } else {
994 994
             $custom = explode(":", $field_type);
995 995
             $custom_output = '';
996
-            $file_name = MODX_BASE_PATH . 'assets/tvs/' . $custom['1'] . '/' . $custom['1'] . '.customtv.php';
996
+            $file_name = MODX_BASE_PATH.'assets/tvs/'.$custom['1'].'/'.$custom['1'].'.customtv.php';
997 997
             if (!file_exists($file_name)) {
998
-                $custom_output = $file_name . ' does not exist';
998
+                $custom_output = $file_name.' does not exist';
999 999
             } else {
1000 1000
                 ob_start();
1001 1001
                 include $file_name;
@@ -1019,7 +1019,7 @@  discard block
 block discarded – undo
1019 1019
     } // end renderFormElement function
1020 1020
 }
1021 1021
 
1022
-if (! function_exists('ParseIntputOptions')) {
1022
+if (!function_exists('ParseIntputOptions')) {
1023 1023
     /**
1024 1024
      * @param string|array|mysqli_result $v
1025 1025
      * @return array
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -573,7 +573,8 @@
 block discarded – undo
573 573
      * @return array|string
574 574
      */
575 575
     function parseInput($src, $delim = "||", $type = "string", $columns = true)
576
-    { // type can be: string, array
576
+    {
577
+// type can be: string, array
577 578
         $modx = evolutionCMS();
578 579
         if ($modx->getDatabase()->isResult($src)) {
579 580
             // must be a recordset
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
                         $modx->setPlaceholder($rvKey, $rvValue);
52 52
                     }
53 53
                     $param = $modx->mergePlaceholderContent($param);
54
-                    $rs = $modx->getDatabase()->query("SELECT $param;");
54
+                    $rs = $modx->getDatabase()->query("select $param;");
55 55
                     $output = $rs;
56 56
                     break;
57 57
 
Please login to merge, or discard this patch.
core/src/AbstractLaravel.php 4 patches
Doc Comments   +14 added lines, -1 removed lines patch added patch discarded remove patch
@@ -119,12 +119,18 @@  discard block
 block discarded – undo
119 119
 
120 120
     protected $evolutionProperty = [];
121 121
 
122
+    /**
123
+     * @param string $data
124
+     */
122 125
     abstract public function getVersionData($data = null);
126
+
127
+    /**
128
+     * @param integer $default
129
+     */
123 130
     abstract public function getConfig($name = '', $default = null);
124 131
     abstract public function bootstrapPath($path = '');
125 132
 
126 133
     /**
127
-     * @param array $classes
128 134
      */
129 135
     public function __construct()
130 136
     {
@@ -168,6 +174,10 @@  discard block
 block discarded – undo
168 174
         $this->boot();
169 175
     }
170 176
 
177
+    /**
178
+     * @param Repository $config
179
+     * @param string $dir
180
+     */
171 181
     protected function loadConfiguration($config, $dir)
172 182
     {
173 183
         $files = [];
@@ -562,6 +572,9 @@  discard block
 block discarded – undo
562 572
         }
563 573
     }
564 574
 
575
+    /**
576
+     * @param string $name
577
+     */
565 578
     public function getService($name)
566 579
     {
567 580
         return $this->get($name);
Please login to merge, or discard this patch.
Unused Use Statements   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,18 +1,18 @@
 block discarded – undo
1 1
 <?php namespace EvolutionCMS;
2 2
 
3 3
 use EvolutionCMS\Interfaces\DatabaseInterface;
4
-use Illuminate\Support\Arr;
5
-use Illuminate\Support\Str;
6
-use Illuminate\Support\Collection;
4
+use Illuminate\Config\Repository;
7 5
 use Illuminate\Container\Container;
8 6
 use Illuminate\Contracts\Foundation\Application as ApplicationContract;
9 7
 use Illuminate\Events\EventServiceProvider;
10 8
 use Illuminate\Filesystem\Filesystem;
9
+use Illuminate\Log\LogServiceProvider;
10
+use Illuminate\Support\Arr;
11
+use Illuminate\Support\Collection;
11 12
 use Illuminate\Support\Facades\Facade;
12 13
 use Illuminate\Support\ServiceProvider;
13
-use Illuminate\Config\Repository;
14
+use Illuminate\Support\Str;
14 15
 use Symfony\Component\Finder\Finder;
15
-use Illuminate\Log\LogServiceProvider;
16 16
 
17 17
 abstract class AbstractLaravel extends Container implements ApplicationContract
18 18
 {
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -140,8 +140,8 @@  discard block
 block discarded – undo
140 140
         $items = [];
141 141
         $this->instance('config', $config = new Repository($items));
142 142
 
143
-        $this->loadConfiguration($config, EVO_CORE_PATH . 'config');
144
-        $this->loadConfiguration($config, EVO_CORE_PATH . 'custom/config');
143
+        $this->loadConfiguration($config, EVO_CORE_PATH.'config');
144
+        $this->loadConfiguration($config, EVO_CORE_PATH.'custom/config');
145 145
 
146 146
         if (null === $this['config']->get('app')) {
147 147
             throw new \Exception('Unable to load the "app" configuration file.');
@@ -180,9 +180,9 @@  discard block
 block discarded – undo
180 180
             foreach (Finder::create()->files()->name('*.php')->in($configPath) as $file) {
181 181
                 $directory = $file->getPath();
182 182
                 if ($directory = trim(str_replace($configPath, '', $directory), DIRECTORY_SEPARATOR)) {
183
-                    $directory = str_replace(DIRECTORY_SEPARATOR, '.', $directory) . '.';
183
+                    $directory = str_replace(DIRECTORY_SEPARATOR, '.', $directory).'.';
184 184
                 }
185
-                $files[$directory . basename($file->getRealPath(), '.php')] = $file->getRealPath();
185
+                $files[$directory.basename($file->getRealPath(), '.php')] = $file->getRealPath();
186 186
             }
187 187
             ksort($files, SORT_NATURAL);
188 188
 
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
      */
230 230
     public function isDownForMaintenance()
231 231
     {
232
-        return (int)$this->getConfig('site_status', 0) === 0;
232
+        return (int) $this->getConfig('site_status', 0) === 0;
233 233
     }
234 234
 
235 235
     /**
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
     {
243 243
         $name = is_string($provider) ? $provider : get_class($provider);
244 244
 
245
-        return Arr::where($this->serviceProviders, function ($value) use ($name) {
245
+        return Arr::where($this->serviceProviders, function($value) use ($name) {
246 246
             return $value instanceof $name;
247 247
         });
248 248
     }
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
     public function registerConfiguredProviders()
277 277
     {
278 278
         $providers = Collection::make($this['config']->get('app.providers'))
279
-            ->partition(function ($provider) {
279
+            ->partition(function($provider){
280 280
                 return Str::startsWith($provider, 'Illuminate\\');
281 281
             });
282 282
         (new ProviderRepository($this, new Filesystem, $this->getCachedServicesPath()))
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
      */
289 289
     public function register($provider, $options = [], $force = false)
290 290
     {
291
-        if (($registered = $this->getProvider($provider)) && ! $force) {
291
+        if (($registered = $this->getProvider($provider)) && !$force) {
292 292
             return $registered;
293 293
         }
294 294
         // If the given "provider" is a string, we will resolve it, passing in the
@@ -358,14 +358,14 @@  discard block
 block discarded – undo
358 358
      */
359 359
     public function loadDeferredProvider($service)
360 360
     {
361
-        if (! isset($this->deferredServices[$service])) {
361
+        if (!isset($this->deferredServices[$service])) {
362 362
             return;
363 363
         }
364 364
         $provider = $this->deferredServices[$service];
365 365
         // If the service provider has not already been loaded and registered we can
366 366
         // register it with the application and remove the service from this list
367 367
         // of deferred services, since it will already be loaded on subsequent.
368
-        if (! isset($this->loadedProviders[$provider])) {
368
+        if (!isset($this->loadedProviders[$provider])) {
369 369
             $this->registerDeferredProvider($provider, $service);
370 370
         }
371 371
     }
@@ -382,8 +382,8 @@  discard block
 block discarded – undo
382 382
             unset($this->deferredServices[$service]);
383 383
         }
384 384
         $this->register($instance = new $provider($this));
385
-        if (! $this->booted) {
386
-            $this->booting(function () use ($instance) {
385
+        if (!$this->booted) {
386
+            $this->booting(function() use ($instance) {
387 387
                 $this->bootProvider($instance);
388 388
             });
389 389
         }
@@ -441,7 +441,7 @@  discard block
 block discarded – undo
441 441
     public function make($abstract, array $parameters = [])
442 442
     {
443 443
         $abstract = $this->getAlias($abstract);
444
-        if (isset($this->deferredServices[$abstract]) && ! isset($this->instances[$abstract])) {
444
+        if (isset($this->deferredServices[$abstract]) && !isset($this->instances[$abstract])) {
445 445
             $this->loadDeferredProvider($abstract);
446 446
         }
447 447
         return parent::make($abstract, $parameters);
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
         // for any listeners that need to do work after this initial booting gets
486 486
         // finished. This is useful when ordering the boot-up processes we run.
487 487
         $this->fireAppCallbacks($this->bootingCallbacks);
488
-        array_walk($this->serviceProviders, function ($provider) {
488
+        array_walk($this->serviceProviders, function($provider){
489 489
             $this->bootProvider($provider);
490 490
         });
491 491
         $this->booted = true;
Please login to merge, or discard this patch.
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
     {
243 243
         $name = is_string($provider) ? $provider : get_class($provider);
244 244
 
245
-        return Arr::where($this->serviceProviders, function ($value) use ($name) {
245
+        return Arr::where($this->serviceProviders, function ($value) use ($name){
246 246
             return $value instanceof $name;
247 247
         });
248 248
     }
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
     public function registerConfiguredProviders()
277 277
     {
278 278
         $providers = Collection::make($this['config']->get('app.providers'))
279
-            ->partition(function ($provider) {
279
+            ->partition(function ($provider){
280 280
                 return Str::startsWith($provider, 'Illuminate\\');
281 281
             });
282 282
         (new ProviderRepository($this, new Filesystem, $this->getCachedServicesPath()))
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
         }
384 384
         $this->register($instance = new $provider($this));
385 385
         if (! $this->booted) {
386
-            $this->booting(function () use ($instance) {
386
+            $this->booting(function () use ($instance){
387 387
                 $this->bootProvider($instance);
388 388
             });
389 389
         }
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
         // for any listeners that need to do work after this initial booting gets
486 486
         // finished. This is useful when ordering the boot-up processes we run.
487 487
         $this->fireAppCallbacks($this->bootingCallbacks);
488
-        array_walk($this->serviceProviders, function ($provider) {
488
+        array_walk($this->serviceProviders, function ($provider){
489 489
             $this->bootProvider($provider);
490 490
         });
491 491
         $this->booted = true;
Please login to merge, or discard this patch.
core/src/AliasLoader.php 2 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,6 @@
 block discarded – undo
41 41
      * Get or create the singleton alias loader instance.
42 42
      *
43 43
      * @param  array  $aliases
44
-     * @param string $cachedPath
45 44
      * @return AliasLoader
46 45
      */
47 46
     public static function getInstance(array $aliases = [])
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
      */
88 88
     protected function ensureFacadeExists($alias)
89 89
     {
90
-        if (file_exists($path = EVO_CORE_PATH . 'cache/facade-'.sha1($alias).'.php')) {
90
+        if (file_exists($path = EVO_CORE_PATH.'cache/facade-'.sha1($alias).'.php')) {
91 91
             return $path;
92 92
         }
93 93
         file_put_contents($path, $this->formatFacadeStub(
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
      */
132 132
     public function register()
133 133
     {
134
-        if (! $this->registered) {
134
+        if (!$this->registered) {
135 135
             $this->prependToLoaderStack();
136 136
             $this->registered = true;
137 137
         }
Please login to merge, or discard this patch.
core/src/Console.php 1 patch
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1 1
 <?php namespace EvolutionCMS;
2 2
 
3 3
 use Illuminate\Console\Application as Artisan;
4
+use Illuminate\Console\Events;
4 5
 use Illuminate\Contracts\Container\Container;
5 6
 use Illuminate\Contracts\Events\Dispatcher;
6
-use Illuminate\Console\Events;
7 7
 use Symfony\Component\Console\Application as SymfonyApplication;
8 8
 
9 9
 class Console extends Artisan
Please login to merge, or discard this patch.
core/src/Console/VendorPublishCommand.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@
 block discarded – undo
106 106
     /**
107 107
      * The choices available via the prompt.
108 108
      *
109
-     * @return array
109
+     * @return string[]
110 110
      */
111 111
     protected function publishableChoices()
112 112
     {
Please login to merge, or discard this patch.
Unused Use Statements   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php namespace EvolutionCMS\Console;
2 2
 
3
-use Illuminate\Support\Arr;
4 3
 use Illuminate\Console\Command;
5
-use League\Flysystem\MountManager;
6 4
 use Illuminate\Filesystem\Filesystem;
5
+use Illuminate\Support\Arr;
7 6
 use Illuminate\Support\ServiceProvider;
8
-use League\Flysystem\Filesystem as Flysystem;
9 7
 use League\Flysystem\Adapter\Local as LocalAdapter;
8
+use League\Flysystem\Filesystem as Flysystem;
9
+use League\Flysystem\MountManager;
10 10
 
11 11
 /**
12 12
  * @see: https://github.com/laravel-zero/foundation/blob/5.6/src/Illuminate/Foundation/Console/VendorPublishCommand.php
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
         list($this->provider, $this->tags) = [
84 84
             $this->option('provider'), (array) $this->option('tag'),
85 85
         ];
86
-        if (! $this->provider && ! $this->tags) {
86
+        if (!$this->provider && !$this->tags) {
87 87
             $this->promptForProviderOrTag();
88 88
         }
89 89
     }
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
      */
181 181
     protected function publishFile($from, $to)
182 182
     {
183
-        if (! $this->files->exists($to) || $this->option('force')) {
183
+        if (!$this->files->exists($to) || $this->option('force')) {
184 184
             $this->createParentDirectory(dirname($to));
185 185
             $this->files->copy($from, $to);
186 186
             $this->status($from, $to, 'File');
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
     protected function moveManagedFiles($manager)
211 211
     {
212 212
         foreach ($manager->listContents('from://', true) as $file) {
213
-            if ($file['type'] === 'file' && (! $manager->has('to://'.$file['path']) || $this->option('force'))) {
213
+            if ($file['type'] === 'file' && (!$manager->has('to://'.$file['path']) || $this->option('force'))) {
214 214
                 $manager->put('to://'.$file['path'], $manager->read('from://'.$file['path']));
215 215
             }
216 216
         }
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
      */
224 224
     protected function createParentDirectory($directory)
225 225
     {
226
-        if (! $this->files->isDirectory($directory)) {
226
+        if (!$this->files->isDirectory($directory)) {
227 227
             $this->files->makeDirectory($directory, 0755, true);
228 228
         }
229 229
     }
Please login to merge, or discard this patch.
core/src/Console/ViewClearCommand.php 2 patches
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 block discarded – undo
1 1
 <?php namespace EvolutionCMS\Console;
2 2
 
3
-use RuntimeException;
4 3
 use Illuminate\Console\Command;
5 4
 use Illuminate\Filesystem\Filesystem;
5
+use RuntimeException;
6 6
 
7 7
 /**
8 8
  * @see: https://github.com/laravel-zero/foundation/blob/5.6/src/Illuminate/Foundation/Console/ViewClearCommand.php
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
     public function handle()
47 47
     {
48 48
         $path = $this->laravel['config']['view.compiled'];
49
-        if (! $path) {
49
+        if (!$path) {
50 50
             throw new RuntimeException('View path not found.');
51 51
         }
52 52
         foreach ($this->files->glob("{$path}/*") as $view) {
Please login to merge, or discard this patch.
core/src/Controllers/AbstractController.php 3 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -43,6 +43,7 @@
 block discarded – undo
43 43
 
44 44
     /**
45 45
      * {@inheritdoc}
46
+     * @param string $view
46 47
      */
47 48
     public function setView($view) : bool
48 49
     {
Please login to merge, or discard this patch.
Unused Use Statements   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,9 +1,8 @@
 block discarded – undo
1 1
 <?php namespace EvolutionCMS\Controllers;
2 2
 
3
-use EvolutionCMS\Interfaces\ManagerTheme\ControllerInterface;
4 3
 use EvolutionCMS\Interfaces\ManagerThemeInterface;
4
+use EvolutionCMS\Interfaces\ManagerTheme\ControllerInterface;
5 5
 use View;
6
-use Illuminate\Contracts\View\View as ViewContract;
7 6
 
8 7
 abstract class AbstractController implements ControllerInterface
9 8
 {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -112,6 +112,6 @@
 block discarded – undo
112 112
      */
113 113
     public function getElementId(): int
114 114
     {
115
-        return (int)get_by_key($_REQUEST, 'id', 0, 'is_scalar');
115
+        return (int) get_by_key($_REQUEST, 'id', 0, 'is_scalar');
116 116
     }
117 117
 }
Please login to merge, or discard this patch.