Completed
Push — develop ( 0fb426...cc37ab )
by Agel_Nash
09:24 queued 03:05
created
manager/actions/mutate_templates.dynamic.php 1 patch
Indentation   +124 added lines, -124 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->getManagerApi()->action) {
7
-	case 16:
8
-		if(!$modx->hasPermission('edit_template')) {
9
-			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
10
-		}
11
-		break;
12
-	case 19:
13
-		if(!$modx->hasPermission('new_template')) {
14
-			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
15
-		}
16
-		break;
17
-	default:
18
-		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7
+    case 16:
8
+        if(!$modx->hasPermission('edit_template')) {
9
+            $modx->webAlertAndQuit($_lang["error_no_privileges"]);
10
+        }
11
+        break;
12
+    case 19:
13
+        if(!$modx->hasPermission('new_template')) {
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
 $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 
25 25
 // check to see the snippet editor isn't locked
26 26
 if($lockedEl = $modx->elementIsLocked(1, $id)) {
27
-	$modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['template']));
27
+    $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['template']));
28 28
 }
29 29
 // end check for lock
30 30
 
@@ -33,23 +33,23 @@  discard block
 block discarded – undo
33 33
 
34 34
 $content = array();
35 35
 if(!empty($id)) {
36
-	$rs = $modx->getDatabase()->select('*', $tbl_site_templates, "id='{$id}'");
37
-	$content = $modx->getDatabase()->getRow($rs);
38
-	if(!$content) {
39
-		$modx->webAlertAndQuit("No database record has been found for this template.");
40
-	}
41
-
42
-	$_SESSION['itemname'] = $content['templatename'];
43
-	if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
44
-		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
45
-	}
36
+    $rs = $modx->getDatabase()->select('*', $tbl_site_templates, "id='{$id}'");
37
+    $content = $modx->getDatabase()->getRow($rs);
38
+    if(!$content) {
39
+        $modx->webAlertAndQuit("No database record has been found for this template.");
40
+    }
41
+
42
+    $_SESSION['itemname'] = $content['templatename'];
43
+    if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
44
+        $modx->webAlertAndQuit($_lang["error_no_privileges"]);
45
+    }
46 46
 } else {
47
-	$_SESSION['itemname'] = $_lang["new_template"];
48
-	$content['category'] = (int)$_REQUEST['catid'];
47
+    $_SESSION['itemname'] = $_lang["new_template"];
48
+    $content['category'] = (int)$_REQUEST['catid'];
49 49
 }
50 50
 
51 51
 if($modx->getManagerApi()->hasFormValues()) {
52
-	$modx->getManagerApi()->loadFormValues();
52
+    $modx->getManagerApi()->loadFormValues();
53 53
 }
54 54
 
55 55
 $content = array_merge($content, $_POST);
@@ -98,12 +98,12 @@  discard block
 block discarded – undo
98 98
 
99 99
 <form name="mutate" method="post" action="index.php">
100 100
 	<?php
101
-	// invoke OnTempFormPrerender event
102
-	$evtOut = $modx->invokeEvent("OnTempFormPrerender", array("id" => $id));
103
-	if(is_array($evtOut)) {
104
-		echo implode("", $evtOut);
105
-	}
106
-	?>
101
+    // invoke OnTempFormPrerender event
102
+    $evtOut = $modx->invokeEvent("OnTempFormPrerender", array("id" => $id));
103
+    if(is_array($evtOut)) {
104
+        echo implode("", $evtOut);
105
+    }
106
+    ?>
107 107
 	<input type="hidden" name="a" value="20">
108 108
 	<input type="hidden" name="id" value="<?= $_REQUEST['id'] ?>">
109 109
 	<input type="hidden" name="mode" value="<?= $modx->getManagerApi()->action ?>">
@@ -133,8 +133,8 @@  discard block
 block discarded – undo
133 133
 						<label class="col-md-3 col-lg-2">
134 134
 							<?= $_lang['template_name'] ?>
135 135
 							<?php if($id == $modx->config['default_template']) {
136
-								echo '<small class="form-text text-danger">' . mb_strtolower(rtrim($_lang['defaulttemplate_title'], ':'), $modx_manager_charset) . '</small>';
137
-							} ?>
136
+                                echo '<small class="form-text text-danger">' . mb_strtolower(rtrim($_lang['defaulttemplate_title'], ':'), $modx_manager_charset) . '</small>';
137
+                            } ?>
138 138
 						</label>
139 139
 						<div class="col-md-9 col-lg-10">
140 140
 							<div class="form-control-name clearfix">
@@ -162,11 +162,11 @@  discard block
 block discarded – undo
162 162
 							<select name="categoryid" class="form-control" onchange="documentDirty=true;">
163 163
 								<option>&nbsp;</option>
164 164
 								<?php
165
-								include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
166
-								foreach(getCategories() as $n => $v) {
167
-									echo "<option value='" . $v['id'] . "'" . ($content["category"] == $v["id"] ? " selected='selected'" : "") . ">" . $modx->getPhpCompat()->htmlspecialchars($v["category"]) . "</option>";
168
-								}
169
-								?>
165
+                                include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
166
+                                foreach(getCategories() as $n => $v) {
167
+                                    echo "<option value='" . $v['id'] . "'" . ($content["category"] == $v["id"] ? " selected='selected'" : "") . ">" . $modx->getPhpCompat()->htmlspecialchars($v["category"]) . "</option>";
168
+                                }
169
+                                ?>
170 170
 							</select>
171 171
 						</div>
172 172
 					</div>
@@ -197,38 +197,38 @@  discard block
 block discarded – undo
197 197
 			<input type="submit" name="save" style="display:none">
198 198
 
199 199
 			<?php
200
-			$selectedTvs = array();
201
-			if(!isset($_POST['assignedTv'])) {
202
-				$rs = $modx->getDatabase()->select(sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category", $_lang['no_category']), sprintf("%s tv
200
+            $selectedTvs = array();
201
+            if(!isset($_POST['assignedTv'])) {
202
+                $rs = $modx->getDatabase()->select(sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category", $_lang['no_category']), sprintf("%s tv
203 203
                 LEFT JOIN %s tr ON tv.id=tr.tmplvarid
204 204
                 LEFT JOIN %s cat ON tv.category=cat.id", $modx->getFullTableName('site_tmplvars'), $modx->getFullTableName('site_tmplvar_templates'), $modx->getFullTableName('categories')), "templateid='{$id}'", "tr.rank DESC, tv.rank DESC, tvcaption DESC, tvid DESC"     // workaround for correct sort of none-existing ranks
205
-				);
206
-				while($row = $modx->getDatabase()->getRow($rs)) {
207
-					$selectedTvs[$row['tvid']] = $row;
208
-				}
209
-				$selectedTvs = array_reverse($selectedTvs, true);       // reverse ORDERBY DESC
210
-			}
211
-
212
-			$unselectedTvs = array();
213
-			$rs = $modx->getDatabase()->select(sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category, cat.id as catid", $_lang['no_category']), sprintf("%s tv
205
+                );
206
+                while($row = $modx->getDatabase()->getRow($rs)) {
207
+                    $selectedTvs[$row['tvid']] = $row;
208
+                }
209
+                $selectedTvs = array_reverse($selectedTvs, true);       // reverse ORDERBY DESC
210
+            }
211
+
212
+            $unselectedTvs = array();
213
+            $rs = $modx->getDatabase()->select(sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category, cat.id as catid", $_lang['no_category']), sprintf("%s tv
214 214
 	    LEFT JOIN %s tr ON tv.id=tr.tmplvarid
215 215
 	    LEFT JOIN %s cat ON tv.category=cat.id", $modx->getFullTableName('site_tmplvars'), $modx->getFullTableName('site_tmplvar_templates'), $modx->getFullTableName('categories')), "", "category, tvcaption");
216
-			while($row = $modx->getDatabase()->getRow($rs)) {
217
-				$unselectedTvs[$row['tvid']] = $row;
218
-			}
219
-
220
-			// Catch checkboxes if form not validated
221
-			if(isset($_POST['assignedTv'])) {
222
-				$selectedTvs = array();
223
-				foreach($_POST['assignedTv'] as $tvid) {
224
-					if(isset($unselectedTvs[$tvid])) {
225
-						$selectedTvs[$tvid] = $unselectedTvs[$tvid];
226
-					}
227
-				};
228
-			}
229
-
230
-			$total = count($selectedTvs);
231
-			?>
216
+            while($row = $modx->getDatabase()->getRow($rs)) {
217
+                $unselectedTvs[$row['tvid']] = $row;
218
+            }
219
+
220
+            // Catch checkboxes if form not validated
221
+            if(isset($_POST['assignedTv'])) {
222
+                $selectedTvs = array();
223
+                foreach($_POST['assignedTv'] as $tvid) {
224
+                    if(isset($unselectedTvs[$tvid])) {
225
+                        $selectedTvs[$tvid] = $unselectedTvs[$tvid];
226
+                    }
227
+                };
228
+            }
229
+
230
+            $total = count($selectedTvs);
231
+            ?>
232 232
 		</div>
233 233
 
234 234
 		<div class="tab-page" id="tabAssignedTVs">
@@ -238,65 +238,65 @@  discard block
 block discarded – undo
238 238
 
239 239
 			<div class="container container-body">
240 240
 				<?php
241
-				if($total > 0) {
242
-					echo '<p>' . $_lang['template_tv_msg'] . '</p>';
243
-				}
244
-				if($modx->hasPermission('save_template') && $total > 1 && $id) {
245
-					echo sprintf('<div class="form-group"><a class="btn btn-primary" href="index.php?a=117&amp;id=%s">%s</a></div>', $id, $_lang['template_tv_edit']);
246
-				}
247
-
248
-				// Selected TVs
249
-				$tvList = '';
250
-				if($total > 0) {
251
-					$tvList .= '<ul>';
252
-					foreach($selectedTvs as $row) {
253
-						$desc = !empty($row['tvdescription']) ? '&nbsp;&nbsp;<small>(' . $row['tvdescription'] . ')</small>' : '';
254
-						$locked = $row['tvlocked'] ? ' <em>(' . $_lang['locked'] . ')</em>' : "";
255
-						$tvList .= sprintf('<li><label><input name="assignedTv[]" value="%s" type="checkbox" checked="checked" onchange="documentDirty=true;jQuery(\'#tvsDirty\').val(\'1\');"> %s <small>(%s)</small> - %s%s</label>%s <a href="index.php?id=%s&a=301&or=%s&oid=%s">%s</a></li>', $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->getManagerApi()->action, $id, $_lang['edit']);
256
-					}
257
-					$tvList .= '</ul>';
258
-
259
-				} else {
260
-					echo $_lang['template_no_tv'];
261
-				}
262
-				echo $tvList;
263
-
264
-				// Unselected TVs
265
-				$tvList = '<hr/><p>' . $_lang['template_notassigned_tv'] . '</p><ul>';
266
-				$preCat = '';
267
-				$insideUl = 0;
268
-				while($row = array_shift($unselectedTvs)) {
269
-					if(isset($selectedTvs[$row['tvid']])) {
270
-						continue;
271
-					} // Skip selected
272
-					$row['category'] = stripslashes($row['category']); //pixelchutes
273
-					if($preCat !== $row['category']) {
274
-						$tvList .= $insideUl ? '</ul>' : '';
275
-						$tvList .= '<li><strong>' . $row['category'] . ($row['catid'] != '' ? ' <small>(' . $row['catid'] . ')</small>' : '') . '</strong><ul>';
276
-						$insideUl = 1;
277
-					}
278
-
279
-					$desc = !empty($row['tvdescription']) ? '&nbsp;&nbsp;<small>(' . $row['tvdescription'] . ')</small>' : '';
280
-					$locked = $row['tvlocked'] ? ' <em>(' . $_lang['locked'] . ')</em>' : "";
281
-					$tvList .= sprintf('<li><label><input name="assignedTv[]" value="%s" type="checkbox" onchange="documentDirty=true;jQuery(\'#tvsDirty\').val(\'1\');"> %s <small>(%s)</small> - %s%s</label>%s <a href="index.php?id=%s&a=301&or=%s&oid=%s">%s</a></li>', $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->getManagerApi()->action, $id, $_lang['edit']);
282
-					$tvList .= '</li>';
283
-
284
-					$preCat = $row['category'];
285
-				}
286
-				$tvList .= $insideUl ? '</ul>' : '';
287
-				$tvList .= '</ul>';
288
-				echo $tvList;
289
-
290
-				?>
241
+                if($total > 0) {
242
+                    echo '<p>' . $_lang['template_tv_msg'] . '</p>';
243
+                }
244
+                if($modx->hasPermission('save_template') && $total > 1 && $id) {
245
+                    echo sprintf('<div class="form-group"><a class="btn btn-primary" href="index.php?a=117&amp;id=%s">%s</a></div>', $id, $_lang['template_tv_edit']);
246
+                }
247
+
248
+                // Selected TVs
249
+                $tvList = '';
250
+                if($total > 0) {
251
+                    $tvList .= '<ul>';
252
+                    foreach($selectedTvs as $row) {
253
+                        $desc = !empty($row['tvdescription']) ? '&nbsp;&nbsp;<small>(' . $row['tvdescription'] . ')</small>' : '';
254
+                        $locked = $row['tvlocked'] ? ' <em>(' . $_lang['locked'] . ')</em>' : "";
255
+                        $tvList .= sprintf('<li><label><input name="assignedTv[]" value="%s" type="checkbox" checked="checked" onchange="documentDirty=true;jQuery(\'#tvsDirty\').val(\'1\');"> %s <small>(%s)</small> - %s%s</label>%s <a href="index.php?id=%s&a=301&or=%s&oid=%s">%s</a></li>', $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->getManagerApi()->action, $id, $_lang['edit']);
256
+                    }
257
+                    $tvList .= '</ul>';
258
+
259
+                } else {
260
+                    echo $_lang['template_no_tv'];
261
+                }
262
+                echo $tvList;
263
+
264
+                // Unselected TVs
265
+                $tvList = '<hr/><p>' . $_lang['template_notassigned_tv'] . '</p><ul>';
266
+                $preCat = '';
267
+                $insideUl = 0;
268
+                while($row = array_shift($unselectedTvs)) {
269
+                    if(isset($selectedTvs[$row['tvid']])) {
270
+                        continue;
271
+                    } // Skip selected
272
+                    $row['category'] = stripslashes($row['category']); //pixelchutes
273
+                    if($preCat !== $row['category']) {
274
+                        $tvList .= $insideUl ? '</ul>' : '';
275
+                        $tvList .= '<li><strong>' . $row['category'] . ($row['catid'] != '' ? ' <small>(' . $row['catid'] . ')</small>' : '') . '</strong><ul>';
276
+                        $insideUl = 1;
277
+                    }
278
+
279
+                    $desc = !empty($row['tvdescription']) ? '&nbsp;&nbsp;<small>(' . $row['tvdescription'] . ')</small>' : '';
280
+                    $locked = $row['tvlocked'] ? ' <em>(' . $_lang['locked'] . ')</em>' : "";
281
+                    $tvList .= sprintf('<li><label><input name="assignedTv[]" value="%s" type="checkbox" onchange="documentDirty=true;jQuery(\'#tvsDirty\').val(\'1\');"> %s <small>(%s)</small> - %s%s</label>%s <a href="index.php?id=%s&a=301&or=%s&oid=%s">%s</a></li>', $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->getManagerApi()->action, $id, $_lang['edit']);
282
+                    $tvList .= '</li>';
283
+
284
+                    $preCat = $row['category'];
285
+                }
286
+                $tvList .= $insideUl ? '</ul>' : '';
287
+                $tvList .= '</ul>';
288
+                echo $tvList;
289
+
290
+                ?>
291 291
 			</div>
292 292
 		</div>
293 293
 
294 294
 		<?php
295
-		// invoke OnTempFormRender event
296
-		$evtOut = $modx->invokeEvent("OnTempFormRender", array("id" => $id));
297
-		if(is_array($evtOut)) {
298
-			echo implode("", $evtOut);
299
-		}
300
-		?>
295
+        // invoke OnTempFormRender event
296
+        $evtOut = $modx->invokeEvent("OnTempFormRender", array("id" => $id));
297
+        if(is_array($evtOut)) {
298
+            echo implode("", $evtOut);
299
+        }
300
+        ?>
301 301
 	</div>
302 302
 </form>
Please login to merge, or discard this patch.
manager/actions/mutate_tmplvars.dynamic.php 1 patch
Indentation   +117 added lines, -117 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@  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_template') && $modx->getManagerApi()->action == '301') {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 if(!$modx->hasPermission('new_template') && $modx->getManagerApi()->action == '300') {
9
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
9
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
10 10
 }
11 11
 
12 12
 $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 
21 21
 // check to see the snippet editor isn't locked
22 22
 if($lockedEl = $modx->elementIsLocked(2, $id)) {
23
-	$modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['tmplvar']));
23
+    $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['tmplvar']));
24 24
 }
25 25
 // end check for lock
26 26
 
@@ -30,25 +30,25 @@  discard block
 block discarded – undo
30 30
 global $content;
31 31
 $content = array();
32 32
 if(isset($_GET['id'])) {
33
-	$rs = $modx->getDatabase()->select('*', $tbl_site_tmplvars, "id='{$id}'");
34
-	$content = $modx->getDatabase()->getRow($rs);
35
-	if(!$content) {
36
-		header("Location: " . MODX_SITE_URL . "index.php?id={$site_start}");
37
-	}
38
-
39
-	$_SESSION['itemname'] = $content['caption'];
40
-	if($content['locked'] == 1 && $modx->hasPermission('save_role') != 1) {
41
-		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
42
-	}
33
+    $rs = $modx->getDatabase()->select('*', $tbl_site_tmplvars, "id='{$id}'");
34
+    $content = $modx->getDatabase()->getRow($rs);
35
+    if(!$content) {
36
+        header("Location: " . MODX_SITE_URL . "index.php?id={$site_start}");
37
+    }
38
+
39
+    $_SESSION['itemname'] = $content['caption'];
40
+    if($content['locked'] == 1 && $modx->hasPermission('save_role') != 1) {
41
+        $modx->webAlertAndQuit($_lang["error_no_privileges"]);
42
+    }
43 43
 } else if(isset($_REQUEST['itemname'])) {
44
-	$content['name'] = $_REQUEST['itemname'];
44
+    $content['name'] = $_REQUEST['itemname'];
45 45
 } else {
46
-	$_SESSION['itemname'] = $_lang["new_tmplvars"];
47
-	$content['category'] = (int)$_REQUEST['catid'];
46
+    $_SESSION['itemname'] = $_lang["new_tmplvars"];
47
+    $content['category'] = (int)$_REQUEST['catid'];
48 48
 }
49 49
 
50 50
 if($modx->getManagerApi()->hasFormValues()) {
51
-	$modx->getManagerApi()->loadFormValues();
51
+    $modx->getManagerApi()->loadFormValues();
52 52
 }
53 53
 
54 54
 $content = array_merge($content, $_POST);
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 $RTEditors = '';
63 63
 $evtOut = $modx->invokeEvent('OnRichTextEditorRegister', array('forfrontend' => 1));
64 64
 if(is_array($evtOut)) {
65
-	$RTEditors = implode(',', $evtOut);
65
+    $RTEditors = implode(',', $evtOut);
66 66
 }
67 67
 
68 68
 ?>
@@ -277,12 +277,12 @@  discard block
 block discarded – undo
277 277
 
278 278
 <form name="mutate" method="post" action="index.php" enctype="multipart/form-data">
279 279
 	<?php
280
-	// invoke OnTVFormPrerender event
281
-	$evtOut = $modx->invokeEvent('OnTVFormPrerender', array('id' => $id));
282
-	if(is_array($evtOut)) {
283
-		echo implode("", $evtOut);
284
-	}
285
-	?>
280
+    // invoke OnTVFormPrerender event
281
+    $evtOut = $modx->invokeEvent('OnTVFormPrerender', array('id' => $id));
282
+    if(is_array($evtOut)) {
283
+        echo implode("", $evtOut);
284
+    }
285
+    ?>
286 286
 	<input type="hidden" name="id" value="<?= $content['id'] ?>">
287 287
 	<input type="hidden" name="a" value="302">
288 288
 	<input type="hidden" name="or" value="<?= $origin ?>">
@@ -343,11 +343,11 @@  discard block
 block discarded – undo
343 343
 						<select name="categoryid" class="form-control" onChange="documentDirty=true;">
344 344
 							<option>&nbsp;</option>
345 345
 							<?php
346
-							include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
347
-							foreach(getCategories() as $n => $v) {
348
-								echo "<option value='" . $v['id'] . "'" . ($content["category"] == $v["id"] ? " selected='selected'" : "") . ">" . $modx->getPhpCompat()->htmlspecialchars($v["category"]) . "</option>";
349
-							}
350
-							?>
346
+                            include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
347
+                            foreach(getCategories() as $n => $v) {
348
+                                echo "<option value='" . $v['id'] . "'" . ($content["category"] == $v["id"] ? " selected='selected'" : "") . ">" . $modx->getPhpCompat()->htmlspecialchars($v["category"]) . "</option>";
349
+                            }
350
+                            ?>
351 351
 						</select>
352 352
 					</div>
353 353
 				</div>
@@ -383,14 +383,14 @@  discard block
 block discarded – undo
383 383
 							<optgroup label="Custom Type">
384 384
 								<option value="custom_tv" <?= ($content['type'] == 'custom_tv' ? "selected='selected'" : "") ?>>Custom Input</option>
385 385
 								<?php
386
-								$custom_tvs = scandir(MODX_BASE_PATH . 'assets/tvs');
387
-								foreach($custom_tvs as $ctv) {
388
-									if(strpos($ctv, '.') !== 0 && $ctv != 'index.html') {
389
-										$selected = ($content['type'] == 'custom_tv:' . $ctv ? "selected='selected'" : "");
390
-										echo '<option value="custom_tv:' . $ctv . '"  ' . $selected . '>' . $ctv . '</option>';
391
-									}
392
-								}
393
-								?>
386
+                                $custom_tvs = scandir(MODX_BASE_PATH . 'assets/tvs');
387
+                                foreach($custom_tvs as $ctv) {
388
+                                    if(strpos($ctv, '.') !== 0 && $ctv != 'index.html') {
389
+                                        $selected = ($content['type'] == 'custom_tv:' . $ctv ? "selected='selected'" : "");
390
+                                        echo '<option value="custom_tv:' . $ctv . '"  ' . $selected . '>' . $ctv . '</option>';
391
+                                    }
392
+                                }
393
+                                ?>
394 394
 							</optgroup>
395 395
 						</select>
396 396
 					</div>
@@ -455,63 +455,63 @@  discard block
 block discarded – undo
455 455
 					<a class="btn btn-secondary btn-sm" href="javascript:;" onClick="check_toggle(); return false;"><?= $_lang['check_toggle'] ?></a>
456 456
 				</div>
457 457
 				<?php
458
-				$rs = $modx->getDatabase()->select(sprintf("tpl.id AS id, templatename, tpl.description AS tpldescription, tpl.locked AS tpllocked, tpl.selectable AS selectable, tmplvarid, if(isnull(cat.category),'%s',cat.category) AS category, cat.id AS catid", $_lang['no_category']), sprintf("%s as tpl
458
+                $rs = $modx->getDatabase()->select(sprintf("tpl.id AS id, templatename, tpl.description AS tpldescription, tpl.locked AS tpllocked, tpl.selectable AS selectable, tmplvarid, if(isnull(cat.category),'%s',cat.category) AS category, cat.id AS catid", $_lang['no_category']), sprintf("%s as tpl
459 459
                     LEFT JOIN %s as stt ON stt.templateid=tpl.id AND stt.tmplvarid='%s'
460 460
                     LEFT JOIN %s as cat ON tpl.category=cat.id", $modx->getFullTableName('site_templates'), $modx->getFullTableName('site_tmplvar_templates'), $id, $modx->getFullTableName('categories')), '', "category, templatename");
461 461
 
462
-				$tplList = '<ul>';
463
-				$preCat = '';
464
-				$insideUl = 0;
465
-				while($row = $modx->getDatabase()->getRow($rs)) {
466
-					$row['category'] = stripslashes($row['category']); //pixelchutes
467
-					if($preCat !== $row['category']) {
468
-						$tplList .= $insideUl ? '</ul>' : '';
469
-						$tplList .= '<li><strong>' . $row['category'] . ($row['catid'] != '' ? ' <small>(' . $row['catid'] . ')</small>' : '') . '</strong><ul>';
470
-						$insideUl = 1;
471
-					}
472
-
473
-					if($modx->getManagerApi()->action == '300' && $modx->config['default_template'] == $row['id']) {
474
-						$checked = true;
475
-					} elseif(isset($_GET['tpl']) && $_GET['tpl'] == $row['id']) {
476
-						$checked = true;
477
-					} elseif($id == 0 && is_array($_POST['template'])) {
478
-						$checked = in_array($row['id'], $_POST['template']);
479
-					} else {
480
-						$checked = $row['tmplvarid'];
481
-					}
482
-					$selectable = !$row['selectable'] ? ' class="disabled"' : '';
483
-					$checked = $checked ? ' checked="checked"' : '';
484
-					$tplId = '&nbsp;<small>(' . $row['id'] . ')</small>';
485
-					$desc = !empty($row['tpldescription']) ? ' - ' . $row['tpldescription'] : '';
486
-
487
-					$tplInfo = array();
488
-					if($row['tpllocked']) {
489
-						$tplInfo[] = $_lang['locked'];
490
-					}
491
-					if($row['id'] == $modx->config['default_template']) {
492
-						$tplInfo[] = $_lang['defaulttemplate_title'];
493
-					}
494
-					$tplInfo = !empty($tplInfo) ? ' <em>(' . implode(', ', $tplInfo) . ')</em>' : '';
495
-
496
-					$tplList .= sprintf('<li><label%s><input name="template[]" value="%s" type="checkbox" %s onchange="documentDirty=true;"> %s%s%s%s</label></li>', $selectable, $row['id'], $checked, $row['templatename'], $tplId, $desc, $tplInfo);
497
-					$tplList .= '</li>';
498
-
499
-					$preCat = $row['category'];
500
-				}
501
-				$tplList .= $insideUl ? '</ul>' : '';
502
-				$tplList .= '</ul>';
503
-				echo $tplList;
504
-
505
-				?>
462
+                $tplList = '<ul>';
463
+                $preCat = '';
464
+                $insideUl = 0;
465
+                while($row = $modx->getDatabase()->getRow($rs)) {
466
+                    $row['category'] = stripslashes($row['category']); //pixelchutes
467
+                    if($preCat !== $row['category']) {
468
+                        $tplList .= $insideUl ? '</ul>' : '';
469
+                        $tplList .= '<li><strong>' . $row['category'] . ($row['catid'] != '' ? ' <small>(' . $row['catid'] . ')</small>' : '') . '</strong><ul>';
470
+                        $insideUl = 1;
471
+                    }
472
+
473
+                    if($modx->getManagerApi()->action == '300' && $modx->config['default_template'] == $row['id']) {
474
+                        $checked = true;
475
+                    } elseif(isset($_GET['tpl']) && $_GET['tpl'] == $row['id']) {
476
+                        $checked = true;
477
+                    } elseif($id == 0 && is_array($_POST['template'])) {
478
+                        $checked = in_array($row['id'], $_POST['template']);
479
+                    } else {
480
+                        $checked = $row['tmplvarid'];
481
+                    }
482
+                    $selectable = !$row['selectable'] ? ' class="disabled"' : '';
483
+                    $checked = $checked ? ' checked="checked"' : '';
484
+                    $tplId = '&nbsp;<small>(' . $row['id'] . ')</small>';
485
+                    $desc = !empty($row['tpldescription']) ? ' - ' . $row['tpldescription'] : '';
486
+
487
+                    $tplInfo = array();
488
+                    if($row['tpllocked']) {
489
+                        $tplInfo[] = $_lang['locked'];
490
+                    }
491
+                    if($row['id'] == $modx->config['default_template']) {
492
+                        $tplInfo[] = $_lang['defaulttemplate_title'];
493
+                    }
494
+                    $tplInfo = !empty($tplInfo) ? ' <em>(' . implode(', ', $tplInfo) . ')</em>' : '';
495
+
496
+                    $tplList .= sprintf('<li><label%s><input name="template[]" value="%s" type="checkbox" %s onchange="documentDirty=true;"> %s%s%s%s</label></li>', $selectable, $row['id'], $checked, $row['templatename'], $tplId, $desc, $tplInfo);
497
+                    $tplList .= '</li>';
498
+
499
+                    $preCat = $row['category'];
500
+                }
501
+                $tplList .= $insideUl ? '</ul>' : '';
502
+                $tplList .= '</ul>';
503
+                echo $tplList;
504
+
505
+                ?>
506 506
 
507 507
 				<!-- Access Permissions -->
508 508
 				<?php
509
-				if($use_udperms == 1) {
510
-					// fetch permissions for the variable
511
-					$rs = $modx->getDatabase()->select('documentgroup', $modx->getFullTableName('site_tmplvar_access'), "tmplvarid='{$id}'");
512
-					$groupsarray = $modx->getDatabase()->getColumn('documentgroup', $rs);
509
+                if($use_udperms == 1) {
510
+                    // fetch permissions for the variable
511
+                    $rs = $modx->getDatabase()->select('documentgroup', $modx->getFullTableName('site_tmplvar_access'), "tmplvarid='{$id}'");
512
+                    $groupsarray = $modx->getDatabase()->getColumn('documentgroup', $rs);
513 513
 
514
-					?>
514
+                    ?>
515 515
 					<?php if($modx->hasPermission('access_permissions')) { ?>
516 516
 						<script type="text/javascript">
517 517
 							function makePublic(b) {
@@ -539,29 +539,29 @@  discard block
 block discarded – undo
539 539
 						<!--<b><?php /*echo $_lang['access_permissions']; */ ?></b>-->
540 540
 						<p><?= $_lang['tmplvar_access_msg'] ?></p>
541 541
 						<?php
542
-						$chk = '';
543
-						$rs = $modx->getDatabase()->select('name, id', $tbl_documentgroup_names);
544
-						if(empty($groupsarray) && is_array($_POST['docgroups']) && empty($_POST['id'])) {
545
-							$groupsarray = $_POST['docgroups'];
546
-						}
547
-						while($row = $modx->getDatabase()->getRow($rs)) {
548
-							$checked = in_array($row['id'], $groupsarray);
549
-							if($modx->hasPermission('access_permissions')) {
550
-								if($checked) {
551
-									$notPublic = true;
552
-								}
553
-								$chks .= "<li><label><input type='checkbox' name='docgroups[]' value='" . $row['id'] . "' " . ($checked ? "checked='checked'" : '') . " onclick=\"makePublic(false)\" /> " . $row['name'] . "</label></li>";
554
-							} else {
555
-								if($checked) {
556
-									echo "<input type='hidden' name='docgroups[]'  value='" . $row['id'] . "' />";
557
-								}
558
-							}
559
-						}
560
-						if($modx->hasPermission('access_permissions')) {
561
-							$chks = "<li><label><input type='checkbox' name='chkalldocs' " . (!$notPublic ? "checked='checked'" : '') . " onclick=\"makePublic(true)\" /> <span class='warning'>" . $_lang['all_doc_groups'] . "</span></label></li>" . $chks;
562
-						}
563
-						echo '<ul>' . $chks . '</ul>';
564
-						?>
542
+                        $chk = '';
543
+                        $rs = $modx->getDatabase()->select('name, id', $tbl_documentgroup_names);
544
+                        if(empty($groupsarray) && is_array($_POST['docgroups']) && empty($_POST['id'])) {
545
+                            $groupsarray = $_POST['docgroups'];
546
+                        }
547
+                        while($row = $modx->getDatabase()->getRow($rs)) {
548
+                            $checked = in_array($row['id'], $groupsarray);
549
+                            if($modx->hasPermission('access_permissions')) {
550
+                                if($checked) {
551
+                                    $notPublic = true;
552
+                                }
553
+                                $chks .= "<li><label><input type='checkbox' name='docgroups[]' value='" . $row['id'] . "' " . ($checked ? "checked='checked'" : '') . " onclick=\"makePublic(false)\" /> " . $row['name'] . "</label></li>";
554
+                            } else {
555
+                                if($checked) {
556
+                                    echo "<input type='hidden' name='docgroups[]'  value='" . $row['id'] . "' />";
557
+                                }
558
+                            }
559
+                        }
560
+                        if($modx->hasPermission('access_permissions')) {
561
+                            $chks = "<li><label><input type='checkbox' name='chkalldocs' " . (!$notPublic ? "checked='checked'" : '') . " onclick=\"makePublic(true)\" /> <span class='warning'>" . $_lang['all_doc_groups'] . "</span></label></li>" . $chks;
562
+                        }
563
+                        echo '<ul>' . $chks . '</ul>';
564
+                        ?>
565 565
 					<?php } ?>
566 566
 				<?php } ?>
567 567
 
@@ -571,12 +571,12 @@  discard block
 block discarded – undo
571 571
 		<input type="submit" name="save" style="display:none">
572 572
 
573 573
 		<?php
574
-		// invoke OnTVFormRender event
575
-		$evtOut = $modx->invokeEvent('OnTVFormRender', array('id' => $id));
576
-		if(is_array($evtOut)) {
577
-			echo implode('', $evtOut);
578
-		}
579
-		?>
574
+        // invoke OnTVFormRender event
575
+        $evtOut = $modx->invokeEvent('OnTVFormRender', array('id' => $id));
576
+        if(is_array($evtOut)) {
577
+            echo implode('', $evtOut);
578
+        }
579
+        ?>
580 580
 	</div>
581 581
 </form>
582 582
 <script type="text/javascript">setTimeout('showParameters()', 10);</script>
Please login to merge, or discard this patch.
manager/actions/web_access_permissions.dynamic.php 1 patch
Indentation   +89 added lines, -89 removed lines patch added patch discarded remove patch
@@ -1,32 +1,32 @@  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('web_access_permissions')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 // find all document groups, for the select :)
10 10
 $rs = $modx->getDatabase()->select('*', $modx->getFullTableName('documentgroup_names'), '', 'name');
11 11
 if($modx->getDatabase()->getRecordCount($rs) < 1) {
12
-	$docgroupselector = "[no groups to add]";
12
+    $docgroupselector = "[no groups to add]";
13 13
 } else {
14
-	$docgroupselector = '<select name="docgroup">' . "\n";
15
-	while($row = $modx->getDatabase()->getRow($rs)) {
16
-		$docgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n";
17
-	}
18
-	$docgroupselector .= "</select>\n";
14
+    $docgroupselector = '<select name="docgroup">' . "\n";
15
+    while($row = $modx->getDatabase()->getRow($rs)) {
16
+        $docgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n";
17
+    }
18
+    $docgroupselector .= "</select>\n";
19 19
 }
20 20
 
21 21
 $rs = $modx->getDatabase()->select('*', $modx->getFullTableName('webgroup_names'), '', 'name');
22 22
 if($modx->getDatabase()->getRecordCount($rs) < 1) {
23
-	$usrgroupselector = '[no user groups]';
23
+    $usrgroupselector = '[no user groups]';
24 24
 } else {
25
-	$usrgroupselector = '<select name="usergroup">' . "\n";
26
-	while($row = $modx->getDatabase()->getRow($rs)) {
27
-		$usrgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n";
28
-	}
29
-	$usrgroupselector .= "</select>\n";
25
+    $usrgroupselector = '<select name="usergroup">' . "\n";
26
+    while($row = $modx->getDatabase()->getRow($rs)) {
27
+        $usrgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n";
28
+    }
29
+    $usrgroupselector .= "</select>\n";
30 30
 }
31 31
 
32 32
 ?>
@@ -88,24 +88,24 @@  discard block
 block discarded – undo
88 88
 				</form>
89 89
 			</div>
90 90
 			<?php
91
-			$rs = $modx->getDatabase()->select('groupnames.*, users.id AS user_id, users.username user_name ', $modx->getFullTableName('webgroup_names') . " AS groupnames
91
+            $rs = $modx->getDatabase()->select('groupnames.*, users.id AS user_id, users.username user_name ', $modx->getFullTableName('webgroup_names') . " AS groupnames
92 92
 			LEFT JOIN " . $modx->getFullTableName('web_groups') . " AS groups ON groups.webgroup = groupnames.id
93 93
 			LEFT JOIN " . $modx->getFullTableName('web_users') . " AS users ON users.id = groups.webuser", '', 'groupnames.name, user_name');
94
-			if($modx->getDatabase()->getRecordCount($rs) < 1) {
95
-				?>
94
+            if($modx->getDatabase()->getRecordCount($rs) < 1) {
95
+                ?>
96 96
 				<div class="text-danger"><?= $_lang['no_groups_found'] ?></div>
97 97
 				<?php
98
-			} else {
99
-			?>
98
+            } else {
99
+            ?>
100 100
 			<div class="form-group">
101 101
 				<?php
102
-				$pid = '';
103
-				while($row = $modx->getDatabase()->getRow($rs)) {
104
-					if($pid != $row['id']) {
105
-						if($pid != '') {
106
-							echo '</div><div class="form-group">';
107
-						}
108
-						?>
102
+                $pid = '';
103
+                while($row = $modx->getDatabase()->getRow($rs)) {
104
+                    if($pid != $row['id']) {
105
+                        if($pid != '') {
106
+                            echo '</div><div class="form-group">';
107
+                        }
108
+                        ?>
109 109
 						<form method="post" action="index.php" name="accesspermissions">
110 110
 							<input type="hidden" name="a" value="92" />
111 111
 							<input type="hidden" name="groupid" value="<?= $row['id'] ?>" />
@@ -120,21 +120,21 @@  discard block
 block discarded – undo
120 120
 						</form>
121 121
 						<?= $_lang['web_access_permissions_users_in_group'] ?>
122 122
 						<?php
123
-					}
124
-					if(!$row['user_id']) {
125
-						?>
123
+                    }
124
+                    if(!$row['user_id']) {
125
+                        ?>
126 126
 						<i><?= $_lang['access_permissions_no_users_in_group'] ?></i>
127 127
 						<?php
128
-						$pid = $row['id'];
129
-						continue;
130
-					}
131
-					?>
128
+                        $pid = $row['id'];
129
+                        continue;
130
+                    }
131
+                    ?>
132 132
 					<?= ($pid == $row['id'] ? ', ' : '') ?><a href="index.php?a=88&id=<?= $row['user_id'] ?>"><?= $row['user_name'] ?></a>
133 133
 					<?php
134
-					$pid = $row['id'];
135
-				}
136
-				}
137
-				?>
134
+                    $pid = $row['id'];
135
+                }
136
+                }
137
+                ?>
138 138
 			</div>
139 139
 		</div>
140 140
 	</div>
@@ -159,24 +159,24 @@  discard block
 block discarded – undo
159 159
 				</form>
160 160
 			</div>
161 161
 			<?php
162
-			$rs = $modx->getDatabase()->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', $modx->getFullTableName('documentgroup_names') . " AS dgnames
162
+            $rs = $modx->getDatabase()->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', $modx->getFullTableName('documentgroup_names') . " AS dgnames
163 163
 			LEFT JOIN " . $modx->getFullTableName('document_groups') . " AS dg ON dg.document_group = dgnames.id
164 164
 			LEFT JOIN " . $modx->getFullTableName('site_content') . " AS sc ON sc.id = dg.document", '', 'dgnames.name, sc.id');
165
-			if($modx->getDatabase()->getRecordCount($rs) < 1) {
166
-				?>
165
+            if($modx->getDatabase()->getRecordCount($rs) < 1) {
166
+                ?>
167 167
 				<div class="text-danger"><?= $_lang['no_groups_found'] ?></div>
168 168
 				<?php
169
-			} else {
170
-			?>
169
+            } else {
170
+            ?>
171 171
 			<div class="form-group">
172 172
 				<?php
173
-				$pid = '';
174
-				while($row = $modx->getDatabase()->getRow($rs)) {
175
-					if($pid != $row['id']) {
176
-						if($pid != '') {
177
-							echo '</div><div class="form-group">';
178
-						}
179
-						?>
173
+                $pid = '';
174
+                while($row = $modx->getDatabase()->getRow($rs)) {
175
+                    if($pid != $row['id']) {
176
+                        if($pid != '') {
177
+                            echo '</div><div class="form-group">';
178
+                        }
179
+                        ?>
180 180
 						<form method="post" action="index.php" name="accesspermissions">
181 181
 							<input type="hidden" name="a" value="92" />
182 182
 							<input type="hidden" name="groupid" value="<?= $row['id'] ?>" />
@@ -191,21 +191,21 @@  discard block
 block discarded – undo
191 191
 						</form>
192 192
 						<?= $_lang['access_permissions_resources_in_group'] ?>
193 193
 						<?php
194
-					}
195
-					if(!$row['doc_id']) {
196
-						?>
194
+                    }
195
+                    if(!$row['doc_id']) {
196
+                        ?>
197 197
 						<i><?= $_lang['access_permissions_no_resources_in_group'] ?></i>
198 198
 						<?php
199
-						$pid = $row['id'];
200
-						continue;
201
-					}
202
-					?>
199
+                        $pid = $row['id'];
200
+                        continue;
201
+                    }
202
+                    ?>
203 203
 					<?= ($pid == $row['id'] ? ', ' : '') ?><a href="index.php?a=3&id=<?= $row['doc_id'] ?>" title="<?= $modx->getPhpCompat()->htmlspecialchars($row['doc_title']) ?>"><?= $row['doc_id'] ?></a>
204 204
 					<?php
205
-					$pid = $row['id'];
206
-				}
207
-				}
208
-				?>
205
+                    $pid = $row['id'];
206
+                }
207
+                }
208
+                ?>
209 209
 			</div>
210 210
 		</div>
211 211
 	</div>
@@ -217,15 +217,15 @@  discard block
 block discarded – undo
217 217
 		<div class="container container-body">
218 218
 			<p class="element-edit-message-tab alert alert-warning"><?= $_lang['access_permissions_links_tab'] ?></p>
219 219
 			<?php
220
-			$rs = $modx->getDatabase()->select('groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', $modx->getFullTableName('webgroup_names') . " AS groupnames
220
+            $rs = $modx->getDatabase()->select('groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', $modx->getFullTableName('webgroup_names') . " AS groupnames
221 221
 			LEFT JOIN " . $modx->getFullTableName('webgroup_access') . " AS groupacc ON groupacc.webgroup = groupnames.id
222 222
 			LEFT JOIN " . $modx->getFullTableName('documentgroup_names') . " AS dgnames ON dgnames.id = groupacc.documentgroup", '', 'name, dg_name');
223
-			if($modx->getDatabase()->getRecordCount($rs) < 1) {
224
-				?>
223
+            if($modx->getDatabase()->getRecordCount($rs) < 1) {
224
+                ?>
225 225
 				<div class="text-danger"><?= $_lang['no_groups_found'] ?></div>
226 226
 				<?php
227
-			} else {
228
-				?>
227
+            } else {
228
+                ?>
229 229
 				<div class="form-group">
230 230
 					<b><?= $_lang["access_permissions_group_link"] ?></b>
231 231
 					<form method="post" action="index.php" name="accesspermissions">
@@ -241,38 +241,38 @@  discard block
 block discarded – undo
241 241
 				<hr>
242 242
 				<ul>
243 243
 					<?php
244
-					$pid = '';
245
-					while($row = $modx->getDatabase()->getRow($rs)) {
246
-						if($row['id'] != $pid) {
247
-							if($pid != '') {
248
-								echo '</ul></li>';
249
-							} // close previous one
250
-							?>
244
+                    $pid = '';
245
+                    while($row = $modx->getDatabase()->getRow($rs)) {
246
+                        if($row['id'] != $pid) {
247
+                            if($pid != '') {
248
+                                echo '</ul></li>';
249
+                            } // close previous one
250
+                            ?>
251 251
 							<li><b><?= $row['name'] ?></b></li>
252 252
 							<?php
253
-							if(!$row['dg_id']) {
254
-								echo '<i>' . $_lang['no_groups_found'] . '</i></li>';
255
-								$pid = '';
256
-								continue;
257
-							} else {
258
-								echo '<ul>';
259
-							}
260
-						}
261
-						if(!$row['dg_id']) {
262
-							continue;
263
-						}
264
-						?>
253
+                            if(!$row['dg_id']) {
254
+                                echo '<i>' . $_lang['no_groups_found'] . '</i></li>';
255
+                                $pid = '';
256
+                                continue;
257
+                            } else {
258
+                                echo '<ul>';
259
+                            }
260
+                        }
261
+                        if(!$row['dg_id']) {
262
+                            continue;
263
+                        }
264
+                        ?>
265 265
 						<li><?= $row['dg_name'] ?>
266 266
 							<small><i>(<a class="text-danger" href="index.php?a=92&coupling=<?= $row['link_id'] ?>&operation=remove_document_group_from_user_group"><?= $_lang['remove'] ?></a>)</i></small>
267 267
 						</li>
268 268
 						<?php
269
-						$pid = $row['id'];
270
-					}
271
-					?>
269
+                        $pid = $row['id'];
270
+                    }
271
+                    ?>
272 272
 				</ul>
273 273
 				<?php
274
-			}
275
-			?>
274
+            }
275
+            ?>
276 276
 		</div>
277 277
 	</div>
278 278
 
Please login to merge, or discard this patch.
manager/actions/mutate_settings.dynamic.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -1,15 +1,15 @@  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 />Please use the EVO Content Manager instead of accessing this file directly.");
3
+    die("<b>INCLUDE_ORDERING_ERROR</b><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if(!$modx->hasPermission('settings')) {
6
-	$modx->webAlertAndQuit($_lang['error_no_privileges']);
6
+    $modx->webAlertAndQuit($_lang['error_no_privileges']);
7 7
 }
8 8
 
9 9
 // check to see the edit settings page isn't locked
10 10
 $rs = $modx->getDatabase()->select('username', $modx->getFullTableName('active_users'), "action=17 AND internalKey!='" . $modx->getLoginUserID() . "'");
11 11
 if($username = $modx->getDatabase()->getValue($rs)) {
12
-	$modx->webAlertAndQuit(sprintf($_lang['lock_settings_msg'], $username));
12
+    $modx->webAlertAndQuit(sprintf($_lang['lock_settings_msg'], $username));
13 13
 }
14 14
 // end check for lock
15 15
 
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 include_once(MODX_MANAGER_PATH . 'includes/default_config.php');
20 20
 $rs = $modx->getDatabase()->select('setting_name, setting_value', '[+prefix+]system_settings');
21 21
 while($row = $modx->getDatabase()->getRow($rs)) {
22
-	$settings[$row['setting_name']] = $row['setting_value'];
22
+    $settings[$row['setting_name']] = $row['setting_value'];
23 23
 }
24 24
 $settings['filemanager_path'] = preg_replace('@^' . preg_quote(MODX_BASE_PATH) . '@', '[(base_path)]', $settings['filemanager_path']);
25 25
 $settings['rb_base_dir'] = preg_replace('@^' . preg_quote(MODX_BASE_PATH) . '@', '[(base_path)]', $settings['rb_base_dir']);
@@ -30,11 +30,11 @@  discard block
 block discarded – undo
30 30
 $lang_keys = array();
31 31
 $dir = dir('includes/lang');
32 32
 while($file = $dir->read()) {
33
-	if(strpos($file, '.inc.php') > 0) {
34
-		$endpos = strpos($file, '.');
35
-		$languagename = substr($file, 0, $endpos);
36
-		$lang_keys[$languagename] = get_lang_keys($file);
37
-	}
33
+    if(strpos($file, '.inc.php') > 0) {
34
+        $endpos = strpos($file, '.');
35
+        $languagename = substr($file, 0, $endpos);
36
+        $lang_keys[$languagename] = get_lang_keys($file);
37
+    }
38 38
 }
39 39
 $dir->close();
40 40
 $displayStyle = ($_SESSION['browser'] === 'modern') ? 'table-row' : 'block';
@@ -76,14 +76,14 @@  discard block
 block discarded – undo
76 76
 				</script>
77 77
 
78 78
 				<?php
79
-				include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab1_site_settings.inc.php');
80
-				include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab2_furl_settings.inc.php');
81
-				include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab3_user_settings.inc.php');
82
-				include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab4_manager_settings.inc.php');
83
-				include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab5_security_settings.inc.php');
84
-				include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab6_filemanager_settings.inc.php');
85
-				include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab7_filebrowser_settings.inc.php');
86
-				?>
79
+                include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab1_site_settings.inc.php');
80
+                include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab2_furl_settings.inc.php');
81
+                include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab3_user_settings.inc.php');
82
+                include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab4_manager_settings.inc.php');
83
+                include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab5_security_settings.inc.php');
84
+                include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab6_filemanager_settings.inc.php');
85
+                include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab7_filebrowser_settings.inc.php');
86
+                ?>
87 87
 			</div>
88 88
 		</div>
89 89
 	</form>
@@ -130,5 +130,5 @@  discard block
 block discarded – undo
130 130
 	</script>
131 131
 <?php
132 132
 if(is_numeric($_GET['tab'])) {
133
-	echo '<script type="text/javascript">tpSettings.setSelectedIndex( ' . $_GET['tab'] . ' );</script>';
133
+    echo '<script type="text/javascript">tpSettings.setSelectedIndex( ' . $_GET['tab'] . ' );</script>';
134 134
 }
Please login to merge, or discard this patch.
manager/actions/access_permissions.dynamic.php 1 patch
Indentation   +90 added lines, -90 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('access_permissions')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 // Get table names (alphabetical)
@@ -18,24 +18,24 @@  discard block
 block discarded – undo
18 18
 // find all document groups, for the select :)
19 19
 $rs = $modx->getDatabase()->select('*', $tbl_documentgroup_names, '', 'name');
20 20
 if($modx->getDatabase()->getRecordCount($rs) < 1) {
21
-	$docgroupselector = '[no groups to add]';
21
+    $docgroupselector = '[no groups to add]';
22 22
 } else {
23
-	$docgroupselector = '<select name="docgroup">' . "\n";
24
-	while($row = $modx->getDatabase()->getRow($rs)) {
25
-		$docgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n";
26
-	}
27
-	$docgroupselector .= "</select>\n";
23
+    $docgroupselector = '<select name="docgroup">' . "\n";
24
+    while($row = $modx->getDatabase()->getRow($rs)) {
25
+        $docgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n";
26
+    }
27
+    $docgroupselector .= "</select>\n";
28 28
 }
29 29
 
30 30
 $rs = $modx->getDatabase()->select('*', $tbl_membergroup_names, '', 'name');
31 31
 if($modx->getDatabase()->getRecordCount($rs) < 1) {
32
-	$usrgroupselector = '[no user groups]';
32
+    $usrgroupselector = '[no user groups]';
33 33
 } else {
34
-	$usrgroupselector = '<select name="usergroup">' . "\n";
35
-	while($row = $modx->getDatabase()->getRow($rs)) {
36
-		$usrgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n";
37
-	}
38
-	$usrgroupselector .= "</select>\n";
34
+    $usrgroupselector = '<select name="usergroup">' . "\n";
35
+    while($row = $modx->getDatabase()->getRow($rs)) {
36
+        $usrgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n";
37
+    }
38
+    $usrgroupselector .= "</select>\n";
39 39
 }
40 40
 
41 41
 ?>
@@ -96,24 +96,24 @@  discard block
 block discarded – undo
96 96
 				</form>
97 97
 			</div>
98 98
 			<?php
99
-			$rs = $modx->getDatabase()->select('groupnames.*, users.id AS user_id, users.username user_name', $tbl_membergroup_names . ' AS groupnames
99
+            $rs = $modx->getDatabase()->select('groupnames.*, users.id AS user_id, users.username user_name', $tbl_membergroup_names . ' AS groupnames
100 100
 			LEFT JOIN ' . $tbl_member_groups . ' AS groups ON groups.user_group = groupnames.id
101 101
 			LEFT JOIN ' . $tbl_manager_users . ' AS users ON users.id = groups.member', '', 'groupnames.name, user_name');
102
-			if($modx->getDatabase()->getRecordCount($rs) < 1) {
103
-				?>
102
+            if($modx->getDatabase()->getRecordCount($rs) < 1) {
103
+                ?>
104 104
 				<div class="text-danger"><?= $_lang['no_groups_found'] ?></div>
105 105
 				<?php
106
-			} else {
107
-			?>
106
+            } else {
107
+            ?>
108 108
 			<div class="form-group">
109 109
 				<?php
110
-				$pid = '';
111
-				while($row = $modx->getDatabase()->getRow($rs)) {
112
-					if($pid != $row['id']) {
113
-						if($pid != '') {
114
-							echo '</div><div class="form-group">';
115
-						}
116
-						?>
110
+                $pid = '';
111
+                while($row = $modx->getDatabase()->getRow($rs)) {
112
+                    if($pid != $row['id']) {
113
+                        if($pid != '') {
114
+                            echo '</div><div class="form-group">';
115
+                        }
116
+                        ?>
117 117
 						<form method="post" action="index.php" name="accesspermissions">
118 118
 							<input type="hidden" name="a" value="41" />
119 119
 							<input type="hidden" name="groupid" value="<?= $row['id'] ?>" />
@@ -128,21 +128,21 @@  discard block
 block discarded – undo
128 128
 						</form>
129 129
 						<?= $_lang['access_permissions_users_in_group'] ?>
130 130
 						<?php
131
-					}
132
-					if(!$row['user_id']) {
133
-						?>
131
+                    }
132
+                    if(!$row['user_id']) {
133
+                        ?>
134 134
 						<i><?= $_lang['access_permissions_no_users_in_group'] ?></i>
135 135
 						<?php
136
-						$pid = $row['id'];
137
-						continue;
138
-					}
139
-					?>
136
+                        $pid = $row['id'];
137
+                        continue;
138
+                    }
139
+                    ?>
140 140
 					<?= ($pid == $row['id'] ? ', ' : '') ?><a href="index.php?a=12&id=<?= $row['user_id'] ?>"><?= $row['user_name'] ?></a>
141 141
 					<?php
142
-					$pid = $row['id'];
143
-				}
144
-				}
145
-				?>
142
+                    $pid = $row['id'];
143
+                }
144
+                }
145
+                ?>
146 146
 			</div>
147 147
 		</div>
148 148
 	</div>
@@ -167,24 +167,24 @@  discard block
 block discarded – undo
167 167
 				</form>
168 168
 			</div>
169 169
 			<?php
170
-			$rs = $modx->getDatabase()->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', $tbl_documentgroup_names . ' AS dgnames
170
+            $rs = $modx->getDatabase()->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', $tbl_documentgroup_names . ' AS dgnames
171 171
 			LEFT JOIN ' . $tbl_document_groups . ' AS dg ON dg.document_group = dgnames.id
172 172
 			LEFT JOIN ' . $tbl_site_content . ' AS sc ON sc.id = dg.document', '', 'dgnames.name, sc.id');
173
-			if($modx->getDatabase()->getRecordCount($rs) < 1) {
174
-				?>
173
+            if($modx->getDatabase()->getRecordCount($rs) < 1) {
174
+                ?>
175 175
 				<div class="text-danger"><?= $_lang['no_groups_found'] ?></div>
176 176
 				<?php
177
-			} else {
178
-			?>
177
+            } else {
178
+            ?>
179 179
 			<div class="form-group">
180 180
 				<?php
181
-				$pid = '';
182
-				while($row = $modx->getDatabase()->getRow($rs)) {
183
-					if($pid != $row['id']) {
184
-						if($pid != '') {
185
-							echo '</div><div class="form-group">';
186
-						}
187
-						?>
181
+                $pid = '';
182
+                while($row = $modx->getDatabase()->getRow($rs)) {
183
+                    if($pid != $row['id']) {
184
+                        if($pid != '') {
185
+                            echo '</div><div class="form-group">';
186
+                        }
187
+                        ?>
188 188
 						<form method="post" action="index.php" name="accesspermissions">
189 189
 							<input type="hidden" name="a" value="41" />
190 190
 							<input type="hidden" name="groupid" value="<?= $row['id'] ?>" />
@@ -199,21 +199,21 @@  discard block
 block discarded – undo
199 199
 						</form>
200 200
 						<?= $_lang['access_permissions_resources_in_group'] ?>
201 201
 						<?php
202
-					}
203
-					if(!$row['doc_id']) {
204
-						?>
202
+                    }
203
+                    if(!$row['doc_id']) {
204
+                        ?>
205 205
 						<i><?= $_lang['access_permissions_no_resources_in_group'] ?></i>
206 206
 						<?php
207
-						$pid = $row['id'];
208
-						continue;
209
-					}
210
-					?>
207
+                        $pid = $row['id'];
208
+                        continue;
209
+                    }
210
+                    ?>
211 211
 					<?= ($pid == $row['id'] ? ', ' : '') ?><a href="index.php?a=3&id=<?= $row['doc_id'] ?>" title="<?= $modx->getPhpCompat()->htmlspecialchars($row['doc_title']) ?>"><?= $row['doc_id'] ?></a>
212 212
 					<?php
213
-					$pid = $row['id'];
214
-				}
215
-				}
216
-				?>
213
+                    $pid = $row['id'];
214
+                }
215
+                }
216
+                ?>
217 217
 			</div>
218 218
 		</div>
219 219
 	</div>
@@ -225,16 +225,16 @@  discard block
 block discarded – undo
225 225
 		<div class="container container-body">
226 226
 			<p class="element-edit-message-tab alert alert-warning"><?= $_lang['access_permissions_links_tab'] ?></p>
227 227
 			<?php
228
-			// User/Document Group Links
229
-			$rs = $modx->getDatabase()->select('groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', $tbl_membergroup_names . ' AS groupnames
228
+            // User/Document Group Links
229
+            $rs = $modx->getDatabase()->select('groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', $tbl_membergroup_names . ' AS groupnames
230 230
 			LEFT JOIN ' . $tbl_membergroup_access . ' AS groupacc ON groupacc.membergroup = groupnames.id
231 231
 			LEFT JOIN ' . $tbl_documentgroup_names . ' AS dgnames ON dgnames.id = groupacc.documentgroup', '', 'name, dg_name');
232
-			if($modx->getDatabase()->getRecordCount($rs) < 1) {
233
-				?>
232
+            if($modx->getDatabase()->getRecordCount($rs) < 1) {
233
+                ?>
234 234
 				<div class="text-danger"><?= $_lang['no_groups_found'] ?></div>
235 235
 				<?php
236
-			} else {
237
-				?>
236
+            } else {
237
+                ?>
238 238
 				<div class="form-group">
239 239
 					<b><?= $_lang["access_permissions_group_link"] ?></b>
240 240
 					<form method="post" action="index.php" name="accesspermissions">
@@ -250,38 +250,38 @@  discard block
 block discarded – undo
250 250
 				<hr>
251 251
 				<ul>
252 252
 					<?php
253
-					$pid = '';
254
-					while($row = $modx->getDatabase()->getRow($rs)) {
255
-						if($row['id'] != $pid) {
256
-							if($pid != '') {
257
-								echo '</ul></li>';
258
-							} // close previous one
259
-							?>
253
+                    $pid = '';
254
+                    while($row = $modx->getDatabase()->getRow($rs)) {
255
+                        if($row['id'] != $pid) {
256
+                            if($pid != '') {
257
+                                echo '</ul></li>';
258
+                            } // close previous one
259
+                            ?>
260 260
 							<li><b><?= $row['name'] ?></b></li>
261 261
 							<?php
262
-							if(!$row['dg_id']) {
263
-								echo '<i>' . $_lang['no_groups_found'] . '</i></li>';
264
-								$pid = '';
265
-								continue;
266
-							} else {
267
-								echo '<ul>';
268
-							}
269
-						}
270
-						if(!$row['dg_id']) {
271
-							continue;
272
-						}
273
-						?>
262
+                            if(!$row['dg_id']) {
263
+                                echo '<i>' . $_lang['no_groups_found'] . '</i></li>';
264
+                                $pid = '';
265
+                                continue;
266
+                            } else {
267
+                                echo '<ul>';
268
+                            }
269
+                        }
270
+                        if(!$row['dg_id']) {
271
+                            continue;
272
+                        }
273
+                        ?>
274 274
 						<li><?= $row['dg_name'] ?>
275 275
 							<small><i>(<a class="text-danger" href="index.php?a=41&coupling=<?= $row['link_id'] ?>&operation=remove_document_group_from_user_group"><?= $_lang['remove'] ?></a>)</i></small>
276 276
 						</li>
277 277
 						<?php
278
-						$pid = $row['id'];
279
-					}
280
-					?>
278
+                        $pid = $row['id'];
279
+                    }
280
+                    ?>
281 281
 				</ul>
282 282
 				<?php
283
-			}
284
-			?>
283
+            }
284
+            ?>
285 285
 		</div>
286 286
 	</div>
287 287
 
Please login to merge, or discard this patch.
manager/actions/site_schedule.static.php 1 patch
Indentation   +38 added lines, -38 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('view_eventlog')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 ?>
9 9
 <script type="text/javascript" src="media/script/tablesort.js"></script>
@@ -17,14 +17,14 @@  discard block
 block discarded – undo
17 17
 		<div class="form-group" id="lyr1">
18 18
 			<b><?= $_lang["publish_events"] ?></b>
19 19
 			<?php
20
-			$rs = $modx->getDatabase()->select('id, pagetitle, pub_date', $modx->getFullTableName('site_content'), "pub_date > " . time() . "", 'pub_date ASC');
21
-			$limit = $modx->getDatabase()->getRecordCount($rs);
22
-			if($limit < 1) {
23
-				?>
20
+            $rs = $modx->getDatabase()->select('id, pagetitle, pub_date', $modx->getFullTableName('site_content'), "pub_date > " . time() . "", 'pub_date ASC');
21
+            $limit = $modx->getDatabase()->getRecordCount($rs);
22
+            if($limit < 1) {
23
+                ?>
24 24
 				<p><?= $_lang["no_docs_pending_publishing"] ?></p>
25 25
 				<?php
26
-			} else {
27
-				?>
26
+            } else {
27
+                ?>
28 28
 				<div class="table-responsive">
29 29
 					<table class="grid sortabletable" id="table-1">
30 30
 						<thead>
@@ -36,34 +36,34 @@  discard block
 block discarded – undo
36 36
 						</thead>
37 37
 						<tbody>
38 38
 						<?php
39
-						while($row = $modx->getDatabase()->getRow($rs)) {
40
-							?>
39
+                        while($row = $modx->getDatabase()->getRow($rs)) {
40
+                            ?>
41 41
 							<tr>
42 42
 								<td class="text-right"><?= $row['id'] ?></td>
43 43
 								<td><a href="index.php?a=3&id=<?= $row['id'] ?>"><?= $row['pagetitle'] ?></a></td>
44 44
 								<td class="text-nowrap text-right"><?= $modx->toDateFormat($row['pub_date'] + $server_offset_time) ?></td>
45 45
 							</tr>
46 46
 							<?php
47
-						}
48
-						?>
47
+                        }
48
+                        ?>
49 49
 						</tbody>
50 50
 					</table>
51 51
 				</div>
52 52
 				<?php
53
-			}
54
-			?>
53
+            }
54
+            ?>
55 55
 		</div>
56 56
 		<div class="form-group" id="lyr2">
57 57
 			<b><?= $_lang["unpublish_events"] ?></b>
58 58
 			<?php
59
-			$rs = $modx->getDatabase()->select('id, pagetitle, unpub_date', $modx->getFullTableName('site_content'), "unpub_date > " . time() . "", 'unpub_date ASC');
60
-			$limit = $modx->getDatabase()->getRecordCount($rs);
61
-			if($limit < 1) {
62
-				?>
59
+            $rs = $modx->getDatabase()->select('id, pagetitle, unpub_date', $modx->getFullTableName('site_content'), "unpub_date > " . time() . "", 'unpub_date ASC');
60
+            $limit = $modx->getDatabase()->getRecordCount($rs);
61
+            if($limit < 1) {
62
+                ?>
63 63
 				<p><?= $_lang["no_docs_pending_unpublishing"] ?></p>
64 64
 				<?php
65
-			} else {
66
-				?>
65
+            } else {
66
+                ?>
67 67
 				<div class="table-responsive">
68 68
 					<table class="grid sortabletable" id="table-2">
69 69
 						<thead>
@@ -75,34 +75,34 @@  discard block
 block discarded – undo
75 75
 						</thead>
76 76
 						<tbody>
77 77
 						<?php
78
-						while($row = $modx->getDatabase()->getRow($rs)) {
79
-							?>
78
+                        while($row = $modx->getDatabase()->getRow($rs)) {
79
+                            ?>
80 80
 							<tr>
81 81
 								<td class="text-right"><?= $row['id'] ?></td>
82 82
 								<td><a href="index.php?a=3&id=<?= $row['id'] ?>"><?= $row['pagetitle'] ?></a></td>
83 83
 								<td class="text-nowrap text-right"><?= $modx->toDateFormat($row['unpub_date'] + $server_offset_time) ?></td>
84 84
 							</tr>
85 85
 							<?php
86
-						}
87
-						?>
86
+                        }
87
+                        ?>
88 88
 						</tbody>
89 89
 					</table>
90 90
 				</div>
91 91
 				<?php
92
-			}
93
-			?>
92
+            }
93
+            ?>
94 94
 		</div>
95 95
 		<div class="form-group">
96 96
 			<b><?= $_lang["all_events"] ?></b>
97 97
 			<?php
98
-			$rs = $modx->getDatabase()->select('id, pagetitle, pub_date, unpub_date', $modx->getFullTableName('site_content'), "pub_date > 0 OR unpub_date > 0", "pub_date DESC");
99
-			$limit = $modx->getDatabase()->getRecordCount($rs);
100
-			if($limit < 1) {
101
-				?>
98
+            $rs = $modx->getDatabase()->select('id, pagetitle, pub_date, unpub_date', $modx->getFullTableName('site_content'), "pub_date > 0 OR unpub_date > 0", "pub_date DESC");
99
+            $limit = $modx->getDatabase()->getRecordCount($rs);
100
+            if($limit < 1) {
101
+                ?>
102 102
 				<p><?= $_lang["no_docs_pending_pubunpub"] ?></p>
103 103
 				<?php
104
-			} else {
105
-				?>
104
+            } else {
105
+                ?>
106 106
 				<div class="table-responsive">
107 107
 					<table class="grid sortabletable" id="table-3">
108 108
 						<thead>
@@ -115,8 +115,8 @@  discard block
 block discarded – undo
115 115
 						</thead>
116 116
 						<tbody>
117 117
 						<?php
118
-						while($row = $modx->getDatabase()->getRow($rs)) {
119
-							?>
118
+                        while($row = $modx->getDatabase()->getRow($rs)) {
119
+                            ?>
120 120
 							<tr>
121 121
 								<td class="text-right"><?= $row['id'] ?></td>
122 122
 								<td><a href="index.php?a=3&id=<?= $row['id'] ?>"><?= $row['pagetitle'] ?></a></td>
@@ -124,14 +124,14 @@  discard block
 block discarded – undo
124 124
 								<td class="text-nowrap text-right"><?= $row['unpub_date'] == 0 ? "" : $modx->toDateFormat($row['unpub_date'] + $server_offset_time) ?></td>
125 125
 							</tr>
126 126
 							<?php
127
-						}
128
-						?>
127
+                        }
128
+                        ?>
129 129
 						</tbody>
130 130
 					</table>
131 131
 				</div>
132 132
 				<?php
133
-			}
134
-			?>
133
+            }
134
+            ?>
135 135
 		</div>
136 136
 	</div>
137 137
 </div>
Please login to merge, or discard this patch.
manager/actions/welcome.static.php 1 patch
Indentation   +144 added lines, -144 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@  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
 unset($_SESSION['itemname']); // clear this, because it's only set for logging purposes
7 7
 
8 8
 if($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) {
9
-	// seems to be a new install - send the user to the configuration page
10
-	exit('<script type="text/javascript">document.location.href="index.php?a=17";</script>');
9
+    // seems to be a new install - send the user to the configuration page
10
+    exit('<script type="text/javascript">document.location.href="index.php?a=17";</script>');
11 11
 }
12 12
 
13 13
 // set placeholders
@@ -17,93 +17,93 @@  discard block
 block discarded – undo
17 17
 
18 18
 // setup message info
19 19
 if($modx->hasPermission('messages')) {
20
-	include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php');
21
-	$_SESSION['nrtotalmessages'] = $nrtotalmessages;
22
-	$_SESSION['nrnewmessages'] = $nrnewmessages;
23
-
24
-	$msg = array();
25
-	$msg[] = sprintf('<a href="index.php?a=10" target="main"><img src="%s" /></a>', $_style['icons_mail_large']);
26
-	$nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? ' (<span style="color:red">' . $_SESSION['nrnewmessages'] . '</span>)' : '';
27
-	$msg[] = sprintf('<span style="color:#909090;font-size:15px;font-weight:bold">&nbsp;<a class="wm_messages_inbox_link" href="index.php?a=10" target="main">[%%inbox%%]</a>%s</span><br />', $nrnewmessages);
28
-	$nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? '<span style="color:red;">' . $_SESSION['nrnewmessages'] . '</span>' : '0';
29
-	$welcome_messages = sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages);
30
-	$msg[] = sprintf('<span class="comment">%s</span>', $welcome_messages);
31
-	$ph['MessageInfo'] = implode("\n", $msg);
20
+    include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php');
21
+    $_SESSION['nrtotalmessages'] = $nrtotalmessages;
22
+    $_SESSION['nrnewmessages'] = $nrnewmessages;
23
+
24
+    $msg = array();
25
+    $msg[] = sprintf('<a href="index.php?a=10" target="main"><img src="%s" /></a>', $_style['icons_mail_large']);
26
+    $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? ' (<span style="color:red">' . $_SESSION['nrnewmessages'] . '</span>)' : '';
27
+    $msg[] = sprintf('<span style="color:#909090;font-size:15px;font-weight:bold">&nbsp;<a class="wm_messages_inbox_link" href="index.php?a=10" target="main">[%%inbox%%]</a>%s</span><br />', $nrnewmessages);
28
+    $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? '<span style="color:red;">' . $_SESSION['nrnewmessages'] . '</span>' : '0';
29
+    $welcome_messages = sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages);
30
+    $msg[] = sprintf('<span class="comment">%s</span>', $welcome_messages);
31
+    $ph['MessageInfo'] = implode("\n", $msg);
32 32
 }
33 33
 
34 34
 $iconTpl = $modx->getChunk('manager#welcome\WrapIcon');
35 35
 // setup icons
36 36
 if($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) {
37
-	$icon = '<i class="[&icons_security_large&]" alt="[%user_management_title%]"> </i>[%user_management_title%]';
38
-	$ph['SecurityIcon'] = sprintf($iconTpl,$icon, 75);
37
+    $icon = '<i class="[&icons_security_large&]" alt="[%user_management_title%]"> </i>[%user_management_title%]';
38
+    $ph['SecurityIcon'] = sprintf($iconTpl,$icon, 75);
39 39
 }
40 40
 if($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) {
41
-	$icon = '<i class="[&icons_webusers_large&]" alt="[%web_user_management_title%]"> </i>[%web_user_management_title%]';
42
-	$ph['WebUserIcon'] = sprintf($iconTpl,$icon, 99);
41
+    $icon = '<i class="[&icons_webusers_large&]" alt="[%web_user_management_title%]"> </i>[%web_user_management_title%]';
42
+    $ph['WebUserIcon'] = sprintf($iconTpl,$icon, 99);
43 43
 }
44 44
 if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) {
45
-	$icon = '<i class="[&icons_modules_large&]" alt="[%manage_modules%]"> </i>[%modules%]';
46
-	$ph['ModulesIcon'] = sprintf($iconTpl,$icon, 106);
45
+    $icon = '<i class="[&icons_modules_large&]" alt="[%manage_modules%]"> </i>[%modules%]';
46
+    $ph['ModulesIcon'] = sprintf($iconTpl,$icon, 106);
47 47
 }
48 48
 if($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) {
49
-	$icon = '<i class="[&icons_resources_large&]" alt="[%element_management%]"> </i>[%elements%]';
50
-	$ph['ResourcesIcon'] = sprintf($iconTpl,$icon, 76);
49
+    $icon = '<i class="[&icons_resources_large&]" alt="[%element_management%]"> </i>[%elements%]';
50
+    $ph['ResourcesIcon'] = sprintf($iconTpl,$icon, 76);
51 51
 }
52 52
 if($modx->hasPermission('bk_manager')) {
53
-	$icon = '<i class="[&icons_backup_large&]" alt="[%bk_manager%]"> </i>[%backup%]';
54
-	$ph['BackupIcon'] = sprintf($iconTpl,$icon, 93);
53
+    $icon = '<i class="[&icons_backup_large&]" alt="[%bk_manager%]"> </i>[%backup%]';
54
+    $ph['BackupIcon'] = sprintf($iconTpl,$icon, 93);
55 55
 }
56 56
 if($modx->hasPermission('help')) {
57
-	$icon = '<i class="[&icons_help_large&]" alt="[%help%]" /> </i>[%help%]';
58
-	$ph['HelpIcon'] = sprintf($iconTpl,$icon, 9);
57
+    $icon = '<i class="[&icons_help_large&]" alt="[%help%]" /> </i>[%help%]';
58
+    $ph['HelpIcon'] = sprintf($iconTpl,$icon, 9);
59 59
 }
60 60
 
61 61
 if($modx->hasPermission('new_document')) {
62
-	$icon = '<i class="[&icons_resource_large&]"></i>[%add_resource%]';
63
-	$ph['ResourceIcon'] = sprintf($iconTpl,$icon, 4);
64
-	$icon = '<i class="[&icons_weblink_large&]"></i>[%add_weblink%]';
65
-	$ph['WeblinkIcon'] = sprintf($iconTpl,$icon, 72);
62
+    $icon = '<i class="[&icons_resource_large&]"></i>[%add_resource%]';
63
+    $ph['ResourceIcon'] = sprintf($iconTpl,$icon, 4);
64
+    $icon = '<i class="[&icons_weblink_large&]"></i>[%add_weblink%]';
65
+    $ph['WeblinkIcon'] = sprintf($iconTpl,$icon, 72);
66 66
 }
67 67
 if($modx->hasPermission('assets_images')) {
68
-	$icon = '<i class="[&icons_images_large&]"></i>[%images_management%]';
69
-	$ph['ImagesIcon'] = sprintf($iconTpl,$icon, 72);
68
+    $icon = '<i class="[&icons_images_large&]"></i>[%images_management%]';
69
+    $ph['ImagesIcon'] = sprintf($iconTpl,$icon, 72);
70 70
 }
71 71
 if($modx->hasPermission('assets_files')) {
72
-	$icon = '<i class="[&icons_files_large&]"></i>[%files_management%]';
73
-	$ph['FilesIcon'] = sprintf($iconTpl,$icon, 72);
72
+    $icon = '<i class="[&icons_files_large&]"></i>[%files_management%]';
73
+    $ph['FilesIcon'] = sprintf($iconTpl,$icon, 72);
74 74
 }
75 75
 if($modx->hasPermission('change_password')) {
76
-	$icon = '<i class="[&icons_password_large&]"></i>[%change_password%]';
77
-	$ph['PasswordIcon'] = sprintf($iconTpl,$icon, 28);
76
+    $icon = '<i class="[&icons_password_large&]"></i>[%change_password%]';
77
+    $ph['PasswordIcon'] = sprintf($iconTpl,$icon, 28);
78 78
 }
79 79
 $icon = '<i class="[&icons_logout_large&]"></i>[%logout%]';
80 80
 $ph['LogoutIcon'] = sprintf($iconTpl,$icon, 8);
81 81
 
82 82
 // do some config checks
83 83
 if(($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) {
84
-	include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php');
85
-	if($config_check_results != $_lang['configcheck_ok']) {
86
-		$ph['config_check_results'] = $config_check_results;
87
-		$ph['config_display'] = 'block';
88
-	} else {
89
-		$ph['config_display'] = 'none';
90
-	}
84
+    include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php');
85
+    if($config_check_results != $_lang['configcheck_ok']) {
86
+        $ph['config_check_results'] = $config_check_results;
87
+        $ph['config_display'] = 'block';
88
+    } else {
89
+        $ph['config_display'] = 'none';
90
+    }
91 91
 } else {
92
-	$ph['config_display'] = 'none';
92
+    $ph['config_display'] = 'none';
93 93
 }
94 94
 
95 95
 // Check logout-reminder
96 96
 if(isset($_SESSION['show_logout_reminder'])) {
97
-	switch($_SESSION['show_logout_reminder']['type']) {
98
-		case 'logout_reminder':
99
-			$date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly');
100
-			$ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']);
101
-			break;
102
-	}
103
-	$ph['show_logout_reminder'] = 'block';
104
-	unset($_SESSION['show_logout_reminder']);
97
+    switch($_SESSION['show_logout_reminder']['type']) {
98
+        case 'logout_reminder':
99
+            $date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly');
100
+            $ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']);
101
+            break;
102
+    }
103
+    $ph['show_logout_reminder'] = 'block';
104
+    unset($_SESSION['show_logout_reminder']);
105 105
 } else {
106
-	$ph['show_logout_reminder'] = 'none';
106
+    $ph['show_logout_reminder'] = 'none';
107 107
 }
108 108
 
109 109
 // Check multiple sessions
@@ -151,11 +151,11 @@  discard block
 block discarded – undo
151 151
 $nrnewmessages = '<span class="text-danger">' . $_SESSION['nrnewmessages'] . '</span>';
152 152
 
153 153
 $ph['UserInfo'] = $modx->parseText($tpl, array(
154
-	'username' => $modx->getLoginUserName(),
155
-	'role' => $_SESSION['mgrPermissions']['name'],
156
-	'lastlogin' => $modx->toDateFormat($_SESSION['mgrLastlogin'] + $server_offset_time),
157
-	'logincount' => $_SESSION['mgrLogincount'] + 1,
158
-	'msginfo' => sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages)
154
+    'username' => $modx->getLoginUserName(),
155
+    'role' => $_SESSION['mgrPermissions']['name'],
156
+    'lastlogin' => $modx->toDateFormat($_SESSION['mgrLastlogin'] + $server_offset_time),
157
+    'logincount' => $_SESSION['mgrLogincount'] + 1,
158
+    'msginfo' => sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages)
159 159
 ));
160 160
 
161 161
 $from = array();
@@ -164,13 +164,13 @@  discard block
 block discarded – undo
164 164
 $rs = $modx->getDatabase()->select('*', $from, '', 'username ASC, au.sid ASC');
165 165
 
166 166
 if($modx->getDatabase()->getRecordCount($rs) < 1) {
167
-	$html = '<p>[%no_active_users_found%]</p>';
167
+    $html = '<p>[%no_active_users_found%]</p>';
168 168
 } else {
169
-	include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php');
170
-	$now = $_SERVER['REQUEST_TIME'] + $server_offset_time;
171
-	$ph['now'] = strftime('%H:%M:%S', $now);
172
-	$timetocheck = ($now - (60 * 20)); //+$server_offset_time;
173
-	$html = '
169
+    include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php');
170
+    $now = $_SERVER['REQUEST_TIME'] + $server_offset_time;
171
+    $ph['now'] = strftime('%H:%M:%S', $now);
172
+    $timetocheck = ($now - (60 * 20)); //+$server_offset_time;
173
+    $html = '
174 174
 	<div class="card-body">
175 175
 		[%onlineusers_message%] 
176 176
 		<b>[+now+]</b>):
@@ -188,33 +188,33 @@  discard block
 block discarded – undo
188 188
 	</thead>
189 189
 	<tbody>';
190 190
 
191
-	$userList = array();
192
-	$userCount = array();
193
-	// Create userlist with session-count first before output
194
-	while($activeusers = $modx->getDatabase()->getRow($rs)) {
195
-		$userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1;
196
-
197
-		$idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : '';
198
-		$webicon = $activeusers['internalKey'] < 0 ? '<img src="[&tree_globe&]" alt="Web user" />&nbsp;' : '';
199
-		$ip = $activeusers['ip'] === '::1' ? '127.0.0.1' : $activeusers['ip'];
200
-		$currentaction = getAction($activeusers['action'], $activeusers['id']);
201
-		$userList[] = array(
202
-			$idle,
203
-			'',
204
-			$activeusers['username'],
205
-			$webicon,
206
-			abs($activeusers['internalKey']),
207
-			$ip,
208
-			strftime('%H:%M:%S', $activeusers['lasthit'] + $server_offset_time),
209
-			$currentaction
210
-		);
211
-	}
212
-	foreach($userList as $params) {
213
-		$params[1] = $userCount[$params[4]] > 1 ? ' class="userMultipleSessions"' : '';
214
-		$html .= "\n\t\t" . vsprintf('<tr%s><td><strong%s>%s</strong></td><td>%s%s</td><td>%s</td><td>%s</td><td>%s</td></tr>', $params);
215
-	}
216
-
217
-	$html .= '
191
+    $userList = array();
192
+    $userCount = array();
193
+    // Create userlist with session-count first before output
194
+    while($activeusers = $modx->getDatabase()->getRow($rs)) {
195
+        $userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1;
196
+
197
+        $idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : '';
198
+        $webicon = $activeusers['internalKey'] < 0 ? '<img src="[&tree_globe&]" alt="Web user" />&nbsp;' : '';
199
+        $ip = $activeusers['ip'] === '::1' ? '127.0.0.1' : $activeusers['ip'];
200
+        $currentaction = getAction($activeusers['action'], $activeusers['id']);
201
+        $userList[] = array(
202
+            $idle,
203
+            '',
204
+            $activeusers['username'],
205
+            $webicon,
206
+            abs($activeusers['internalKey']),
207
+            $ip,
208
+            strftime('%H:%M:%S', $activeusers['lasthit'] + $server_offset_time),
209
+            $currentaction
210
+        );
211
+    }
212
+    foreach($userList as $params) {
213
+        $params[1] = $userCount[$params[4]] > 1 ? ' class="userMultipleSessions"' : '';
214
+        $html .= "\n\t\t" . vsprintf('<tr%s><td><strong%s>%s</strong></td><td>%s%s</td><td>%s</td><td>%s</td><td>%s</td></tr>', $params);
215
+    }
216
+
217
+    $html .= '
218 218
 	</tbody>
219 219
 	</table>
220 220
 </div>
@@ -255,17 +255,17 @@  discard block
 block discarded – undo
255 255
 // invoke event OnManagerWelcomePrerender
256 256
 $evtOut = $modx->invokeEvent('OnManagerWelcomePrerender');
257 257
 if(is_array($evtOut)) {
258
-	$output = implode('', $evtOut);
259
-	$ph['OnManagerWelcomePrerender'] = $output;
258
+    $output = implode('', $evtOut);
259
+    $ph['OnManagerWelcomePrerender'] = $output;
260 260
 }
261 261
 
262 262
 $widgets['welcome'] = array(
263
-	'menuindex' => '10',
264
-	'id' => 'welcome',
265
-	'cols' => 'col-lg-6',
266
-	'icon' => 'fa-home',
267
-	'title' => '[%welcome_title%]',
268
-	'body' => '
263
+    'menuindex' => '10',
264
+    'id' => 'welcome',
265
+    'cols' => 'col-lg-6',
266
+    'icon' => 'fa-home',
267
+    'title' => '[%welcome_title%]',
268
+    'body' => '
269 269
 				<div class="wm_buttons card-body"> 
270 270
 					<!--@IF:[[#hasPermission?key=new_document]]--> 
271 271
 					<span class="wm_button">
@@ -339,25 +339,25 @@  discard block
 block discarded – undo
339 339
 					</table>
340 340
 				</div>
341 341
 		',
342
-	'hide'=>'0'
342
+    'hide'=>'0'
343 343
 );
344 344
 $widgets['onlineinfo'] = array(
345
-	'menuindex' => '20',
346
-	'id' => 'onlineinfo',
347
-	'cols' => 'col-lg-6',
348
-	'icon' => 'fa-user',
349
-	'title' => '[%onlineusers_title%]',
350
-	'body' => '<div class="userstable">[+OnlineInfo+]</div>',
351
-	'hide'=>'0'
345
+    'menuindex' => '20',
346
+    'id' => 'onlineinfo',
347
+    'cols' => 'col-lg-6',
348
+    'icon' => 'fa-user',
349
+    'title' => '[%onlineusers_title%]',
350
+    'body' => '<div class="userstable">[+OnlineInfo+]</div>',
351
+    'hide'=>'0'
352 352
 );
353 353
 $widgets['recentinfo'] = array(
354
-	'menuindex' => '30',
355
-	'id' => 'modxrecent_widget',
356
-	'cols' => 'col-sm-12',
357
-	'icon' => 'fa-pencil-square-o',
358
-	'title' => '[%activity_title%]',
359
-	'body' => '<div class="widget-stage">[+RecentInfo+]</div>',
360
-	'hide'=>'0'
354
+    'menuindex' => '30',
355
+    'id' => 'modxrecent_widget',
356
+    'cols' => 'col-sm-12',
357
+    'icon' => 'fa-pencil-square-o',
358
+    'title' => '[%activity_title%]',
359
+    'body' => '<div class="widget-stage">[+RecentInfo+]</div>',
360
+    'hide'=>'0'
361 361
 );
362 362
 if ($modx->config['rss_url_news']) {
363 363
     $widgets['news'] = array(
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
 // invoke OnManagerWelcomeHome event
386 386
 $sitewidgets = $modx->invokeEvent("OnManagerWelcomeHome", array('widgets' => $widgets));
387 387
 if(is_array($sitewidgets)) {
388
-	$newwidgets = array();
388
+    $newwidgets = array();
389 389
     foreach($sitewidgets as $widget){
390 390
         $newwidgets = array_merge($newwidgets, unserialize($widget));
391 391
     }
@@ -393,21 +393,21 @@  discard block
 block discarded – undo
393 393
 }
394 394
 
395 395
 usort($widgets, function ($a, $b) {
396
-	return $a['menuindex'] - $b['menuindex'];
396
+    return $a['menuindex'] - $b['menuindex'];
397 397
 });
398 398
 
399 399
 $tpl = $modx->getChunk('manager#welcome\Widget');
400 400
 $output = '';
401 401
 foreach($widgets as $widget) {
402
-	if ($widget['hide'] != '1'){
403
-		$output .= $modx->parseText($tpl, $widget);
404
-	}
402
+    if ($widget['hide'] != '1'){
403
+        $output .= $modx->parseText($tpl, $widget);
404
+    }
405 405
 }
406 406
 $ph['widgets'] = $output;
407 407
 
408 408
 // load template
409 409
 if(!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) {
410
-	$modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl';
410
+    $modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl';
411 411
 }
412 412
 
413 413
 $target = $modx->config['manager_welcome_tpl'];
@@ -415,27 +415,27 @@  discard block
 block discarded – undo
415 415
 $target = $modx->mergeSettingsContent($target);
416 416
 
417 417
 if(substr($target, 0, 1) === '@') {
418
-	if(substr($target, 0, 6) === '@CHUNK') {
419
-		$content = $modx->getChunk(trim(substr($target, 7)));
420
-	} elseif(substr($target, 0, 5) === '@FILE') {
421
-		$content = file_get_contents(trim(substr($target, 6)));
422
-	} else {
423
-		$content = '';
424
-	}
418
+    if(substr($target, 0, 6) === '@CHUNK') {
419
+        $content = $modx->getChunk(trim(substr($target, 7)));
420
+    } elseif(substr($target, 0, 5) === '@FILE') {
421
+        $content = file_get_contents(trim(substr($target, 6)));
422
+    } else {
423
+        $content = '';
424
+    }
425 425
 } else {
426
-	$chunk = $modx->getChunk($target);
427
-	if($chunk !== false && !empty($chunk)) {
428
-		$content = $chunk;
429
-	} elseif(is_file(MODX_BASE_PATH . $target)) {
430
-		$content = file_get_contents(MODX_BASE_PATH . $target);
431
-	} elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) {
432
-		$content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl');
433
-	} elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) // ClipperCMS compatible
434
-	{
435
-		$content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html');
436
-	} else {
437
-		$content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl');
438
-	}
426
+    $chunk = $modx->getChunk($target);
427
+    if($chunk !== false && !empty($chunk)) {
428
+        $content = $chunk;
429
+    } elseif(is_file(MODX_BASE_PATH . $target)) {
430
+        $content = file_get_contents(MODX_BASE_PATH . $target);
431
+    } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) {
432
+        $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl');
433
+    } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) // ClipperCMS compatible
434
+    {
435
+        $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html');
436
+    } else {
437
+        $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl');
438
+    }
439 439
 }
440 440
 
441 441
 // merge placeholders
@@ -443,8 +443,8 @@  discard block
 block discarded – undo
443 443
 $content = $modx->mergeSettingsContent($content);
444 444
 $content = $modx->parseText($content, $ph);
445 445
 if(strpos($content, '[+') !== false) {
446
-	$modx->toPlaceholders($ph);
447
-	$content = $modx->mergePlaceholderContent($content);
446
+    $modx->toPlaceholders($ph);
447
+    $content = $modx->mergePlaceholderContent($content);
448 448
 }
449 449
 $content = $modx->parseDocumentSource($content);
450 450
 $content = $modx->parseText($content, $_lang, '[%', '%]');
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
 $content = $modx->cleanUpMODXTags($content); //cleanup
453 453
 
454 454
 if($js = $modx->getRegisteredClientScripts()) {
455
-	$content .= $js;
455
+    $content .= $js;
456 456
 }
457 457
 
458 458
 echo $content;
Please login to merge, or discard this patch.
manager/actions/search.static.php 1 patch
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -113,31 +113,31 @@
 block discarded – undo
113 113
     // Handle Input "Search in main fields"
114 114
     if ($searchfields != '') {
115 115
 
116
-		/*start search by TV. Added Rising13*/
117
-		$tbl_site_tmplvar_contentvalues = $modx->getFullTableName('site_tmplvar_contentvalues');
118
-		$articul_query = "SELECT `contentid` FROM {$tbl_site_tmplvar_contentvalues} WHERE `value` LIKE '%{$searchfields}%'";
119
-		$articul_result = $modx->getDatabase()->query($articul_query);
120
-		$articul_id_array = $modx->getDatabase()->makeArray($articul_result);
121
-		if(count($articul_id_array)>0){
122
-			$articul_id = '';
123
-			$i = 1;
124
-			foreach( $articul_id_array as $articul ) {
125
-				$articul_id.=$articul['contentid'];
126
-				if($i !== count($articul_id_array)){
127
-					$articul_id.=',';
128
-				}
129
-				$i++;
130
-			}
131
-		$articul_id_query = " OR sc.id IN ({$articul_id})";
132
-		}else{
133
-			$articul_id_query = '';
134
-		}
135
-		/*end search by TV*/
116
+        /*start search by TV. Added Rising13*/
117
+        $tbl_site_tmplvar_contentvalues = $modx->getFullTableName('site_tmplvar_contentvalues');
118
+        $articul_query = "SELECT `contentid` FROM {$tbl_site_tmplvar_contentvalues} WHERE `value` LIKE '%{$searchfields}%'";
119
+        $articul_result = $modx->getDatabase()->query($articul_query);
120
+        $articul_id_array = $modx->getDatabase()->makeArray($articul_result);
121
+        if(count($articul_id_array)>0){
122
+            $articul_id = '';
123
+            $i = 1;
124
+            foreach( $articul_id_array as $articul ) {
125
+                $articul_id.=$articul['contentid'];
126
+                if($i !== count($articul_id_array)){
127
+                    $articul_id.=',';
128
+                }
129
+                $i++;
130
+            }
131
+        $articul_id_query = " OR sc.id IN ({$articul_id})";
132
+        }else{
133
+            $articul_id_query = '';
134
+        }
135
+        /*end search by TV*/
136 136
 
137 137
         if (ctype_digit($searchfields)) {
138 138
             $sqladd .= "sc.id='{$searchfields}'";
139 139
             if (strlen($searchfields) > 3) {
140
-				$sqladd .= $articul_id_query;//search by TV
140
+                $sqladd .= $articul_id_query;//search by TV
141 141
                 $sqladd .= " OR sc.pagetitle LIKE '%{$searchfields}%'";
142 142
             }
143 143
         }
Please login to merge, or discard this patch.
manager/actions/mutate_user.dynamic.php 1 patch
Indentation   +155 added lines, -155 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->getManagerApi()->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,79 +23,79 @@  discard block
 block discarded – undo
23 23
 // check to see the snippet editor isn't locked
24 24
 $rs = $modx->getDatabase()->select('username', $modx->getFullTableName('active_users'), "action=12 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'");
25 25
 if($username = $modx->getDatabase()->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->getManagerApi()->action == '12') {
31
-	// get user attribute
32
-	$rs = $modx->getDatabase()->select('*', $modx->getFullTableName('user_attributes'), "internalKey = '{$user}'");
33
-	$userdata = $modx->getDatabase()->getRow($rs);
34
-	if(!$userdata) {
35
-		$modx->webAlertAndQuit("No user returned!");
36
-	}
31
+    // get user attribute
32
+    $rs = $modx->getDatabase()->select('*', $modx->getFullTableName('user_attributes'), "internalKey = '{$user}'");
33
+    $userdata = $modx->getDatabase()->getRow($rs);
34
+    if(!$userdata) {
35
+        $modx->webAlertAndQuit("No user returned!");
36
+    }
37 37
 
38 38
     if($_SESSION['mgrRole'] != 1 && $userdata['role'] == 1) {
39 39
         $modx->webAlertAndQuit('Illegal attempt to create/modify administrator by non-administrator!');
40 40
     }
41 41
 
42 42
 
43
-	// get user settings
44
-	$rs = $modx->getDatabase()->select('*', $modx->getFullTableName('user_settings'), "user = '{$user}'");
45
-	$usersettings = array();
46
-	while($row = $modx->getDatabase()->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value'];
47
-	// manually extract so that user display settings are not overwritten
48
-	foreach($usersettings as $k => $v) {
49
-		if($k != 'manager_language' && $k != 'manager_theme') {
50
-			${$k} = $v;
51
-		}
52
-	}
43
+    // get user settings
44
+    $rs = $modx->getDatabase()->select('*', $modx->getFullTableName('user_settings'), "user = '{$user}'");
45
+    $usersettings = array();
46
+    while($row = $modx->getDatabase()->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value'];
47
+    // manually extract so that user display settings are not overwritten
48
+    foreach($usersettings as $k => $v) {
49
+        if($k != 'manager_language' && $k != 'manager_theme') {
50
+            ${$k} = $v;
51
+        }
52
+    }
53 53
 
54
-	// get user name
55
-	$rs = $modx->getDatabase()->select('*', $modx->getFullTableName('manager_users'), "id = '{$user}'");
56
-	$usernamedata = $modx->getDatabase()->getRow($rs);
57
-	if(!$usernamedata) {
58
-		$modx->webAlertAndQuit("No user returned while getting username!");
59
-	}
60
-	$_SESSION['itemname'] = $usernamedata['username'];
54
+    // get user name
55
+    $rs = $modx->getDatabase()->select('*', $modx->getFullTableName('manager_users'), "id = '{$user}'");
56
+    $usernamedata = $modx->getDatabase()->getRow($rs);
57
+    if(!$usernamedata) {
58
+        $modx->webAlertAndQuit("No user returned while getting username!");
59
+    }
60
+    $_SESSION['itemname'] = $usernamedata['username'];
61 61
 } else {
62
-	$userdata = array();
63
-	$usersettings = array();
64
-	$usernamedata = array();
65
-	$_SESSION['itemname'] = $_lang["new_user"];
62
+    $userdata = array();
63
+    $usersettings = array();
64
+    $usernamedata = array();
65
+    $_SESSION['itemname'] = $_lang["new_user"];
66 66
 }
67 67
 
68 68
 // avoid doubling htmlspecialchars (already encoded in DB)
69 69
 foreach($userdata as $key => $val) {
70
-	$userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']);
70
+    $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']);
71 71
 };
72 72
 $usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']);
73 73
 
74 74
 // restore saved form
75 75
 $formRestored = false;
76 76
 if($modx->getManagerApi()->hasFormValues()) {
77
-	$modx->getManagerApi()->loadFormValues();
78
-	// restore post values
79
-	$userdata = array_merge($userdata, $_POST);
80
-	$userdata['dob'] = $modx->toTimeStamp($userdata['dob']);
81
-	$usernamedata['username'] = $userdata['newusername'];
82
-	$usernamedata['oldusername'] = $_POST['oldusername'];
83
-	$usersettings = array_merge($usersettings, $userdata);
84
-	$usersettings['allowed_days'] = is_array($_POST['allowed_days']) ? implode(",", $_POST['allowed_days']) : "";
85
-	extract($usersettings, EXTR_OVERWRITE);
77
+    $modx->getManagerApi()->loadFormValues();
78
+    // restore post values
79
+    $userdata = array_merge($userdata, $_POST);
80
+    $userdata['dob'] = $modx->toTimeStamp($userdata['dob']);
81
+    $usernamedata['username'] = $userdata['newusername'];
82
+    $usernamedata['oldusername'] = $_POST['oldusername'];
83
+    $usersettings = array_merge($usersettings, $userdata);
84
+    $usersettings['allowed_days'] = is_array($_POST['allowed_days']) ? implode(",", $_POST['allowed_days']) : "";
85
+    extract($usersettings, EXTR_OVERWRITE);
86 86
 }
87 87
 
88 88
 // include the country list language file
89 89
 $_country_lang = array();
90 90
 include_once "lang/country/english_country.inc.php";
91 91
 if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) {
92
-	include_once "lang/country/" . $manager_language . "_country.inc.php";
92
+    include_once "lang/country/" . $manager_language . "_country.inc.php";
93 93
 }
94 94
 asort($_country_lang);
95 95
 
96 96
 $displayStyle = ($_SESSION['browser'] === 'modern') ? 'table-row' : 'block';
97 97
 if($which_browser == 'default') {
98
-	$which_browser = $modx->configGlobal['which_browser'] ? $modx->configGlobal['which_browser'] : $modx->config['which_browser'];
98
+    $which_browser = $modx->configGlobal['which_browser'] ? $modx->configGlobal['which_browser'] : $modx->config['which_browser'];
99 99
 }
100 100
 ?>
101 101
 <script type="text/javascript">
@@ -205,14 +205,14 @@  discard block
 block discarded – undo
205 205
 <form action="index.php?a=32" method="post" name="userform">
206 206
 	<?php
207 207
 
208
-	// invoke OnUserFormPrerender event
209
-	$evtOut = $modx->invokeEvent("OnUserFormPrerender", array(
210
-		"id" => $user
211
-	));
212
-	if(is_array($evtOut)) {
213
-		echo implode("", $evtOut);
214
-	}
215
-	?>
208
+    // invoke OnUserFormPrerender event
209
+    $evtOut = $modx->invokeEvent("OnUserFormPrerender", array(
210
+        "id" => $user
211
+    ));
212
+    if(is_array($evtOut)) {
213
+        echo implode("", $evtOut);
214
+    }
215
+    ?>
216 216
 	<input type="hidden" name="mode" value="<?php echo $modx->getManagerApi()->action; ?>">
217 217
 	<input type="hidden" name="id" value="<?php echo $user ?>">
218 218
 	<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" ?>" />
@@ -305,21 +305,21 @@  discard block
 block discarded – undo
305 305
 						<td>&nbsp;</td>
306 306
 						<td><?php
307 307
 
308
-							$rs = $modx->getDatabase()->select('name, id', '[+prefix+]user_roles', ($modx->hasPermission('save_role')) ? '' : 'id != 1');
309
-							?>
308
+                            $rs = $modx->getDatabase()->select('name, id', '[+prefix+]user_roles', ($modx->hasPermission('save_role')) ? '' : 'id != 1');
309
+                            ?>
310 310
 							<select name="role" class="inputBox" onChange='documentDirty=true;' style="width:300px">
311 311
 								<?php
312
-								while($row = $modx->getDatabase()->getRow($rs)) {
313
-									if($modx->getManagerApi()->action == '11') {
314
-										$selectedtext = $row['id'] == '1' ? ' selected="selected"' : '';
315
-									} else {
316
-										$selectedtext = $row['id'] == $userdata['role'] ? "selected='selected'" : '';
317
-									}
318
-									?>
312
+                                while($row = $modx->getDatabase()->getRow($rs)) {
313
+                                    if($modx->getManagerApi()->action == '11') {
314
+                                        $selectedtext = $row['id'] == '1' ? ' selected="selected"' : '';
315
+                                    } else {
316
+                                        $selectedtext = $row['id'] == $userdata['role'] ? "selected='selected'" : '';
317
+                                    }
318
+                                    ?>
319 319
 									<option value="<?php echo $row['id']; ?>"<?php echo $selectedtext; ?>><?php echo $row['name']; ?></option>
320 320
 									<?php
321
-								}
322
-								?>
321
+                                }
322
+                                ?>
323 323
 							</select></td>
324 324
 					</tr>
325 325
 					<tr>
@@ -364,10 +364,10 @@  discard block
 block discarded – undo
364 364
 								<?php $chosenCountry = isset($_POST['country']) ? $_POST['country'] : $userdata['country']; ?>
365 365
 								<option value="" <?php (!isset($chosenCountry) ? ' selected' : '') ?> >&nbsp;</option>
366 366
 								<?php
367
-								foreach($_country_lang as $key => $country) {
368
-									echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>";
369
-								}
370
-								?>
367
+                                foreach($_country_lang as $key => $country) {
368
+                                    echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>";
369
+                                }
370
+                                ?>
371 371
 							</select></td>
372 372
 					</tr>
373 373
 					<tr>
@@ -443,21 +443,21 @@  discard block
 block discarded – undo
443 443
 						<td><select name="manager_language" class="inputBox" onChange="documentDirty=true">
444 444
 								<option value=""></option>
445 445
 								<?php
446
-								$activelang = !empty($usersettings['manager_language']) ? $usersettings['manager_language'] : '';
447
-								$dir = dir("includes/lang");
448
-								while($file = $dir->read()) {
449
-									if(strpos($file, ".inc.php") > 0) {
450
-										$endpos = strpos($file, ".");
451
-										$languagename = substr($file, 0, $endpos);
452
-										$selectedtext = $languagename == $activelang ? "selected='selected'" : "";
453
-										?>
446
+                                $activelang = !empty($usersettings['manager_language']) ? $usersettings['manager_language'] : '';
447
+                                $dir = dir("includes/lang");
448
+                                while($file = $dir->read()) {
449
+                                    if(strpos($file, ".inc.php") > 0) {
450
+                                        $endpos = strpos($file, ".");
451
+                                        $languagename = substr($file, 0, $endpos);
452
+                                        $selectedtext = $languagename == $activelang ? "selected='selected'" : "";
453
+                                        ?>
454 454
 										<option value="<?php echo $languagename; ?>" <?php echo $selectedtext; ?>><?php echo ucwords(str_replace("_", " ", $languagename)); ?></option>
455 455
 										<?php
456 456
 
457
-									}
458
-								}
459
-								$dir->close();
460
-								?>
457
+                                    }
458
+                                }
459
+                                $dir->close();
460
+                                ?>
461 461
 							</select></td>
462 462
 					</tr>
463 463
 					<tr>
@@ -532,22 +532,22 @@  discard block
 block discarded – undo
532 532
 						<td><select name="manager_theme" class="inputBox" onChange="documentDirty=true;document.userform.theme_refresher.value = Date.parse(new Date());">
533 533
 								<option value=""></option>
534 534
 								<?php
535
-								$dir = dir("media/style/");
536
-								while($file = $dir->read()) {
537
-									if($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') {
538
-										$themename = $file;
539
-										if($themename === 'common') {
540
-											continue;
541
-										}
542
-										$attr = 'value="' . $themename . '" ';
543
-										if(isset($usersettings['manager_theme']) && $themename == $usersettings['manager_theme']) {
544
-											$attr .= 'selected="selected" ';
545
-										}
546
-										echo "\t\t<option " . rtrim($attr) . '>' . ucwords(str_replace("_", " ", $themename)) . "</option>\n";
547
-									}
548
-								}
549
-								$dir->close();
550
-								?>
535
+                                $dir = dir("media/style/");
536
+                                while($file = $dir->read()) {
537
+                                    if($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') {
538
+                                        $themename = $file;
539
+                                        if($themename === 'common') {
540
+                                            continue;
541
+                                        }
542
+                                        $attr = 'value="' . $themename . '" ';
543
+                                        if(isset($usersettings['manager_theme']) && $themename == $usersettings['manager_theme']) {
544
+                                            $attr .= 'selected="selected" ';
545
+                                        }
546
+                                        echo "\t\t<option " . rtrim($attr) . '>' . ucwords(str_replace("_", " ", $themename)) . "</option>\n";
547
+                                    }
548
+                                }
549
+                                $dir->close();
550
+                                ?>
551 551
 							</select>
552 552
 							<input type="hidden" name="theme_refresher" value=""></td>
553 553
 					</tr>
@@ -583,15 +583,15 @@  discard block
 block discarded – undo
583 583
 						<th><?php echo $_lang["which_browser_title"] ?></th>
584 584
 						<td><select name="which_browser" class="inputBox" onChange="documentDirty=true;">
585 585
 								<?php
586
-								$selected = 'default' == $usersettings['which_browser'] || !$usersettings['which_browser'] ? ' selected="selected"' : '';
587
-								echo '<option value="default"' . $selected . '>' . $_lang['option_default'] . "</option>\n";
588
-								foreach(glob("media/browser/*", GLOB_ONLYDIR) as $dir) {
589
-									$dir = str_replace('\\', '/', $dir);
590
-									$browser_name = substr($dir, strrpos($dir, '/') + 1);
591
-									$selected = $browser_name == $usersettings['which_browser'] ? ' selected="selected"' : '';
592
-									echo '<option value="' . $browser_name . '"' . $selected . '>' . "{$browser_name}</option>\n";
593
-								}
594
-								?>
586
+                                $selected = 'default' == $usersettings['which_browser'] || !$usersettings['which_browser'] ? ' selected="selected"' : '';
587
+                                echo '<option value="default"' . $selected . '>' . $_lang['option_default'] . "</option>\n";
588
+                                foreach(glob("media/browser/*", GLOB_ONLYDIR) as $dir) {
589
+                                    $dir = str_replace('\\', '/', $dir);
590
+                                    $browser_name = substr($dir, strrpos($dir, '/') + 1);
591
+                                    $selected = $browser_name == $usersettings['which_browser'] ? ' selected="selected"' : '';
592
+                                    echo '<option value="' . $browser_name . '"' . $selected . '>' . "{$browser_name}</option>\n";
593
+                                }
594
+                                ?>
595 595
 							</select></td>
596 596
 					</tr>
597 597
 					<tr>
@@ -668,17 +668,17 @@  discard block
 block discarded – undo
668 668
 								<option value=""></option>
669 669
 								<?php
670 670
 
671
-								$edt = isset ($usersettings["which_editor"]) ? $usersettings["which_editor"] : '';
672
-								// invoke OnRichTextEditorRegister event
673
-								$evtOut = $modx->invokeEvent("OnRichTextEditorRegister");
674
-								echo "<option value='none'" . ($edt == 'none' ? " selected='selected'" : "") . ">" . $_lang["none"] . "</option>\n";
675
-								if(is_array($evtOut)) {
676
-									for($i = 0; $i < count($evtOut); $i++) {
677
-										$editor = $evtOut[$i];
678
-										echo "<option value='$editor'" . ($edt == $editor ? " selected='selected'" : "") . ">$editor</option>\n";
679
-									}
680
-								}
681
-								?>
671
+                                $edt = isset ($usersettings["which_editor"]) ? $usersettings["which_editor"] : '';
672
+                                // invoke OnRichTextEditorRegister event
673
+                                $evtOut = $modx->invokeEvent("OnRichTextEditorRegister");
674
+                                echo "<option value='none'" . ($edt == 'none' ? " selected='selected'" : "") . ">" . $_lang["none"] . "</option>\n";
675
+                                if(is_array($evtOut)) {
676
+                                    for($i = 0; $i < count($evtOut); $i++) {
677
+                                        $editor = $evtOut[$i];
678
+                                        echo "<option value='$editor'" . ($edt == $editor ? " selected='selected'" : "") . ">$editor</option>\n";
679
+                                    }
680
+                                }
681
+                                ?>
682 682
 							</select></td>
683 683
 					</tr>
684 684
 					<tr id='editorRow1' style="display: <?php echo $use_editor == 1 ? $displayStyle : 'none'; ?>">
@@ -711,12 +711,12 @@  discard block
 block discarded – undo
711 711
 					</tr>
712 712
 				</table>
713 713
 				<?php
714
-				// invoke OnInterfaceSettingsRender event
715
-				$evtOut = $modx->invokeEvent("OnInterfaceSettingsRender");
716
-				if(is_array($evtOut)) {
717
-					echo implode("", $evtOut);
718
-				}
719
-				?>
714
+                // invoke OnInterfaceSettingsRender event
715
+                $evtOut = $modx->invokeEvent("OnInterfaceSettingsRender");
716
+                if(is_array($evtOut)) {
717
+                    echo implode("", $evtOut);
718
+                }
719
+                ?>
720 720
 			</div>
721 721
 
722 722
 			<!-- Photo -->
@@ -765,39 +765,39 @@  discard block
 block discarded – undo
765 765
 			</div>
766 766
 			<?php if($use_udperms == 1) {
767 767
 
768
-			$groupsarray = array();
769
-
770
-			if($modx->getManagerApi()->action == '12') { // only do this bit if the user is being edited
771
-				$rs = $modx->getDatabase()->select('user_group', $modx->getFullTableName('member_groups'), "member='{$user}'");
772
-				$groupsarray = $modx->getDatabase()->getColumn('user_group', $rs);
773
-			}
774
-			// retain selected doc groups between post
775
-			if(is_array($_POST['user_groups'])) {
776
-				foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v;
777
-			}
778
-			?>
768
+            $groupsarray = array();
769
+
770
+            if($modx->getManagerApi()->action == '12') { // only do this bit if the user is being edited
771
+                $rs = $modx->getDatabase()->select('user_group', $modx->getFullTableName('member_groups'), "member='{$user}'");
772
+                $groupsarray = $modx->getDatabase()->getColumn('user_group', $rs);
773
+            }
774
+            // retain selected doc groups between post
775
+            if(is_array($_POST['user_groups'])) {
776
+                foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v;
777
+            }
778
+            ?>
779 779
 			<div class="tab-page" id="tabAccess">
780 780
 				<h2 class="tab"><?php echo $_lang["access_permissions"] ?></h2>
781 781
 				<script type="text/javascript">tpUser.addTabPage(document.getElementById("tabAccess"));</script>
782 782
 				<p><?php echo $_lang['access_permissions_user_message'] ?></p>
783 783
 				<?php
784
-				$rs = $modx->getDatabase()->select('name, id', $modx->getFullTableName('membergroup_names'), '', 'name');
785
-				while($row = $modx->getDatabase()->getRow($rs)) {
786
-					echo "<label><input type='checkbox' name='user_groups[]' value='" . $row['id'] . "'" . (in_array($row['id'], $groupsarray) ? " checked='checked'" : "") . " />" . $row['name'] . "</label><br />";
787
-				}
788
-				}
789
-				?>
784
+                $rs = $modx->getDatabase()->select('name, id', $modx->getFullTableName('membergroup_names'), '', 'name');
785
+                while($row = $modx->getDatabase()->getRow($rs)) {
786
+                    echo "<label><input type='checkbox' name='user_groups[]' value='" . $row['id'] . "'" . (in_array($row['id'], $groupsarray) ? " checked='checked'" : "") . " />" . $row['name'] . "</label><br />";
787
+                }
788
+                }
789
+                ?>
790 790
 			</div>
791 791
 		</div>
792 792
 	</div>
793 793
 	<input type="submit" name="save" style="display:none">
794 794
 	<?php
795
-	// invoke OnUserFormRender event
796
-	$evtOut = $modx->invokeEvent("OnUserFormRender", array(
797
-		"id" => $user
798
-	));
799
-	if(is_array($evtOut)) {
800
-		echo implode("", $evtOut);
801
-	}
802
-	?>
795
+    // invoke OnUserFormRender event
796
+    $evtOut = $modx->invokeEvent("OnUserFormRender", array(
797
+        "id" => $user
798
+    ));
799
+    if(is_array($evtOut)) {
800
+        echo implode("", $evtOut);
801
+    }
802
+    ?>
803 803
 </form>
Please login to merge, or discard this patch.