Completed
Push — develop ( cb7ecf...5e631f )
by Dmytro
17s
created
manager/includes/src/Support/MakeTable.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
      */
131 131
     public function setTableWidth($value)
132 132
     {
133
-        $this->tableWidth = (int)$value;
133
+        $this->tableWidth = (int) $value;
134 134
     }
135 135
 
136 136
     /**
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
     {
318 318
         $currentWidth = '';
319 319
         if (is_array($this->columnWidths)) {
320
-            $currentWidth = $this->columnWidths[$columnPosition] ? ' width="' . $this->columnWidths[$columnPosition] . '" ' : '';
320
+            $currentWidth = $this->columnWidths[$columnPosition] ? ' width="'.$this->columnWidths[$columnPosition].'" ' : '';
321 321
         }
322 322
 
323 323
         return $currentWidth;
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
             $currentClass = $this->rowAlternateClass;
347 347
         }
348 348
 
349
-        return ' class="' . $currentClass . '"';
349
+        return ' class="'.$currentClass.'"';
350 350
     }
351 351
 
352 352
     /**
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
     {
361 361
         $cellAction = '';
362 362
         if ($this->cellAction) {
363
-            $cellAction = ' onClick="javascript:window.location=\'' . $this->cellAction . $this->actionField . '=' . urlencode($currentActionFieldValue) . '\'" ';
363
+            $cellAction = ' onClick="javascript:window.location=\''.$this->cellAction.$this->actionField.'='.urlencode($currentActionFieldValue).'\'" ';
364 364
         }
365 365
 
366 366
         return $cellAction;
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
     {
378 378
         $cell = $value;
379 379
         if ($this->linkAction) {
380
-            $cell = '<a href="' . $this->linkAction . $this->actionField . '=' . urlencode($currentActionFieldValue) . '">' . $cell . '</a>';
380
+            $cell = '<a href="'.$this->linkAction.$this->actionField.'='.urlencode($currentActionFieldValue).'">'.$cell.'</a>';
381 381
         }
382 382
 
383 383
         return $cell;
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
             $end = '?';
407 407
         }
408 408
 
409
-        return $link . $end;
409
+        return $link.$end;
410 410
     }
411 411
 
412 412
     /**
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
         if (is_array($fieldsArray)) {
427 427
             $i = 0;
428 428
             foreach ($fieldsArray as $fieldName => $fieldValue) {
429
-                $table .= "\t<tr" . $this->determineRowClass($i) . ">\n";
429
+                $table .= "\t<tr".$this->determineRowClass($i).">\n";
430 430
                 $currentActionFieldValue = $fieldValue[$this->actionField];
431 431
                 if (is_array($this->selectedValues)) {
432 432
                     $isChecked = array_search($currentActionFieldValue, $this->selectedValues) === false ? 0 : 1;
@@ -437,15 +437,15 @@  discard block
 block discarded – undo
437 437
                 $colPosition = 0;
438 438
                 foreach ($fieldValue as $key => $value) {
439 439
                     if (!in_array($key, $this->excludeFields)) {
440
-                        $table .= "\t\t<td" . $this->getCellAction($currentActionFieldValue) . ">";
440
+                        $table .= "\t\t<td".$this->getCellAction($currentActionFieldValue).">";
441 441
                         $table .= $this->createCellText($currentActionFieldValue, $value);
442 442
                         $table .= "</td>\n";
443 443
                         if ($i == 0) {
444 444
                             if (empty ($header) && $this->formElementType) {
445
-                                $header .= "\t\t<th style=\"width:32px\" " . ($this->thClass ? 'class="' . $this->thClass . '"' : '') . ">" . ($this->allOption ? '<a href="javascript:clickAll()">all</a>' : '') . "</th>\n";
445
+                                $header .= "\t\t<th style=\"width:32px\" ".($this->thClass ? 'class="'.$this->thClass.'"' : '').">".($this->allOption ? '<a href="javascript:clickAll()">all</a>' : '')."</th>\n";
446 446
                             }
447 447
                             $headerText = array_key_exists($key, $fieldHeadersArray) ? $fieldHeadersArray[$key] : $key;
448
-                            $header .= "\t\t<th" . $this->getColumnWidth($colPosition) . ($this->thClass ? ' class="' . $this->thClass . '" ' : '') . ">" . $headerText . "</th>\n";
448
+                            $header .= "\t\t<th".$this->getColumnWidth($colPosition).($this->thClass ? ' class="'.$this->thClass.'" ' : '').">".$headerText."</th>\n";
449 449
                         }
450 450
                         $colPosition++;
451 451
                     }
@@ -453,9 +453,9 @@  discard block
 block discarded – undo
453 453
                 $i++;
454 454
                 $table .= "\t</tr>\n";
455 455
             }
456
-            $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";
456
+            $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";
457 457
             if ($this->formElementType) {
458
-                $table = "\n" . '<form id="' . $this->formName . '" name="' . $this->formName . '" action="' . $this->formAction . '" method="POST">' . $table;
458
+                $table = "\n".'<form id="'.$this->formName.'" name="'.$this->formName.'" action="'.$this->formAction.'" method="POST">'.$table;
459 459
             }
460 460
             if (strlen($this->pageNav) > 1) {//changed to display the pagination if exists.
461 461
                 /* commented this part because of cookie
@@ -469,7 +469,7 @@  discard block
 block discarded – undo
469 469
 
470 470
                 $table .= '</select>'.$_lang["pagination_table_perpage"].'</div>';
471 471
                 */
472
-                $table .= '<div id="pagination" class="paginate">' . $_lang["pagination_table_gotopage"] . '<ul>' . $this->pageNav . '</ul></div>';
472
+                $table .= '<div id="pagination" class="paginate">'.$_lang["pagination_table_gotopage"].'<ul>'.$this->pageNav.'</ul></div>';
473 473
                 //$table .= '<script language="javascript">function updatePageSize(size){window.location = \''.$this->prepareLink($linkpage).'pageSize=\'+size;}</script>';
474 474
 
475 475
             }
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
 <script language="javascript">
479 479
 	toggled = 0;
480 480
 	function clickAll() {
481
-		myform = document.getElementById("' . $this->formName . '");
481
+		myform = document.getElementById("' . $this->formName.'");
482 482
 		for(i=0;i<myform.length;i++) {
483 483
 			if(myform.elements[i].type==\'checkbox\') {
484 484
 				myform.elements[i].checked=(toggled?false:true);
@@ -490,9 +490,9 @@  discard block
 block discarded – undo
490 490
             }
491 491
             if ($this->formElementType) {
492 492
                 if ($this->extra) {
493
-                    $table .= "\n" . $this->extra . "\n";
493
+                    $table .= "\n".$this->extra."\n";
494 494
                 }
495
-                $table .= "\n" . '</form>' . "\n";
495
+                $table .= "\n".'</form>'."\n";
496 496
             }
497 497
 
498 498
             return $table;
@@ -515,7 +515,7 @@  discard block
 block discarded – undo
515 515
         $numPages = ceil($numRecords / MAX_DISPLAY_RECORDS_NUM);
516 516
         $nav = '';
517 517
         if ($numPages > 1) {
518
-            $currentURL = empty($qs) ? '' : '?' . $qs;
518
+            $currentURL = empty($qs) ? '' : '?'.$qs;
519 519
             if ($currentPage > 6) {
520 520
                 $nav .= $this->createPageLink($currentURL, 1, $_lang["pagination_table_first"]);
521 521
             }
@@ -540,7 +540,7 @@  discard block
 block discarded – undo
540 540
                 $nav .= $this->createPageLink($currentURL, $numPages, $_lang["pagination_table_last"]);
541 541
             }
542 542
         }
543
-        $this->pageNav = ' ' . $nav;
543
+        $this->pageNav = ' '.$nav;
544 544
     }
545 545
 
546 546
     /**
@@ -556,14 +556,14 @@  discard block
 block discarded – undo
556 556
     public function createPageLink($link = '', $pageNum, $displayText, $currentPage = false, $qs = '')
557 557
     {
558 558
         $modx = evolutionCMS();
559
-        $orderBy = !empty($_GET['orderby']) ? '&orderby=' . $_GET['orderby'] : '';
560
-        $orderDir = !empty($_GET['orderdir']) ? '&orderdir=' . $_GET['orderdir'] : '';
559
+        $orderBy = !empty($_GET['orderby']) ? '&orderby='.$_GET['orderby'] : '';
560
+        $orderDir = !empty($_GET['orderdir']) ? '&orderdir='.$_GET['orderdir'] : '';
561 561
         if (!empty($qs)) {
562 562
             $qs = "?$qs";
563 563
         }
564 564
         $link = empty($link) ? $modx->makeUrl($modx->documentIdentifier, $modx->documentObject['alias'],
565
-            $qs . "page=$pageNum$orderBy$orderDir") : $this->prepareLink($link) . "page=$pageNum";
566
-        $nav = '<li' . ($currentPage ? ' class="currentPage"' : '') . '><a' . ($currentPage ? ' class="currentPage"' : '') . ' href="' . $link . '">' . $displayText . '</a></li>' . "\n";
565
+            $qs."page=$pageNum$orderBy$orderDir") : $this->prepareLink($link)."page=$pageNum";
566
+        $nav = '<li'.($currentPage ? ' class="currentPage"' : '').'><a'.($currentPage ? ' class="currentPage"' : '').' href="'.$link.'">'.$displayText.'</a></li>'."\n";
567 567
 
568 568
         return $nav;
569 569
     }
@@ -581,7 +581,7 @@  discard block
 block discarded – undo
581 581
         $field = '';
582 582
         if ($this->formElementType) {
583 583
             $checked = $isChecked ? "checked " : "";
584
-            $field = "\t\t" . '<td><input type="' . $this->formElementType . '" name="' . ($this->formElementName ? $this->formElementName : $value) . '"  value="' . $value . '" ' . $checked . '/></td>' . "\n";
584
+            $field = "\t\t".'<td><input type="'.$this->formElementType.'" name="'.($this->formElementName ? $this->formElementName : $value).'"  value="'.$value.'" '.$checked.'/></td>'."\n";
585 585
         }
586 586
 
587 587
         return $field;
@@ -595,7 +595,7 @@  discard block
 block discarded – undo
595 595
     public function handlePaging()
596 596
     {
597 597
         $offset = (is_numeric($_GET['page']) && $_GET['page'] > 0) ? $_GET['page'] - 1 : 0;
598
-        $limitClause = ' LIMIT ' . ($offset * MAX_DISPLAY_RECORDS_NUM) . ', ' . MAX_DISPLAY_RECORDS_NUM;
598
+        $limitClause = ' LIMIT '.($offset * MAX_DISPLAY_RECORDS_NUM).', '.MAX_DISPLAY_RECORDS_NUM;
599 599
 
600 600
         return $limitClause;
601 601
     }
@@ -610,10 +610,10 @@  discard block
 block discarded – undo
610 610
     public function handleSorting($natural_order = false)
611 611
     {
612 612
         $orderByClause = '';
613
-        if ((bool)$natural_order === false) {
613
+        if ((bool) $natural_order === false) {
614 614
             $orderby = !empty($_GET['orderby']) ? $_GET['orderby'] : "id";
615 615
             $orderdir = !empty($_GET['orderdir']) ? $_GET['orderdir'] : "DESC";
616
-            $orderByClause = !empty($orderby) ? ' ORDER BY ' . $orderby . ' ' . $orderdir . ' ' : "";
616
+            $orderByClause = !empty($orderby) ? ' ORDER BY '.$orderby.' '.$orderdir.' ' : "";
617 617
         }
618 618
 
619 619
         return $orderByClause;
@@ -642,7 +642,7 @@  discard block
 block discarded – undo
642 642
             }
643 643
         }
644 644
 
645
-        return '<a href="[~' . $modx->documentIdentifier . '~]?' . $qs . 'orderby=' . $key . $orderDir . '">' . $text . '</a>';
645
+        return '<a href="[~'.$modx->documentIdentifier.'~]?'.$qs.'orderby='.$key.$orderDir.'">'.$text.'</a>';
646 646
     }
647 647
 
648 648
 }
Please login to merge, or discard this patch.
manager/includes/src/Support/Captcha.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -43,44 +43,44 @@  discard block
 block discarded – undo
43 43
     public $im_height  = 0;
44 44
     public $im;
45 45
 
46
-    public function __construct($w=200, $h=80) {
46
+    public function __construct($w = 200, $h = 80){
47 47
         /* create session to set word for verification */
48 48
         $this->setVeriword();
49
-        $this->dir_font = MODX_BASE_PATH . 'assets/' . $this->dir_font;
49
+        $this->dir_font = MODX_BASE_PATH.'assets/'.$this->dir_font;
50 50
         $this->im_width         = $w;
51 51
         $this->im_height        = $h;
52 52
     }
53 53
 
54
-    public function setVeriword() {
54
+    public function setVeriword(){
55 55
         /* create session variable for verification,
56 56
            you may change the session variable name */
57 57
         $this->word             = $this->makeText();
58 58
         $_SESSION['veriword']   = $this->word;
59 59
     }
60 60
 
61
-    public function output() {
61
+    public function output(){
62 62
         /* output the image as jpeg */
63 63
         $this->drawImage();
64 64
         header("Content-type: image/jpeg");
65 65
         imagejpeg($this->im);
66 66
     }
67 67
 
68
-    public function makeText() {
68
+    public function makeText(){
69 69
         $modx = evolutionCMS();
70 70
         // set default words
71
-        $words="MODX,Access,Better,BitCode,Chunk,Cache,Desc,Design,Excell,Enjoy,URLs,TechView,Gerald,Griff,Humphrey,Holiday,Intel,Integration,Joystick,Join(),Oscope,Genetic,Light,Likeness,Marit,Maaike,Niche,Netherlands,Ordinance,Oscillo,Parser,Phusion,Query,Question,Regalia,Righteous,Snippet,Sentinel,Template,Thespian,Unity,Enterprise,Verily,Veri,Website,WideWeb,Yap,Yellow,Zebra,Zygote";
71
+        $words = "MODX,Access,Better,BitCode,Chunk,Cache,Desc,Design,Excell,Enjoy,URLs,TechView,Gerald,Griff,Humphrey,Holiday,Intel,Integration,Joystick,Join(),Oscope,Genetic,Light,Likeness,Marit,Maaike,Niche,Netherlands,Ordinance,Oscillo,Parser,Phusion,Query,Question,Regalia,Righteous,Snippet,Sentinel,Template,Thespian,Unity,Enterprise,Verily,Veri,Website,WideWeb,Yap,Yellow,Zebra,Zygote";
72 72
         $words = $modx->config['captcha_words'] ? $modx->config['captcha_words'] : $words;
73 73
         $arr_words = array_filter(array_map('trim', explode(',', $words)));
74 74
 
75 75
         /* pick one randomly for text verification */
76
-        return (string) $arr_words[array_rand($arr_words)].rand(10,999);
76
+        return (string) $arr_words[array_rand($arr_words)].rand(10, 999);
77 77
     }
78 78
 
79
-    public function drawText() {
79
+    public function drawText(){
80 80
         $dir = dir($this->dir_font);
81 81
         $fontstmp = array();
82 82
         while (false !== ($file = $dir->read())) {
83
-            if(substr($file, -4) == '.ttf') {
83
+            if (substr($file, -4) == '.ttf') {
84 84
                 $fontstmp[] = $this->dir_font.$file;
85 85
             }
86 86
         }
@@ -88,35 +88,35 @@  discard block
 block discarded – undo
88 88
         $text_font = (string) $fontstmp[array_rand($fontstmp)];
89 89
 
90 90
         /* angle for text inclination */
91
-        $text_angle = rand(-9,9);
91
+        $text_angle = rand(-9, 9);
92 92
         /* initial text size */
93 93
         $text_size  = 30;
94 94
         /* calculate text width and height */
95
-        $box        = imagettfbbox ( $text_size, $text_angle, $text_font, $this->word);
96
-        $text_width = $box[2]-$box[0]; //text width
97
-        $text_height= $box[5]-$box[3]; //text height
95
+        $box        = imagettfbbox($text_size, $text_angle, $text_font, $this->word);
96
+        $text_width = $box[2] - $box[0]; //text width
97
+        $text_height = $box[5] - $box[3]; //text height
98 98
 
99 99
         /* adjust text size */
100
-        $text_size  = round((20 * $this->im_width)/$text_width);
100
+        $text_size  = round((20 * $this->im_width) / $text_width);
101 101
 
102 102
         /* recalculate text width and height */
103
-        $box        = imagettfbbox ( $text_size, $text_angle, $text_font, $this->word);
104
-        $text_width = $box[2]-$box[0]; //text width
105
-        $text_height= $box[5]-$box[3]; //text height
103
+        $box        = imagettfbbox($text_size, $text_angle, $text_font, $this->word);
104
+        $text_width = $box[2] - $box[0]; //text width
105
+        $text_height = $box[5] - $box[3]; //text height
106 106
 
107 107
         /* calculate center position of text */
108
-        $text_x         = ($this->im_width - $text_width)/2;
109
-        $text_y         = ($this->im_height - $text_height)/2;
108
+        $text_x         = ($this->im_width - $text_width) / 2;
109
+        $text_y         = ($this->im_height - $text_height) / 2;
110 110
 
111 111
         /* create canvas for text drawing */
112
-        $im_text        = imagecreate ($this->im_width, $this->im_height);
113
-        $bg_color       = imagecolorallocate ($im_text, 255, 255, 255);
112
+        $im_text        = imagecreate($this->im_width, $this->im_height);
113
+        $bg_color       = imagecolorallocate($im_text, 255, 255, 255);
114 114
 
115 115
         /* pick color for text */
116
-        $text_color     = imagecolorallocate ($im_text, 0, 51, 153);
116
+        $text_color     = imagecolorallocate($im_text, 0, 51, 153);
117 117
 
118 118
         /* draw text into canvas */
119
-        imagettftext    (   $im_text,
119
+        imagettftext($im_text,
120 120
             $text_size,
121 121
             $text_angle,
122 122
             $text_x,
@@ -131,19 +131,19 @@  discard block
 block discarded – undo
131 131
     }
132 132
 
133 133
 
134
-    public function drawImage() {
134
+    public function drawImage(){
135 135
 
136 136
         /* pick one background image randomly from image directory */
137
-        $img_file       = MODX_BASE_PATH . 'assets/' . $this->dir_noise."noise".rand(1,4).".jpg";
137
+        $img_file       = MODX_BASE_PATH.'assets/'.$this->dir_noise."noise".rand(1, 4).".jpg";
138 138
 
139 139
         /* create "noise" background image from your image stock*/
140
-        $noise_img      = @imagecreatefromjpeg ($img_file);
140
+        $noise_img      = @imagecreatefromjpeg($img_file);
141 141
         $noise_width    = imagesx($noise_img);
142 142
         $noise_height   = imagesy($noise_img);
143 143
 
144 144
         /* resize the background image to fit the size of image output */
145
-        $this->im       = imagecreatetruecolor($this->im_width,$this->im_height);
146
-        imagecopyresampled ($this->im,
145
+        $this->im       = imagecreatetruecolor($this->im_width, $this->im_height);
146
+        imagecopyresampled($this->im,
147 147
             $noise_img,
148 148
             0, 0, 0, 0,
149 149
             $this->im_width,
@@ -152,17 +152,17 @@  discard block
 block discarded – undo
152 152
             $noise_height);
153 153
 
154 154
         /* put text image into background image */
155
-        imagecopymerge (    $this->im,
155
+        imagecopymerge($this->im,
156 156
             $this->drawText(),
157 157
             0, 0, 0, 0,
158 158
             $this->im_width,
159 159
             $this->im_height,
160
-            70 );
160
+            70);
161 161
 
162 162
         return $this->im;
163 163
     }
164 164
 
165
-    public function destroy() {
165
+    public function destroy(){
166 166
         imagedestroy($this->im);
167 167
     }
168 168
 }
Please login to merge, or discard this patch.
manager/includes/src/Event.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
         if (is_array($SystemAlertMsgQueque)) {
36 36
             $title = '';
37 37
             if ($this->name && $this->activePlugin) {
38
-                $title = "<div><b>" . $this->activePlugin . "</b> - <span style='color:maroon;'>" . $this->name . "</span></div>";
38
+                $title = "<div><b>".$this->activePlugin."</b> - <span style='color:maroon;'>".$this->name."</span></div>";
39 39
             }
40 40
             $SystemAlertMsgQueque[] = "$title<div style='margin-left:10px;margin-top:3px;'>$msg</div>";
41 41
         }
Please login to merge, or discard this patch.
manager/includes/functions/preload.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
         $_ = crc32(__FILE__);
33 33
         $_ = sprintf('%u', $_);
34 34
 
35
-        return 'evo' . base_convert($_, 10, 36);
35
+        return 'evo'.base_convert($_, 10, 36);
36 36
     }
37 37
 }
38 38
 
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
         session_start();
58 58
         $key = "modx.mgr.session.cookie.lifetime";
59 59
         if (isset($_SESSION[$key]) && is_numeric($_SESSION[$key])) {
60
-            $cookieLifetime = (int)$_SESSION[$key];
60
+            $cookieLifetime = (int) $_SESSION[$key];
61 61
             if ($cookieLifetime) {
62 62
                 $cookieExpiration = $_SERVER['REQUEST_TIME'] + $cookieLifetime;
63 63
             }
Please login to merge, or discard this patch.
manager/frames/1.php 1 patch
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 header("X-XSS-Protection: 0");
@@ -47,9 +47,9 @@  discard block
 block discarded – undo
47 47
 
48 48
 $theme_modes = array('', 'lightness', 'light', 'dark', 'darkness');
49 49
 if (!empty($theme_modes[$_COOKIE['MODX_themeMode']])) {
50
-    $body_class .= ' ' . $theme_modes[$_COOKIE['MODX_themeMode']];
50
+    $body_class .= ' '.$theme_modes[$_COOKIE['MODX_themeMode']];
51 51
 } elseif (!empty($theme_modes[$modx->config['manager_theme_mode']])) {
52
-    $body_class .= ' ' . $theme_modes[$modx->config['manager_theme_mode']];
52
+    $body_class .= ' '.$theme_modes[$modx->config['manager_theme_mode']];
53 53
 }
54 54
 
55 55
 $navbar_position = $modx->config['manager_menu_position'];
@@ -82,36 +82,36 @@  discard block
 block discarded – undo
82 82
     $user['which_browser'] = $modx->config['which_browser'];
83 83
 }
84 84
 
85
-$css = 'media/style/' . $modx->config['manager_theme'] . '/css/page.css?v=' . $lastInstallTime;
85
+$css = 'media/style/'.$modx->config['manager_theme'].'/css/page.css?v='.$lastInstallTime;
86 86
 
87 87
 if ($modx->config['manager_theme'] == 'default') {
88
-    if (!file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css') && is_writable(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css')) {
89
-        require_once MODX_BASE_PATH . 'assets/lib/Formatter/CSSMinify.php';
88
+    if (!file_exists(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css') && is_writable(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css')) {
89
+        require_once MODX_BASE_PATH.'assets/lib/Formatter/CSSMinify.php';
90 90
         $minifier = new Formatter\CSSMinify();
91
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/bootstrap/css/bootstrap.min.css');
92
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/font-awesome/css/font-awesome.min.css');
93
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/fonts.css');
94
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/forms.css');
95
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/mainmenu.css');
96
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/tree.css');
97
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/custom.css');
98
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/tabpane.css');
99
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/contextmenu.css');
100
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/index.css');
101
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/main.css');
91
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/common/bootstrap/css/bootstrap.min.css');
92
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/common/font-awesome/css/font-awesome.min.css');
93
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/fonts.css');
94
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/forms.css');
95
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/mainmenu.css');
96
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/tree.css');
97
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/custom.css');
98
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/tabpane.css');
99
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/contextmenu.css');
100
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/index.css');
101
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/main.css');
102 102
         $css = $minifier->minify();
103
-        file_put_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css', $css);
103
+        file_put_contents(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css', $css);
104 104
     }
105
-    if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) {
106
-        $css = 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css?v=' . $lastInstallTime;
105
+    if (file_exists(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css')) {
106
+        $css = 'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css?v='.$lastInstallTime;
107 107
     }
108 108
 }
109 109
 
110
-$modx->config['global_tabs'] = (int)($modx->config['global_tabs'] && ($user['role'] == 1 || $modx->hasPermission('edit_template') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_plugin')));
110
+$modx->config['global_tabs'] = (int) ($modx->config['global_tabs'] && ($user['role'] == 1 || $modx->hasPermission('edit_template') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_plugin')));
111 111
 
112 112
 ?>
113 113
 <!DOCTYPE html>
114
-<html <?= (isset($modx_textdir) && $modx_textdir ? 'dir="rtl" lang="' : 'lang="') . $mxla . '" xml:lang="' . $mxla . '"' ?>>
114
+<html <?= (isset($modx_textdir) && $modx_textdir ? 'dir="rtl" lang="' : 'lang="').$mxla.'" xml:lang="'.$mxla.'"' ?>>
115 115
 <head>
116 116
     <title><?= $site_name ?>- (EVO CMS Manager)</title>
117 117
     <meta http-equiv="Content-Type" content="text/html; charset=<?= $modx_manager_charset ?>" />
@@ -142,21 +142,21 @@  discard block
 block discarded – undo
142 142
         MODX_SITE_URL: '<?= MODX_SITE_URL ?>',
143 143
         MODX_MANAGER_URL: '<?= MODX_MANAGER_URL ?>',
144 144
         user: {
145
-          role: <?= (int)$user['role'] ?>,
145
+          role: <?= (int) $user['role'] ?>,
146 146
           username: '<?= $user['username'] ?>'
147 147
         },
148 148
         config: {
149 149
           mail_check_timeperiod: <?= $modx->config['mail_check_timeperiod'] ?>,
150
-          menu_height: <?= (int)$menu_height ?>,
151
-          tree_width: <?= (int)$tree_width ?>,
152
-          tree_min_width: <?= (int)$tree_min_width ?>,
153
-          session_timeout: <?= (int)$modx->config['session_timeout'] ?>,
154
-          site_start: <?= (int)$modx->config['site_start'] ?>,
155
-          tree_page_click: <?=(!empty($modx->config['tree_page_click']) ? (int)$modx->config['tree_page_click'] : 27) ?>,
150
+          menu_height: <?= (int) $menu_height ?>,
151
+          tree_width: <?= (int) $tree_width ?>,
152
+          tree_min_width: <?= (int) $tree_min_width ?>,
153
+          session_timeout: <?= (int) $modx->config['session_timeout'] ?>,
154
+          site_start: <?= (int) $modx->config['site_start'] ?>,
155
+          tree_page_click: <?=(!empty($modx->config['tree_page_click']) ? (int) $modx->config['tree_page_click'] : 27) ?>,
156 156
           theme: '<?= $modx->config['manager_theme'] ?>',
157 157
           theme_mode: '<?= $modx->config['manager_theme_mode'] ?>',
158 158
           which_browser: '<?= $user['which_browser'] ?>',
159
-          layout: <?= (int)$manager_layout ?>,
159
+          layout: <?= (int) $manager_layout ?>,
160 160
           textdir: '<?= $modx_textdir ?>',
161 161
           global_tabs: <?= $modx->config['global_tabs'] ?>
162 162
 
@@ -241,11 +241,11 @@  discard block
 block discarded – undo
241 241
           delete a[b];
242 242
         },
243 243
         openedArray: [],
244
-        lockedElementsTranslation: <?= json_encode($unlockTranslations, JSON_FORCE_OBJECT | JSON_UNESCAPED_UNICODE) . "\n" ?>
244
+        lockedElementsTranslation: <?= json_encode($unlockTranslations, JSON_FORCE_OBJECT | JSON_UNESCAPED_UNICODE)."\n" ?>
245 245
       };
246 246
       <?php
247 247
       $opened = array_filter(array_map('intval', explode('|', $_SESSION['openedArray'])));
248
-      echo (empty($opened) ? '' : 'modx.openedArray[' . implode("] = 1;\n		modx.openedArray[", $opened) . '] = 1;') . "\n";
248
+      echo (empty($opened) ? '' : 'modx.openedArray['.implode("] = 1;\n		modx.openedArray[", $opened).'] = 1;')."\n";
249 249
       ?>
250 250
     </script>
251 251
     <script src="media/style/<?= $modx->config['manager_theme'] ?>/js/modx.min.js?v=<?= $lastInstallTime ?>"></script>
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
                             <a href="javascript:;" class="dropdown-toggle" onclick="return false;">
328 328
                                 <span class="username"><?= $user['username'] ?></span>
329 329
                                 <?php if ($user['photo']) { ?>
330
-                                    <span class="icon photo" style="background-image: url(<?= MODX_SITE_URL . $user['photo'] ?>);"></span>
330
+                                    <span class="icon photo" style="background-image: url(<?= MODX_SITE_URL.$user['photo'] ?>);"></span>
331 331
                                 <?php } else { ?>
332 332
                                     <span class="icon"><?= $_style['menu_user'] ?></span>
333 333
                                 <?php } ?>
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
                                 $version = 'Evolution';
355 355
                                 ?>
356 356
                                 <?php
357
-                                echo sprintf('<li><span class="dropdown-item" title="%s &ndash; %s" %s>' . $version . ' %s</span></li>', $site_name, $modx->getVersionData('full_appname'), $style, $modx->config['settings_version']);
357
+                                echo sprintf('<li><span class="dropdown-item" title="%s &ndash; %s" %s>'.$version.' %s</span></li>', $site_name, $modx->getVersionData('full_appname'), $style, $modx->config['settings_version']);
358 358
                                 ?>
359 359
                             </ul>
360 360
                         </li>
@@ -535,7 +535,7 @@  discard block
 block discarded – undo
535 535
     </div>
536 536
 
537 537
     <?php
538
-    if(!function_exists('constructLink')) {
538
+    if (!function_exists('constructLink')) {
539 539
         /**
540 540
          * @param string $action
541 541
          * @param string $img
@@ -544,7 +544,7 @@  discard block
 block discarded – undo
544 544
          */
545 545
         function constructLink($action, $img, $text, $allowed)
546 546
         {
547
-            if ((bool)$allowed) {
547
+            if ((bool) $allowed) {
548 548
                 echo sprintf('<div class="menuLink" id="item%s" onclick="modx.tree.menuHandler(%s);">', $action,
549 549
                     $action);
550 550
                 echo sprintf('<i class="%s"></i> %s</div>', $img, $text);
@@ -557,7 +557,7 @@  discard block
 block discarded – undo
557 557
     <script type="text/javascript">
558 558
 
559 559
       if (document.getElementById('treeMenu')) {
560
-          <?php if($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin')) { ?>
560
+          <?php if ($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin')) { ?>
561 561
 
562 562
         document.getElementById('treeMenu_openelements').onclick = function(e) {
563 563
           e.preventDefault();
@@ -575,12 +575,12 @@  discard block
 block discarded – undo
575 575
           }
576 576
         };
577 577
           <?php } ?>
578
-          <?php if($use_browser && $modx->hasPermission('assets_images')) { ?>
578
+          <?php if ($use_browser && $modx->hasPermission('assets_images')) { ?>
579 579
 
580 580
         document.getElementById('treeMenu_openimages').onclick = function(e) {
581 581
           e.preventDefault();
582 582
           if (modx.config.global_tabs && !e.shiftKey) {
583
-            modx.tabs({url: '<?= MODX_MANAGER_URL . 'media/browser/' . $which_browser . '/browse.php?filemanager=media/browser/' . $which_browser . '/browse.php&type=images' ?>', title: '<?= $_lang["images_management"] ?>'});
583
+            modx.tabs({url: '<?= MODX_MANAGER_URL.'media/browser/'.$which_browser.'/browse.php?filemanager=media/browser/'.$which_browser.'/browse.php&type=images' ?>', title: '<?= $_lang["images_management"] ?>'});
584 584
           } else {
585 585
             var randomNum = '<?= $_lang["files_files"] ?>';
586 586
             if (e.shiftKey) {
@@ -593,12 +593,12 @@  discard block
 block discarded – undo
593 593
           }
594 594
         };
595 595
           <?php } ?>
596
-          <?php if($use_browser && $modx->hasPermission('assets_files')) { ?>
596
+          <?php if ($use_browser && $modx->hasPermission('assets_files')) { ?>
597 597
 
598 598
         document.getElementById('treeMenu_openfiles').onclick = function(e) {
599 599
           e.preventDefault();
600 600
           if (modx.config.global_tabs && !e.shiftKey) {
601
-            modx.tabs({url: '<?= MODX_MANAGER_URL . 'media/browser/' . $which_browser . '/browse.php?filemanager=media/browser/' . $which_browser . '/browse.php&type=files' ?>', title: '<?= $_lang["files_files"] ?>'});
601
+            modx.tabs({url: '<?= MODX_MANAGER_URL.'media/browser/'.$which_browser.'/browse.php?filemanager=media/browser/'.$which_browser.'/browse.php&type=files' ?>', title: '<?= $_lang["files_files"] ?>'});
602 602
           } else {
603 603
             var randomNum = '<?= $_lang["files_files"] ?>';
604 604
             if (e.shiftKey) {
@@ -652,7 +652,7 @@  discard block
 block discarded – undo
652 652
 
653 653
 </div>
654 654
 <?php if ($modx->config['show_picker'] != "0") {
655
-    include('media/style/' . $modx->config['manager_theme'] . '/color.switcher.php');
655
+    include('media/style/'.$modx->config['manager_theme'].'/color.switcher.php');
656 656
 } ?>
657 657
 </body>
658 658
 </html>
Please login to merge, or discard this patch.
manager/actions/mutate_categories.dynamic.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 
6
-if(!$modx->hasPermission('category_manager')) {
6
+if (!$modx->hasPermission('category_manager')) {
7 7
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
8 8
 }
9 9
 
@@ -15,11 +15,11 @@  discard block
 block discarded – undo
15 15
 	'native_language'  => 'de',
16 16
 	'name'             => 'Categories Manager',
17 17
 	'dirname'          => $site_manager_url,
18
-	'url'              => 'index.php?a=120&amp;id=' . $_GET['id'],
19
-	'path'             => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR,
20
-	'inc_dir'          => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR,
21
-	'languages_dir'    => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'lang' . DIRECTORY_SEPARATOR,
22
-	'views_dir'        => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'skin' . DIRECTORY_SEPARATOR,
18
+	'url'              => 'index.php?a=120&amp;id='.$_GET['id'],
19
+	'path'             => realpath(dirname(__FILE__)).DIRECTORY_SEPARATOR.'category_mgr'.DIRECTORY_SEPARATOR,
20
+	'inc_dir'          => realpath(dirname(__FILE__)).DIRECTORY_SEPARATOR.'category_mgr'.DIRECTORY_SEPARATOR.'inc'.DIRECTORY_SEPARATOR,
21
+	'languages_dir'    => realpath(dirname(__FILE__)).DIRECTORY_SEPARATOR.'category_mgr'.DIRECTORY_SEPARATOR.'lang'.DIRECTORY_SEPARATOR,
22
+	'views_dir'        => realpath(dirname(__FILE__)).DIRECTORY_SEPARATOR.'category_mgr'.DIRECTORY_SEPARATOR.'skin'.DIRECTORY_SEPARATOR,
23 23
 	'request_key'      => 'module_categories_manager',
24 24
 	'messages'         => array()
25 25
 );
@@ -27,19 +27,19 @@  discard block
 block discarded – undo
27 27
 $cm = new EvolutionCMS\Legacy\ModuleCategoriesManager();
28 28
 
29 29
 // assign module_params to internal params
30
-foreach( $_module_params as $param => $value )
30
+foreach ($_module_params as $param => $value)
31 31
 {
32
-	$cm->set( $param, $value );
32
+	$cm->set($param, $value);
33 33
 }
34 34
 
35 35
 // catch the request actions
36
-include_once $cm->get('inc_dir') . 'request_trigger.inc.php';
36
+include_once $cm->get('inc_dir').'request_trigger.inc.php';
37 37
 
38
-if( !$categories = $cm->getCategories() )
38
+if (!$categories = $cm->getCategories())
39 39
 {
40
-	setcookie('webfxtab_manage-categories-pane', 0 );
41
-	$cm->addMessage( $cm->txt('Currently no categories available... JUST ADD A NEW ONE!'), 'global' );
40
+	setcookie('webfxtab_manage-categories-pane', 0);
41
+	$cm->addMessage($cm->txt('Currently no categories available... JUST ADD A NEW ONE!'), 'global');
42 42
 }
43 43
 
44
-$cm->renderView('main', $categories );
44
+$cm->renderView('main', $categories);
45 45
 return;
Please login to merge, or discard this patch.
manager/actions/resources/mgrResources.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 
Please login to merge, or discard this patch.
manager/captcha.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
 $modx->getSettings();
8 8
 
9 9
 $modx->documentMethod = 'id';
10
-$modx->documentIdentifier = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 1;
10
+$modx->documentIdentifier = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 1;
11 11
 $modx->documentObject = $modx->getDocumentObject('id', $modx->documentIdentifier);
12 12
 
13 13
 $modx->invokeEvent('OnWebPageInit');
Please login to merge, or discard this patch.
manager/processors/duplicate_content.processor.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5
-if(!$modx->hasPermission('new_document') || !$modx->hasPermission('save_document')) {
5
+if (!$modx->hasPermission('new_document') || !$modx->hasPermission('save_document')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = isset($_GET['id'])? (int)$_GET['id'] : 0;
10
-if($id==0) {
9
+$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
10
+if ($id == 0) {
11 11
 	$modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 $udperms->role = $_SESSION['mgrRole'];
21 21
 $udperms->duplicateDoc = true;
22 22
 
23
-if(!$udperms->checkPermissions()) {
23
+if (!$udperms->checkPermissions()) {
24 24
 	$modx->webAlertAndQuit($_lang["access_permission_denied"]);
25 25
 }
26 26
 
@@ -32,5 +32,5 @@  discard block
 block discarded – undo
32 32
 $_SESSION['itemname'] = $name;
33 33
 
34 34
 // finish cloning - redirect
35
-$header="Location: index.php?r=1&a=3&id=$id";
35
+$header = "Location: index.php?r=1&a=3&id=$id";
36 36
 header($header);
Please login to merge, or discard this patch.