@@ -7,11 +7,11 @@ discard block |
||
7 | 7 | |
8 | 8 | $modx->db->connect(); |
9 | 9 | |
10 | -if (empty ($modx->config)) { |
|
10 | +if (empty ($modx->config)) { |
|
11 | 11 | $modx->getSettings(); |
12 | 12 | } |
13 | 13 | |
14 | -if (!isset($_SESSION['mgrValidated']) || !isset($_SERVER['HTTP_X_REQUESTED_WITH']) || (strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') || ($_SERVER['REQUEST_METHOD'] != 'POST')) { |
|
14 | +if (!isset($_SESSION['mgrValidated']) || !isset($_SERVER['HTTP_X_REQUESTED_WITH']) || (strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') || ($_SERVER['REQUEST_METHOD'] != 'POST')) { |
|
15 | 15 | $modx->sendErrorPage(); |
16 | 16 | } |
17 | 17 | |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | |
21 | 21 | $_lang = array(); |
22 | 22 | include_once MODX_MANAGER_PATH . '/includes/lang/english.inc.php'; |
23 | -if ($modx->config['manager_language'] != 'english') { |
|
23 | +if ($modx->config['manager_language'] != 'english') { |
|
24 | 24 | include_once MODX_MANAGER_PATH . '/includes/lang/' . $modx->config['manager_language'] . '.inc.php'; |
25 | 25 | } |
26 | 26 | include_once MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/style.php'; |
@@ -33,12 +33,12 @@ discard block |
||
33 | 33 | // set limit sql query |
34 | 34 | $limit = !empty($modx->config['number_of_results']) ? (int) $modx->config['number_of_results'] : 100; |
35 | 35 | |
36 | -if (isset($action)) { |
|
37 | - switch ($action) { |
|
36 | +if (isset($action)) { |
|
37 | + switch ($action) { |
|
38 | 38 | |
39 | 39 | case '1': { |
40 | 40 | |
41 | - switch ($frame) { |
|
41 | + switch ($frame) { |
|
42 | 42 | case 'nodes': |
43 | 43 | include_once MODX_MANAGER_PATH . '/frames/nodes.php'; |
44 | 44 | |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | |
53 | 53 | $elements = isset($_REQUEST['elements']) && is_scalar($_REQUEST['elements']) ? htmlentities($_REQUEST['elements']) : ''; |
54 | 54 | |
55 | - if ($elements) { |
|
55 | + if ($elements) { |
|
56 | 56 | $output = ''; |
57 | 57 | $items = ''; |
58 | 58 | $sql = ''; |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | $sqlLike = $filter ? 'WHERE t1.name LIKE "' . $modx->db->escape($filter) . '%"' : ''; |
62 | 62 | $sqlLimit = $sqlLike ? '' : 'LIMIT ' . $limit; |
63 | 63 | |
64 | - switch ($elements) { |
|
64 | + switch ($elements) { |
|
65 | 65 | case 'element_templates': |
66 | 66 | $a = 16; |
67 | 67 | $sqlLike = $filter ? 'WHERE t1.templatename LIKE "' . $modx->db->escape($filter) . '%"' : ''; |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | ORDER BY t1.templatename ASC |
72 | 72 | ' . $sqlLimit); |
73 | 73 | |
74 | - if ($modx->hasPermission('new_template')) { |
|
74 | + if ($modx->hasPermission('new_template')) { |
|
75 | 75 | $output .= '<li><a id="a_19" href="index.php?a=19" target="main"><i class="fa fa-plus"></i>' . $_lang['new_template'] . '</a></li>'; |
76 | 76 | } |
77 | 77 | |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | ORDER BY t1.name ASC |
88 | 88 | ' . $sqlLimit); |
89 | 89 | |
90 | - if ($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) { |
|
90 | + if ($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) { |
|
91 | 91 | $output .= '<li><a id="a_300" href="index.php?a=300" target="main"><i class="fa fa-plus"></i>' . $_lang['new_tmplvars'] . '</a></li>'; |
92 | 92 | } |
93 | 93 | |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | ORDER BY t1.name ASC |
102 | 102 | ' . $sqlLimit); |
103 | 103 | |
104 | - if ($modx->hasPermission('new_chunk')) { |
|
104 | + if ($modx->hasPermission('new_chunk')) { |
|
105 | 105 | $output .= '<li><a id="a_77" href="index.php?a=77" target="main"><i class="fa fa-plus"></i>' . $_lang['new_htmlsnippet'] . '</a></li>'; |
106 | 106 | } |
107 | 107 | |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | ORDER BY t1.name ASC |
116 | 116 | ' . $sqlLimit); |
117 | 117 | |
118 | - if ($modx->hasPermission('new_snippet')) { |
|
118 | + if ($modx->hasPermission('new_snippet')) { |
|
119 | 119 | $output .= '<li><a id="a_23" href="index.php?a=23" target="main"><i class="fa fa-plus"></i>' . $_lang['new_snippet'] . '</a></li>'; |
120 | 120 | } |
121 | 121 | |
@@ -129,19 +129,19 @@ discard block |
||
129 | 129 | ORDER BY t1.name ASC |
130 | 130 | ' . $sqlLimit); |
131 | 131 | |
132 | - if ($modx->hasPermission('new_plugin')) { |
|
132 | + if ($modx->hasPermission('new_plugin')) { |
|
133 | 133 | $output .= '<li><a id="a_101" href="index.php?a=101" target="main"><i class="fa fa-plus"></i>' . $_lang['new_plugin'] . '</a></li>'; |
134 | 134 | } |
135 | 135 | |
136 | 136 | break; |
137 | 137 | } |
138 | 138 | |
139 | - if ($count = $modx->db->getRecordCount($sql)) { |
|
140 | - if ($count == $limit) { |
|
139 | + if ($count = $modx->db->getRecordCount($sql)) { |
|
140 | + if ($count == $limit) { |
|
141 | 141 | $output .= '<li class="item-input"><input type="text" name="filter" class="dropdown-item form-control form-control-sm" autocomplete="off" /></li>'; |
142 | 142 | } |
143 | - while ($row = $modx->db->getRow($sql)) { |
|
144 | - if (($row['disabled'] || $row['locked']) && $role != 1) { |
|
143 | + while ($row = $modx->db->getRow($sql)) { |
|
144 | + if (($row['disabled'] || $row['locked']) && $role != 1) { |
|
145 | 145 | continue; |
146 | 146 | } |
147 | 147 | |
@@ -149,9 +149,9 @@ discard block |
||
149 | 149 | } |
150 | 150 | } |
151 | 151 | |
152 | - if (isset($_REQUEST['filter'])) { |
|
152 | + if (isset($_REQUEST['filter'])) { |
|
153 | 153 | $output = $items; |
154 | - } else { |
|
154 | + } else { |
|
155 | 155 | $output .= $items; |
156 | 156 | } |
157 | 157 | |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | $sqlLike = $filter ? 'WHERE t1.username LIKE "' . $modx->db->escape($filter) . '%"' : ''; |
170 | 170 | $sqlLimit = $sqlLike ? '' : 'LIMIT ' . $limit; |
171 | 171 | |
172 | - if(!$modx->hasPermission('save_role')) { |
|
172 | + if(!$modx->hasPermission('save_role')) { |
|
173 | 173 | $sqlLike .= $sqlLike ? ' AND ' : 'WHERE '; |
174 | 174 | $sqlLike .= 't2.role != 1'; |
175 | 175 | } |
@@ -181,22 +181,22 @@ discard block |
||
181 | 181 | ORDER BY t1.username ASC |
182 | 182 | ' . $sqlLimit); |
183 | 183 | |
184 | - if ($modx->hasPermission('new_user')) { |
|
184 | + if ($modx->hasPermission('new_user')) { |
|
185 | 185 | $output .= '<li><a id="a_11" href="index.php?a=11" target="main"><i class="fa fa-plus"></i>' . $_lang['new_user'] . '</a></li>'; |
186 | 186 | } |
187 | 187 | |
188 | - if ($count = $modx->db->getRecordCount($sql)) { |
|
189 | - if ($count == $limit) { |
|
188 | + if ($count = $modx->db->getRecordCount($sql)) { |
|
189 | + if ($count == $limit) { |
|
190 | 190 | $output .= '<li class="item-input"><input type="text" name="filter" class="dropdown-item form-control form-control-sm" autocomplete="off" /></li>'; |
191 | 191 | } |
192 | - while ($row = $modx->db->getRow($sql)) { |
|
192 | + while ($row = $modx->db->getRow($sql)) { |
|
193 | 193 | $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>'; |
194 | 194 | } |
195 | 195 | } |
196 | 196 | |
197 | - if (isset($_REQUEST['filter'])) { |
|
197 | + if (isset($_REQUEST['filter'])) { |
|
198 | 198 | $output = $items; |
199 | - } else { |
|
199 | + } else { |
|
200 | 200 | $output .= $items; |
201 | 201 | } |
202 | 202 | |
@@ -220,22 +220,22 @@ discard block |
||
220 | 220 | ORDER BY t1.username ASC |
221 | 221 | ' . $sqlLimit); |
222 | 222 | |
223 | - if ($modx->hasPermission('new_web_user')) { |
|
223 | + if ($modx->hasPermission('new_web_user')) { |
|
224 | 224 | $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>'; |
225 | 225 | } |
226 | 226 | |
227 | - if ($count = $modx->db->getRecordCount($sql)) { |
|
228 | - if ($count == $limit) { |
|
227 | + if ($count = $modx->db->getRecordCount($sql)) { |
|
228 | + if ($count == $limit) { |
|
229 | 229 | $output .= '<li class="item-input"><input type="text" name="filter" class="dropdown-item form-control form-control-sm" autocomplete="off" /></li>'; |
230 | 230 | } |
231 | - while ($row = $modx->db->getRow($sql)) { |
|
231 | + while ($row = $modx->db->getRow($sql)) { |
|
232 | 232 | $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>'; |
233 | 233 | } |
234 | 234 | } |
235 | 235 | |
236 | - if (isset($_REQUEST['filter'])) { |
|
236 | + if (isset($_REQUEST['filter'])) { |
|
237 | 237 | $output = $items; |
238 | - } else { |
|
238 | + } else { |
|
239 | 239 | $output .= $items; |
240 | 240 | } |
241 | 241 | |
@@ -249,8 +249,8 @@ discard block |
||
249 | 249 | $type = isset($_REQUEST['type']) && is_scalar($_REQUEST['type']) ? $modx->db->escape($_REQUEST['type']) : false; |
250 | 250 | $contextmenu = ''; |
251 | 251 | |
252 | - if ($role && $name && $type) { |
|
253 | - switch ($type) { |
|
252 | + if ($role && $name && $type) { |
|
253 | + switch ($type) { |
|
254 | 254 | case 'Snippet': |
255 | 255 | case 'SnippetNoCache': { |
256 | 256 | |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | WHERE name="' . $name . '" |
260 | 260 | LIMIT 1'); |
261 | 261 | |
262 | - if ($modx->db->getRecordCount($sql)) { |
|
262 | + if ($modx->db->getRecordCount($sql)) { |
|
263 | 263 | $row = $modx->db->getRow($sql); |
264 | 264 | $contextmenu = array( |
265 | 265 | 'header' => array( |
@@ -270,13 +270,13 @@ discard block |
||
270 | 270 | 'url' => "index.php?a=22&id=" . $row['id'] |
271 | 271 | ) |
272 | 272 | ); |
273 | - if (!empty($row['description'])) { |
|
273 | + if (!empty($row['description'])) { |
|
274 | 274 | $contextmenu['seperator'] = ''; |
275 | 275 | $contextmenu['description'] = array( |
276 | 276 | 'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description'] |
277 | 277 | ); |
278 | 278 | } |
279 | - } else { |
|
279 | + } else { |
|
280 | 280 | $contextmenu = array( |
281 | 281 | 'header' => array( |
282 | 282 | 'innerHTML' => '<i class="fa fa-code"></i> ' . $name |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | WHERE name="' . $name . '" |
298 | 298 | LIMIT 1'); |
299 | 299 | |
300 | - if ($modx->db->getRecordCount($sql)) { |
|
300 | + if ($modx->db->getRecordCount($sql)) { |
|
301 | 301 | $row = $modx->db->getRow($sql); |
302 | 302 | $contextmenu = array( |
303 | 303 | 'header' => array( |
@@ -308,13 +308,13 @@ discard block |
||
308 | 308 | 'url' => "index.php?a=78&id=" . $row['id'] |
309 | 309 | ) |
310 | 310 | ); |
311 | - if (!empty($row['description'])) { |
|
311 | + if (!empty($row['description'])) { |
|
312 | 312 | $contextmenu['seperator'] = ''; |
313 | 313 | $contextmenu['description'] = array( |
314 | 314 | 'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description'] |
315 | 315 | ); |
316 | 316 | } |
317 | - } else { |
|
317 | + } else { |
|
318 | 318 | $contextmenu = array( |
319 | 319 | 'header' => array( |
320 | 320 | 'innerHTML' => '<i class="fa fa-th-large"></i> ' . $name |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | WHERE name="' . $name . '" |
335 | 335 | LIMIT 1'); |
336 | 336 | |
337 | - if ($modx->db->getRecordCount($sql)) { |
|
337 | + if ($modx->db->getRecordCount($sql)) { |
|
338 | 338 | $row = $modx->db->getRow($sql); |
339 | 339 | $contextmenu = array( |
340 | 340 | 'header' => array( |
@@ -345,20 +345,20 @@ discard block |
||
345 | 345 | 'url' => "index.php?a=78&id=" . $row['id'] |
346 | 346 | ) |
347 | 347 | ); |
348 | - if (!empty($row['description'])) { |
|
348 | + if (!empty($row['description'])) { |
|
349 | 349 | $contextmenu['seperator'] = ''; |
350 | 350 | $contextmenu['description'] = array( |
351 | 351 | 'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description'] |
352 | 352 | ); |
353 | 353 | } |
354 | - } else { |
|
354 | + } else { |
|
355 | 355 | |
356 | 356 | $sql = $modx->db->query('SELECT * |
357 | 357 | FROM ' . $modx->getFullTableName('site_snippets') . ' |
358 | 358 | WHERE name="' . $name . '" |
359 | 359 | LIMIT 1'); |
360 | 360 | |
361 | - if ($modx->db->getRecordCount($sql)) { |
|
361 | + if ($modx->db->getRecordCount($sql)) { |
|
362 | 362 | $row = $modx->db->getRow($sql); |
363 | 363 | $contextmenu = array( |
364 | 364 | 'header' => array( |
@@ -369,13 +369,13 @@ discard block |
||
369 | 369 | 'url' => "index.php?a=22&id=" . $row['id'] |
370 | 370 | ) |
371 | 371 | ); |
372 | - if (!empty($row['description'])) { |
|
372 | + if (!empty($row['description'])) { |
|
373 | 373 | $contextmenu['seperator'] = ''; |
374 | 374 | $contextmenu['description'] = array( |
375 | 375 | 'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description'] |
376 | 376 | ); |
377 | 377 | } |
378 | - } else { |
|
378 | + } else { |
|
379 | 379 | $contextmenu = array( |
380 | 380 | 'header' => array( |
381 | 381 | 'innerHTML' => '<i class="fa fa-code"></i> ' . $name |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | 'alias_visible' |
438 | 438 | ); |
439 | 439 | |
440 | - if (in_array($name, $default_field)) { |
|
440 | + if (in_array($name, $default_field)) { |
|
441 | 441 | return; |
442 | 442 | } |
443 | 443 | |
@@ -446,7 +446,7 @@ discard block |
||
446 | 446 | WHERE name="' . $name . '" |
447 | 447 | LIMIT 1'); |
448 | 448 | |
449 | - if ($modx->db->getRecordCount($sql)) { |
|
449 | + if ($modx->db->getRecordCount($sql)) { |
|
450 | 450 | $row = $modx->db->getRow($sql); |
451 | 451 | $contextmenu = array( |
452 | 452 | 'header' => array( |
@@ -457,13 +457,13 @@ discard block |
||
457 | 457 | 'url' => "index.php?a=301&id=" . $row['id'] |
458 | 458 | ) |
459 | 459 | ); |
460 | - if (!empty($row['description'])) { |
|
460 | + if (!empty($row['description'])) { |
|
461 | 461 | $contextmenu['seperator'] = ''; |
462 | 462 | $contextmenu['description'] = array( |
463 | 463 | 'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description'] |
464 | 464 | ); |
465 | 465 | } |
466 | - } else { |
|
466 | + } else { |
|
467 | 467 | $contextmenu = array( |
468 | 468 | 'header' => array( |
469 | 469 | 'innerHTML' => '<i class="fa fa-list-alt"></i> ' . $name |
@@ -488,13 +488,13 @@ discard block |
||
488 | 488 | case 'movedocument' : { |
489 | 489 | $json = array(); |
490 | 490 | |
491 | - if ($modx->hasPermission('new_document') && $modx->hasPermission('edit_document') && $modx->hasPermission('save_document')) { |
|
491 | + if ($modx->hasPermission('new_document') && $modx->hasPermission('edit_document') && $modx->hasPermission('save_document')) { |
|
492 | 492 | $id = !empty($_REQUEST['id']) ? (int)$_REQUEST['id'] : ''; |
493 | 493 | $parent = isset($_REQUEST['parent']) ? (int)$_REQUEST['parent'] : 0; |
494 | 494 | $menuindex = isset($_REQUEST['menuindex']) && is_scalar($_REQUEST['menuindex']) ? $_REQUEST['menuindex'] : 0; |
495 | 495 | |
496 | 496 | // set parent |
497 | - if ($id && $parent >= 0) { |
|
497 | + if ($id && $parent >= 0) { |
|
498 | 498 | |
499 | 499 | // find older parent |
500 | 500 | $parentOld = $modx->db->getValue($modx->db->select('parent', $modx->getFullTableName('site_content'), 'id=' . $id)); |
@@ -505,31 +505,31 @@ discard block |
||
505 | 505 | 'new_parent' => $parent, |
506 | 506 | ]); |
507 | 507 | |
508 | - if (is_array($eventOut) && count($eventOut) > 0) { |
|
508 | + if (is_array($eventOut) && count($eventOut) > 0) { |
|
509 | 509 | $eventParent = array_pop($eventOut); |
510 | 510 | |
511 | - if ($eventParent == $parentOld) { |
|
511 | + if ($eventParent == $parentOld) { |
|
512 | 512 | $json['errors'] = $_lang['error_movedocument2']; |
513 | - } else { |
|
513 | + } else { |
|
514 | 514 | $parent = $eventParent; |
515 | 515 | } |
516 | 516 | } |
517 | 517 | |
518 | - if (empty($json['errors'])) { |
|
518 | + if (empty($json['errors'])) { |
|
519 | 519 | // check privileges user for move docs |
520 | - if (!empty($modx->config['tree_show_protected']) && $role != 1) { |
|
520 | + if (!empty($modx->config['tree_show_protected']) && $role != 1) { |
|
521 | 521 | $sql = $modx->db->select('*', $modx->getFullTableName('document_groups'), 'document IN(' . $id . ',' . $parent . ',' . $parentOld . ')'); |
522 | - if ($modx->db->getRecordCount($sql)) { |
|
522 | + if ($modx->db->getRecordCount($sql)) { |
|
523 | 523 | $document_groups = array(); |
524 | - while ($row = $modx->db->getRow($sql)) { |
|
524 | + while ($row = $modx->db->getRow($sql)) { |
|
525 | 525 | $document_groups[$row['document']]['groups'][] = $row['document_group']; |
526 | 526 | } |
527 | - foreach ($document_groups as $key => $value) { |
|
528 | - if (($key == $parent || $key == $parentOld || $key == $id) && !in_array($role, $value['groups'])) { |
|
527 | + foreach ($document_groups as $key => $value) { |
|
528 | + if (($key == $parent || $key == $parentOld || $key == $id) && !in_array($role, $value['groups'])) { |
|
529 | 529 | $json['errors'] = $_lang["error_no_privileges"]; |
530 | 530 | } |
531 | 531 | } |
532 | - if ($json['errors']) { |
|
532 | + if ($json['errors']) { |
|
533 | 533 | header('content-type: application/json'); |
534 | 534 | echo json_encode($json, JSON_FORCE_OBJECT | JSON_UNESCAPED_UNICODE); |
535 | 535 | break; |
@@ -537,9 +537,9 @@ discard block |
||
537 | 537 | } |
538 | 538 | } |
539 | 539 | |
540 | - if ($parent == 0 && $parent != $parentOld && !$modx->config['udperms_allowroot'] && $role != 1) { |
|
540 | + if ($parent == 0 && $parent != $parentOld && !$modx->config['udperms_allowroot'] && $role != 1) { |
|
541 | 541 | $json['errors'] = $_lang["error_no_privileges"]; |
542 | - } else { |
|
542 | + } else { |
|
543 | 543 | // set new parent |
544 | 544 | $modx->db->update(array( |
545 | 545 | 'parent' => $parent |
@@ -549,13 +549,13 @@ discard block |
||
549 | 549 | 'isfolder' => 1 |
550 | 550 | ), $modx->getFullTableName('site_content'), 'id=' . $parent); |
551 | 551 | |
552 | - if ($parent != $parentOld) { |
|
552 | + if ($parent != $parentOld) { |
|
553 | 553 | // check children docs and set parent isfolder |
554 | - if ($modx->db->getRecordCount($modx->db->select('id', $modx->getFullTableName('site_content'), 'parent=' . $parentOld))) { |
|
554 | + if ($modx->db->getRecordCount($modx->db->select('id', $modx->getFullTableName('site_content'), 'parent=' . $parentOld))) { |
|
555 | 555 | $modx->db->update(array( |
556 | 556 | 'isfolder' => 1 |
557 | 557 | ), $modx->getFullTableName('site_content'), 'id=' . $parentOld); |
558 | - } else { |
|
558 | + } else { |
|
559 | 559 | $modx->db->update(array( |
560 | 560 | 'isfolder' => 0 |
561 | 561 | ), $modx->getFullTableName('site_content'), 'id=' . $parentOld); |
@@ -563,16 +563,16 @@ discard block |
||
563 | 563 | } |
564 | 564 | |
565 | 565 | // set menuindex |
566 | - if (!empty($menuindex)) { |
|
566 | + if (!empty($menuindex)) { |
|
567 | 567 | $menuindex = explode(',', $menuindex); |
568 | - foreach ($menuindex as $key => $value) { |
|
568 | + foreach ($menuindex as $key => $value) { |
|
569 | 569 | $modx->db->query('UPDATE ' . $modx->getFullTableName('site_content') . ' SET menuindex=' . $key . ' WHERE id=' . $value); |
570 | 570 | } |
571 | - } else { |
|
571 | + } else { |
|
572 | 572 | // TODO: max(*) menuindex |
573 | 573 | } |
574 | 574 | |
575 | - if (!$json['errors']) { |
|
575 | + if (!$json['errors']) { |
|
576 | 576 | $json['success'] = $_lang["actioncomplete"]; |
577 | 577 | |
578 | 578 | $modx->invokeEvent('onAfterMoveDocument', [ |
@@ -584,7 +584,7 @@ discard block |
||
584 | 584 | } |
585 | 585 | } |
586 | 586 | } |
587 | - } else { |
|
587 | + } else { |
|
588 | 588 | $json['errors'] = $_lang["error_no_privileges"]; |
589 | 589 | } |
590 | 590 | |
@@ -600,7 +600,7 @@ discard block |
||
600 | 600 | |
601 | 601 | $output = !!$modx->elementIsLocked($type, $id, true); |
602 | 602 | |
603 | - if (!$output) { |
|
603 | + if (!$output) { |
|
604 | 604 | $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(',', $_SESSION['mgrDocgroups']) : ''; |
605 | 605 | $docgrp_cond = $docgrp ? ' OR dg.document_group IN (' . $docgrp . ')' : ''; |
606 | 606 | $sql = ' |
@@ -609,7 +609,7 @@ discard block |
||
609 | 609 | LEFT JOIN ' . $modx->getFullTableName('document_groups') . ' dg ON dg.document=sc.id |
610 | 610 | WHERE sc.id=' . $id . ' GROUP BY sc.id'; |
611 | 611 | $sql = $modx->db->query($sql); |
612 | - if ($modx->db->getRecordCount($sql)) { |
|
612 | + if ($modx->db->getRecordCount($sql)) { |
|
613 | 613 | $row = $modx->db->getRow($sql); |
614 | 614 | $output = !!$row['locked']; |
615 | 615 | } |