Completed
Push — develop ( dd48c1...053968 )
by Maxim
06:38 queued 01:16
created
manager/actions/mutate_template_tv_rank.dynamic.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if (!$modx->hasPermission('save_template')) {
6 6
     $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
9
+$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0;
10 10
 $reset = isset($_POST['reset']) && $_POST['reset'] == 'true' ? 1 : 0;
11 11
 
12 12
 $tbl_site_templates = $modx->getFullTableName('site_templates');
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 $templatename = '';
20 20
 
21 21
 if (isset($_POST['listSubmitted'])) {
22
-    $updateMsg .= '<div class="text-success" id="updated">' . $_lang['sort_updated'] . '</div>';
22
+    $updateMsg .= '<div class="text-success" id="updated">'.$_lang['sort_updated'].'</div>';
23 23
     foreach ($_POST as $listName => $listValue) {
24 24
         if ($listName == 'listSubmitted' || $listName == 'reset') {
25 25
             continue;
@@ -47,11 +47,11 @@  discard block
 block discarded – undo
47 47
     while ($row = $modx->db->getRow($rs)) {
48 48
         $templatename = $row['templatename'];
49 49
         $caption = $row['caption'] != '' ? $row['caption'] : $row['name'];
50
-        $sortableList .= '<li id="item_' . $row['id'] . '"><i class="fa fa-list-alt"></i> ' . $caption . ' <small class="protectedNode" style="float:right">[*' . $row['name'] . '*]</small></li>';
50
+        $sortableList .= '<li id="item_'.$row['id'].'"><i class="fa fa-list-alt"></i> '.$caption.' <small class="protectedNode" style="float:right">[*'.$row['name'].'*]</small></li>';
51 51
     }
52 52
     $sortableList .= '</ul></div>';
53 53
 } else {
54
-    $updateMsg = '<p class="text-danger">' . $_lang['tmplvars_novars'] . '</p>';
54
+    $updateMsg = '<p class="text-danger">'.$_lang['tmplvars_novars'].'</p>';
55 55
 }
56 56
 ?>
57 57
 
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 </script>
129 129
 
130 130
 <h1>
131
-    <i class="fa fa-sort-numeric-asc"></i><?= ($templatename ? $templatename . '<small>(' . $id . ')</small>' : $_lang['template_tv_edit_title']) ?>
131
+    <i class="fa fa-sort-numeric-asc"></i><?= ($templatename ? $templatename.'<small>('.$id.')</small>' : $_lang['template_tv_edit_title']) ?>
132 132
 </h1>
133 133
 
134 134
 <?= $_style['actionbuttons']['dynamic']['save'] ?>
Please login to merge, or discard this patch.
manager/actions/mutate_templates.dynamic.php 1 patch
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
 	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 
6
-switch($modx->manager->action) {
6
+switch ($modx->manager->action) {
7 7
 	case 16:
8
-		if(!$modx->hasPermission('edit_template')) {
8
+		if (!$modx->hasPermission('edit_template')) {
9 9
 			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
10 10
 		}
11 11
 		break;
12 12
 	case 19:
13
-		if(!$modx->hasPermission('new_template')) {
13
+		if (!$modx->hasPermission('new_template')) {
14 14
 			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
15 15
 		}
16 16
 		break;
@@ -18,12 +18,12 @@  discard block
 block discarded – undo
18 18
 		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
19 19
 }
20 20
 
21
-$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
21
+$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0;
22 22
 
23 23
 $tbl_site_templates = $modx->getFullTableName('site_templates');
24 24
 
25 25
 // check to see the snippet editor isn't locked
26
-if($lockedEl = $modx->elementIsLocked(1, $id)) {
26
+if ($lockedEl = $modx->elementIsLocked(1, $id)) {
27 27
 	$modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['template']));
28 28
 }
29 29
 // end check for lock
@@ -32,23 +32,23 @@  discard block
 block discarded – undo
32 32
 $modx->lockElement(1, $id);
33 33
 
34 34
 $content = array();
35
-if(!empty($id)) {
35
+if (!empty($id)) {
36 36
 	$rs = $modx->db->select('*', $tbl_site_templates, "id='{$id}'");
37 37
 	$content = $modx->db->getRow($rs);
38
-	if(!$content) {
38
+	if (!$content) {
39 39
 		$modx->webAlertAndQuit("No database record has been found for this template.");
40 40
 	}
41 41
 
42 42
 	$_SESSION['itemname'] = $content['templatename'];
43
-	if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
43
+	if ($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
44 44
 		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
45 45
 	}
46 46
 } else {
47 47
 	$_SESSION['itemname'] = $_lang["new_template"];
48
-	$content['category'] = (int)$_REQUEST['catid'];
48
+	$content['category'] = (int) $_REQUEST['catid'];
49 49
 }
50 50
 
51
-if($modx->manager->hasFormValues()) {
51
+if ($modx->manager->hasFormValues()) {
52 52
 	$modx->manager->loadFormValues();
53 53
 }
54 54
 
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 // Add lock-element JS-Script
59 59
 $lockElementId = $id;
60 60
 $lockElementType = 1;
61
-require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php');
61
+require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php');
62 62
 ?>
63 63
 <script type="text/javascript">
64 64
 
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 	<?php
101 101
 	// invoke OnTempFormPrerender event
102 102
 	$evtOut = $modx->invokeEvent("OnTempFormPrerender", array("id" => $id));
103
-	if(is_array($evtOut)) {
103
+	if (is_array($evtOut)) {
104 104
 		echo implode("", $evtOut);
105 105
 	}
106 106
 	?>
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 	<input type="hidden" name="mode" value="<?= $modx->manager->action ?>">
110 110
 
111 111
 	<h1>
112
-		<i class="fa fa-newspaper-o"></i><?= ($content['templatename'] ? $content['templatename'] . '<small>(' . $content['id'] . ')</small>' : $_lang['new_template']) ?><i class="fa fa-question-circle help"></i>
112
+		<i class="fa fa-newspaper-o"></i><?= ($content['templatename'] ? $content['templatename'].'<small>('.$content['id'].')</small>' : $_lang['new_template']) ?><i class="fa fa-question-circle help"></i>
113 113
 	</h1>
114 114
 
115 115
 	<?= $_style['actionbuttons']['dynamic']['element'] ?>
@@ -132,15 +132,15 @@  discard block
 block discarded – undo
132 132
 					<div class="row form-row">
133 133
 						<label class="col-md-3 col-lg-2">
134 134
 							<?= $_lang['template_name'] ?>
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>';
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 137
 							} ?>
138 138
 						</label>
139 139
 						<div class="col-md-9 col-lg-10">
140 140
 							<div class="form-control-name clearfix">
141 141
 								<input name="templatename" type="text" maxlength="100" value="<?= $modx->htmlspecialchars($content['templatename']) ?>" class="form-control form-control-lg" onchange="documentDirty=true;">
142
-								<?php if($modx->hasPermission('save_role')): ?>
143
-									<label class="custom-control" title="<?= $_lang['lock_template'] . "\n" . $_lang['lock_template_msg'] ?>" tooltip>
142
+								<?php if ($modx->hasPermission('save_role')): ?>
143
+									<label class="custom-control" title="<?= $_lang['lock_template']."\n".$_lang['lock_template_msg'] ?>" tooltip>
144 144
 										<input name="locked" type="checkbox"<?= ($content['locked'] == 1 ? ' checked="checked"' : '') ?> />
145 145
 										<i class="fa fa-lock"></i>
146 146
 									</label>
@@ -162,9 +162,9 @@  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->htmlspecialchars($v["category"]) . "</option>";
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->htmlspecialchars($v["category"])."</option>";
168 168
 								}
169 169
 								?>
170 170
 							</select>
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 						</div>
178 178
 					</div>
179 179
 				</div>
180
-				<?php if($modx->hasPermission('save_role')): ?>
180
+				<?php if ($modx->hasPermission('save_role')): ?>
181 181
 					<div class="form-group">
182 182
 						<label>
183 183
 							<input name="selectable" type="checkbox"<?= ($selectable == 1 ? ' checked="checked"' : '') ?> /> <?= $_lang['template_selectable'] ?></label>
@@ -198,30 +198,30 @@  discard block
 block discarded – undo
198 198
 
199 199
 			<?php
200 200
 			$selectedTvs = array();
201
-			if(!isset($_POST['assignedTv'])) {
201
+			if (!isset($_POST['assignedTv'])) {
202 202
 				$rs = $modx->db->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 205
 				);
206
-				while($row = $modx->db->getRow($rs)) {
206
+				while ($row = $modx->db->getRow($rs)) {
207 207
 					$selectedTvs[$row['tvid']] = $row;
208 208
 				}
209
-				$selectedTvs = array_reverse($selectedTvs, true);       // reverse ORDERBY DESC
209
+				$selectedTvs = array_reverse($selectedTvs, true); // reverse ORDERBY DESC
210 210
 			}
211 211
 
212 212
 			$unselectedTvs = array();
213 213
 			$rs = $modx->db->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->db->getRow($rs)) {
216
+			while ($row = $modx->db->getRow($rs)) {
217 217
 				$unselectedTvs[$row['tvid']] = $row;
218 218
 			}
219 219
 
220 220
 			// Catch checkboxes if form not validated
221
-			if(isset($_POST['assignedTv'])) {
221
+			if (isset($_POST['assignedTv'])) {
222 222
 				$selectedTvs = array();
223
-				foreach($_POST['assignedTv'] as $tvid) {
224
-					if(isset($unselectedTvs[$tvid])) {
223
+				foreach ($_POST['assignedTv'] as $tvid) {
224
+					if (isset($unselectedTvs[$tvid])) {
225 225
 						$selectedTvs[$tvid] = $unselectedTvs[$tvid];
226 226
 					}
227 227
 				};
@@ -238,20 +238,20 @@  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>';
241
+				if ($total > 0) {
242
+					echo '<p>'.$_lang['template_tv_msg'].'</p>';
243 243
 				}
244
-				if($modx->hasPermission('save_template') && $total > 1 && $id) {
244
+				if ($modx->hasPermission('save_template') && $total > 1 && $id) {
245 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 246
 				}
247 247
 
248 248
 				// Selected TVs
249 249
 				$tvList = '';
250
-				if($total > 0) {
250
+				if ($total > 0) {
251 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>' : "";
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 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->manager->action, $id, $_lang['edit']);
256 256
 					}
257 257
 					$tvList .= '</ul>';
@@ -262,22 +262,22 @@  discard block
 block discarded – undo
262 262
 				echo $tvList;
263 263
 
264 264
 				// Unselected TVs
265
-				$tvList = '<hr/><p>' . $_lang['template_notassigned_tv'] . '</p><ul>';
265
+				$tvList = '<hr/><p>'.$_lang['template_notassigned_tv'].'</p><ul>';
266 266
 				$preCat = '';
267 267
 				$insideUl = 0;
268
-				while($row = array_shift($unselectedTvs)) {
269
-					if(isset($selectedTvs[$row['tvid']])) {
268
+				while ($row = array_shift($unselectedTvs)) {
269
+					if (isset($selectedTvs[$row['tvid']])) {
270 270
 						continue;
271 271
 					} // Skip selected
272 272
 					$row['category'] = stripslashes($row['category']); //pixelchutes
273
-					if($preCat !== $row['category']) {
273
+					if ($preCat !== $row['category']) {
274 274
 						$tvList .= $insideUl ? '</ul>' : '';
275
-						$tvList .= '<li><strong>' . $row['category'] . ($row['catid'] != '' ? ' <small>(' . $row['catid'] . ')</small>' : '') . '</strong><ul>';
275
+						$tvList .= '<li><strong>'.$row['category'].($row['catid'] != '' ? ' <small>('.$row['catid'].')</small>' : '').'</strong><ul>';
276 276
 						$insideUl = 1;
277 277
 					}
278 278
 
279
-					$desc = !empty($row['tvdescription']) ? '&nbsp;&nbsp;<small>(' . $row['tvdescription'] . ')</small>' : '';
280
-					$locked = $row['tvlocked'] ? ' <em>(' . $_lang['locked'] . ')</em>' : "";
279
+					$desc = !empty($row['tvdescription']) ? '&nbsp;&nbsp;<small>('.$row['tvdescription'].')</small>' : '';
280
+					$locked = $row['tvlocked'] ? ' <em>('.$_lang['locked'].')</em>' : "";
281 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->manager->action, $id, $_lang['edit']);
282 282
 					$tvList .= '</li>';
283 283
 
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
 		<?php
295 295
 		// invoke OnTempFormRender event
296 296
 		$evtOut = $modx->invokeEvent("OnTempFormRender", array("id" => $id));
297
-		if(is_array($evtOut)) {
297
+		if (is_array($evtOut)) {
298 298
 			echo implode("", $evtOut);
299 299
 		}
300 300
 		?>
Please login to merge, or discard this patch.
manager/actions/mutate_menuindex_sort.dynamic.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,19 +1,19 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if (!$modx->hasPermission('edit_document') || !$modx->hasPermission('save_document')) {
6 6
     $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : null;
9
+$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : null;
10 10
 $reset = isset($_POST['reset']) && $_POST['reset'] == 'true' ? 1 : 0;
11 11
 $items = isset($_POST['list']) ? $_POST['list'] : '';
12 12
 $ressourcelist = '';
13 13
 $updateMsg = '';
14 14
 
15 15
 // check permissions on the document
16
-include_once MODX_MANAGER_PATH . "processors/user_documents_permissions.class.php";
16
+include_once MODX_MANAGER_PATH."processors/user_documents_permissions.class.php";
17 17
 $udperms = new udperms();
18 18
 $udperms->user = $modx->getLoginUserID();
19 19
 $udperms->document = $id;
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 }
25 25
 
26 26
 if (isset($_POST['listSubmitted'])) {
27
-    $updateMsg .= '<div class="text-success" id="updated">' . $_lang['sort_updated'] . '</div>';
27
+    $updateMsg .= '<div class="text-success" id="updated">'.$_lang['sort_updated'].'</div>';
28 28
     if (strlen($items) > 0) {
29 29
         $items = explode(';', $items);
30 30
         foreach ($items as $key => $value) {
@@ -44,15 +44,15 @@  discard block
 block discarded – undo
44 44
     $tblsc = $modx->getFullTableName('site_content');
45 45
     $tbldg = $modx->getFullTableName('document_groups');
46 46
 
47
-    $rs = $modx->db->select('pagetitle', $tblsc, 'id=' . $id . '');
47
+    $rs = $modx->db->select('pagetitle', $tblsc, 'id='.$id.'');
48 48
     $pagetitle = $modx->db->getValue($rs);
49 49
 
50 50
     $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(',', $_SESSION['mgrDocgroups']) : '';
51 51
     $docgrp_cond = $docgrp ? "OR dg.document_group IN ({$docgrp})" : '';
52
-    $mgrRole = (isset ($_SESSION['mgrRole']) && (string)$_SESSION['mgrRole'] === '1') ? '1' : '0';
53
-    $access = " AND (1={$mgrRole} OR sc.privatemgr=0" . (!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))");
52
+    $mgrRole = (isset ($_SESSION['mgrRole']) && (string) $_SESSION['mgrRole'] === '1') ? '1' : '0';
53
+    $access = " AND (1={$mgrRole} OR sc.privatemgr=0".(!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))");
54 54
 
55
-    $rs = $modx->db->select('sc.id, sc.pagetitle, sc.parent, sc.menuindex, sc.published, sc.hidemenu, sc.deleted, sc.isfolder', $tblsc . 'AS sc LEFT JOIN ' . $tbldg . ' dg ON dg.document=sc.id', 'sc.parent=' . $id . $access . ' GROUP BY sc.id', 'menuindex ASC');
55
+    $rs = $modx->db->select('sc.id, sc.pagetitle, sc.parent, sc.menuindex, sc.published, sc.hidemenu, sc.deleted, sc.isfolder', $tblsc.'AS sc LEFT JOIN '.$tbldg.' dg ON dg.document=sc.id', 'sc.parent='.$id.$access.' GROUP BY sc.id', 'menuindex ASC');
56 56
 
57 57
     if ($modx->db->getRecordCount($rs)) {
58 58
         $ressourcelist .= '<div class="clearfix"><ul id="sortlist" class="sortableList">';
@@ -61,12 +61,12 @@  discard block
 block discarded – undo
61 61
             $classes .= ($row['hidemenu']) ? ' notInMenuNode ' : ' inMenuNode';
62 62
             $classes .= ($row['published']) ? ' publishedNode ' : ' unpublishedNode ';
63 63
             $classes = ($row['deleted']) ? ' deletedNode ' : $classes;
64
-            $icon = $row['isfolder'] ? '<i class="' . $_style['files_folder'] . '"></i> ' : ' <i class="' . $_style['files_page_html'] . '"></i> ';
65
-            $ressourcelist .= '<li id="item_' . $row['id'] . '" class="' . $classes . '">' . $icon . $row['pagetitle'] . ' <small>(' . $row['id'] . ')</small></li>';
64
+            $icon = $row['isfolder'] ? '<i class="'.$_style['files_folder'].'"></i> ' : ' <i class="'.$_style['files_page_html'].'"></i> ';
65
+            $ressourcelist .= '<li id="item_'.$row['id'].'" class="'.$classes.'">'.$icon.$row['pagetitle'].' <small>('.$row['id'].')</small></li>';
66 66
         }
67 67
         $ressourcelist .= '</ul></div>';
68 68
     } else {
69
-        $updateMsg = '<p class="text-danger">' . $_lang['sort_nochildren'] . '</p>';
69
+        $updateMsg = '<p class="text-danger">'.$_lang['sort_nochildren'].'</p>';
70 70
     }
71 71
 }
72 72
 
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 </script>
150 150
 
151 151
 <h1>
152
-    <i class="fa fa-sort-numeric-asc"></i><?= ($pagetitle ? $pagetitle . '<small>(' . $id . ')</small>' : $_lang['sort_menuindex']) ?>
152
+    <i class="fa fa-sort-numeric-asc"></i><?= ($pagetitle ? $pagetitle.'<small>('.$id.')</small>' : $_lang['sort_menuindex']) ?>
153 153
 </h1>
154 154
 
155 155
 <?= $_style['actionbuttons']['dynamic']['save'] ?>
Please login to merge, or discard this patch.
manager/actions/search.static.php 1 patch
Spacing   +76 added lines, -76 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     exit();
4 4
 }
5 5
 unset($_SESSION['itemname']); // clear this, because it's only set for logging purposes
@@ -41,9 +41,9 @@  discard block
 block discarded – undo
41 41
                         <?php
42 42
                         $rs = $modx->db->select('*', $modx->getFullTableName('site_templates'));
43 43
                         $option[] = '<option value="">No selected</option>';
44
-                        $templateid = (isset($_REQUEST['templateid']) && $_REQUEST['templateid'] !== '') ? (int)$_REQUEST['templateid'] : '';
44
+                        $templateid = (isset($_REQUEST['templateid']) && $_REQUEST['templateid'] !== '') ? (int) $_REQUEST['templateid'] : '';
45 45
                         $selected = $templateid === 0 ? ' selected="selected"' : '';
46
-                        $option[] = '<option value="0"' . $selected . '>(blank)</option>';
46
+                        $option[] = '<option value="0"'.$selected.'>(blank)</option>';
47 47
                         while ($row = $modx->db->getRow($rs)) {
48 48
                             $templatename = htmlspecialchars($row['templatename'], ENT_QUOTES, $modx->config['modx_charset']);
49 49
                             $selected = $row['id'] == $templateid ? ' selected="selected"' : '';
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
     $searchfields = htmlentities(trim($_POST['searchfields']), ENT_QUOTES, $modx_manager_charset);
87 87
     $searchlongtitle = $modx->db->escape(trim($_REQUEST['searchfields']));
88 88
     $search_alias = $modx->db->escape(trim($_REQUEST['searchfields']));
89
-    $templateid = isset($_REQUEST['templateid']) && $_REQUEST['templateid'] !== '' ? (int)$_REQUEST['templateid'] : '';
89
+    $templateid = isset($_REQUEST['templateid']) && $_REQUEST['templateid'] !== '' ? (int) $_REQUEST['templateid'] : '';
90 90
     $searchcontent = $modx->db->escape($_REQUEST['content']);
91 91
 
92 92
     $fields = 'DISTINCT sc.id, contenttype, pagetitle, longtitle, description, introtext, menutitle, deleted, published, isfolder, type';
@@ -100,12 +100,12 @@  discard block
 block discarded – undo
100 100
         $friendly_url_suffix = $modx->config['friendly_url_suffix'];
101 101
         $base_url = $modx->config['base_url'];
102 102
         $site_url = $modx->config['site_url'];
103
-        $url = preg_replace('@' . $friendly_url_suffix . '$@', '', $url);
103
+        $url = preg_replace('@'.$friendly_url_suffix.'$@', '', $url);
104 104
         if ($url[0] === '/') {
105
-            $url = preg_replace('@^' . $base_url . '@', '', $url);
105
+            $url = preg_replace('@^'.$base_url.'@', '', $url);
106 106
         }
107 107
         if (substr($url, 0, 4) === 'http') {
108
-            $url = preg_replace('@^' . $site_url . '@', '', $url);
108
+            $url = preg_replace('@^'.$site_url.'@', '', $url);
109 109
         }
110 110
         $idFromAlias = $modx->getIdFromAlias($url);
111 111
     }
@@ -118,18 +118,18 @@  discard block
 block discarded – undo
118 118
 		$articul_query = "SELECT `contentid` FROM {$tbl_site_tmplvar_contentvalues} WHERE `value` LIKE '%{$searchfields}%'";
119 119
 		$articul_result = $modx->db->query($articul_query);
120 120
 		$articul_id_array = $modx->db->makeArray($articul_result);
121
-		if(count($articul_id_array)>0){
121
+		if (count($articul_id_array) > 0) {
122 122
 			$articul_id = '';
123 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.=',';
124
+			foreach ($articul_id_array as $articul) {
125
+				$articul_id .= $articul['contentid'];
126
+				if ($i !== count($articul_id_array)) {
127
+					$articul_id .= ',';
128 128
 				}
129 129
 				$i++;
130 130
 			}
131 131
 		$articul_id_query = " OR sc.id IN ({$articul_id})";
132
-		}else{
132
+		} else {
133 133
 			$articul_id_query = '';
134 134
 		}
135 135
 		/*end search by TV*/
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
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
         }
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
             $sqladd .= " OR sc.introtext LIKE '%{$searchlongtitle}%'";
158 158
             $sqladd .= " OR sc.menutitle LIKE '%{$searchlongtitle}%'";
159 159
             $sqladd .= " OR sc.alias LIKE '%{$search_alias}%'";
160
-			$sqladd .= $articul_id_query;//search by TV
160
+			$sqladd .= $articul_id_query; //search by TV
161 161
         }
162 162
     } else if ($idFromAlias) {
163 163
         $sqladd .= " sc.id='{$idFromAlias}'";
@@ -180,8 +180,8 @@  discard block
 block discarded – undo
180 180
         $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(',', $_SESSION['mgrDocgroups']) : '';
181 181
         $mgrRole = (isset ($_SESSION['mgrRole']) && $_SESSION['mgrRole'] == 1) ? 1 : 0;
182 182
         $docgrp_cond = $docgrp ? " OR dg.document_group IN ({$docgrp})" : '';
183
-        $fields .= ', MAX(IF(1=' . $mgrRole . ' OR sc.privatemgr=0' . $docgrp_cond . ',1,0)) AS hasAccess';
184
-        $sqladd = '(' . $sqladd . ") AND (1={$mgrRole} OR sc.privatemgr=0" . (!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))");
183
+        $fields .= ', MAX(IF(1='.$mgrRole.' OR sc.privatemgr=0'.$docgrp_cond.',1,0)) AS hasAccess';
184
+        $sqladd = '('.$sqladd.") AND (1={$mgrRole} OR sc.privatemgr=0".(!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))");
185 185
     }
186 186
 
187 187
     if ($sqladd) {
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
     $where = $sqladd;
192 192
 
193 193
     if ($where) {
194
-        $rs = $modx->db->select($fields, $tbl_site_content . ' AS sc LEFT JOIN ' . $tbldg . ' AS dg ON dg.document=sc.id', $where, 'sc.id');
194
+        $rs = $modx->db->select($fields, $tbl_site_content.' AS sc LEFT JOIN '.$tbldg.' AS dg ON dg.document=sc.id', $where, 'sc.id');
195 195
         $limit = $modx->db->getRecordCount($rs);
196 196
     } else {
197 197
         $limit = 0;
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
                 if ($limit < 1) {
211 211
                     echo $_lang['search_empty'];
212 212
                 } else {
213
-                    printf('<p>' . $_lang['search_results_returned_msg'] . '</p>', $limit);
213
+                    printf('<p>'.$_lang['search_results_returned_msg'].'</p>', $limit);
214 214
                     ?>
215 215
                     <script type="text/javascript" src="media/script/tablesort.js"></script>
216 216
                     <table class="grid sortabletable sortable-onload-2 rowstyle-even" id="table-1">
@@ -270,14 +270,14 @@  discard block
 block discarded – undo
270 270
                                 if (function_exists('mb_strlen') && function_exists('mb_substr')) {
271 271
                                     ?>
272 272
                                     <td<?= $tdClass ?>>
273
-                                        <a href="index.php?a=27&id=<?= $row['id'] ?>"><?= mb_strlen($row['pagetitle'], $modx_manager_charset) > 70 ? mb_substr($row['pagetitle'], 0, 70, $modx_manager_charset) . "..." : $row['pagetitle'] ?></a>
273
+                                        <a href="index.php?a=27&id=<?= $row['id'] ?>"><?= mb_strlen($row['pagetitle'], $modx_manager_charset) > 70 ? mb_substr($row['pagetitle'], 0, 70, $modx_manager_charset)."..." : $row['pagetitle'] ?></a>
274 274
                                     </td>
275
-                                    <td<?= $tdClass ?>><?= mb_strlen($row['description'], $modx_manager_charset) > 70 ? mb_substr($row['description'], 0, 70, $modx_manager_charset) . "..." : $row['description'] ?></td>
275
+                                    <td<?= $tdClass ?>><?= mb_strlen($row['description'], $modx_manager_charset) > 70 ? mb_substr($row['description'], 0, 70, $modx_manager_charset)."..." : $row['description'] ?></td>
276 276
                                     <?php
277 277
                                 } else {
278 278
                                     ?>
279
-                                    <td<?= $tdClass ?>><?= strlen($row['pagetitle']) > 20 ? substr($row['pagetitle'], 0, 20) . '...' : $row['pagetitle'] ?></td>
280
-                                    <td<?= $tdClass ?>><?= strlen($row['description']) > 35 ? substr($row['description'], 0, 35) . '...' : $row['description'] ?></td>
279
+                                    <td<?= $tdClass ?>><?= strlen($row['pagetitle']) > 20 ? substr($row['pagetitle'], 0, 20).'...' : $row['pagetitle'] ?></td>
280
+                                    <td<?= $tdClass ?>><?= strlen($row['description']) > 35 ? substr($row['description'], 0, 35).'...' : $row['description'] ?></td>
281 281
                                     <?php
282 282
                                 }
283 283
                                 ?>
@@ -297,115 +297,115 @@  discard block
 block discarded – undo
297 297
                 if ($modx->hasPermission('new_document') && $modx->hasPermission('edit_document') && $modx->hasPermission('save_document')) {
298 298
                     $docscounts = $modx->db->getRecordCount($rs);
299 299
                     if ($docscounts > 0) {
300
-                        $output .= '<li><b><i class="fa fa-sitemap"></i> ' . $_lang["manage_documents"] . ' (' . $docscounts . ')</b></li>';
300
+                        $output .= '<li><b><i class="fa fa-sitemap"></i> '.$_lang["manage_documents"].' ('.$docscounts.')</b></li>';
301 301
                         while ($row = $modx->db->getRow($rs)) {
302
-                            $output .= '<li' . addClassForItemList('', !$row['published'], $row['deleted']) . '><a href="index.php?a=27&id=' . $row['id'] . '" id="content_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['pagetitle'] . ' <small>(' . $row['id'] . ')</small>', $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>';
302
+                            $output .= '<li'.addClassForItemList('', !$row['published'], $row['deleted']).'><a href="index.php?a=27&id='.$row['id'].'" id="content_'.$row['id'].'" target="main">'.highlightingCoincidence($row['pagetitle'].' <small>('.$row['id'].')</small>', $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>';
303 303
                         }
304 304
                     }
305 305
                 }
306 306
 
307 307
                 //templates
308 308
                 if ($modx->hasPermission('edit_template')) {
309
-                    $rs = $modx->db->select("id,templatename,locked", $modx->getFullTableName('site_templates'), "`id` like '%" . $searchfields . "%' 
310
-					OR `templatename` like '%" . $searchfields . "%' 
311
-					OR `description` like '%" . $searchfields . "%' 
312
-					OR `content` like '%" . $searchfields . "%'");
309
+                    $rs = $modx->db->select("id,templatename,locked", $modx->getFullTableName('site_templates'), "`id` like '%".$searchfields."%' 
310
+					OR `templatename` like '%" . $searchfields."%' 
311
+					OR `description` like '%" . $searchfields."%' 
312
+					OR `content` like '%" . $searchfields."%'");
313 313
                     $templatecounts = $modx->db->getRecordCount($rs);
314 314
                     if ($templatecounts > 0) {
315
-                        $output .= '<li><b><i class="fa fa-newspaper-o"></i> ' . $_lang["manage_templates"] . ' (' . $templatecounts . ')</b></li>';
315
+                        $output .= '<li><b><i class="fa fa-newspaper-o"></i> '.$_lang["manage_templates"].' ('.$templatecounts.')</b></li>';
316 316
                         while ($row = $modx->db->getRow($rs)) {
317
-                            $output .= '<li' . addClassForItemList($row['locked']) . '><a href="index.php?a=16&id=' . $row['id'] . '" id="templates_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['templatename'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>';
317
+                            $output .= '<li'.addClassForItemList($row['locked']).'><a href="index.php?a=16&id='.$row['id'].'" id="templates_'.$row['id'].'" target="main">'.highlightingCoincidence($row['templatename'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>';
318 318
                         }
319 319
                     }
320 320
                 }
321 321
 
322 322
                 //tvs
323 323
                 if ($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) {
324
-                    $rs = $modx->db->select("id,name,locked", $modx->getFullTableName('site_tmplvars'), "`id` like '%" . $searchfields . "%' 
325
-					OR `name` like '%" . $searchfields . "%' 
326
-					OR `description` like '%" . $searchfields . "%' 
327
-					OR `type` like '%" . $searchfields . "%' 
328
-					OR `elements` like '%" . $searchfields . "%' 
329
-					OR `display` like '%" . $searchfields . "%' 
330
-					OR `display_params` like '%" . $searchfields . "%' 
331
-					OR `default_text` like '%" . $searchfields . "%'");
324
+                    $rs = $modx->db->select("id,name,locked", $modx->getFullTableName('site_tmplvars'), "`id` like '%".$searchfields."%' 
325
+					OR `name` like '%" . $searchfields."%' 
326
+					OR `description` like '%" . $searchfields."%' 
327
+					OR `type` like '%" . $searchfields."%' 
328
+					OR `elements` like '%" . $searchfields."%' 
329
+					OR `display` like '%" . $searchfields."%' 
330
+					OR `display_params` like '%" . $searchfields."%' 
331
+					OR `default_text` like '%" . $searchfields."%'");
332 332
                     $tvscounts = $modx->db->getRecordCount($rs);
333 333
                     if ($tvscounts > 0) {
334
-                        $output .= '<li><b><i class="fa fa-list-alt"></i> ' . $_lang["settings_templvars"] . ' (' . $tvscounts . ')</b></li>';
334
+                        $output .= '<li><b><i class="fa fa-list-alt"></i> '.$_lang["settings_templvars"].' ('.$tvscounts.')</b></li>';
335 335
                         while ($row = $modx->db->getRow($rs)) {
336
-                            $output .= '<li' . addClassForItemList($row['locked']) . '><a href="index.php?a=301&id=' . $row['id'] . '" id="tmplvars_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['name'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>';
336
+                            $output .= '<li'.addClassForItemList($row['locked']).'><a href="index.php?a=301&id='.$row['id'].'" id="tmplvars_'.$row['id'].'" target="main">'.highlightingCoincidence($row['name'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>';
337 337
                         }
338 338
                     }
339 339
                 }
340 340
 
341 341
                 //Chunks
342 342
                 if ($modx->hasPermission('edit_chunk')) {
343
-                    $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_htmlsnippets'), "`id` like '%" . $searchfields . "%' 
344
-					OR `name` like '%" . $searchfields . "%' 
345
-					OR `description` like '%" . $searchfields . "%'     
346
-					OR `snippet` like '%" . $searchfields . "%'");
343
+                    $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_htmlsnippets'), "`id` like '%".$searchfields."%' 
344
+					OR `name` like '%" . $searchfields."%' 
345
+					OR `description` like '%" . $searchfields."%'     
346
+					OR `snippet` like '%" . $searchfields."%'");
347 347
                     $chunkscounts = $modx->db->getRecordCount($rs);
348 348
                     if ($chunkscounts > 0) {
349
-                        $output .= '<li><b><i class="fa fa-th-large"></i> ' . $_lang["manage_htmlsnippets"] . ' (' . $chunkscounts . ')</b></li>';
349
+                        $output .= '<li><b><i class="fa fa-th-large"></i> '.$_lang["manage_htmlsnippets"].' ('.$chunkscounts.')</b></li>';
350 350
                         while ($row = $modx->db->getRow($rs)) {
351
-                            $output .= '<li' . addClassForItemList($row['locked'], $row['disabled']) . '><a href="index.php?a=78&id=' . $row['id'] . '" id="htmlsnippets_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['name'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>';
351
+                            $output .= '<li'.addClassForItemList($row['locked'], $row['disabled']).'><a href="index.php?a=78&id='.$row['id'].'" id="htmlsnippets_'.$row['id'].'" target="main">'.highlightingCoincidence($row['name'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>';
352 352
                         }
353 353
                     }
354 354
                 }
355 355
 
356 356
                 //Snippets
357 357
                 if ($modx->hasPermission('edit_snippet')) {
358
-                    $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_snippets'), "`id` like '%" . $searchfields . "%' 
359
-					OR `name` like '%" . $searchfields . "%' 
360
-					OR `description` like '%" . $searchfields . "%' 
361
-					OR `snippet` like '%" . $searchfields . "%'  
362
-					OR `properties` like '%" . $searchfields . "%'      
363
-					OR `moduleguid` like '%" . $searchfields . "%'");
358
+                    $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_snippets'), "`id` like '%".$searchfields."%' 
359
+					OR `name` like '%" . $searchfields."%' 
360
+					OR `description` like '%" . $searchfields."%' 
361
+					OR `snippet` like '%" . $searchfields."%'  
362
+					OR `properties` like '%" . $searchfields."%'      
363
+					OR `moduleguid` like '%" . $searchfields."%'");
364 364
                     $snippetscounts = $modx->db->getRecordCount($rs);
365 365
                     if ($snippetscounts > 0) {
366
-                        $output .= '<li><b><i class="fa fa-code"></i> ' . $_lang["manage_snippets"] . ' (' . $snippetscounts . ')</b></li>';
366
+                        $output .= '<li><b><i class="fa fa-code"></i> '.$_lang["manage_snippets"].' ('.$snippetscounts.')</b></li>';
367 367
                         while ($row = $modx->db->getRow($rs)) {
368
-                            $output .= '<li' . addClassForItemList($row['locked'], $row['disabled']) . '><a href="index.php?a=22&id=' . $row['id'] . '" id="snippets_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['name'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>';
368
+                            $output .= '<li'.addClassForItemList($row['locked'], $row['disabled']).'><a href="index.php?a=22&id='.$row['id'].'" id="snippets_'.$row['id'].'" target="main">'.highlightingCoincidence($row['name'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>';
369 369
                         }
370 370
                     }
371 371
                 }
372 372
 
373 373
                 //plugins
374 374
                 if ($modx->hasPermission('edit_plugin')) {
375
-                    $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_plugins'), "`id` like '%" . $searchfields . "%' 
376
-					OR `name` like '%" . $searchfields . "%' 
377
-					OR `description` like '%" . $searchfields . "%' 
378
-					OR `plugincode` like '%" . $searchfields . "%'  
379
-					OR `properties` like '%" . $searchfields . "%'      
380
-					OR `moduleguid` like '%" . $searchfields . "%'");
375
+                    $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_plugins'), "`id` like '%".$searchfields."%' 
376
+					OR `name` like '%" . $searchfields."%' 
377
+					OR `description` like '%" . $searchfields."%' 
378
+					OR `plugincode` like '%" . $searchfields."%'  
379
+					OR `properties` like '%" . $searchfields."%'      
380
+					OR `moduleguid` like '%" . $searchfields."%'");
381 381
                     $pluginscounts = $modx->db->getRecordCount($rs);
382 382
                     if ($pluginscounts > 0) {
383
-                        $output .= '<li><b><i class="fa fa-plug"></i> ' . $_lang["manage_plugins"] . ' (' . $pluginscounts . ')</b></li>';
383
+                        $output .= '<li><b><i class="fa fa-plug"></i> '.$_lang["manage_plugins"].' ('.$pluginscounts.')</b></li>';
384 384
                         while ($row = $modx->db->getRow($rs)) {
385
-                            $output .= '<li' . addClassForItemList($row['locked'], $row['disabled']) . '><a href="index.php?a=102&id=' . $row['id'] . '" id="plugins_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['name'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>';
385
+                            $output .= '<li'.addClassForItemList($row['locked'], $row['disabled']).'><a href="index.php?a=102&id='.$row['id'].'" id="plugins_'.$row['id'].'" target="main">'.highlightingCoincidence($row['name'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>';
386 386
                         }
387 387
                     }
388 388
                 }
389 389
 
390 390
                 //modules
391 391
                 if ($modx->hasPermission('edit_module')) {
392
-                    $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_modules'), "`id` like '%" . $searchfields . "%' 
393
-                    OR `name` like '%" . $searchfields . "%' 
394
-                    OR `description` like '%" . $searchfields . "%' 
395
-                    OR `modulecode` like '%" . $searchfields . "%'  
396
-                    OR `properties` like '%" . $searchfields . "%'  
397
-                    OR `guid` like '%" . $searchfields . "%'      
398
-                    OR `resourcefile` like '%" . $searchfields . "%'");
392
+                    $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_modules'), "`id` like '%".$searchfields."%' 
393
+                    OR `name` like '%" . $searchfields."%' 
394
+                    OR `description` like '%" . $searchfields."%' 
395
+                    OR `modulecode` like '%" . $searchfields."%'  
396
+                    OR `properties` like '%" . $searchfields."%'  
397
+                    OR `guid` like '%" . $searchfields."%'      
398
+                    OR `resourcefile` like '%" . $searchfields."%'");
399 399
                     $modulescounts = $modx->db->getRecordCount($rs);
400 400
                     if ($modulescounts > 0) {
401
-                        $output .= '<li><b><i class="fa fa-cogs"></i> ' . $_lang["modules"] . ' (' . $modulescounts . ')</b></li>';
401
+                        $output .= '<li><b><i class="fa fa-cogs"></i> '.$_lang["modules"].' ('.$modulescounts.')</b></li>';
402 402
                         while ($row = $modx->db->getRow($rs)) {
403
-                            $output .= '<li' . addClassForItemList($row['locked'], $row['disabled']) . '><a href="index.php?a=108&id=' . $row['id'] . '" id="modules_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['name'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>';
403
+                            $output .= '<li'.addClassForItemList($row['locked'], $row['disabled']).'><a href="index.php?a=108&id='.$row['id'].'" id="modules_'.$row['id'].'" target="main">'.highlightingCoincidence($row['name'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>';
404 404
                         }
405 405
                     }
406 406
                 }
407 407
 
408
-                echo $output ? '<div class="ajaxSearchResults"><ul>' . $output . '</ul></div>' : '1';
408
+                echo $output ? '<div class="ajaxSearchResults"><ul>'.$output.'</ul></div>' : '1';
409 409
             }
410 410
 
411 411
             ?>
@@ -416,13 +416,13 @@  discard block
 block discarded – undo
416 416
 
417 417
 function highlightingCoincidence($text, $search)
418 418
 {
419
-    $regexp = '!(' . str_replace(array(
419
+    $regexp = '!('.str_replace(array(
420 420
             '(',
421 421
             ')'
422 422
         ), array(
423 423
             '\(',
424 424
             '\)'
425
-        ), trim($search)) . ')!isu';
425
+        ), trim($search)).')!isu';
426 426
     return preg_replace($regexp, '<span class="text-danger">$1</span>', $text);
427 427
 }
428 428
 
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
         $class .= ' deleted';
440 440
     }
441 441
     if ($class) {
442
-        $class = ' class="' . trim($class) . '"';
442
+        $class = ' class="'.trim($class).'"';
443 443
     }
444 444
     return $class;
445 445
 }
Please login to merge, or discard this patch.
manager/actions/mutate_module.dynamic.php 1 patch
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -1,22 +1,22 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
 	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5
-switch($modx->manager->action) {
5
+switch ($modx->manager->action) {
6 6
 	case 107:
7
-		if(!$modx->hasPermission('new_module')) {
7
+		if (!$modx->hasPermission('new_module')) {
8 8
 			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
9 9
 		}
10 10
 		break;
11 11
 	case 108:
12
-		if(!$modx->hasPermission('edit_module')) {
12
+		if (!$modx->hasPermission('edit_module')) {
13 13
 			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
14 14
 		}
15 15
 		break;
16 16
 	default:
17 17
 		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
18 18
 }
19
-$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
19
+$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0;
20 20
 // Get table names (alphabetical)
21 21
 $tbl_membergroup_names = $modx->getFullTableName('membergroup_names');
22 22
 $tbl_site_content = $modx->getFullTableName('site_content');
@@ -29,16 +29,16 @@  discard block
 block discarded – undo
29 29
 $tbl_site_templates = $modx->getFullTableName('site_templates');
30 30
 $tbl_site_tmplvars = $modx->getFullTableName('site_tmplvars');
31 31
 // create globally unique identifiers (guid)
32
-function createGUID() {
32
+function createGUID(){
33 33
 	srand((double) microtime() * 1000000);
34 34
 	$r = rand();
35
-	$u = uniqid(getmypid() . $r . (double) microtime() * 1000000, 1);
35
+	$u = uniqid(getmypid().$r.(double) microtime() * 1000000, 1);
36 36
 	$m = md5($u);
37 37
 	return $m;
38 38
 }
39 39
 
40 40
 // check to see the module editor isn't locked
41
-if($lockedEl = $modx->elementIsLocked(6, $id)) {
41
+if ($lockedEl = $modx->elementIsLocked(6, $id)) {
42 42
 	$modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module']));
43 43
 }
44 44
 // end check for lock
@@ -46,29 +46,29 @@  discard block
 block discarded – undo
46 46
 // Lock snippet for other users to edit
47 47
 $modx->lockElement(6, $id);
48 48
 
49
-if(isset($_GET['id'])) {
49
+if (isset($_GET['id'])) {
50 50
 	$rs = $modx->db->select('*', $tbl_site_modules, "id='{$id}'");
51 51
 	$content = $modx->db->getRow($rs);
52
-	if(!$content) {
52
+	if (!$content) {
53 53
 		$modx->webAlertAndQuit("Module not found for id '{$id}'.");
54 54
 	}
55 55
 	$content['properties'] = str_replace("&", "&amp;", $content['properties']);
56 56
 	$_SESSION['itemname'] = $content['name'];
57
-	if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
57
+	if ($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
58 58
 		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
59 59
 	}
60 60
 } else {
61 61
 	$_SESSION['itemname'] = $_lang["new_module"];
62 62
 	$content['wrap'] = '1';
63 63
 }
64
-if($modx->manager->hasFormValues()) {
64
+if ($modx->manager->hasFormValues()) {
65 65
 	$modx->manager->loadFormValues();
66 66
 }
67 67
 
68 68
 // Add lock-element JS-Script
69 69
 $lockElementId = $id;
70 70
 $lockElementType = 6;
71
-require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php');
71
+require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php');
72 72
 ?>
73 73
 <script type="text/javascript">
74 74
 	function loadDependencies() {
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
 	function BrowseServer() {
416 416
 		var w = screen.width * 0.7;
417 417
 		var h = screen.height * 0.7;
418
-		OpenServerBrowser("<?= MODX_MANAGER_URL;?>media/browser/<?= $which_browser;?>/browser.php?Type=images", w, h);
418
+		OpenServerBrowser("<?= MODX_MANAGER_URL; ?>media/browser/<?= $which_browser; ?>/browser.php?Type=images", w, h);
419 419
 	}
420 420
 
421 421
 	function SetUrl(url, width, height, alt) {
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
 	<?php
436 436
 	// invoke OnModFormPrerender event
437 437
 	$evtOut = $modx->invokeEvent('OnModFormPrerender', array('id' => $id));
438
-	if(is_array($evtOut)) {
438
+	if (is_array($evtOut)) {
439 439
 		echo implode('', $evtOut);
440 440
 	}
441 441
 
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
 	<input type="hidden" name="mode" value="<?= $modx->manager->action ?>">
450 450
 
451 451
 	<h1>
452
-		<i class="<?= ($content['icon'] != '' ? $content['icon'] : $_style['icons_module']) ?>"></i><?= ($content['name'] ? $content['name'] . '<small>(' . $content['id'] . ')</small>' : $_lang['new_module']) ?><i class="fa fa-question-circle help"></i>
452
+		<i class="<?= ($content['icon'] != '' ? $content['icon'] : $_style['icons_module']) ?>"></i><?= ($content['name'] ? $content['name'].'<small>('.$content['id'].')</small>' : $_lang['new_module']) ?><i class="fa fa-question-circle help"></i>
453 453
 	</h1>
454 454
 
455 455
 	<?= $_style['actionbuttons']['dynamic']['element'] ?>
@@ -474,8 +474,8 @@  discard block
 block discarded – undo
474 474
 						<div class="col-md-9 col-lg-10">
475 475
 							<div class="form-control-name clearfix">
476 476
 								<input name="name" type="text" maxlength="100" value="<?= $modx->htmlspecialchars($content['name']) ?>" class="form-control form-control-lg" onchange="documentDirty=true;" />
477
-								<?php if($modx->hasPermission('save_role')): ?>
478
-									<label class="custom-control" title="<?= $_lang['lock_module'] . "\n" . $_lang['lock_module_msg'] ?>" tooltip>
477
+								<?php if ($modx->hasPermission('save_role')): ?>
478
+									<label class="custom-control" title="<?= $_lang['lock_module']."\n".$_lang['lock_module_msg'] ?>" tooltip>
479 479
 										<input name="locked" type="checkbox"<?= ($content['locked'] == 1 ? ' checked="checked"' : '') ?> />
480 480
 										<i class="fa fa-lock"></i>
481 481
 									</label>
@@ -497,9 +497,9 @@  discard block
 block discarded – undo
497 497
 							<select name="categoryid" class="form-control" onchange="documentDirty=true;">
498 498
 								<option>&nbsp;</option>
499 499
 								<?php
500
-								include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
501
-								foreach(getCategories() as $n => $v) {
502
-									echo "\t\t\t" . '<option value="' . $v['id'] . '"' . ($content['category'] == $v['id'] ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($v['category']) . "</option>\n";
500
+								include_once(MODX_MANAGER_PATH.'includes/categories.inc.php');
501
+								foreach (getCategories() as $n => $v) {
502
+									echo "\t\t\t".'<option value="'.$v['id'].'"'.($content['category'] == $v['id'] ? ' selected="selected"' : '').'>'.$modx->htmlspecialchars($v['category'])."</option>\n";
503 503
 								}
504 504
 								?>
505 505
 							</select>
@@ -531,7 +531,7 @@  discard block
 block discarded – undo
531 531
 				<div class="form-group">
532 532
 					<div class="form-row">
533 533
 						<label for="disabled"><input name="disabled" id="disabled" type="checkbox" value="on"<?= ($content['disabled'] == 1 ? ' checked="checked"' : '') ?> />
534
-							<?= ($content['disabled'] == 1 ? '<span class="text-danger">' . $_lang['module_disabled'] . '</span>' : $_lang['module_disabled']) ?></label>
534
+							<?= ($content['disabled'] == 1 ? '<span class="text-danger">'.$_lang['module_disabled'].'</span>' : $_lang['module_disabled']) ?></label>
535 535
 					</div>
536 536
 					<div class="form-row">
537 537
 						<label for="parse_docblock">
@@ -596,7 +596,7 @@  discard block
 block discarded – undo
596 596
 			</div>
597 597
 			<!-- HTML text editor end -->
598 598
 		</div>
599
-		<?php if($modx->manager->action == '108'): ?>
599
+		<?php if ($modx->manager->action == '108'): ?>
600 600
 			<!-- Dependencies -->
601 601
 			<div class="tab-page" id="tabDepend">
602 602
 				<h2 class="tab"><?= $_lang['settings_dependencies'] ?></h2>
@@ -624,14 +624,14 @@  discard block
 block discarded – undo
624 624
 						LEFT JOIN {$tbl_site_templates} AS st ON st.id = smd.resource AND smd.type = 50
625 625
 						LEFT JOIN {$tbl_site_tmplvars} AS sv ON sv.id = smd.resource AND smd.type = 60", "smd.module='{$id}'", 'smd.type,name');
626 626
 
627
-					include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php";
627
+					include_once MODX_MANAGER_PATH."includes/controls/datagrid.class.php";
628 628
 					$grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items
629 629
 					$grd->noRecordMsg = $_lang['no_records_found'];
630 630
 					$grd->cssClass = 'grid';
631 631
 					$grd->columnHeaderClass = 'gridHeader';
632 632
 					$grd->itemClass = 'gridItem';
633 633
 					$grd->altItemClass = 'gridAltItem';
634
-					$grd->columns = $_lang['element_name'] . " ," . $_lang['type'];
634
+					$grd->columns = $_lang['element_name']." ,".$_lang['type'];
635 635
 					$grd->fields = "name,type";
636 636
 					echo $grd->render();
637 637
 					?>
@@ -644,13 +644,13 @@  discard block
 block discarded – undo
644 644
 			<h2 class="tab"><?= $_lang['access_permissions'] ?></h2>
645 645
 			<script type="text/javascript">tp.addTabPage(document.getElementById("tabPermissions"));</script>
646 646
 			<div class="container container-body">
647
-				<?php if($use_udperms == 1) : ?>
647
+				<?php if ($use_udperms == 1) : ?>
648 648
 					<?php
649 649
 					// fetch user access permissions for the module
650 650
 					$rs = $modx->db->select('usergroup', $tbl_site_module_access, "module='{$id}'");
651 651
 					$groupsarray = $modx->db->getColumn('usergroup', $rs);
652 652
 
653
-					if($modx->hasPermission('access_permissions')) {
653
+					if ($modx->hasPermission('access_permissions')) {
654 654
 						?>
655 655
 						<!-- User Group Access Permissions -->
656 656
 						<script type="text/javascript">
@@ -678,22 +678,22 @@  discard block
 block discarded – undo
678 678
 					}
679 679
 					$chk = '';
680 680
 					$rs = $modx->db->select('name, id', $tbl_membergroup_names, '', 'name');
681
-					while($row = $modx->db->getRow($rs)) {
681
+					while ($row = $modx->db->getRow($rs)) {
682 682
 						$groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array();
683 683
 						$checked = in_array($row['id'], $groupsarray);
684
-						if($modx->hasPermission('access_permissions')) {
685
-							if($checked) {
684
+						if ($modx->hasPermission('access_permissions')) {
685
+							if ($checked) {
686 686
 								$notPublic = true;
687 687
 							}
688
-							$chks .= '<label><input type="checkbox" name="usrgroups[]" value="' . $row['id'] . '"' . ($checked ? ' checked="checked"' : '') . ' onclick="makePublic(false)" /> ' . $row['name'] . "</label><br />\n";
688
+							$chks .= '<label><input type="checkbox" name="usrgroups[]" value="'.$row['id'].'"'.($checked ? ' checked="checked"' : '').' onclick="makePublic(false)" /> '.$row['name']."</label><br />\n";
689 689
 						} else {
690
-							if($checked) {
691
-								$chks = '<input type="hidden" name="usrgroups[]"  value="' . $row['id'] . '" />' . "\n" . $chks;
690
+							if ($checked) {
691
+								$chks = '<input type="hidden" name="usrgroups[]"  value="'.$row['id'].'" />'."\n".$chks;
692 692
 							}
693 693
 						}
694 694
 					}
695
-					if($modx->hasPermission('access_permissions')) {
696
-						$chks = '<label><input type="checkbox" name="chkallgroups"' . (!$notPublic ? ' checked="checked"' : '') . ' onclick="makePublic(true)" /><span class="warning"> ' . $_lang['all_usr_groups'] . '</span></label><br />' . "\n" . $chks;
695
+					if ($modx->hasPermission('access_permissions')) {
696
+						$chks = '<label><input type="checkbox" name="chkallgroups"'.(!$notPublic ? ' checked="checked"' : '').' onclick="makePublic(true)" /><span class="warning"> '.$_lang['all_usr_groups'].'</span></label><br />'."\n".$chks;
697 697
 					}
698 698
 					echo $chks;
699 699
 					?>
@@ -714,7 +714,7 @@  discard block
 block discarded – undo
714 714
 		<?php
715 715
 		// invoke OnModFormRender event
716 716
 		$evtOut = $modx->invokeEvent('OnModFormRender', array('id' => $id));
717
-		if(is_array($evtOut)) {
717
+		if (is_array($evtOut)) {
718 718
 			echo implode('', $evtOut);
719 719
 		}
720 720
 		?>
Please login to merge, or discard this patch.
manager/actions/mutate_module_resources.dynamic.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
 	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 
6
-if(!$modx->hasPermission('edit_module')) {
6
+if (!$modx->hasPermission('edit_module')) {
7 7
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
8 8
 }
9 9
 
10
-$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
10
+$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0;
11 11
 
12 12
 // Get table names (alphabetical)
13 13
 $tbl_active_users = $modx->getFullTableName('active_users');
@@ -24,41 +24,41 @@  discard block
 block discarded – undo
24 24
 $modx->manager->initPageViewState();
25 25
 
26 26
 // check to see the  editor isn't locked
27
-$rs = $modx->db->select('username', $tbl_active_users, "action=108 AND id='{$id}' AND internalKey!='" . $modx->getLoginUserID() . "'");
28
-if($username = $modx->db->getValue($rs)) {
27
+$rs = $modx->db->select('username', $tbl_active_users, "action=108 AND id='{$id}' AND internalKey!='".$modx->getLoginUserID()."'");
28
+if ($username = $modx->db->getValue($rs)) {
29 29
 	$modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $username, 'module'));
30 30
 }
31 31
 // end check for lock
32 32
 
33 33
 // take action
34
-switch($_REQUEST['op']) {
34
+switch ($_REQUEST['op']) {
35 35
 	case 'add':
36 36
 		// convert ids to numbers
37 37
 		$opids = array_filter(array_map('intval', explode(',', $_REQUEST['newids'])));
38 38
 
39
-		if(count($opids) > 0) {
39
+		if (count($opids) > 0) {
40 40
 			// 1-snips, 2-tpls, 3-tvs, 4-chunks, 5-plugins, 6-docs
41 41
 			$rt = strtolower($_REQUEST["rt"]);
42
-			if($rt == 'chunk') {
42
+			if ($rt == 'chunk') {
43 43
 				$type = 10;
44 44
 			}
45
-			if($rt == 'doc') {
45
+			if ($rt == 'doc') {
46 46
 				$type = 20;
47 47
 			}
48
-			if($rt == 'plug') {
48
+			if ($rt == 'plug') {
49 49
 				$type = 30;
50 50
 			}
51
-			if($rt == 'snip') {
51
+			if ($rt == 'snip') {
52 52
 				$type = 40;
53 53
 			}
54
-			if($rt == 'tpl') {
54
+			if ($rt == 'tpl') {
55 55
 				$type = 50;
56 56
 			}
57
-			if($rt == 'tv') {
57
+			if ($rt == 'tv') {
58 58
 				$type = 60;
59 59
 			}
60
-			$modx->db->delete($tbl_site_module_depobj, "module='{$id}' AND resource IN (" . implode(',', $opids) . ") AND type='{$type}'");
61
-			foreach($opids as $opid) {
60
+			$modx->db->delete($tbl_site_module_depobj, "module='{$id}' AND resource IN (".implode(',', $opids).") AND type='{$type}'");
61
+			foreach ($opids as $opid) {
62 62
 				$modx->db->insert(array(
63 63
 					'module' => $id,
64 64
 					'resource' => $opid,
@@ -72,15 +72,15 @@  discard block
 block discarded – undo
72 72
 		$opids = array_filter(array_map('intval', $_REQUEST['depid']));
73 73
 
74 74
 		// get resources that needs to be removed
75
-		$ds = $modx->db->select('*', $tbl_site_module_depobj, "id IN (" . implode(",", $opids) . ")");
75
+		$ds = $modx->db->select('*', $tbl_site_module_depobj, "id IN (".implode(",", $opids).")");
76 76
 		// loop through resources and look for plugins and snippets
77 77
 		$plids = array();
78 78
 		$snid = array();
79
-		while($row = $modx->db->getRow($ds)) {
80
-			if($row['type'] == '30') {
79
+		while ($row = $modx->db->getRow($ds)) {
80
+			if ($row['type'] == '30') {
81 81
 				$plids[$i] = $row['resource'];
82 82
 			}
83
-			if($row['type'] == '40') {
83
+			if ($row['type'] == '40') {
84 84
 				$snids[$i] = $row['resource'];
85 85
 			}
86 86
 		}
@@ -88,28 +88,28 @@  discard block
 block discarded – undo
88 88
 		$ds = $modx->db->select('guid', $tbl_site_modules, "id='{$id}'");
89 89
 		$guid = $modx->db->getValue($ds);
90 90
 		// reset moduleguid for deleted resources
91
-		if(($cp = count($plids)) || ($cs = count($snids))) {
92
-			if($cp) {
93
-				$modx->db->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $plids) . ") AND moduleguid='{$guid}'");
91
+		if (($cp = count($plids)) || ($cs = count($snids))) {
92
+			if ($cp) {
93
+				$modx->db->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (".implode(',', $plids).") AND moduleguid='{$guid}'");
94 94
 			}
95
-			if($cs) {
96
-				$modx->db->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $snids) . ") AND moduleguid='{$guid}'");
95
+			if ($cs) {
96
+				$modx->db->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (".implode(',', $snids).") AND moduleguid='{$guid}'");
97 97
 			}
98 98
 			// reset cache
99 99
 			$modx->clearCache('full');
100 100
 		}
101
-		$modx->db->delete($tbl_site_module_depobj, "id IN (" . implode(',', $opids) . ")");
101
+		$modx->db->delete($tbl_site_module_depobj, "id IN (".implode(',', $opids).")");
102 102
 		break;
103 103
 }
104 104
 
105 105
 // load record
106 106
 $rs = $modx->db->select('*', $tbl_site_modules, "id = '{$id}'");
107 107
 $content = $modx->db->getRow($rs);
108
-if(!$content) {
108
+if (!$content) {
109 109
 	$modx->webAlertAndQuit("Module not found for id '{$id}'.");
110 110
 }
111 111
 $_SESSION['itemname'] = $content['name'];
112
-if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
112
+if ($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
113 113
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
114 114
 }
115 115
 
@@ -188,13 +188,13 @@  discard block
 block discarded – undo
188 188
 	<input type="hidden" name="id" value="<?php echo $content['id']; ?>" />
189 189
 
190 190
 	<h1>
191
-		<i class="fa fa-cogs"></i><?= ($content['name'] ? $content['name'] . '<small>(' . $content['id'] . ')</small>' : $_lang['module_resource_title']) ?>
191
+		<i class="fa fa-cogs"></i><?= ($content['name'] ? $content['name'].'<small>('.$content['id'].')</small>' : $_lang['module_resource_title']) ?>
192 192
 	</h1>
193 193
 
194 194
 	<?php echo $_style['actionbuttons']['dynamic']['close'] ?>
195 195
 
196 196
 	<div class="section">
197
-		<div class="sectionHeader"><?php echo $content["name"] . " - " . $_lang['module_resource_title']; ?></div>
197
+		<div class="sectionHeader"><?php echo $content["name"]." - ".$_lang['module_resource_title']; ?></div>
198 198
 		<div class="sectionBody">
199 199
 			<p><?php echo $_lang['module_resource_msg']; ?></p>
200 200
 			<br />
@@ -218,14 +218,14 @@  discard block
 block discarded – undo
218 218
 					LEFT JOIN {$tbl_site_snippets} AS ss ON ss.id = smd.resource AND smd.type = '40'
219 219
 					LEFT JOIN {$tbl_site_templates} AS st ON st.id = smd.resource AND smd.type = '50'
220 220
 					LEFT JOIN {$tbl_site_tmplvars} AS sv ON sv.id = smd.resource AND smd.type = '60'", "smd.module={$id}", "smd.type,name");
221
-						include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php";
221
+						include_once MODX_MANAGER_PATH."includes/controls/datagrid.class.php";
222 222
 						$grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items
223 223
 						$grd->noRecordMsg = $_lang["no_records_found"];
224 224
 						$grd->cssClass = "grid";
225 225
 						$grd->columnHeaderClass = "gridHeader";
226 226
 						$grd->itemClass = "gridItem";
227 227
 						$grd->altItemClass = "gridAltItem";
228
-						$grd->columns = $_lang["element_name"] . " ," . $_lang["type"];
228
+						$grd->columns = $_lang["element_name"]." ,".$_lang["type"];
229 229
 						$grd->colTypes = "template:<input type='checkbox' name='depid[]' value='[+id+]'> [+value+]";
230 230
 						$grd->fields = "name,type";
231 231
 						echo $grd->render();
Please login to merge, or discard this patch.
manager/actions/category_mgr/inc/Categories.php 1 patch
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
      */
10 10
     public $db;
11 11
     public $db_tbl   = array();
12
-    public $elements = array( 'templates', 'tmplvars', 'htmlsnippets', 'snippets', 'plugins', 'modules' );
12
+    public $elements = array('templates', 'tmplvars', 'htmlsnippets', 'snippets', 'plugins', 'modules');
13 13
 
14 14
     public function __construct()
15 15
     {
@@ -18,9 +18,9 @@  discard block
 block discarded – undo
18 18
         $this->db                   = & $modx->db;
19 19
         $this->db_tbl['categories'] = $modx->getFullTableName('categories');
20 20
 
21
-        foreach( $this->elements as $element )
21
+        foreach ($this->elements as $element)
22 22
         {
23
-            $this->db_tbl[$element] = $modx->getFullTableName('site_' . $element );
23
+            $this->db_tbl[$element] = $modx->getFullTableName('site_'.$element);
24 24
         }
25 25
     }
26 26
 
@@ -40,50 +40,50 @@  discard block
 block discarded – undo
40 40
             )
41 41
         );
42 42
 
43
-        return empty( $categories ) ? array() : $categories;
43
+        return empty($categories) ? array() : $categories;
44 44
     }
45 45
 
46
-    public function getCategory( $search, $where = 'category' )
46
+    public function getCategory($search, $where = 'category')
47 47
     {
48 48
         $category = $this->db->getRow(
49 49
             $this->db->select(
50 50
                 '*',
51 51
                 $this->db_tbl['categories'],
52
-                "`" . $where . "` = '" . $search . "'"
52
+                "`".$where."` = '".$search."'"
53 53
             )
54 54
         );
55 55
         return $category;
56 56
     }
57 57
 
58
-    public function getCategoryValue( $value, $search, $where = 'category' )
58
+    public function getCategoryValue($value, $search, $where = 'category')
59 59
     {
60 60
         $_value = $this->db->getValue(
61 61
             $this->db->select(
62
-                '`' . $value . '`',
62
+                '`'.$value.'`',
63 63
                 $this->db_tbl['categories'],
64
-                "`" . $where . "` = '" . $search . "'"
64
+                "`".$where."` = '".$search."'"
65 65
             )
66 66
         );
67 67
         return $_value;
68 68
     }
69 69
 
70
-    public function getAssignedElements( $category_id, $element )
70
+    public function getAssignedElements($category_id, $element)
71 71
     {
72
-        if( in_array( $element, $this->elements, true ) )
72
+        if (in_array($element, $this->elements, true))
73 73
         {
74 74
             $elements = $this->db->makeArray(
75 75
                 $this->db->select(
76 76
                     '*',
77 77
                     $this->db_tbl[$element],
78
-                    "`category` = '" . $category_id . "'"
78
+                    "`category` = '".$category_id."'"
79 79
                 )
80 80
             );
81 81
 
82 82
             // correct the name of templates
83
-            if( $element === 'templates' )
83
+            if ($element === 'templates')
84 84
             {
85 85
                 $_elements_count = count($elements);
86
-                for( $i=0; $i < $_elements_count; $i++ )
86
+                for ($i = 0; $i < $_elements_count; $i++)
87 87
                 {
88 88
                     $elements[$i]['name'] = $elements[$i]['templatename'];
89 89
                 }
@@ -93,56 +93,56 @@  discard block
 block discarded – undo
93 93
         return false;
94 94
     }
95 95
 
96
-    public function getAllAssignedElements( $category_id )
96
+    public function getAllAssignedElements($category_id)
97 97
     {
98 98
         $elements = array();
99
-        foreach( $this->elements as $element )
99
+        foreach ($this->elements as $element)
100 100
         {
101
-            $elements[$element] = $this->getAssignedElements( $category_id, $element );
101
+            $elements[$element] = $this->getAssignedElements($category_id, $element);
102 102
         }
103 103
         return $elements;
104 104
     }
105 105
 
106
-    public function deleteCategory( $category_id )
106
+    public function deleteCategory($category_id)
107 107
     {
108 108
         $_update = array('category' => 0);
109
-        foreach( $this->elements as $element )
109
+        foreach ($this->elements as $element)
110 110
         {
111 111
             $this->db->update(
112 112
                 $_update,
113 113
                 $this->db_tbl[$element],
114
-                "`category` = '" . $category_id . "'"
114
+                "`category` = '".$category_id."'"
115 115
             );
116 116
         }
117 117
 
118 118
         $this->db->delete(
119 119
             $this->db_tbl['categories'],
120
-            "`id` = '" . $category_id . "'"
120
+            "`id` = '".$category_id."'"
121 121
         );
122 122
 
123 123
         return $this->db->getAffectedRows() === 1;
124 124
     }
125 125
 
126
-    public function updateCategory( $category_id, $data = array() )
126
+    public function updateCategory($category_id, $data = array())
127 127
     {
128
-        if( empty( $data )
129
-            || empty( $category_id ) )
128
+        if (empty($data)
129
+            || empty($category_id))
130 130
         {
131 131
             return false;
132 132
         }
133 133
 
134 134
         $_update = array(
135
-            'category' => $this->db->escape( $data['category'] ),
136
-            'rank'     => (int)$data['rank']
135
+            'category' => $this->db->escape($data['category']),
136
+            'rank'     => (int) $data['rank']
137 137
         );
138 138
 
139 139
         $this->db->update(
140 140
             $_update,
141 141
             $this->db_tbl['categories'],
142
-            "`id` = '" . (int)$category_id . "'"
142
+            "`id` = '".(int) $category_id."'"
143 143
         );
144 144
 
145
-        if( $this->db->getAffectedRows() === 1 )
145
+        if ($this->db->getAffectedRows() === 1)
146 146
         {
147 147
             return true;
148 148
         }
@@ -150,16 +150,16 @@  discard block
 block discarded – undo
150 150
         return false;
151 151
     }
152 152
 
153
-    public function addCategory( $category_name, $category_rank )
153
+    public function addCategory($category_name, $category_rank)
154 154
     {
155
-        if( $this->isCategoryExists( $category_name ) )
155
+        if ($this->isCategoryExists($category_name))
156 156
         {
157 157
             return false;
158 158
         }
159 159
 
160 160
         $_insert = array(
161
-            'category' => $this->db->escape( $category_name ),
162
-            'rank'     => (int)$category_rank
161
+            'category' => $this->db->escape($category_name),
162
+            'rank'     => (int) $category_rank
163 163
         );
164 164
 
165 165
         $this->db->insert(
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
             $this->db_tbl['categories']
168 168
         );
169 169
 
170
-        if( $this->db->getAffectedRows() === 1 )
170
+        if ($this->db->getAffectedRows() === 1)
171 171
         {
172 172
             return $this->db->getInsertId();
173 173
         }
@@ -175,19 +175,19 @@  discard block
 block discarded – undo
175 175
         return false;
176 176
     }
177 177
 
178
-    public function isCategoryExists( $category_name )
178
+    public function isCategoryExists($category_name)
179 179
     {
180
-        $category = $this->db->escape( $category_name );
180
+        $category = $this->db->escape($category_name);
181 181
 
182 182
         $category_id = $this->db->getValue(
183 183
             $this->db->select(
184 184
                 '`id`',
185 185
                 $this->db_tbl['categories'],
186
-                "`category` = '" . $category . "'"
186
+                "`category` = '".$category."'"
187 187
             )
188 188
         );
189 189
 
190
-        if( $this->db->getAffectedRows() === 1 )
190
+        if ($this->db->getAffectedRows() === 1)
191 191
         {
192 192
             return $category_id;
193 193
         }
Please login to merge, or discard this patch.
manager/actions/mutate_plugin.dynamic.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
         $modx->webAlertAndQuit($_lang["error_no_privileges"]);
19 19
 }
20 20
 
21
-$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
21
+$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0;
22 22
 
23 23
 $tbl_site_plugins = $modx->getFullTableName('site_plugins');
24 24
 $tbl_site_plugin_events = $modx->getFullTableName('site_plugin_events');
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
     $content['properties'] = str_replace("&", "&amp;", $content['properties']);
47 47
 } else {
48 48
     $_SESSION['itemname'] = $_lang["new_plugin"];
49
-    $content['category'] = (int)$_REQUEST['catid'];
49
+    $content['category'] = (int) $_REQUEST['catid'];
50 50
 }
51 51
 
52 52
 if ($modx->manager->hasFormValues()) {
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 // Add lock-element JS-Script
57 57
 $lockElementId = $id;
58 58
 $lockElementType = 5;
59
-require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php');
59
+require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php');
60 60
 
61 61
 function bold($cond = false)
62 62
 {
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
     <input type="hidden" name="mode" value="<?= $modx->manager->action ?>">
479 479
 
480 480
     <h1>
481
-        <i class="fa fa-plug"></i><?= ($content['name'] ? $content['name'] . '<small>(' . $content['id'] . ')</small>' : $_lang['new_plugin']) ?><i class="fa fa-question-circle help"></i>
481
+        <i class="fa fa-plug"></i><?= ($content['name'] ? $content['name'].'<small>('.$content['id'].')</small>' : $_lang['new_plugin']) ?><i class="fa fa-question-circle help"></i>
482 482
     </h1>
483 483
 
484 484
     <?= $_style['actionbuttons']['dynamic']['element'] ?>
@@ -504,7 +504,7 @@  discard block
 block discarded – undo
504 504
                             <div class="form-control-name clearfix">
505 505
                                 <input name="name" type="text" maxlength="100" value="<?= $modx->htmlspecialchars($content['name']) ?>" class="form-control form-control-lg" onchange="documentDirty=true;" />
506 506
                                 <?php if ($modx->hasPermission('save_role')): ?>
507
-                                <label class="custom-control" title="<?= $_lang['lock_plugin'] . "\n" . $_lang['lock_plugin_msg'] ?>" tooltip>
507
+                                <label class="custom-control" title="<?= $_lang['lock_plugin']."\n".$_lang['lock_plugin_msg'] ?>" tooltip>
508 508
                                     <input name="locked" type="checkbox" value="on"<?= ($content['locked'] == 1 ? ' checked="checked"' : '') ?> />
509 509
                                     <i class="fa fa-lock"></i>
510 510
                                 </label>
@@ -528,9 +528,9 @@  discard block
 block discarded – undo
528 528
                             <select name="categoryid" class="form-control" onchange="documentDirty=true;">
529 529
                                 <option>&nbsp;</option>
530 530
                                 <?php
531
-                                include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
531
+                                include_once(MODX_MANAGER_PATH.'includes/categories.inc.php');
532 532
                                 foreach (getCategories() as $n => $v) {
533
-                                    echo '<option value="' . $v['id'] . '"' . ($content["category"] == $v["id"] ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($v["category"]) . "</option>";
533
+                                    echo '<option value="'.$v['id'].'"'.($content["category"] == $v["id"] ? ' selected="selected"' : '').'>'.$modx->htmlspecialchars($v["category"])."</option>";
534 534
                                 }
535 535
                                 ?>
536 536
                             </select>
@@ -546,7 +546,7 @@  discard block
 block discarded – undo
546 546
                 <?php if ($modx->hasPermission('save_role')): ?>
547 547
                 <div class="form-group">
548 548
                     <div class="form-row">
549
-                        <label><input name="disabled" type="checkbox" value="on"<?= ($content['disabled'] == 1 ? ' checked="checked"' : '') ?> /> <?= ($content['disabled'] == 1 ? "<span class='text-danger'>" . $_lang['plugin_disabled'] . "</span>" : $_lang['plugin_disabled']) ?></label>
549
+                        <label><input name="disabled" type="checkbox" value="on"<?= ($content['disabled'] == 1 ? ' checked="checked"' : '') ?> /> <?= ($content['disabled'] == 1 ? "<span class='text-danger'>".$_lang['plugin_disabled']."</span>" : $_lang['plugin_disabled']) ?></label>
550 550
                     </div>
551 551
                     <div class="form-row">
552 552
                         <label>
@@ -593,11 +593,11 @@  discard block
 block discarded – undo
593 593
                             <select name="moduleguid" class="form-control" onchange="documentDirty=true;">
594 594
                                 <option>&nbsp;</option>
595 595
                                 <?php
596
-                                $ds = $modx->db->select('sm.id,sm.name,sm.guid', $modx->getFullTableName("site_modules") . " sm 
597
-								INNER JOIN " . $modx->getFullTableName("site_module_depobj") . " smd ON smd.module=sm.id AND smd.type=30
598
-								INNER JOIN " . $modx->getFullTableName("site_plugins") . " sp ON sp.id=smd.resource", "smd.resource='{$id}' AND sm.enable_sharedparams='1'", 'sm.name');
596
+                                $ds = $modx->db->select('sm.id,sm.name,sm.guid', $modx->getFullTableName("site_modules")." sm 
597
+								INNER JOIN " . $modx->getFullTableName("site_module_depobj")." smd ON smd.module=sm.id AND smd.type=30
598
+								INNER JOIN " . $modx->getFullTableName("site_plugins")." sp ON sp.id=smd.resource", "smd.resource='{$id}' AND sm.enable_sharedparams='1'", 'sm.name');
599 599
                                 while ($row = $modx->db->getRow($ds)) {
600
-                                    echo "<option value='" . $row['guid'] . "'" . ($content["moduleguid"] == $row["guid"] ? " selected='selected'" : "") . ">" . $modx->htmlspecialchars($row["name"]) . "</option>";
600
+                                    echo "<option value='".$row['guid']."'".($content["moduleguid"] == $row["guid"] ? " selected='selected'" : "").">".$modx->htmlspecialchars($row["name"])."</option>";
601 601
                                 }
602 602
                                 ?>
603 603
                             </select>
@@ -658,7 +658,7 @@  discard block
 block discarded – undo
658 658
                                 echoEventRows($evtnames);
659 659
                             }
660 660
                             echo '<hr class="clear">';
661
-                            echo '<div class="form-group"><b>' . $services[$srv - 1] . '</b></div>';
661
+                            echo '<div class="form-group"><b>'.$services[$srv - 1].'</b></div>';
662 662
                         }
663 663
                         // display group name
664 664
                         if ($grp != $row['groupname']) {
@@ -667,9 +667,9 @@  discard block
 block discarded – undo
667 667
                                 echoEventRows($evtnames);
668 668
                             }
669 669
                             echo '<hr class="clear">';
670
-                            echo '<div class="form-group"><b>' . $row['groupname'] . '</b></div>';
670
+                            echo '<div class="form-group"><b>'.$row['groupname'].'</b></div>';
671 671
                         }
672
-                        $evtnames[] = '<input name="sysevents[]" id="' . $row['name'] . '" type="checkbox" ' . (in_array($row['id'], $evts) ? ' checked="checked" ' : '') . 'class="inputBox" value="' . $row['id'] . '" /> <label for="' . $row['name'] . '" ' . bold(in_array($row['id'], $evts)) . '> ' . $row['name'] . '</label>' . "\n";
672
+                        $evtnames[] = '<input name="sysevents[]" id="'.$row['name'].'" type="checkbox" '.(in_array($row['id'], $evts) ? ' checked="checked" ' : '').'class="inputBox" value="'.$row['id'].'" /> <label for="'.$row['name'].'" '.bold(in_array($row['id'], $evts)).'> '.$row['name'].'</label>'."\n";
673 673
                         if (count($evtnames) == 2) {
674 674
                             echoEventRows($evtnames);
675 675
                         }
@@ -681,7 +681,7 @@  discard block
 block discarded – undo
681 681
 
682 682
                 function echoEventRows(&$evtnames)
683 683
                 {
684
-                    echo '<div class="row form-row"><div class="col-sm-6 col-md-4 col-lg-3">' . implode('</div><div class="col-sm-6 col-md-4 col-lg-3">', $evtnames) . '</div></div>';
684
+                    echo '<div class="row form-row"><div class="col-sm-6 col-md-4 col-lg-3">'.implode('</div><div class="col-sm-6 col-md-4 col-lg-3">', $evtnames).'</div></div>';
685 685
                     $evtnames = array();
686 686
                 }
687 687
 
Please login to merge, or discard this patch.
manager/actions/mutate_snippet.dynamic.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
         $modx->webAlertAndQuit($_lang["error_no_privileges"]);
19 19
 }
20 20
 
21
-$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
21
+$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0;
22 22
 
23 23
 // Get table Names (alphabetical)
24 24
 $tbl_site_module_depobj = $modx->getFullTableName('site_module_depobj');
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
     $rs = $modx->db->select('*', $tbl_site_snippets, "id='{$id}'");
40 40
     $content = $modx->db->getRow($rs);
41 41
     if (!$content) {
42
-        header("Location: " . MODX_SITE_URL . "index.php?id=" . $site_start);
42
+        header("Location: ".MODX_SITE_URL."index.php?id=".$site_start);
43 43
     }
44 44
     $_SESSION['itemname'] = $content['name'];
45 45
     if ($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
     $content['name'] = $_REQUEST['itemname'];
51 51
 } else {
52 52
     $_SESSION['itemname'] = $_lang["new_snippet"];
53
-    $content['category'] = (int)$_REQUEST['catid'];
53
+    $content['category'] = (int) $_REQUEST['catid'];
54 54
 }
55 55
 
56 56
 if ($modx->manager->hasFormValues()) {
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 // Add lock-element JS-Script
63 63
 $lockElementId = $id;
64 64
 $lockElementType = 4;
65
-require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php');
65
+require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php');
66 66
 ?>
67 67
 <script type="text/javascript">
68 68
 
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
     <input type="hidden" name="mode" value="<?= $modx->manager->action ?>">
432 432
 
433 433
     <h1 class="pagetitle">
434
-        <i class="fa fa-code"></i><?= ($content['name'] ? $content['name'] . '<small>(' . $content['id'] . ')</small>' : $_lang['new_snippet']) ?><i class="fa fa-question-circle help"></i>
434
+        <i class="fa fa-code"></i><?= ($content['name'] ? $content['name'].'<small>('.$content['id'].')</small>' : $_lang['new_snippet']) ?><i class="fa fa-question-circle help"></i>
435 435
     </h1>
436 436
 
437 437
     <?= $_style['actionbuttons']['dynamic']['element'] ?>
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
                             <div class="form-control-name clearfix">
458 458
                                 <input name="name" type="text" maxlength="100" value="<?= $modx->htmlspecialchars($content['name']) ?>" class="form-control form-control-lg" onchange="documentDirty=true;" />
459 459
                                 <?php if ($modx->hasPermission('save_role')): ?>
460
-                                    <label class="custom-control" title="<?= $_lang['lock_snippet'] . "\n" . $_lang['lock_snippet_msg'] ?>" tooltip>
460
+                                    <label class="custom-control" title="<?= $_lang['lock_snippet']."\n".$_lang['lock_snippet_msg'] ?>" tooltip>
461 461
                                         <input name="locked" type="checkbox"<?= ($content['locked'] == 1 ? ' checked="checked"' : '') ?> />
462 462
                                         <i class="fa fa-lock"></i>
463 463
                                     </label>
@@ -481,9 +481,9 @@  discard block
 block discarded – undo
481 481
                             <select name="categoryid" class="form-control" onchange="documentDirty=true;">
482 482
                                 <option>&nbsp;</option>
483 483
                                 <?php
484
-                                include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
484
+                                include_once(MODX_MANAGER_PATH.'includes/categories.inc.php');
485 485
                                 foreach (getCategories() as $n => $v) {
486
-                                    echo '<option value="' . $v['id'] . '"' . ($content['category'] == $v['id'] ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($v['category']) . '</option>';
486
+                                    echo '<option value="'.$v['id'].'"'.($content['category'] == $v['id'] ? ' selected="selected"' : '').'>'.$modx->htmlspecialchars($v['category']).'</option>';
487 487
                                 }
488 488
                                 ?>
489 489
                             </select>
@@ -500,7 +500,7 @@  discard block
 block discarded – undo
500 500
                     <div class="form-group">
501 501
                         <?php if ($_SESSION['mgrRole'] == 1): ?>
502 502
                             <div class="form-row">
503
-                                <label><input name="disabled" type="checkbox" value="on"<?= ($content['disabled'] == 1 ? ' checked="checked"' : '') ?> /> <?= ($content['disabled'] == 1 ? "<span class='text-danger'>" . $_lang['disabled'] . "</span>" : $_lang['disabled']) ?></label>
503
+                                <label><input name="disabled" type="checkbox" value="on"<?= ($content['disabled'] == 1 ? ' checked="checked"' : '') ?> /> <?= ($content['disabled'] == 1 ? "<span class='text-danger'>".$_lang['disabled']."</span>" : $_lang['disabled']) ?></label>
504 504
                             </div>
505 505
                         <?php endif; ?>
506 506
                         <div class="form-row">
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
                 <span><?= $_lang['snippet_code'] ?></span>
518 518
             </div>
519 519
             <div class="section-editor clearfix">
520
-                <textarea dir="ltr" name="post" class="phptextarea" rows="20" wrap="soft" onchange="documentDirty=true;"><?= (isset($content['post']) ? trim($modx->htmlspecialchars($content['post'])) : "<?php" . "\n" . trim($modx->htmlspecialchars($content['snippet'])) . "\n") ?></textarea>
520
+                <textarea dir="ltr" name="post" class="phptextarea" rows="20" wrap="soft" onchange="documentDirty=true;"><?= (isset($content['post']) ? trim($modx->htmlspecialchars($content['post'])) : "<?php"."\n".trim($modx->htmlspecialchars($content['snippet']))."\n") ?></textarea>
521 521
             </div>
522 522
             <!-- PHP text editor end -->
523 523
         </div>
@@ -552,7 +552,7 @@  discard block
 block discarded – undo
552 552
 								INNER JOIN {$tbl_site_module_depobj} AS smd ON smd.module=sm.id AND smd.type=40 
553 553
 								INNER JOIN {$tbl_site_snippets} AS ss ON ss.id=smd.resource", "smd.resource='{$id}' AND sm.enable_sharedparams=1", 'sm.name');
554 554
                                 while ($row = $modx->db->getRow($ds)) {
555
-                                    echo "<option value='" . $row['guid'] . "'" . ($content['moduleguid'] == $row['guid'] ? " selected='selected'" : "") . ">" . $modx->htmlspecialchars($row['name']) . "</option>";
555
+                                    echo "<option value='".$row['guid']."'".($content['moduleguid'] == $row['guid'] ? " selected='selected'" : "").">".$modx->htmlspecialchars($row['name'])."</option>";
556 556
                                 }
557 557
                                 ?>
558 558
                             </select>
Please login to merge, or discard this patch.