Completed
Push — develop ( 404e5a...5cb106 )
by Agel_Nash
06:21
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(!empty($_GET['a']) && $_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(!empty($_GET['a']) && $_GET['a'] == 2) {
18
+if (!empty($_GET['a']) && $_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(!empty($_GET['a']) && $_GET['a'] == 2) {
18
+if(!empty($_GET['a']) && $_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/includes/src/Interfaces/CoreInterface.php 1 patch
Doc Comments   +5 added lines, -3 removed lines patch added patch discarded remove patch
@@ -3,9 +3,9 @@  discard block
 block discarded – undo
3 3
 interface CoreInterface
4 4
 {
5 5
     /**
6
-     * @param $type
7
-     * @param $scanPath
8
-     * @param array $ext
6
+     * @param string $type
7
+     * @param string $scanPath
8
+     * @param string[] $ext
9 9
      *
10 10
      * @return array
11 11
      *
@@ -18,6 +18,7 @@  discard block
 block discarded – undo
18 18
      * @param string $phpCode
19 19
      * @param string $namespace
20 20
      * @param array defaultParams
21
+     * @return void
21 22
      */
22 23
     public function addSnippet($name, $phpCode, $namespace = '#', array $defaultParams = array());
23 24
 
@@ -25,6 +26,7 @@  discard block
 block discarded – undo
25 26
      * @param string $name
26 27
      * @param string $text
27 28
      * @param string $namespace
29
+     * @return void
28 30
      */
29 31
     public function addChunk($name, $text, $namespace = '#');
30 32
 }
Please login to merge, or discard this patch.
manager/includes/src/ManagerTheme.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
     {
38 38
         $found = $this->core->findElements(
39 39
             'chunk',
40
-            MODX_MANAGER_PATH . 'media/style/' . $this->theme . '/snippets/',
40
+            MODX_MANAGER_PATH.'media/style/'.$this->theme.'/snippets/',
41 41
             array('php')
42 42
         );
43 43
         foreach ($found as $name => $code) {
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
     {
50 50
         $found = $this->core->findElements(
51 51
             'chunk',
52
-            MODX_MANAGER_PATH . 'media/style/' . $this->theme . '/chunks/',
52
+            MODX_MANAGER_PATH.'media/style/'.$this->theme.'/chunks/',
53 53
             array('tpl', 'html')
54 54
         );
55 55
         foreach ($found as $name => $code) {
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
         $this->core->addSnippet(
63 63
             $name,
64 64
             $code,
65
-            $this->templateNamespace . '#',
65
+            $this->templateNamespace.'#',
66 66
             array(
67 67
                 'managerTheme' => $this
68 68
             )
@@ -71,6 +71,6 @@  discard block
 block discarded – undo
71 71
 
72 72
     public function addChunk($name, $code)
73 73
     {
74
-        $this->core->addChunk($name, $code, $this->templateNamespace . '#');
74
+        $this->core->addChunk($name, $code, $this->templateNamespace.'#');
75 75
     }
76 76
 }
Please login to merge, or discard this patch.
install/src/template/actions/install.php 2 patches
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     <?php endif; ?>
66 66
 <?php endif; ?>
67 67
 
68
-<?php if ($installLevel >=  2 && $moduleSQLBaseFile) : ?>
68
+<?php if ($installLevel >= 2 && $moduleSQLBaseFile) : ?>
69 69
     <?php if ($sqlParser->installFailed === false) : ?>
70 70
         <p>
71 71
             <?=$_lang['setup_database_creating_tables']?>
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
         <?php $sqlErrors = count($sqlParser->mysqlErrors); ?>
77 77
         <?php for ($i = 0; $i < $sqlErrors; $i++) : ?>
78 78
             <em><?=$sqlParser->mysqlErrors[$i]["error"]?></em>
79
-            <?=$_lang['during_execution_of_sql'];?>
79
+            <?=$_lang['during_execution_of_sql']; ?>
80 80
             <span class="mono"><?=strip_tags($sqlParser->mysqlErrors[$i]["sql"])?></span>
81 81
             <hr />
82 82
         <?php endfor; ?>
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
         <?php $sqlErrors = count($sqlParser->mysqlErrors); ?>
113 113
         <?php for ($i = 0; $i < $sqlErrors; $i++) : ?>
114 114
             <em><?=$sqlParser->mysqlErrors[$i]["error"]?></em> <?=$_lang['during_execution_of_sql']?>
115
-            <span class='mono'><?=strip_tags($sqlParser->mysqlErrors[$i]["sql"]);?></span>
115
+            <span class='mono'><?=strip_tags($sqlParser->mysqlErrors[$i]["sql"]); ?></span>
116 116
             <hr />
117 117
         <?php endfor; ?>
118 118
         </p>
@@ -130,9 +130,9 @@  discard block
 block discarded – undo
130 130
         <h3><?=$_lang['templates']?>:</h3>
131 131
         <?php foreach ($installDataLevel['templates'] as $itemName => $itemData) : ?>
132 132
             <?php if (empty($itemData['error'])) : ?>
133
-                <?php if($itemData['type'] === 'create') : ?>
133
+                <?php if ($itemData['type'] === 'create') : ?>
134 134
                     <p>&nbsp;&nbsp;&#10003;&nbsp;&nbsp;<?=$itemName?>: <span class="ok"><?=$_lang['installed']?></span></p>
135
-                <?php elseif($itemData['type'] === 'update') : ?>
135
+                <?php elseif ($itemData['type'] === 'update') : ?>
136 136
                     <p>&nbsp;&nbsp;&#10003;&nbsp;&nbsp;<?=$itemName?>: <span class="ok"><?=$_lang['upgraded']?></span></p>
137 137
                 <?php endif; ?>
138 138
             <?php else : ?>
@@ -154,11 +154,11 @@  discard block
 block discarded – undo
154 154
         <h3><?=$_lang['tvs']?>:</h3>
155 155
         <?php foreach ($installDataLevel['tvs'] as $itemName => $itemData) : ?>
156 156
             <?php if (empty($itemData['error'])) : ?>
157
-                <?php if($itemData['type'] === 'create') : ?>
157
+                <?php if ($itemData['type'] === 'create') : ?>
158 158
                     <p>&nbsp;&nbsp;&#10003;&nbsp;&nbsp;<?=$itemName?>: <span class="ok"><?=$_lang['installed']?></span></p>
159
-                <?php elseif($itemData['type'] === 'update') : ?>
159
+                <?php elseif ($itemData['type'] === 'update') : ?>
160 160
                     <p>&nbsp;&nbsp;&#10003;&nbsp;&nbsp;<?=$itemName?>: <span class="ok"><?=$_lang['upgraded']?></span></p>
161
-                <?php elseif($itemData['type'] === 'skip') : ?>
161
+                <?php elseif ($itemData['type'] === 'skip') : ?>
162 162
                     <!-- SKIP -->
163 163
                 <?php endif; ?>
164 164
             <?php else : ?>
@@ -173,13 +173,13 @@  discard block
 block discarded – undo
173 173
         <h3><?=$_lang['chunks']?>:</h3>
174 174
         <?php foreach ($installDataLevel['chunks'] as $itemName => $itemData) : ?>
175 175
             <?php if (empty($itemData['error'])) : ?>
176
-                <?php if($itemData['type'] === 'create') : ?>
176
+                <?php if ($itemData['type'] === 'create') : ?>
177 177
                     <p>&nbsp;&nbsp;&#10003;&nbsp;&nbsp;<?=$itemName?>: <span class="ok"><?=$_lang['installed']?></span></p>
178
-                <?php elseif($itemData['type'] === 'overwrite') : ?>
178
+                <?php elseif ($itemData['type'] === 'overwrite') : ?>
179 179
                     <p>&nbsp;&nbsp;&#10003;&nbsp;&nbsp;<?=$itemName?>: <span class="ok"><?=$_lang['installed']?></span></p>
180
-                <?php elseif($itemData['type'] === 'update') : ?>
180
+                <?php elseif ($itemData['type'] === 'update') : ?>
181 181
                     <p>&nbsp;&nbsp;&#10003;&nbsp;&nbsp;<?=$itemName?>: <span class="ok"><?=$_lang['upgraded']?></span></p>
182
-                <?php elseif($itemData['type'] === 'skip') : ?>
182
+                <?php elseif ($itemData['type'] === 'skip') : ?>
183 183
                     <!-- SKIP -->
184 184
                 <?php endif; ?>
185 185
             <?php else : ?>
@@ -201,11 +201,11 @@  discard block
 block discarded – undo
201 201
         <h3><?=$_lang['modules']?>:</h3>
202 202
         <?php foreach ($installDataLevel['modules'] as $itemName => $itemData) : ?>
203 203
             <?php if (empty($itemData['error'])) : ?>
204
-                <?php if($itemData['type'] === 'create') : ?>
204
+                <?php if ($itemData['type'] === 'create') : ?>
205 205
                     <p>&nbsp;&nbsp;&#10003;&nbsp;&nbsp;<?=$itemName?>: <span class="ok"><?=$_lang['installed']?></span></p>
206
-                <?php elseif($itemData['type'] === 'update') : ?>
206
+                <?php elseif ($itemData['type'] === 'update') : ?>
207 207
                     <p>&nbsp;&nbsp;&#10003;&nbsp;&nbsp;<?=$itemName?>: <span class="ok"><?=$_lang['upgraded']?></span></p>
208
-                <?php elseif($itemData['type'] === 'skip') : ?>
208
+                <?php elseif ($itemData['type'] === 'skip') : ?>
209 209
                     <!-- SKIP -->
210 210
                 <?php endif; ?>
211 211
             <?php else : ?>
@@ -227,11 +227,11 @@  discard block
 block discarded – undo
227 227
         <h3><?=$_lang['plugins']?>:</h3>
228 228
         <?php foreach ($installDataLevel['plugins'] as $itemName => $itemData) : ?>
229 229
             <?php if (empty($itemData['error'])) : ?>
230
-                <?php if($itemData['type'] === 'create') : ?>
230
+                <?php if ($itemData['type'] === 'create') : ?>
231 231
                     <p>&nbsp;&nbsp;&#10003;&nbsp;&nbsp;<?=$itemName?>: <span class="ok"><?=$_lang['installed']?></span></p>
232
-                <?php elseif($itemData['type'] === 'update') : ?>
232
+                <?php elseif ($itemData['type'] === 'update') : ?>
233 233
                     <p>&nbsp;&nbsp;&#10003;&nbsp;&nbsp;<?=$itemName?>: <span class="ok"><?=$_lang['upgraded']?></span></p>
234
-                <?php elseif($itemData['type'] === 'skip') : ?>
234
+                <?php elseif ($itemData['type'] === 'skip') : ?>
235 235
                     <!-- SKIP -->
236 236
                 <?php endif; ?>
237 237
             <?php else : ?>
@@ -253,13 +253,13 @@  discard block
 block discarded – undo
253 253
         <h3><?=$_lang['snippets']?>:</h3>
254 254
         <?php foreach ($installDataLevel['snippets'] as $itemName => $itemData) : ?>
255 255
             <?php if (empty($itemData['error'])) : ?>
256
-                <?php if($itemData['type'] === 'create') : ?>
256
+                <?php if ($itemData['type'] === 'create') : ?>
257 257
                     <p>&nbsp;&nbsp;&#10003;&nbsp;&nbsp;<?=$itemName?>: <span class="ok"><?=$_lang['installed']?></span></p>
258
-                <?php elseif($itemData['type'] === 'overwrite') : ?>
258
+                <?php elseif ($itemData['type'] === 'overwrite') : ?>
259 259
                     <p>&nbsp;&nbsp;&#10003;&nbsp;&nbsp;<?=$itemName?>: <span class="ok"><?=$_lang['installed']?></span></p>
260
-                <?php elseif($itemData['type'] === 'update') : ?>
260
+                <?php elseif ($itemData['type'] === 'update') : ?>
261 261
                     <p>&nbsp;&nbsp;&#10003;&nbsp;&nbsp;<?=$itemName?>: <span class="ok"><?=$_lang['upgraded']?></span></p>
262
-                <?php elseif($itemData['type'] === 'skip') : ?>
262
+                <?php elseif ($itemData['type'] === 'skip') : ?>
263 263
                     <!-- SKIP -->
264 264
                 <?php endif; ?>
265 265
             <?php else : ?>
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
             <p><?=$_lang['setup_couldnt_install']?></p>
287 287
             <p><?=$_lang['installation_error_occured']?></p>
288 288
             <br /><br />
289
-            <?php foreach($installDataLevel['demo']['error'] as $error): ?>
289
+            <?php foreach ($installDataLevel['demo']['error'] as $error): ?>
290 290
                 <em><?=$error['content']?></em>
291 291
                 <?=$_lang['during_execution_of_sql']?>
292 292
                 <span class="mono"><?=htmlspecialchars($error['sql'])?></span>
@@ -300,9 +300,9 @@  discard block
 block discarded – undo
300 300
 <?php if ($installLevel >= 6): ?>
301 301
     <?php foreach ($installDependencyLevel as $itemName => $itemData) : ?>
302 302
         <?php if (empty($itemData['error'])) : ?>
303
-            <?php if($itemData['type'] === 'create') : ?>
303
+            <?php if ($itemData['type'] === 'create') : ?>
304 304
                 <p>&nbsp;&nbsp;&#10003;&nbsp;&nbsp;<?=$itemName?>Module: <span class="ok"><?=$_lang['depedency_create']?></span></p>
305
-            <?php elseif($itemData['type'] === 'update') : ?>
305
+            <?php elseif ($itemData['type'] === 'update') : ?>
306 306
                 <p>&nbsp;&nbsp;&#10003;&nbsp;&nbsp;<?=$itemName?>Module: <span class="ok"><?=$_lang['depedency_update']?></span></p>
307 307
             <?php endif; ?>
308 308
 
@@ -370,10 +370,10 @@  discard block
 block discarded – undo
370 370
                 var chk = document.install.rminstaller;
371 371
                 if (chk && chk.checked) {
372 372
                     // remove install folder and files
373
-                    window.location.href = "../<?=MGR_DIR;?>/processors/remove_installer.processor.php?rminstall=1";
373
+                    window.location.href = "../<?=MGR_DIR; ?>/processors/remove_installer.processor.php?rminstall=1";
374 374
                 }
375 375
                 else {
376
-                    window.location.href = "../<?=MGR_DIR;?>/";
376
+                    window.location.href = "../<?=MGR_DIR; ?>/";
377 377
                 }
378 378
             }
379 379
             /* ]]> */
Please login to merge, or discard this patch.
Braces   +80 added lines, -32 removed lines patch added patch discarded remove patch
@@ -16,7 +16,8 @@  discard block
 block discarded – undo
16 16
         <span class="notok"><?=$_lang['setup_database_create_connection_failed']?></span>
17 17
     </p>
18 18
     <p><?=$_lang['setup_database_create_connection_failed_note']?></p>
19
-<?php else : ?>
19
+<?php else {
20
+    : ?>
20 21
     <p><?=$_lang['setup_database_create_connection']?> <span class="ok"><?=$_lang['ok']?></span></p>
21 22
     <?php if ($selectDatabase === false) : ?>
22 23
         <p><?=rtrim($_lang['setup_database_selection'], '`')?> <strong><?=trim($dbase, '`')?></strong>:
@@ -41,13 +42,18 @@  discard block
 block discarded – undo
41 42
                 <?=rtrim($_lang['setup_database_creation'], '`')?> <strong><?=trim($dbase, '`')?></strong>:
42 43
                 <span class="ok"><?=$_lang['ok']?></span>
43 44
             </p>
44
-        <?php endif; ?>
45
-    <?php else : ?>
45
+        <?php endif;
46
+}
47
+?>
48
+    <?php else {
49
+    : ?>
46 50
         <p>
47 51
             <?=rtrim($_lang['setup_database_selection'], '`')?> <strong><?=trim($dbase, '`')?></strong>:
48 52
             <span class="ok"><?=$_lang['ok']?></span>
49 53
         </p>
50
-    <?php endif; ?>
54
+    <?php endif;
55
+}
56
+?>
51 57
 <?php endif; ?>
52 58
 
53 59
 <?php if ($installLevel >= 1) : ?>
@@ -57,12 +63,15 @@  discard block
 block discarded – undo
57 63
             <span class="notok"><?=$_lang['failed']?></span> <?=$_lang['table_prefix_already_inuse']?>
58 64
         </p>
59 65
         <p><?=$_lang['table_prefix_already_inuse_note']?></p>
60
-    <?php else : ?>
66
+    <?php else {
67
+    : ?>
61 68
         <p>
62 69
             <?=rtrim($_lang['checking_table_prefix'], '`')?> <strong><?=trim($table_prefix, '`')?></strong>:
63 70
             <span class="ok"><?=$_lang['ok']?></span>
64 71
         </p>
65
-    <?php endif; ?>
72
+    <?php endif;
73
+}
74
+?>
66 75
 <?php endif; ?>
67 76
 
68 77
 <?php if ($installLevel >=  2 && $moduleSQLBaseFile) : ?>
@@ -81,9 +90,12 @@  discard block
 block discarded – undo
81 90
             <hr />
82 91
         <?php endfor; ?>
83 92
         <p><?=$_lang['some_tables_not_updated']?></p>
84
-    <?php else : ?>
93
+    <?php else {
94
+    : ?>
85 95
         <p><?=$_lang['setup_database_creating_tables']?> <span class="ok"><?=$_lang['ok']?></span></p>
86
-    <?php endif; ?>
96
+    <?php endif;
97
+}
98
+?>
87 99
 <?php endif; ?>
88 100
 
89 101
 <?php if ($installLevel >= 3) : ?>
@@ -94,11 +106,14 @@  discard block
 block discarded – undo
94 106
         <p><?=$_lang['cant_write_config_file']?> <span class="mono"><?=MGR_DIR?>/includes/config.inc.php</span></p>
95 107
         <textarea style="width:400px; height:160px;"><?=$configString?></textarea>
96 108
         <p><?=$_lang['cant_write_config_file_note']?></p>
97
-    <?php else : ?>
109
+    <?php else {
110
+    : ?>
98 111
         <p>
99 112
             <?=$_lang['writing_config_file']?> <span class="ok"><?=$_lang['ok']?></span>
100 113
         </p>
101
-    <?php endif; ?>
114
+    <?php endif;
115
+}
116
+?>
102 117
 <?php endif; ?>
103 118
 
104 119
 <?php if ($installLevel >= 4 && $installData && $moduleSQLDataFile && $moduleSQLResetFile) : ?>
@@ -117,12 +132,15 @@  discard block
 block discarded – undo
117 132
         <?php endfor; ?>
118 133
         </p>
119 134
         <p><?=$_lang['some_tables_not_updated']?></p>
120
-    <?php else : ?>
135
+    <?php else {
136
+    : ?>
121 137
         <p>
122 138
             <?=$_lang['resetting_database']?>
123 139
             <span class="ok"><?=$_lang['ok']?></span>
124 140
         </p>
125
-    <?php endif; ?>
141
+    <?php endif;
142
+}
143
+?>
126 144
 <?php endif; ?>
127 145
 
128 146
 <?php if ($installLevel >= 5) : ?>
@@ -135,7 +153,8 @@  discard block
 block discarded – undo
135 153
                 <?php elseif($itemData['type'] === 'update') : ?>
136 154
                     <p>&nbsp;&nbsp;&#10003;&nbsp;&nbsp;<?=$itemName?>: <span class="ok"><?=$_lang['upgraded']?></span></p>
137 155
                 <?php endif; ?>
138
-            <?php else : ?>
156
+            <?php else {
157
+    : ?>
139 158
                 <?php if ($itemData['error']['type'] === 'sql') : ?>
140 159
                     <p>&#10060; <?=$itemData['error']['content']?></p>
141 160
                 <?php elseif ($itemData['error']['type'] === 'file_not_found') : ?>
@@ -145,7 +164,9 @@  discard block
 block discarded – undo
145 164
                             <?=$_lang['not_found']?>.
146 165
                         </span>
147 166
                     </p>
148
-                <?php endif; ?>
167
+                <?php endif;
168
+}
169
+?>
149 170
             <?php endif; ?>
150 171
         <?php endforeach; ?>
151 172
     <?php endif; ?>
@@ -161,10 +182,13 @@  discard block
 block discarded – undo
161 182
                 <?php elseif($itemData['type'] === 'skip') : ?>
162 183
                     <!-- SKIP -->
163 184
                 <?php endif; ?>
164
-            <?php else : ?>
185
+            <?php else {
186
+    : ?>
165 187
                 <?php if ($itemData['error']['type'] === 'sql') : ?>
166 188
                     <p>&#10060; <?=$itemData['error']['content']?></p>
167
-                <?php endif; ?>
189
+                <?php endif;
190
+}
191
+?>
168 192
             <?php endif; ?>
169 193
         <?php endforeach; ?>
170 194
     <?php endif; ?>
@@ -182,7 +206,8 @@  discard block
 block discarded – undo
182 206
                 <?php elseif($itemData['type'] === 'skip') : ?>
183 207
                     <!-- SKIP -->
184 208
                 <?php endif; ?>
185
-            <?php else : ?>
209
+            <?php else {
210
+    : ?>
186 211
                 <?php if ($itemData['error']['type'] === 'sql') : ?>
187 212
                     <p>&#10060; <?=$itemData['error']['content']?></p>
188 213
                 <?php elseif ($itemData['error']['type'] === 'file_not_found') : ?>
@@ -192,7 +217,9 @@  discard block
 block discarded – undo
192 217
                             <?=$_lang['not_found']?>.
193 218
                         </span>
194 219
                     </p>
195
-                <?php endif; ?>
220
+                <?php endif;
221
+}
222
+?>
196 223
             <?php endif; ?>
197 224
         <?php endforeach; ?>
198 225
     <?php endif; ?>
@@ -208,7 +235,8 @@  discard block
 block discarded – undo
208 235
                 <?php elseif($itemData['type'] === 'skip') : ?>
209 236
                     <!-- SKIP -->
210 237
                 <?php endif; ?>
211
-            <?php else : ?>
238
+            <?php else {
239
+    : ?>
212 240
                 <?php if ($itemData['error']['type'] === 'sql') : ?>
213 241
                     <p>&#10060; <?=$itemData['error']['content']?></p>
214 242
                 <?php elseif ($itemData['error']['type'] === 'file_not_found') : ?>
@@ -218,7 +246,9 @@  discard block
 block discarded – undo
218 246
                             <?=$_lang['not_found']?>.
219 247
                         </span>
220 248
                     </p>
221
-                <?php endif; ?>
249
+                <?php endif;
250
+}
251
+?>
222 252
             <?php endif; ?>
223 253
         <?php endforeach; ?>
224 254
     <?php endif; ?>
@@ -234,7 +264,8 @@  discard block
 block discarded – undo
234 264
                 <?php elseif($itemData['type'] === 'skip') : ?>
235 265
                     <!-- SKIP -->
236 266
                 <?php endif; ?>
237
-            <?php else : ?>
267
+            <?php else {
268
+    : ?>
238 269
                 <?php if ($itemData['error']['type'] === 'sql') : ?>
239 270
                     <p>&#10060; <?=$itemData['error']['content']?></p>
240 271
                 <?php elseif ($itemData['error']['type'] === 'file_not_found') : ?>
@@ -244,7 +275,9 @@  discard block
 block discarded – undo
244 275
                             <?=$_lang['not_found']?>.
245 276
                         </span>
246 277
                     </p>
247
-                <?php endif; ?>
278
+                <?php endif;
279
+}
280
+?>
248 281
             <?php endif; ?>
249 282
         <?php endforeach; ?>
250 283
     <?php endif; ?>
@@ -262,7 +295,8 @@  discard block
 block discarded – undo
262 295
                 <?php elseif($itemData['type'] === 'skip') : ?>
263 296
                     <!-- SKIP -->
264 297
                 <?php endif; ?>
265
-            <?php else : ?>
298
+            <?php else {
299
+    : ?>
266 300
                 <?php if ($itemData['error']['type'] === 'sql') : ?>
267 301
                     <p>&#10060; <?=$itemData['error']['content']?></p>
268 302
                 <?php elseif ($itemData['error']['type'] === 'file_not_found') : ?>
@@ -272,7 +306,9 @@  discard block
 block discarded – undo
272 306
                             <?=$_lang['not_found']?>.
273 307
                         </span>
274 308
                     </p>
275
-                <?php endif; ?>
309
+                <?php endif;
310
+}
311
+?>
276 312
             <?php endif; ?>
277 313
         <?php endforeach; ?>
278 314
     <?php endif; ?>
@@ -281,7 +317,8 @@  discard block
 block discarded – undo
281 317
         <h3><?=$_lang['installing_demo_site']?></h3>
282 318
         <?php if (empty($installDataLevel['demo']['error'])) : ?>
283 319
             <p>&nbsp;&nbsp;&#10003;&nbsp;&nbsp<span class="ok"><?=$_lang['ok']?></span></p>
284
-        <?php else : ?>
320
+        <?php else {
321
+    : ?>
285 322
             <p><span class="notok"><b><?=$_lang['database_alerts']?></span></p>
286 323
             <p><?=$_lang['setup_couldnt_install']?></p>
287 324
             <p><?=$_lang['installation_error_occured']?></p>
@@ -291,7 +328,9 @@  discard block
 block discarded – undo
291 328
                 <?=$_lang['during_execution_of_sql']?>
292 329
                 <span class="mono"><?=htmlspecialchars($error['sql'])?></span>
293 330
                 <hr />
294
-            <?php endforeach; ?>
331
+            <?php endforeach;
332
+}
333
+?>
295 334
             <p><?=$_lang['some_tables_not_updated']?></p>
296 335
         <?php endif; ?>
297 336
     <?php endif; ?>
@@ -316,10 +355,13 @@  discard block
 block discarded – undo
316 355
                     <span class="ok"><?=$_lang['guid_set']?></span>
317 356
                 </p>
318 357
             <?php endif; ?>
319
-        <?php else : ?>
358
+        <?php else {
359
+    : ?>
320 360
             <?php if ($itemData['error']['type'] === 'sql') : ?>
321 361
                 <p>&#10060; <?=$itemData['error']['content']?></p>
322
-            <?php endif; ?>
362
+            <?php endif;
363
+}
364
+?>
323 365
         <?php endif; ?>
324 366
     <?php endforeach; ?>
325 367
 <?php endif; ?>
@@ -332,12 +374,15 @@  discard block
 block discarded – undo
332 374
             <img src="img/ico_info.png" width="40" height="42" align="left" style="margin-right:10px;" />
333 375
             <?=$_lang['installation_note']?>
334 376
         </p>
335
-    <?php else : ?>
377
+    <?php else {
378
+    : ?>
336 379
         <p>
337 380
             <img src="img/ico_info.png" width="40" height="42" align="left" style="margin-right:10px;" />
338 381
             <?=$_lang['upgrade_note']?>
339 382
         </p>
340
-    <?php endif; ?>
383
+    <?php endif;
384
+}
385
+?>
341 386
 
342 387
     <form name="install" id="install_form" action="index.php?action=options" method="post">
343 388
             <?php if ($errors === 0) : ?>
@@ -350,11 +395,14 @@  discard block
 block discarded – undo
350 395
                       />
351 396
                         <?=$_lang['remove_install_folder_auto'] ?>
352 397
                 </span>
353
-                <?php else : ?>
398
+                <?php else {
399
+    : ?>
354 400
                     <span id="removeinstall" style="float:left;color:#505050;line-height:18px;">
355 401
                     <?=$_lang['remove_install_folder_manual'] ?>
356 402
                 </span>
357
-                <?php endif; ?>
403
+                <?php endif;
404
+}
405
+?>
358 406
             <?php endif; ?>
359 407
         <p class="buttonlinks">
360 408
             <a href="javascript:closepage();" title="<?=$_lang['btnclose_value'] ?>">
Please login to merge, or discard this patch.
install/src/controllers/install.php 2 patches
Upper-Lower-Casing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
 
295 295
                     if (mysqli_num_rows($rs)) {
296 296
                         $installDataLevel['templates'][$moduleTemplate[0]]['type'] = 'update';
297
-                        $query = "UPDATE $dbase.`" . $table_prefix . "site_templates` SET content='$template', description='$desc', category=$category_id, locked='$locked'  WHERE templatename='$name' LIMIT 1;";
297
+                        $query = "update $dbase.`" . $table_prefix . "site_templates` SET content='$template', description='$desc', category=$category_id, locked='$locked'  WHERE templatename='$name' LIMIT 1;";
298 298
                         if (!mysqli_query($sqlParser->conn, $query)) {
299 299
                             $errors += 1;
300 300
                             $installDataLevel['templates'][$moduleTemplate[0]]['error'] = array(
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
                 if (mysqli_num_rows($rs)) {
386 386
                     $installDataLevel['tvs'][$moduleTV[0]]['type'] = 'update';
387 387
                     while ($row = mysqli_fetch_assoc($rs)) {
388
-                        $query = "UPDATE $dbase.`" . $table_prefix . "site_tmplvars` SET type='$input_type', caption='$caption', description='$desc', category=$category, locked=$locked, elements='$input_options', display='$output_widget', display_params='$output_widget_params', default_text='$input_default' WHERE id={$row['id']};";
388
+                        $query = "update $dbase.`" . $table_prefix . "site_tmplvars` SET type='$input_type', caption='$caption', description='$desc', category=$category, locked=$locked, elements='$input_options', display='$output_widget', display_params='$output_widget_params', default_text='$input_default' WHERE id={$row['id']};";
389 389
                         if (!mysqli_query($sqlParser->conn, $query)) {
390 390
                             $installDataLevel['tvs'][$moduleTV[0]]['error'] = array(
391 391
                                 'type' => 'sql',
@@ -496,7 +496,7 @@  discard block
 block discarded – undo
496 496
                     if ($update) {
497 497
                         $installDataLevel['chunks'][$moduleChunk[0]]['type'] = 'update';
498 498
                         if (!mysqli_query($sqlParser->conn,
499
-                            "UPDATE $dbase.`" . $table_prefix . "site_htmlsnippets` SET snippet='$chunk', description='$desc', category=$category_id WHERE name='$name';")) {
499
+                            "update $dbase.`" . $table_prefix . "site_htmlsnippets` SET snippet='$chunk', description='$desc', category=$category_id WHERE name='$name';")) {
500 500
                             $errors += 1;
501 501
                             $installDataLevel['chunks'][$moduleChunk[0]]['error'] = array(
502 502
                                 'type' => 'sql',
@@ -581,7 +581,7 @@  discard block
 block discarded – undo
581 581
                         $row = mysqli_fetch_assoc($rs);
582 582
                         $props = mysqli_real_escape_string($conn, propUpdate($properties, $row['properties']));
583 583
                         if (!mysqli_query($sqlParser->conn,
584
-                            "UPDATE $dbase.`" . $table_prefix . "site_modules` SET modulecode='$module', description='$desc', properties='$props', enable_sharedparams='$shared' WHERE name='$name';")) {
584
+                            "update $dbase.`" . $table_prefix . "site_modules` SET modulecode='$module', description='$desc', properties='$props', enable_sharedparams='$shared' WHERE name='$name';")) {
585 585
                             $installDataLevel['modules'][$moduleModule[0]]['error'] = array(
586 586
                                 'type' => 'sql',
587 587
                                 'content' => mysqli_error($sqlParser->conn)
@@ -660,7 +660,7 @@  discard block
 block discarded – undo
660 660
 
661 661
                     // disable legacy versions based on legacy_names provided
662 662
                     if (!empty($leg_names)) {
663
-                        $update_query = "UPDATE $dbase.`" . $table_prefix . "site_plugins` SET disabled='1' WHERE name IN ($leg_names);";
663
+                        $update_query = "update $dbase.`" . $table_prefix . "site_plugins` SET disabled='1' WHERE name IN ($leg_names);";
664 664
                         $rs = mysqli_query($sqlParser->conn, $update_query);
665 665
                     }
666 666
 
@@ -678,7 +678,7 @@  discard block
 block discarded – undo
678 678
                         while ($row = mysqli_fetch_assoc($rs)) {
679 679
                             $props = mysqli_real_escape_string($conn, propUpdate($properties, $row['properties']));
680 680
                             if ($row['description'] == $desc) {
681
-                                $query = "UPDATE $dbase.`" . $table_prefix . "site_plugins` SET plugincode='$plugin', description='$desc', properties='$props' WHERE id={$row['id']};";
681
+                                $query = "update $dbase.`" . $table_prefix . "site_plugins` SET plugincode='$plugin', description='$desc', properties='$props' WHERE id={$row['id']};";
682 682
                                 if (!mysqli_query($sqlParser->conn, $query)) {
683 683
                                     $installDataLevel['plugins'][$modulePlugin[0]]['error'] = array(
684 684
                                         'type' => 'sql',
@@ -689,7 +689,7 @@  discard block
 block discarded – undo
689 689
                                 }
690 690
                                 $insert = false;
691 691
                             } else {
692
-                                $query = "UPDATE $dbase.`" . $table_prefix . "site_plugins` SET disabled='1' WHERE id={$row['id']};";
692
+                                $query = "update $dbase.`" . $table_prefix . "site_plugins` SET disabled='1' WHERE id={$row['id']};";
693 693
                                 if (!mysqli_query($sqlParser->conn, $query)) {
694 694
                                     $installDataLevel['plugins'][$modulePlugin[0]]['error'] = array(
695 695
                                         'type' => 'sql',
@@ -792,7 +792,7 @@  discard block
 block discarded – undo
792 792
                         $row = mysqli_fetch_assoc($rs);
793 793
                         $props = mysqli_real_escape_string($conn, propUpdate($properties, $row['properties']));
794 794
                         if (!mysqli_query($sqlParser->conn,
795
-                            "UPDATE $dbase.`" . $table_prefix . "site_snippets` SET snippet='$snippet', description='$desc', properties='$props' WHERE name='$name';")) {
795
+                            "update $dbase.`" . $table_prefix . "site_snippets` SET snippet='$snippet', description='$desc', properties='$props' WHERE name='$name';")) {
796 796
                             $installDataLevel['snippets'][$moduleSnippet[0]]['error'] = array(
797 797
                                 'type' => 'sql',
798 798
                                 'content' => mysqli_error($sqlParser->conn)
Please login to merge, or discard this patch.
Spacing   +83 added lines, -83 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (file_exists(dirname(dirname(dirname(__DIR__))) . "/assets/cache/siteManager.php")) {
3
-    include_once(dirname(dirname(dirname(__DIR__))) . "/assets/cache/siteManager.php");
2
+if (file_exists(dirname(dirname(dirname(__DIR__)))."/assets/cache/siteManager.php")) {
3
+    include_once(dirname(dirname(dirname(__DIR__)))."/assets/cache/siteManager.php");
4 4
 } else {
5 5
     define('MGR_DIR', 'manager');
6 6
 }
@@ -25,8 +25,8 @@  discard block
 block discarded – undo
25 25
 // set timout limit
26 26
 @ set_time_limit(120); // used @ to prevent warning when using safe mode?
27 27
 
28
-$installMode = (int)$_POST['installmode'];
29
-$installData = (int)!empty($_POST['installdata']);
28
+$installMode = (int) $_POST['installmode'];
29
+$installData = (int) !empty($_POST['installdata']);
30 30
 
31 31
 // get db info from post
32 32
 $database_server = $_POST['databasehost'];
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 $database_charset = substr($database_collation, 0, strpos($database_collation, '_'));
37 37
 $database_connection_charset = $_POST['database_connection_charset'];
38 38
 $database_connection_method = $_POST['database_connection_method'];
39
-$dbase = "`" . $_POST['database_name'] . "`";
39
+$dbase = "`".$_POST['database_name']."`";
40 40
 $table_prefix = $_POST['tableprefix'];
41 41
 $adminname = $_POST['cmsadmin'];
42 42
 $adminemail = $_POST['cmsadminemail'];
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 
47 47
 // set session name variable
48 48
 if (!isset ($site_sessionname)) {
49
-    $site_sessionname = 'SN' . uniqid('');
49
+    $site_sessionname = 'SN'.uniqid('');
50 50
 }
51 51
 
52 52
 // get base path and url
@@ -62,8 +62,8 @@  discard block
 block discarded – undo
62 62
 }
63 63
 $pth = implode('install', $a);
64 64
 unset ($a);
65
-$base_url = $url . (substr($url, -1) != '/' ? '/' : '');
66
-$base_path = $pth . (substr($pth, -1) != '/' ? '/' : '');
65
+$base_url = $url.(substr($url, -1) != '/' ? '/' : '');
66
+$base_path = $pth.(substr($pth, -1) != '/' ? '/' : '');
67 67
 
68 68
 // connect to the database
69 69
 $conn = @mysqli_connect($database_server, $database_user, $database_password);
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
     if ($installLevel === 1) {
93 93
         // check table prefix
94 94
         if ($installMode === 0) {
95
-            $query = "SELECT COUNT(*) FROM $dbase.`" . $table_prefix . "site_content`";
95
+            $query = "SELECT COUNT(*) FROM $dbase.`".$table_prefix."site_content`";
96 96
             if (@mysqli_query($conn, $query)) {
97 97
                 $errors += 1;
98 98
             } else {
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
         // check status of Inherit Parent Template plugin
108 108
         $auto_template_logic = 'parent';
109 109
         if ($installMode !== 0) {
110
-            $query = "SELECT properties, disabled FROM " . $dbase . ".`" . $table_prefix . "site_plugins` WHERE name='Inherit Parent Template'";
110
+            $query = "SELECT properties, disabled FROM ".$dbase.".`".$table_prefix."site_plugins` WHERE name='Inherit Parent Template'";
111 111
             $rs = mysqli_query($conn, $query);
112 112
             $row = mysqli_fetch_row($rs);
113 113
             if (!$row) {
@@ -130,8 +130,8 @@  discard block
 block discarded – undo
130 130
         }
131 131
 
132 132
         // open db connection
133
-        include dirname(__DIR__) . '/processor/result.php';
134
-        include_once dirname(__DIR__) . '/sqlParser.class.php';
133
+        include dirname(__DIR__).'/processor/result.php';
134
+        include_once dirname(__DIR__).'/sqlParser.class.php';
135 135
         $sqlParser = new SqlParser(
136 136
             $database_server,
137 137
             $database_user,
@@ -177,10 +177,10 @@  discard block
 block discarded – undo
177 177
         $confph['lastInstallTime'] = time();
178 178
         $confph['site_sessionname'] = $site_sessionname;
179 179
 
180
-        $configString = file_get_contents(dirname(dirname(__DIR__)) . '/stubs/config.tpl');
180
+        $configString = file_get_contents(dirname(dirname(__DIR__)).'/stubs/config.tpl');
181 181
         $configString = parse($configString, $confph);
182 182
 
183
-        $filename = dirname(dirname(dirname(__DIR__))) . '/' . MGR_DIR . '/includes/config.inc.php';
183
+        $filename = dirname(dirname(dirname(__DIR__))).'/'.MGR_DIR.'/includes/config.inc.php';
184 184
         $configFileFailed = false;
185 185
         if (@ !$handle = fopen($filename, 'w')) {
186 186
             $configFileFailed = true;
@@ -208,13 +208,13 @@  discard block
 block discarded – undo
208 208
             $siteid = uniqid('');
209 209
             mysqli_query(
210 210
                     $sqlParser->conn,
211
-                "REPLACE INTO $dbase.`" . $table_prefix . "system_settings` (setting_name,setting_value) VALUES('site_id','$siteid'),('manager_theme','default')"
211
+                "REPLACE INTO $dbase.`".$table_prefix."system_settings` (setting_name,setting_value) VALUES('site_id','$siteid'),('manager_theme','default')"
212 212
             );
213 213
         } else {
214 214
             // update site_id if missing
215 215
             $ds = mysqli_query(
216 216
                     $sqlParser->conn,
217
-                "SELECT setting_name,setting_value FROM $dbase.`" . $table_prefix . "system_settings` WHERE setting_name='site_id'"
217
+                "SELECT setting_name,setting_value FROM $dbase.`".$table_prefix."system_settings` WHERE setting_name='site_id'"
218 218
             );
219 219
             if ($ds) {
220 220
                 $r = mysqli_fetch_assoc($ds);
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
                     $siteid = uniqid('');
224 224
                     mysqli_query(
225 225
                             $sqlParser->conn,
226
-                        "REPLACE INTO $dbase.`" . $table_prefix . "system_settings` (setting_name,setting_value) VALUES('site_id','$siteid')"
226
+                        "REPLACE INTO $dbase.`".$table_prefix."system_settings` (setting_name,setting_value) VALUES('site_id','$siteid')"
227 227
                     );
228 228
                 }
229 229
             }
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
     if ($installLevel === 5 && (isset ($_POST['template']) || $installData)) {
250 250
         $selTemplates = $_POST['template'];
251 251
         foreach ($moduleTemplates as $k => $moduleTemplate) {
252
-            if (! is_array($moduleTemplate)) {
252
+            if (!is_array($moduleTemplate)) {
253 253
                 continue;
254 254
             }
255 255
             $installDataLevel['templates'][$moduleTemplate[0]] = array(
@@ -287,12 +287,12 @@  discard block
 block discarded – undo
287 287
                     $template = mysqli_real_escape_string($conn, $template);
288 288
 
289 289
                     // See if the template already exists
290
-                    $query = "SELECT * FROM $dbase.`" . $table_prefix . "site_templates` WHERE templatename='$name'";
290
+                    $query = "SELECT * FROM $dbase.`".$table_prefix."site_templates` WHERE templatename='$name'";
291 291
                     $rs = mysqli_query($sqlParser->conn, $query);
292 292
 
293 293
                     if (mysqli_num_rows($rs)) {
294 294
                         $installDataLevel['templates'][$moduleTemplate[0]]['type'] = 'update';
295
-                        $query = "UPDATE $dbase.`" . $table_prefix . "site_templates` SET content='$template', description='$desc', category=$category_id, locked='$locked'  WHERE templatename='$name' LIMIT 1;";
295
+                        $query = "UPDATE $dbase.`".$table_prefix."site_templates` SET content='$template', description='$desc', category=$category_id, locked='$locked'  WHERE templatename='$name' LIMIT 1;";
296 296
                         if (!mysqli_query($sqlParser->conn, $query)) {
297 297
                             $errors += 1;
298 298
                             $installDataLevel['templates'][$moduleTemplate[0]]['error'] = array(
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
                         if (!is_null($save_sql_id_as)) {
306 306
                             $sql_id = @mysqli_insert_id($sqlParser->conn);
307 307
                             if (!$sql_id) {
308
-                                $query = "SELECT id FROM $dbase.`" . $table_prefix . "site_templates` WHERE templatename='$name' LIMIT 1;";
308
+                                $query = "SELECT id FROM $dbase.`".$table_prefix."site_templates` WHERE templatename='$name' LIMIT 1;";
309 309
                                 $idQuery = mysqli_fetch_assoc(mysqli_query($sqlParser->conn, $query));
310 310
                                 $sql_id = $idQuery['id'];
311 311
                             }
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
                         }
314 314
                     } else {
315 315
                         $installDataLevel['templates'][$moduleTemplate[0]]['type'] = 'create';
316
-                        $query = "INSERT INTO $dbase.`" . $table_prefix . "site_templates` (templatename,description,content,category,locked) VALUES('$name','$desc','$template',$category_id,'$locked');";
316
+                        $query = "INSERT INTO $dbase.`".$table_prefix."site_templates` (templatename,description,content,category,locked) VALUES('$name','$desc','$template',$category_id,'$locked');";
317 317
                         if (!@mysqli_query($sqlParser->conn, $query)) {
318 318
                             $errors += 1;
319 319
                             $installDataLevel['templates'][$moduleTemplate[0]]['error'] = array(
@@ -378,12 +378,12 @@  discard block
 block discarded – undo
378 378
                 // Create the category if it does not already exist
379 379
                 $category = getCreateDbCategory($category, $sqlParser);
380 380
 
381
-                $query = "SELECT * FROM $dbase.`" . $table_prefix . "site_tmplvars` WHERE name='$name'";
382
-                $rs = mysqli_query($sqlParser->conn,$query);
381
+                $query = "SELECT * FROM $dbase.`".$table_prefix."site_tmplvars` WHERE name='$name'";
382
+                $rs = mysqli_query($sqlParser->conn, $query);
383 383
                 if (mysqli_num_rows($rs)) {
384 384
                     $installDataLevel['tvs'][$moduleTV[0]]['type'] = 'update';
385 385
                     while ($row = mysqli_fetch_assoc($rs)) {
386
-                        $query = "UPDATE $dbase.`" . $table_prefix . "site_tmplvars` SET type='$input_type', caption='$caption', description='$desc', category=$category, locked=$locked, elements='$input_options', display='$output_widget', display_params='$output_widget_params', default_text='$input_default' WHERE id={$row['id']};";
386
+                        $query = "UPDATE $dbase.`".$table_prefix."site_tmplvars` SET type='$input_type', caption='$caption', description='$desc', category=$category, locked=$locked, elements='$input_options', display='$output_widget', display_params='$output_widget_params', default_text='$input_default' WHERE id={$row['id']};";
387 387
                         if (!mysqli_query($sqlParser->conn, $query)) {
388 388
                             $installDataLevel['tvs'][$moduleTV[0]]['error'] = array(
389 389
                                 'type' => 'sql',
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
                     }
397 397
                 } else {
398 398
                     $installDataLevel['tvs'][$moduleTV[0]]['type'] = 'create';
399
-                    $q = "INSERT INTO $dbase.`" . $table_prefix . "site_tmplvars` (type,name,caption,description,category,locked,elements,display,display_params,default_text) VALUES('$input_type','$name','$caption','$desc',$category,$locked,'$input_options','$output_widget','$output_widget_params','$input_default');";
399
+                    $q = "INSERT INTO $dbase.`".$table_prefix."site_tmplvars` (type,name,caption,description,category,locked,elements,display,display_params,default_text) VALUES('$input_type','$name','$caption','$desc',$category,$locked,'$input_options','$output_widget','$output_widget_params','$input_default');";
400 400
                     if (!mysqli_query($sqlParser->conn, $q)) {
401 401
                         $installDataLevel['tvs'][$moduleTV[0]]['error'] = array(
402 402
                             'type' => 'sql',
@@ -413,23 +413,23 @@  discard block
 block discarded – undo
413 413
                 if (count($assignments) > 0) {
414 414
 
415 415
                     // remove existing tv -> template assignments
416
-                    $query = "SELECT id FROM $dbase.`" . $table_prefix . "site_tmplvars` WHERE name='$name' AND description='$desc';";
416
+                    $query = "SELECT id FROM $dbase.`".$table_prefix."site_tmplvars` WHERE name='$name' AND description='$desc';";
417 417
                     $ds = mysqli_query($sqlParser->conn, $query);
418 418
                     $row = mysqli_fetch_assoc($ds);
419 419
                     $id = $row["id"];
420
-                    $query = 'DELETE FROM ' . $dbase . '.`' . $table_prefix . 'site_tmplvar_templates` WHERE tmplvarid = \'' . $id . '\'';
420
+                    $query = 'DELETE FROM '.$dbase.'.`'.$table_prefix.'site_tmplvar_templates` WHERE tmplvarid = \''.$id.'\'';
421 421
                     mysqli_query($sqlParser->conn, $query);
422 422
 
423 423
                     // add tv -> template assignments
424 424
                     foreach ($assignments as $assignment) {
425 425
                         $template = mysqli_real_escape_string($conn, $assignment);
426
-                        $query = "SELECT id FROM $dbase.`" . $table_prefix . "site_templates` WHERE templatename='$template';";
426
+                        $query = "SELECT id FROM $dbase.`".$table_prefix."site_templates` WHERE templatename='$template';";
427 427
                         $ts = mysqli_query($sqlParser->conn, $query);
428 428
                         if ($ds && $ts) {
429 429
                             $tRow = mysqli_fetch_assoc($ts);
430 430
                             $templateId = $tRow['id'];
431
-                            $query = "INSERT INTO $dbase.`" . $table_prefix . "site_tmplvar_templates` (tmplvarid, templateid) VALUES($id, $templateId)";
432
-                            mysqli_query($sqlParser->conn,$query);
431
+                            $query = "INSERT INTO $dbase.`".$table_prefix."site_tmplvar_templates` (tmplvarid, templateid) VALUES($id, $templateId)";
432
+                            mysqli_query($sqlParser->conn, $query);
433 433
                         }
434 434
                     }
435 435
                 }
@@ -441,7 +441,7 @@  discard block
 block discarded – undo
441 441
     if ($installLevel === 5 && $errorData === false && (isset ($_POST['chunk']) || $installData)) {
442 442
         $selChunks = $_POST['chunk'];
443 443
         foreach ($moduleChunks as $k => $moduleChunk) {
444
-            if (! is_array($moduleChunk)) {
444
+            if (!is_array($moduleChunk)) {
445 445
                 continue;
446 446
             }
447 447
             $installDataLevel['chunks'][$moduleChunk[0]] = array(
@@ -479,14 +479,14 @@  discard block
 block discarded – undo
479 479
                     $chunk = mysqli_real_escape_string($conn, $chunk);
480 480
                     $rs = mysqli_query(
481 481
                         $sqlParser->conn,
482
-                        "SELECT * FROM $dbase.`" . $table_prefix . "site_htmlsnippets` WHERE name='$name'"
482
+                        "SELECT * FROM $dbase.`".$table_prefix."site_htmlsnippets` WHERE name='$name'"
483 483
                     );
484 484
                     $count_original_name = mysqli_num_rows($rs);
485 485
                     if ($overwrite == 'false') {
486
-                        $newname = $name . '-' . str_replace('.', '_', $modx_version);
486
+                        $newname = $name.'-'.str_replace('.', '_', $modx_version);
487 487
                         $rs = mysqli_query(
488 488
                             $sqlParser->conn,
489
-                            "SELECT * FROM $dbase.`" . $table_prefix . "site_htmlsnippets` WHERE name='$newname'"
489
+                            "SELECT * FROM $dbase.`".$table_prefix."site_htmlsnippets` WHERE name='$newname'"
490 490
                         );
491 491
                         $count_new_name = mysqli_num_rows($rs);
492 492
                     }
@@ -494,7 +494,7 @@  discard block
 block discarded – undo
494 494
                     if ($update) {
495 495
                         $installDataLevel['chunks'][$moduleChunk[0]]['type'] = 'update';
496 496
                         if (!mysqli_query($sqlParser->conn,
497
-                            "UPDATE $dbase.`" . $table_prefix . "site_htmlsnippets` SET snippet='$chunk', description='$desc', category=$category_id WHERE name='$name';")) {
497
+                            "UPDATE $dbase.`".$table_prefix."site_htmlsnippets` SET snippet='$chunk', description='$desc', category=$category_id WHERE name='$name';")) {
498 498
                             $errors += 1;
499 499
                             $installDataLevel['chunks'][$moduleChunk[0]]['error'] = array(
500 500
                                 'type' => 'sql',
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
                         } else {
512 512
                             $installDataLevel['chunks'][$moduleChunk[0]]['type'] = 'create';
513 513
                         }
514
-                        $query = "INSERT INTO $dbase.`" . $table_prefix . "site_htmlsnippets` (name,description,snippet,category) VALUES('$name','$desc','$chunk',$category_id);";
514
+                        $query = "INSERT INTO $dbase.`".$table_prefix."site_htmlsnippets` (name,description,snippet,category) VALUES('$name','$desc','$chunk',$category_id);";
515 515
                         if (!mysqli_query($sqlParser->conn, $query)) {
516 516
                             $errors += 1;
517 517
                             $installDataLevel['chunks'][$moduleChunk[0]]['error'] = array(
@@ -534,7 +534,7 @@  discard block
 block discarded – undo
534 534
     if ($installLevel === 5 && $errorData === false && (isset ($_POST['module']) || $installData)) {
535 535
         $selModules = $_POST['module'];
536 536
         foreach ($moduleModules as $k => $moduleModule) {
537
-            if (! is_array($moduleModule)) {
537
+            if (!is_array($moduleModule)) {
538 538
                 continue;
539 539
             }
540 540
             $installDataLevel['modules'][$moduleModule[0]] = array(
@@ -573,13 +573,13 @@  discard block
 block discarded – undo
573 573
                     // $module = removeDocblock($module, 'module'); // Modules have no fileBinding, keep docblock for info-tab
574 574
                     $module = mysqli_real_escape_string($conn, $module);
575 575
                     $rs = mysqli_query($sqlParser->conn,
576
-                        "SELECT * FROM $dbase.`" . $table_prefix . "site_modules` WHERE name='$name'");
576
+                        "SELECT * FROM $dbase.`".$table_prefix."site_modules` WHERE name='$name'");
577 577
                     if (mysqli_num_rows($rs)) {
578 578
                         $installDataLevel['modules'][$moduleModule[0]]['type'] = 'update';
579 579
                         $row = mysqli_fetch_assoc($rs);
580 580
                         $props = mysqli_real_escape_string($conn, propUpdate($properties, $row['properties']));
581 581
                         if (!mysqli_query($sqlParser->conn,
582
-                            "UPDATE $dbase.`" . $table_prefix . "site_modules` SET modulecode='$module', description='$desc', properties='$props', enable_sharedparams='$shared' WHERE name='$name';")) {
582
+                            "UPDATE $dbase.`".$table_prefix."site_modules` SET modulecode='$module', description='$desc', properties='$props', enable_sharedparams='$shared' WHERE name='$name';")) {
583 583
                             $installDataLevel['modules'][$moduleModule[0]]['error'] = array(
584 584
                                 'type' => 'sql',
585 585
                                 'content' => mysqli_error($sqlParser->conn)
@@ -591,7 +591,7 @@  discard block
 block discarded – undo
591 591
                         $installDataLevel['modules'][$moduleModule[0]]['type'] = 'create';
592 592
                         $properties = mysqli_real_escape_string($conn, parseProperties($properties, true));
593 593
                         if (!mysqli_query($sqlParser->conn,
594
-                            "INSERT INTO $dbase.`" . $table_prefix . "site_modules` (name,description,modulecode,properties,guid,enable_sharedparams,category) VALUES('$name','$desc','$module','$properties','$guid','$shared', $category);")) {
594
+                            "INSERT INTO $dbase.`".$table_prefix."site_modules` (name,description,modulecode,properties,guid,enable_sharedparams,category) VALUES('$name','$desc','$module','$properties','$guid','$shared', $category);")) {
595 595
                             $installDataLevel['modules'][$moduleModule[0]]['error'] = array(
596 596
                                 'type' => 'sql',
597 597
                                 'content' => mysqli_error($sqlParser->conn)
@@ -611,7 +611,7 @@  discard block
 block discarded – undo
611 611
     if ($installLevel === 5 && $errorData === false && (isset ($_POST['plugin']) || $installData)) {
612 612
         $selPlugs = $_POST['plugin'];
613 613
         foreach ($modulePlugins as $k => $modulePlugin) {
614
-            if (! is_array($modulePlugin)) {
614
+            if (!is_array($modulePlugin)) {
615 615
                 continue;
616 616
             }
617 617
             $installDataLevel['plugins'][$modulePlugin[0]] = array(
@@ -645,12 +645,12 @@  discard block
 block discarded – undo
645 645
                 $disabled = $modulePlugin[9];
646 646
                 if (array_key_exists(7, $modulePlugin)) {
647 647
                     // parse comma-separated legacy names and prepare them for sql IN clause
648
-                    $leg_names = "'" . implode(
648
+                    $leg_names = "'".implode(
649 649
                             "','",
650 650
                             preg_split('/\s*,\s*/', mysqli_real_escape_string($conn, $modulePlugin[7]))
651
-                        ) . "'";
651
+                        )."'";
652 652
                 }
653
-                if (! file_exists($filecontent)) {
653
+                if (!file_exists($filecontent)) {
654 654
                     $installDataLevel['plugins'][$modulePlugin[0]]['error'] = array(
655 655
                         'type' => 'file_not_found'
656 656
                     );
@@ -658,7 +658,7 @@  discard block
 block discarded – undo
658 658
 
659 659
                     // disable legacy versions based on legacy_names provided
660 660
                     if (!empty($leg_names)) {
661
-                        $update_query = "UPDATE $dbase.`" . $table_prefix . "site_plugins` SET disabled='1' WHERE name IN ($leg_names);";
661
+                        $update_query = "UPDATE $dbase.`".$table_prefix."site_plugins` SET disabled='1' WHERE name IN ($leg_names);";
662 662
                         $rs = mysqli_query($sqlParser->conn, $update_query);
663 663
                     }
664 664
 
@@ -668,7 +668,7 @@  discard block
 block discarded – undo
668 668
                     $plugin = end(preg_split("/(\/\/)?\s*\<\?php/", file_get_contents($filecontent), 2));
669 669
                     $plugin = removeDocblock($plugin, 'plugin');
670 670
                     $plugin = mysqli_real_escape_string($conn, $plugin);
671
-                    $query = "SELECT * FROM $dbase.`" . $table_prefix . "site_plugins` WHERE name='$name'";
671
+                    $query = "SELECT * FROM $dbase.`".$table_prefix."site_plugins` WHERE name='$name'";
672 672
                     $rs = mysqli_query($sqlParser->conn, $query);
673 673
                     if (mysqli_num_rows($rs)) {
674 674
                         $installDataLevel['plugins'][$modulePlugin[0]]['type'] = 'update';
@@ -676,7 +676,7 @@  discard block
 block discarded – undo
676 676
                         while ($row = mysqli_fetch_assoc($rs)) {
677 677
                             $props = mysqli_real_escape_string($conn, propUpdate($properties, $row['properties']));
678 678
                             if ($row['description'] == $desc) {
679
-                                $query = "UPDATE $dbase.`" . $table_prefix . "site_plugins` SET plugincode='$plugin', description='$desc', properties='$props' WHERE id={$row['id']};";
679
+                                $query = "UPDATE $dbase.`".$table_prefix."site_plugins` SET plugincode='$plugin', description='$desc', properties='$props' WHERE id={$row['id']};";
680 680
                                 if (!mysqli_query($sqlParser->conn, $query)) {
681 681
                                     $installDataLevel['plugins'][$modulePlugin[0]]['error'] = array(
682 682
                                         'type' => 'sql',
@@ -687,7 +687,7 @@  discard block
 block discarded – undo
687 687
                                 }
688 688
                                 $insert = false;
689 689
                             } else {
690
-                                $query = "UPDATE $dbase.`" . $table_prefix . "site_plugins` SET disabled='1' WHERE id={$row['id']};";
690
+                                $query = "UPDATE $dbase.`".$table_prefix."site_plugins` SET disabled='1' WHERE id={$row['id']};";
691 691
                                 if (!mysqli_query($sqlParser->conn, $query)) {
692 692
                                     $installDataLevel['plugins'][$modulePlugin[0]]['error'] = array(
693 693
                                         'type' => 'sql',
@@ -700,7 +700,7 @@  discard block
 block discarded – undo
700 700
                         }
701 701
                         if ($insert === true) {
702 702
                             $properties = mysqli_real_escape_string($conn, propUpdate($properties, $row['properties']));
703
-                            $query = "INSERT INTO $dbase.`" . $table_prefix . "site_plugins` (name,description,plugincode,properties,moduleguid,disabled,category) VALUES('$name','$desc','$plugin','$properties','$guid','0',$category);";
703
+                            $query = "INSERT INTO $dbase.`".$table_prefix."site_plugins` (name,description,plugincode,properties,moduleguid,disabled,category) VALUES('$name','$desc','$plugin','$properties','$guid','0',$category);";
704 704
                             if (!mysqli_query($sqlParser->conn, $query)) {
705 705
                                 $installDataLevel['plugins'][$modulePlugin[0]]['error'] = array(
706 706
                                     'type' => 'sql',
@@ -713,7 +713,7 @@  discard block
 block discarded – undo
713 713
                     } else {
714 714
                         $installDataLevel['plugins'][$modulePlugin[0]]['type'] = 'create';
715 715
                         $properties = mysqli_real_escape_string($conn, parseProperties($properties, true));
716
-                        $query = "INSERT INTO $dbase.`" . $table_prefix . "site_plugins` (name,description,plugincode,properties,moduleguid,category,disabled) VALUES('$name','$desc','$plugin','$properties','$guid',$category,$disabled);";
716
+                        $query = "INSERT INTO $dbase.`".$table_prefix."site_plugins` (name,description,plugincode,properties,moduleguid,category,disabled) VALUES('$name','$desc','$plugin','$properties','$guid',$category,$disabled);";
717 717
                         if (!mysqli_query($sqlParser->conn, $query)) {
718 718
                             $installDataLevel['plugins'][$modulePlugin[0]]['error'] = array(
719 719
                                 'type' => 'sql',
@@ -725,17 +725,17 @@  discard block
 block discarded – undo
725 725
                     }
726 726
                     // add system events
727 727
                     if (count($events) > 0) {
728
-                        $query = "SELECT id FROM $dbase.`" . $table_prefix . "site_plugins` WHERE name='$name' AND description='$desc';";
728
+                        $query = "SELECT id FROM $dbase.`".$table_prefix."site_plugins` WHERE name='$name' AND description='$desc';";
729 729
                         $ds = mysqli_query($sqlParser->conn, $query);
730 730
                         if ($ds) {
731 731
                             $row = mysqli_fetch_assoc($ds);
732 732
                             $id = $row["id"];
733 733
                             // remove existing events
734
-                            $query = 'DELETE FROM ' . $dbase . '.`' . $table_prefix . 'site_plugin_events` WHERE pluginid = \'' . $id . '\'';
734
+                            $query = 'DELETE FROM '.$dbase.'.`'.$table_prefix.'site_plugin_events` WHERE pluginid = \''.$id.'\'';
735 735
                             mysqli_query($sqlParser->conn, $query);
736 736
                             // add new events
737
-                            $query = "INSERT INTO $dbase.`" . $table_prefix . "site_plugin_events` (pluginid, evtid) SELECT '$id' as 'pluginid',se.id as 'evtid' FROM $dbase.`" . $table_prefix . "system_eventnames` se WHERE name IN ('" . implode("','", $events) . "')";
738
-                            mysqli_query($sqlParser->conn,$query);
737
+                            $query = "INSERT INTO $dbase.`".$table_prefix."site_plugin_events` (pluginid, evtid) SELECT '$id' as 'pluginid',se.id as 'evtid' FROM $dbase.`".$table_prefix."system_eventnames` se WHERE name IN ('".implode("','", $events)."')";
738
+                            mysqli_query($sqlParser->conn, $query);
739 739
                         }
740 740
                     }
741 741
                 }
@@ -749,7 +749,7 @@  discard block
 block discarded – undo
749 749
     if ($installLevel === 5 && $errorData === false && (isset ($_POST['snippet']) || $installData)) {
750 750
         $selSnips = $_POST['snippet'];
751 751
         foreach ($moduleSnippets as $k => $moduleSnippet) {
752
-            if (! is_array($moduleSnippet)) {
752
+            if (!is_array($moduleSnippet)) {
753 753
                 continue;
754 754
             }
755 755
             $installDataLevel['snippets'][$moduleSnippet[0]] = array(
@@ -784,13 +784,13 @@  discard block
 block discarded – undo
784 784
                     $snippet = removeDocblock($snippet, 'snippet');
785 785
                     $snippet = mysqli_real_escape_string($conn, $snippet);
786 786
                     $rs = mysqli_query($sqlParser->conn,
787
-                        "SELECT * FROM $dbase.`" . $table_prefix . "site_snippets` WHERE name='$name'");
787
+                        "SELECT * FROM $dbase.`".$table_prefix."site_snippets` WHERE name='$name'");
788 788
                     if (mysqli_num_rows($rs)) {
789 789
                         $installDataLevel['snippets'][$moduleSnippet[0]]['type'] = 'update';
790 790
                         $row = mysqli_fetch_assoc($rs);
791 791
                         $props = mysqli_real_escape_string($conn, propUpdate($properties, $row['properties']));
792 792
                         if (!mysqli_query($sqlParser->conn,
793
-                            "UPDATE $dbase.`" . $table_prefix . "site_snippets` SET snippet='$snippet', description='$desc', properties='$props' WHERE name='$name';")) {
793
+                            "UPDATE $dbase.`".$table_prefix."site_snippets` SET snippet='$snippet', description='$desc', properties='$props' WHERE name='$name';")) {
794 794
                             $installDataLevel['snippets'][$moduleSnippet[0]]['error'] = array(
795 795
                                 'type' => 'sql',
796 796
                                 'content' => mysqli_error($sqlParser->conn)
@@ -802,7 +802,7 @@  discard block
 block discarded – undo
802 802
                         $installDataLevel['snippets'][$moduleSnippet[0]]['type'] = 'create';
803 803
                         $properties = mysqli_real_escape_string($conn, parseProperties($properties, true));
804 804
                         if (!mysqli_query($sqlParser->conn,
805
-                            "INSERT INTO $dbase.`" . $table_prefix . "site_snippets` (name,description,snippet,properties,category) VALUES('$name','$desc','$snippet','$properties',$category);")) {
805
+                            "INSERT INTO $dbase.`".$table_prefix."site_snippets` (name,description,snippet,properties,category) VALUES('$name','$desc','$snippet','$properties',$category);")) {
806 806
                             $installDataLevel['snippets'][$moduleSnippet[0]]['error'] = array(
807 807
                                 'type' => 'sql',
808 808
                                 'content' => mysqli_error($sqlParser->conn)
@@ -869,7 +869,7 @@  discard block
 block discarded – undo
869 869
                     'content' => '' //dependency name or error message
870 870
                 )*/
871 871
             );
872
-            $query = 'SELECT id, guid FROM ' . $dbase . '`' . $sqlParser->prefix . 'site_modules` WHERE name="' . $dependency['module'] . '"';
872
+            $query = 'SELECT id, guid FROM '.$dbase.'`'.$sqlParser->prefix.'site_modules` WHERE name="'.$dependency['module'].'"';
873 873
             $ds = mysqli_query($sqlParser->conn, $query);
874 874
             if (!$ds) {
875 875
                 $installDependencyLevel[$dependency['module']]['error'] = array(
@@ -884,7 +884,7 @@  discard block
 block discarded – undo
884 884
                 $moduleGuid = $row["guid"];
885 885
             }
886 886
             // get extra id
887
-            $query = 'SELECT id FROM ' . $dbase . '`' . $sqlParser->prefix . 'site_' . $dependency['table'] . '` WHERE ' . $dependency['column'] . '="' . $dependency['name'] . '"';
887
+            $query = 'SELECT id FROM '.$dbase.'`'.$sqlParser->prefix.'site_'.$dependency['table'].'` WHERE '.$dependency['column'].'="'.$dependency['name'].'"';
888 888
             $ds = mysqli_query($sqlParser->conn, $query);
889 889
             if (!$ds) {
890 890
                 $installDependencyLevel[$dependency['module']]['error'] = array(
@@ -898,7 +898,7 @@  discard block
 block discarded – undo
898 898
                 $extraId = $row["id"];
899 899
             }
900 900
             // setup extra as module dependency
901
-            $query = 'SELECT module FROM ' . $dbase . '`' . $sqlParser->prefix . 'site_module_depobj` WHERE module=' . $moduleId . ' AND resource=' . $extraId . ' AND type=' . $dependency['type'] . ' LIMIT 1';
901
+            $query = 'SELECT module FROM '.$dbase.'`'.$sqlParser->prefix.'site_module_depobj` WHERE module='.$moduleId.' AND resource='.$extraId.' AND type='.$dependency['type'].' LIMIT 1';
902 902
             $ds = mysqli_query($sqlParser->conn, $query);
903 903
             if (!$ds) {
904 904
                 $installDependencyLevel[$dependency['module']]['error'] = array(
@@ -909,17 +909,17 @@  discard block
 block discarded – undo
909 909
                 break;
910 910
             } else {
911 911
                 if (mysqli_num_rows($ds) === 0) {
912
-                    $query = 'INSERT INTO ' . $dbase . '`' . $sqlParser->prefix . 'site_module_depobj` (module, resource, type) VALUES(' . $moduleId . ',' . $extraId . ',' . $dependency['type'] . ')';
912
+                    $query = 'INSERT INTO '.$dbase.'`'.$sqlParser->prefix.'site_module_depobj` (module, resource, type) VALUES('.$moduleId.','.$extraId.','.$dependency['type'].')';
913 913
                     mysqli_query($sqlParser->conn, $query);
914 914
                     $installDependencyLevel[$dependency['module']]['type'] = 'create';
915 915
                 } else {
916
-                    $query = 'UPDATE ' . $dbase . '`' . $sqlParser->prefix . 'site_module_depobj` SET module = ' . $moduleId . ', resource = ' . $extraId . ', type = ' . $dependency['type'] . ' WHERE module=' . $moduleId . ' AND resource=' . $extraId . ' AND type=' . $dependency['type'];
916
+                    $query = 'UPDATE '.$dbase.'`'.$sqlParser->prefix.'site_module_depobj` SET module = '.$moduleId.', resource = '.$extraId.', type = '.$dependency['type'].' WHERE module='.$moduleId.' AND resource='.$extraId.' AND type='.$dependency['type'];
917 917
                     mysqli_query($sqlParser->conn, $query);
918 918
                     $installDependencyLevel[$dependency['module']]['type'] = 'update';
919 919
                 }
920 920
                 if ($dependency['type'] == 30 || $dependency['type'] == 40) {
921 921
                     // set extra guid for plugins and snippets
922
-                    $query = 'SELECT id FROM ' . $dbase . '`' . $sqlParser->prefix . 'site_' . $dependency['table'] . '` WHERE id=' . $extraId . ' LIMIT 1';
922
+                    $query = 'SELECT id FROM '.$dbase.'`'.$sqlParser->prefix.'site_'.$dependency['table'].'` WHERE id='.$extraId.' LIMIT 1';
923 923
                     $ds = mysqli_query($sqlParser->conn, $query);
924 924
                     if (!$ds) {
925 925
                         $installDependencyLevel[$dependency['module']]['extra'] = array(
@@ -930,8 +930,8 @@  discard block
 block discarded – undo
930 930
                         break;
931 931
                     } else {
932 932
                         if (mysqli_num_rows($ds) != 0) {
933
-                            $query = 'UPDATE ' . $dbase . '`' . $sqlParser->prefix . 'site_' . $dependency['table'] . '` SET moduleguid = ' . $moduleGuid . ' WHERE id=' . $extraId;
934
-                            $ds= mysqli_query($sqlParser->conn, $query);
933
+                            $query = 'UPDATE '.$dbase.'`'.$sqlParser->prefix.'site_'.$dependency['table'].'` SET moduleguid = '.$moduleGuid.' WHERE id='.$extraId;
934
+                            $ds = mysqli_query($sqlParser->conn, $query);
935 935
                             $installDependencyLevel[$dependency['module']]['extra'] = array(
936 936
                                 'type' => 'done',
937 937
                                 'content' => $dependency['name']
@@ -953,28 +953,28 @@  discard block
 block discarded – undo
953 953
         }
954 954
 
955 955
         // Setup the MODX API -- needed for the cache processor
956
-        if (file_exists(dirname(dirname(dirname(__DIR__))) . '/' . MGR_DIR . '/includes/config_mutator.php')) {
957
-            require_once dirname(dirname(dirname(__DIR__))) . '/' . MGR_DIR . '/includes/config_mutator.php';
956
+        if (file_exists(dirname(dirname(dirname(__DIR__))).'/'.MGR_DIR.'/includes/config_mutator.php')) {
957
+            require_once dirname(dirname(dirname(__DIR__))).'/'.MGR_DIR.'/includes/config_mutator.php';
958 958
         }
959 959
         define('MODX_API_MODE', true);
960 960
         if (!defined('MODX_BASE_PATH')) {
961 961
             define('MODX_BASE_PATH', $base_path);
962 962
         }
963 963
         if (!defined('MODX_MANAGER_PATH')) {
964
-            define('MODX_MANAGER_PATH', $base_path . MGR_DIR . '/');
964
+            define('MODX_MANAGER_PATH', $base_path.MGR_DIR.'/');
965 965
         }
966 966
         $database_type = 'mysqli';
967 967
         // initiate a new document parser
968 968
         if (!defined('EVO_BOOTSTRAP_FILE')) {
969 969
             define('EVO_BOOTSTRAP_FILE',
970
-                dirname(dirname(dirname(__DIR__))) . '/' . MGR_DIR . '/includes/bootstrap.php');
971
-            require_once dirname(dirname(dirname(__DIR__))) . '/' . MGR_DIR . '/includes/bootstrap.php';
970
+                dirname(dirname(dirname(__DIR__))).'/'.MGR_DIR.'/includes/bootstrap.php');
971
+            require_once dirname(dirname(dirname(__DIR__))).'/'.MGR_DIR.'/includes/bootstrap.php';
972 972
         }
973 973
 
974
-        if (! defined('EVO_SERVICES_FILE')) {
975
-            define('EVO_SERVICES_FILE', dirname(dirname(dirname(__DIR__))) . '/' . MGR_DIR . '/includes/services.php');
974
+        if (!defined('EVO_SERVICES_FILE')) {
975
+            define('EVO_SERVICES_FILE', dirname(dirname(dirname(__DIR__))).'/'.MGR_DIR.'/includes/services.php');
976 976
         }
977
-        if (! defined('MODX_CLASS')) {
977
+        if (!defined('MODX_CLASS')) {
978 978
             define('MODX_CLASS', '\EvolutionCMS\Core');
979 979
         }
980 980
         
@@ -982,25 +982,25 @@  discard block
 block discarded – undo
982 982
         $modx->getDatabase()->connect();
983 983
         // always empty cache after install
984 984
         $sync = new EvolutionCMS\Cache();
985
-        $sync->setCachepath(dirname(dirname(dirname(__DIR__))) . '/assets/cache/');
985
+        $sync->setCachepath(dirname(dirname(dirname(__DIR__))).'/assets/cache/');
986 986
         $sync->setReport(false);
987 987
         $sync->emptyCache(); // first empty the cache
988 988
 
989 989
         // try to chmod the cache go-rwx (for suexeced php)
990
-        @chmod(dirname(dirname(dirname(__DIR__))) . '/assets/cache/siteCache.idx.php', 0600);
991
-        @chmod(dirname(dirname(dirname(__DIR__))) . '/assets/cache/sitePublishing.idx.php', 0600);
990
+        @chmod(dirname(dirname(dirname(__DIR__))).'/assets/cache/siteCache.idx.php', 0600);
991
+        @chmod(dirname(dirname(dirname(__DIR__))).'/assets/cache/sitePublishing.idx.php', 0600);
992 992
 
993 993
         // remove any locks on the manager functions so initial manager login is not blocked
994
-        mysqli_query($conn, "TRUNCATE TABLE `" . $table_prefix . "active_users`");
994
+        mysqli_query($conn, "TRUNCATE TABLE `".$table_prefix."active_users`");
995 995
 
996 996
         // close db connection
997 997
         $sqlParser->close();
998 998
 
999 999
         // andrazk 20070416 - release manager access
1000
-        if (file_exists(dirname(dirname(dirname(__DIR__))) . '/assets/cache/installProc.inc.php')) {
1001
-            @chmod(dirname(dirname(dirname(__DIR__))) . '/assets/cache/installProc.inc.php', 0755);
1002
-            unlink(dirname(dirname(dirname(__DIR__))) . '/assets/cache/installProc.inc.php');
1000
+        if (file_exists(dirname(dirname(dirname(__DIR__))).'/assets/cache/installProc.inc.php')) {
1001
+            @chmod(dirname(dirname(dirname(__DIR__))).'/assets/cache/installProc.inc.php', 0755);
1002
+            unlink(dirname(dirname(dirname(__DIR__))).'/assets/cache/installProc.inc.php');
1003 1003
         }
1004 1004
     }
1005 1005
 }
1006
-include_once dirname(__DIR__) . '/template/actions/install.php';
1006
+include_once dirname(__DIR__).'/template/actions/install.php';
Please login to merge, or discard this patch.
manager/includes/src/Core.php 4 patches
Doc Comments   +26 added lines, -24 removed lines patch added patch discarded remove patch
@@ -212,7 +212,6 @@  discard block
 block discarded – undo
212 212
 
213 213
     /**
214 214
      * @param array $services
215
-     * @param array $parameters
216 215
      */
217 216
     public function __construct(array $services = array())
218 217
     {
@@ -282,6 +281,9 @@  discard block
 block discarded – undo
282 281
         return $service;
283 282
     }
284 283
 
284
+    /**
285
+     * @param string $name
286
+     */
285 287
     private function checkServiceAlias($name){
286 288
         foreach ($this->providerAliases as $alias => $interface) {
287 289
             if($name === $interface) {
@@ -319,7 +321,7 @@  discard block
 block discarded – undo
319 321
      *
320 322
      * @param object $service         The service.
321 323
      * @param string $name            The service name.
322
-     * @param array  $callDefinitions The service calls definition.
324
+     * @param boolean  $callDefinitions The service calls definition.
323 325
      *
324 326
      * @throws Exceptions\ContainerException On failure.
325 327
      */
@@ -561,7 +563,7 @@  discard block
 block discarded – undo
561 563
      * @param int $count_attempts
562 564
      * @param string $type $type
563 565
      * @param string $responseCode
564
-     * @return bool|null
566
+     * @return false|null
565 567
      * @global string $base_url
566 568
      * @global string $site_url
567 569
      */
@@ -1262,7 +1264,7 @@  discard block
 block discarded – undo
1262 1264
     }
1263 1265
 
1264 1266
     /**
1265
-     * @param $contents
1267
+     * @param string $contents
1266 1268
      * @return mixed
1267 1269
      */
1268 1270
     public function RecoveryEscapedTags($contents)
@@ -1286,7 +1288,7 @@  discard block
 block discarded – undo
1286 1288
     }
1287 1289
 
1288 1290
     /**
1289
-     * @param $tstart
1291
+     * @param double $tstart
1290 1292
      * @return array
1291 1293
      */
1292 1294
     public function getTimerStats($tstart)
@@ -2052,7 +2054,7 @@  discard block
 block discarded – undo
2052 2054
 
2053 2055
     /**
2054 2056
      * Remove Comment-Tags from output like <!--@- Comment -@-->
2055
-     * @param $content
2057
+     * @param string $content
2056 2058
      * @param string $left
2057 2059
      * @param string $right
2058 2060
      * @return mixed
@@ -2228,7 +2230,7 @@  discard block
 block discarded – undo
2228 2230
     /**
2229 2231
      * Run snippets as per the tags in $documentSource and replace the tags with the returned values.
2230 2232
      *
2231
-     * @param $content
2233
+     * @param string $content
2232 2234
      * @return string
2233 2235
      * @internal param string $documentSource
2234 2236
      */
@@ -3263,7 +3265,7 @@  discard block
 block discarded – undo
3263 3265
 
3264 3266
     /**
3265 3267
      * @param $templateID
3266
-     * @return mixed
3268
+     * @return string
3267 3269
      */
3268 3270
     public function _getTemplateCodeFromDB($templateID)
3269 3271
     {
@@ -3306,7 +3308,7 @@  discard block
 block discarded – undo
3306 3308
     /**
3307 3309
      * @param $id
3308 3310
      * @param int $top
3309
-     * @return mixed
3311
+     * @return string
3310 3312
      */
3311 3313
     public function getUltimateParentId($id, $top = 0)
3312 3314
     {
@@ -3646,7 +3648,7 @@  discard block
 block discarded – undo
3646 3648
      *
3647 3649
      * @param int $type Types: 1=template, 2=tv, 3=chunk, 4=snippet, 5=plugin, 6=module, 7=resource, 8=role
3648 3650
      * @param int $id Element- / Resource-id
3649
-     * @return bool
3651
+     * @return false|null
3650 3652
      */
3651 3653
     public function lockElement($type, $id)
3652 3654
     {
@@ -3668,7 +3670,7 @@  discard block
 block discarded – undo
3668 3670
      * @param int $type Types: 1=template, 2=tv, 3=chunk, 4=snippet, 5=plugin, 6=module, 7=resource, 8=role
3669 3671
      * @param int $id Element- / Resource-id
3670 3672
      * @param bool $includeAllUsers true = Deletes not only own user-locks
3671
-     * @return bool
3673
+     * @return false|null
3672 3674
      */
3673 3675
     public function unlockElement($type, $id, $includeAllUsers = false)
3674 3676
     {
@@ -4181,7 +4183,7 @@  discard block
 block discarded – undo
4181 4183
      *                     Default: 1
4182 4184
      * @param string $fields List of fields
4183 4185
      *                       Default: id, pagetitle, description, alias
4184
-     * @return boolean|array
4186
+     * @return string
4185 4187
      */
4186 4188
     public function getPageInfo($pageid = -1, $active = 1, $fields = 'id, pagetitle, description, alias')
4187 4189
     {
@@ -4273,7 +4275,7 @@  discard block
 block discarded – undo
4273 4275
      *
4274 4276
      * @param string $type
4275 4277
      * @param bool $report
4276
-     * @return bool
4278
+     * @return boolean|null
4277 4279
      */
4278 4280
     public function clearCache($type = '', $report = false)
4279 4281
     {
@@ -4639,7 +4641,7 @@  discard block
 block discarded – undo
4639 4641
      * - Placeholders prefix. Default: '{'.
4640 4642
      * @param string $suffix {string}
4641 4643
      * - Placeholders suffix. Default: '}'.
4642
-     * @return bool|mixed|string {string; false} - Parsed chunk or false if $chunkArr is not array.
4644
+     * @return false|string {string; false} - Parsed chunk or false if $chunkArr is not array.
4643 4645
      * - Parsed chunk or false if $chunkArr is not array.
4644 4646
      */
4645 4647
     public function parseChunk($chunkName, $chunkArr, $prefix = '{', $suffix = '}')
@@ -5611,7 +5613,7 @@  discard block
 block discarded – undo
5611 5613
      * Remove event listener - only for use within the current execution cycle
5612 5614
      *
5613 5615
      * @param string $evtName
5614
-     * @return boolean
5616
+     * @return false|null
5615 5617
      */
5616 5618
     public function removeEventListener($evtName)
5617 5619
     {
@@ -5635,7 +5637,7 @@  discard block
 block discarded – undo
5635 5637
      *
5636 5638
      * @param string $evtName
5637 5639
      * @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.
5638
-     * @return boolean|array
5640
+     * @return false|null
5639 5641
      */
5640 5642
     public function invokeEvent($evtName, $extParams = array())
5641 5643
     {
@@ -6280,7 +6282,7 @@  discard block
 block discarded – undo
6280 6282
 
6281 6283
     /**
6282 6284
      * @param string $str
6283
-     * @return bool|mixed|string
6285
+     * @return string
6284 6286
      */
6285 6287
     public function atBindFileContent($str = '')
6286 6288
     {
@@ -6331,8 +6333,8 @@  discard block
 block discarded – undo
6331 6333
     }
6332 6334
 
6333 6335
     /**
6334
-     * @param $str
6335
-     * @return bool|string
6336
+     * @param string $str
6337
+     * @return false|string
6336 6338
      */
6337 6339
     public function getExtFromFilename($str)
6338 6340
     {
@@ -6360,7 +6362,7 @@  discard block
 block discarded – undo
6360 6362
      * @param string $text Error message
6361 6363
      * @param string $file File where the error was detected
6362 6364
      * @param string $line Line number within $file
6363
-     * @return boolean
6365
+     * @return boolean|null
6364 6366
      */
6365 6367
     public function phpError($nr, $text, $file, $line)
6366 6368
     {
@@ -6412,7 +6414,7 @@  discard block
 block discarded – undo
6412 6414
      * @param string $text
6413 6415
      * @param string $line
6414 6416
      * @param string $output
6415
-     * @return bool
6417
+     * @return null|boolean
6416 6418
      */
6417 6419
     public function messageQuit($msg = 'unspecified error', $query = '', $is_error = true, $nr = '', $file = '', $source = '', $text = '', $line = '', $output = '')
6418 6420
     {
@@ -6827,7 +6829,7 @@  discard block
 block discarded – undo
6827 6829
 
6828 6830
     /**
6829 6831
      * @param string $str
6830
-     * @return bool|mixed|string
6832
+     * @return string
6831 6833
      */
6832 6834
     public function atBindInclude($str = '')
6833 6835
     {
@@ -6878,7 +6880,7 @@  discard block
 block discarded – undo
6878 6880
      * @param $str
6879 6881
      * @param int $flags
6880 6882
      * @param string $encode
6881
-     * @return mixed
6883
+     * @return null|string
6882 6884
      */
6883 6885
     public function htmlspecialchars($str, $flags = ENT_COMPAT, $encode = '')
6884 6886
     {
@@ -6886,7 +6888,7 @@  discard block
 block discarded – undo
6886 6888
     }
6887 6889
 
6888 6890
     /**
6889
-     * @param $string
6891
+     * @param string $string
6890 6892
      * @param bool $returnData
6891 6893
      * @return bool|mixed
6892 6894
      */
Please login to merge, or discard this patch.
Braces   +62 added lines, -31 removed lines patch added patch discarded remove patch
@@ -281,7 +281,8 @@  discard block
 block discarded – undo
281 281
         return $service;
282 282
     }
283 283
 
284
-    private function checkServiceAlias($name){
284
+    private function checkServiceAlias($name)
285
+    {
285 286
         foreach ($this->providerAliases as $alias => $interface) {
286 287
             if($name === $interface) {
287 288
                 return $alias;
@@ -963,13 +964,15 @@  discard block
 block discarded – undo
963 964
             $this->virtualDir = '';
964 965
         }
965 966
 
966
-        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 */
967
+        if (preg_match('@^[1-9][0-9]*$@', $q) && !isset($this->documentListing[$q])) {
968
+/* we got an ID returned, check to make sure it's not an alias */
967 969
             /* FS#476 and FS#308: check that id is valid in terms of virtualDir structure */
968 970
             if ($this->config['use_alias_path'] == 1) {
969 971
                 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))))) {
970 972
                     $this->documentMethod = 'id';
971 973
                     return $q;
972
-                } else { /* not a valid id in terms of virtualDir, treat as alias */
974
+                } else {
975
+/* not a valid id in terms of virtualDir, treat as alias */
973 976
                     $this->documentMethod = 'alias';
974 977
                     return $q;
975 978
                 }
@@ -977,7 +980,8 @@  discard block
 block discarded – undo
977 980
                 $this->documentMethod = 'id';
978 981
                 return $q;
979 982
             }
980
-        } else { /* we didn't get an ID back, so instead we assume it's an alias */
983
+        } else {
984
+/* we didn't get an ID back, so instead we assume it's an alias */
981 985
             if ($this->config['friendly_alias_urls'] != 1) {
982 986
                 $q = $qOrig;
983 987
             }
@@ -1007,13 +1011,14 @@  discard block
 block discarded – undo
1007 1011
      * @param $id
1008 1012
      * @return array|mixed|null|string
1009 1013
      */
1010
-    public function makePageCacheKey($id){
1014
+    public function makePageCacheKey($id)
1015
+    {
1011 1016
         $hash = $id;
1012 1017
         $tmp = null;
1013 1018
         $params = array();
1014
-        if(!empty($this->systemCacheKey)){
1019
+        if(!empty($this->systemCacheKey)) {
1015 1020
             $hash = $this->systemCacheKey;
1016
-        }else {
1021
+        } else {
1017 1022
             if (!empty($_GET)) {
1018 1023
                 // Sort GET parameters so that the order of parameters on the HTTP request don't affect the generated cache ID.
1019 1024
                 $params = $_GET;
@@ -1022,7 +1027,7 @@  discard block
 block discarded – undo
1022 1027
             }
1023 1028
         }
1024 1029
         $evtOut = $this->invokeEvent("OnMakePageCacheKey", array ("hash" => $hash, "id" => $id, 'params' => $params));
1025
-        if (is_array($evtOut) && count($evtOut) > 0){
1030
+        if (is_array($evtOut) && count($evtOut) > 0) {
1026 1031
             $tmp = array_pop($evtOut);
1027 1032
         }
1028 1033
         return empty($tmp) ? $hash : $tmp;
@@ -1359,7 +1364,8 @@  discard block
 block discarded – undo
1359 1364
             $where
1360 1365
         );
1361 1366
         $this->getDatabase()->update($field, $this->getDatabase()->getFullTableName('site_content'), $where);
1362
-        if ($this->getDatabase()->getRecordCount($result_pub) >= 1) { //Event unPublished doc
1367
+        if ($this->getDatabase()->getRecordCount($result_pub) >= 1) {
1368
+//Event unPublished doc
1363 1369
             while ($row_pub = $this->getDatabase()->getRow($result_pub)) {
1364 1370
                 $this->invokeEvent("OnDocUnPublished", array(
1365 1371
                     "docid" => $row_pub['id']
@@ -1376,7 +1382,8 @@  discard block
 block discarded – undo
1376 1382
             $where
1377 1383
         );
1378 1384
         $this->getDatabase()->update($field, $this->getDatabase()->getFullTableName('site_content'), $where);
1379
-        if ($this->getDatabase()->getRecordCount($result_unpub) >= 1) { //Event unPublished doc
1385
+        if ($this->getDatabase()->getRecordCount($result_unpub) >= 1) {
1386
+//Event unPublished doc
1380 1387
             while ($row_unpub = $this->getDatabase()->getRow($result_unpub)) {
1381 1388
                 $this->invokeEvent("OnDocUnPublished", array(
1382 1389
                     "docid" => $row_unpub['id']
@@ -1467,10 +1474,18 @@  discard block
 block discarded – undo
1467 1474
             return array();
1468 1475
         }
1469 1476
         $spacer = md5('<<<EVO>>>');
1470
-        if($left==='{{' && strpos($content,';}}')!==false)  $content = str_replace(';}}', sprintf(';}%s}',   $spacer),$content);
1471
-        if($left==='{{' && strpos($content,'{{}}')!==false) $content = str_replace('{{}}',sprintf('{%$1s{}%$1s}',$spacer),$content);
1472
-        if($left==='[[' && strpos($content,']]]]')!==false) $content = str_replace(']]]]',sprintf(']]%s]]',  $spacer),$content);
1473
-        if($left==='[[' && strpos($content,']]]')!==false)  $content = str_replace(']]]', sprintf(']%s]]',   $spacer),$content);
1477
+        if($left==='{{' && strpos($content,';}}')!==false) {
1478
+            $content = str_replace(';}}', sprintf(';}%s}',   $spacer),$content);
1479
+        }
1480
+        if($left==='{{' && strpos($content,'{{}}')!==false) {
1481
+            $content = str_replace('{{}}',sprintf('{%$1s{}%$1s}',$spacer),$content);
1482
+        }
1483
+        if($left==='[[' && strpos($content,']]]]')!==false) {
1484
+            $content = str_replace(']]]]',sprintf(']]%s]]',  $spacer),$content);
1485
+        }
1486
+        if($left==='[[' && strpos($content,']]]')!==false) {
1487
+            $content = str_replace(']]]', sprintf(']%s]]',   $spacer),$content);
1488
+        }
1474 1489
 
1475 1490
         $pos['<![CDATA['] = strpos($content, '<![CDATA[');
1476 1491
         $pos[']]>'] = strpos($content, ']]>');
@@ -1523,7 +1538,8 @@  discard block
 block discarded – undo
1523 1538
                         }
1524 1539
                     }
1525 1540
 
1526
-                    if (!in_array($fetch, $tags)) {  // Avoid double Matches
1541
+                    if (!in_array($fetch, $tags)) {
1542
+// Avoid double Matches
1527 1543
                         $tags[] = $fetch; // Fetch
1528 1544
                     };
1529 1545
                     $fetch = ''; // and reset
@@ -1541,7 +1557,9 @@  discard block
 block discarded – undo
1541 1557
             }
1542 1558
         }
1543 1559
         foreach($tags as $i=>$tag) {
1544
-            if(strpos($tag,$spacer)!==false) $tags[$i] = str_replace($spacer, '', $tag);
1560
+            if(strpos($tag,$spacer)!==false) {
1561
+                $tags[$i] = str_replace($spacer, '', $tag);
1562
+            }
1545 1563
         }
1546 1564
         return $tags;
1547 1565
     }
@@ -1581,7 +1599,10 @@  discard block
 block discarded – undo
1581 1599
         }
1582 1600
 
1583 1601
         foreach ($matches[1] as $i => $key) {
1584
-            if(strpos($key,'[+')!==false) continue; // Allow chunk {{chunk?&param=`xxx`}} with [*tv_name_[+param+]*] as content
1602
+            if(strpos($key,'[+')!==false) {
1603
+                continue;
1604
+            }
1605
+            // Allow chunk {{chunk?&param=`xxx`}} with [*tv_name_[+param+]*] as content
1585 1606
             if (substr($key, 0, 1) == '#') {
1586 1607
                 $key = substr($key, 1);
1587 1608
             } // remove # for QuickEdit format
@@ -2307,7 +2328,8 @@  discard block
 block discarded – undo
2307 2328
      * @return mixed|string
2308 2329
      */
2309 2330
     public function _getSGVar($value)
2310
-    { // Get super globals
2331
+    {
2332
+// Get super globals
2311 2333
         $key = $value;
2312 2334
         $_ = $this->config['enable_filter'];
2313 2335
         $this->config['enable_filter'] = 1;
@@ -2716,7 +2738,8 @@  discard block
 block discarded – undo
2716 2738
         if ($this->config['friendly_urls'] == 1) {
2717 2739
             $aliases = array();
2718 2740
             if (is_array($this->documentListing)) {
2719
-                foreach ($this->documentListing as $path => $docid) { // This is big Loop on large site!
2741
+                foreach ($this->documentListing as $path => $docid) {
2742
+// This is big Loop on large site!
2720 2743
                     $aliases[$docid] = $path;
2721 2744
                     $isfolder[$docid] = $this->aliasListing[$docid]['isfolder'];
2722 2745
                 }
@@ -2749,7 +2772,7 @@  discard block
 block discarded – undo
2749 2772
             $isfriendly = ($this->config['friendly_alias_urls'] == 1 ? 1 : 0);
2750 2773
             $pref = $this->config['friendly_url_prefix'];
2751 2774
             $suff = $this->config['friendly_url_suffix'];
2752
-            $documentSource = preg_replace_callback($in, function ($m) use ($aliases, $isfolder, $isfriendly, $pref, $suff) {
2775
+            $documentSource = preg_replace_callback($in, function ($m) use ($aliases, $isfolder, $isfriendly, $pref, $suff){
2753 2776
                 global $modx;
2754 2777
                 $thealias = $aliases[$m[1]];
2755 2778
                 $thefolder = $isfolder[$m[1]];
@@ -4533,7 +4556,8 @@  discard block
 block discarded – undo
4533 4556
         if (isset ($this->snippetCache[$snippetName])) {
4534 4557
             $snippet = $this->snippetCache[$snippetName];
4535 4558
             $properties = !empty($this->snippetCache[$snippetName . "Props"]) ? $this->snippetCache[$snippetName . "Props"] : '';
4536
-        } else { // not in cache so let's check the db
4559
+        } else {
4560
+// not in cache so let's check the db
4537 4561
             $sql = "SELECT ss.`name`, ss.`snippet`, ss.`properties`, sm.properties as `sharedproperties` FROM " . $this->getDatabase()->getFullTableName("site_snippets") . " as ss LEFT JOIN " . $this->getDatabase()->getFullTableName('site_modules') . " as sm on sm.guid=ss.moduleguid WHERE ss.`name`='" . $this->getDatabase()->escape($snippetName) . "'  AND ss.disabled=0;";
4538 4562
             $result = $this->getDatabase()->query($sql);
4539 4563
             if ($this->getDatabase()->getRecordCount($result) == 1) {
@@ -5047,7 +5071,7 @@  discard block
 block discarded – undo
5047 5071
             $result = $this->getDatabase()->makeArray($rs);
5048 5072
 
5049 5073
             // get default/built-in template variables
5050
-            if(is_array($docRow)){
5074
+            if(is_array($docRow)) {
5051 5075
                 ksort($docRow);
5052 5076
 
5053 5077
                 foreach ($docRow as $key => $value) {
@@ -5524,12 +5548,16 @@  discard block
 block discarded – undo
5524 5548
             return '';
5525 5549
         } // nothing to register
5526 5550
         if (!is_array($options)) {
5527
-            if (is_bool($options))  // backward compatibility with old plaintext parameter
5551
+            if (is_bool($options)) {
5552
+                // backward compatibility with old plaintext parameter
5528 5553
             {
5529 5554
                 $options = array('plaintext' => $options);
5530
-            } elseif (is_string($options)) // Also allow script name as 2nd param
5555
+            }
5556
+            } elseif (is_string($options)) {
5557
+                // Also allow script name as 2nd param
5531 5558
             {
5532 5559
                 $options = array('name' => $options);
5560
+            }
5533 5561
             } else {
5534 5562
                 $options = array();
5535 5563
             }
@@ -5541,7 +5569,8 @@  discard block
 block discarded – undo
5541 5569
         unset($overwritepos); // probably unnecessary--just making sure
5542 5570
 
5543 5571
         $useThisVer = true;
5544
-        if (isset($this->loadedjscripts[$key])) { // a matching script was found
5572
+        if (isset($this->loadedjscripts[$key])) {
5573
+// a matching script was found
5545 5574
             // if existing script is a startup script, make sure the candidate is also a startup script
5546 5575
             if ($this->loadedjscripts[$key]['startup']) {
5547 5576
                 $startup = true;
@@ -5561,7 +5590,8 @@  discard block
 block discarded – undo
5561 5590
                     // overwrite the old script (the position may be important for dependent scripts)
5562 5591
                     $overwritepos = $this->loadedjscripts[$key]['pos'];
5563 5592
                 }
5564
-            } else { // Use the original version
5593
+            } else {
5594
+// Use the original version
5565 5595
                 if ($startup == true && $this->loadedjscripts[$key]['startup'] == false) {
5566 5596
                     // need to move the exisiting script to the head
5567 5597
                     $version = $this->loadedjscripts[$key][$version];
@@ -5686,7 +5716,8 @@  discard block
 block discarded – undo
5686 5716
         }
5687 5717
 
5688 5718
         $results = null;
5689
-        foreach ($this->pluginEvent[$evtName] as $pluginName) { // start for loop
5719
+        foreach ($this->pluginEvent[$evtName] as $pluginName) {
5720
+// start for loop
5690 5721
             if ($this->dumpPlugins) {
5691 5722
                 $eventtime = $this->getMicroTime();
5692 5723
             }
@@ -5832,8 +5863,7 @@  discard block
 block discarded – undo
5832 5863
                     }
5833 5864
                 }
5834 5865
             }
5835
-        }
5836
-        elseif(\is_array($propertyString)) {
5866
+        } elseif(\is_array($propertyString)) {
5837 5867
             $property = $propertyString;
5838 5868
         }
5839 5869
         if (!empty($elementName) && !empty($elementType)) {
@@ -6280,7 +6310,8 @@  discard block
 block discarded – undo
6280 6310
      * @return bool
6281 6311
      */
6282 6312
     public function isSafeCode($phpcode = '', $safe_functions = '')
6283
-    { // return true or false
6313
+    {
6314
+// return true or false
6284 6315
         if ($safe_functions == '') {
6285 6316
             return false;
6286 6317
         }
@@ -6689,7 +6720,7 @@  discard block
 block discarded – undo
6689 6720
             $args = array_pad(array(), $_, '$var');
6690 6721
             $args = implode(", ", $args);
6691 6722
             $modx = &$this;
6692
-            $args = preg_replace_callback('/\$var/', function () use ($modx, &$tmp, $val) {
6723
+            $args = preg_replace_callback('/\$var/', function () use ($modx, &$tmp, $val){
6693 6724
                 $arg = $val['args'][$tmp - 1];
6694 6725
                 switch (true) {
6695 6726
                     case is_null($arg): {
Please login to merge, or discard this patch.
Upper-Lower-Casing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -2612,11 +2612,11 @@  discard block
 block discarded – undo
2612 2612
         if (isset($this->snippetCache[$snip_name])) {
2613 2613
             $snippetObject['name'] = $snip_name;
2614 2614
             $snippetObject['content'] = $this->snippetCache[$snip_name];
2615
-            if (isset($this->snippetCache["{$snip_name}Props"])) {
2616
-                if (!isset($this->snippetCache["{$snip_name}Props"])) {
2617
-                    $this->snippetCache["{$snip_name}Props"] = '';
2615
+            if (isset($this->snippetCache["{$snip_name}props"])) {
2616
+                if (!isset($this->snippetCache["{$snip_name}props"])) {
2617
+                    $this->snippetCache["{$snip_name}props"] = '';
2618 2618
                 }
2619
-                $snippetObject['properties'] = $this->snippetCache["{$snip_name}Props"];
2619
+                $snippetObject['properties'] = $this->snippetCache["{$snip_name}props"];
2620 2620
             }
2621 2621
         } elseif (substr($snip_name, 0, 1) === '@' && isset($this->pluginEvent[trim($snip_name, '@')])) {
2622 2622
             $snippetObject['name'] = trim($snip_name, '@');
@@ -2645,7 +2645,7 @@  discard block
 block discarded – undo
2645 2645
             $snippetObject['content'] = $snip_content;
2646 2646
             $snippetObject['properties'] = $snip_prop;
2647 2647
             $this->snippetCache[$snip_name] = $snip_content;
2648
-            $this->snippetCache["{$snip_name}Props"] = $snip_prop;
2648
+            $this->snippetCache["{$snip_name}props"] = $snip_prop;
2649 2649
         }
2650 2650
         return $snippetObject;
2651 2651
     }
@@ -3960,7 +3960,7 @@  discard block
 block discarded – undo
3960 3960
         }
3961 3961
         // build query
3962 3962
         $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0") . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)");
3963
-        $result = $this->getDatabase()->select("DISTINCT {$fields}", "{$tblsc} sc
3963
+        $result = $this->getDatabase()->select("distinct {$fields}", "{$tblsc} sc
3964 3964
                 LEFT JOIN {$tbldg} dg on dg.document = sc.id", "sc.parent = '{$id}' AND ({$access}) GROUP BY sc.id", "{$sort} {$dir}");
3965 3965
         $resourceArray = $this->getDatabase()->makeArray($result);
3966 3966
         $this->tmpCache[__FUNCTION__][$cacheKey] = $resourceArray;
@@ -3997,7 +3997,7 @@  discard block
 block discarded – undo
3997 3997
         }
3998 3998
         // build query
3999 3999
         $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0") . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)");
4000
-        $result = $this->getDatabase()->select("DISTINCT {$fields}", "{$tblsc} sc
4000
+        $result = $this->getDatabase()->select("distinct {$fields}", "{$tblsc} sc
4001 4001
                 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}");
4002 4002
         $resourceArray = $this->getDatabase()->makeArray($result);
4003 4003
 
@@ -4053,7 +4053,7 @@  discard block
 block discarded – undo
4053 4053
         $tblsc = $this->getDatabase()->getFullTableName('site_content');
4054 4054
         $tbldg = $this->getDatabase()->getFullTableName('document_groups');
4055 4055
 
4056
-        $result = $this->getDatabase()->select("DISTINCT {$fields}", "{$tblsc} sc
4056
+        $result = $this->getDatabase()->select("distinct {$fields}", "{$tblsc} sc
4057 4057
                 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);
4058 4058
 
4059 4059
         $resourceArray = $this->getDatabase()->makeArray($result);
@@ -4119,7 +4119,7 @@  discard block
 block discarded – undo
4119 4119
             $tblsc = $this->getDatabase()->getFullTableName('site_content');
4120 4120
             $tbldg = $this->getDatabase()->getFullTableName('document_groups');
4121 4121
 
4122
-            $result = $this->getDatabase()->select("DISTINCT {$fields}", "{$tblsc} sc
4122
+            $result = $this->getDatabase()->select("distinct {$fields}", "{$tblsc} sc
4123 4123
                     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);
4124 4124
 
4125 4125
             $resourceArray = $this->getDatabase()->makeArray($result);
@@ -4707,7 +4707,7 @@  discard block
 block discarded – undo
4707 4707
                 $template = $doc['content'];
4708 4708
                 break;
4709 4709
             case 'SELECT':
4710
-                $this->getDatabase()->getValue($this->getDatabase()->query("SELECT {$template}"));
4710
+                $this->getDatabase()->getValue($this->getDatabase()->query("select {$template}"));
4711 4711
                 break;
4712 4712
             default:
4713 4713
                 if (!($template = $this->getChunk($tpl))) {
Please login to merge, or discard this patch.
Spacing   +274 added lines, -274 removed lines patch added patch discarded remove patch
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
         if (empty($services)) {
173 173
             $services   = include EVO_SERVICES_FILE;
174 174
         }
175
-        $this->services     =  $services;
175
+        $this->services = $services;
176 176
 
177 177
         $this->initialize();
178 178
     }
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
 
237 237
     private function checkServiceAlias($name){
238 238
         foreach ($this->providerAliases as $alias => $interface) {
239
-            if($name === $interface) {
239
+            if ($name === $interface) {
240 240
                 return $alias;
241 241
             }
242 242
         }
@@ -415,8 +415,8 @@  discard block
 block discarded – undo
415 415
         if (isset($this->providerAliases[$name])) {
416 416
             if ($this->getConfig('error_reporting', 0) > 1) {
417 417
                 trigger_error(
418
-                    'Property $' . $name . ' is deprecated and should no longer be used. ' .
419
-                    'Alternative ->getService(' . $this->providerAliases[$name] . '::class)',
418
+                    'Property $'.$name.' is deprecated and should no longer be used. '.
419
+                    'Alternative ->getService('.$this->providerAliases[$name].'::class)',
420 420
                     E_USER_DEPRECATED
421 421
                 );
422 422
             }
@@ -452,12 +452,12 @@  discard block
 block discarded – undo
452 452
             $info = debug_backtrace();
453 453
             $m[] = $msg;
454 454
             if (!empty($this->currentSnippet)) {
455
-                $m[] = 'Snippet - ' . $this->currentSnippet;
455
+                $m[] = 'Snippet - '.$this->currentSnippet;
456 456
             } elseif (!empty($this->event->activePlugin)) {
457
-                $m[] = 'Plugin - ' . $this->event->activePlugin;
457
+                $m[] = 'Plugin - '.$this->event->activePlugin;
458 458
             }
459 459
             $m[] = $this->decoded_request_uri;
460
-            $m[] = str_replace('\\', '/', $info[0]['file']) . '(line:' . $info[0]['line'] . ')';
460
+            $m[] = str_replace('\\', '/', $info[0]['file']).'(line:'.$info[0]['line'].')';
461 461
             $msg = implode('<br />', $m);
462 462
             $this->logEvent(0, $error_type, $msg, $title);
463 463
         }
@@ -474,7 +474,7 @@  discard block
 block discarded – undo
474 474
     {
475 475
         $flag = false;
476 476
         if (is_scalar($connector) && !empty($connector) && isset($this->{$connector}) && $this->{$connector} instanceof Interfaces\DatabaseInterface) {
477
-            $flag = (bool)$this->{$connector}->conn;
477
+            $flag = (bool) $this->{$connector}->conn;
478 478
         }
479 479
         return $flag;
480 480
     }
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
             }
506 506
             if (!$out && $flag) {
507 507
                 $extname = trim(str_replace(array('..', '/', '\\'), '', strtolower($extname)));
508
-                $filename = MODX_MANAGER_PATH . "includes/extenders/ex_{$extname}.inc.php";
508
+                $filename = MODX_MANAGER_PATH."includes/extenders/ex_{$extname}.inc.php";
509 509
                 $out = is_file($filename) ? include $filename : false;
510 510
             }
511 511
             if ($out && !in_array($extname, $this->extensions)) {
@@ -523,7 +523,7 @@  discard block
 block discarded – undo
523 523
     public function getMicroTime()
524 524
     {
525 525
         list ($usec, $sec) = explode(' ', microtime());
526
-        return ((float)$usec + (float)$sec);
526
+        return ((float) $usec + (float) $sec);
527 527
     }
528 528
 
529 529
     /**
@@ -547,7 +547,7 @@  discard block
 block discarded – undo
547 547
             // append the redirect count string to the url
548 548
             $currentNumberOfRedirects = isset ($_REQUEST['err']) ? $_REQUEST['err'] : 0;
549 549
             if ($currentNumberOfRedirects > 3) {
550
-                $this->messageQuit('Redirection attempt failed - please ensure the document you\'re trying to redirect to exists. <p>Redirection URL: <i>' . $url . '</i></p>');
550
+                $this->messageQuit('Redirection attempt failed - please ensure the document you\'re trying to redirect to exists. <p>Redirection URL: <i>'.$url.'</i></p>');
551 551
             } else {
552 552
                 $currentNumberOfRedirects += 1;
553 553
                 if (strpos($url, "?") > 0) {
@@ -558,19 +558,19 @@  discard block
 block discarded – undo
558 558
             }
559 559
         }
560 560
         if ($type == 'REDIRECT_REFRESH') {
561
-            $header = 'Refresh: 0;URL=' . $url;
561
+            $header = 'Refresh: 0;URL='.$url;
562 562
         } elseif ($type == 'REDIRECT_META') {
563
-            $header = '<META HTTP-EQUIV="Refresh" CONTENT="0; URL=' . $url . '" />';
563
+            $header = '<META HTTP-EQUIV="Refresh" CONTENT="0; URL='.$url.'" />';
564 564
             echo $header;
565 565
             exit;
566 566
         } elseif ($type == 'REDIRECT_HEADER' || empty ($type)) {
567 567
             // check if url has /$base_url
568 568
             if (substr($url, 0, strlen(MODX_BASE_URL)) == MODX_BASE_URL) {
569 569
                 // append $site_url to make it work with Location:
570
-                $url = MODX_SITE_URL . substr($url, strlen(MODX_BASE_URL));
570
+                $url = MODX_SITE_URL.substr($url, strlen(MODX_BASE_URL));
571 571
             }
572 572
             if (strpos($url, "\n") === false) {
573
-                $header = 'Location: ' . $url;
573
+                $header = 'Location: '.$url;
574 574
             } else {
575 575
                 $this->messageQuit('No newline allowed in redirect url.');
576 576
             }
@@ -579,7 +579,7 @@  discard block
 block discarded – undo
579 579
             header($responseCode);
580 580
         }
581 581
 
582
-        if(!empty($header)) {
582
+        if (!empty($header)) {
583 583
             header($header);
584 584
         }
585 585
 
@@ -684,8 +684,8 @@  discard block
 block discarded – undo
684 684
 
685 685
     private function recoverySiteCache()
686 686
     {
687
-        $site_cache_dir = MODX_BASE_PATH . $this->getCacheFolder();
688
-        $site_cache_path = $site_cache_dir . 'siteCache.idx.php';
687
+        $site_cache_dir = MODX_BASE_PATH.$this->getCacheFolder();
688
+        $site_cache_path = $site_cache_dir.'siteCache.idx.php';
689 689
 
690 690
         if (is_file($site_cache_path)) {
691 691
             include($site_cache_path);
@@ -748,8 +748,8 @@  discard block
 block discarded – undo
748 748
                 $this->invokeEvent("OnBeforeManagerPageInit");
749 749
             }
750 750
 
751
-            if (isset ($_SESSION[$usrType . 'UsrConfigSet'])) {
752
-                $usrSettings = &$_SESSION[$usrType . 'UsrConfigSet'];
751
+            if (isset ($_SESSION[$usrType.'UsrConfigSet'])) {
752
+                $usrSettings = &$_SESSION[$usrType.'UsrConfigSet'];
753 753
             } else {
754 754
                 if ($usrType == 'web') {
755 755
                     $from = $tbl_web_user_settings;
@@ -769,7 +769,7 @@  discard block
 block discarded – undo
769 769
                     $usrSettings[$row['setting_name']] = $row['setting_value'];
770 770
                 }
771 771
                 if (isset ($usrType)) {
772
-                    $_SESSION[$usrType . 'UsrConfigSet'] = $usrSettings;
772
+                    $_SESSION[$usrType.'UsrConfigSet'] = $usrSettings;
773 773
                 } // store user settings in session
774 774
             }
775 775
         }
@@ -914,10 +914,10 @@  discard block
 block discarded – undo
914 914
         $suf = $this->config['friendly_url_suffix'];
915 915
         $pre = preg_quote($pre, '/');
916 916
         $suf = preg_quote($suf, '/');
917
-        if ($pre && preg_match('@^' . $pre . '(.*)$@', $q, $_)) {
917
+        if ($pre && preg_match('@^'.$pre.'(.*)$@', $q, $_)) {
918 918
             $q = $_[1];
919 919
         }
920
-        if ($suf && preg_match('@(.*)' . $suf . '$@', $q, $_)) {
920
+        if ($suf && preg_match('@(.*)'.$suf.'$@', $q, $_)) {
921 921
             $q = $_[1];
922 922
         }
923 923
 
@@ -939,7 +939,7 @@  discard block
 block discarded – undo
939 939
         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 */
940 940
             /* FS#476 and FS#308: check that id is valid in terms of virtualDir structure */
941 941
             if ($this->config['use_alias_path'] == 1) {
942
-                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))))) {
942
+                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))))) {
943 943
                     $this->documentMethod = 'id';
944 944
                     return $q;
945 945
                 } else { /* not a valid id in terms of virtualDir, treat as alias */
@@ -973,7 +973,7 @@  discard block
 block discarded – undo
973 973
      */
974 974
     public function getHashFile($key)
975 975
     {
976
-        return $this->getCacheFolder() . "docid_" . $key . ".pageCache.php";
976
+        return $this->getCacheFolder()."docid_".$key.".pageCache.php";
977 977
     }
978 978
 
979 979
     /**
@@ -984,9 +984,9 @@  discard block
 block discarded – undo
984 984
         $hash = $id;
985 985
         $tmp = null;
986 986
         $params = array();
987
-        if(!empty($this->systemCacheKey)){
987
+        if (!empty($this->systemCacheKey)) {
988 988
             $hash = $this->systemCacheKey;
989
-        }else {
989
+        } else {
990 990
             if (!empty($_GET)) {
991 991
                 // Sort GET parameters so that the order of parameters on the HTTP request don't affect the generated cache ID.
992 992
                 $params = $_GET;
@@ -994,8 +994,8 @@  discard block
 block discarded – undo
994 994
                 $hash .= '_'.md5(http_build_query($params));
995 995
             }
996 996
         }
997
-        $evtOut = $this->invokeEvent("OnMakePageCacheKey", array ("hash" => $hash, "id" => $id, 'params' => $params));
998
-        if (is_array($evtOut) && count($evtOut) > 0){
997
+        $evtOut = $this->invokeEvent("OnMakePageCacheKey", array("hash" => $hash, "id" => $id, 'params' => $params));
998
+        if (is_array($evtOut) && count($evtOut) > 0) {
999 999
             $tmp = array_pop($evtOut);
1000 1000
         }
1001 1001
         return empty($tmp) ? $hash : $tmp;
@@ -1143,12 +1143,12 @@  discard block
 block discarded – undo
1143 1143
         if ($js = $this->getRegisteredClientStartupScripts()) {
1144 1144
             // change to just before closing </head>
1145 1145
             // $this->documentContent = preg_replace("/(<head[^>]*>)/i", "\\1\n".$js, $this->documentContent);
1146
-            $this->documentOutput = preg_replace("/(<\/head>)/i", $js . "\n\\1", $this->documentOutput);
1146
+            $this->documentOutput = preg_replace("/(<\/head>)/i", $js."\n\\1", $this->documentOutput);
1147 1147
         }
1148 1148
 
1149 1149
         // Insert jscripts & html block into template - template must have a </body> tag
1150 1150
         if ($js = $this->getRegisteredClientScripts()) {
1151
-            $this->documentOutput = preg_replace("/(<\/body>)/i", $js . "\n\\1", $this->documentOutput);
1151
+            $this->documentOutput = preg_replace("/(<\/body>)/i", $js."\n\\1", $this->documentOutput);
1152 1152
         }
1153 1153
         // End fix by sirlancelot
1154 1154
 
@@ -1159,7 +1159,7 @@  discard block
 block discarded – undo
1159 1159
         // send out content-type and content-disposition headers
1160 1160
         if (IN_PARSER_MODE == "true") {
1161 1161
             $type = !empty ($this->contentTypes[$this->documentIdentifier]) ? $this->contentTypes[$this->documentIdentifier] : "text/html";
1162
-            header('Content-Type: ' . $type . '; charset=' . $this->config['modx_charset']);
1162
+            header('Content-Type: '.$type.'; charset='.$this->config['modx_charset']);
1163 1163
             //            if (($this->documentIdentifier == $this->config['error_page']) || $redirect_error)
1164 1164
             //                header('HTTP/1.0 404 Not Found');
1165 1165
             if (!$this->checkPreview() && $this->documentObject['content_dispo'] == 1) {
@@ -1177,7 +1177,7 @@  discard block
 block discarded – undo
1177 1177
                     $name = preg_replace('|-+|', '-', $name);
1178 1178
                     $name = trim($name, '-');
1179 1179
                 }
1180
-                $header = 'Content-Disposition: attachment; filename=' . $name;
1180
+                $header = 'Content-Disposition: attachment; filename='.$name;
1181 1181
                 header($header);
1182 1182
             }
1183 1183
         }
@@ -1185,7 +1185,7 @@  discard block
 block discarded – undo
1185 1185
 
1186 1186
         $stats = $this->getTimerStats($this->tstart);
1187 1187
 
1188
-        $out =& $this->documentOutput;
1188
+        $out = & $this->documentOutput;
1189 1189
         $out = str_replace("[^q^]", $stats['queries'], $out);
1190 1190
         $out = str_replace("[^qt^]", $stats['queryTime'], $out);
1191 1191
         $out = str_replace("[^p^]", $stats['phpTime'], $out);
@@ -1224,17 +1224,17 @@  discard block
 block discarded – undo
1224 1224
                 $sc .= sprintf("%s. %s (%s)<br>", $s, $sname, sprintf("%2.2f ms", $t)); // currentSnippet
1225 1225
                 $tt += $t;
1226 1226
             }
1227
-            echo "<fieldset><legend><b>Snippets</b> (" . count($this->snippetsTime) . " / " . sprintf("%2.2f ms", $tt) . ")</legend>{$sc}</fieldset><br />";
1227
+            echo "<fieldset><legend><b>Snippets</b> (".count($this->snippetsTime)." / ".sprintf("%2.2f ms", $tt).")</legend>{$sc}</fieldset><br />";
1228 1228
             echo $this->snippetsCode;
1229 1229
         }
1230 1230
         if ($this->dumpPlugins) {
1231 1231
             $ps = "";
1232 1232
             $tt = 0;
1233 1233
             foreach ($this->pluginsTime as $s => $t) {
1234
-                $ps .= "$s (" . sprintf("%2.2f ms", $t * 1000) . ")<br>";
1234
+                $ps .= "$s (".sprintf("%2.2f ms", $t * 1000).")<br>";
1235 1235
                 $tt += $t;
1236 1236
             }
1237
-            echo "<fieldset><legend><b>Plugins</b> (" . count($this->pluginsTime) . " / " . sprintf("%2.2f ms", $tt * 1000) . ")</legend>{$ps}</fieldset><br />";
1237
+            echo "<fieldset><legend><b>Plugins</b> (".count($this->pluginsTime)." / ".sprintf("%2.2f ms", $tt * 1000).")</legend>{$ps}</fieldset><br />";
1238 1238
             echo $this->pluginsCode;
1239 1239
         }
1240 1240
 
@@ -1260,7 +1260,7 @@  discard block
 block discarded – undo
1260 1260
         $srcTags = explode(',', $tags);
1261 1261
         $repTags = array();
1262 1262
         foreach ($srcTags as $tag) {
1263
-            $repTags[] = '\\' . $tag[0] . '\\' . $tag[1];
1263
+            $repTags[] = '\\'.$tag[0].'\\'.$tag[1];
1264 1264
         }
1265 1265
         return array($srcTags, $repTags);
1266 1266
     }
@@ -1282,7 +1282,7 @@  discard block
 block discarded – undo
1282 1282
         $stats['phpTime'] = sprintf("%2.4f s", $stats['phpTime']);
1283 1283
         $stats['source'] = $this->documentGenerated == 1 ? "database" : "cache";
1284 1284
         $stats['queries'] = isset ($this->executedQueries) ? $this->executedQueries : 0;
1285
-        $stats['phpMemory'] = (memory_get_peak_usage(true) / 1024 / 1024) . " mb";
1285
+        $stats['phpMemory'] = (memory_get_peak_usage(true) / 1024 / 1024)." mb";
1286 1286
 
1287 1287
         return $stats;
1288 1288
     }
@@ -1315,7 +1315,7 @@  discard block
 block discarded – undo
1315 1315
     {
1316 1316
         $cacheRefreshTime = 0;
1317 1317
         $recent_update = 0;
1318
-        @include(MODX_BASE_PATH . $this->getCacheFolder() . 'sitePublishing.idx.php');
1318
+        @include(MODX_BASE_PATH.$this->getCacheFolder().'sitePublishing.idx.php');
1319 1319
         $this->recentUpdate = $recent_update;
1320 1320
 
1321 1321
         $timeNow = $_SERVER['REQUEST_TIME'] + $this->config['server_offset_time'];
@@ -1397,8 +1397,8 @@  discard block
 block discarded – undo
1397 1397
                 }
1398 1398
 
1399 1399
                 $docObjSerial = serialize($this->documentObject);
1400
-                $cacheContent = $docObjSerial . "<!--__MODxCacheSpliter__-->" . $this->documentContent;
1401
-                $page_cache_path = MODX_BASE_PATH . $this->getHashFile($this->cacheKey);
1400
+                $cacheContent = $docObjSerial."<!--__MODxCacheSpliter__-->".$this->documentContent;
1401
+                $page_cache_path = MODX_BASE_PATH.$this->getHashFile($this->cacheKey);
1402 1402
                 file_put_contents($page_cache_path, "<?php die('Unauthorized access.'); ?>$cacheContent");
1403 1403
             }
1404 1404
         }
@@ -1440,16 +1440,16 @@  discard block
 block discarded – undo
1440 1440
             return array();
1441 1441
         }
1442 1442
         $spacer = md5('<<<EVO>>>');
1443
-        if($left==='{{' && strpos($content,';}}')!==false)  $content = str_replace(';}}', sprintf(';}%s}',   $spacer),$content);
1444
-        if($left==='{{' && strpos($content,'{{}}')!==false) $content = str_replace('{{}}',sprintf('{%$1s{}%$1s}',$spacer),$content);
1445
-        if($left==='[[' && strpos($content,']]]]')!==false) $content = str_replace(']]]]',sprintf(']]%s]]',  $spacer),$content);
1446
-        if($left==='[[' && strpos($content,']]]')!==false)  $content = str_replace(']]]', sprintf(']%s]]',   $spacer),$content);
1443
+        if ($left === '{{' && strpos($content, ';}}') !== false)  $content = str_replace(';}}', sprintf(';}%s}', $spacer), $content);
1444
+        if ($left === '{{' && strpos($content, '{{}}') !== false) $content = str_replace('{{}}', sprintf('{%$1s{}%$1s}', $spacer), $content);
1445
+        if ($left === '[[' && strpos($content, ']]]]') !== false) $content = str_replace(']]]]', sprintf(']]%s]]', $spacer), $content);
1446
+        if ($left === '[[' && strpos($content, ']]]') !== false)  $content = str_replace(']]]', sprintf(']%s]]', $spacer), $content);
1447 1447
 
1448 1448
         $pos['<![CDATA['] = strpos($content, '<![CDATA[');
1449 1449
         $pos[']]>'] = strpos($content, ']]>');
1450 1450
 
1451 1451
         if ($pos['<![CDATA['] !== false && $pos[']]>'] !== false) {
1452
-            $content = substr($content, 0, $pos['<![CDATA[']) . substr($content, $pos[']]>'] + 3);
1452
+            $content = substr($content, 0, $pos['<![CDATA[']).substr($content, $pos[']]>'] + 3);
1453 1453
         }
1454 1454
 
1455 1455
         $lp = explode($left, $content);
@@ -1513,8 +1513,8 @@  discard block
 block discarded – undo
1513 1513
                 }
1514 1514
             }
1515 1515
         }
1516
-        foreach($tags as $i=>$tag) {
1517
-            if(strpos($tag,$spacer)!==false) $tags[$i] = str_replace($spacer, '', $tag);
1516
+        foreach ($tags as $i=>$tag) {
1517
+            if (strpos($tag, $spacer) !== false) $tags[$i] = str_replace($spacer, '', $tag);
1518 1518
         }
1519 1519
         return $tags;
1520 1520
     }
@@ -1554,7 +1554,7 @@  discard block
 block discarded – undo
1554 1554
         }
1555 1555
 
1556 1556
         foreach ($matches[1] as $i => $key) {
1557
-            if(strpos($key,'[+')!==false) continue; // Allow chunk {{chunk?&param=`xxx`}} with [*tv_name_[+param+]*] as content
1557
+            if (strpos($key, '[+') !== false) continue; // Allow chunk {{chunk?&param=`xxx`}} with [*tv_name_[+param+]*] as content
1558 1558
             if (substr($key, 0, 1) == '#') {
1559 1559
                 $key = substr($key, 1);
1560 1560
             } // remove # for QuickEdit format
@@ -1584,8 +1584,8 @@  discard block
 block discarded – undo
1584 1584
 
1585 1585
             if (strpos($content, $s) !== false) {
1586 1586
                 $content = str_replace($s, $value, $content);
1587
-            } elseif($this->debug) {
1588
-                $this->addLog('mergeDocumentContent parse error', $_SERVER['REQUEST_URI'] . $s, 2);
1587
+            } elseif ($this->debug) {
1588
+                $this->addLog('mergeDocumentContent parse error', $_SERVER['REQUEST_URI'].$s, 2);
1589 1589
             }
1590 1590
         }
1591 1591
 
@@ -1752,8 +1752,8 @@  discard block
 block discarded – undo
1752 1752
             $s = &$matches[0][$i];
1753 1753
             if (strpos($content, $s) !== false) {
1754 1754
                 $content = str_replace($s, $value, $content);
1755
-            } elseif($this->debug) {
1756
-                $this->addLog('mergeSettingsContent parse error', $_SERVER['REQUEST_URI'] . $s, 2);
1755
+            } elseif ($this->debug) {
1756
+                $this->addLog('mergeSettingsContent parse error', $_SERVER['REQUEST_URI'].$s, 2);
1757 1757
             }
1758 1758
         }
1759 1759
         return $content;
@@ -1806,7 +1806,7 @@  discard block
 block discarded – undo
1806 1806
             }
1807 1807
 
1808 1808
             $value = $this->parseText($value, $params); // parse local scope placeholers for ConditionalTags
1809
-            $value = $this->mergePlaceholderContent($value, $params);  // parse page global placeholers
1809
+            $value = $this->mergePlaceholderContent($value, $params); // parse page global placeholers
1810 1810
             if ($this->config['enable_at_syntax']) {
1811 1811
                 $value = $this->mergeConditionalTagsContent($value);
1812 1812
             }
@@ -1821,8 +1821,8 @@  discard block
 block discarded – undo
1821 1821
             $s = &$matches[0][$i];
1822 1822
             if (strpos($content, $s) !== false) {
1823 1823
                 $content = str_replace($s, $value, $content);
1824
-            } elseif($this->debug) {
1825
-                $this->addLog('mergeChunkContent parse error', $_SERVER['REQUEST_URI'] . $s, 2);
1824
+            } elseif ($this->debug) {
1825
+                $this->addLog('mergeChunkContent parse error', $_SERVER['REQUEST_URI'].$s, 2);
1826 1826
             }
1827 1827
         }
1828 1828
         return $content;
@@ -1880,8 +1880,8 @@  discard block
 block discarded – undo
1880 1880
             $s = &$matches[0][$i];
1881 1881
             if (strpos($content, $s) !== false) {
1882 1882
                 $content = str_replace($s, $value, $content);
1883
-            } elseif($this->debug) {
1884
-                $this->addLog('mergePlaceholderContent parse error', $_SERVER['REQUEST_URI'] . $s, 2);
1883
+            } elseif ($this->debug) {
1884
+                $this->addLog('mergePlaceholderContent parse error', $_SERVER['REQUEST_URI'].$s, 2);
1885 1885
             }
1886 1886
         }
1887 1887
         return $content;
@@ -1905,7 +1905,7 @@  discard block
 block discarded – undo
1905 1905
             return $content;
1906 1906
         }
1907 1907
 
1908
-        $sp = '#' . md5('ConditionalTags' . $_SERVER['REQUEST_TIME']) . '#';
1908
+        $sp = '#'.md5('ConditionalTags'.$_SERVER['REQUEST_TIME']).'#';
1909 1909
         $content = str_replace(array('<?php', '<?=', '<?', '?>'), array("{$sp}b", "{$sp}p", "{$sp}s", "{$sp}e"), $content);
1910 1910
 
1911 1911
         $pieces = explode('<@IF:', $content);
@@ -1916,7 +1916,7 @@  discard block
 block discarded – undo
1916 1916
             }
1917 1917
             list($cmd, $text) = explode('>', $split, 2);
1918 1918
             $cmd = str_replace("'", "\'", $cmd);
1919
-            $content .= "<?php if(\$this->_parseCTagCMD('" . $cmd . "')): ?>";
1919
+            $content .= "<?php if(\$this->_parseCTagCMD('".$cmd."')): ?>";
1920 1920
             $content .= $text;
1921 1921
         }
1922 1922
         $pieces = explode('<@ELSEIF:', $content);
@@ -1927,13 +1927,13 @@  discard block
 block discarded – undo
1927 1927
             }
1928 1928
             list($cmd, $text) = explode('>', $split, 2);
1929 1929
             $cmd = str_replace("'", "\'", $cmd);
1930
-            $content .= "<?php elseif(\$this->_parseCTagCMD('" . $cmd . "')): ?>";
1930
+            $content .= "<?php elseif(\$this->_parseCTagCMD('".$cmd."')): ?>";
1931 1931
             $content .= $text;
1932 1932
         }
1933 1933
 
1934 1934
         $content = str_replace(array('<@ELSE>', '<@ENDIF>'), array('<?php else:?>', '<?php endif;?>'), $content);
1935 1935
         ob_start();
1936
-        $content = eval('?>' . $content);
1936
+        $content = eval('?>'.$content);
1937 1937
         $content = ob_get_clean();
1938 1938
         $content = str_replace(array("{$sp}b", "{$sp}p", "{$sp}s", "{$sp}e"), array('<?php', '<?=', '<?', '?>'), $content);
1939 1939
 
@@ -2058,7 +2058,7 @@  discard block
 block discarded – undo
2058 2058
         $matches = $this->getTagsFromContent($content, $left, $right);
2059 2059
         if (!empty($matches)) {
2060 2060
             foreach ($matches[0] as $i => $v) {
2061
-                $addBreakMatches[$i] = $v . "\n";
2061
+                $addBreakMatches[$i] = $v."\n";
2062 2062
             }
2063 2063
             $content = str_replace($addBreakMatches, '', $content);
2064 2064
             if (strpos($content, $left) !== false) {
@@ -2091,8 +2091,8 @@  discard block
 block discarded – undo
2091 2091
             $s = &$matches[0][$i];
2092 2092
             if (strpos($content, $s) !== false) {
2093 2093
                 $content = str_replace($s, $v, $content);
2094
-            } elseif($this->debug) {
2095
-                $this->addLog('ignoreCommentedTagsContent parse error', $_SERVER['REQUEST_URI'] . $s, 2);
2094
+            } elseif ($this->debug) {
2095
+                $this->addLog('ignoreCommentedTagsContent parse error', $_SERVER['REQUEST_URI'].$s, 2);
2096 2096
             }
2097 2097
         }
2098 2098
         return $content;
@@ -2156,7 +2156,7 @@  discard block
 block discarded – undo
2156 2156
                 $msg = ($msg === false) ? 'ob_get_contents() error' : $msg;
2157 2157
                 $this->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], 'Plugin', $error_info['message'], $error_info['line'], $msg);
2158 2158
                 if ($this->isBackend()) {
2159
-                    $this->event->alert('An error occurred while loading. Please see the event log for more information.<p>' . $msg . '</p>');
2159
+                    $this->event->alert('An error occurred while loading. Please see the event log for more information.<p>'.$msg.'</p>');
2160 2160
                 }
2161 2161
             }
2162 2162
         } else {
@@ -2205,7 +2205,7 @@  discard block
 block discarded – undo
2205 2205
                 $echo = ($echo === false) ? 'ob_get_contents() error' : $echo;
2206 2206
                 $this->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], 'Snippet', $error_info['message'], $error_info['line'], $echo);
2207 2207
                 if ($this->isBackend()) {
2208
-                    $this->event->alert('An error occurred while loading. Please see the event log for more information<p>' . $echo . $return . '</p>');
2208
+                    $this->event->alert('An error occurred while loading. Please see the event log for more information<p>'.$echo.$return.'</p>');
2209 2209
                 }
2210 2210
             }
2211 2211
         }
@@ -2213,7 +2213,7 @@  discard block
 block discarded – undo
2213 2213
         if (is_array($return) || is_object($return)) {
2214 2214
             return $return;
2215 2215
         } else {
2216
-            return $echo . $return;
2216
+            return $echo.$return;
2217 2217
         }
2218 2218
     }
2219 2219
 
@@ -2251,8 +2251,8 @@  discard block
 block discarded – undo
2251 2251
                 }
2252 2252
                 if (strpos($content, $s) !== false) {
2253 2253
                     $content = str_replace($s, $value, $content);
2254
-                } elseif($this->debug) {
2255
-                    $this->addLog('evalSnippetsSGVar parse error', $_SERVER['REQUEST_URI'] . $s, 2);
2254
+                } elseif ($this->debug) {
2255
+                    $this->addLog('evalSnippetsSGVar parse error', $_SERVER['REQUEST_URI'].$s, 2);
2256 2256
                 }
2257 2257
                 continue;
2258 2258
             }
@@ -2263,8 +2263,8 @@  discard block
 block discarded – undo
2263 2263
 
2264 2264
             if (strpos($content, $s) !== false) {
2265 2265
                 $content = str_replace($s, $value, $content);
2266
-            } elseif($this->debug) {
2267
-                $this->addLog('evalSnippets parse error', $_SERVER['REQUEST_URI'] . $s, 2);
2266
+            } elseif ($this->debug) {
2267
+                $this->addLog('evalSnippets parse error', $_SERVER['REQUEST_URI'].$s, 2);
2268 2268
             }
2269 2269
         }
2270 2270
 
@@ -2355,7 +2355,7 @@  discard block
 block discarded – undo
2355 2355
             $eventtime = sprintf('%2.2f ms', $eventtime * 1000);
2356 2356
             $code = str_replace("\t", '  ', $this->getPhpCompat()->htmlspecialchars($value));
2357 2357
             $piece = str_replace("\t", '  ', $this->getPhpCompat()->htmlspecialchars($piece));
2358
-            $print_r_params = str_replace("\t", '  ', $this->getPhpCompat()->htmlspecialchars('$modx->event->params = ' . print_r($params, true)));
2358
+            $print_r_params = str_replace("\t", '  ', $this->getPhpCompat()->htmlspecialchars('$modx->event->params = '.print_r($params, true)));
2359 2359
             $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);
2360 2360
             $this->snippetsTime[] = array('sname' => $key, 'time' => $eventtime);
2361 2361
         }
@@ -2604,7 +2604,7 @@  discard block
 block discarded – undo
2604 2604
             );
2605 2605
             $count = $this->getDatabase()->getRecordCount($rs);
2606 2606
             if (1 < $count) {
2607
-                exit('Error $modx->_getSnippetObject()' . $snip_name);
2607
+                exit('Error $modx->_getSnippetObject()'.$snip_name);
2608 2608
             }
2609 2609
             if ($count) {
2610 2610
                 $row = $this->getDatabase()->getRow($rs);
@@ -2630,7 +2630,7 @@  discard block
 block discarded – undo
2630 2630
     public function toAlias($text)
2631 2631
     {
2632 2632
         $suff = $this->config['friendly_url_suffix'];
2633
-        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);
2633
+        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);
2634 2634
     }
2635 2635
 
2636 2636
     /**
@@ -2662,7 +2662,7 @@  discard block
 block discarded – undo
2662 2662
                 $suff = '/';
2663 2663
             }
2664 2664
 
2665
-            $url = ($dir != '' ? $dir . '/' : '') . $pre . $alias . $suff;
2665
+            $url = ($dir != '' ? $dir.'/' : '').$pre.$alias.$suff;
2666 2666
         }
2667 2667
 
2668 2668
         $evtOut = $this->invokeEvent('OnMakeDocUrl', array(
@@ -2699,7 +2699,7 @@  discard block
 block discarded – undo
2699 2699
                 preg_match_all('!\[\~([0-9]+)\~\]!ise', $documentSource, $match);
2700 2700
                 $ids = implode(',', array_unique($match['1']));
2701 2701
                 if ($ids) {
2702
-                    $res = $this->getDatabase()->select("id,alias,isfolder,parent,alias_visible", $this->getDatabase()->getFullTableName('site_content'), "id IN (" . $ids . ") AND isfolder = '0'");
2702
+                    $res = $this->getDatabase()->select("id,alias,isfolder,parent,alias_visible", $this->getDatabase()->getFullTableName('site_content'), "id IN (".$ids.") AND isfolder = '0'");
2703 2703
                     while ($row = $this->getDatabase()->getRow($res)) {
2704 2704
                         if ($this->config['use_alias_path'] == '1' && $row['parent'] != 0) {
2705 2705
                             $parent = $row['parent'];
@@ -2710,7 +2710,7 @@  discard block
 block discarded – undo
2710 2710
                                 $parent = $this->aliasListing[$parent]['parent'];
2711 2711
                             }
2712 2712
 
2713
-                            $aliases[$row['id']] = $path . '/' . $row['alias'];
2713
+                            $aliases[$row['id']] = $path.'/'.$row['alias'];
2714 2714
                         } else {
2715 2715
                             $aliases[$row['id']] = $row['alias'];
2716 2716
                         }
@@ -2722,7 +2722,7 @@  discard block
 block discarded – undo
2722 2722
             $isfriendly = ($this->config['friendly_alias_urls'] == 1 ? 1 : 0);
2723 2723
             $pref = $this->config['friendly_url_prefix'];
2724 2724
             $suff = $this->config['friendly_url_suffix'];
2725
-            $documentSource = preg_replace_callback($in, function ($m) use ($aliases, $isfolder, $isfriendly, $pref, $suff) {
2725
+            $documentSource = preg_replace_callback($in, function($m) use ($aliases, $isfolder, $isfriendly, $pref, $suff) {
2726 2726
                 global $modx;
2727 2727
                 $thealias = $aliases[$m[1]];
2728 2728
                 $thefolder = $isfolder[$m[1]];
@@ -2738,7 +2738,7 @@  discard block
 block discarded – undo
2738 2738
 
2739 2739
         } else {
2740 2740
             $in = '!\[\~([0-9]+)\~\]!is';
2741
-            $out = "index.php?id=" . '\1';
2741
+            $out = "index.php?id=".'\1';
2742 2742
             $documentSource = preg_replace($in, $out, $documentSource);
2743 2743
         }
2744 2744
 
@@ -2759,7 +2759,7 @@  discard block
 block discarded – undo
2759 2759
         $scheme = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http';
2760 2760
         $len_base_url = strlen($this->config['base_url']);
2761 2761
 
2762
-        $url_path = $q;//LANG
2762
+        $url_path = $q; //LANG
2763 2763
 
2764 2764
         if (substr($url_path, 0, $len_base_url) === $this->config['base_url']) {
2765 2765
             $url_path = substr($url_path, $len_base_url);
@@ -2771,7 +2771,7 @@  discard block
 block discarded – undo
2771 2771
             $strictURL = substr($strictURL, $len_base_url);
2772 2772
         }
2773 2773
         $http_host = $_SERVER['HTTP_HOST'];
2774
-        $requestedURL = "{$scheme}://{$http_host}" . '/' . $q; //LANG
2774
+        $requestedURL = "{$scheme}://{$http_host}".'/'.$q; //LANG
2775 2775
 
2776 2776
         $site_url = $this->config['site_url'];
2777 2777
         $url_query_string = explode('?', $_SERVER['REQUEST_URI']);
@@ -2789,7 +2789,7 @@  discard block
 block discarded – undo
2789 2789
                 }
2790 2790
                 if ($this->config['base_url'] != $_SERVER['REQUEST_URI']) {
2791 2791
                     if (empty($_POST)) {
2792
-                        if (($this->config['base_url'] . '?' . $qstring) != $_SERVER['REQUEST_URI']) {
2792
+                        if (($this->config['base_url'].'?'.$qstring) != $_SERVER['REQUEST_URI']) {
2793 2793
                             $this->sendRedirect($url, 0, 'REDIRECT_HEADER', 'HTTP/1.0 301 Moved Permanently');
2794 2794
                             exit(0);
2795 2795
                         }
@@ -2848,7 +2848,7 @@  discard block
 block discarded – undo
2848 2848
                 $docgrp = implode(",", $docgrp);
2849 2849
             }
2850 2850
             // get document
2851
-            $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0") . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)");
2851
+            $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='".$_SESSION['mgrRole']."' OR sc.privatemgr=0").(!$docgrp ? "" : " OR dg.document_group IN ($docgrp)");
2852 2852
             $rs = $this->getDatabase()->select('sc.*', "{$tblsc} sc
2853 2853
                 LEFT JOIN {$tbldg} dg ON dg.document = sc.id", "sc.{$method} = '{$identifier}' AND ({$access})", "", 1);
2854 2854
             if ($this->getDatabase()->getRecordCount($rs) < 1) {
@@ -2884,9 +2884,9 @@  discard block
 block discarded – undo
2884 2884
             }
2885 2885
             if ($documentObject['template']) {
2886 2886
                 // load TVs and merge with document - Orig by Apodigm - Docvars
2887
-                $rs = $this->getDatabase()->select("tv.*, IF(tvc.value!='',tvc.value,tv.default_text) as value", $this->getDatabase()->getFullTableName("site_tmplvars") . " tv
2888
-                INNER JOIN " . $this->getDatabase()->getFullTableName("site_tmplvar_templates") . " tvtpl ON tvtpl.tmplvarid = tv.id
2889
-                LEFT JOIN " . $this->getDatabase()->getFullTableName("site_tmplvar_contentvalues") . " tvc ON tvc.tmplvarid=tv.id AND tvc.contentid = '{$documentObject['id']}'", "tvtpl.templateid = '{$documentObject['template']}'");
2887
+                $rs = $this->getDatabase()->select("tv.*, IF(tvc.value!='',tvc.value,tv.default_text) as value", $this->getDatabase()->getFullTableName("site_tmplvars")." tv
2888
+                INNER JOIN " . $this->getDatabase()->getFullTableName("site_tmplvar_templates")." tvtpl ON tvtpl.tmplvarid = tv.id
2889
+                LEFT JOIN " . $this->getDatabase()->getFullTableName("site_tmplvar_contentvalues")." tvc ON tvc.tmplvarid=tv.id AND tvc.contentid = '{$documentObject['id']}'", "tvtpl.templateid = '{$documentObject['template']}'");
2890 2890
                 $tmplvars = array();
2891 2891
                 while ($row = $this->getDatabase()->getRow($rs)) {
2892 2892
                     $tmplvars[$row['name']] = array(
@@ -2932,7 +2932,7 @@  discard block
 block discarded – undo
2932 2932
                 $st = md5($source);
2933 2933
             }
2934 2934
             if ($this->dumpSnippets == 1) {
2935
-                $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>";
2935
+                $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>";
2936 2936
             }
2937 2937
 
2938 2938
             // invoke OnParseDocument event
@@ -2974,7 +2974,7 @@  discard block
 block discarded – undo
2974 2974
      */
2975 2975
     public function executeParser()
2976 2976
     {
2977
-        if(MODX_CLI) {
2977
+        if (MODX_CLI) {
2978 2978
             throw new \RuntimeException('Call DocumentParser::executeParser on CLI mode');
2979 2979
         }
2980 2980
 
@@ -3020,7 +3020,7 @@  discard block
 block discarded – undo
3020 3020
 
3021 3021
             // Check use_alias_path and check if $this->virtualDir is set to anything, then parse the path
3022 3022
             if ($this->config['use_alias_path'] == 1) {
3023
-                $alias = (strlen($this->virtualDir) > 0 ? $this->virtualDir . '/' : '') . $this->documentIdentifier;
3023
+                $alias = (strlen($this->virtualDir) > 0 ? $this->virtualDir.'/' : '').$this->documentIdentifier;
3024 3024
                 if (isset($this->documentListing[$alias])) {
3025 3025
                     $this->documentIdentifier = $this->documentListing[$alias];
3026 3026
                 } else {
@@ -3081,7 +3081,7 @@  discard block
 block discarded – undo
3081 3081
                 } else {
3082 3082
                     $docAlias = $this->getDatabase()->escape($this->documentIdentifier);
3083 3083
                     $rs = $this->getDatabase()->select('id', $this->getDatabase()->getFullTableName('site_content'), "deleted=0 and alias='{$docAlias}'");
3084
-                    $this->documentIdentifier = (int)$this->getDatabase()->getValue($rs);
3084
+                    $this->documentIdentifier = (int) $this->getDatabase()->getValue($rs);
3085 3085
                 }
3086 3086
             }
3087 3087
             $this->documentMethod = 'id';
@@ -3138,7 +3138,7 @@  discard block
 block discarded – undo
3138 3138
                 $_REQUEST[$n] = $_GET[$n] = $v;
3139 3139
             }
3140 3140
         }
3141
-        $_SERVER['PHP_SELF'] = $this->config['base_url'] . $qp['path'];
3141
+        $_SERVER['PHP_SELF'] = $this->config['base_url'].$qp['path'];
3142 3142
         $this->q = $qp['path'];
3143 3143
         return $qp['path'];
3144 3144
     }
@@ -3288,7 +3288,7 @@  discard block
 block discarded – undo
3288 3288
         while ($id && $height--) {
3289 3289
             $thisid = $id;
3290 3290
             if ($this->config['aliaslistingfolder'] == 1) {
3291
-                $id = isset($this->aliasListing[$id]['parent']) ? $this->aliasListing[$id]['parent'] : $this->getDatabase()->getValue("SELECT `parent` FROM " . $this->getDatabase()->getFullTableName("site_content") . " WHERE `id` = '{$id}' LIMIT 0,1");
3291
+                $id = isset($this->aliasListing[$id]['parent']) ? $this->aliasListing[$id]['parent'] : $this->getDatabase()->getValue("SELECT `parent` FROM ".$this->getDatabase()->getFullTableName("site_content")." WHERE `id` = '{$id}' LIMIT 0,1");
3292 3292
                 if (!$id || $id == '0') {
3293 3293
                     break;
3294 3294
                 }
@@ -3339,15 +3339,15 @@  discard block
 block discarded – undo
3339 3339
 
3340 3340
         if ($this->config['aliaslistingfolder'] == 1) {
3341 3341
 
3342
-            $res = $this->getDatabase()->select("id,alias,isfolder,parent", $this->getDatabase()->getFullTableName('site_content'), "parent IN (" . $id . ") AND deleted = '0'");
3342
+            $res = $this->getDatabase()->select("id,alias,isfolder,parent", $this->getDatabase()->getFullTableName('site_content'), "parent IN (".$id.") AND deleted = '0'");
3343 3343
             $idx = array();
3344 3344
             while ($row = $this->getDatabase()->getRow($res)) {
3345 3345
                 $pAlias = '';
3346 3346
                 if (isset($this->aliasListing[$row['parent']])) {
3347
-                    $pAlias .= !empty($this->aliasListing[$row['parent']]['path']) ? $this->aliasListing[$row['parent']]['path'] . '/' : '';
3348
-                    $pAlias .= !empty($this->aliasListing[$row['parent']]['alias']) ? $this->aliasListing[$row['parent']]['alias'] . '/' : '';
3347
+                    $pAlias .= !empty($this->aliasListing[$row['parent']]['path']) ? $this->aliasListing[$row['parent']]['path'].'/' : '';
3348
+                    $pAlias .= !empty($this->aliasListing[$row['parent']]['alias']) ? $this->aliasListing[$row['parent']]['alias'].'/' : '';
3349 3349
                 };
3350
-                $children[$pAlias . $row['alias']] = $row['id'];
3350
+                $children[$pAlias.$row['alias']] = $row['id'];
3351 3351
                 if ($row['isfolder'] == 1) {
3352 3352
                     $idx[] = $row['id'];
3353 3353
                 }
@@ -3379,7 +3379,7 @@  discard block
 block discarded – undo
3379 3379
                 $depth--;
3380 3380
 
3381 3381
                 foreach ($documentMap_cache[$id] as $childId) {
3382
-                    $pkey = (strlen($this->aliasListing[$childId]['path']) ? "{$this->aliasListing[$childId]['path']}/" : '') . $this->aliasListing[$childId]['alias'];
3382
+                    $pkey = (strlen($this->aliasListing[$childId]['path']) ? "{$this->aliasListing[$childId]['path']}/" : '').$this->aliasListing[$childId]['alias'];
3383 3383
                     if (!strlen($pkey)) {
3384 3384
                         $pkey = "{$childId}";
3385 3385
                     }
@@ -3416,7 +3416,7 @@  discard block
 block discarded – undo
3416 3416
                 $fnc = 'history.back(-1);';
3417 3417
                 break;
3418 3418
             default:
3419
-                $fnc = "window.location.href='" . addslashes($url) . "';";
3419
+                $fnc = "window.location.href='".addslashes($url)."';";
3420 3420
         }
3421 3421
 
3422 3422
         echo "<html><head>
@@ -3448,9 +3448,9 @@  discard block
 block discarded – undo
3448 3448
         $state = 0;
3449 3449
         $pms = $_SESSION['mgrPermissions'];
3450 3450
         if ($pms) {
3451
-            $state = ((bool)$pms[$pm] === true);
3451
+            $state = ((bool) $pms[$pm] === true);
3452 3452
         }
3453
-        return (int)$state;
3453
+        return (int) $state;
3454 3454
     }
3455 3455
 
3456 3456
     /**
@@ -3463,8 +3463,8 @@  discard block
 block discarded – undo
3463 3463
      */
3464 3464
     public function elementIsLocked($type, $id, $includeThisUser = false)
3465 3465
     {
3466
-        $id = (int)$id;
3467
-        $type = (int)$type;
3466
+        $id = (int) $id;
3467
+        $type = (int) $type;
3468 3468
         if (!$type || !$id) {
3469 3469
             return null;
3470 3470
         }
@@ -3514,7 +3514,7 @@  discard block
 block discarded – undo
3514 3514
             return $lockedElements;
3515 3515
         }
3516 3516
 
3517
-        $type = (int)$type;
3517
+        $type = (int) $type;
3518 3518
         if (isset($lockedElements[$type])) {
3519 3519
             return $lockedElements[$type];
3520 3520
         } else {
@@ -3531,7 +3531,7 @@  discard block
 block discarded – undo
3531 3531
             $this->lockedElements = array();
3532 3532
             $this->cleanupExpiredLocks();
3533 3533
 
3534
-            $rs = $this->getDatabase()->select('sid,internalKey,elementType,elementId,lasthit,username', $this->getDatabase()->getFullTableName('active_user_locks') . " ul
3534
+            $rs = $this->getDatabase()->select('sid,internalKey,elementType,elementId,lasthit,username', $this->getDatabase()->getFullTableName('active_user_locks')." ul
3535 3535
                 LEFT JOIN {$this->getDatabase()->getFullTableName('manager_users')} mu on ul.internalKey = mu.id");
3536 3536
             while ($row = $this->getDatabase()->getRow($rs)) {
3537 3537
                 $this->lockedElements[$row['elementType']][$row['elementId']] = array(
@@ -3554,7 +3554,7 @@  discard block
 block discarded – undo
3554 3554
     public function cleanupExpiredLocks()
3555 3555
     {
3556 3556
         // Clean-up active_user_sessions first
3557
-        $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
3557
+        $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
3558 3558
         $validSessionTimeLimit = $this->time - $timeout;
3559 3559
         $this->getDatabase()->delete($this->getDatabase()->getFullTableName('active_user_sessions'), "lasthit < {$validSessionTimeLimit}");
3560 3560
 
@@ -3567,7 +3567,7 @@  discard block
 block discarded – undo
3567 3567
             foreach ($rs as $row) {
3568 3568
                 $userSids[] = $row['sid'];
3569 3569
             }
3570
-            $userSids = "'" . implode("','", $userSids) . "'";
3570
+            $userSids = "'".implode("','", $userSids)."'";
3571 3571
             $this->getDatabase()->delete($this->getDatabase()->getFullTableName('active_user_locks'), "sid NOT IN({$userSids})");
3572 3572
         } else {
3573 3573
             $this->getDatabase()->delete($this->getDatabase()->getFullTableName('active_user_locks'));
@@ -3651,8 +3651,8 @@  discard block
 block discarded – undo
3651 3651
     public function lockElement($type, $id)
3652 3652
     {
3653 3653
         $userId = $this->isBackend() && $_SESSION['mgrInternalKey'] ? $_SESSION['mgrInternalKey'] : 0;
3654
-        $type = (int)$type;
3655
-        $id = (int)$id;
3654
+        $type = (int) $type;
3655
+        $id = (int) $id;
3656 3656
         if (!$type || !$id || !$userId) {
3657 3657
             return false;
3658 3658
         }
@@ -3673,8 +3673,8 @@  discard block
 block discarded – undo
3673 3673
     public function unlockElement($type, $id, $includeAllUsers = false)
3674 3674
     {
3675 3675
         $userId = $this->isBackend() && $_SESSION['mgrInternalKey'] ? $_SESSION['mgrInternalKey'] : 0;
3676
-        $type = (int)$type;
3677
-        $id = (int)$id;
3676
+        $type = (int) $type;
3677
+        $id = (int) $id;
3678 3678
         if (!$type || !$id) {
3679 3679
             return false;
3680 3680
         }
@@ -3741,8 +3741,8 @@  discard block
 block discarded – undo
3741 3741
         }
3742 3742
 
3743 3743
         $usertype = $this->isFrontend() ? 1 : 0;
3744
-        $evtid = (int)$evtid;
3745
-        $type = (int)$type;
3744
+        $evtid = (int) $evtid;
3745
+        $type = (int) $type;
3746 3746
 
3747 3747
         // Types: 1 = information, 2 = warning, 3 = error
3748 3748
         if ($type < 1) {
@@ -3764,8 +3764,8 @@  discard block
 block discarded – undo
3764 3764
         if (isset($this->config['send_errormail']) && $this->config['send_errormail'] !== '0') {
3765 3765
             if ($this->config['send_errormail'] <= $type) {
3766 3766
                 $this->sendmail(array(
3767
-                    'subject' => 'MODX System Error on ' . $this->config['site_name'],
3768
-                    'body' => 'Source: ' . $source . ' - The details of the error could be seen in the MODX system events log.',
3767
+                    'subject' => 'MODX System Error on '.$this->config['site_name'],
3768
+                    'body' => 'Source: '.$source.' - The details of the error could be seen in the MODX system events log.',
3769 3769
                     'type' => 'text'
3770 3770
                 ));
3771 3771
             }
@@ -3814,7 +3814,7 @@  discard block
 block discarded – undo
3814 3814
             $p['fromname'] = $userinfo['username'];
3815 3815
         }
3816 3816
         if ($msg === '' && !isset($p['body'])) {
3817
-            $p['body'] = $_SERVER['REQUEST_URI'] . "\n" . $_SERVER['HTTP_USER_AGENT'] . "\n" . $_SERVER['HTTP_REFERER'];
3817
+            $p['body'] = $_SERVER['REQUEST_URI']."\n".$_SERVER['HTTP_USER_AGENT']."\n".$_SERVER['HTTP_REFERER'];
3818 3818
         } elseif (is_string($msg) && 0 < strlen($msg)) {
3819 3819
             $p['body'] = $msg;
3820 3820
         }
@@ -3855,8 +3855,8 @@  discard block
 block discarded – undo
3855 3855
             $files = array();
3856 3856
         }
3857 3857
         foreach ($files as $f) {
3858
-            if (file_exists(MODX_BASE_PATH . $f) && is_file(MODX_BASE_PATH . $f) && is_readable(MODX_BASE_PATH . $f)) {
3859
-                $this->getMail()->AddAttachment(MODX_BASE_PATH . $f);
3858
+            if (file_exists(MODX_BASE_PATH.$f) && is_file(MODX_BASE_PATH.$f) && is_readable(MODX_BASE_PATH.$f)) {
3859
+                $this->getMail()->AddAttachment(MODX_BASE_PATH.$f);
3860 3860
             }
3861 3861
         }
3862 3862
         return $this->getMail()->send();
@@ -3900,7 +3900,7 @@  discard block
 block discarded – undo
3900 3900
      */
3901 3901
     public function isFrontend()
3902 3902
     {
3903
-        return ! $this->isBackend();
3903
+        return !$this->isBackend();
3904 3904
     }
3905 3905
 
3906 3906
     /**
@@ -3925,14 +3925,14 @@  discard block
 block discarded – undo
3925 3925
         $tblsc = $this->getDatabase()->getFullTableName("site_content");
3926 3926
         $tbldg = $this->getDatabase()->getFullTableName("document_groups");
3927 3927
         // modify field names to use sc. table reference
3928
-        $fields = 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $fields))));
3929
-        $sort = 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $sort))));
3928
+        $fields = 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $fields))));
3929
+        $sort = 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $sort))));
3930 3930
         // get document groups for current user
3931 3931
         if ($docgrp = $this->getUserDocGroups()) {
3932 3932
             $docgrp = implode(",", $docgrp);
3933 3933
         }
3934 3934
         // build query
3935
-        $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0") . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)");
3935
+        $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='".$_SESSION['mgrRole']."' OR sc.privatemgr=0").(!$docgrp ? "" : " OR dg.document_group IN ($docgrp)");
3936 3936
         $result = $this->getDatabase()->select("DISTINCT {$fields}", "{$tblsc} sc
3937 3937
                 LEFT JOIN {$tbldg} dg on dg.document = sc.id", "sc.parent = '{$id}' AND ({$access}) GROUP BY sc.id", "{$sort} {$dir}");
3938 3938
         $resourceArray = $this->getDatabase()->makeArray($result);
@@ -3962,14 +3962,14 @@  discard block
 block discarded – undo
3962 3962
         $tbldg = $this->getDatabase()->getFullTableName("document_groups");
3963 3963
 
3964 3964
         // modify field names to use sc. table reference
3965
-        $fields = 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $fields))));
3966
-        $sort = 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $sort))));
3965
+        $fields = 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $fields))));
3966
+        $sort = 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $sort))));
3967 3967
         // get document groups for current user
3968 3968
         if ($docgrp = $this->getUserDocGroups()) {
3969 3969
             $docgrp = implode(",", $docgrp);
3970 3970
         }
3971 3971
         // build query
3972
-        $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0") . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)");
3972
+        $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='".$_SESSION['mgrRole']."' OR sc.privatemgr=0").(!$docgrp ? "" : " OR dg.document_group IN ($docgrp)");
3973 3973
         $result = $this->getDatabase()->select("DISTINCT {$fields}", "{$tblsc} sc
3974 3974
                 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}");
3975 3975
         $resourceArray = $this->getDatabase()->makeArray($result);
@@ -4004,16 +4004,16 @@  discard block
 block discarded – undo
4004 4004
             return $this->tmpCache[__FUNCTION__][$cacheKey];
4005 4005
         }
4006 4006
 
4007
-        $published = ($published !== 'all') ? 'AND sc.published = ' . $published : '';
4008
-        $deleted = ($deleted !== 'all') ? 'AND sc.deleted = ' . $deleted : '';
4007
+        $published = ($published !== 'all') ? 'AND sc.published = '.$published : '';
4008
+        $deleted = ($deleted !== 'all') ? 'AND sc.deleted = '.$deleted : '';
4009 4009
 
4010 4010
         if ($where != '') {
4011
-            $where = 'AND ' . $where;
4011
+            $where = 'AND '.$where;
4012 4012
         }
4013 4013
 
4014 4014
         // modify field names to use sc. table reference
4015
-        $fields = 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $fields))));
4016
-        $sort = ($sort == '') ? '' : 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $sort))));
4015
+        $fields = 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $fields))));
4016
+        $sort = ($sort == '') ? '' : 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $sort))));
4017 4017
 
4018 4018
         // get document groups for current user
4019 4019
         if ($docgrp = $this->getUserDocGroups()) {
@@ -4021,7 +4021,7 @@  discard block
 block discarded – undo
4021 4021
         }
4022 4022
 
4023 4023
         // build query
4024
-        $access = ($this->isFrontend() ? 'sc.privateweb=0' : '1="' . $_SESSION['mgrRole'] . '" OR sc.privatemgr=0') . (!$docgrp ? '' : ' OR dg.document_group IN (' . $docgrp . ')');
4024
+        $access = ($this->isFrontend() ? 'sc.privateweb=0' : '1="'.$_SESSION['mgrRole'].'" OR sc.privatemgr=0').(!$docgrp ? '' : ' OR dg.document_group IN ('.$docgrp.')');
4025 4025
 
4026 4026
         $tblsc = $this->getDatabase()->getFullTableName('site_content');
4027 4027
         $tbldg = $this->getDatabase()->getFullTableName('document_groups');
@@ -4073,10 +4073,10 @@  discard block
 block discarded – undo
4073 4073
             return false;
4074 4074
         } else {
4075 4075
             // modify field names to use sc. table reference
4076
-            $fields = 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $fields))));
4077
-            $sort = ($sort == '') ? '' : 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $sort))));
4076
+            $fields = 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $fields))));
4077
+            $sort = ($sort == '') ? '' : 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $sort))));
4078 4078
             if ($where != '') {
4079
-                $where = 'AND ' . $where;
4079
+                $where = 'AND '.$where;
4080 4080
             }
4081 4081
 
4082 4082
             $published = ($published !== 'all') ? "AND sc.published = '{$published}'" : '';
@@ -4087,13 +4087,13 @@  discard block
 block discarded – undo
4087 4087
                 $docgrp = implode(',', $docgrp);
4088 4088
             }
4089 4089
 
4090
-            $access = ($this->isFrontend() ? 'sc.privateweb=0' : '1="' . $_SESSION['mgrRole'] . '" OR sc.privatemgr=0') . (!$docgrp ? '' : ' OR dg.document_group IN (' . $docgrp . ')');
4090
+            $access = ($this->isFrontend() ? 'sc.privateweb=0' : '1="'.$_SESSION['mgrRole'].'" OR sc.privatemgr=0').(!$docgrp ? '' : ' OR dg.document_group IN ('.$docgrp.')');
4091 4091
 
4092 4092
             $tblsc = $this->getDatabase()->getFullTableName('site_content');
4093 4093
             $tbldg = $this->getDatabase()->getFullTableName('document_groups');
4094 4094
 
4095 4095
             $result = $this->getDatabase()->select("DISTINCT {$fields}", "{$tblsc} sc
4096
-                    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);
4096
+                    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);
4097 4097
 
4098 4098
             $resourceArray = $this->getDatabase()->makeArray($result);
4099 4099
 
@@ -4198,12 +4198,12 @@  discard block
 block discarded – undo
4198 4198
             $tbldg = $this->getDatabase()->getFullTableName("document_groups");
4199 4199
             $activeSql = $active == 1 ? "AND sc.published=1 AND sc.deleted=0" : "";
4200 4200
             // modify field names to use sc. table reference
4201
-            $fields = 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $fields))));
4201
+            $fields = 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $fields))));
4202 4202
             // get document groups for current user
4203 4203
             if ($docgrp = $this->getUserDocGroups()) {
4204 4204
                 $docgrp = implode(",", $docgrp);
4205 4205
             }
4206
-            $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0") . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)");
4206
+            $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='".$_SESSION['mgrRole']."' OR sc.privatemgr=0").(!$docgrp ? "" : " OR dg.document_group IN ($docgrp)");
4207 4207
             $result = $this->getDatabase()->select($fields, "{$tblsc} sc LEFT JOIN {$tbldg} dg on dg.document = sc.id", "(sc.id='{$pageid}' {$activeSql}) AND ({$access})", "", 1);
4208 4208
             $pageInfo = $this->getDatabase()->getRow($result);
4209 4209
 
@@ -4250,7 +4250,7 @@  discard block
 block discarded – undo
4250 4250
     {
4251 4251
         if ($this->currentSnippet) {
4252 4252
             $tbl = $this->getDatabase()->getFullTableName("site_snippets");
4253
-            $rs = $this->getDatabase()->select('id', $tbl, "name='" . $this->getDatabase()->escape($this->currentSnippet) . "'", '', 1);
4253
+            $rs = $this->getDatabase()->select('id', $tbl, "name='".$this->getDatabase()->escape($this->currentSnippet)."'", '', 1);
4254 4254
             if ($snippetId = $this->getDatabase()->getValue($rs)) {
4255 4255
                 return $snippetId;
4256 4256
             }
@@ -4277,7 +4277,7 @@  discard block
 block discarded – undo
4277 4277
      */
4278 4278
     public function clearCache($type = '', $report = false)
4279 4279
     {
4280
-        $cache_dir = MODX_BASE_PATH . $this->getCacheFolder();
4280
+        $cache_dir = MODX_BASE_PATH.$this->getCacheFolder();
4281 4281
         if (is_array($type)) {
4282 4282
             foreach ($type as $_) {
4283 4283
                 $this->clearCache($_, $report);
@@ -4289,10 +4289,10 @@  discard block
 block discarded – undo
4289 4289
             $sync->emptyCache();
4290 4290
         } elseif (preg_match('@^[1-9][0-9]*$@', $type)) {
4291 4291
             $key = ($this->config['cache_type'] == 2) ? $this->makePageCacheKey($type) : $type;
4292
-            $file_name = "docid_" . $key . "_*.pageCache.php";
4293
-            $cache_path = $cache_dir . $file_name;
4292
+            $file_name = "docid_".$key."_*.pageCache.php";
4293
+            $cache_path = $cache_dir.$file_name;
4294 4294
             $files = glob($cache_path);
4295
-            $files[] = $cache_dir . "docid_" . $key . ".pageCache.php";
4295
+            $files[] = $cache_dir."docid_".$key.".pageCache.php";
4296 4296
             foreach ($files as $file) {
4297 4297
                 if (!is_file($file)) {
4298 4298
                     continue;
@@ -4300,7 +4300,7 @@  discard block
 block discarded – undo
4300 4300
                 unlink($file);
4301 4301
             }
4302 4302
         } else {
4303
-            $files = glob($cache_dir . '*');
4303
+            $files = glob($cache_dir.'*');
4304 4304
             foreach ($files as $file) {
4305 4305
                 $name = basename($file);
4306 4306
                 if (strpos($name, '.pageCache.php') === false) {
@@ -4369,7 +4369,7 @@  discard block
 block discarded – undo
4369 4369
                         $f_url_suffix = '/';
4370 4370
                     }
4371 4371
 
4372
-                    $alPath = !empty ($al['path']) ? $al['path'] . '/' : '';
4372
+                    $alPath = !empty ($al['path']) ? $al['path'].'/' : '';
4373 4373
 
4374 4374
                     if ($al && $al['alias']) {
4375 4375
                         $alias = $al['alias'];
@@ -4377,7 +4377,7 @@  discard block
 block discarded – undo
4377 4377
 
4378 4378
                 }
4379 4379
 
4380
-                $alias = $alPath . $f_url_prefix . $alias . $f_url_suffix;
4380
+                $alias = $alPath.$f_url_prefix.$alias.$f_url_suffix;
4381 4381
                 $url = "{$alias}{$args}";
4382 4382
             } else {
4383 4383
                 $url = "index.php?id={$id}{$args}";
@@ -4396,7 +4396,7 @@  discard block
 block discarded – undo
4396 4396
             }
4397 4397
 
4398 4398
             //TODO: check to make sure that $site_url incudes the url :port (e.g. :8080)
4399
-            $host = $scheme == 'full' ? $this->config['site_url'] : $scheme . '://' . $_SERVER['HTTP_HOST'] . $host;
4399
+            $host = $scheme == 'full' ? $this->config['site_url'] : $scheme.'://'.$_SERVER['HTTP_HOST'].$host;
4400 4400
         }
4401 4401
 
4402 4402
         //fix strictUrl by Bumkaka
@@ -4405,9 +4405,9 @@  discard block
 block discarded – undo
4405 4405
         }
4406 4406
 
4407 4407
         if ($this->config['xhtml_urls']) {
4408
-            $url = preg_replace("/&(?!amp;)/", "&amp;", $host . $virtualDir . $url);
4408
+            $url = preg_replace("/&(?!amp;)/", "&amp;", $host.$virtualDir.$url);
4409 4409
         } else {
4410
-            $url = $host . $virtualDir . $url;
4410
+            $url = $host.$virtualDir.$url;
4411 4411
         }
4412 4412
 
4413 4413
         $evtOut = $this->invokeEvent('OnMakeDocUrl', array(
@@ -4431,21 +4431,21 @@  discard block
 block discarded – undo
4431 4431
         if (isset($this->aliasListing[$id])) {
4432 4432
             $out = $this->aliasListing[$id];
4433 4433
         } else {
4434
-            $q = $this->getDatabase()->query("SELECT id,alias,isfolder,parent FROM " . $this->getDatabase()->getFullTableName("site_content") . " WHERE id=" . (int)$id);
4434
+            $q = $this->getDatabase()->query("SELECT id,alias,isfolder,parent FROM ".$this->getDatabase()->getFullTableName("site_content")." WHERE id=".(int) $id);
4435 4435
             if ($this->getDatabase()->getRecordCount($q) == '1') {
4436 4436
                 $q = $this->getDatabase()->getRow($q);
4437 4437
                 $this->aliasListing[$id] = array(
4438
-                    'id' => (int)$q['id'],
4438
+                    'id' => (int) $q['id'],
4439 4439
                     'alias' => $q['alias'] == '' ? $q['id'] : $q['alias'],
4440
-                    'parent' => (int)$q['parent'],
4441
-                    'isfolder' => (int)$q['isfolder'],
4440
+                    'parent' => (int) $q['parent'],
4441
+                    'isfolder' => (int) $q['isfolder'],
4442 4442
                 );
4443 4443
                 if ($this->aliasListing[$id]['parent'] > 0) {
4444 4444
                     //fix alias_path_usage
4445 4445
                     if ($this->config['use_alias_path'] == '1') {
4446 4446
                         //&& $tmp['path'] != '' - fix error slash with epty path
4447 4447
                         $tmp = $this->getAliasListing($this->aliasListing[$id]['parent']);
4448
-                        $this->aliasListing[$id]['path'] = $tmp['path'] . ($tmp['alias_visible'] ? (($tmp['parent'] > 0 && $tmp['path'] != '') ? '/' : '') . $tmp['alias'] : '');
4448
+                        $this->aliasListing[$id]['path'] = $tmp['path'].($tmp['alias_visible'] ? (($tmp['parent'] > 0 && $tmp['path'] != '') ? '/' : '').$tmp['alias'] : '');
4449 4449
                     } else {
4450 4450
                         $this->aliasListing[$id]['path'] = '';
4451 4451
                     }
@@ -4483,7 +4483,7 @@  discard block
 block discarded – undo
4483 4483
         $out = array();
4484 4484
         if (empty($this->version) || !is_array($this->version)) {
4485 4485
             //include for compatibility modx version < 1.0.10
4486
-            include MODX_MANAGER_PATH . "includes/version.inc.php";
4486
+            include MODX_MANAGER_PATH."includes/version.inc.php";
4487 4487
             $this->version = array();
4488 4488
             $this->version['version'] = isset($modx_version) ? $modx_version : '';
4489 4489
             $this->version['branch'] = isset($modx_branch) ? $modx_branch : '';
@@ -4505,18 +4505,18 @@  discard block
 block discarded – undo
4505 4505
     {
4506 4506
         if (isset ($this->snippetCache[$snippetName])) {
4507 4507
             $snippet = $this->snippetCache[$snippetName];
4508
-            $properties = !empty($this->snippetCache[$snippetName . "Props"]) ? $this->snippetCache[$snippetName . "Props"] : '';
4508
+            $properties = !empty($this->snippetCache[$snippetName."Props"]) ? $this->snippetCache[$snippetName."Props"] : '';
4509 4509
         } else { // not in cache so let's check the db
4510
-            $sql = "SELECT ss.`name`, ss.`snippet`, ss.`properties`, sm.properties as `sharedproperties` FROM " . $this->getDatabase()->getFullTableName("site_snippets") . " as ss LEFT JOIN " . $this->getDatabase()->getFullTableName('site_modules') . " as sm on sm.guid=ss.moduleguid WHERE ss.`name`='" . $this->getDatabase()->escape($snippetName) . "'  AND ss.disabled=0;";
4510
+            $sql = "SELECT ss.`name`, ss.`snippet`, ss.`properties`, sm.properties as `sharedproperties` FROM ".$this->getDatabase()->getFullTableName("site_snippets")." as ss LEFT JOIN ".$this->getDatabase()->getFullTableName('site_modules')." as sm on sm.guid=ss.moduleguid WHERE ss.`name`='".$this->getDatabase()->escape($snippetName)."'  AND ss.disabled=0;";
4511 4511
             $result = $this->getDatabase()->query($sql);
4512 4512
             if ($this->getDatabase()->getRecordCount($result) == 1) {
4513 4513
                 $row = $this->getDatabase()->getRow($result);
4514 4514
                 $snippet = $this->snippetCache[$snippetName] = $row['snippet'];
4515 4515
                 $mergedProperties = array_merge($this->parseProperties($row['properties']), $this->parseProperties($row['sharedproperties']));
4516
-                $properties = $this->snippetCache[$snippetName . "Props"] = json_encode($mergedProperties);
4516
+                $properties = $this->snippetCache[$snippetName."Props"] = json_encode($mergedProperties);
4517 4517
             } else {
4518 4518
                 $snippet = $this->snippetCache[$snippetName] = "return false;";
4519
-                $properties = $this->snippetCache[$snippetName . "Props"] = '';
4519
+                $properties = $this->snippetCache[$snippetName."Props"] = '';
4520 4520
             }
4521 4521
         }
4522 4522
         // load default params/properties
@@ -4620,8 +4620,8 @@  discard block
 block discarded – undo
4620 4620
             }
4621 4621
             if (strpos($tpl, $s) !== false) {
4622 4622
                 $tpl = str_replace($s, $value, $tpl);
4623
-            } elseif($this->debug) {
4624
-                $this->addLog('parseText parse error', $_SERVER['REQUEST_URI'] . $s, 2);
4623
+            } elseif ($this->debug) {
4624
+                $this->addLog('parseText parse error', $_SERVER['REQUEST_URI'].$s, 2);
4625 4625
             }
4626 4626
         }
4627 4627
 
@@ -4671,7 +4671,7 @@  discard block
 block discarded – undo
4671 4671
             case 'CODE':
4672 4672
                 break;
4673 4673
             case 'FILE':
4674
-                $template = file_get_contents(MODX_BASE_PATH . $template);
4674
+                $template = file_get_contents(MODX_BASE_PATH.$template);
4675 4675
                 break;
4676 4676
             case 'CHUNK':
4677 4677
                 $template = $this->getChunk($template);
@@ -4704,7 +4704,7 @@  discard block
 block discarded – undo
4704 4704
         if ($mode !== 'formatOnly' && empty($timestamp)) {
4705 4705
             return '-';
4706 4706
         }
4707
-        $timestamp = (int)$timestamp;
4707
+        $timestamp = (int) $timestamp;
4708 4708
 
4709 4709
         switch ($this->config['datetime_format']) {
4710 4710
             case 'YYYY/mm/dd':
@@ -4724,7 +4724,7 @@  discard block
 block discarded – undo
4724 4724
         }
4725 4725
 
4726 4726
         if (empty($mode)) {
4727
-            $strTime = strftime($dateFormat . " %H:%M:%S", $timestamp);
4727
+            $strTime = strftime($dateFormat." %H:%M:%S", $timestamp);
4728 4728
         } elseif ($mode == 'dateOnly') {
4729 4729
             $strTime = strftime($dateFormat, $timestamp);
4730 4730
         } elseif ($mode == 'formatOnly') {
@@ -4778,7 +4778,7 @@  discard block
 block discarded – undo
4778 4778
             $S = 0;
4779 4779
         }
4780 4780
         $timeStamp = mktime($H, $M, $S, $m, $d, $Y);
4781
-        $timeStamp = (int)$timeStamp;
4781
+        $timeStamp = (int) $timeStamp;
4782 4782
         return $timeStamp;
4783 4783
     }
4784 4784
 
@@ -4820,7 +4820,7 @@  discard block
 block discarded – undo
4820 4820
                     if ($v === 'value') {
4821 4821
                         unset($_[$i]);
4822 4822
                     } else {
4823
-                        $_[$i] = 'tv.' . $v;
4823
+                        $_[$i] = 'tv.'.$v;
4824 4824
                     }
4825 4825
                 }
4826 4826
                 $fields = implode(',', $_);
@@ -4829,12 +4829,12 @@  discard block
 block discarded – undo
4829 4829
             }
4830 4830
 
4831 4831
             if ($tvsort != '') {
4832
-                $tvsort = 'tv.' . implode(',tv.', array_filter(array_map('trim', explode(',', $tvsort))));
4832
+                $tvsort = 'tv.'.implode(',tv.', array_filter(array_map('trim', explode(',', $tvsort))));
4833 4833
             }
4834 4834
             if ($tvidnames == "*") {
4835 4835
                 $query = "tv.id<>0";
4836 4836
             } else {
4837
-                $query = (is_numeric($tvidnames[0]) ? "tv.id" : "tv.name") . " IN ('" . implode("','", $tvidnames) . "')";
4837
+                $query = (is_numeric($tvidnames[0]) ? "tv.id" : "tv.name")." IN ('".implode("','", $tvidnames)."')";
4838 4838
             }
4839 4839
 
4840 4840
             $this->getUserDocGroups();
@@ -4846,10 +4846,10 @@  discard block
 block discarded – undo
4846 4846
                 $rs = $this->getDatabase()->select(
4847 4847
                     "{$fields}, IF(tvc.value!='',tvc.value,tv.default_text) as value ",
4848 4848
 
4849
-                    $this->getDatabase()->getFullTableName("site_tmplvars") .
4850
-                    " tv INNER JOIN " . $this->getDatabase()->getFullTableName("site_tmplvar_templates") .
4851
-                    " tvtpl ON tvtpl.tmplvarid = tv.id LEFT JOIN " .
4852
-                    $this->getDatabase()->getFullTableName("site_tmplvar_contentvalues") .
4849
+                    $this->getDatabase()->getFullTableName("site_tmplvars").
4850
+                    " tv INNER JOIN ".$this->getDatabase()->getFullTableName("site_tmplvar_templates").
4851
+                    " tvtpl ON tvtpl.tmplvarid = tv.id LEFT JOIN ".
4852
+                    $this->getDatabase()->getFullTableName("site_tmplvar_contentvalues").
4853 4853
                     " tvc ON tvc.tmplvarid=tv.id AND tvc.contentid='{$docid}'",
4854 4854
 
4855 4855
                     "{$query} AND tvtpl.templateid = '{$doc['template']}'",
@@ -4987,7 +4987,7 @@  discard block
 block discarded – undo
4987 4987
             return $this->tmpCache[__FUNCTION__][$cacheKey];
4988 4988
         }
4989 4989
 
4990
-        if (($idnames != '*' && !is_array($idnames)) || empty($idnames) ) {
4990
+        if (($idnames != '*' && !is_array($idnames)) || empty($idnames)) {
4991 4991
             return false;
4992 4992
         } else {
4993 4993
 
@@ -5005,23 +5005,23 @@  discard block
 block discarded – undo
5005 5005
             }
5006 5006
 
5007 5007
             // get user defined template variables
5008
-            $fields = ($fields == '') ? 'tv.*' : 'tv.' . implode(',tv.', array_filter(array_map('trim', explode(',', $fields))));
5009
-            $sort = ($sort == '') ? '' : 'tv.' . implode(',tv.', array_filter(array_map('trim', explode(',', $sort))));
5008
+            $fields = ($fields == '') ? 'tv.*' : 'tv.'.implode(',tv.', array_filter(array_map('trim', explode(',', $fields))));
5009
+            $sort = ($sort == '') ? '' : 'tv.'.implode(',tv.', array_filter(array_map('trim', explode(',', $sort))));
5010 5010
 
5011 5011
             if ($idnames == '*') {
5012 5012
                 $query = 'tv.id<>0';
5013 5013
             } else {
5014
-                $query = (is_numeric($idnames[0]) ? 'tv.id' : 'tv.name') . " IN ('" . implode("','", $idnames) . "')";
5014
+                $query = (is_numeric($idnames[0]) ? 'tv.id' : 'tv.name')." IN ('".implode("','", $idnames)."')";
5015 5015
             }
5016 5016
 
5017
-            $rs = $this->getDatabase()->select("{$fields}, IF(tvc.value != '', tvc.value, tv.default_text) as value", $this->getDatabase()->getFullTableName('site_tmplvars') . " tv
5018
-                    INNER JOIN " . $this->getDatabase()->getFullTableName('site_tmplvar_templates') . " tvtpl ON tvtpl.tmplvarid = tv.id
5019
-                    LEFT JOIN " . $this->getDatabase()->getFullTableName('site_tmplvar_contentvalues') . " tvc ON tvc.tmplvarid=tv.id AND tvc.contentid = '{$docid}'", "{$query} AND tvtpl.templateid = '{$docRow['template']}'", ($sort ? "{$sort} {$dir}" : ""));
5017
+            $rs = $this->getDatabase()->select("{$fields}, IF(tvc.value != '', tvc.value, tv.default_text) as value", $this->getDatabase()->getFullTableName('site_tmplvars')." tv
5018
+                    INNER JOIN " . $this->getDatabase()->getFullTableName('site_tmplvar_templates')." tvtpl ON tvtpl.tmplvarid = tv.id
5019
+                    LEFT JOIN " . $this->getDatabase()->getFullTableName('site_tmplvar_contentvalues')." tvc ON tvc.tmplvarid=tv.id AND tvc.contentid = '{$docid}'", "{$query} AND tvtpl.templateid = '{$docRow['template']}'", ($sort ? "{$sort} {$dir}" : ""));
5020 5020
 
5021 5021
             $result = $this->getDatabase()->makeArray($rs);
5022 5022
 
5023 5023
             // get default/built-in template variables
5024
-            if(is_array($docRow)){
5024
+            if (is_array($docRow)) {
5025 5025
                 ksort($docRow);
5026 5026
 
5027 5027
                 foreach ($docRow as $key => $value) {
@@ -5059,13 +5059,13 @@  discard block
 block discarded – undo
5059 5059
      */
5060 5060
     public function getTemplateVarOutput($idnames = array(), $docid = '', $published = 1, $sep = '')
5061 5061
     {
5062
-        if (is_array($idnames) && empty($idnames) ) {
5062
+        if (is_array($idnames) && empty($idnames)) {
5063 5063
             return false;
5064 5064
         } else {
5065 5065
             $output = array();
5066 5066
             $vars = ($idnames == '*' || is_array($idnames)) ? $idnames : array($idnames);
5067 5067
 
5068
-            $docid = (int)$docid > 0 ? (int)$docid : $this->documentIdentifier;
5068
+            $docid = (int) $docid > 0 ? (int) $docid : $this->documentIdentifier;
5069 5069
             // remove sort for speed
5070 5070
             $result = $this->getTemplateVars($vars, '*', $docid, $published, '', '');
5071 5071
 
@@ -5174,7 +5174,7 @@  discard block
 block discarded – undo
5174 5174
      */
5175 5175
     public function getCachePath()
5176 5176
     {
5177
-        return MODX_BASE_URL . $this->getCacheFolder();
5177
+        return MODX_BASE_URL.$this->getCacheFolder();
5178 5178
     }
5179 5179
 
5180 5180
     /**
@@ -5225,8 +5225,8 @@  discard block
 block discarded – undo
5225 5225
         $out = false;
5226 5226
 
5227 5227
         if (!empty($context)) {
5228
-            if (is_scalar($context) && isset($_SESSION[$context . 'Validated'])) {
5229
-                $out = $_SESSION[$context . 'InternalKey'];
5228
+            if (is_scalar($context) && isset($_SESSION[$context.'Validated'])) {
5229
+                $out = $_SESSION[$context.'InternalKey'];
5230 5230
             }
5231 5231
         } else {
5232 5232
             switch (true) {
@@ -5254,8 +5254,8 @@  discard block
 block discarded – undo
5254 5254
         $out = false;
5255 5255
 
5256 5256
         if (!empty($context)) {
5257
-            if (is_scalar($context) && isset($_SESSION[$context . 'Validated'])) {
5258
-                $out = $_SESSION[$context . 'Shortname'];
5257
+            if (is_scalar($context) && isset($_SESSION[$context.'Validated'])) {
5258
+                $out = $_SESSION[$context.'Shortname'];
5259 5259
             }
5260 5260
         } else {
5261 5261
             switch (true) {
@@ -5300,8 +5300,8 @@  discard block
 block discarded – undo
5300 5300
             return $this->tmpCache[__FUNCTION__][$uid];
5301 5301
         }
5302 5302
 
5303
-        $from = $this->getDatabase()->getFullTableName('manager_users') . ' mu INNER JOIN ' .
5304
-            $this->getDatabase()->getFullTableName('user_attributes'). ' mua ON mua.internalkey=mu.id';
5303
+        $from = $this->getDatabase()->getFullTableName('manager_users').' mu INNER JOIN '.
5304
+            $this->getDatabase()->getFullTableName('user_attributes').' mua ON mua.internalkey=mu.id';
5305 5305
         $where = sprintf("mu.id='%s'", $this->getDatabase()->escape($uid));
5306 5306
         $rs = $this->getDatabase()->select('mu.username, mu.password, mua.*', $from, $where, '', 1);
5307 5307
 
@@ -5327,8 +5327,8 @@  discard block
 block discarded – undo
5327 5327
      */
5328 5328
     public function getWebUserInfo($uid)
5329 5329
     {
5330
-        $rs = $this->getDatabase()->select('wu.username, wu.password, wua.*', $this->getDatabase()->getFullTableName("web_users") . " wu
5331
-                INNER JOIN " . $this->getDatabase()->getFullTableName("web_user_attributes") . " wua ON wua.internalkey=wu.id", "wu.id='{$uid}'");
5330
+        $rs = $this->getDatabase()->select('wu.username, wu.password, wua.*', $this->getDatabase()->getFullTableName("web_users")." wu
5331
+                INNER JOIN " . $this->getDatabase()->getFullTableName("web_user_attributes")." wua ON wua.internalkey=wu.id", "wu.id='{$uid}'");
5332 5332
         if ($row = $this->getDatabase()->getRow($rs)) {
5333 5333
             if (!isset($row['usertype']) or !$row["usertype"]) {
5334 5334
                 $row["usertype"] = "web";
@@ -5364,7 +5364,7 @@  discard block
 block discarded – undo
5364 5364
         } else if (is_array($dg)) {
5365 5365
             // resolve ids to names
5366 5366
             $dgn = array();
5367
-            $ds = $this->getDatabase()->select('name', $this->getDatabase()->getFullTableName("documentgroup_names"), "id IN (" . implode(",", $dg) . ")");
5367
+            $ds = $this->getDatabase()->select('name', $this->getDatabase()->getFullTableName("documentgroup_names"), "id IN (".implode(",", $dg).")");
5368 5368
             while ($row = $this->getDatabase()->getRow($ds)) {
5369 5369
                 $dgn[] = $row['name'];
5370 5370
             }
@@ -5392,7 +5392,7 @@  discard block
 block discarded – undo
5392 5392
         $rt = false;
5393 5393
         if ($_SESSION["webValidated"] == 1) {
5394 5394
             $tbl = $this->getDatabase()->getFullTableName("web_users");
5395
-            $ds = $this->getDatabase()->select('id, username, password', $tbl, "id='" . $this->getLoginUserID() . "'");
5395
+            $ds = $this->getDatabase()->select('id, username, password', $tbl, "id='".$this->getLoginUserID()."'");
5396 5396
             if ($row = $this->getDatabase()->getRow($ds)) {
5397 5397
                 if ($row["password"] == md5($oldPwd)) {
5398 5398
                     if (strlen($newPwd) < 6) {
@@ -5402,7 +5402,7 @@  discard block
 block discarded – undo
5402 5402
                     } else {
5403 5403
                         $this->getDatabase()->update(array(
5404 5404
                             'password' => $this->getDatabase()->escape($newPwd),
5405
-                        ), $tbl, "id='" . $this->getLoginUserID() . "'");
5405
+                        ), $tbl, "id='".$this->getLoginUserID()."'");
5406 5406
                         // invoke OnWebChangePassword event
5407 5407
                         $this->invokeEvent("OnWebChangePassword", array(
5408 5408
                             "userid" => $row["id"],
@@ -5433,8 +5433,8 @@  discard block
 block discarded – undo
5433 5433
         // check cache
5434 5434
         $grpNames = isset ($_SESSION['webUserGroupNames']) ? $_SESSION['webUserGroupNames'] : false;
5435 5435
         if (!is_array($grpNames)) {
5436
-            $rs = $this->getDatabase()->select('wgn.name', $this->getDatabase()->getFullTableName("webgroup_names") . " wgn
5437
-                    INNER JOIN " . $this->getDatabase()->getFullTableName("web_groups") . " wg ON wg.webgroup=wgn.id AND wg.webuser='" . $this->getLoginUserID() . "'");
5436
+            $rs = $this->getDatabase()->select('wgn.name', $this->getDatabase()->getFullTableName("webgroup_names")." wgn
5437
+                    INNER JOIN " . $this->getDatabase()->getFullTableName("web_groups")." wg ON wg.webgroup=wgn.id AND wg.webuser='".$this->getLoginUserID()."'");
5438 5438
             $grpNames = $this->getDatabase()->getColumn("name", $rs);
5439 5439
             // save to cache
5440 5440
             $_SESSION['webUserGroupNames'] = $grpNames;
@@ -5467,7 +5467,7 @@  discard block
 block discarded – undo
5467 5467
         if (strpos(strtolower($src), "<style") !== false || strpos(strtolower($src), "<link") !== false) {
5468 5468
             $this->sjscripts[$nextpos] = $src;
5469 5469
         } else {
5470
-            $this->sjscripts[$nextpos] = "\t" . '<link rel="stylesheet" type="text/css" href="' . $src . '" ' . ($media ? 'media="' . $media . '" ' : '') . '/>';
5470
+            $this->sjscripts[$nextpos] = "\t".'<link rel="stylesheet" type="text/css" href="'.$src.'" '.($media ? 'media="'.$media.'" ' : '').'/>';
5471 5471
         }
5472 5472
     }
5473 5473
 
@@ -5546,7 +5546,7 @@  discard block
 block discarded – undo
5546 5546
         }
5547 5547
 
5548 5548
         if ($useThisVer && $plaintext != true && (strpos(strtolower($src), "<script") === false)) {
5549
-            $src = "\t" . '<script type="text/javascript" src="' . $src . '"></script>';
5549
+            $src = "\t".'<script type="text/javascript" src="'.$src.'"></script>';
5550 5550
         }
5551 5551
         if ($startup) {
5552 5552
             $pos = isset($overwritepos) ? $overwritepos : max(array_merge(array(0), array_keys($this->sjscripts))) + 1;
@@ -5693,7 +5693,7 @@  discard block
 block discarded – undo
5693 5693
                 $eventtime = $this->getMicroTime() - $eventtime;
5694 5694
                 $this->pluginsCode .= sprintf('<fieldset><legend><b>%s / %s</b> (%2.2f ms)</legend>', $evtName, $pluginName, $eventtime * 1000);
5695 5695
                 foreach ($parameter as $k => $v) {
5696
-                    $this->pluginsCode .= "{$k} => " . print_r($v, true) . '<br>';
5696
+                    $this->pluginsCode .= "{$k} => ".print_r($v, true).'<br>';
5697 5697
                 }
5698 5698
                 $this->pluginsCode .= '</fieldset><br />';
5699 5699
                 $this->pluginsTime["{$evtName} / {$pluginName}"] += $eventtime;
@@ -5721,13 +5721,13 @@  discard block
 block discarded – undo
5721 5721
         $plugin = array();
5722 5722
         if (isset ($this->pluginCache[$pluginName])) {
5723 5723
             $pluginCode = $this->pluginCache[$pluginName];
5724
-            $pluginProperties = isset($this->pluginCache[$pluginName . "Props"]) ? $this->pluginCache[$pluginName . "Props"] : '';
5724
+            $pluginProperties = isset($this->pluginCache[$pluginName."Props"]) ? $this->pluginCache[$pluginName."Props"] : '';
5725 5725
         } else {
5726 5726
             $pluginName = $this->getDatabase()->escape($pluginName);
5727 5727
             $result = $this->getDatabase()->select('name, plugincode, properties', $this->getDatabase()->getFullTableName("site_plugins"), "name='{$pluginName}' AND disabled=0");
5728 5728
             if ($row = $this->getDatabase()->getRow($result)) {
5729 5729
                 $pluginCode = $this->pluginCache[$row['name']] = $row['plugincode'];
5730
-                $pluginProperties = $this->pluginCache[$row['name'] . "Props"] = $row['properties'];
5730
+                $pluginProperties = $this->pluginCache[$row['name']."Props"] = $row['properties'];
5731 5731
             } else {
5732 5732
                 $pluginCode = $this->pluginCache[$pluginName] = "return false;";
5733 5733
                 $pluginProperties = '';
@@ -5751,7 +5751,7 @@  discard block
 block discarded – undo
5751 5751
     {
5752 5752
         $property = array();
5753 5753
 
5754
-        if(\is_scalar($propertyString)) {
5754
+        if (\is_scalar($propertyString)) {
5755 5755
             $propertyString = trim($propertyString);
5756 5756
             $propertyString = str_replace('{}', '', $propertyString);
5757 5757
             $propertyString = str_replace('} {', ',', $propertyString);
@@ -5805,7 +5805,7 @@  discard block
 block discarded – undo
5805 5805
                 }
5806 5806
             }
5807 5807
         }
5808
-        elseif(\is_array($propertyString)) {
5808
+        elseif (\is_array($propertyString)) {
5809 5809
             $property = $propertyString;
5810 5810
         }
5811 5811
         if (!empty($elementName) && !empty($elementType)) {
@@ -5836,7 +5836,7 @@  discard block
 block discarded – undo
5836 5836
     public function parseDocBlockFromFile($element_dir, $filename, $escapeValues = false)
5837 5837
     {
5838 5838
         $params = array();
5839
-        $fullpath = $element_dir . '/' . $filename;
5839
+        $fullpath = $element_dir.'/'.$filename;
5840 5840
         if (is_readable($fullpath)) {
5841 5841
             $tpl = @fopen($fullpath, "r");
5842 5842
             if ($tpl) {
@@ -6003,8 +6003,8 @@  discard block
 block discarded – undo
6003 6003
         $ph = array('site_url' => MODX_SITE_URL);
6004 6004
         $regexUrl = "/((http|https|ftp|ftps)\:\/\/[^\/]+(\/[^\s]+[^,.?!:;\s])?)/";
6005 6005
         $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';
6006
-        $emailSubject = isset($parsed['name']) ? '?subject=' . $parsed['name'] : '';
6007
-        $emailSubject .= isset($parsed['version']) ? ' v' . $parsed['version'] : '';
6006
+        $emailSubject = isset($parsed['name']) ? '?subject='.$parsed['name'] : '';
6007
+        $emailSubject .= isset($parsed['version']) ? ' v'.$parsed['version'] : '';
6008 6008
         foreach ($parsed as $key => $val) {
6009 6009
             if (is_array($val)) {
6010 6010
                 foreach ($val as $key2 => $val2) {
@@ -6013,7 +6013,7 @@  discard block
 block discarded – undo
6013 6013
                         $val2 = preg_replace($regexUrl, "<a href=\"{$url[0]}\" target=\"_blank\">{$url[0]}</a> ", $val2);
6014 6014
                     }
6015 6015
                     if (preg_match($regexEmail, $val2, $url)) {
6016
-                        $val2 = preg_replace($regexEmail, '<a href="mailto:\\1' . $emailSubject . '">\\1</a>', $val2);
6016
+                        $val2 = preg_replace($regexEmail, '<a href="mailto:\\1'.$emailSubject.'">\\1</a>', $val2);
6017 6017
                     }
6018 6018
                     $parsed[$key][$key2] = $val2;
6019 6019
                 }
@@ -6023,7 +6023,7 @@  discard block
 block discarded – undo
6023 6023
                     $val = preg_replace($regexUrl, "<a href=\"{$url[0]}\" target=\"_blank\">{$url[0]}</a> ", $val);
6024 6024
                 }
6025 6025
                 if (preg_match($regexEmail, $val, $url)) {
6026
-                    $val = preg_replace($regexEmail, '<a href="mailto:\\1' . $emailSubject . '">\\1</a>', $val);
6026
+                    $val = preg_replace($regexEmail, '<a href="mailto:\\1'.$emailSubject.'">\\1</a>', $val);
6027 6027
                 }
6028 6028
                 $parsed[$key] = $val;
6029 6029
             }
@@ -6037,32 +6037,32 @@  discard block
 block discarded – undo
6037 6037
         );
6038 6038
 
6039 6039
         $nl = "\n";
6040
-        $list = isset($parsed['logo']) ? '<img src="' . $this->config['base_url'] . ltrim($parsed['logo'], "/") . '" style="float:right;max-width:100px;height:auto;" />' . $nl : '';
6041
-        $list .= '<p>' . $nl;
6042
-        $list .= isset($parsed['name']) ? '<strong>' . $parsed['name'] . '</strong><br/>' . $nl : '';
6043
-        $list .= isset($parsed['description']) ? $parsed['description'] . $nl : '';
6044
-        $list .= '</p><br/>' . $nl;
6045
-        $list .= isset($parsed['version']) ? '<p><strong>' . $_lang['version'] . ':</strong> ' . $parsed['version'] . '</p>' . $nl : '';
6046
-        $list .= isset($parsed['license']) ? '<p><strong>' . $_lang['license'] . ':</strong> ' . $parsed['license'] . '</p>' . $nl : '';
6047
-        $list .= isset($parsed['lastupdate']) ? '<p><strong>' . $_lang['last_update'] . ':</strong> ' . $parsed['lastupdate'] . '</p>' . $nl : '';
6048
-        $list .= '<br/>' . $nl;
6040
+        $list = isset($parsed['logo']) ? '<img src="'.$this->config['base_url'].ltrim($parsed['logo'], "/").'" style="float:right;max-width:100px;height:auto;" />'.$nl : '';
6041
+        $list .= '<p>'.$nl;
6042
+        $list .= isset($parsed['name']) ? '<strong>'.$parsed['name'].'</strong><br/>'.$nl : '';
6043
+        $list .= isset($parsed['description']) ? $parsed['description'].$nl : '';
6044
+        $list .= '</p><br/>'.$nl;
6045
+        $list .= isset($parsed['version']) ? '<p><strong>'.$_lang['version'].':</strong> '.$parsed['version'].'</p>'.$nl : '';
6046
+        $list .= isset($parsed['license']) ? '<p><strong>'.$_lang['license'].':</strong> '.$parsed['license'].'</p>'.$nl : '';
6047
+        $list .= isset($parsed['lastupdate']) ? '<p><strong>'.$_lang['last_update'].':</strong> '.$parsed['lastupdate'].'</p>'.$nl : '';
6048
+        $list .= '<br/>'.$nl;
6049 6049
         $first = true;
6050 6050
         foreach ($arrayParams as $param => $label) {
6051 6051
             if (isset($parsed[$param])) {
6052 6052
                 if ($first) {
6053
-                    $list .= '<p><strong>' . $_lang['references'] . '</strong></p>' . $nl;
6054
-                    $list .= '<ul class="docBlockList">' . $nl;
6053
+                    $list .= '<p><strong>'.$_lang['references'].'</strong></p>'.$nl;
6054
+                    $list .= '<ul class="docBlockList">'.$nl;
6055 6055
                     $first = false;
6056 6056
                 }
6057
-                $list .= '    <li><strong>' . $label . '</strong>' . $nl;
6058
-                $list .= '        <ul>' . $nl;
6057
+                $list .= '    <li><strong>'.$label.'</strong>'.$nl;
6058
+                $list .= '        <ul>'.$nl;
6059 6059
                 foreach ($parsed[$param] as $val) {
6060
-                    $list .= '            <li>' . $val . '</li>' . $nl;
6060
+                    $list .= '            <li>'.$val.'</li>'.$nl;
6061 6061
                 }
6062
-                $list .= '        </ul></li>' . $nl;
6062
+                $list .= '        </ul></li>'.$nl;
6063 6063
             }
6064 6064
         }
6065
-        $list .= !$first ? '</ul>' . $nl : '';
6065
+        $list .= !$first ? '</ul>'.$nl : '';
6066 6066
 
6067 6067
         return $list;
6068 6068
     }
@@ -6137,8 +6137,8 @@  discard block
 block discarded – undo
6137 6137
      */
6138 6138
     public function addSnippet($name, $phpCode, $namespace = '#', array $defaultParams = array())
6139 6139
     {
6140
-        $this->snippetCache[$namespace . $name] = $phpCode;
6141
-        $this->snippetCache[$namespace . $name . 'Props'] = $defaultParams;
6140
+        $this->snippetCache[$namespace.$name] = $phpCode;
6141
+        $this->snippetCache[$namespace.$name.'Props'] = $defaultParams;
6142 6142
     }
6143 6143
 
6144 6144
     /**
@@ -6146,7 +6146,7 @@  discard block
 block discarded – undo
6146 6146
      */
6147 6147
     public function addChunk($name, $text, $namespace = '#')
6148 6148
     {
6149
-        $this->chunkCache[$namespace . $name] = $text;
6149
+        $this->chunkCache[$namespace.$name] = $text;
6150 6150
     }
6151 6151
 
6152 6152
     /**
@@ -6156,7 +6156,7 @@  discard block
 block discarded – undo
6156 6156
     {
6157 6157
         $out = array();
6158 6158
 
6159
-        if (! is_dir($scanPath) || empty($ext)) {
6159
+        if (!is_dir($scanPath) || empty($ext)) {
6160 6160
             return $out;
6161 6161
         }
6162 6162
         $iterator = new \RecursiveIteratorIterator(
@@ -6168,22 +6168,22 @@  discard block
 block discarded – undo
6168 6168
              * @var \SplFileInfo $item
6169 6169
              */
6170 6170
             if ($item->isFile() && $item->isReadable() && \in_array($item->getExtension(), $ext)) {
6171
-                $name = $item->getBasename('.' . $item->getExtension());
6171
+                $name = $item->getBasename('.'.$item->getExtension());
6172 6172
                 $path = ltrim(str_replace(
6173 6173
                     array(rtrim($scanPath, '//'), '/'),
6174 6174
                     array('', '\\'),
6175
-                    $item->getPath() . '/'
6175
+                    $item->getPath().'/'
6176 6176
                 ), '\\');
6177 6177
 
6178 6178
                 if (!empty($path)) {
6179
-                    $name = $path . $name;
6179
+                    $name = $path.$name;
6180 6180
                 }
6181 6181
                 switch ($type) {
6182 6182
                     case 'chunk':
6183 6183
                         $out[$name] = file_get_contents($item->getRealPath());
6184 6184
                         break;
6185 6185
                     case 'snippet':
6186
-                        $out[$name] = "return require '" . $item->getRealPath() . "';";
6186
+                        $out[$name] = "return require '".$item->getRealPath()."';";
6187 6187
                         break;
6188 6188
                     default:
6189 6189
                         throw new \Exception;
@@ -6227,7 +6227,7 @@  discard block
 block discarded – undo
6227 6227
         }
6228 6228
 
6229 6229
         if (!$isSafe) {
6230
-            $msg = $phpcode . "\n" . $this->currentSnippet . "\n" . print_r($_SERVER, true);
6230
+            $msg = $phpcode."\n".$this->currentSnippet."\n".print_r($_SERVER, true);
6231 6231
             $title = sprintf('Unknown eval was executed (%s)', $this->getPhpCompat()->htmlspecialchars(substr(trim($phpcode), 0, 50)));
6232 6232
             $this->messageQuit($title, '', true, '', '', 'Parser', $msg);
6233 6233
             return;
@@ -6241,7 +6241,7 @@  discard block
 block discarded – undo
6241 6241
             return 'array()';
6242 6242
         }
6243 6243
 
6244
-        $output = $echo . $return;
6244
+        $output = $echo.$return;
6245 6245
         modx_sanitize_gpc($output);
6246 6246
         return $this->getPhpCompat()->htmlspecialchars($output); // Maybe, all html tags are dangerous
6247 6247
     }
@@ -6259,8 +6259,8 @@  discard block
 block discarded – undo
6259 6259
 
6260 6260
         $safe = explode(',', $safe_functions);
6261 6261
 
6262
-        $phpcode = rtrim($phpcode, ';') . ';';
6263
-        $tokens = token_get_all('<?php ' . $phpcode);
6262
+        $phpcode = rtrim($phpcode, ';').';';
6263
+        $tokens = token_get_all('<?php '.$phpcode);
6264 6264
         foreach ($tokens as $i => $token) {
6265 6265
             if (!is_array($token)) {
6266 6266
                 continue;
@@ -6296,7 +6296,7 @@  discard block
 block discarded – undo
6296 6296
     public function atBindFileContent($str = '')
6297 6297
     {
6298 6298
 
6299
-        $search_path = array('assets/tvs/', 'assets/chunks/', 'assets/templates/', $this->config['rb_base_url'] . 'files/', '');
6299
+        $search_path = array('assets/tvs/', 'assets/chunks/', 'assets/templates/', $this->config['rb_base_url'].'files/', '');
6300 6300
 
6301 6301
         if (stripos($str, '@FILE') !== 0) {
6302 6302
             return $str;
@@ -6319,7 +6319,7 @@  discard block
 block discarded – undo
6319 6319
         $errorMsg = sprintf("Could not retrieve string '%s'.", $str);
6320 6320
 
6321 6321
         foreach ($search_path as $path) {
6322
-            $file_path = MODX_BASE_PATH . $path . $str;
6322
+            $file_path = MODX_BASE_PATH.$path.$str;
6323 6323
             if (strpos($file_path, MODX_MANAGER_PATH) === 0) {
6324 6324
                 return $errorMsg;
6325 6325
             } elseif (is_file($file_path)) {
@@ -6333,7 +6333,7 @@  discard block
 block discarded – undo
6333 6333
             return $errorMsg;
6334 6334
         }
6335 6335
 
6336
-        $content = (string)file_get_contents($file_path);
6336
+        $content = (string) file_get_contents($file_path);
6337 6337
         if ($content === false) {
6338 6338
             return $errorMsg;
6339 6339
         }
@@ -6442,22 +6442,22 @@  discard block
 block discarded – undo
6442 6442
 
6443 6443
         $version = isset ($GLOBALS['modx_version']) ? $GLOBALS['modx_version'] : '';
6444 6444
         $release_date = isset ($GLOBALS['release_date']) ? $GLOBALS['release_date'] : '';
6445
-        $request_uri = "http://" . $_SERVER['HTTP_HOST'] . ($_SERVER["SERVER_PORT"] == 80 ? "" : (":" . $_SERVER["SERVER_PORT"])) . $_SERVER['REQUEST_URI'];
6445
+        $request_uri = "http://".$_SERVER['HTTP_HOST'].($_SERVER["SERVER_PORT"] == 80 ? "" : (":".$_SERVER["SERVER_PORT"])).$_SERVER['REQUEST_URI'];
6446 6446
         $request_uri = $this->getPhpCompat()->htmlspecialchars($request_uri, ENT_QUOTES, $this->config['modx_charset']);
6447 6447
         $ua = $this->getPhpCompat()->htmlspecialchars($_SERVER['HTTP_USER_AGENT'], ENT_QUOTES, $this->config['modx_charset']);
6448 6448
         $referer = $this->getPhpCompat()->htmlspecialchars($_SERVER['HTTP_REFERER'], ENT_QUOTES, $this->config['modx_charset']);
6449 6449
         if ($is_error) {
6450 6450
             $str = '<h2 style="color:red">&laquo; Evo Parse Error &raquo;</h2>';
6451 6451
             if ($msg != 'PHP Parse Error') {
6452
-                $str .= '<h3 style="color:red">' . $msg . '</h3>';
6452
+                $str .= '<h3 style="color:red">'.$msg.'</h3>';
6453 6453
             }
6454 6454
         } else {
6455 6455
             $str = '<h2 style="color:#003399">&laquo; Evo Debug/ stop message &raquo;</h2>';
6456
-            $str .= '<h3 style="color:#003399">' . $msg . '</h3>';
6456
+            $str .= '<h3 style="color:#003399">'.$msg.'</h3>';
6457 6457
         }
6458 6458
 
6459 6459
         if (!empty ($query)) {
6460
-            $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>';
6460
+            $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>';
6461 6461
         }
6462 6462
 
6463 6463
         $errortype = array(
@@ -6480,13 +6480,13 @@  discard block
 block discarded – undo
6480 6480
 
6481 6481
         if (!empty($nr) || !empty($file)) {
6482 6482
             if ($text != '') {
6483
-                $str .= '<div style="font-weight:bold;border:1px solid #ccc;padding:8px;color:#333;background-color:#ffffcd;margin-bottom:15px;">Error : ' . $text . '</div>';
6483
+                $str .= '<div style="font-weight:bold;border:1px solid #ccc;padding:8px;color:#333;background-color:#ffffcd;margin-bottom:15px;">Error : '.$text.'</div>';
6484 6484
             }
6485 6485
             if ($output != '') {
6486
-                $str .= '<div style="font-weight:bold;border:1px solid #ccc;padding:8px;color:#333;background-color:#ffffcd;margin-bottom:15px;">' . $output . '</div>';
6486
+                $str .= '<div style="font-weight:bold;border:1px solid #ccc;padding:8px;color:#333;background-color:#ffffcd;margin-bottom:15px;">'.$output.'</div>';
6487 6487
             }
6488 6488
             if ($nr !== '') {
6489
-                $table[] = array('ErrorType[num]', $errortype [$nr] . "[" . $nr . "]");
6489
+                $table[] = array('ErrorType[num]', $errortype [$nr]."[".$nr."]");
6490 6490
             }
6491 6491
             if ($file) {
6492 6492
                 $table[] = array('File', $file);
@@ -6506,7 +6506,7 @@  discard block
 block discarded – undo
6506 6506
         }
6507 6507
 
6508 6508
         if (!empty($this->event->activePlugin)) {
6509
-            $table[] = array('Current Plugin', $this->event->activePlugin . '(' . $this->event->name . ')');
6509
+            $table[] = array('Current Plugin', $this->event->activePlugin.'('.$this->event->name.')');
6510 6510
         }
6511 6511
 
6512 6512
         $str .= $MakeTable->create($table, array('Error information', ''));
@@ -6516,17 +6516,17 @@  discard block
 block discarded – undo
6516 6516
         $table[] = array('REQUEST_URI', $request_uri);
6517 6517
 
6518 6518
         if ($this->getManagerApi()->action) {
6519
-            include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php');
6519
+            include_once(MODX_MANAGER_PATH.'includes/actionlist.inc.php');
6520 6520
             global $action_list;
6521 6521
             $actionName = (isset($action_list[$this->getManagerApi()->action])) ? " - {$action_list[$this->getManagerApi()->action]}" : '';
6522 6522
 
6523
-            $table[] = array('Manager action', $this->getManagerApi()->action . $actionName);
6523
+            $table[] = array('Manager action', $this->getManagerApi()->action.$actionName);
6524 6524
         }
6525 6525
 
6526 6526
         if (preg_match('@^[0-9]+@', $this->documentIdentifier)) {
6527 6527
             $resource = $this->getDocumentObject('id', $this->documentIdentifier);
6528 6528
             $url = $this->makeUrl($this->documentIdentifier, '', '', 'full');
6529
-            $table[] = array('Resource', '[' . $this->documentIdentifier . '] <a href="' . $url . '" target="_blank">' . $resource['pagetitle'] . '</a>');
6529
+            $table[] = array('Resource', '['.$this->documentIdentifier.'] <a href="'.$url.'" target="_blank">'.$resource['pagetitle'].'</a>');
6530 6530
         }
6531 6531
         $table[] = array('Referer', $referer);
6532 6532
         $table[] = array('User Agent', $ua);
@@ -6547,7 +6547,7 @@  discard block
 block discarded – undo
6547 6547
 
6548 6548
         $mem = memory_get_peak_usage(true);
6549 6549
         $total_mem = $mem - $this->mstart;
6550
-        $total_mem = ($total_mem / 1024 / 1024) . ' mb';
6550
+        $total_mem = ($total_mem / 1024 / 1024).' mb';
6551 6551
 
6552 6552
         $queryTime = $this->queryTime;
6553 6553
         $phpTime = $totalTime - $queryTime;
@@ -6568,18 +6568,18 @@  discard block
 block discarded – undo
6568 6568
         $str .= $this->get_backtrace(debug_backtrace());
6569 6569
         // Log error
6570 6570
         if (!empty($this->currentSnippet)) {
6571
-            $source = 'Snippet - ' . $this->currentSnippet;
6571
+            $source = 'Snippet - '.$this->currentSnippet;
6572 6572
         } elseif (!empty($this->event->activePlugin)) {
6573
-            $source = 'Plugin - ' . $this->event->activePlugin;
6573
+            $source = 'Plugin - '.$this->event->activePlugin;
6574 6574
         } elseif ($source !== '') {
6575
-            $source = 'Parser - ' . $source;
6575
+            $source = 'Parser - '.$source;
6576 6576
         } elseif ($query !== '') {
6577 6577
             $source = 'SQL Query';
6578 6578
         } else {
6579 6579
             $source = 'Parser';
6580 6580
         }
6581 6581
         if ($msg) {
6582
-            $source .= ' / ' . $msg;
6582
+            $source .= ' / '.$msg;
6583 6583
         }
6584 6584
         if (isset($actionName) && !empty($actionName)) {
6585 6585
             $source .= $actionName;
@@ -6612,12 +6612,12 @@  discard block
 block discarded – undo
6612 6612
         ob_get_clean();
6613 6613
         // Display error
6614 6614
         if (isset($_SESSION['mgrValidated'])) {
6615
-            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>
6615
+            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>
6616 6616
                  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6617
-                 <link rel="stylesheet" type="text/css" href="' . $this->config['site_manager_url'] . 'media/style/' . $this->config['manager_theme'] . '/style.css" />
6617
+                 <link rel="stylesheet" type="text/css" href="' . $this->config['site_manager_url'].'media/style/'.$this->config['manager_theme'].'/style.css" />
6618 6618
                  <style type="text/css">body { padding:10px; } td {font:inherit;}</style>
6619 6619
                  </head><body>
6620
-                 ' . $str . '</body></html>';
6620
+                 ' . $str.'</body></html>';
6621 6621
 
6622 6622
         } else {
6623 6623
             echo 'Error';
@@ -6652,7 +6652,7 @@  discard block
 block discarded – undo
6652 6652
             switch (get_by_key($val, 'type')) {
6653 6653
                 case '->':
6654 6654
                 case '::':
6655
-                    $functionName = $val['function'] = $val['class'] . $val['type'] . $val['function'];
6655
+                    $functionName = $val['function'] = $val['class'].$val['type'].$val['function'];
6656 6656
                     break;
6657 6657
                 default:
6658 6658
                     $functionName = $val['function'];
@@ -6662,7 +6662,7 @@  discard block
 block discarded – undo
6662 6662
             $args = array_pad(array(), $_, '$var');
6663 6663
             $args = implode(", ", $args);
6664 6664
             $modx = &$this;
6665
-            $args = preg_replace_callback('/\$var/', function () use ($modx, &$tmp, $val) {
6665
+            $args = preg_replace_callback('/\$var/', function() use ($modx, &$tmp, $val) {
6666 6666
                 $arg = $val['args'][$tmp - 1];
6667 6667
                 switch (true) {
6668 6668
                     case is_null($arg): {
@@ -6674,7 +6674,7 @@  discard block
 block discarded – undo
6674 6674
                         break;
6675 6675
                     }
6676 6676
                     case is_scalar($arg): {
6677
-                        $out = strlen($arg) > 20 ? 'string $var' . $tmp : ("'" . $this->getPhpCompat()->htmlspecialchars(str_replace("'", "\\'", $arg)) . "'");
6677
+                        $out = strlen($arg) > 20 ? 'string $var'.$tmp : ("'".$this->getPhpCompat()->htmlspecialchars(str_replace("'", "\\'", $arg))."'");
6678 6678
                         break;
6679 6679
                     }
6680 6680
                     case is_bool($arg): {
@@ -6682,23 +6682,23 @@  discard block
 block discarded – undo
6682 6682
                         break;
6683 6683
                     }
6684 6684
                     case is_array($arg): {
6685
-                        $out = 'array $var' . $tmp;
6685
+                        $out = 'array $var'.$tmp;
6686 6686
                         break;
6687 6687
                     }
6688 6688
                     case is_object($arg): {
6689
-                        $out = get_class($arg) . ' $var' . $tmp;
6689
+                        $out = get_class($arg).' $var'.$tmp;
6690 6690
                         break;
6691 6691
                     }
6692 6692
                     default: {
6693
-                        $out = '$var' . $tmp;
6693
+                        $out = '$var'.$tmp;
6694 6694
                     }
6695 6695
                 }
6696 6696
                 $tmp++;
6697 6697
                 return $out;
6698 6698
             }, $args);
6699 6699
             $line = array(
6700
-                "<strong>" . $functionName . "</strong>(" . $args . ")",
6701
-                $path . " on line " . $val['line']
6700
+                "<strong>".$functionName."</strong>(".$args.")",
6701
+                $path." on line ".$val['line']
6702 6702
             );
6703 6703
             $table[] = array(implode("<br />", $line));
6704 6704
         }
@@ -6739,7 +6739,7 @@  discard block
 block discarded – undo
6739 6739
             $alias = strip_tags($alias); // strip HTML
6740 6740
             $alias = preg_replace('/[^\.A-Za-z0-9 _-]/', '', $alias); // strip non-alphanumeric characters
6741 6741
             $alias = preg_replace('/\s+/', '-', $alias); // convert white-space to dash
6742
-            $alias = preg_replace('/-+/', '-', $alias);  // convert multiple dashes to one
6742
+            $alias = preg_replace('/-+/', '-', $alias); // convert multiple dashes to one
6743 6743
             $alias = trim($alias, '-'); // trim excess
6744 6744
             return $alias;
6745 6745
         }
@@ -6755,7 +6755,7 @@  discard block
 block discarded – undo
6755 6755
         $precisions = count($sizes) - 1;
6756 6756
         foreach ($sizes as $unit => $bytes) {
6757 6757
             if ($size >= $bytes) {
6758
-                return number_format($size / $bytes, $precisions) . ' ' . $unit;
6758
+                return number_format($size / $bytes, $precisions).' '.$unit;
6759 6759
             }
6760 6760
             $precisions--;
6761 6761
         }
@@ -6859,10 +6859,10 @@  discard block
 block discarded – undo
6859 6859
 
6860 6860
         if (strpos($str, MODX_MANAGER_PATH) === 0) {
6861 6861
             return false;
6862
-        } elseif (is_file(MODX_BASE_PATH . $str)) {
6863
-            $file_path = MODX_BASE_PATH . $str;
6864
-        } elseif (is_file(MODX_BASE_PATH . "{$tpl_dir}{$str}")) {
6865
-            $file_path = MODX_BASE_PATH . $tpl_dir . $str;
6862
+        } elseif (is_file(MODX_BASE_PATH.$str)) {
6863
+            $file_path = MODX_BASE_PATH.$str;
6864
+        } elseif (is_file(MODX_BASE_PATH."{$tpl_dir}{$str}")) {
6865
+            $file_path = MODX_BASE_PATH.$tpl_dir.$str;
6866 6866
         } else {
6867 6867
             return false;
6868 6868
         }
@@ -6986,7 +6986,7 @@  discard block
 block discarded – undo
6986 6986
             $title = 'no title';
6987 6987
         }
6988 6988
         if (is_array($msg)) {
6989
-            $msg = '<pre>' . print_r($msg, true) . '</pre>';
6989
+            $msg = '<pre>'.print_r($msg, true).'</pre>';
6990 6990
         } elseif ($msg === '') {
6991 6991
             $msg = $_SERVER['REQUEST_URI'];
6992 6992
         }
Please login to merge, or discard this patch.
manager/includes/src/Legacy/PhpCompat.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
      * @param int $flags
11 11
      * @param string $encode
12 12
      * @param int $safecount
13
-     * @return string|array
13
+     * @return null|string
14 14
      */
15 15
     public function htmlspecialchars($str = '', $flags = ENT_COMPAT, $encode = '', $safecount = 0)
16 16
     {
Please login to merge, or discard this patch.
manager/includes/src/Mail.php 2 patches
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php namespace EvolutionCMS;
2 2
 
3
-use PHPMailer\PHPMailer\PHPMailer;
4 3
 use PHPMailer\PHPMailer\Exception as PHPMailerException;
4
+use PHPMailer\PHPMailer\PHPMailer;
5 5
 
6 6
 class Mail extends PHPMailer
7 7
 {
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
     {
30 30
         $modx = evolutionCMS();
31 31
         $this->modx = $modx;
32
-        $this->PluginDir = MODX_MANAGER_PATH . 'includes/controls/phpmailer/';
32
+        $this->PluginDir = MODX_MANAGER_PATH.'includes/controls/phpmailer/';
33 33
 
34 34
         switch ($modx->config['email_method']) {
35 35
             case 'smtp':
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
             mb_language($this->mb_language);
96 96
             mb_internal_encoding($modx->config['modx_charset']);
97 97
         }
98
-        $exconf = MODX_MANAGER_PATH . 'includes/controls/phpmailer/config.inc.php';
98
+        $exconf = MODX_MANAGER_PATH.'includes/controls/phpmailer/config.inc.php';
99 99
         if (is_file($exconf)) {
100 100
             include($exconf);
101 101
         }
@@ -163,12 +163,12 @@  discard block
 block discarded – undo
163 163
         }
164 164
 
165 165
         if ($this->modx->debug) {
166
-            $debug_info = 'CharSet = ' . $this->CharSet . "\n";
167
-            $debug_info .= 'Encoding = ' . $this->Encoding . "\n";
168
-            $debug_info .= 'mb_language = ' . $this->mb_language . "\n";
169
-            $debug_info .= 'encode_header_method = ' . $this->encode_header_method . "\n";
166
+            $debug_info = 'CharSet = '.$this->CharSet."\n";
167
+            $debug_info .= 'Encoding = '.$this->Encoding."\n";
168
+            $debug_info .= 'mb_language = '.$this->mb_language."\n";
169
+            $debug_info .= 'encode_header_method = '.$this->encode_header_method."\n";
170 170
             $debug_info .= "send_mode = {$mode}\n";
171
-            $debug_info .= 'Subject = ' . $this->Subject . "\n";
171
+            $debug_info .= 'Subject = '.$this->Subject."\n";
172 172
             $log = "<pre>{$debug_info}\n{$header}\n{$org_body}</pre>";
173 173
             $this->modx->logEvent(1, 1, $log, 'MODxMailer debug information');
174 174
 
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
             ini_set('sendmail_from', $old_from);
235 235
         }
236 236
         if (!$rt) {
237
-            $msg = $this->Lang('instantiate') . "<br />\n";
237
+            $msg = $this->Lang('instantiate')."<br />\n";
238 238
             $msg .= "{$this->Subject}<br />\n";
239 239
             $msg .= "{$this->FromName}&lt;{$this->From}&gt;<br />\n";
240 240
             $msg .= mb_convert_encoding($body, $this->modx->config['modx_charset'], $this->CharSet);
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
         $classDump = call_user_func('get_object_vars', $this);
257 257
         unset($classDump['modx']);
258 258
         $this->modx->config['send_errormail'] = '0';
259
-        $this->modx->logEvent(0, 3, $msg . '<pre>' . print_r($classDump, true) . '</pre>', 'phpmailer');
259
+        $this->modx->logEvent(0, 3, $msg.'<pre>'.print_r($classDump, true).'</pre>', 'phpmailer');
260 260
 
261 261
         return parent::SetError($msg);
262 262
     }
Please login to merge, or discard this patch.
manager/includes/src/Support/DataSetPager.php 4 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -33,6 +33,9 @@  discard block
 block discarded – undo
33 33
     public $renderPagerFncArgs;
34 34
     public static $dataSetPagerCnt;
35 35
 
36
+    /**
37
+     * @param boolean|string $id
38
+     */
36 39
     public function __construct($id, $ds, $pageSize = 10, $pageNumber = -1) {
37 40
 		global $_PAGE; // use view state object
38 41
 
@@ -77,6 +80,9 @@  discard block
 block discarded – undo
77 80
 		$this->pageSize = $ps;
78 81
 	}
79 82
 
83
+    /**
84
+     * @param DataGrid $fncName
85
+     */
80 86
     public function setRenderRowFnc($fncName, $args = "") {
81 87
 		$this->renderRowFnc = &$fncName;
82 88
 		$this->renderRowFncArgs = $args;    // extra agruments
Please login to merge, or discard this patch.
Indentation   +147 added lines, -147 removed lines patch added patch discarded remove patch
@@ -13,18 +13,18 @@  discard block
 block discarded – undo
13 13
 
14 14
 class DataSetPager implements DataSetPagerInterface{
15 15
 
16
-	public $ds; // datasource
16
+    public $ds; // datasource
17 17
     public $pageSize;
18 18
     public $pageNumber;
19 19
     public $rows;
20 20
     public $pager;
21 21
     public $id;
22 22
 
23
-	// normal page
23
+    // normal page
24 24
     public $pageStyle;
25 25
     public $pageClass;
26 26
 
27
-	// selected page
27
+    // selected page
28 28
     public $selPageStyle;
29 29
     public $selPageClass;
30 30
     public $renderRowFnc;
@@ -34,164 +34,164 @@  discard block
 block discarded – undo
34 34
     public static $dataSetPagerCnt;
35 35
 
36 36
     public function __construct($id, $ds, $pageSize = 10, $pageNumber = -1) {
37
-		global $_PAGE; // use view state object
38
-
39
-		// set id
40
-		self::$dataSetPagerCnt++;
41
-		$this->id = !empty($id) ? $id : "dsp" . self::$dataSetPagerCnt;
42
-
43
-		// get pagenumber
44
-		// by setting pager to -1 cause pager to load it's last page number
45
-		if($pageNumber == -1) {
46
-			$pageNumber = 1;
47
-			if(isset($_GET["dpgn" . $this->id])) {
48
-				$pageNumber = $_GET["dpgn" . $this->id];
49
-			} elseif(isset($_PAGE['vs'][$id . '_dpgn'])) {
50
-				$pageNumber = $_PAGE['vs'][$id . '_dpgn'];
51
-			}
52
-		}
53
-		if(!is_numeric($pageNumber)) {
54
-			$pageNumber = 1;
55
-		}
56
-
57
-		$this->ds = $ds; // datasource
58
-		$this->pageSize = $pageSize;
59
-		$this->pageNumber = $pageNumber;
60
-		$this->rows = '';
61
-		$this->pager = '';
62
-	}
37
+        global $_PAGE; // use view state object
38
+
39
+        // set id
40
+        self::$dataSetPagerCnt++;
41
+        $this->id = !empty($id) ? $id : "dsp" . self::$dataSetPagerCnt;
42
+
43
+        // get pagenumber
44
+        // by setting pager to -1 cause pager to load it's last page number
45
+        if($pageNumber == -1) {
46
+            $pageNumber = 1;
47
+            if(isset($_GET["dpgn" . $this->id])) {
48
+                $pageNumber = $_GET["dpgn" . $this->id];
49
+            } elseif(isset($_PAGE['vs'][$id . '_dpgn'])) {
50
+                $pageNumber = $_PAGE['vs'][$id . '_dpgn'];
51
+            }
52
+        }
53
+        if(!is_numeric($pageNumber)) {
54
+            $pageNumber = 1;
55
+        }
56
+
57
+        $this->ds = $ds; // datasource
58
+        $this->pageSize = $pageSize;
59
+        $this->pageNumber = $pageNumber;
60
+        $this->rows = '';
61
+        $this->pager = '';
62
+    }
63 63
 
64 64
     public function getRenderedPager() {
65
-		return $this->pager;
66
-	}
65
+        return $this->pager;
66
+    }
67 67
 
68 68
     public function getRenderedRows() {
69
-		return $this->rows;
70
-	}
69
+        return $this->rows;
70
+    }
71 71
 
72 72
     public function setDataSource($ds) {
73
-		$this->ds = $ds;
74
-	}
73
+        $this->ds = $ds;
74
+    }
75 75
 
76 76
     public function setPageSize($ps) {
77
-		$this->pageSize = $ps;
78
-	}
77
+        $this->pageSize = $ps;
78
+    }
79 79
 
80 80
     public function setRenderRowFnc($fncName, $args = "") {
81
-		$this->renderRowFnc = &$fncName;
82
-		$this->renderRowFncArgs = $args;    // extra agruments
81
+        $this->renderRowFnc = &$fncName;
82
+        $this->renderRowFncArgs = $args;    // extra agruments
83 83
 
84 84
 
85
-	}
85
+    }
86 86
 
87 87
     public function setRenderPagerFnc($fncName, $args = "") {
88
-		$this->renderPagerFnc = $fncName;
89
-		$this->renderPagerFncArgs = $args;    // extra agruments
90
-	}
88
+        $this->renderPagerFnc = $fncName;
89
+        $this->renderPagerFncArgs = $args;    // extra agruments
90
+    }
91 91
 
92 92
     public function render() {
93
-		$modx = evolutionCMS(); global $_PAGE;
94
-
95
-		$isDataset = $modx->getDatabase()->isResult($this->ds);
96
-
97
-		if(!$this->selPageStyle) {
98
-			$this->selPageStyle = "font-weight:bold";
99
-		}
100
-
101
-		// get total number of rows
102
-		$tnr = ($isDataset) ? $modx->getDatabase()->getRecordCount($this->ds) : count($this->ds);
103
-
104
-		// render: no records found
105
-		if($tnr <= 0) {
106
-			$fnc = $this->renderRowFnc;
107
-			$args = $this->renderRowFncArgs;
108
-			if(isset($fnc)) {
109
-				if($args != "") {
110
-					$this->rows .= $fnc(0, null, $args);
111
-				} // if agrs was specified then we will pass three params
112
-				else {
113
-					$this->rows .= $fnc(0, null);
114
-				}                 // otherwise two will be passed
115
-			}
116
-			return;
117
-		}
118
-
119
-		// get total pages
120
-		$tp = ceil($tnr / $this->pageSize);
121
-		if($this->pageNumber > $tp) {
122
-			$this->pageNumber = 1;
123
-		}
124
-
125
-		// get page number
126
-		$p = $this->pageNumber;
127
-
128
-		// save page number to view state if available
129
-		if(isset($_PAGE['vs'])) {
130
-			$_PAGE['vs'][$this->id . '_dpgn'] = $p;
131
-		}
132
-
133
-		// render pager : renderPagerFnc($cuurentPage,$pagerNumber,$arguments="");
134
-		if($tp > 1) {
135
-		    $url = '';
136
-			$fnc = $this->renderPagerFnc;
137
-			$args = $this->renderPagerFncArgs;
138
-			if(!isset($fnc)) {
139
-				if($modx->isFrontend()) {
140
-					$url = $modx->makeUrl($modx->documentIdentifier, '', '', 'full') . '?';
141
-				} else {
142
-					$url = $_SERVER['PHP_SELF'] . '?';
143
-				}
144
-				$i = 0;
145
-				foreach($_GET as $n => $v) if($n != 'dpgn' . $this->id) {
146
-					$i++;
147
-					$url .= (($i > 1) ? "&" : "") . "$n=$v";
148
-				}
149
-				if($i >= 1) {
150
-					$url .= "&";
151
-				}
152
-			}
153
-			for($i = 1; $i <= $tp; $i++) {
154
-				if(isset($fnc)) {
155
-					if($args != "") {
156
-						$this->pager .= $fnc($p, $i, $args);
157
-					} else {
158
-						$this->pager .= $fnc($p, $i);
159
-					}
160
-				} else {
161
-					$this->pager .= ($p == $i) ? " <span class='" . $this->selPageClass . "' style='" . $this->selPageStyle . "'>$i</span> " : " <a href='" . $url . "dpgn" . $this->id . "=$i' class='" . $this->pageClass . "' style='" . $this->pageStyle . "'>$i</a> ";
162
-				}
163
-			}
164
-		}
165
-
166
-		// render row : renderRowFnc($rowNumber,$row,$arguments="")
167
-		$fnc = $this->renderRowFnc;
168
-		$args = $this->renderRowFncArgs;
169
-
170
-		if(isset($fnc)) {
171
-			$i = 1;
172
-			$fncObject = is_object($fnc);
173
-			$minitems = (($p - 1) * $this->pageSize) + 1;
174
-			$maxitems = (($p - 1) * $this->pageSize) + $this->pageSize;
175
-			while($i <= $maxitems && ($row = ($isDataset) ? $modx->getDatabase()->getRow($this->ds) : $this->ds[$i - 1])) {
176
-				if($i >= $minitems && $i <= $maxitems) {
177
-					if($fncObject) {
178
-						if($args != "") {
179
-							$this->rows .= $fnc->RenderRowFnc($i, $row, $args);
180
-						} else {
181
-							$this->rows .= $fnc->RenderRowFnc($i, $row);
182
-						}
183
-					} else {
184
-						if($args != "") {
185
-							$this->rows .= $fnc($i, $row, $args);
186
-						} // if agrs was specified then we wil pass three params
187
-						else {
188
-							$this->rows .= $fnc($i, $row);
189
-						}                 // otherwise two will be passed
190
-					}
191
-
192
-				}
193
-				$i++;
194
-			}
195
-		}
196
-	}
93
+        $modx = evolutionCMS(); global $_PAGE;
94
+
95
+        $isDataset = $modx->getDatabase()->isResult($this->ds);
96
+
97
+        if(!$this->selPageStyle) {
98
+            $this->selPageStyle = "font-weight:bold";
99
+        }
100
+
101
+        // get total number of rows
102
+        $tnr = ($isDataset) ? $modx->getDatabase()->getRecordCount($this->ds) : count($this->ds);
103
+
104
+        // render: no records found
105
+        if($tnr <= 0) {
106
+            $fnc = $this->renderRowFnc;
107
+            $args = $this->renderRowFncArgs;
108
+            if(isset($fnc)) {
109
+                if($args != "") {
110
+                    $this->rows .= $fnc(0, null, $args);
111
+                } // if agrs was specified then we will pass three params
112
+                else {
113
+                    $this->rows .= $fnc(0, null);
114
+                }                 // otherwise two will be passed
115
+            }
116
+            return;
117
+        }
118
+
119
+        // get total pages
120
+        $tp = ceil($tnr / $this->pageSize);
121
+        if($this->pageNumber > $tp) {
122
+            $this->pageNumber = 1;
123
+        }
124
+
125
+        // get page number
126
+        $p = $this->pageNumber;
127
+
128
+        // save page number to view state if available
129
+        if(isset($_PAGE['vs'])) {
130
+            $_PAGE['vs'][$this->id . '_dpgn'] = $p;
131
+        }
132
+
133
+        // render pager : renderPagerFnc($cuurentPage,$pagerNumber,$arguments="");
134
+        if($tp > 1) {
135
+            $url = '';
136
+            $fnc = $this->renderPagerFnc;
137
+            $args = $this->renderPagerFncArgs;
138
+            if(!isset($fnc)) {
139
+                if($modx->isFrontend()) {
140
+                    $url = $modx->makeUrl($modx->documentIdentifier, '', '', 'full') . '?';
141
+                } else {
142
+                    $url = $_SERVER['PHP_SELF'] . '?';
143
+                }
144
+                $i = 0;
145
+                foreach($_GET as $n => $v) if($n != 'dpgn' . $this->id) {
146
+                    $i++;
147
+                    $url .= (($i > 1) ? "&" : "") . "$n=$v";
148
+                }
149
+                if($i >= 1) {
150
+                    $url .= "&";
151
+                }
152
+            }
153
+            for($i = 1; $i <= $tp; $i++) {
154
+                if(isset($fnc)) {
155
+                    if($args != "") {
156
+                        $this->pager .= $fnc($p, $i, $args);
157
+                    } else {
158
+                        $this->pager .= $fnc($p, $i);
159
+                    }
160
+                } else {
161
+                    $this->pager .= ($p == $i) ? " <span class='" . $this->selPageClass . "' style='" . $this->selPageStyle . "'>$i</span> " : " <a href='" . $url . "dpgn" . $this->id . "=$i' class='" . $this->pageClass . "' style='" . $this->pageStyle . "'>$i</a> ";
162
+                }
163
+            }
164
+        }
165
+
166
+        // render row : renderRowFnc($rowNumber,$row,$arguments="")
167
+        $fnc = $this->renderRowFnc;
168
+        $args = $this->renderRowFncArgs;
169
+
170
+        if(isset($fnc)) {
171
+            $i = 1;
172
+            $fncObject = is_object($fnc);
173
+            $minitems = (($p - 1) * $this->pageSize) + 1;
174
+            $maxitems = (($p - 1) * $this->pageSize) + $this->pageSize;
175
+            while($i <= $maxitems && ($row = ($isDataset) ? $modx->getDatabase()->getRow($this->ds) : $this->ds[$i - 1])) {
176
+                if($i >= $minitems && $i <= $maxitems) {
177
+                    if($fncObject) {
178
+                        if($args != "") {
179
+                            $this->rows .= $fnc->RenderRowFnc($i, $row, $args);
180
+                        } else {
181
+                            $this->rows .= $fnc->RenderRowFnc($i, $row);
182
+                        }
183
+                    } else {
184
+                        if($args != "") {
185
+                            $this->rows .= $fnc($i, $row, $args);
186
+                        } // if agrs was specified then we wil pass three params
187
+                        else {
188
+                            $this->rows .= $fnc($i, $row);
189
+                        }                 // otherwise two will be passed
190
+                    }
191
+
192
+                }
193
+                $i++;
194
+            }
195
+        }
196
+    }
197 197
 }
Please login to merge, or discard this patch.
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -33,24 +33,24 @@  discard block
 block discarded – undo
33 33
     public $renderPagerFncArgs;
34 34
     public static $dataSetPagerCnt;
35 35
 
36
-    public function __construct($id, $ds, $pageSize = 10, $pageNumber = -1) {
36
+    public function __construct($id, $ds, $pageSize = 10, $pageNumber = -1){
37 37
 		global $_PAGE; // use view state object
38 38
 
39 39
 		// set id
40 40
 		self::$dataSetPagerCnt++;
41
-		$this->id = !empty($id) ? $id : "dsp" . self::$dataSetPagerCnt;
41
+		$this->id = !empty($id) ? $id : "dsp".self::$dataSetPagerCnt;
42 42
 
43 43
 		// get pagenumber
44 44
 		// by setting pager to -1 cause pager to load it's last page number
45
-		if($pageNumber == -1) {
45
+		if ($pageNumber == -1) {
46 46
 			$pageNumber = 1;
47
-			if(isset($_GET["dpgn" . $this->id])) {
48
-				$pageNumber = $_GET["dpgn" . $this->id];
49
-			} elseif(isset($_PAGE['vs'][$id . '_dpgn'])) {
50
-				$pageNumber = $_PAGE['vs'][$id . '_dpgn'];
47
+			if (isset($_GET["dpgn".$this->id])) {
48
+				$pageNumber = $_GET["dpgn".$this->id];
49
+			} elseif (isset($_PAGE['vs'][$id.'_dpgn'])) {
50
+				$pageNumber = $_PAGE['vs'][$id.'_dpgn'];
51 51
 			}
52 52
 		}
53
-		if(!is_numeric($pageNumber)) {
53
+		if (!is_numeric($pageNumber)) {
54 54
 			$pageNumber = 1;
55 55
 		}
56 56
 
@@ -61,40 +61,40 @@  discard block
 block discarded – undo
61 61
 		$this->pager = '';
62 62
 	}
63 63
 
64
-    public function getRenderedPager() {
64
+    public function getRenderedPager(){
65 65
 		return $this->pager;
66 66
 	}
67 67
 
68
-    public function getRenderedRows() {
68
+    public function getRenderedRows(){
69 69
 		return $this->rows;
70 70
 	}
71 71
 
72
-    public function setDataSource($ds) {
72
+    public function setDataSource($ds){
73 73
 		$this->ds = $ds;
74 74
 	}
75 75
 
76
-    public function setPageSize($ps) {
76
+    public function setPageSize($ps){
77 77
 		$this->pageSize = $ps;
78 78
 	}
79 79
 
80
-    public function setRenderRowFnc($fncName, $args = "") {
80
+    public function setRenderRowFnc($fncName, $args = ""){
81 81
 		$this->renderRowFnc = &$fncName;
82
-		$this->renderRowFncArgs = $args;    // extra agruments
82
+		$this->renderRowFncArgs = $args; // extra agruments
83 83
 
84 84
 
85 85
 	}
86 86
 
87
-    public function setRenderPagerFnc($fncName, $args = "") {
87
+    public function setRenderPagerFnc($fncName, $args = ""){
88 88
 		$this->renderPagerFnc = $fncName;
89
-		$this->renderPagerFncArgs = $args;    // extra agruments
89
+		$this->renderPagerFncArgs = $args; // extra agruments
90 90
 	}
91 91
 
92
-    public function render() {
92
+    public function render(){
93 93
 		$modx = evolutionCMS(); global $_PAGE;
94 94
 
95 95
 		$isDataset = $modx->getDatabase()->isResult($this->ds);
96 96
 
97
-		if(!$this->selPageStyle) {
97
+		if (!$this->selPageStyle) {
98 98
 			$this->selPageStyle = "font-weight:bold";
99 99
 		}
100 100
 
@@ -102,11 +102,11 @@  discard block
 block discarded – undo
102 102
 		$tnr = ($isDataset) ? $modx->getDatabase()->getRecordCount($this->ds) : count($this->ds);
103 103
 
104 104
 		// render: no records found
105
-		if($tnr <= 0) {
105
+		if ($tnr <= 0) {
106 106
 			$fnc = $this->renderRowFnc;
107 107
 			$args = $this->renderRowFncArgs;
108
-			if(isset($fnc)) {
109
-				if($args != "") {
108
+			if (isset($fnc)) {
109
+				if ($args != "") {
110 110
 					$this->rows .= $fnc(0, null, $args);
111 111
 				} // if agrs was specified then we will pass three params
112 112
 				else {
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 
119 119
 		// get total pages
120 120
 		$tp = ceil($tnr / $this->pageSize);
121
-		if($this->pageNumber > $tp) {
121
+		if ($this->pageNumber > $tp) {
122 122
 			$this->pageNumber = 1;
123 123
 		}
124 124
 
@@ -126,39 +126,39 @@  discard block
 block discarded – undo
126 126
 		$p = $this->pageNumber;
127 127
 
128 128
 		// save page number to view state if available
129
-		if(isset($_PAGE['vs'])) {
130
-			$_PAGE['vs'][$this->id . '_dpgn'] = $p;
129
+		if (isset($_PAGE['vs'])) {
130
+			$_PAGE['vs'][$this->id.'_dpgn'] = $p;
131 131
 		}
132 132
 
133 133
 		// render pager : renderPagerFnc($cuurentPage,$pagerNumber,$arguments="");
134
-		if($tp > 1) {
134
+		if ($tp > 1) {
135 135
 		    $url = '';
136 136
 			$fnc = $this->renderPagerFnc;
137 137
 			$args = $this->renderPagerFncArgs;
138
-			if(!isset($fnc)) {
139
-				if($modx->isFrontend()) {
140
-					$url = $modx->makeUrl($modx->documentIdentifier, '', '', 'full') . '?';
138
+			if (!isset($fnc)) {
139
+				if ($modx->isFrontend()) {
140
+					$url = $modx->makeUrl($modx->documentIdentifier, '', '', 'full').'?';
141 141
 				} else {
142
-					$url = $_SERVER['PHP_SELF'] . '?';
142
+					$url = $_SERVER['PHP_SELF'].'?';
143 143
 				}
144 144
 				$i = 0;
145
-				foreach($_GET as $n => $v) if($n != 'dpgn' . $this->id) {
145
+				foreach ($_GET as $n => $v) if ($n != 'dpgn'.$this->id) {
146 146
 					$i++;
147
-					$url .= (($i > 1) ? "&" : "") . "$n=$v";
147
+					$url .= (($i > 1) ? "&" : "")."$n=$v";
148 148
 				}
149
-				if($i >= 1) {
149
+				if ($i >= 1) {
150 150
 					$url .= "&";
151 151
 				}
152 152
 			}
153
-			for($i = 1; $i <= $tp; $i++) {
154
-				if(isset($fnc)) {
155
-					if($args != "") {
153
+			for ($i = 1; $i <= $tp; $i++) {
154
+				if (isset($fnc)) {
155
+					if ($args != "") {
156 156
 						$this->pager .= $fnc($p, $i, $args);
157 157
 					} else {
158 158
 						$this->pager .= $fnc($p, $i);
159 159
 					}
160 160
 				} else {
161
-					$this->pager .= ($p == $i) ? " <span class='" . $this->selPageClass . "' style='" . $this->selPageStyle . "'>$i</span> " : " <a href='" . $url . "dpgn" . $this->id . "=$i' class='" . $this->pageClass . "' style='" . $this->pageStyle . "'>$i</a> ";
161
+					$this->pager .= ($p == $i) ? " <span class='".$this->selPageClass."' style='".$this->selPageStyle."'>$i</span> " : " <a href='".$url."dpgn".$this->id."=$i' class='".$this->pageClass."' style='".$this->pageStyle."'>$i</a> ";
162 162
 				}
163 163
 			}
164 164
 		}
@@ -167,21 +167,21 @@  discard block
 block discarded – undo
167 167
 		$fnc = $this->renderRowFnc;
168 168
 		$args = $this->renderRowFncArgs;
169 169
 
170
-		if(isset($fnc)) {
170
+		if (isset($fnc)) {
171 171
 			$i = 1;
172 172
 			$fncObject = is_object($fnc);
173 173
 			$minitems = (($p - 1) * $this->pageSize) + 1;
174 174
 			$maxitems = (($p - 1) * $this->pageSize) + $this->pageSize;
175
-			while($i <= $maxitems && ($row = ($isDataset) ? $modx->getDatabase()->getRow($this->ds) : $this->ds[$i - 1])) {
176
-				if($i >= $minitems && $i <= $maxitems) {
177
-					if($fncObject) {
178
-						if($args != "") {
175
+			while ($i <= $maxitems && ($row = ($isDataset) ? $modx->getDatabase()->getRow($this->ds) : $this->ds[$i - 1])) {
176
+				if ($i >= $minitems && $i <= $maxitems) {
177
+					if ($fncObject) {
178
+						if ($args != "") {
179 179
 							$this->rows .= $fnc->RenderRowFnc($i, $row, $args);
180 180
 						} else {
181 181
 							$this->rows .= $fnc->RenderRowFnc($i, $row);
182 182
 						}
183 183
 					} else {
184
-						if($args != "") {
184
+						if ($args != "") {
185 185
 							$this->rows .= $fnc($i, $row, $args);
186 186
 						} // if agrs was specified then we wil pass three params
187 187
 						else {
Please login to merge, or discard this patch.
Braces   +21 added lines, -10 removed lines patch added patch discarded remove patch
@@ -11,7 +11,8 @@  discard block
 block discarded – undo
11 11
 # -----------------------------------------
12 12
 #
13 13
 
14
-class DataSetPager implements DataSetPagerInterface{
14
+class DataSetPager implements DataSetPagerInterface
15
+{
15 16
 
16 17
 	public $ds; // datasource
17 18
     public $pageSize;
@@ -33,7 +34,8 @@  discard block
 block discarded – undo
33 34
     public $renderPagerFncArgs;
34 35
     public static $dataSetPagerCnt;
35 36
 
36
-    public function __construct($id, $ds, $pageSize = 10, $pageNumber = -1) {
37
+    public function __construct($id, $ds, $pageSize = 10, $pageNumber = -1)
38
+    {
37 39
 		global $_PAGE; // use view state object
38 40
 
39 41
 		// set id
@@ -61,35 +63,42 @@  discard block
 block discarded – undo
61 63
 		$this->pager = '';
62 64
 	}
63 65
 
64
-    public function getRenderedPager() {
66
+    public function getRenderedPager()
67
+    {
65 68
 		return $this->pager;
66 69
 	}
67 70
 
68
-    public function getRenderedRows() {
71
+    public function getRenderedRows()
72
+    {
69 73
 		return $this->rows;
70 74
 	}
71 75
 
72
-    public function setDataSource($ds) {
76
+    public function setDataSource($ds)
77
+    {
73 78
 		$this->ds = $ds;
74 79
 	}
75 80
 
76
-    public function setPageSize($ps) {
81
+    public function setPageSize($ps)
82
+    {
77 83
 		$this->pageSize = $ps;
78 84
 	}
79 85
 
80
-    public function setRenderRowFnc($fncName, $args = "") {
86
+    public function setRenderRowFnc($fncName, $args = "")
87
+    {
81 88
 		$this->renderRowFnc = &$fncName;
82 89
 		$this->renderRowFncArgs = $args;    // extra agruments
83 90
 
84 91
 
85 92
 	}
86 93
 
87
-    public function setRenderPagerFnc($fncName, $args = "") {
94
+    public function setRenderPagerFnc($fncName, $args = "")
95
+    {
88 96
 		$this->renderPagerFnc = $fncName;
89 97
 		$this->renderPagerFncArgs = $args;    // extra agruments
90 98
 	}
91 99
 
92
-    public function render() {
100
+    public function render()
101
+    {
93 102
 		$modx = evolutionCMS(); global $_PAGE;
94 103
 
95 104
 		$isDataset = $modx->getDatabase()->isResult($this->ds);
@@ -142,8 +151,10 @@  discard block
 block discarded – undo
142 151
 					$url = $_SERVER['PHP_SELF'] . '?';
143 152
 				}
144 153
 				$i = 0;
145
-				foreach($_GET as $n => $v) if($n != 'dpgn' . $this->id) {
154
+				foreach($_GET as $n => $v) {
155
+				    if($n != 'dpgn' . $this->id) {
146 156
 					$i++;
157
+				}
147 158
 					$url .= (($i > 1) ? "&" : "") . "$n=$v";
148 159
 				}
149 160
 				if($i >= 1) {
Please login to merge, or discard this patch.