Completed
Pull Request — develop (#716)
by Agel_Nash
09:00
created
manager/includes/src/Support/MysqlDumper.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 
74 74
         // Set line feed
75 75
         $lf = "\n";
76
-        $tempfile_path = $modx->config['base_path'] . 'assets/backup/temp.php';
76
+        $tempfile_path = $modx->config['base_path'].'assets/backup/temp.php';
77 77
 
78 78
         $result = $modx->db->query('SHOW TABLES');
79 79
         $tables = $this->result2Array(0, $result);
@@ -86,15 +86,15 @@  discard block
 block discarded – undo
86 86
 
87 87
         // Set header
88 88
         $output = "#{$lf}";
89
-        $output .= "# " . addslashes($modx->config['site_name']) . " Database Dump{$lf}";
89
+        $output .= "# ".addslashes($modx->config['site_name'])." Database Dump{$lf}";
90 90
         $output .= "# MODX Version:{$version['version']}{$lf}";
91 91
         $output .= "# {$lf}";
92 92
         $output .= "# Host: {$this->database_server}{$lf}";
93
-        $output .= "# Generation Time: " . $modx->toDateFormat(time()) . $lf;
94
-        $output .= "# Server version: " . $modx->db->getVersion() . $lf;
95
-        $output .= "# PHP Version: " . phpversion() . $lf;
93
+        $output .= "# Generation Time: ".$modx->toDateFormat(time()).$lf;
94
+        $output .= "# Server version: ".$modx->db->getVersion().$lf;
95
+        $output .= "# PHP Version: ".phpversion().$lf;
96 96
         $output .= "# Database: `{$this->dbname}`{$lf}";
97
-        $output .= "# Description: " . trim($_REQUEST['backup_title']) . "{$lf}";
97
+        $output .= "# Description: ".trim($_REQUEST['backup_title'])."{$lf}";
98 98
         $output .= "#";
99 99
         file_put_contents($tempfile_path, $output, FILE_APPEND | LOCK_EX);
100 100
         $output = '';
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
                 }
114 114
             }
115 115
             if ($callBack === 'snapshot') {
116
-                if (!preg_match('@^' . $modx->db->config['table_prefix'] . '@', $tblval)) {
116
+                if (!preg_match('@^'.$modx->db->config['table_prefix'].'@', $tblval)) {
117 117
                     continue;
118 118
                 }
119 119
             }
@@ -150,9 +150,9 @@  discard block
 block discarded – undo
150 150
                         ), '\\n', $value);
151 151
                         $value = "'{$value}'";
152 152
                     }
153
-                    $insertdump .= $value . ',';
153
+                    $insertdump .= $value.',';
154 154
                 }
155
-                $output .= rtrim($insertdump, ',') . ");\n";
155
+                $output .= rtrim($insertdump, ',').");\n";
156 156
                 if (1048576 < strlen($output)) {
157 157
                     file_put_contents($tempfile_path, $output, FILE_APPEND | LOCK_EX);
158 158
                     $output = '';
Please login to merge, or discard this patch.
manager/includes/src/Support/Captcha.php 2 patches
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.
Braces   +14 added lines, -7 removed lines patch added patch discarded remove patch
@@ -43,7 +43,8 @@  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 48
         /* create session to set word for verification */
48 49
         $this->setVeriword();
49 50
         $this->dir_font = MODX_BASE_PATH . 'assets/' . $this->dir_font;
@@ -51,21 +52,24 @@  discard block
 block discarded – undo
51 52
         $this->im_height        = $h;
52 53
     }
53 54
 
54
-    public function setVeriword() {
55
+    public function setVeriword()
56
+    {
55 57
         /* create session variable for verification,
56 58
            you may change the session variable name */
57 59
         $this->word             = $this->makeText();
58 60
         $_SESSION['veriword']   = $this->word;
59 61
     }
60 62
 
61
-    public function output() {
63
+    public function output()
64
+    {
62 65
         /* output the image as jpeg */
63 66
         $this->drawImage();
64 67
         header("Content-type: image/jpeg");
65 68
         imagejpeg($this->im);
66 69
     }
67 70
 
68
-    public function makeText() {
71
+    public function makeText()
72
+    {
69 73
         $modx = evolutionCMS();
70 74
         // set default words
71 75
         $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";
@@ -76,7 +80,8 @@  discard block
 block discarded – undo
76 80
         return (string) $arr_words[array_rand($arr_words)].rand(10,999);
77 81
     }
78 82
 
79
-    public function drawText() {
83
+    public function drawText()
84
+    {
80 85
         $dir = dir($this->dir_font);
81 86
         $fontstmp = array();
82 87
         while (false !== ($file = $dir->read())) {
@@ -131,7 +136,8 @@  discard block
 block discarded – undo
131 136
     }
132 137
 
133 138
 
134
-    public function drawImage() {
139
+    public function drawImage()
140
+    {
135 141
 
136 142
         /* pick one background image randomly from image directory */
137 143
         $img_file       = MODX_BASE_PATH . 'assets/' . $this->dir_noise."noise".rand(1,4).".jpg";
@@ -162,7 +168,8 @@  discard block
 block discarded – undo
162 168
         return $this->im;
163 169
     }
164 170
 
165
-    public function destroy() {
171
+    public function destroy()
172
+    {
166 173
         imagedestroy($this->im);
167 174
     }
168 175
 }
Please login to merge, or discard this patch.
manager/includes/accesscontrol.inc.php 1 patch
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -18,13 +18,13 @@  discard block
 block discarded – undo
18 18
 }
19 19
 
20 20
 // andrazk 20070416 - if installer is running, destroy active sessions
21
-if (file_exists(MODX_BASE_PATH . 'assets/cache/installProc.inc.php')) {
22
-    include_once(MODX_BASE_PATH . 'assets/cache/installProc.inc.php');
21
+if (file_exists(MODX_BASE_PATH.'assets/cache/installProc.inc.php')) {
22
+    include_once(MODX_BASE_PATH.'assets/cache/installProc.inc.php');
23 23
     if (isset($installStartTime)) {
24 24
         if ((time() - $installStartTime) > 5 * 60) { // if install flag older than 5 minutes, discard
25 25
             unset($installStartTime);
26
-            @ chmod(MODX_BASE_PATH . 'assets/cache/installProc.inc.php', 0755);
27
-            unlink(MODX_BASE_PATH . 'assets/cache/installProc.inc.php');
26
+            @ chmod(MODX_BASE_PATH.'assets/cache/installProc.inc.php', 0755);
27
+            unlink(MODX_BASE_PATH.'assets/cache/installProc.inc.php');
28 28
         } else {
29 29
             if ($_SERVER['REQUEST_METHOD'] != 'POST') {
30 30
                 if (isset($_COOKIE[session_name()])) {
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
                         //						setcookie(session_name(), '', 0, MODX_BASE_URL);
51 51
                     }
52 52
                     header('HTTP/1.0 307 Redirect');
53
-                    header('Location: ' . MODX_MANAGER_URL . 'index.php?installGoingOn=2');
53
+                    header('Location: '.MODX_MANAGER_URL.'index.php?installGoingOn=2');
54 54
                 }
55 55
             }
56 56
         }
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
         // establish fallback to English default
63 63
         include_once "lang/english.inc.php";
64 64
         // include localized overrides
65
-        include_once "lang/" . $manager_language . ".inc.php";
65
+        include_once "lang/".$manager_language.".inc.php";
66 66
     } else {
67 67
         include_once "lang/english.inc.php";
68 68
     }
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
     $modx->setPlaceholder('modx_charset', $modx_manager_charset);
71 71
     $modx->setPlaceholder('theme', $manager_theme);
72 72
     $modx->setPlaceholder('favicon',
73
-        (file_exists(MODX_BASE_PATH . 'favicon.ico') ? MODX_SITE_URL . 'favicon.ico' : 'media/style/' . $modx->config['manager_theme'] . '/images/favicon.ico'));
73
+        (file_exists(MODX_BASE_PATH.'favicon.ico') ? MODX_SITE_URL . 'favicon.ico' : 'media/style/'.$modx->config['manager_theme'].'/images/favicon.ico'));
74 74
 
75 75
     // invoke OnManagerLoginFormPrerender event
76 76
     $evtOut = $modx->invokeEvent('OnManagerLoginFormPrerender');
@@ -81,25 +81,25 @@  discard block
 block discarded – undo
81 81
     $modx->setPlaceholder('manager_path', MGR_DIR);
82 82
     $modx->setPlaceholder('logo_slogan', $_lang["logo_slogan"]);
83 83
     $modx->setPlaceholder('login_message', $_lang["login_message"]);
84
-    $modx->setPlaceholder('manager_theme_url', MODX_MANAGER_URL . 'media/style/' . $modx->config['manager_theme'] . '/');
84
+    $modx->setPlaceholder('manager_theme_url', MODX_MANAGER_URL.'media/style/'.$modx->config['manager_theme'].'/');
85 85
     $modx->setPlaceholder('year', date('Y'));
86 86
 
87 87
     // set login logo image
88
-    if ( !empty($modx->config['login_logo']) ) {
89
-        $modx->setPlaceholder('login_logo', MODX_SITE_URL . $modx->config['login_logo']);
88
+    if (!empty($modx->config['login_logo'])) {
89
+        $modx->setPlaceholder('login_logo', MODX_SITE_URL.$modx->config['login_logo']);
90 90
     } else {
91
-        $modx->setPlaceholder('login_logo', MODX_MANAGER_URL . 'media/style/' . $modx->config['manager_theme'] . '/images/login/default/login-logo.png');
91
+        $modx->setPlaceholder('login_logo', MODX_MANAGER_URL.'media/style/'.$modx->config['manager_theme'].'/images/login/default/login-logo.png');
92 92
     }
93 93
 
94 94
     // set login background image
95
-    if ( !empty($modx->config['login_bg']) ) {
96
-        $modx->setPlaceholder('login_bg', MODX_SITE_URL . $modx->config['login_bg']);
95
+    if (!empty($modx->config['login_bg'])) {
96
+        $modx->setPlaceholder('login_bg', MODX_SITE_URL.$modx->config['login_bg']);
97 97
     } else {
98
-        $modx->setPlaceholder('login_bg', MODX_MANAGER_URL . 'media/style/' . $modx->config['manager_theme'] . '/images/login/default/login-background.jpg');
98
+        $modx->setPlaceholder('login_bg', MODX_MANAGER_URL.'media/style/'.$modx->config['manager_theme'].'/images/login/default/login-background.jpg');
99 99
     }
100 100
 
101 101
     // set form position css class
102
-    $modx->setPlaceholder('login_form_position_class', 'loginbox-' . $modx->config['login_form_position']);
102
+    $modx->setPlaceholder('login_form_position_class', 'loginbox-'.$modx->config['login_form_position']);
103 103
 
104 104
     switch ($modx->config['manager_theme_mode']) {
105 105
       case '1':
@@ -124,11 +124,11 @@  discard block
 block discarded – undo
124 124
         switch ($installGoingOn) {
125 125
             case 1 :
126 126
                 $modx->setPlaceholder('login_message',
127
-                    "<p><span class=\"fail\">" . $_lang["login_cancelled_install_in_progress"] . "</p><p>" . $_lang["login_message"] . "</p>");
127
+                    "<p><span class=\"fail\">".$_lang["login_cancelled_install_in_progress"]."</p><p>".$_lang["login_message"]."</p>");
128 128
                 break;
129 129
             case 2 :
130 130
                 $modx->setPlaceholder('login_message',
131
-                    "<p><span class=\"fail\">" . $_lang["login_cancelled_site_was_updated"] . "</p><p>" . $_lang["login_message"] . "</p>");
131
+                    "<p><span class=\"fail\">".$_lang["login_cancelled_site_was_updated"]."</p><p>".$_lang["login_message"]."</p>");
132 132
                 break;
133 133
         }
134 134
     }
@@ -136,9 +136,9 @@  discard block
 block discarded – undo
136 136
     if ($modx->config['use_captcha'] == 1) {
137 137
         $modx->setPlaceholder('login_captcha_message', $_lang["login_captcha_message"]);
138 138
         $modx->setPlaceholder('captcha_image',
139
-            '<a href="' . MODX_MANAGER_URL . '" class="loginCaptcha"><img id="captcha_image" src="' . MODX_MANAGER_URL . 'captcha.php?rand=' . rand() . '" alt="' . $_lang["login_captcha_message"] . '" /></a>');
139
+            '<a href="'.MODX_MANAGER_URL.'" class="loginCaptcha"><img id="captcha_image" src="'.MODX_MANAGER_URL.'captcha.php?rand='.rand().'" alt="'.$_lang["login_captcha_message"].'" /></a>');
140 140
         $modx->setPlaceholder('captcha_input',
141
-            '<label>' . $_lang["captcha_code"] . '</label> <input type="text" name="captcha_code" tabindex="3" value="" />');
141
+            '<label>'.$_lang["captcha_code"].'</label> <input type="text" name="captcha_code" tabindex="3" value="" />');
142 142
     }
143 143
 
144 144
     // login info
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 
157 157
     // invoke OnManagerLoginFormRender event
158 158
     $evtOut = $modx->invokeEvent('OnManagerLoginFormRender');
159
-    $html = is_array($evtOut) ? '<div id="onManagerLoginFormRender">' . implode('', $evtOut) . '</div>' : '';
159
+    $html = is_array($evtOut) ? '<div id="onManagerLoginFormRender">'.implode('', $evtOut).'</div>' : '';
160 160
     $modx->setPlaceholder('OnManagerLoginFormRender', $html);
161 161
 
162 162
     // load template
@@ -174,29 +174,29 @@  discard block
 block discarded – undo
174 174
             $login_tpl = file_get_contents($target);
175 175
         }
176 176
     } else {
177
-        $theme_path = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/';
178
-        if (is_file($theme_path . 'style.php')) {
179
-            include($theme_path . 'style.php');
177
+        $theme_path = MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/';
178
+        if (is_file($theme_path.'style.php')) {
179
+            include($theme_path.'style.php');
180 180
         }
181 181
         $chunk = $modx->getChunk($target);
182 182
         if ($chunk !== false && !empty($chunk)) {
183 183
             $login_tpl = $chunk;
184
-        } elseif (is_file(MODX_BASE_PATH . $target)) {
185
-            $target = MODX_BASE_PATH . $target;
184
+        } elseif (is_file(MODX_BASE_PATH.$target)) {
185
+            $target = MODX_BASE_PATH.$target;
186 186
             $login_tpl = file_get_contents($target);
187 187
         } elseif (is_file($target)) {
188 188
             $login_tpl = file_get_contents($target);
189
-        } elseif (is_file($theme_path . 'login.tpl')) {
190
-            $target = $theme_path . 'login.tpl';
189
+        } elseif (is_file($theme_path.'login.tpl')) {
190
+            $target = $theme_path.'login.tpl';
191 191
             $login_tpl = file_get_contents($target);
192
-        } elseif (is_file($theme_path . 'templates/actions/login.tpl')) {
193
-            $target = $theme_path . 'templates/actions/login.tpl';
192
+        } elseif (is_file($theme_path.'templates/actions/login.tpl')) {
193
+            $target = $theme_path.'templates/actions/login.tpl';
194 194
             $login_tpl = file_get_contents($target);
195
-        } elseif (is_file($theme_path . 'html/login.html')) { // ClipperCMS compatible
196
-            $target = $theme_path . 'html/login.html';
195
+        } elseif (is_file($theme_path.'html/login.html')) { // ClipperCMS compatible
196
+            $target = $theme_path.'html/login.html';
197 197
             $login_tpl = file_get_contents($target);
198 198
         } else {
199
-            $target = MODX_MANAGER_PATH . 'media/style/common/login.tpl';
199
+            $target = MODX_MANAGER_PATH.'media/style/common/login.tpl';
200 200
             $login_tpl = file_get_contents($target);
201 201
         }
202 202
     }
@@ -216,17 +216,17 @@  discard block
 block discarded – undo
216 216
     $modx->updateValidatedUserSession();
217 217
 
218 218
     // Update last action in table active_users
219
-    $itemid = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : '';
219
+    $itemid = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : '';
220 220
     $lasthittime = time();
221
-    $action = isset($_REQUEST['a']) ? (int)$_REQUEST['a'] : 1;
221
+    $action = isset($_REQUEST['a']) ? (int) $_REQUEST['a'] : 1;
222 222
 
223 223
     if ($action !== 1) {
224
-        if ((int)$itemid <= 0) {
224
+        if ((int) $itemid <= 0) {
225 225
             $itemid = null;
226 226
         }
227 227
         $sql = sprintf("REPLACE INTO %s (sid, internalKey, username, lasthit, action, id) VALUES ('%s', %d, '%s', %d, '%s', %s)",
228 228
             $modx->getFullTableName('active_users') // Table
229
-            , session_id(), $modx->getLoginUserID(), $_SESSION['mgrShortname'], $lasthittime, (string)$action,
229
+            , session_id(), $modx->getLoginUserID(), $_SESSION['mgrShortname'], $lasthittime, (string) $action,
230 230
             $itemid == null ? var_export(null, true) : $itemid);
231 231
         $modx->db->query($sql);
232 232
     }
Please login to merge, or discard this patch.
manager/includes/template.parser.class.inc.php 2 patches
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,8 +8,8 @@
 block discarded – undo
8 8
  * @todo could be unnecessary
9 9
  *
10 10
  */
11
-Class TemplateParser extends EvolutionCMS\Legacy\TemplateParser
12
-{
11
+Class TemplateParser extends EvolutionCMS\Legacy\TemplateParser
12
+{
13 13
 }
14 14
 
15 15
 ?>
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
  * @todo could be unnecessary
9 9
  *
10 10
  */
11
-Class TemplateParser extends EvolutionCMS\Legacy\TemplateParser
11
+class TemplateParser extends EvolutionCMS\Legacy\TemplateParser
12 12
 {
13 13
 }
14 14
 
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/includes/functions/nodes.php 1 patch
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if(!function_exists('makeHTML')) {
3
+if (!function_exists('makeHTML')) {
4 4
     /**
5 5
      * @param int $indent
6 6
      * @param int $parent
@@ -37,14 +37,14 @@  discard block
 block discarded – undo
37 37
             case 'publishedon':
38 38
             case 'pub_date':
39 39
             case 'unpub_date':
40
-                $sortby = sprintf('CASE WHEN %s IS NULL THEN 1 ELSE 0 END, %s', 'sc.' . $_SESSION['tree_sortby'],
41
-                    'sc.' . $_SESSION['tree_sortby']);
40
+                $sortby = sprintf('CASE WHEN %s IS NULL THEN 1 ELSE 0 END, %s', 'sc.'.$_SESSION['tree_sortby'],
41
+                    'sc.'.$_SESSION['tree_sortby']);
42 42
                 break;
43 43
             default:
44
-                $sortby = 'sc.' . $_SESSION['tree_sortby'];
44
+                $sortby = 'sc.'.$_SESSION['tree_sortby'];
45 45
         };
46 46
 
47
-        $orderby = $modx->db->escape($sortby . ' ' . $_SESSION['tree_sortdir']);
47
+        $orderby = $modx->db->escape($sortby.' '.$_SESSION['tree_sortdir']);
48 48
 
49 49
         // Folder sorting gets special setup ;) Add menuindex and pagetitle
50 50
         if ($_SESSION['tree_sortby'] == 'isfolder') {
@@ -59,11 +59,11 @@  discard block
 block discarded – undo
59 59
             $_SESSION['mgrDocgroups']) : '';
60 60
         $showProtected = false;
61 61
         if (isset ($modx->config['tree_show_protected'])) {
62
-            $showProtected = (boolean)$modx->config['tree_show_protected'];
62
+            $showProtected = (boolean) $modx->config['tree_show_protected'];
63 63
         }
64
-        $mgrRole = (isset ($_SESSION['mgrRole']) && (string)$_SESSION['mgrRole'] === '1') ? '1' : '0';
64
+        $mgrRole = (isset ($_SESSION['mgrRole']) && (string) $_SESSION['mgrRole'] === '1') ? '1' : '0';
65 65
         if ($showProtected == false) {
66
-            $access = "AND (1={$mgrRole} OR sc.privatemgr=0" . (!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))");
66
+            $access = "AND (1={$mgrRole} OR sc.privatemgr=0".(!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))");
67 67
         } else {
68 68
             $access = '';
69 69
         }
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
             }
101 101
 
102 102
             $weblinkDisplay = $row['type'] == 'reference' ? sprintf('&nbsp;%s', $_style['tree_linkgo']) : '';
103
-            $pageIdDisplay = '<small>(' . ($modx_textdir ? '&rlm;' : '') . $row['id'] . ')</small>';
103
+            $pageIdDisplay = '<small>('.($modx_textdir ? '&rlm;' : '').$row['id'].')</small>';
104 104
 
105 105
             // Prepare displaying user-locks
106 106
             $lockedByUser = '';
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
                         'element_type' => $_lang["lock_element_type_7"],
112 112
                         'lasthit_df'   => $rowLock['lasthit_df']
113 113
                     ));
114
-                    $lockedByUser = '<span title="' . $title . '" class="editResource">' . $_style['tree_preview_resource'] . '</span>';
114
+                    $lockedByUser = '<span title="'.$title.'" class="editResource">'.$_style['tree_preview_resource'].'</span>';
115 115
                 } else {
116 116
                     $title = $modx->parseText($_lang["lock_element_locked_by"], array(
117 117
                         'element_type' => $_lang["lock_element_type_7"],
@@ -119,9 +119,9 @@  discard block
 block discarded – undo
119 119
                         'lasthit_df'   => $rowLock['lasthit_df']
120 120
                     ));
121 121
                     if ($modx->hasPermission('remove_locks')) {
122
-                        $lockedByUser = '<span onclick="modx.tree.unlockElement(7, ' . $row['id'] . ', this);return false;" title="' . $title . '" class="lockedResource">' . $_style['icons_secured'] . '</span>';
122
+                        $lockedByUser = '<span onclick="modx.tree.unlockElement(7, '.$row['id'].', this);return false;" title="'.$title.'" class="lockedResource">'.$_style['icons_secured'].'</span>';
123 123
                     } else {
124
-                        $lockedByUser = '<span title="' . $title . '" class="lockedResource">' . $_style['icons_secured'] . '</span>';
124
+                        $lockedByUser = '<span title="'.$title.'" class="lockedResource">'.$_style['icons_secured'].'</span>';
125 125
                     }
126 126
                 }
127 127
             }
@@ -130,22 +130,22 @@  discard block
 block discarded – undo
130 130
 
131 131
             $title = '';
132 132
             if (isDateNode($nodeNameSource)) {
133
-                $title = $_lang['pagetitle'] . ': ' . $row['pagetitle'] . '[+lf+]';
133
+                $title = $_lang['pagetitle'].': '.$row['pagetitle'].'[+lf+]';
134 134
             }
135
-            $title .= $_lang['id'] . ': ' . $row['id'];
136
-            $title .= '[+lf+]' . $_lang['resource_opt_menu_title'] . ': ' . $row['menutitle'];
137
-            $title .= '[+lf+]' . $_lang['resource_opt_menu_index'] . ': ' . $row['menuindex'];
138
-            $title .= '[+lf+]' . $_lang['alias'] . ': ' . (!empty($row['alias']) ? $row['alias'] : '-');
139
-            $title .= '[+lf+]' . $_lang['template'] . ': ' . $row['templatename'];
140
-            $title .= '[+lf+]' . $_lang['publish_date'] . ': ' . $modx->toDateFormat($row['pub_date']);
141
-            $title .= '[+lf+]' . $_lang['unpublish_date'] . ': ' . $modx->toDateFormat($row['unpub_date']);
142
-            $title .= '[+lf+]' . $_lang['page_data_web_access'] . ': ' . ($row['privateweb'] ? $_lang['private'] : $_lang['public']);
143
-            $title .= '[+lf+]' . $_lang['page_data_mgr_access'] . ': ' . ($row['privatemgr'] ? $_lang['private'] : $_lang['public']);
144
-            $title .= '[+lf+]' . $_lang['resource_opt_richtext'] . ': ' . ($row['richtext'] == 0 ? $_lang['no'] : $_lang['yes']);
145
-            $title .= '[+lf+]' . $_lang['page_data_searchable'] . ': ' . ($row['searchable'] == 0 ? $_lang['no'] : $_lang['yes']);
146
-            $title .= '[+lf+]' . $_lang['page_data_cacheable'] . ': ' . ($row['cacheable'] == 0 ? $_lang['no'] : $_lang['yes']);
135
+            $title .= $_lang['id'].': '.$row['id'];
136
+            $title .= '[+lf+]'.$_lang['resource_opt_menu_title'].': '.$row['menutitle'];
137
+            $title .= '[+lf+]'.$_lang['resource_opt_menu_index'].': '.$row['menuindex'];
138
+            $title .= '[+lf+]'.$_lang['alias'].': '.(!empty($row['alias']) ? $row['alias'] : '-');
139
+            $title .= '[+lf+]'.$_lang['template'].': '.$row['templatename'];
140
+            $title .= '[+lf+]'.$_lang['publish_date'].': '.$modx->toDateFormat($row['pub_date']);
141
+            $title .= '[+lf+]'.$_lang['unpublish_date'].': '.$modx->toDateFormat($row['unpub_date']);
142
+            $title .= '[+lf+]'.$_lang['page_data_web_access'].': '.($row['privateweb'] ? $_lang['private'] : $_lang['public']);
143
+            $title .= '[+lf+]'.$_lang['page_data_mgr_access'].': '.($row['privatemgr'] ? $_lang['private'] : $_lang['public']);
144
+            $title .= '[+lf+]'.$_lang['resource_opt_richtext'].': '.($row['richtext'] == 0 ? $_lang['no'] : $_lang['yes']);
145
+            $title .= '[+lf+]'.$_lang['page_data_searchable'].': '.($row['searchable'] == 0 ? $_lang['no'] : $_lang['yes']);
146
+            $title .= '[+lf+]'.$_lang['page_data_cacheable'].': '.($row['cacheable'] == 0 ? $_lang['no'] : $_lang['yes']);
147 147
             $title = $modx->htmlspecialchars($title);
148
-            $title = str_replace('[+lf+]', ' &#13;', $title);   // replace line-breaks with empty space as fall-back
148
+            $title = str_replace('[+lf+]', ' &#13;', $title); // replace line-breaks with empty space as fall-back
149 149
 
150 150
             $data = array(
151 151
                 'id'               => $row['id'],
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
                 }
230 230
 
231 231
                 if ($ph['contextmenu']) {
232
-                    $ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"';
232
+                    $ph['contextmenu'] = ' data-contextmenu="'._htmlentities($ph['contextmenu']).'"';
233 233
                 }
234 234
 
235 235
                 if ($_SESSION['tree_show_only_folders']) {
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
                         }
288 288
 
289 289
                         if ($ph['contextmenu']) {
290
-                            $ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"';
290
+                            $ph['contextmenu'] = ' data-contextmenu="'._htmlentities($ph['contextmenu']).'"';
291 291
                         }
292 292
 
293 293
                         $node .= $modx->parseText($tpl, $ph);
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
                         }
326 326
 
327 327
                         if ($ph['contextmenu']) {
328
-                            $ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"';
328
+                            $ph['contextmenu'] = ' data-contextmenu="'._htmlentities($ph['contextmenu']).'"';
329 329
                         }
330 330
 
331 331
                         $node .= $modx->parseText($tpl, $ph);
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
                         }
377 377
 
378 378
                         if ($ph['contextmenu']) {
379
-                            $ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"';
379
+                            $ph['contextmenu'] = ' data-contextmenu="'._htmlentities($ph['contextmenu']).'"';
380 380
                         }
381 381
 
382 382
                         $node .= $modx->parseText($tpl, $ph);
@@ -418,7 +418,7 @@  discard block
 block discarded – undo
418 418
                         }
419 419
 
420 420
                         if ($ph['contextmenu']) {
421
-                            $ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"';
421
+                            $ph['contextmenu'] = ' data-contextmenu="'._htmlentities($ph['contextmenu']).'"';
422 422
                         }
423 423
 
424 424
                         $node .= $modx->parseText($tpl, $ph);
@@ -444,7 +444,7 @@  discard block
 block discarded – undo
444 444
     }
445 445
 }
446 446
 
447
-if(!function_exists('getIconInfo')) {
447
+if (!function_exists('getIconInfo')) {
448 448
     /**
449 449
      * @param array $_style
450 450
      * @return array
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
     }
479 479
 }
480 480
 
481
-if(!function_exists('getNodeTitle')) {
481
+if (!function_exists('getNodeTitle')) {
482 482
     /**
483 483
      * @param string $nodeNameSource
484 484
      * @param array $row
@@ -499,7 +499,7 @@  discard block
 block discarded – undo
499 499
                         $nodetitle .= $modx->config['friendly_url_suffix'];
500 500
                     }
501 501
                 }
502
-                $nodetitle = $modx->config['friendly_url_prefix'] . $nodetitle;
502
+                $nodetitle = $modx->config['friendly_url_prefix'].$nodetitle;
503 503
                 break;
504 504
             case 'pagetitle':
505 505
                 $nodetitle = $row['pagetitle'];
@@ -533,7 +533,7 @@  discard block
 block discarded – undo
533 533
     }
534 534
 }
535 535
 
536
-if(!function_exists('isDateNode')) {
536
+if (!function_exists('isDateNode')) {
537 537
     /**
538 538
      * @param string $nodeNameSource
539 539
      * @return bool
@@ -553,7 +553,7 @@  discard block
 block discarded – undo
553 553
     }
554 554
 }
555 555
 
556
-if(!function_exists('checkIsFolder')) {
556
+if (!function_exists('checkIsFolder')) {
557 557
     /**
558 558
      * @param int $parent
559 559
      * @param int $isfolder
@@ -563,11 +563,11 @@  discard block
 block discarded – undo
563 563
     {
564 564
         $modx = evolutionCMS();
565 565
 
566
-        return (int)$modx->db->getValue($modx->db->query('SELECT count(*) FROM ' . $modx->getFullTableName('site_content') . ' WHERE parent=' . $parent . ' AND isfolder=' . $isfolder . ' '));
566
+        return (int) $modx->db->getValue($modx->db->query('SELECT count(*) FROM '.$modx->getFullTableName('site_content').' WHERE parent='.$parent.' AND isfolder='.$isfolder.' '));
567 567
     }
568 568
 }
569 569
 
570
-if(!function_exists('_htmlentities')) {
570
+if (!function_exists('_htmlentities')) {
571 571
     /**
572 572
      * @param mixed $array
573 573
      * @return string
@@ -583,7 +583,7 @@  discard block
 block discarded – undo
583 583
     }
584 584
 }
585 585
 
586
-if(!function_exists('getTplSingleNode')) {
586
+if (!function_exists('getTplSingleNode')) {
587 587
     /**
588 588
      * @return string
589 589
      */
@@ -613,7 +613,7 @@  discard block
 block discarded – undo
613 613
     }
614 614
 }
615 615
 
616
-if(!function_exists('getTplFolderNode')) {
616
+if (!function_exists('getTplFolderNode')) {
617 617
     /**
618 618
      * @return string
619 619
      */
@@ -654,7 +654,7 @@  discard block
 block discarded – undo
654 654
         title="[+title+]">[+nodetitleDisplay+][+weblinkDisplay+]</span>[+pageIdDisplay+]</a><div>';
655 655
     }
656 656
 }
657
-if(!function_exists('getTplFolderNodeNotChildren')) {
657
+if (!function_exists('getTplFolderNodeNotChildren')) {
658 658
     /**
659 659
      * @return string
660 660
      */
Please login to merge, or discard this patch.
manager/includes/bootstrap.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
  * @see https://github.com/theseer/Autoload
4 4
  */
5 5
 spl_autoload_register(
6
-    function ($class) {
6
+    function($class){
7 7
         static $classes = null;
8 8
         if ($classes === null) {
9 9
             $classes = array(
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
         }
35 35
         $cn = strtolower($class);
36 36
         if (isset($classes[$cn])) {
37
-            require __DIR__ . '/src' . $classes[$cn];
37
+            require __DIR__.'/src'.$classes[$cn];
38 38
         }
39 39
     },
40 40
     true,
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
3 3
  * @see https://github.com/theseer/Autoload
4 4
  */
5 5
 spl_autoload_register(
6
-    function ($class) {
6
+    function ($class){
7 7
         static $classes = null;
8 8
         if ($classes === null) {
9 9
             $classes = array(
Please login to merge, or discard this patch.
manager/frames/1.php 2 patches
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.
Braces   +32 added lines, -29 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");
@@ -11,22 +11,22 @@  discard block
 block discarded – undo
11 11
 
12 12
 $mxla = $modx_lang_attribute ? $modx_lang_attribute : 'en';
13 13
 
14
-if (!isset($modx->config['manager_menu_height'])) {
14
+if (!isset($modx->config['manager_menu_height'])) {
15 15
     $modx->config['manager_menu_height'] = 2.2; // rem
16 16
 }
17 17
 
18
-if (!isset($modx->config['manager_tree_width'])) {
18
+if (!isset($modx->config['manager_tree_width'])) {
19 19
     $modx->config['manager_tree_width'] = 20; // rem
20 20
 }
21 21
 
22
-if (isset($_SESSION['onLoginForwardToAction']) && is_int($_SESSION['onLoginForwardToAction'])) {
22
+if (isset($_SESSION['onLoginForwardToAction']) && is_int($_SESSION['onLoginForwardToAction'])) {
23 23
     $initMainframeAction = $_SESSION['onLoginForwardToAction'];
24 24
     unset($_SESSION['onLoginForwardToAction']);
25
-} else {
25
+} else {
26 26
     $initMainframeAction = 2; // welcome.static
27 27
 }
28 28
 
29
-if (!isset($_SESSION['tree_show_only_folders'])) {
29
+if (!isset($_SESSION['tree_show_only_folders'])) {
30 30
     $_SESSION['tree_show_only_folders'] = 0;
31 31
 }
32 32
 
@@ -35,29 +35,29 @@  discard block
 block discarded – undo
35 35
 $tree_width = $modx->config['manager_tree_width'];
36 36
 $tree_min_width = 0;
37 37
 
38
-if (isset($_COOKIE['MODX_widthSideBar'])) {
38
+if (isset($_COOKIE['MODX_widthSideBar'])) {
39 39
     $MODX_widthSideBar = $_COOKIE['MODX_widthSideBar'];
40
-} else {
40
+} else {
41 41
     $MODX_widthSideBar = $tree_width;
42 42
 }
43 43
 
44
-if (!$MODX_widthSideBar) {
44
+if (!$MODX_widthSideBar) {
45 45
     $body_class .= 'sidebar-closed';
46 46
 }
47 47
 
48 48
 $theme_modes = array('', 'lightness', 'light', 'dark', 'darkness');
49
-if (!empty($theme_modes[$_COOKIE['MODX_themeMode']])) {
49
+if (!empty($theme_modes[$_COOKIE['MODX_themeMode']])) {
50 50
     $body_class .= ' ' . $theme_modes[$_COOKIE['MODX_themeMode']];
51
-} elseif (!empty($theme_modes[$modx->config['manager_theme_mode']])) {
51
+} elseif (!empty($theme_modes[$modx->config['manager_theme_mode']])) {
52 52
     $body_class .= ' ' . $theme_modes[$modx->config['manager_theme_mode']];
53 53
 }
54 54
 
55 55
 $navbar_position = $modx->config['manager_menu_position'];
56
-if ($navbar_position == 'left') {
56
+if ($navbar_position == 'left') {
57 57
     $body_class .= ' navbar-left navbar-left-icon-and-text';
58 58
 }
59 59
 
60
-if (isset($modx->pluginCache['ElementsInTree'])) {
60
+if (isset($modx->pluginCache['ElementsInTree'])) {
61 61
     $body_class .= ' ElementsInTree';
62 62
 }
63 63
 
@@ -73,19 +73,19 @@  discard block
 block discarded – undo
73 73
     'type8' => $_lang["lock_element_type_8"]
74 74
 );
75 75
 
76
-foreach ($unlockTranslations as $key => $value) {
76
+foreach ($unlockTranslations as $key => $value) {
77 77
     $unlockTranslations[$key] = iconv($modx->config["modx_charset"], "utf-8", $value);
78 78
 }
79 79
 
80 80
 $user = $modx->getUserInfo($modx->getLoginUserID());
81
-if ($user['which_browser'] == 'default') {
81
+if ($user['which_browser'] == 'default') {
82 82
     $user['which_browser'] = $modx->config['which_browser'];
83 83
 }
84 84
 
85 85
 $css = 'media/style/' . $modx->config['manager_theme'] . '/css/page.css?v=' . $lastInstallTime;
86 86
 
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')) {
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 89
         require_once MODX_BASE_PATH . 'assets/lib/Formatter/CSSMinify.php';
90 90
         $minifier = new Formatter\CSSMinify();
91 91
         $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/bootstrap/css/bootstrap.min.css');
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
         $css = $minifier->minify();
103 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')) {
105
+    if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) {
106 106
         $css = 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css?v=' . $lastInstallTime;
107 107
     }
108 108
 }
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
     <?php
258 258
     // invoke OnManagerTopPrerender event
259 259
     $evtOut = $modx->invokeEvent('OnManagerTopPrerender', $_REQUEST);
260
-    if (is_array($evtOut)) {
260
+    if (is_array($evtOut)) {
261 261
         echo implode("\n", $evtOut);
262 262
     }
263 263
     ?>
@@ -428,11 +428,14 @@  discard block
 block discarded – undo
428 428
             <div id="evo-tab-page-home" class="evo-tab-page show iframe-scroller">
429 429
                 <iframe id="mainframe" src="index.php?a=<?= $initMainframeAction ?>" scrolling="auto" frameborder="0" onload="modx.main.onload(event);"></iframe>
430 430
             </div>
431
-        <?php else: ?>
431
+        <?php else {
432
+    : ?>
432 433
             <div class="iframe-scroller">
433 434
                 <iframe id="mainframe" name="main" src="index.php?a=<?= $initMainframeAction ?>" scrolling="auto" frameborder="0" onload="modx.main.onload(event);"></iframe>
434 435
             </div>
435
-        <?php endif; ?>
436
+        <?php endif;
437
+}
438
+?>
436 439
         <script>
437 440
             if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) {
438 441
                 document.getElementById('mainframe').setAttribute('scrolling', 'no');
@@ -451,11 +454,11 @@  discard block
 block discarded – undo
451 454
             'tree_sortdir',
452 455
             'tree_nodename'
453 456
         );
454
-        foreach ($sortParams as $param) {
455
-            if (isset($_REQUEST[$param])) {
457
+        foreach ($sortParams as $param) {
458
+            if (isset($_REQUEST[$param])) {
456 459
                 $modx->manager->saveLastUserSetting($param, $_REQUEST[$param]);
457 460
                 $_SESSION[$param] = $_REQUEST[$param];
458
-            } else if (!isset($_SESSION[$param])) {
461
+            } else if (!isset($_SESSION[$param])) {
459 462
                 $_SESSION[$param] = $modx->manager->getLastUserSetting($param);
460 463
             }
461 464
         }
@@ -535,16 +538,16 @@  discard block
 block discarded – undo
535 538
     </div>
536 539
 
537 540
     <?php
538
-    if(!function_exists('constructLink')) {
541
+    if(!function_exists('constructLink')) {
539 542
         /**
540 543
          * @param string $action
541 544
          * @param string $img
542 545
          * @param string $text
543 546
          * @param bool $allowed
544 547
          */
545
-        function constructLink($action, $img, $text, $allowed)
546
-        {
547
-            if ((bool)$allowed) {
548
+        function constructLink($action, $img, $text, $allowed)
549
+        {
550
+            if ((bool)$allowed) {
548 551
                 echo sprintf('<div class="menuLink" id="item%s" onclick="modx.tree.menuHandler(%s);">', $action,
549 552
                     $action);
550 553
                 echo sprintf('<i class="%s"></i> %s</div>', $img, $text);
@@ -651,7 +654,7 @@  discard block
 block discarded – undo
651 654
     ?>
652 655
 
653 656
 </div>
654
-<?php if ($modx->config['show_picker'] != "0") {
657
+<?php if ($modx->config['show_picker'] != "0") {
655 658
     include('media/style/' . $modx->config['manager_theme'] . '/color.switcher.php');
656 659
 } ?>
657 660
 </body>
Please login to merge, or discard this patch.
manager/actions/mutate_menuindex_sort.dynamic.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if (!$modx->hasPermission('edit_document') || !$modx->hasPermission('save_document')) {
6 6
     $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : null;
9
+$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : null;
10 10
 $reset = isset($_POST['reset']) && $_POST['reset'] == 'true' ? 1 : 0;
11 11
 $items = isset($_POST['list']) ? $_POST['list'] : '';
12 12
 $ressourcelist = '';
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 }
24 24
 
25 25
 if (isset($_POST['listSubmitted'])) {
26
-    $updateMsg .= '<div class="text-success" id="updated">' . $_lang['sort_updated'] . '</div>';
26
+    $updateMsg .= '<div class="text-success" id="updated">'.$_lang['sort_updated'].'</div>';
27 27
     if (strlen($items) > 0) {
28 28
         $items = explode(';', $items);
29 29
         foreach ($items as $key => $value) {
@@ -43,15 +43,15 @@  discard block
 block discarded – undo
43 43
     $tblsc = $modx->getFullTableName('site_content');
44 44
     $tbldg = $modx->getFullTableName('document_groups');
45 45
 
46
-    $rs = $modx->db->select('pagetitle', $tblsc, 'id=' . $id . '');
46
+    $rs = $modx->db->select('pagetitle', $tblsc, 'id='.$id.'');
47 47
     $pagetitle = $modx->db->getValue($rs);
48 48
 
49 49
     $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(',', $_SESSION['mgrDocgroups']) : '';
50 50
     $docgrp_cond = $docgrp ? "OR dg.document_group IN ({$docgrp})" : '';
51
-    $mgrRole = (isset ($_SESSION['mgrRole']) && (string)$_SESSION['mgrRole'] === '1') ? '1' : '0';
52
-    $access = " AND (1={$mgrRole} OR sc.privatemgr=0" . (!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))");
51
+    $mgrRole = (isset ($_SESSION['mgrRole']) && (string) $_SESSION['mgrRole'] === '1') ? '1' : '0';
52
+    $access = " AND (1={$mgrRole} OR sc.privatemgr=0".(!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))");
53 53
 
54
-    $rs = $modx->db->select('sc.id, sc.pagetitle, sc.parent, sc.menuindex, sc.published, sc.hidemenu, sc.deleted, sc.isfolder', $tblsc . 'AS sc LEFT JOIN ' . $tbldg . ' dg ON dg.document=sc.id', 'sc.parent=' . $id . $access . ' GROUP BY sc.id', 'menuindex ASC');
54
+    $rs = $modx->db->select('sc.id, sc.pagetitle, sc.parent, sc.menuindex, sc.published, sc.hidemenu, sc.deleted, sc.isfolder', $tblsc.'AS sc LEFT JOIN '.$tbldg.' dg ON dg.document=sc.id', 'sc.parent='.$id.$access.' GROUP BY sc.id', 'menuindex ASC');
55 55
 
56 56
     if ($modx->db->getRecordCount($rs)) {
57 57
         $ressourcelist .= '<div class="clearfix"><ul id="sortlist" class="sortableList">';
@@ -60,12 +60,12 @@  discard block
 block discarded – undo
60 60
             $classes .= ($row['hidemenu']) ? ' notInMenuNode ' : ' inMenuNode';
61 61
             $classes .= ($row['published']) ? ' publishedNode ' : ' unpublishedNode ';
62 62
             $classes = ($row['deleted']) ? ' deletedNode ' : $classes;
63
-            $icon = $row['isfolder'] ? '<i class="' . $_style['files_folder'] . '"></i> ' : ' <i class="' . $_style['files_page_html'] . '"></i> ';
64
-            $ressourcelist .= '<li id="item_' . $row['id'] . '" class="' . $classes . '">' . $icon . $row['pagetitle'] . ' <small>(' . $row['id'] . ')</small></li>';
63
+            $icon = $row['isfolder'] ? '<i class="'.$_style['files_folder'].'"></i> ' : ' <i class="'.$_style['files_page_html'].'"></i> ';
64
+            $ressourcelist .= '<li id="item_'.$row['id'].'" class="'.$classes.'">'.$icon.$row['pagetitle'].' <small>('.$row['id'].')</small></li>';
65 65
         }
66 66
         $ressourcelist .= '</ul></div>';
67 67
     } else {
68
-        $updateMsg = '<p class="text-danger">' . $_lang['sort_nochildren'] . '</p>';
68
+        $updateMsg = '<p class="text-danger">'.$_lang['sort_nochildren'].'</p>';
69 69
     }
70 70
 }
71 71
 
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 </script>
149 149
 
150 150
 <h1>
151
-    <i class="fa fa-sort-numeric-asc"></i><?= ($pagetitle ? $pagetitle . '<small>(' . $id . ')</small>' : $_lang['sort_menuindex']) ?>
151
+    <i class="fa fa-sort-numeric-asc"></i><?= ($pagetitle ? $pagetitle.'<small>('.$id.')</small>' : $_lang['sort_menuindex']) ?>
152 152
 </h1>
153 153
 
154 154
 <?= $_style['actionbuttons']['dynamic']['save'] ?>
Please login to merge, or discard this patch.