Completed
Push — develop ( 053968...47dc8d )
by Maxim
12s
created
manager/media/style/default/style.php 3 patches
Indentation   +73 added lines, -73 removed lines patch added patch discarded remove patch
@@ -11,12 +11,12 @@  discard block
 block discarded – undo
11 11
 $style_path = 'media/style/' . $modx->config['manager_theme'] . '/images/';
12 12
 $modx->config['mgr_date_picker_path'] = 'media/calendar/datepicker.inc.php';
13 13
 if(!$modx->config['lang_code']) {
14
-	global $modx_lang_attribute;
15
-	$modx->config['lang_code'] = !$modx_lang_attribute ? 'en' : $modx_lang_attribute;
14
+    global $modx_lang_attribute;
15
+    $modx->config['lang_code'] = !$modx_lang_attribute ? 'en' : $modx_lang_attribute;
16 16
 }
17 17
 
18 18
 if($_GET['a'] == 2) {
19
-	include_once('welcome.php');
19
+    include_once('welcome.php');
20 20
 }
21 21
 
22 22
 // Favicon
@@ -274,66 +274,66 @@  discard block
 block discarded – undo
274 274
 $addnew = 0;
275 275
 $run = 0;
276 276
 switch($action) {
277
-	case '3':
278
-	case '4':
279
-	case '27':
280
-	case '72':
281
-		if($modx->hasPermission('new_document')) {
282
-			$addnew = 1;
283
-		}
284
-		break;
285
-	case '16':
286
-	case '19':
287
-		if($modx->hasPermission('new_template')) {
288
-			$addnew = 1;
289
-		}
290
-		break;
291
-	case '300':
292
-	case '301':
293
-		if($modx->hasPermission('new_snippet') && $modx->hasPermission('new_chunk') && $modx->hasPermission('new_plugin')) {
294
-			$addnew = 1;
295
-		}
296
-		break;
297
-	case '77':
298
-	case '78':
299
-		if($modx->hasPermission('new_chunk')) {
300
-			$addnew = 1;
301
-		}
302
-		break;
303
-	case '22':
304
-	case '23':
305
-		if($modx->hasPermission('new_snippet')) {
306
-			$addnew = 1;
307
-		}
308
-		break;
309
-	case '101':
310
-	case '102':
311
-		if($modx->hasPermission('new_plugin')) {
312
-			$addnew = 1;
313
-		}
314
-		break;
315
-	case '106':
316
-	case '107':
317
-	case '108':
318
-		if($modx->hasPermission('new_module')) {
319
-			$addnew = 1;
320
-		}
321
-		if($modx->hasPermission('exec_module')) {
322
-			$run = 1;
323
-		}
324
-		break;
325
-	case '88':
326
-		if($modx->hasPermission('new_web_user')) {
327
-			$addnew = 1;
328
-		}
329
-		break;
277
+    case '3':
278
+    case '4':
279
+    case '27':
280
+    case '72':
281
+        if($modx->hasPermission('new_document')) {
282
+            $addnew = 1;
283
+        }
284
+        break;
285
+    case '16':
286
+    case '19':
287
+        if($modx->hasPermission('new_template')) {
288
+            $addnew = 1;
289
+        }
290
+        break;
291
+    case '300':
292
+    case '301':
293
+        if($modx->hasPermission('new_snippet') && $modx->hasPermission('new_chunk') && $modx->hasPermission('new_plugin')) {
294
+            $addnew = 1;
295
+        }
296
+        break;
297
+    case '77':
298
+    case '78':
299
+        if($modx->hasPermission('new_chunk')) {
300
+            $addnew = 1;
301
+        }
302
+        break;
303
+    case '22':
304
+    case '23':
305
+        if($modx->hasPermission('new_snippet')) {
306
+            $addnew = 1;
307
+        }
308
+        break;
309
+    case '101':
310
+    case '102':
311
+        if($modx->hasPermission('new_plugin')) {
312
+            $addnew = 1;
313
+        }
314
+        break;
315
+    case '106':
316
+    case '107':
317
+    case '108':
318
+        if($modx->hasPermission('new_module')) {
319
+            $addnew = 1;
320
+        }
321
+        if($modx->hasPermission('exec_module')) {
322
+            $run = 1;
323
+        }
324
+        break;
325
+    case '88':
326
+        if($modx->hasPermission('new_web_user')) {
327
+            $addnew = 1;
328
+        }
329
+        break;
330 330
 }
331 331
 
332 332
 $disabled = ($action == '19' || $action == '300' || $action == '77' || $action == '23' || $action == '101' || $action == '4' || $action == '72' || $action == '87' || $action == '11' || $action == '107' || $action == '38') ? ' disabled' : '';
333 333
 
334 334
 $_style['actionbuttons'] = array(
335
-	'dynamic' => array(
336
-		'document' => '<div id="actions">
335
+    'dynamic' => array(
336
+        'document' => '<div id="actions">
337 337
 			<div class="btn-group">
338 338
 				<div class="btn-group">
339 339
 					<a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.save();">
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
 						<option id="stay3" value="" ' . ($stay == '' ? ' selected="selected"' : '') . '>' . $_lang['close'] . '</option>
349 349
 					</select>
350 350
 				</div>' .
351
-					($addnew ? '
351
+                    ($addnew ? '
352 352
 					<a id="Button6" class="btn btn-secondary' . $disabled . '" href="javascript:;" onclick="actions.duplicate();">
353 353
 						<i class="' . $_style["actions_duplicate"] . '"></i><span>' . $_lang['duplicate'] . '</span>
354 354
 					</a>
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
 				</a>
365 365
 			</div>
366 366
 		</div>',
367
-		'user' => '<div id="actions">
367
+        'user' => '<div id="actions">
368 368
 			<div class="btn-group">
369 369
 				<div class="btn-group">
370 370
 					<a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.save();">
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
 				</a>
388 388
 			</div>
389 389
 		</div>',
390
-		'element' => '<div id="actions">
390
+        'element' => '<div id="actions">
391 391
 			<div class="btn-group">
392 392
 				<div class="btn-group">
393 393
 					<a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.save();">
@@ -420,21 +420,21 @@  discard block
 block discarded – undo
420 420
 				' : '') . '
421 421
 			</div>
422 422
 		</div>',
423
-		'newmodule' => ($addnew ? '<div id="actions">
423
+        'newmodule' => ($addnew ? '<div id="actions">
424 424
 			<div class="btn-group">
425 425
 				<a id="newModule" class="btn btn-secondary" href="javascript:;" onclick="actions.new();">
426 426
 					<i class="' . $_style["actions_new"] . '"></i><span>' . $_lang['new_module'] . '</span>
427 427
 				</a>
428 428
 			</div>
429 429
 		</div>' : ''),
430
-		'close' => '<div id="actions">
430
+        'close' => '<div id="actions">
431 431
 			<div class="btn-group">
432 432
 				<a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.close();">
433 433
 					<i class="' . $_style["actions_close"] . '"></i><span>' . $_lang['close'] . '</span>
434 434
 				</a>
435 435
 			</div>
436 436
 		</div>',
437
-		'save' => '<div id="actions">
437
+        'save' => '<div id="actions">
438 438
 			<div class="btn-group">
439 439
 				<a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.save();">
440 440
 					<i class="' . $_style["actions_save"] . '"></i><span>' . $_lang['save'] . '</span>
@@ -444,7 +444,7 @@  discard block
 block discarded – undo
444 444
 				</a>
445 445
 			</div>
446 446
 		</div>',
447
-		'savedelete' => '<div id="actions">
447
+        'savedelete' => '<div id="actions">
448 448
 			<div class="btn-group">
449 449
 				<a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.save();">
450 450
 					<i class="' . $_style["actions_save"] . '"></i><span>' . $_lang['save'] . '</span>
@@ -457,14 +457,14 @@  discard block
 block discarded – undo
457 457
 				</a>
458 458
 			</div>
459 459
 		</div>',
460
-		'cancel' => '<div id="actions">
460
+        'cancel' => '<div id="actions">
461 461
 			<div class="btn-group">
462 462
 				<a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.cancel();">
463 463
 					<i class="' . $_style["actions_cancel"] . '"></i><span>' . $_lang['cancel'] . '</span>
464 464
 				</a>
465 465
 			</div>
466 466
 		</div>',
467
-		'canceldelete' => '<div id="actions">
467
+        'canceldelete' => '<div id="actions">
468 468
 			<div class="btn-group">
469 469
 				<a id="Button3" class="btn btn-secondary' . $disabled . '" href="javascript:;" onclick="actions.delete();">
470 470
 					<i class="' . $_style["actions_delete"] . '"></i><span>' . $_lang['delete'] . '</span>
@@ -474,11 +474,11 @@  discard block
 block discarded – undo
474 474
 				</a>
475 475
 			</div>
476 476
 		</div>',
477
-	),
478
-	'static' => array(
479
-		'document' => '<div id="actions">
477
+    ),
478
+    'static' => array(
479
+        'document' => '<div id="actions">
480 480
 			<div class="btn-group">' .
481
-				($addnew ? '
481
+                ($addnew ? '
482 482
 					<a class="btn btn-secondary" href="javascript:;" onclick="actions.new();">
483 483
 						<i class="' . $_style["icons_new_document"] . '"></i><span>' . $_lang['create_resource_here'] . '</span>
484 484
 					</a>
@@ -503,12 +503,12 @@  discard block
 block discarded – undo
503 503
 				</a>
504 504
 			</div>
505 505
 		</div>',
506
-		'cancel' => '<div id="actions">
506
+        'cancel' => '<div id="actions">
507 507
 			<div class="btn-group">
508 508
 				<a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.cancel();">
509 509
 					<i class="' . $_style["actions_cancel"] . '"></i><span>' . $_lang['cancel'] . '</span>
510 510
 				</a>
511 511
 			</div>
512 512
 		</div>',
513
-	)
513
+    )
514 514
 );
Please login to merge, or discard this patch.
Spacing   +75 added lines, -75 removed lines patch added patch discarded remove patch
@@ -8,19 +8,19 @@  discard block
 block discarded – undo
8 8
  * Version:        1.1
9 9
  * MODX version:   1.0.3
10 10
  */
11
-$style_path = 'media/style/' . $modx->config['manager_theme'] . '/images/';
11
+$style_path = 'media/style/'.$modx->config['manager_theme'].'/images/';
12 12
 $modx->config['mgr_date_picker_path'] = 'media/calendar/datepicker.inc.php';
13
-if(!$modx->config['lang_code']) {
13
+if (!$modx->config['lang_code']) {
14 14
 	global $modx_lang_attribute;
15 15
 	$modx->config['lang_code'] = !$modx_lang_attribute ? 'en' : $modx_lang_attribute;
16 16
 }
17 17
 
18
-if($_GET['a'] == 2) {
18
+if ($_GET['a'] == 2) {
19 19
 	include_once('welcome.php');
20 20
 }
21 21
 
22 22
 // Favicon
23
-$_style['favicon']                  = (file_exists(MODX_BASE_PATH . 'favicon.ico') ? MODX_SITE_URL . 'favicon.ico' : 'media/style/' . $modx->config['manager_theme'] . '/images/favicon.ico');
23
+$_style['favicon']                  = (file_exists(MODX_BASE_PATH.'favicon.ico') ? MODX_SITE_URL . 'favicon.ico' : 'media/style/'.$modx->config['manager_theme'].'/images/favicon.ico');
24 24
 
25 25
 //Main Menu
26 26
 $_style['menu_search']              = '<i class="fa fa-search"></i>';
@@ -99,10 +99,10 @@  discard block
 block discarded – undo
99 99
 $_style['tree_page_word']           = "<i class='fa fa-file-word-o'></i>";
100 100
 $_style['tree_page_excel']          = "<i class='fa fa-file-excel-o'></i>";
101 101
 
102
-$_style['tree_minusnode']           = "<i class='fa fa-angle-down'></i>";//$style_path.'tree/angle-down.png';
103
-$_style['tree_plusnode']            = "<i class='fa fa-angle-right'></i>";//$style_path.'tree/angle-right.png';
102
+$_style['tree_minusnode']           = "<i class='fa fa-angle-down'></i>"; //$style_path.'tree/angle-down.png';
103
+$_style['tree_plusnode']            = "<i class='fa fa-angle-right'></i>"; //$style_path.'tree/angle-right.png';
104 104
 $_style['tree_weblink']             = $style_path.'tree/link.png';
105
-$_style['tree_preview_resource']    = "<i class='fa fa-eye'></i>";//$style_path.'icons/eye.png';
105
+$_style['tree_preview_resource']    = "<i class='fa fa-eye'></i>"; //$style_path.'icons/eye.png';
106 106
 
107 107
 $_style['tree_showtree']            = '<i class="fa fa-sitemap"></i>';
108 108
 $_style['tree_working']             = '<i class="fa fa-warning"></i>';
@@ -137,8 +137,8 @@  discard block
 block discarded – undo
137 137
 $_style['icons_edit_document']      = $style_path.'icons/save.png';
138 138
 $_style['icons_delete_document']    = $style_path.'icons/trash.png';
139 139
 //locks
140
-$_style['icons_preview_resource']   = $style_path.'icons/eye.png';//$style_path.'icons/eye.png';
141
-$_style['icons_secured']            = "<i class='fa fa-lock'></i>";//$style_path.'icons/lock.png';
140
+$_style['icons_preview_resource']   = $style_path.'icons/eye.png'; //$style_path.'icons/eye.png';
141
+$_style['icons_secured']            = "<i class='fa fa-lock'></i>"; //$style_path.'icons/lock.png';
142 142
 
143 143
 //file manager icons
144 144
 $_style['files_save']               = 'fa fa-floppy-o';
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 $_style['icons_set_parent']         = $style_path.'icons/folder-open.png';
214 214
 
215 215
 //modules
216
-$_style['icons_module']            = 'fa fa-cube';
216
+$_style['icons_module'] = 'fa fa-cube';
217 217
 $_style['icons_modules']            = 'fa fa-cubes'; //$style_path.'icons/modules.png';
218 218
 $_style['icons_run']                = $style_path.'icons/play.png';
219 219
 
@@ -273,57 +273,57 @@  discard block
 block discarded – undo
273 273
 $stay = isset($_REQUEST['stay']) ? $_REQUEST['stay'] : '';
274 274
 $addnew = 0;
275 275
 $run = 0;
276
-switch($action) {
276
+switch ($action) {
277 277
 	case '3':
278 278
 	case '4':
279 279
 	case '27':
280 280
 	case '72':
281
-		if($modx->hasPermission('new_document')) {
281
+		if ($modx->hasPermission('new_document')) {
282 282
 			$addnew = 1;
283 283
 		}
284 284
 		break;
285 285
 	case '16':
286 286
 	case '19':
287
-		if($modx->hasPermission('new_template')) {
287
+		if ($modx->hasPermission('new_template')) {
288 288
 			$addnew = 1;
289 289
 		}
290 290
 		break;
291 291
 	case '300':
292 292
 	case '301':
293
-		if($modx->hasPermission('new_snippet') && $modx->hasPermission('new_chunk') && $modx->hasPermission('new_plugin')) {
293
+		if ($modx->hasPermission('new_snippet') && $modx->hasPermission('new_chunk') && $modx->hasPermission('new_plugin')) {
294 294
 			$addnew = 1;
295 295
 		}
296 296
 		break;
297 297
 	case '77':
298 298
 	case '78':
299
-		if($modx->hasPermission('new_chunk')) {
299
+		if ($modx->hasPermission('new_chunk')) {
300 300
 			$addnew = 1;
301 301
 		}
302 302
 		break;
303 303
 	case '22':
304 304
 	case '23':
305
-		if($modx->hasPermission('new_snippet')) {
305
+		if ($modx->hasPermission('new_snippet')) {
306 306
 			$addnew = 1;
307 307
 		}
308 308
 		break;
309 309
 	case '101':
310 310
 	case '102':
311
-		if($modx->hasPermission('new_plugin')) {
311
+		if ($modx->hasPermission('new_plugin')) {
312 312
 			$addnew = 1;
313 313
 		}
314 314
 		break;
315 315
 	case '106':
316 316
 	case '107':
317 317
 	case '108':
318
-		if($modx->hasPermission('new_module')) {
318
+		if ($modx->hasPermission('new_module')) {
319 319
 			$addnew = 1;
320 320
 		}
321
-		if($modx->hasPermission('exec_module')) {
321
+		if ($modx->hasPermission('exec_module')) {
322 322
 			$run = 1;
323 323
 		}
324 324
 		break;
325 325
 	case '88':
326
-		if($modx->hasPermission('new_web_user')) {
326
+		if ($modx->hasPermission('new_web_user')) {
327 327
 			$addnew = 1;
328 328
 		}
329 329
 		break;
@@ -337,30 +337,30 @@  discard block
 block discarded – undo
337 337
 			<div class="btn-group">
338 338
 				<div class="btn-group">
339 339
 					<a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.save();">
340
-						<i class="' . $_style["actions_save"] . '"></i><span>' . $_lang['save'] . '</span>
340
+						<i class="' . $_style["actions_save"].'"></i><span>'.$_lang['save'].'</span>
341 341
 					</a>
342 342
 					<span class="btn btn-success plus dropdown-toggle"></span>
343 343
 					<select id="stay" name="stay">
344 344
 						' . ($addnew ? '
345
-							<option id="stay1" value="1" ' . ($stay == '1' ? ' selected="selected"' : '') . '>' . $_lang['stay_new'] . '</option>
346
-						' : '') . '
347
-						<option id="stay2" value="2" ' . ($stay == '2' ? ' selected="selected"' : '') . '>' . $_lang['stay'] . '</option>
348
-						<option id="stay3" value="" ' . ($stay == '' ? ' selected="selected"' : '') . '>' . $_lang['close'] . '</option>
345
+							<option id="stay1" value="1" ' . ($stay == '1' ? ' selected="selected"' : '').'>'.$_lang['stay_new'].'</option>
346
+						' : '').'
347
+						<option id="stay2" value="2" ' . ($stay == '2' ? ' selected="selected"' : '').'>'.$_lang['stay'].'</option>
348
+						<option id="stay3" value="" ' . ($stay == '' ? ' selected="selected"' : '').'>'.$_lang['close'].'</option>
349 349
 					</select>
350 350
 				</div>' .
351 351
 					($addnew ? '
352
-					<a id="Button6" class="btn btn-secondary' . $disabled . '" href="javascript:;" onclick="actions.duplicate();">
353
-						<i class="' . $_style["actions_duplicate"] . '"></i><span>' . $_lang['duplicate'] . '</span>
352
+					<a id="Button6" class="btn btn-secondary' . $disabled.'" href="javascript:;" onclick="actions.duplicate();">
353
+						<i class="' . $_style["actions_duplicate"].'"></i><span>'.$_lang['duplicate'].'</span>
354 354
 					</a>
355
-					' : '') . '
356
-				<a id="Button3" class="btn btn-secondary' . $disabled . '" href="javascript:;" onclick="actions.delete();">
357
-					<i class="' . $_style["actions_delete"] . '"></i><span>' . $_lang['delete'] . '</span>
355
+					' : '').'
356
+				<a id="Button3" class="btn btn-secondary' . $disabled.'" href="javascript:;" onclick="actions.delete();">
357
+					<i class="' . $_style["actions_delete"].'"></i><span>'.$_lang['delete'].'</span>
358 358
 				</a>
359 359
 				<a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.cancel();">
360
-					<i class="' . $_style["actions_cancel"] . '"></i><span>' . $_lang['cancel'] . '</span>
360
+					<i class="' . $_style["actions_cancel"].'"></i><span>'.$_lang['cancel'].'</span>
361 361
 				</a>
362 362
 				<a id="Button4" class="btn btn-secondary" href="javascript:;" onclick="actions.view();">
363
-					<i class="' . $_style["actions_preview"] . '"></i><span>' . $_lang['preview'] . '</span>
363
+					<i class="' . $_style["actions_preview"].'"></i><span>'.$_lang['preview'].'</span>
364 364
 				</a>
365 365
 			</div>
366 366
 		</div>',
@@ -368,22 +368,22 @@  discard block
 block discarded – undo
368 368
 			<div class="btn-group">
369 369
 				<div class="btn-group">
370 370
 					<a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.save();">
371
-						<i class="' . $_style["actions_save"] . '"></i><span>' . $_lang['save'] . '</span>
371
+						<i class="' . $_style["actions_save"].'"></i><span>'.$_lang['save'].'</span>
372 372
 					</a>
373 373
 					<span class="btn btn-success plus dropdown-toggle"></span>
374 374
 					<select id="stay" name="stay">
375 375
 						' . ($addnew ? '
376
-							<option id="stay1" value="1" ' . ($stay == '1' ? ' selected="selected"' : '') . '>' . $_lang['stay_new'] . '</option>
377
-						' : '') . '
378
-						<option id="stay2" value="2" ' . ($stay == '2' ? ' selected="selected"' : '') . '>' . $_lang['stay'] . '</option>
379
-						<option id="stay3" value="" ' . ($stay == '' ? ' selected="selected"' : '') . '>' . $_lang['close'] . '</option>
376
+							<option id="stay1" value="1" ' . ($stay == '1' ? ' selected="selected"' : '').'>'.$_lang['stay_new'].'</option>
377
+						' : '').'
378
+						<option id="stay2" value="2" ' . ($stay == '2' ? ' selected="selected"' : '').'>'.$_lang['stay'].'</option>
379
+						<option id="stay3" value="" ' . ($stay == '' ? ' selected="selected"' : '').'>'.$_lang['close'].'</option>
380 380
 					</select>
381 381
 				</div>
382
-				<a id="Button3" class="btn btn-secondary' . $disabled . '" href="javascript:;" onclick="actions.delete();">
383
-					<i class="' . $_style["actions_delete"] . '"></i><span>' . $_lang['delete'] . '</span>
382
+				<a id="Button3" class="btn btn-secondary' . $disabled.'" href="javascript:;" onclick="actions.delete();">
383
+					<i class="' . $_style["actions_delete"].'"></i><span>'.$_lang['delete'].'</span>
384 384
 				</a>
385 385
 				<a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.cancel();">
386
-					<i class="' . $_style["actions_cancel"] . '"></i><span>' . $_lang['cancel'] . '</span>
386
+					<i class="' . $_style["actions_cancel"].'"></i><span>'.$_lang['cancel'].'</span>
387 387
 				</a>
388 388
 			</div>
389 389
 		</div>',
@@ -391,86 +391,86 @@  discard block
 block discarded – undo
391 391
 			<div class="btn-group">
392 392
 				<div class="btn-group">
393 393
 					<a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.save();">
394
-						<i class="' . $_style["actions_save"] . '"></i><span>' . $_lang['save'] . '</span>
394
+						<i class="' . $_style["actions_save"].'"></i><span>'.$_lang['save'].'</span>
395 395
 					</a>
396 396
 					<span class="btn btn-success plus dropdown-toggle"></span>
397 397
 					<select id="stay" name="stay">
398 398
 						' . ($addnew ? '
399
-							<option id="stay1" value="1" ' . ($stay == '1' ? ' selected="selected"' : '') . '>' . $_lang['stay_new'] . '</option>
400
-						' : '') . '
401
-						<option id="stay2" value="2" ' . ($stay == '2' ? ' selected="selected"' : '') . '>' . $_lang['stay'] . '</option>
402
-						<option id="stay3" value="" ' . ($stay == '' ? ' selected="selected"' : '') . '>' . $_lang['close'] . '</option>
399
+							<option id="stay1" value="1" ' . ($stay == '1' ? ' selected="selected"' : '').'>'.$_lang['stay_new'].'</option>
400
+						' : '').'
401
+						<option id="stay2" value="2" ' . ($stay == '2' ? ' selected="selected"' : '').'>'.$_lang['stay'].'</option>
402
+						<option id="stay3" value="" ' . ($stay == '' ? ' selected="selected"' : '').'>'.$_lang['close'].'</option>
403 403
 					</select>
404 404
 				</div>
405 405
 				' . ($addnew ? '
406
-				<a id="Button6" class="btn btn-secondary' . $disabled . '" href="javascript:;" onclick="actions.duplicate();">
407
-					<i class="' . $_style["actions_duplicate"] . '"></i><span>' . $_lang['duplicate'] . '</span>
406
+				<a id="Button6" class="btn btn-secondary' . $disabled.'" href="javascript:;" onclick="actions.duplicate();">
407
+					<i class="' . $_style["actions_duplicate"].'"></i><span>'.$_lang['duplicate'].'</span>
408 408
 				</a>
409
-				' : '') . '
410
-				<a id="Button3" class="btn btn-secondary' . $disabled . '" href="javascript:;" onclick="actions.delete();">
411
-					<i class="' . $_style["actions_delete"] . '"></i><span>' . $_lang['delete'] . '</span>
409
+				' : '').'
410
+				<a id="Button3" class="btn btn-secondary' . $disabled.'" href="javascript:;" onclick="actions.delete();">
411
+					<i class="' . $_style["actions_delete"].'"></i><span>'.$_lang['delete'].'</span>
412 412
 				</a>
413 413
 				<a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.cancel();">
414
-					<i class="' . $_style["actions_cancel"] . '"></i><span>' . $_lang['cancel'] . '</span>
414
+					<i class="' . $_style["actions_cancel"].'"></i><span>'.$_lang['cancel'].'</span>
415 415
 				</a>
416 416
 				' . ($run ? '
417
-				<a id="Button4" class="btn btn-secondary' . $disabled . '" href="javascript:;" onclick="actions.run();">
418
-					<i class="' . $_style["actions_run"] . '"></i><span>' . $_lang['run_module'] . '</span>
417
+				<a id="Button4" class="btn btn-secondary' . $disabled.'" href="javascript:;" onclick="actions.run();">
418
+					<i class="' . $_style["actions_run"].'"></i><span>'.$_lang['run_module'].'</span>
419 419
 				</a>
420
-				' : '') . '
420
+				' : '').'
421 421
 			</div>
422 422
 		</div>',
423 423
 		'newmodule' => ($addnew ? '<div id="actions">
424 424
 			<div class="btn-group">
425 425
 				<a id="newModule" class="btn btn-secondary" href="javascript:;" onclick="actions.new();">
426
-					<i class="' . $_style["actions_new"] . '"></i><span>' . $_lang['new_module'] . '</span>
426
+					<i class="' . $_style["actions_new"].'"></i><span>'.$_lang['new_module'].'</span>
427 427
 				</a>
428 428
 			</div>
429 429
 		</div>' : ''),
430 430
 		'close' => '<div id="actions">
431 431
 			<div class="btn-group">
432 432
 				<a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.close();">
433
-					<i class="' . $_style["actions_close"] . '"></i><span>' . $_lang['close'] . '</span>
433
+					<i class="' . $_style["actions_close"].'"></i><span>'.$_lang['close'].'</span>
434 434
 				</a>
435 435
 			</div>
436 436
 		</div>',
437 437
 		'save' => '<div id="actions">
438 438
 			<div class="btn-group">
439 439
 				<a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.save();">
440
-					<i class="' . $_style["actions_save"] . '"></i><span>' . $_lang['save'] . '</span>
440
+					<i class="' . $_style["actions_save"].'"></i><span>'.$_lang['save'].'</span>
441 441
 				</a>
442 442
 				<a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.cancel();">
443
-					<i class="' . $_style["actions_cancel"] . '"></i><span>' . $_lang['cancel'] . '</span>
443
+					<i class="' . $_style["actions_cancel"].'"></i><span>'.$_lang['cancel'].'</span>
444 444
 				</a>
445 445
 			</div>
446 446
 		</div>',
447 447
 		'savedelete' => '<div id="actions">
448 448
 			<div class="btn-group">
449 449
 				<a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.save();">
450
-					<i class="' . $_style["actions_save"] . '"></i><span>' . $_lang['save'] . '</span>
450
+					<i class="' . $_style["actions_save"].'"></i><span>'.$_lang['save'].'</span>
451 451
 				</a>
452
-				<a id="Button3" class="btn btn-secondary' . $disabled . '" href="javascript:;" onclick="actions.delete();">
453
-					<i class="' . $_style["actions_delete"] . '"></i><span>' . $_lang['delete'] . '</span>
452
+				<a id="Button3" class="btn btn-secondary' . $disabled.'" href="javascript:;" onclick="actions.delete();">
453
+					<i class="' . $_style["actions_delete"].'"></i><span>'.$_lang['delete'].'</span>
454 454
 				</a>
455 455
 				<a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.cancel();">
456
-					<i class="' . $_style["actions_cancel"] . '"></i><span>' . $_lang['cancel'] . '</span>
456
+					<i class="' . $_style["actions_cancel"].'"></i><span>'.$_lang['cancel'].'</span>
457 457
 				</a>
458 458
 			</div>
459 459
 		</div>',
460 460
 		'cancel' => '<div id="actions">
461 461
 			<div class="btn-group">
462 462
 				<a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.cancel();">
463
-					<i class="' . $_style["actions_cancel"] . '"></i><span>' . $_lang['cancel'] . '</span>
463
+					<i class="' . $_style["actions_cancel"].'"></i><span>'.$_lang['cancel'].'</span>
464 464
 				</a>
465 465
 			</div>
466 466
 		</div>',
467 467
 		'canceldelete' => '<div id="actions">
468 468
 			<div class="btn-group">
469
-				<a id="Button3" class="btn btn-secondary' . $disabled . '" href="javascript:;" onclick="actions.delete();">
470
-					<i class="' . $_style["actions_delete"] . '"></i><span>' . $_lang['delete'] . '</span>
469
+				<a id="Button3" class="btn btn-secondary' . $disabled.'" href="javascript:;" onclick="actions.delete();">
470
+					<i class="' . $_style["actions_delete"].'"></i><span>'.$_lang['delete'].'</span>
471 471
 				</a>
472 472
 				<a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.cancel();">
473
-					<i class="' . $_style["actions_cancel"] . '"></i><span>' . $_lang['cancel'] . '</span>
473
+					<i class="' . $_style["actions_cancel"].'"></i><span>'.$_lang['cancel'].'</span>
474 474
 				</a>
475 475
 			</div>
476 476
 		</div>',
@@ -480,33 +480,33 @@  discard block
 block discarded – undo
480 480
 			<div class="btn-group">' .
481 481
 				($addnew ? '
482 482
 					<a class="btn btn-secondary" href="javascript:;" onclick="actions.new();">
483
-						<i class="' . $_style["icons_new_document"] . '"></i><span>' . $_lang['create_resource_here'] . '</span>
483
+						<i class="' . $_style["icons_new_document"].'"></i><span>'.$_lang['create_resource_here'].'</span>
484 484
 					</a>
485 485
 					<a class="btn btn-secondary" href="javascript:;" onclick="actions.newlink();">
486
-						<i class="' . $_style["icons_new_weblink"] . '"></i><span>' . $_lang['create_weblink_here'] . '</span>
486
+						<i class="' . $_style["icons_new_weblink"].'"></i><span>'.$_lang['create_weblink_here'].'</span>
487 487
 					</a>
488
-				' : '') . '
488
+				' : '').'
489 489
 				<a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.edit();">
490
-					<i class="' . $_style["actions_edit"] . '"></i><span>' . $_lang['edit'] . '</span>
490
+					<i class="' . $_style["actions_edit"].'"></i><span>'.$_lang['edit'].'</span>
491 491
 				</a>
492 492
 				<a id="Button2" class="btn btn-secondary" href="javascript:;" onclick="actions.move();">
493
-					<i class="' . $_style["actions_move"] . '"></i><span>' . $_lang['move'] . '</span>
493
+					<i class="' . $_style["actions_move"].'"></i><span>'.$_lang['move'].'</span>
494 494
 				</a>
495 495
 				<a id="Button6" class="btn btn-secondary" href="javascript:;" onclick="actions.duplicate();">
496
-					<i class="' . $_style["actions_duplicate"] . '"></i><span>' . $_lang['duplicate'] . '</span>
496
+					<i class="' . $_style["actions_duplicate"].'"></i><span>'.$_lang['duplicate'].'</span>
497 497
 				</a>
498 498
 				<a id="Button3" class="btn btn-secondary" href="javascript:;" onclick="actions.delete();">
499
-					<i class="' . $_style["actions_delete"] . '"></i><span>' . $_lang['delete'] . '</span>
499
+					<i class="' . $_style["actions_delete"].'"></i><span>'.$_lang['delete'].'</span>
500 500
 				</a>
501 501
 				<a id="Button4" class="btn btn-secondary" href="javascript:;" onclick="actions.view();">
502
-					<i class="' . $_style["actions_preview"] . '"></i><span>' . $_lang['preview'] . '</span>
502
+					<i class="' . $_style["actions_preview"].'"></i><span>'.$_lang['preview'].'</span>
503 503
 				</a>
504 504
 			</div>
505 505
 		</div>',
506 506
 		'cancel' => '<div id="actions">
507 507
 			<div class="btn-group">
508 508
 				<a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.cancel();">
509
-					<i class="' . $_style["actions_cancel"] . '"></i><span>' . $_lang['cancel'] . '</span>
509
+					<i class="' . $_style["actions_cancel"].'"></i><span>'.$_lang['cancel'].'</span>
510 510
 				</a>
511 511
 			</div>
512 512
 		</div>',
Please login to merge, or discard this patch.
Braces   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -10,12 +10,12 @@  discard block
 block discarded – undo
10 10
  */
11 11
 $style_path = 'media/style/' . $modx->config['manager_theme'] . '/images/';
12 12
 $modx->config['mgr_date_picker_path'] = 'media/calendar/datepicker.inc.php';
13
-if(!$modx->config['lang_code']) {
13
+if(!$modx->config['lang_code']) {
14 14
 	global $modx_lang_attribute;
15 15
 	$modx->config['lang_code'] = !$modx_lang_attribute ? 'en' : $modx_lang_attribute;
16 16
 }
17 17
 
18
-if($_GET['a'] == 2) {
18
+if($_GET['a'] == 2) {
19 19
 	include_once('welcome.php');
20 20
 }
21 21
 
@@ -262,68 +262,68 @@  discard block
 block discarded – undo
262 262
 
263 263
 // actions buttons templates
264 264
 $action = isset($_REQUEST['a']) ? $_REQUEST['a'] : '';
265
-if (!empty($modx->config['global_tabs']) && !isset($_SESSION['stay'])) {
265
+if (!empty($modx->config['global_tabs']) && !isset($_SESSION['stay'])) {
266 266
     $_REQUEST['stay'] = 2;
267 267
 }
268
-if (isset($_REQUEST['stay'])) {
268
+if (isset($_REQUEST['stay'])) {
269 269
     $_SESSION['stay'] = $_REQUEST['stay'];
270
-} else if (isset($_SESSION['stay'])) {
270
+} else if (isset($_SESSION['stay'])) {
271 271
     $_REQUEST['stay'] = $_SESSION['stay'];
272 272
 }
273 273
 $stay = isset($_REQUEST['stay']) ? $_REQUEST['stay'] : '';
274 274
 $addnew = 0;
275 275
 $run = 0;
276
-switch($action) {
276
+switch($action) {
277 277
 	case '3':
278 278
 	case '4':
279 279
 	case '27':
280 280
 	case '72':
281
-		if($modx->hasPermission('new_document')) {
281
+		if($modx->hasPermission('new_document')) {
282 282
 			$addnew = 1;
283 283
 		}
284 284
 		break;
285 285
 	case '16':
286 286
 	case '19':
287
-		if($modx->hasPermission('new_template')) {
287
+		if($modx->hasPermission('new_template')) {
288 288
 			$addnew = 1;
289 289
 		}
290 290
 		break;
291 291
 	case '300':
292 292
 	case '301':
293
-		if($modx->hasPermission('new_snippet') && $modx->hasPermission('new_chunk') && $modx->hasPermission('new_plugin')) {
293
+		if($modx->hasPermission('new_snippet') && $modx->hasPermission('new_chunk') && $modx->hasPermission('new_plugin')) {
294 294
 			$addnew = 1;
295 295
 		}
296 296
 		break;
297 297
 	case '77':
298 298
 	case '78':
299
-		if($modx->hasPermission('new_chunk')) {
299
+		if($modx->hasPermission('new_chunk')) {
300 300
 			$addnew = 1;
301 301
 		}
302 302
 		break;
303 303
 	case '22':
304 304
 	case '23':
305
-		if($modx->hasPermission('new_snippet')) {
305
+		if($modx->hasPermission('new_snippet')) {
306 306
 			$addnew = 1;
307 307
 		}
308 308
 		break;
309 309
 	case '101':
310 310
 	case '102':
311
-		if($modx->hasPermission('new_plugin')) {
311
+		if($modx->hasPermission('new_plugin')) {
312 312
 			$addnew = 1;
313 313
 		}
314 314
 		break;
315 315
 	case '106':
316 316
 	case '107':
317 317
 	case '108':
318
-		if($modx->hasPermission('new_module')) {
318
+		if($modx->hasPermission('new_module')) {
319 319
 			$addnew = 1;
320 320
 		}
321
-		if($modx->hasPermission('exec_module')) {
321
+		if($modx->hasPermission('exec_module')) {
322 322
 			$run = 1;
323 323
 		}
324 324
 		break;
325 325
 	case '88':
326
-		if($modx->hasPermission('new_web_user')) {
326
+		if($modx->hasPermission('new_web_user')) {
327 327
 			$addnew = 1;
328 328
 		}
329 329
 		break;
Please login to merge, or discard this patch.
manager/media/style/common/moo-datepicker/datepicker.inc.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
1 1
 <?php
2
-class DATEPICKER {
3
-    function __construct() {
2
+class DATEPICKER{
3
+    function __construct(){
4 4
     }
5
-    function getDP() {
6
-        global $modx,$_lang;
5
+    function getDP(){
6
+        global $modx, $_lang;
7 7
         
8 8
         $tpl = file_get_contents(dirname(__FILE__).'/datepicker.tpl');
9
-        return $modx->parseText($tpl,$_lang,'[%','%]');
9
+        return $modx->parseText($tpl, $_lang, '[%', '%]');
10 10
     }
11 11
 }
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,8 +1,11 @@
 block discarded – undo
1 1
 <?php
2
-class DATEPICKER {
3
-    function __construct() {
2
+class DATEPICKER
3
+{
4
+    function __construct()
5
+    {
4 6
     }
5
-    function getDP() {
7
+    function getDP()
8
+    {
6 9
         global $modx,$_lang;
7 10
         
8 11
         $tpl = file_get_contents(dirname(__FILE__).'/datepicker.tpl');
Please login to merge, or discard this patch.
manager/media/rss/rss_utils.inc 2 patches
Braces   +4 added lines, -5 removed lines patch added patch discarded remove patch
@@ -22,7 +22,8 @@  discard block
 block discarded – undo
22 22
     NOTE: http://www.w3.org/TR/NOTE-datetime
23 23
 \*======================================================================*/
24 24
 
25
-function parse_w3cdtf ( $date_str ) {
25
+function parse_w3cdtf ( $date_str )
26
+{
26 27
     
27 28
     # regex to match wc3dtf
28 29
     $pat = "/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(:(\d{2}))?(?:([-+])(\d{2}):?(\d{2})|(Z))?/";
@@ -37,8 +38,7 @@  discard block
 block discarded – undo
37 38
         $offset = 0;
38 39
         if ( $match[10] == 'Z' ) {
39 40
             # zulu time, aka GMT
40
-        }
41
-        else {
41
+        } else {
42 42
             list( $tz_mod, $tz_hour, $tz_min ) =
43 43
                 array( $match[8], $match[9], $match[10]);
44 44
             
@@ -58,8 +58,7 @@  discard block
 block discarded – undo
58 58
         }
59 59
         $epoch = $epoch + $offset;
60 60
         return $epoch;
61
-    }
62
-    else {
61
+    } else {
63 62
         return -1;
64 63
     }
65 64
 }
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -22,35 +22,35 @@
 block discarded – undo
22 22
     NOTE: http://www.w3.org/TR/NOTE-datetime
23 23
 \*======================================================================*/
24 24
 
25
-function parse_w3cdtf ( $date_str ) {
25
+function parse_w3cdtf($date_str){
26 26
 
27 27
     # regex to match wc3dtf
28 28
     $pat = "/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(:(\d{2}))?(?:([-+])(\d{2}):?(\d{2})|(Z))?/";
29 29
 
30
-    if ( preg_match( $pat, $date_str, $match ) ) {
31
-        list( $year, $month, $day, $hours, $minutes, $seconds) =
32
-            array( $match[1], $match[2], $match[3], $match[4], $match[5], $match[6]);
30
+    if (preg_match($pat, $date_str, $match)) {
31
+        list($year, $month, $day, $hours, $minutes, $seconds) =
32
+            array($match[1], $match[2], $match[3], $match[4], $match[5], $match[6]);
33 33
 
34 34
         # calc epoch for current date assuming GMT
35
-        $epoch = gmmktime( $hours, $minutes, $seconds, $month, $day, $year);
35
+        $epoch = gmmktime($hours, $minutes, $seconds, $month, $day, $year);
36 36
 
37 37
         $offset = 0;
38
-        if ( $match[10] == 'Z' ) {
38
+        if ($match[10] == 'Z') {
39 39
             # zulu time, aka GMT
40 40
         }
41 41
         else {
42
-            list( $tz_mod, $tz_hour, $tz_min ) =
43
-                array( $match[8], $match[9], $match[10]);
42
+            list($tz_mod, $tz_hour, $tz_min) =
43
+                array($match[8], $match[9], $match[10]);
44 44
 
45 45
             # zero out the variables
46
-            if ( ! $tz_hour ) { $tz_hour = 0; }
47
-            if ( ! $tz_min ) { $tz_min = 0; }
46
+            if (!$tz_hour) { $tz_hour = 0; }
47
+            if (!$tz_min) { $tz_min = 0; }
48 48
 
49
-            $offset_secs = (($tz_hour*60)+$tz_min)*60;
49
+            $offset_secs = (($tz_hour * 60) + $tz_min) * 60;
50 50
 
51 51
             # is timezone ahead of GMT?  then subtract offset
52 52
             #
53
-            if ( $tz_mod == '+' ) {
53
+            if ($tz_mod == '+') {
54 54
                 $offset_secs = $offset_secs * -1;
55 55
             }
56 56
 
Please login to merge, or discard this patch.
manager/includes/default_config.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-$c  = &$settings;
3
+$c = &$settings;
4 4
 
5 5
 $c['site_name']                = 'My MODX Site';
6 6
 $c['site_start']               = 1;
Please login to merge, or discard this patch.
manager/includes/charsets.php 2 patches
Braces   +31 added lines, -15 removed lines patch added patch discarded remove patch
@@ -65,21 +65,37 @@
 block discarded – undo
65 65
 $_['macintosh']         = 'Western European (Mac) - macintosh';
66 66
 $_['Windows-1252']      = 'Western European (Windows) - Windows-1252';
67 67
 
68
-if($modx_charset     == 'euc-jp')      $_['euc-jp']      = 'Japanese (EUC) - euc-jp';
69
-elseif($modx_charset == 'shift_jis')   $_['shift_jis']   = 'Japanese (Shift-JIS) - shift_jis';
70
-elseif($modx_charset == 'iso-2022-jp') $_['iso-2022-jp'] = 'Japanese (JIS-Allow 1 byte Kana - SO/SI) - iso-2022-jp';
71
-elseif($modx_charset == 'csISO2022JP') $_['csISO2022JP'] = 'Japanese (JIS-Allow 1 byte Kana) - csISO2022JP';
72
-elseif($modx_charset == 'EUC-CN')            $_['EUC-CN']            = 'Chinese Simplified (EUC) - EUC-CN';
73
-elseif($modx_charset == 'hz-gb-2312')        $_['hz-gb-2312']        = 'Chinese Simplified (HZ) - hz-gb-2312';
74
-elseif($modx_charset == 'x-mac-chinesesimp') $_['x-mac-chinesesimp'] = 'Chinese Simplified (Mac) - x-mac-chinesesimp';
75
-elseif($modx_charset == 'x-Chinese-CNS')     $_['x-Chinese-CNS']     = 'Chinese Traditional (CNS) - x-Chinese-CNS';
76
-elseif($modx_charset == 'x-Chinese-Eten')    $_['x-Chinese-Eten']    = 'Chinese Traditional (Eten) - x-Chinese-Eten';
77
-elseif($modx_charset == 'x-mac-chinesetrad') $_['x-mac-chinesetrad'] = 'Chinese Traditional (Mac) - x-mac-chinesetrad';
78
-elseif($modx_charset == 'ks_c_5601-1987') $_['ks_c_5601-1987'] = 'Korean - ks_c_5601-1987';
79
-elseif($modx_charset == 'euc-kr')         $_['euc-kr']         = 'Korean (EUC) - euc-kr';
80
-elseif($modx_charset == 'iso-2022-kr')    $_['iso-2022-kr']    = 'Korean (ISO) - iso-2022-kr';
81
-elseif($modx_charset == 'Johab')          $_['Johab']          = 'Korean (Johab) - Johab';
82
-elseif($modx_charset == 'x-mac-korean')   $_['x-mac-korean']   = 'Korean (Mac) - x-mac-korean';
68
+if($modx_charset     == 'euc-jp') {
69
+    $_['euc-jp']      = 'Japanese (EUC) - euc-jp';
70
+} elseif($modx_charset == 'shift_jis') {
71
+    $_['shift_jis']   = 'Japanese (Shift-JIS) - shift_jis';
72
+} elseif($modx_charset == 'iso-2022-jp') {
73
+    $_['iso-2022-jp'] = 'Japanese (JIS-Allow 1 byte Kana - SO/SI) - iso-2022-jp';
74
+} elseif($modx_charset == 'csISO2022JP') {
75
+    $_['csISO2022JP'] = 'Japanese (JIS-Allow 1 byte Kana) - csISO2022JP';
76
+} elseif($modx_charset == 'EUC-CN') {
77
+    $_['EUC-CN']            = 'Chinese Simplified (EUC) - EUC-CN';
78
+} elseif($modx_charset == 'hz-gb-2312') {
79
+    $_['hz-gb-2312']        = 'Chinese Simplified (HZ) - hz-gb-2312';
80
+} elseif($modx_charset == 'x-mac-chinesesimp') {
81
+    $_['x-mac-chinesesimp'] = 'Chinese Simplified (Mac) - x-mac-chinesesimp';
82
+} elseif($modx_charset == 'x-Chinese-CNS') {
83
+    $_['x-Chinese-CNS']     = 'Chinese Traditional (CNS) - x-Chinese-CNS';
84
+} elseif($modx_charset == 'x-Chinese-Eten') {
85
+    $_['x-Chinese-Eten']    = 'Chinese Traditional (Eten) - x-Chinese-Eten';
86
+} elseif($modx_charset == 'x-mac-chinesetrad') {
87
+    $_['x-mac-chinesetrad'] = 'Chinese Traditional (Mac) - x-mac-chinesetrad';
88
+} elseif($modx_charset == 'ks_c_5601-1987') {
89
+    $_['ks_c_5601-1987'] = 'Korean - ks_c_5601-1987';
90
+} elseif($modx_charset == 'euc-kr') {
91
+    $_['euc-kr']         = 'Korean (EUC) - euc-kr';
92
+} elseif($modx_charset == 'iso-2022-kr') {
93
+    $_['iso-2022-kr']    = 'Korean (ISO) - iso-2022-kr';
94
+} elseif($modx_charset == 'Johab') {
95
+    $_['Johab']          = 'Korean (Johab) - Johab';
96
+} elseif($modx_charset == 'x-mac-korean') {
97
+    $_['x-mac-korean']   = 'Korean (Mac) - x-mac-korean';
98
+}
83 99
 
84 100
 $tpl = '<option value="%s" %s>%s</option>';
85 101
 $options = array();
Please login to merge, or discard this patch.
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -65,26 +65,26 @@
 block discarded – undo
65 65
 $_['macintosh']         = 'Western European (Mac) - macintosh';
66 66
 $_['Windows-1252']      = 'Western European (Windows) - Windows-1252';
67 67
 
68
-if($modx_charset     == 'euc-jp')      $_['euc-jp']      = 'Japanese (EUC) - euc-jp';
69
-elseif($modx_charset == 'shift_jis')   $_['shift_jis']   = 'Japanese (Shift-JIS) - shift_jis';
70
-elseif($modx_charset == 'iso-2022-jp') $_['iso-2022-jp'] = 'Japanese (JIS-Allow 1 byte Kana - SO/SI) - iso-2022-jp';
71
-elseif($modx_charset == 'csISO2022JP') $_['csISO2022JP'] = 'Japanese (JIS-Allow 1 byte Kana) - csISO2022JP';
72
-elseif($modx_charset == 'EUC-CN')            $_['EUC-CN']            = 'Chinese Simplified (EUC) - EUC-CN';
73
-elseif($modx_charset == 'hz-gb-2312')        $_['hz-gb-2312']        = 'Chinese Simplified (HZ) - hz-gb-2312';
74
-elseif($modx_charset == 'x-mac-chinesesimp') $_['x-mac-chinesesimp'] = 'Chinese Simplified (Mac) - x-mac-chinesesimp';
75
-elseif($modx_charset == 'x-Chinese-CNS')     $_['x-Chinese-CNS']     = 'Chinese Traditional (CNS) - x-Chinese-CNS';
76
-elseif($modx_charset == 'x-Chinese-Eten')    $_['x-Chinese-Eten']    = 'Chinese Traditional (Eten) - x-Chinese-Eten';
77
-elseif($modx_charset == 'x-mac-chinesetrad') $_['x-mac-chinesetrad'] = 'Chinese Traditional (Mac) - x-mac-chinesetrad';
78
-elseif($modx_charset == 'ks_c_5601-1987') $_['ks_c_5601-1987'] = 'Korean - ks_c_5601-1987';
79
-elseif($modx_charset == 'euc-kr')         $_['euc-kr']         = 'Korean (EUC) - euc-kr';
80
-elseif($modx_charset == 'iso-2022-kr')    $_['iso-2022-kr']    = 'Korean (ISO) - iso-2022-kr';
81
-elseif($modx_charset == 'Johab')          $_['Johab']          = 'Korean (Johab) - Johab';
82
-elseif($modx_charset == 'x-mac-korean')   $_['x-mac-korean']   = 'Korean (Mac) - x-mac-korean';
68
+if ($modx_charset == 'euc-jp')      $_['euc-jp']      = 'Japanese (EUC) - euc-jp';
69
+elseif ($modx_charset == 'shift_jis')   $_['shift_jis']   = 'Japanese (Shift-JIS) - shift_jis';
70
+elseif ($modx_charset == 'iso-2022-jp') $_['iso-2022-jp'] = 'Japanese (JIS-Allow 1 byte Kana - SO/SI) - iso-2022-jp';
71
+elseif ($modx_charset == 'csISO2022JP') $_['csISO2022JP'] = 'Japanese (JIS-Allow 1 byte Kana) - csISO2022JP';
72
+elseif ($modx_charset == 'EUC-CN')            $_['EUC-CN']            = 'Chinese Simplified (EUC) - EUC-CN';
73
+elseif ($modx_charset == 'hz-gb-2312')        $_['hz-gb-2312']        = 'Chinese Simplified (HZ) - hz-gb-2312';
74
+elseif ($modx_charset == 'x-mac-chinesesimp') $_['x-mac-chinesesimp'] = 'Chinese Simplified (Mac) - x-mac-chinesesimp';
75
+elseif ($modx_charset == 'x-Chinese-CNS')     $_['x-Chinese-CNS']     = 'Chinese Traditional (CNS) - x-Chinese-CNS';
76
+elseif ($modx_charset == 'x-Chinese-Eten')    $_['x-Chinese-Eten']    = 'Chinese Traditional (Eten) - x-Chinese-Eten';
77
+elseif ($modx_charset == 'x-mac-chinesetrad') $_['x-mac-chinesetrad'] = 'Chinese Traditional (Mac) - x-mac-chinesetrad';
78
+elseif ($modx_charset == 'ks_c_5601-1987') $_['ks_c_5601-1987'] = 'Korean - ks_c_5601-1987';
79
+elseif ($modx_charset == 'euc-kr')         $_['euc-kr']         = 'Korean (EUC) - euc-kr';
80
+elseif ($modx_charset == 'iso-2022-kr')    $_['iso-2022-kr']    = 'Korean (ISO) - iso-2022-kr';
81
+elseif ($modx_charset == 'Johab')          $_['Johab']          = 'Korean (Johab) - Johab';
82
+elseif ($modx_charset == 'x-mac-korean')   $_['x-mac-korean']   = 'Korean (Mac) - x-mac-korean';
83 83
 
84 84
 $tpl = '<option value="%s" %s>%s</option>';
85 85
 $options = array();
86
-foreach($_ as $value=>$label) {
87
-    $selected = $value===$modx_charset ? 'selected' : '';
86
+foreach ($_ as $value=>$label) {
87
+    $selected = $value === $modx_charset ? 'selected' : '';
88 88
     $options[] = sprintf($tpl, $value, $selected, $label);
89 89
 }
90 90
 echo implode("\n", $options);
Please login to merge, or discard this patch.
manager/includes/tmplvars.commands.inc.php 5 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
                     $modx->setPlaceholder($rvKey, $rvValue);
56 56
                 }
57 57
                 $param = $modx->mergePlaceholderContent($param);
58
-                $rs = $modx->db->query("SELECT $param;");
58
+                $rs = $modx->db->query("select $param;");
59 59
                 $output = $rs;
60 60
                 break;
61 61
 
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -163,7 +163,7 @@
 block discarded – undo
163 163
  *
164 164
  * @param string $param
165 165
  * @param array $tvsArray
166
- * @return mixed
166
+ * @return string
167 167
  */
168 168
 function parseTvValues($param, $tvsArray)
169 169
 {
Please login to merge, or discard this patch.
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -131,8 +131,8 @@  discard block
 block discarded – undo
131 131
  */
132 132
 function ProcessFile($file) {
133 133
     // get the file
134
-	$buffer = @file_get_contents($file);
135
-	if ($buffer === false) $buffer = " Could not retrieve document '$file'.";
134
+    $buffer = @file_get_contents($file);
135
+    if ($buffer === false) $buffer = " Could not retrieve document '$file'.";
136 136
     return $buffer;
137 137
 }
138 138
 
@@ -167,21 +167,21 @@  discard block
 block discarded – undo
167 167
  */
168 168
 function parseTvValues($param, $tvsArray)
169 169
 {
170
-	global $modx;
171
-	$tvsArray = is_array($modx->documentObject) ? array_merge($tvsArray, $modx->documentObject) : $tvsArray;
172
-	if (strpos($param, '[*') !== false) {
173
-		$matches = $modx->getTagsFromContent($param, '[*', '*]');
174
-		foreach ($matches[0] as $i=>$match) {
175
-			if(isset($tvsArray[ $matches[1][$i] ])) {
176
-				if(is_array($tvsArray[ $matches[1][$i] ])) {
177
-					$value = $tvsArray[$matches[1][$i]]['value'];
178
-					$value = $value === '' ? $tvsArray[$matches[1][$i]]['default_text'] : $value;
179
-				} else {
180
-					$value = $tvsArray[ $matches[1][$i] ];
181
-				}
182
-				$param = str_replace($match, $value, $param);
183
-			}
184
-		}
185
-	}
186
-	return $param;
170
+    global $modx;
171
+    $tvsArray = is_array($modx->documentObject) ? array_merge($tvsArray, $modx->documentObject) : $tvsArray;
172
+    if (strpos($param, '[*') !== false) {
173
+        $matches = $modx->getTagsFromContent($param, '[*', '*]');
174
+        foreach ($matches[0] as $i=>$match) {
175
+            if(isset($tvsArray[ $matches[1][$i] ])) {
176
+                if(is_array($tvsArray[ $matches[1][$i] ])) {
177
+                    $value = $tvsArray[$matches[1][$i]]['value'];
178
+                    $value = $value === '' ? $tvsArray[$matches[1][$i]]['default_text'] : $value;
179
+                } else {
180
+                    $value = $tvsArray[ $matches[1][$i] ];
181
+                }
182
+                $param = str_replace($match, $value, $param);
183
+            }
184
+        }
185
+    }
186
+    return $param;
187 187
 }
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
  * Created by Raymond Irving Feb, 2005
5 5
  */
6 6
 global $BINDINGS; // Array of supported bindings. must be upper case
7
-$BINDINGS = array (
7
+$BINDINGS = array(
8 8
     'FILE',
9 9
     'CHUNK',
10 10
     'DOCUMENT',
@@ -22,13 +22,13 @@  discard block
 block discarded – undo
22 22
  * @param array $tvsArray
23 23
  * @return string
24 24
  */
25
-function ProcessTVCommand($value, $name = '', $docid = '', $src='docform', $tvsArray = array()) {
25
+function ProcessTVCommand($value, $name = '', $docid = '', $src = 'docform', $tvsArray = array()){
26 26
     global $modx;
27
-    $docid = (int)$docid > 0 ? (int)$docid : $modx->documentIdentifier;
27
+    $docid = (int) $docid > 0 ? (int) $docid : $modx->documentIdentifier;
28 28
     $nvalue = trim($value);
29 29
     if (substr($nvalue, 0, 1) != '@')
30 30
         return $value;
31
-    elseif(isset($modx->config['enable_bindings']) && $modx->config['enable_bindings']!=1 && $src==='docform') {
31
+    elseif (isset($modx->config['enable_bindings']) && $modx->config['enable_bindings'] != 1 && $src === 'docform') {
32 32
         return '@Bindings is disabled.';
33 33
     }
34 34
     else {
@@ -54,8 +54,8 @@  discard block
 block discarded – undo
54 54
                 break;
55 55
 
56 56
             case "SELECT" : // selects a record from the cms database
57
-                $rt = array ();
58
-                $replacementVars = array (
57
+                $rt = array();
58
+                $replacementVars = array(
59 59
                     'DBASE' => $modx->db->config['dbase'],
60 60
                     'PREFIX' => $modx->db->config['table_prefix']
61 61
                 );
@@ -96,8 +96,8 @@  discard block
 block discarded – undo
96 96
                 break;
97 97
 
98 98
             case 'DIRECTORY' :
99
-                $files = array ();
100
-                $path = $modx->config['base_path'] . $param;
99
+                $files = array();
100
+                $path = $modx->config['base_path'].$param;
101 101
                 if (substr($path, -1, 1) != '/') {
102 102
                     $path .= '/';
103 103
                 }
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
  * @param $file
130 130
  * @return string
131 131
  */
132
-function ProcessFile($file) {
132
+function ProcessFile($file){
133 133
     // get the file
134 134
 	$buffer = @file_get_contents($file);
135 135
 	if ($buffer === false) $buffer = " Could not retrieve document '$file'.";
@@ -146,12 +146,12 @@  discard block
 block discarded – undo
146 146
 {
147 147
     global $BINDINGS;
148 148
     $binding_array = array();
149
-    foreach($BINDINGS as $cmd)
149
+    foreach ($BINDINGS as $cmd)
150 150
     {
151
-        if(strpos($binding_string,'@'.$cmd)===0)
151
+        if (strpos($binding_string, '@'.$cmd) === 0)
152 152
         {
153
-            $code = substr($binding_string,strlen($cmd)+1);
154
-            $binding_array = array($cmd,trim($code));
153
+            $code = substr($binding_string, strlen($cmd) + 1);
154
+            $binding_array = array($cmd, trim($code));
155 155
             break;
156 156
         }
157 157
     }
@@ -172,12 +172,12 @@  discard block
 block discarded – undo
172 172
 	if (strpos($param, '[*') !== false) {
173 173
 		$matches = $modx->getTagsFromContent($param, '[*', '*]');
174 174
 		foreach ($matches[0] as $i=>$match) {
175
-			if(isset($tvsArray[ $matches[1][$i] ])) {
176
-				if(is_array($tvsArray[ $matches[1][$i] ])) {
175
+			if (isset($tvsArray[$matches[1][$i]])) {
176
+				if (is_array($tvsArray[$matches[1][$i]])) {
177 177
 					$value = $tvsArray[$matches[1][$i]]['value'];
178 178
 					$value = $value === '' ? $tvsArray[$matches[1][$i]]['default_text'] : $value;
179 179
 				} else {
180
-					$value = $tvsArray[ $matches[1][$i] ];
180
+					$value = $tvsArray[$matches[1][$i]];
181 181
 				}
182 182
 				$param = str_replace($match, $value, $param);
183 183
 			}
Please login to merge, or discard this patch.
Braces   +22 added lines, -18 removed lines patch added patch discarded remove patch
@@ -22,16 +22,16 @@  discard block
 block discarded – undo
22 22
  * @param array $tvsArray
23 23
  * @return string
24 24
  */
25
-function ProcessTVCommand($value, $name = '', $docid = '', $src='docform', $tvsArray = array()) {
25
+function ProcessTVCommand($value, $name = '', $docid = '', $src='docform', $tvsArray = array())
26
+{
26 27
     global $modx;
27 28
     $docid = (int)$docid > 0 ? (int)$docid : $modx->documentIdentifier;
28 29
     $nvalue = trim($value);
29
-    if (substr($nvalue, 0, 1) != '@')
30
-        return $value;
31
-    elseif(isset($modx->config['enable_bindings']) && $modx->config['enable_bindings']!=1 && $src==='docform') {
30
+    if (substr($nvalue, 0, 1) != '@') {
31
+            return $value;
32
+    } elseif(isset($modx->config['enable_bindings']) && $modx->config['enable_bindings']!=1 && $src==='docform') {
32 33
         return '@Bindings is disabled.';
33
-    }
34
-    else {
34
+    } else {
35 35
         list ($cmd, $param) = ParseCommand($nvalue);
36 36
         $cmd = trim($cmd);
37 37
         $param = parseTvValues($param, $tvsArray);
@@ -47,10 +47,11 @@  discard block
 block discarded – undo
47 47
 
48 48
             case "DOCUMENT" : // retrieve a document and process it's content
49 49
                 $rs = $modx->getDocument($param);
50
-                if (is_array($rs))
51
-                    $output = $rs['content'];
52
-                else
53
-                    $output = "Unable to locate document $param";
50
+                if (is_array($rs)) {
51
+                                    $output = $rs['content'];
52
+                } else {
53
+                                    $output = "Unable to locate document $param";
54
+                }
54 55
                 break;
55 56
 
56 57
             case "SELECT" : // selects a record from the cms database
@@ -80,8 +81,10 @@  discard block
 block discarded – undo
80 81
 
81 82
                     // Grab document regardless of publish status
82 83
                     $doc = $modx->getPageInfo($parent_id, 0, 'id,parent,published');
83
-                    if ($doc['parent'] != 0 && !$doc['published'])
84
-                        continue; // hide unpublished docs if we're not at the top
84
+                    if ($doc['parent'] != 0 && !$doc['published']) {
85
+                                            continue;
86
+                    }
87
+                    // hide unpublished docs if we're not at the top
85 88
 
86 89
                     $tv = $modx->getTemplateVar($name, '*', $doc['id'], $doc['published']);
87 90
 
@@ -129,10 +132,13 @@  discard block
 block discarded – undo
129 132
  * @param $file
130 133
  * @return string
131 134
  */
132
-function ProcessFile($file) {
135
+function ProcessFile($file)
136
+{
133 137
     // get the file
134 138
 	$buffer = @file_get_contents($file);
135
-	if ($buffer === false) $buffer = " Could not retrieve document '$file'.";
139
+	if ($buffer === false) {
140
+	    $buffer = " Could not retrieve document '$file'.";
141
+	}
136 142
     return $buffer;
137 143
 }
138 144
 
@@ -146,10 +152,8 @@  discard block
 block discarded – undo
146 152
 {
147 153
     global $BINDINGS;
148 154
     $binding_array = array();
149
-    foreach($BINDINGS as $cmd)
150
-    {
151
-        if(strpos($binding_string,'@'.$cmd)===0)
152
-        {
155
+    foreach($BINDINGS as $cmd) {
156
+        if(strpos($binding_string,'@'.$cmd)===0) {
153 157
             $code = substr($binding_string,strlen($cmd)+1);
154 158
             $binding_array = array($cmd,trim($code));
155 159
             break;
Please login to merge, or discard this patch.
manager/includes/document.parser.class.inc.php 4 patches
Upper-Lower-Casing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -2224,11 +2224,11 @@  discard block
 block discarded – undo
2224 2224
         if (isset($this->snippetCache[$snip_name])) {
2225 2225
             $snippetObject['name'] = $snip_name;
2226 2226
             $snippetObject['content'] = $this->snippetCache[$snip_name];
2227
-            if (isset($this->snippetCache["{$snip_name}Props"])) {
2228
-                if (!isset($this->snippetCache["{$snip_name}Props"])) {
2229
-                    $this->snippetCache["{$snip_name}Props"] = '';
2227
+            if (isset($this->snippetCache["{$snip_name}props"])) {
2228
+                if (!isset($this->snippetCache["{$snip_name}props"])) {
2229
+                    $this->snippetCache["{$snip_name}props"] = '';
2230 2230
                 }
2231
-                $snippetObject['properties'] = $this->snippetCache["{$snip_name}Props"];
2231
+                $snippetObject['properties'] = $this->snippetCache["{$snip_name}props"];
2232 2232
             }
2233 2233
         } elseif (substr($snip_name, 0, 1) === '@' && isset($this->pluginEvent[trim($snip_name, '@')])) {
2234 2234
             $snippetObject['name'] = trim($snip_name, '@');
@@ -2253,7 +2253,7 @@  discard block
 block discarded – undo
2253 2253
             $snippetObject['content'] = $snip_content;
2254 2254
             $snippetObject['properties'] = $snip_prop;
2255 2255
             $this->snippetCache[$snip_name] = $snip_content;
2256
-            $this->snippetCache["{$snip_name}Props"] = $snip_prop;
2256
+            $this->snippetCache["{$snip_name}props"] = $snip_prop;
2257 2257
         }
2258 2258
         return $snippetObject;
2259 2259
     }
@@ -3569,7 +3569,7 @@  discard block
 block discarded – undo
3569 3569
         }
3570 3570
         // build query
3571 3571
         $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0") . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)");
3572
-        $result = $this->db->select("DISTINCT {$fields}", "{$tblsc} sc
3572
+        $result = $this->db->select("distinct {$fields}", "{$tblsc} sc
3573 3573
                 LEFT JOIN {$tbldg} dg on dg.document = sc.id", "sc.parent = '{$id}' AND ({$access}) GROUP BY sc.id", "{$sort} {$dir}");
3574 3574
         $resourceArray = $this->db->makeArray($result);
3575 3575
         $this->tmpCache[__FUNCTION__][$cacheKey] = $resourceArray;
@@ -3606,7 +3606,7 @@  discard block
 block discarded – undo
3606 3606
         }
3607 3607
         // build query
3608 3608
         $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0") . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)");
3609
-        $result = $this->db->select("DISTINCT {$fields}", "{$tblsc} sc
3609
+        $result = $this->db->select("distinct {$fields}", "{$tblsc} sc
3610 3610
                 LEFT JOIN {$tbldg} dg on dg.document = sc.id", "sc.parent = '{$id}' AND sc.published=1 AND sc.deleted=0 AND ({$access}) GROUP BY sc.id", "{$sort} {$dir}");
3611 3611
         $resourceArray = $this->db->makeArray($result);
3612 3612
 
@@ -3662,7 +3662,7 @@  discard block
 block discarded – undo
3662 3662
         $tblsc = $this->getFullTableName('site_content');
3663 3663
         $tbldg = $this->getFullTableName('document_groups');
3664 3664
 
3665
-        $result = $this->db->select("DISTINCT {$fields}", "{$tblsc} sc
3665
+        $result = $this->db->select("distinct {$fields}", "{$tblsc} sc
3666 3666
                 LEFT JOIN {$tbldg} dg on dg.document = sc.id", "sc.parent = '{$parentid}' {$published} {$deleted} {$where} AND ({$access}) GROUP BY sc.id", ($sort ? "{$sort} {$dir}" : ""), $limit);
3667 3667
 
3668 3668
         $resourceArray = $this->db->makeArray($result);
@@ -3728,7 +3728,7 @@  discard block
 block discarded – undo
3728 3728
             $tblsc = $this->getFullTableName('site_content');
3729 3729
             $tbldg = $this->getFullTableName('document_groups');
3730 3730
 
3731
-            $result = $this->db->select("DISTINCT {$fields}", "{$tblsc} sc
3731
+            $result = $this->db->select("distinct {$fields}", "{$tblsc} sc
3732 3732
                     LEFT JOIN {$tbldg} dg on dg.document = sc.id", "(sc.id IN (" . implode(',', $ids) . ") {$published} {$deleted} {$where}) AND ({$access}) GROUP BY sc.id", ($sort ? "{$sort} {$dir}" : ""), $limit);
3733 3733
 
3734 3734
             $resourceArray = $this->db->makeArray($result);
@@ -4320,7 +4320,7 @@  discard block
 block discarded – undo
4320 4320
                 $template = $doc['content'];
4321 4321
                 break;
4322 4322
             case 'SELECT':
4323
-                $this->db->getValue($this->db->query("SELECT {$template}"));
4323
+                $this->db->getValue($this->db->query("select {$template}"));
4324 4324
                 break;
4325 4325
             default:
4326 4326
                 if (!($template = $this->getChunk($tpl))) {
Please login to merge, or discard this patch.
Braces   +55 added lines, -26 removed lines patch added patch discarded remove patch
@@ -695,13 +695,15 @@  discard block
 block discarded – undo
695 695
             $this->virtualDir = '';
696 696
         }
697 697
 
698
-        if (preg_match('@^[1-9][0-9]*$@', $q) && !isset($this->documentListing[$q])) { /* we got an ID returned, check to make sure it's not an alias */
698
+        if (preg_match('@^[1-9][0-9]*$@', $q) && !isset($this->documentListing[$q])) {
699
+/* we got an ID returned, check to make sure it's not an alias */
699 700
             /* FS#476 and FS#308: check that id is valid in terms of virtualDir structure */
700 701
             if ($this->config['use_alias_path'] == 1) {
701 702
                 if (($this->virtualDir != '' && !isset($this->documentListing[$this->virtualDir . '/' . $q]) || ($this->virtualDir == '' && !isset($this->documentListing[$q]))) && (($this->virtualDir != '' && isset($this->documentListing[$this->virtualDir]) && in_array($q, $this->getChildIds($this->documentListing[$this->virtualDir], 1))) || ($this->virtualDir == '' && in_array($q, $this->getChildIds(0, 1))))) {
702 703
                     $this->documentMethod = 'id';
703 704
                     return $q;
704
-                } else { /* not a valid id in terms of virtualDir, treat as alias */
705
+                } else {
706
+/* not a valid id in terms of virtualDir, treat as alias */
705 707
                     $this->documentMethod = 'alias';
706 708
                     return $q;
707 709
                 }
@@ -709,7 +711,8 @@  discard block
 block discarded – undo
709 711
                 $this->documentMethod = 'id';
710 712
                 return $q;
711 713
             }
712
-        } else { /* we didn't get an ID back, so instead we assume it's an alias */
714
+        } else {
715
+/* we didn't get an ID back, so instead we assume it's an alias */
713 716
             if ($this->config['friendly_alias_urls'] != 1) {
714 717
                 $q = $qOrig;
715 718
             }
@@ -739,13 +742,14 @@  discard block
 block discarded – undo
739 742
      * @param $id
740 743
      * @return array|mixed|null|string
741 744
      */
742
-    public function makePageCacheKey($id){
745
+    public function makePageCacheKey($id)
746
+    {
743 747
         $hash = $id;
744 748
         $tmp = null;
745 749
         $params = array();
746
-        if(!empty($this->systemCacheKey)){
750
+        if(!empty($this->systemCacheKey)) {
747 751
             $hash = $this->systemCacheKey;
748
-        }else {
752
+        } else {
749 753
             if (!empty($_GET)) {
750 754
                 // Sort GET parameters so that the order of parameters on the HTTP request don't affect the generated cache ID.
751 755
                 $params = $_GET;
@@ -754,7 +758,7 @@  discard block
 block discarded – undo
754 758
             }
755 759
         }
756 760
         $evtOut = $this->invokeEvent("OnMakePageCacheKey", array ("hash" => $hash, "id" => $id, 'params' => $params));
757
-        if (is_array($evtOut) && count($evtOut) > 0){
761
+        if (is_array($evtOut) && count($evtOut) > 0) {
758 762
             $tmp = array_pop($evtOut);
759 763
         }
760 764
         return empty($tmp) ? $hash : $tmp;
@@ -1165,10 +1169,18 @@  discard block
 block discarded – undo
1165 1169
             return array();
1166 1170
         }
1167 1171
         $spacer = md5('<<<EVO>>>');
1168
-        if($left==='{{' && strpos($content,';}}')!==false)  $content = str_replace(';}}', sprintf(';}%s}',   $spacer),$content);
1169
-        if($left==='{{' && strpos($content,'{{}}')!==false) $content = str_replace('{{}}',sprintf('{%$1s{}%$1s}',$spacer),$content);
1170
-        if($left==='[[' && strpos($content,']]]]')!==false) $content = str_replace(']]]]',sprintf(']]%s]]',  $spacer),$content);
1171
-        if($left==='[[' && strpos($content,']]]')!==false)  $content = str_replace(']]]', sprintf(']%s]]',   $spacer),$content);
1172
+        if($left==='{{' && strpos($content,';}}')!==false) {
1173
+            $content = str_replace(';}}', sprintf(';}%s}',   $spacer),$content);
1174
+        }
1175
+        if($left==='{{' && strpos($content,'{{}}')!==false) {
1176
+            $content = str_replace('{{}}',sprintf('{%$1s{}%$1s}',$spacer),$content);
1177
+        }
1178
+        if($left==='[[' && strpos($content,']]]]')!==false) {
1179
+            $content = str_replace(']]]]',sprintf(']]%s]]',  $spacer),$content);
1180
+        }
1181
+        if($left==='[[' && strpos($content,']]]')!==false) {
1182
+            $content = str_replace(']]]', sprintf(']%s]]',   $spacer),$content);
1183
+        }
1172 1184
 
1173 1185
         $pos['<![CDATA['] = strpos($content, '<![CDATA[');
1174 1186
         $pos[']]>'] = strpos($content, ']]>');
@@ -1221,7 +1233,8 @@  discard block
 block discarded – undo
1221 1233
                         }
1222 1234
                     }
1223 1235
 
1224
-                    if (!in_array($fetch, $tags)) {  // Avoid double Matches
1236
+                    if (!in_array($fetch, $tags)) {
1237
+// Avoid double Matches
1225 1238
                         $tags[] = $fetch; // Fetch
1226 1239
                     };
1227 1240
                     $fetch = ''; // and reset
@@ -1239,7 +1252,9 @@  discard block
 block discarded – undo
1239 1252
             }
1240 1253
         }
1241 1254
         foreach($tags as $i=>$tag) {
1242
-            if(strpos($tag,$spacer)!==false) $tags[$i] = str_replace($spacer, '', $tag);
1255
+            if(strpos($tag,$spacer)!==false) {
1256
+                $tags[$i] = str_replace($spacer, '', $tag);
1257
+            }
1243 1258
         }
1244 1259
         return $tags;
1245 1260
     }
@@ -1279,7 +1294,10 @@  discard block
 block discarded – undo
1279 1294
         }
1280 1295
 
1281 1296
         foreach ($matches[1] as $i => $key) {
1282
-            if(strpos($key,'[+')!==false) continue; // Allow chunk {{chunk?&param=`xxx`}} with [*tv_name_[+param+]*] as content
1297
+            if(strpos($key,'[+')!==false) {
1298
+                continue;
1299
+            }
1300
+            // Allow chunk {{chunk?&param=`xxx`}} with [*tv_name_[+param+]*] as content
1283 1301
             if (substr($key, 0, 1) == '#') {
1284 1302
                 $key = substr($key, 1);
1285 1303
             } // remove # for QuickEdit format
@@ -2004,7 +2022,8 @@  discard block
 block discarded – undo
2004 2022
      * @return mixed|string
2005 2023
      */
2006 2024
     public function _getSGVar($value)
2007
-    { // Get super globals
2025
+    {
2026
+// Get super globals
2008 2027
         $key = $value;
2009 2028
         $_ = $this->config['enable_filter'];
2010 2029
         $this->config['enable_filter'] = 1;
@@ -2409,7 +2428,8 @@  discard block
 block discarded – undo
2409 2428
         if ($this->config['friendly_urls'] == 1) {
2410 2429
             $aliases = array();
2411 2430
             if (is_array($this->documentListing)) {
2412
-                foreach ($this->documentListing as $path => $docid) { // This is big Loop on large site!
2431
+                foreach ($this->documentListing as $path => $docid) {
2432
+// This is big Loop on large site!
2413 2433
                     $aliases[$docid] = $path;
2414 2434
                     $isfolder[$docid] = $this->aliasListing[$docid]['isfolder'];
2415 2435
                 }
@@ -2442,7 +2462,7 @@  discard block
 block discarded – undo
2442 2462
             $isfriendly = ($this->config['friendly_alias_urls'] == 1 ? 1 : 0);
2443 2463
             $pref = $this->config['friendly_url_prefix'];
2444 2464
             $suff = $this->config['friendly_url_suffix'];
2445
-            $documentSource = preg_replace_callback($in, function ($m) use ($aliases, $isfolder, $isfriendly, $pref, $suff) {
2465
+            $documentSource = preg_replace_callback($in, function ($m) use ($aliases, $isfolder, $isfriendly, $pref, $suff){
2446 2466
                 global $modx;
2447 2467
                 $thealias = $aliases[$m[1]];
2448 2468
                 $thefolder = $isfolder[$m[1]];
@@ -4214,7 +4234,8 @@  discard block
 block discarded – undo
4214 4234
         if (isset ($this->snippetCache[$snippetName])) {
4215 4235
             $snippet = $this->snippetCache[$snippetName];
4216 4236
             $properties = !empty($this->snippetCache[$snippetName . "Props"]) ? $this->snippetCache[$snippetName . "Props"] : '';
4217
-        } else { // not in cache so let's check the db
4237
+        } else {
4238
+// not in cache so let's check the db
4218 4239
             $sql = "SELECT ss.`name`, ss.`snippet`, ss.`properties`, sm.properties as `sharedproperties` FROM " . $this->getFullTableName("site_snippets") . " as ss LEFT JOIN " . $this->getFullTableName('site_modules') . " as sm on sm.guid=ss.moduleguid WHERE ss.`name`='" . $this->db->escape($snippetName) . "'  AND ss.disabled=0;";
4219 4240
             $result = $this->db->query($sql);
4220 4241
             if ($this->db->getRecordCount($result) == 1) {
@@ -4718,7 +4739,7 @@  discard block
 block discarded – undo
4718 4739
             $result = $this->db->makeArray($rs);
4719 4740
 
4720 4741
             // get default/built-in template variables
4721
-            if(is_array($docRow)){
4742
+            if(is_array($docRow)) {
4722 4743
                 ksort($docRow);
4723 4744
 
4724 4745
                 foreach ($docRow as $key => $value) {
@@ -5197,12 +5218,16 @@  discard block
 block discarded – undo
5197 5218
             return '';
5198 5219
         } // nothing to register
5199 5220
         if (!is_array($options)) {
5200
-            if (is_bool($options))  // backward compatibility with old plaintext parameter
5221
+            if (is_bool($options)) {
5222
+                // backward compatibility with old plaintext parameter
5201 5223
             {
5202 5224
                 $options = array('plaintext' => $options);
5203
-            } elseif (is_string($options)) // Also allow script name as 2nd param
5225
+            }
5226
+            } elseif (is_string($options)) {
5227
+                // Also allow script name as 2nd param
5204 5228
             {
5205 5229
                 $options = array('name' => $options);
5230
+            }
5206 5231
             } else {
5207 5232
                 $options = array();
5208 5233
             }
@@ -5214,7 +5239,8 @@  discard block
 block discarded – undo
5214 5239
         unset($overwritepos); // probably unnecessary--just making sure
5215 5240
 
5216 5241
         $useThisVer = true;
5217
-        if (isset($this->loadedjscripts[$key])) { // a matching script was found
5242
+        if (isset($this->loadedjscripts[$key])) {
5243
+// a matching script was found
5218 5244
             // if existing script is a startup script, make sure the candidate is also a startup script
5219 5245
             if ($this->loadedjscripts[$key]['startup']) {
5220 5246
                 $startup = true;
@@ -5234,7 +5260,8 @@  discard block
 block discarded – undo
5234 5260
                     // overwrite the old script (the position may be important for dependent scripts)
5235 5261
                     $overwritepos = $this->loadedjscripts[$key]['pos'];
5236 5262
                 }
5237
-            } else { // Use the original version
5263
+            } else {
5264
+// Use the original version
5238 5265
                 if ($startup == true && $this->loadedjscripts[$key]['startup'] == false) {
5239 5266
                     // need to move the exisiting script to the head
5240 5267
                     $version = $this->loadedjscripts[$key][$version];
@@ -5358,7 +5385,8 @@  discard block
 block discarded – undo
5358 5385
         }
5359 5386
 
5360 5387
         $results = null;
5361
-        foreach ($this->pluginEvent[$evtName] as $pluginName) { // start for loop
5388
+        foreach ($this->pluginEvent[$evtName] as $pluginName) {
5389
+// start for loop
5362 5390
             if ($this->dumpPlugins) {
5363 5391
                 $eventtime = $this->getMicroTime();
5364 5392
             }
@@ -5906,7 +5934,8 @@  discard block
 block discarded – undo
5906 5934
      * @return bool
5907 5935
      */
5908 5936
     public function isSafeCode($phpcode = '', $safe_functions = '')
5909
-    { // return true or false
5937
+    {
5938
+// return true or false
5910 5939
         if ($safe_functions == '') {
5911 5940
             return false;
5912 5941
         }
@@ -6322,7 +6351,7 @@  discard block
 block discarded – undo
6322 6351
             $args = array_pad(array(), $_, '$var');
6323 6352
             $args = implode(", ", $args);
6324 6353
             $modx = &$this;
6325
-            $args = preg_replace_callback('/\$var/', function () use ($modx, &$tmp, $val) {
6354
+            $args = preg_replace_callback('/\$var/', function () use ($modx, &$tmp, $val){
6326 6355
                 $arg = $val['args'][$tmp - 1];
6327 6356
                 switch (true) {
6328 6357
                     case is_null($arg): {
Please login to merge, or discard this patch.
Doc Comments   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
      * MODX_MANAGER_PATH."includes/extenders/ex_{$extname}.inc.php"
257 257
      * $extname - extension name in lowercase
258 258
      *
259
-     * @param $extname
259
+     * @param string $extname
260 260
      * @param bool $reload
261 261
      * @return bool
262 262
      */
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
      * @param int $count_attempts
300 300
      * @param string $type $type
301 301
      * @param string $responseCode
302
-     * @return bool|null
302
+     * @return false|null
303 303
      * @global string $base_url
304 304
      * @global string $site_url
305 305
      */
@@ -1000,7 +1000,7 @@  discard block
 block discarded – undo
1000 1000
     }
1001 1001
 
1002 1002
     /**
1003
-     * @param $contents
1003
+     * @param string $contents
1004 1004
      * @return mixed
1005 1005
      */
1006 1006
     public function RecoveryEscapedTags($contents)
@@ -1024,7 +1024,7 @@  discard block
 block discarded – undo
1024 1024
     }
1025 1025
 
1026 1026
     /**
1027
-     * @param $tstart
1027
+     * @param double $tstart
1028 1028
      * @return array
1029 1029
      */
1030 1030
     public function getTimerStats($tstart)
@@ -1776,7 +1776,7 @@  discard block
 block discarded – undo
1776 1776
 
1777 1777
     /**
1778 1778
      * Remove Comment-Tags from output like <!--@- Comment -@-->
1779
-     * @param $content
1779
+     * @param string $content
1780 1780
      * @param string $left
1781 1781
      * @param string $right
1782 1782
      * @return mixed
@@ -1949,7 +1949,7 @@  discard block
 block discarded – undo
1949 1949
     /**
1950 1950
      * Run snippets as per the tags in $documentSource and replace the tags with the returned values.
1951 1951
      *
1952
-     * @param $content
1952
+     * @param string $content
1953 1953
      * @return string
1954 1954
      * @internal param string $documentSource
1955 1955
      */
@@ -2981,7 +2981,7 @@  discard block
 block discarded – undo
2981 2981
 
2982 2982
     /**
2983 2983
      * @param $templateID
2984
-     * @return mixed
2984
+     * @return string
2985 2985
      */
2986 2986
     public function _getTemplateCodeFromDB($templateID)
2987 2987
     {
@@ -3022,9 +3022,9 @@  discard block
 block discarded – undo
3022 3022
     }
3023 3023
 
3024 3024
     /**
3025
-     * @param $id
3025
+     * @param integer $id
3026 3026
      * @param int $top
3027
-     * @return mixed
3027
+     * @return string
3028 3028
      */
3029 3029
     public function getUltimateParentId($id, $top = 0)
3030 3030
     {
@@ -3355,7 +3355,7 @@  discard block
 block discarded – undo
3355 3355
      *
3356 3356
      * @param int $type Types: 1=template, 2=tv, 3=chunk, 4=snippet, 5=plugin, 6=module, 7=resource, 8=role
3357 3357
      * @param int $id Element- / Resource-id
3358
-     * @return bool
3358
+     * @return false|null
3359 3359
      */
3360 3360
     public function lockElement($type, $id)
3361 3361
     {
@@ -3377,7 +3377,7 @@  discard block
 block discarded – undo
3377 3377
      * @param int $type Types: 1=template, 2=tv, 3=chunk, 4=snippet, 5=plugin, 6=module, 7=resource, 8=role
3378 3378
      * @param int $id Element- / Resource-id
3379 3379
      * @param bool $includeAllUsers true = Deletes not only own user-locks
3380
-     * @return bool
3380
+     * @return false|null
3381 3381
      */
3382 3382
     public function unlockElement($type, $id, $includeAllUsers = false)
3383 3383
     {
@@ -3485,7 +3485,7 @@  discard block
 block discarded – undo
3485 3485
      * @param array $params
3486 3486
      * @param string $msg
3487 3487
      * @param array $files
3488
-     * @return mixed
3488
+     * @return boolean
3489 3489
      */
3490 3490
     public function sendmail($params = array(), $msg = '', $files = array())
3491 3491
     {
@@ -3981,7 +3981,7 @@  discard block
 block discarded – undo
3981 3981
      *
3982 3982
      * @param string $type
3983 3983
      * @param bool $report
3984
-     * @return bool
3984
+     * @return boolean|null
3985 3985
      */
3986 3986
     public function clearCache($type = '', $report = false)
3987 3987
     {
@@ -4348,7 +4348,7 @@  discard block
 block discarded – undo
4348 4348
      * - Placeholders prefix. Default: '{'.
4349 4349
      * @param string $suffix {string}
4350 4350
      * - Placeholders suffix. Default: '}'.
4351
-     * @return bool|mixed|string {string; false} - Parsed chunk or false if $chunkArr is not array.
4351
+     * @return false|string {string; false} - Parsed chunk or false if $chunkArr is not array.
4352 4352
      * - Parsed chunk or false if $chunkArr is not array.
4353 4353
      */
4354 4354
     public function parseChunk($chunkName, $chunkArr, $prefix = '{', $suffix = '}')
@@ -5324,7 +5324,7 @@  discard block
 block discarded – undo
5324 5324
      * Remove event listener - only for use within the current execution cycle
5325 5325
      *
5326 5326
      * @param string $evtName
5327
-     * @return boolean
5327
+     * @return false|null
5328 5328
      */
5329 5329
     public function removeEventListener($evtName)
5330 5330
     {
@@ -5348,7 +5348,7 @@  discard block
 block discarded – undo
5348 5348
      *
5349 5349
      * @param string $evtName
5350 5350
      * @param array $extParams Parameters available to plugins. Each array key will be the PHP variable name, and the array value will be the variable value.
5351
-     * @return boolean|array
5351
+     * @return false|null
5352 5352
      */
5353 5353
     public function invokeEvent($evtName, $extParams = array())
5354 5354
     {
@@ -5947,7 +5947,7 @@  discard block
 block discarded – undo
5947 5947
 
5948 5948
     /**
5949 5949
      * @param string $str
5950
-     * @return bool|mixed|string
5950
+     * @return string
5951 5951
      */
5952 5952
     public function atBindFileContent($str = '')
5953 5953
     {
@@ -5998,8 +5998,8 @@  discard block
 block discarded – undo
5998 5998
     }
5999 5999
 
6000 6000
     /**
6001
-     * @param $str
6002
-     * @return bool|string
6001
+     * @param string $str
6002
+     * @return false|string
6003 6003
      */
6004 6004
     public function getExtFromFilename($str)
6005 6005
     {
@@ -6027,7 +6027,7 @@  discard block
 block discarded – undo
6027 6027
      * @param string $text Error message
6028 6028
      * @param string $file File where the error was detected
6029 6029
      * @param string $line Line number within $file
6030
-     * @return boolean
6030
+     * @return boolean|null
6031 6031
      */
6032 6032
     public function phpError($nr, $text, $file, $line)
6033 6033
     {
@@ -6079,7 +6079,7 @@  discard block
 block discarded – undo
6079 6079
      * @param string $text
6080 6080
      * @param string $line
6081 6081
      * @param string $output
6082
-     * @return bool
6082
+     * @return null|boolean
6083 6083
      */
6084 6084
     public function messageQuit($msg = 'unspecified error', $query = '', $is_error = true, $nr = '', $file = '', $source = '', $text = '', $line = '', $output = '')
6085 6085
     {
@@ -6501,7 +6501,7 @@  discard block
 block discarded – undo
6501 6501
 
6502 6502
     /**
6503 6503
      * @param string $str
6504
-     * @return bool|mixed|string
6504
+     * @return string
6505 6505
      */
6506 6506
     public function atBindInclude($str = '')
6507 6507
     {
@@ -6552,7 +6552,7 @@  discard block
 block discarded – undo
6552 6552
      * @param $str
6553 6553
      * @param int $flags
6554 6554
      * @param string $encode
6555
-     * @return mixed
6555
+     * @return string
6556 6556
      */
6557 6557
     public function htmlspecialchars($str, $flags = ENT_COMPAT, $encode = '')
6558 6558
     {
@@ -6561,7 +6561,7 @@  discard block
 block discarded – undo
6561 6561
     }
6562 6562
 
6563 6563
     /**
6564
-     * @param $string
6564
+     * @param string $string
6565 6565
      * @param bool $returnData
6566 6566
      * @return bool|mixed
6567 6567
      */
Please login to merge, or discard this patch.
Spacing   +266 added lines, -266 removed lines patch added patch discarded remove patch
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
      */
206 206
     function __call($method_name, $arguments)
207 207
     {
208
-        include_once(MODX_MANAGER_PATH . 'includes/extenders/deprecated.functions.inc.php');
208
+        include_once(MODX_MANAGER_PATH.'includes/extenders/deprecated.functions.inc.php');
209 209
         if (method_exists($this->old, $method_name)) {
210 210
             $error_type = 1;
211 211
         } else {
@@ -223,12 +223,12 @@  discard block
 block discarded – undo
223 223
             $info = debug_backtrace();
224 224
             $m[] = $msg;
225 225
             if (!empty($this->currentSnippet)) {
226
-                $m[] = 'Snippet - ' . $this->currentSnippet;
226
+                $m[] = 'Snippet - '.$this->currentSnippet;
227 227
             } elseif (!empty($this->event->activePlugin)) {
228
-                $m[] = 'Plugin - ' . $this->event->activePlugin;
228
+                $m[] = 'Plugin - '.$this->event->activePlugin;
229 229
             }
230 230
             $m[] = $this->decoded_request_uri;
231
-            $m[] = str_replace('\\', '/', $info[0]['file']) . '(line:' . $info[0]['line'] . ')';
231
+            $m[] = str_replace('\\', '/', $info[0]['file']).'(line:'.$info[0]['line'].')';
232 232
             $msg = implode('<br />', $m);
233 233
             $this->logEvent(0, $error_type, $msg, $title);
234 234
         }
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
     {
246 246
         $flag = false;
247 247
         if (is_scalar($connector) && !empty($connector) && isset($this->{$connector}) && $this->{$connector} instanceof DBAPI) {
248
-            $flag = (bool)$this->{$connector}->conn;
248
+            $flag = (bool) $this->{$connector}->conn;
249 249
         }
250 250
         return $flag;
251 251
     }
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
         }
273 273
         if (!$out && $flag) {
274 274
             $extname = trim(str_replace(array('..', '/', '\\'), '', strtolower($extname)));
275
-            $filename = MODX_MANAGER_PATH . "includes/extenders/ex_{$extname}.inc.php";
275
+            $filename = MODX_MANAGER_PATH."includes/extenders/ex_{$extname}.inc.php";
276 276
             $out = is_file($filename) ? include $filename : false;
277 277
         }
278 278
         if ($out && !in_array($extname, $this->extensions)) {
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
     public function getMicroTime()
290 290
     {
291 291
         list ($usec, $sec) = explode(' ', microtime());
292
-        return ((float)$usec + (float)$sec);
292
+        return ((float) $usec + (float) $sec);
293 293
     }
294 294
 
295 295
     /**
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
             // append the redirect count string to the url
314 314
             $currentNumberOfRedirects = isset ($_REQUEST['err']) ? $_REQUEST['err'] : 0;
315 315
             if ($currentNumberOfRedirects > 3) {
316
-                $this->messageQuit('Redirection attempt failed - please ensure the document you\'re trying to redirect to exists. <p>Redirection URL: <i>' . $url . '</i></p>');
316
+                $this->messageQuit('Redirection attempt failed - please ensure the document you\'re trying to redirect to exists. <p>Redirection URL: <i>'.$url.'</i></p>');
317 317
             } else {
318 318
                 $currentNumberOfRedirects += 1;
319 319
                 if (strpos($url, "?") > 0) {
@@ -324,9 +324,9 @@  discard block
 block discarded – undo
324 324
             }
325 325
         }
326 326
         if ($type == 'REDIRECT_REFRESH') {
327
-            $header = 'Refresh: 0;URL=' . $url;
327
+            $header = 'Refresh: 0;URL='.$url;
328 328
         } elseif ($type == 'REDIRECT_META') {
329
-            $header = '<META HTTP-EQUIV="Refresh" CONTENT="0; URL=' . $url . '" />';
329
+            $header = '<META HTTP-EQUIV="Refresh" CONTENT="0; URL='.$url.'" />';
330 330
             echo $header;
331 331
             exit;
332 332
         } elseif ($type == 'REDIRECT_HEADER' || empty ($type)) {
@@ -334,10 +334,10 @@  discard block
 block discarded – undo
334 334
             global $base_url, $site_url;
335 335
             if (substr($url, 0, strlen($base_url)) == $base_url) {
336 336
                 // append $site_url to make it work with Location:
337
-                $url = $site_url . substr($url, strlen($base_url));
337
+                $url = $site_url.substr($url, strlen($base_url));
338 338
             }
339 339
             if (strpos($url, "\n") === false) {
340
-                $header = 'Location: ' . $url;
340
+                $header = 'Location: '.$url;
341 341
             } else {
342 342
                 $this->messageQuit('No newline allowed in redirect url.');
343 343
             }
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
             header($responseCode);
347 347
         }
348 348
 
349
-        if(!empty($header)) {
349
+        if (!empty($header)) {
350 350
             header($header);
351 351
         }
352 352
 
@@ -450,8 +450,8 @@  discard block
 block discarded – undo
450 450
 
451 451
     private function recoverySiteCache()
452 452
     {
453
-        $site_cache_dir = MODX_BASE_PATH . $this->getCacheFolder();
454
-        $site_cache_path = $site_cache_dir . 'siteCache.idx.php';
453
+        $site_cache_dir = MODX_BASE_PATH.$this->getCacheFolder();
454
+        $site_cache_path = $site_cache_dir.'siteCache.idx.php';
455 455
 
456 456
         if (is_file($site_cache_path)) {
457 457
             include($site_cache_path);
@@ -460,7 +460,7 @@  discard block
 block discarded – undo
460 460
             return;
461 461
         }
462 462
 
463
-        include_once(MODX_MANAGER_PATH . 'processors/cache_sync.class.processor.php');
463
+        include_once(MODX_MANAGER_PATH.'processors/cache_sync.class.processor.php');
464 464
         $cache = new synccache();
465 465
         $cache->setCachepath($site_cache_dir);
466 466
         $cache->setReport(false);
@@ -512,8 +512,8 @@  discard block
 block discarded – undo
512 512
                 $this->invokeEvent("OnBeforeManagerPageInit");
513 513
             }
514 514
 
515
-            if (isset ($_SESSION[$usrType . 'UsrConfigSet'])) {
516
-                $usrSettings = &$_SESSION[$usrType . 'UsrConfigSet'];
515
+            if (isset ($_SESSION[$usrType.'UsrConfigSet'])) {
516
+                $usrSettings = &$_SESSION[$usrType.'UsrConfigSet'];
517 517
             } else {
518 518
                 if ($usrType == 'web') {
519 519
                     $from = $tbl_web_user_settings;
@@ -533,7 +533,7 @@  discard block
 block discarded – undo
533 533
                     $usrSettings[$row['setting_name']] = $row['setting_value'];
534 534
                 }
535 535
                 if (isset ($usrType)) {
536
-                    $_SESSION[$usrType . 'UsrConfigSet'] = $usrSettings;
536
+                    $_SESSION[$usrType.'UsrConfigSet'] = $usrSettings;
537 537
                 } // store user settings in session
538 538
             }
539 539
         }
@@ -678,10 +678,10 @@  discard block
 block discarded – undo
678 678
         $suf = $this->config['friendly_url_suffix'];
679 679
         $pre = preg_quote($pre, '/');
680 680
         $suf = preg_quote($suf, '/');
681
-        if ($pre && preg_match('@^' . $pre . '(.*)$@', $q, $_)) {
681
+        if ($pre && preg_match('@^'.$pre.'(.*)$@', $q, $_)) {
682 682
             $q = $_[1];
683 683
         }
684
-        if ($suf && preg_match('@(.*)' . $suf . '$@', $q, $_)) {
684
+        if ($suf && preg_match('@(.*)'.$suf.'$@', $q, $_)) {
685 685
             $q = $_[1];
686 686
         }
687 687
 
@@ -703,7 +703,7 @@  discard block
 block discarded – undo
703 703
         if (preg_match('@^[1-9][0-9]*$@', $q) && !isset($this->documentListing[$q])) { /* we got an ID returned, check to make sure it's not an alias */
704 704
             /* FS#476 and FS#308: check that id is valid in terms of virtualDir structure */
705 705
             if ($this->config['use_alias_path'] == 1) {
706
-                if (($this->virtualDir != '' && !isset($this->documentListing[$this->virtualDir . '/' . $q]) || ($this->virtualDir == '' && !isset($this->documentListing[$q]))) && (($this->virtualDir != '' && isset($this->documentListing[$this->virtualDir]) && in_array($q, $this->getChildIds($this->documentListing[$this->virtualDir], 1))) || ($this->virtualDir == '' && in_array($q, $this->getChildIds(0, 1))))) {
706
+                if (($this->virtualDir != '' && !isset($this->documentListing[$this->virtualDir.'/'.$q]) || ($this->virtualDir == '' && !isset($this->documentListing[$q]))) && (($this->virtualDir != '' && isset($this->documentListing[$this->virtualDir]) && in_array($q, $this->getChildIds($this->documentListing[$this->virtualDir], 1))) || ($this->virtualDir == '' && in_array($q, $this->getChildIds(0, 1))))) {
707 707
                     $this->documentMethod = 'id';
708 708
                     return $q;
709 709
                 } else { /* not a valid id in terms of virtualDir, treat as alias */
@@ -737,7 +737,7 @@  discard block
 block discarded – undo
737 737
      */
738 738
     public function getHashFile($key)
739 739
     {
740
-        return $this->getCacheFolder() . "docid_" . $key . ".pageCache.php";
740
+        return $this->getCacheFolder()."docid_".$key.".pageCache.php";
741 741
     }
742 742
 
743 743
     /**
@@ -748,9 +748,9 @@  discard block
 block discarded – undo
748 748
         $hash = $id;
749 749
         $tmp = null;
750 750
         $params = array();
751
-        if(!empty($this->systemCacheKey)){
751
+        if (!empty($this->systemCacheKey)) {
752 752
             $hash = $this->systemCacheKey;
753
-        }else {
753
+        } else {
754 754
             if (!empty($_GET)) {
755 755
                 // Sort GET parameters so that the order of parameters on the HTTP request don't affect the generated cache ID.
756 756
                 $params = $_GET;
@@ -758,8 +758,8 @@  discard block
 block discarded – undo
758 758
                 $hash .= '_'.md5(http_build_query($params));
759 759
             }
760 760
         }
761
-        $evtOut = $this->invokeEvent("OnMakePageCacheKey", array ("hash" => $hash, "id" => $id, 'params' => $params));
762
-        if (is_array($evtOut) && count($evtOut) > 0){
761
+        $evtOut = $this->invokeEvent("OnMakePageCacheKey", array("hash" => $hash, "id" => $id, 'params' => $params));
762
+        if (is_array($evtOut) && count($evtOut) > 0) {
763 763
             $tmp = array_pop($evtOut);
764 764
         }
765 765
         return empty($tmp) ? $hash : $tmp;
@@ -901,12 +901,12 @@  discard block
 block discarded – undo
901 901
         if ($js = $this->getRegisteredClientStartupScripts()) {
902 902
             // change to just before closing </head>
903 903
             // $this->documentContent = preg_replace("/(<head[^>]*>)/i", "\\1\n".$js, $this->documentContent);
904
-            $this->documentOutput = preg_replace("/(<\/head>)/i", $js . "\n\\1", $this->documentOutput);
904
+            $this->documentOutput = preg_replace("/(<\/head>)/i", $js."\n\\1", $this->documentOutput);
905 905
         }
906 906
 
907 907
         // Insert jscripts & html block into template - template must have a </body> tag
908 908
         if ($js = $this->getRegisteredClientScripts()) {
909
-            $this->documentOutput = preg_replace("/(<\/body>)/i", $js . "\n\\1", $this->documentOutput);
909
+            $this->documentOutput = preg_replace("/(<\/body>)/i", $js."\n\\1", $this->documentOutput);
910 910
         }
911 911
         // End fix by sirlancelot
912 912
 
@@ -917,7 +917,7 @@  discard block
 block discarded – undo
917 917
         // send out content-type and content-disposition headers
918 918
         if (IN_PARSER_MODE == "true") {
919 919
             $type = !empty ($this->contentTypes[$this->documentIdentifier]) ? $this->contentTypes[$this->documentIdentifier] : "text/html";
920
-            header('Content-Type: ' . $type . '; charset=' . $this->config['modx_charset']);
920
+            header('Content-Type: '.$type.'; charset='.$this->config['modx_charset']);
921 921
             //            if (($this->documentIdentifier == $this->config['error_page']) || $redirect_error)
922 922
             //                header('HTTP/1.0 404 Not Found');
923 923
             if (!$this->checkPreview() && $this->documentObject['content_dispo'] == 1) {
@@ -935,7 +935,7 @@  discard block
 block discarded – undo
935 935
                     $name = preg_replace('|-+|', '-', $name);
936 936
                     $name = trim($name, '-');
937 937
                 }
938
-                $header = 'Content-Disposition: attachment; filename=' . $name;
938
+                $header = 'Content-Disposition: attachment; filename='.$name;
939 939
                 header($header);
940 940
             }
941 941
         }
@@ -943,7 +943,7 @@  discard block
 block discarded – undo
943 943
 
944 944
         $stats = $this->getTimerStats($this->tstart);
945 945
 
946
-        $out =& $this->documentOutput;
946
+        $out = & $this->documentOutput;
947 947
         $out = str_replace("[^q^]", $stats['queries'], $out);
948 948
         $out = str_replace("[^qt^]", $stats['queryTime'], $out);
949 949
         $out = str_replace("[^p^]", $stats['phpTime'], $out);
@@ -982,17 +982,17 @@  discard block
 block discarded – undo
982 982
                 $sc .= sprintf("%s. %s (%s)<br>", $s, $sname, sprintf("%2.2f ms", $t)); // currentSnippet
983 983
                 $tt += $t;
984 984
             }
985
-            echo "<fieldset><legend><b>Snippets</b> (" . count($this->snippetsTime) . " / " . sprintf("%2.2f ms", $tt) . ")</legend>{$sc}</fieldset><br />";
985
+            echo "<fieldset><legend><b>Snippets</b> (".count($this->snippetsTime)." / ".sprintf("%2.2f ms", $tt).")</legend>{$sc}</fieldset><br />";
986 986
             echo $this->snippetsCode;
987 987
         }
988 988
         if ($this->dumpPlugins) {
989 989
             $ps = "";
990 990
             $tt = 0;
991 991
             foreach ($this->pluginsTime as $s => $t) {
992
-                $ps .= "$s (" . sprintf("%2.2f ms", $t * 1000) . ")<br>";
992
+                $ps .= "$s (".sprintf("%2.2f ms", $t * 1000).")<br>";
993 993
                 $tt += $t;
994 994
             }
995
-            echo "<fieldset><legend><b>Plugins</b> (" . count($this->pluginsTime) . " / " . sprintf("%2.2f ms", $tt * 1000) . ")</legend>{$ps}</fieldset><br />";
995
+            echo "<fieldset><legend><b>Plugins</b> (".count($this->pluginsTime)." / ".sprintf("%2.2f ms", $tt * 1000).")</legend>{$ps}</fieldset><br />";
996 996
             echo $this->pluginsCode;
997 997
         }
998 998
 
@@ -1018,7 +1018,7 @@  discard block
 block discarded – undo
1018 1018
         $srcTags = explode(',', $tags);
1019 1019
         $repTags = array();
1020 1020
         foreach ($srcTags as $tag) {
1021
-            $repTags[] = '\\' . $tag[0] . '\\' . $tag[1];
1021
+            $repTags[] = '\\'.$tag[0].'\\'.$tag[1];
1022 1022
         }
1023 1023
         return array($srcTags, $repTags);
1024 1024
     }
@@ -1040,7 +1040,7 @@  discard block
 block discarded – undo
1040 1040
         $stats['phpTime'] = sprintf("%2.4f s", $stats['phpTime']);
1041 1041
         $stats['source'] = $this->documentGenerated == 1 ? "database" : "cache";
1042 1042
         $stats['queries'] = isset ($this->executedQueries) ? $this->executedQueries : 0;
1043
-        $stats['phpMemory'] = (memory_get_peak_usage(true) / 1024 / 1024) . " mb";
1043
+        $stats['phpMemory'] = (memory_get_peak_usage(true) / 1024 / 1024)." mb";
1044 1044
 
1045 1045
         return $stats;
1046 1046
     }
@@ -1073,7 +1073,7 @@  discard block
 block discarded – undo
1073 1073
     {
1074 1074
         $cacheRefreshTime = 0;
1075 1075
         $recent_update = 0;
1076
-        @include(MODX_BASE_PATH . $this->getCacheFolder() . 'sitePublishing.idx.php');
1076
+        @include(MODX_BASE_PATH.$this->getCacheFolder().'sitePublishing.idx.php');
1077 1077
         $this->recentUpdate = $recent_update;
1078 1078
 
1079 1079
         $timeNow = $_SERVER['REQUEST_TIME'] + $this->config['server_offset_time'];
@@ -1127,8 +1127,8 @@  discard block
 block discarded – undo
1127 1127
                 }
1128 1128
 
1129 1129
                 $docObjSerial = serialize($this->documentObject);
1130
-                $cacheContent = $docObjSerial . "<!--__MODxCacheSpliter__-->" . $this->documentContent;
1131
-                $page_cache_path = MODX_BASE_PATH . $this->getHashFile($this->cacheKey);
1130
+                $cacheContent = $docObjSerial."<!--__MODxCacheSpliter__-->".$this->documentContent;
1131
+                $page_cache_path = MODX_BASE_PATH.$this->getHashFile($this->cacheKey);
1132 1132
                 file_put_contents($page_cache_path, "<?php die('Unauthorized access.'); ?>$cacheContent");
1133 1133
             }
1134 1134
         }
@@ -1170,16 +1170,16 @@  discard block
 block discarded – undo
1170 1170
             return array();
1171 1171
         }
1172 1172
         $spacer = md5('<<<EVO>>>');
1173
-        if($left==='{{' && strpos($content,';}}')!==false)  $content = str_replace(';}}', sprintf(';}%s}',   $spacer),$content);
1174
-        if($left==='{{' && strpos($content,'{{}}')!==false) $content = str_replace('{{}}',sprintf('{%$1s{}%$1s}',$spacer),$content);
1175
-        if($left==='[[' && strpos($content,']]]]')!==false) $content = str_replace(']]]]',sprintf(']]%s]]',  $spacer),$content);
1176
-        if($left==='[[' && strpos($content,']]]')!==false)  $content = str_replace(']]]', sprintf(']%s]]',   $spacer),$content);
1173
+        if ($left === '{{' && strpos($content, ';}}') !== false)  $content = str_replace(';}}', sprintf(';}%s}', $spacer), $content);
1174
+        if ($left === '{{' && strpos($content, '{{}}') !== false) $content = str_replace('{{}}', sprintf('{%$1s{}%$1s}', $spacer), $content);
1175
+        if ($left === '[[' && strpos($content, ']]]]') !== false) $content = str_replace(']]]]', sprintf(']]%s]]', $spacer), $content);
1176
+        if ($left === '[[' && strpos($content, ']]]') !== false)  $content = str_replace(']]]', sprintf(']%s]]', $spacer), $content);
1177 1177
 
1178 1178
         $pos['<![CDATA['] = strpos($content, '<![CDATA[');
1179 1179
         $pos[']]>'] = strpos($content, ']]>');
1180 1180
 
1181 1181
         if ($pos['<![CDATA['] !== false && $pos[']]>'] !== false) {
1182
-            $content = substr($content, 0, $pos['<![CDATA[']) . substr($content, $pos[']]>'] + 3);
1182
+            $content = substr($content, 0, $pos['<![CDATA[']).substr($content, $pos[']]>'] + 3);
1183 1183
         }
1184 1184
 
1185 1185
         $lp = explode($left, $content);
@@ -1243,8 +1243,8 @@  discard block
 block discarded – undo
1243 1243
                 }
1244 1244
             }
1245 1245
         }
1246
-        foreach($tags as $i=>$tag) {
1247
-            if(strpos($tag,$spacer)!==false) $tags[$i] = str_replace($spacer, '', $tag);
1246
+        foreach ($tags as $i=>$tag) {
1247
+            if (strpos($tag, $spacer) !== false) $tags[$i] = str_replace($spacer, '', $tag);
1248 1248
         }
1249 1249
         return $tags;
1250 1250
     }
@@ -1284,7 +1284,7 @@  discard block
 block discarded – undo
1284 1284
         }
1285 1285
 
1286 1286
         foreach ($matches[1] as $i => $key) {
1287
-            if(strpos($key,'[+')!==false) continue; // Allow chunk {{chunk?&param=`xxx`}} with [*tv_name_[+param+]*] as content
1287
+            if (strpos($key, '[+') !== false) continue; // Allow chunk {{chunk?&param=`xxx`}} with [*tv_name_[+param+]*] as content
1288 1288
             if (substr($key, 0, 1) == '#') {
1289 1289
                 $key = substr($key, 1);
1290 1290
             } // remove # for QuickEdit format
@@ -1304,8 +1304,8 @@  discard block
 block discarded – undo
1304 1304
             }
1305 1305
 
1306 1306
             if (is_array($value)) {
1307
-                include_once(MODX_MANAGER_PATH . 'includes/tmplvars.format.inc.php');
1308
-                include_once(MODX_MANAGER_PATH . 'includes/tmplvars.commands.inc.php');
1307
+                include_once(MODX_MANAGER_PATH.'includes/tmplvars.format.inc.php');
1308
+                include_once(MODX_MANAGER_PATH.'includes/tmplvars.commands.inc.php');
1309 1309
                 $value = getTVDisplayFormat($value[0], $value[1], $value[2], $value[3], $value[4]);
1310 1310
             }
1311 1311
 
@@ -1316,8 +1316,8 @@  discard block
 block discarded – undo
1316 1316
 
1317 1317
             if (strpos($content, $s) !== false) {
1318 1318
                 $content = str_replace($s, $value, $content);
1319
-            } elseif($this->debug) {
1320
-                $this->addLog('mergeDocumentContent parse error', $_SERVER['REQUEST_URI'] . $s, 2);
1319
+            } elseif ($this->debug) {
1320
+                $this->addLog('mergeDocumentContent parse error', $_SERVER['REQUEST_URI'].$s, 2);
1321 1321
             }
1322 1322
         }
1323 1323
 
@@ -1484,8 +1484,8 @@  discard block
 block discarded – undo
1484 1484
             $s = &$matches[0][$i];
1485 1485
             if (strpos($content, $s) !== false) {
1486 1486
                 $content = str_replace($s, $value, $content);
1487
-            } elseif($this->debug) {
1488
-                $this->addLog('mergeSettingsContent parse error', $_SERVER['REQUEST_URI'] . $s, 2);
1487
+            } elseif ($this->debug) {
1488
+                $this->addLog('mergeSettingsContent parse error', $_SERVER['REQUEST_URI'].$s, 2);
1489 1489
             }
1490 1490
         }
1491 1491
         return $content;
@@ -1538,7 +1538,7 @@  discard block
 block discarded – undo
1538 1538
             }
1539 1539
 
1540 1540
             $value = $this->parseText($value, $params); // parse local scope placeholers for ConditionalTags
1541
-            $value = $this->mergePlaceholderContent($value, $params);  // parse page global placeholers
1541
+            $value = $this->mergePlaceholderContent($value, $params); // parse page global placeholers
1542 1542
             if ($this->config['enable_at_syntax']) {
1543 1543
                 $value = $this->mergeConditionalTagsContent($value);
1544 1544
             }
@@ -1553,8 +1553,8 @@  discard block
 block discarded – undo
1553 1553
             $s = &$matches[0][$i];
1554 1554
             if (strpos($content, $s) !== false) {
1555 1555
                 $content = str_replace($s, $value, $content);
1556
-            } elseif($this->debug) {
1557
-                $this->addLog('mergeChunkContent parse error', $_SERVER['REQUEST_URI'] . $s, 2);
1556
+            } elseif ($this->debug) {
1557
+                $this->addLog('mergeChunkContent parse error', $_SERVER['REQUEST_URI'].$s, 2);
1558 1558
             }
1559 1559
         }
1560 1560
         return $content;
@@ -1612,8 +1612,8 @@  discard block
 block discarded – undo
1612 1612
             $s = &$matches[0][$i];
1613 1613
             if (strpos($content, $s) !== false) {
1614 1614
                 $content = str_replace($s, $value, $content);
1615
-            } elseif($this->debug) {
1616
-                $this->addLog('mergePlaceholderContent parse error', $_SERVER['REQUEST_URI'] . $s, 2);
1615
+            } elseif ($this->debug) {
1616
+                $this->addLog('mergePlaceholderContent parse error', $_SERVER['REQUEST_URI'].$s, 2);
1617 1617
             }
1618 1618
         }
1619 1619
         return $content;
@@ -1637,7 +1637,7 @@  discard block
 block discarded – undo
1637 1637
             return $content;
1638 1638
         }
1639 1639
 
1640
-        $sp = '#' . md5('ConditionalTags' . $_SERVER['REQUEST_TIME']) . '#';
1640
+        $sp = '#'.md5('ConditionalTags'.$_SERVER['REQUEST_TIME']).'#';
1641 1641
         $content = str_replace(array('<?php', '<?=', '<?', '?>'), array("{$sp}b", "{$sp}p", "{$sp}s", "{$sp}e"), $content);
1642 1642
 
1643 1643
         $pieces = explode('<@IF:', $content);
@@ -1648,7 +1648,7 @@  discard block
 block discarded – undo
1648 1648
             }
1649 1649
             list($cmd, $text) = explode('>', $split, 2);
1650 1650
             $cmd = str_replace("'", "\'", $cmd);
1651
-            $content .= "<?php if(\$this->_parseCTagCMD('" . $cmd . "')): ?>";
1651
+            $content .= "<?php if(\$this->_parseCTagCMD('".$cmd."')): ?>";
1652 1652
             $content .= $text;
1653 1653
         }
1654 1654
         $pieces = explode('<@ELSEIF:', $content);
@@ -1659,13 +1659,13 @@  discard block
 block discarded – undo
1659 1659
             }
1660 1660
             list($cmd, $text) = explode('>', $split, 2);
1661 1661
             $cmd = str_replace("'", "\'", $cmd);
1662
-            $content .= "<?php elseif(\$this->_parseCTagCMD('" . $cmd . "')): ?>";
1662
+            $content .= "<?php elseif(\$this->_parseCTagCMD('".$cmd."')): ?>";
1663 1663
             $content .= $text;
1664 1664
         }
1665 1665
 
1666 1666
         $content = str_replace(array('<@ELSE>', '<@ENDIF>'), array('<?php else:?>', '<?php endif;?>'), $content);
1667 1667
         ob_start();
1668
-        $content = eval('?>' . $content);
1668
+        $content = eval('?>'.$content);
1669 1669
         $content = ob_get_clean();
1670 1670
         $content = str_replace(array("{$sp}b", "{$sp}p", "{$sp}s", "{$sp}e"), array('<?php', '<?=', '<?', '?>'), $content);
1671 1671
 
@@ -1790,7 +1790,7 @@  discard block
 block discarded – undo
1790 1790
         $matches = $this->getTagsFromContent($content, $left, $right);
1791 1791
         if (!empty($matches)) {
1792 1792
             foreach ($matches[0] as $i => $v) {
1793
-                $addBreakMatches[$i] = $v . "\n";
1793
+                $addBreakMatches[$i] = $v."\n";
1794 1794
             }
1795 1795
             $content = str_replace($addBreakMatches, '', $content);
1796 1796
             if (strpos($content, $left) !== false) {
@@ -1823,8 +1823,8 @@  discard block
 block discarded – undo
1823 1823
             $s = &$matches[0][$i];
1824 1824
             if (strpos($content, $s) !== false) {
1825 1825
                 $content = str_replace($s, $v, $content);
1826
-            } elseif($this->debug) {
1827
-                $this->addLog('ignoreCommentedTagsContent parse error', $_SERVER['REQUEST_URI'] . $s, 2);
1826
+            } elseif ($this->debug) {
1827
+                $this->addLog('ignoreCommentedTagsContent parse error', $_SERVER['REQUEST_URI'].$s, 2);
1828 1828
             }
1829 1829
         }
1830 1830
         return $content;
@@ -1888,7 +1888,7 @@  discard block
 block discarded – undo
1888 1888
                 $msg = ($msg === false) ? 'ob_get_contents() error' : $msg;
1889 1889
                 $this->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], 'Plugin', $error_info['message'], $error_info['line'], $msg);
1890 1890
                 if ($this->isBackend()) {
1891
-                    $this->event->alert('An error occurred while loading. Please see the event log for more information.<p>' . $msg . '</p>');
1891
+                    $this->event->alert('An error occurred while loading. Please see the event log for more information.<p>'.$msg.'</p>');
1892 1892
                 }
1893 1893
             }
1894 1894
         } else {
@@ -1934,7 +1934,7 @@  discard block
 block discarded – undo
1934 1934
                 $echo = ($echo === false) ? 'ob_get_contents() error' : $echo;
1935 1935
                 $this->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], 'Snippet', $error_info['message'], $error_info['line'], $echo);
1936 1936
                 if ($this->isBackend()) {
1937
-                    $this->event->alert('An error occurred while loading. Please see the event log for more information<p>' . $echo . $return . '</p>');
1937
+                    $this->event->alert('An error occurred while loading. Please see the event log for more information<p>'.$echo.$return.'</p>');
1938 1938
                 }
1939 1939
             }
1940 1940
         }
@@ -1942,7 +1942,7 @@  discard block
 block discarded – undo
1942 1942
         if (is_array($return) || is_object($return)) {
1943 1943
             return $return;
1944 1944
         } else {
1945
-            return $echo . $return;
1945
+            return $echo.$return;
1946 1946
         }
1947 1947
     }
1948 1948
 
@@ -1980,8 +1980,8 @@  discard block
 block discarded – undo
1980 1980
                 }
1981 1981
                 if (strpos($content, $s) !== false) {
1982 1982
                     $content = str_replace($s, $value, $content);
1983
-                } elseif($this->debug) {
1984
-                    $this->addLog('evalSnippetsSGVar parse error', $_SERVER['REQUEST_URI'] . $s, 2);
1983
+                } elseif ($this->debug) {
1984
+                    $this->addLog('evalSnippetsSGVar parse error', $_SERVER['REQUEST_URI'].$s, 2);
1985 1985
                 }
1986 1986
                 continue;
1987 1987
             }
@@ -1992,8 +1992,8 @@  discard block
 block discarded – undo
1992 1992
 
1993 1993
             if (strpos($content, $s) !== false) {
1994 1994
                 $content = str_replace($s, $value, $content);
1995
-            } elseif($this->debug) {
1996
-                $this->addLog('evalSnippets parse error', $_SERVER['REQUEST_URI'] . $s, 2);
1995
+            } elseif ($this->debug) {
1996
+                $this->addLog('evalSnippets parse error', $_SERVER['REQUEST_URI'].$s, 2);
1997 1997
             }
1998 1998
         }
1999 1999
 
@@ -2084,7 +2084,7 @@  discard block
 block discarded – undo
2084 2084
             $eventtime = sprintf('%2.2f ms', $eventtime * 1000);
2085 2085
             $code = str_replace("\t", '  ', $this->htmlspecialchars($value));
2086 2086
             $piece = str_replace("\t", '  ', $this->htmlspecialchars($piece));
2087
-            $print_r_params = str_replace("\t", '  ', $this->htmlspecialchars('$modx->event->params = ' . print_r($params, true)));
2087
+            $print_r_params = str_replace("\t", '  ', $this->htmlspecialchars('$modx->event->params = '.print_r($params, true)));
2088 2088
             $this->snippetsCode .= sprintf('<fieldset style="margin:1em;"><legend><b>%s</b>(%s)</legend><pre style="white-space: pre-wrap;background-color:#fff;width:90%%;">[[%s]]</pre><pre style="white-space: pre-wrap;background-color:#fff;width:90%%;">%s</pre><pre style="white-space: pre-wrap;background-color:#fff;width:90%%;">%s</pre></fieldset>', $snippetObject['name'], $eventtime, $piece, $print_r_params, $code);
2089 2089
             $this->snippetsTime[] = array('sname' => $key, 'time' => $eventtime);
2090 2090
         }
@@ -2328,7 +2328,7 @@  discard block
 block discarded – undo
2328 2328
             $rs = $this->db->select('name,snippet,properties', '[+prefix+]site_snippets', $where);
2329 2329
             $count = $this->db->getRecordCount($rs);
2330 2330
             if (1 < $count) {
2331
-                exit('Error $modx->_getSnippetObject()' . $snip_name);
2331
+                exit('Error $modx->_getSnippetObject()'.$snip_name);
2332 2332
             }
2333 2333
             if ($count) {
2334 2334
                 $row = $this->db->getRow($rs);
@@ -2354,7 +2354,7 @@  discard block
 block discarded – undo
2354 2354
     public function toAlias($text)
2355 2355
     {
2356 2356
         $suff = $this->config['friendly_url_suffix'];
2357
-        return str_replace(array('.xml' . $suff, '.rss' . $suff, '.js' . $suff, '.css' . $suff, '.txt' . $suff, '.json' . $suff, '.pdf' . $suff), array('.xml', '.rss', '.js', '.css', '.txt', '.json', '.pdf'), $text);
2357
+        return str_replace(array('.xml'.$suff, '.rss'.$suff, '.js'.$suff, '.css'.$suff, '.txt'.$suff, '.json'.$suff, '.pdf'.$suff), array('.xml', '.rss', '.js', '.css', '.txt', '.json', '.pdf'), $text);
2358 2358
     }
2359 2359
 
2360 2360
     /**
@@ -2386,7 +2386,7 @@  discard block
 block discarded – undo
2386 2386
                 $suff = '/';
2387 2387
             }
2388 2388
 
2389
-            $url = ($dir != '' ? $dir . '/' : '') . $pre . $alias . $suff;
2389
+            $url = ($dir != '' ? $dir.'/' : '').$pre.$alias.$suff;
2390 2390
         }
2391 2391
 
2392 2392
         $evtOut = $this->invokeEvent('OnMakeDocUrl', array(
@@ -2423,7 +2423,7 @@  discard block
 block discarded – undo
2423 2423
                 preg_match_all('!\[\~([0-9]+)\~\]!ise', $documentSource, $match);
2424 2424
                 $ids = implode(',', array_unique($match['1']));
2425 2425
                 if ($ids) {
2426
-                    $res = $this->db->select("id,alias,isfolder,parent,alias_visible", $this->getFullTableName('site_content'), "id IN (" . $ids . ") AND isfolder = '0'");
2426
+                    $res = $this->db->select("id,alias,isfolder,parent,alias_visible", $this->getFullTableName('site_content'), "id IN (".$ids.") AND isfolder = '0'");
2427 2427
                     while ($row = $this->db->getRow($res)) {
2428 2428
                         if ($this->config['use_alias_path'] == '1' && $row['parent'] != 0) {
2429 2429
                             $parent = $row['parent'];
@@ -2434,7 +2434,7 @@  discard block
 block discarded – undo
2434 2434
                                 $parent = $this->aliasListing[$parent]['parent'];
2435 2435
                             }
2436 2436
 
2437
-                            $aliases[$row['id']] = $path . '/' . $row['alias'];
2437
+                            $aliases[$row['id']] = $path.'/'.$row['alias'];
2438 2438
                         } else {
2439 2439
                             $aliases[$row['id']] = $row['alias'];
2440 2440
                         }
@@ -2446,7 +2446,7 @@  discard block
 block discarded – undo
2446 2446
             $isfriendly = ($this->config['friendly_alias_urls'] == 1 ? 1 : 0);
2447 2447
             $pref = $this->config['friendly_url_prefix'];
2448 2448
             $suff = $this->config['friendly_url_suffix'];
2449
-            $documentSource = preg_replace_callback($in, function ($m) use ($aliases, $isfolder, $isfriendly, $pref, $suff) {
2449
+            $documentSource = preg_replace_callback($in, function($m) use ($aliases, $isfolder, $isfriendly, $pref, $suff) {
2450 2450
                 global $modx;
2451 2451
                 $thealias = $aliases[$m[1]];
2452 2452
                 $thefolder = $isfolder[$m[1]];
@@ -2462,7 +2462,7 @@  discard block
 block discarded – undo
2462 2462
 
2463 2463
         } else {
2464 2464
             $in = '!\[\~([0-9]+)\~\]!is';
2465
-            $out = "index.php?id=" . '\1';
2465
+            $out = "index.php?id=".'\1';
2466 2466
             $documentSource = preg_replace($in, $out, $documentSource);
2467 2467
         }
2468 2468
 
@@ -2483,7 +2483,7 @@  discard block
 block discarded – undo
2483 2483
         $scheme = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http';
2484 2484
         $len_base_url = strlen($this->config['base_url']);
2485 2485
 
2486
-        $url_path = $q;//LANG
2486
+        $url_path = $q; //LANG
2487 2487
 
2488 2488
         if (substr($url_path, 0, $len_base_url) === $this->config['base_url']) {
2489 2489
             $url_path = substr($url_path, $len_base_url);
@@ -2495,7 +2495,7 @@  discard block
 block discarded – undo
2495 2495
             $strictURL = substr($strictURL, $len_base_url);
2496 2496
         }
2497 2497
         $http_host = $_SERVER['HTTP_HOST'];
2498
-        $requestedURL = "{$scheme}://{$http_host}" . '/' . $q; //LANG
2498
+        $requestedURL = "{$scheme}://{$http_host}".'/'.$q; //LANG
2499 2499
 
2500 2500
         $site_url = $this->config['site_url'];
2501 2501
 
@@ -2511,7 +2511,7 @@  discard block
 block discarded – undo
2511 2511
                 }
2512 2512
                 if ($this->config['base_url'] != $_SERVER['REQUEST_URI']) {
2513 2513
                     if (empty($_POST)) {
2514
-                        if (($this->config['base_url'] . '?' . $qstring) != $_SERVER['REQUEST_URI']) {
2514
+                        if (($this->config['base_url'].'?'.$qstring) != $_SERVER['REQUEST_URI']) {
2515 2515
                             $this->sendRedirect($url, 0, 'REDIRECT_HEADER', 'HTTP/1.0 301 Moved Permanently');
2516 2516
                             exit(0);
2517 2517
                         }
@@ -2574,7 +2574,7 @@  discard block
 block discarded – undo
2574 2574
                 $docgrp = implode(",", $docgrp);
2575 2575
             }
2576 2576
             // get document
2577
-            $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0") . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)");
2577
+            $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='".$_SESSION['mgrRole']."' OR sc.privatemgr=0").(!$docgrp ? "" : " OR dg.document_group IN ($docgrp)");
2578 2578
             $rs = $this->db->select('sc.*', "{$tblsc} sc
2579 2579
                 LEFT JOIN {$tbldg} dg ON dg.document = sc.id", "sc.{$method} = '{$identifier}' AND ({$access})", "", 1);
2580 2580
             if ($this->db->getRecordCount($rs) < 1) {
@@ -2610,9 +2610,9 @@  discard block
 block discarded – undo
2610 2610
             }
2611 2611
             if ($documentObject['template']) {
2612 2612
                 // load TVs and merge with document - Orig by Apodigm - Docvars
2613
-                $rs = $this->db->select("tv.*, IF(tvc.value!='',tvc.value,tv.default_text) as value", $this->getFullTableName("site_tmplvars") . " tv
2614
-                INNER JOIN " . $this->getFullTableName("site_tmplvar_templates") . " tvtpl ON tvtpl.tmplvarid = tv.id
2615
-                LEFT JOIN " . $this->getFullTableName("site_tmplvar_contentvalues") . " tvc ON tvc.tmplvarid=tv.id AND tvc.contentid = '{$documentObject['id']}'", "tvtpl.templateid = '{$documentObject['template']}'");
2613
+                $rs = $this->db->select("tv.*, IF(tvc.value!='',tvc.value,tv.default_text) as value", $this->getFullTableName("site_tmplvars")." tv
2614
+                INNER JOIN " . $this->getFullTableName("site_tmplvar_templates")." tvtpl ON tvtpl.tmplvarid = tv.id
2615
+                LEFT JOIN " . $this->getFullTableName("site_tmplvar_contentvalues")." tvc ON tvc.tmplvarid=tv.id AND tvc.contentid = '{$documentObject['id']}'", "tvtpl.templateid = '{$documentObject['template']}'");
2616 2616
                 $tmplvars = array();
2617 2617
                 while ($row = $this->db->getRow($rs)) {
2618 2618
                     $tmplvars[$row['name']] = array(
@@ -2658,7 +2658,7 @@  discard block
 block discarded – undo
2658 2658
                 $st = md5($source);
2659 2659
             }
2660 2660
             if ($this->dumpSnippets == 1) {
2661
-                $this->snippetsCode .= "<fieldset><legend><b style='color: #821517;'>PARSE PASS " . ($i + 1) . "</b></legend><p>The following snippets (if any) were parsed during this pass.</p>";
2661
+                $this->snippetsCode .= "<fieldset><legend><b style='color: #821517;'>PARSE PASS ".($i + 1)."</b></legend><p>The following snippets (if any) were parsed during this pass.</p>";
2662 2662
             }
2663 2663
 
2664 2664
             // invoke OnParseDocument event
@@ -2744,7 +2744,7 @@  discard block
 block discarded – undo
2744 2744
 
2745 2745
             // Check use_alias_path and check if $this->virtualDir is set to anything, then parse the path
2746 2746
             if ($this->config['use_alias_path'] == 1) {
2747
-                $alias = (strlen($this->virtualDir) > 0 ? $this->virtualDir . '/' : '') . $this->documentIdentifier;
2747
+                $alias = (strlen($this->virtualDir) > 0 ? $this->virtualDir.'/' : '').$this->documentIdentifier;
2748 2748
                 if (isset($this->documentListing[$alias])) {
2749 2749
                     $this->documentIdentifier = $this->documentListing[$alias];
2750 2750
                 } else {
@@ -2805,7 +2805,7 @@  discard block
 block discarded – undo
2805 2805
                 } else {
2806 2806
                     $docAlias = $this->db->escape($this->documentIdentifier);
2807 2807
                     $rs = $this->db->select('id', $this->getFullTableName('site_content'), "deleted=0 and alias='{$docAlias}'");
2808
-                    $this->documentIdentifier = (int)$this->db->getValue($rs);
2808
+                    $this->documentIdentifier = (int) $this->db->getValue($rs);
2809 2809
                 }
2810 2810
             }
2811 2811
             $this->documentMethod = 'id';
@@ -2858,7 +2858,7 @@  discard block
 block discarded – undo
2858 2858
                 $_REQUEST[$n] = $_GET[$n] = $v;
2859 2859
             }
2860 2860
         }
2861
-        $_SERVER['PHP_SELF'] = $this->config['base_url'] . $qp['path'];
2861
+        $_SERVER['PHP_SELF'] = $this->config['base_url'].$qp['path'];
2862 2862
         $this->q = $qp['path'];
2863 2863
         return $qp['path'];
2864 2864
     }
@@ -2952,7 +2952,7 @@  discard block
 block discarded – undo
2952 2952
             $this->sendErrorPage();
2953 2953
         } else {
2954 2954
             // Inculde the necessary files to check document permissions
2955
-            include_once(MODX_MANAGER_PATH . 'processors/user_documents_permissions.class.php');
2955
+            include_once(MODX_MANAGER_PATH.'processors/user_documents_permissions.class.php');
2956 2956
             $udperms = new udperms();
2957 2957
             $udperms->user = $this->getLoginUserID();
2958 2958
             $udperms->document = $this->documentIdentifier;
@@ -3006,7 +3006,7 @@  discard block
 block discarded – undo
3006 3006
         while ($id && $height--) {
3007 3007
             $thisid = $id;
3008 3008
             if ($this->config['aliaslistingfolder'] == 1) {
3009
-                $id = isset($this->aliasListing[$id]['parent']) ? $this->aliasListing[$id]['parent'] : $this->db->getValue("SELECT `parent` FROM " . $this->getFullTableName("site_content") . " WHERE `id` = '{$id}' LIMIT 0,1");
3009
+                $id = isset($this->aliasListing[$id]['parent']) ? $this->aliasListing[$id]['parent'] : $this->db->getValue("SELECT `parent` FROM ".$this->getFullTableName("site_content")." WHERE `id` = '{$id}' LIMIT 0,1");
3010 3010
                 if (!$id || $id == '0') {
3011 3011
                     break;
3012 3012
                 }
@@ -3057,15 +3057,15 @@  discard block
 block discarded – undo
3057 3057
 
3058 3058
         if ($this->config['aliaslistingfolder'] == 1) {
3059 3059
 
3060
-            $res = $this->db->select("id,alias,isfolder,parent", $this->getFullTableName('site_content'), "parent IN (" . $id . ") AND deleted = '0'");
3060
+            $res = $this->db->select("id,alias,isfolder,parent", $this->getFullTableName('site_content'), "parent IN (".$id.") AND deleted = '0'");
3061 3061
             $idx = array();
3062 3062
             while ($row = $this->db->getRow($res)) {
3063 3063
                 $pAlias = '';
3064 3064
                 if (isset($this->aliasListing[$row['parent']])) {
3065
-                    $pAlias .= !empty($this->aliasListing[$row['parent']]['path']) ? $this->aliasListing[$row['parent']]['path'] . '/' : '';
3066
-                    $pAlias .= !empty($this->aliasListing[$row['parent']]['alias']) ? $this->aliasListing[$row['parent']]['alias'] . '/' : '';
3065
+                    $pAlias .= !empty($this->aliasListing[$row['parent']]['path']) ? $this->aliasListing[$row['parent']]['path'].'/' : '';
3066
+                    $pAlias .= !empty($this->aliasListing[$row['parent']]['alias']) ? $this->aliasListing[$row['parent']]['alias'].'/' : '';
3067 3067
                 };
3068
-                $children[$pAlias . $row['alias']] = $row['id'];
3068
+                $children[$pAlias.$row['alias']] = $row['id'];
3069 3069
                 if ($row['isfolder'] == 1) {
3070 3070
                     $idx[] = $row['id'];
3071 3071
                 }
@@ -3097,7 +3097,7 @@  discard block
 block discarded – undo
3097 3097
                 $depth--;
3098 3098
 
3099 3099
                 foreach ($documentMap_cache[$id] as $childId) {
3100
-                    $pkey = (strlen($this->aliasListing[$childId]['path']) ? "{$this->aliasListing[$childId]['path']}/" : '') . $this->aliasListing[$childId]['alias'];
3100
+                    $pkey = (strlen($this->aliasListing[$childId]['path']) ? "{$this->aliasListing[$childId]['path']}/" : '').$this->aliasListing[$childId]['alias'];
3101 3101
                     if (!strlen($pkey)) {
3102 3102
                         $pkey = "{$childId}";
3103 3103
                     }
@@ -3126,7 +3126,7 @@  discard block
 block discarded – undo
3126 3126
         if (substr(strtolower($url), 0, 11) == "javascript:") {
3127 3127
             $fnc = substr($url, 11);
3128 3128
         } elseif ($url) {
3129
-            $fnc = "window.location.href='" . addslashes($url) . "';";
3129
+            $fnc = "window.location.href='".addslashes($url)."';";
3130 3130
         } else {
3131 3131
             $fnc = "history.back(-1);";
3132 3132
         }
@@ -3135,7 +3135,7 @@  discard block
 block discarded – undo
3135 3135
             <meta http-equiv=\"Content-Type\" content=\"text/html; charset={$modx_manager_charset};\">
3136 3136
             <script>
3137 3137
                 function __alertQuit() {
3138
-                    alert('" . addslashes($msg) . "');
3138
+                    alert('".addslashes($msg)."');
3139 3139
                     {$fnc}
3140 3140
                 }
3141 3141
                 window.setTimeout('__alertQuit();',100);
@@ -3159,7 +3159,7 @@  discard block
 block discarded – undo
3159 3159
         if ($pms) {
3160 3160
             $state = ($pms[$pm] === 1);
3161 3161
         }
3162
-        return (int)$state;
3162
+        return (int) $state;
3163 3163
     }
3164 3164
 
3165 3165
     /**
@@ -3172,8 +3172,8 @@  discard block
 block discarded – undo
3172 3172
      */
3173 3173
     public function elementIsLocked($type, $id, $includeThisUser = false)
3174 3174
     {
3175
-        $id = (int)$id;
3176
-        $type = (int)$type;
3175
+        $id = (int) $id;
3176
+        $type = (int) $type;
3177 3177
         if (!$type || !$id) {
3178 3178
             return null;
3179 3179
         }
@@ -3223,7 +3223,7 @@  discard block
 block discarded – undo
3223 3223
             return $lockedElements;
3224 3224
         }
3225 3225
 
3226
-        $type = (int)$type;
3226
+        $type = (int) $type;
3227 3227
         if (isset($lockedElements[$type])) {
3228 3228
             return $lockedElements[$type];
3229 3229
         } else {
@@ -3240,7 +3240,7 @@  discard block
 block discarded – undo
3240 3240
             $this->lockedElements = array();
3241 3241
             $this->cleanupExpiredLocks();
3242 3242
 
3243
-            $rs = $this->db->select('sid,internalKey,elementType,elementId,lasthit,username', $this->getFullTableName('active_user_locks') . " ul
3243
+            $rs = $this->db->select('sid,internalKey,elementType,elementId,lasthit,username', $this->getFullTableName('active_user_locks')." ul
3244 3244
                 LEFT JOIN {$this->getFullTableName('manager_users')} mu on ul.internalKey = mu.id");
3245 3245
             while ($row = $this->db->getRow($rs)) {
3246 3246
                 $this->lockedElements[$row['elementType']][$row['elementId']] = array(
@@ -3263,7 +3263,7 @@  discard block
 block discarded – undo
3263 3263
     public function cleanupExpiredLocks()
3264 3264
     {
3265 3265
         // Clean-up active_user_sessions first
3266
-        $timeout = (int)$this->config['session_timeout'] < 2 ? 120 : $this->config['session_timeout'] * 60; // session.js pings every 10min, updateMail() in mainMenu pings every minute, so 2min is minimum
3266
+        $timeout = (int) $this->config['session_timeout'] < 2 ? 120 : $this->config['session_timeout'] * 60; // session.js pings every 10min, updateMail() in mainMenu pings every minute, so 2min is minimum
3267 3267
         $validSessionTimeLimit = $this->time - $timeout;
3268 3268
         $this->db->delete($this->getFullTableName('active_user_sessions'), "lasthit < {$validSessionTimeLimit}");
3269 3269
 
@@ -3276,7 +3276,7 @@  discard block
 block discarded – undo
3276 3276
             foreach ($rs as $row) {
3277 3277
                 $userSids[] = $row['sid'];
3278 3278
             }
3279
-            $userSids = "'" . implode("','", $userSids) . "'";
3279
+            $userSids = "'".implode("','", $userSids)."'";
3280 3280
             $this->db->delete($this->getFullTableName('active_user_locks'), "sid NOT IN({$userSids})");
3281 3281
         } else {
3282 3282
             $this->db->delete($this->getFullTableName('active_user_locks'));
@@ -3360,8 +3360,8 @@  discard block
 block discarded – undo
3360 3360
     public function lockElement($type, $id)
3361 3361
     {
3362 3362
         $userId = $this->isBackend() && $_SESSION['mgrInternalKey'] ? $_SESSION['mgrInternalKey'] : 0;
3363
-        $type = (int)$type;
3364
-        $id = (int)$id;
3363
+        $type = (int) $type;
3364
+        $id = (int) $id;
3365 3365
         if (!$type || !$id || !$userId) {
3366 3366
             return false;
3367 3367
         }
@@ -3382,8 +3382,8 @@  discard block
 block discarded – undo
3382 3382
     public function unlockElement($type, $id, $includeAllUsers = false)
3383 3383
     {
3384 3384
         $userId = $this->isBackend() && $_SESSION['mgrInternalKey'] ? $_SESSION['mgrInternalKey'] : 0;
3385
-        $type = (int)$type;
3386
-        $id = (int)$id;
3385
+        $type = (int) $type;
3386
+        $id = (int) $id;
3387 3387
         if (!$type || !$id) {
3388 3388
             return false;
3389 3389
         }
@@ -3450,8 +3450,8 @@  discard block
 block discarded – undo
3450 3450
         }
3451 3451
 
3452 3452
         $usertype = $this->isFrontend() ? 1 : 0;
3453
-        $evtid = (int)$evtid;
3454
-        $type = (int)$type;
3453
+        $evtid = (int) $evtid;
3454
+        $type = (int) $type;
3455 3455
 
3456 3456
         // Types: 1 = information, 2 = warning, 3 = error
3457 3457
         if ($type < 1) {
@@ -3473,8 +3473,8 @@  discard block
 block discarded – undo
3473 3473
         if (isset($this->config['send_errormail']) && $this->config['send_errormail'] !== '0') {
3474 3474
             if ($this->config['send_errormail'] <= $type) {
3475 3475
                 $this->sendmail(array(
3476
-                    'subject' => 'MODX System Error on ' . $this->config['site_name'],
3477
-                    'body' => 'Source: ' . $source . ' - The details of the error could be seen in the MODX system events log.',
3476
+                    'subject' => 'MODX System Error on '.$this->config['site_name'],
3477
+                    'body' => 'Source: '.$source.' - The details of the error could be seen in the MODX system events log.',
3478 3478
                     'type' => 'text'
3479 3479
                 ));
3480 3480
             }
@@ -3522,7 +3522,7 @@  discard block
 block discarded – undo
3522 3522
             $p['fromname'] = $userinfo['username'];
3523 3523
         }
3524 3524
         if ($msg === '' && !isset($p['body'])) {
3525
-            $p['body'] = $_SERVER['REQUEST_URI'] . "\n" . $_SERVER['HTTP_USER_AGENT'] . "\n" . $_SERVER['HTTP_REFERER'];
3525
+            $p['body'] = $_SERVER['REQUEST_URI']."\n".$_SERVER['HTTP_USER_AGENT']."\n".$_SERVER['HTTP_REFERER'];
3526 3526
         } elseif (is_string($msg) && 0 < strlen($msg)) {
3527 3527
             $p['body'] = $msg;
3528 3528
         }
@@ -3562,8 +3562,8 @@  discard block
 block discarded – undo
3562 3562
             $files = array();
3563 3563
         }
3564 3564
         foreach ($files as $f) {
3565
-            if (file_exists(MODX_BASE_PATH . $f) && is_file(MODX_BASE_PATH . $f) && is_readable(MODX_BASE_PATH . $f)) {
3566
-                $this->mail->AddAttachment(MODX_BASE_PATH . $f);
3565
+            if (file_exists(MODX_BASE_PATH.$f) && is_file(MODX_BASE_PATH.$f) && is_readable(MODX_BASE_PATH.$f)) {
3566
+                $this->mail->AddAttachment(MODX_BASE_PATH.$f);
3567 3567
             }
3568 3568
         }
3569 3569
         $rs = $this->mail->send();
@@ -3608,7 +3608,7 @@  discard block
 block discarded – undo
3608 3608
      */
3609 3609
     public function isFrontend()
3610 3610
     {
3611
-        return ! $this->isBackend();
3611
+        return !$this->isBackend();
3612 3612
     }
3613 3613
 
3614 3614
     /**
@@ -3633,14 +3633,14 @@  discard block
 block discarded – undo
3633 3633
         $tblsc = $this->getFullTableName("site_content");
3634 3634
         $tbldg = $this->getFullTableName("document_groups");
3635 3635
         // modify field names to use sc. table reference
3636
-        $fields = 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $fields))));
3637
-        $sort = 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $sort))));
3636
+        $fields = 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $fields))));
3637
+        $sort = 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $sort))));
3638 3638
         // get document groups for current user
3639 3639
         if ($docgrp = $this->getUserDocGroups()) {
3640 3640
             $docgrp = implode(",", $docgrp);
3641 3641
         }
3642 3642
         // build query
3643
-        $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0") . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)");
3643
+        $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='".$_SESSION['mgrRole']."' OR sc.privatemgr=0").(!$docgrp ? "" : " OR dg.document_group IN ($docgrp)");
3644 3644
         $result = $this->db->select("DISTINCT {$fields}", "{$tblsc} sc
3645 3645
                 LEFT JOIN {$tbldg} dg on dg.document = sc.id", "sc.parent = '{$id}' AND ({$access}) GROUP BY sc.id", "{$sort} {$dir}");
3646 3646
         $resourceArray = $this->db->makeArray($result);
@@ -3670,14 +3670,14 @@  discard block
 block discarded – undo
3670 3670
         $tbldg = $this->getFullTableName("document_groups");
3671 3671
 
3672 3672
         // modify field names to use sc. table reference
3673
-        $fields = 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $fields))));
3674
-        $sort = 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $sort))));
3673
+        $fields = 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $fields))));
3674
+        $sort = 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $sort))));
3675 3675
         // get document groups for current user
3676 3676
         if ($docgrp = $this->getUserDocGroups()) {
3677 3677
             $docgrp = implode(",", $docgrp);
3678 3678
         }
3679 3679
         // build query
3680
-        $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0") . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)");
3680
+        $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='".$_SESSION['mgrRole']."' OR sc.privatemgr=0").(!$docgrp ? "" : " OR dg.document_group IN ($docgrp)");
3681 3681
         $result = $this->db->select("DISTINCT {$fields}", "{$tblsc} sc
3682 3682
                 LEFT JOIN {$tbldg} dg on dg.document = sc.id", "sc.parent = '{$id}' AND sc.published=1 AND sc.deleted=0 AND ({$access}) GROUP BY sc.id", "{$sort} {$dir}");
3683 3683
         $resourceArray = $this->db->makeArray($result);
@@ -3712,16 +3712,16 @@  discard block
 block discarded – undo
3712 3712
             return $this->tmpCache[__FUNCTION__][$cacheKey];
3713 3713
         }
3714 3714
 
3715
-        $published = ($published !== 'all') ? 'AND sc.published = ' . $published : '';
3716
-        $deleted = ($deleted !== 'all') ? 'AND sc.deleted = ' . $deleted : '';
3715
+        $published = ($published !== 'all') ? 'AND sc.published = '.$published : '';
3716
+        $deleted = ($deleted !== 'all') ? 'AND sc.deleted = '.$deleted : '';
3717 3717
 
3718 3718
         if ($where != '') {
3719
-            $where = 'AND ' . $where;
3719
+            $where = 'AND '.$where;
3720 3720
         }
3721 3721
 
3722 3722
         // modify field names to use sc. table reference
3723
-        $fields = 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $fields))));
3724
-        $sort = ($sort == '') ? '' : 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $sort))));
3723
+        $fields = 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $fields))));
3724
+        $sort = ($sort == '') ? '' : 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $sort))));
3725 3725
 
3726 3726
         // get document groups for current user
3727 3727
         if ($docgrp = $this->getUserDocGroups()) {
@@ -3729,7 +3729,7 @@  discard block
 block discarded – undo
3729 3729
         }
3730 3730
 
3731 3731
         // build query
3732
-        $access = ($this->isFrontend() ? 'sc.privateweb=0' : '1="' . $_SESSION['mgrRole'] . '" OR sc.privatemgr=0') . (!$docgrp ? '' : ' OR dg.document_group IN (' . $docgrp . ')');
3732
+        $access = ($this->isFrontend() ? 'sc.privateweb=0' : '1="'.$_SESSION['mgrRole'].'" OR sc.privatemgr=0').(!$docgrp ? '' : ' OR dg.document_group IN ('.$docgrp.')');
3733 3733
 
3734 3734
         $tblsc = $this->getFullTableName('site_content');
3735 3735
         $tbldg = $this->getFullTableName('document_groups');
@@ -3781,10 +3781,10 @@  discard block
 block discarded – undo
3781 3781
             return false;
3782 3782
         } else {
3783 3783
             // modify field names to use sc. table reference
3784
-            $fields = 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $fields))));
3785
-            $sort = ($sort == '') ? '' : 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $sort))));
3784
+            $fields = 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $fields))));
3785
+            $sort = ($sort == '') ? '' : 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $sort))));
3786 3786
             if ($where != '') {
3787
-                $where = 'AND ' . $where;
3787
+                $where = 'AND '.$where;
3788 3788
             }
3789 3789
 
3790 3790
             $published = ($published !== 'all') ? "AND sc.published = '{$published}'" : '';
@@ -3795,13 +3795,13 @@  discard block
 block discarded – undo
3795 3795
                 $docgrp = implode(',', $docgrp);
3796 3796
             }
3797 3797
 
3798
-            $access = ($this->isFrontend() ? 'sc.privateweb=0' : '1="' . $_SESSION['mgrRole'] . '" OR sc.privatemgr=0') . (!$docgrp ? '' : ' OR dg.document_group IN (' . $docgrp . ')');
3798
+            $access = ($this->isFrontend() ? 'sc.privateweb=0' : '1="'.$_SESSION['mgrRole'].'" OR sc.privatemgr=0').(!$docgrp ? '' : ' OR dg.document_group IN ('.$docgrp.')');
3799 3799
 
3800 3800
             $tblsc = $this->getFullTableName('site_content');
3801 3801
             $tbldg = $this->getFullTableName('document_groups');
3802 3802
 
3803 3803
             $result = $this->db->select("DISTINCT {$fields}", "{$tblsc} sc
3804
-                    LEFT JOIN {$tbldg} dg on dg.document = sc.id", "(sc.id IN (" . implode(',', $ids) . ") {$published} {$deleted} {$where}) AND ({$access}) GROUP BY sc.id", ($sort ? "{$sort} {$dir}" : ""), $limit);
3804
+                    LEFT JOIN {$tbldg} dg on dg.document = sc.id", "(sc.id IN (".implode(',', $ids).") {$published} {$deleted} {$where}) AND ({$access}) GROUP BY sc.id", ($sort ? "{$sort} {$dir}" : ""), $limit);
3805 3805
 
3806 3806
             $resourceArray = $this->db->makeArray($result);
3807 3807
 
@@ -3906,12 +3906,12 @@  discard block
 block discarded – undo
3906 3906
             $tbldg = $this->getFullTableName("document_groups");
3907 3907
             $activeSql = $active == 1 ? "AND sc.published=1 AND sc.deleted=0" : "";
3908 3908
             // modify field names to use sc. table reference
3909
-            $fields = 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $fields))));
3909
+            $fields = 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $fields))));
3910 3910
             // get document groups for current user
3911 3911
             if ($docgrp = $this->getUserDocGroups()) {
3912 3912
                 $docgrp = implode(",", $docgrp);
3913 3913
             }
3914
-            $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0") . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)");
3914
+            $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='".$_SESSION['mgrRole']."' OR sc.privatemgr=0").(!$docgrp ? "" : " OR dg.document_group IN ($docgrp)");
3915 3915
             $result = $this->db->select($fields, "{$tblsc} sc LEFT JOIN {$tbldg} dg on dg.document = sc.id", "(sc.id='{$pageid}' {$activeSql}) AND ({$access})", "", 1);
3916 3916
             $pageInfo = $this->db->getRow($result);
3917 3917
 
@@ -3958,7 +3958,7 @@  discard block
 block discarded – undo
3958 3958
     {
3959 3959
         if ($this->currentSnippet) {
3960 3960
             $tbl = $this->getFullTableName("site_snippets");
3961
-            $rs = $this->db->select('id', $tbl, "name='" . $this->db->escape($this->currentSnippet) . "'", '', 1);
3961
+            $rs = $this->db->select('id', $tbl, "name='".$this->db->escape($this->currentSnippet)."'", '', 1);
3962 3962
             if ($snippetId = $this->db->getValue($rs)) {
3963 3963
                 return $snippetId;
3964 3964
             }
@@ -3985,23 +3985,23 @@  discard block
 block discarded – undo
3985 3985
      */
3986 3986
     public function clearCache($type = '', $report = false)
3987 3987
     {
3988
-        $cache_dir = MODX_BASE_PATH . $this->getCacheFolder();
3988
+        $cache_dir = MODX_BASE_PATH.$this->getCacheFolder();
3989 3989
         if (is_array($type)) {
3990 3990
             foreach ($type as $_) {
3991 3991
                 $this->clearCache($_, $report);
3992 3992
             }
3993 3993
         } elseif ($type == 'full') {
3994
-            include_once(MODX_MANAGER_PATH . 'processors/cache_sync.class.processor.php');
3994
+            include_once(MODX_MANAGER_PATH.'processors/cache_sync.class.processor.php');
3995 3995
             $sync = new synccache();
3996 3996
             $sync->setCachepath($cache_dir);
3997 3997
             $sync->setReport($report);
3998 3998
             $sync->emptyCache();
3999 3999
         } elseif (preg_match('@^[1-9][0-9]*$@', $type)) {
4000 4000
             $key = ($this->config['cache_type'] == 2) ? $this->makePageCacheKey($type) : $type;
4001
-            $file_name = "docid_" . $key . "_*.pageCache.php";
4002
-            $cache_path = $cache_dir . $file_name;
4001
+            $file_name = "docid_".$key."_*.pageCache.php";
4002
+            $cache_path = $cache_dir.$file_name;
4003 4003
             $files = glob($cache_path);
4004
-            $files[] = $cache_dir . "docid_" . $key . ".pageCache.php";
4004
+            $files[] = $cache_dir."docid_".$key.".pageCache.php";
4005 4005
             foreach ($files as $file) {
4006 4006
                 if (!is_file($file)) {
4007 4007
                     continue;
@@ -4009,7 +4009,7 @@  discard block
 block discarded – undo
4009 4009
                 unlink($file);
4010 4010
             }
4011 4011
         } else {
4012
-            $files = glob($cache_dir . '*');
4012
+            $files = glob($cache_dir.'*');
4013 4013
             foreach ($files as $file) {
4014 4014
                 $name = basename($file);
4015 4015
                 if (strpos($name, '.pageCache.php') === false) {
@@ -4078,7 +4078,7 @@  discard block
 block discarded – undo
4078 4078
                         $f_url_suffix = '/';
4079 4079
                     }
4080 4080
 
4081
-                    $alPath = !empty ($al['path']) ? $al['path'] . '/' : '';
4081
+                    $alPath = !empty ($al['path']) ? $al['path'].'/' : '';
4082 4082
 
4083 4083
                     if ($al && $al['alias']) {
4084 4084
                         $alias = $al['alias'];
@@ -4086,7 +4086,7 @@  discard block
 block discarded – undo
4086 4086
 
4087 4087
                 }
4088 4088
 
4089
-                $alias = $alPath . $f_url_prefix . $alias . $f_url_suffix;
4089
+                $alias = $alPath.$f_url_prefix.$alias.$f_url_suffix;
4090 4090
                 $url = "{$alias}{$args}";
4091 4091
             } else {
4092 4092
                 $url = "index.php?id={$id}{$args}";
@@ -4105,7 +4105,7 @@  discard block
 block discarded – undo
4105 4105
             }
4106 4106
 
4107 4107
             //TODO: check to make sure that $site_url incudes the url :port (e.g. :8080)
4108
-            $host = $scheme == 'full' ? $this->config['site_url'] : $scheme . '://' . $_SERVER['HTTP_HOST'] . $host;
4108
+            $host = $scheme == 'full' ? $this->config['site_url'] : $scheme.'://'.$_SERVER['HTTP_HOST'].$host;
4109 4109
         }
4110 4110
 
4111 4111
         //fix strictUrl by Bumkaka
@@ -4114,9 +4114,9 @@  discard block
 block discarded – undo
4114 4114
         }
4115 4115
 
4116 4116
         if ($this->config['xhtml_urls']) {
4117
-            $url = preg_replace("/&(?!amp;)/", "&amp;", $host . $virtualDir . $url);
4117
+            $url = preg_replace("/&(?!amp;)/", "&amp;", $host.$virtualDir.$url);
4118 4118
         } else {
4119
-            $url = $host . $virtualDir . $url;
4119
+            $url = $host.$virtualDir.$url;
4120 4120
         }
4121 4121
 
4122 4122
         $evtOut = $this->invokeEvent('OnMakeDocUrl', array(
@@ -4140,21 +4140,21 @@  discard block
 block discarded – undo
4140 4140
         if (isset($this->aliasListing[$id])) {
4141 4141
             $out = $this->aliasListing[$id];
4142 4142
         } else {
4143
-            $q = $this->db->query("SELECT id,alias,isfolder,parent FROM " . $this->getFullTableName("site_content") . " WHERE id=" . (int)$id);
4143
+            $q = $this->db->query("SELECT id,alias,isfolder,parent FROM ".$this->getFullTableName("site_content")." WHERE id=".(int) $id);
4144 4144
             if ($this->db->getRecordCount($q) == '1') {
4145 4145
                 $q = $this->db->getRow($q);
4146 4146
                 $this->aliasListing[$id] = array(
4147
-                    'id' => (int)$q['id'],
4147
+                    'id' => (int) $q['id'],
4148 4148
                     'alias' => $q['alias'] == '' ? $q['id'] : $q['alias'],
4149
-                    'parent' => (int)$q['parent'],
4150
-                    'isfolder' => (int)$q['isfolder'],
4149
+                    'parent' => (int) $q['parent'],
4150
+                    'isfolder' => (int) $q['isfolder'],
4151 4151
                 );
4152 4152
                 if ($this->aliasListing[$id]['parent'] > 0) {
4153 4153
                     //fix alias_path_usage
4154 4154
                     if ($this->config['use_alias_path'] == '1') {
4155 4155
                         //&& $tmp['path'] != '' - fix error slash with epty path
4156 4156
                         $tmp = $this->getAliasListing($this->aliasListing[$id]['parent']);
4157
-                        $this->aliasListing[$id]['path'] = $tmp['path'] . ($tmp['alias_visible'] ? (($tmp['parent'] > 0 && $tmp['path'] != '') ? '/' : '') . $tmp['alias'] : '');
4157
+                        $this->aliasListing[$id]['path'] = $tmp['path'].($tmp['alias_visible'] ? (($tmp['parent'] > 0 && $tmp['path'] != '') ? '/' : '').$tmp['alias'] : '');
4158 4158
                     } else {
4159 4159
                         $this->aliasListing[$id]['path'] = '';
4160 4160
                     }
@@ -4195,7 +4195,7 @@  discard block
 block discarded – undo
4195 4195
         $out = array();
4196 4196
         if (empty($this->version) || !is_array($this->version)) {
4197 4197
             //include for compatibility modx version < 1.0.10
4198
-            include MODX_MANAGER_PATH . "includes/version.inc.php";
4198
+            include MODX_MANAGER_PATH."includes/version.inc.php";
4199 4199
             $this->version = array();
4200 4200
             $this->version['version'] = isset($modx_version) ? $modx_version : '';
4201 4201
             $this->version['branch'] = isset($modx_branch) ? $modx_branch : '';
@@ -4217,18 +4217,18 @@  discard block
 block discarded – undo
4217 4217
     {
4218 4218
         if (isset ($this->snippetCache[$snippetName])) {
4219 4219
             $snippet = $this->snippetCache[$snippetName];
4220
-            $properties = !empty($this->snippetCache[$snippetName . "Props"]) ? $this->snippetCache[$snippetName . "Props"] : '';
4220
+            $properties = !empty($this->snippetCache[$snippetName."Props"]) ? $this->snippetCache[$snippetName."Props"] : '';
4221 4221
         } else { // not in cache so let's check the db
4222
-            $sql = "SELECT ss.`name`, ss.`snippet`, ss.`properties`, sm.properties as `sharedproperties` FROM " . $this->getFullTableName("site_snippets") . " as ss LEFT JOIN " . $this->getFullTableName('site_modules') . " as sm on sm.guid=ss.moduleguid WHERE ss.`name`='" . $this->db->escape($snippetName) . "'  AND ss.disabled=0;";
4222
+            $sql = "SELECT ss.`name`, ss.`snippet`, ss.`properties`, sm.properties as `sharedproperties` FROM ".$this->getFullTableName("site_snippets")." as ss LEFT JOIN ".$this->getFullTableName('site_modules')." as sm on sm.guid=ss.moduleguid WHERE ss.`name`='".$this->db->escape($snippetName)."'  AND ss.disabled=0;";
4223 4223
             $result = $this->db->query($sql);
4224 4224
             if ($this->db->getRecordCount($result) == 1) {
4225 4225
                 $row = $this->db->getRow($result);
4226 4226
                 $snippet = $this->snippetCache[$snippetName] = $row['snippet'];
4227 4227
                 $mergedProperties = array_merge($this->parseProperties($row['properties']), $this->parseProperties($row['sharedproperties']));
4228
-                $properties = $this->snippetCache[$snippetName . "Props"] = json_encode($mergedProperties);
4228
+                $properties = $this->snippetCache[$snippetName."Props"] = json_encode($mergedProperties);
4229 4229
             } else {
4230 4230
                 $snippet = $this->snippetCache[$snippetName] = "return false;";
4231
-                $properties = $this->snippetCache[$snippetName . "Props"] = '';
4231
+                $properties = $this->snippetCache[$snippetName."Props"] = '';
4232 4232
             }
4233 4233
         }
4234 4234
         // load default params/properties
@@ -4328,8 +4328,8 @@  discard block
 block discarded – undo
4328 4328
             }
4329 4329
             if (strpos($tpl, $s) !== false) {
4330 4330
                 $tpl = str_replace($s, $value, $tpl);
4331
-            } elseif($this->debug) {
4332
-                $this->addLog('parseText parse error', $_SERVER['REQUEST_URI'] . $s, 2);
4331
+            } elseif ($this->debug) {
4332
+                $this->addLog('parseText parse error', $_SERVER['REQUEST_URI'].$s, 2);
4333 4333
             }
4334 4334
         }
4335 4335
 
@@ -4378,7 +4378,7 @@  discard block
 block discarded – undo
4378 4378
             case 'CODE':
4379 4379
                 break;
4380 4380
             case 'FILE':
4381
-                $template = file_get_contents(MODX_BASE_PATH . $template);
4381
+                $template = file_get_contents(MODX_BASE_PATH.$template);
4382 4382
                 break;
4383 4383
             case 'CHUNK':
4384 4384
                 $template = $this->getChunk($template);
@@ -4411,7 +4411,7 @@  discard block
 block discarded – undo
4411 4411
         if ($mode !== 'formatOnly' && empty($timestamp)) {
4412 4412
             return '-';
4413 4413
         }
4414
-        $timestamp = (int)$timestamp;
4414
+        $timestamp = (int) $timestamp;
4415 4415
 
4416 4416
         switch ($this->config['datetime_format']) {
4417 4417
             case 'YYYY/mm/dd':
@@ -4431,7 +4431,7 @@  discard block
 block discarded – undo
4431 4431
         }
4432 4432
 
4433 4433
         if (empty($mode)) {
4434
-            $strTime = strftime($dateFormat . " %H:%M:%S", $timestamp);
4434
+            $strTime = strftime($dateFormat." %H:%M:%S", $timestamp);
4435 4435
         } elseif ($mode == 'dateOnly') {
4436 4436
             $strTime = strftime($dateFormat, $timestamp);
4437 4437
         } elseif ($mode == 'formatOnly') {
@@ -4485,7 +4485,7 @@  discard block
 block discarded – undo
4485 4485
             $S = 0;
4486 4486
         }
4487 4487
         $timeStamp = mktime($H, $M, $S, $m, $d, $Y);
4488
-        $timeStamp = (int)$timeStamp;
4488
+        $timeStamp = (int) $timeStamp;
4489 4489
         return $timeStamp;
4490 4490
     }
4491 4491
 
@@ -4527,7 +4527,7 @@  discard block
 block discarded – undo
4527 4527
                     if ($v === 'value') {
4528 4528
                         unset($_[$i]);
4529 4529
                     } else {
4530
-                        $_[$i] = 'tv.' . $v;
4530
+                        $_[$i] = 'tv.'.$v;
4531 4531
                     }
4532 4532
                 }
4533 4533
                 $fields = implode(',', $_);
@@ -4536,12 +4536,12 @@  discard block
 block discarded – undo
4536 4536
             }
4537 4537
 
4538 4538
             if ($tvsort != '') {
4539
-                $tvsort = 'tv.' . implode(',tv.', array_filter(array_map('trim', explode(',', $tvsort))));
4539
+                $tvsort = 'tv.'.implode(',tv.', array_filter(array_map('trim', explode(',', $tvsort))));
4540 4540
             }
4541 4541
             if ($tvidnames == "*") {
4542 4542
                 $query = "tv.id<>0";
4543 4543
             } else {
4544
-                $query = (is_numeric($tvidnames[0]) ? "tv.id" : "tv.name") . " IN ('" . implode("','", $tvidnames) . "')";
4544
+                $query = (is_numeric($tvidnames[0]) ? "tv.id" : "tv.name")." IN ('".implode("','", $tvidnames)."')";
4545 4545
             }
4546 4546
 
4547 4547
             $this->getUserDocGroups();
@@ -4685,7 +4685,7 @@  discard block
 block discarded – undo
4685 4685
             return $this->tmpCache[__FUNCTION__][$cacheKey];
4686 4686
         }
4687 4687
 
4688
-        if (($idnames != '*' && !is_array($idnames)) || empty($idnames) ) {
4688
+        if (($idnames != '*' && !is_array($idnames)) || empty($idnames)) {
4689 4689
             return false;
4690 4690
         } else {
4691 4691
 
@@ -4703,23 +4703,23 @@  discard block
 block discarded – undo
4703 4703
             }
4704 4704
 
4705 4705
             // get user defined template variables
4706
-            $fields = ($fields == '') ? 'tv.*' : 'tv.' . implode(',tv.', array_filter(array_map('trim', explode(',', $fields))));
4707
-            $sort = ($sort == '') ? '' : 'tv.' . implode(',tv.', array_filter(array_map('trim', explode(',', $sort))));
4706
+            $fields = ($fields == '') ? 'tv.*' : 'tv.'.implode(',tv.', array_filter(array_map('trim', explode(',', $fields))));
4707
+            $sort = ($sort == '') ? '' : 'tv.'.implode(',tv.', array_filter(array_map('trim', explode(',', $sort))));
4708 4708
 
4709 4709
             if ($idnames == '*') {
4710 4710
                 $query = 'tv.id<>0';
4711 4711
             } else {
4712
-                $query = (is_numeric($idnames[0]) ? 'tv.id' : 'tv.name') . " IN ('" . implode("','", $idnames) . "')";
4712
+                $query = (is_numeric($idnames[0]) ? 'tv.id' : 'tv.name')." IN ('".implode("','", $idnames)."')";
4713 4713
             }
4714 4714
 
4715
-            $rs = $this->db->select("{$fields}, IF(tvc.value != '', tvc.value, tv.default_text) as value", $this->getFullTableName('site_tmplvars') . " tv
4716
-                    INNER JOIN " . $this->getFullTableName('site_tmplvar_templates') . " tvtpl ON tvtpl.tmplvarid = tv.id
4717
-                    LEFT JOIN " . $this->getFullTableName('site_tmplvar_contentvalues') . " tvc ON tvc.tmplvarid=tv.id AND tvc.contentid = '{$docid}'", "{$query} AND tvtpl.templateid = '{$docRow['template']}'", ($sort ? "{$sort} {$dir}" : ""));
4715
+            $rs = $this->db->select("{$fields}, IF(tvc.value != '', tvc.value, tv.default_text) as value", $this->getFullTableName('site_tmplvars')." tv
4716
+                    INNER JOIN " . $this->getFullTableName('site_tmplvar_templates')." tvtpl ON tvtpl.tmplvarid = tv.id
4717
+                    LEFT JOIN " . $this->getFullTableName('site_tmplvar_contentvalues')." tvc ON tvc.tmplvarid=tv.id AND tvc.contentid = '{$docid}'", "{$query} AND tvtpl.templateid = '{$docRow['template']}'", ($sort ? "{$sort} {$dir}" : ""));
4718 4718
 
4719 4719
             $result = $this->db->makeArray($rs);
4720 4720
 
4721 4721
             // get default/built-in template variables
4722
-            if(is_array($docRow)){
4722
+            if (is_array($docRow)) {
4723 4723
                 ksort($docRow);
4724 4724
 
4725 4725
                 foreach ($docRow as $key => $value) {
@@ -4757,22 +4757,22 @@  discard block
 block discarded – undo
4757 4757
      */
4758 4758
     public function getTemplateVarOutput($idnames = array(), $docid = '', $published = 1, $sep = '')
4759 4759
     {
4760
-        if (is_array($idnames) && empty($idnames) ) {
4760
+        if (is_array($idnames) && empty($idnames)) {
4761 4761
             return false;
4762 4762
         } else {
4763 4763
             $output = array();
4764 4764
             $vars = ($idnames == '*' || is_array($idnames)) ? $idnames : array($idnames);
4765 4765
 
4766
-            $docid = (int)$docid > 0 ? (int)$docid : $this->documentIdentifier;
4766
+            $docid = (int) $docid > 0 ? (int) $docid : $this->documentIdentifier;
4767 4767
             // remove sort for speed
4768 4768
             $result = $this->getTemplateVars($vars, '*', $docid, $published, '', '');
4769 4769
 
4770 4770
             if ($result == false) {
4771 4771
                 return false;
4772 4772
             } else {
4773
-                $baspath = MODX_MANAGER_PATH . 'includes';
4774
-                include_once $baspath . '/tmplvars.format.inc.php';
4775
-                include_once $baspath . '/tmplvars.commands.inc.php';
4773
+                $baspath = MODX_MANAGER_PATH.'includes';
4774
+                include_once $baspath.'/tmplvars.format.inc.php';
4775
+                include_once $baspath.'/tmplvars.commands.inc.php';
4776 4776
 
4777 4777
                 for ($i = 0; $i < count($result); $i++) {
4778 4778
                     $row = $result[$i];
@@ -4797,7 +4797,7 @@  discard block
 block discarded – undo
4797 4797
      */
4798 4798
     public function getFullTableName($tbl)
4799 4799
     {
4800
-        return $this->db->config['dbase'] . ".`" . $this->db->config['table_prefix'] . $tbl . "`";
4800
+        return $this->db->config['dbase'].".`".$this->db->config['table_prefix'].$tbl."`";
4801 4801
     }
4802 4802
 
4803 4803
     /**
@@ -4876,7 +4876,7 @@  discard block
 block discarded – undo
4876 4876
     public function getCachePath()
4877 4877
     {
4878 4878
         global $base_url;
4879
-        $pth = $base_url . $this->getCacheFolder();
4879
+        $pth = $base_url.$this->getCacheFolder();
4880 4880
         return $pth;
4881 4881
     }
4882 4882
 
@@ -4928,8 +4928,8 @@  discard block
 block discarded – undo
4928 4928
         $out = false;
4929 4929
 
4930 4930
         if (!empty($context)) {
4931
-            if (is_scalar($context) && isset($_SESSION[$context . 'Validated'])) {
4932
-                $out = $_SESSION[$context . 'InternalKey'];
4931
+            if (is_scalar($context) && isset($_SESSION[$context.'Validated'])) {
4932
+                $out = $_SESSION[$context.'InternalKey'];
4933 4933
             }
4934 4934
         } else {
4935 4935
             switch (true) {
@@ -4957,8 +4957,8 @@  discard block
 block discarded – undo
4957 4957
         $out = false;
4958 4958
 
4959 4959
         if (!empty($context)) {
4960
-            if (is_scalar($context) && isset($_SESSION[$context . 'Validated'])) {
4961
-                $out = $_SESSION[$context . 'Shortname'];
4960
+            if (is_scalar($context) && isset($_SESSION[$context.'Validated'])) {
4961
+                $out = $_SESSION[$context.'Shortname'];
4962 4962
             }
4963 4963
         } else {
4964 4964
             switch (true) {
@@ -5029,8 +5029,8 @@  discard block
 block discarded – undo
5029 5029
      */
5030 5030
     public function getWebUserInfo($uid)
5031 5031
     {
5032
-        $rs = $this->db->select('wu.username, wu.password, wua.*', $this->getFullTableName("web_users") . " wu
5033
-                INNER JOIN " . $this->getFullTableName("web_user_attributes") . " wua ON wua.internalkey=wu.id", "wu.id='{$uid}'");
5032
+        $rs = $this->db->select('wu.username, wu.password, wua.*', $this->getFullTableName("web_users")." wu
5033
+                INNER JOIN " . $this->getFullTableName("web_user_attributes")." wua ON wua.internalkey=wu.id", "wu.id='{$uid}'");
5034 5034
         if ($row = $this->db->getRow($rs)) {
5035 5035
             if (!isset($row['usertype']) or !$row["usertype"]) {
5036 5036
                 $row["usertype"] = "web";
@@ -5066,7 +5066,7 @@  discard block
 block discarded – undo
5066 5066
         } else if (is_array($dg)) {
5067 5067
             // resolve ids to names
5068 5068
             $dgn = array();
5069
-            $ds = $this->db->select('name', $this->getFullTableName("documentgroup_names"), "id IN (" . implode(",", $dg) . ")");
5069
+            $ds = $this->db->select('name', $this->getFullTableName("documentgroup_names"), "id IN (".implode(",", $dg).")");
5070 5070
             while ($row = $this->db->getRow($ds)) {
5071 5071
                 $dgn[] = $row['name'];
5072 5072
             }
@@ -5094,7 +5094,7 @@  discard block
 block discarded – undo
5094 5094
         $rt = false;
5095 5095
         if ($_SESSION["webValidated"] == 1) {
5096 5096
             $tbl = $this->getFullTableName("web_users");
5097
-            $ds = $this->db->select('id, username, password', $tbl, "id='" . $this->getLoginUserID() . "'");
5097
+            $ds = $this->db->select('id, username, password', $tbl, "id='".$this->getLoginUserID()."'");
5098 5098
             if ($row = $this->db->getRow($ds)) {
5099 5099
                 if ($row["password"] == md5($oldPwd)) {
5100 5100
                     if (strlen($newPwd) < 6) {
@@ -5104,7 +5104,7 @@  discard block
 block discarded – undo
5104 5104
                     } else {
5105 5105
                         $this->db->update(array(
5106 5106
                             'password' => $this->db->escape($newPwd),
5107
-                        ), $tbl, "id='" . $this->getLoginUserID() . "'");
5107
+                        ), $tbl, "id='".$this->getLoginUserID()."'");
5108 5108
                         // invoke OnWebChangePassword event
5109 5109
                         $this->invokeEvent("OnWebChangePassword", array(
5110 5110
                             "userid" => $row["id"],
@@ -5135,8 +5135,8 @@  discard block
 block discarded – undo
5135 5135
         // check cache
5136 5136
         $grpNames = isset ($_SESSION['webUserGroupNames']) ? $_SESSION['webUserGroupNames'] : false;
5137 5137
         if (!is_array($grpNames)) {
5138
-            $rs = $this->db->select('wgn.name', $this->getFullTableName("webgroup_names") . " wgn
5139
-                    INNER JOIN " . $this->getFullTableName("web_groups") . " wg ON wg.webgroup=wgn.id AND wg.webuser='" . $this->getLoginUserID() . "'");
5138
+            $rs = $this->db->select('wgn.name', $this->getFullTableName("webgroup_names")." wgn
5139
+                    INNER JOIN " . $this->getFullTableName("web_groups")." wg ON wg.webgroup=wgn.id AND wg.webuser='".$this->getLoginUserID()."'");
5140 5140
             $grpNames = $this->db->getColumn("name", $rs);
5141 5141
             // save to cache
5142 5142
             $_SESSION['webUserGroupNames'] = $grpNames;
@@ -5169,7 +5169,7 @@  discard block
 block discarded – undo
5169 5169
         if (strpos(strtolower($src), "<style") !== false || strpos(strtolower($src), "<link") !== false) {
5170 5170
             $this->sjscripts[$nextpos] = $src;
5171 5171
         } else {
5172
-            $this->sjscripts[$nextpos] = "\t" . '<link rel="stylesheet" type="text/css" href="' . $src . '" ' . ($media ? 'media="' . $media . '" ' : '') . '/>';
5172
+            $this->sjscripts[$nextpos] = "\t".'<link rel="stylesheet" type="text/css" href="'.$src.'" '.($media ? 'media="'.$media.'" ' : '').'/>';
5173 5173
         }
5174 5174
     }
5175 5175
 
@@ -5248,7 +5248,7 @@  discard block
 block discarded – undo
5248 5248
         }
5249 5249
 
5250 5250
         if ($useThisVer && $plaintext != true && (strpos(strtolower($src), "<script") === false)) {
5251
-            $src = "\t" . '<script type="text/javascript" src="' . $src . '"></script>';
5251
+            $src = "\t".'<script type="text/javascript" src="'.$src.'"></script>';
5252 5252
         }
5253 5253
         if ($startup) {
5254 5254
             $pos = isset($overwritepos) ? $overwritepos : max(array_merge(array(0), array_keys($this->sjscripts))) + 1;
@@ -5395,7 +5395,7 @@  discard block
 block discarded – undo
5395 5395
                 $eventtime = $this->getMicroTime() - $eventtime;
5396 5396
                 $this->pluginsCode .= sprintf('<fieldset><legend><b>%s / %s</b> (%2.2f ms)</legend>', $evtName, $pluginName, $eventtime * 1000);
5397 5397
                 foreach ($parameter as $k => $v) {
5398
-                    $this->pluginsCode .= "{$k} => " . print_r($v, true) . '<br>';
5398
+                    $this->pluginsCode .= "{$k} => ".print_r($v, true).'<br>';
5399 5399
                 }
5400 5400
                 $this->pluginsCode .= '</fieldset><br />';
5401 5401
                 $this->pluginsTime["{$evtName} / {$pluginName}"] += $eventtime;
@@ -5423,13 +5423,13 @@  discard block
 block discarded – undo
5423 5423
         $plugin = array();
5424 5424
         if (isset ($this->pluginCache[$pluginName])) {
5425 5425
             $pluginCode = $this->pluginCache[$pluginName];
5426
-            $pluginProperties = isset($this->pluginCache[$pluginName . "Props"]) ? $this->pluginCache[$pluginName . "Props"] : '';
5426
+            $pluginProperties = isset($this->pluginCache[$pluginName."Props"]) ? $this->pluginCache[$pluginName."Props"] : '';
5427 5427
         } else {
5428 5428
             $pluginName = $this->db->escape($pluginName);
5429 5429
             $result = $this->db->select('name, plugincode, properties', $this->getFullTableName("site_plugins"), "name='{$pluginName}' AND disabled=0");
5430 5430
             if ($row = $this->db->getRow($result)) {
5431 5431
                 $pluginCode = $this->pluginCache[$row['name']] = $row['plugincode'];
5432
-                $pluginProperties = $this->pluginCache[$row['name'] . "Props"] = $row['properties'];
5432
+                $pluginProperties = $this->pluginCache[$row['name']."Props"] = $row['properties'];
5433 5433
             } else {
5434 5434
                 $pluginCode = $this->pluginCache[$pluginName] = "return false;";
5435 5435
                 $pluginProperties = '';
@@ -5536,7 +5536,7 @@  discard block
 block discarded – undo
5536 5536
     public function parseDocBlockFromFile($element_dir, $filename, $escapeValues = false)
5537 5537
     {
5538 5538
         $params = array();
5539
-        $fullpath = $element_dir . '/' . $filename;
5539
+        $fullpath = $element_dir.'/'.$filename;
5540 5540
         if (is_readable($fullpath)) {
5541 5541
             $tpl = @fopen($fullpath, "r");
5542 5542
             if ($tpl) {
@@ -5703,8 +5703,8 @@  discard block
 block discarded – undo
5703 5703
         $ph = array('site_url' => MODX_SITE_URL);
5704 5704
         $regexUrl = "/((http|https|ftp|ftps)\:\/\/[^\/]+(\/[^\s]+[^,.?!:;\s])?)/";
5705 5705
         $regexEmail = '#([0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-wyz][a-z](fo|g|l|m|mes|o|op|pa|ro|seum|t|u|v|z)?)#i';
5706
-        $emailSubject = isset($parsed['name']) ? '?subject=' . $parsed['name'] : '';
5707
-        $emailSubject .= isset($parsed['version']) ? ' v' . $parsed['version'] : '';
5706
+        $emailSubject = isset($parsed['name']) ? '?subject='.$parsed['name'] : '';
5707
+        $emailSubject .= isset($parsed['version']) ? ' v'.$parsed['version'] : '';
5708 5708
         foreach ($parsed as $key => $val) {
5709 5709
             if (is_array($val)) {
5710 5710
                 foreach ($val as $key2 => $val2) {
@@ -5713,7 +5713,7 @@  discard block
 block discarded – undo
5713 5713
                         $val2 = preg_replace($regexUrl, "<a href=\"{$url[0]}\" target=\"_blank\">{$url[0]}</a> ", $val2);
5714 5714
                     }
5715 5715
                     if (preg_match($regexEmail, $val2, $url)) {
5716
-                        $val2 = preg_replace($regexEmail, '<a href="mailto:\\1' . $emailSubject . '">\\1</a>', $val2);
5716
+                        $val2 = preg_replace($regexEmail, '<a href="mailto:\\1'.$emailSubject.'">\\1</a>', $val2);
5717 5717
                     }
5718 5718
                     $parsed[$key][$key2] = $val2;
5719 5719
                 }
@@ -5723,7 +5723,7 @@  discard block
 block discarded – undo
5723 5723
                     $val = preg_replace($regexUrl, "<a href=\"{$url[0]}\" target=\"_blank\">{$url[0]}</a> ", $val);
5724 5724
                 }
5725 5725
                 if (preg_match($regexEmail, $val, $url)) {
5726
-                    $val = preg_replace($regexEmail, '<a href="mailto:\\1' . $emailSubject . '">\\1</a>', $val);
5726
+                    $val = preg_replace($regexEmail, '<a href="mailto:\\1'.$emailSubject.'">\\1</a>', $val);
5727 5727
                 }
5728 5728
                 $parsed[$key] = $val;
5729 5729
             }
@@ -5737,32 +5737,32 @@  discard block
 block discarded – undo
5737 5737
         );
5738 5738
 
5739 5739
         $nl = "\n";
5740
-        $list = isset($parsed['logo']) ? '<img src="' . $this->config['base_url'] . ltrim($parsed['logo'], "/") . '" style="float:right;max-width:100px;height:auto;" />' . $nl : '';
5741
-        $list .= '<p>' . $nl;
5742
-        $list .= isset($parsed['name']) ? '<strong>' . $parsed['name'] . '</strong><br/>' . $nl : '';
5743
-        $list .= isset($parsed['description']) ? $parsed['description'] . $nl : '';
5744
-        $list .= '</p><br/>' . $nl;
5745
-        $list .= isset($parsed['version']) ? '<p><strong>' . $_lang['version'] . ':</strong> ' . $parsed['version'] . '</p>' . $nl : '';
5746
-        $list .= isset($parsed['license']) ? '<p><strong>' . $_lang['license'] . ':</strong> ' . $parsed['license'] . '</p>' . $nl : '';
5747
-        $list .= isset($parsed['lastupdate']) ? '<p><strong>' . $_lang['last_update'] . ':</strong> ' . $parsed['lastupdate'] . '</p>' . $nl : '';
5748
-        $list .= '<br/>' . $nl;
5740
+        $list = isset($parsed['logo']) ? '<img src="'.$this->config['base_url'].ltrim($parsed['logo'], "/").'" style="float:right;max-width:100px;height:auto;" />'.$nl : '';
5741
+        $list .= '<p>'.$nl;
5742
+        $list .= isset($parsed['name']) ? '<strong>'.$parsed['name'].'</strong><br/>'.$nl : '';
5743
+        $list .= isset($parsed['description']) ? $parsed['description'].$nl : '';
5744
+        $list .= '</p><br/>'.$nl;
5745
+        $list .= isset($parsed['version']) ? '<p><strong>'.$_lang['version'].':</strong> '.$parsed['version'].'</p>'.$nl : '';
5746
+        $list .= isset($parsed['license']) ? '<p><strong>'.$_lang['license'].':</strong> '.$parsed['license'].'</p>'.$nl : '';
5747
+        $list .= isset($parsed['lastupdate']) ? '<p><strong>'.$_lang['last_update'].':</strong> '.$parsed['lastupdate'].'</p>'.$nl : '';
5748
+        $list .= '<br/>'.$nl;
5749 5749
         $first = true;
5750 5750
         foreach ($arrayParams as $param => $label) {
5751 5751
             if (isset($parsed[$param])) {
5752 5752
                 if ($first) {
5753
-                    $list .= '<p><strong>' . $_lang['references'] . '</strong></p>' . $nl;
5754
-                    $list .= '<ul class="docBlockList">' . $nl;
5753
+                    $list .= '<p><strong>'.$_lang['references'].'</strong></p>'.$nl;
5754
+                    $list .= '<ul class="docBlockList">'.$nl;
5755 5755
                     $first = false;
5756 5756
                 }
5757
-                $list .= '    <li><strong>' . $label . '</strong>' . $nl;
5758
-                $list .= '        <ul>' . $nl;
5757
+                $list .= '    <li><strong>'.$label.'</strong>'.$nl;
5758
+                $list .= '        <ul>'.$nl;
5759 5759
                 foreach ($parsed[$param] as $val) {
5760
-                    $list .= '            <li>' . $val . '</li>' . $nl;
5760
+                    $list .= '            <li>'.$val.'</li>'.$nl;
5761 5761
                 }
5762
-                $list .= '        </ul></li>' . $nl;
5762
+                $list .= '        </ul></li>'.$nl;
5763 5763
             }
5764 5764
         }
5765
-        $list .= !$first ? '</ul>' . $nl : '';
5765
+        $list .= !$first ? '</ul>'.$nl : '';
5766 5766
 
5767 5767
         return $list;
5768 5768
     }
@@ -5838,7 +5838,7 @@  discard block
 block discarded – undo
5838 5838
      */
5839 5839
     public function addSnippet($name, $phpCode)
5840 5840
     {
5841
-        $this->snippetCache['#' . $name] = $phpCode;
5841
+        $this->snippetCache['#'.$name] = $phpCode;
5842 5842
     }
5843 5843
 
5844 5844
     /**
@@ -5847,7 +5847,7 @@  discard block
 block discarded – undo
5847 5847
      */
5848 5848
     public function addChunk($name, $text)
5849 5849
     {
5850
-        $this->chunkCache['#' . $name] = $text;
5850
+        $this->chunkCache['#'.$name] = $text;
5851 5851
     }
5852 5852
 
5853 5853
     /**
@@ -5883,7 +5883,7 @@  discard block
 block discarded – undo
5883 5883
         }
5884 5884
 
5885 5885
         if (!$isSafe) {
5886
-            $msg = $phpcode . "\n" . $this->currentSnippet . "\n" . print_r($_SERVER, true);
5886
+            $msg = $phpcode."\n".$this->currentSnippet."\n".print_r($_SERVER, true);
5887 5887
             $title = sprintf('Unknown eval was executed (%s)', $this->htmlspecialchars(substr(trim($phpcode), 0, 50)));
5888 5888
             $this->messageQuit($title, '', true, '', '', 'Parser', $msg);
5889 5889
             return;
@@ -5897,7 +5897,7 @@  discard block
 block discarded – undo
5897 5897
             return 'array()';
5898 5898
         }
5899 5899
 
5900
-        $output = $echo . $return;
5900
+        $output = $echo.$return;
5901 5901
         modx_sanitize_gpc($output);
5902 5902
         return $this->htmlspecialchars($output); // Maybe, all html tags are dangerous
5903 5903
     }
@@ -5915,8 +5915,8 @@  discard block
 block discarded – undo
5915 5915
 
5916 5916
         $safe = explode(',', $safe_functions);
5917 5917
 
5918
-        $phpcode = rtrim($phpcode, ';') . ';';
5919
-        $tokens = token_get_all('<?php ' . $phpcode);
5918
+        $phpcode = rtrim($phpcode, ';').';';
5919
+        $tokens = token_get_all('<?php '.$phpcode);
5920 5920
         foreach ($tokens as $i => $token) {
5921 5921
             if (!is_array($token)) {
5922 5922
                 continue;
@@ -5952,7 +5952,7 @@  discard block
 block discarded – undo
5952 5952
     public function atBindFileContent($str = '')
5953 5953
     {
5954 5954
 
5955
-        $search_path = array('assets/tvs/', 'assets/chunks/', 'assets/templates/', $this->config['rb_base_url'] . 'files/', '');
5955
+        $search_path = array('assets/tvs/', 'assets/chunks/', 'assets/templates/', $this->config['rb_base_url'].'files/', '');
5956 5956
 
5957 5957
         if (stripos($str, '@FILE') !== 0) {
5958 5958
             return $str;
@@ -5975,7 +5975,7 @@  discard block
 block discarded – undo
5975 5975
         $errorMsg = sprintf("Could not retrieve string '%s'.", $str);
5976 5976
 
5977 5977
         foreach ($search_path as $path) {
5978
-            $file_path = MODX_BASE_PATH . $path . $str;
5978
+            $file_path = MODX_BASE_PATH.$path.$str;
5979 5979
             if (strpos($file_path, MODX_MANAGER_PATH) === 0) {
5980 5980
                 return $errorMsg;
5981 5981
             } elseif (is_file($file_path)) {
@@ -5989,7 +5989,7 @@  discard block
 block discarded – undo
5989 5989
             return $errorMsg;
5990 5990
         }
5991 5991
 
5992
-        $content = (string)file_get_contents($file_path);
5992
+        $content = (string) file_get_contents($file_path);
5993 5993
         if ($content === false) {
5994 5994
             return $errorMsg;
5995 5995
         }
@@ -6102,22 +6102,22 @@  discard block
 block discarded – undo
6102 6102
 
6103 6103
         $version = isset ($GLOBALS['modx_version']) ? $GLOBALS['modx_version'] : '';
6104 6104
         $release_date = isset ($GLOBALS['release_date']) ? $GLOBALS['release_date'] : '';
6105
-        $request_uri = "http://" . $_SERVER['HTTP_HOST'] . ($_SERVER["SERVER_PORT"] == 80 ? "" : (":" . $_SERVER["SERVER_PORT"])) . $_SERVER['REQUEST_URI'];
6105
+        $request_uri = "http://".$_SERVER['HTTP_HOST'].($_SERVER["SERVER_PORT"] == 80 ? "" : (":".$_SERVER["SERVER_PORT"])).$_SERVER['REQUEST_URI'];
6106 6106
         $request_uri = $this->htmlspecialchars($request_uri, ENT_QUOTES, $this->config['modx_charset']);
6107 6107
         $ua = $this->htmlspecialchars($_SERVER['HTTP_USER_AGENT'], ENT_QUOTES, $this->config['modx_charset']);
6108 6108
         $referer = $this->htmlspecialchars($_SERVER['HTTP_REFERER'], ENT_QUOTES, $this->config['modx_charset']);
6109 6109
         if ($is_error) {
6110 6110
             $str = '<h2 style="color:red">&laquo; Evo Parse Error &raquo;</h2>';
6111 6111
             if ($msg != 'PHP Parse Error') {
6112
-                $str .= '<h3 style="color:red">' . $msg . '</h3>';
6112
+                $str .= '<h3 style="color:red">'.$msg.'</h3>';
6113 6113
             }
6114 6114
         } else {
6115 6115
             $str = '<h2 style="color:#003399">&laquo; Evo Debug/ stop message &raquo;</h2>';
6116
-            $str .= '<h3 style="color:#003399">' . $msg . '</h3>';
6116
+            $str .= '<h3 style="color:#003399">'.$msg.'</h3>';
6117 6117
         }
6118 6118
 
6119 6119
         if (!empty ($query)) {
6120
-            $str .= '<div style="font-weight:bold;border:1px solid #ccc;padding:8px;color:#333;background-color:#ffffcd;margin-bottom:15px;">SQL &gt; <span id="sqlHolder">' . $query . '</span></div>';
6120
+            $str .= '<div style="font-weight:bold;border:1px solid #ccc;padding:8px;color:#333;background-color:#ffffcd;margin-bottom:15px;">SQL &gt; <span id="sqlHolder">'.$query.'</span></div>';
6121 6121
         }
6122 6122
 
6123 6123
         $errortype = array(
@@ -6140,13 +6140,13 @@  discard block
 block discarded – undo
6140 6140
 
6141 6141
         if (!empty($nr) || !empty($file)) {
6142 6142
             if ($text != '') {
6143
-                $str .= '<div style="font-weight:bold;border:1px solid #ccc;padding:8px;color:#333;background-color:#ffffcd;margin-bottom:15px;">Error : ' . $text . '</div>';
6143
+                $str .= '<div style="font-weight:bold;border:1px solid #ccc;padding:8px;color:#333;background-color:#ffffcd;margin-bottom:15px;">Error : '.$text.'</div>';
6144 6144
             }
6145 6145
             if ($output != '') {
6146
-                $str .= '<div style="font-weight:bold;border:1px solid #ccc;padding:8px;color:#333;background-color:#ffffcd;margin-bottom:15px;">' . $output . '</div>';
6146
+                $str .= '<div style="font-weight:bold;border:1px solid #ccc;padding:8px;color:#333;background-color:#ffffcd;margin-bottom:15px;">'.$output.'</div>';
6147 6147
             }
6148 6148
             if ($nr !== '') {
6149
-                $table[] = array('ErrorType[num]', $errortype [$nr] . "[" . $nr . "]");
6149
+                $table[] = array('ErrorType[num]', $errortype [$nr]."[".$nr."]");
6150 6150
             }
6151 6151
             if ($file) {
6152 6152
                 $table[] = array('File', $file);
@@ -6166,7 +6166,7 @@  discard block
 block discarded – undo
6166 6166
         }
6167 6167
 
6168 6168
         if (!empty($this->event->activePlugin)) {
6169
-            $table[] = array('Current Plugin', $this->event->activePlugin . '(' . $this->event->name . ')');
6169
+            $table[] = array('Current Plugin', $this->event->activePlugin.'('.$this->event->name.')');
6170 6170
         }
6171 6171
 
6172 6172
         $str .= $MakeTable->create($table, array('Error information', ''));
@@ -6176,17 +6176,17 @@  discard block
 block discarded – undo
6176 6176
         $table[] = array('REQUEST_URI', $request_uri);
6177 6177
 
6178 6178
         if ($this->manager->action) {
6179
-            include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php');
6179
+            include_once(MODX_MANAGER_PATH.'includes/actionlist.inc.php');
6180 6180
             global $action_list;
6181 6181
             $actionName = (isset($action_list[$this->manager->action])) ? " - {$action_list[$this->manager->action]}" : '';
6182 6182
 
6183
-            $table[] = array('Manager action', $this->manager->action . $actionName);
6183
+            $table[] = array('Manager action', $this->manager->action.$actionName);
6184 6184
         }
6185 6185
 
6186 6186
         if (preg_match('@^[0-9]+@', $this->documentIdentifier)) {
6187 6187
             $resource = $this->getDocumentObject('id', $this->documentIdentifier);
6188 6188
             $url = $this->makeUrl($this->documentIdentifier, '', '', 'full');
6189
-            $table[] = array('Resource', '[' . $this->documentIdentifier . '] <a href="' . $url . '" target="_blank">' . $resource['pagetitle'] . '</a>');
6189
+            $table[] = array('Resource', '['.$this->documentIdentifier.'] <a href="'.$url.'" target="_blank">'.$resource['pagetitle'].'</a>');
6190 6190
         }
6191 6191
         $table[] = array('Referer', $referer);
6192 6192
         $table[] = array('User Agent', $ua);
@@ -6207,7 +6207,7 @@  discard block
 block discarded – undo
6207 6207
 
6208 6208
         $mem = memory_get_peak_usage(true);
6209 6209
         $total_mem = $mem - $this->mstart;
6210
-        $total_mem = ($total_mem / 1024 / 1024) . ' mb';
6210
+        $total_mem = ($total_mem / 1024 / 1024).' mb';
6211 6211
 
6212 6212
         $queryTime = $this->queryTime;
6213 6213
         $phpTime = $totalTime - $queryTime;
@@ -6228,18 +6228,18 @@  discard block
 block discarded – undo
6228 6228
         $str .= $this->get_backtrace(debug_backtrace());
6229 6229
         // Log error
6230 6230
         if (!empty($this->currentSnippet)) {
6231
-            $source = 'Snippet - ' . $this->currentSnippet;
6231
+            $source = 'Snippet - '.$this->currentSnippet;
6232 6232
         } elseif (!empty($this->event->activePlugin)) {
6233
-            $source = 'Plugin - ' . $this->event->activePlugin;
6233
+            $source = 'Plugin - '.$this->event->activePlugin;
6234 6234
         } elseif ($source !== '') {
6235
-            $source = 'Parser - ' . $source;
6235
+            $source = 'Parser - '.$source;
6236 6236
         } elseif ($query !== '') {
6237 6237
             $source = 'SQL Query';
6238 6238
         } else {
6239 6239
             $source = 'Parser';
6240 6240
         }
6241 6241
         if ($msg) {
6242
-            $source .= ' / ' . $msg;
6242
+            $source .= ' / '.$msg;
6243 6243
         }
6244 6244
         if (isset($actionName) && !empty($actionName)) {
6245 6245
             $source .= $actionName;
@@ -6271,12 +6271,12 @@  discard block
 block discarded – undo
6271 6271
 
6272 6272
         // Display error
6273 6273
         if (isset($_SESSION['mgrValidated'])) {
6274
-            echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html><head><title>EVO Content Manager ' . $version . ' &raquo; ' . $release_date . '</title>
6274
+            echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html><head><title>EVO Content Manager '.$version.' &raquo; '.$release_date.'</title>
6275 6275
                  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6276
-                 <link rel="stylesheet" type="text/css" href="' . $this->config['site_manager_url'] . 'media/style/' . $this->config['manager_theme'] . '/style.css" />
6276
+                 <link rel="stylesheet" type="text/css" href="' . $this->config['site_manager_url'].'media/style/'.$this->config['manager_theme'].'/style.css" />
6277 6277
                  <style type="text/css">body { padding:10px; } td {font:inherit;}</style>
6278 6278
                  </head><body>
6279
-                 ' . $str . '</body></html>';
6279
+                 ' . $str.'</body></html>';
6280 6280
 
6281 6281
         } else {
6282 6282
             echo 'Error';
@@ -6314,7 +6314,7 @@  discard block
 block discarded – undo
6314 6314
             switch ($val['type']) {
6315 6315
                 case '->':
6316 6316
                 case '::':
6317
-                    $functionName = $val['function'] = $val['class'] . $val['type'] . $val['function'];
6317
+                    $functionName = $val['function'] = $val['class'].$val['type'].$val['function'];
6318 6318
                     break;
6319 6319
                 default:
6320 6320
                     $functionName = $val['function'];
@@ -6324,7 +6324,7 @@  discard block
 block discarded – undo
6324 6324
             $args = array_pad(array(), $_, '$var');
6325 6325
             $args = implode(", ", $args);
6326 6326
             $modx = &$this;
6327
-            $args = preg_replace_callback('/\$var/', function () use ($modx, &$tmp, $val) {
6327
+            $args = preg_replace_callback('/\$var/', function() use ($modx, &$tmp, $val) {
6328 6328
                 $arg = $val['args'][$tmp - 1];
6329 6329
                 switch (true) {
6330 6330
                     case is_null($arg): {
@@ -6336,7 +6336,7 @@  discard block
 block discarded – undo
6336 6336
                         break;
6337 6337
                     }
6338 6338
                     case is_scalar($arg): {
6339
-                        $out = strlen($arg) > 20 ? 'string $var' . $tmp : ("'" . $this->htmlspecialchars(str_replace("'", "\\'", $arg)) . "'");
6339
+                        $out = strlen($arg) > 20 ? 'string $var'.$tmp : ("'".$this->htmlspecialchars(str_replace("'", "\\'", $arg))."'");
6340 6340
                         break;
6341 6341
                     }
6342 6342
                     case is_bool($arg): {
@@ -6344,23 +6344,23 @@  discard block
 block discarded – undo
6344 6344
                         break;
6345 6345
                     }
6346 6346
                     case is_array($arg): {
6347
-                        $out = 'array $var' . $tmp;
6347
+                        $out = 'array $var'.$tmp;
6348 6348
                         break;
6349 6349
                     }
6350 6350
                     case is_object($arg): {
6351
-                        $out = get_class($arg) . ' $var' . $tmp;
6351
+                        $out = get_class($arg).' $var'.$tmp;
6352 6352
                         break;
6353 6353
                     }
6354 6354
                     default: {
6355
-                        $out = '$var' . $tmp;
6355
+                        $out = '$var'.$tmp;
6356 6356
                     }
6357 6357
                 }
6358 6358
                 $tmp++;
6359 6359
                 return $out;
6360 6360
             }, $args);
6361 6361
             $line = array(
6362
-                "<strong>" . $functionName . "</strong>(" . $args . ")",
6363
-                $path . " on line " . $val['line']
6362
+                "<strong>".$functionName."</strong>(".$args.")",
6363
+                $path." on line ".$val['line']
6364 6364
             );
6365 6365
             $table[] = array(implode("<br />", $line));
6366 6366
         }
@@ -6401,7 +6401,7 @@  discard block
 block discarded – undo
6401 6401
             $alias = strip_tags($alias); // strip HTML
6402 6402
             $alias = preg_replace('/[^\.A-Za-z0-9 _-]/', '', $alias); // strip non-alphanumeric characters
6403 6403
             $alias = preg_replace('/\s+/', '-', $alias); // convert white-space to dash
6404
-            $alias = preg_replace('/-+/', '-', $alias);  // convert multiple dashes to one
6404
+            $alias = preg_replace('/-+/', '-', $alias); // convert multiple dashes to one
6405 6405
             $alias = trim($alias, '-'); // trim excess
6406 6406
             return $alias;
6407 6407
         }
@@ -6417,7 +6417,7 @@  discard block
 block discarded – undo
6417 6417
         $precisions = count($sizes) - 1;
6418 6418
         foreach ($sizes as $unit => $bytes) {
6419 6419
             if ($size >= $bytes) {
6420
-                return number_format($size / $bytes, $precisions) . ' ' . $unit;
6420
+                return number_format($size / $bytes, $precisions).' '.$unit;
6421 6421
             }
6422 6422
             $precisions--;
6423 6423
         }
@@ -6521,10 +6521,10 @@  discard block
 block discarded – undo
6521 6521
 
6522 6522
         if (strpos($str, MODX_MANAGER_PATH) === 0) {
6523 6523
             return false;
6524
-        } elseif (is_file(MODX_BASE_PATH . $str)) {
6525
-            $file_path = MODX_BASE_PATH . $str;
6526
-        } elseif (is_file(MODX_BASE_PATH . "{$tpl_dir}{$str}")) {
6527
-            $file_path = MODX_BASE_PATH . $tpl_dir . $str;
6524
+        } elseif (is_file(MODX_BASE_PATH.$str)) {
6525
+            $file_path = MODX_BASE_PATH.$str;
6526
+        } elseif (is_file(MODX_BASE_PATH."{$tpl_dir}{$str}")) {
6527
+            $file_path = MODX_BASE_PATH.$tpl_dir.$str;
6528 6528
         } else {
6529 6529
             return false;
6530 6530
         }
@@ -6650,7 +6650,7 @@  discard block
 block discarded – undo
6650 6650
             $title = 'no title';
6651 6651
         }
6652 6652
         if (is_array($msg)) {
6653
-            $msg = '<pre>' . print_r($msg, true) . '</pre>';
6653
+            $msg = '<pre>'.print_r($msg, true).'</pre>';
6654 6654
         } elseif ($msg === '') {
6655 6655
             $msg = $_SERVER['REQUEST_URI'];
6656 6656
         }
@@ -6695,7 +6695,7 @@  discard block
 block discarded – undo
6695 6695
         if (is_array($SystemAlertMsgQueque)) {
6696 6696
             $title = '';
6697 6697
             if ($this->name && $this->activePlugin) {
6698
-                $title = "<div><b>" . $this->activePlugin . "</b> - <span style='color:maroon;'>" . $this->name . "</span></div>";
6698
+                $title = "<div><b>".$this->activePlugin."</b> - <span style='color:maroon;'>".$this->name."</span></div>";
6699 6699
             }
6700 6700
             $SystemAlertMsgQueque[] = "$title<div style='margin-left:10px;margin-top:3px;'>$msg</div>";
6701 6701
         }
Please login to merge, or discard this patch.
manager/includes/sysalert.display.inc.php 2 patches
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -1,30 +1,30 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-	/**
4
-	 *	System Alert Message Queue Display file
5
-	 *	Written By Raymond Irving, April, 2005
6
-	 *
7
-	 *	Used to display system alert messages inside the browser
8
-	 *
9
-	 */
3
+    /**
4
+     *	System Alert Message Queue Display file
5
+     *	Written By Raymond Irving, April, 2005
6
+     *
7
+     *	Used to display system alert messages inside the browser
8
+     *
9
+     */
10 10
 
11
-	require_once(dirname(__FILE__).'/protect.inc.php');
11
+    require_once(dirname(__FILE__).'/protect.inc.php');
12 12
 
13
-	$sysMsgs = "";
14
-	$limit = count($SystemAlertMsgQueque);
15
-	for($i=0;$i<$limit;$i++) {
16
-		$sysMsgs .= $SystemAlertMsgQueque[$i]."<hr sys/>";
17
-	}
18
-	// reset message queque
19
-	unset($_SESSION['SystemAlertMsgQueque']);
20
-	$_SESSION['SystemAlertMsgQueque'] = array();
21
-	$SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque'];
13
+    $sysMsgs = "";
14
+    $limit = count($SystemAlertMsgQueque);
15
+    for($i=0;$i<$limit;$i++) {
16
+        $sysMsgs .= $SystemAlertMsgQueque[$i]."<hr sys/>";
17
+    }
18
+    // reset message queque
19
+    unset($_SESSION['SystemAlertMsgQueque']);
20
+    $_SESSION['SystemAlertMsgQueque'] = array();
21
+    $SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque'];
22 22
 
23
-	if($sysMsgs!="") {
23
+    if($sysMsgs!="") {
24 24
 ?>
25 25
 
26 26
 <?php // fetch the styles
27
-	echo '<link rel="stylesheet" type="text/css" href="'.MODX_MANAGER_URL.'media/style/'.$manager_theme.'/style.css'.'" />';
27
+    echo '<link rel="stylesheet" type="text/css" href="'.MODX_MANAGER_URL.'media/style/'.$manager_theme.'/style.css'.'" />';
28 28
 ?>
29 29
 <script type="text/javascript">
30 30
 // <![CDATA[
@@ -42,5 +42,5 @@  discard block
 block discarded – undo
42 42
 // ]]>
43 43
 </script>
44 44
 <?php
45
-	}
45
+    }
46 46
 ?>
47 47
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 
13 13
 	$sysMsgs = "";
14 14
 	$limit = count($SystemAlertMsgQueque);
15
-	for($i=0;$i<$limit;$i++) {
15
+	for ($i = 0; $i < $limit; $i++) {
16 16
 		$sysMsgs .= $SystemAlertMsgQueque[$i]."<hr sys/>";
17 17
 	}
18 18
 	// reset message queque
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 	$_SESSION['SystemAlertMsgQueque'] = array();
21 21
 	$SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque'];
22 22
 
23
-	if($sysMsgs!="") {
23
+	if ($sysMsgs != "") {
24 24
 ?>
25 25
 
26 26
 <?php // fetch the styles
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 			var sysAlert = new Element('div').setProperties({
33 33
 				'class': 'sysAlert'
34 34
 			});
35
-			sysAlert.innerHTML = '<?php echo $modx->db->escape($sysMsgs);?>';
35
+			sysAlert.innerHTML = '<?php echo $modx->db->escape($sysMsgs); ?>';
36 36
 			var boxHtml = new MooPrompt('<?php echo $_lang['sys_alert']; ?>', sysAlert, {
37 37
 				buttons: 1,
38 38
 				button1: 'Ok',
Please login to merge, or discard this patch.
manager/includes/config_check.inc.php 4 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@
 block discarded – undo
88 88
 }
89 89
 </script>
90 90
 
91
-JS;
91
+js;
92 92
         $modx->regClientScript($script);
93 93
         }
94 94
     }
Please login to merge, or discard this patch.
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -5,14 +5,14 @@  discard block
 block discarded – undo
5 5
 
6 6
 // PROCESSOR FIRST
7 7
 if($_SESSION['mgrRole'] == 1) {
8
-	if($_REQUEST['b'] == 'resetSysfilesChecksum' && $modx->hasPermission('settings')) {
9
-		$current = $modx->manager->getSystemChecksum($modx->config['check_files_onlogin']);
10
-		if(!empty($current)) {
11
-			$modx->manager->setSystemChecksum($current);
12
-			$modx->clearCache('full');
13
-			$modx->config['sys_files_checksum'] = $current;
14
-		};
15
-	}
8
+    if($_REQUEST['b'] == 'resetSysfilesChecksum' && $modx->hasPermission('settings')) {
9
+        $current = $modx->manager->getSystemChecksum($modx->config['check_files_onlogin']);
10
+        if(!empty($current)) {
11
+            $modx->manager->setSystemChecksum($current);
12
+            $modx->clearCache('full');
13
+            $modx->config['sys_files_checksum'] = $current;
14
+        };
15
+    }
16 16
 }
17 17
 
18 18
 // NOW CHECK CONFIG
@@ -20,15 +20,15 @@  discard block
 block discarded – undo
20 20
 
21 21
 $sysfiles_check = $modx->manager->checkSystemChecksum();
22 22
 if ($sysfiles_check!=='0'){
23
-      $warningspresent = 1;
24
-      $warnings[] = array($_lang['configcheck_sysfiles_mod']);
23
+        $warningspresent = 1;
24
+        $warnings[] = array($_lang['configcheck_sysfiles_mod']);
25 25
 }
26 26
 
27 27
 if (is_writable("includes/config.inc.php")){
28 28
     // Warn if world writable
29 29
     if(@fileperms('includes/config.inc.php') & 0x0002) {
30
-      $warningspresent = 1;
31
-      $warnings[] = array($_lang['configcheck_configinc']);
30
+        $warningspresent = 1;
31
+        $warnings[] = array($_lang['configcheck_configinc']);
32 32
     }
33 33
 }
34 34
 
@@ -179,10 +179,10 @@  discard block
 block discarded – undo
179 179
             break;
180 180
         case $_lang['configcheck_sysfiles_mod']:
181 181
             $warnings[$i][1] = $_lang["configcheck_sysfiles_mod_msg"];
182
-			$warnings[$i][2] = '<ul><li>'. implode('</li><li>', $sysfiles_check) .'</li></ul>';
183
-			if($modx->hasPermission('settings')) {
184
-				$warnings[$i][2] .= '<ul class="actionButtons" style="float:right"><li><a href="index.php?a=2&b=resetSysfilesChecksum" onclick="return confirm(\'' . $_lang["reset_sysfiles_checksum_alert"] . '\')">' . $_lang["reset_sysfiles_checksum_button"] . '</a></li></ul>';
185
-			}
182
+            $warnings[$i][2] = '<ul><li>'. implode('</li><li>', $sysfiles_check) .'</li></ul>';
183
+            if($modx->hasPermission('settings')) {
184
+                $warnings[$i][2] .= '<ul class="actionButtons" style="float:right"><li><a href="index.php?a=2&b=resetSysfilesChecksum" onclick="return confirm(\'' . $_lang["reset_sysfiles_checksum_alert"] . '\')">' . $_lang["reset_sysfiles_checksum_button"] . '</a></li></ul>';
185
+            }
186 186
             if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1]." ".implode(', ',$sysfiles_check),$_lang['configcheck_sysfiles_mod']);
187 187
             break;
188 188
         case $_lang['configcheck_lang_difference'] :
Please login to merge, or discard this patch.
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 
6 6
 // PROCESSOR FIRST
7
-if($_SESSION['mgrRole'] == 1) {
8
-	if($_REQUEST['b'] == 'resetSysfilesChecksum' && $modx->hasPermission('settings')) {
7
+if ($_SESSION['mgrRole'] == 1) {
8
+	if ($_REQUEST['b'] == 'resetSysfilesChecksum' && $modx->hasPermission('settings')) {
9 9
 		$current = $modx->manager->getSystemChecksum($modx->config['check_files_onlogin']);
10
-		if(!empty($current)) {
10
+		if (!empty($current)) {
11 11
 			$modx->manager->setSystemChecksum($current);
12 12
 			$modx->clearCache('full');
13 13
 			$modx->config['sys_files_checksum'] = $current;
@@ -19,14 +19,14 @@  discard block
 block discarded – undo
19 19
 $warningspresent = 0;
20 20
 
21 21
 $sysfiles_check = $modx->manager->checkSystemChecksum();
22
-if ($sysfiles_check!=='0'){
22
+if ($sysfiles_check !== '0') {
23 23
       $warningspresent = 1;
24 24
       $warnings[] = array($_lang['configcheck_sysfiles_mod']);
25 25
 }
26 26
 
27
-if (is_writable("includes/config.inc.php")){
27
+if (is_writable("includes/config.inc.php")) {
28 28
     // Warn if world writable
29
-    if(@fileperms('includes/config.inc.php') & 0x0002) {
29
+    if (@fileperms('includes/config.inc.php') & 0x0002) {
30 30
       $warningspresent = 1;
31 31
       $warnings[] = array($_lang['configcheck_configinc']);
32 32
     }
@@ -42,8 +42,8 @@  discard block
 block discarded – undo
42 42
     $warnings[] = array($_lang['configcheck_php_gdzip']);
43 43
 }
44 44
 
45
-if(!isset($modx->config['_hide_configcheck_validate_referer']) || $modx->config['_hide_configcheck_validate_referer'] !== '1') {
46
-    if(isset($_SESSION['mgrPermissions']['settings']) && $_SESSION['mgrPermissions']['settings'] == '1') {
45
+if (!isset($modx->config['_hide_configcheck_validate_referer']) || $modx->config['_hide_configcheck_validate_referer'] !== '1') {
46
+    if (isset($_SESSION['mgrPermissions']['settings']) && $_SESSION['mgrPermissions']['settings'] == '1') {
47 47
         if ($modx->db->getValue($modx->db->select('COUNT(setting_value)', $modx->getFullTableName('system_settings'), "setting_name='validate_referer' AND setting_value='0'"))) {
48 48
             $warningspresent = 1;
49 49
             $warnings[] = array($_lang['configcheck_validate_referer']);
@@ -52,11 +52,11 @@  discard block
 block discarded – undo
52 52
 }
53 53
 
54 54
 // check for Template Switcher plugin
55
-if(!isset($modx->config['_hide_configcheck_templateswitcher_present']) || $modx->config['_hide_configcheck_templateswitcher_present'] !== '1') {
56
-    if(isset($_SESSION['mgrPermissions']['edit_plugin']) && $_SESSION['mgrPermissions']['edit_plugin'] == '1') {
55
+if (!isset($modx->config['_hide_configcheck_templateswitcher_present']) || $modx->config['_hide_configcheck_templateswitcher_present'] !== '1') {
56
+    if (isset($_SESSION['mgrPermissions']['edit_plugin']) && $_SESSION['mgrPermissions']['edit_plugin'] == '1') {
57 57
         $rs = $modx->db->select('name, disabled', $modx->getFullTableName('site_plugins'), "name IN ('TemplateSwitcher', 'Template Switcher', 'templateswitcher', 'template_switcher', 'template switcher') OR plugincode LIKE '%TemplateSwitcher%'");
58 58
         $row = $modx->db->getRow($rs);
59
-        if($row && $row['disabled'] == 0) {
59
+        if ($row && $row['disabled'] == 0) {
60 60
             $warningspresent = 1;
61 61
             $warnings[] = array($_lang['configcheck_templateswitcher_present']);
62 62
             $tplName = $row['name'];
@@ -120,36 +120,36 @@  discard block
 block discarded – undo
120 120
     /**
121 121
      * @return bool
122 122
      */
123
-    function checkSiteCache() {
123
+    function checkSiteCache(){
124 124
         global $modx;
125
-        $checked= true;
126
-        if (file_exists($modx->config['base_path'] . 'assets/cache/siteCache.idx.php')) {
127
-            $checked= @include_once ($modx->config['base_path'] . 'assets/cache/siteCache.idx.php');
125
+        $checked = true;
126
+        if (file_exists($modx->config['base_path'].'assets/cache/siteCache.idx.php')) {
127
+            $checked = @include_once ($modx->config['base_path'].'assets/cache/siteCache.idx.php');
128 128
         }
129 129
         return $checked;
130 130
     }
131 131
 }
132 132
 
133
-if (!is_writable(MODX_BASE_PATH . "assets/cache/")) {
133
+if (!is_writable(MODX_BASE_PATH."assets/cache/")) {
134 134
     $warningspresent = 1;
135 135
     $warnings[] = array($_lang['configcheck_cache']);
136 136
 }
137 137
 
138 138
 if (!checkSiteCache()) {
139 139
     $warningspresent = 1;
140
-    $warnings[]= array($lang['configcheck_sitecache_integrity']);
140
+    $warnings[] = array($lang['configcheck_sitecache_integrity']);
141 141
 }
142 142
 
143
-if (!is_writable(MODX_BASE_PATH . "assets/images/")) {
143
+if (!is_writable(MODX_BASE_PATH."assets/images/")) {
144 144
     $warningspresent = 1;
145 145
     $warnings[] = array($_lang['configcheck_images']);
146 146
 }
147 147
 
148
-if(strpos($modx->config['rb_base_dir'],MODX_BASE_PATH)!==0) {
148
+if (strpos($modx->config['rb_base_dir'], MODX_BASE_PATH) !== 0) {
149 149
     $warningspresent = 1;
150 150
     $warnings[] = array($_lang['configcheck_rb_base_dir']);
151 151
 }
152
-if(strpos($modx->config['filemanager_path'],MODX_BASE_PATH)!==0) {
152
+if (strpos($modx->config['filemanager_path'], MODX_BASE_PATH) !== 0) {
153 153
     $warningspresent = 1;
154 154
     $warnings[] = array($_lang['configcheck_filemanager_path']);
155 155
 }
@@ -157,36 +157,36 @@  discard block
 block discarded – undo
157 157
 // clear file info cache
158 158
 clearstatcache();
159 159
 
160
-if ($warningspresent==1) {
160
+if ($warningspresent == 1) {
161 161
 
162
-if(!isset($modx->config['send_errormail'])) $modx->config['send_errormail']='3';
162
+if (!isset($modx->config['send_errormail'])) $modx->config['send_errormail'] = '3';
163 163
 $config_check_results = "<h3>".$_lang['configcheck_notok']."</h3>";
164 164
 
165
-for ($i=0;$i<count($warnings);$i++) {
165
+for ($i = 0; $i < count($warnings); $i++) {
166 166
     switch ($warnings[$i][0]) {
167 167
         case $_lang['configcheck_configinc'];
168 168
             $warnings[$i][1] = $_lang['configcheck_configinc_msg'];
169
-            if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1],$_lang['configcheck_configinc']);
169
+            if (!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0, 3, $warnings[$i][1], $_lang['configcheck_configinc']);
170 170
             break;
171 171
         case $_lang['configcheck_installer'] :
172 172
             $warnings[$i][1] = $_lang['configcheck_installer_msg'];
173
-            if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1],$_lang['configcheck_installer']);
173
+            if (!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0, 3, $warnings[$i][1], $_lang['configcheck_installer']);
174 174
             break;
175 175
         case $_lang['configcheck_cache'] :
176 176
             $warnings[$i][1] = $_lang['configcheck_cache_msg'];
177
-            if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,2,$warnings[$i][1],$_lang['configcheck_cache']);
177
+            if (!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0, 2, $warnings[$i][1], $_lang['configcheck_cache']);
178 178
             break;
179 179
         case $_lang['configcheck_images'] :
180 180
             $warnings[$i][1] = $_lang['configcheck_images_msg'];
181
-            if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,2,$warnings[$i][1],$_lang['configcheck_images']);
181
+            if (!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0, 2, $warnings[$i][1], $_lang['configcheck_images']);
182 182
             break;
183 183
         case $_lang['configcheck_sysfiles_mod']:
184 184
             $warnings[$i][1] = $_lang["configcheck_sysfiles_mod_msg"];
185
-			$warnings[$i][2] = '<ul><li>'. implode('</li><li>', $sysfiles_check) .'</li></ul>';
186
-			if($modx->hasPermission('settings')) {
187
-				$warnings[$i][2] .= '<ul class="actionButtons" style="float:right"><li><a href="index.php?a=2&b=resetSysfilesChecksum" onclick="return confirm(\'' . $_lang["reset_sysfiles_checksum_alert"] . '\')">' . $_lang["reset_sysfiles_checksum_button"] . '</a></li></ul>';
185
+			$warnings[$i][2] = '<ul><li>'.implode('</li><li>', $sysfiles_check).'</li></ul>';
186
+			if ($modx->hasPermission('settings')) {
187
+				$warnings[$i][2] .= '<ul class="actionButtons" style="float:right"><li><a href="index.php?a=2&b=resetSysfilesChecksum" onclick="return confirm(\''.$_lang["reset_sysfiles_checksum_alert"].'\')">'.$_lang["reset_sysfiles_checksum_button"].'</a></li></ul>';
188 188
 			}
189
-            if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1]." ".implode(', ',$sysfiles_check),$_lang['configcheck_sysfiles_mod']);
189
+            if (!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0, 3, $warnings[$i][1]." ".implode(', ', $sysfiles_check), $_lang['configcheck_sysfiles_mod']);
190 190
             break;
191 191
         case $_lang['configcheck_lang_difference'] :
192 192
             $warnings[$i][1] = $_lang['configcheck_lang_difference_msg'];
@@ -208,18 +208,18 @@  discard block
 block discarded – undo
208 208
             break;
209 209
         case $_lang['configcheck_validate_referer'] :
210 210
             $msg = $_lang['configcheck_validate_referer_msg'];
211
-            $msg .= '<br />' . sprintf($_lang["configcheck_hide_warning"], 'validate_referer');
211
+            $msg .= '<br />'.sprintf($_lang["configcheck_hide_warning"], 'validate_referer');
212 212
             $warnings[$i][1] = "<span id=\"validate_referer_warning_wrapper\">{$msg}</span>\n";
213 213
             break;
214 214
         case $_lang['configcheck_templateswitcher_present'] :
215 215
             $msg = $_lang["configcheck_templateswitcher_present_msg"];
216
-            if(isset($_SESSION['mgrPermissions']['save_plugin']) && $_SESSION['mgrPermissions']['save_plugin'] == '1') {
217
-                $msg .= '<br />' . $_lang["configcheck_templateswitcher_present_disable"];
216
+            if (isset($_SESSION['mgrPermissions']['save_plugin']) && $_SESSION['mgrPermissions']['save_plugin'] == '1') {
217
+                $msg .= '<br />'.$_lang["configcheck_templateswitcher_present_disable"];
218 218
             }
219
-            if(isset($_SESSION['mgrPermissions']['delete_plugin']) && $_SESSION['mgrPermissions']['delete_plugin'] == '1') {
220
-                $msg .= '<br />' . $_lang["configcheck_templateswitcher_present_delete"];
219
+            if (isset($_SESSION['mgrPermissions']['delete_plugin']) && $_SESSION['mgrPermissions']['delete_plugin'] == '1') {
220
+                $msg .= '<br />'.$_lang["configcheck_templateswitcher_present_delete"];
221 221
             }
222
-            $msg .= '<br />' . sprintf($_lang["configcheck_hide_warning"], 'templateswitcher_present');
222
+            $msg .= '<br />'.sprintf($_lang["configcheck_hide_warning"], 'templateswitcher_present');
223 223
             $warnings[$i][1] = "<span id=\"templateswitcher_present_warning_wrapper\">{$msg}</span>\n";
224 224
             break;
225 225
         case $_lang['configcheck_rb_base_dir'] :
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
             $warnings[$i][1] = $_lang['configcheck_default_msg'];
233 233
     }
234 234
 
235
-    $admin_warning = $_SESSION['mgrRole']!=1 ? $_lang['configcheck_admin'] : "" ;
235
+    $admin_warning = $_SESSION['mgrRole'] != 1 ? $_lang['configcheck_admin'] : "";
236 236
     $config_check_results .= "
237 237
             <fieldset>
238 238
             <p><strong>".$_lang['configcheck_warning']."</strong> '".$warnings[$i][0]."'</p>
@@ -241,11 +241,11 @@  discard block
 block discarded – undo
241 241
             ".(isset($warnings[$i][2]) ? '<div style="padding-left:1em">'.$warnings[$i][2].'</div>' : '')."
242 242
             </fieldset>
243 243
 ";
244
-        if ($i!=count($warnings)-1) {
244
+        if ($i != count($warnings) - 1) {
245 245
             $config_check_results .= "<br />";
246 246
         }
247 247
     }
248
-    $_SESSION["mgrConfigCheck"]=true;
248
+    $_SESSION["mgrConfigCheck"] = true;
249 249
 } else {
250 250
     $config_check_results = $_lang['configcheck_ok'];
251 251
 }
Please login to merge, or discard this patch.
Braces   +22 added lines, -9 removed lines patch added patch discarded remove patch
@@ -19,12 +19,12 @@  discard block
 block discarded – undo
19 19
 $warningspresent = 0;
20 20
 
21 21
 $sysfiles_check = $modx->manager->checkSystemChecksum();
22
-if ($sysfiles_check!=='0'){
22
+if ($sysfiles_check!=='0') {
23 23
       $warningspresent = 1;
24 24
       $warnings[] = array($_lang['configcheck_sysfiles_mod']);
25 25
 }
26 26
 
27
-if (is_writable("includes/config.inc.php")){
27
+if (is_writable("includes/config.inc.php")) {
28 28
     // Warn if world writable
29 29
     if(@fileperms('includes/config.inc.php') & 0x0002) {
30 30
       $warningspresent = 1;
@@ -120,7 +120,8 @@  discard block
 block discarded – undo
120 120
     /**
121 121
      * @return bool
122 122
      */
123
-    function checkSiteCache() {
123
+    function checkSiteCache()
124
+    {
124 125
         global $modx;
125 126
         $checked= true;
126 127
         if (file_exists($modx->config['base_path'] . 'assets/cache/siteCache.idx.php')) {
@@ -159,26 +160,36 @@  discard block
 block discarded – undo
159 160
 
160 161
 if ($warningspresent==1) {
161 162
 
162
-if(!isset($modx->config['send_errormail'])) $modx->config['send_errormail']='3';
163
+if(!isset($modx->config['send_errormail'])) {
164
+    $modx->config['send_errormail']='3';
165
+}
163 166
 $config_check_results = "<h3>".$_lang['configcheck_notok']."</h3>";
164 167
 
165 168
 for ($i=0;$i<count($warnings);$i++) {
166 169
     switch ($warnings[$i][0]) {
167 170
         case $_lang['configcheck_configinc'];
168 171
             $warnings[$i][1] = $_lang['configcheck_configinc_msg'];
169
-            if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1],$_lang['configcheck_configinc']);
172
+            if(!$_SESSION["mgrConfigCheck"]) {
173
+                $modx->logEvent(0,3,$warnings[$i][1],$_lang['configcheck_configinc']);
174
+            }
170 175
             break;
171 176
         case $_lang['configcheck_installer'] :
172 177
             $warnings[$i][1] = $_lang['configcheck_installer_msg'];
173
-            if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1],$_lang['configcheck_installer']);
178
+            if(!$_SESSION["mgrConfigCheck"]) {
179
+                $modx->logEvent(0,3,$warnings[$i][1],$_lang['configcheck_installer']);
180
+            }
174 181
             break;
175 182
         case $_lang['configcheck_cache'] :
176 183
             $warnings[$i][1] = $_lang['configcheck_cache_msg'];
177
-            if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,2,$warnings[$i][1],$_lang['configcheck_cache']);
184
+            if(!$_SESSION["mgrConfigCheck"]) {
185
+                $modx->logEvent(0,2,$warnings[$i][1],$_lang['configcheck_cache']);
186
+            }
178 187
             break;
179 188
         case $_lang['configcheck_images'] :
180 189
             $warnings[$i][1] = $_lang['configcheck_images_msg'];
181
-            if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,2,$warnings[$i][1],$_lang['configcheck_images']);
190
+            if(!$_SESSION["mgrConfigCheck"]) {
191
+                $modx->logEvent(0,2,$warnings[$i][1],$_lang['configcheck_images']);
192
+            }
182 193
             break;
183 194
         case $_lang['configcheck_sysfiles_mod']:
184 195
             $warnings[$i][1] = $_lang["configcheck_sysfiles_mod_msg"];
@@ -186,7 +197,9 @@  discard block
 block discarded – undo
186 197
 			if($modx->hasPermission('settings')) {
187 198
 				$warnings[$i][2] .= '<ul class="actionButtons" style="float:right"><li><a href="index.php?a=2&b=resetSysfilesChecksum" onclick="return confirm(\'' . $_lang["reset_sysfiles_checksum_alert"] . '\')">' . $_lang["reset_sysfiles_checksum_button"] . '</a></li></ul>';
188 199
 			}
189
-            if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1]." ".implode(', ',$sysfiles_check),$_lang['configcheck_sysfiles_mod']);
200
+            if(!$_SESSION["mgrConfigCheck"]) {
201
+                $modx->logEvent(0,3,$warnings[$i][1]." ".implode(', ',$sysfiles_check),$_lang['configcheck_sysfiles_mod']);
202
+            }
190 203
             break;
191 204
         case $_lang['configcheck_lang_difference'] :
192 205
             $warnings[$i][1] = $_lang['configcheck_lang_difference_msg'];
Please login to merge, or discard this patch.