Completed
Push — develop ( 524d8a...6df80e )
by Maxim
27s
created
manager/includes/src/Database.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
         $pre = null,
34 34
         $charset = '',
35 35
         $connection_method = 'SET CHARACTER SET'
36
-    ) {
36
+    ){
37 37
         $this->config['host'] = $host ? $host : $GLOBALS['database_server'];
38 38
         $this->config['dbase'] = $dbase ? $dbase : $GLOBALS['dbase'];
39 39
         $this->config['user'] = $uid ? $uid : $GLOBALS['database_user'];
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
                         $ua = $modx->getPhpCompat()->htmlspecialchars($_SERVER['HTTP_USER_AGENT']);
83 83
                         $referer = $modx->getPhpCompat()->htmlspecialchars($_SERVER['HTTP_REFERER']);
84 84
                         $modx->sendmail(array(
85
-                            'subject' => 'Missing to create the database connection! from ' . $modx->getPhpCompat()->entities($modx->config['site_name']),
85
+                            'subject' => 'Missing to create the database connection! from '.$modx->getPhpCompat()->entities($modx->config['site_name']),
86 86
                             'body'    => "{$logtitle}\n{$request_uri}\n{$ua}\n{$referer}",
87 87
                             'type'    => 'text'
88 88
                         ));
@@ -97,8 +97,8 @@  discard block
 block discarded – undo
97 97
             $tend = $modx->getMicroTime();
98 98
             $totaltime = $tend - $tstart;
99 99
             if ($modx->dumpSQL) {
100
-                $modx->queryCode .= "<fieldset style='text-align:left'><legend>Database connection</legend>" . sprintf("Database connection was created in %2.4f s",
101
-                        $totaltime) . "</fieldset><br />";
100
+                $modx->queryCode .= "<fieldset style='text-align:left'><legend>Database connection</legend>".sprintf("Database connection was created in %2.4f s",
101
+                        $totaltime)."</fieldset><br />";
102 102
             }
103 103
             $this->conn->set_charset($this->getConfig('charset'));
104 104
             $this->isConnected = true;
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
         if (1000 < $safeCount) {
132 132
             exit("Too many loops '{$safeCount}'");
133 133
         }
134
-        if ( ! ($this->conn instanceof mysqli)) {
134
+        if (!($this->conn instanceof mysqli)) {
135 135
             $this->connect();
136 136
         }
137 137
         if (is_array($s)) {
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
     public function query($sql, $watchError = true)
158 158
     {
159 159
         $modx = evolutionCMS();
160
-        if ( ! ($this->conn instanceof mysqli)) {
160
+        if (!($this->conn instanceof mysqli)) {
161 161
             $this->connect();
162 162
         }
163 163
         $tStart = $modx->getMicroTime();
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
                 case 1091:
178 178
                     break;
179 179
                 default:
180
-                    $modx->messageQuit('Execution of a query to the database failed - ' . $this->getLastError(), $sql);
180
+                    $modx->messageQuit('Execution of a query to the database failed - '.$this->getLastError(), $sql);
181 181
             }
182 182
         } else {
183 183
             $tend = $modx->getMicroTime();
@@ -191,24 +191,24 @@  discard block
 block discarded – undo
191 191
                     $debug_path[] = $line['function'];
192 192
                 }
193 193
                 $debug_path = implode(' > ', array_reverse($debug_path));
194
-                $modx->queryCode .= "<fieldset style='text-align:left'><legend>Query " . ($modx->executedQueries + 1) . " - " . sprintf("%2.2f ms",
195
-                        $totalTime * 1000) . "</legend>";
196
-                $modx->queryCode .= $sql . '<br><br>';
194
+                $modx->queryCode .= "<fieldset style='text-align:left'><legend>Query ".($modx->executedQueries + 1)." - ".sprintf("%2.2f ms",
195
+                        $totalTime * 1000)."</legend>";
196
+                $modx->queryCode .= $sql.'<br><br>';
197 197
                 if ($modx->event->name) {
198
-                    $modx->queryCode .= 'Current Event  => ' . $modx->event->name . '<br>';
198
+                    $modx->queryCode .= 'Current Event  => '.$modx->event->name.'<br>';
199 199
                 }
200 200
                 if ($modx->event->activePlugin) {
201
-                    $modx->queryCode .= 'Current Plugin => ' . $modx->event->activePlugin . '<br>';
201
+                    $modx->queryCode .= 'Current Plugin => '.$modx->event->activePlugin.'<br>';
202 202
                 }
203 203
                 if ($modx->currentSnippet) {
204
-                    $modx->queryCode .= 'Current Snippet => ' . $modx->currentSnippet . '<br>';
204
+                    $modx->queryCode .= 'Current Snippet => '.$modx->currentSnippet.'<br>';
205 205
                 }
206 206
                 if (stripos($sql, 'select') === 0) {
207
-                    $modx->queryCode .= 'Record Count => ' . $this->getRecordCount($result) . '<br>';
207
+                    $modx->queryCode .= 'Record Count => '.$this->getRecordCount($result).'<br>';
208 208
                 } else {
209
-                    $modx->queryCode .= 'Affected Rows => ' . $this->getAffectedRows() . '<br>';
209
+                    $modx->queryCode .= 'Affected Rows => '.$this->getAffectedRows().'<br>';
210 210
                 }
211
-                $modx->queryCode .= 'Functions Path => ' . $debug_path . '<br>';
211
+                $modx->queryCode .= 'Functions Path => '.$debug_path.'<br>';
212 212
                 $modx->queryCode .= "</fieldset><br />";
213 213
             }
214 214
             $modx->executedQueries++;
@@ -315,9 +315,9 @@  discard block
 block discarded – undo
315 315
                     if ($value === null || strtolower($value) === 'null') {
316 316
                         $f = 'NULL';
317 317
                     } else {
318
-                        $f = "'" . $value . "'";
318
+                        $f = "'".$value."'";
319 319
                     }
320
-                    $fields[$key] = "`{$key}` = " . $f;
320
+                    $fields[$key] = "`{$key}` = ".$f;
321 321
                 }
322 322
                 $fields = implode(',', $fields);
323 323
             }
@@ -352,12 +352,12 @@  discard block
 block discarded – undo
352 352
                 $this->query("INSERT INTO {$intotable} {$fields}");
353 353
             } else {
354 354
                 if (empty($fromtable)) {
355
-                    $fields = "(`" . implode("`, `", array_keys($fields)) . "`) VALUES('" . implode("', '",
356
-                            array_values($fields)) . "')";
355
+                    $fields = "(`".implode("`, `", array_keys($fields))."`) VALUES('".implode("', '",
356
+                            array_values($fields))."')";
357 357
                     $this->query("INSERT INTO {$intotable} {$fields}");
358 358
                 } else {
359 359
                     $fromtable = $this->replaceFullTableName($fromtable);
360
-                    $fields = "(" . implode(",", array_keys($fields)) . ")";
360
+                    $fields = "(".implode(",", array_keys($fields)).")";
361 361
                     $where = trim($where);
362 362
                     $limit = trim($limit);
363 363
                     if ($where !== '' && stripos($where, 'WHERE') !== 0) {
@@ -451,8 +451,8 @@  discard block
 block discarded – undo
451 451
      */
452 452
     public function getInsertId($conn = null)
453 453
     {
454
-        if (! ($conn instanceof mysqli)) {
455
-            $conn =& $this->conn;
454
+        if (!($conn instanceof mysqli)) {
455
+            $conn = & $this->conn;
456 456
         }
457 457
 
458 458
         return $conn->insert_id;
@@ -464,8 +464,8 @@  discard block
 block discarded – undo
464 464
      */
465 465
     public function getAffectedRows($conn = null)
466 466
     {
467
-        if (! ($conn instanceof mysqli)) {
468
-            $conn =& $this->conn;
467
+        if (!($conn instanceof mysqli)) {
468
+            $conn = & $this->conn;
469 469
         }
470 470
 
471 471
         return $conn->affected_rows;
@@ -477,8 +477,8 @@  discard block
 block discarded – undo
477 477
      */
478 478
     public function getLastError($conn = null)
479 479
     {
480
-        if (! ($conn instanceof mysqli)) {
481
-            $conn =& $this->conn;
480
+        if (!($conn instanceof mysqli)) {
481
+            $conn = & $this->conn;
482 482
         }
483 483
 
484 484
         return $conn->error;
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
     {
503 503
         $out = false;
504 504
         if ($ds instanceof mysqli_result) {
505
-            switch($mode){
505
+            switch ($mode) {
506 506
                 case 'assoc':
507 507
                     $out = $ds->fetch_assoc();
508 508
                     break;
@@ -532,7 +532,7 @@  discard block
 block discarded – undo
532 532
     public function getColumn($name, $dsq)
533 533
     {
534 534
         $col = array();
535
-        if ( ! ($dsq instanceof mysqli_result)) {
535
+        if (!($dsq instanceof mysqli_result)) {
536 536
             $dsq = $this->query($dsq);
537 537
         }
538 538
         if ($dsq) {
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
     public function getColumnNames($dsq)
552 552
     {
553 553
         $names = array();
554
-        if ( ! ($dsq instanceof mysqli_result)) {
554
+        if (!($dsq instanceof mysqli_result)) {
555 555
             $dsq = $this->query($dsq);
556 556
         }
557 557
         if ($dsq) {
@@ -571,7 +571,7 @@  discard block
 block discarded – undo
571 571
     public function getValue($dsq)
572 572
     {
573 573
         $out = false;
574
-        if ( ! ($dsq instanceof mysqli_result)) {
574
+        if (!($dsq instanceof mysqli_result)) {
575 575
             $dsq = $this->query($dsq);
576 576
         }
577 577
         if ($dsq) {
@@ -661,8 +661,8 @@  discard block
 block discarded – undo
661 661
 
662 662
     public function getTableName($table, $escape = true)
663 663
     {
664
-        $out = $this->getConfig('table_prefix') . $table;
665
-        return $escape ? '`' . $out . '`' : $out;
664
+        $out = $this->getConfig('table_prefix').$table;
665
+        return $escape ? '`'.$out.'`' : $out;
666 666
     }
667 667
 
668 668
     /**
@@ -671,7 +671,7 @@  discard block
 block discarded – undo
671 671
      */
672 672
     public function getFullTableName($tbl)
673 673
     {
674
-        return $this->getConfig('dbase') . "." . $this->getTableName($tbl);
674
+        return $this->getConfig('dbase').".".$this->getTableName($tbl);
675 675
     }
676 676
 
677 677
     /**
@@ -684,7 +684,7 @@  discard block
 block discarded – undo
684 684
         $tableName = trim($tableName);
685 685
         $dbase = trim($this->getConfig('dbase'), '`');
686 686
         $prefix = $this->getConfig('table_prefix');
687
-        if ((bool)$force === true) {
687
+        if ((bool) $force === true) {
688 688
             $result = "`{$dbase}`.`{$prefix}{$tableName}`";
689 689
         } elseif (strpos($tableName, '[+prefix+]') !== false) {
690 690
             $result = preg_replace('@\[\+prefix\+\]([0-9a-zA-Z_]+)@', "`{$dbase}`.`{$prefix}$1`", $tableName);
Please login to merge, or discard this patch.
manager/media/style/default/snippets/welcome/RecentInfo.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
 $tpl = '<tr>
8 8
     <td data-toggle="collapse" data-target=".collapse[+id+]" class="text-right"><span class="label label-info">[+id+]</span></td>
9 9
     <td data-toggle="collapse" data-target=".collapse[+id+]"><a class="[+status+]" title="[%edit_resource%]" href="index.php?a=3&amp;id=[+id+]" target="main">[+pagetitle+]</a></td>
10
-    <td data-toggle="collapse" data-target=".collapse[+id+]" class="text-right text-nowrap">[+editedon:math("%s+[(server_offset_time)]"):dateFormat=`'.$modx->toDateFormat(0,'formatOnly').' %H:%M:%S`+]</td>
10
+    <td data-toggle="collapse" data-target=".collapse[+id+]" class="text-right text-nowrap">[+editedon:math("%s+[(server_offset_time)]"):dateFormat=`'.$modx->toDateFormat(0, 'formatOnly').' %H:%M:%S`+]</td>
11 11
     <td data-toggle="collapse" data-target=".collapse[+id+]">[+username+]</td>
12 12
     <td style="text-align: right;" class="actions">[+edit_btn+][+preview_btn+][+delete_btn+][+publish_btn+][+info_btn+]</td>
13 13
 </tr>
Please login to merge, or discard this patch.
manager/includes/src/Support/MakeTable.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
      */
133 133
     public function setTableWidth($value)
134 134
     {
135
-        $this->tableWidth = (int)$value;
135
+        $this->tableWidth = (int) $value;
136 136
     }
137 137
 
138 138
     /**
@@ -318,8 +318,8 @@  discard block
 block discarded – undo
318 318
     public function getColumnWidth($columnPosition)
319 319
     {
320 320
         $currentWidth = '';
321
-        if (is_array($this->columnWidths) && ! empty($this->columnWidths[$columnPosition])) {
322
-            $currentWidth = ' width="' . $this->columnWidths[$columnPosition] . '" ';
321
+        if (is_array($this->columnWidths) && !empty($this->columnWidths[$columnPosition])) {
322
+            $currentWidth = ' width="'.$this->columnWidths[$columnPosition].'" ';
323 323
         }
324 324
 
325 325
         return $currentWidth;
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
             $currentClass = $this->rowAlternateClass;
349 349
         }
350 350
 
351
-        return ' class="' . $currentClass . '"';
351
+        return ' class="'.$currentClass.'"';
352 352
     }
353 353
 
354 354
     /**
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
     {
363 363
         $cellAction = '';
364 364
         if ($this->cellAction) {
365
-            $cellAction = ' onClick="javascript:window.location=\'' . $this->cellAction . $this->actionField . '=' . urlencode($currentActionFieldValue) . '\'" ';
365
+            $cellAction = ' onClick="javascript:window.location=\''.$this->cellAction.$this->actionField.'='.urlencode($currentActionFieldValue).'\'" ';
366 366
         }
367 367
 
368 368
         return $cellAction;
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
     {
380 380
         $cell = $value;
381 381
         if ($this->linkAction) {
382
-            $cell = '<a href="' . $this->linkAction . $this->actionField . '=' . urlencode($currentActionFieldValue) . '">' . $cell . '</a>';
382
+            $cell = '<a href="'.$this->linkAction.$this->actionField.'='.urlencode($currentActionFieldValue).'">'.$cell.'</a>';
383 383
         }
384 384
 
385 385
         return $cell;
@@ -408,7 +408,7 @@  discard block
 block discarded – undo
408 408
             $end = '?';
409 409
         }
410 410
 
411
-        return $link . $end;
411
+        return $link.$end;
412 412
     }
413 413
 
414 414
     /**
@@ -430,7 +430,7 @@  discard block
 block discarded – undo
430 430
         if (is_array($fieldsArray)) {
431 431
             $i = 0;
432 432
             foreach ($fieldsArray as $fieldName => $fieldValue) {
433
-                $table .= "\t<tr" . $this->determineRowClass($i) . ">\n";
433
+                $table .= "\t<tr".$this->determineRowClass($i).">\n";
434 434
                 $currentActionFieldValue = get_by_key($fieldValue, $this->actionField, '');
435 435
                 if (is_array($this->selectedValues)) {
436 436
                     $isChecked = array_search($currentActionFieldValue, $this->selectedValues) === false ? 0 : 1;
@@ -441,15 +441,15 @@  discard block
 block discarded – undo
441 441
                 $colPosition = 0;
442 442
                 foreach ($fieldValue as $key => $value) {
443 443
                     if (!in_array($key, $this->excludeFields)) {
444
-                        $table .= "\t\t<td" . $this->getCellAction($currentActionFieldValue) . ">";
444
+                        $table .= "\t\t<td".$this->getCellAction($currentActionFieldValue).">";
445 445
                         $table .= $this->createCellText($currentActionFieldValue, $value);
446 446
                         $table .= "</td>\n";
447 447
                         if ($i == 0) {
448 448
                             if (empty ($header) && $this->formElementType) {
449
-                                $header .= "\t\t<th style=\"width:32px\" " . ($this->thClass ? 'class="' . $this->thClass . '"' : '') . ">" . ($this->allOption ? '<a href="javascript:clickAll()">all</a>' : '') . "</th>\n";
449
+                                $header .= "\t\t<th style=\"width:32px\" ".($this->thClass ? 'class="'.$this->thClass.'"' : '').">".($this->allOption ? '<a href="javascript:clickAll()">all</a>' : '')."</th>\n";
450 450
                             }
451 451
                             $headerText = array_key_exists($key, $fieldHeadersArray) ? $fieldHeadersArray[$key] : $key;
452
-                            $header .= "\t\t<th" . $this->getColumnWidth($colPosition) . ($this->thClass ? ' class="' . $this->thClass . '" ' : '') . ">" . $headerText . "</th>\n";
452
+                            $header .= "\t\t<th".$this->getColumnWidth($colPosition).($this->thClass ? ' class="'.$this->thClass.'" ' : '').">".$headerText."</th>\n";
453 453
                         }
454 454
                         $colPosition++;
455 455
                     }
@@ -457,9 +457,9 @@  discard block
 block discarded – undo
457 457
                 $i++;
458 458
                 $table .= "\t</tr>\n";
459 459
             }
460
-            $table = "\n" . '<table' . ($this->tableWidth > 0 ? ' width="' . $this->tableWidth . '"' : '') . ($this->tableClass ? ' class="' . $this->tableClass . '"' : '') . ($this->tableID ? ' id="' . $this->tableID . '"' : '') . ">\n" . ($header ? "\t<thead>\n\t<tr class=\"" . $this->rowHeaderClass . "\">\n" . $header . "\t</tr>\n\t</thead>\n" : '') . $table . "</table>\n";
460
+            $table = "\n".'<table'.($this->tableWidth > 0 ? ' width="'.$this->tableWidth.'"' : '').($this->tableClass ? ' class="'.$this->tableClass.'"' : '').($this->tableID ? ' id="'.$this->tableID.'"' : '').">\n".($header ? "\t<thead>\n\t<tr class=\"".$this->rowHeaderClass."\">\n".$header."\t</tr>\n\t</thead>\n" : '').$table."</table>\n";
461 461
             if ($this->formElementType) {
462
-                $table = "\n" . '<form id="' . $this->formName . '" name="' . $this->formName . '" action="' . $this->formAction . '" method="POST">' . $table;
462
+                $table = "\n".'<form id="'.$this->formName.'" name="'.$this->formName.'" action="'.$this->formAction.'" method="POST">'.$table;
463 463
             }
464 464
             if (strlen($this->pageNav) > 1) {//changed to display the pagination if exists.
465 465
                 /* commented this part because of cookie
@@ -473,7 +473,7 @@  discard block
 block discarded – undo
473 473
 
474 474
                 $table .= '</select>'.$_lang["pagination_table_perpage"].'</div>';
475 475
                 */
476
-                $table .= '<div id="pagination" class="paginate">' . $_lang["pagination_table_gotopage"] . '<ul>' . $this->pageNav . '</ul></div>';
476
+                $table .= '<div id="pagination" class="paginate">'.$_lang["pagination_table_gotopage"].'<ul>'.$this->pageNav.'</ul></div>';
477 477
                 //$table .= '<script language="javascript">function updatePageSize(size){window.location = \''.$this->prepareLink($linkpage).'pageSize=\'+size;}</script>';
478 478
 
479 479
             }
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
 <script language="javascript">
483 483
 	toggled = 0;
484 484
 	function clickAll() {
485
-		myform = document.getElementById("' . $this->formName . '");
485
+		myform = document.getElementById("' . $this->formName.'");
486 486
 		for(i=0;i<myform.length;i++) {
487 487
 			if(myform.elements[i].type==\'checkbox\') {
488 488
 				myform.elements[i].checked=(toggled?false:true);
@@ -494,9 +494,9 @@  discard block
 block discarded – undo
494 494
             }
495 495
             if ($this->formElementType) {
496 496
                 if ($this->extra) {
497
-                    $table .= "\n" . $this->extra . "\n";
497
+                    $table .= "\n".$this->extra."\n";
498 498
                 }
499
-                $table .= "\n" . '</form>' . "\n";
499
+                $table .= "\n".'</form>'."\n";
500 500
             }
501 501
 
502 502
             return $table;
@@ -519,7 +519,7 @@  discard block
 block discarded – undo
519 519
         $numPages = ceil($numRecords / MAX_DISPLAY_RECORDS_NUM);
520 520
         $nav = '';
521 521
         if ($numPages > 1) {
522
-            $currentURL = empty($qs) ? '' : '?' . $qs;
522
+            $currentURL = empty($qs) ? '' : '?'.$qs;
523 523
             if ($currentPage > 6) {
524 524
                 $nav .= $this->createPageLink($currentURL, 1, $_lang["pagination_table_first"]);
525 525
             }
@@ -544,7 +544,7 @@  discard block
 block discarded – undo
544 544
                 $nav .= $this->createPageLink($currentURL, $numPages, $_lang["pagination_table_last"]);
545 545
             }
546 546
         }
547
-        $this->pageNav = ' ' . $nav;
547
+        $this->pageNav = ' '.$nav;
548 548
     }
549 549
 
550 550
     /**
@@ -560,14 +560,14 @@  discard block
 block discarded – undo
560 560
     public function createPageLink($link = '', $pageNum, $displayText, $currentPage = false, $qs = '')
561 561
     {
562 562
         $modx = evolutionCMS();
563
-        $orderBy = !empty($_GET['orderby']) ? '&orderby=' . $_GET['orderby'] : '';
564
-        $orderDir = !empty($_GET['orderdir']) ? '&orderdir=' . $_GET['orderdir'] : '';
563
+        $orderBy = !empty($_GET['orderby']) ? '&orderby='.$_GET['orderby'] : '';
564
+        $orderDir = !empty($_GET['orderdir']) ? '&orderdir='.$_GET['orderdir'] : '';
565 565
         if (!empty($qs)) {
566 566
             $qs = "?$qs";
567 567
         }
568 568
         $link = empty($link) ? $modx->makeUrl($modx->documentIdentifier, $modx->documentObject['alias'],
569
-            $qs . "page=$pageNum$orderBy$orderDir") : $this->prepareLink($link) . "page=$pageNum";
570
-        $nav = '<li' . ($currentPage ? ' class="currentPage"' : '') . '><a' . ($currentPage ? ' class="currentPage"' : '') . ' href="' . $link . '">' . $displayText . '</a></li>' . "\n";
569
+            $qs."page=$pageNum$orderBy$orderDir") : $this->prepareLink($link)."page=$pageNum";
570
+        $nav = '<li'.($currentPage ? ' class="currentPage"' : '').'><a'.($currentPage ? ' class="currentPage"' : '').' href="'.$link.'">'.$displayText.'</a></li>'."\n";
571 571
 
572 572
         return $nav;
573 573
     }
@@ -585,7 +585,7 @@  discard block
 block discarded – undo
585 585
         $field = '';
586 586
         if ($this->formElementType) {
587 587
             $checked = $isChecked ? "checked " : "";
588
-            $field = "\t\t" . '<td><input type="' . $this->formElementType . '" name="' . ($this->formElementName ? $this->formElementName : $value) . '"  value="' . $value . '" ' . $checked . '/></td>' . "\n";
588
+            $field = "\t\t".'<td><input type="'.$this->formElementType.'" name="'.($this->formElementName ? $this->formElementName : $value).'"  value="'.$value.'" '.$checked.'/></td>'."\n";
589 589
         }
590 590
 
591 591
         return $field;
@@ -599,7 +599,7 @@  discard block
 block discarded – undo
599 599
     public function handlePaging()
600 600
     {
601 601
         $offset = (is_numeric($_GET['page']) && $_GET['page'] > 0) ? $_GET['page'] - 1 : 0;
602
-        $limitClause = ' LIMIT ' . ($offset * MAX_DISPLAY_RECORDS_NUM) . ', ' . MAX_DISPLAY_RECORDS_NUM;
602
+        $limitClause = ' LIMIT '.($offset * MAX_DISPLAY_RECORDS_NUM).', '.MAX_DISPLAY_RECORDS_NUM;
603 603
 
604 604
         return $limitClause;
605 605
     }
@@ -614,10 +614,10 @@  discard block
 block discarded – undo
614 614
     public function handleSorting($natural_order = false)
615 615
     {
616 616
         $orderByClause = '';
617
-        if ((bool)$natural_order === false) {
617
+        if ((bool) $natural_order === false) {
618 618
             $orderby = !empty($_GET['orderby']) ? $_GET['orderby'] : "id";
619 619
             $orderdir = !empty($_GET['orderdir']) ? $_GET['orderdir'] : "DESC";
620
-            $orderByClause = !empty($orderby) ? ' ORDER BY ' . $orderby . ' ' . $orderdir . ' ' : "";
620
+            $orderByClause = !empty($orderby) ? ' ORDER BY '.$orderby.' '.$orderdir.' ' : "";
621 621
         }
622 622
 
623 623
         return $orderByClause;
@@ -646,7 +646,7 @@  discard block
 block discarded – undo
646 646
             }
647 647
         }
648 648
 
649
-        return '<a href="[~' . $modx->documentIdentifier . '~]?' . $qs . 'orderby=' . $key . $orderDir . '">' . $text . '</a>';
649
+        return '<a href="[~'.$modx->documentIdentifier.'~]?'.$qs.'orderby='.$key.$orderDir.'">'.$text.'</a>';
650 650
     }
651 651
 
652 652
 }
Please login to merge, or discard this patch.
manager/actions/mutate_settings/tab7_filebrowser_settings.inc.php 1 patch
Spacing   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -6,8 +6,8 @@  discard block
 block discarded – undo
6 6
   <tr>
7 7
     <td nowrap class="warning"><?php echo $_lang['rb_title']?><br><small>[(use_browser)]</small></td>
8 8
     <td>
9
-        <?php echo wrap_label($_lang['yes'],form_radio('use_browser', 1, 'id="rbRowOn"'));?><br />
10
-        <?php echo wrap_label($_lang['no'], form_radio('use_browser', 0, 'id="rbRowOff"'));?>
9
+        <?php echo wrap_label($_lang['yes'], form_radio('use_browser', 1, 'id="rbRowOn"')); ?><br />
10
+        <?php echo wrap_label($_lang['no'], form_radio('use_browser', 0, 'id="rbRowOff"')); ?>
11 11
     </td>
12 12
   </tr>
13 13
   <tr>
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
     <td colspan="2"><div class="split"></div></td>
19 19
   </tr>
20 20
   
21
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
21
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
22 22
     <td nowrap class="warning"><?php echo $_lang['which_browser_default_title']?><br><small>[(which_browser)]</small></td>
23 23
     <td>
24 24
         <select name="which_browser" size="1" class="inputBox" onchange="documentDirty=true;">
@@ -27,125 +27,125 @@  discard block
 block discarded – undo
27 27
                 $dir = str_replace('\\', '/', $dir);
28 28
                 $browser_name = substr($dir, strrpos($dir, '/') + 1);
29 29
                 $selected = $browser_name == $which_browser ? ' selected="selected"' : '';
30
-                echo '<option value="' . $browser_name . '"' . $selected . '>' . "{$browser_name}</option>\n";
30
+                echo '<option value="'.$browser_name.'"'.$selected.'>'."{$browser_name}</option>\n";
31 31
             }
32 32
             ?>
33 33
         </select>
34 34
     </td>
35 35
   </tr>
36
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
36
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
37 37
     <td width="200">&nbsp;</td>
38 38
     <td class="comment"><?php echo $_lang['which_browser_default_msg']?></td>
39 39
   </tr>
40 40
   <tr>
41 41
     <td colspan="2"><div class="split"></div></td>
42 42
   </tr>
43
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
43
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
44 44
     <td nowrap class="warning"><?php echo $_lang['rb_webuser_title']?><br><small>[(rb_webuser)]</small></td>
45 45
     <td>
46
-      <label><input type="radio" name="rb_webuser" value="1" <?php echo $rb_webuser=='1' ? 'checked="checked"' : "" ; ?> />
46
+      <label><input type="radio" name="rb_webuser" value="1" <?php echo $rb_webuser == '1' ? 'checked="checked"' : ""; ?> />
47 47
       <?php echo $_lang['yes']?></label><br />
48
-      <label><input type="radio" name="rb_webuser" value="0" <?php echo $rb_webuser=='0' ? 'checked="checked"' : "" ; ?> />
48
+      <label><input type="radio" name="rb_webuser" value="0" <?php echo $rb_webuser == '0' ? 'checked="checked"' : ""; ?> />
49 49
       <?php echo $_lang['no']?></label>
50 50
     </td>
51 51
   </tr>
52
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
52
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
53 53
     <td width="200">&nbsp;</td>
54 54
     <td class="comment"><?php echo $_lang['rb_webuser_message']?></td>
55 55
   </tr>
56
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
56
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
57 57
     <td colspan="2"><div class="split"></div></td>
58 58
   </tr>
59
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
59
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
60 60
     <td nowrap class="warning"><?php echo $_lang['rb_base_dir_title']?><br><small>[(rb_base_dir)]</small></td>
61 61
     <td>
62 62
         <?php echo $_lang['default']; ?> <span id="default_rb_base_dir">[(base_path)]assets/</span><br />
63 63
         <input onchange="documentDirty=true;" type="text" maxlength="255" style="width: 250px;" name="rb_base_dir" id="rb_base_dir" value="<?php echo $rb_base_dir; ?>" /> <input type="button" onclick="reset_path('rb_base_dir');" value="<?php echo $_lang['reset']; ?>" name="reset_rb_base_dir">
64 64
     </td>
65 65
   </tr>
66
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
66
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
67 67
     <td width="200">&nbsp;</td>
68 68
     <td class="comment"><?php echo $_lang['rb_base_dir_message']?></td>
69 69
   </tr>
70
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
70
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
71 71
     <td colspan="2"><div class="split"></div></td>
72 72
   </tr>
73
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
73
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
74 74
     <td nowrap class="warning"><?php echo $_lang['rb_base_url_title']?><br><small>[(rb_base_url)]</small></td>
75 75
     <td>
76 76
       <input onchange="documentDirty=true;" type="text" maxlength="255" style="width: 250px;" name="rb_base_url" value="<?php echo $rb_base_url; ?>" />
77 77
       </td>
78 78
   </tr>
79
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
79
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
80 80
     <td width="200">&nbsp;</td>
81 81
     <td class="comment"><?php echo $_lang['rb_base_url_message']?></td>
82 82
   </tr>
83
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
83
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
84 84
     <td colspan="2"><div class="split"></div></td>
85 85
   </tr>
86
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
86
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
87 87
       <td nowrap class="warning"><?php echo $_lang['clean_uploaded_filename']?><br><small>[(clean_uploaded_filename)]</small></td>
88 88
       <td>
89
-        <label><input type="radio" name="clean_uploaded_filename" value="1" <?php echo $clean_uploaded_filename=='1' ? 'checked="checked"' : "" ; ?> />
89
+        <label><input type="radio" name="clean_uploaded_filename" value="1" <?php echo $clean_uploaded_filename == '1' ? 'checked="checked"' : ""; ?> />
90 90
         <?php echo $_lang['yes']?></label><br />
91
-        <label><input type="radio" name="clean_uploaded_filename" value="0" <?php echo $clean_uploaded_filename=='0' ? 'checked="checked"' : "" ; ?> />
91
+        <label><input type="radio" name="clean_uploaded_filename" value="0" <?php echo $clean_uploaded_filename == '0' ? 'checked="checked"' : ""; ?> />
92 92
         <?php echo $_lang['no']?></label>
93 93
       </td>
94 94
   </tr>
95
-    <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
95
+    <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
96 96
       <td width="200">&nbsp;</td>
97
-      <td class="comment"><?php echo $_lang['clean_uploaded_filename_message'];?></td>
97
+      <td class="comment"><?php echo $_lang['clean_uploaded_filename_message']; ?></td>
98 98
     </tr>
99
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
99
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
100 100
   <td colspan="2"><div class="split"></div></td>
101 101
   </tr>
102
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
102
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
103 103
     <td nowrap class="warning"><?php echo $_lang['settings_strip_image_paths_title']?><br><small>[(strip_image_paths)]</small></td>
104 104
     <td>
105
-      <label><input type="radio" name="strip_image_paths" value="1" <?php echo $strip_image_paths=='1' ? 'checked="checked"' : "" ; ?> />
105
+      <label><input type="radio" name="strip_image_paths" value="1" <?php echo $strip_image_paths == '1' ? 'checked="checked"' : ""; ?> />
106 106
       <?php echo $_lang['yes']?></label><br />
107
-      <label><input type="radio" name="strip_image_paths" value="0" <?php echo $strip_image_paths=='0' ? 'checked="checked"' : "" ; ?> />
107
+      <label><input type="radio" name="strip_image_paths" value="0" <?php echo $strip_image_paths == '0' ? 'checked="checked"' : ""; ?> />
108 108
       <?php echo $_lang['no']?></label>
109 109
     </td>
110 110
   </tr>
111
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
111
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
112 112
     <td width="200">&nbsp;</td>
113 113
     <td class="comment"><?php echo $_lang['settings_strip_image_paths_message']?></td>
114 114
   </tr>
115
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
115
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
116 116
     <td colspan="2"><div class="split"></div></td>
117 117
   </tr>
118
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
118
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
119 119
     <td nowrap class="warning"><?php echo $_lang['maxImageWidth']?><br><small>[(maxImageWidth)]</small></td>
120 120
     <td>
121 121
       <input onchange="documentDirty=true;" type="text" maxlength="4" style="width: 50px;" name="maxImageWidth" value="<?php echo $maxImageWidth; ?>" />
122 122
     </td>
123 123
   </tr>
124
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
124
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
125 125
     <td width="200">&nbsp;</td>
126 126
     <td class="comment"><?php echo $_lang['maxImageWidth_message']?></td>
127 127
   </tr>
128
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
128
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
129 129
     <td colspan="2"><div class="split"></div></td>
130 130
   </tr>
131
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
131
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
132 132
     <td nowrap class="warning"><?php echo $_lang['maxImageHeight']?><br><small>[(maxImageHeight)]</small></td>
133 133
     <td>
134 134
       <input onchange="documentDirty=true;" type="text" maxlength="4" style="width: 50px;" name="maxImageHeight" value="<?php echo $maxImageHeight; ?>" />
135 135
     </td>
136 136
   </tr>
137
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
137
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
138 138
     <td width="200">&nbsp;</td>
139 139
     <td class="comment"><?php echo $_lang['maxImageHeight_message']?></td>
140 140
   </tr>
141
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
141
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
142 142
     <td colspan="2"><div class="split"></div></td>
143 143
   </tr>
144
-    <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
144
+    <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
145 145
         <td nowrap class="warning"><?php echo $_lang['clientResize']?><br><small>[(clientResize)]</small></td>
146 146
         <td>
147
-            <?php echo wrap_label($_lang['yes'],form_radio('clientResize', 1, ''));?><br />
148
-            <?php echo wrap_label($_lang['no'], form_radio('clientResize', 0, ''));?>
147
+            <?php echo wrap_label($_lang['yes'], form_radio('clientResize', 1, '')); ?><br />
148
+            <?php echo wrap_label($_lang['no'], form_radio('clientResize', 0, '')); ?>
149 149
         </td>
150 150
     </tr>
151 151
     <tr>
@@ -155,11 +155,11 @@  discard block
 block discarded – undo
155 155
     <tr>
156 156
         <td colspan="2"><div class="split"></div></td>
157 157
     </tr>
158
-    <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
158
+    <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
159 159
         <td nowrap class="warning"><?php echo $_lang['noThumbnailsRecreation']?><br><small>[(noThumbnailsRecreation)]</small></td>
160 160
         <td>
161
-            <?php echo wrap_label($_lang['yes'],form_radio('noThumbnailsRecreation', 1, ''));?><br />
162
-            <?php echo wrap_label($_lang['no'], form_radio('noThumbnailsRecreation', 0, ''));?>
161
+            <?php echo wrap_label($_lang['yes'], form_radio('noThumbnailsRecreation', 1, '')); ?><br />
162
+            <?php echo wrap_label($_lang['no'], form_radio('noThumbnailsRecreation', 0, '')); ?>
163 163
         </td>
164 164
     </tr>
165 165
     <tr>
@@ -170,92 +170,92 @@  discard block
 block discarded – undo
170 170
         <td colspan="2"><div class="split"></div></td>
171 171
     </tr>
172 172
 
173
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
173
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
174 174
     <td nowrap class="warning"><?php echo $_lang['thumbWidth']?><br><small>[(thumbWidth)]</small></td>
175 175
     <td>
176 176
       <input onchange="documentDirty=true;" type="text" maxlength="4" style="width: 50px;" name="thumbWidth" value="<?php echo $thumbWidth; ?>" />
177 177
     </td>
178 178
   </tr>
179
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
179
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
180 180
     <td width="200">&nbsp;</td>
181 181
     <td class="comment"><?php echo $_lang['thumbWidth_message']?></td>
182 182
   </tr>
183
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
183
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
184 184
     <td colspan="2"><div class="split"></div></td>
185 185
   </tr>
186
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
186
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
187 187
     <td nowrap class="warning"><?php echo $_lang['thumbHeight']?><br><small>[(thumbHeight)]</small></td>
188 188
     <td>
189 189
       <input onchange="documentDirty=true;" type="text" maxlength="4" style="width: 50px;" name="thumbHeight" value="<?php echo $thumbHeight; ?>" />
190 190
     </td>
191 191
   </tr>
192
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
192
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
193 193
     <td width="200">&nbsp;</td>
194 194
     <td class="comment"><?php echo $_lang['thumbHeight_message']?></td>
195 195
   </tr>
196
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
196
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
197 197
     <td colspan="2"><div class="split"></div></td>
198 198
   </tr>
199
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
199
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
200 200
     <td nowrap class="warning"><?php echo $_lang['thumbsDir']?><br><small>[(thumbsDir)]</small></td>
201 201
     <td>
202 202
       <input onchange="documentDirty=true;" type="text" maxlength="255" style="width: 250px;" name="thumbsDir" value="<?php echo $thumbsDir; ?>" />
203 203
     </td>
204 204
   </tr>
205
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
205
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
206 206
     <td width="200">&nbsp;</td>
207 207
     <td class="comment"><?php echo $_lang['thumbsDir_message']?></td>
208 208
   </tr>
209
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
209
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
210 210
     <td colspan="2"><div class="split"></div></td>
211 211
   </tr>
212
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
212
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
213 213
     <td nowrap class="warning"><?php echo $_lang['jpegQuality']?><br><small>[(jpegQuality)]</small></td>
214 214
     <td>
215 215
       <input onchange="documentDirty=true;" type="text" maxlength="4" style="width: 50px;" name="jpegQuality" value="<?php echo $jpegQuality; ?>" />
216 216
     </td>
217 217
   </tr>
218
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
218
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
219 219
     <td width="200">&nbsp;</td>
220 220
     <td class="comment"><?php echo $_lang['jpegQuality_message']?></td>
221 221
   </tr>
222
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
222
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
223 223
     <td colspan="2"><div class="split"></div></td>
224 224
   </tr>
225
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
225
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
226 226
        <td nowrap class="warning"><?php echo $_lang['denyZipDownload'] ?><br><small>[(denyZipDownload)]</small></td>
227 227
         <td>
228
-          <label><input type="radio" name="denyZipDownload" value="0" <?php echo $denyZipDownload=='0' ? 'checked="checked"' : ""; ?> />
228
+          <label><input type="radio" name="denyZipDownload" value="0" <?php echo $denyZipDownload == '0' ? 'checked="checked"' : ""; ?> />
229 229
           <?php echo $_lang['no']?></label><br />
230
-          <label><input type="radio" name="denyZipDownload" value="1" <?php echo $denyZipDownload=='1' ? 'checked="checked"' : ""; ?> />
230
+          <label><input type="radio" name="denyZipDownload" value="1" <?php echo $denyZipDownload == '1' ? 'checked="checked"' : ""; ?> />
231 231
           <?php echo $_lang['yes']?></label>
232 232
         </td>
233 233
   </tr>
234
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
234
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
235 235
     <td colspan="2"><div class="split"></div></td>
236 236
   </tr>
237
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
237
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
238 238
         <td nowrap class="warning"><?php echo $_lang['denyExtensionRename'] ?><br><small>[(denyExtensionRename)]</small></td>
239 239
         <td>
240
-           <label><input type="radio" name="denyExtensionRename" value="0" <?php echo $denyExtensionRename=='0' ? 'checked="checked"' : ""; ?> />
240
+           <label><input type="radio" name="denyExtensionRename" value="0" <?php echo $denyExtensionRename == '0' ? 'checked="checked"' : ""; ?> />
241 241
            <?php echo $_lang['no']?></label><br />
242
-           <label><input type="radio" name="denyExtensionRename" value="1" <?php echo $denyExtensionRename=='1' ? 'checked="checked"' : ""; ?> />
242
+           <label><input type="radio" name="denyExtensionRename" value="1" <?php echo $denyExtensionRename == '1' ? 'checked="checked"' : ""; ?> />
243 243
            <?php echo $_lang['yes']?></label>
244 244
         </td>
245 245
   </tr>
246
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
246
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
247 247
     <td colspan="2"><div class="split"></div></td>
248 248
   </tr>
249
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
249
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
250 250
        <td nowrap class="warning"><?php echo $_lang['showHiddenFiles'] ?><br><small>[(showHiddenFiles)]</small></td>
251 251
        <td>
252
-         <label><input type="radio" name="showHiddenFiles" value="0" <?php echo $showHiddenFiles=='0' ? 'checked="checked"' : ""; ?> />
252
+         <label><input type="radio" name="showHiddenFiles" value="0" <?php echo $showHiddenFiles == '0' ? 'checked="checked"' : ""; ?> />
253 253
          <?php echo $_lang['no']?></label><br />
254
-         <label><input type="radio" name="showHiddenFiles" value="1" <?php echo $showHiddenFiles=='1' ? 'checked="checked"' : ""; ?> />
254
+         <label><input type="radio" name="showHiddenFiles" value="1" <?php echo $showHiddenFiles == '1' ? 'checked="checked"' : ""; ?> />
255 255
          <?php echo $_lang['yes']?></label>
256 256
         </td>
257 257
   </tr>
258
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
258
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
259 259
     <td colspan="2"><div class="split"></div></td>
260 260
   </tr>
261 261
   
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
         <?php
265 265
             // invoke OnMiscSettingsRender event
266 266
             $evtOut = $modx->invokeEvent('OnMiscSettingsRender');
267
-            if(is_array($evtOut)) echo implode("",$evtOut);
267
+            if (is_array($evtOut)) echo implode("", $evtOut);
268 268
         ?>
269 269
     </td>
270 270
   </tr>
Please login to merge, or discard this patch.
manager/media/browser/mcpuk/config.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
     'assetsURL'           => rtrim($modx->config['rb_base_url'], '/'),
30 30
     'dirPerms'            => intval($modx->config['new_folder_permissions'], 8),
31 31
     'filePerms'           => intval($modx->config['new_file_permissions'], 8),
32
-    'maxfilesize'         => (int)$modx->config['upload_maxsize'],
32
+    'maxfilesize'         => (int) $modx->config['upload_maxsize'],
33 33
     'noThumbnailsRecreation' => $modx->config['noThumbnailsRecreation'],
34 34
 
35 35
     'access' => array(
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 
89 89
     // THE FOLLOWING SETTINGS CANNOT BE OVERRIDED WITH SESSION CONFIGURATION
90 90
     '_check4htaccess' => false,
91
-    '_tinyMCEPath'    => MODX_BASE_URL . "assets/plugins/tinymce/tiny_mce",
91
+    '_tinyMCEPath'    => MODX_BASE_URL."assets/plugins/tinymce/tiny_mce",
92 92
 
93 93
     '_sessionVar' => &$_SESSION['KCFINDER'],
94 94
     //'_sessionLifetime' => 30,
Please login to merge, or discard this patch.
manager/media/browser/mcpuk/core/autoload.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -26,19 +26,19 @@  discard block
 block discarded – undo
26 26
 if (empty ($modx->config)) {
27 27
     $modx->getSettings();
28 28
 }
29
-if(!isset($_SESSION['mgrValidated'])) {
29
+if (!isset($_SESSION['mgrValidated'])) {
30 30
         die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
31 31
 }
32 32
 $manager_language = $modx->config['manager_language'];
33 33
 // Pass language code from MODX to KCFinder
34
-if(!file_exists("../../../includes/lang/".$manager_language.".inc.php")) {
34
+if (!file_exists("../../../includes/lang/".$manager_language.".inc.php")) {
35 35
     $manager_language = "english"; // if not set, get the english language file.
36 36
 }
37 37
 include_once "../../../includes/lang/".$manager_language.".inc.php";
38 38
 $_GET['langCode'] = $modx_lang_attribute;
39 39
 
40 40
 // MAGIC AUTOLOAD CLASSES FUNCTION
41
-function autoloadda9d06472ccb71b84928677ce2a6ca89($class) {
41
+function autoloadda9d06472ccb71b84928677ce2a6ca89($class){
42 42
     static $classes = null;
43 43
     if ($classes === null) {
44 44
         $classes = array(
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
         );
63 63
     }
64 64
     if (isset($classes[$class])) {
65
-        require dirname(__FILE__) . $classes[$class];
65
+        require dirname(__FILE__).$classes[$class];
66 66
     }
67 67
 }
68 68
 spl_autoload_register('autoloadda9d06472ccb71b84928677ce2a6ca89', true);
Please login to merge, or discard this patch.
manager/media/browser/mcpuk/core/uploader.php 1 patch
Spacing   +41 added lines, -42 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
   *      @link http://kcfinder.sunhater.com
13 13
   */
14 14
 
15
-class uploader {
15
+class uploader{
16 16
 
17 17
 /** Release version */
18 18
     const VERSION = "2.54";
@@ -72,8 +72,8 @@  discard block
 block discarded – undo
72 72
 
73 73
 /** Next three properties are got from the current language file
74 74
   * @var string */
75
-    protected $dateTimeFull;   // Currently not used
76
-    protected $dateTimeMid;    // Currently not used
75
+    protected $dateTimeFull; // Currently not used
76
+    protected $dateTimeMid; // Currently not used
77 77
     protected $dateTimeSmall;
78 78
 
79 79
 /** Contain Specified language labels
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 /** Magic method which allows read-only access to protected or private class properties
105 105
   * @param string $property
106 106
   * @return mixed */
107
-    public function __get($property) {
107
+    public function __get($property){
108 108
         return property_exists($this, $property) ? $this->$property : null;
109 109
     }
110 110
 
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
      * uploader constructor.
113 113
      * @param DocumentParser $modx
114 114
      */
115
-    public function __construct(DocumentParser $modx) {
115
+    public function __construct(DocumentParser $modx){
116 116
 
117 117
         //MODX
118 118
         try {
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 
196 196
         // COOKIES INIT
197 197
         $ip = '(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)';
198
-        $ip = '/^' . implode('\.', array($ip, $ip, $ip, $ip)) . '$/';
198
+        $ip = '/^'.implode('\.', array($ip, $ip, $ip, $ip)).'$/';
199 199
         if (preg_match($ip, $_SERVER['HTTP_HOST']) ||
200 200
             preg_match('/^[^\.]+$/', $_SERVER['HTTP_HOST'])
201 201
         )
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
         ) {
214 214
             list($unused, $protocol, $domain, $unused, $port, $path) = $patt;
215 215
             $path = path::normalize($path);
216
-            $this->config['uploadURL'] = "$protocol://$domain" . (strlen($port) ? ":$port" : "") . "/$path";
216
+            $this->config['uploadURL'] = "$protocol://$domain".(strlen($port) ? ":$port" : "")."/$path";
217 217
             $this->config['uploadDir'] = strlen($this->config['uploadDir'])
218 218
                 ? path::normalize($this->config['uploadDir'])
219 219
                 : path::url2fullPath("/$path");
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
         foreach ($this->langInputNames as $key)
257 257
             if (isset($this->get[$key]) &&
258 258
                 preg_match('/^[a-z][a-z\._\-]*$/i', $this->get[$key]) &&
259
-                file_exists("lang/" . strtolower($this->get[$key]) . ".php")
259
+                file_exists("lang/".strtolower($this->get[$key]).".php")
260 260
             ) {
261 261
                 $this->lang = $this->get[$key];
262 262
                 break;
@@ -290,12 +290,12 @@  discard block
 block discarded – undo
290 290
     /**
291 291
      * @return array|bool|int|null|string|void
292 292
      */
293
-    protected function getTransaliasSettings() {
293
+    protected function getTransaliasSettings(){
294 294
 		$modx = evolutionCMS();
295 295
 
296 296
 		// Cleaning uploaded filename?
297 297
 		$setting = $modx->getDatabase()->select('count(*)', $modx->getDatabase()->getFullTableName('system_settings'), 'setting_name="clean_uploaded_filename" AND setting_value=1');
298
-		if ($modx->getDatabase()->getValue($setting)>0) {
298
+		if ($modx->getDatabase()->getValue($setting) > 0) {
299 299
 			// Transalias plugin active?
300 300
 			$res = $modx->getDatabase()->select('properties', $modx->getDatabase()->getFullTableName('site_plugins'), 'name="TransAlias" AND disabled=0');
301 301
 			if ($properties = $modx->getDatabase()->getValue($res)) {
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
      * @param $filename
315 315
      * @return mixed|string
316 316
      */
317
-    protected function normalizeFilename($filename) {
317
+    protected function normalizeFilename($filename){
318 318
 		if ($this->getTransaliasSettings()) {
319 319
         		$format = strrchr($filename, ".");
320 320
         		$filename = str_replace($format, "", $filename);
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
      * @param $dirname
328 328
      * @return string
329 329
      */
330
-    protected function normalizeDirname($dirname) {
330
+    protected function normalizeDirname($dirname){
331 331
         return $this->modx->stripAlias($dirname);
332 332
     }
333 333
 
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
      * @param array|null $aFile
336 336
      * @return bool|mixed
337 337
      */
338
-    protected function checkUploadedFile(array $aFile=null) {
338
+    protected function checkUploadedFile(array $aFile = null){
339 339
         $config = &$this->config;
340 340
         $file = ($aFile === null) ? $this->file : $aFile;
341 341
 
@@ -361,8 +361,7 @@  discard block
 block discarded – undo
361 361
                 ($file['error'] == UPLOAD_ERR_NO_TMP_DIR) ?
362 362
                     $this->label("Missing a temporary folder.") : (
363 363
                 ($file['error'] == UPLOAD_ERR_CANT_WRITE) ?
364
-                    $this->label("Failed to write file.") :
365
-                    $this->label("Unknown error.")
364
+                    $this->label("Failed to write file.") : $this->label("Unknown error.")
366 365
             )))));
367 366
 
368 367
         // HIDDEN FILENAMES CHECK
@@ -397,7 +396,7 @@  discard block
 block discarded – undo
397 396
 
398 397
 
399 398
 	// CHECK FOR MODX MAX FILE SIZE
400
-	$actualfilesize=filesize($file['tmp_name']);
399
+	$actualfilesize = filesize($file['tmp_name']);
401 400
 	if (isset($this->config['maxfilesize']) && $actualfilesize > $this->config['maxfilesize'])
402 401
 	    return $this->label("File is too big: ".$actualfilesize." Bytes. (max ".$this->config['maxfilesize']." Bytes)");
403 402
 
@@ -410,7 +409,7 @@  discard block
 block discarded – undo
410 409
      * @param bool $existing
411 410
      * @return bool|string
412 411
      */
413
-    protected function checkInputDir($dir, $inclType=true, $existing=true) {
412
+    protected function checkInputDir($dir, $inclType = true, $existing = true){
414 413
         $dir = path::normalize($dir);
415 414
         if (substr($dir, 0, 1) == "/")
416 415
             $dir = substr($dir, 1);
@@ -441,7 +440,7 @@  discard block
 block discarded – undo
441 440
      * @param $type
442 441
      * @return bool
443 442
      */
444
-    protected function validateExtension($ext, $type) {
443
+    protected function validateExtension($ext, $type){
445 444
         $ext = trim(strtolower($ext));
446 445
         if (!isset($this->types[$type]))
447 446
             return false;
@@ -470,7 +469,7 @@  discard block
 block discarded – undo
470 469
      * @param $path
471 470
      * @return mixed
472 471
      */
473
-    protected function getTypeFromPath($path) {
472
+    protected function getTypeFromPath($path){
474 473
         return preg_match('/^([^\/]*)\/.*$/', $path, $patt)
475 474
             ? $patt[1] : $path;
476 475
     }
@@ -479,7 +478,7 @@  discard block
 block discarded – undo
479 478
      * @param $path
480 479
      * @return string
481 480
      */
482
-    protected function removeTypeFromPath($path) {
481
+    protected function removeTypeFromPath($path){
483 482
         return preg_match('/^[^\/]*\/(.*)$/', $path, $patt)
484 483
             ? $patt[1] : "";
485 484
     }
@@ -489,7 +488,7 @@  discard block
 block discarded – undo
489 488
      * @param null $file
490 489
      * @return bool
491 490
      */
492
-    protected function imageResize($image, $file=null) {
491
+    protected function imageResize($image, $file = null){
493 492
 
494 493
         if (!($image instanceof image)) {
495 494
             $img = image::factory($this->imageDriver, $image);
@@ -577,19 +576,19 @@  discard block
 block discarded – undo
577 576
             $img->watermark($this->config['watermark']['file'], $left, $top);
578 577
 		}
579 578
 
580
-        $options = array( 'file' => $file );
579
+        $options = array('file' => $file);
581 580
 
582
-        $type = exif_imagetype( $file );
581
+        $type = exif_imagetype($file);
583 582
 
584
-        switch ( $type ) {
583
+        switch ($type) {
585 584
             case IMAGETYPE_GIF:
586
-                return $img->output( 'gif', $options );
585
+                return $img->output('gif', $options);
587 586
 
588 587
             case IMAGETYPE_PNG:
589
-                return $img->output( 'png', $options );
588
+                return $img->output('png', $options);
590 589
 
591 590
             default:
592
-                return $img->output( 'jpeg', array_merge( $options, array( 'quality' => $this->config['jpegQuality'] ) ) );
591
+                return $img->output('jpeg', array_merge($options, array('quality' => $this->config['jpegQuality'])));
593 592
         }
594 593
 
595 594
     }
@@ -599,7 +598,7 @@  discard block
 block discarded – undo
599 598
      * @param bool $overwrite
600 599
      * @return bool
601 600
      */
602
-    protected function makeThumb($file, $overwrite=true) {
601
+    protected function makeThumb($file, $overwrite = true){
603 602
         $img = image::factory($this->imageDriver, $file);
604 603
 
605 604
         // Drop files which are not images
@@ -607,7 +606,7 @@  discard block
 block discarded – undo
607 606
             return true;
608 607
 
609 608
         $thumb = substr($file, strlen($this->config['uploadDir']));
610
-        $thumb = $this->config['uploadDir'] . "/" . $this->config['thumbsDir'] . "/" . $thumb;
609
+        $thumb = $this->config['uploadDir']."/".$this->config['thumbsDir']."/".$thumb;
611 610
         $thumb = path::normalize($thumb);
612 611
         $thumbDir = dirname($thumb);
613 612
         if (!is_dir($thumbDir) && !@mkdir($thumbDir, $this->config['dirPerms'], true))
@@ -630,15 +629,15 @@  discard block
 block discarded – undo
630 629
         if (!$img->resizeFit($this->config['thumbWidth'], $this->config['thumbHeight']))
631 630
             return false;
632 631
 
633
-        if ( $this->imageDriver == 'gd' ) {
634
-            $width  = imagesx( $img->image );
635
-            $height = imagesy( $img->image );
636
-            $back   = image::factory( $this->imageDriver, array( $width, $height ) );
637
-            $tile   = image::factory( $this->imageDriver, __DIR__ . '/../themes/' . $this->config['theme'] . '/img/bg_transparent.png' );
632
+        if ($this->imageDriver == 'gd') {
633
+            $width  = imagesx($img->image);
634
+            $height = imagesy($img->image);
635
+            $back   = image::factory($this->imageDriver, array($width, $height));
636
+            $tile   = image::factory($this->imageDriver, __DIR__.'/../themes/'.$this->config['theme'].'/img/bg_transparent.png');
638 637
 
639
-            imagesettile( $back->image, $tile->image );
640
-            imagefilledrectangle( $back->image, 0, 0, $width, $height, IMG_COLOR_TILED );
641
-            imagecopy( $back->image, $img->image, 0, 0, 0, 0, $width, $height );
638
+            imagesettile($back->image, $tile->image);
639
+            imagefilledrectangle($back->image, 0, 0, $width, $height, IMG_COLOR_TILED);
640
+            imagecopy($back->image, $img->image, 0, 0, 0, 0, $width, $height);
642 641
 
643 642
             $img = $back;
644 643
         }
@@ -653,7 +652,7 @@  discard block
 block discarded – undo
653 652
     /**
654 653
      * @param $langCode
655 654
      */
656
-    protected function localize($langCode) {
655
+    protected function localize($langCode){
657 656
         require "lang/{$langCode}.php";
658 657
         setlocale(LC_ALL, $lang['_locale']);
659 658
         $this->charset = $lang['_charset'];
@@ -673,7 +672,7 @@  discard block
 block discarded – undo
673 672
      * @param array|null $data
674 673
      * @return mixed
675 674
      */
676
-    protected function label($string, array $data=null) {
675
+    protected function label($string, array $data = null){
677 676
         $return = isset($this->labels[$string]) ? $this->labels[$string] : $string;
678 677
         if (is_array($data))
679 678
             foreach ($data as $key => $val)
@@ -685,7 +684,7 @@  discard block
 block discarded – undo
685 684
      * @param $message
686 685
      * @param array|null $data
687 686
      */
688
-    protected function backMsg($message, array $data=null) {
687
+    protected function backMsg($message, array $data = null){
689 688
         $message = $this->label($message, $data);
690 689
         if (isset($this->file['tmp_name']) && file_exists($this->file['tmp_name']))
691 690
             @unlink($this->file['tmp_name']);
@@ -697,7 +696,7 @@  discard block
 block discarded – undo
697 696
      * @param $url
698 697
      * @param string $message
699 698
      */
700
-    protected function callBack($url, $message="") {
699
+    protected function callBack($url, $message = ""){
701 700
         $message = text::jsValue($message);
702 701
         $CKfuncNum = isset($this->opener['CKEditor']['funcNum'])
703 702
             ? $this->opener['CKEditor']['funcNum'] : 0;
@@ -741,7 +740,7 @@  discard block
 block discarded – undo
741 740
     /**
742 741
      * @return string
743 742
      */
744
-    protected function get_htaccess() {
743
+    protected function get_htaccess(){
745 744
         return "<IfModule mod_php4.c>
746 745
   php_value engine off
747 746
 </IfModule>
Please login to merge, or discard this patch.
manager/media/browser/mcpuk/core/browser.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
             $this->get['dir'] = $dir;
43 43
         }
44 44
 
45
-        $thumbsDir = $this->config['uploadDir'] . "/" . $this->config['thumbsDir'];
45
+        $thumbsDir = $this->config['uploadDir']."/".$this->config['thumbsDir'];
46 46
         if ((
47 47
                 !is_dir($thumbsDir) &&
48 48
                 !@mkdir($thumbsDir, $this->config['dirPerms'])
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
             $this->session['dir'] = $this->type;
115 115
         } else {
116 116
             $type = $this->getTypeFromPath($this->session['dir']);
117
-            $dir = $this->config['uploadDir'] . "/" . $this->session['dir'];
117
+            $dir = $this->config['uploadDir']."/".$this->session['dir'];
118 118
             if (($type != $this->type) || !is_dir($dir) || !is_readable($dir)) {
119 119
                 $this->session['dir'] = $this->type;
120 120
             }
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
         }
189 189
         $file = "{$this->thumbsDir}/{$this->type}/{$this->get['dir']}/$file";
190 190
         if (!is_file($file) || !is_readable($file)) {
191
-            $file = "{$this->config['uploadDir']}/{$this->type}/{$this->get['dir']}/" . basename($file);
191
+            $file = "{$this->config['uploadDir']}/{$this->type}/{$this->get['dir']}/".basename($file);
192 192
             if (!is_file($file) || !is_readable($file)) {
193 193
                 $this->sendDefaultThumb($file);
194 194
             }
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
     protected function act_chDir()
228 228
     {
229 229
         $this->postDir(); // Just for existing check
230
-        $this->session['dir'] = $this->type . "/" . $this->post['dir'];
230
+        $this->session['dir'] = $this->type."/".$this->post['dir'];
231 231
         $dirWritable = dir::isWritable("{$this->config['uploadDir']}/{$this->session['dir']}");
232 232
 
233 233
         return json_encode(array(
@@ -292,12 +292,12 @@  discard block
 block discarded – undo
292 292
         if (substr($newName, 0, 1) == ".") {
293 293
             $this->errorMsg("Folder name shouldn't begins with '.'");
294 294
         }
295
-        if (!@rename($dir, dirname($dir) . "/$newName")) {
295
+        if (!@rename($dir, dirname($dir)."/$newName")) {
296 296
             $this->errorMsg("Cannot rename the folder.");
297 297
         }
298 298
         $thumbDir = "$this->thumbsTypeDir/{$this->post['dir']}";
299 299
         if (is_dir($thumbDir)) {
300
-            @rename($thumbDir, dirname($thumbDir) . "/$newName");
300
+            @rename($thumbDir, dirname($thumbDir)."/$newName");
301 301
         }
302 302
 
303 303
         return json_encode(array('name' => $newName));
@@ -375,9 +375,9 @@  discard block
 block discarded – undo
375 375
         header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
376 376
         header("Cache-Control: private", false);
377 377
         header("Content-Type: application/octet-stream");
378
-        header('Content-Disposition: attachment; filename="' . str_replace('"', "_", $this->post['file']) . '"');
378
+        header('Content-Disposition: attachment; filename="'.str_replace('"', "_", $this->post['file']).'"');
379 379
         header("Content-Transfer-Encoding:­ binary");
380
-        header("Content-Length: " . filesize($file));
380
+        header("Content-Length: ".filesize($file));
381 381
         readfile($file);
382 382
         die;
383 383
     }
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
         $thumbFile = "$thumbDir/{$this->post['file']}";
435 435
 
436 436
         if (file_exists($thumbFile)) {
437
-            @rename($thumbFile, "$thumbDir/" . basename($newName));
437
+            @rename($thumbFile, "$thumbDir/".basename($newName));
438 438
         }
439 439
 
440 440
         return true;
@@ -514,11 +514,11 @@  discard block
 block discarded – undo
514 514
             if (!file_exists($path)) {
515 515
                 $error[] = $this->label("The file '{file}' does not exist.", $replace);
516 516
             } elseif (substr($base, 0, 1) == ".") {
517
-                $error[] = "$base: " . $this->label("File name shouldn't begins with '.'");
517
+                $error[] = "$base: ".$this->label("File name shouldn't begins with '.'");
518 518
             } elseif (!$this->validateExtension($ext, $type)) {
519
-                $error[] = "$base: " . $this->label("Denied file extension.");
519
+                $error[] = "$base: ".$this->label("Denied file extension.");
520 520
             } elseif (file_exists("$dir/$base")) {
521
-                $error[] = "$base: " . $this->label("A file or folder with that name already exists.");
521
+                $error[] = "$base: ".$this->label("A file or folder with that name already exists.");
522 522
             } elseif (!is_readable($path) || !is_file($path)) {
523 523
                 $error[] = $this->label("Cannot read '{file}'.", $replace);
524 524
             } elseif (!@copy($path, "$dir/$base")) {
@@ -578,11 +578,11 @@  discard block
 block discarded – undo
578 578
             if (!file_exists($path)) {
579 579
                 $error[] = $this->label("The file '{file}' does not exist.", $replace);
580 580
             } elseif (substr($base, 0, 1) == ".") {
581
-                $error[] = "$base: " . $this->label("File name shouldn't begins with '.'");
581
+                $error[] = "$base: ".$this->label("File name shouldn't begins with '.'");
582 582
             } elseif (!$this->validateExtension($ext, $type)) {
583
-                $error[] = "$base: " . $this->label("Denied file extension.");
583
+                $error[] = "$base: ".$this->label("Denied file extension.");
584 584
             } elseif (file_exists("$dir/$base")) {
585
-                $error[] = "$base: " . $this->label("A file or folder with that name already exists.");
585
+                $error[] = "$base: ".$this->label("A file or folder with that name already exists.");
586 586
             } elseif (!is_readable($path) || !is_file($path)) {
587 587
                 $error[] = $this->label("Cannot read '{file}'.", $replace);
588 588
             } elseif (!file::isWritable($path) || !@rename($path, "$dir/$base")) {
@@ -635,7 +635,7 @@  discard block
 block discarded – undo
635 635
             }
636 636
             $path = "{$this->config['uploadDir']}/$file";
637 637
             $base = basename($file);
638
-            $filepath = str_replace('/' . $base, '', $path);
638
+            $filepath = str_replace('/'.$base, '', $path);
639 639
             $replace = array('file' => $base);
640 640
             if (!is_file($path)) {
641 641
                 $error[] = $this->label("The file '{file}' does not exist.", $replace);
@@ -681,15 +681,15 @@  discard block
 block discarded – undo
681 681
         if (!isset($this->post['dir']) || $this->config['denyZipDownload']) {
682 682
             $this->errorMsg("Unknown error.");
683 683
         }
684
-        $filename = basename($dir) . ".zip";
684
+        $filename = basename($dir).".zip";
685 685
         do {
686
-            $file = md5(time() . session_id());
686
+            $file = md5(time().session_id());
687 687
             $file = "{$this->config['uploadDir']}/$file.zip";
688 688
         } while (file_exists($file));
689 689
         new zipFolder($file, $dir);
690 690
         header("Content-Type: application/x-zip");
691
-        header('Content-Disposition: attachment; filename="' . str_replace('"', "_", $filename) . '"');
692
-        header("Content-Length: " . filesize($file));
691
+        header('Content-Disposition: attachment; filename="'.str_replace('"', "_", $filename).'"');
692
+        header("Content-Length: ".filesize($file));
693 693
         readfile($file);
694 694
         unlink($file);
695 695
         die;
@@ -723,7 +723,7 @@  discard block
 block discarded – undo
723 723
         }
724 724
 
725 725
         do {
726
-            $file = md5(time() . session_id());
726
+            $file = md5(time().session_id());
727 727
             $file = "{$this->config['uploadDir']}/$file.zip";
728 728
         } while (file_exists($file));
729 729
 
@@ -736,8 +736,8 @@  discard block
 block discarded – undo
736 736
             $zip->close();
737 737
         }
738 738
         header("Content-Type: application/x-zip");
739
-        header('Content-Disposition: attachment; filename="selected_files_' . basename($file) . '"');
740
-        header("Content-Length: " . filesize($file));
739
+        header('Content-Disposition: attachment; filename="selected_files_'.basename($file).'"');
740
+        header("Content-Length: ".filesize($file));
741 741
         readfile($file);
742 742
         unlink($file);
743 743
         die;
@@ -766,7 +766,7 @@  discard block
 block discarded – undo
766 766
             if ($type != $this->type) {
767 767
                 continue;
768 768
             }
769
-            $file = $this->config['uploadDir'] . "/$file";
769
+            $file = $this->config['uploadDir']."/$file";
770 770
             if (!is_file($file) || !is_readable($file)) {
771 771
                 continue;
772 772
             }
@@ -774,7 +774,7 @@  discard block
 block discarded – undo
774 774
         }
775 775
 
776 776
         do {
777
-            $file = md5(time() . session_id());
777
+            $file = md5(time().session_id());
778 778
             $file = "{$this->config['uploadDir']}/$file.zip";
779 779
         } while (file_exists($file));
780 780
 
@@ -787,8 +787,8 @@  discard block
 block discarded – undo
787 787
             $zip->close();
788 788
         }
789 789
         header("Content-Type: application/x-zip");
790
-        header('Content-Disposition: attachment; filename="clipboard_' . basename($file) . '"');
791
-        header("Content-Length: " . filesize($file));
790
+        header('Content-Disposition: attachment; filename="clipboard_'.basename($file).'"');
791
+        header("Content-Length: ".filesize($file));
792 792
         readfile($file);
793 793
         unlink($file);
794 794
         die;
@@ -824,7 +824,7 @@  discard block
 block discarded – undo
824 824
             return $response;
825 825
         }
826 826
         $filename = $this->normalizeFilename($file['name']);
827
-        $target = "$dir/" . file::getInexistantFilename($filename, $dir);
827
+        $target = "$dir/".file::getInexistantFilename($filename, $dir);
828 828
 
829 829
         if (!@move_uploaded_file($file['tmp_name'], $target) &&
830 830
             !@rename($file['tmp_name'], $target) &&
@@ -890,7 +890,7 @@  discard block
 block discarded – undo
890 890
                 if (is_array($size) && count($size)) {
891 891
                     $preview = true;
892 892
                     if (!$this->config['noThumbnailsRecreation']) {
893
-                        $thumb_file = "$thumbDir/" . basename($file);
893
+                        $thumb_file = "$thumbDir/".basename($file);
894 894
                         if (!is_file($thumb_file) || filemtime($file) > filemtime($thumb_file)) {
895 895
                             $this->makeThumb($file);
896 896
                         }
@@ -907,7 +907,7 @@  discard block
 block discarded – undo
907 907
             }
908 908
             $name = basename($file);
909 909
             $types = $this->config['types'];
910
-            $types = explode(' ', $types['images'] . ' ' . $types['image']);
910
+            $types = explode(' ', $types['images'].' '.$types['image']);
911 911
             if (substr($name, 0, 1) == '.' && !$this->config['showHiddenFiles']) {
912 912
                 continue;
913 913
             }
@@ -987,7 +987,7 @@  discard block
 block discarded – undo
987 987
     {
988 988
         $dir = $this->typeDir;
989 989
         if (isset($this->post['dir'])) {
990
-            $dir .= "/" . $this->post['dir'];
990
+            $dir .= "/".$this->post['dir'];
991 991
         }
992 992
         if ($existent && (!is_dir($dir) || !is_readable($dir))) {
993 993
             $this->errorMsg("Inexistant or inaccessible folder.");
@@ -1004,7 +1004,7 @@  discard block
 block discarded – undo
1004 1004
     {
1005 1005
         $dir = $this->typeDir;
1006 1006
         if (isset($this->get['dir'])) {
1007
-            $dir .= "/" . $this->get['dir'];
1007
+            $dir .= "/".$this->get['dir'];
1008 1008
         }
1009 1009
         if ($existent && (!is_dir($dir) || !is_readable($dir))) {
1010 1010
             $this->errorMsg("Inexistant or inaccessible folder.");
Please login to merge, or discard this patch.
manager/includes/src/Core.php 1 patch
Spacing   +274 added lines, -274 removed lines patch added patch discarded remove patch
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
         if (empty($services)) {
173 173
             $services   = include EVO_SERVICES_FILE;
174 174
         }
175
-        $this->services     =  $services;
175
+        $this->services = $services;
176 176
 
177 177
         $this->initialize();
178 178
     }
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
 
237 237
     private function checkServiceAlias($name){
238 238
         foreach ($this->providerAliases as $alias => $interface) {
239
-            if($name === $interface) {
239
+            if ($name === $interface) {
240 240
                 return $alias;
241 241
             }
242 242
         }
@@ -415,8 +415,8 @@  discard block
 block discarded – undo
415 415
         if (isset($this->providerAliases[$name])) {
416 416
             if ($this->getConfig('error_reporting', 0) > 1) {
417 417
                 trigger_error(
418
-                    'Property $' . $name . ' is deprecated and should no longer be used. ' .
419
-                    'Alternative ->getService(' . $this->providerAliases[$name] . '::class)',
418
+                    'Property $'.$name.' is deprecated and should no longer be used. '.
419
+                    'Alternative ->getService('.$this->providerAliases[$name].'::class)',
420 420
                     E_USER_DEPRECATED
421 421
                 );
422 422
             }
@@ -452,12 +452,12 @@  discard block
 block discarded – undo
452 452
             $info = debug_backtrace();
453 453
             $m[] = $msg;
454 454
             if (!empty($this->currentSnippet)) {
455
-                $m[] = 'Snippet - ' . $this->currentSnippet;
455
+                $m[] = 'Snippet - '.$this->currentSnippet;
456 456
             } elseif (!empty($this->event->activePlugin)) {
457
-                $m[] = 'Plugin - ' . $this->event->activePlugin;
457
+                $m[] = 'Plugin - '.$this->event->activePlugin;
458 458
             }
459 459
             $m[] = $this->decoded_request_uri;
460
-            $m[] = str_replace('\\', '/', $info[0]['file']) . '(line:' . $info[0]['line'] . ')';
460
+            $m[] = str_replace('\\', '/', $info[0]['file']).'(line:'.$info[0]['line'].')';
461 461
             $msg = implode('<br />', $m);
462 462
             $this->logEvent(0, $error_type, $msg, $title);
463 463
         }
@@ -474,7 +474,7 @@  discard block
 block discarded – undo
474 474
     {
475 475
         $flag = false;
476 476
         if (is_scalar($connector) && !empty($connector) && isset($this->{$connector}) && $this->{$connector} instanceof Interfaces\DatabaseInterface) {
477
-            $flag = (bool)$this->{$connector}->conn;
477
+            $flag = (bool) $this->{$connector}->conn;
478 478
         }
479 479
         return $flag;
480 480
     }
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
             }
506 506
             if (!$out && $flag) {
507 507
                 $extname = trim(str_replace(array('..', '/', '\\'), '', strtolower($extname)));
508
-                $filename = MODX_MANAGER_PATH . "includes/extenders/ex_{$extname}.inc.php";
508
+                $filename = MODX_MANAGER_PATH."includes/extenders/ex_{$extname}.inc.php";
509 509
                 $out = is_file($filename) ? include $filename : false;
510 510
             }
511 511
             if ($out && !in_array($extname, $this->extensions)) {
@@ -523,7 +523,7 @@  discard block
 block discarded – undo
523 523
     public function getMicroTime()
524 524
     {
525 525
         list ($usec, $sec) = explode(' ', microtime());
526
-        return ((float)$usec + (float)$sec);
526
+        return ((float) $usec + (float) $sec);
527 527
     }
528 528
 
529 529
     /**
@@ -547,7 +547,7 @@  discard block
 block discarded – undo
547 547
             // append the redirect count string to the url
548 548
             $currentNumberOfRedirects = isset ($_REQUEST['err']) ? $_REQUEST['err'] : 0;
549 549
             if ($currentNumberOfRedirects > 3) {
550
-                $this->messageQuit('Redirection attempt failed - please ensure the document you\'re trying to redirect to exists. <p>Redirection URL: <i>' . $url . '</i></p>');
550
+                $this->messageQuit('Redirection attempt failed - please ensure the document you\'re trying to redirect to exists. <p>Redirection URL: <i>'.$url.'</i></p>');
551 551
             } else {
552 552
                 $currentNumberOfRedirects += 1;
553 553
                 if (strpos($url, "?") > 0) {
@@ -558,19 +558,19 @@  discard block
 block discarded – undo
558 558
             }
559 559
         }
560 560
         if ($type == 'REDIRECT_REFRESH') {
561
-            $header = 'Refresh: 0;URL=' . $url;
561
+            $header = 'Refresh: 0;URL='.$url;
562 562
         } elseif ($type == 'REDIRECT_META') {
563
-            $header = '<META HTTP-EQUIV="Refresh" CONTENT="0; URL=' . $url . '" />';
563
+            $header = '<META HTTP-EQUIV="Refresh" CONTENT="0; URL='.$url.'" />';
564 564
             echo $header;
565 565
             exit;
566 566
         } elseif ($type == 'REDIRECT_HEADER' || empty ($type)) {
567 567
             // check if url has /$base_url
568 568
             if (substr($url, 0, strlen(MODX_BASE_URL)) == MODX_BASE_URL) {
569 569
                 // append $site_url to make it work with Location:
570
-                $url = MODX_SITE_URL . substr($url, strlen(MODX_BASE_URL));
570
+                $url = MODX_SITE_URL.substr($url, strlen(MODX_BASE_URL));
571 571
             }
572 572
             if (strpos($url, "\n") === false) {
573
-                $header = 'Location: ' . $url;
573
+                $header = 'Location: '.$url;
574 574
             } else {
575 575
                 $this->messageQuit('No newline allowed in redirect url.');
576 576
             }
@@ -579,7 +579,7 @@  discard block
 block discarded – undo
579 579
             header($responseCode);
580 580
         }
581 581
 
582
-        if(!empty($header)) {
582
+        if (!empty($header)) {
583 583
             header($header);
584 584
         }
585 585
 
@@ -684,8 +684,8 @@  discard block
 block discarded – undo
684 684
 
685 685
     private function recoverySiteCache()
686 686
     {
687
-        $site_cache_dir = MODX_BASE_PATH . $this->getCacheFolder();
688
-        $site_cache_path = $site_cache_dir . 'siteCache.idx.php';
687
+        $site_cache_dir = MODX_BASE_PATH.$this->getCacheFolder();
688
+        $site_cache_path = $site_cache_dir.'siteCache.idx.php';
689 689
 
690 690
         if (is_file($site_cache_path)) {
691 691
             include($site_cache_path);
@@ -748,8 +748,8 @@  discard block
 block discarded – undo
748 748
                 $this->invokeEvent("OnBeforeManagerPageInit");
749 749
             }
750 750
 
751
-            if (isset ($_SESSION[$usrType . 'UsrConfigSet'])) {
752
-                $usrSettings = &$_SESSION[$usrType . 'UsrConfigSet'];
751
+            if (isset ($_SESSION[$usrType.'UsrConfigSet'])) {
752
+                $usrSettings = &$_SESSION[$usrType.'UsrConfigSet'];
753 753
             } else {
754 754
                 if ($usrType == 'web') {
755 755
                     $from = $tbl_web_user_settings;
@@ -769,7 +769,7 @@  discard block
 block discarded – undo
769 769
                     $usrSettings[$row['setting_name']] = $row['setting_value'];
770 770
                 }
771 771
                 if (isset ($usrType)) {
772
-                    $_SESSION[$usrType . 'UsrConfigSet'] = $usrSettings;
772
+                    $_SESSION[$usrType.'UsrConfigSet'] = $usrSettings;
773 773
                 } // store user settings in session
774 774
             }
775 775
         }
@@ -914,10 +914,10 @@  discard block
 block discarded – undo
914 914
         $suf = $this->config['friendly_url_suffix'];
915 915
         $pre = preg_quote($pre, '/');
916 916
         $suf = preg_quote($suf, '/');
917
-        if ($pre && preg_match('@^' . $pre . '(.*)$@', $q, $_)) {
917
+        if ($pre && preg_match('@^'.$pre.'(.*)$@', $q, $_)) {
918 918
             $q = $_[1];
919 919
         }
920
-        if ($suf && preg_match('@(.*)' . $suf . '$@', $q, $_)) {
920
+        if ($suf && preg_match('@(.*)'.$suf.'$@', $q, $_)) {
921 921
             $q = $_[1];
922 922
         }
923 923
 
@@ -939,7 +939,7 @@  discard block
 block discarded – undo
939 939
         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 */
940 940
             /* FS#476 and FS#308: check that id is valid in terms of virtualDir structure */
941 941
             if ($this->config['use_alias_path'] == 1) {
942
-                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))))) {
942
+                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))))) {
943 943
                     $this->documentMethod = 'id';
944 944
                     return $q;
945 945
                 } else { /* not a valid id in terms of virtualDir, treat as alias */
@@ -973,7 +973,7 @@  discard block
 block discarded – undo
973 973
      */
974 974
     public function getHashFile($key)
975 975
     {
976
-        return $this->getCacheFolder() . "docid_" . $key . ".pageCache.php";
976
+        return $this->getCacheFolder()."docid_".$key.".pageCache.php";
977 977
     }
978 978
 
979 979
     /**
@@ -984,9 +984,9 @@  discard block
 block discarded – undo
984 984
         $hash = $id;
985 985
         $tmp = null;
986 986
         $params = array();
987
-        if(!empty($this->systemCacheKey)){
987
+        if (!empty($this->systemCacheKey)) {
988 988
             $hash = $this->systemCacheKey;
989
-        }else {
989
+        } else {
990 990
             if (!empty($_GET)) {
991 991
                 // Sort GET parameters so that the order of parameters on the HTTP request don't affect the generated cache ID.
992 992
                 $params = $_GET;
@@ -994,8 +994,8 @@  discard block
 block discarded – undo
994 994
                 $hash .= '_'.md5(http_build_query($params));
995 995
             }
996 996
         }
997
-        $evtOut = $this->invokeEvent("OnMakePageCacheKey", array ("hash" => $hash, "id" => $id, 'params' => $params));
998
-        if (is_array($evtOut) && count($evtOut) > 0){
997
+        $evtOut = $this->invokeEvent("OnMakePageCacheKey", array("hash" => $hash, "id" => $id, 'params' => $params));
998
+        if (is_array($evtOut) && count($evtOut) > 0) {
999 999
             $tmp = array_pop($evtOut);
1000 1000
         }
1001 1001
         return empty($tmp) ? $hash : $tmp;
@@ -1143,12 +1143,12 @@  discard block
 block discarded – undo
1143 1143
         if ($js = $this->getRegisteredClientStartupScripts()) {
1144 1144
             // change to just before closing </head>
1145 1145
             // $this->documentContent = preg_replace("/(<head[^>]*>)/i", "\\1\n".$js, $this->documentContent);
1146
-            $this->documentOutput = preg_replace("/(<\/head>)/i", $js . "\n\\1", $this->documentOutput);
1146
+            $this->documentOutput = preg_replace("/(<\/head>)/i", $js."\n\\1", $this->documentOutput);
1147 1147
         }
1148 1148
 
1149 1149
         // Insert jscripts & html block into template - template must have a </body> tag
1150 1150
         if ($js = $this->getRegisteredClientScripts()) {
1151
-            $this->documentOutput = preg_replace("/(<\/body>)/i", $js . "\n\\1", $this->documentOutput);
1151
+            $this->documentOutput = preg_replace("/(<\/body>)/i", $js."\n\\1", $this->documentOutput);
1152 1152
         }
1153 1153
         // End fix by sirlancelot
1154 1154
 
@@ -1159,7 +1159,7 @@  discard block
 block discarded – undo
1159 1159
         // send out content-type and content-disposition headers
1160 1160
         if (IN_PARSER_MODE == "true") {
1161 1161
             $type = !empty ($this->contentTypes[$this->documentIdentifier]) ? $this->contentTypes[$this->documentIdentifier] : "text/html";
1162
-            header('Content-Type: ' . $type . '; charset=' . $this->config['modx_charset']);
1162
+            header('Content-Type: '.$type.'; charset='.$this->config['modx_charset']);
1163 1163
             //            if (($this->documentIdentifier == $this->config['error_page']) || $redirect_error)
1164 1164
             //                header('HTTP/1.0 404 Not Found');
1165 1165
             if (!$this->checkPreview() && $this->documentObject['content_dispo'] == 1) {
@@ -1177,7 +1177,7 @@  discard block
 block discarded – undo
1177 1177
                     $name = preg_replace('|-+|', '-', $name);
1178 1178
                     $name = trim($name, '-');
1179 1179
                 }
1180
-                $header = 'Content-Disposition: attachment; filename=' . $name;
1180
+                $header = 'Content-Disposition: attachment; filename='.$name;
1181 1181
                 header($header);
1182 1182
             }
1183 1183
         }
@@ -1185,7 +1185,7 @@  discard block
 block discarded – undo
1185 1185
 
1186 1186
         $stats = $this->getTimerStats($this->tstart);
1187 1187
 
1188
-        $out =& $this->documentOutput;
1188
+        $out = & $this->documentOutput;
1189 1189
         $out = str_replace("[^q^]", $stats['queries'], $out);
1190 1190
         $out = str_replace("[^qt^]", $stats['queryTime'], $out);
1191 1191
         $out = str_replace("[^p^]", $stats['phpTime'], $out);
@@ -1224,17 +1224,17 @@  discard block
 block discarded – undo
1224 1224
                 $sc .= sprintf("%s. %s (%s)<br>", $s, $sname, sprintf("%2.2f ms", $t)); // currentSnippet
1225 1225
                 $tt += $t;
1226 1226
             }
1227
-            echo "<fieldset><legend><b>Snippets</b> (" . count($this->snippetsTime) . " / " . sprintf("%2.2f ms", $tt) . ")</legend>{$sc}</fieldset><br />";
1227
+            echo "<fieldset><legend><b>Snippets</b> (".count($this->snippetsTime)." / ".sprintf("%2.2f ms", $tt).")</legend>{$sc}</fieldset><br />";
1228 1228
             echo $this->snippetsCode;
1229 1229
         }
1230 1230
         if ($this->dumpPlugins) {
1231 1231
             $ps = "";
1232 1232
             $tt = 0;
1233 1233
             foreach ($this->pluginsTime as $s => $t) {
1234
-                $ps .= "$s (" . sprintf("%2.2f ms", $t * 1000) . ")<br>";
1234
+                $ps .= "$s (".sprintf("%2.2f ms", $t * 1000).")<br>";
1235 1235
                 $tt += $t;
1236 1236
             }
1237
-            echo "<fieldset><legend><b>Plugins</b> (" . count($this->pluginsTime) . " / " . sprintf("%2.2f ms", $tt * 1000) . ")</legend>{$ps}</fieldset><br />";
1237
+            echo "<fieldset><legend><b>Plugins</b> (".count($this->pluginsTime)." / ".sprintf("%2.2f ms", $tt * 1000).")</legend>{$ps}</fieldset><br />";
1238 1238
             echo $this->pluginsCode;
1239 1239
         }
1240 1240
 
@@ -1260,7 +1260,7 @@  discard block
 block discarded – undo
1260 1260
         $srcTags = explode(',', $tags);
1261 1261
         $repTags = array();
1262 1262
         foreach ($srcTags as $tag) {
1263
-            $repTags[] = '\\' . $tag[0] . '\\' . $tag[1];
1263
+            $repTags[] = '\\'.$tag[0].'\\'.$tag[1];
1264 1264
         }
1265 1265
         return array($srcTags, $repTags);
1266 1266
     }
@@ -1282,7 +1282,7 @@  discard block
 block discarded – undo
1282 1282
         $stats['phpTime'] = sprintf("%2.4f s", $stats['phpTime']);
1283 1283
         $stats['source'] = $this->documentGenerated == 1 ? "database" : "cache";
1284 1284
         $stats['queries'] = isset ($this->executedQueries) ? $this->executedQueries : 0;
1285
-        $stats['phpMemory'] = (memory_get_peak_usage(true) / 1024 / 1024) . " mb";
1285
+        $stats['phpMemory'] = (memory_get_peak_usage(true) / 1024 / 1024)." mb";
1286 1286
 
1287 1287
         return $stats;
1288 1288
     }
@@ -1315,7 +1315,7 @@  discard block
 block discarded – undo
1315 1315
     {
1316 1316
         $cacheRefreshTime = 0;
1317 1317
         $recent_update = 0;
1318
-        @include(MODX_BASE_PATH . $this->getCacheFolder() . 'sitePublishing.idx.php');
1318
+        @include(MODX_BASE_PATH.$this->getCacheFolder().'sitePublishing.idx.php');
1319 1319
         $this->recentUpdate = $recent_update;
1320 1320
 
1321 1321
         $timeNow = $_SERVER['REQUEST_TIME'] + $this->config['server_offset_time'];
@@ -1397,8 +1397,8 @@  discard block
 block discarded – undo
1397 1397
                 }
1398 1398
 
1399 1399
                 $docObjSerial = serialize($this->documentObject);
1400
-                $cacheContent = $docObjSerial . "<!--__MODxCacheSpliter__-->" . $this->documentContent;
1401
-                $page_cache_path = MODX_BASE_PATH . $this->getHashFile($this->cacheKey);
1400
+                $cacheContent = $docObjSerial."<!--__MODxCacheSpliter__-->".$this->documentContent;
1401
+                $page_cache_path = MODX_BASE_PATH.$this->getHashFile($this->cacheKey);
1402 1402
                 file_put_contents($page_cache_path, "<?php die('Unauthorized access.'); ?>$cacheContent");
1403 1403
             }
1404 1404
         }
@@ -1440,16 +1440,16 @@  discard block
 block discarded – undo
1440 1440
             return array();
1441 1441
         }
1442 1442
         $spacer = md5('<<<EVO>>>');
1443
-        if($left==='{{' && strpos($content,';}}')!==false)  $content = str_replace(';}}', sprintf(';}%s}',   $spacer),$content);
1444
-        if($left==='{{' && strpos($content,'{{}}')!==false) $content = str_replace('{{}}',sprintf('{%$1s{}%$1s}',$spacer),$content);
1445
-        if($left==='[[' && strpos($content,']]]]')!==false) $content = str_replace(']]]]',sprintf(']]%s]]',  $spacer),$content);
1446
-        if($left==='[[' && strpos($content,']]]')!==false)  $content = str_replace(']]]', sprintf(']%s]]',   $spacer),$content);
1443
+        if ($left === '{{' && strpos($content, ';}}') !== false)  $content = str_replace(';}}', sprintf(';}%s}', $spacer), $content);
1444
+        if ($left === '{{' && strpos($content, '{{}}') !== false) $content = str_replace('{{}}', sprintf('{%$1s{}%$1s}', $spacer), $content);
1445
+        if ($left === '[[' && strpos($content, ']]]]') !== false) $content = str_replace(']]]]', sprintf(']]%s]]', $spacer), $content);
1446
+        if ($left === '[[' && strpos($content, ']]]') !== false)  $content = str_replace(']]]', sprintf(']%s]]', $spacer), $content);
1447 1447
 
1448 1448
         $pos['<![CDATA['] = strpos($content, '<![CDATA[');
1449 1449
         $pos[']]>'] = strpos($content, ']]>');
1450 1450
 
1451 1451
         if ($pos['<![CDATA['] !== false && $pos[']]>'] !== false) {
1452
-            $content = substr($content, 0, $pos['<![CDATA[']) . substr($content, $pos[']]>'] + 3);
1452
+            $content = substr($content, 0, $pos['<![CDATA[']).substr($content, $pos[']]>'] + 3);
1453 1453
         }
1454 1454
 
1455 1455
         $lp = explode($left, $content);
@@ -1513,8 +1513,8 @@  discard block
 block discarded – undo
1513 1513
                 }
1514 1514
             }
1515 1515
         }
1516
-        foreach($tags as $i=>$tag) {
1517
-            if(strpos($tag,$spacer)!==false) $tags[$i] = str_replace($spacer, '', $tag);
1516
+        foreach ($tags as $i=>$tag) {
1517
+            if (strpos($tag, $spacer) !== false) $tags[$i] = str_replace($spacer, '', $tag);
1518 1518
         }
1519 1519
         return $tags;
1520 1520
     }
@@ -1554,7 +1554,7 @@  discard block
 block discarded – undo
1554 1554
         }
1555 1555
 
1556 1556
         foreach ($matches[1] as $i => $key) {
1557
-            if(strpos($key,'[+')!==false) continue; // Allow chunk {{chunk?&param=`xxx`}} with [*tv_name_[+param+]*] as content
1557
+            if (strpos($key, '[+') !== false) continue; // Allow chunk {{chunk?&param=`xxx`}} with [*tv_name_[+param+]*] as content
1558 1558
             if (substr($key, 0, 1) == '#') {
1559 1559
                 $key = substr($key, 1);
1560 1560
             } // remove # for QuickEdit format
@@ -1584,8 +1584,8 @@  discard block
 block discarded – undo
1584 1584
 
1585 1585
             if (strpos($content, $s) !== false) {
1586 1586
                 $content = str_replace($s, $value, $content);
1587
-            } elseif($this->debug) {
1588
-                $this->addLog('mergeDocumentContent parse error', $_SERVER['REQUEST_URI'] . $s, 2);
1587
+            } elseif ($this->debug) {
1588
+                $this->addLog('mergeDocumentContent parse error', $_SERVER['REQUEST_URI'].$s, 2);
1589 1589
             }
1590 1590
         }
1591 1591
 
@@ -1752,8 +1752,8 @@  discard block
 block discarded – undo
1752 1752
             $s = &$matches[0][$i];
1753 1753
             if (strpos($content, $s) !== false) {
1754 1754
                 $content = str_replace($s, $value, $content);
1755
-            } elseif($this->debug) {
1756
-                $this->addLog('mergeSettingsContent parse error', $_SERVER['REQUEST_URI'] . $s, 2);
1755
+            } elseif ($this->debug) {
1756
+                $this->addLog('mergeSettingsContent parse error', $_SERVER['REQUEST_URI'].$s, 2);
1757 1757
             }
1758 1758
         }
1759 1759
         return $content;
@@ -1806,7 +1806,7 @@  discard block
 block discarded – undo
1806 1806
             }
1807 1807
 
1808 1808
             $value = $this->parseText($value, $params); // parse local scope placeholers for ConditionalTags
1809
-            $value = $this->mergePlaceholderContent($value, $params);  // parse page global placeholers
1809
+            $value = $this->mergePlaceholderContent($value, $params); // parse page global placeholers
1810 1810
             if ($this->config['enable_at_syntax']) {
1811 1811
                 $value = $this->mergeConditionalTagsContent($value);
1812 1812
             }
@@ -1821,8 +1821,8 @@  discard block
 block discarded – undo
1821 1821
             $s = &$matches[0][$i];
1822 1822
             if (strpos($content, $s) !== false) {
1823 1823
                 $content = str_replace($s, $value, $content);
1824
-            } elseif($this->debug) {
1825
-                $this->addLog('mergeChunkContent parse error', $_SERVER['REQUEST_URI'] . $s, 2);
1824
+            } elseif ($this->debug) {
1825
+                $this->addLog('mergeChunkContent parse error', $_SERVER['REQUEST_URI'].$s, 2);
1826 1826
             }
1827 1827
         }
1828 1828
         return $content;
@@ -1880,8 +1880,8 @@  discard block
 block discarded – undo
1880 1880
             $s = &$matches[0][$i];
1881 1881
             if (strpos($content, $s) !== false) {
1882 1882
                 $content = str_replace($s, $value, $content);
1883
-            } elseif($this->debug) {
1884
-                $this->addLog('mergePlaceholderContent parse error', $_SERVER['REQUEST_URI'] . $s, 2);
1883
+            } elseif ($this->debug) {
1884
+                $this->addLog('mergePlaceholderContent parse error', $_SERVER['REQUEST_URI'].$s, 2);
1885 1885
             }
1886 1886
         }
1887 1887
         return $content;
@@ -1905,7 +1905,7 @@  discard block
 block discarded – undo
1905 1905
             return $content;
1906 1906
         }
1907 1907
 
1908
-        $sp = '#' . md5('ConditionalTags' . $_SERVER['REQUEST_TIME']) . '#';
1908
+        $sp = '#'.md5('ConditionalTags'.$_SERVER['REQUEST_TIME']).'#';
1909 1909
         $content = str_replace(array('<?php', '<?=', '<?', '?>'), array("{$sp}b", "{$sp}p", "{$sp}s", "{$sp}e"), $content);
1910 1910
 
1911 1911
         $pieces = explode('<@IF:', $content);
@@ -1916,7 +1916,7 @@  discard block
 block discarded – undo
1916 1916
             }
1917 1917
             list($cmd, $text) = explode('>', $split, 2);
1918 1918
             $cmd = str_replace("'", "\'", $cmd);
1919
-            $content .= "<?php if(\$this->_parseCTagCMD('" . $cmd . "')): ?>";
1919
+            $content .= "<?php if(\$this->_parseCTagCMD('".$cmd."')): ?>";
1920 1920
             $content .= $text;
1921 1921
         }
1922 1922
         $pieces = explode('<@ELSEIF:', $content);
@@ -1927,13 +1927,13 @@  discard block
 block discarded – undo
1927 1927
             }
1928 1928
             list($cmd, $text) = explode('>', $split, 2);
1929 1929
             $cmd = str_replace("'", "\'", $cmd);
1930
-            $content .= "<?php elseif(\$this->_parseCTagCMD('" . $cmd . "')): ?>";
1930
+            $content .= "<?php elseif(\$this->_parseCTagCMD('".$cmd."')): ?>";
1931 1931
             $content .= $text;
1932 1932
         }
1933 1933
 
1934 1934
         $content = str_replace(array('<@ELSE>', '<@ENDIF>'), array('<?php else:?>', '<?php endif;?>'), $content);
1935 1935
         ob_start();
1936
-        $content = eval('?>' . $content);
1936
+        $content = eval('?>'.$content);
1937 1937
         $content = ob_get_clean();
1938 1938
         $content = str_replace(array("{$sp}b", "{$sp}p", "{$sp}s", "{$sp}e"), array('<?php', '<?=', '<?', '?>'), $content);
1939 1939
 
@@ -2058,7 +2058,7 @@  discard block
 block discarded – undo
2058 2058
         $matches = $this->getTagsFromContent($content, $left, $right);
2059 2059
         if (!empty($matches)) {
2060 2060
             foreach ($matches[0] as $i => $v) {
2061
-                $addBreakMatches[$i] = $v . "\n";
2061
+                $addBreakMatches[$i] = $v."\n";
2062 2062
             }
2063 2063
             $content = str_replace($addBreakMatches, '', $content);
2064 2064
             if (strpos($content, $left) !== false) {
@@ -2091,8 +2091,8 @@  discard block
 block discarded – undo
2091 2091
             $s = &$matches[0][$i];
2092 2092
             if (strpos($content, $s) !== false) {
2093 2093
                 $content = str_replace($s, $v, $content);
2094
-            } elseif($this->debug) {
2095
-                $this->addLog('ignoreCommentedTagsContent parse error', $_SERVER['REQUEST_URI'] . $s, 2);
2094
+            } elseif ($this->debug) {
2095
+                $this->addLog('ignoreCommentedTagsContent parse error', $_SERVER['REQUEST_URI'].$s, 2);
2096 2096
             }
2097 2097
         }
2098 2098
         return $content;
@@ -2156,7 +2156,7 @@  discard block
 block discarded – undo
2156 2156
                 $msg = ($msg === false) ? 'ob_get_contents() error' : $msg;
2157 2157
                 $this->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], 'Plugin', $error_info['message'], $error_info['line'], $msg);
2158 2158
                 if ($this->isBackend()) {
2159
-                    $this->event->alert('An error occurred while loading. Please see the event log for more information.<p>' . $msg . '</p>');
2159
+                    $this->event->alert('An error occurred while loading. Please see the event log for more information.<p>'.$msg.'</p>');
2160 2160
                 }
2161 2161
             }
2162 2162
         } else {
@@ -2205,7 +2205,7 @@  discard block
 block discarded – undo
2205 2205
                 $echo = ($echo === false) ? 'ob_get_contents() error' : $echo;
2206 2206
                 $this->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], 'Snippet', $error_info['message'], $error_info['line'], $echo);
2207 2207
                 if ($this->isBackend()) {
2208
-                    $this->event->alert('An error occurred while loading. Please see the event log for more information<p>' . $echo . $return . '</p>');
2208
+                    $this->event->alert('An error occurred while loading. Please see the event log for more information<p>'.$echo.$return.'</p>');
2209 2209
                 }
2210 2210
             }
2211 2211
         }
@@ -2213,7 +2213,7 @@  discard block
 block discarded – undo
2213 2213
         if (is_array($return) || is_object($return)) {
2214 2214
             return $return;
2215 2215
         } else {
2216
-            return $echo . $return;
2216
+            return $echo.$return;
2217 2217
         }
2218 2218
     }
2219 2219
 
@@ -2251,8 +2251,8 @@  discard block
 block discarded – undo
2251 2251
                 }
2252 2252
                 if (strpos($content, $s) !== false) {
2253 2253
                     $content = str_replace($s, $value, $content);
2254
-                } elseif($this->debug) {
2255
-                    $this->addLog('evalSnippetsSGVar parse error', $_SERVER['REQUEST_URI'] . $s, 2);
2254
+                } elseif ($this->debug) {
2255
+                    $this->addLog('evalSnippetsSGVar parse error', $_SERVER['REQUEST_URI'].$s, 2);
2256 2256
                 }
2257 2257
                 continue;
2258 2258
             }
@@ -2263,8 +2263,8 @@  discard block
 block discarded – undo
2263 2263
 
2264 2264
             if (strpos($content, $s) !== false) {
2265 2265
                 $content = str_replace($s, $value, $content);
2266
-            } elseif($this->debug) {
2267
-                $this->addLog('evalSnippets parse error', $_SERVER['REQUEST_URI'] . $s, 2);
2266
+            } elseif ($this->debug) {
2267
+                $this->addLog('evalSnippets parse error', $_SERVER['REQUEST_URI'].$s, 2);
2268 2268
             }
2269 2269
         }
2270 2270
 
@@ -2355,7 +2355,7 @@  discard block
 block discarded – undo
2355 2355
             $eventtime = sprintf('%2.2f ms', $eventtime * 1000);
2356 2356
             $code = str_replace("\t", '  ', $this->getPhpCompat()->htmlspecialchars($value));
2357 2357
             $piece = str_replace("\t", '  ', $this->getPhpCompat()->htmlspecialchars($piece));
2358
-            $print_r_params = str_replace("\t", '  ', $this->getPhpCompat()->htmlspecialchars('$modx->event->params = ' . print_r($params, true)));
2358
+            $print_r_params = str_replace("\t", '  ', $this->getPhpCompat()->htmlspecialchars('$modx->event->params = '.print_r($params, true)));
2359 2359
             $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);
2360 2360
             $this->snippetsTime[] = array('sname' => $key, 'time' => $eventtime);
2361 2361
         }
@@ -2604,7 +2604,7 @@  discard block
 block discarded – undo
2604 2604
             );
2605 2605
             $count = $this->getDatabase()->getRecordCount($rs);
2606 2606
             if (1 < $count) {
2607
-                exit('Error $modx->_getSnippetObject()' . $snip_name);
2607
+                exit('Error $modx->_getSnippetObject()'.$snip_name);
2608 2608
             }
2609 2609
             if ($count) {
2610 2610
                 $row = $this->getDatabase()->getRow($rs);
@@ -2630,7 +2630,7 @@  discard block
 block discarded – undo
2630 2630
     public function toAlias($text)
2631 2631
     {
2632 2632
         $suff = $this->config['friendly_url_suffix'];
2633
-        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);
2633
+        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);
2634 2634
     }
2635 2635
 
2636 2636
     /**
@@ -2662,7 +2662,7 @@  discard block
 block discarded – undo
2662 2662
                 $suff = '/';
2663 2663
             }
2664 2664
 
2665
-            $url = ($dir != '' ? $dir . '/' : '') . $pre . $alias . $suff;
2665
+            $url = ($dir != '' ? $dir.'/' : '').$pre.$alias.$suff;
2666 2666
         }
2667 2667
 
2668 2668
         $evtOut = $this->invokeEvent('OnMakeDocUrl', array(
@@ -2699,7 +2699,7 @@  discard block
 block discarded – undo
2699 2699
                 preg_match_all('!\[\~([0-9]+)\~\]!ise', $documentSource, $match);
2700 2700
                 $ids = implode(',', array_unique($match['1']));
2701 2701
                 if ($ids) {
2702
-                    $res = $this->getDatabase()->select("id,alias,isfolder,parent,alias_visible", $this->getDatabase()->getFullTableName('site_content'), "id IN (" . $ids . ") AND isfolder = '0'");
2702
+                    $res = $this->getDatabase()->select("id,alias,isfolder,parent,alias_visible", $this->getDatabase()->getFullTableName('site_content'), "id IN (".$ids.") AND isfolder = '0'");
2703 2703
                     while ($row = $this->getDatabase()->getRow($res)) {
2704 2704
                         if ($this->config['use_alias_path'] == '1' && $row['parent'] != 0) {
2705 2705
                             $parent = $row['parent'];
@@ -2710,7 +2710,7 @@  discard block
 block discarded – undo
2710 2710
                                 $parent = $this->aliasListing[$parent]['parent'];
2711 2711
                             }
2712 2712
 
2713
-                            $aliases[$row['id']] = $path . '/' . $row['alias'];
2713
+                            $aliases[$row['id']] = $path.'/'.$row['alias'];
2714 2714
                         } else {
2715 2715
                             $aliases[$row['id']] = $row['alias'];
2716 2716
                         }
@@ -2722,7 +2722,7 @@  discard block
 block discarded – undo
2722 2722
             $isfriendly = ($this->config['friendly_alias_urls'] == 1 ? 1 : 0);
2723 2723
             $pref = $this->config['friendly_url_prefix'];
2724 2724
             $suff = $this->config['friendly_url_suffix'];
2725
-            $documentSource = preg_replace_callback($in, function ($m) use ($aliases, $isfolder, $isfriendly, $pref, $suff) {
2725
+            $documentSource = preg_replace_callback($in, function($m) use ($aliases, $isfolder, $isfriendly, $pref, $suff) {
2726 2726
                 global $modx;
2727 2727
                 $thealias = $aliases[$m[1]];
2728 2728
                 $thefolder = $isfolder[$m[1]];
@@ -2738,7 +2738,7 @@  discard block
 block discarded – undo
2738 2738
 
2739 2739
         } else {
2740 2740
             $in = '!\[\~([0-9]+)\~\]!is';
2741
-            $out = "index.php?id=" . '\1';
2741
+            $out = "index.php?id=".'\1';
2742 2742
             $documentSource = preg_replace($in, $out, $documentSource);
2743 2743
         }
2744 2744
 
@@ -2759,7 +2759,7 @@  discard block
 block discarded – undo
2759 2759
         $scheme = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http';
2760 2760
         $len_base_url = strlen($this->config['base_url']);
2761 2761
 
2762
-        $url_path = $q;//LANG
2762
+        $url_path = $q; //LANG
2763 2763
 
2764 2764
         if (substr($url_path, 0, $len_base_url) === $this->config['base_url']) {
2765 2765
             $url_path = substr($url_path, $len_base_url);
@@ -2771,7 +2771,7 @@  discard block
 block discarded – undo
2771 2771
             $strictURL = substr($strictURL, $len_base_url);
2772 2772
         }
2773 2773
         $http_host = $_SERVER['HTTP_HOST'];
2774
-        $requestedURL = "{$scheme}://{$http_host}" . '/' . $q; //LANG
2774
+        $requestedURL = "{$scheme}://{$http_host}".'/'.$q; //LANG
2775 2775
 
2776 2776
         $site_url = $this->config['site_url'];
2777 2777
         $url_query_string = explode('?', $_SERVER['REQUEST_URI']);
@@ -2789,7 +2789,7 @@  discard block
 block discarded – undo
2789 2789
                 }
2790 2790
                 if ($this->config['base_url'] != $_SERVER['REQUEST_URI']) {
2791 2791
                     if (empty($_POST)) {
2792
-                        if (($this->config['base_url'] . '?' . $qstring) != $_SERVER['REQUEST_URI']) {
2792
+                        if (($this->config['base_url'].'?'.$qstring) != $_SERVER['REQUEST_URI']) {
2793 2793
                             $this->sendRedirect($url, 0, 'REDIRECT_HEADER', 'HTTP/1.0 301 Moved Permanently');
2794 2794
                             exit(0);
2795 2795
                         }
@@ -2848,7 +2848,7 @@  discard block
 block discarded – undo
2848 2848
                 $docgrp = implode(",", $docgrp);
2849 2849
             }
2850 2850
             // get document
2851
-            $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0") . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)");
2851
+            $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='".$_SESSION['mgrRole']."' OR sc.privatemgr=0").(!$docgrp ? "" : " OR dg.document_group IN ($docgrp)");
2852 2852
             $rs = $this->getDatabase()->select('sc.*', "{$tblsc} sc
2853 2853
                 LEFT JOIN {$tbldg} dg ON dg.document = sc.id", "sc.{$method} = '{$identifier}' AND ({$access})", "", 1);
2854 2854
             if ($this->getDatabase()->getRecordCount($rs) < 1) {
@@ -2884,9 +2884,9 @@  discard block
 block discarded – undo
2884 2884
             }
2885 2885
             if ($documentObject['template']) {
2886 2886
                 // load TVs and merge with document - Orig by Apodigm - Docvars
2887
-                $rs = $this->getDatabase()->select("tv.*, IF(tvc.value!='',tvc.value,tv.default_text) as value", $this->getDatabase()->getFullTableName("site_tmplvars") . " tv
2888
-                INNER JOIN " . $this->getDatabase()->getFullTableName("site_tmplvar_templates") . " tvtpl ON tvtpl.tmplvarid = tv.id
2889
-                LEFT JOIN " . $this->getDatabase()->getFullTableName("site_tmplvar_contentvalues") . " tvc ON tvc.tmplvarid=tv.id AND tvc.contentid = '{$documentObject['id']}'", "tvtpl.templateid = '{$documentObject['template']}'");
2887
+                $rs = $this->getDatabase()->select("tv.*, IF(tvc.value!='',tvc.value,tv.default_text) as value", $this->getDatabase()->getFullTableName("site_tmplvars")." tv
2888
+                INNER JOIN " . $this->getDatabase()->getFullTableName("site_tmplvar_templates")." tvtpl ON tvtpl.tmplvarid = tv.id
2889
+                LEFT JOIN " . $this->getDatabase()->getFullTableName("site_tmplvar_contentvalues")." tvc ON tvc.tmplvarid=tv.id AND tvc.contentid = '{$documentObject['id']}'", "tvtpl.templateid = '{$documentObject['template']}'");
2890 2890
                 $tmplvars = array();
2891 2891
                 while ($row = $this->getDatabase()->getRow($rs)) {
2892 2892
                     $tmplvars[$row['name']] = array(
@@ -2932,7 +2932,7 @@  discard block
 block discarded – undo
2932 2932
                 $st = md5($source);
2933 2933
             }
2934 2934
             if ($this->dumpSnippets == 1) {
2935
-                $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>";
2935
+                $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>";
2936 2936
             }
2937 2937
 
2938 2938
             // invoke OnParseDocument event
@@ -2974,7 +2974,7 @@  discard block
 block discarded – undo
2974 2974
      */
2975 2975
     public function executeParser()
2976 2976
     {
2977
-        if(MODX_CLI) {
2977
+        if (MODX_CLI) {
2978 2978
             throw new \RuntimeException('Call DocumentParser::executeParser on CLI mode');
2979 2979
         }
2980 2980
 
@@ -3020,7 +3020,7 @@  discard block
 block discarded – undo
3020 3020
 
3021 3021
             // Check use_alias_path and check if $this->virtualDir is set to anything, then parse the path
3022 3022
             if ($this->config['use_alias_path'] == 1) {
3023
-                $alias = (strlen($this->virtualDir) > 0 ? $this->virtualDir . '/' : '') . $this->documentIdentifier;
3023
+                $alias = (strlen($this->virtualDir) > 0 ? $this->virtualDir.'/' : '').$this->documentIdentifier;
3024 3024
                 if (isset($this->documentListing[$alias])) {
3025 3025
                     $this->documentIdentifier = $this->documentListing[$alias];
3026 3026
                 } else {
@@ -3081,7 +3081,7 @@  discard block
 block discarded – undo
3081 3081
                 } else {
3082 3082
                     $docAlias = $this->getDatabase()->escape($this->documentIdentifier);
3083 3083
                     $rs = $this->getDatabase()->select('id', $this->getDatabase()->getFullTableName('site_content'), "deleted=0 and alias='{$docAlias}'");
3084
-                    $this->documentIdentifier = (int)$this->getDatabase()->getValue($rs);
3084
+                    $this->documentIdentifier = (int) $this->getDatabase()->getValue($rs);
3085 3085
                 }
3086 3086
             }
3087 3087
             $this->documentMethod = 'id';
@@ -3138,7 +3138,7 @@  discard block
 block discarded – undo
3138 3138
                 $_REQUEST[$n] = $_GET[$n] = $v;
3139 3139
             }
3140 3140
         }
3141
-        $_SERVER['PHP_SELF'] = $this->config['base_url'] . $qp['path'];
3141
+        $_SERVER['PHP_SELF'] = $this->config['base_url'].$qp['path'];
3142 3142
         $this->q = $qp['path'];
3143 3143
         return $qp['path'];
3144 3144
     }
@@ -3288,7 +3288,7 @@  discard block
 block discarded – undo
3288 3288
         while ($id && $height--) {
3289 3289
             $thisid = $id;
3290 3290
             if ($this->config['aliaslistingfolder'] == 1) {
3291
-                $id = isset($this->aliasListing[$id]['parent']) ? $this->aliasListing[$id]['parent'] : $this->getDatabase()->getValue("SELECT `parent` FROM " . $this->getDatabase()->getFullTableName("site_content") . " WHERE `id` = '{$id}' LIMIT 0,1");
3291
+                $id = isset($this->aliasListing[$id]['parent']) ? $this->aliasListing[$id]['parent'] : $this->getDatabase()->getValue("SELECT `parent` FROM ".$this->getDatabase()->getFullTableName("site_content")." WHERE `id` = '{$id}' LIMIT 0,1");
3292 3292
                 if (!$id || $id == '0') {
3293 3293
                     break;
3294 3294
                 }
@@ -3339,15 +3339,15 @@  discard block
 block discarded – undo
3339 3339
 
3340 3340
         if ($this->config['aliaslistingfolder'] == 1) {
3341 3341
 
3342
-            $res = $this->getDatabase()->select("id,alias,isfolder,parent", $this->getDatabase()->getFullTableName('site_content'), "parent IN (" . $id . ") AND deleted = '0'");
3342
+            $res = $this->getDatabase()->select("id,alias,isfolder,parent", $this->getDatabase()->getFullTableName('site_content'), "parent IN (".$id.") AND deleted = '0'");
3343 3343
             $idx = array();
3344 3344
             while ($row = $this->getDatabase()->getRow($res)) {
3345 3345
                 $pAlias = '';
3346 3346
                 if (isset($this->aliasListing[$row['parent']])) {
3347
-                    $pAlias .= !empty($this->aliasListing[$row['parent']]['path']) ? $this->aliasListing[$row['parent']]['path'] . '/' : '';
3348
-                    $pAlias .= !empty($this->aliasListing[$row['parent']]['alias']) ? $this->aliasListing[$row['parent']]['alias'] . '/' : '';
3347
+                    $pAlias .= !empty($this->aliasListing[$row['parent']]['path']) ? $this->aliasListing[$row['parent']]['path'].'/' : '';
3348
+                    $pAlias .= !empty($this->aliasListing[$row['parent']]['alias']) ? $this->aliasListing[$row['parent']]['alias'].'/' : '';
3349 3349
                 };
3350
-                $children[$pAlias . $row['alias']] = $row['id'];
3350
+                $children[$pAlias.$row['alias']] = $row['id'];
3351 3351
                 if ($row['isfolder'] == 1) {
3352 3352
                     $idx[] = $row['id'];
3353 3353
                 }
@@ -3379,7 +3379,7 @@  discard block
 block discarded – undo
3379 3379
                 $depth--;
3380 3380
 
3381 3381
                 foreach ($documentMap_cache[$id] as $childId) {
3382
-                    $pkey = (strlen($this->aliasListing[$childId]['path']) ? "{$this->aliasListing[$childId]['path']}/" : '') . $this->aliasListing[$childId]['alias'];
3382
+                    $pkey = (strlen($this->aliasListing[$childId]['path']) ? "{$this->aliasListing[$childId]['path']}/" : '').$this->aliasListing[$childId]['alias'];
3383 3383
                     if (!strlen($pkey)) {
3384 3384
                         $pkey = "{$childId}";
3385 3385
                     }
@@ -3416,7 +3416,7 @@  discard block
 block discarded – undo
3416 3416
                 $fnc = 'history.back(-1);';
3417 3417
                 break;
3418 3418
             default:
3419
-                $fnc = "window.location.href='" . addslashes($url) . "';";
3419
+                $fnc = "window.location.href='".addslashes($url)."';";
3420 3420
         }
3421 3421
 
3422 3422
         echo "<html><head>
@@ -3448,9 +3448,9 @@  discard block
 block discarded – undo
3448 3448
         $state = 0;
3449 3449
         $pms = $_SESSION['mgrPermissions'];
3450 3450
         if ($pms) {
3451
-            $state = ((bool)$pms[$pm] === true);
3451
+            $state = ((bool) $pms[$pm] === true);
3452 3452
         }
3453
-        return (int)$state;
3453
+        return (int) $state;
3454 3454
     }
3455 3455
 
3456 3456
     /**
@@ -3463,8 +3463,8 @@  discard block
 block discarded – undo
3463 3463
      */
3464 3464
     public function elementIsLocked($type, $id, $includeThisUser = false)
3465 3465
     {
3466
-        $id = (int)$id;
3467
-        $type = (int)$type;
3466
+        $id = (int) $id;
3467
+        $type = (int) $type;
3468 3468
         if (!$type || !$id) {
3469 3469
             return null;
3470 3470
         }
@@ -3514,7 +3514,7 @@  discard block
 block discarded – undo
3514 3514
             return $lockedElements;
3515 3515
         }
3516 3516
 
3517
-        $type = (int)$type;
3517
+        $type = (int) $type;
3518 3518
         if (isset($lockedElements[$type])) {
3519 3519
             return $lockedElements[$type];
3520 3520
         } else {
@@ -3531,7 +3531,7 @@  discard block
 block discarded – undo
3531 3531
             $this->lockedElements = array();
3532 3532
             $this->cleanupExpiredLocks();
3533 3533
 
3534
-            $rs = $this->getDatabase()->select('sid,internalKey,elementType,elementId,lasthit,username', $this->getDatabase()->getFullTableName('active_user_locks') . " ul
3534
+            $rs = $this->getDatabase()->select('sid,internalKey,elementType,elementId,lasthit,username', $this->getDatabase()->getFullTableName('active_user_locks')." ul
3535 3535
                 LEFT JOIN {$this->getDatabase()->getFullTableName('manager_users')} mu on ul.internalKey = mu.id");
3536 3536
             while ($row = $this->getDatabase()->getRow($rs)) {
3537 3537
                 $this->lockedElements[$row['elementType']][$row['elementId']] = array(
@@ -3554,7 +3554,7 @@  discard block
 block discarded – undo
3554 3554
     public function cleanupExpiredLocks()
3555 3555
     {
3556 3556
         // Clean-up active_user_sessions first
3557
-        $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
3557
+        $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
3558 3558
         $validSessionTimeLimit = $this->time - $timeout;
3559 3559
         $this->getDatabase()->delete($this->getDatabase()->getFullTableName('active_user_sessions'), "lasthit < {$validSessionTimeLimit}");
3560 3560
 
@@ -3567,7 +3567,7 @@  discard block
 block discarded – undo
3567 3567
             foreach ($rs as $row) {
3568 3568
                 $userSids[] = $row['sid'];
3569 3569
             }
3570
-            $userSids = "'" . implode("','", $userSids) . "'";
3570
+            $userSids = "'".implode("','", $userSids)."'";
3571 3571
             $this->getDatabase()->delete($this->getDatabase()->getFullTableName('active_user_locks'), "sid NOT IN({$userSids})");
3572 3572
         } else {
3573 3573
             $this->getDatabase()->delete($this->getDatabase()->getFullTableName('active_user_locks'));
@@ -3651,8 +3651,8 @@  discard block
 block discarded – undo
3651 3651
     public function lockElement($type, $id)
3652 3652
     {
3653 3653
         $userId = $this->isBackend() && $_SESSION['mgrInternalKey'] ? $_SESSION['mgrInternalKey'] : 0;
3654
-        $type = (int)$type;
3655
-        $id = (int)$id;
3654
+        $type = (int) $type;
3655
+        $id = (int) $id;
3656 3656
         if (!$type || !$id || !$userId) {
3657 3657
             return false;
3658 3658
         }
@@ -3673,8 +3673,8 @@  discard block
 block discarded – undo
3673 3673
     public function unlockElement($type, $id, $includeAllUsers = false)
3674 3674
     {
3675 3675
         $userId = $this->isBackend() && $_SESSION['mgrInternalKey'] ? $_SESSION['mgrInternalKey'] : 0;
3676
-        $type = (int)$type;
3677
-        $id = (int)$id;
3676
+        $type = (int) $type;
3677
+        $id = (int) $id;
3678 3678
         if (!$type || !$id) {
3679 3679
             return false;
3680 3680
         }
@@ -3741,8 +3741,8 @@  discard block
 block discarded – undo
3741 3741
         }
3742 3742
 
3743 3743
         $usertype = $this->isFrontend() ? 1 : 0;
3744
-        $evtid = (int)$evtid;
3745
-        $type = (int)$type;
3744
+        $evtid = (int) $evtid;
3745
+        $type = (int) $type;
3746 3746
 
3747 3747
         // Types: 1 = information, 2 = warning, 3 = error
3748 3748
         if ($type < 1) {
@@ -3764,8 +3764,8 @@  discard block
 block discarded – undo
3764 3764
         if (isset($this->config['send_errormail']) && $this->config['send_errormail'] !== '0') {
3765 3765
             if ($this->config['send_errormail'] <= $type) {
3766 3766
                 $this->sendmail(array(
3767
-                    'subject' => 'MODX System Error on ' . $this->config['site_name'],
3768
-                    'body' => 'Source: ' . $source . ' - The details of the error could be seen in the MODX system events log.',
3767
+                    'subject' => 'MODX System Error on '.$this->config['site_name'],
3768
+                    'body' => 'Source: '.$source.' - The details of the error could be seen in the MODX system events log.',
3769 3769
                     'type' => 'text'
3770 3770
                 ));
3771 3771
             }
@@ -3814,7 +3814,7 @@  discard block
 block discarded – undo
3814 3814
             $p['fromname'] = $userinfo['username'];
3815 3815
         }
3816 3816
         if ($msg === '' && !isset($p['body'])) {
3817
-            $p['body'] = $_SERVER['REQUEST_URI'] . "\n" . $_SERVER['HTTP_USER_AGENT'] . "\n" . $_SERVER['HTTP_REFERER'];
3817
+            $p['body'] = $_SERVER['REQUEST_URI']."\n".$_SERVER['HTTP_USER_AGENT']."\n".$_SERVER['HTTP_REFERER'];
3818 3818
         } elseif (is_string($msg) && 0 < strlen($msg)) {
3819 3819
             $p['body'] = $msg;
3820 3820
         }
@@ -3855,8 +3855,8 @@  discard block
 block discarded – undo
3855 3855
             $files = array();
3856 3856
         }
3857 3857
         foreach ($files as $f) {
3858
-            if (file_exists(MODX_BASE_PATH . $f) && is_file(MODX_BASE_PATH . $f) && is_readable(MODX_BASE_PATH . $f)) {
3859
-                $this->getMail()->AddAttachment(MODX_BASE_PATH . $f);
3858
+            if (file_exists(MODX_BASE_PATH.$f) && is_file(MODX_BASE_PATH.$f) && is_readable(MODX_BASE_PATH.$f)) {
3859
+                $this->getMail()->AddAttachment(MODX_BASE_PATH.$f);
3860 3860
             }
3861 3861
         }
3862 3862
         return $this->getMail()->send();
@@ -3900,7 +3900,7 @@  discard block
 block discarded – undo
3900 3900
      */
3901 3901
     public function isFrontend()
3902 3902
     {
3903
-        return ! $this->isBackend();
3903
+        return !$this->isBackend();
3904 3904
     }
3905 3905
 
3906 3906
     /**
@@ -3925,14 +3925,14 @@  discard block
 block discarded – undo
3925 3925
         $tblsc = $this->getDatabase()->getFullTableName("site_content");
3926 3926
         $tbldg = $this->getDatabase()->getFullTableName("document_groups");
3927 3927
         // modify field names to use sc. table reference
3928
-        $fields = 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $fields))));
3929
-        $sort = 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $sort))));
3928
+        $fields = 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $fields))));
3929
+        $sort = 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $sort))));
3930 3930
         // get document groups for current user
3931 3931
         if ($docgrp = $this->getUserDocGroups()) {
3932 3932
             $docgrp = implode(",", $docgrp);
3933 3933
         }
3934 3934
         // build query
3935
-        $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0") . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)");
3935
+        $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='".$_SESSION['mgrRole']."' OR sc.privatemgr=0").(!$docgrp ? "" : " OR dg.document_group IN ($docgrp)");
3936 3936
         $result = $this->getDatabase()->select("DISTINCT {$fields}", "{$tblsc} sc
3937 3937
                 LEFT JOIN {$tbldg} dg on dg.document = sc.id", "sc.parent = '{$id}' AND ({$access}) GROUP BY sc.id", "{$sort} {$dir}");
3938 3938
         $resourceArray = $this->getDatabase()->makeArray($result);
@@ -3962,14 +3962,14 @@  discard block
 block discarded – undo
3962 3962
         $tbldg = $this->getDatabase()->getFullTableName("document_groups");
3963 3963
 
3964 3964
         // modify field names to use sc. table reference
3965
-        $fields = 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $fields))));
3966
-        $sort = 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $sort))));
3965
+        $fields = 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $fields))));
3966
+        $sort = 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $sort))));
3967 3967
         // get document groups for current user
3968 3968
         if ($docgrp = $this->getUserDocGroups()) {
3969 3969
             $docgrp = implode(",", $docgrp);
3970 3970
         }
3971 3971
         // build query
3972
-        $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0") . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)");
3972
+        $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='".$_SESSION['mgrRole']."' OR sc.privatemgr=0").(!$docgrp ? "" : " OR dg.document_group IN ($docgrp)");
3973 3973
         $result = $this->getDatabase()->select("DISTINCT {$fields}", "{$tblsc} sc
3974 3974
                 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}");
3975 3975
         $resourceArray = $this->getDatabase()->makeArray($result);
@@ -4004,16 +4004,16 @@  discard block
 block discarded – undo
4004 4004
             return $this->tmpCache[__FUNCTION__][$cacheKey];
4005 4005
         }
4006 4006
 
4007
-        $published = ($published !== 'all') ? 'AND sc.published = ' . $published : '';
4008
-        $deleted = ($deleted !== 'all') ? 'AND sc.deleted = ' . $deleted : '';
4007
+        $published = ($published !== 'all') ? 'AND sc.published = '.$published : '';
4008
+        $deleted = ($deleted !== 'all') ? 'AND sc.deleted = '.$deleted : '';
4009 4009
 
4010 4010
         if ($where != '') {
4011
-            $where = 'AND ' . $where;
4011
+            $where = 'AND '.$where;
4012 4012
         }
4013 4013
 
4014 4014
         // modify field names to use sc. table reference
4015
-        $fields = 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $fields))));
4016
-        $sort = ($sort == '') ? '' : 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $sort))));
4015
+        $fields = 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $fields))));
4016
+        $sort = ($sort == '') ? '' : 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $sort))));
4017 4017
 
4018 4018
         // get document groups for current user
4019 4019
         if ($docgrp = $this->getUserDocGroups()) {
@@ -4021,7 +4021,7 @@  discard block
 block discarded – undo
4021 4021
         }
4022 4022
 
4023 4023
         // build query
4024
-        $access = ($this->isFrontend() ? 'sc.privateweb=0' : '1="' . $_SESSION['mgrRole'] . '" OR sc.privatemgr=0') . (!$docgrp ? '' : ' OR dg.document_group IN (' . $docgrp . ')');
4024
+        $access = ($this->isFrontend() ? 'sc.privateweb=0' : '1="'.$_SESSION['mgrRole'].'" OR sc.privatemgr=0').(!$docgrp ? '' : ' OR dg.document_group IN ('.$docgrp.')');
4025 4025
 
4026 4026
         $tblsc = $this->getDatabase()->getFullTableName('site_content');
4027 4027
         $tbldg = $this->getDatabase()->getFullTableName('document_groups');
@@ -4073,10 +4073,10 @@  discard block
 block discarded – undo
4073 4073
             return false;
4074 4074
         } else {
4075 4075
             // modify field names to use sc. table reference
4076
-            $fields = 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $fields))));
4077
-            $sort = ($sort == '') ? '' : 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $sort))));
4076
+            $fields = 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $fields))));
4077
+            $sort = ($sort == '') ? '' : 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $sort))));
4078 4078
             if ($where != '') {
4079
-                $where = 'AND ' . $where;
4079
+                $where = 'AND '.$where;
4080 4080
             }
4081 4081
 
4082 4082
             $published = ($published !== 'all') ? "AND sc.published = '{$published}'" : '';
@@ -4087,13 +4087,13 @@  discard block
 block discarded – undo
4087 4087
                 $docgrp = implode(',', $docgrp);
4088 4088
             }
4089 4089
 
4090
-            $access = ($this->isFrontend() ? 'sc.privateweb=0' : '1="' . $_SESSION['mgrRole'] . '" OR sc.privatemgr=0') . (!$docgrp ? '' : ' OR dg.document_group IN (' . $docgrp . ')');
4090
+            $access = ($this->isFrontend() ? 'sc.privateweb=0' : '1="'.$_SESSION['mgrRole'].'" OR sc.privatemgr=0').(!$docgrp ? '' : ' OR dg.document_group IN ('.$docgrp.')');
4091 4091
 
4092 4092
             $tblsc = $this->getDatabase()->getFullTableName('site_content');
4093 4093
             $tbldg = $this->getDatabase()->getFullTableName('document_groups');
4094 4094
 
4095 4095
             $result = $this->getDatabase()->select("DISTINCT {$fields}", "{$tblsc} sc
4096
-                    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);
4096
+                    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);
4097 4097
 
4098 4098
             $resourceArray = $this->getDatabase()->makeArray($result);
4099 4099
 
@@ -4198,12 +4198,12 @@  discard block
 block discarded – undo
4198 4198
             $tbldg = $this->getDatabase()->getFullTableName("document_groups");
4199 4199
             $activeSql = $active == 1 ? "AND sc.published=1 AND sc.deleted=0" : "";
4200 4200
             // modify field names to use sc. table reference
4201
-            $fields = 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $fields))));
4201
+            $fields = 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $fields))));
4202 4202
             // get document groups for current user
4203 4203
             if ($docgrp = $this->getUserDocGroups()) {
4204 4204
                 $docgrp = implode(",", $docgrp);
4205 4205
             }
4206
-            $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0") . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)");
4206
+            $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='".$_SESSION['mgrRole']."' OR sc.privatemgr=0").(!$docgrp ? "" : " OR dg.document_group IN ($docgrp)");
4207 4207
             $result = $this->getDatabase()->select($fields, "{$tblsc} sc LEFT JOIN {$tbldg} dg on dg.document = sc.id", "(sc.id='{$pageid}' {$activeSql}) AND ({$access})", "", 1);
4208 4208
             $pageInfo = $this->getDatabase()->getRow($result);
4209 4209
 
@@ -4250,7 +4250,7 @@  discard block
 block discarded – undo
4250 4250
     {
4251 4251
         if ($this->currentSnippet) {
4252 4252
             $tbl = $this->getDatabase()->getFullTableName("site_snippets");
4253
-            $rs = $this->getDatabase()->select('id', $tbl, "name='" . $this->getDatabase()->escape($this->currentSnippet) . "'", '', 1);
4253
+            $rs = $this->getDatabase()->select('id', $tbl, "name='".$this->getDatabase()->escape($this->currentSnippet)."'", '', 1);
4254 4254
             if ($snippetId = $this->getDatabase()->getValue($rs)) {
4255 4255
                 return $snippetId;
4256 4256
             }
@@ -4277,7 +4277,7 @@  discard block
 block discarded – undo
4277 4277
      */
4278 4278
     public function clearCache($type = '', $report = false)
4279 4279
     {
4280
-        $cache_dir = MODX_BASE_PATH . $this->getCacheFolder();
4280
+        $cache_dir = MODX_BASE_PATH.$this->getCacheFolder();
4281 4281
         if (is_array($type)) {
4282 4282
             foreach ($type as $_) {
4283 4283
                 $this->clearCache($_, $report);
@@ -4289,10 +4289,10 @@  discard block
 block discarded – undo
4289 4289
             $sync->emptyCache();
4290 4290
         } elseif (preg_match('@^[1-9][0-9]*$@', $type)) {
4291 4291
             $key = ($this->config['cache_type'] == 2) ? $this->makePageCacheKey($type) : $type;
4292
-            $file_name = "docid_" . $key . "_*.pageCache.php";
4293
-            $cache_path = $cache_dir . $file_name;
4292
+            $file_name = "docid_".$key."_*.pageCache.php";
4293
+            $cache_path = $cache_dir.$file_name;
4294 4294
             $files = glob($cache_path);
4295
-            $files[] = $cache_dir . "docid_" . $key . ".pageCache.php";
4295
+            $files[] = $cache_dir."docid_".$key.".pageCache.php";
4296 4296
             foreach ($files as $file) {
4297 4297
                 if (!is_file($file)) {
4298 4298
                     continue;
@@ -4300,7 +4300,7 @@  discard block
 block discarded – undo
4300 4300
                 unlink($file);
4301 4301
             }
4302 4302
         } else {
4303
-            $files = glob($cache_dir . '*');
4303
+            $files = glob($cache_dir.'*');
4304 4304
             foreach ($files as $file) {
4305 4305
                 $name = basename($file);
4306 4306
                 if (strpos($name, '.pageCache.php') === false) {
@@ -4369,7 +4369,7 @@  discard block
 block discarded – undo
4369 4369
                         $f_url_suffix = '/';
4370 4370
                     }
4371 4371
 
4372
-                    $alPath = !empty ($al['path']) ? $al['path'] . '/' : '';
4372
+                    $alPath = !empty ($al['path']) ? $al['path'].'/' : '';
4373 4373
 
4374 4374
                     if ($al && $al['alias']) {
4375 4375
                         $alias = $al['alias'];
@@ -4377,7 +4377,7 @@  discard block
 block discarded – undo
4377 4377
 
4378 4378
                 }
4379 4379
 
4380
-                $alias = $alPath . $f_url_prefix . $alias . $f_url_suffix;
4380
+                $alias = $alPath.$f_url_prefix.$alias.$f_url_suffix;
4381 4381
                 $url = "{$alias}{$args}";
4382 4382
             } else {
4383 4383
                 $url = "index.php?id={$id}{$args}";
@@ -4396,7 +4396,7 @@  discard block
 block discarded – undo
4396 4396
             }
4397 4397
 
4398 4398
             //TODO: check to make sure that $site_url incudes the url :port (e.g. :8080)
4399
-            $host = $scheme == 'full' ? $this->config['site_url'] : $scheme . '://' . $_SERVER['HTTP_HOST'] . $host;
4399
+            $host = $scheme == 'full' ? $this->config['site_url'] : $scheme.'://'.$_SERVER['HTTP_HOST'].$host;
4400 4400
         }
4401 4401
 
4402 4402
         //fix strictUrl by Bumkaka
@@ -4405,9 +4405,9 @@  discard block
 block discarded – undo
4405 4405
         }
4406 4406
 
4407 4407
         if ($this->config['xhtml_urls']) {
4408
-            $url = preg_replace("/&(?!amp;)/", "&amp;", $host . $virtualDir . $url);
4408
+            $url = preg_replace("/&(?!amp;)/", "&amp;", $host.$virtualDir.$url);
4409 4409
         } else {
4410
-            $url = $host . $virtualDir . $url;
4410
+            $url = $host.$virtualDir.$url;
4411 4411
         }
4412 4412
 
4413 4413
         $evtOut = $this->invokeEvent('OnMakeDocUrl', array(
@@ -4431,21 +4431,21 @@  discard block
 block discarded – undo
4431 4431
         if (isset($this->aliasListing[$id])) {
4432 4432
             $out = $this->aliasListing[$id];
4433 4433
         } else {
4434
-            $q = $this->getDatabase()->query("SELECT id,alias,isfolder,parent FROM " . $this->getDatabase()->getFullTableName("site_content") . " WHERE id=" . (int)$id);
4434
+            $q = $this->getDatabase()->query("SELECT id,alias,isfolder,parent FROM ".$this->getDatabase()->getFullTableName("site_content")." WHERE id=".(int) $id);
4435 4435
             if ($this->getDatabase()->getRecordCount($q) == '1') {
4436 4436
                 $q = $this->getDatabase()->getRow($q);
4437 4437
                 $this->aliasListing[$id] = array(
4438
-                    'id' => (int)$q['id'],
4438
+                    'id' => (int) $q['id'],
4439 4439
                     'alias' => $q['alias'] == '' ? $q['id'] : $q['alias'],
4440
-                    'parent' => (int)$q['parent'],
4441
-                    'isfolder' => (int)$q['isfolder'],
4440
+                    'parent' => (int) $q['parent'],
4441
+                    'isfolder' => (int) $q['isfolder'],
4442 4442
                 );
4443 4443
                 if ($this->aliasListing[$id]['parent'] > 0) {
4444 4444
                     //fix alias_path_usage
4445 4445
                     if ($this->config['use_alias_path'] == '1') {
4446 4446
                         //&& $tmp['path'] != '' - fix error slash with epty path
4447 4447
                         $tmp = $this->getAliasListing($this->aliasListing[$id]['parent']);
4448
-                        $this->aliasListing[$id]['path'] = $tmp['path'] . ($tmp['alias_visible'] ? (($tmp['parent'] > 0 && $tmp['path'] != '') ? '/' : '') . $tmp['alias'] : '');
4448
+                        $this->aliasListing[$id]['path'] = $tmp['path'].($tmp['alias_visible'] ? (($tmp['parent'] > 0 && $tmp['path'] != '') ? '/' : '').$tmp['alias'] : '');
4449 4449
                     } else {
4450 4450
                         $this->aliasListing[$id]['path'] = '';
4451 4451
                     }
@@ -4483,7 +4483,7 @@  discard block
 block discarded – undo
4483 4483
         $out = array();
4484 4484
         if (empty($this->version) || !is_array($this->version)) {
4485 4485
             //include for compatibility modx version < 1.0.10
4486
-            include MODX_MANAGER_PATH . "includes/version.inc.php";
4486
+            include MODX_MANAGER_PATH."includes/version.inc.php";
4487 4487
             $this->version = array();
4488 4488
             $this->version['version'] = isset($modx_version) ? $modx_version : '';
4489 4489
             $this->version['branch'] = isset($modx_branch) ? $modx_branch : '';
@@ -4505,18 +4505,18 @@  discard block
 block discarded – undo
4505 4505
     {
4506 4506
         if (isset ($this->snippetCache[$snippetName])) {
4507 4507
             $snippet = $this->snippetCache[$snippetName];
4508
-            $properties = !empty($this->snippetCache[$snippetName . "Props"]) ? $this->snippetCache[$snippetName . "Props"] : '';
4508
+            $properties = !empty($this->snippetCache[$snippetName."Props"]) ? $this->snippetCache[$snippetName."Props"] : '';
4509 4509
         } else { // not in cache so let's check the db
4510
-            $sql = "SELECT ss.`name`, ss.`snippet`, ss.`properties`, sm.properties as `sharedproperties` FROM " . $this->getDatabase()->getFullTableName("site_snippets") . " as ss LEFT JOIN " . $this->getDatabase()->getFullTableName('site_modules') . " as sm on sm.guid=ss.moduleguid WHERE ss.`name`='" . $this->getDatabase()->escape($snippetName) . "'  AND ss.disabled=0;";
4510
+            $sql = "SELECT ss.`name`, ss.`snippet`, ss.`properties`, sm.properties as `sharedproperties` FROM ".$this->getDatabase()->getFullTableName("site_snippets")." as ss LEFT JOIN ".$this->getDatabase()->getFullTableName('site_modules')." as sm on sm.guid=ss.moduleguid WHERE ss.`name`='".$this->getDatabase()->escape($snippetName)."'  AND ss.disabled=0;";
4511 4511
             $result = $this->getDatabase()->query($sql);
4512 4512
             if ($this->getDatabase()->getRecordCount($result) == 1) {
4513 4513
                 $row = $this->getDatabase()->getRow($result);
4514 4514
                 $snippet = $this->snippetCache[$snippetName] = $row['snippet'];
4515 4515
                 $mergedProperties = array_merge($this->parseProperties($row['properties']), $this->parseProperties($row['sharedproperties']));
4516
-                $properties = $this->snippetCache[$snippetName . "Props"] = json_encode($mergedProperties);
4516
+                $properties = $this->snippetCache[$snippetName."Props"] = json_encode($mergedProperties);
4517 4517
             } else {
4518 4518
                 $snippet = $this->snippetCache[$snippetName] = "return false;";
4519
-                $properties = $this->snippetCache[$snippetName . "Props"] = '';
4519
+                $properties = $this->snippetCache[$snippetName."Props"] = '';
4520 4520
             }
4521 4521
         }
4522 4522
         // load default params/properties
@@ -4620,8 +4620,8 @@  discard block
 block discarded – undo
4620 4620
             }
4621 4621
             if (strpos($tpl, $s) !== false) {
4622 4622
                 $tpl = str_replace($s, $value, $tpl);
4623
-            } elseif($this->debug) {
4624
-                $this->addLog('parseText parse error', $_SERVER['REQUEST_URI'] . $s, 2);
4623
+            } elseif ($this->debug) {
4624
+                $this->addLog('parseText parse error', $_SERVER['REQUEST_URI'].$s, 2);
4625 4625
             }
4626 4626
         }
4627 4627
 
@@ -4671,7 +4671,7 @@  discard block
 block discarded – undo
4671 4671
             case 'CODE':
4672 4672
                 break;
4673 4673
             case 'FILE':
4674
-                $template = file_get_contents(MODX_BASE_PATH . $template);
4674
+                $template = file_get_contents(MODX_BASE_PATH.$template);
4675 4675
                 break;
4676 4676
             case 'CHUNK':
4677 4677
                 $template = $this->getChunk($template);
@@ -4704,7 +4704,7 @@  discard block
 block discarded – undo
4704 4704
         if ($mode !== 'formatOnly' && empty($timestamp)) {
4705 4705
             return '-';
4706 4706
         }
4707
-        $timestamp = (int)$timestamp;
4707
+        $timestamp = (int) $timestamp;
4708 4708
 
4709 4709
         switch ($this->config['datetime_format']) {
4710 4710
             case 'YYYY/mm/dd':
@@ -4724,7 +4724,7 @@  discard block
 block discarded – undo
4724 4724
         }
4725 4725
 
4726 4726
         if (empty($mode)) {
4727
-            $strTime = strftime($dateFormat . " %H:%M:%S", $timestamp);
4727
+            $strTime = strftime($dateFormat." %H:%M:%S", $timestamp);
4728 4728
         } elseif ($mode == 'dateOnly') {
4729 4729
             $strTime = strftime($dateFormat, $timestamp);
4730 4730
         } elseif ($mode == 'formatOnly') {
@@ -4778,7 +4778,7 @@  discard block
 block discarded – undo
4778 4778
             $S = 0;
4779 4779
         }
4780 4780
         $timeStamp = mktime($H, $M, $S, $m, $d, $Y);
4781
-        $timeStamp = (int)$timeStamp;
4781
+        $timeStamp = (int) $timeStamp;
4782 4782
         return $timeStamp;
4783 4783
     }
4784 4784
 
@@ -4820,7 +4820,7 @@  discard block
 block discarded – undo
4820 4820
                     if ($v === 'value') {
4821 4821
                         unset($_[$i]);
4822 4822
                     } else {
4823
-                        $_[$i] = 'tv.' . $v;
4823
+                        $_[$i] = 'tv.'.$v;
4824 4824
                     }
4825 4825
                 }
4826 4826
                 $fields = implode(',', $_);
@@ -4829,12 +4829,12 @@  discard block
 block discarded – undo
4829 4829
             }
4830 4830
 
4831 4831
             if ($tvsort != '') {
4832
-                $tvsort = 'tv.' . implode(',tv.', array_filter(array_map('trim', explode(',', $tvsort))));
4832
+                $tvsort = 'tv.'.implode(',tv.', array_filter(array_map('trim', explode(',', $tvsort))));
4833 4833
             }
4834 4834
             if ($tvidnames == "*") {
4835 4835
                 $query = "tv.id<>0";
4836 4836
             } else {
4837
-                $query = (is_numeric($tvidnames[0]) ? "tv.id" : "tv.name") . " IN ('" . implode("','", $tvidnames) . "')";
4837
+                $query = (is_numeric($tvidnames[0]) ? "tv.id" : "tv.name")." IN ('".implode("','", $tvidnames)."')";
4838 4838
             }
4839 4839
 
4840 4840
             $this->getUserDocGroups();
@@ -4846,10 +4846,10 @@  discard block
 block discarded – undo
4846 4846
                 $rs = $this->getDatabase()->select(
4847 4847
                     "{$fields}, IF(tvc.value!='',tvc.value,tv.default_text) as value ",
4848 4848
 
4849
-                    $this->getDatabase()->getFullTableName("site_tmplvars") .
4850
-                    " tv INNER JOIN " . $this->getDatabase()->getFullTableName("site_tmplvar_templates") .
4851
-                    " tvtpl ON tvtpl.tmplvarid = tv.id LEFT JOIN " .
4852
-                    $this->getDatabase()->getFullTableName("site_tmplvar_contentvalues") .
4849
+                    $this->getDatabase()->getFullTableName("site_tmplvars").
4850
+                    " tv INNER JOIN ".$this->getDatabase()->getFullTableName("site_tmplvar_templates").
4851
+                    " tvtpl ON tvtpl.tmplvarid = tv.id LEFT JOIN ".
4852
+                    $this->getDatabase()->getFullTableName("site_tmplvar_contentvalues").
4853 4853
                     " tvc ON tvc.tmplvarid=tv.id AND tvc.contentid='{$docid}'",
4854 4854
 
4855 4855
                     "{$query} AND tvtpl.templateid = '{$doc['template']}'",
@@ -4987,7 +4987,7 @@  discard block
 block discarded – undo
4987 4987
             return $this->tmpCache[__FUNCTION__][$cacheKey];
4988 4988
         }
4989 4989
 
4990
-        if (($idnames != '*' && !is_array($idnames)) || empty($idnames) ) {
4990
+        if (($idnames != '*' && !is_array($idnames)) || empty($idnames)) {
4991 4991
             return false;
4992 4992
         } else {
4993 4993
 
@@ -5005,23 +5005,23 @@  discard block
 block discarded – undo
5005 5005
             }
5006 5006
 
5007 5007
             // get user defined template variables
5008
-            $fields = ($fields == '') ? 'tv.*' : 'tv.' . implode(',tv.', array_filter(array_map('trim', explode(',', $fields))));
5009
-            $sort = ($sort == '') ? '' : 'tv.' . implode(',tv.', array_filter(array_map('trim', explode(',', $sort))));
5008
+            $fields = ($fields == '') ? 'tv.*' : 'tv.'.implode(',tv.', array_filter(array_map('trim', explode(',', $fields))));
5009
+            $sort = ($sort == '') ? '' : 'tv.'.implode(',tv.', array_filter(array_map('trim', explode(',', $sort))));
5010 5010
 
5011 5011
             if ($idnames == '*') {
5012 5012
                 $query = 'tv.id<>0';
5013 5013
             } else {
5014
-                $query = (is_numeric($idnames[0]) ? 'tv.id' : 'tv.name') . " IN ('" . implode("','", $idnames) . "')";
5014
+                $query = (is_numeric($idnames[0]) ? 'tv.id' : 'tv.name')." IN ('".implode("','", $idnames)."')";
5015 5015
             }
5016 5016
 
5017
-            $rs = $this->getDatabase()->select("{$fields}, IF(tvc.value != '', tvc.value, tv.default_text) as value", $this->getDatabase()->getFullTableName('site_tmplvars') . " tv
5018
-                    INNER JOIN " . $this->getDatabase()->getFullTableName('site_tmplvar_templates') . " tvtpl ON tvtpl.tmplvarid = tv.id
5019
-                    LEFT JOIN " . $this->getDatabase()->getFullTableName('site_tmplvar_contentvalues') . " tvc ON tvc.tmplvarid=tv.id AND tvc.contentid = '{$docid}'", "{$query} AND tvtpl.templateid = '{$docRow['template']}'", ($sort ? "{$sort} {$dir}" : ""));
5017
+            $rs = $this->getDatabase()->select("{$fields}, IF(tvc.value != '', tvc.value, tv.default_text) as value", $this->getDatabase()->getFullTableName('site_tmplvars')." tv
5018
+                    INNER JOIN " . $this->getDatabase()->getFullTableName('site_tmplvar_templates')." tvtpl ON tvtpl.tmplvarid = tv.id
5019
+                    LEFT JOIN " . $this->getDatabase()->getFullTableName('site_tmplvar_contentvalues')." tvc ON tvc.tmplvarid=tv.id AND tvc.contentid = '{$docid}'", "{$query} AND tvtpl.templateid = '{$docRow['template']}'", ($sort ? "{$sort} {$dir}" : ""));
5020 5020
 
5021 5021
             $result = $this->getDatabase()->makeArray($rs);
5022 5022
 
5023 5023
             // get default/built-in template variables
5024
-            if(is_array($docRow)){
5024
+            if (is_array($docRow)) {
5025 5025
                 ksort($docRow);
5026 5026
 
5027 5027
                 foreach ($docRow as $key => $value) {
@@ -5059,13 +5059,13 @@  discard block
 block discarded – undo
5059 5059
      */
5060 5060
     public function getTemplateVarOutput($idnames = array(), $docid = '', $published = 1, $sep = '')
5061 5061
     {
5062
-        if (is_array($idnames) && empty($idnames) ) {
5062
+        if (is_array($idnames) && empty($idnames)) {
5063 5063
             return false;
5064 5064
         } else {
5065 5065
             $output = array();
5066 5066
             $vars = ($idnames == '*' || is_array($idnames)) ? $idnames : array($idnames);
5067 5067
 
5068
-            $docid = (int)$docid > 0 ? (int)$docid : $this->documentIdentifier;
5068
+            $docid = (int) $docid > 0 ? (int) $docid : $this->documentIdentifier;
5069 5069
             // remove sort for speed
5070 5070
             $result = $this->getTemplateVars($vars, '*', $docid, $published, '', '');
5071 5071
 
@@ -5174,7 +5174,7 @@  discard block
 block discarded – undo
5174 5174
      */
5175 5175
     public function getCachePath()
5176 5176
     {
5177
-        return MODX_BASE_URL . $this->getCacheFolder();
5177
+        return MODX_BASE_URL.$this->getCacheFolder();
5178 5178
     }
5179 5179
 
5180 5180
     /**
@@ -5225,8 +5225,8 @@  discard block
 block discarded – undo
5225 5225
         $out = false;
5226 5226
 
5227 5227
         if (!empty($context)) {
5228
-            if (is_scalar($context) && isset($_SESSION[$context . 'Validated'])) {
5229
-                $out = $_SESSION[$context . 'InternalKey'];
5228
+            if (is_scalar($context) && isset($_SESSION[$context.'Validated'])) {
5229
+                $out = $_SESSION[$context.'InternalKey'];
5230 5230
             }
5231 5231
         } else {
5232 5232
             switch (true) {
@@ -5254,8 +5254,8 @@  discard block
 block discarded – undo
5254 5254
         $out = false;
5255 5255
 
5256 5256
         if (!empty($context)) {
5257
-            if (is_scalar($context) && isset($_SESSION[$context . 'Validated'])) {
5258
-                $out = $_SESSION[$context . 'Shortname'];
5257
+            if (is_scalar($context) && isset($_SESSION[$context.'Validated'])) {
5258
+                $out = $_SESSION[$context.'Shortname'];
5259 5259
             }
5260 5260
         } else {
5261 5261
             switch (true) {
@@ -5300,8 +5300,8 @@  discard block
 block discarded – undo
5300 5300
             return $this->tmpCache[__FUNCTION__][$uid];
5301 5301
         }
5302 5302
 
5303
-        $from = $this->getDatabase()->getFullTableName('manager_users') . ' mu INNER JOIN ' .
5304
-            $this->getDatabase()->getFullTableName('user_attributes'). ' mua ON mua.internalkey=mu.id';
5303
+        $from = $this->getDatabase()->getFullTableName('manager_users').' mu INNER JOIN '.
5304
+            $this->getDatabase()->getFullTableName('user_attributes').' mua ON mua.internalkey=mu.id';
5305 5305
         $where = sprintf("mu.id='%s'", $this->getDatabase()->escape($uid));
5306 5306
         $rs = $this->getDatabase()->select('mu.username, mu.password, mua.*', $from, $where, '', 1);
5307 5307
 
@@ -5327,8 +5327,8 @@  discard block
 block discarded – undo
5327 5327
      */
5328 5328
     public function getWebUserInfo($uid)
5329 5329
     {
5330
-        $rs = $this->getDatabase()->select('wu.username, wu.password, wua.*', $this->getDatabase()->getFullTableName("web_users") . " wu
5331
-                INNER JOIN " . $this->getDatabase()->getFullTableName("web_user_attributes") . " wua ON wua.internalkey=wu.id", "wu.id='{$uid}'");
5330
+        $rs = $this->getDatabase()->select('wu.username, wu.password, wua.*', $this->getDatabase()->getFullTableName("web_users")." wu
5331
+                INNER JOIN " . $this->getDatabase()->getFullTableName("web_user_attributes")." wua ON wua.internalkey=wu.id", "wu.id='{$uid}'");
5332 5332
         if ($row = $this->getDatabase()->getRow($rs)) {
5333 5333
             if (!isset($row['usertype']) or !$row["usertype"]) {
5334 5334
                 $row["usertype"] = "web";
@@ -5364,7 +5364,7 @@  discard block
 block discarded – undo
5364 5364
         } else if (is_array($dg)) {
5365 5365
             // resolve ids to names
5366 5366
             $dgn = array();
5367
-            $ds = $this->getDatabase()->select('name', $this->getDatabase()->getFullTableName("documentgroup_names"), "id IN (" . implode(",", $dg) . ")");
5367
+            $ds = $this->getDatabase()->select('name', $this->getDatabase()->getFullTableName("documentgroup_names"), "id IN (".implode(",", $dg).")");
5368 5368
             while ($row = $this->getDatabase()->getRow($ds)) {
5369 5369
                 $dgn[] = $row['name'];
5370 5370
             }
@@ -5392,7 +5392,7 @@  discard block
 block discarded – undo
5392 5392
         $rt = false;
5393 5393
         if ($_SESSION["webValidated"] == 1) {
5394 5394
             $tbl = $this->getDatabase()->getFullTableName("web_users");
5395
-            $ds = $this->getDatabase()->select('id, username, password', $tbl, "id='" . $this->getLoginUserID() . "'");
5395
+            $ds = $this->getDatabase()->select('id, username, password', $tbl, "id='".$this->getLoginUserID()."'");
5396 5396
             if ($row = $this->getDatabase()->getRow($ds)) {
5397 5397
                 if ($row["password"] == md5($oldPwd)) {
5398 5398
                     if (strlen($newPwd) < 6) {
@@ -5402,7 +5402,7 @@  discard block
 block discarded – undo
5402 5402
                     } else {
5403 5403
                         $this->getDatabase()->update(array(
5404 5404
                             'password' => $this->getDatabase()->escape($newPwd),
5405
-                        ), $tbl, "id='" . $this->getLoginUserID() . "'");
5405
+                        ), $tbl, "id='".$this->getLoginUserID()."'");
5406 5406
                         // invoke OnWebChangePassword event
5407 5407
                         $this->invokeEvent("OnWebChangePassword", array(
5408 5408
                             "userid" => $row["id"],
@@ -5433,8 +5433,8 @@  discard block
 block discarded – undo
5433 5433
         // check cache
5434 5434
         $grpNames = isset ($_SESSION['webUserGroupNames']) ? $_SESSION['webUserGroupNames'] : false;
5435 5435
         if (!is_array($grpNames)) {
5436
-            $rs = $this->getDatabase()->select('wgn.name', $this->getDatabase()->getFullTableName("webgroup_names") . " wgn
5437
-                    INNER JOIN " . $this->getDatabase()->getFullTableName("web_groups") . " wg ON wg.webgroup=wgn.id AND wg.webuser='" . $this->getLoginUserID() . "'");
5436
+            $rs = $this->getDatabase()->select('wgn.name', $this->getDatabase()->getFullTableName("webgroup_names")." wgn
5437
+                    INNER JOIN " . $this->getDatabase()->getFullTableName("web_groups")." wg ON wg.webgroup=wgn.id AND wg.webuser='".$this->getLoginUserID()."'");
5438 5438
             $grpNames = $this->getDatabase()->getColumn("name", $rs);
5439 5439
             // save to cache
5440 5440
             $_SESSION['webUserGroupNames'] = $grpNames;
@@ -5467,7 +5467,7 @@  discard block
 block discarded – undo
5467 5467
         if (strpos(strtolower($src), "<style") !== false || strpos(strtolower($src), "<link") !== false) {
5468 5468
             $this->sjscripts[$nextpos] = $src;
5469 5469
         } else {
5470
-            $this->sjscripts[$nextpos] = "\t" . '<link rel="stylesheet" type="text/css" href="' . $src . '" ' . ($media ? 'media="' . $media . '" ' : '') . '/>';
5470
+            $this->sjscripts[$nextpos] = "\t".'<link rel="stylesheet" type="text/css" href="'.$src.'" '.($media ? 'media="'.$media.'" ' : '').'/>';
5471 5471
         }
5472 5472
     }
5473 5473
 
@@ -5546,7 +5546,7 @@  discard block
 block discarded – undo
5546 5546
         }
5547 5547
 
5548 5548
         if ($useThisVer && $plaintext != true && (strpos(strtolower($src), "<script") === false)) {
5549
-            $src = "\t" . '<script type="text/javascript" src="' . $src . '"></script>';
5549
+            $src = "\t".'<script type="text/javascript" src="'.$src.'"></script>';
5550 5550
         }
5551 5551
         if ($startup) {
5552 5552
             $pos = isset($overwritepos) ? $overwritepos : max(array_merge(array(0), array_keys($this->sjscripts))) + 1;
@@ -5693,7 +5693,7 @@  discard block
 block discarded – undo
5693 5693
                 $eventtime = $this->getMicroTime() - $eventtime;
5694 5694
                 $this->pluginsCode .= sprintf('<fieldset><legend><b>%s / %s</b> (%2.2f ms)</legend>', $evtName, $pluginName, $eventtime * 1000);
5695 5695
                 foreach ($parameter as $k => $v) {
5696
-                    $this->pluginsCode .= "{$k} => " . print_r($v, true) . '<br>';
5696
+                    $this->pluginsCode .= "{$k} => ".print_r($v, true).'<br>';
5697 5697
                 }
5698 5698
                 $this->pluginsCode .= '</fieldset><br />';
5699 5699
                 $this->pluginsTime["{$evtName} / {$pluginName}"] += $eventtime;
@@ -5721,13 +5721,13 @@  discard block
 block discarded – undo
5721 5721
         $plugin = array();
5722 5722
         if (isset ($this->pluginCache[$pluginName])) {
5723 5723
             $pluginCode = $this->pluginCache[$pluginName];
5724
-            $pluginProperties = isset($this->pluginCache[$pluginName . "Props"]) ? $this->pluginCache[$pluginName . "Props"] : '';
5724
+            $pluginProperties = isset($this->pluginCache[$pluginName."Props"]) ? $this->pluginCache[$pluginName."Props"] : '';
5725 5725
         } else {
5726 5726
             $pluginName = $this->getDatabase()->escape($pluginName);
5727 5727
             $result = $this->getDatabase()->select('name, plugincode, properties', $this->getDatabase()->getFullTableName("site_plugins"), "name='{$pluginName}' AND disabled=0");
5728 5728
             if ($row = $this->getDatabase()->getRow($result)) {
5729 5729
                 $pluginCode = $this->pluginCache[$row['name']] = $row['plugincode'];
5730
-                $pluginProperties = $this->pluginCache[$row['name'] . "Props"] = $row['properties'];
5730
+                $pluginProperties = $this->pluginCache[$row['name']."Props"] = $row['properties'];
5731 5731
             } else {
5732 5732
                 $pluginCode = $this->pluginCache[$pluginName] = "return false;";
5733 5733
                 $pluginProperties = '';
@@ -5751,7 +5751,7 @@  discard block
 block discarded – undo
5751 5751
     {
5752 5752
         $property = array();
5753 5753
 
5754
-        if(\is_scalar($propertyString)) {
5754
+        if (\is_scalar($propertyString)) {
5755 5755
             $propertyString = trim($propertyString);
5756 5756
             $propertyString = str_replace('{}', '', $propertyString);
5757 5757
             $propertyString = str_replace('} {', ',', $propertyString);
@@ -5805,7 +5805,7 @@  discard block
 block discarded – undo
5805 5805
                 }
5806 5806
             }
5807 5807
         }
5808
-        elseif(\is_array($propertyString)) {
5808
+        elseif (\is_array($propertyString)) {
5809 5809
             $property = $propertyString;
5810 5810
         }
5811 5811
         if (!empty($elementName) && !empty($elementType)) {
@@ -5836,7 +5836,7 @@  discard block
 block discarded – undo
5836 5836
     public function parseDocBlockFromFile($element_dir, $filename, $escapeValues = false)
5837 5837
     {
5838 5838
         $params = array();
5839
-        $fullpath = $element_dir . '/' . $filename;
5839
+        $fullpath = $element_dir.'/'.$filename;
5840 5840
         if (is_readable($fullpath)) {
5841 5841
             $tpl = @fopen($fullpath, "r");
5842 5842
             if ($tpl) {
@@ -6003,8 +6003,8 @@  discard block
 block discarded – undo
6003 6003
         $ph = array('site_url' => MODX_SITE_URL);
6004 6004
         $regexUrl = "/((http|https|ftp|ftps)\:\/\/[^\/]+(\/[^\s]+[^,.?!:;\s])?)/";
6005 6005
         $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';
6006
-        $emailSubject = isset($parsed['name']) ? '?subject=' . $parsed['name'] : '';
6007
-        $emailSubject .= isset($parsed['version']) ? ' v' . $parsed['version'] : '';
6006
+        $emailSubject = isset($parsed['name']) ? '?subject='.$parsed['name'] : '';
6007
+        $emailSubject .= isset($parsed['version']) ? ' v'.$parsed['version'] : '';
6008 6008
         foreach ($parsed as $key => $val) {
6009 6009
             if (is_array($val)) {
6010 6010
                 foreach ($val as $key2 => $val2) {
@@ -6013,7 +6013,7 @@  discard block
 block discarded – undo
6013 6013
                         $val2 = preg_replace($regexUrl, "<a href=\"{$url[0]}\" target=\"_blank\">{$url[0]}</a> ", $val2);
6014 6014
                     }
6015 6015
                     if (preg_match($regexEmail, $val2, $url)) {
6016
-                        $val2 = preg_replace($regexEmail, '<a href="mailto:\\1' . $emailSubject . '">\\1</a>', $val2);
6016
+                        $val2 = preg_replace($regexEmail, '<a href="mailto:\\1'.$emailSubject.'">\\1</a>', $val2);
6017 6017
                     }
6018 6018
                     $parsed[$key][$key2] = $val2;
6019 6019
                 }
@@ -6023,7 +6023,7 @@  discard block
 block discarded – undo
6023 6023
                     $val = preg_replace($regexUrl, "<a href=\"{$url[0]}\" target=\"_blank\">{$url[0]}</a> ", $val);
6024 6024
                 }
6025 6025
                 if (preg_match($regexEmail, $val, $url)) {
6026
-                    $val = preg_replace($regexEmail, '<a href="mailto:\\1' . $emailSubject . '">\\1</a>', $val);
6026
+                    $val = preg_replace($regexEmail, '<a href="mailto:\\1'.$emailSubject.'">\\1</a>', $val);
6027 6027
                 }
6028 6028
                 $parsed[$key] = $val;
6029 6029
             }
@@ -6037,32 +6037,32 @@  discard block
 block discarded – undo
6037 6037
         );
6038 6038
 
6039 6039
         $nl = "\n";
6040
-        $list = isset($parsed['logo']) ? '<img src="' . $this->config['base_url'] . ltrim($parsed['logo'], "/") . '" style="float:right;max-width:100px;height:auto;" />' . $nl : '';
6041
-        $list .= '<p>' . $nl;
6042
-        $list .= isset($parsed['name']) ? '<strong>' . $parsed['name'] . '</strong><br/>' . $nl : '';
6043
-        $list .= isset($parsed['description']) ? $parsed['description'] . $nl : '';
6044
-        $list .= '</p><br/>' . $nl;
6045
-        $list .= isset($parsed['version']) ? '<p><strong>' . $_lang['version'] . ':</strong> ' . $parsed['version'] . '</p>' . $nl : '';
6046
-        $list .= isset($parsed['license']) ? '<p><strong>' . $_lang['license'] . ':</strong> ' . $parsed['license'] . '</p>' . $nl : '';
6047
-        $list .= isset($parsed['lastupdate']) ? '<p><strong>' . $_lang['last_update'] . ':</strong> ' . $parsed['lastupdate'] . '</p>' . $nl : '';
6048
-        $list .= '<br/>' . $nl;
6040
+        $list = isset($parsed['logo']) ? '<img src="'.$this->config['base_url'].ltrim($parsed['logo'], "/").'" style="float:right;max-width:100px;height:auto;" />'.$nl : '';
6041
+        $list .= '<p>'.$nl;
6042
+        $list .= isset($parsed['name']) ? '<strong>'.$parsed['name'].'</strong><br/>'.$nl : '';
6043
+        $list .= isset($parsed['description']) ? $parsed['description'].$nl : '';
6044
+        $list .= '</p><br/>'.$nl;
6045
+        $list .= isset($parsed['version']) ? '<p><strong>'.$_lang['version'].':</strong> '.$parsed['version'].'</p>'.$nl : '';
6046
+        $list .= isset($parsed['license']) ? '<p><strong>'.$_lang['license'].':</strong> '.$parsed['license'].'</p>'.$nl : '';
6047
+        $list .= isset($parsed['lastupdate']) ? '<p><strong>'.$_lang['last_update'].':</strong> '.$parsed['lastupdate'].'</p>'.$nl : '';
6048
+        $list .= '<br/>'.$nl;
6049 6049
         $first = true;
6050 6050
         foreach ($arrayParams as $param => $label) {
6051 6051
             if (isset($parsed[$param])) {
6052 6052
                 if ($first) {
6053
-                    $list .= '<p><strong>' . $_lang['references'] . '</strong></p>' . $nl;
6054
-                    $list .= '<ul class="docBlockList">' . $nl;
6053
+                    $list .= '<p><strong>'.$_lang['references'].'</strong></p>'.$nl;
6054
+                    $list .= '<ul class="docBlockList">'.$nl;
6055 6055
                     $first = false;
6056 6056
                 }
6057
-                $list .= '    <li><strong>' . $label . '</strong>' . $nl;
6058
-                $list .= '        <ul>' . $nl;
6057
+                $list .= '    <li><strong>'.$label.'</strong>'.$nl;
6058
+                $list .= '        <ul>'.$nl;
6059 6059
                 foreach ($parsed[$param] as $val) {
6060
-                    $list .= '            <li>' . $val . '</li>' . $nl;
6060
+                    $list .= '            <li>'.$val.'</li>'.$nl;
6061 6061
                 }
6062
-                $list .= '        </ul></li>' . $nl;
6062
+                $list .= '        </ul></li>'.$nl;
6063 6063
             }
6064 6064
         }
6065
-        $list .= !$first ? '</ul>' . $nl : '';
6065
+        $list .= !$first ? '</ul>'.$nl : '';
6066 6066
 
6067 6067
         return $list;
6068 6068
     }
@@ -6137,8 +6137,8 @@  discard block
 block discarded – undo
6137 6137
      */
6138 6138
     public function addSnippet($name, $phpCode, $namespace = '#', array $defaultParams = array())
6139 6139
     {
6140
-        $this->snippetCache[$namespace . $name] = $phpCode;
6141
-        $this->snippetCache[$namespace . $name . 'Props'] = $defaultParams;
6140
+        $this->snippetCache[$namespace.$name] = $phpCode;
6141
+        $this->snippetCache[$namespace.$name.'Props'] = $defaultParams;
6142 6142
     }
6143 6143
 
6144 6144
     /**
@@ -6146,7 +6146,7 @@  discard block
 block discarded – undo
6146 6146
      */
6147 6147
     public function addChunk($name, $text, $namespace = '#')
6148 6148
     {
6149
-        $this->chunkCache[$namespace . $name] = $text;
6149
+        $this->chunkCache[$namespace.$name] = $text;
6150 6150
     }
6151 6151
 
6152 6152
     /**
@@ -6156,7 +6156,7 @@  discard block
 block discarded – undo
6156 6156
     {
6157 6157
         $out = array();
6158 6158
 
6159
-        if (! is_dir($scanPath) || empty($ext)) {
6159
+        if (!is_dir($scanPath) || empty($ext)) {
6160 6160
             return $out;
6161 6161
         }
6162 6162
         $iterator = new \RecursiveIteratorIterator(
@@ -6168,22 +6168,22 @@  discard block
 block discarded – undo
6168 6168
              * @var \SplFileInfo $item
6169 6169
              */
6170 6170
             if ($item->isFile() && $item->isReadable() && \in_array($item->getExtension(), $ext)) {
6171
-                $name = $item->getBasename('.' . $item->getExtension());
6171
+                $name = $item->getBasename('.'.$item->getExtension());
6172 6172
                 $path = ltrim(str_replace(
6173 6173
                     array(rtrim($scanPath, '//'), '/'),
6174 6174
                     array('', '\\'),
6175
-                    $item->getPath() . '/'
6175
+                    $item->getPath().'/'
6176 6176
                 ), '\\');
6177 6177
 
6178 6178
                 if (!empty($path)) {
6179
-                    $name = $path . $name;
6179
+                    $name = $path.$name;
6180 6180
                 }
6181 6181
                 switch ($type) {
6182 6182
                     case 'chunk':
6183 6183
                         $out[$name] = file_get_contents($item->getRealPath());
6184 6184
                         break;
6185 6185
                     case 'snippet':
6186
-                        $out[$name] = "return require '" . $item->getRealPath() . "';";
6186
+                        $out[$name] = "return require '".$item->getRealPath()."';";
6187 6187
                         break;
6188 6188
                     default:
6189 6189
                         throw new \Exception;
@@ -6227,7 +6227,7 @@  discard block
 block discarded – undo
6227 6227
         }
6228 6228
 
6229 6229
         if (!$isSafe) {
6230
-            $msg = $phpcode . "\n" . $this->currentSnippet . "\n" . print_r($_SERVER, true);
6230
+            $msg = $phpcode."\n".$this->currentSnippet."\n".print_r($_SERVER, true);
6231 6231
             $title = sprintf('Unknown eval was executed (%s)', $this->getPhpCompat()->htmlspecialchars(substr(trim($phpcode), 0, 50)));
6232 6232
             $this->messageQuit($title, '', true, '', '', 'Parser', $msg);
6233 6233
             return;
@@ -6241,7 +6241,7 @@  discard block
 block discarded – undo
6241 6241
             return 'array()';
6242 6242
         }
6243 6243
 
6244
-        $output = $echo . $return;
6244
+        $output = $echo.$return;
6245 6245
         modx_sanitize_gpc($output);
6246 6246
         return $this->getPhpCompat()->htmlspecialchars($output); // Maybe, all html tags are dangerous
6247 6247
     }
@@ -6259,8 +6259,8 @@  discard block
 block discarded – undo
6259 6259
 
6260 6260
         $safe = explode(',', $safe_functions);
6261 6261
 
6262
-        $phpcode = rtrim($phpcode, ';') . ';';
6263
-        $tokens = token_get_all('<?php ' . $phpcode);
6262
+        $phpcode = rtrim($phpcode, ';').';';
6263
+        $tokens = token_get_all('<?php '.$phpcode);
6264 6264
         foreach ($tokens as $i => $token) {
6265 6265
             if (!is_array($token)) {
6266 6266
                 continue;
@@ -6296,7 +6296,7 @@  discard block
 block discarded – undo
6296 6296
     public function atBindFileContent($str = '')
6297 6297
     {
6298 6298
 
6299
-        $search_path = array('assets/tvs/', 'assets/chunks/', 'assets/templates/', $this->config['rb_base_url'] . 'files/', '');
6299
+        $search_path = array('assets/tvs/', 'assets/chunks/', 'assets/templates/', $this->config['rb_base_url'].'files/', '');
6300 6300
 
6301 6301
         if (stripos($str, '@FILE') !== 0) {
6302 6302
             return $str;
@@ -6319,7 +6319,7 @@  discard block
 block discarded – undo
6319 6319
         $errorMsg = sprintf("Could not retrieve string '%s'.", $str);
6320 6320
 
6321 6321
         foreach ($search_path as $path) {
6322
-            $file_path = MODX_BASE_PATH . $path . $str;
6322
+            $file_path = MODX_BASE_PATH.$path.$str;
6323 6323
             if (strpos($file_path, MODX_MANAGER_PATH) === 0) {
6324 6324
                 return $errorMsg;
6325 6325
             } elseif (is_file($file_path)) {
@@ -6333,7 +6333,7 @@  discard block
 block discarded – undo
6333 6333
             return $errorMsg;
6334 6334
         }
6335 6335
 
6336
-        $content = (string)file_get_contents($file_path);
6336
+        $content = (string) file_get_contents($file_path);
6337 6337
         if ($content === false) {
6338 6338
             return $errorMsg;
6339 6339
         }
@@ -6442,22 +6442,22 @@  discard block
 block discarded – undo
6442 6442
 
6443 6443
         $version = isset ($GLOBALS['modx_version']) ? $GLOBALS['modx_version'] : '';
6444 6444
         $release_date = isset ($GLOBALS['release_date']) ? $GLOBALS['release_date'] : '';
6445
-        $request_uri = "http://" . $_SERVER['HTTP_HOST'] . ($_SERVER["SERVER_PORT"] == 80 ? "" : (":" . $_SERVER["SERVER_PORT"])) . $_SERVER['REQUEST_URI'];
6445
+        $request_uri = "http://".$_SERVER['HTTP_HOST'].($_SERVER["SERVER_PORT"] == 80 ? "" : (":".$_SERVER["SERVER_PORT"])).$_SERVER['REQUEST_URI'];
6446 6446
         $request_uri = $this->getPhpCompat()->htmlspecialchars($request_uri, ENT_QUOTES, $this->config['modx_charset']);
6447 6447
         $ua = $this->getPhpCompat()->htmlspecialchars($_SERVER['HTTP_USER_AGENT'], ENT_QUOTES, $this->config['modx_charset']);
6448 6448
         $referer = $this->getPhpCompat()->htmlspecialchars($_SERVER['HTTP_REFERER'], ENT_QUOTES, $this->config['modx_charset']);
6449 6449
         if ($is_error) {
6450 6450
             $str = '<h2 style="color:red">&laquo; Evo Parse Error &raquo;</h2>';
6451 6451
             if ($msg != 'PHP Parse Error') {
6452
-                $str .= '<h3 style="color:red">' . $msg . '</h3>';
6452
+                $str .= '<h3 style="color:red">'.$msg.'</h3>';
6453 6453
             }
6454 6454
         } else {
6455 6455
             $str = '<h2 style="color:#003399">&laquo; Evo Debug/ stop message &raquo;</h2>';
6456
-            $str .= '<h3 style="color:#003399">' . $msg . '</h3>';
6456
+            $str .= '<h3 style="color:#003399">'.$msg.'</h3>';
6457 6457
         }
6458 6458
 
6459 6459
         if (!empty ($query)) {
6460
-            $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>';
6460
+            $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>';
6461 6461
         }
6462 6462
 
6463 6463
         $errortype = array(
@@ -6480,13 +6480,13 @@  discard block
 block discarded – undo
6480 6480
 
6481 6481
         if (!empty($nr) || !empty($file)) {
6482 6482
             if ($text != '') {
6483
-                $str .= '<div style="font-weight:bold;border:1px solid #ccc;padding:8px;color:#333;background-color:#ffffcd;margin-bottom:15px;">Error : ' . $text . '</div>';
6483
+                $str .= '<div style="font-weight:bold;border:1px solid #ccc;padding:8px;color:#333;background-color:#ffffcd;margin-bottom:15px;">Error : '.$text.'</div>';
6484 6484
             }
6485 6485
             if ($output != '') {
6486
-                $str .= '<div style="font-weight:bold;border:1px solid #ccc;padding:8px;color:#333;background-color:#ffffcd;margin-bottom:15px;">' . $output . '</div>';
6486
+                $str .= '<div style="font-weight:bold;border:1px solid #ccc;padding:8px;color:#333;background-color:#ffffcd;margin-bottom:15px;">'.$output.'</div>';
6487 6487
             }
6488 6488
             if ($nr !== '') {
6489
-                $table[] = array('ErrorType[num]', $errortype [$nr] . "[" . $nr . "]");
6489
+                $table[] = array('ErrorType[num]', $errortype [$nr]."[".$nr."]");
6490 6490
             }
6491 6491
             if ($file) {
6492 6492
                 $table[] = array('File', $file);
@@ -6506,7 +6506,7 @@  discard block
 block discarded – undo
6506 6506
         }
6507 6507
 
6508 6508
         if (!empty($this->event->activePlugin)) {
6509
-            $table[] = array('Current Plugin', $this->event->activePlugin . '(' . $this->event->name . ')');
6509
+            $table[] = array('Current Plugin', $this->event->activePlugin.'('.$this->event->name.')');
6510 6510
         }
6511 6511
 
6512 6512
         $str .= $MakeTable->create($table, array('Error information', ''));
@@ -6516,17 +6516,17 @@  discard block
 block discarded – undo
6516 6516
         $table[] = array('REQUEST_URI', $request_uri);
6517 6517
 
6518 6518
         if ($this->getManagerApi()->action) {
6519
-            include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php');
6519
+            include_once(MODX_MANAGER_PATH.'includes/actionlist.inc.php');
6520 6520
             global $action_list;
6521 6521
             $actionName = (isset($action_list[$this->getManagerApi()->action])) ? " - {$action_list[$this->getManagerApi()->action]}" : '';
6522 6522
 
6523
-            $table[] = array('Manager action', $this->getManagerApi()->action . $actionName);
6523
+            $table[] = array('Manager action', $this->getManagerApi()->action.$actionName);
6524 6524
         }
6525 6525
 
6526 6526
         if (preg_match('@^[0-9]+@', $this->documentIdentifier)) {
6527 6527
             $resource = $this->getDocumentObject('id', $this->documentIdentifier);
6528 6528
             $url = $this->makeUrl($this->documentIdentifier, '', '', 'full');
6529
-            $table[] = array('Resource', '[' . $this->documentIdentifier . '] <a href="' . $url . '" target="_blank">' . $resource['pagetitle'] . '</a>');
6529
+            $table[] = array('Resource', '['.$this->documentIdentifier.'] <a href="'.$url.'" target="_blank">'.$resource['pagetitle'].'</a>');
6530 6530
         }
6531 6531
         $table[] = array('Referer', $referer);
6532 6532
         $table[] = array('User Agent', $ua);
@@ -6547,7 +6547,7 @@  discard block
 block discarded – undo
6547 6547
 
6548 6548
         $mem = memory_get_peak_usage(true);
6549 6549
         $total_mem = $mem - $this->mstart;
6550
-        $total_mem = ($total_mem / 1024 / 1024) . ' mb';
6550
+        $total_mem = ($total_mem / 1024 / 1024).' mb';
6551 6551
 
6552 6552
         $queryTime = $this->queryTime;
6553 6553
         $phpTime = $totalTime - $queryTime;
@@ -6568,18 +6568,18 @@  discard block
 block discarded – undo
6568 6568
         $str .= $this->get_backtrace(debug_backtrace());
6569 6569
         // Log error
6570 6570
         if (!empty($this->currentSnippet)) {
6571
-            $source = 'Snippet - ' . $this->currentSnippet;
6571
+            $source = 'Snippet - '.$this->currentSnippet;
6572 6572
         } elseif (!empty($this->event->activePlugin)) {
6573
-            $source = 'Plugin - ' . $this->event->activePlugin;
6573
+            $source = 'Plugin - '.$this->event->activePlugin;
6574 6574
         } elseif ($source !== '') {
6575
-            $source = 'Parser - ' . $source;
6575
+            $source = 'Parser - '.$source;
6576 6576
         } elseif ($query !== '') {
6577 6577
             $source = 'SQL Query';
6578 6578
         } else {
6579 6579
             $source = 'Parser';
6580 6580
         }
6581 6581
         if ($msg) {
6582
-            $source .= ' / ' . $msg;
6582
+            $source .= ' / '.$msg;
6583 6583
         }
6584 6584
         if (isset($actionName) && !empty($actionName)) {
6585 6585
             $source .= $actionName;
@@ -6612,12 +6612,12 @@  discard block
 block discarded – undo
6612 6612
         ob_get_clean();
6613 6613
         // Display error
6614 6614
         if (isset($_SESSION['mgrValidated'])) {
6615
-            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>
6615
+            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>
6616 6616
                  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6617
-                 <link rel="stylesheet" type="text/css" href="' . $this->config['site_manager_url'] . 'media/style/' . $this->config['manager_theme'] . '/style.css" />
6617
+                 <link rel="stylesheet" type="text/css" href="' . $this->config['site_manager_url'].'media/style/'.$this->config['manager_theme'].'/style.css" />
6618 6618
                  <style type="text/css">body { padding:10px; } td {font:inherit;}</style>
6619 6619
                  </head><body>
6620
-                 ' . $str . '</body></html>';
6620
+                 ' . $str.'</body></html>';
6621 6621
 
6622 6622
         } else {
6623 6623
             echo 'Error';
@@ -6652,7 +6652,7 @@  discard block
 block discarded – undo
6652 6652
             switch (get_by_key($val, 'type')) {
6653 6653
                 case '->':
6654 6654
                 case '::':
6655
-                    $functionName = $val['function'] = $val['class'] . $val['type'] . $val['function'];
6655
+                    $functionName = $val['function'] = $val['class'].$val['type'].$val['function'];
6656 6656
                     break;
6657 6657
                 default:
6658 6658
                     $functionName = $val['function'];
@@ -6662,7 +6662,7 @@  discard block
 block discarded – undo
6662 6662
             $args = array_pad(array(), $_, '$var');
6663 6663
             $args = implode(", ", $args);
6664 6664
             $modx = &$this;
6665
-            $args = preg_replace_callback('/\$var/', function () use ($modx, &$tmp, $val) {
6665
+            $args = preg_replace_callback('/\$var/', function() use ($modx, &$tmp, $val) {
6666 6666
                 $arg = $val['args'][$tmp - 1];
6667 6667
                 switch (true) {
6668 6668
                     case is_null($arg): {
@@ -6674,7 +6674,7 @@  discard block
 block discarded – undo
6674 6674
                         break;
6675 6675
                     }
6676 6676
                     case is_scalar($arg): {
6677
-                        $out = strlen($arg) > 20 ? 'string $var' . $tmp : ("'" . $this->getPhpCompat()->htmlspecialchars(str_replace("'", "\\'", $arg)) . "'");
6677
+                        $out = strlen($arg) > 20 ? 'string $var'.$tmp : ("'".$this->getPhpCompat()->htmlspecialchars(str_replace("'", "\\'", $arg))."'");
6678 6678
                         break;
6679 6679
                     }
6680 6680
                     case is_bool($arg): {
@@ -6682,23 +6682,23 @@  discard block
 block discarded – undo
6682 6682
                         break;
6683 6683
                     }
6684 6684
                     case is_array($arg): {
6685
-                        $out = 'array $var' . $tmp;
6685
+                        $out = 'array $var'.$tmp;
6686 6686
                         break;
6687 6687
                     }
6688 6688
                     case is_object($arg): {
6689
-                        $out = get_class($arg) . ' $var' . $tmp;
6689
+                        $out = get_class($arg).' $var'.$tmp;
6690 6690
                         break;
6691 6691
                     }
6692 6692
                     default: {
6693
-                        $out = '$var' . $tmp;
6693
+                        $out = '$var'.$tmp;
6694 6694
                     }
6695 6695
                 }
6696 6696
                 $tmp++;
6697 6697
                 return $out;
6698 6698
             }, $args);
6699 6699
             $line = array(
6700
-                "<strong>" . $functionName . "</strong>(" . $args . ")",
6701
-                $path . " on line " . $val['line']
6700
+                "<strong>".$functionName."</strong>(".$args.")",
6701
+                $path." on line ".$val['line']
6702 6702
             );
6703 6703
             $table[] = array(implode("<br />", $line));
6704 6704
         }
@@ -6739,7 +6739,7 @@  discard block
 block discarded – undo
6739 6739
             $alias = strip_tags($alias); // strip HTML
6740 6740
             $alias = preg_replace('/[^\.A-Za-z0-9 _-]/', '', $alias); // strip non-alphanumeric characters
6741 6741
             $alias = preg_replace('/\s+/', '-', $alias); // convert white-space to dash
6742
-            $alias = preg_replace('/-+/', '-', $alias);  // convert multiple dashes to one
6742
+            $alias = preg_replace('/-+/', '-', $alias); // convert multiple dashes to one
6743 6743
             $alias = trim($alias, '-'); // trim excess
6744 6744
             return $alias;
6745 6745
         }
@@ -6755,7 +6755,7 @@  discard block
 block discarded – undo
6755 6755
         $precisions = count($sizes) - 1;
6756 6756
         foreach ($sizes as $unit => $bytes) {
6757 6757
             if ($size >= $bytes) {
6758
-                return number_format($size / $bytes, $precisions) . ' ' . $unit;
6758
+                return number_format($size / $bytes, $precisions).' '.$unit;
6759 6759
             }
6760 6760
             $precisions--;
6761 6761
         }
@@ -6859,10 +6859,10 @@  discard block
 block discarded – undo
6859 6859
 
6860 6860
         if (strpos($str, MODX_MANAGER_PATH) === 0) {
6861 6861
             return false;
6862
-        } elseif (is_file(MODX_BASE_PATH . $str)) {
6863
-            $file_path = MODX_BASE_PATH . $str;
6864
-        } elseif (is_file(MODX_BASE_PATH . "{$tpl_dir}{$str}")) {
6865
-            $file_path = MODX_BASE_PATH . $tpl_dir . $str;
6862
+        } elseif (is_file(MODX_BASE_PATH.$str)) {
6863
+            $file_path = MODX_BASE_PATH.$str;
6864
+        } elseif (is_file(MODX_BASE_PATH."{$tpl_dir}{$str}")) {
6865
+            $file_path = MODX_BASE_PATH.$tpl_dir.$str;
6866 6866
         } else {
6867 6867
             return false;
6868 6868
         }
@@ -6986,7 +6986,7 @@  discard block
 block discarded – undo
6986 6986
             $title = 'no title';
6987 6987
         }
6988 6988
         if (is_array($msg)) {
6989
-            $msg = '<pre>' . print_r($msg, true) . '</pre>';
6989
+            $msg = '<pre>'.print_r($msg, true).'</pre>';
6990 6990
         } elseif ($msg === '') {
6991 6991
             $msg = $_SERVER['REQUEST_URI'];
6992 6992
         }
Please login to merge, or discard this patch.