Completed
Push — develop ( 0132ab...e45b08 )
by Dmytro
13:40 queued 05:11
created
manager/actions/mutate_user.dynamic.php 1 patch
Braces   +42 added lines, -37 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;
@@ -22,16 +22,16 @@  discard block
 block discarded – undo
22 22
 
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
-if($username = $modx->db->getValue($rs)) {
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,12 @@  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
-	foreach($usersettings as $k => $v) {
45
-		if($k != 'manager_language' && $k != 'manager_theme') {
46
+	foreach($usersettings as $k => $v) {
47
+		if($k != 'manager_language' && $k != 'manager_theme') {
46 48
 			${$k} = $v;
47 49
 		}
48 50
 	}
@@ -50,11 +52,11 @@  discard block
 block discarded – undo
50 52
 	// get user name
51 53
 	$rs = $modx->db->select('*', $modx->getFullTableName('manager_users'), "id = '{$user}'");
52 54
 	$usernamedata = $modx->db->getRow($rs);
53
-	if(!$usernamedata) {
55
+	if(!$usernamedata) {
54 56
 		$modx->webAlertAndQuit("No user returned while getting username!");
55 57
 	}
56 58
 	$_SESSION['itemname'] = $usernamedata['username'];
57
-} else {
59
+} else {
58 60
 	$userdata = array();
59 61
 	$usersettings = array();
60 62
 	$usernamedata = array();
@@ -62,14 +64,14 @@  discard block
 block discarded – undo
62 64
 }
63 65
 
64 66
 // avoid doubling htmlspecialchars (already encoded in DB)
65
-foreach($userdata as $key => $val) {
67
+foreach($userdata as $key => $val) {
66 68
 	$userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']);
67 69
 };
68 70
 $usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']);
69 71
 
70 72
 // restore saved form
71 73
 $formRestored = false;
72
-if($modx->manager->hasFormValues()) {
74
+if($modx->manager->hasFormValues()) {
73 75
 	$modx->manager->loadFormValues();
74 76
 	// restore post values
75 77
 	$userdata = array_merge($userdata, $_POST);
@@ -84,13 +86,13 @@  discard block
 block discarded – undo
84 86
 // include the country list language file
85 87
 $_country_lang = array();
86 88
 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")) {
89
+if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) {
88 90
 	include_once "lang/country/" . $manager_language . "_country.inc.php";
89 91
 }
90 92
 asort($_country_lang);
91 93
 
92 94
 $displayStyle = ($_SESSION['browser'] === 'modern') ? 'table-row' : 'block';
93
-if($which_browser == 'default') {
95
+if($which_browser == 'default') {
94 96
 	$which_browser = $modx->configGlobal['which_browser'] ? $modx->configGlobal['which_browser'] : $modx->config['which_browser'];
95 97
 }
96 98
 ?>
@@ -205,7 +207,7 @@  discard block
 block discarded – undo
205 207
 	$evtOut = $modx->invokeEvent("OnUserFormPrerender", array(
206 208
 		"id" => $user
207 209
 	));
208
-	if(is_array($evtOut)) {
210
+	if(is_array($evtOut)) {
209 211
 		echo implode("", $evtOut);
210 212
 	}
211 213
 	?>
@@ -305,10 +307,10 @@  discard block
 block discarded – undo
305 307
 							?>
306 308
 							<select name="role" class="inputBox" onChange='documentDirty=true;' style="width:300px">
307 309
 								<?php
308
-								while($row = $modx->db->getRow($rs)) {
309
-									if($modx->manager->action == '11') {
310
+								while($row = $modx->db->getRow($rs)) {
311
+									if($modx->manager->action == '11') {
310 312
 										$selectedtext = $row['id'] == '1' ? ' selected="selected"' : '';
311
-									} else {
313
+									} else {
312 314
 										$selectedtext = $row['id'] == $userdata['role'] ? "selected='selected'" : '';
313 315
 									}
314 316
 									?>
@@ -360,7 +362,7 @@  discard block
 block discarded – undo
360 362
 								<?php $chosenCountry = isset($_POST['country']) ? $_POST['country'] : $userdata['country']; ?>
361 363
 								<option value="" <?php (!isset($chosenCountry) ? ' selected' : '') ?> >&nbsp;</option>
362 364
 								<?php
363
-								foreach($_country_lang as $key => $country) {
365
+								foreach($_country_lang as $key => $country) {
364 366
 									echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>";
365 367
 								}
366 368
 								?>
@@ -441,8 +443,8 @@  discard block
 block discarded – undo
441 443
 								<?php
442 444
 								$activelang = !empty($usersettings['manager_language']) ? $usersettings['manager_language'] : '';
443 445
 								$dir = dir("includes/lang");
444
-								while($file = $dir->read()) {
445
-									if(strpos($file, ".inc.php") > 0) {
446
+								while($file = $dir->read()) {
447
+									if(strpos($file, ".inc.php") > 0) {
446 448
 										$endpos = strpos($file, ".");
447 449
 										$languagename = substr($file, 0, $endpos);
448 450
 										$selectedtext = $languagename == $activelang ? "selected='selected'" : "";
@@ -529,14 +531,14 @@  discard block
 block discarded – undo
529 531
 								<option value=""></option>
530 532
 								<?php
531 533
 								$dir = dir("media/style/");
532
-								while($file = $dir->read()) {
533
-									if($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') {
534
+								while($file = $dir->read()) {
535
+									if($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') {
534 536
 										$themename = $file;
535
-										if($themename === 'common') {
537
+										if($themename === 'common') {
536 538
 											continue;
537 539
 										}
538 540
 										$attr = 'value="' . $themename . '" ';
539
-										if(isset($usersettings['manager_theme']) && $themename == $usersettings['manager_theme']) {
541
+										if(isset($usersettings['manager_theme']) && $themename == $usersettings['manager_theme']) {
540 542
 											$attr .= 'selected="selected" ';
541 543
 										}
542 544
 										echo "\t\t<option " . rtrim($attr) . '>' . ucwords(str_replace("_", " ", $themename)) . "</option>\n";
@@ -557,7 +559,7 @@  discard block
 block discarded – undo
557 559
 								<?php
558 560
 								$selected = 'default' == $usersettings['which_browser'] || !$usersettings['which_browser'] ? ' selected="selected"' : '';
559 561
 								echo '<option value="default"' . $selected . '>' . $_lang['option_default'] . "</option>\n";
560
-								foreach(glob("media/browser/*", GLOB_ONLYDIR) as $dir) {
562
+								foreach(glob("media/browser/*", GLOB_ONLYDIR) as $dir) {
561 563
 									$dir = str_replace('\\', '/', $dir);
562 564
 									$browser_name = substr($dir, strrpos($dir, '/') + 1);
563 565
 									$selected = $browser_name == $usersettings['which_browser'] ? ' selected="selected"' : '';
@@ -644,8 +646,8 @@  discard block
 block discarded – undo
644 646
 								// invoke OnRichTextEditorRegister event
645 647
 								$evtOut = $modx->invokeEvent("OnRichTextEditorRegister");
646 648
 								echo "<option value='none'" . ($edt == 'none' ? " selected='selected'" : "") . ">" . $_lang["none"] . "</option>\n";
647
-								if(is_array($evtOut)) {
648
-									for($i = 0; $i < count($evtOut); $i++) {
649
+								if(is_array($evtOut)) {
650
+									for($i = 0; $i < count($evtOut); $i++) {
649 651
 										$editor = $evtOut[$i];
650 652
 										echo "<option value='$editor'" . ($edt == $editor ? " selected='selected'" : "") . ">$editor</option>\n";
651 653
 									}
@@ -685,7 +687,7 @@  discard block
 block discarded – undo
685 687
 				<?php
686 688
 				// invoke OnInterfaceSettingsRender event
687 689
 				$evtOut = $modx->invokeEvent("OnInterfaceSettingsRender");
688
-				if(is_array($evtOut)) {
690
+				if(is_array($evtOut)) {
689 691
 					echo implode("", $evtOut);
690 692
 				}
691 693
 				?>
@@ -735,17 +737,20 @@  discard block
 block discarded – undo
735 737
 					</tr>
736 738
 				</table>
737 739
 			</div>
738
-			<?php if($use_udperms == 1) {
740
+			<?php if($use_udperms == 1) {
739 741
 
740 742
 			$groupsarray = array();
741 743
 
742
-			if($modx->manager->action == '12') { // only do this bit if the user is being edited
744
+			if($modx->manager->action == '12') {
745
+// only do this bit if the user is being edited
743 746
 				$rs = $modx->db->select('user_group', $modx->getFullTableName('member_groups'), "member='{$user}'");
744 747
 				$groupsarray = $modx->db->getColumn('user_group', $rs);
745 748
 			}
746 749
 			// retain selected doc groups between post
747
-			if(is_array($_POST['user_groups'])) {
748
-				foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v;
750
+			if(is_array($_POST['user_groups'])) {
751
+				foreach($_POST['user_groups'] as $n => $v) {
752
+				    $groupsarray[] = $v;
753
+				}
749 754
 			}
750 755
 			?>
751 756
 			<div class="tab-page" id="tabAccess">
@@ -754,7 +759,7 @@  discard block
 block discarded – undo
754 759
 				<p><?php echo $_lang['access_permissions_user_message'] ?></p>
755 760
 				<?php
756 761
 				$rs = $modx->db->select('name, id', $modx->getFullTableName('membergroup_names'), '', 'name');
757
-				while($row = $modx->db->getRow($rs)) {
762
+				while($row = $modx->db->getRow($rs)) {
758 763
 					echo "<label><input type='checkbox' name='user_groups[]' value='" . $row['id'] . "'" . (in_array($row['id'], $groupsarray) ? " checked='checked'" : "") . " />" . $row['name'] . "</label><br />";
759 764
 				}
760 765
 				}
@@ -768,7 +773,7 @@  discard block
 block discarded – undo
768 773
 	$evtOut = $modx->invokeEvent("OnUserFormRender", array(
769 774
 		"id" => $user
770 775
 	));
771
-	if(is_array($evtOut)) {
776
+	if(is_array($evtOut)) {
772 777
 		echo implode("", $evtOut);
773 778
 	}
774 779
 	?>
Please login to merge, or discard this patch.
manager/actions/category_mgr/inc/request_trigger.inc.php 1 patch
Braces   +31 added lines, -65 removed lines patch added patch discarded remove patch
@@ -6,26 +6,22 @@  discard block
 block discarded – undo
6 6
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
7 7
 }
8 8
 
9
-if( isset( $_REQUEST[$cm->get('request_key')]['ajax'] ) )
10
-{
9
+if( isset( $_REQUEST[$cm->get('request_key')]['ajax'] ) ) {
11 10
     $_data  = $_REQUEST[$cm->get('request_key')];
12 11
     $output = '';
13 12
     $task   = $_data['task'];
14
-    switch( $task )
15
-    {
13
+    switch( $task ) {
16 14
         /**
17 15
          * get categories
18 16
          */
19 17
         case 'categorize_load_elements':
20 18
             $elements = $_data['elements'];
21 19
 
22
-            if( $uncategorized_elements = $cm->getAssignedElements( 0, $_data['elements'] ) )
23
-            {
20
+            if( $uncategorized_elements = $cm->getAssignedElements( 0, $_data['elements'] ) ) {
24 21
                $output .= $cm->renderView('chunks/categorize/uncategorized_elements', $uncategorized_elements);
25 22
             }
26 23
 
27
-            foreach( $cm->getCategories() as $category )
28
-            {
24
+            foreach( $cm->getCategories() as $category ) {
29 25
                 $category['elements'] = $cm->getAssignedElements( $category['id'], $_data['elements'] );
30 26
                 $output .= $cm->renderView('chunks/categorize/category', $category);
31 27
             }
@@ -41,8 +37,7 @@  discard block
 block discarded – undo
41 37
  * @see http://modxcms.com/forums/index.php/topic,40430.msg251476.html#msg251476
42 38
  *
43 39
  */
44
-if( isset( $_POST[$cm->get('request_key')]['categorize']['submit'] ) )
45
-{
40
+if( isset( $_POST[$cm->get('request_key')]['categorize']['submit'] ) ) {
46 41
     $_data = $_POST[$cm->get('request_key')]['categorize'];
47 42
     $_changes = 0;
48 43
 
@@ -54,16 +49,13 @@  discard block
 block discarded – undo
54 49
         'categorize'
55 50
     );
56 51
 
57
-    if( !isset( $_data['elements'] ) )
58
-    {
52
+    if( !isset( $_data['elements'] ) ) {
59 53
         $cm->addMessage( $cm->txt('cm_unknown_error'), 'categorize' );
60 54
         return;
61 55
     }
62 56
 
63
-    foreach( $_data['elements'] as $element_id => $data )
64
-    {
65
-        if( $cm->updateElement( $_data['elementsgroup'], $element_id, $data['category_id'] ) )
66
-        {
57
+    foreach( $_data['elements'] as $element_id => $data ) {
58
+        if( $cm->updateElement( $_data['elementsgroup'], $element_id, $data['category_id'] ) ) {
67 59
             $cm->addMessage(
68 60
                 sprintf(
69 61
                     $cm->txt('cm_x_assigned_to_category_y'),
@@ -78,13 +70,10 @@  discard block
 block discarded – undo
78 70
         }
79 71
     }
80 72
 
81
-    if( $_changes === 0 )
82
-    {
73
+    if( $_changes === 0 ) {
83 74
         $cm->addMessage( $cm->txt('cm_no_categorization'), 'categorize' );
84 75
         return;
85
-    }
86
-    else
87
-    {
76
+    } else {
88 77
         $cm->addMessage(
89 78
             sprintf(
90 79
                 $cm->txt('cm_x_changes_made'),
@@ -98,26 +87,22 @@  discard block
 block discarded – undo
98 87
 /**
99 88
  * Add a new category
100 89
  */
101
-if( isset( $_POST[$cm->get('request_key')]['add']['submit'] ) )
102
-{
90
+if( isset( $_POST[$cm->get('request_key')]['add']['submit'] ) ) {
103 91
     $_data    = $_POST[$cm->get('request_key')]['add']['data'];
104 92
     $category = trim( html_entity_decode($_data['name']) );
105 93
     $rank     = (int) $_data['rank'];
106 94
 
107
-    if( empty( $category ) )
108
-    {
95
+    if( empty( $category ) ) {
109 96
        $cm->addMessage( $cm->txt('cm_enter_name_for_category'), 'add' );
110 97
        return;
111 98
     }
112 99
 
113
-    if( $cm->isCategoryExists( $category ) )
114
-    {
100
+    if( $cm->isCategoryExists( $category ) ) {
115 101
        $cm->addMessage( sprintf( $cm->txt('cm_category_x_exists'), $category ), 'add' );
116 102
        return;
117 103
     }
118 104
 
119
-    if( $cm->addCategory( $category, $rank ) !== 0 )
120
-    {
105
+    if( $cm->addCategory( $category, $rank ) !== 0 ) {
121 106
         $cm->addMessage(
122 107
             sprintf(
123 108
                 $cm->txt( 'cm_category_x_saved_at_position_y' ),
@@ -126,9 +111,7 @@  discard block
 block discarded – undo
126 111
             ),
127 112
             'add'
128 113
         );
129
-    }
130
-    else
131
-    {
114
+    } else {
132 115
         $cm->addMessage( $cm->txt('cm_unknown_error'), 'add' );
133 116
     }
134 117
 }
@@ -136,20 +119,17 @@  discard block
 block discarded – undo
136 119
 /**
137 120
  * Sort categories
138 121
  */
139
-if( isset( $_POST[$cm->get('request_key')]['sort']['submit'] ) )
140
-{
122
+if( isset( $_POST[$cm->get('request_key')]['sort']['submit'] ) ) {
141 123
     $categories = $_POST[$cm->get('request_key')]['sort']['data'];
142 124
     $_changes   = 0;
143 125
 
144
-    foreach( $categories as $category_id => $_data  )
145
-    {
126
+    foreach( $categories as $category_id => $_data  ) {
146 127
         $data = array(
147 128
             'category' => urldecode( $_data['category'] ),
148 129
             'rank'     => $_data['rank']
149 130
         );
150 131
 
151
-        if( $cm->updateCategory( $category_id, $data ) )
152
-        {
132
+        if( $cm->updateCategory( $category_id, $data ) ) {
153 133
             $cm->addMessage(
154 134
                 sprintf(
155 135
                     $cm->txt('cm_category_x_moved_to_position_y'),
@@ -162,12 +142,9 @@  discard block
 block discarded – undo
162 142
         }
163 143
     }
164 144
 
165
-    if( $_changes === 0 )
166
-    {
145
+    if( $_changes === 0 ) {
167 146
         $cm->addMessage( $cm->txt( 'cm_no_changes' ), 'sort');
168
-    }
169
-    else
170
-    {
147
+    } else {
171 148
         $cm->addMessage(
172 149
             sprintf(
173 150
                 $cm->txt('cm_x_changes_made'),
@@ -181,17 +158,13 @@  discard block
 block discarded – undo
181 158
 /**
182 159
  * Edit categories
183 160
  */
184
-if( isset( $_POST[$cm->get('request_key')]['edit']['submit'] ) )
185
-{
161
+if( isset( $_POST[$cm->get('request_key')]['edit']['submit'] ) ) {
186 162
     $categories = $_POST[$cm->get('request_key')]['edit']['data'];
187 163
     $_changes   = 0;
188 164
 
189
-    foreach( $categories as $category_id => $_data  )
190
-    {
191
-        if( isset( $_data['delete'] ) )
192
-        {
193
-            if( $cm->deleteCategory( $category_id ) )
194
-            {
165
+    foreach( $categories as $category_id => $_data  ) {
166
+        if( isset( $_data['delete'] ) ) {
167
+            if( $cm->deleteCategory( $category_id ) ) {
195 168
                 $cm->addMessage(
196 169
                     sprintf(
197 170
                         $cm->txt('cm_category_x_deleted'),
@@ -209,8 +182,7 @@  discard block
 block discarded – undo
209 182
             'rank'     => $_data['rank']
210 183
         );
211 184
 
212
-        if( $cm->updateCategory( $category_id, $data ) )
213
-        {
185
+        if( $cm->updateCategory( $category_id, $data ) ) {
214 186
             $cm->addMessage(
215 187
                 sprintf(
216 188
                     $cm->txt('cm_category_x_renamed_to_y'),
@@ -223,8 +195,7 @@  discard block
 block discarded – undo
223 195
         }
224 196
     }
225 197
 
226
-    if( $_changes === 0 )
227
-    {
198
+    if( $_changes === 0 ) {
228 199
         $cm->addMessage( $cm->txt( 'cm_no_changes' ), 'edit');
229 200
     }
230 201
 }
@@ -233,12 +204,10 @@  discard block
 block discarded – undo
233 204
  * Delete singel category by $_GET
234 205
  */
235 206
 if( isset( $_GET[$cm->get('request_key')]['delete'] )
236
-    && !empty( $_GET[$cm->get('request_key')]['delete'] ) )
237
-{
207
+    && !empty( $_GET[$cm->get('request_key')]['delete'] ) ) {
238 208
     $category_id = (int)$_GET[$cm->get('request_key')]['delete'];
239 209
 
240
-    if( $cm->deleteCategory( $category_id ) )
241
-    {
210
+    if( $cm->deleteCategory( $category_id ) ) {
242 211
         $cm->addMessage(
243 212
             sprintf(
244 213
                 $cm->txt('cm_category_x_deleted'),
@@ -251,16 +220,13 @@  discard block
 block discarded – undo
251 220
 /**
252 221
  * Translate phrases
253 222
  */
254
-if( isset( $_POST[$cm->get('request_key')]['translate']['submit'] ) )
255
-{
223
+if( isset( $_POST[$cm->get('request_key')]['translate']['submit'] ) ) {
256 224
     $translations = $_POST[$cm->get('request_key')]['translate']['data'];
257 225
 
258
-    foreach( $translations as $native_phrase => $translation )
259
-    {
226
+    foreach( $translations as $native_phrase => $translation ) {
260 227
         $native_phrase = urldecode( $native_phrase );
261 228
 
262
-        if( empty( $translation ) )
263
-        {
229
+        if( empty( $translation ) ) {
264 230
             $translation = $native_phrase;
265 231
 
266 232
             $cm->addMessage(
Please login to merge, or discard this patch.
manager/includes/manager.lockout.inc.php 1 patch
Braces   +8 added lines, -13 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
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
-if($modx->manager->action!='8' && isset($_SESSION['mgrValidated'])){
6
+if($modx->manager->action!='8' && isset($_SESSION['mgrValidated'])) {
7 7
 
8 8
     $homeurl = $modx->makeUrl($manager_login_startup>0 ? $manager_login_startup:$site_start);
9 9
     $logouturl = MODX_MANAGER_URL.'index.php?a=8';
@@ -35,8 +35,7 @@  discard block
 block discarded – undo
35 35
     	if(substr($target,0,6)==='@CHUNK') {
36 36
     		$target = trim(substr($target,7));
37 37
     		$lockout_tpl = $modx->getChunk($target);
38
-    	}
39
-    	elseif(substr($target,0,5)==='@FILE') {
38
+    	} elseif(substr($target,0,5)==='@FILE') {
40 39
     		$target = trim(substr($target,6));
41 40
     		$lockout_tpl = file_get_contents($target);
42 41
     	}
@@ -44,24 +43,20 @@  discard block
 block discarded – undo
44 43
     	$chunk = $modx->getChunk($target);
45 44
     	if($chunk!==false && !empty($chunk)) {
46 45
     		$lockout_tpl = $chunk;
47
-    	}
48
-    	elseif(is_file(MODX_BASE_PATH . $target)) {
46
+    	} elseif(is_file(MODX_BASE_PATH . $target)) {
49 47
     		$target = MODX_BASE_PATH . $target;
50 48
     		$lockout_tpl = file_get_contents($target);
51
-    	}
52
-    	elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/manager.lockout.tpl')) {
49
+    	} elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/manager.lockout.tpl')) {
53 50
     		$target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/manager.lockout.tpl';
54 51
     		$lockout_tpl = file_get_contents($target);
55
-    	}
56
-	elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/templates/actions/manager.lockout.tpl')) {
52
+    	} elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/templates/actions/manager.lockout.tpl')) {
57 53
 		$target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/templates/actions/manager.lockout.tpl';
58 54
 		$login_tpl = file_get_contents($target);
59
-	}
60
-    	elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/manager.lockout.html')) { // ClipperCMS compatible
55
+	} elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/manager.lockout.html')) {
56
+// ClipperCMS compatible
61 57
     		$target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/manager.lockout.html';
62 58
     		$lockout_tpl = file_get_contents($target);
63
-    	}
64
-    	else {
59
+    	} else {
65 60
     		$target = MODX_MANAGER_PATH . 'media/style/common/manager.lockout.tpl';
66 61
     		$lockout_tpl = file_get_contents($target);
67 62
     	}
Please login to merge, or discard this patch.
manager/processors/export_site.processor.php 1 patch
Braces   +9 added lines, -5 removed lines patch added patch discarded remove patch
@@ -12,16 +12,20 @@
 block discarded – undo
12 12
 $modx->loadExtension('EXPORT_SITE');
13 13
 
14 14
 
15
-if(is_dir(MODX_BASE_PATH . 'temp'))       $export_dir = MODX_BASE_PATH . 'temp/export';
16
-elseif(is_dir(MODX_BASE_PATH . 'assets')) $export_dir = MODX_BASE_PATH . 'assets/export';
15
+if(is_dir(MODX_BASE_PATH . 'temp')) {
16
+    $export_dir = MODX_BASE_PATH . 'temp/export';
17
+} elseif(is_dir(MODX_BASE_PATH . 'assets')) {
18
+    $export_dir = MODX_BASE_PATH . 'assets/export';
19
+}
17 20
 $modx->export->targetDir = $export_dir;
18 21
 
19
-if(strpos($modx->config['base_path'],"{$export_dir}/")===0 && 0 <= strlen(str_replace("{$export_dir}/",'',$modx->config['base_path'])))
22
+if(strpos($modx->config['base_path'],"{$export_dir}/")===0 && 0 <= strlen(str_replace("{$export_dir}/",'',$modx->config['base_path']))) {
20 23
 	return $_lang['export_site.static.php6'];
21
-elseif($modx->config['rb_base_dir'] === $export_dir . '/')
24
+} elseif($modx->config['rb_base_dir'] === $export_dir . '/') {
22 25
 	return $modx->parsePlaceholder($_lang['export_site.static.php7'],'rb_base_url=' . $modx->config['base_url'] . $modx->config['rb_base_url']);
23
-elseif(!is_writable($export_dir))
26
+} elseif(!is_writable($export_dir)) {
24 27
 	return $_lang['export_site_target_unwritable'];
28
+}
25 29
 
26 30
 $modx->export->generate_mode = $_POST['generate_mode'];
27 31
 
Please login to merge, or discard this patch.
manager/processors/duplicate_plugin.processor.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,8 +14,11 @@
 block discarded – undo
14 14
 // count duplicates
15 15
 $name = $modx->db->getValue($modx->db->select('name', $modx->getFullTableName('site_plugins'), "id='{$id}'"));
16 16
 $count = $modx->db->getRecordCount($modx->db->select('name', $modx->getFullTableName('site_plugins'), "name LIKE '{$name} {$_lang['duplicated_el_suffix']}%'"));
17
-if($count>=1) $count = ' '.($count+1);
18
-else $count = '';
17
+if($count>=1) {
18
+    $count = ' '.($count+1);
19
+} else {
20
+    $count = '';
21
+}
19 22
 
20 23
 // duplicate Plugin
21 24
 $newid = $modx->db->insert(
Please login to merge, or discard this patch.
manager/processors/duplicate_tmplvars.processor.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,8 +14,11 @@
 block discarded – undo
14 14
 // count duplicates
15 15
 $name = $modx->db->getValue($modx->db->select('name', $modx->getFullTableName('site_tmplvars'), "id='{$id}'"));
16 16
 $count = $modx->db->getRecordCount($modx->db->select('name', $modx->getFullTableName('site_tmplvars'), "name LIKE '{$name} {$_lang['duplicated_el_suffix']}%'"));
17
-if($count>=1) $count = ' '.($count+1);
18
-else $count = '';
17
+if($count>=1) {
18
+    $count = ' '.($count+1);
19
+} else {
20
+    $count = '';
21
+}
19 22
 
20 23
 // duplicate TV
21 24
 $newid = $modx->db->insert(
Please login to merge, or discard this patch.
manager/processors/remove_locks.processor.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,9 @@
 block discarded – undo
4 4
 }
5 5
 
6 6
 if(!isset($_GET['id'])) {
7
-	if(!$modx->hasPermission('remove_locks')) $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7
+	if(!$modx->hasPermission('remove_locks')) {
8
+	    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
9
+	}
8 10
 
9 11
 	// Remove all locks
10 12
 	$modx->db->truncate($modx->getFullTableName('active_user_locks'));
Please login to merge, or discard this patch.
manager/processors/web_access_groups.processor.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -117,7 +117,7 @@
 block discarded – undo
117 117
 }
118 118
 
119 119
 // secure web documents - flag as private
120
-if($updategroupaccess==true){
120
+if($updategroupaccess==true) {
121 121
 	include MODX_MANAGER_PATH."includes/secure_web_documents.inc.php";
122 122
 	secureWebDocument();
123 123
 
Please login to merge, or discard this patch.
manager/processors/duplicate_snippet.processor.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,8 +14,11 @@
 block discarded – undo
14 14
 // count duplicates
15 15
 $name = $modx->db->getValue($modx->db->select('name', $modx->getFullTableName('site_snippets'), "id='{$id}'"));
16 16
 $count = $modx->db->getRecordCount($modx->db->select('name', $modx->getFullTableName('site_snippets'), "name LIKE '{$name} {$_lang['duplicated_el_suffix']}%'"));
17
-if($count>=1) $count = ' '.($count+1);
18
-else $count = '';
17
+if($count>=1) {
18
+    $count = ' '.($count+1);
19
+} else {
20
+    $count = '';
21
+}
19 22
 
20 23
 // duplicate Snippet
21 24
 $newid = $modx->db->insert(
Please login to merge, or discard this patch.