Completed
Pull Request — develop (#716)
by Serg
08:10 queued 01:53
created
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/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/functions/tv.php 1 patch
Spacing   +76 added lines, -76 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (! function_exists('ProcessTVCommand')) {
3
+if (!function_exists('ProcessTVCommand')) {
4 4
     /**
5 5
      * @param string $value
6 6
      * @param string $name
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
     function ProcessTVCommand($value, $name = '', $docid = '', $src = 'docform', $tvsArray = array())
13 13
     {
14 14
         $modx = evolutionCMS();
15
-        $docid = (int)$docid > 0 ? (int)$docid : $modx->documentIdentifier;
15
+        $docid = (int) $docid > 0 ? (int) $docid : $modx->documentIdentifier;
16 16
         $nvalue = trim($value);
17 17
         if (substr($nvalue, 0, 1) != '@') {
18 18
             return $value;
@@ -77,8 +77,8 @@  discard block
 block discarded – undo
77 77
                         // if an inherited value is found and if there is content following the @INHERIT binding
78 78
                         // remove @INHERIT and output that following content. This content could contain other
79 79
                         // @ bindings, that are processed in the next step
80
-                        if ((string)$tv['value'] !== '' && !preg_match('%^@INHERIT[\s\n\r]*$%im', $tv['value'])) {
81
-                            $output = trim(str_replace('@INHERIT', '', (string)$tv['value']));
80
+                        if ((string) $tv['value'] !== '' && !preg_match('%^@INHERIT[\s\n\r]*$%im', $tv['value'])) {
81
+                            $output = trim(str_replace('@INHERIT', '', (string) $tv['value']));
82 82
                             break 2;
83 83
                         }
84 84
                     }
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 
87 87
                 case 'DIRECTORY' :
88 88
                     $files = array();
89
-                    $path = $modx->config['base_path'] . $param;
89
+                    $path = $modx->config['base_path'].$param;
90 90
                     if (substr($path, -1, 1) != '/') {
91 91
                         $path .= '/';
92 92
                     }
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
     }
118 118
 }
119 119
 
120
-if (! function_exists('ProcessFile')) {
120
+if (!function_exists('ProcessFile')) {
121 121
     /**
122 122
      * @param $file
123 123
      * @return string
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
     }
135 135
 }
136 136
 
137
-if (! function_exists('ParseCommand')) {
137
+if (!function_exists('ParseCommand')) {
138 138
     /**
139 139
      * ParseCommand - separate @ cmd from params
140 140
      *
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 
156 156
         $binding_array = array();
157 157
         foreach ($BINDINGS as $cmd) {
158
-            if (strpos($binding_string, '@' . $cmd) === 0) {
158
+            if (strpos($binding_string, '@'.$cmd) === 0) {
159 159
                 $code = substr($binding_string, strlen($cmd) + 1);
160 160
                 $binding_array = array($cmd, trim($code));
161 161
                 break;
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
     }
167 167
 }
168 168
 
169
-if (! function_exists('parseTvValues')) {
169
+if (!function_exists('parseTvValues')) {
170 170
     /**
171 171
      * Parse MODX Template-Variables
172 172
      *
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
     }
198 198
 }
199 199
 
200
-if (! function_exists('getTVDisplayFormat')) {
200
+if (!function_exists('getTVDisplayFormat')) {
201 201
     /**
202 202
      * @param string $name
203 203
      * @param string $value
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
         $o = '';
216 216
 
217 217
         // process any TV commands in value
218
-        $docid = (int)$docid > 0 ? (int)$docid : $modx->documentIdentifier;
218
+        $docid = (int) $docid > 0 ? (int) $docid : $modx->documentIdentifier;
219 219
         $value = ProcessTVCommand($value, $name, $docid);
220 220
 
221 221
         $params = array();
@@ -254,12 +254,12 @@  discard block
 block discarded – undo
254 254
                             $attr['align'] = $params['align'];
255 255
                         }
256 256
                         foreach ($attr as $k => $v) {
257
-                            $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : '');
257
+                            $attributes .= ($v ? ' '.$k.'="'.$v.'"' : '');
258 258
                         }
259
-                        $attributes .= ' ' . $params['attrib'];
259
+                        $attributes .= ' '.$params['attrib'];
260 260
 
261 261
                         // Output the image with attributes
262
-                        $o .= '<img' . rtrim($attributes) . ' />';
262
+                        $o .= '<img'.rtrim($attributes).' />';
263 263
                     }
264 264
                 }
265 265
                 break;
@@ -331,12 +331,12 @@  discard block
 block discarded – undo
331 331
                             'target' => $params['target'],
332 332
                         );
333 333
                         foreach ($attr as $k => $v) {
334
-                            $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : '');
334
+                            $attributes .= ($v ? ' '.$k.'="'.$v.'"' : '');
335 335
                         }
336
-                        $attributes .= ' ' . $params['attrib']; // add extra
336
+                        $attributes .= ' '.$params['attrib']; // add extra
337 337
 
338 338
                         // Output the link
339
-                        $o .= '<a' . rtrim($attributes) . '>' . ($params['text'] ? $modx->htmlspecialchars($params['text']) : $name) . '</a>';
339
+                        $o .= '<a'.rtrim($attributes).'>'.($params['text'] ? $modx->htmlspecialchars($params['text']) : $name).'</a>';
340 340
                     }
341 341
                 }
342 342
                 break;
@@ -362,12 +362,12 @@  discard block
 block discarded – undo
362 362
                         'style' => $params['style'],
363 363
                     );
364 364
                     foreach ($attr as $k => $v) {
365
-                        $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : '');
365
+                        $attributes .= ($v ? ' '.$k.'="'.$v.'"' : '');
366 366
                     }
367
-                    $attributes .= ' ' . $params['attrib']; // add extra
367
+                    $attributes .= ' '.$params['attrib']; // add extra
368 368
 
369 369
                     // Output the HTML Tag
370
-                    $o .= '<' . $tagname . rtrim($attributes) . '>' . $tagvalue . '</' . $tagname . '>';
370
+                    $o .= '<'.$tagname.rtrim($attributes).'>'.$tagvalue.'</'.$tagname.'>';
371 371
                 }
372 372
                 break;
373 373
 
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
                 $w = $params['w'] ? $params['w'] : '100%';
377 377
                 $h = $params['h'] ? $params['h'] : '400px';
378 378
                 $richtexteditor = $params['edt'] ? $params['edt'] : "";
379
-                $o = '<div class="MODX_RichTextWidget"><textarea id="' . $id . '" name="' . $id . '" style="width:' . $w . '; height:' . $h . ';">';
379
+                $o = '<div class="MODX_RichTextWidget"><textarea id="'.$id.'" name="'.$id.'" style="width:'.$w.'; height:'.$h.';">';
380 380
                 $o .= $modx->htmlspecialchars($value);
381 381
                 $o .= '</textarea></div>';
382 382
                 $replace_richtext = array($id);
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
 
404 404
             case "viewport":
405 405
                 $value = parseInput($value);
406
-                $id = '_' . time();
406
+                $id = '_'.time();
407 407
                 if (!$params['vpid']) {
408 408
                     $params['vpid'] = $id;
409 409
                 }
@@ -417,41 +417,41 @@  discard block
 block discarded – undo
417 417
                     $h = "100%";
418 418
                 }
419 419
                 if ($params['asize'] == 'Yes' || ($params['awidth'] == 'Yes' && $params['aheight'] == 'Yes')) {
420
-                    $autoMode = "3";  //both
420
+                    $autoMode = "3"; //both
421 421
                 } else {
422 422
                     if ($params['awidth'] == 'Yes') {
423 423
                         $autoMode = "1"; //width only
424 424
                     } else {
425 425
                         if ($params['aheight'] == 'Yes') {
426
-                            $autoMode = "2";    //height only
426
+                            $autoMode = "2"; //height only
427 427
                         }
428 428
                     }
429 429
                 }
430 430
 
431
-                $modx->regClientStartupScript(MODX_MANAGER_URL . "media/script/bin/viewport.js", array(
431
+                $modx->regClientStartupScript(MODX_MANAGER_URL."media/script/bin/viewport.js", array(
432 432
                     'name'      => 'viewport',
433 433
                     'version'   => '0',
434 434
                     'plaintext' => false
435 435
                 ));
436
-                $o = $sTag . " id='" . $params['vpid'] . "' name='" . $params['vpid'] . "' ";
436
+                $o = $sTag." id='".$params['vpid']."' name='".$params['vpid']."' ";
437 437
                 if ($params['class']) {
438
-                    $o .= " class='" . $params['class'] . "' ";
438
+                    $o .= " class='".$params['class']."' ";
439 439
                 }
440 440
                 if ($params['style']) {
441
-                    $o .= " style='" . $params['style'] . "' ";
441
+                    $o .= " style='".$params['style']."' ";
442 442
                 }
443 443
                 if ($params['attrib']) {
444
-                    $o .= $params['attrib'] . " ";
444
+                    $o .= $params['attrib']." ";
445 445
                 }
446
-                $o .= "scrolling='" . ($params['sbar'] == 'No' ? "no" : ($params['sbar'] == 'Yes' ? "yes" : "auto")) . "' ";
447
-                $o .= "src='" . $value . "' frameborder='" . $params['borsize'] . "' ";
448
-                $o .= "onload=\"window.setTimeout('ResizeViewPort(\\'" . $params['vpid'] . "\\'," . $autoMode . ")',100);\" width='" . $w . "' height='" . $h . "' ";
446
+                $o .= "scrolling='".($params['sbar'] == 'No' ? "no" : ($params['sbar'] == 'Yes' ? "yes" : "auto"))."' ";
447
+                $o .= "src='".$value."' frameborder='".$params['borsize']."' ";
448
+                $o .= "onload=\"window.setTimeout('ResizeViewPort(\\'".$params['vpid']."\\',".$autoMode.")',100);\" width='".$w."' height='".$h."' ";
449 449
                 $o .= ">";
450 450
                 $o .= $eTag;
451 451
                 break;
452 452
 
453 453
             case "datagrid":
454
-                include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php";
454
+                include_once MODX_MANAGER_PATH."includes/controls/datagrid.class.php";
455 455
                 $grd = new DataGrid('', $value);
456 456
 
457 457
                 $grd->noRecordMsg = $params['egmsg'];
@@ -498,16 +498,16 @@  discard block
 block discarded – undo
498 498
                 $o = '';
499 499
                 /* If we are loading a file */
500 500
                 if (substr($params['output'], 0, 5) == "@FILE") {
501
-                    $file_name = MODX_BASE_PATH . trim(substr($params['output'], 6));
501
+                    $file_name = MODX_BASE_PATH.trim(substr($params['output'], 6));
502 502
                     if (!file_exists($file_name)) {
503
-                        $widget_output = $file_name . ' does not exist';
503
+                        $widget_output = $file_name.' does not exist';
504 504
                     } else {
505 505
                         $widget_output = file_get_contents($file_name);
506 506
                     }
507 507
                 } elseif (substr($params['output'], 0, 8) == '@INCLUDE') {
508
-                    $file_name = MODX_BASE_PATH . trim(substr($params['output'], 9));
508
+                    $file_name = MODX_BASE_PATH.trim(substr($params['output'], 9));
509 509
                     if (!file_exists($file_name)) {
510
-                        $widget_output = $file_name . ' does not exist';
510
+                        $widget_output = $file_name.' does not exist';
511 511
                     } else {
512 512
                         /* The included file needs to set $widget_output. Can be string, array, object */
513 513
                         include $file_name;
@@ -549,7 +549,7 @@  discard block
 block discarded – undo
549 549
     }
550 550
 }
551 551
 
552
-if (! function_exists('decodeParamValue')) {
552
+if (!function_exists('decodeParamValue')) {
553 553
     /**
554 554
      * @param string $s
555 555
      * @return string
@@ -562,7 +562,7 @@  discard block
 block discarded – undo
562 562
     }
563 563
 }
564 564
 
565
-if (! function_exists('parseInput')) {
565
+if (!function_exists('parseInput')) {
566 566
     /**
567 567
      * returns an array if a delimiter is present. returns array is a recordset is present
568 568
      *
@@ -594,7 +594,7 @@  discard block
 block discarded – undo
594 594
     }
595 595
 }
596 596
 
597
-if (! function_exists('getUnixtimeFromDateString')) {
597
+if (!function_exists('getUnixtimeFromDateString')) {
598 598
     /**
599 599
      * @param string $value
600 600
      * @return bool|false|int
@@ -622,7 +622,7 @@  discard block
 block discarded – undo
622 622
     }
623 623
 }
624 624
 
625
-if (! function_exists('renderFormElement')) {
625
+if (!function_exists('renderFormElement')) {
626 626
     /**
627 627
      * DISPLAY FORM ELEMENTS
628 628
      *
@@ -645,7 +645,7 @@  discard block
 block discarded – undo
645 645
         $field_style = '',
646 646
         $row = array(),
647 647
         $tvsArray = array()
648
-    ) {
648
+    ){
649 649
         $modx = evolutionCMS();
650 650
         global $_style;
651 651
         global $_lang;
@@ -665,22 +665,22 @@  discard block
 block discarded – undo
665 665
 
666 666
                 case "text": // handler for regular text boxes
667 667
                 case "rawtext"; // non-htmlentity converted text boxes
668
-                    $field_html .= '<input type="text" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $modx->htmlspecialchars($field_value) . '" ' . $field_style . ' tvtype="' . $field_type . '" onchange="documentDirty=true;" style="width:100%" />';
668
+                    $field_html .= '<input type="text" id="tv'.$field_id.'" name="tv'.$field_id.'" value="'.$modx->htmlspecialchars($field_value).'" '.$field_style.' tvtype="'.$field_type.'" onchange="documentDirty=true;" style="width:100%" />';
669 669
                     break;
670 670
                 case "email": // handles email input fields
671
-                    $field_html .= '<input type="email" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $modx->htmlspecialchars($field_value) . '" ' . $field_style . ' tvtype="' . $field_type . '" onchange="documentDirty=true;" style="width:100%"/>';
671
+                    $field_html .= '<input type="email" id="tv'.$field_id.'" name="tv'.$field_id.'" value="'.$modx->htmlspecialchars($field_value).'" '.$field_style.' tvtype="'.$field_type.'" onchange="documentDirty=true;" style="width:100%"/>';
672 672
                     break;
673 673
                 case "number": // handles the input of numbers
674
-                    $field_html .= '<input type="number" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $modx->htmlspecialchars($field_value) . '" ' . $field_style . ' tvtype="' . $field_type . '" onchange="documentDirty=true;" style="width:100%" onkeyup="this.value=this.value.replace(/[^\d-,.+]/,\'\')"/>';
674
+                    $field_html .= '<input type="number" id="tv'.$field_id.'" name="tv'.$field_id.'" value="'.$modx->htmlspecialchars($field_value).'" '.$field_style.' tvtype="'.$field_type.'" onchange="documentDirty=true;" style="width:100%" onkeyup="this.value=this.value.replace(/[^\d-,.+]/,\'\')"/>';
675 675
                     break;
676 676
                 case "textareamini": // handler for textarea mini boxes
677
-                    $field_html .= '<textarea id="tv' . $field_id . '" name="tv' . $field_id . '" cols="40" rows="5" onchange="documentDirty=true;" style="width:100%">' . $modx->htmlspecialchars($field_value) . '</textarea>';
677
+                    $field_html .= '<textarea id="tv'.$field_id.'" name="tv'.$field_id.'" cols="40" rows="5" onchange="documentDirty=true;" style="width:100%">'.$modx->htmlspecialchars($field_value).'</textarea>';
678 678
                     break;
679 679
                 case "textarea": // handler for textarea boxes
680 680
                 case "rawtextarea": // non-htmlentity convertex textarea boxes
681 681
                 case "htmlarea": // handler for textarea boxes (deprecated)
682 682
                 case "richtext": // handler for textarea boxes
683
-                    $field_html .= '<textarea id="tv' . $field_id . '" name="tv' . $field_id . '" cols="40" rows="15" onchange="documentDirty=true;" style="width:100%">' . $modx->htmlspecialchars($field_value) . '</textarea>';
683
+                    $field_html .= '<textarea id="tv'.$field_id.'" name="tv'.$field_id.'" cols="40" rows="15" onchange="documentDirty=true;" style="width:100%">'.$modx->htmlspecialchars($field_value).'</textarea>';
684 684
                     break;
685 685
                 case "date":
686 686
                     $field_id = str_replace(array(
@@ -690,12 +690,12 @@  discard block
 block discarded – undo
690 690
                     if ($field_value == '') {
691 691
                         $field_value = 0;
692 692
                     }
693
-                    $field_html .= '<input id="tv' . $field_id . '" name="tv' . $field_id . '" class="DatePicker" type="text" value="' . ($field_value == 0 || !isset($field_value) ? "" : $field_value) . '" onblur="documentDirty=true;" />';
694
-                    $field_html .= ' <a onclick="document.forms[\'mutate\'].elements[\'tv' . $field_id . '\'].value=\'\';document.forms[\'mutate\'].elements[\'tv' . $field_id . '\'].onblur(); return true;" onmouseover="window.status=\'clear the date\'; return true;" onmouseout="window.status=\'\'; return true;" style="cursor:pointer; cursor:hand"><i class="' . $_style["actions_calendar_delete"] . '"></i></a>';
693
+                    $field_html .= '<input id="tv'.$field_id.'" name="tv'.$field_id.'" class="DatePicker" type="text" value="'.($field_value == 0 || !isset($field_value) ? "" : $field_value).'" onblur="documentDirty=true;" />';
694
+                    $field_html .= ' <a onclick="document.forms[\'mutate\'].elements[\'tv'.$field_id.'\'].value=\'\';document.forms[\'mutate\'].elements[\'tv'.$field_id.'\'].onblur(); return true;" onmouseover="window.status=\'clear the date\'; return true;" onmouseout="window.status=\'\'; return true;" style="cursor:pointer; cursor:hand"><i class="'.$_style["actions_calendar_delete"].'"></i></a>';
695 695
 
696 696
                     break;
697 697
                 case "dropdown": // handler for select boxes
698
-                    $field_html .= '<select id="tv' . $field_id . '" name="tv' . $field_id . '" size="1" onchange="documentDirty=true;">';
698
+                    $field_html .= '<select id="tv'.$field_id.'" name="tv'.$field_id.'" size="1" onchange="documentDirty=true;">';
699 699
                     $index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform',
700 700
                         $tvsArray));
701 701
                     while (list($item, $itemvalue) = each($index_list)) {
@@ -703,12 +703,12 @@  discard block
 block discarded – undo
703 703
                         if (strlen($itemvalue) == 0) {
704 704
                             $itemvalue = $item;
705 705
                         }
706
-                        $field_html .= '<option value="' . $modx->htmlspecialchars($itemvalue) . '"' . ($itemvalue == $field_value ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($item) . '</option>';
706
+                        $field_html .= '<option value="'.$modx->htmlspecialchars($itemvalue).'"'.($itemvalue == $field_value ? ' selected="selected"' : '').'>'.$modx->htmlspecialchars($item).'</option>';
707 707
                     }
708 708
                     $field_html .= "</select>";
709 709
                     break;
710 710
                 case "listbox": // handler for select boxes
711
-                    $field_html .= '<select id="tv' . $field_id . '" name="tv' . $field_id . '" onchange="documentDirty=true;" size="8">';
711
+                    $field_html .= '<select id="tv'.$field_id.'" name="tv'.$field_id.'" onchange="documentDirty=true;" size="8">';
712 712
                     $index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform',
713 713
                         $tvsArray));
714 714
                     while (list($item, $itemvalue) = each($index_list)) {
@@ -716,13 +716,13 @@  discard block
 block discarded – undo
716 716
                         if (strlen($itemvalue) == 0) {
717 717
                             $itemvalue = $item;
718 718
                         }
719
-                        $field_html .= '<option value="' . $modx->htmlspecialchars($itemvalue) . '"' . ($itemvalue == $field_value ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($item) . '</option>';
719
+                        $field_html .= '<option value="'.$modx->htmlspecialchars($itemvalue).'"'.($itemvalue == $field_value ? ' selected="selected"' : '').'>'.$modx->htmlspecialchars($item).'</option>';
720 720
                     }
721 721
                     $field_html .= "</select>";
722 722
                     break;
723 723
                 case "listbox-multiple": // handler for select boxes where you can choose multiple items
724 724
                     $field_value = explode("||", $field_value);
725
-                    $field_html .= '<select id="tv' . $field_id . '" name="tv' . $field_id . '[]" multiple="multiple" onchange="documentDirty=true;" size="8">';
725
+                    $field_html .= '<select id="tv'.$field_id.'" name="tv'.$field_id.'[]" multiple="multiple" onchange="documentDirty=true;" size="8">';
726 726
                     $index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform',
727 727
                         $tvsArray));
728 728
                     while (list($item, $itemvalue) = each($index_list)) {
@@ -730,8 +730,8 @@  discard block
 block discarded – undo
730 730
                         if (strlen($itemvalue) == 0) {
731 731
                             $itemvalue = $item;
732 732
                         }
733
-                        $field_html .= '<option value="' . $modx->htmlspecialchars($itemvalue) . '"' . (in_array($itemvalue,
734
-                                $field_value) ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($item) . '</option>';
733
+                        $field_html .= '<option value="'.$modx->htmlspecialchars($itemvalue).'"'.(in_array($itemvalue,
734
+                                $field_value) ? ' selected="selected"' : '').'>'.$modx->htmlspecialchars($item).'</option>';
735 735
                     }
736 736
                     $field_html .= "</select>";
737 737
                     break;
@@ -743,17 +743,17 @@  discard block
 block discarded – undo
743 743
                         'ftp://'   => 'ftp://',
744 744
                         'mailto:'  => 'mailto:'
745 745
                     );
746
-                    $field_html = '<table border="0" cellspacing="0" cellpadding="0"><tr><td><select id="tv' . $field_id . '_prefix" name="tv' . $field_id . '_prefix" onchange="documentDirty=true;">';
746
+                    $field_html = '<table border="0" cellspacing="0" cellpadding="0"><tr><td><select id="tv'.$field_id.'_prefix" name="tv'.$field_id.'_prefix" onchange="documentDirty=true;">';
747 747
                     foreach ($urls as $k => $v) {
748 748
                         if (strpos($field_value, $v) === false) {
749
-                            $field_html .= '<option value="' . $v . '">' . $k . '</option>';
749
+                            $field_html .= '<option value="'.$v.'">'.$k.'</option>';
750 750
                         } else {
751 751
                             $field_value = str_replace($v, '', $field_value);
752
-                            $field_html .= '<option value="' . $v . '" selected="selected">' . $k . '</option>';
752
+                            $field_html .= '<option value="'.$v.'" selected="selected">'.$k.'</option>';
753 753
                         }
754 754
                     }
755 755
                     $field_html .= '</select></td><td>';
756
-                    $field_html .= '<input type="text" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $modx->htmlspecialchars($field_value) . '" width="100" ' . $field_style . ' onchange="documentDirty=true;" /></td></tr></table>';
756
+                    $field_html .= '<input type="text" id="tv'.$field_id.'" name="tv'.$field_id.'" value="'.$modx->htmlspecialchars($field_value).'" width="100" '.$field_style.' onchange="documentDirty=true;" /></td></tr></table>';
757 757
                     break;
758 758
                 case 'checkbox': // handles check boxes
759 759
                     $values = !is_array($field_value) ? explode('||', $field_value) : $field_value;
@@ -795,7 +795,7 @@  discard block
 block discarded – undo
795 795
                         if (strlen($itemvalue) == 0) {
796 796
                             $itemvalue = $item;
797 797
                         }
798
-                        $field_html .= '<input type="radio" value="' . $modx->htmlspecialchars($itemvalue) . '" id="tv_' . $i . '" name="tv' . $field_id . '" ' . ($itemvalue == $field_value ? 'checked="checked"' : '') . ' onchange="documentDirty=true;" /><label for="tv_' . $i . '" class="radio">' . $item . '</label><br />';
798
+                        $field_html .= '<input type="radio" value="'.$modx->htmlspecialchars($itemvalue).'" id="tv_'.$i.'" name="tv'.$field_id.'" '.($itemvalue == $field_value ? 'checked="checked"' : '').' onchange="documentDirty=true;" /><label for="tv_'.$i.'" class="radio">'.$item.'</label><br />';
799 799
                         $i++;
800 800
                     }
801 801
                     break;
@@ -825,13 +825,13 @@  discard block
 block discarded – undo
825 825
 									lastImageCtrl = ctrl;
826 826
 									var w = screen.width * 0.5;
827 827
 									var h = screen.height * 0.5;
828
-									OpenServerBrowser('" . MODX_MANAGER_URL . "media/browser/{$which_browser}/browser.php?Type=images', w, h);
828
+									OpenServerBrowser('" . MODX_MANAGER_URL."media/browser/{$which_browser}/browser.php?Type=images', w, h);
829 829
 								}
830 830
 								function BrowseFileServer(ctrl) {
831 831
 									lastFileCtrl = ctrl;
832 832
 									var w = screen.width * 0.5;
833 833
 									var h = screen.height * 0.5;
834
-									OpenServerBrowser('" . MODX_MANAGER_URL . "media/browser/{$which_browser}/browser.php?Type=files', w, h);
834
+									OpenServerBrowser('".MODX_MANAGER_URL."media/browser/{$which_browser}/browser.php?Type=files', w, h);
835 835
 								}
836 836
 								function SetUrlChange(el) {
837 837
 									if ('createEvent' in document) {
@@ -865,7 +865,7 @@  discard block
 block discarded – undo
865 865
 						</script>";
866 866
                         $ResourceManagerLoaded = true;
867 867
                     }
868
-                    $field_html .= '<input type="text" id="tv' . $field_id . '" name="tv' . $field_id . '"  value="' . $field_value . '" ' . $field_style . ' onchange="documentDirty=true;" /><input type="button" value="' . $_lang['insert'] . '" onclick="BrowseServer(\'tv' . $field_id . '\')" />';
868
+                    $field_html .= '<input type="text" id="tv'.$field_id.'" name="tv'.$field_id.'"  value="'.$field_value.'" '.$field_style.' onchange="documentDirty=true;" /><input type="button" value="'.$_lang['insert'].'" onclick="BrowseServer(\'tv'.$field_id.'\')" />';
869 869
                     break;
870 870
                 case "file": // handles the input of file uploads
871 871
                     /* Modified by Timon for use with resource browser */
@@ -895,13 +895,13 @@  discard block
 block discarded – undo
895 895
 									lastImageCtrl = ctrl;
896 896
 									var w = screen.width * 0.5;
897 897
 									var h = screen.height * 0.5;
898
-									OpenServerBrowser('" . MODX_MANAGER_URL . "media/browser/{$which_browser}/browser.php?Type=images', w, h);
898
+									OpenServerBrowser('" . MODX_MANAGER_URL."media/browser/{$which_browser}/browser.php?Type=images', w, h);
899 899
 								}
900 900
 								function BrowseFileServer(ctrl) {
901 901
 									lastFileCtrl = ctrl;
902 902
 									var w = screen.width * 0.5;
903 903
 									var h = screen.height * 0.5;
904
-									OpenServerBrowser('" . MODX_MANAGER_URL . "media/browser/{$which_browser}/browser.php?Type=files', w, h);
904
+									OpenServerBrowser('".MODX_MANAGER_URL."media/browser/{$which_browser}/browser.php?Type=files', w, h);
905 905
 								}
906 906
 								function SetUrlChange(el) {
907 907
 									if ('createEvent' in document) {
@@ -935,7 +935,7 @@  discard block
 block discarded – undo
935 935
 						</script>";
936 936
                         $ResourceManagerLoaded = true;
937 937
                     }
938
-                    $field_html .= '<input type="text" id="tv' . $field_id . '" name="tv' . $field_id . '"  value="' . $field_value . '" ' . $field_style . ' onchange="documentDirty=true;" /><input type="button" value="' . $_lang['insert'] . '" onclick="BrowseFileServer(\'tv' . $field_id . '\')" />';
938
+                    $field_html .= '<input type="text" id="tv'.$field_id.'" name="tv'.$field_id.'"  value="'.$field_value.'" '.$field_style.' onchange="documentDirty=true;" /><input type="button" value="'.$_lang['insert'].'" onclick="BrowseFileServer(\'tv'.$field_id.'\')" />';
939 939
 
940 940
                     break;
941 941
 
@@ -943,16 +943,16 @@  discard block
 block discarded – undo
943 943
                     $custom_output = '';
944 944
                     /* If we are loading a file */
945 945
                     if (substr($field_elements, 0, 5) == "@FILE") {
946
-                        $file_name = MODX_BASE_PATH . trim(substr($field_elements, 6));
946
+                        $file_name = MODX_BASE_PATH.trim(substr($field_elements, 6));
947 947
                         if (!file_exists($file_name)) {
948
-                            $custom_output = $file_name . ' does not exist';
948
+                            $custom_output = $file_name.' does not exist';
949 949
                         } else {
950 950
                             $custom_output = file_get_contents($file_name);
951 951
                         }
952 952
                     } elseif (substr($field_elements, 0, 8) == '@INCLUDE') {
953
-                        $file_name = MODX_BASE_PATH . trim(substr($field_elements, 9));
953
+                        $file_name = MODX_BASE_PATH.trim(substr($field_elements, 9));
954 954
                         if (!file_exists($file_name)) {
955
-                            $custom_output = $file_name . ' does not exist';
955
+                            $custom_output = $file_name.' does not exist';
956 956
                         } else {
957 957
                             ob_start();
958 958
                             include $file_name;
@@ -963,7 +963,7 @@  discard block
 block discarded – undo
963 963
                         $chunk_name = trim(substr($field_elements, 7));
964 964
                         $chunk_body = $modx->getChunk($chunk_name);
965 965
                         if ($chunk_body == false) {
966
-                            $custom_output = $_lang['chunk_no_exist'] . '(' . $_lang['htmlsnippet_name'] . ':' . $chunk_name . ')';
966
+                            $custom_output = $_lang['chunk_no_exist'].'('.$_lang['htmlsnippet_name'].':'.$chunk_name.')';
967 967
                         } else {
968 968
                             $custom_output = $chunk_body;
969 969
                         }
@@ -988,15 +988,15 @@  discard block
 block discarded – undo
988 988
                     break;
989 989
 
990 990
                 default: // the default handler -- for errors, mostly
991
-                    $field_html .= '<input type="text" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $modx->htmlspecialchars($field_value) . '" ' . $field_style . ' onchange="documentDirty=true;" />';
991
+                    $field_html .= '<input type="text" id="tv'.$field_id.'" name="tv'.$field_id.'" value="'.$modx->htmlspecialchars($field_value).'" '.$field_style.' onchange="documentDirty=true;" />';
992 992
 
993 993
             } // end switch statement
994 994
         } else {
995 995
             $custom = explode(":", $field_type);
996 996
             $custom_output = '';
997
-            $file_name = MODX_BASE_PATH . 'assets/tvs/' . $custom['1'] . '/' . $custom['1'] . '.customtv.php';
997
+            $file_name = MODX_BASE_PATH.'assets/tvs/'.$custom['1'].'/'.$custom['1'].'.customtv.php';
998 998
             if (!file_exists($file_name)) {
999
-                $custom_output = $file_name . ' does not exist';
999
+                $custom_output = $file_name.' does not exist';
1000 1000
             } else {
1001 1001
                 ob_start();
1002 1002
                 include $file_name;
@@ -1020,7 +1020,7 @@  discard block
 block discarded – undo
1020 1020
     } // end renderFormElement function
1021 1021
 }
1022 1022
 
1023
-if (! function_exists('ParseIntputOptions')) {
1023
+if (!function_exists('ParseIntputOptions')) {
1024 1024
     /**
1025 1025
      * @param string|array|mysqli_result $v
1026 1026
      * @return array
Please login to merge, or discard this patch.
manager/includes/bootstrap.php 1 patch
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.
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_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.
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.