Completed
Push — develop ( 6df80e...9a0e8e )
by Maxim
06:04
created
manager/actions/logging.static.php 1 patch
Spacing   +27 added lines, -27 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
 if (!$modx->hasPermission('logs')) {
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
                             $logs_user = record_sort(array_unique_multi($logs, 'internalKey'), 'username');
29 29
                             foreach ($logs_user as $row) {
30 30
                                 $selectedtext = $row['internalKey'] == $_REQUEST['searchuser'] ? ' selected="selected"' : '';
31
-                                echo "\t\t" . '<option value="' . $row['internalKey'] . '"' . $selectedtext . '>' . $row['username'] . "</option>\n";
31
+                                echo "\t\t".'<option value="'.$row['internalKey'].'"'.$selectedtext.'>'.$row['username']."</option>\n";
32 32
                             }
33 33
                             ?>
34 34
                         </select>
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
                                     continue;
50 50
                                 }
51 51
                                 $selectedtext = $row['action'] == $_REQUEST['action'] ? ' selected="selected"' : '';
52
-                                echo "\t\t" . '<option value="' . $row['action'] . '"' . $selectedtext . '>' . $row['action'] . ' - ' . $action . "</option>\n";
52
+                                echo "\t\t".'<option value="'.$row['action'].'"'.$selectedtext.'>'.$row['action'].' - '.$action."</option>\n";
53 53
                             }
54 54
                             ?>
55 55
                         </select>
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
                             $logs_items = record_sort(array_unique_multi($logs, 'itemid'), 'itemid');
66 66
                             foreach ($logs_items as $row) {
67 67
                                 $selectedtext = $row['itemid'] == $_REQUEST['itemid'] ? ' selected="selected"' : '';
68
-                                echo "\t\t" . '<option value="' . $row['itemid'] . '"' . $selectedtext . '>' . $row['itemid'] . "</option>\n";
68
+                                echo "\t\t".'<option value="'.$row['itemid'].'"'.$selectedtext.'>'.$row['itemid']."</option>\n";
69 69
                             }
70 70
                             ?>
71 71
                         </select>
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
                             $logs_names = record_sort(array_unique_multi($logs, 'itemname'), 'itemname');
82 82
                             foreach ($logs_names as $row) {
83 83
                                 $selectedtext = $row['itemname'] == $_REQUEST['itemname'] ? ' selected="selected"' : '';
84
-                                echo "\t\t" . '<option value="' . $row['itemname'] . '"' . $selectedtext . '>' . $row['itemname'] . "</option>\n";
84
+                                echo "\t\t".'<option value="'.$row['itemname'].'"'.$selectedtext.'>'.$row['itemname']."</option>\n";
85 85
                             }
86 86
                             ?>
87 87
                         </select>
@@ -139,26 +139,26 @@  discard block
 block discarded – undo
139 139
     // get the selections the user made.
140 140
     $sqladd = array();
141 141
     if ($_REQUEST['searchuser'] != 0) {
142
-        $sqladd[] = "internalKey='" . (int)$_REQUEST['searchuser'] . "'";
142
+        $sqladd[] = "internalKey='".(int) $_REQUEST['searchuser']."'";
143 143
     }
144 144
     if ($_REQUEST['action'] != 0) {
145
-        $sqladd[] = "action=" . (int)$_REQUEST['action'];
145
+        $sqladd[] = "action=".(int) $_REQUEST['action'];
146 146
     }
147 147
     if ($_REQUEST['itemid'] != 0 || $_REQUEST['itemid'] == "-") {
148
-        $sqladd[] = "itemid='" . $_REQUEST['itemid'] . "'";
148
+        $sqladd[] = "itemid='".$_REQUEST['itemid']."'";
149 149
     }
150 150
     if ($_REQUEST['itemname'] != '0') {
151
-        $sqladd[] = "itemname='" . $modx->getDatabase()->escape($_REQUEST['itemname']) . "'";
151
+        $sqladd[] = "itemname='".$modx->getDatabase()->escape($_REQUEST['itemname'])."'";
152 152
     }
153 153
     if ($_REQUEST['message'] != "") {
154
-        $sqladd[] = "message LIKE '%" . $modx->getDatabase()->escape($_REQUEST['message']) . "%'";
154
+        $sqladd[] = "message LIKE '%".$modx->getDatabase()->escape($_REQUEST['message'])."%'";
155 155
     }
156 156
     // date stuff
157 157
     if ($_REQUEST['datefrom'] != "") {
158
-        $sqladd[] = "timestamp>" . $modx->toTimeStamp($_REQUEST['datefrom']);
158
+        $sqladd[] = "timestamp>".$modx->toTimeStamp($_REQUEST['datefrom']);
159 159
     }
160 160
     if ($_REQUEST['dateto'] != "") {
161
-        $sqladd[] = "timestamp<" . $modx->toTimeStamp($_REQUEST['dateto']);
161
+        $sqladd[] = "timestamp<".$modx->toTimeStamp($_REQUEST['dateto']);
162 162
     }
163 163
 
164 164
     // If current position is not set, set it to zero
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
     // Number of result to display on the page, will be in the LIMIT of the sql query also
172 172
     $int_num_result = is_numeric($_REQUEST['nrresults']) ? $_REQUEST['nrresults'] : $number_of_logs;
173 173
 
174
-    $extargv = "&a=13&searchuser=" . $_REQUEST['searchuser'] . "&action=" . $_REQUEST['action'] . "&itemid=" . $_REQUEST['itemid'] . "&itemname=" . $_REQUEST['itemname'] . "&message=" . $_REQUEST['message'] . "&dateto=" . $_REQUEST['dateto'] . "&datefrom=" . $_REQUEST['datefrom'] . "&nrresults=" . $int_num_result . "&log_submit=" . $_REQUEST['log_submit']; // extra argv here (could be anything depending on your page)
174
+    $extargv = "&a=13&searchuser=".$_REQUEST['searchuser']."&action=".$_REQUEST['action']."&itemid=".$_REQUEST['itemid']."&itemname=".$_REQUEST['itemname']."&message=".$_REQUEST['message']."&dateto=".$_REQUEST['dateto']."&datefrom=".$_REQUEST['datefrom']."&nrresults=".$int_num_result."&log_submit=".$_REQUEST['log_submit']; // extra argv here (could be anything depending on your page)
175 175
 
176 176
     // build the sql
177 177
     $limit = $num_rows = $modx->getDatabase()->getValue($modx->getDatabase()->select('COUNT(*)', $modx->getDatabase()->getFullTableName('manager_log'), (!empty($sqladd) ? implode(' AND ', $sqladd) : '')));
@@ -179,9 +179,9 @@  discard block
 block discarded – undo
179 179
     $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('manager_log'), (!empty($sqladd) ? implode(' AND ', $sqladd) : ''), 'timestamp DESC, id DESC', "{$int_cur_position}, {$int_num_result}");
180 180
 
181 181
 if ($limit < 1) {
182
-    echo '<p>' . $_lang["mgrlog_emptysrch"] . '</p>';
182
+    echo '<p>'.$_lang["mgrlog_emptysrch"].'</p>';
183 183
 } else {
184
-    echo '<p>' . $_lang["mgrlog_sortinst"] . '</p>';
184
+    echo '<p>'.$_lang["mgrlog_sortinst"].'</p>';
185 185
 
186 186
     // New instance of the Paging class, you can modify the color and the width of the html table
187 187
     $p = new EvolutionCMS\Support\Paginate($num_rows, $int_cur_position, $int_num_result, $extargv);
@@ -192,11 +192,11 @@  discard block
 block discarded – undo
192 192
     $current_row = $int_cur_position / $int_num_result;
193 193
 
194 194
     // Display the result as you like...
195
-    print "<p>" . $_lang["paging_showing"] . " " . $array_paging['lower'];
196
-    print " " . $_lang["paging_to"] . " " . $array_paging['upper'];
197
-    print " (" . $array_paging['total'] . " " . $_lang["paging_total"] . ")<br />";
198
-    $paging = $array_paging['first_link'] . $_lang["paging_first"] . (isset($array_paging['first_link']) ? "</a> " : " ");
199
-    $paging .= $array_paging['previous_link'] . $_lang["paging_prev"] . (isset($array_paging['previous_link']) ? "</a> " : " ");
195
+    print "<p>".$_lang["paging_showing"]." ".$array_paging['lower'];
196
+    print " ".$_lang["paging_to"]." ".$array_paging['upper'];
197
+    print " (".$array_paging['total']." ".$_lang["paging_total"].")<br />";
198
+    $paging = $array_paging['first_link'].$_lang["paging_first"].(isset($array_paging['first_link']) ? "</a> " : " ");
199
+    $paging .= $array_paging['previous_link'].$_lang["paging_prev"].(isset($array_paging['previous_link']) ? "</a> " : " ");
200 200
     $pagesfound = sizeof($array_row_paging);
201 201
     if ($pagesfound > 6) {
202 202
         $paging .= $array_row_paging[$current_row - 2]; // ."&nbsp;";
@@ -206,11 +206,11 @@  discard block
 block discarded – undo
206 206
         $paging .= $array_row_paging[$current_row + 2]; // ."&nbsp;";
207 207
     } else {
208 208
         for ($i = 0; $i < $pagesfound; $i++) {
209
-            $paging .= $array_row_paging[$i] . "&nbsp;";
209
+            $paging .= $array_row_paging[$i]."&nbsp;";
210 210
         }
211 211
     }
212
-    $paging .= $array_paging['next_link'] . $_lang["paging_next"] . (isset($array_paging['next_link']) ? "</a> " : " ") . " ";
213
-    $paging .= $array_paging['last_link'] . $_lang["paging_last"] . (isset($array_paging['last_link']) ? "</a> " : " ") . " ";
212
+    $paging .= $array_paging['next_link'].$_lang["paging_next"].(isset($array_paging['next_link']) ? "</a> " : " ")." ";
213
+    $paging .= $array_paging['last_link'].$_lang["paging_last"].(isset($array_paging['last_link']) ? "</a> " : " ")." ";
214 214
     // The above exemple print somethings like:
215 215
     // Results 1 to 20 of 597  <<< 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 >>>
216 216
     // Of course you can now play with array_row_paging in order to print
@@ -246,16 +246,16 @@  discard block
 block discarded – undo
246 246
                     if (!preg_match("/^[0-9]+$/", $logentry['itemid'])) {
247 247
                         $item = '<div style="text-align:center;">-</div>';
248 248
                     } elseif ($logentry['action'] == 3 || $logentry['action'] == 27 || $logentry['action'] == 5) {
249
-                        $item = '<a href="index.php?a=3&amp;id=' . $logentry['itemid'] . '">' . $logentry['itemname'] . '</a>';
249
+                        $item = '<a href="index.php?a=3&amp;id='.$logentry['itemid'].'">'.$logentry['itemname'].'</a>';
250 250
                     } else {
251 251
                         $item = $logentry['itemname'];
252 252
                     }
253 253
                     //index.php?a=13&searchuser=' . $logentry['internalKey'] . '&action=' . $logentry['action'] . '&itemname=' . $logentry['itemname'] . '&log_submit=true'
254
-                    $user_drill = 'index.php?a=13&searchuser=' . $logentry['internalKey'] . '&itemname=0&log_submit=true';
254
+                    $user_drill = 'index.php?a=13&searchuser='.$logentry['internalKey'].'&itemname=0&log_submit=true';
255 255
                     ?>
256 256
                     <tr>
257
-                        <td><?= '<a href="' . $user_drill . '">' . $logentry['username'] . '</a>' ?></td>
258
-                        <td class="text-nowrap"><?= '[' . $logentry['action'] . '] ' . $logentry['message'] ?></td>
257
+                        <td><?= '<a href="'.$user_drill.'">'.$logentry['username'].'</a>' ?></td>
258
+                        <td class="text-nowrap"><?= '['.$logentry['action'].'] '.$logentry['message'] ?></td>
259 259
                         <td class="text-xs-right"><?= $logentry['itemid'] ?></td>
260 260
                         <td><?= $item ?></td>
261 261
                         <td class="text-nowrap"><?= $modx->toDateFormat($logentry['timestamp'] + $server_offset_time) ?></td>
Please login to merge, or discard this patch.
manager/actions/mutate_plugin_priority.dynamic.php 1 patch
Spacing   +8 added lines, -8 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
 if (!$modx->hasPermission('save_plugin')) {
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 $updateMsg = '';
12 12
 
13 13
 if (isset($_POST['listSubmitted'])) {
14
-    $updateMsg .= '<span class="text-success" id="updated">' . $_lang['sort_updated'] . '</span>';
14
+    $updateMsg .= '<span class="text-success" id="updated">'.$_lang['sort_updated'].'</span>';
15 15
     $tbl = $modx->getDatabase()->getFullTableName('site_plugin_events');
16 16
 
17 17
     foreach ($_POST as $listName => $listValue) {
@@ -34,9 +34,9 @@  discard block
 block discarded – undo
34 34
     $modx->clearCache('full');
35 35
 }
36 36
 
37
-$rs = $modx->getDatabase()->select("sysevt.name as evtname, sysevt.id as evtid, pe.pluginid, plugs.name, pe.priority, plugs.disabled", $modx->getDatabase()->getFullTableName('system_eventnames') . " sysevt
38
-		INNER JOIN " . $modx->getDatabase()->getFullTableName('site_plugin_events') . " pe ON pe.evtid = sysevt.id
39
-		INNER JOIN " . $modx->getDatabase()->getFullTableName('site_plugins') . " plugs ON plugs.id = pe.pluginid", '', 'sysevt.name,pe.priority');
37
+$rs = $modx->getDatabase()->select("sysevt.name as evtname, sysevt.id as evtid, pe.pluginid, plugs.name, pe.priority, plugs.disabled", $modx->getDatabase()->getFullTableName('system_eventnames')." sysevt
38
+		INNER JOIN " . $modx->getDatabase()->getFullTableName('site_plugin_events')." pe ON pe.evtid = sysevt.id
39
+		INNER JOIN " . $modx->getDatabase()->getFullTableName('site_plugins')." plugs ON plugs.id = pe.pluginid", '', 'sysevt.name,pe.priority');
40 40
 
41 41
 $insideUl = 0;
42 42
 $preEvt = '';
@@ -47,17 +47,17 @@  discard block
 block discarded – undo
47 47
     if ($preEvt !== $plugins['evtid']) {
48 48
         $sortables[] = $plugins['evtid'];
49 49
         $sortableList .= $insideUl ? '</ul></div>' : '';
50
-        $sortableList .= '<div class="form-group clearfix"><strong>' . $plugins['evtname'] . '</strong><ul id="' . $plugins['evtid'] . '" class="sortableList">';
50
+        $sortableList .= '<div class="form-group clearfix"><strong>'.$plugins['evtname'].'</strong><ul id="'.$plugins['evtid'].'" class="sortableList">';
51 51
         $insideUl = 1;
52 52
     }
53
-    $sortableList .= '<li id="item_' . $plugins['pluginid'] . '"' . ($plugins['disabled'] ? ' class="disabledPlugin"' : '') . '><i class="fa fa-plug"></i> ' . $plugins['name'] . ($plugins['disabled'] ? ' (hide)' : '') . '</li>';
53
+    $sortableList .= '<li id="item_'.$plugins['pluginid'].'"'.($plugins['disabled'] ? ' class="disabledPlugin"' : '').'><i class="fa fa-plug"></i> '.$plugins['name'].($plugins['disabled'] ? ' (hide)' : '').'</li>';
54 54
     $preEvt = $plugins['evtid'];
55 55
 }
56 56
 if ($insideUl) {
57 57
     $sortableList .= '</ul></div>';
58 58
 }
59 59
 
60
-require_once(MODX_MANAGER_PATH . 'includes/header.inc.php');
60
+require_once(MODX_MANAGER_PATH.'includes/header.inc.php');
61 61
 ?>
62 62
 
63 63
 <script type="text/javascript">
Please login to merge, or discard this patch.
manager/media/style/default/ajax.php 1 patch
Spacing   +99 added lines, -99 removed lines patch added patch discarded remove patch
@@ -18,11 +18,11 @@  discard block
 block discarded – undo
18 18
 $modx->sid = session_id();
19 19
 
20 20
 $_lang = array();
21
-include_once MODX_MANAGER_PATH . '/includes/lang/english.inc.php';
21
+include_once MODX_MANAGER_PATH.'/includes/lang/english.inc.php';
22 22
 if ($modx->config['manager_language'] != 'english') {
23
-    include_once MODX_MANAGER_PATH . '/includes/lang/' . $modx->config['manager_language'] . '.inc.php';
23
+    include_once MODX_MANAGER_PATH.'/includes/lang/'.$modx->config['manager_language'].'.inc.php';
24 24
 }
25
-include_once MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/style.php';
25
+include_once MODX_MANAGER_PATH.'/media/style/'.$modx->config['manager_theme'].'/style.php';
26 26
 
27 27
 $action = isset($_REQUEST['a']) ? $_REQUEST['a'] : '';
28 28
 $frame = isset($_REQUEST['f']) ? $_REQUEST['f'] : '';
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 
40 40
             switch ($frame) {
41 41
                 case 'nodes':
42
-                    include_once MODX_MANAGER_PATH . '/frames/nodes.php';
42
+                    include_once MODX_MANAGER_PATH.'/frames/nodes.php';
43 43
 
44 44
                     break;
45 45
             }
@@ -57,21 +57,21 @@  discard block
 block discarded – undo
57 57
                 $sql = '';
58 58
                 $a = '';
59 59
                 $filter = !empty($_REQUEST['filter']) && is_scalar($_REQUEST['filter']) ? addcslashes(trim($_REQUEST['filter']), '%*_') : '';
60
-                $sqlLike = $filter ? 'WHERE t1.name LIKE "' . $modx->getDatabase()->escape($filter) . '%"' : '';
61
-                $sqlLimit = $sqlLike ? '' : 'LIMIT ' . $limit;
60
+                $sqlLike = $filter ? 'WHERE t1.name LIKE "'.$modx->getDatabase()->escape($filter).'%"' : '';
61
+                $sqlLimit = $sqlLike ? '' : 'LIMIT '.$limit;
62 62
 
63 63
                 switch ($elements) {
64 64
                     case 'element_templates':
65 65
                         $a = 16;
66
-                        $sqlLike = $filter ? 'WHERE t1.templatename LIKE "' . $modx->getDatabase()->escape($filter) . '%"' : '';
66
+                        $sqlLike = $filter ? 'WHERE t1.templatename LIKE "'.$modx->getDatabase()->escape($filter).'%"' : '';
67 67
                         $sql = $modx->getDatabase()->query('SELECT t1.id, t1.templatename AS name, t1.locked, 0 AS disabled
68
-                        FROM ' . $modx->getDatabase()->getFullTableName('site_templates') . ' AS t1
69
-                        ' . $sqlLike . '
68
+                        FROM ' . $modx->getDatabase()->getFullTableName('site_templates').' AS t1
69
+                        ' . $sqlLike.'
70 70
                         ORDER BY t1.templatename ASC
71 71
                         ' . $sqlLimit);
72 72
 
73 73
                         if ($modx->hasPermission('new_template')) {
74
-                            $output .= '<li><a id="a_19" href="index.php?a=19" target="main"><i class="fa fa-plus"></i>' . $_lang['new_template'] . '</a></li>';
74
+                            $output .= '<li><a id="a_19" href="index.php?a=19" target="main"><i class="fa fa-plus"></i>'.$_lang['new_template'].'</a></li>';
75 75
                         }
76 76
 
77 77
                         break;
@@ -79,15 +79,15 @@  discard block
 block discarded – undo
79 79
                     case 'element_tplvars':
80 80
                         $a = 301;
81 81
                         $sql = $modx->getDatabase()->query('SELECT t1.id, t1.name, t1.locked, IF(MIN(t2.tmplvarid),0,1) AS disabled
82
-                        FROM ' . $modx->getDatabase()->getFullTableName('site_tmplvars') . ' AS t1
83
-                        LEFT JOIN ' . $modx->getDatabase()->getFullTableName('site_tmplvar_templates') . ' AS t2 ON t1.id=t2.tmplvarid
84
-                        ' . $sqlLike . '
82
+                        FROM ' . $modx->getDatabase()->getFullTableName('site_tmplvars').' AS t1
83
+                        LEFT JOIN ' . $modx->getDatabase()->getFullTableName('site_tmplvar_templates').' AS t2 ON t1.id=t2.tmplvarid
84
+                        ' . $sqlLike.'
85 85
                         GROUP BY t1.id
86 86
                         ORDER BY t1.name ASC
87 87
                         ' . $sqlLimit);
88 88
 
89 89
                         if ($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) {
90
-                            $output .= '<li><a id="a_300" href="index.php?a=300" target="main"><i class="fa fa-plus"></i>' . $_lang['new_tmplvars'] . '</a></li>';
90
+                            $output .= '<li><a id="a_300" href="index.php?a=300" target="main"><i class="fa fa-plus"></i>'.$_lang['new_tmplvars'].'</a></li>';
91 91
                         }
92 92
 
93 93
                         break;
@@ -95,13 +95,13 @@  discard block
 block discarded – undo
95 95
                     case 'element_htmlsnippets':
96 96
                         $a = 78;
97 97
                         $sql = $modx->getDatabase()->query('SELECT t1.id, t1.name, t1.locked, t1.disabled
98
-                        FROM ' . $modx->getDatabase()->getFullTableName('site_htmlsnippets') . ' AS t1
99
-                        ' . $sqlLike . '
98
+                        FROM ' . $modx->getDatabase()->getFullTableName('site_htmlsnippets').' AS t1
99
+                        ' . $sqlLike.'
100 100
                         ORDER BY t1.name ASC
101 101
                         ' . $sqlLimit);
102 102
 
103 103
                         if ($modx->hasPermission('new_chunk')) {
104
-                            $output .= '<li><a id="a_77" href="index.php?a=77" target="main"><i class="fa fa-plus"></i>' . $_lang['new_htmlsnippet'] . '</a></li>';
104
+                            $output .= '<li><a id="a_77" href="index.php?a=77" target="main"><i class="fa fa-plus"></i>'.$_lang['new_htmlsnippet'].'</a></li>';
105 105
                         }
106 106
 
107 107
                         break;
@@ -109,13 +109,13 @@  discard block
 block discarded – undo
109 109
                     case 'element_snippets':
110 110
                         $a = 22;
111 111
                         $sql = $modx->getDatabase()->query('SELECT t1.id, t1.name, t1.locked, t1.disabled
112
-                        FROM ' . $modx->getDatabase()->getFullTableName('site_snippets') . ' AS t1
113
-                        ' . $sqlLike . '
112
+                        FROM ' . $modx->getDatabase()->getFullTableName('site_snippets').' AS t1
113
+                        ' . $sqlLike.'
114 114
                         ORDER BY t1.name ASC
115 115
                         ' . $sqlLimit);
116 116
 
117 117
                         if ($modx->hasPermission('new_snippet')) {
118
-                            $output .= '<li><a id="a_23" href="index.php?a=23" target="main"><i class="fa fa-plus"></i>' . $_lang['new_snippet'] . '</a></li>';
118
+                            $output .= '<li><a id="a_23" href="index.php?a=23" target="main"><i class="fa fa-plus"></i>'.$_lang['new_snippet'].'</a></li>';
119 119
                         }
120 120
 
121 121
                         break;
@@ -123,13 +123,13 @@  discard block
 block discarded – undo
123 123
                     case 'element_plugins':
124 124
                         $a = 102;
125 125
                         $sql = $modx->getDatabase()->query('SELECT t1.id, t1.name, t1.locked, t1.disabled
126
-                        FROM ' . $modx->getDatabase()->getFullTableName('site_plugins') . ' AS t1
127
-                        ' . $sqlLike . '
126
+                        FROM ' . $modx->getDatabase()->getFullTableName('site_plugins').' AS t1
127
+                        ' . $sqlLike.'
128 128
                         ORDER BY t1.name ASC
129 129
                         ' . $sqlLimit);
130 130
 
131 131
                         if ($modx->hasPermission('new_plugin')) {
132
-                            $output .= '<li><a id="a_101" href="index.php?a=101" target="main"><i class="fa fa-plus"></i>' . $_lang['new_plugin'] . '</a></li>';
132
+                            $output .= '<li><a id="a_101" href="index.php?a=101" target="main"><i class="fa fa-plus"></i>'.$_lang['new_plugin'].'</a></li>';
133 133
                         }
134 134
 
135 135
                         break;
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
                             continue;
145 145
                         }
146 146
 
147
-                        $items .= '<li class="item ' . ($row['disabled'] ? 'disabled' : '') . ($row['locked'] ? ' locked' : '') . '"><a id="a_' . $a . '__id_' . $row['id'] . '" href="index.php?a=' . $a . '&id=' . $row['id'] . '" target="main" data-parent-id="a_76__elements_' . $elements . '">' . $row['name'] . ' <small>(' . $row['id'] . ')</small></a></li>' . "\n";
147
+                        $items .= '<li class="item '.($row['disabled'] ? 'disabled' : '').($row['locked'] ? ' locked' : '').'"><a id="a_'.$a.'__id_'.$row['id'].'" href="index.php?a='.$a.'&id='.$row['id'].'" target="main" data-parent-id="a_76__elements_'.$elements.'">'.$row['name'].' <small>('.$row['id'].')</small></a></li>'."\n";
148 148
                     }
149 149
                 }
150 150
 
@@ -165,23 +165,23 @@  discard block
 block discarded – undo
165 165
             $output = '';
166 166
             $items = '';
167 167
             $filter = !empty($_REQUEST['filter']) && is_scalar($_REQUEST['filter']) ? addcslashes(trim($_REQUEST['filter']), '\%*_') : '';
168
-            $sqlLike = $filter ? 'WHERE t1.username LIKE "' . $modx->getDatabase()->escape($filter) . '%"' : '';
169
-            $sqlLimit = $sqlLike ? '' : 'LIMIT ' . $limit;
168
+            $sqlLike = $filter ? 'WHERE t1.username LIKE "'.$modx->getDatabase()->escape($filter).'%"' : '';
169
+            $sqlLimit = $sqlLike ? '' : 'LIMIT '.$limit;
170 170
 
171
-            if(!$modx->hasPermission('save_role')) {
171
+            if (!$modx->hasPermission('save_role')) {
172 172
                 $sqlLike .= $sqlLike ? ' AND ' : 'WHERE ';
173 173
                 $sqlLike .= 't2.role != 1';
174 174
             }
175 175
 
176 176
             $sql = $modx->getDatabase()->query('SELECT t1.*, t1.username AS name, t2.blocked
177
-				FROM ' . $modx->getDatabase()->getFullTableName('manager_users') . ' AS t1
178
-				LEFT JOIN ' . $modx->getDatabase()->getFullTableName('user_attributes') . ' AS t2 ON t1.id=t2.internalKey
179
-				' . $sqlLike . '
177
+				FROM ' . $modx->getDatabase()->getFullTableName('manager_users').' AS t1
178
+				LEFT JOIN ' . $modx->getDatabase()->getFullTableName('user_attributes').' AS t2 ON t1.id=t2.internalKey
179
+				' . $sqlLike.'
180 180
 				ORDER BY t1.username ASC
181 181
 				' . $sqlLimit);
182 182
 
183 183
             if ($modx->hasPermission('new_user')) {
184
-                $output .= '<li><a id="a_11" href="index.php?a=11" target="main"><i class="fa fa-plus"></i>' . $_lang['new_user'] . '</a></li>';
184
+                $output .= '<li><a id="a_11" href="index.php?a=11" target="main"><i class="fa fa-plus"></i>'.$_lang['new_user'].'</a></li>';
185 185
             }
186 186
 
187 187
             if ($count = $modx->getDatabase()->getRecordCount($sql)) {
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
                     $output .= '<li class="item-input"><input type="text" name="filter" class="dropdown-item form-control form-control-sm" autocomplete="off" /></li>';
190 190
                 }
191 191
                 while ($row = $modx->getDatabase()->getRow($sql)) {
192
-                    $items .= '<li class="item ' . ($row['blocked'] ? 'disabled' : '') . '"><a id="a_' . $a . '__id_' . $row['id'] . '" href="index.php?a=' . $a . '&id=' . $row['id'] . '" target="main">' . $row['name'] . ' <small>(' . $row['id'] . ')</small></a></li>';
192
+                    $items .= '<li class="item '.($row['blocked'] ? 'disabled' : '').'"><a id="a_'.$a.'__id_'.$row['id'].'" href="index.php?a='.$a.'&id='.$row['id'].'" target="main">'.$row['name'].' <small>('.$row['id'].')</small></a></li>';
193 193
                 }
194 194
             }
195 195
 
@@ -209,18 +209,18 @@  discard block
 block discarded – undo
209 209
             $output = '';
210 210
             $items = '';
211 211
             $filter = !empty($_REQUEST['filter']) && is_scalar($_REQUEST['filter']) ? addcslashes(trim($_REQUEST['filter']), '\%*_') : '';
212
-            $sqlLike = $filter ? 'WHERE t1.username LIKE "' . $modx->getDatabase()->escape($filter) . '%"' : '';
213
-            $sqlLimit = $sqlLike ? '' : 'LIMIT ' . $limit;
212
+            $sqlLike = $filter ? 'WHERE t1.username LIKE "'.$modx->getDatabase()->escape($filter).'%"' : '';
213
+            $sqlLimit = $sqlLike ? '' : 'LIMIT '.$limit;
214 214
 
215 215
             $sql = $modx->getDatabase()->query('SELECT t1.*, t1.username AS name, t2.blocked
216
-				FROM ' . $modx->getDatabase()->getFullTableName('web_users') . ' AS t1
217
-				LEFT JOIN ' . $modx->getDatabase()->getFullTableName('web_user_attributes') . ' AS t2 ON t1.id=t2.internalKey
218
-				' . $sqlLike . '
216
+				FROM ' . $modx->getDatabase()->getFullTableName('web_users').' AS t1
217
+				LEFT JOIN ' . $modx->getDatabase()->getFullTableName('web_user_attributes').' AS t2 ON t1.id=t2.internalKey
218
+				' . $sqlLike.'
219 219
 				ORDER BY t1.username ASC
220 220
 				' . $sqlLimit);
221 221
 
222 222
             if ($modx->hasPermission('new_web_user')) {
223
-                $output .= '<li><a id="a_87" href="index.php?a=87" target="main"><i class="fa fa-plus"></i>' . $_lang['new_web_user'] . '</a></li>';
223
+                $output .= '<li><a id="a_87" href="index.php?a=87" target="main"><i class="fa fa-plus"></i>'.$_lang['new_web_user'].'</a></li>';
224 224
             }
225 225
 
226 226
             if ($count = $modx->getDatabase()->getRecordCount($sql)) {
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
                     $output .= '<li class="item-input"><input type="text" name="filter" class="dropdown-item form-control form-control-sm" autocomplete="off" /></li>';
229 229
                 }
230 230
                 while ($row = $modx->getDatabase()->getRow($sql)) {
231
-                    $items .= '<li class="item ' . ($row['blocked'] ? 'disabled' : '') . '"><a id="a_' . $a . '__id_' . $row['id'] . '" href="index.php?a=' . $a . '&id=' . $row['id'] . '" target="main">' . $row['name'] . ' <small>(' . $row['id'] . ')</small></a></li>';
231
+                    $items .= '<li class="item '.($row['blocked'] ? 'disabled' : '').'"><a id="a_'.$a.'__id_'.$row['id'].'" href="index.php?a='.$a.'&id='.$row['id'].'" target="main">'.$row['name'].' <small>('.$row['id'].')</small></a></li>';
232 232
                 }
233 233
             }
234 234
 
@@ -254,35 +254,35 @@  discard block
 block discarded – undo
254 254
                     case 'SnippetNoCache': {
255 255
 
256 256
                         $sql = $modx->getDatabase()->query('SELECT *
257
-						FROM ' . $modx->getDatabase()->getFullTableName('site_snippets') . '
258
-						WHERE name="' . $name . '"
257
+						FROM ' . $modx->getDatabase()->getFullTableName('site_snippets').'
258
+						WHERE name="' . $name.'"
259 259
 						LIMIT 1');
260 260
 
261 261
                         if ($modx->getDatabase()->getRecordCount($sql)) {
262 262
                             $row = $modx->getDatabase()->getRow($sql);
263 263
                             $contextmenu = array(
264 264
                                 'header' => array(
265
-                                    'innerHTML' => '<i class="fa fa-code"></i> ' . $row['name']
265
+                                    'innerHTML' => '<i class="fa fa-code"></i> '.$row['name']
266 266
                                 ),
267 267
                                 'item' => array(
268
-                                    'innerHTML' => '<i class="fa fa-pencil-square-o"></i> ' . $_lang['edit'],
269
-                                    'url' => "index.php?a=22&id=" . $row['id']
268
+                                    'innerHTML' => '<i class="fa fa-pencil-square-o"></i> '.$_lang['edit'],
269
+                                    'url' => "index.php?a=22&id=".$row['id']
270 270
                                 )
271 271
                             );
272 272
                             if (!empty($row['description'])) {
273 273
                                 $contextmenu['seperator'] = '';
274 274
                                 $contextmenu['description'] = array(
275
-                                    'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description']
275
+                                    'innerHTML' => '<i class="fa fa-info"></i> '.$row['description']
276 276
                                 );
277 277
                             }
278 278
                         } else {
279 279
                             $contextmenu = array(
280 280
                                 'header' => array(
281
-                                    'innerHTML' => '<i class="fa fa-code"></i> ' . $name
281
+                                    'innerHTML' => '<i class="fa fa-code"></i> '.$name
282 282
                                 ),
283 283
                                 'item' => array(
284
-                                    'innerHTML' => '<i class="fa fa-plus"></i> ' . $_lang['new_snippet'],
285
-                                    'url' => "index.php?a=23&itemname=" . $name
284
+                                    'innerHTML' => '<i class="fa fa-plus"></i> '.$_lang['new_snippet'],
285
+                                    'url' => "index.php?a=23&itemname=".$name
286 286
                                 )
287 287
                             );
288 288
                         }
@@ -292,35 +292,35 @@  discard block
 block discarded – undo
292 292
                     case 'Chunk' : {
293 293
 
294 294
                         $sql = $modx->getDatabase()->query('SELECT *
295
-						FROM ' . $modx->getDatabase()->getFullTableName('site_htmlsnippets') . '
296
-						WHERE name="' . $name . '"
295
+						FROM ' . $modx->getDatabase()->getFullTableName('site_htmlsnippets').'
296
+						WHERE name="' . $name.'"
297 297
 						LIMIT 1');
298 298
 
299 299
                         if ($modx->getDatabase()->getRecordCount($sql)) {
300 300
                             $row = $modx->getDatabase()->getRow($sql);
301 301
                             $contextmenu = array(
302 302
                                 'header' => array(
303
-                                    'innerHTML' => '<i class="fa fa-th-large"></i> ' . $row['name']
303
+                                    'innerHTML' => '<i class="fa fa-th-large"></i> '.$row['name']
304 304
                                 ),
305 305
                                 'item' => array(
306
-                                    'innerHTML' => '<i class="fa fa-pencil-square-o"></i> ' . $_lang['edit'],
307
-                                    'url' => "index.php?a=78&id=" . $row['id']
306
+                                    'innerHTML' => '<i class="fa fa-pencil-square-o"></i> '.$_lang['edit'],
307
+                                    'url' => "index.php?a=78&id=".$row['id']
308 308
                                 )
309 309
                             );
310 310
                             if (!empty($row['description'])) {
311 311
                                 $contextmenu['seperator'] = '';
312 312
                                 $contextmenu['description'] = array(
313
-                                    'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description']
313
+                                    'innerHTML' => '<i class="fa fa-info"></i> '.$row['description']
314 314
                                 );
315 315
                             }
316 316
                         } else {
317 317
                             $contextmenu = array(
318 318
                                 'header' => array(
319
-                                    'innerHTML' => '<i class="fa fa-th-large"></i> ' . $name
319
+                                    'innerHTML' => '<i class="fa fa-th-large"></i> '.$name
320 320
                                 ),
321 321
                                 'item' => array(
322
-                                    'innerHTML' => '<i class="fa fa-plus"></i> ' . $_lang['new_htmlsnippet'],
323
-                                    'url' => "index.php?a=77&itemname=" . $name
322
+                                    'innerHTML' => '<i class="fa fa-plus"></i> '.$_lang['new_htmlsnippet'],
323
+                                    'url' => "index.php?a=77&itemname=".$name
324 324
                                 )
325 325
                             );
326 326
                         }
@@ -329,8 +329,8 @@  discard block
 block discarded – undo
329 329
                     }
330 330
                     case 'AttributeValue': {
331 331
                         $sql = $modx->getDatabase()->query('SELECT *
332
-						FROM ' . $modx->getDatabase()->getFullTableName('site_htmlsnippets') . '
333
-						WHERE name="' . $name . '"
332
+						FROM ' . $modx->getDatabase()->getFullTableName('site_htmlsnippets').'
333
+						WHERE name="' . $name.'"
334 334
 						LIMIT 1');
335 335
 
336 336
                         if ($modx->getDatabase()->getRecordCount($sql)) {
@@ -340,52 +340,52 @@  discard block
 block discarded – undo
340 340
                                     'innerText' => $row['name']
341 341
                                 ),
342 342
                                 'item' => array(
343
-                                    'innerHTML' => '<i class="fa fa-pencil-square-o"></i> ' . $_lang['edit'],
344
-                                    'url' => "index.php?a=78&id=" . $row['id']
343
+                                    'innerHTML' => '<i class="fa fa-pencil-square-o"></i> '.$_lang['edit'],
344
+                                    'url' => "index.php?a=78&id=".$row['id']
345 345
                                 )
346 346
                             );
347 347
                             if (!empty($row['description'])) {
348 348
                                 $contextmenu['seperator'] = '';
349 349
                                 $contextmenu['description'] = array(
350
-                                    'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description']
350
+                                    'innerHTML' => '<i class="fa fa-info"></i> '.$row['description']
351 351
                                 );
352 352
                             }
353 353
                         } else {
354 354
 
355 355
                             $sql = $modx->getDatabase()->query('SELECT *
356
-							FROM ' . $modx->getDatabase()->getFullTableName('site_snippets') . '
357
-							WHERE name="' . $name . '"
356
+							FROM ' . $modx->getDatabase()->getFullTableName('site_snippets').'
357
+							WHERE name="' . $name.'"
358 358
 							LIMIT 1');
359 359
 
360 360
                             if ($modx->getDatabase()->getRecordCount($sql)) {
361 361
                                 $row = $modx->getDatabase()->getRow($sql);
362 362
                                 $contextmenu = array(
363 363
                                     'header' => array(
364
-                                        'innerHTML' => '<i class="fa fa-code"></i> ' . $row['name']
364
+                                        'innerHTML' => '<i class="fa fa-code"></i> '.$row['name']
365 365
                                     ),
366 366
                                     'item' => array(
367
-                                        'innerHTML' => '<i class="fa fa-pencil-square-o"></i> ' . $_lang['edit'],
368
-                                        'url' => "index.php?a=22&id=" . $row['id']
367
+                                        'innerHTML' => '<i class="fa fa-pencil-square-o"></i> '.$_lang['edit'],
368
+                                        'url' => "index.php?a=22&id=".$row['id']
369 369
                                     )
370 370
                                 );
371 371
                                 if (!empty($row['description'])) {
372 372
                                     $contextmenu['seperator'] = '';
373 373
                                     $contextmenu['description'] = array(
374
-                                        'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description']
374
+                                        'innerHTML' => '<i class="fa fa-info"></i> '.$row['description']
375 375
                                     );
376 376
                                 }
377 377
                             } else {
378 378
                                 $contextmenu = array(
379 379
                                     'header' => array(
380
-                                        'innerHTML' => '<i class="fa fa-code"></i> ' . $name
380
+                                        'innerHTML' => '<i class="fa fa-code"></i> '.$name
381 381
                                     ),
382 382
                                     'item' => array(
383
-                                        'innerHTML' => '<i class="fa fa-plus"></i> ' . $_lang['new_htmlsnippet'],
384
-                                        'url' => "index.php?a=77&itemname=" . $name
383
+                                        'innerHTML' => '<i class="fa fa-plus"></i> '.$_lang['new_htmlsnippet'],
384
+                                        'url' => "index.php?a=77&itemname=".$name
385 385
                                     ),
386 386
                                     'item2' => array(
387
-                                        'innerHTML' => '<i class="fa fa-plus"></i> ' . $_lang['new_snippet'],
388
-                                        'url' => "index.php?a=23&itemname=" . $name
387
+                                        'innerHTML' => '<i class="fa fa-plus"></i> '.$_lang['new_snippet'],
388
+                                        'url' => "index.php?a=23&itemname=".$name
389 389
                                     )
390 390
                                 );
391 391
                             }
@@ -441,35 +441,35 @@  discard block
 block discarded – undo
441 441
                         }
442 442
 
443 443
                         $sql = $modx->getDatabase()->query('SELECT *
444
-						FROM ' . $modx->getDatabase()->getFullTableName('site_tmplvars') . '
445
-						WHERE name="' . $name . '"
444
+						FROM ' . $modx->getDatabase()->getFullTableName('site_tmplvars').'
445
+						WHERE name="' . $name.'"
446 446
 						LIMIT 1');
447 447
 
448 448
                         if ($modx->getDatabase()->getRecordCount($sql)) {
449 449
                             $row = $modx->getDatabase()->getRow($sql);
450 450
                             $contextmenu = array(
451 451
                                 'header' => array(
452
-                                    'innerHTML' => '<i class="fa fa-list-alt"></i> ' . $row['name']
452
+                                    'innerHTML' => '<i class="fa fa-list-alt"></i> '.$row['name']
453 453
                                 ),
454 454
                                 'item' => array(
455
-                                    'innerHTML' => '<i class="fa fa-pencil-square-o"></i> ' . $_lang['edit'],
456
-                                    'url' => "index.php?a=301&id=" . $row['id']
455
+                                    'innerHTML' => '<i class="fa fa-pencil-square-o"></i> '.$_lang['edit'],
456
+                                    'url' => "index.php?a=301&id=".$row['id']
457 457
                                 )
458 458
                             );
459 459
                             if (!empty($row['description'])) {
460 460
                                 $contextmenu['seperator'] = '';
461 461
                                 $contextmenu['description'] = array(
462
-                                    'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description']
462
+                                    'innerHTML' => '<i class="fa fa-info"></i> '.$row['description']
463 463
                                 );
464 464
                             }
465 465
                         } else {
466 466
                             $contextmenu = array(
467 467
                                 'header' => array(
468
-                                    'innerHTML' => '<i class="fa fa-list-alt"></i> ' . $name
468
+                                    'innerHTML' => '<i class="fa fa-list-alt"></i> '.$name
469 469
                                 ),
470 470
                                 'item' => array(
471
-                                    'innerHTML' => '<i class="fa fa-plus"></i> ' . $_lang['new_tmplvars'],
472
-                                    'url' => "index.php?a=300&itemname=" . $name
471
+                                    'innerHTML' => '<i class="fa fa-plus"></i> '.$_lang['new_tmplvars'],
472
+                                    'url' => "index.php?a=300&itemname=".$name
473 473
                                 )
474 474
                             );
475 475
                         }
@@ -488,15 +488,15 @@  discard block
 block discarded – undo
488 488
             $json = array();
489 489
 
490 490
             if ($modx->hasPermission('new_document') && $modx->hasPermission('edit_document') && $modx->hasPermission('save_document')) {
491
-                $id = !empty($_REQUEST['id']) ? (int)$_REQUEST['id'] : '';
492
-                $parent = isset($_REQUEST['parent']) ? (int)$_REQUEST['parent'] : 0;
491
+                $id = !empty($_REQUEST['id']) ? (int) $_REQUEST['id'] : '';
492
+                $parent = isset($_REQUEST['parent']) ? (int) $_REQUEST['parent'] : 0;
493 493
                 $menuindex = isset($_REQUEST['menuindex']) && is_scalar($_REQUEST['menuindex']) ? $_REQUEST['menuindex'] : 0;
494 494
 
495 495
                 // set parent
496 496
                 if ($id && $parent >= 0) {
497 497
 
498 498
                     // find older parent
499
-                    $parentOld = $modx->getDatabase()->getValue($modx->getDatabase()->select('parent', $modx->getDatabase()->getFullTableName('site_content'), 'id=' . $id));
499
+                    $parentOld = $modx->getDatabase()->getValue($modx->getDatabase()->select('parent', $modx->getDatabase()->getFullTableName('site_content'), 'id='.$id));
500 500
 
501 501
                     $eventOut = $modx->invokeEvent('onBeforeMoveDocument', [
502 502
                         'id_document' => $id,
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
                     if (empty($json['errors'])) {
518 518
                         // check privileges user for move docs
519 519
                         if (!empty($modx->config['tree_show_protected']) && $role != 1) {
520
-                            $sql = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('document_groups'), 'document IN(' . $id . ',' . $parent . ',' . $parentOld . ')');
520
+                            $sql = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('document_groups'), 'document IN('.$id.','.$parent.','.$parentOld.')');
521 521
                             if ($modx->getDatabase()->getRecordCount($sql)) {
522 522
                                 $document_groups = array();
523 523
                                 while ($row = $modx->getDatabase()->getRow($sql)) {
@@ -542,22 +542,22 @@  discard block
 block discarded – undo
542 542
                             // set new parent
543 543
                             $modx->getDatabase()->update(array(
544 544
                                 'parent' => $parent
545
-                            ), $modx->getDatabase()->getFullTableName('site_content'), 'id=' . $id);
545
+                            ), $modx->getDatabase()->getFullTableName('site_content'), 'id='.$id);
546 546
                             // set parent isfolder = 1
547 547
                             $modx->getDatabase()->update(array(
548 548
                                 'isfolder' => 1
549
-                            ), $modx->getDatabase()->getFullTableName('site_content'), 'id=' . $parent);
549
+                            ), $modx->getDatabase()->getFullTableName('site_content'), 'id='.$parent);
550 550
 
551 551
                             if ($parent != $parentOld) {
552 552
                                 // check children docs and set parent isfolder
553
-                                if ($modx->getDatabase()->getRecordCount($modx->getDatabase()->select('id', $modx->getDatabase()->getFullTableName('site_content'), 'parent=' . $parentOld))) {
553
+                                if ($modx->getDatabase()->getRecordCount($modx->getDatabase()->select('id', $modx->getDatabase()->getFullTableName('site_content'), 'parent='.$parentOld))) {
554 554
                                     $modx->getDatabase()->update(array(
555 555
                                         'isfolder' => 1
556
-                                    ), $modx->getDatabase()->getFullTableName('site_content'), 'id=' . $parentOld);
556
+                                    ), $modx->getDatabase()->getFullTableName('site_content'), 'id='.$parentOld);
557 557
                                 } else {
558 558
                                     $modx->getDatabase()->update(array(
559 559
                                         'isfolder' => 0
560
-                                    ), $modx->getDatabase()->getFullTableName('site_content'), 'id=' . $parentOld);
560
+                                    ), $modx->getDatabase()->getFullTableName('site_content'), 'id='.$parentOld);
561 561
                                 }
562 562
                             }
563 563
 
@@ -565,7 +565,7 @@  discard block
 block discarded – undo
565 565
                             if (!empty($menuindex)) {
566 566
                                 $menuindex = explode(',', $menuindex);
567 567
                                 foreach ($menuindex as $key => $value) {
568
-                                    $modx->getDatabase()->query('UPDATE ' . $modx->getDatabase()->getFullTableName('site_content') . ' SET menuindex=' . $key . ' WHERE id=' . $value);
568
+                                    $modx->getDatabase()->query('UPDATE '.$modx->getDatabase()->getFullTableName('site_content').' SET menuindex='.$key.' WHERE id='.$value);
569 569
                                 }
570 570
                             } else {
571 571
                                 // TODO: max(*) menuindex
@@ -594,19 +594,19 @@  discard block
 block discarded – undo
594 594
         }
595 595
 
596 596
         case 'getLockedElements': {
597
-            $type = isset($_REQUEST['type']) ? (int)$_REQUEST['type'] : 0;
598
-            $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
597
+            $type = isset($_REQUEST['type']) ? (int) $_REQUEST['type'] : 0;
598
+            $id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0;
599 599
 
600 600
             $output = !!$modx->elementIsLocked($type, $id, true);
601 601
 
602 602
             if (!$output) {
603 603
                 $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(',', $_SESSION['mgrDocgroups']) : '';
604
-                $docgrp_cond = $docgrp ? ' OR dg.document_group IN (' . $docgrp . ')' : '';
604
+                $docgrp_cond = $docgrp ? ' OR dg.document_group IN ('.$docgrp.')' : '';
605 605
                 $sql = '
606
-                    SELECT MAX(IF(1=' . $role . ' OR sc.privatemgr=0' . $docgrp_cond . ', 0, 1)) AS locked
607
-                    FROM ' . $modx->getDatabase()->getFullTableName('site_content') . ' AS sc 
608
-                    LEFT JOIN ' . $modx->getDatabase()->getFullTableName('document_groups') . ' dg ON dg.document=sc.id
609
-                    WHERE sc.id=' . $id . ' GROUP BY sc.id';
606
+                    SELECT MAX(IF(1=' . $role.' OR sc.privatemgr=0'.$docgrp_cond.', 0, 1)) AS locked
607
+                    FROM ' . $modx->getDatabase()->getFullTableName('site_content').' AS sc 
608
+                    LEFT JOIN ' . $modx->getDatabase()->getFullTableName('document_groups').' dg ON dg.document=sc.id
609
+                    WHERE sc.id=' . $id.' GROUP BY sc.id';
610 610
                 $sql = $modx->getDatabase()->query($sql);
611 611
                 if ($modx->getDatabase()->getRecordCount($sql)) {
612 612
                     $row = $modx->getDatabase()->getRow($sql);
Please login to merge, or discard this patch.
manager/includes/user_settings.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
 if (!empty($user_id)) {
15 15
     // Raymond: grab the user settings from the database.
16 16
     $rs = $modx->getDatabase()->select('setting_name, setting_value', $modx->getDatabase()->getFullTableName('user_settings'),
17
-        "user=" . $modx->getLoginUserID());
17
+        "user=".$modx->getLoginUserID());
18 18
 
19 19
     $which_browser_default = $which_browser;
20 20
     while ($row = $modx->getDatabase()->getRow($rs)) {
Please login to merge, or discard this patch.
manager/includes/secure_mgr_documents.inc.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -20,14 +20,14 @@
 block discarded – undo
20 20
         ($docid > 0 ? "id='$docid'" : "privatemgr = 1"));
21 21
     $rs = $modx->getDatabase()->select(
22 22
         'DISTINCT sc.id',
23
-        $modx->getDatabase()->getFullTableName("site_content") . " sc
24
-			LEFT JOIN " . $modx->getDatabase()->getFullTableName("document_groups") . " dg ON dg.document = sc.id
25
-			LEFT JOIN " . $modx->getDatabase()->getFullTableName("membergroup_access") . " mga ON mga.documentgroup = dg.document_group",
26
-        ($docid > 0 ? " sc.id='{$docid}' AND " : "") . "mga.id>0"
23
+        $modx->getDatabase()->getFullTableName("site_content")." sc
24
+			LEFT JOIN " . $modx->getDatabase()->getFullTableName("document_groups")." dg ON dg.document = sc.id
25
+			LEFT JOIN " . $modx->getDatabase()->getFullTableName("membergroup_access")." mga ON mga.documentgroup = dg.document_group",
26
+        ($docid > 0 ? " sc.id='{$docid}' AND " : "")."mga.id>0"
27 27
     );
28 28
     $ids = $modx->getDatabase()->getColumn("id", $rs);
29 29
     if (count($ids) > 0) {
30 30
         $modx->getDatabase()->update('privatemgr = 1', $modx->getDatabase()->getFullTableName("site_content"),
31
-            "id IN (" . implode(", ", $ids) . ")");
31
+            "id IN (".implode(", ", $ids).")");
32 32
     }
33 33
 }
Please login to merge, or discard this patch.
manager/includes/messageCount.inc.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -4,15 +4,15 @@
 block discarded – undo
4 4
 }
5 5
 
6 6
 $rs = $modx->getDatabase()->select('COUNT(*)', $modx->getDatabase()->getFullTableName('user_messages'),
7
-    "recipient=" . $modx->getLoginUserID() . " AND messageread=0");
7
+    "recipient=".$modx->getLoginUserID()." AND messageread=0");
8 8
 $nrnewmessages = $modx->getDatabase()->getValue($rs);
9
-$rs = $modx->getDatabase()->select('COUNT(*)', $modx->getDatabase()->getFullTableName('user_messages'), "recipient=" . $modx->getLoginUserID());
9
+$rs = $modx->getDatabase()->select('COUNT(*)', $modx->getDatabase()->getFullTableName('user_messages'), "recipient=".$modx->getLoginUserID());
10 10
 $nrtotalmessages = $modx->getDatabase()->getValue($rs);
11 11
 $messagesallowed = $modx->hasPermission('messages');
12 12
 
13 13
 // ajax response
14 14
 if (isset($_POST['updateMsgCount'])) {
15 15
     header("Content-Type: application/json; charset=utf-8");
16
-    print $nrnewmessages . ',' . $nrtotalmessages;
16
+    print $nrnewmessages.','.$nrtotalmessages;
17 17
     exit;
18 18
 }
Please login to merge, or discard this patch.
manager/includes/src/Cache.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
         if (isset($this->aliases[$id])) {
101 101
             if ($this->aliasVisible[$id] == 1) {
102 102
                 if ($path != '') {
103
-                    $path = $this->aliases[$id] . '/' . $path;
103
+                    $path = $this->aliases[$id].'/'.$path;
104 104
                 } else {
105 105
                     $path = $this->aliases[$id];
106 106
                 }
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
             $modx->messageQuit("Cache path not set.");
125 125
         }
126 126
 
127
-        $files = glob(realpath($this->cachePath) . '/*.pageCache.php');
127
+        $files = glob(realpath($this->cachePath).'/*.pageCache.php');
128 128
         $filesincache = count($files);
129 129
         $deletedfiles = array();
130 130
         while ($file = array_shift($files)) {
@@ -159,9 +159,9 @@  discard block
 block discarded – undo
159 159
                 if (isset($opcache)) {
160 160
                     echo '<p>Opcache empty.</p>';
161 161
                 }
162
-                echo '<p>' . $_lang['cache_files_deleted'] . '</p><ul>';
162
+                echo '<p>'.$_lang['cache_files_deleted'].'</p><ul>';
163 163
                 foreach ($deletedfiles as $deletedfile) {
164
-                    echo '<li>' . $deletedfile . '</li>';
164
+                    echo '<li>'.$deletedfile.'</li>';
165 165
                 }
166 166
                 echo '</ul>';
167 167
             }
@@ -180,11 +180,11 @@  discard block
 block discarded – undo
180 180
 
181 181
 
182 182
         // write the file
183
-        $content = '<?php' . "\n";
184
-        $content .= '$recent_update=\'' . $this->request_time . '\';' . "\n";
185
-        $content .= '$cacheRefreshTime=\'' . $cacheRefreshTime . '\';' . "\n";
183
+        $content = '<?php'."\n";
184
+        $content .= '$recent_update=\''.$this->request_time.'\';'."\n";
185
+        $content .= '$cacheRefreshTime=\''.$cacheRefreshTime.'\';'."\n";
186 186
 
187
-        $filename = $this->cachePath . '/sitePublishing.idx.php';
187
+        $filename = $this->cachePath.'/sitePublishing.idx.php';
188 188
         if (!$handle = fopen($filename, 'w')) {
189 189
             exit("Cannot open file ({$filename}");
190 190
         }
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
         $result = $modx->getDatabase()->select(
211 211
             'MIN(pub_date) AS minpub',
212 212
             $modx->getDatabase()->getFullTableName('site_content'),
213
-            'pub_date>' . $this->request_time
213
+            'pub_date>'.$this->request_time
214 214
         );
215 215
         if (!$result) {
216 216
             echo "Couldn't determine next publish event!";
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
         $result = $modx->getDatabase()->select(
225 225
             'MIN(unpub_date) AS minunpub',
226 226
             $modx->getDatabase()->getFullTableName('site_content'),
227
-            'unpub_date>' . $this->request_time
227
+            'unpub_date>'.$this->request_time
228 228
         );
229 229
         if (!$result) {
230 230
             echo "Couldn't determine next unpublish event!";
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
         $config = array();
265 265
         $content .= '$c=&$this->config;';
266 266
         while (list($key, $value) = $modx->getDatabase()->getRow($rs, 'num')) {
267
-            $content .= '$c[\'' . $key . '\']="' . $this->escapeDoubleQuotes($value) . '";';
267
+            $content .= '$c[\''.$key.'\']="'.$this->escapeDoubleQuotes($value).'";';
268 268
             $config[$key] = $value;
269 269
         }
270 270
 
@@ -285,8 +285,8 @@  discard block
 block discarded – undo
285 285
             $f['isfolder'] = 'c.isfolder';
286 286
             $f['alias_visible'] = 'c.alias_visible';
287 287
             $from = array();
288
-            $from[] = $modx->getDatabase()->getFullTableName('site_content') . ' c';
289
-            $from[] = 'LEFT JOIN ' . $modx->getDatabase()->getFullTableName('site_content') . ' p ON p.id=c.parent';
288
+            $from[] = $modx->getDatabase()->getFullTableName('site_content').' c';
289
+            $from[] = 'LEFT JOIN '.$modx->getDatabase()->getFullTableName('site_content').' p ON p.id=c.parent';
290 290
             $where = 'c.deleted=0 AND (c.isfolder=1 OR p.alias_visible=0)';
291 291
             $rs = $modx->getDatabase()->select($f, $from, $where, 'c.parent, c.menuindex');
292 292
         } else {
@@ -308,16 +308,16 @@  discard block
 block discarded – undo
308 308
             $docid = $doc['id'];
309 309
             if ($use_alias_path) {
310 310
                 $tmpPath = $this->getParents($doc['parent']);
311
-                $alias = (strlen($tmpPath) > 0 ? "$tmpPath/" : '') . $doc['alias'];
311
+                $alias = (strlen($tmpPath) > 0 ? "$tmpPath/" : '').$doc['alias'];
312 312
                 $key = $alias;
313 313
             } else {
314 314
                 $key = $doc['alias'];
315 315
             }
316 316
 
317 317
             $doc['path'] = $tmpPath;
318
-            $content .= '$a[' . $docid . ']=array(\'id\'=>' . $docid . ',\'alias\'=>\'' . $doc['alias'] . '\',\'path\'=>\'' . $doc['path'] . '\',\'parent\'=>' . $doc['parent'] . ',\'isfolder\'=>' . $doc['isfolder'] . ',\'alias_visible\'=>' . $doc['alias_visible'] . ');';
319
-            $content .= '$d[\'' . $key . '\']=' . $docid . ';';
320
-            $content .= '$m[]=array(' . $doc['parent'] . '=>' . $docid . ');';
318
+            $content .= '$a['.$docid.']=array(\'id\'=>'.$docid.',\'alias\'=>\''.$doc['alias'].'\',\'path\'=>\''.$doc['path'].'\',\'parent\'=>'.$doc['parent'].',\'isfolder\'=>'.$doc['isfolder'].',\'alias_visible\'=>'.$doc['alias_visible'].');';
319
+            $content .= '$d[\''.$key.'\']='.$docid.';';
320
+            $content .= '$m[]=array('.$doc['parent'].'=>'.$docid.');';
321 321
         }
322 322
 
323 323
         // get content types
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
         );
329 329
         $content .= '$c=&$this->contentTypes;';
330 330
         while ($doc = $modx->getDatabase()->getRow($rs)) {
331
-            $content .= '$c[\'' . $doc['id'] . '\']=\'' . $doc['contentType'] . '\';';
331
+            $content .= '$c[\''.$doc['id'].'\']=\''.$doc['contentType'].'\';';
332 332
         }
333 333
 
334 334
         // WRITE Chunks to cache file
@@ -338,30 +338,30 @@  discard block
 block discarded – undo
338 338
             if ($modx->config['minifyphp_incache']) {
339 339
                 $doc['snippet'] = $this->php_strip_whitespace($doc['snippet']);
340 340
             }
341
-            $content .= '$c[\'' . $doc['name'] . '\']=\'' . ($doc['disabled'] ? '' : $this->escapeSingleQuotes($doc['snippet'])) . '\';';
341
+            $content .= '$c[\''.$doc['name'].'\']=\''.($doc['disabled'] ? '' : $this->escapeSingleQuotes($doc['snippet'])).'\';';
342 342
         }
343 343
 
344 344
         // WRITE snippets to cache file
345 345
         $f = 'ss.*, sm.properties as sharedproperties';
346
-        $from = $modx->getDatabase()->getFullTableName('site_snippets') . ' ss LEFT JOIN ' .
347
-            $modx->getDatabase()->getFullTableName('site_modules') . ' sm on sm.guid=ss.moduleguid';
346
+        $from = $modx->getDatabase()->getFullTableName('site_snippets').' ss LEFT JOIN '.
347
+            $modx->getDatabase()->getFullTableName('site_modules').' sm on sm.guid=ss.moduleguid';
348 348
         $rs = $modx->getDatabase()->select($f, $from);
349 349
         $content .= '$s=&$this->snippetCache;';
350 350
         while ($row = $modx->getDatabase()->getRow($rs)) {
351 351
             $key = $row['name'];
352 352
             if ($row['disabled']) {
353
-                $content .= '$s[\'' . $key . '\']=\'return false;\';';
353
+                $content .= '$s[\''.$key.'\']=\'return false;\';';
354 354
             } else {
355 355
                 $value = trim($row['snippet']);
356 356
                 if ($modx->config['minifyphp_incache']) {
357 357
                     $value = $this->php_strip_whitespace($value);
358 358
                 }
359
-                $content .= '$s[\'' . $key . '\']=\'' . $this->escapeSingleQuotes($value) . '\';';
359
+                $content .= '$s[\''.$key.'\']=\''.$this->escapeSingleQuotes($value).'\';';
360 360
                 $properties = $modx->parseProperties($row['properties']);
361 361
                 $sharedproperties = $modx->parseProperties($row['sharedproperties']);
362 362
                 $properties = array_merge($sharedproperties, $properties);
363 363
                 if (0 < count($properties)) {
364
-                    $content .= '$s[\'' . $key . 'Props\']=\'' . $this->escapeSingleQuotes(json_encode($properties)) . '\';';
364
+                    $content .= '$s[\''.$key.'Props\']=\''.$this->escapeSingleQuotes(json_encode($properties)).'\';';
365 365
                 }
366 366
             }
367 367
         }
@@ -369,8 +369,8 @@  discard block
 block discarded – undo
369 369
         // WRITE plugins to cache file
370 370
         $f = 'sp.*, sm.properties as sharedproperties';
371 371
         $from = array();
372
-        $from[] = $modx->getDatabase()->getFullTableName('site_plugins') . ' sp';
373
-        $from[] = 'LEFT JOIN ' . $modx->getDatabase()->getFullTableName('site_modules') . ' sm on sm.guid=sp.moduleguid';
372
+        $from[] = $modx->getDatabase()->getFullTableName('site_plugins').' sp';
373
+        $from[] = 'LEFT JOIN '.$modx->getDatabase()->getFullTableName('site_modules').' sm on sm.guid=sp.moduleguid';
374 374
         $rs = $modx->getDatabase()->select($f, $from, 'sp.disabled=0');
375 375
         $content .= '$p=&$this->pluginCache;';
376 376
         while ($row = $modx->getDatabase()->getRow($rs)) {
@@ -379,13 +379,13 @@  discard block
 block discarded – undo
379 379
             if ($modx->config['minifyphp_incache']) {
380 380
                 $value = $this->php_strip_whitespace($value);
381 381
             }
382
-            $content .= '$p[\'' . $key . '\']=\'' . $this->escapeSingleQuotes($value) . '\';';
382
+            $content .= '$p[\''.$key.'\']=\''.$this->escapeSingleQuotes($value).'\';';
383 383
             if ($row['properties'] != '' || $row['sharedproperties'] != '') {
384 384
                 $properties = $modx->parseProperties($row['properties']);
385 385
                 $sharedproperties = $modx->parseProperties($row['sharedproperties']);
386 386
                 $properties = array_merge($sharedproperties, $properties);
387 387
                 if (0 < count($properties)) {
388
-                    $content .= '$p[\'' . $key . 'Props\']=\'' . $this->escapeSingleQuotes(json_encode($properties)) . '\';';
388
+                    $content .= '$p[\''.$key.'Props\']=\''.$this->escapeSingleQuotes(json_encode($properties)).'\';';
389 389
                 }
390 390
             }
391 391
         }
@@ -393,9 +393,9 @@  discard block
 block discarded – undo
393 393
         // WRITE system event triggers
394 394
         $f = 'sysevt.name as evtname, event.pluginid, plugin.name as pname';
395 395
         $from = array();
396
-        $from[] = $modx->getDatabase()->getFullTableName('system_eventnames') . ' sysevt';
397
-        $from[] = 'INNER JOIN ' . $modx->getDatabase()->getFullTableName('site_plugin_events') . ' event ON event.evtid=sysevt.id';
398
-        $from[] = 'INNER JOIN ' . $modx->getDatabase()->getFullTableName('site_plugins') . ' plugin ON plugin.id=event.pluginid';
396
+        $from[] = $modx->getDatabase()->getFullTableName('system_eventnames').' sysevt';
397
+        $from[] = 'INNER JOIN '.$modx->getDatabase()->getFullTableName('site_plugin_events').' event ON event.evtid=sysevt.id';
398
+        $from[] = 'INNER JOIN '.$modx->getDatabase()->getFullTableName('site_plugins').' plugin ON plugin.id=event.pluginid';
399 399
         $rs = $modx->getDatabase()->select($f, $from, 'plugin.disabled=0', 'sysevt.name, event.priority');
400 400
         $content .= '$e=&$this->pluginEvent;';
401 401
         $events = array();
@@ -408,14 +408,14 @@  discard block
 block discarded – undo
408 408
         }
409 409
         foreach ($events as $evtname => $pluginnames) {
410 410
             $events[$evtname] = $pluginnames;
411
-            $content .= '$e[\'' . $evtname . '\']=array(\'' . implode('\',\'',
412
-                    $this->escapeSingleQuotes($pluginnames)) . '\');';
411
+            $content .= '$e[\''.$evtname.'\']=array(\''.implode('\',\'',
412
+                    $this->escapeSingleQuotes($pluginnames)).'\');';
413 413
         }
414 414
 
415 415
         $content .= "\n";
416 416
 
417 417
         // close and write the file
418
-        $filename = $this->cachePath . 'siteCache.idx.php';
418
+        $filename = $this->cachePath.'siteCache.idx.php';
419 419
 
420 420
         // invoke OnBeforeCacheUpdate event
421 421
         if ($modx) {
@@ -426,8 +426,8 @@  discard block
 block discarded – undo
426 426
             exit("Cannot write main MODX cache file! Make sure the assets/cache directory is writable!");
427 427
         }
428 428
 
429
-        if (!is_file($this->cachePath . '/.htaccess')) {
430
-            file_put_contents($this->cachePath . '/.htaccess', "order deny,allow\ndeny from all\n");
429
+        if (!is_file($this->cachePath.'/.htaccess')) {
430
+            file_put_contents($this->cachePath.'/.htaccess', "order deny,allow\ndeny from all\n");
431 431
         }
432 432
 
433 433
         // invoke OnCacheUpdate event
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
 
450 450
         $source = trim($source);
451 451
         if (substr($source, 0, 5) !== '<?php') {
452
-            $source = '<?php ' . $source;
452
+            $source = '<?php '.$source;
453 453
         }
454 454
 
455 455
         $tokens = token_get_all($source);
@@ -507,7 +507,7 @@  discard block
 block discarded – undo
507 507
             }
508 508
         }
509 509
         $source = preg_replace(array('@^<\?php@i', '|\s+|', '|<!--|', '|-->|', '|-->\s+<!--|'),
510
-            array('', ' ', "\n" . '<!--', '-->' . "\n", '-->' . "\n" . '<!--'), $_);
510
+            array('', ' ', "\n".'<!--', '-->'."\n", '-->'."\n".'<!--'), $_);
511 511
         $source = trim($source);
512 512
 
513 513
         return $source;
Please login to merge, or discard this patch.
manager/includes/src/Legacy/mgrResources.php 1 patch
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php namespace EvolutionCMS\Legacy;
2 2
 
3
-class mgrResources {
3
+class mgrResources{
4 4
     /**
5 5
      * @var array
6 6
      */
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
     /**
22 22
      * mgrResources constructor.
23 23
      */
24
-    public function __construct() {
24
+    public function __construct(){
25 25
         $this->setTypes();
26 26
         $this->queryItemsFromDB();
27 27
         $this->prepareCategoryArrays();
@@ -30,47 +30,47 @@  discard block
 block discarded – undo
30 30
     /**
31 31
      * @return void
32 32
      */
33
-    public function setTypes() {
33
+    public function setTypes(){
34 34
         global $_lang;
35
-        $this->types['site_templates']    = array(
35
+        $this->types['site_templates'] = array(
36 36
             'title'=>$_lang["manage_templates"],
37
-            'actions'=>array( 'edit'=>array(16,'edit_template'), 'duplicate'=>array(96,'new_template'), 'remove'=>array(21,'delete_template') ),
38
-            'permissions'=>array('new_template','edit_template'),
37
+            'actions'=>array('edit'=>array(16, 'edit_template'), 'duplicate'=>array(96, 'new_template'), 'remove'=>array(21, 'delete_template')),
38
+            'permissions'=>array('new_template', 'edit_template'),
39 39
             'name'=>'templatename'
40 40
         );
41
-        $this->types['site_tmplvars']     = array(
41
+        $this->types['site_tmplvars'] = array(
42 42
             'title'=>$_lang["tmplvars"],
43
-            'actions'=>array('edit'=>array(301,'edit_template'), 'duplicate'=>array(304,'edit_template'), 'remove'=>array(303,'edit_template')),
44
-            'permissions'=>array('new_template','edit_template'),
43
+            'actions'=>array('edit'=>array(301, 'edit_template'), 'duplicate'=>array(304, 'edit_template'), 'remove'=>array(303, 'edit_template')),
44
+            'permissions'=>array('new_template', 'edit_template'),
45 45
         );
46 46
         $this->types['site_htmlsnippets'] = array(
47 47
             'title'=>$_lang["manage_htmlsnippets"],
48
-            'actions'=>array('edit'=>array(78,'edit_chunk'), 'duplicate'=>array(97,'new_chunk'), 'remove'=>array(80,'delete_chunk')),
49
-            'permissions'=>array('new_chunk','edit_chunk'),
48
+            'actions'=>array('edit'=>array(78, 'edit_chunk'), 'duplicate'=>array(97, 'new_chunk'), 'remove'=>array(80, 'delete_chunk')),
49
+            'permissions'=>array('new_chunk', 'edit_chunk'),
50 50
         );
51
-        $this->types['site_snippets']     = array(
51
+        $this->types['site_snippets'] = array(
52 52
             'title'=>$_lang["manage_snippets"],
53
-            'actions'=>array('edit'=>array(22,'edit_snippet'), 'duplicate'=>array(98,'new_snippet'), 'remove'=>array(25,'delete_snippet')),
54
-            'permissions'=>array('new_snippet','edit_snippet'),
53
+            'actions'=>array('edit'=>array(22, 'edit_snippet'), 'duplicate'=>array(98, 'new_snippet'), 'remove'=>array(25, 'delete_snippet')),
54
+            'permissions'=>array('new_snippet', 'edit_snippet'),
55 55
         );
56
-        $this->types['site_plugins']      = array(
56
+        $this->types['site_plugins'] = array(
57 57
             'title'=>$_lang["manage_plugins"],
58
-            'actions'=>array('edit'=>array(102,'edit_plugin'), 'duplicate'=>array(105,'new_plugin'), 'remove'=>array(104,'delete_plugin')),
59
-            'permissions'=>array('new_plugin','edit_plugin'),
58
+            'actions'=>array('edit'=>array(102, 'edit_plugin'), 'duplicate'=>array(105, 'new_plugin'), 'remove'=>array(104, 'delete_plugin')),
59
+            'permissions'=>array('new_plugin', 'edit_plugin'),
60 60
         );
61
-        $this->types['site_modules']      = array(
61
+        $this->types['site_modules'] = array(
62 62
             'title'=>$_lang["manage_modules"],
63
-            'actions'=>array('edit'=>array(108,'edit_module'), 'duplicate'=>array(111,'new_module'), 'remove'=>array(110,'delete_module')),
64
-            'permissions'=>array('new_module','edit_module'),
63
+            'actions'=>array('edit'=>array(108, 'edit_module'), 'duplicate'=>array(111, 'new_module'), 'remove'=>array(110, 'delete_module')),
64
+            'permissions'=>array('new_module', 'edit_module'),
65 65
         );
66 66
     }
67 67
 
68 68
     /**
69 69
      * @return void
70 70
      */
71
-    public function queryItemsFromDB() {
72
-        foreach($this->types as $resourceTable=>$type) {
73
-            if($this->hasAnyPermissions($type['permissions'])) {
71
+    public function queryItemsFromDB(){
72
+        foreach ($this->types as $resourceTable=>$type) {
73
+            if ($this->hasAnyPermissions($type['permissions'])) {
74 74
                 $nameField = isset($type['name']) ? $type['name'] : 'name';
75 75
                 $this->items[$resourceTable] = $this->queryResources($resourceTable, $nameField);
76 76
             }
@@ -81,11 +81,11 @@  discard block
 block discarded – undo
81 81
      * @param array $permissions
82 82
      * @return bool
83 83
      */
84
-    public function hasAnyPermissions($permissions) {
84
+    public function hasAnyPermissions($permissions){
85 85
         $modx = evolutionCMS();
86 86
 
87
-        foreach($permissions as $p)
88
-            if($modx->hasPermission($p)) return true;
87
+        foreach ($permissions as $p)
88
+            if ($modx->hasPermission($p)) return true;
89 89
 
90 90
         return false;
91 91
     }
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
      * @param string $nameField
96 96
      * @return array|bool
97 97
      */
98
-    public function queryResources($resourceTable, $nameField = 'name') {
98
+    public function queryResources($resourceTable, $nameField = 'name'){
99 99
         $modx = evolutionCMS(); global $_lang;
100 100
 
101 101
         $allowed = array(
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
             'site_plugins',
105 105
             'site_modules'
106 106
         );
107
-        $pluginsql = !empty($resourceTable) && in_array($resourceTable, $allowed) ? $resourceTable . '.disabled, ' : '';
107
+        $pluginsql = !empty($resourceTable) && in_array($resourceTable, $allowed) ? $resourceTable.'.disabled, ' : '';
108 108
 
109 109
         $tvsql  = '';
110 110
         $tvjoin = '';
@@ -119,14 +119,14 @@  discard block
 block discarded – undo
119 119
 
120 120
         $rs = $modx->getDatabase()->select(
121 121
             "{$sttfield} {$pluginsql} {$tvsql} {$resourceTable}.{$nameField} as name, {$resourceTable}.id, {$resourceTable}.description, {$resourceTable}.locked, {$selectableTemplates}IF(isnull(categories.category),'{$_lang['no_category']}',categories.category) as category, categories.id as catid",
122
-            $modx->getDatabase()->getFullTableName($resourceTable) . " AS {$resourceTable}
123
-	            LEFT JOIN " . $modx->getDatabase()->getFullTableName('categories') . " AS categories ON {$resourceTable}.category = categories.id {$tvjoin}",
122
+            $modx->getDatabase()->getFullTableName($resourceTable)." AS {$resourceTable}
123
+	            LEFT JOIN ".$modx->getDatabase()->getFullTableName('categories')." AS categories ON {$resourceTable}.category = categories.id {$tvjoin}",
124 124
             "",
125 125
             "category,name"
126 126
         );
127 127
         $limit = $modx->getDatabase()->getRecordCount($rs);
128 128
 
129
-        if($limit < 1) return false;
129
+        if ($limit < 1) return false;
130 130
 
131 131
         $result = array();
132 132
         while ($row = $modx->getDatabase()->getRow($rs)) {
@@ -138,9 +138,9 @@  discard block
 block discarded – undo
138 138
     /**
139 139
      * @return void
140 140
      */
141
-    public function prepareCategoryArrays() {
142
-        foreach($this->items as $type=>$items) {
143
-            foreach((array)$items as $item) {
141
+    public function prepareCategoryArrays(){
142
+        foreach ($this->items as $type=>$items) {
143
+            foreach ((array) $items as $item) {
144 144
                 $catid = $item['catid'] ? $item['catid'] : 0;
145 145
                 $this->categories[$catid] = $item['category'];
146 146
 
@@ -153,8 +153,8 @@  discard block
 block discarded – undo
153 153
         natcasesort($this->categories);
154 154
 
155 155
         // Now sort by name
156
-        foreach($this->itemsPerCategory as $catid=>$items) {
157
-            usort($this->itemsPerCategory[$catid], function ($a, $b) {
156
+        foreach ($this->itemsPerCategory as $catid=>$items) {
157
+            usort($this->itemsPerCategory[$catid], function($a, $b){
158 158
                 return strcasecmp($a['name'], $b['name']);
159 159
             });
160 160
         }
Please login to merge, or discard this patch.
manager/includes/src/Legacy/ManagerApi.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -146,33 +146,33 @@  discard block
 block discarded – undo
146 146
             $algorithm = 'UNCRYPT';
147 147
         }
148 148
 
149
-        $salt = md5($password . $seed);
149
+        $salt = md5($password.$seed);
150 150
 
151 151
         switch ($algorithm) {
152 152
             case 'BLOWFISH_Y':
153
-                $salt = '$2y$07$' . substr($salt, 0, 22);
153
+                $salt = '$2y$07$'.substr($salt, 0, 22);
154 154
                 break;
155 155
             case 'BLOWFISH_A':
156
-                $salt = '$2a$07$' . substr($salt, 0, 22);
156
+                $salt = '$2a$07$'.substr($salt, 0, 22);
157 157
                 break;
158 158
             case 'SHA512':
159
-                $salt = '$6$' . substr($salt, 0, 16);
159
+                $salt = '$6$'.substr($salt, 0, 16);
160 160
                 break;
161 161
             case 'SHA256':
162
-                $salt = '$5$' . substr($salt, 0, 16);
162
+                $salt = '$5$'.substr($salt, 0, 16);
163 163
                 break;
164 164
             case 'MD5':
165
-                $salt = '$1$' . substr($salt, 0, 8);
165
+                $salt = '$1$'.substr($salt, 0, 8);
166 166
                 break;
167 167
         }
168 168
 
169 169
         if ($algorithm !== 'UNCRYPT') {
170
-            $password = sha1($password) . crypt($password, $salt);
170
+            $password = sha1($password).crypt($password, $salt);
171 171
         } else {
172
-            $password = sha1($salt . $password);
172
+            $password = sha1($salt.$password);
173 173
         }
174 174
 
175
-        $result = strtolower($algorithm) . '>' . md5($salt . $password) . substr(md5($salt), 0, 8);
175
+        $result = strtolower($algorithm).'>'.md5($salt.$password).substr(md5($salt), 0, 8);
176 176
 
177 177
         return $result;
178 178
     }
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
         $check_files = explode("\n", $check_files);
255 255
         foreach ($check_files as $file) {
256 256
             $file = trim($file);
257
-            $file = MODX_BASE_PATH . $file;
257
+            $file = MODX_BASE_PATH.$file;
258 258
             if (!is_file($file)) {
259 259
                 continue;
260 260
             }
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
         $checksum = unserialize($checksum);
278 278
         foreach ($check_files as $file) {
279 279
             $file = trim($file);
280
-            $filePath = MODX_BASE_PATH . $file;
280
+            $filePath = MODX_BASE_PATH.$file;
281 281
             if (!is_file($filePath)) {
282 282
                 continue;
283 283
             }
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
     {
297 297
         $modx = evolutionCMS();
298 298
         $tbl_system_settings = $modx->getDatabase()->getFullTableName('system_settings');
299
-        $sql = "REPLACE INTO {$tbl_system_settings} (setting_name, setting_value) VALUES ('sys_files_checksum','" . $modx->getDatabase()->escape($checksum) . "')";
299
+        $sql = "REPLACE INTO {$tbl_system_settings} (setting_name, setting_value) VALUES ('sys_files_checksum','".$modx->getDatabase()->escape($checksum)."')";
300 300
         $modx->getDatabase()->query($sql);
301 301
     }
302 302
 
@@ -373,10 +373,10 @@  discard block
 block discarded – undo
373 373
             foreach ($settings as $key => $val) {
374 374
                 $f = array();
375 375
                 $f['user'] = $_SESSION['mgrInternalKey'];
376
-                $f['setting_name'] = '_LAST_' . $key;
376
+                $f['setting_name'] = '_LAST_'.$key;
377 377
                 $f['setting_value'] = $val;
378 378
                 $f = $modx->getDatabase()->escape($f);
379
-                $f = "(`" . implode("`, `", array_keys($f)) . "`) VALUES('" . implode("', '", array_values($f)) . "')";
379
+                $f = "(`".implode("`, `", array_keys($f))."`) VALUES('".implode("', '", array_values($f))."')";
380 380
                 $f .= " ON DUPLICATE KEY UPDATE setting_value = VALUES(setting_value)";
381 381
                 $modx->getDatabase()->insert($f, $modx->getDatabase()->getFullTableName('user_settings'));
382 382
             }
Please login to merge, or discard this patch.