Completed
Pull Request — develop (#716)
by Agel_Nash
09:56
created
manager/actions/mutate_settings/tab6_filemanager_settings.inc.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@
 block discarded – undo
113 113
         <?php
114 114
             // invoke OnMiscSettingsRender event
115 115
             $evtOut = $modx->invokeEvent('OnFileManagerSettingsRender');
116
-            if(is_array($evtOut)) echo implode("",$evtOut);
116
+            if (is_array($evtOut)) echo implode("", $evtOut);
117 117
         ?>
118 118
     </td>
119 119
   </tr>
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -113,7 +113,9 @@
 block discarded – undo
113 113
         <?php
114 114
             // invoke OnMiscSettingsRender event
115 115
             $evtOut = $modx->invokeEvent('OnFileManagerSettingsRender');
116
-            if(is_array($evtOut)) echo implode("",$evtOut);
116
+            if(is_array($evtOut)) {
117
+                echo implode("",$evtOut);
118
+            }
117 119
         ?>
118 120
     </td>
119 121
   </tr>
Please login to merge, or discard this patch.
manager/actions/mutate_user.dynamic.php 4 patches
Indentation   +158 added lines, -158 removed lines patch added patch discarded remove patch
@@ -1,21 +1,21 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3
-	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
3
+    die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 
6 6
 switch($modx->manager->action) {
7
-	case 12:
8
-		if(!$modx->hasPermission('edit_user')) {
9
-			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
10
-		}
11
-		break;
12
-	case 11:
13
-		if(!$modx->hasPermission('new_user')) {
14
-			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
15
-		}
16
-		break;
17
-	default:
18
-		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7
+    case 12:
8
+        if(!$modx->hasPermission('edit_user')) {
9
+            $modx->webAlertAndQuit($_lang["error_no_privileges"]);
10
+        }
11
+        break;
12
+    case 11:
13
+        if(!$modx->hasPermission('new_user')) {
14
+            $modx->webAlertAndQuit($_lang["error_no_privileges"]);
15
+        }
16
+        break;
17
+    default:
18
+        $modx->webAlertAndQuit($_lang["error_no_privileges"]);
19 19
 }
20 20
 
21 21
 $user = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
@@ -23,75 +23,75 @@  discard block
 block discarded – undo
23 23
 // check to see the snippet editor isn't locked
24 24
 $rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=12 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'");
25 25
 if($username = $modx->db->getValue($rs)) {
26
-	$modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "user"));
26
+    $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "user"));
27 27
 }
28 28
 // end check for lock
29 29
 
30 30
 if($modx->manager->action == '12') {
31
-	// get user attribute
32
-	$rs = $modx->db->select('*', $modx->getFullTableName('user_attributes'), "internalKey = '{$user}'");
33
-	$userdata = $modx->db->getRow($rs);
34
-	if(!$userdata) {
35
-		$modx->webAlertAndQuit("No user returned!");
36
-	}
37
-
38
-
39
-	// get user settings
40
-	$rs = $modx->db->select('*', $modx->getFullTableName('user_settings'), "user = '{$user}'");
41
-	$usersettings = array();
42
-	while($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value'];
43
-	// manually extract so that user display settings are not overwritten
44
-	foreach($usersettings as $k => $v) {
45
-		if($k != 'manager_language' && $k != 'manager_theme') {
46
-			${$k} = $v;
47
-		}
48
-	}
49
-
50
-	// get user name
51
-	$rs = $modx->db->select('*', $modx->getFullTableName('manager_users'), "id = '{$user}'");
52
-	$usernamedata = $modx->db->getRow($rs);
53
-	if(!$usernamedata) {
54
-		$modx->webAlertAndQuit("No user returned while getting username!");
55
-	}
56
-	$_SESSION['itemname'] = $usernamedata['username'];
31
+    // get user attribute
32
+    $rs = $modx->db->select('*', $modx->getFullTableName('user_attributes'), "internalKey = '{$user}'");
33
+    $userdata = $modx->db->getRow($rs);
34
+    if(!$userdata) {
35
+        $modx->webAlertAndQuit("No user returned!");
36
+    }
37
+
38
+
39
+    // get user settings
40
+    $rs = $modx->db->select('*', $modx->getFullTableName('user_settings'), "user = '{$user}'");
41
+    $usersettings = array();
42
+    while($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value'];
43
+    // manually extract so that user display settings are not overwritten
44
+    foreach($usersettings as $k => $v) {
45
+        if($k != 'manager_language' && $k != 'manager_theme') {
46
+            ${$k} = $v;
47
+        }
48
+    }
49
+
50
+    // get user name
51
+    $rs = $modx->db->select('*', $modx->getFullTableName('manager_users'), "id = '{$user}'");
52
+    $usernamedata = $modx->db->getRow($rs);
53
+    if(!$usernamedata) {
54
+        $modx->webAlertAndQuit("No user returned while getting username!");
55
+    }
56
+    $_SESSION['itemname'] = $usernamedata['username'];
57 57
 } else {
58
-	$userdata = array();
59
-	$usersettings = array();
60
-	$usernamedata = array();
61
-	$_SESSION['itemname'] = $_lang["new_user"];
58
+    $userdata = array();
59
+    $usersettings = array();
60
+    $usernamedata = array();
61
+    $_SESSION['itemname'] = $_lang["new_user"];
62 62
 }
63 63
 
64 64
 // avoid doubling htmlspecialchars (already encoded in DB)
65 65
 foreach($userdata as $key => $val) {
66
-	$userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']);
66
+    $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']);
67 67
 };
68 68
 $usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']);
69 69
 
70 70
 // restore saved form
71 71
 $formRestored = false;
72 72
 if($modx->manager->hasFormValues()) {
73
-	$modx->manager->loadFormValues();
74
-	// restore post values
75
-	$userdata = array_merge($userdata, $_POST);
76
-	$userdata['dob'] = $modx->toTimeStamp($userdata['dob']);
77
-	$usernamedata['username'] = $userdata['newusername'];
78
-	$usernamedata['oldusername'] = $_POST['oldusername'];
79
-	$usersettings = array_merge($usersettings, $userdata);
80
-	$usersettings['allowed_days'] = is_array($_POST['allowed_days']) ? implode(",", $_POST['allowed_days']) : "";
81
-	extract($usersettings, EXTR_OVERWRITE);
73
+    $modx->manager->loadFormValues();
74
+    // restore post values
75
+    $userdata = array_merge($userdata, $_POST);
76
+    $userdata['dob'] = $modx->toTimeStamp($userdata['dob']);
77
+    $usernamedata['username'] = $userdata['newusername'];
78
+    $usernamedata['oldusername'] = $_POST['oldusername'];
79
+    $usersettings = array_merge($usersettings, $userdata);
80
+    $usersettings['allowed_days'] = is_array($_POST['allowed_days']) ? implode(",", $_POST['allowed_days']) : "";
81
+    extract($usersettings, EXTR_OVERWRITE);
82 82
 }
83 83
 
84 84
 // include the country list language file
85 85
 $_country_lang = array();
86 86
 include_once "lang/country/english_country.inc.php";
87 87
 if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) {
88
-	include_once "lang/country/" . $manager_language . "_country.inc.php";
88
+    include_once "lang/country/" . $manager_language . "_country.inc.php";
89 89
 }
90 90
 asort($_country_lang);
91 91
 
92 92
 $displayStyle = ($_SESSION['browser'] === 'modern') ? 'table-row' : 'block';
93 93
 if($which_browser == 'default') {
94
-	$which_browser = $modx->configGlobal['which_browser'] ? $modx->configGlobal['which_browser'] : $modx->config['which_browser'];
94
+    $which_browser = $modx->configGlobal['which_browser'] ? $modx->configGlobal['which_browser'] : $modx->config['which_browser'];
95 95
 }
96 96
 ?>
97 97
 <script type="text/javascript">
@@ -201,14 +201,14 @@  discard block
 block discarded – undo
201 201
 <form action="index.php?a=32" method="post" name="userform">
202 202
 	<?php
203 203
 
204
-	// invoke OnUserFormPrerender event
205
-	$evtOut = $modx->invokeEvent("OnUserFormPrerender", array(
206
-		"id" => $user
207
-	));
208
-	if(is_array($evtOut)) {
209
-		echo implode("", $evtOut);
210
-	}
211
-	?>
204
+    // invoke OnUserFormPrerender event
205
+    $evtOut = $modx->invokeEvent("OnUserFormPrerender", array(
206
+        "id" => $user
207
+    ));
208
+    if(is_array($evtOut)) {
209
+        echo implode("", $evtOut);
210
+    }
211
+    ?>
212 212
 	<input type="hidden" name="mode" value="<?php echo $modx->manager->action; ?>">
213 213
 	<input type="hidden" name="id" value="<?php echo $user ?>">
214 214
 	<input type="hidden" name="blockedmode" value="<?php echo ($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || ($userdata['blockedafter'] < time() && $userdata['blockedafter'] != 0) || $userdata['failedlogins'] > 3) ? "1" : "0" ?>" />
@@ -301,21 +301,21 @@  discard block
 block discarded – undo
301 301
 						<td>&nbsp;</td>
302 302
 						<td><?php
303 303
 
304
-							$rs = $modx->db->select('name, id', '[+prefix+]user_roles', ($modx->hasPermission('save_role')) ? '' : 'id != 1');
305
-							?>
304
+                            $rs = $modx->db->select('name, id', '[+prefix+]user_roles', ($modx->hasPermission('save_role')) ? '' : 'id != 1');
305
+                            ?>
306 306
 							<select name="role" class="inputBox" onChange='documentDirty=true;' style="width:300px">
307 307
 								<?php
308
-								while($row = $modx->db->getRow($rs)) {
309
-									if($modx->manager->action == '11') {
310
-										$selectedtext = $row['id'] == '1' ? ' selected="selected"' : '';
311
-									} else {
312
-										$selectedtext = $row['id'] == $userdata['role'] ? "selected='selected'" : '';
313
-									}
314
-									?>
308
+                                while($row = $modx->db->getRow($rs)) {
309
+                                    if($modx->manager->action == '11') {
310
+                                        $selectedtext = $row['id'] == '1' ? ' selected="selected"' : '';
311
+                                    } else {
312
+                                        $selectedtext = $row['id'] == $userdata['role'] ? "selected='selected'" : '';
313
+                                    }
314
+                                    ?>
315 315
 									<option value="<?php echo $row['id']; ?>"<?php echo $selectedtext; ?>><?php echo $row['name']; ?></option>
316 316
 									<?php
317
-								}
318
-								?>
317
+                                }
318
+                                ?>
319 319
 							</select></td>
320 320
 					</tr>
321 321
 					<tr>
@@ -360,10 +360,10 @@  discard block
 block discarded – undo
360 360
 								<?php $chosenCountry = isset($_POST['country']) ? $_POST['country'] : $userdata['country']; ?>
361 361
 								<option value="" <?php (!isset($chosenCountry) ? ' selected' : '') ?> >&nbsp;</option>
362 362
 								<?php
363
-								foreach($_country_lang as $key => $country) {
364
-									echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>";
365
-								}
366
-								?>
363
+                                foreach($_country_lang as $key => $country) {
364
+                                    echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>";
365
+                                }
366
+                                ?>
367 367
 							</select></td>
368 368
 					</tr>
369 369
 					<tr>
@@ -439,21 +439,21 @@  discard block
 block discarded – undo
439 439
 						<td><select name="manager_language" class="inputBox" onChange="documentDirty=true">
440 440
 								<option value=""></option>
441 441
 								<?php
442
-								$activelang = !empty($usersettings['manager_language']) ? $usersettings['manager_language'] : '';
443
-								$dir = dir("includes/lang");
444
-								while($file = $dir->read()) {
445
-									if(strpos($file, ".inc.php") > 0) {
446
-										$endpos = strpos($file, ".");
447
-										$languagename = substr($file, 0, $endpos);
448
-										$selectedtext = $languagename == $activelang ? "selected='selected'" : "";
449
-										?>
442
+                                $activelang = !empty($usersettings['manager_language']) ? $usersettings['manager_language'] : '';
443
+                                $dir = dir("includes/lang");
444
+                                while($file = $dir->read()) {
445
+                                    if(strpos($file, ".inc.php") > 0) {
446
+                                        $endpos = strpos($file, ".");
447
+                                        $languagename = substr($file, 0, $endpos);
448
+                                        $selectedtext = $languagename == $activelang ? "selected='selected'" : "";
449
+                                        ?>
450 450
 										<option value="<?php echo $languagename; ?>" <?php echo $selectedtext; ?>><?php echo ucwords(str_replace("_", " ", $languagename)); ?></option>
451 451
 										<?php
452 452
 
453
-									}
454
-								}
455
-								$dir->close();
456
-								?>
453
+                                    }
454
+                                }
455
+                                $dir->close();
456
+                                ?>
457 457
 							</select></td>
458 458
 					</tr>
459 459
 					<tr>
@@ -528,22 +528,22 @@  discard block
 block discarded – undo
528 528
 						<td><select name="manager_theme" class="inputBox" onChange="documentDirty=true;document.userform.theme_refresher.value = Date.parse(new Date());">
529 529
 								<option value=""></option>
530 530
 								<?php
531
-								$dir = dir("media/style/");
532
-								while($file = $dir->read()) {
533
-									if($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') {
534
-										$themename = $file;
535
-										if($themename === 'common') {
536
-											continue;
537
-										}
538
-										$attr = 'value="' . $themename . '" ';
539
-										if(isset($usersettings['manager_theme']) && $themename == $usersettings['manager_theme']) {
540
-											$attr .= 'selected="selected" ';
541
-										}
542
-										echo "\t\t<option " . rtrim($attr) . '>' . ucwords(str_replace("_", " ", $themename)) . "</option>\n";
543
-									}
544
-								}
545
-								$dir->close();
546
-								?>
531
+                                $dir = dir("media/style/");
532
+                                while($file = $dir->read()) {
533
+                                    if($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') {
534
+                                        $themename = $file;
535
+                                        if($themename === 'common') {
536
+                                            continue;
537
+                                        }
538
+                                        $attr = 'value="' . $themename . '" ';
539
+                                        if(isset($usersettings['manager_theme']) && $themename == $usersettings['manager_theme']) {
540
+                                            $attr .= 'selected="selected" ';
541
+                                        }
542
+                                        echo "\t\t<option " . rtrim($attr) . '>' . ucwords(str_replace("_", " ", $themename)) . "</option>\n";
543
+                                    }
544
+                                }
545
+                                $dir->close();
546
+                                ?>
547 547
 							</select>
548 548
 							<input type="hidden" name="theme_refresher" value=""></td>
549 549
 					</tr>
@@ -579,15 +579,15 @@  discard block
 block discarded – undo
579 579
 						<th><?php echo $_lang["which_browser_title"] ?></th>
580 580
 						<td><select name="which_browser" class="inputBox" onChange="documentDirty=true;">
581 581
 								<?php
582
-								$selected = 'default' == $usersettings['which_browser'] || !$usersettings['which_browser'] ? ' selected="selected"' : '';
583
-								echo '<option value="default"' . $selected . '>' . $_lang['option_default'] . "</option>\n";
584
-								foreach(glob("media/browser/*", GLOB_ONLYDIR) as $dir) {
585
-									$dir = str_replace('\\', '/', $dir);
586
-									$browser_name = substr($dir, strrpos($dir, '/') + 1);
587
-									$selected = $browser_name == $usersettings['which_browser'] ? ' selected="selected"' : '';
588
-									echo '<option value="' . $browser_name . '"' . $selected . '>' . "{$browser_name}</option>\n";
589
-								}
590
-								?>
582
+                                $selected = 'default' == $usersettings['which_browser'] || !$usersettings['which_browser'] ? ' selected="selected"' : '';
583
+                                echo '<option value="default"' . $selected . '>' . $_lang['option_default'] . "</option>\n";
584
+                                foreach(glob("media/browser/*", GLOB_ONLYDIR) as $dir) {
585
+                                    $dir = str_replace('\\', '/', $dir);
586
+                                    $browser_name = substr($dir, strrpos($dir, '/') + 1);
587
+                                    $selected = $browser_name == $usersettings['which_browser'] ? ' selected="selected"' : '';
588
+                                    echo '<option value="' . $browser_name . '"' . $selected . '>' . "{$browser_name}</option>\n";
589
+                                }
590
+                                ?>
591 591
 							</select></td>
592 592
 					</tr>
593 593
 					<tr>
@@ -664,17 +664,17 @@  discard block
 block discarded – undo
664 664
 								<option value=""></option>
665 665
 								<?php
666 666
 
667
-								$edt = isset ($usersettings["which_editor"]) ? $usersettings["which_editor"] : '';
668
-								// invoke OnRichTextEditorRegister event
669
-								$evtOut = $modx->invokeEvent("OnRichTextEditorRegister");
670
-								echo "<option value='none'" . ($edt == 'none' ? " selected='selected'" : "") . ">" . $_lang["none"] . "</option>\n";
671
-								if(is_array($evtOut)) {
672
-									for($i = 0; $i < count($evtOut); $i++) {
673
-										$editor = $evtOut[$i];
674
-										echo "<option value='$editor'" . ($edt == $editor ? " selected='selected'" : "") . ">$editor</option>\n";
675
-									}
676
-								}
677
-								?>
667
+                                $edt = isset ($usersettings["which_editor"]) ? $usersettings["which_editor"] : '';
668
+                                // invoke OnRichTextEditorRegister event
669
+                                $evtOut = $modx->invokeEvent("OnRichTextEditorRegister");
670
+                                echo "<option value='none'" . ($edt == 'none' ? " selected='selected'" : "") . ">" . $_lang["none"] . "</option>\n";
671
+                                if(is_array($evtOut)) {
672
+                                    for($i = 0; $i < count($evtOut); $i++) {
673
+                                        $editor = $evtOut[$i];
674
+                                        echo "<option value='$editor'" . ($edt == $editor ? " selected='selected'" : "") . ">$editor</option>\n";
675
+                                    }
676
+                                }
677
+                                ?>
678 678
 							</select></td>
679 679
 					</tr>
680 680
 					<tr id='editorRow1' style="display: <?php echo $use_editor == 1 ? $displayStyle : 'none'; ?>">
@@ -707,12 +707,12 @@  discard block
 block discarded – undo
707 707
 					</tr>
708 708
 				</table>
709 709
 				<?php
710
-				// invoke OnInterfaceSettingsRender event
711
-				$evtOut = $modx->invokeEvent("OnInterfaceSettingsRender");
712
-				if(is_array($evtOut)) {
713
-					echo implode("", $evtOut);
714
-				}
715
-				?>
710
+                // invoke OnInterfaceSettingsRender event
711
+                $evtOut = $modx->invokeEvent("OnInterfaceSettingsRender");
712
+                if(is_array($evtOut)) {
713
+                    echo implode("", $evtOut);
714
+                }
715
+                ?>
716 716
 			</div>
717 717
 
718 718
 			<!-- Photo -->
@@ -761,39 +761,39 @@  discard block
 block discarded – undo
761 761
 			</div>
762 762
 			<?php if($use_udperms == 1) {
763 763
 
764
-			$groupsarray = array();
765
-
766
-			if($modx->manager->action == '12') { // only do this bit if the user is being edited
767
-				$rs = $modx->db->select('user_group', $modx->getFullTableName('member_groups'), "member='{$user}'");
768
-				$groupsarray = $modx->db->getColumn('user_group', $rs);
769
-			}
770
-			// retain selected doc groups between post
771
-			if(is_array($_POST['user_groups'])) {
772
-				foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v;
773
-			}
774
-			?>
764
+            $groupsarray = array();
765
+
766
+            if($modx->manager->action == '12') { // only do this bit if the user is being edited
767
+                $rs = $modx->db->select('user_group', $modx->getFullTableName('member_groups'), "member='{$user}'");
768
+                $groupsarray = $modx->db->getColumn('user_group', $rs);
769
+            }
770
+            // retain selected doc groups between post
771
+            if(is_array($_POST['user_groups'])) {
772
+                foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v;
773
+            }
774
+            ?>
775 775
 			<div class="tab-page" id="tabAccess">
776 776
 				<h2 class="tab"><?php echo $_lang["access_permissions"] ?></h2>
777 777
 				<script type="text/javascript">tpUser.addTabPage(document.getElementById("tabAccess"));</script>
778 778
 				<p><?php echo $_lang['access_permissions_user_message'] ?></p>
779 779
 				<?php
780
-				$rs = $modx->db->select('name, id', $modx->getFullTableName('membergroup_names'), '', 'name');
781
-				while($row = $modx->db->getRow($rs)) {
782
-					echo "<label><input type='checkbox' name='user_groups[]' value='" . $row['id'] . "'" . (in_array($row['id'], $groupsarray) ? " checked='checked'" : "") . " />" . $row['name'] . "</label><br />";
783
-				}
784
-				}
785
-				?>
780
+                $rs = $modx->db->select('name, id', $modx->getFullTableName('membergroup_names'), '', 'name');
781
+                while($row = $modx->db->getRow($rs)) {
782
+                    echo "<label><input type='checkbox' name='user_groups[]' value='" . $row['id'] . "'" . (in_array($row['id'], $groupsarray) ? " checked='checked'" : "") . " />" . $row['name'] . "</label><br />";
783
+                }
784
+                }
785
+                ?>
786 786
 			</div>
787 787
 		</div>
788 788
 	</div>
789 789
 	<input type="submit" name="save" style="display:none">
790 790
 	<?php
791
-	// invoke OnUserFormRender event
792
-	$evtOut = $modx->invokeEvent("OnUserFormRender", array(
793
-		"id" => $user
794
-	));
795
-	if(is_array($evtOut)) {
796
-		echo implode("", $evtOut);
797
-	}
798
-	?>
791
+    // invoke OnUserFormRender event
792
+    $evtOut = $modx->invokeEvent("OnUserFormRender", array(
793
+        "id" => $user
794
+    ));
795
+    if(is_array($evtOut)) {
796
+        echo implode("", $evtOut);
797
+    }
798
+    ?>
799 799
 </form>
Please login to merge, or discard this patch.
Switch Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -4,18 +4,18 @@
 block discarded – undo
4 4
 }
5 5
 
6 6
 switch($modx->manager->action) {
7
-	case 12:
8
-		if(!$modx->hasPermission('edit_user')) {
9
-			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
10
-		}
11
-		break;
12
-	case 11:
13
-		if(!$modx->hasPermission('new_user')) {
14
-			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
15
-		}
16
-		break;
17
-	default:
18
-		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7
+	    case 12:
8
+		    if(!$modx->hasPermission('edit_user')) {
9
+			    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
10
+		    }
11
+		    break;
12
+	    case 11:
13
+		    if(!$modx->hasPermission('new_user')) {
14
+			    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
15
+		    }
16
+		    break;
17
+	    default:
18
+		    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
19 19
 }
20 20
 
21 21
 $user = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
Please login to merge, or discard this patch.
Spacing   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
 	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 
6
-switch($modx->manager->action) {
6
+switch ($modx->manager->action) {
7 7
 	case 12:
8
-		if(!$modx->hasPermission('edit_user')) {
8
+		if (!$modx->hasPermission('edit_user')) {
9 9
 			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
10 10
 		}
11 11
 		break;
12 12
 	case 11:
13
-		if(!$modx->hasPermission('new_user')) {
13
+		if (!$modx->hasPermission('new_user')) {
14 14
 			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
15 15
 		}
16 16
 		break;
@@ -18,20 +18,20 @@  discard block
 block discarded – undo
18 18
 		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
19 19
 }
20 20
 
21
-$user = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
21
+$user = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0;
22 22
 
23 23
 // check to see the snippet editor isn't locked
24
-$rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=12 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'");
25
-if($username = $modx->db->getValue($rs)) {
24
+$rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=12 AND id='{$user}' AND internalKey!='".$modx->getLoginUserID()."'");
25
+if ($username = $modx->db->getValue($rs)) {
26 26
 	$modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "user"));
27 27
 }
28 28
 // end check for lock
29 29
 
30
-if($modx->manager->action == '12') {
30
+if ($modx->manager->action == '12') {
31 31
 	// get user attribute
32 32
 	$rs = $modx->db->select('*', $modx->getFullTableName('user_attributes'), "internalKey = '{$user}'");
33 33
 	$userdata = $modx->db->getRow($rs);
34
-	if(!$userdata) {
34
+	if (!$userdata) {
35 35
 		$modx->webAlertAndQuit("No user returned!");
36 36
 	}
37 37
 
@@ -39,10 +39,10 @@  discard block
 block discarded – undo
39 39
 	// get user settings
40 40
 	$rs = $modx->db->select('*', $modx->getFullTableName('user_settings'), "user = '{$user}'");
41 41
 	$usersettings = array();
42
-	while($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value'];
42
+	while ($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value'];
43 43
 	// manually extract so that user display settings are not overwritten
44
-	foreach($usersettings as $k => $v) {
45
-		if($k != 'manager_language' && $k != 'manager_theme') {
44
+	foreach ($usersettings as $k => $v) {
45
+		if ($k != 'manager_language' && $k != 'manager_theme') {
46 46
 			${$k} = $v;
47 47
 		}
48 48
 	}
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 	// get user name
51 51
 	$rs = $modx->db->select('*', $modx->getFullTableName('manager_users'), "id = '{$user}'");
52 52
 	$usernamedata = $modx->db->getRow($rs);
53
-	if(!$usernamedata) {
53
+	if (!$usernamedata) {
54 54
 		$modx->webAlertAndQuit("No user returned while getting username!");
55 55
 	}
56 56
 	$_SESSION['itemname'] = $usernamedata['username'];
@@ -62,14 +62,14 @@  discard block
 block discarded – undo
62 62
 }
63 63
 
64 64
 // avoid doubling htmlspecialchars (already encoded in DB)
65
-foreach($userdata as $key => $val) {
65
+foreach ($userdata as $key => $val) {
66 66
 	$userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']);
67 67
 };
68 68
 $usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']);
69 69
 
70 70
 // restore saved form
71 71
 $formRestored = false;
72
-if($modx->manager->hasFormValues()) {
72
+if ($modx->manager->hasFormValues()) {
73 73
 	$modx->manager->loadFormValues();
74 74
 	// restore post values
75 75
 	$userdata = array_merge($userdata, $_POST);
@@ -84,13 +84,13 @@  discard block
 block discarded – undo
84 84
 // include the country list language file
85 85
 $_country_lang = array();
86 86
 include_once "lang/country/english_country.inc.php";
87
-if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) {
88
-	include_once "lang/country/" . $manager_language . "_country.inc.php";
87
+if ($manager_language != "english" && file_exists($modx->config['site_manager_path']."includes/lang/country/".$manager_language."_country.inc.php")) {
88
+	include_once "lang/country/".$manager_language."_country.inc.php";
89 89
 }
90 90
 asort($_country_lang);
91 91
 
92 92
 $displayStyle = ($_SESSION['browser'] === 'modern') ? 'table-row' : 'block';
93
-if($which_browser == 'default') {
93
+if ($which_browser == 'default') {
94 94
 	$which_browser = $modx->configGlobal['which_browser'] ? $modx->configGlobal['which_browser'] : $modx->config['which_browser'];
95 95
 }
96 96
 ?>
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 			document.userform.save.click();
183 183
 		},
184 184
 		delete: function() {
185
-			<?php if($_GET['id'] == $modx->getLoginUserID()) { ?>
185
+			<?php if ($_GET['id'] == $modx->getLoginUserID()) { ?>
186 186
 			alert("<?php echo $_lang['alert_delete_self']; ?>");
187 187
 			<?php } else { ?>
188 188
 			if(confirm("<?php echo $_lang['confirm_delete_user']; ?>") === true) {
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 	$evtOut = $modx->invokeEvent("OnUserFormPrerender", array(
206 206
 		"id" => $user
207 207
 	));
208
-	if(is_array($evtOut)) {
208
+	if (is_array($evtOut)) {
209 209
 		echo implode("", $evtOut);
210 210
 	}
211 211
 	?>
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 	<input type="hidden" name="blockedmode" value="<?php echo ($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || ($userdata['blockedafter'] < time() && $userdata['blockedafter'] != 0) || $userdata['failedlogins'] > 3) ? "1" : "0" ?>" />
215 215
 
216 216
 	<h1>
217
-        <i class="fa fa fa-user"></i><?= ($usernamedata['username'] ? $usernamedata['username'] . '<small>(' . $usernamedata['id'] . ')</small>' : $_lang['user_title']) ?>
217
+        <i class="fa fa fa-user"></i><?= ($usernamedata['username'] ? $usernamedata['username'].'<small>('.$usernamedata['id'].')</small>' : $_lang['user_title']) ?>
218 218
     </h1>
219 219
 
220 220
 	<?php echo $_style['actionbuttons']['dynamic']['user'] ?>
@@ -232,13 +232,13 @@  discard block
 block discarded – undo
232 232
 				<table border="0" cellspacing="0" cellpadding="3" class="table table--edit table--editUser">
233 233
 					<tr>
234 234
 						<td colspan="3"><span id="blocked" class="warning">
235
-							<?php if($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || $userdata['failedlogins'] > 3) { ?>
235
+							<?php if ($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || $userdata['failedlogins'] > 3) { ?>
236 236
 								<?php echo $_lang['user_is_blocked']; ?>
237 237
 							<?php } ?>
238 238
 							</span>
239 239
 							<br /></td>
240 240
 					</tr>
241
-					<?php if(!empty($userdata['id'])) { ?>
241
+					<?php if (!empty($userdata['id'])) { ?>
242 242
 						<tr id="showname" style="display: <?php echo ($modx->manager->action == '12' && (!isset($usernamedata['oldusername']) || $usernamedata['oldusername'] == $usernamedata['username'])) ? $displayStyle : 'none'; ?> ">
243 243
 							<td colspan="3"><i class="<?php echo $_style["icons_user"] ?>"></i>&nbsp;<b><?php echo $modx->htmlspecialchars(!empty($usernamedata['oldusername']) ? $usernamedata['oldusername'] : $usernamedata['username']); ?></b> - <span class="comment"><a href="javascript:;" onClick="changeName();return false;"><?php echo $_lang["change_name"]; ?></a></span>
244 244
 								<input type="hidden" name="oldusername" value="<?php echo $modx->htmlspecialchars(!empty($usernamedata['oldusername']) ? $usernamedata['oldusername'] : $usernamedata['username']); ?>" />
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
 						<td><input type="text" name="newusername" class="inputBox" value="<?php echo $modx->htmlspecialchars($usernamedata['username']); ?>" onChange='documentDirty=true;' maxlength="100" /></td>
252 252
 					</tr>
253 253
 					<tr>
254
-						<th><?php echo $modx->manager->action == '11' ? $_lang['password'] . ":" : $_lang['change_password_new'] . ":"; ?></th>
254
+						<th><?php echo $modx->manager->action == '11' ? $_lang['password'].":" : $_lang['change_password_new'].":"; ?></th>
255 255
 						<td>&nbsp;</td>
256 256
 						<td><input name="newpasswordcheck" type="checkbox" onClick="changestate(document.userform.newpassword);changePasswordState(document.userform.newpassword);"<?php echo $modx->manager->action == "11" ? " checked disabled" : ""; ?>>
257 257
 							<input type="hidden" name="newpassword" value="<?php echo $modx->manager->action == "11" ? 1 : 0; ?>" onChange="documentDirty=true;" />
@@ -305,8 +305,8 @@  discard block
 block discarded – undo
305 305
 							?>
306 306
 							<select name="role" class="inputBox" onChange='documentDirty=true;' style="width:300px">
307 307
 								<?php
308
-								while($row = $modx->db->getRow($rs)) {
309
-									if($modx->manager->action == '11') {
308
+								while ($row = $modx->db->getRow($rs)) {
309
+									if ($modx->manager->action == '11') {
310 310
 										$selectedtext = $row['id'] == '1' ? ' selected="selected"' : '';
311 311
 									} else {
312 312
 										$selectedtext = $row['id'] == $userdata['role'] ? "selected='selected'" : '';
@@ -360,8 +360,8 @@  discard block
 block discarded – undo
360 360
 								<?php $chosenCountry = isset($_POST['country']) ? $_POST['country'] : $userdata['country']; ?>
361 361
 								<option value="" <?php (!isset($chosenCountry) ? ' selected' : '') ?> >&nbsp;</option>
362 362
 								<?php
363
-								foreach($_country_lang as $key => $country) {
364
-									echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>";
363
+								foreach ($_country_lang as $key => $country) {
364
+									echo "<option value=\"$key\"".(isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '').">$country</option>";
365 365
 								}
366 366
 								?>
367 367
 							</select></td>
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
 						<td>&nbsp;</td>
388 388
 						<td><textarea type="text" name="comment" class="inputBox" rows="5" onChange="documentDirty=true;"><?php echo $modx->htmlspecialchars($userdata['comment']); ?></textarea></td>
389 389
 					</tr>
390
-					<?php if($modx->manager->action == '12') { ?>
390
+					<?php if ($modx->manager->action == '12') { ?>
391 391
 						<tr>
392 392
 							<th><?php echo $_lang['user_logincount']; ?>:</th>
393 393
 							<td>&nbsp;</td>
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
 						</tr>
425 425
 					<?php } ?>
426 426
 				</table>
427
-				<?php if($_GET['id'] == $modx->getLoginUserID()) { ?>
427
+				<?php if ($_GET['id'] == $modx->getLoginUserID()) { ?>
428 428
 					<p><?php echo $_lang['user_edit_self_msg']; ?></p>
429 429
 				<?php } ?>
430 430
 			</div>
@@ -441,8 +441,8 @@  discard block
 block discarded – undo
441 441
 								<?php
442 442
 								$activelang = !empty($usersettings['manager_language']) ? $usersettings['manager_language'] : '';
443 443
 								$dir = dir("includes/lang");
444
-								while($file = $dir->read()) {
445
-									if(strpos($file, ".inc.php") > 0) {
444
+								while ($file = $dir->read()) {
445
+									if (strpos($file, ".inc.php") > 0) {
446 446
 										$endpos = strpos($file, ".");
447 447
 										$languagename = substr($file, 0, $endpos);
448 448
 										$selectedtext = $languagename == $activelang ? "selected='selected'" : "";
@@ -529,17 +529,17 @@  discard block
 block discarded – undo
529 529
 								<option value=""></option>
530 530
 								<?php
531 531
 								$dir = dir("media/style/");
532
-								while($file = $dir->read()) {
533
-									if($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') {
532
+								while ($file = $dir->read()) {
533
+									if ($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') {
534 534
 										$themename = $file;
535
-										if($themename === 'common') {
535
+										if ($themename === 'common') {
536 536
 											continue;
537 537
 										}
538
-										$attr = 'value="' . $themename . '" ';
539
-										if(isset($usersettings['manager_theme']) && $themename == $usersettings['manager_theme']) {
538
+										$attr = 'value="'.$themename.'" ';
539
+										if (isset($usersettings['manager_theme']) && $themename == $usersettings['manager_theme']) {
540 540
 											$attr .= 'selected="selected" ';
541 541
 										}
542
-										echo "\t\t<option " . rtrim($attr) . '>' . ucwords(str_replace("_", " ", $themename)) . "</option>\n";
542
+										echo "\t\t<option ".rtrim($attr).'>'.ucwords(str_replace("_", " ", $themename))."</option>\n";
543 543
 									}
544 544
 								}
545 545
 								$dir->close();
@@ -580,12 +580,12 @@  discard block
 block discarded – undo
580 580
 						<td><select name="which_browser" class="inputBox" onChange="documentDirty=true;">
581 581
 								<?php
582 582
 								$selected = 'default' == $usersettings['which_browser'] || !$usersettings['which_browser'] ? ' selected="selected"' : '';
583
-								echo '<option value="default"' . $selected . '>' . $_lang['option_default'] . "</option>\n";
584
-								foreach(glob("media/browser/*", GLOB_ONLYDIR) as $dir) {
583
+								echo '<option value="default"'.$selected.'>'.$_lang['option_default']."</option>\n";
584
+								foreach (glob("media/browser/*", GLOB_ONLYDIR) as $dir) {
585 585
 									$dir = str_replace('\\', '/', $dir);
586 586
 									$browser_name = substr($dir, strrpos($dir, '/') + 1);
587 587
 									$selected = $browser_name == $usersettings['which_browser'] ? ' selected="selected"' : '';
588
-									echo '<option value="' . $browser_name . '"' . $selected . '>' . "{$browser_name}</option>\n";
588
+									echo '<option value="'.$browser_name.'"'.$selected.'>'."{$browser_name}</option>\n";
589 589
 								}
590 590
 								?>
591 591
 							</select></td>
@@ -612,7 +612,7 @@  discard block
 block discarded – undo
612 612
 					</tr>
613 613
 					<tr>
614 614
 						<td>&nbsp;</td>
615
-						<td class='comment'><?php echo $_lang["uploadable_images_message"] . $_lang["user_upload_message"] ?></td>
615
+						<td class='comment'><?php echo $_lang["uploadable_images_message"].$_lang["user_upload_message"] ?></td>
616 616
 					</tr>
617 617
 					<tr>
618 618
 						<th><?php echo $_lang["uploadable_media_title"] ?></th>
@@ -624,7 +624,7 @@  discard block
 block discarded – undo
624 624
 					</tr>
625 625
 					<tr>
626 626
 						<td>&nbsp;</td>
627
-						<td class='comment'><?php echo $_lang["uploadable_media_message"] . $_lang["user_upload_message"] ?></td>
627
+						<td class='comment'><?php echo $_lang["uploadable_media_message"].$_lang["user_upload_message"] ?></td>
628 628
 					</tr>
629 629
 					<tr>
630 630
 						<th><?php echo $_lang["uploadable_flash_title"] ?></th>
@@ -636,7 +636,7 @@  discard block
 block discarded – undo
636 636
 					</tr>
637 637
 					<tr>
638 638
 						<td>&nbsp;</td>
639
-						<td class='comment'><?php echo $_lang["uploadable_flash_message"] . $_lang["user_upload_message"] ?></td>
639
+						<td class='comment'><?php echo $_lang["uploadable_flash_message"].$_lang["user_upload_message"] ?></td>
640 640
 					</tr>
641 641
 					<tr>
642 642
 						<th><?php echo $_lang["uploadable_files_title"] ?></th>
@@ -648,7 +648,7 @@  discard block
 block discarded – undo
648 648
 					</tr>
649 649
 					<tr>
650 650
 						<td>&nbsp;</td>
651
-						<td class='comment'><?php echo $_lang["uploadable_files_message"] . $_lang["user_upload_message"] ?></td>
651
+						<td class='comment'><?php echo $_lang["uploadable_files_message"].$_lang["user_upload_message"] ?></td>
652 652
 					</tr>
653 653
 					<tr class='row2'>
654 654
 						<th><?php echo $_lang["upload_maxsize_title"] ?></th>
@@ -667,11 +667,11 @@  discard block
 block discarded – undo
667 667
 								$edt = isset ($usersettings["which_editor"]) ? $usersettings["which_editor"] : '';
668 668
 								// invoke OnRichTextEditorRegister event
669 669
 								$evtOut = $modx->invokeEvent("OnRichTextEditorRegister");
670
-								echo "<option value='none'" . ($edt == 'none' ? " selected='selected'" : "") . ">" . $_lang["none"] . "</option>\n";
671
-								if(is_array($evtOut)) {
672
-									for($i = 0; $i < count($evtOut); $i++) {
670
+								echo "<option value='none'".($edt == 'none' ? " selected='selected'" : "").">".$_lang["none"]."</option>\n";
671
+								if (is_array($evtOut)) {
672
+									for ($i = 0; $i < count($evtOut); $i++) {
673 673
 										$editor = $evtOut[$i];
674
-										echo "<option value='$editor'" . ($edt == $editor ? " selected='selected'" : "") . ">$editor</option>\n";
674
+										echo "<option value='$editor'".($edt == $editor ? " selected='selected'" : "").">$editor</option>\n";
675 675
 									}
676 676
 								}
677 677
 								?>
@@ -709,7 +709,7 @@  discard block
 block discarded – undo
709 709
 				<?php
710 710
 				// invoke OnInterfaceSettingsRender event
711 711
 				$evtOut = $modx->invokeEvent("OnInterfaceSettingsRender");
712
-				if(is_array($evtOut)) {
712
+				if (is_array($evtOut)) {
713 713
 					echo implode("", $evtOut);
714 714
 				}
715 715
 				?>
@@ -736,7 +736,7 @@  discard block
 block discarded – undo
736 736
 					function BrowseServer() {
737 737
 						var w = screen.width * 0.7;
738 738
 						var h = screen.height * 0.7;
739
-						OpenServerBrowser("<?php echo MODX_MANAGER_URL; ?>media/browser/<?php echo $which_browser;?>/browser.php?Type=images", w, h);
739
+						OpenServerBrowser("<?php echo MODX_MANAGER_URL; ?>media/browser/<?php echo $which_browser; ?>/browser.php?Type=images", w, h);
740 740
 					}
741 741
 
742 742
 					function SetUrl(url, width, height, alt) {
@@ -759,17 +759,17 @@  discard block
 block discarded – undo
759 759
 					</tr>
760 760
 				</table>
761 761
 			</div>
762
-			<?php if($use_udperms == 1) {
762
+			<?php if ($use_udperms == 1) {
763 763
 
764 764
 			$groupsarray = array();
765 765
 
766
-			if($modx->manager->action == '12') { // only do this bit if the user is being edited
766
+			if ($modx->manager->action == '12') { // only do this bit if the user is being edited
767 767
 				$rs = $modx->db->select('user_group', $modx->getFullTableName('member_groups'), "member='{$user}'");
768 768
 				$groupsarray = $modx->db->getColumn('user_group', $rs);
769 769
 			}
770 770
 			// retain selected doc groups between post
771
-			if(is_array($_POST['user_groups'])) {
772
-				foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v;
771
+			if (is_array($_POST['user_groups'])) {
772
+				foreach ($_POST['user_groups'] as $n => $v) $groupsarray[] = $v;
773 773
 			}
774 774
 			?>
775 775
 			<div class="tab-page" id="tabAccess">
@@ -778,8 +778,8 @@  discard block
 block discarded – undo
778 778
 				<p><?php echo $_lang['access_permissions_user_message'] ?></p>
779 779
 				<?php
780 780
 				$rs = $modx->db->select('name, id', $modx->getFullTableName('membergroup_names'), '', 'name');
781
-				while($row = $modx->db->getRow($rs)) {
782
-					echo "<label><input type='checkbox' name='user_groups[]' value='" . $row['id'] . "'" . (in_array($row['id'], $groupsarray) ? " checked='checked'" : "") . " />" . $row['name'] . "</label><br />";
781
+				while ($row = $modx->db->getRow($rs)) {
782
+					echo "<label><input type='checkbox' name='user_groups[]' value='".$row['id']."'".(in_array($row['id'], $groupsarray) ? " checked='checked'" : "")." />".$row['name']."</label><br />";
783 783
 				}
784 784
 				}
785 785
 				?>
@@ -792,7 +792,7 @@  discard block
 block discarded – undo
792 792
 	$evtOut = $modx->invokeEvent("OnUserFormRender", array(
793 793
 		"id" => $user
794 794
 	));
795
-	if(is_array($evtOut)) {
795
+	if (is_array($evtOut)) {
796 796
 		echo implode("", $evtOut);
797 797
 	}
798 798
 	?>
Please login to merge, or discard this patch.
Braces   +8 added lines, -3 removed lines patch added patch discarded remove patch
@@ -39,7 +39,9 @@  discard block
 block discarded – undo
39 39
 	// get user settings
40 40
 	$rs = $modx->db->select('*', $modx->getFullTableName('user_settings'), "user = '{$user}'");
41 41
 	$usersettings = array();
42
-	while($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value'];
42
+	while($row = $modx->db->getRow($rs)) {
43
+	    $usersettings[$row['setting_name']] = $row['setting_value'];
44
+	}
43 45
 	// manually extract so that user display settings are not overwritten
44 46
 	foreach($usersettings as $k => $v) {
45 47
 		if($k != 'manager_language' && $k != 'manager_theme') {
@@ -763,13 +765,16 @@  discard block
 block discarded – undo
763 765
 
764 766
 			$groupsarray = array();
765 767
 
766
-			if($modx->manager->action == '12') { // only do this bit if the user is being edited
768
+			if($modx->manager->action == '12') {
769
+// only do this bit if the user is being edited
767 770
 				$rs = $modx->db->select('user_group', $modx->getFullTableName('member_groups'), "member='{$user}'");
768 771
 				$groupsarray = $modx->db->getColumn('user_group', $rs);
769 772
 			}
770 773
 			// retain selected doc groups between post
771 774
 			if(is_array($_POST['user_groups'])) {
772
-				foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v;
775
+				foreach($_POST['user_groups'] as $n => $v) {
776
+				    $groupsarray[] = $v;
777
+				}
773 778
 			}
774 779
 			?>
775 780
 			<div class="tab-page" id="tabAccess">
Please login to merge, or discard this patch.
manager/includes/header.inc.php 2 patches
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -20,28 +20,28 @@  discard block
 block discarded – undo
20 20
 $body_class = '';
21 21
 $theme_modes = array('', 'lightness', 'light', 'dark', 'darkness');
22 22
 if (!empty($theme_modes[$_COOKIE['MODX_themeMode']])) {
23
-    $body_class .= ' ' . $theme_modes[$_COOKIE['MODX_themeMode']];
23
+    $body_class .= ' '.$theme_modes[$_COOKIE['MODX_themeMode']];
24 24
 } elseif (!empty($theme_modes[$modx->config['manager_theme_mode']])) {
25
-    $body_class .= ' ' . $theme_modes[$modx->config['manager_theme_mode']];
25
+    $body_class .= ' '.$theme_modes[$modx->config['manager_theme_mode']];
26 26
 }
27 27
 
28
-$css = 'media/style/' . $modx->config['manager_theme'] . '/style.css?v=' . $lastInstallTime;
28
+$css = 'media/style/'.$modx->config['manager_theme'].'/style.css?v='.$lastInstallTime;
29 29
 
30 30
 if ($modx->config['manager_theme'] == 'default') {
31
-    if (!file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')
32
-        && is_writable(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css')) {
31
+    if (!file_exists(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css')
32
+        && is_writable(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css')) {
33 33
         $files = array(
34
-            'bootstrap' => MODX_MANAGER_PATH . 'media/style/common/bootstrap/css/bootstrap.min.css',
35
-            'font-awesome' => MODX_MANAGER_PATH . 'media/style/common/font-awesome/css/font-awesome.min.css',
36
-            'fonts' => MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/fonts.css',
37
-            'forms' => MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/forms.css',
38
-            'mainmenu' => MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/mainmenu.css',
39
-            'tree' => MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/tree.css',
40
-            'custom' => MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/custom.css',
41
-            'tabpane' => MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/tabpane.css',
42
-            'contextmenu' => MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/contextmenu.css',
43
-            'index' => MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/index.css',
44
-            'main' => MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/main.css'
34
+            'bootstrap' => MODX_MANAGER_PATH.'media/style/common/bootstrap/css/bootstrap.min.css',
35
+            'font-awesome' => MODX_MANAGER_PATH.'media/style/common/font-awesome/css/font-awesome.min.css',
36
+            'fonts' => MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/fonts.css',
37
+            'forms' => MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/forms.css',
38
+            'mainmenu' => MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/mainmenu.css',
39
+            'tree' => MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/tree.css',
40
+            'custom' => MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/custom.css',
41
+            'tabpane' => MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/tabpane.css',
42
+            'contextmenu' => MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/contextmenu.css',
43
+            'index' => MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/index.css',
44
+            'main' => MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/main.css'
45 45
         );
46 46
         $evtOut = $modx->invokeEvent('OnBeforeMinifyCss', array(
47 47
             'files' => $files,
@@ -58,16 +58,16 @@  discard block
 block discarded – undo
58 58
             default:
59 59
                 $modx->webAlertAndQuit(sprintf($_lang['invalid_event_response'], 'OnBeforeMinifyManagerCss'));
60 60
         }
61
-        require_once MODX_BASE_PATH . 'assets/lib/Formatter/CSSMinify.php';
61
+        require_once MODX_BASE_PATH.'assets/lib/Formatter/CSSMinify.php';
62 62
         $minifier = new Formatter\CSSMinify($files);
63 63
         $css = $minifier->minify();
64 64
         file_put_contents(
65
-            MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css',
65
+            MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css',
66 66
             $css
67 67
         );
68 68
     }
69
-    if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) {
70
-        $css = 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css?v=' . $lastInstallTime;
69
+    if (file_exists(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css')) {
70
+        $css = 'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css?v='.$lastInstallTime;
71 71
     }
72 72
 }
73 73
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
     <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
83 83
     <link rel="stylesheet" type="text/css" href="<?= $css ?>"/>
84 84
     <script type="text/javascript" src="media/script/tabpane.js"></script>
85
-    <?= sprintf('<script type="text/javascript" src="%s"></script>' . "\n", $modx->config['mgr_jquery_path']) ?>
85
+    <?= sprintf('<script type="text/javascript" src="%s"></script>'."\n", $modx->config['mgr_jquery_path']) ?>
86 86
     <?php if ($modx->config['show_picker'] != "0") { ?>
87 87
         <script src="media/style/<?= $modx->config['manager_theme'] ?>/js/color.switcher.js"
88 88
                 type="text/javascript"></script>
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
     <?php } ?>
96 96
 
97 97
     <!-- OnManagerMainFrameHeaderHTMLBlock -->
98
-    <?= $onManagerMainFrameHeaderHTMLBlock . "\n" ?>
98
+    <?= $onManagerMainFrameHeaderHTMLBlock."\n" ?>
99 99
 
100 100
     <script type="text/javascript">
101 101
       if (!evo) {
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
     <script>
126 126
         <?php
127 127
         if (isset($_REQUEST['r']) && preg_match('@^[0-9]+$@', $_REQUEST['r'])) {
128
-            echo 'doRefresh(' . $_REQUEST['r'] . ");\n";
128
+            echo 'doRefresh('.$_REQUEST['r'].");\n";
129 129
         }
130 130
         ?>
131 131
     </script>
Please login to merge, or discard this patch.
Braces   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />
4 4
     Please use the EVO Content Manager instead of accessing this file directly.");
5 5
 }
@@ -10,26 +10,26 @@  discard block
 block discarded – undo
10 10
 $modx_textdir = isset($modx_textdir) ? $modx_textdir : null;
11 11
 $onManagerMainFrameHeaderHTMLBlock = is_array($evtOut) ? implode("\n", $evtOut) : '';
12 12
 $textdir = $modx_textdir === 'rtl' ? 'rtl' : 'ltr';
13
-if (!isset($modx->config['mgr_jquery_path'])) {
13
+if (!isset($modx->config['mgr_jquery_path'])) {
14 14
     $modx->config['mgr_jquery_path'] = 'media/script/jquery/jquery.min.js';
15 15
 }
16
-if (!isset($modx->config['mgr_date_picker_path'])) {
16
+if (!isset($modx->config['mgr_date_picker_path'])) {
17 17
     $modx->config['mgr_date_picker_path'] = 'media/script/air-datepicker/datepicker.inc.php';
18 18
 }
19 19
 
20 20
 $body_class = '';
21 21
 $theme_modes = array('', 'lightness', 'light', 'dark', 'darkness');
22
-if (!empty($theme_modes[$_COOKIE['MODX_themeMode']])) {
22
+if (!empty($theme_modes[$_COOKIE['MODX_themeMode']])) {
23 23
     $body_class .= ' ' . $theme_modes[$_COOKIE['MODX_themeMode']];
24
-} elseif (!empty($theme_modes[$modx->config['manager_theme_mode']])) {
24
+} elseif (!empty($theme_modes[$modx->config['manager_theme_mode']])) {
25 25
     $body_class .= ' ' . $theme_modes[$modx->config['manager_theme_mode']];
26 26
 }
27 27
 
28 28
 $css = 'media/style/' . $modx->config['manager_theme'] . '/style.css?v=' . $lastInstallTime;
29 29
 
30
-if ($modx->config['manager_theme'] == 'default') {
30
+if ($modx->config['manager_theme'] == 'default') {
31 31
     if (!file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')
32
-        && is_writable(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css')) {
32
+        && is_writable(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css')) {
33 33
         $files = array(
34 34
             'bootstrap' => MODX_MANAGER_PATH . 'media/style/common/bootstrap/css/bootstrap.min.css',
35 35
             'font-awesome' => MODX_MANAGER_PATH . 'media/style/common/font-awesome/css/font-awesome.min.css',
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
             'source' => 'manager',
49 49
             'theme' => $modx->config['manager_theme']
50 50
         ));
51
-        switch (true) {
51
+        switch (true) {
52 52
             case empty($evtOut):
53 53
             case is_array($evtOut) && count($evtOut) === 0:
54 54
                 break;
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
             $css
67 67
         );
68 68
     }
69
-    if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) {
69
+    if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) {
70 70
         $css = 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css?v=' . $lastInstallTime;
71 71
     }
72 72
 }
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
     <script src="media/script/main.js"></script>
125 125
     <script>
126 126
         <?php
127
-        if (isset($_REQUEST['r']) && preg_match('@^[0-9]+$@', $_REQUEST['r'])) {
127
+        if (isset($_REQUEST['r']) && preg_match('@^[0-9]+$@', $_REQUEST['r'])) {
128 128
             echo 'doRefresh(' . $_REQUEST['r'] . ");\n";
129 129
         }
130 130
         ?>
Please login to merge, or discard this patch.
manager/actions/user_management.static.php 2 patches
Indentation   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3
-	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
3
+    die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if(!$modx->hasPermission('edit_user')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 // initialize page view state - the $_PAGE object
@@ -11,12 +11,12 @@  discard block
 block discarded – undo
11 11
 
12 12
 // get and save search string
13 13
 if($_REQUEST['op'] == 'reset') {
14
-	$query = '';
15
-	$_PAGE['vs']['search'] = '';
14
+    $query = '';
15
+    $_PAGE['vs']['search'] = '';
16 16
 } else {
17
-	$query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search'];
18
-	$sqlQuery = $modx->db->escape($query);
19
-	$_PAGE['vs']['search'] = $query;
17
+    $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search'];
18
+    $sqlQuery = $modx->db->escape($query);
19
+    $_PAGE['vs']['search'] = $query;
20 20
 }
21 21
 
22 22
 // get & save listmode
@@ -120,55 +120,55 @@  discard block
 block discarded – undo
120 120
 			<div class="row">
121 121
 				<div class="table-responsive">
122 122
 					<?php
123
-					$where = "";
124
-					if(!$modx->hasPermission('save_role')) {
125
-						$where .= (empty($where) ? "" : " AND ") . "mua.role != 1";
126
-					}
127
-					if(!empty($sqlQuery)) {
128
-						$where .= (empty($where) ? "" : " AND ") . "((mu.username LIKE '{$sqlQuery}%') OR (mua.fullname LIKE '%{$sqlQuery}%') OR (mua.email LIKE '{$sqlQuery}%'))";
129
-					}
130
-					$ds = $modx->db->select("mu.id, mu.username, rname.name AS role, mua.fullname, mua.email, IF(mua.blocked,'{$_lang['yes']}','-') as blocked, mua.thislogin, mua.logincount", $modx->getFullTableName('manager_users') . " AS mu 
123
+                    $where = "";
124
+                    if(!$modx->hasPermission('save_role')) {
125
+                        $where .= (empty($where) ? "" : " AND ") . "mua.role != 1";
126
+                    }
127
+                    if(!empty($sqlQuery)) {
128
+                        $where .= (empty($where) ? "" : " AND ") . "((mu.username LIKE '{$sqlQuery}%') OR (mua.fullname LIKE '%{$sqlQuery}%') OR (mua.email LIKE '{$sqlQuery}%'))";
129
+                    }
130
+                    $ds = $modx->db->select("mu.id, mu.username, rname.name AS role, mua.fullname, mua.email, IF(mua.blocked,'{$_lang['yes']}','-') as blocked, mua.thislogin, mua.logincount", $modx->getFullTableName('manager_users') . " AS mu 
131 131
 			INNER JOIN " . $modx->getFullTableName('user_attributes') . " AS mua ON mua.internalKey=mu.id 
132 132
 			LEFT JOIN " . $modx->getFullTableName('user_roles') . " AS rname ON mua.role=rname.id", $where, 'mua.blocked ASC, mua.thislogin DESC');
133
-					include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php";
134
-					$grd = new DataGrid('', $ds, $modx->config['number_of_results']); // set page size to 0 t show all items
135
-					$grd->noRecordMsg = $_lang["no_records_found"];
136
-					$grd->cssClass = "table data";
137
-					$grd->columnHeaderClass = "tableHeader";
138
-					$grd->itemClass = "tableItem";
139
-					$grd->altItemClass = "tableAltItem";
140
-					$grd->fields = "id,username,fullname,role,email,thislogin,logincount,blocked";
141
-					$grd->columns = implode(',', array(
142
-						$_lang["icon"],
143
-						$_lang["name"],
144
-						$_lang["user_full_name"],
145
-						$_lang['role'],
146
-						$_lang["email"],
147
-						$_lang["user_prevlogin"],
148
-						$_lang["user_logincount"],
149
-						$_lang["user_block"]
150
-					));
151
-					$grd->colWidths = "1%,,,,,1%,1%,1%";
152
-					$grd->colAligns = "center,,,,,right' nowrap='nowrap,right,center";
153
-					$grd->colTypes = implode('||', array(
154
-						'template:<a class="gridRowIcon" href="javascript:;" onclick="return showContentMenu([+id+],event);" title="' . $_lang['click_to_context'] . '"><i class="' . $_style['icons_user'] . '"></i></a>',
155
-						'template:<a href="index.php?a=12&id=[+id+]" title="' . $_lang['click_to_edit_title'] . '">[+value+]</a>',
156
-						'template:[+fullname+]',
157
-						'template:[+role+]',
158
-						'template:[+email+]',
159
-						'date: ' . $modx->toDateFormat('[+thislogin+]', 'formatOnly') . ' %H:%M',
160
-						'template:[+logincount+]',
161
-						'template:[+blocked+]'
162
-					));
163
-					if($listmode == '1') {
164
-						$grd->pageSize = 0;
165
-					}
166
-					if($_REQUEST['op'] == 'reset') {
167
-						$grd->pageNumber = 1;
168
-					}
169
-					// render grid
170
-					echo $grd->render();
171
-					?>
133
+                    include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php";
134
+                    $grd = new DataGrid('', $ds, $modx->config['number_of_results']); // set page size to 0 t show all items
135
+                    $grd->noRecordMsg = $_lang["no_records_found"];
136
+                    $grd->cssClass = "table data";
137
+                    $grd->columnHeaderClass = "tableHeader";
138
+                    $grd->itemClass = "tableItem";
139
+                    $grd->altItemClass = "tableAltItem";
140
+                    $grd->fields = "id,username,fullname,role,email,thislogin,logincount,blocked";
141
+                    $grd->columns = implode(',', array(
142
+                        $_lang["icon"],
143
+                        $_lang["name"],
144
+                        $_lang["user_full_name"],
145
+                        $_lang['role'],
146
+                        $_lang["email"],
147
+                        $_lang["user_prevlogin"],
148
+                        $_lang["user_logincount"],
149
+                        $_lang["user_block"]
150
+                    ));
151
+                    $grd->colWidths = "1%,,,,,1%,1%,1%";
152
+                    $grd->colAligns = "center,,,,,right' nowrap='nowrap,right,center";
153
+                    $grd->colTypes = implode('||', array(
154
+                        'template:<a class="gridRowIcon" href="javascript:;" onclick="return showContentMenu([+id+],event);" title="' . $_lang['click_to_context'] . '"><i class="' . $_style['icons_user'] . '"></i></a>',
155
+                        'template:<a href="index.php?a=12&id=[+id+]" title="' . $_lang['click_to_edit_title'] . '">[+value+]</a>',
156
+                        'template:[+fullname+]',
157
+                        'template:[+role+]',
158
+                        'template:[+email+]',
159
+                        'date: ' . $modx->toDateFormat('[+thislogin+]', 'formatOnly') . ' %H:%M',
160
+                        'template:[+logincount+]',
161
+                        'template:[+blocked+]'
162
+                    ));
163
+                    if($listmode == '1') {
164
+                        $grd->pageSize = 0;
165
+                    }
166
+                    if($_REQUEST['op'] == 'reset') {
167
+                        $grd->pageNumber = 1;
168
+                    }
169
+                    // render grid
170
+                    echo $grd->render();
171
+                    ?>
172 172
 				</div>
173 173
 			</div>
174 174
 		</div>
Please login to merge, or discard this patch.
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
 	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5
-if(!$modx->hasPermission('edit_user')) {
5
+if (!$modx->hasPermission('edit_user')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 $modx->manager->initPageViewState();
11 11
 
12 12
 // get and save search string
13
-if($_REQUEST['op'] == 'reset') {
13
+if ($_REQUEST['op'] == 'reset') {
14 14
 	$query = '';
15 15
 	$_PAGE['vs']['search'] = '';
16 16
 } else {
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
 
27 27
 // context menu
28
-include_once MODX_MANAGER_PATH . "includes/controls/contextmenu.php";
28
+include_once MODX_MANAGER_PATH."includes/controls/contextmenu.php";
29 29
 $cm = new ContextMenu("cntxm", 150);
30 30
 $cm->addItem($_lang["edit"], "js:menuAction(1)", $_style["actions_edit"], (!$modx->hasPermission('edit_user') ? 1 : 0));
31 31
 $cm->addItem($_lang["delete"], "js:menuAction(2)", $_style["actions_delete"], (!$modx->hasPermission('delete_user') ? 1 : 0));
@@ -121,16 +121,16 @@  discard block
 block discarded – undo
121 121
 				<div class="table-responsive">
122 122
 					<?php
123 123
 					$where = "";
124
-					if(!$modx->hasPermission('save_role')) {
125
-						$where .= (empty($where) ? "" : " AND ") . "mua.role != 1";
124
+					if (!$modx->hasPermission('save_role')) {
125
+						$where .= (empty($where) ? "" : " AND ")."mua.role != 1";
126 126
 					}
127
-					if(!empty($sqlQuery)) {
128
-						$where .= (empty($where) ? "" : " AND ") . "((mu.username LIKE '{$sqlQuery}%') OR (mua.fullname LIKE '%{$sqlQuery}%') OR (mua.email LIKE '{$sqlQuery}%'))";
127
+					if (!empty($sqlQuery)) {
128
+						$where .= (empty($where) ? "" : " AND ")."((mu.username LIKE '{$sqlQuery}%') OR (mua.fullname LIKE '%{$sqlQuery}%') OR (mua.email LIKE '{$sqlQuery}%'))";
129 129
 					}
130
-					$ds = $modx->db->select("mu.id, mu.username, rname.name AS role, mua.fullname, mua.email, IF(mua.blocked,'{$_lang['yes']}','-') as blocked, mua.thislogin, mua.logincount", $modx->getFullTableName('manager_users') . " AS mu 
131
-			INNER JOIN " . $modx->getFullTableName('user_attributes') . " AS mua ON mua.internalKey=mu.id 
132
-			LEFT JOIN " . $modx->getFullTableName('user_roles') . " AS rname ON mua.role=rname.id", $where, 'mua.blocked ASC, mua.thislogin DESC');
133
-					include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php";
130
+					$ds = $modx->db->select("mu.id, mu.username, rname.name AS role, mua.fullname, mua.email, IF(mua.blocked,'{$_lang['yes']}','-') as blocked, mua.thislogin, mua.logincount", $modx->getFullTableName('manager_users')." AS mu 
131
+			INNER JOIN " . $modx->getFullTableName('user_attributes')." AS mua ON mua.internalKey=mu.id 
132
+			LEFT JOIN " . $modx->getFullTableName('user_roles')." AS rname ON mua.role=rname.id", $where, 'mua.blocked ASC, mua.thislogin DESC');
133
+					include_once MODX_MANAGER_PATH."includes/controls/datagrid.class.php";
134 134
 					$grd = new DataGrid('', $ds, $modx->config['number_of_results']); // set page size to 0 t show all items
135 135
 					$grd->noRecordMsg = $_lang["no_records_found"];
136 136
 					$grd->cssClass = "table data";
@@ -151,19 +151,19 @@  discard block
 block discarded – undo
151 151
 					$grd->colWidths = "1%,,,,,1%,1%,1%";
152 152
 					$grd->colAligns = "center,,,,,right' nowrap='nowrap,right,center";
153 153
 					$grd->colTypes = implode('||', array(
154
-						'template:<a class="gridRowIcon" href="javascript:;" onclick="return showContentMenu([+id+],event);" title="' . $_lang['click_to_context'] . '"><i class="' . $_style['icons_user'] . '"></i></a>',
155
-						'template:<a href="index.php?a=12&id=[+id+]" title="' . $_lang['click_to_edit_title'] . '">[+value+]</a>',
154
+						'template:<a class="gridRowIcon" href="javascript:;" onclick="return showContentMenu([+id+],event);" title="'.$_lang['click_to_context'].'"><i class="'.$_style['icons_user'].'"></i></a>',
155
+						'template:<a href="index.php?a=12&id=[+id+]" title="'.$_lang['click_to_edit_title'].'">[+value+]</a>',
156 156
 						'template:[+fullname+]',
157 157
 						'template:[+role+]',
158 158
 						'template:[+email+]',
159
-						'date: ' . $modx->toDateFormat('[+thislogin+]', 'formatOnly') . ' %H:%M',
159
+						'date: '.$modx->toDateFormat('[+thislogin+]', 'formatOnly').' %H:%M',
160 160
 						'template:[+logincount+]',
161 161
 						'template:[+blocked+]'
162 162
 					));
163
-					if($listmode == '1') {
163
+					if ($listmode == '1') {
164 164
 						$grd->pageSize = 0;
165 165
 					}
166
-					if($_REQUEST['op'] == 'reset') {
166
+					if ($_REQUEST['op'] == 'reset') {
167 167
 						$grd->pageNumber = 1;
168 168
 					}
169 169
 					// render grid
Please login to merge, or discard this patch.
manager/actions/web_user_management.static.php 2 patches
Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3
-	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
3
+    die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if(!$modx->hasPermission('edit_web_user')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 // initialize page view state - the $_PAGE object
@@ -11,12 +11,12 @@  discard block
 block discarded – undo
11 11
 
12 12
 // get and save search string
13 13
 if($_REQUEST['op'] == 'reset') {
14
-	$query = '';
15
-	$_PAGE['vs']['search'] = '';
14
+    $query = '';
15
+    $_PAGE['vs']['search'] = '';
16 16
 } else {
17
-	$query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search'];
18
-	$sqlQuery = $modx->db->escape($query);
19
-	$_PAGE['vs']['search'] = $query;
17
+    $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search'];
18
+    $sqlQuery = $modx->db->escape($query);
19
+    $_PAGE['vs']['search'] = $query;
20 20
 }
21 21
 
22 22
 // get & save listmode
@@ -120,30 +120,30 @@  discard block
 block discarded – undo
120 120
 			<div class="row">
121 121
 				<div class="table-responsive">
122 122
 					<?php
123
-					$ds = $modx->db->select("wu.id, wu.username, wua.fullname, wua.email, wua.lastlogin, wua.logincount, IF(wua.blocked,'{$_lang['yes']}','-') as 'blocked'", $modx->getFullTableName("web_users") . " wu 
123
+                    $ds = $modx->db->select("wu.id, wu.username, wua.fullname, wua.email, wua.lastlogin, wua.logincount, IF(wua.blocked,'{$_lang['yes']}','-') as 'blocked'", $modx->getFullTableName("web_users") . " wu 
124 124
 			INNER JOIN " . $modx->getFullTableName("web_user_attributes") . " wua ON wua.internalKey=wu.id", ($sqlQuery ? "(wu.username LIKE '{$sqlQuery}%') OR (wua.fullname LIKE '%{$sqlQuery}%') OR (wua.email LIKE '%{$sqlQuery}%')" : ""), 'username');
125
-					include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php";
126
-					$grd = new DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items
127
-					$grd->noRecordMsg = $_lang["no_records_found"];
128
-					$grd->cssClass = "table data";
129
-					$grd->columnHeaderClass = "tableHeader";
130
-					$grd->itemClass = "tableItem";
131
-					$grd->altItemClass = "tableAltItem";
132
-					$grd->fields = "id,username,fullname,email,lastlogin,logincount,blocked";
133
-					$grd->columns = $_lang["icon"] . " ," . $_lang["name"] . " ," . $_lang["user_full_name"] . " ," . $_lang["email"] . " ," . $_lang["user_prevlogin"] . " ," . $_lang["user_logincount"] . " ," . $_lang["user_block"];
134
-					$grd->colWidths = "1%,,,,1%,1%,1%";
135
-					$grd->colAligns = "center,,,,right' nowrap='nowrap,right,center";
136
-					$grd->colTypes = "template:<a class='gridRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='" . $_lang["click_to_context"] . "'><i class='" . $_style["icons_user"] . "'></i></a>||template:<a href='index.php?a=88&id=[+id+]' title='" . $_lang["click_to_edit_title"] . "'>[+value+]</a>||template:[+fullname+]||template:[+email+]||date: " . $modx->toDateFormat('[+thislogin+]', 'formatOnly') . 
137
-					" %H:%M";
138
-					if($listmode == '1') {
139
-						$grd->pageSize = 0;
140
-					}
141
-					if($_REQUEST['op'] == 'reset') {
142
-						$grd->pageNumber = 1;
143
-					}
144
-					// render grid
145
-					echo $grd->render();
146
-					?>
125
+                    include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php";
126
+                    $grd = new DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items
127
+                    $grd->noRecordMsg = $_lang["no_records_found"];
128
+                    $grd->cssClass = "table data";
129
+                    $grd->columnHeaderClass = "tableHeader";
130
+                    $grd->itemClass = "tableItem";
131
+                    $grd->altItemClass = "tableAltItem";
132
+                    $grd->fields = "id,username,fullname,email,lastlogin,logincount,blocked";
133
+                    $grd->columns = $_lang["icon"] . " ," . $_lang["name"] . " ," . $_lang["user_full_name"] . " ," . $_lang["email"] . " ," . $_lang["user_prevlogin"] . " ," . $_lang["user_logincount"] . " ," . $_lang["user_block"];
134
+                    $grd->colWidths = "1%,,,,1%,1%,1%";
135
+                    $grd->colAligns = "center,,,,right' nowrap='nowrap,right,center";
136
+                    $grd->colTypes = "template:<a class='gridRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='" . $_lang["click_to_context"] . "'><i class='" . $_style["icons_user"] . "'></i></a>||template:<a href='index.php?a=88&id=[+id+]' title='" . $_lang["click_to_edit_title"] . "'>[+value+]</a>||template:[+fullname+]||template:[+email+]||date: " . $modx->toDateFormat('[+thislogin+]', 'formatOnly') . 
137
+                    " %H:%M";
138
+                    if($listmode == '1') {
139
+                        $grd->pageSize = 0;
140
+                    }
141
+                    if($_REQUEST['op'] == 'reset') {
142
+                        $grd->pageNumber = 1;
143
+                    }
144
+                    // render grid
145
+                    echo $grd->render();
146
+                    ?>
147 147
 				</div>
148 148
 			</div>
149 149
 		</div>
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
 	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5
-if(!$modx->hasPermission('edit_web_user')) {
5
+if (!$modx->hasPermission('edit_web_user')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 $modx->manager->initPageViewState();
11 11
 
12 12
 // get and save search string
13
-if($_REQUEST['op'] == 'reset') {
13
+if ($_REQUEST['op'] == 'reset') {
14 14
 	$query = '';
15 15
 	$_PAGE['vs']['search'] = '';
16 16
 } else {
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
 
27 27
 // context menu
28
-include_once MODX_MANAGER_PATH . "includes/controls/contextmenu.php";
28
+include_once MODX_MANAGER_PATH."includes/controls/contextmenu.php";
29 29
 $cm = new ContextMenu("cntxm", 150);
30 30
 $cm->addItem($_lang["edit"], "js:menuAction(1)", $_style["actions_edit"], (!$modx->hasPermission('edit_user') ? 1 : 0));
31 31
 $cm->addItem($_lang["delete"], "js:menuAction(2)", $_style["actions_delete"], (!$modx->hasPermission('delete_user') ? 1 : 0));
@@ -120,9 +120,9 @@  discard block
 block discarded – undo
120 120
 			<div class="row">
121 121
 				<div class="table-responsive">
122 122
 					<?php
123
-					$ds = $modx->db->select("wu.id, wu.username, wua.fullname, wua.email, wua.lastlogin, wua.logincount, IF(wua.blocked,'{$_lang['yes']}','-') as 'blocked'", $modx->getFullTableName("web_users") . " wu 
124
-			INNER JOIN " . $modx->getFullTableName("web_user_attributes") . " wua ON wua.internalKey=wu.id", ($sqlQuery ? "(wu.username LIKE '{$sqlQuery}%') OR (wua.fullname LIKE '%{$sqlQuery}%') OR (wua.email LIKE '%{$sqlQuery}%')" : ""), 'username');
125
-					include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php";
123
+					$ds = $modx->db->select("wu.id, wu.username, wua.fullname, wua.email, wua.lastlogin, wua.logincount, IF(wua.blocked,'{$_lang['yes']}','-') as 'blocked'", $modx->getFullTableName("web_users")." wu 
124
+			INNER JOIN " . $modx->getFullTableName("web_user_attributes")." wua ON wua.internalKey=wu.id", ($sqlQuery ? "(wu.username LIKE '{$sqlQuery}%') OR (wua.fullname LIKE '%{$sqlQuery}%') OR (wua.email LIKE '%{$sqlQuery}%')" : ""), 'username');
125
+					include_once MODX_MANAGER_PATH."includes/controls/datagrid.class.php";
126 126
 					$grd = new DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items
127 127
 					$grd->noRecordMsg = $_lang["no_records_found"];
128 128
 					$grd->cssClass = "table data";
@@ -130,15 +130,15 @@  discard block
 block discarded – undo
130 130
 					$grd->itemClass = "tableItem";
131 131
 					$grd->altItemClass = "tableAltItem";
132 132
 					$grd->fields = "id,username,fullname,email,lastlogin,logincount,blocked";
133
-					$grd->columns = $_lang["icon"] . " ," . $_lang["name"] . " ," . $_lang["user_full_name"] . " ," . $_lang["email"] . " ," . $_lang["user_prevlogin"] . " ," . $_lang["user_logincount"] . " ," . $_lang["user_block"];
133
+					$grd->columns = $_lang["icon"]." ,".$_lang["name"]." ,".$_lang["user_full_name"]." ,".$_lang["email"]." ,".$_lang["user_prevlogin"]." ,".$_lang["user_logincount"]." ,".$_lang["user_block"];
134 134
 					$grd->colWidths = "1%,,,,1%,1%,1%";
135 135
 					$grd->colAligns = "center,,,,right' nowrap='nowrap,right,center";
136
-					$grd->colTypes = "template:<a class='gridRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='" . $_lang["click_to_context"] . "'><i class='" . $_style["icons_user"] . "'></i></a>||template:<a href='index.php?a=88&id=[+id+]' title='" . $_lang["click_to_edit_title"] . "'>[+value+]</a>||template:[+fullname+]||template:[+email+]||date: " . $modx->toDateFormat('[+thislogin+]', 'formatOnly') . 
136
+					$grd->colTypes = "template:<a class='gridRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='".$_lang["click_to_context"]."'><i class='".$_style["icons_user"]."'></i></a>||template:<a href='index.php?a=88&id=[+id+]' title='".$_lang["click_to_edit_title"]."'>[+value+]</a>||template:[+fullname+]||template:[+email+]||date: ".$modx->toDateFormat('[+thislogin+]', 'formatOnly'). 
137 137
 					" %H:%M";
138
-					if($listmode == '1') {
138
+					if ($listmode == '1') {
139 139
 						$grd->pageSize = 0;
140 140
 					}
141
-					if($_REQUEST['op'] == 'reset') {
141
+					if ($_REQUEST['op'] == 'reset') {
142 142
 						$grd->pageNumber = 1;
143 143
 					}
144 144
 					// render grid
Please login to merge, or discard this patch.
manager/actions/files.dynamic.php 3 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -745,7 +745,7 @@  discard block
 block discarded – undo
745 745
 if(!function_exists('removeLastPath')) {
746 746
     /**
747 747
      * @param string $string
748
-     * @return bool|string
748
+     * @return string|false
749 749
      */
750 750
     function removeLastPath($string)
751 751
     {
@@ -763,7 +763,7 @@  discard block
 block discarded – undo
763 763
 if(!function_exists('getExtension')) {
764 764
     /**
765 765
      * @param string $string
766
-     * @return bool|string
766
+     * @return string|false
767 767
      */
768 768
     function getExtension($string)
769 769
     {
Please login to merge, or discard this patch.
Spacing   +125 added lines, -125 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if (!$modx->hasPermission('file_manager')) {
@@ -9,15 +9,15 @@  discard block
 block discarded – undo
9 9
 $newToken = makeToken();
10 10
 
11 11
 // settings
12
-$theme_image_path = $modx->config['site_manager_url'] . 'media/style/' . $modx->config['manager_theme'] . '/images/';
12
+$theme_image_path = $modx->config['site_manager_url'].'media/style/'.$modx->config['manager_theme'].'/images/';
13 13
 $excludes = array(
14 14
     '.',
15 15
     '..',
16 16
     '.svn'
17 17
 );
18
-$alias_suffix = (!empty($friendly_url_suffix)) ? ',' . ltrim($friendly_url_suffix, '.') : '';
19
-$editablefiles = explode(',', 'txt,php,tpl,less,sass,shtml,html,htm,xml,js,css,pageCache,htaccess,json,ini' . $alias_suffix);
20
-$inlineviewablefiles = explode(',', 'txt,php,tpl,less,sass,html,htm,xml,js,css,pageCache,htaccess,json,ini' . $alias_suffix);
18
+$alias_suffix = (!empty($friendly_url_suffix)) ? ','.ltrim($friendly_url_suffix, '.') : '';
19
+$editablefiles = explode(',', 'txt,php,tpl,less,sass,shtml,html,htm,xml,js,css,pageCache,htaccess,json,ini'.$alias_suffix);
20
+$inlineviewablefiles = explode(',', 'txt,php,tpl,less,sass,html,htm,xml,js,css,pageCache,htaccess,json,ini'.$alias_suffix);
21 21
 $viewablefiles = explode(',', 'jpg,gif,png,ico');
22 22
 
23 23
 $editablefiles = add_dot($editablefiles);
@@ -30,31 +30,31 @@  discard block
 block discarded – undo
30 30
 {
31 31
 */
32 32
 $protected_path[] = $modx->config['site_manager_path'];
33
-$protected_path[] = $modx->config['base_path'] . 'temp/backup';
34
-$protected_path[] = $modx->config['base_path'] . 'assets/backup';
33
+$protected_path[] = $modx->config['base_path'].'temp/backup';
34
+$protected_path[] = $modx->config['base_path'].'assets/backup';
35 35
 
36 36
 if (!$modx->hasPermission('save_plugin')) {
37
-    $protected_path[] = $modx->config['base_path'] . 'assets/plugins';
37
+    $protected_path[] = $modx->config['base_path'].'assets/plugins';
38 38
 }
39 39
 if (!$modx->hasPermission('save_snippet')) {
40
-    $protected_path[] = $modx->config['base_path'] . 'assets/snippets';
40
+    $protected_path[] = $modx->config['base_path'].'assets/snippets';
41 41
 }
42 42
 if (!$modx->hasPermission('save_template')) {
43
-    $protected_path[] = $modx->config['base_path'] . 'assets/templates';
43
+    $protected_path[] = $modx->config['base_path'].'assets/templates';
44 44
 }
45 45
 if (!$modx->hasPermission('save_module')) {
46
-    $protected_path[] = $modx->config['base_path'] . 'assets/modules';
46
+    $protected_path[] = $modx->config['base_path'].'assets/modules';
47 47
 }
48 48
 if (!$modx->hasPermission('empty_cache')) {
49
-    $protected_path[] = $modx->config['base_path'] . 'assets/cache';
49
+    $protected_path[] = $modx->config['base_path'].'assets/cache';
50 50
 }
51 51
 if (!$modx->hasPermission('import_static')) {
52
-    $protected_path[] = $modx->config['base_path'] . 'temp/import';
53
-    $protected_path[] = $modx->config['base_path'] . 'assets/import';
52
+    $protected_path[] = $modx->config['base_path'].'temp/import';
53
+    $protected_path[] = $modx->config['base_path'].'assets/import';
54 54
 }
55 55
 if (!$modx->hasPermission('export_static')) {
56
-    $protected_path[] = $modx->config['base_path'] . 'temp/export';
57
-    $protected_path[] = $modx->config['base_path'] . 'assets/export';
56
+    $protected_path[] = $modx->config['base_path'].'temp/export';
57
+    $protected_path[] = $modx->config['base_path'].'assets/export';
58 58
 }
59 59
 /*
60 60
 }
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 $uploadablefiles = array_merge($upload_files, $upload_images, $upload_media, $upload_flash);
77 77
 $uploadablefiles = add_dot($uploadablefiles);
78 78
 
79
-if(!function_exists('add_dot')) {
79
+if (!function_exists('add_dot')) {
80 80
     /**
81 81
      * @param array $array
82 82
      * @return array
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
     {
86 86
         $count = count($array);
87 87
         for ($i = 0; $i < $count; $i++) {
88
-            $array[$i] = '.' . strtolower(trim($array[$i])); // add a dot :)
88
+            $array[$i] = '.'.strtolower(trim($array[$i])); // add a dot :)
89 89
         }
90 90
 
91 91
         return $array;
@@ -111,15 +111,15 @@  discard block
 block discarded – undo
111 111
 $rw = realpath('../');
112 112
 $webstart_path = str_replace('\\', '/', str_replace($rw, '', $rf));
113 113
 if (substr($webstart_path, 0, 1) == '/') {
114
-    $webstart_path = '..' . $webstart_path;
114
+    $webstart_path = '..'.$webstart_path;
115 115
 } else {
116
-    $webstart_path = '../' . $webstart_path;
116
+    $webstart_path = '../'.$webstart_path;
117 117
 }
118 118
 
119 119
 ?>
120 120
     <script type="text/javascript">
121 121
 
122
-        var current_path = '<?= $startpath;?>';
122
+        var current_path = '<?= $startpath; ?>';
123 123
 
124 124
         function viewfile (url)
125 125
         {
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
         function unzipFile (file)
156 156
         {
157 157
             if (confirmUnzip()) {
158
-                window.location.href = "index.php?a=31&mode=unzip&path=" + current_path + '/&file=' + file + "&token=<?= $newToken;?>";
158
+                window.location.href = "index.php?a=31&mode=unzip&path=" + current_path + '/&file=' + file + "&token=<?= $newToken; ?>";
159 159
                 return false;
160 160
             }
161 161
         }
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
         function deleteFolder (folder, status)
178 178
         {
179 179
             if (confirmDeleteFolder(status)) {
180
-                window.location.href = "index.php?a=31&mode=deletefolder&path=" + current_path + "&folderpath=" + current_path + '/' + folder + "&token=<?= $newToken;?>";
180
+                window.location.href = "index.php?a=31&mode=deletefolder&path=" + current_path + "&folderpath=" + current_path + '/' + folder + "&token=<?= $newToken; ?>";
181 181
                 return false;
182 182
             }
183 183
         }
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
         function deleteFile (file)
186 186
         {
187 187
             if (confirmDelete()) {
188
-                window.location.href = "index.php?a=31&mode=delete&path=" + current_path + '/' + file + "&token=<?= $newToken;?>";
188
+                window.location.href = "index.php?a=31&mode=delete&path=" + current_path + '/' + file + "&token=<?= $newToken; ?>";
189 189
                 return false;
190 190
             }
191 191
         }
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
         {
195 195
             var newFilename = prompt("<?= $_lang["files_dynamic_new_file_name"] ?>", file);
196 196
             if (newFilename !== null && newFilename !== file) {
197
-                window.location.href = "index.php?a=31&mode=duplicate&path=" + current_path + '/' + file + "&newFilename=" + newFilename + "&token=<?= $newToken;?>";
197
+                window.location.href = "index.php?a=31&mode=duplicate&path=" + current_path + '/' + file + "&newFilename=" + newFilename + "&token=<?= $newToken; ?>";
198 198
             }
199 199
         }
200 200
 
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
         {
203 203
             var newDirname = prompt("<?= $_lang["files_dynamic_new_folder_name"] ?>", dir);
204 204
             if (newDirname !== null && newDirname !== dir) {
205
-                window.location.href = "index.php?a=31&mode=renameFolder&path=" + current_path + '&dirname=' + dir + "&newDirname=" + newDirname + "&token=<?= $newToken;?>";
205
+                window.location.href = "index.php?a=31&mode=renameFolder&path=" + current_path + '&dirname=' + dir + "&newDirname=" + newDirname + "&token=<?= $newToken; ?>";
206 206
             }
207 207
         }
208 208
 
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
         {
211 211
             var newFilename = prompt("<?= $_lang["files_dynamic_new_file_name"] ?>", file);
212 212
             if (newFilename !== null && newFilename !== file) {
213
-                window.location.href = "index.php?a=31&mode=renameFile&path=" + current_path + '/' + file + "&newFilename=" + newFilename + "&token=<?= $newToken;?>";
213
+                window.location.href = "index.php?a=31&mode=renameFile&path=" + current_path + '/' + file + "&newFilename=" + newFilename + "&token=<?= $newToken; ?>";
214 214
             }
215 215
         }
216 216
 
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
             <?php endif ?>
230 230
             <?php
231 231
             if (isset($_GET['mode']) && $_GET['mode'] !== 'drill') {
232
-                $href = 'a=31&path=' . urlencode($_REQUEST['path']);
232
+                $href = 'a=31&path='.urlencode($_REQUEST['path']);
233 233
             } else {
234 234
                 $href = 'a=2';
235 235
             }
@@ -239,12 +239,12 @@  discard block
 block discarded – undo
239 239
                 $tpl = '<a class="btn btn-secondary" href="[+href+]" onclick="return getFolderName(this);"><i class="[+image+]"></i><span>[+subject+]</span></a>';
240 240
                 $ph['image'] = $_style['files_folder-open'];
241 241
                 $ph['subject'] = $_lang['add_folder'];
242
-                $ph['href'] = 'index.php?a=31&mode=newfolder&path=' . urlencode($startpath) . '&name=';
242
+                $ph['href'] = 'index.php?a=31&mode=newfolder&path='.urlencode($startpath).'&name=';
243 243
                 $_ = parsePlaceholder($tpl, $ph);
244 244
 
245
-                $tpl = '<a class="btn btn-secondary" href="[+href+]" onclick="return getFileName(this);"><i class="[+image+]"></i><span>' . $_lang['files.dynamic.php1'] . '</span></a>';
245
+                $tpl = '<a class="btn btn-secondary" href="[+href+]" onclick="return getFileName(this);"><i class="[+image+]"></i><span>'.$_lang['files.dynamic.php1'].'</span></a>';
246 246
                 $ph['image'] = $_style['files_page_html'];
247
-                $ph['href'] = 'index.php?a=31&mode=newfile&path=' . urlencode($startpath) . '&name=';
247
+                $ph['href'] = 'index.php?a=31&mode=newfile&path='.urlencode($startpath).'&name=';
248 248
                 $_ .= parsePlaceholder($tpl, $ph);
249 249
                 echo $_;
250 250
             }
@@ -274,12 +274,12 @@  discard block
 block discarded – undo
274 274
             $ph = array();
275 275
             $ph['style_path'] = $theme_image_path;
276 276
             // To Top Level with folder icon to the left
277
-            if ($startpath == $filemanager_path || $startpath . '/' == $filemanager_path) {
278
-                $ph['image'] = '' . $_style['files_top'] . '';
277
+            if ($startpath == $filemanager_path || $startpath.'/' == $filemanager_path) {
278
+                $ph['image'] = ''.$_style['files_top'].'';
279 279
                 $ph['subject'] = '<span>Top</span>';
280 280
             } else {
281
-                $ph['image'] = '' . $_style['files_top'] . '';
282
-                $ph['subject'] = '<a href="index.php?a=31&mode=drill&path=' . $filemanager_path . '">Top</a>/';
281
+                $ph['image'] = ''.$_style['files_top'].'';
282
+                $ph['subject'] = '<a href="index.php?a=31&mode=drill&path='.$filemanager_path.'">Top</a>/';
283 283
             }
284 284
 
285 285
             echo parsePlaceholder($tpl, $ph);
@@ -296,12 +296,12 @@  discard block
 block discarded – undo
296 296
                     if (empty($v)) {
297 297
                         continue;
298 298
                     }
299
-                    $path .= rtrim($v, '/') . '/';
299
+                    $path .= rtrim($v, '/').'/';
300 300
                     if (1 < $count) {
301
-                        $href = 'index.php?a=31&mode=drill&path=' . urlencode($filemanager_path . $path);
302
-                        $pieces[$i] = '<a href="' . $href . '">' . trim($v, '/') . '</a>';
301
+                        $href = 'index.php?a=31&mode=drill&path='.urlencode($filemanager_path.$path);
302
+                        $pieces[$i] = '<a href="'.$href.'">'.trim($v, '/').'</a>';
303 303
                     } else {
304
-                        $pieces[$i] = '<span>' . trim($v, '/') . '</span>';
304
+                        $pieces[$i] = '<span>'.trim($v, '/').'</span>';
305 305
                     }
306 306
                     $count--;
307 307
                 }
@@ -314,16 +314,16 @@  discard block
 block discarded – undo
314 314
         </div>
315 315
         <?php
316 316
         // check to see user isn't trying to move below the document_root
317
-        if (substr(strtolower(str_replace('//', '/', $startpath . "/")), 0, $len) != strtolower(str_replace('//', '/', $filemanager_path . '/'))) {
317
+        if (substr(strtolower(str_replace('//', '/', $startpath."/")), 0, $len) != strtolower(str_replace('//', '/', $filemanager_path.'/'))) {
318 318
             $modx->webAlertAndQuit($_lang["files_access_denied"]);
319 319
         }
320 320
 
321 321
         // Unzip .zip files - by Raymond
322 322
         if ($enablefileunzip && $_REQUEST['mode'] == 'unzip' && is_writable($startpath)) {
323
-            if (!$err = unzip(realpath("{$startpath}/" . $_REQUEST['file']), realpath($startpath))) {
324
-                echo '<span class="warning"><b>' . $_lang['file_unzip_fail'] . ($err === 0 ? 'Missing zip library (php_zip.dll / zip.so)' : '') . '</b></span><br /><br />';
323
+            if (!$err = unzip(realpath("{$startpath}/".$_REQUEST['file']), realpath($startpath))) {
324
+                echo '<span class="warning"><b>'.$_lang['file_unzip_fail'].($err === 0 ? 'Missing zip library (php_zip.dll / zip.so)' : '').'</b></span><br /><br />';
325 325
             } else {
326
-                echo '<span class="success"><b>' . $_lang['file_unzip'] . '</b></span><br /><br />';
326
+                echo '<span class="success"><b>'.$_lang['file_unzip'].'</b></span><br /><br />';
327 327
             }
328 328
         }
329 329
         // End Unzip - Raymond
@@ -335,9 +335,9 @@  discard block
 block discarded – undo
335 335
             if ($_REQUEST['mode'] == 'deletefolder') {
336 336
                 $folder = $_REQUEST['folderpath'];
337 337
                 if (!$token_check || !@rrmdir($folder)) {
338
-                    echo '<span class="warning"><b>' . $_lang['file_folder_not_deleted'] . '</b></span><br /><br />';
338
+                    echo '<span class="warning"><b>'.$_lang['file_folder_not_deleted'].'</b></span><br /><br />';
339 339
                 } else {
340
-                    echo '<span class="success"><b>' . $_lang['file_folder_deleted'] . '</b></span><br /><br />';
340
+                    echo '<span class="success"><b>'.$_lang['file_folder_deleted'].'</b></span><br /><br />';
341 341
                 }
342 342
             }
343 343
 
@@ -348,10 +348,10 @@  discard block
 block discarded – undo
348 348
                 if (!mkdirs("{$startpath}/{$foldername}", 0777)) {
349 349
                     echo '<span class="warning"><b>', $_lang['file_folder_not_created'], '</b></span><br /><br />';
350 350
                 } else {
351
-                    if (!@chmod($startpath . '/' . $foldername, $newfolderaccessmode)) {
352
-                        echo '<span class="warning"><b>' . $_lang['file_folder_chmod_error'] . '</b></span><br /><br />';
351
+                    if (!@chmod($startpath.'/'.$foldername, $newfolderaccessmode)) {
352
+                        echo '<span class="warning"><b>'.$_lang['file_folder_chmod_error'].'</b></span><br /><br />';
353 353
                     } else {
354
-                        echo '<span class="success"><b>' . $_lang['file_folder_created'] . '</b></span><br /><br />';
354
+                        echo '<span class="success"><b>'.$_lang['file_folder_created'].'</b></span><br /><br />';
355 355
                     }
356 356
                 }
357 357
                 umask($old_umask);
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
                 $filename = $modx->db->escape($filename);
364 364
 
365 365
                 if (!checkExtension($filename)) {
366
-                    echo '<span class="warning"><b>' . $_lang['files_filetype_notok'] . '</b></span><br /><br />';
366
+                    echo '<span class="warning"><b>'.$_lang['files_filetype_notok'].'</b></span><br /><br />';
367 367
                 } elseif (preg_match('@(\\\\|\/|\:|\;|\,|\*|\?|\"|\<|\>|\||\?)@', $filename) !== 0) {
368 368
                     echo $_lang['files.dynamic.php3'];
369 369
                 } else {
@@ -385,11 +385,11 @@  discard block
 block discarded – undo
385 385
                 $newFilename = $modx->db->escape($newFilename);
386 386
 
387 387
                 if (!checkExtension($newFilename)) {
388
-                    echo '<span class="warning"><b>' . $_lang['files_filetype_notok'] . '</b></span><br /><br />';
388
+                    echo '<span class="warning"><b>'.$_lang['files_filetype_notok'].'</b></span><br /><br />';
389 389
                 } elseif (preg_match('@(\\\\|\/|\:|\;|\,|\*|\?|\"|\<|\>|\||\?)@', $newFilename) !== 0) {
390 390
                     echo $_lang['files.dynamic.php3'];
391 391
                 } else {
392
-                    if (!copy($filename, MODX_BASE_PATH . $newFilename)) {
392
+                    if (!copy($filename, MODX_BASE_PATH.$newFilename)) {
393 393
                         echo $_lang['files.dynamic.php5'];
394 394
                     }
395 395
                     umask($old_umask);
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
             // Rename folder here
399 399
             if ($_REQUEST['mode'] == 'renameFolder') {
400 400
                 $old_umask = umask(0);
401
-                $dirname = $_REQUEST['path'] . '/' . $_REQUEST['dirname'];
401
+                $dirname = $_REQUEST['path'].'/'.$_REQUEST['dirname'];
402 402
                 $dirname = $modx->db->escape($dirname);
403 403
                 $newDirname = str_replace(array(
404 404
                     '..\\',
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
 
411 411
                 if (preg_match('@(\\\\|\/|\:|\;|\,|\*|\?|\"|\<|\>|\||\?)@', $newDirname) !== 0) {
412 412
                     echo $_lang['files.dynamic.php3'];
413
-                } else if (!rename($dirname, $_REQUEST['path'] . '/' . $newDirname)) {
413
+                } else if (!rename($dirname, $_REQUEST['path'].'/'.$newDirname)) {
414 414
                     echo '<span class="warning"><b>', $_lang['file_folder_not_created'], '</b></span><br /><br />';
415 415
                 }
416 416
                 umask($old_umask);
@@ -430,11 +430,11 @@  discard block
 block discarded – undo
430 430
                 $newFilename = $modx->db->escape($newFilename);
431 431
 
432 432
                 if (!checkExtension($newFilename)) {
433
-                    echo '<span class="warning"><b>' . $_lang['files_filetype_notok'] . '</b></span><br /><br />';
433
+                    echo '<span class="warning"><b>'.$_lang['files_filetype_notok'].'</b></span><br /><br />';
434 434
                 } elseif (preg_match('@(\\\\|\/|\:|\;|\,|\*|\?|\"|\<|\>|\||\?)@', $newFilename) !== 0) {
435 435
                     echo $_lang['files.dynamic.php3'];
436 436
                 } else {
437
-                    if (!rename($filename, $path . '/' . $newFilename)) {
437
+                    if (!rename($filename, $path.'/'.$newFilename)) {
438 438
                         echo $_lang['files.dynamic.php5'];
439 439
                     }
440 440
                     umask($old_umask);
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
                 ls($startpath);
468 468
                 echo "\n\n\n";
469 469
                 if ($folders == 0 && $files == 0) {
470
-                    echo '<tr><td colspan="4"><i class="' . $_style['files_deleted_folder'] . ' FilesDeletedFolder"></i> <span style="color:#888;cursor:default;"> ' . $_lang['files_directory_is_empty'] . ' </span></td></tr>';
470
+                    echo '<tr><td colspan="4"><i class="'.$_style['files_deleted_folder'].' FilesDeletedFolder"></i> <span style="color:#888;cursor:default;"> '.$_lang['files_directory_is_empty'].' </span></td></tr>';
471 471
                 }
472 472
                 ?>
473 473
             </table>
@@ -476,10 +476,10 @@  discard block
 block discarded – undo
476 476
         <div class="container">
477 477
             <p>
478 478
                 <?php
479
-                echo $_lang['files_directories'] . ': <b>' . $folders . '</b> ';
480
-                echo $_lang['files_files'] . ': <b>' . $files . '</b> ';
481
-                echo $_lang['files_data'] . ': <b><span dir="ltr">' . $modx->nicesize($filesizes) . '</span></b> ';
482
-                echo $_lang['files_dirwritable'] . ' <b>' . (is_writable($startpath) == 1 ? $_lang['yes'] . '.' : $_lang['no']) . '.</b>'
479
+                echo $_lang['files_directories'].': <b>'.$folders.'</b> ';
480
+                echo $_lang['files_files'].': <b>'.$files.'</b> ';
481
+                echo $_lang['files_data'].': <b><span dir="ltr">'.$modx->nicesize($filesizes).'</span></b> ';
482
+                echo $_lang['files_dirwritable'].' <b>'.(is_writable($startpath) == 1 ? $_lang['yes'].'.' : $_lang['no']).'.</b>'
483 483
                 ?>
484 484
             </p>
485 485
 
@@ -504,7 +504,7 @@  discard block
 block discarded – undo
504 504
                 </form>
505 505
                 <?php
506 506
             } else {
507
-                echo "<p>" . $_lang['files_upload_inhibited_msg'] . "</p>";
507
+                echo "<p>".$_lang['files_upload_inhibited_msg']."</p>";
508 508
             }
509 509
             ?>
510 510
             <div id="imageviewer"></div>
@@ -572,7 +572,7 @@  discard block
 block discarded – undo
572 572
 
573 573
 }
574 574
 
575
-if(!function_exists('determineIcon')) {
575
+if (!function_exists('determineIcon')) {
576 576
     /**
577 577
      * @param string $file
578 578
      * @param string $selFile
@@ -591,11 +591,11 @@  discard block
 block discarded – undo
591 591
             $icon = isset($icons[$mode]) ? $icons[$mode] : $icons['default'];
592 592
         }
593 593
 
594
-        return '<i class="' . $icon . ' FilesPage"></i>';
594
+        return '<i class="'.$icon.' FilesPage"></i>';
595 595
     }
596 596
 }
597 597
 
598
-if(!function_exists('markRow')) {
598
+if (!function_exists('markRow')) {
599 599
     /**
600 600
      * @param string $file
601 601
      * @param string $selFile
@@ -612,14 +612,14 @@  discard block
 block discarded – undo
612 612
         if ($file == $selFile) {
613 613
             $class = isset($classNames[$mode]) ? $classNames[$mode] : $classNames['default'];
614 614
 
615
-            return ' class="' . $class . '"';
615
+            return ' class="'.$class.'"';
616 616
         }
617 617
 
618 618
         return '';
619 619
     }
620 620
 }
621 621
 
622
-if(!function_exists('ls')) {
622
+if (!function_exists('ls')) {
623 623
     /**
624 624
      * @param string $curpath
625 625
      */
@@ -629,7 +629,7 @@  discard block
 block discarded – undo
629 629
         global $excludes, $protected_path, $editablefiles, $inlineviewablefiles, $viewablefiles, $enablefileunzip, $enablefiledownload, $uploadablefiles, $folders, $files, $filesizes, $len, $dirs_array, $files_array, $webstart_path, $modx;
630 630
         $dircounter = 0;
631 631
         $filecounter = 0;
632
-        $curpath = str_replace('//', '/', $curpath . '/');
632
+        $curpath = str_replace('//', '/', $curpath.'/');
633 633
 
634 634
         if (!is_dir($curpath)) {
635 635
             echo 'Invalid path "', $curpath, '"<br />';
@@ -640,7 +640,7 @@  discard block
 block discarded – undo
640 640
 
641 641
         // first, get info
642 642
         foreach ($dir as $file) {
643
-            $newpath = $curpath . $file;
643
+            $newpath = $curpath.$file;
644 644
             if ($file === '..' || $file === '.') {
645 645
                 continue;
646 646
             }
@@ -650,7 +650,7 @@  discard block
 block discarded – undo
650 650
                 if ($file === '..' || $file === '.') {
651 651
                     continue;
652 652
                 } elseif (!in_array($file, $excludes) && !in_array($newpath, $protected_path)) {
653
-                    $dirs_array[$dircounter]['text'] = '<i class="' . $_style['files_folder'] . ' FilesFolder"></i> <a href="index.php?a=31&mode=drill&path=' . urlencode($newpath) . '"><b>' . $file . '</b></a>';
653
+                    $dirs_array[$dircounter]['text'] = '<i class="'.$_style['files_folder'].' FilesFolder"></i> <a href="index.php?a=31&mode=drill&path='.urlencode($newpath).'"><b>'.$file.'</b></a>';
654 654
 
655 655
                     $dfiles = scandir($newpath);
656 656
                     foreach ($dfiles as $i => $infile) {
@@ -663,13 +663,13 @@  discard block
 block discarded – undo
663 663
                     }
664 664
                     $file_exists = (0 < count($dfiles)) ? 'file_exists' : '';
665 665
 
666
-                    $dirs_array[$dircounter]['delete'] = is_writable($curpath) ? '<a href="javascript: deleteFolder(\'' . urlencode($file) . '\',\'' . $file_exists . '\');"><i class="' . $_style['files_delete'] . '" title="' . $_lang['file_delete_folder'] . '"></i></a>' : '';
666
+                    $dirs_array[$dircounter]['delete'] = is_writable($curpath) ? '<a href="javascript: deleteFolder(\''.urlencode($file).'\',\''.$file_exists.'\');"><i class="'.$_style['files_delete'].'" title="'.$_lang['file_delete_folder'].'"></i></a>' : '';
667 667
                 } else {
668
-                    $dirs_array[$dircounter]['text'] = '<span><i class="' . $_style['files_deleted_folder'] . ' FilesDeletedFolder"></i> ' . $file . '</span>';
669
-                    $dirs_array[$dircounter]['delete'] = is_writable($curpath) ? '<span class="disabled"><i class="' . $_style['files_delete'] . '" title="' . $_lang['file_delete_folder'] . '"></i></span>' : '';
668
+                    $dirs_array[$dircounter]['text'] = '<span><i class="'.$_style['files_deleted_folder'].' FilesDeletedFolder"></i> '.$file.'</span>';
669
+                    $dirs_array[$dircounter]['delete'] = is_writable($curpath) ? '<span class="disabled"><i class="'.$_style['files_delete'].'" title="'.$_lang['file_delete_folder'].'"></i></span>' : '';
670 670
                 }
671 671
 
672
-                $dirs_array[$dircounter]['rename'] = is_writable($curpath) ? '<a href="javascript:renameFolder(\'' . urlencode($file) . '\');"><i class="' . $_style['files_rename'] . '" title="' . $_lang['rename'] . '"></i></a> ' : '';
672
+                $dirs_array[$dircounter]['rename'] = is_writable($curpath) ? '<a href="javascript:renameFolder(\''.urlencode($file).'\');"><i class="'.$_style['files_rename'].'" title="'.$_lang['rename'].'"></i></a> ' : '';
673 673
 
674 674
                 // increment the counter
675 675
                 $dircounter++;
@@ -678,24 +678,24 @@  discard block
 block discarded – undo
678 678
                 $files_array[$filecounter]['file'] = $newpath;
679 679
                 $files_array[$filecounter]['stats'] = lstat($newpath);
680 680
                 $files_array[$filecounter]['text'] = determineIcon($newpath, $_REQUEST['path'],
681
-                        $_REQUEST['mode']) . ' ' . $file;
681
+                        $_REQUEST['mode']).' '.$file;
682 682
                 $files_array[$filecounter]['view'] = (in_array($type,
683
-                    $viewablefiles)) ? '<a href="javascript:;" onclick="viewfile(\'' . $webstart_path . substr($newpath,
683
+                    $viewablefiles)) ? '<a href="javascript:;" onclick="viewfile(\''.$webstart_path.substr($newpath,
684 684
                         $len,
685
-                        strlen($newpath)) . '\');"><i class="' . $_style['files_view'] . '" title="' . $_lang['files_viewfile'] . '"></i></a>' : (($enablefiledownload && in_array($type,
686
-                        $uploadablefiles)) ? '<a href="' . $webstart_path . implode('/', array_map('rawurlencode',
685
+                        strlen($newpath)).'\');"><i class="'.$_style['files_view'].'" title="'.$_lang['files_viewfile'].'"></i></a>' : (($enablefiledownload && in_array($type,
686
+                        $uploadablefiles)) ? '<a href="'.$webstart_path.implode('/', array_map('rawurlencode',
687 687
                         explode('/', substr($newpath, $len,
688
-                            strlen($newpath))))) . '" style="cursor:pointer;"><i class="' . $_style['files_download'] . '" title="' . $_lang['file_download_file'] . '"></i></a>' : '<span class="disabled"><i class="' . $_style['files_view'] . '" title="' . $_lang['files_viewfile'] . '"></i></span>');
688
+                            strlen($newpath))))).'" style="cursor:pointer;"><i class="'.$_style['files_download'].'" title="'.$_lang['file_download_file'].'"></i></a>' : '<span class="disabled"><i class="'.$_style['files_view'].'" title="'.$_lang['files_viewfile'].'"></i></span>');
689 689
                 $files_array[$filecounter]['view'] = (in_array($type,
690
-                    $inlineviewablefiles)) ? '<a href="index.php?a=31&mode=view&path=' . urlencode($newpath) . '"><i class="' . $_style['files_view'] . '" title="' . $_lang['files_viewfile'] . '"></i></a>' : $files_array[$filecounter]['view'];
691
-                $files_array[$filecounter]['unzip'] = ($enablefileunzip && $type == '.zip') ? '<a href="javascript:unzipFile(\'' . urlencode($file) . '\');"><i class="' . $_style['files_unzip'] . '" title="' . $_lang['file_download_unzip'] . '"></i></a>' : '';
690
+                    $inlineviewablefiles)) ? '<a href="index.php?a=31&mode=view&path='.urlencode($newpath).'"><i class="'.$_style['files_view'].'" title="'.$_lang['files_viewfile'].'"></i></a>' : $files_array[$filecounter]['view'];
691
+                $files_array[$filecounter]['unzip'] = ($enablefileunzip && $type == '.zip') ? '<a href="javascript:unzipFile(\''.urlencode($file).'\');"><i class="'.$_style['files_unzip'].'" title="'.$_lang['file_download_unzip'].'"></i></a>' : '';
692 692
                 $files_array[$filecounter]['edit'] = (in_array($type,
693
-                        $editablefiles) && is_writable($curpath) && is_writable($newpath)) ? '<a href="index.php?a=31&mode=edit&path=' . urlencode($newpath) . '#file_editfile"><i class="' . $_style['files_edit'] . '" title="' . $_lang['files_editfile'] . '"></i></a>' : '<span class="disabled"><i class="' . $_style['files_edit'] . '" title="' . $_lang['files_editfile'] . '"></i></span>';
693
+                        $editablefiles) && is_writable($curpath) && is_writable($newpath)) ? '<a href="index.php?a=31&mode=edit&path='.urlencode($newpath).'#file_editfile"><i class="'.$_style['files_edit'].'" title="'.$_lang['files_editfile'].'"></i></a>' : '<span class="disabled"><i class="'.$_style['files_edit'].'" title="'.$_lang['files_editfile'].'"></i></span>';
694 694
                 $files_array[$filecounter]['duplicate'] = (in_array($type,
695
-                        $editablefiles) && is_writable($curpath) && is_writable($newpath)) ? '<a href="javascript:duplicateFile(\'' . urlencode($file) . '\');"><i class="' . $_style['files_duplicate'] . '" title="' . $_lang['duplicate'] . '"></i></a>' : '<span class="disabled"><i class="' . $_style['files_duplicate'] . '" align="absmiddle" title="' . $_lang['duplicate'] . '"></i></span>';
695
+                        $editablefiles) && is_writable($curpath) && is_writable($newpath)) ? '<a href="javascript:duplicateFile(\''.urlencode($file).'\');"><i class="'.$_style['files_duplicate'].'" title="'.$_lang['duplicate'].'"></i></a>' : '<span class="disabled"><i class="'.$_style['files_duplicate'].'" align="absmiddle" title="'.$_lang['duplicate'].'"></i></span>';
696 696
                 $files_array[$filecounter]['rename'] = (in_array($type,
697
-                        $editablefiles) && is_writable($curpath) && is_writable($newpath)) ? '<a href="javascript:renameFile(\'' . urlencode($file) . '\');"><i class="' . $_style['files_rename'] . '" align="absmiddle" title="' . $_lang['rename'] . '"></i></a>' : '<span class="disabled"><i class="' . $_style['files_rename'] . '" align="absmiddle" title="' . $_lang['rename'] . '"></i></span>';
698
-                $files_array[$filecounter]['delete'] = is_writable($curpath) && is_writable($newpath) ? '<a href="javascript:deleteFile(\'' . urlencode($file) . '\');"><i class="' . $_style['files_delete'] . '" title="' . $_lang['file_delete_file'] . '"></i></a>' : '<span class="disabled"><i class="' . $_style['files_delete'] . '" title="' . $_lang['file_delete_file'] . '"></i></span>';
697
+                        $editablefiles) && is_writable($curpath) && is_writable($newpath)) ? '<a href="javascript:renameFile(\''.urlencode($file).'\');"><i class="'.$_style['files_rename'].'" align="absmiddle" title="'.$_lang['rename'].'"></i></a>' : '<span class="disabled"><i class="'.$_style['files_rename'].'" align="absmiddle" title="'.$_lang['rename'].'"></i></span>';
698
+                $files_array[$filecounter]['delete'] = is_writable($curpath) && is_writable($newpath) ? '<a href="javascript:deleteFile(\''.urlencode($file).'\');"><i class="'.$_style['files_delete'].'" title="'.$_lang['file_delete_file'].'"></i></a>' : '<span class="disabled"><i class="'.$_style['files_delete'].'" title="'.$_lang['file_delete_file'].'"></i></span>';
699 699
 
700 700
                 // increment the counter
701 701
                 $filecounter++;
@@ -708,9 +708,9 @@  discard block
 block discarded – undo
708 708
         for ($i = 0; $i < $folders; $i++) {
709 709
             $filesizes += $dirs_array[$i]['stats']['7'];
710 710
             echo '<tr>';
711
-            echo '<td>' . $dirs_array[$i]['text'] . '</td>';
712
-            echo '<td class="text-nowrap">' . $modx->toDateFormat($dirs_array[$i]['stats']['9']) . '</td>';
713
-            echo '<td class="text-right">' . $modx->nicesize($dirs_array[$i]['stats']['7']) . '</td>';
711
+            echo '<td>'.$dirs_array[$i]['text'].'</td>';
712
+            echo '<td class="text-nowrap">'.$modx->toDateFormat($dirs_array[$i]['stats']['9']).'</td>';
713
+            echo '<td class="text-right">'.$modx->nicesize($dirs_array[$i]['stats']['7']).'</td>';
714 714
             echo '<td class="actions text-right">';
715 715
             echo $dirs_array[$i]['rename'];
716 716
             echo $dirs_array[$i]['delete'];
@@ -723,10 +723,10 @@  discard block
 block discarded – undo
723 723
         sort($files_array); // sorting the array alphabetically (Thanks pxl8r!)
724 724
         for ($i = 0; $i < $files; $i++) {
725 725
             $filesizes += $files_array[$i]['stats']['7'];
726
-            echo '<tr ' . markRow($files_array[$i]['file'], $_REQUEST['path'], $_REQUEST['mode']) . '>';
727
-            echo '<td>' . $files_array[$i]['text'] . '</td>';
728
-            echo '<td class="text-nowrap">' . $modx->toDateFormat($files_array[$i]['stats']['9']) . '</td>';
729
-            echo '<td class="text-right">' . $modx->nicesize($files_array[$i]['stats']['7']) . '</td>';
726
+            echo '<tr '.markRow($files_array[$i]['file'], $_REQUEST['path'], $_REQUEST['mode']).'>';
727
+            echo '<td>'.$files_array[$i]['text'].'</td>';
728
+            echo '<td class="text-nowrap">'.$modx->toDateFormat($files_array[$i]['stats']['9']).'</td>';
729
+            echo '<td class="text-right">'.$modx->nicesize($files_array[$i]['stats']['7']).'</td>';
730 730
             echo '<td class="actions text-right">';
731 731
             echo $files_array[$i]['unzip'];
732 732
             echo $files_array[$i]['view'];
@@ -742,7 +742,7 @@  discard block
 block discarded – undo
742 742
     }
743 743
 }
744 744
 
745
-if(!function_exists('removeLastPath')) {
745
+if (!function_exists('removeLastPath')) {
746 746
     /**
747 747
      * @param string $string
748 748
      * @return bool|string
@@ -760,7 +760,7 @@  discard block
 block discarded – undo
760 760
     }
761 761
 }
762 762
 
763
-if(!function_exists('getExtension')) {
763
+if (!function_exists('getExtension')) {
764 764
     /**
765 765
      * @param string $string
766 766
      * @return bool|string
@@ -779,7 +779,7 @@  discard block
 block discarded – undo
779 779
     }
780 780
 }
781 781
 
782
-if(!function_exists('checkExtension')) {
782
+if (!function_exists('checkExtension')) {
783 783
     /**
784 784
      * @param string $path
785 785
      * @return bool
@@ -796,7 +796,7 @@  discard block
 block discarded – undo
796 796
     }
797 797
 }
798 798
 
799
-if(!function_exists('mkdirs')) {
799
+if (!function_exists('mkdirs')) {
800 800
     /**
801 801
      * recursive mkdir function
802 802
      *
@@ -818,7 +818,7 @@  discard block
 block discarded – undo
818 818
     }
819 819
 }
820 820
 
821
-if(!function_exists('logFileChange')) {
821
+if (!function_exists('logFileChange')) {
822 822
     /**
823 823
      * @param string $type
824 824
      * @param string $filename
@@ -854,7 +854,7 @@  discard block
 block discarded – undo
854 854
     }
855 855
 }
856 856
 
857
-if(!function_exists('unzip')) {
857
+if (!function_exists('unzip')) {
858 858
     /**
859 859
      * by patrick_allaert - php user notes
860 860
      *
@@ -878,17 +878,17 @@  discard block
 block discarded – undo
878 878
         $zip = zip_open($file);
879 879
         if ($zip) {
880 880
             $old_umask = umask(0);
881
-            $path = rtrim($path, '/') . '/';
881
+            $path = rtrim($path, '/').'/';
882 882
             while ($zip_entry = zip_read($zip)) {
883 883
                 if (zip_entry_filesize($zip_entry) > 0) {
884 884
                     // str_replace must be used under windows to convert "/" into "\"
885 885
                     $zip_entry_name = zip_entry_name($zip_entry);
886
-                    $complete_path = $path . str_replace('\\', '/', dirname($zip_entry_name));
887
-                    $complete_name = $path . str_replace('\\', '/', $zip_entry_name);
886
+                    $complete_path = $path.str_replace('\\', '/', dirname($zip_entry_name));
887
+                    $complete_name = $path.str_replace('\\', '/', $zip_entry_name);
888 888
                     if (!file_exists($complete_path)) {
889 889
                         $tmp = '';
890 890
                         foreach (explode('/', $complete_path) AS $k) {
891
-                            $tmp .= $k . '/';
891
+                            $tmp .= $k.'/';
892 892
                             if (!is_dir($tmp)) {
893 893
                                 mkdir($tmp, 0777);
894 894
                             }
@@ -909,14 +909,14 @@  discard block
 block discarded – undo
909 909
     }
910 910
 }
911 911
 
912
-if(!function_exists('rrmdir')) {
912
+if (!function_exists('rrmdir')) {
913 913
     /**
914 914
      * @param string $dir
915 915
      * @return bool
916 916
      */
917 917
     function rrmdir($dir)
918 918
     {
919
-        foreach (glob($dir . '/*') as $file) {
919
+        foreach (glob($dir.'/*') as $file) {
920 920
             if (is_dir($file)) {
921 921
                 rrmdir($file);
922 922
             } else {
@@ -928,7 +928,7 @@  discard block
 block discarded – undo
928 928
     }
929 929
 }
930 930
 
931
-if(!function_exists('fileupload')) {
931
+if (!function_exists('fileupload')) {
932 932
     /**
933 933
      * @return string
934 934
      */
@@ -958,13 +958,13 @@  discard block
 block discarded – undo
958 958
             $userfile['type'] = $_FILES['userfile']['type'][$i];
959 959
 
960 960
             // this seems to be an upload action.
961
-            $path = $modx->config['site_url'] . substr($startpath, strlen($filemanager_path), strlen($startpath));
962
-            $path = rtrim($path, '/') . '/' . $userfile['name'];
961
+            $path = $modx->config['site_url'].substr($startpath, strlen($filemanager_path), strlen($startpath));
962
+            $path = rtrim($path, '/').'/'.$userfile['name'];
963 963
             $msg .= $path;
964 964
             if ($userfile['error'] == 0) {
965 965
                 $img = (strpos($userfile['type'],
966
-                        'image') !== false) ? '<br /><img src="' . $path . '" height="75" />' : '';
967
-                $msg .= "<p>" . $_lang['files_file_type'] . $userfile['type'] . ", " . $modx->nicesize(filesize($userfile['tmp_name'])) . $img . '</p>';
966
+                        'image') !== false) ? '<br /><img src="'.$path.'" height="75" />' : '';
967
+                $msg .= "<p>".$_lang['files_file_type'].$userfile['type'].", ".$modx->nicesize(filesize($userfile['tmp_name'])).$img.'</p>';
968 968
             }
969 969
 
970 970
             $userfilename = $userfile['tmp_name'];
@@ -972,15 +972,15 @@  discard block
 block discarded – undo
972 972
             if (is_uploaded_file($userfilename)) {
973 973
                 // file is uploaded file, process it!
974 974
                 if (!checkExtension($userfile['name'])) {
975
-                    $msg .= '<p><span class="warning">' . $_lang['files_filetype_notok'] . '</span></p>';
975
+                    $msg .= '<p><span class="warning">'.$_lang['files_filetype_notok'].'</span></p>';
976 976
                 } else {
977
-                    if (@move_uploaded_file($userfile['tmp_name'], $_POST['path'] . '/' . $userfile['name'])) {
977
+                    if (@move_uploaded_file($userfile['tmp_name'], $_POST['path'].'/'.$userfile['name'])) {
978 978
                         // Ryan: Repair broken permissions issue with file manager
979 979
                         if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN') {
980
-                            @chmod($_POST['path'] . "/" . $userfile['name'], $new_file_permissions);
980
+                            @chmod($_POST['path']."/".$userfile['name'], $new_file_permissions);
981 981
                         }
982 982
                         // Ryan: End
983
-                        $msg .= '<p><span class="success">' . $_lang['files_upload_ok'] . '</span></p><hr/>';
983
+                        $msg .= '<p><span class="success">'.$_lang['files_upload_ok'].'</span></p><hr/>';
984 984
 
985 985
                         // invoke OnFileManagerUpload event
986 986
                         $modx->invokeEvent('OnFileManagerUpload', array(
@@ -988,13 +988,13 @@  discard block
 block discarded – undo
988 988
                             'filename' => $userfile['name']
989 989
                         ));
990 990
                         // Log the change
991
-                        logFileChange('upload', $_POST['path'] . '/' . $userfile['name']);
991
+                        logFileChange('upload', $_POST['path'].'/'.$userfile['name']);
992 992
                     } else {
993
-                        $msg .= '<p><span class="warning">' . $_lang['files_upload_copyfailed'] . '</span> ' . $_lang["files_upload_permissions_error"] . '</p>';
993
+                        $msg .= '<p><span class="warning">'.$_lang['files_upload_copyfailed'].'</span> '.$_lang["files_upload_permissions_error"].'</p>';
994 994
                     }
995 995
                 }
996 996
             } else {
997
-                $msg .= '<br /><span class="warning"><b>' . $_lang['files_upload_error'] . ':</b>';
997
+                $msg .= '<br /><span class="warning"><b>'.$_lang['files_upload_error'].':</b>';
998 998
                 switch ($userfile['error']) {
999 999
                     case 0: //no error; possible file attack!
1000 1000
                         $msg .= $_lang['files_upload_error0'];
@@ -1019,11 +1019,11 @@  discard block
 block discarded – undo
1019 1019
             }
1020 1020
         }
1021 1021
 
1022
-        return $msg . '<br/>';
1022
+        return $msg.'<br/>';
1023 1023
     }
1024 1024
 }
1025 1025
 
1026
-if(!function_exists('textsave')) {
1026
+if (!function_exists('textsave')) {
1027 1027
     /**
1028 1028
      * @return string
1029 1029
      */
@@ -1037,9 +1037,9 @@  discard block
 block discarded – undo
1037 1037
 
1038 1038
         // Write $content to our opened file.
1039 1039
         if (file_put_contents($filename, $content) === false) {
1040
-            $msg .= '<span class="warning"><b>' . $_lang['file_not_saved'] . '</b></span><br /><br />';
1040
+            $msg .= '<span class="warning"><b>'.$_lang['file_not_saved'].'</b></span><br /><br />';
1041 1041
         } else {
1042
-            $msg .= '<span class="success"><b>' . $_lang['file_saved'] . '</b></span><br /><br />';
1042
+            $msg .= '<span class="success"><b>'.$_lang['file_saved'].'</b></span><br /><br />';
1043 1043
             $_REQUEST['mode'] = 'edit';
1044 1044
         }
1045 1045
         // Log the change
@@ -1049,7 +1049,7 @@  discard block
 block discarded – undo
1049 1049
     }
1050 1050
 }
1051 1051
 
1052
-if(!function_exists('delete_file')) {
1052
+if (!function_exists('delete_file')) {
1053 1053
     /**
1054 1054
      * @return string
1055 1055
      */
@@ -1061,9 +1061,9 @@  discard block
 block discarded – undo
1061 1061
 
1062 1062
         $file = $_REQUEST['path'];
1063 1063
         if (!$token_check || !@unlink($file)) {
1064
-            $msg .= '<span class="warning"><b>' . $_lang['file_not_deleted'] . '</b></span><br /><br />';
1064
+            $msg .= '<span class="warning"><b>'.$_lang['file_not_deleted'].'</b></span><br /><br />';
1065 1065
         } else {
1066
-            $msg .= '<span class="success"><b>' . $_lang['file_deleted'] . '</b></span><br /><br />';
1066
+            $msg .= '<span class="success"><b>'.$_lang['file_deleted'].'</b></span><br /><br />';
1067 1067
         }
1068 1068
 
1069 1069
         // Log the change
@@ -1073,7 +1073,7 @@  discard block
 block discarded – undo
1073 1073
     }
1074 1074
 }
1075 1075
 
1076
-if(!function_exists('parsePlaceholder')) {
1076
+if (!function_exists('parsePlaceholder')) {
1077 1077
     /**
1078 1078
      * @param string $tpl
1079 1079
      * @param array $ph
@@ -1090,7 +1090,7 @@  discard block
 block discarded – undo
1090 1090
     }
1091 1091
 }
1092 1092
 
1093
-if(!function_exists('checkToken')) {
1093
+if (!function_exists('checkToken')) {
1094 1094
     /**
1095 1095
      * @return bool
1096 1096
      */
@@ -1115,7 +1115,7 @@  discard block
 block discarded – undo
1115 1115
     }
1116 1116
 }
1117 1117
 
1118
-if(!function_exists('makeToken')) {
1118
+if (!function_exists('makeToken')) {
1119 1119
     /**
1120 1120
      * @return string
1121 1121
      */
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -887,7 +887,7 @@
 block discarded – undo
887 887
                     $complete_name = $path . str_replace('\\', '/', $zip_entry_name);
888 888
                     if (!file_exists($complete_path)) {
889 889
                         $tmp = '';
890
-                        foreach (explode('/', $complete_path) AS $k) {
890
+                        foreach (explode('/', $complete_path) as $k) {
891 891
                             $tmp .= $k . '/';
892 892
                             if (!is_dir($tmp)) {
893 893
                                 mkdir($tmp, 0777);
Please login to merge, or discard this patch.
manager/actions/import_site.static.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -357,7 +357,7 @@
 block discarded – undo
357 357
 if(!function_exists('getFileContent')) {
358 358
     /**
359 359
      * @param string $filepath
360
-     * @return bool|string
360
+     * @return null|string
361 361
      */
362 362
     function getFileContent($filepath)
363 363
     {
Please login to merge, or discard this patch.
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -1,17 +1,17 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3
-	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
3
+    die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if(!$modx->hasPermission('import_static')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 // Files to upload
10 10
 $allowedfiles = array(
11
-	'html',
12
-	'htm',
13
-	'shtml',
14
-	'xml'
11
+    'html',
12
+    'htm',
13
+    'shtml',
14
+    'xml'
15 15
 );
16 16
 ?>
17 17
 	<script language="javascript">
@@ -43,9 +43,9 @@  discard block
 block discarded – undo
43 43
 	<div class="tab-page">
44 44
 		<div class="container container-body">
45 45
 			<?php
46
-			if(!isset($_POST['import'])) {
47
-				echo "<div class=\"element-edit-message\">" . $_lang['import_site_message'] . "</div>";
48
-				?>
46
+            if(!isset($_POST['import'])) {
47
+                echo "<div class=\"element-edit-message\">" . $_lang['import_site_message'] . "</div>";
48
+                ?>
49 49
 				<form action="index.php" method="post" name="importFrm">
50 50
 					<input type="hidden" name="import" value="import" />
51 51
 					<input type="hidden" name="a" value="95" />
@@ -85,18 +85,18 @@  discard block
 block discarded – undo
85 85
 					<a href="javascript:;" class="btn btn-primary" onclick="window.importFrm.submit();"><i class="<?= $_style["actions_save"] ?>"></i> <?= $_lang["import_site_start"] ?></a>
86 86
 				</form>
87 87
 			<?php
88
-			} else {
89
-			run();
90
-			$modx->clearCache('full');
91
-			?>
88
+            } else {
89
+            run();
90
+            $modx->clearCache('full');
91
+            ?>
92 92
 				<a href="javascript:;" class="btn btn-primary" onclick="window.location.href='index.php?a=2';"><i class="<?= $_style["actions_close"] ?>"></i> <?= $_lang["close"] ?></a>
93 93
 				<script type="text/javascript">
94 94
 					top.mainMenu.reloadtree();
95 95
 					parent.tree.ca = 'open';
96 96
 				</script>
97 97
 				<?php
98
-			}
99
-			?>
98
+            }
99
+            ?>
100 100
 		</div>
101 101
 	</div>
102 102
 
@@ -216,9 +216,9 @@  discard block
 block discarded – undo
216 216
                 $field['menuindex'] = 1;
217 217
                 $find = false;
218 218
                 foreach (array(
219
-                             'index.html',
220
-                             'index.htm'
221
-                         ) as $filename) {
219
+                                'index.html',
220
+                                'index.htm'
221
+                            ) as $filename) {
222 222
                     $filepath = $filedir . $alias . '/' . $filename;
223 223
                     if ($find === false && file_exists($filepath)) {
224 224
                         $file = getFileContent($filepath);
Please login to merge, or discard this patch.
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
 	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5
-if(!$modx->hasPermission('import_static')) {
5
+if (!$modx->hasPermission('import_static')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
@@ -43,8 +43,8 @@  discard block
 block discarded – undo
43 43
 	<div class="tab-page">
44 44
 		<div class="container container-body">
45 45
 			<?php
46
-			if(!isset($_POST['import'])) {
47
-				echo "<div class=\"element-edit-message\">" . $_lang['import_site_message'] . "</div>";
46
+			if (!isset($_POST['import'])) {
47
+				echo "<div class=\"element-edit-message\">".$_lang['import_site_message']."</div>";
48 48
 				?>
49 49
 				<form action="index.php" method="post" name="importFrm">
50 50
 					<input type="hidden" name="import" value="import" />
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 	</div>
102 102
 
103 103
 <?php
104
-if(!function_exists('run')) {
104
+if (!function_exists('run')) {
105 105
     /**
106 106
      * @return string
107 107
      */
@@ -130,12 +130,12 @@  discard block
 block discarded – undo
130 130
             $modx->db->query("ALTER TABLE {$tbl_site_content} AUTO_INCREMENT = 1");
131 131
         }
132 132
 
133
-        $parent = (int)$_POST['parent'];
133
+        $parent = (int) $_POST['parent'];
134 134
 
135
-        if (is_dir(MODX_BASE_PATH . 'temp/import')) {
136
-            $filedir = MODX_BASE_PATH . 'temp/import/';
137
-        } elseif (is_dir(MODX_BASE_PATH . 'assets/import')) {
138
-            $filedir = MODX_BASE_PATH . 'assets/import/';
135
+        if (is_dir(MODX_BASE_PATH.'temp/import')) {
136
+            $filedir = MODX_BASE_PATH.'temp/import/';
137
+        } elseif (is_dir(MODX_BASE_PATH.'assets/import')) {
138
+            $filedir = MODX_BASE_PATH.'assets/import/';
139 139
         } else {
140 140
             $filedir = '';
141 141
         }
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
         $files = pop_index($files);
147 147
 
148 148
         // no. of files to import
149
-        $output .= sprintf('<p>' . $_lang['import_files_found'] . '</p>', $filesfound);
149
+        $output .= sprintf('<p>'.$_lang['import_files_found'].'</p>', $filesfound);
150 150
 
151 151
         // import files
152 152
         if (0 < count($files)) {
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
         $mtime = $mtime[1] + $mtime[0];
160 160
         $importend = $mtime;
161 161
         $totaltime = ($importend - $importstart);
162
-        $output .= sprintf('<p>' . $_lang['import_site_time'] . '</p>', round($totaltime, 3));
162
+        $output .= sprintf('<p>'.$_lang['import_site_time'].'</p>', round($totaltime, 3));
163 163
 
164 164
         if ($_POST['convert_link'] == 'on') {
165 165
             convertLink();
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
     }
170 170
 }
171 171
 
172
-if(!function_exists('importFiles')) {
172
+if (!function_exists('importFiles')) {
173 173
     /**
174 174
      * @param int $parent
175 175
      * @param string $filedir
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
             if (is_array($value)) {
201 201
                 // create folder
202 202
                 $alias = $id;
203
-                printf('<span>' . $_lang['import_site_importing_document'] . '</span>', $alias);
203
+                printf('<span>'.$_lang['import_site_importing_document'].'</span>', $alias);
204 204
                 $field = array();
205 205
                 $field['type'] = 'document';
206 206
                 $field['contentType'] = 'text/html';
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
                              'index.html',
220 220
                              'index.htm'
221 221
                          ) as $filename) {
222
-                    $filepath = $filedir . $alias . '/' . $filename;
222
+                    $filepath = $filedir.$alias.'/'.$filename;
223 223
                     if ($find === false && file_exists($filepath)) {
224 224
                         $file = getFileContent($filepath);
225 225
                         list($pagetitle, $content, $description) = treatContent($file, $filename, $alias);
@@ -234,10 +234,10 @@  discard block
 block discarded – undo
234 234
                         $newid = $modx->db->insert($field, $tbl_site_content);
235 235
                         if ($newid) {
236 236
                             $find = true;
237
-                            echo ' - <span class="success">' . $_lang['import_site_success'] . '</span><br />' . "\n";
238
-                            importFiles($newid, $filedir . $alias . '/', $value, 'sub');
237
+                            echo ' - <span class="success">'.$_lang['import_site_success'].'</span><br />'."\n";
238
+                            importFiles($newid, $filedir.$alias.'/', $value, 'sub');
239 239
                         } else {
240
-                            echo '<span class="fail">' . $_lang["import_site_failed"] . "</span> " . $_lang["import_site_failed_db_error"] . $modx->db->getLastError();
240
+                            echo '<span class="fail">'.$_lang["import_site_failed"]."</span> ".$_lang["import_site_failed_db_error"].$modx->db->getLastError();
241 241
                             exit;
242 242
                         }
243 243
                     }
@@ -252,10 +252,10 @@  discard block
 block discarded – undo
252 252
                     $newid = $modx->db->insert($field, $tbl_site_content);
253 253
                     if ($newid) {
254 254
                         $find = true;
255
-                        echo ' - <span class="success">' . $_lang['import_site_success'] . '</span><br />' . "\n";
256
-                        importFiles($newid, $filedir . $alias . '/', $value, 'sub');
255
+                        echo ' - <span class="success">'.$_lang['import_site_success'].'</span><br />'."\n";
256
+                        importFiles($newid, $filedir.$alias.'/', $value, 'sub');
257 257
                     } else {
258
-                        echo '<span class="fail">' . $_lang["import_site_failed"] . "</span> " . $_lang["import_site_failed_db_error"] . $modx->db->getLastError();
258
+                        echo '<span class="fail">'.$_lang["import_site_failed"]."</span> ".$_lang["import_site_failed_db_error"].$modx->db->getLastError();
259 259
                         exit;
260 260
                     }
261 261
                 }
@@ -268,12 +268,12 @@  discard block
 block discarded – undo
268 268
                 $fparts = explode('.', $value);
269 269
                 $alias = $fparts[0];
270 270
                 $ext = (count($fparts) > 1) ? $fparts[count($fparts) - 1] : "";
271
-                printf("<span>" . $_lang['import_site_importing_document'] . "</span>", $filename);
271
+                printf("<span>".$_lang['import_site_importing_document']."</span>", $filename);
272 272
 
273 273
                 if (!in_array($ext, $allowedfiles)) {
274
-                    echo ' - <span class="fail">' . $_lang["import_site_skip"] . '</span><br />' . "\n";
274
+                    echo ' - <span class="fail">'.$_lang["import_site_skip"].'</span><br />'."\n";
275 275
                 } else {
276
-                    $filepath = $filedir . $filename;
276
+                    $filepath = $filedir.$filename;
277 277
                     $file = getFileContent($filepath);
278 278
                     list($pagetitle, $content, $description) = treatContent($file, $filename, $alias);
279 279
 
@@ -299,9 +299,9 @@  discard block
 block discarded – undo
299 299
                     $field['menuindex'] = ($alias == 'index') ? 0 : 2;
300 300
                     $newid = $modx->db->insert($field, $tbl_site_content);
301 301
                     if ($newid) {
302
-                        echo ' - <span class="success">' . $_lang['import_site_success'] . '</span><br />' . "\n";
302
+                        echo ' - <span class="success">'.$_lang['import_site_success'].'</span><br />'."\n";
303 303
                     } else {
304
-                        echo '<span class="fail">' . $_lang["import_site_failed"] . "</span> " . $_lang["import_site_failed_db_error"] . $modx->db->getLastError();
304
+                        echo '<span class="fail">'.$_lang["import_site_failed"]."</span> ".$_lang["import_site_failed_db_error"].$modx->db->getLastError();
305 305
                         exit;
306 306
                     }
307 307
 
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
     }
321 321
 }
322 322
 
323
-if(!function_exists('getFiles')) {
323
+if (!function_exists('getFiles')) {
324 324
     /**
325 325
      * @param string $directory
326 326
      * @param array $listing
@@ -336,10 +336,10 @@  discard block
 block discarded – undo
336 336
             foreach ($files as $file) {
337 337
                 if ($file == '.' || $file == '..') {
338 338
                     continue;
339
-                } elseif ($h = @opendir($directory . $file . "/")) {
339
+                } elseif ($h = @opendir($directory.$file."/")) {
340 340
                     closedir($h);
341 341
                     $count = -1;
342
-                    $listing[$file] = getFiles($directory . $file . "/", array(), $count + 1);
342
+                    $listing[$file] = getFiles($directory.$file."/", array(), $count + 1);
343 343
                 } elseif (strpos($file, '.htm') !== false) {
344 344
                     $listing[$dummy] = $file;
345 345
                     $dummy = $dummy + 1;
@@ -347,14 +347,14 @@  discard block
 block discarded – undo
347 347
                 }
348 348
             }
349 349
         } else {
350
-            echo '<p><span class="fail">' . $_lang["import_site_failed"] . "</span> " . $_lang["import_site_failed_no_open_dir"] . $directory . ".</p>";
350
+            echo '<p><span class="fail">'.$_lang["import_site_failed"]."</span> ".$_lang["import_site_failed_no_open_dir"].$directory.".</p>";
351 351
         }
352 352
 
353 353
         return ($listing);
354 354
     }
355 355
 }
356 356
 
357
-if(!function_exists('getFileContent')) {
357
+if (!function_exists('getFileContent')) {
358 358
     /**
359 359
      * @param string $filepath
360 360
      * @return bool|string
@@ -364,14 +364,14 @@  discard block
 block discarded – undo
364 364
         global $_lang;
365 365
         // get the file
366 366
         if (!$buffer = file_get_contents($filepath)) {
367
-            echo '<p><span class="fail">' . $_lang['import_site_failed'] . "</span> " . $_lang["import_site_failed_no_retrieve_file"] . $filepath . ".</p>";
367
+            echo '<p><span class="fail">'.$_lang['import_site_failed']."</span> ".$_lang["import_site_failed_no_retrieve_file"].$filepath.".</p>";
368 368
         } else {
369 369
             return $buffer;
370 370
         }
371 371
     }
372 372
 }
373 373
 
374
-if(!function_exists('pop_index')) {
374
+if (!function_exists('pop_index')) {
375 375
     /**
376 376
      * @param array $array
377 377
      * @return array
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
     }
397 397
 }
398 398
 
399
-if(!function_exists('treatContent')) {
399
+if (!function_exists('treatContent')) {
400 400
     /**
401 401
      * @param string $src
402 402
      * @param string $filename
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
         } else {
432 432
             $content = $src;
433 433
             $s = '/(<meta[^>]+charset\s*=)[^>"\'=]+(.+>)/i';
434
-            $r = '$1' . $modx->config['modx_charset'] . '$2';
434
+            $r = '$1'.$modx->config['modx_charset'].'$2';
435 435
             $content = preg_replace($s, $r, $content);
436 436
             $content = preg_replace('@<title>.*</title>@i', "<title>[*pagetitle*]</title>", $content);
437 437
         }
@@ -447,7 +447,7 @@  discard block
 block discarded – undo
447 447
     }
448 448
 }
449 449
 
450
-if(!function_exists('convertLink')) {
450
+if (!function_exists('convertLink')) {
451 451
     /**
452 452
      * @return void
453 453
      */
@@ -470,7 +470,7 @@  discard block
 block discarded – undo
470 470
                     list($href, $v) = explode('"', $v, 2);
471 471
                     $_ = $href;
472 472
                     if (strpos($_, $modx->config['site_url']) !== false) {
473
-                        $_ = $modx->config['base_url'] . str_replace($modx->config['site_url'], '', $_);
473
+                        $_ = $modx->config['base_url'].str_replace($modx->config['site_url'], '', $_);
474 474
                     }
475 475
                     if ($_[0] === '/') {
476 476
                         $_ = substr($_, 1);
@@ -497,15 +497,15 @@  discard block
 block discarded – undo
497 497
                     if (strpos($_, '/') !== false) {
498 498
                         $_ = substr($_, strrpos($_, '/'));
499 499
                     }
500
-                    $_ = $dir . str_replace('.html', '', $_);
500
+                    $_ = $dir.str_replace('.html', '', $_);
501 501
                     if (!isset($target[$_])) {
502 502
                         $target[$_] = $modx->getIdFromAlias($_);
503 503
                     }
504 504
                     $target[$_] = trim($target[$_]);
505 505
                     if (!empty($target[$_])) {
506
-                        $href = '[~' . $target[$_] . '~]';
506
+                        $href = '[~'.$target[$_].'~]';
507 507
                     }
508
-                    $array[$c] = '<a href="' . $href . '"' . $v;
508
+                    $array[$c] = '<a href="'.$href.'"'.$v;
509 509
                 }
510 510
                 $c++;
511 511
             }
Please login to merge, or discard this patch.
manager/includes/functions/tv.php 4 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
      *
173 173
      * @param string $param
174 174
      * @param array $tvsArray
175
-     * @return mixed
175
+     * @return string
176 176
      */
177 177
     function parseTvValues($param, $tvsArray)
178 178
     {
@@ -566,7 +566,7 @@  discard block
 block discarded – undo
566 566
     /**
567 567
      * returns an array if a delimiter is present. returns array is a recordset is present
568 568
      *
569
-     * @param $src
569
+     * @param string $src
570 570
      * @param string $delim
571 571
      * @param string $type
572 572
      * @param bool $columns
@@ -1022,7 +1022,7 @@  discard block
 block discarded – undo
1022 1022
 
1023 1023
 if (! function_exists('ParseIntputOptions')) {
1024 1024
     /**
1025
-     * @param string|array|mysqli_result $v
1025
+     * @param string $v
1026 1026
      * @return array
1027 1027
      */
1028 1028
     function ParseIntputOptions($v)
Please login to merge, or discard this patch.
Spacing   +76 added lines, -76 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (! function_exists('ProcessTVCommand')) {
3
+if (!function_exists('ProcessTVCommand')) {
4 4
     /**
5 5
      * @param string $value
6 6
      * @param string $name
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
     function ProcessTVCommand($value, $name = '', $docid = '', $src = 'docform', $tvsArray = array())
13 13
     {
14 14
         $modx = evolutionCMS();
15
-        $docid = (int)$docid > 0 ? (int)$docid : $modx->documentIdentifier;
15
+        $docid = (int) $docid > 0 ? (int) $docid : $modx->documentIdentifier;
16 16
         $nvalue = trim($value);
17 17
         if (substr($nvalue, 0, 1) != '@') {
18 18
             return $value;
@@ -77,8 +77,8 @@  discard block
 block discarded – undo
77 77
                         // if an inherited value is found and if there is content following the @INHERIT binding
78 78
                         // remove @INHERIT and output that following content. This content could contain other
79 79
                         // @ bindings, that are processed in the next step
80
-                        if ((string)$tv['value'] !== '' && !preg_match('%^@INHERIT[\s\n\r]*$%im', $tv['value'])) {
81
-                            $output = trim(str_replace('@INHERIT', '', (string)$tv['value']));
80
+                        if ((string) $tv['value'] !== '' && !preg_match('%^@INHERIT[\s\n\r]*$%im', $tv['value'])) {
81
+                            $output = trim(str_replace('@INHERIT', '', (string) $tv['value']));
82 82
                             break 2;
83 83
                         }
84 84
                     }
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 
87 87
                 case 'DIRECTORY' :
88 88
                     $files = array();
89
-                    $path = $modx->config['base_path'] . $param;
89
+                    $path = $modx->config['base_path'].$param;
90 90
                     if (substr($path, -1, 1) != '/') {
91 91
                         $path .= '/';
92 92
                     }
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
     }
118 118
 }
119 119
 
120
-if (! function_exists('ProcessFile')) {
120
+if (!function_exists('ProcessFile')) {
121 121
     /**
122 122
      * @param $file
123 123
      * @return string
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
     }
135 135
 }
136 136
 
137
-if (! function_exists('ParseCommand')) {
137
+if (!function_exists('ParseCommand')) {
138 138
     /**
139 139
      * ParseCommand - separate @ cmd from params
140 140
      *
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 
156 156
         $binding_array = array();
157 157
         foreach ($BINDINGS as $cmd) {
158
-            if (strpos($binding_string, '@' . $cmd) === 0) {
158
+            if (strpos($binding_string, '@'.$cmd) === 0) {
159 159
                 $code = substr($binding_string, strlen($cmd) + 1);
160 160
                 $binding_array = array($cmd, trim($code));
161 161
                 break;
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
     }
167 167
 }
168 168
 
169
-if (! function_exists('parseTvValues')) {
169
+if (!function_exists('parseTvValues')) {
170 170
     /**
171 171
      * Parse MODX Template-Variables
172 172
      *
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
     }
198 198
 }
199 199
 
200
-if (! function_exists('getTVDisplayFormat')) {
200
+if (!function_exists('getTVDisplayFormat')) {
201 201
     /**
202 202
      * @param string $name
203 203
      * @param string $value
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
         $o = '';
216 216
 
217 217
         // process any TV commands in value
218
-        $docid = (int)$docid > 0 ? (int)$docid : $modx->documentIdentifier;
218
+        $docid = (int) $docid > 0 ? (int) $docid : $modx->documentIdentifier;
219 219
         $value = ProcessTVCommand($value, $name, $docid);
220 220
 
221 221
         $params = array();
@@ -254,12 +254,12 @@  discard block
 block discarded – undo
254 254
                             $attr['align'] = $params['align'];
255 255
                         }
256 256
                         foreach ($attr as $k => $v) {
257
-                            $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : '');
257
+                            $attributes .= ($v ? ' '.$k.'="'.$v.'"' : '');
258 258
                         }
259
-                        $attributes .= ' ' . $params['attrib'];
259
+                        $attributes .= ' '.$params['attrib'];
260 260
 
261 261
                         // Output the image with attributes
262
-                        $o .= '<img' . rtrim($attributes) . ' />';
262
+                        $o .= '<img'.rtrim($attributes).' />';
263 263
                     }
264 264
                 }
265 265
                 break;
@@ -331,12 +331,12 @@  discard block
 block discarded – undo
331 331
                             'target' => $params['target'],
332 332
                         );
333 333
                         foreach ($attr as $k => $v) {
334
-                            $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : '');
334
+                            $attributes .= ($v ? ' '.$k.'="'.$v.'"' : '');
335 335
                         }
336
-                        $attributes .= ' ' . $params['attrib']; // add extra
336
+                        $attributes .= ' '.$params['attrib']; // add extra
337 337
 
338 338
                         // Output the link
339
-                        $o .= '<a' . rtrim($attributes) . '>' . ($params['text'] ? $modx->htmlspecialchars($params['text']) : $name) . '</a>';
339
+                        $o .= '<a'.rtrim($attributes).'>'.($params['text'] ? $modx->htmlspecialchars($params['text']) : $name).'</a>';
340 340
                     }
341 341
                 }
342 342
                 break;
@@ -362,12 +362,12 @@  discard block
 block discarded – undo
362 362
                         'style' => $params['style'],
363 363
                     );
364 364
                     foreach ($attr as $k => $v) {
365
-                        $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : '');
365
+                        $attributes .= ($v ? ' '.$k.'="'.$v.'"' : '');
366 366
                     }
367
-                    $attributes .= ' ' . $params['attrib']; // add extra
367
+                    $attributes .= ' '.$params['attrib']; // add extra
368 368
 
369 369
                     // Output the HTML Tag
370
-                    $o .= '<' . $tagname . rtrim($attributes) . '>' . $tagvalue . '</' . $tagname . '>';
370
+                    $o .= '<'.$tagname.rtrim($attributes).'>'.$tagvalue.'</'.$tagname.'>';
371 371
                 }
372 372
                 break;
373 373
 
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
                 $w = $params['w'] ? $params['w'] : '100%';
377 377
                 $h = $params['h'] ? $params['h'] : '400px';
378 378
                 $richtexteditor = $params['edt'] ? $params['edt'] : "";
379
-                $o = '<div class="MODX_RichTextWidget"><textarea id="' . $id . '" name="' . $id . '" style="width:' . $w . '; height:' . $h . ';">';
379
+                $o = '<div class="MODX_RichTextWidget"><textarea id="'.$id.'" name="'.$id.'" style="width:'.$w.'; height:'.$h.';">';
380 380
                 $o .= $modx->htmlspecialchars($value);
381 381
                 $o .= '</textarea></div>';
382 382
                 $replace_richtext = array($id);
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
 
404 404
             case "viewport":
405 405
                 $value = parseInput($value);
406
-                $id = '_' . time();
406
+                $id = '_'.time();
407 407
                 if (!$params['vpid']) {
408 408
                     $params['vpid'] = $id;
409 409
                 }
@@ -417,41 +417,41 @@  discard block
 block discarded – undo
417 417
                     $h = "100%";
418 418
                 }
419 419
                 if ($params['asize'] == 'Yes' || ($params['awidth'] == 'Yes' && $params['aheight'] == 'Yes')) {
420
-                    $autoMode = "3";  //both
420
+                    $autoMode = "3"; //both
421 421
                 } else {
422 422
                     if ($params['awidth'] == 'Yes') {
423 423
                         $autoMode = "1"; //width only
424 424
                     } else {
425 425
                         if ($params['aheight'] == 'Yes') {
426
-                            $autoMode = "2";    //height only
426
+                            $autoMode = "2"; //height only
427 427
                         }
428 428
                     }
429 429
                 }
430 430
 
431
-                $modx->regClientStartupScript(MODX_MANAGER_URL . "media/script/bin/viewport.js", array(
431
+                $modx->regClientStartupScript(MODX_MANAGER_URL."media/script/bin/viewport.js", array(
432 432
                     'name'      => 'viewport',
433 433
                     'version'   => '0',
434 434
                     'plaintext' => false
435 435
                 ));
436
-                $o = $sTag . " id='" . $params['vpid'] . "' name='" . $params['vpid'] . "' ";
436
+                $o = $sTag." id='".$params['vpid']."' name='".$params['vpid']."' ";
437 437
                 if ($params['class']) {
438
-                    $o .= " class='" . $params['class'] . "' ";
438
+                    $o .= " class='".$params['class']."' ";
439 439
                 }
440 440
                 if ($params['style']) {
441
-                    $o .= " style='" . $params['style'] . "' ";
441
+                    $o .= " style='".$params['style']."' ";
442 442
                 }
443 443
                 if ($params['attrib']) {
444
-                    $o .= $params['attrib'] . " ";
444
+                    $o .= $params['attrib']." ";
445 445
                 }
446
-                $o .= "scrolling='" . ($params['sbar'] == 'No' ? "no" : ($params['sbar'] == 'Yes' ? "yes" : "auto")) . "' ";
447
-                $o .= "src='" . $value . "' frameborder='" . $params['borsize'] . "' ";
448
-                $o .= "onload=\"window.setTimeout('ResizeViewPort(\\'" . $params['vpid'] . "\\'," . $autoMode . ")',100);\" width='" . $w . "' height='" . $h . "' ";
446
+                $o .= "scrolling='".($params['sbar'] == 'No' ? "no" : ($params['sbar'] == 'Yes' ? "yes" : "auto"))."' ";
447
+                $o .= "src='".$value."' frameborder='".$params['borsize']."' ";
448
+                $o .= "onload=\"window.setTimeout('ResizeViewPort(\\'".$params['vpid']."\\',".$autoMode.")',100);\" width='".$w."' height='".$h."' ";
449 449
                 $o .= ">";
450 450
                 $o .= $eTag;
451 451
                 break;
452 452
 
453 453
             case "datagrid":
454
-                include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php";
454
+                include_once MODX_MANAGER_PATH."includes/controls/datagrid.class.php";
455 455
                 $grd = new DataGrid('', $value);
456 456
 
457 457
                 $grd->noRecordMsg = $params['egmsg'];
@@ -498,16 +498,16 @@  discard block
 block discarded – undo
498 498
                 $o = '';
499 499
                 /* If we are loading a file */
500 500
                 if (substr($params['output'], 0, 5) == "@FILE") {
501
-                    $file_name = MODX_BASE_PATH . trim(substr($params['output'], 6));
501
+                    $file_name = MODX_BASE_PATH.trim(substr($params['output'], 6));
502 502
                     if (!file_exists($file_name)) {
503
-                        $widget_output = $file_name . ' does not exist';
503
+                        $widget_output = $file_name.' does not exist';
504 504
                     } else {
505 505
                         $widget_output = file_get_contents($file_name);
506 506
                     }
507 507
                 } elseif (substr($params['output'], 0, 8) == '@INCLUDE') {
508
-                    $file_name = MODX_BASE_PATH . trim(substr($params['output'], 9));
508
+                    $file_name = MODX_BASE_PATH.trim(substr($params['output'], 9));
509 509
                     if (!file_exists($file_name)) {
510
-                        $widget_output = $file_name . ' does not exist';
510
+                        $widget_output = $file_name.' does not exist';
511 511
                     } else {
512 512
                         /* The included file needs to set $widget_output. Can be string, array, object */
513 513
                         include $file_name;
@@ -549,7 +549,7 @@  discard block
 block discarded – undo
549 549
     }
550 550
 }
551 551
 
552
-if (! function_exists('decodeParamValue')) {
552
+if (!function_exists('decodeParamValue')) {
553 553
     /**
554 554
      * @param string $s
555 555
      * @return string
@@ -562,7 +562,7 @@  discard block
 block discarded – undo
562 562
     }
563 563
 }
564 564
 
565
-if (! function_exists('parseInput')) {
565
+if (!function_exists('parseInput')) {
566 566
     /**
567 567
      * returns an array if a delimiter is present. returns array is a recordset is present
568 568
      *
@@ -594,7 +594,7 @@  discard block
 block discarded – undo
594 594
     }
595 595
 }
596 596
 
597
-if (! function_exists('getUnixtimeFromDateString')) {
597
+if (!function_exists('getUnixtimeFromDateString')) {
598 598
     /**
599 599
      * @param string $value
600 600
      * @return bool|false|int
@@ -622,7 +622,7 @@  discard block
 block discarded – undo
622 622
     }
623 623
 }
624 624
 
625
-if (! function_exists('renderFormElement')) {
625
+if (!function_exists('renderFormElement')) {
626 626
     /**
627 627
      * DISPLAY FORM ELEMENTS
628 628
      *
@@ -645,7 +645,7 @@  discard block
 block discarded – undo
645 645
         $field_style = '',
646 646
         $row = array(),
647 647
         $tvsArray = array()
648
-    ) {
648
+    ){
649 649
         $modx = evolutionCMS();
650 650
         global $_style;
651 651
         global $_lang;
@@ -665,22 +665,22 @@  discard block
 block discarded – undo
665 665
 
666 666
                 case "text": // handler for regular text boxes
667 667
                 case "rawtext"; // non-htmlentity converted text boxes
668
-                    $field_html .= '<input type="text" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $modx->htmlspecialchars($field_value) . '" ' . $field_style . ' tvtype="' . $field_type . '" onchange="documentDirty=true;" style="width:100%" />';
668
+                    $field_html .= '<input type="text" id="tv'.$field_id.'" name="tv'.$field_id.'" value="'.$modx->htmlspecialchars($field_value).'" '.$field_style.' tvtype="'.$field_type.'" onchange="documentDirty=true;" style="width:100%" />';
669 669
                     break;
670 670
                 case "email": // handles email input fields
671
-                    $field_html .= '<input type="email" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $modx->htmlspecialchars($field_value) . '" ' . $field_style . ' tvtype="' . $field_type . '" onchange="documentDirty=true;" style="width:100%"/>';
671
+                    $field_html .= '<input type="email" id="tv'.$field_id.'" name="tv'.$field_id.'" value="'.$modx->htmlspecialchars($field_value).'" '.$field_style.' tvtype="'.$field_type.'" onchange="documentDirty=true;" style="width:100%"/>';
672 672
                     break;
673 673
                 case "number": // handles the input of numbers
674
-                    $field_html .= '<input type="number" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $modx->htmlspecialchars($field_value) . '" ' . $field_style . ' tvtype="' . $field_type . '" onchange="documentDirty=true;" style="width:100%" onkeyup="this.value=this.value.replace(/[^\d-,.+]/,\'\')"/>';
674
+                    $field_html .= '<input type="number" id="tv'.$field_id.'" name="tv'.$field_id.'" value="'.$modx->htmlspecialchars($field_value).'" '.$field_style.' tvtype="'.$field_type.'" onchange="documentDirty=true;" style="width:100%" onkeyup="this.value=this.value.replace(/[^\d-,.+]/,\'\')"/>';
675 675
                     break;
676 676
                 case "textareamini": // handler for textarea mini boxes
677
-                    $field_html .= '<textarea id="tv' . $field_id . '" name="tv' . $field_id . '" cols="40" rows="5" onchange="documentDirty=true;" style="width:100%">' . $modx->htmlspecialchars($field_value) . '</textarea>';
677
+                    $field_html .= '<textarea id="tv'.$field_id.'" name="tv'.$field_id.'" cols="40" rows="5" onchange="documentDirty=true;" style="width:100%">'.$modx->htmlspecialchars($field_value).'</textarea>';
678 678
                     break;
679 679
                 case "textarea": // handler for textarea boxes
680 680
                 case "rawtextarea": // non-htmlentity convertex textarea boxes
681 681
                 case "htmlarea": // handler for textarea boxes (deprecated)
682 682
                 case "richtext": // handler for textarea boxes
683
-                    $field_html .= '<textarea id="tv' . $field_id . '" name="tv' . $field_id . '" cols="40" rows="15" onchange="documentDirty=true;" style="width:100%">' . $modx->htmlspecialchars($field_value) . '</textarea>';
683
+                    $field_html .= '<textarea id="tv'.$field_id.'" name="tv'.$field_id.'" cols="40" rows="15" onchange="documentDirty=true;" style="width:100%">'.$modx->htmlspecialchars($field_value).'</textarea>';
684 684
                     break;
685 685
                 case "date":
686 686
                     $field_id = str_replace(array(
@@ -690,12 +690,12 @@  discard block
 block discarded – undo
690 690
                     if ($field_value == '') {
691 691
                         $field_value = 0;
692 692
                     }
693
-                    $field_html .= '<input id="tv' . $field_id . '" name="tv' . $field_id . '" class="DatePicker" type="text" value="' . ($field_value == 0 || !isset($field_value) ? "" : $field_value) . '" onblur="documentDirty=true;" />';
694
-                    $field_html .= ' <a onclick="document.forms[\'mutate\'].elements[\'tv' . $field_id . '\'].value=\'\';document.forms[\'mutate\'].elements[\'tv' . $field_id . '\'].onblur(); return true;" onmouseover="window.status=\'clear the date\'; return true;" onmouseout="window.status=\'\'; return true;" style="cursor:pointer; cursor:hand"><i class="' . $_style["actions_calendar_delete"] . '"></i></a>';
693
+                    $field_html .= '<input id="tv'.$field_id.'" name="tv'.$field_id.'" class="DatePicker" type="text" value="'.($field_value == 0 || !isset($field_value) ? "" : $field_value).'" onblur="documentDirty=true;" />';
694
+                    $field_html .= ' <a onclick="document.forms[\'mutate\'].elements[\'tv'.$field_id.'\'].value=\'\';document.forms[\'mutate\'].elements[\'tv'.$field_id.'\'].onblur(); return true;" onmouseover="window.status=\'clear the date\'; return true;" onmouseout="window.status=\'\'; return true;" style="cursor:pointer; cursor:hand"><i class="'.$_style["actions_calendar_delete"].'"></i></a>';
695 695
 
696 696
                     break;
697 697
                 case "dropdown": // handler for select boxes
698
-                    $field_html .= '<select id="tv' . $field_id . '" name="tv' . $field_id . '" size="1" onchange="documentDirty=true;">';
698
+                    $field_html .= '<select id="tv'.$field_id.'" name="tv'.$field_id.'" size="1" onchange="documentDirty=true;">';
699 699
                     $index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform',
700 700
                         $tvsArray));
701 701
                     while (list($item, $itemvalue) = each($index_list)) {
@@ -703,12 +703,12 @@  discard block
 block discarded – undo
703 703
                         if (strlen($itemvalue) == 0) {
704 704
                             $itemvalue = $item;
705 705
                         }
706
-                        $field_html .= '<option value="' . $modx->htmlspecialchars($itemvalue) . '"' . ($itemvalue == $field_value ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($item) . '</option>';
706
+                        $field_html .= '<option value="'.$modx->htmlspecialchars($itemvalue).'"'.($itemvalue == $field_value ? ' selected="selected"' : '').'>'.$modx->htmlspecialchars($item).'</option>';
707 707
                     }
708 708
                     $field_html .= "</select>";
709 709
                     break;
710 710
                 case "listbox": // handler for select boxes
711
-                    $field_html .= '<select id="tv' . $field_id . '" name="tv' . $field_id . '" onchange="documentDirty=true;" size="8">';
711
+                    $field_html .= '<select id="tv'.$field_id.'" name="tv'.$field_id.'" onchange="documentDirty=true;" size="8">';
712 712
                     $index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform',
713 713
                         $tvsArray));
714 714
                     while (list($item, $itemvalue) = each($index_list)) {
@@ -716,13 +716,13 @@  discard block
 block discarded – undo
716 716
                         if (strlen($itemvalue) == 0) {
717 717
                             $itemvalue = $item;
718 718
                         }
719
-                        $field_html .= '<option value="' . $modx->htmlspecialchars($itemvalue) . '"' . ($itemvalue == $field_value ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($item) . '</option>';
719
+                        $field_html .= '<option value="'.$modx->htmlspecialchars($itemvalue).'"'.($itemvalue == $field_value ? ' selected="selected"' : '').'>'.$modx->htmlspecialchars($item).'</option>';
720 720
                     }
721 721
                     $field_html .= "</select>";
722 722
                     break;
723 723
                 case "listbox-multiple": // handler for select boxes where you can choose multiple items
724 724
                     $field_value = explode("||", $field_value);
725
-                    $field_html .= '<select id="tv' . $field_id . '" name="tv' . $field_id . '[]" multiple="multiple" onchange="documentDirty=true;" size="8">';
725
+                    $field_html .= '<select id="tv'.$field_id.'" name="tv'.$field_id.'[]" multiple="multiple" onchange="documentDirty=true;" size="8">';
726 726
                     $index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform',
727 727
                         $tvsArray));
728 728
                     while (list($item, $itemvalue) = each($index_list)) {
@@ -730,8 +730,8 @@  discard block
 block discarded – undo
730 730
                         if (strlen($itemvalue) == 0) {
731 731
                             $itemvalue = $item;
732 732
                         }
733
-                        $field_html .= '<option value="' . $modx->htmlspecialchars($itemvalue) . '"' . (in_array($itemvalue,
734
-                                $field_value) ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($item) . '</option>';
733
+                        $field_html .= '<option value="'.$modx->htmlspecialchars($itemvalue).'"'.(in_array($itemvalue,
734
+                                $field_value) ? ' selected="selected"' : '').'>'.$modx->htmlspecialchars($item).'</option>';
735 735
                     }
736 736
                     $field_html .= "</select>";
737 737
                     break;
@@ -743,17 +743,17 @@  discard block
 block discarded – undo
743 743
                         'ftp://'   => 'ftp://',
744 744
                         'mailto:'  => 'mailto:'
745 745
                     );
746
-                    $field_html = '<table border="0" cellspacing="0" cellpadding="0"><tr><td><select id="tv' . $field_id . '_prefix" name="tv' . $field_id . '_prefix" onchange="documentDirty=true;">';
746
+                    $field_html = '<table border="0" cellspacing="0" cellpadding="0"><tr><td><select id="tv'.$field_id.'_prefix" name="tv'.$field_id.'_prefix" onchange="documentDirty=true;">';
747 747
                     foreach ($urls as $k => $v) {
748 748
                         if (strpos($field_value, $v) === false) {
749
-                            $field_html .= '<option value="' . $v . '">' . $k . '</option>';
749
+                            $field_html .= '<option value="'.$v.'">'.$k.'</option>';
750 750
                         } else {
751 751
                             $field_value = str_replace($v, '', $field_value);
752
-                            $field_html .= '<option value="' . $v . '" selected="selected">' . $k . '</option>';
752
+                            $field_html .= '<option value="'.$v.'" selected="selected">'.$k.'</option>';
753 753
                         }
754 754
                     }
755 755
                     $field_html .= '</select></td><td>';
756
-                    $field_html .= '<input type="text" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $modx->htmlspecialchars($field_value) . '" width="100" ' . $field_style . ' onchange="documentDirty=true;" /></td></tr></table>';
756
+                    $field_html .= '<input type="text" id="tv'.$field_id.'" name="tv'.$field_id.'" value="'.$modx->htmlspecialchars($field_value).'" width="100" '.$field_style.' onchange="documentDirty=true;" /></td></tr></table>';
757 757
                     break;
758 758
                 case 'checkbox': // handles check boxes
759 759
                     $values = !is_array($field_value) ? explode('||', $field_value) : $field_value;
@@ -795,7 +795,7 @@  discard block
 block discarded – undo
795 795
                         if (strlen($itemvalue) == 0) {
796 796
                             $itemvalue = $item;
797 797
                         }
798
-                        $field_html .= '<input type="radio" value="' . $modx->htmlspecialchars($itemvalue) . '" id="tv_' . $i . '" name="tv' . $field_id . '" ' . ($itemvalue == $field_value ? 'checked="checked"' : '') . ' onchange="documentDirty=true;" /><label for="tv_' . $i . '" class="radio">' . $item . '</label><br />';
798
+                        $field_html .= '<input type="radio" value="'.$modx->htmlspecialchars($itemvalue).'" id="tv_'.$i.'" name="tv'.$field_id.'" '.($itemvalue == $field_value ? 'checked="checked"' : '').' onchange="documentDirty=true;" /><label for="tv_'.$i.'" class="radio">'.$item.'</label><br />';
799 799
                         $i++;
800 800
                     }
801 801
                     break;
@@ -825,13 +825,13 @@  discard block
 block discarded – undo
825 825
 									lastImageCtrl = ctrl;
826 826
 									var w = screen.width * 0.5;
827 827
 									var h = screen.height * 0.5;
828
-									OpenServerBrowser('" . MODX_MANAGER_URL . "media/browser/{$which_browser}/browser.php?Type=images', w, h);
828
+									OpenServerBrowser('" . MODX_MANAGER_URL."media/browser/{$which_browser}/browser.php?Type=images', w, h);
829 829
 								}
830 830
 								function BrowseFileServer(ctrl) {
831 831
 									lastFileCtrl = ctrl;
832 832
 									var w = screen.width * 0.5;
833 833
 									var h = screen.height * 0.5;
834
-									OpenServerBrowser('" . MODX_MANAGER_URL . "media/browser/{$which_browser}/browser.php?Type=files', w, h);
834
+									OpenServerBrowser('".MODX_MANAGER_URL."media/browser/{$which_browser}/browser.php?Type=files', w, h);
835 835
 								}
836 836
 								function SetUrlChange(el) {
837 837
 									if ('createEvent' in document) {
@@ -865,7 +865,7 @@  discard block
 block discarded – undo
865 865
 						</script>";
866 866
                         $ResourceManagerLoaded = true;
867 867
                     }
868
-                    $field_html .= '<input type="text" id="tv' . $field_id . '" name="tv' . $field_id . '"  value="' . $field_value . '" ' . $field_style . ' onchange="documentDirty=true;" /><input type="button" value="' . $_lang['insert'] . '" onclick="BrowseServer(\'tv' . $field_id . '\')" />';
868
+                    $field_html .= '<input type="text" id="tv'.$field_id.'" name="tv'.$field_id.'"  value="'.$field_value.'" '.$field_style.' onchange="documentDirty=true;" /><input type="button" value="'.$_lang['insert'].'" onclick="BrowseServer(\'tv'.$field_id.'\')" />';
869 869
                     break;
870 870
                 case "file": // handles the input of file uploads
871 871
                     /* Modified by Timon for use with resource browser */
@@ -895,13 +895,13 @@  discard block
 block discarded – undo
895 895
 									lastImageCtrl = ctrl;
896 896
 									var w = screen.width * 0.5;
897 897
 									var h = screen.height * 0.5;
898
-									OpenServerBrowser('" . MODX_MANAGER_URL . "media/browser/{$which_browser}/browser.php?Type=images', w, h);
898
+									OpenServerBrowser('" . MODX_MANAGER_URL."media/browser/{$which_browser}/browser.php?Type=images', w, h);
899 899
 								}
900 900
 								function BrowseFileServer(ctrl) {
901 901
 									lastFileCtrl = ctrl;
902 902
 									var w = screen.width * 0.5;
903 903
 									var h = screen.height * 0.5;
904
-									OpenServerBrowser('" . MODX_MANAGER_URL . "media/browser/{$which_browser}/browser.php?Type=files', w, h);
904
+									OpenServerBrowser('".MODX_MANAGER_URL."media/browser/{$which_browser}/browser.php?Type=files', w, h);
905 905
 								}
906 906
 								function SetUrlChange(el) {
907 907
 									if ('createEvent' in document) {
@@ -935,7 +935,7 @@  discard block
 block discarded – undo
935 935
 						</script>";
936 936
                         $ResourceManagerLoaded = true;
937 937
                     }
938
-                    $field_html .= '<input type="text" id="tv' . $field_id . '" name="tv' . $field_id . '"  value="' . $field_value . '" ' . $field_style . ' onchange="documentDirty=true;" /><input type="button" value="' . $_lang['insert'] . '" onclick="BrowseFileServer(\'tv' . $field_id . '\')" />';
938
+                    $field_html .= '<input type="text" id="tv'.$field_id.'" name="tv'.$field_id.'"  value="'.$field_value.'" '.$field_style.' onchange="documentDirty=true;" /><input type="button" value="'.$_lang['insert'].'" onclick="BrowseFileServer(\'tv'.$field_id.'\')" />';
939 939
 
940 940
                     break;
941 941
 
@@ -943,16 +943,16 @@  discard block
 block discarded – undo
943 943
                     $custom_output = '';
944 944
                     /* If we are loading a file */
945 945
                     if (substr($field_elements, 0, 5) == "@FILE") {
946
-                        $file_name = MODX_BASE_PATH . trim(substr($field_elements, 6));
946
+                        $file_name = MODX_BASE_PATH.trim(substr($field_elements, 6));
947 947
                         if (!file_exists($file_name)) {
948
-                            $custom_output = $file_name . ' does not exist';
948
+                            $custom_output = $file_name.' does not exist';
949 949
                         } else {
950 950
                             $custom_output = file_get_contents($file_name);
951 951
                         }
952 952
                     } elseif (substr($field_elements, 0, 8) == '@INCLUDE') {
953
-                        $file_name = MODX_BASE_PATH . trim(substr($field_elements, 9));
953
+                        $file_name = MODX_BASE_PATH.trim(substr($field_elements, 9));
954 954
                         if (!file_exists($file_name)) {
955
-                            $custom_output = $file_name . ' does not exist';
955
+                            $custom_output = $file_name.' does not exist';
956 956
                         } else {
957 957
                             ob_start();
958 958
                             include $file_name;
@@ -963,7 +963,7 @@  discard block
 block discarded – undo
963 963
                         $chunk_name = trim(substr($field_elements, 7));
964 964
                         $chunk_body = $modx->getChunk($chunk_name);
965 965
                         if ($chunk_body == false) {
966
-                            $custom_output = $_lang['chunk_no_exist'] . '(' . $_lang['htmlsnippet_name'] . ':' . $chunk_name . ')';
966
+                            $custom_output = $_lang['chunk_no_exist'].'('.$_lang['htmlsnippet_name'].':'.$chunk_name.')';
967 967
                         } else {
968 968
                             $custom_output = $chunk_body;
969 969
                         }
@@ -988,15 +988,15 @@  discard block
 block discarded – undo
988 988
                     break;
989 989
 
990 990
                 default: // the default handler -- for errors, mostly
991
-                    $field_html .= '<input type="text" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $modx->htmlspecialchars($field_value) . '" ' . $field_style . ' onchange="documentDirty=true;" />';
991
+                    $field_html .= '<input type="text" id="tv'.$field_id.'" name="tv'.$field_id.'" value="'.$modx->htmlspecialchars($field_value).'" '.$field_style.' onchange="documentDirty=true;" />';
992 992
 
993 993
             } // end switch statement
994 994
         } else {
995 995
             $custom = explode(":", $field_type);
996 996
             $custom_output = '';
997
-            $file_name = MODX_BASE_PATH . 'assets/tvs/' . $custom['1'] . '/' . $custom['1'] . '.customtv.php';
997
+            $file_name = MODX_BASE_PATH.'assets/tvs/'.$custom['1'].'/'.$custom['1'].'.customtv.php';
998 998
             if (!file_exists($file_name)) {
999
-                $custom_output = $file_name . ' does not exist';
999
+                $custom_output = $file_name.' does not exist';
1000 1000
             } else {
1001 1001
                 ob_start();
1002 1002
                 include $file_name;
@@ -1020,7 +1020,7 @@  discard block
 block discarded – undo
1020 1020
     } // end renderFormElement function
1021 1021
 }
1022 1022
 
1023
-if (! function_exists('ParseIntputOptions')) {
1023
+if (!function_exists('ParseIntputOptions')) {
1024 1024
     /**
1025 1025
      * @param string|array|mysqli_result $v
1026 1026
      * @return array
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -573,7 +573,8 @@
 block discarded – undo
573 573
      * @return array|string
574 574
      */
575 575
     function parseInput($src, $delim = "||", $type = "string", $columns = true)
576
-    { // type can be: string, array
576
+    {
577
+// type can be: string, array
577 578
         $modx = evolutionCMS();
578 579
         if ($modx->db->isResult($src)) {
579 580
             // must be a recordset
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
                         $modx->setPlaceholder($rvKey, $rvValue);
52 52
                     }
53 53
                     $param = $modx->mergePlaceholderContent($param);
54
-                    $rs = $modx->db->query("SELECT $param;");
54
+                    $rs = $modx->db->query("select $param;");
55 55
                     $output = $rs;
56 56
                     break;
57 57
 
Please login to merge, or discard this patch.
manager/includes/src/Cache.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -237,7 +237,7 @@
 block discarded – undo
237 237
     /**
238 238
      * build siteCache file
239 239
      * @param DocumentParser $modx
240
-     * @return boolean success
240
+     * @return null|boolean success
241 241
      */
242 242
     public function buildCache($modx)
243 243
     {
Please login to merge, or discard this patch.
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
         if (isset($this->aliases[$id])) {
95 95
             if ($this->aliasVisible[$id] == 1) {
96 96
                 if ($path != '') {
97
-                    $path = $this->aliases[$id] . '/' . $path;
97
+                    $path = $this->aliases[$id].'/'.$path;
98 98
                 } else {
99 99
                     $path = $this->aliases[$id];
100 100
                 }
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
             $modx->messageQuit("Cache path not set.");
119 119
         }
120 120
 
121
-        $files = glob(realpath($this->cachePath) . '/*.pageCache.php');
121
+        $files = glob(realpath($this->cachePath).'/*.pageCache.php');
122 122
         $filesincache = count($files);
123 123
         $deletedfiles = array();
124 124
         while ($file = array_shift($files)) {
@@ -151,9 +151,9 @@  discard block
 block discarded – undo
151 151
                 if (isset($opcache)) {
152 152
                     echo '<p>Opcache empty.</p>';
153 153
                 }
154
-                echo '<p>' . $_lang['cache_files_deleted'] . '</p><ul>';
154
+                echo '<p>'.$_lang['cache_files_deleted'].'</p><ul>';
155 155
                 foreach ($deletedfiles as $deletedfile) {
156
-                    echo '<li>' . $deletedfile . '</li>';
156
+                    echo '<li>'.$deletedfile.'</li>';
157 157
                 }
158 158
                 echo '</ul>';
159 159
             }
@@ -172,11 +172,11 @@  discard block
 block discarded – undo
172 172
 
173 173
 
174 174
         // write the file
175
-        $content = '<?php' . "\n";
176
-        $content .= '$recent_update=\'' . $this->request_time . '\';' . "\n";
177
-        $content .= '$cacheRefreshTime=\'' . $cacheRefreshTime . '\';' . "\n";
175
+        $content = '<?php'."\n";
176
+        $content .= '$recent_update=\''.$this->request_time.'\';'."\n";
177
+        $content .= '$cacheRefreshTime=\''.$cacheRefreshTime.'\';'."\n";
178 178
 
179
-        $filename = $this->cachePath . '/sitePublishing.idx.php';
179
+        $filename = $this->cachePath.'/sitePublishing.idx.php';
180 180
         if (!$handle = fopen($filename, 'w')) {
181 181
             exit("Cannot open file ({$filename}");
182 182
         }
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
         $timesArr = array();
201 201
 
202 202
         $result = $modx->db->select('MIN(pub_date) AS minpub', '[+prefix+]site_content',
203
-            'pub_date>' . $this->request_time);
203
+            'pub_date>'.$this->request_time);
204 204
         if (!$result) {
205 205
             echo "Couldn't determine next publish event!";
206 206
         }
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
         }
212 212
 
213 213
         $result = $modx->db->select('MIN(unpub_date) AS minunpub', '[+prefix+]site_content',
214
-            'unpub_date>' . $this->request_time);
214
+            'unpub_date>'.$this->request_time);
215 215
         if (!$result) {
216 216
             echo "Couldn't determine next unpublish event!";
217 217
         }
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
         $config = array();
251 251
         $content .= '$c=&$this->config;';
252 252
         while (list($key, $value) = $modx->db->getRow($rs, 'num')) {
253
-            $content .= '$c[\'' . $key . '\']="' . $this->escapeDoubleQuotes($value) . '";';
253
+            $content .= '$c[\''.$key.'\']="'.$this->escapeDoubleQuotes($value).'";';
254 254
             $config[$key] = $value;
255 255
         }
256 256
 
@@ -288,23 +288,23 @@  discard block
 block discarded – undo
288 288
             $docid = $doc['id'];
289 289
             if ($use_alias_path) {
290 290
                 $tmpPath = $this->getParents($doc['parent']);
291
-                $alias = (strlen($tmpPath) > 0 ? "$tmpPath/" : '') . $doc['alias'];
291
+                $alias = (strlen($tmpPath) > 0 ? "$tmpPath/" : '').$doc['alias'];
292 292
                 $key = $alias;
293 293
             } else {
294 294
                 $key = $doc['alias'];
295 295
             }
296 296
 
297 297
             $doc['path'] = $tmpPath;
298
-            $content .= '$a[' . $docid . ']=array(\'id\'=>' . $docid . ',\'alias\'=>\'' . $doc['alias'] . '\',\'path\'=>\'' . $doc['path'] . '\',\'parent\'=>' . $doc['parent'] . ',\'isfolder\'=>' . $doc['isfolder'] . ',\'alias_visible\'=>' . $doc['alias_visible'] . ');';
299
-            $content .= '$d[\'' . $key . '\']=' . $docid . ';';
300
-            $content .= '$m[]=array(' . $doc['parent'] . '=>' . $docid . ');';
298
+            $content .= '$a['.$docid.']=array(\'id\'=>'.$docid.',\'alias\'=>\''.$doc['alias'].'\',\'path\'=>\''.$doc['path'].'\',\'parent\'=>'.$doc['parent'].',\'isfolder\'=>'.$doc['isfolder'].',\'alias_visible\'=>'.$doc['alias_visible'].');';
299
+            $content .= '$d[\''.$key.'\']='.$docid.';';
300
+            $content .= '$m[]=array('.$doc['parent'].'=>'.$docid.');';
301 301
         }
302 302
 
303 303
         // get content types
304 304
         $rs = $modx->db->select('id, contentType', '[+prefix+]site_content', "contentType!='text/html'");
305 305
         $content .= '$c=&$this->contentTypes;';
306 306
         while ($doc = $modx->db->getRow($rs)) {
307
-            $content .= '$c[\'' . $doc['id'] . '\']=\'' . $doc['contentType'] . '\';';
307
+            $content .= '$c[\''.$doc['id'].'\']=\''.$doc['contentType'].'\';';
308 308
         }
309 309
 
310 310
         // WRITE Chunks to cache file
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
             if ($modx->config['minifyphp_incache']) {
315 315
                 $doc['snippet'] = $this->php_strip_whitespace($doc['snippet']);
316 316
             }
317
-            $content .= '$c[\'' . $doc['name'] . '\']=\'' . ($doc['disabled'] ? '' : $this->escapeSingleQuotes($doc['snippet'])) . '\';';
317
+            $content .= '$c[\''.$doc['name'].'\']=\''.($doc['disabled'] ? '' : $this->escapeSingleQuotes($doc['snippet'])).'\';';
318 318
         }
319 319
 
320 320
         // WRITE snippets to cache file
@@ -325,18 +325,18 @@  discard block
 block discarded – undo
325 325
         while ($row = $modx->db->getRow($rs)) {
326 326
             $key = $row['name'];
327 327
             if ($row['disabled']) {
328
-                $content .= '$s[\'' . $key . '\']=\'return false;\';';
328
+                $content .= '$s[\''.$key.'\']=\'return false;\';';
329 329
             } else {
330 330
                 $value = trim($row['snippet']);
331 331
                 if ($modx->config['minifyphp_incache']) {
332 332
                     $value = $this->php_strip_whitespace($value);
333 333
                 }
334
-                $content .= '$s[\'' . $key . '\']=\'' . $this->escapeSingleQuotes($value) . '\';';
334
+                $content .= '$s[\''.$key.'\']=\''.$this->escapeSingleQuotes($value).'\';';
335 335
                 $properties = $modx->parseProperties($row['properties']);
336 336
                 $sharedproperties = $modx->parseProperties($row['sharedproperties']);
337 337
                 $properties = array_merge($sharedproperties, $properties);
338 338
                 if (0 < count($properties)) {
339
-                    $content .= '$s[\'' . $key . 'Props\']=\'' . $this->escapeSingleQuotes(json_encode($properties)) . '\';';
339
+                    $content .= '$s[\''.$key.'Props\']=\''.$this->escapeSingleQuotes(json_encode($properties)).'\';';
340 340
                 }
341 341
             }
342 342
         }
@@ -354,13 +354,13 @@  discard block
 block discarded – undo
354 354
             if ($modx->config['minifyphp_incache']) {
355 355
                 $value = $this->php_strip_whitespace($value);
356 356
             }
357
-            $content .= '$p[\'' . $key . '\']=\'' . $this->escapeSingleQuotes($value) . '\';';
357
+            $content .= '$p[\''.$key.'\']=\''.$this->escapeSingleQuotes($value).'\';';
358 358
             if ($row['properties'] != '' || $row['sharedproperties'] != '') {
359 359
                 $properties = $modx->parseProperties($row['properties']);
360 360
                 $sharedproperties = $modx->parseProperties($row['sharedproperties']);
361 361
                 $properties = array_merge($sharedproperties, $properties);
362 362
                 if (0 < count($properties)) {
363
-                    $content .= '$p[\'' . $key . 'Props\']=\'' . $this->escapeSingleQuotes(json_encode($properties)) . '\';';
363
+                    $content .= '$p[\''.$key.'Props\']=\''.$this->escapeSingleQuotes(json_encode($properties)).'\';';
364 364
                 }
365 365
             }
366 366
         }
@@ -383,14 +383,14 @@  discard block
 block discarded – undo
383 383
         }
384 384
         foreach ($events as $evtname => $pluginnames) {
385 385
             $events[$evtname] = $pluginnames;
386
-            $content .= '$e[\'' . $evtname . '\']=array(\'' . implode('\',\'',
387
-                    $this->escapeSingleQuotes($pluginnames)) . '\');';
386
+            $content .= '$e[\''.$evtname.'\']=array(\''.implode('\',\'',
387
+                    $this->escapeSingleQuotes($pluginnames)).'\');';
388 388
         }
389 389
 
390 390
         $content .= "\n";
391 391
 
392 392
         // close and write the file
393
-        $filename = $this->cachePath . 'siteCache.idx.php';
393
+        $filename = $this->cachePath.'siteCache.idx.php';
394 394
 
395 395
         // invoke OnBeforeCacheUpdate event
396 396
         if ($modx) {
@@ -401,8 +401,8 @@  discard block
 block discarded – undo
401 401
             exit("Cannot write main MODX cache file! Make sure the assets/cache directory is writable!");
402 402
         }
403 403
 
404
-        if (!is_file($this->cachePath . '/.htaccess')) {
405
-            file_put_contents($this->cachePath . '/.htaccess', "order deny,allow\ndeny from all\n");
404
+        if (!is_file($this->cachePath.'/.htaccess')) {
405
+            file_put_contents($this->cachePath.'/.htaccess', "order deny,allow\ndeny from all\n");
406 406
         }
407 407
 
408 408
         // invoke OnCacheUpdate event
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
 
425 425
         $source = trim($source);
426 426
         if (substr($source, 0, 5) !== '<?php') {
427
-            $source = '<?php ' . $source;
427
+            $source = '<?php '.$source;
428 428
         }
429 429
 
430 430
         $tokens = token_get_all($source);
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
             }
483 483
         }
484 484
         $source = preg_replace(array('@^<\?php@i', '|\s+|', '|<!--|', '|-->|', '|-->\s+<!--|'),
485
-            array('', ' ', "\n" . '<!--', '-->' . "\n", '-->' . "\n" . '<!--'), $_);
485
+            array('', ' ', "\n".'<!--', '-->'."\n", '-->'."\n".'<!--'), $_);
486 486
         $source = trim($source);
487 487
 
488 488
         return $source;
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -79,7 +79,8 @@  discard block
 block discarded – undo
79 79
      * @return string
80 80
      */
81 81
     public function getParents($id, $path = '')
82
-    { // modx:returns child's parent
82
+    {
83
+// modx:returns child's parent
83 84
         $modx = evolutionCMS();
84 85
         if (empty($this->aliases)) {
85 86
             $f = "id, IF(alias='', id, alias) AS alias, parent, alias_visible";
@@ -456,7 +457,8 @@  discard block
 block discarded – undo
456 457
                         $_ = trim($_);
457 458
                     }
458 459
                     $lastChar = substr($_, -1);
459
-                    if (!in_array($lastChar, $chars)) {// ,320,327,288,284,289
460
+                    if (!in_array($lastChar, $chars)) {
461
+// ,320,327,288,284,289
460 462
                         if (!in_array($prev_token,
461 463
                             array(T_FOREACH, T_WHILE, T_FOR, T_BOOLEAN_AND, T_BOOLEAN_OR, T_DOUBLE_ARROW))) {
462 464
                             $_ .= ' ';
Please login to merge, or discard this patch.