Completed
Push — develop ( e575c7...d51988 )
by
unknown
15s
created
manager/processors/duplicate_plugin.processor.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -3,12 +3,12 @@  discard block
 block discarded – undo
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if(!$modx->hasPermission('new_plugin')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 $id = isset($_GET['id'])? (int)$_GET['id'] : 0;
10 10
 if($id==0) {
11
-	$modx->webAlertAndQuit($_lang["error_no_id"]);
11
+    $modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
14 14
 // count duplicates
@@ -19,25 +19,25 @@  discard block
 block discarded – undo
19 19
 
20 20
 // duplicate Plugin
21 21
 $newid = $modx->db->insert(
22
-	array(
23
-		'name'=>'',
24
-		'description'=>'',
25
-		'disabled'=>'',
26
-		'moduleguid'=>'',
27
-		'plugincode'=>'',
28
-		'properties'=>'',
29
-		'category'=>'',
30
-		), $modx->getFullTableName('site_plugins'), // Insert into
31
-	"CONCAT(name, ' {$_lang['duplicated_el_suffix']}{$count}') AS name, description, '1' AS disabled, moduleguid, plugincode, properties, category", $modx->getFullTableName('site_plugins'), "id='{$id}'"); // Copy from
22
+    array(
23
+        'name'=>'',
24
+        'description'=>'',
25
+        'disabled'=>'',
26
+        'moduleguid'=>'',
27
+        'plugincode'=>'',
28
+        'properties'=>'',
29
+        'category'=>'',
30
+        ), $modx->getFullTableName('site_plugins'), // Insert into
31
+    "CONCAT(name, ' {$_lang['duplicated_el_suffix']}{$count}') AS name, description, '1' AS disabled, moduleguid, plugincode, properties, category", $modx->getFullTableName('site_plugins'), "id='{$id}'"); // Copy from
32 32
 
33 33
 // duplicate Plugin Event Listeners
34 34
 $modx->db->insert(
35
-	array(
36
-		'pluginid'=>'',
37
-		'evtid'=>'',
38
-		'priority'=>'',
39
-		), $modx->getFullTableName('site_plugin_events'), // Insert into
40
-	"'{$newid}', evtid, priority", $modx->getFullTableName('site_plugin_events'), "pluginid='{$id}'"); // Copy from
35
+    array(
36
+        'pluginid'=>'',
37
+        'evtid'=>'',
38
+        'priority'=>'',
39
+        ), $modx->getFullTableName('site_plugin_events'), // Insert into
40
+    "'{$newid}', evtid, priority", $modx->getFullTableName('site_plugin_events'), "pluginid='{$id}'"); // Copy from
41 41
 
42 42
 // Set the item name for logger
43 43
 $name = $modx->db->getValue($modx->db->select('name', $modx->getFullTableName('site_plugins'), "id='{$newid}'"));
Please login to merge, or discard this patch.
manager/processors/delete_user.processor.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -3,17 +3,17 @@  discard block
 block discarded – undo
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if(!$modx->hasPermission('delete_user')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 $id = isset($_GET['id'])? (int)$_GET['id'] : 0;
10 10
 if($id==0) {
11
-	$modx->webAlertAndQuit($_lang["error_no_id"]);
11
+    $modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
14 14
 // delete the user, but first check if we are deleting our own record
15 15
 if($id==$modx->getLoginUserID()) {
16
-	$modx->webAlertAndQuit("You can't delete yourself!");
16
+    $modx->webAlertAndQuit("You can't delete yourself!");
17 17
 }
18 18
 
19 19
 // Set the item name for logger
@@ -22,9 +22,9 @@  discard block
 block discarded – undo
22 22
 
23 23
 // invoke OnBeforeUserFormDelete event
24 24
 $modx->invokeEvent("OnBeforeUserFormDelete",
25
-	array(
26
-		"id"	=> $id
27
-	));
25
+    array(
26
+        "id"	=> $id
27
+    ));
28 28
 
29 29
 // delete the user.
30 30
 $modx->db->delete($modx->getFullTableName('manager_users'), "id='{$id}'");
@@ -39,16 +39,16 @@  discard block
 block discarded – undo
39 39
 
40 40
 // invoke OnManagerDeleteUser event
41 41
 $modx->invokeEvent("OnManagerDeleteUser",
42
-	array(
43
-		"userid"		=> $id,
44
-		"username"		=> $username
45
-	));
42
+    array(
43
+        "userid"		=> $id,
44
+        "username"		=> $username
45
+    ));
46 46
 
47 47
 // invoke OnUserFormDelete event
48 48
 $modx->invokeEvent("OnUserFormDelete",
49
-	array(
50
-		"id"	=> $id
51
-	));
49
+    array(
50
+        "id"	=> $id
51
+    ));
52 52
 
53 53
 $header="Location: index.php?a=75";
54 54
 header($header);
Please login to merge, or discard this patch.
manager/processors/duplicate_snippet.processor.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -3,12 +3,12 @@  discard block
 block discarded – undo
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if(!$modx->hasPermission('new_snippet')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 $id = isset($_GET['id'])? (int)$_GET['id'] : 0;
10 10
 if($id==0) {
11
-	$modx->webAlertAndQuit($_lang["error_no_id"]);
11
+    $modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
14 14
 // count duplicates
@@ -19,14 +19,14 @@  discard block
 block discarded – undo
19 19
 
20 20
 // duplicate Snippet
21 21
 $newid = $modx->db->insert(
22
-	array(
23
-		'name'=>'',
24
-		'description'=>'',
25
-		'snippet'=>'',
26
-		'properties'=>'',
27
-		'category'=>'',
28
-		), $modx->getFullTableName('site_snippets'), // Insert into
29
-	"CONCAT(name, ' {$_lang['duplicated_el_suffix']}{$count}') AS name, description, snippet, properties, category", $modx->getFullTableName('site_snippets'), "id='{$id}'"); // Copy from
22
+    array(
23
+        'name'=>'',
24
+        'description'=>'',
25
+        'snippet'=>'',
26
+        'properties'=>'',
27
+        'category'=>'',
28
+        ), $modx->getFullTableName('site_snippets'), // Insert into
29
+    "CONCAT(name, ' {$_lang['duplicated_el_suffix']}{$count}') AS name, description, snippet, properties, category", $modx->getFullTableName('site_snippets'), "id='{$id}'"); // Copy from
30 30
 
31 31
 // Set the item name for logger
32 32
 $name = $modx->db->getValue($modx->db->select('name', $modx->getFullTableName('site_snippets'), "id='{$newid}'"));
Please login to merge, or discard this patch.
manager/processors/unpublish_content.processor.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -3,12 +3,12 @@  discard block
 block discarded – undo
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if(!$modx->hasPermission('save_document')||!$modx->hasPermission('publish_document')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 $id = isset($_REQUEST['id'])? (int)$_REQUEST['id'] : 0;
10 10
 if($id==0) {
11
-	$modx->webAlertAndQuit($_lang["error_no_id"]);
11
+    $modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
14 14
 /************webber ********/
@@ -33,20 +33,20 @@  discard block
 block discarded – undo
33 33
 $udperms->role = $_SESSION['mgrRole'];
34 34
 
35 35
 if(!$udperms->checkPermissions()) {
36
-	$modx->webAlertAndQuit($_lang["access_permission_denied"]);
36
+    $modx->webAlertAndQuit($_lang["access_permission_denied"]);
37 37
 }
38 38
 
39 39
 // update the document
40 40
 $modx->db->update(
41
-	array(
42
-		'published'   => 0,
43
-		'pub_date'    => 0,
44
-		'unpub_date'  => 0,
45
-		'editedby'    => $modx->getLoginUserID(),
46
-		'editedon'    => time(),
47
-		'publishedby' => 0,
48
-		'publishedon' => 0,
49
-	), $modx->getFullTableName('site_content'), "id='{$id}'");
41
+    array(
42
+        'published'   => 0,
43
+        'pub_date'    => 0,
44
+        'unpub_date'  => 0,
45
+        'editedby'    => $modx->getLoginUserID(),
46
+        'editedon'    => time(),
47
+        'publishedby' => 0,
48
+        'publishedon' => 0,
49
+    ), $modx->getFullTableName('site_content'), "id='{$id}'");
50 50
 
51 51
 // invoke OnDocUnPublished  event
52 52
 $modx->invokeEvent("OnDocUnPublished",array("docid"=>$id));
Please login to merge, or discard this patch.
manager/processors/delete_module.processor.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -3,12 +3,12 @@  discard block
 block discarded – undo
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if(!$modx->hasPermission('delete_module')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 $id = isset($_GET['id'])? (int)$_GET['id'] : 0;
10 10
 if($id==0) {
11
-	$modx->webAlertAndQuit($_lang["error_no_id"]);
11
+    $modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
14 14
 // Set the item name for logger
@@ -17,9 +17,9 @@  discard block
 block discarded – undo
17 17
 
18 18
 // invoke OnBeforeModFormDelete event
19 19
 $modx->invokeEvent("OnBeforeModFormDelete",
20
-	array(
21
-		"id"	=> $id
22
-	));
20
+    array(
21
+        "id"	=> $id
22
+    ));
23 23
 
24 24
 // delete the module.
25 25
 $modx->db->delete($modx->getFullTableName('site_modules'), "id='{$id}'");
@@ -32,9 +32,9 @@  discard block
 block discarded – undo
32 32
 
33 33
 // invoke OnModFormDelete event
34 34
 $modx->invokeEvent("OnModFormDelete",
35
-	array(
36
-		"id"	=> $id
37
-	));
35
+    array(
36
+        "id"	=> $id
37
+    ));
38 38
 
39 39
 // empty cache
40 40
 $modx->clearCache('full');
Please login to merge, or discard this patch.
install/setup.info.php 1 patch
Indentation   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -170,70 +170,70 @@
 block discarded – undo
170 170
                 array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : false
171 171
             );
172 172
         }
173
-		if ((int)$params['shareparams'] || !empty($params['dependencies'])) {
174
-			$dependencies = explode(',', $params['dependencies']);
175
-			foreach ($dependencies as $dependency) {
176
-				$dependency = explode(':', $dependency);
177
-				switch (trim($dependency[0])) {
178
-					case 'template':
179
-						$mdp[] = array(
180
-							'module' => $params['name'],
181
-							'table' => 'templates',
182
-							'column' => 'templatename',
183
-							'type' => 50,
184
-							'name' => trim($dependency[1])
185
-						);
186
-						break;
187
-					case 'tv':
188
-					case 'tmplvar':
189
-						$mdp[] = array(
190
-							'module' => $params['name'],
191
-							'table' => 'tmplvars',
192
-							'column' => 'name',
193
-							'type' => 60,
194
-							'name' => trim($dependency[1])
195
-						);
196
-						break;
197
-					case 'chunk':
198
-					case 'htmlsnippet':
199
-						$mdp[] = array(
200
-							'module' => $params['name'],
201
-							'table' => 'htmlsnippets',
202
-							'column' => 'name',
203
-							'type' => 10,
204
-							'name' => trim($dependency[1])
205
-						);
206
-						break;
207
-					case 'snippet':
208
-						$mdp[] = array(
209
-							'module' => $params['name'],
210
-							'table' => 'snippets',
211
-							'column' => 'name',
212
-							'type' => 40,
213
-							'name' => trim($dependency[1])
214
-						);
215
-						break;
216
-					case 'plugin':
217
-						$mdp[] = array(
218
-							'module' => $params['name'],
219
-							'table' => 'plugins',
220
-							'column' => 'name',
221
-							'type' => 30,
222
-							'name' => trim($dependency[1])
223
-						);
224
-						break;
225
-					case 'resource':
226
-						$mdp[] = array(
227
-							'module' => $params['name'],
228
-							'table' => 'content',
229
-							'column' => 'pagetitle',
230
-							'type' => 20,
231
-							'name' => trim($dependency[1])
232
-						);
233
-						break;
234
-				}
235
-			}
236
-		}
173
+        if ((int)$params['shareparams'] || !empty($params['dependencies'])) {
174
+            $dependencies = explode(',', $params['dependencies']);
175
+            foreach ($dependencies as $dependency) {
176
+                $dependency = explode(':', $dependency);
177
+                switch (trim($dependency[0])) {
178
+                    case 'template':
179
+                        $mdp[] = array(
180
+                            'module' => $params['name'],
181
+                            'table' => 'templates',
182
+                            'column' => 'templatename',
183
+                            'type' => 50,
184
+                            'name' => trim($dependency[1])
185
+                        );
186
+                        break;
187
+                    case 'tv':
188
+                    case 'tmplvar':
189
+                        $mdp[] = array(
190
+                            'module' => $params['name'],
191
+                            'table' => 'tmplvars',
192
+                            'column' => 'name',
193
+                            'type' => 60,
194
+                            'name' => trim($dependency[1])
195
+                        );
196
+                        break;
197
+                    case 'chunk':
198
+                    case 'htmlsnippet':
199
+                        $mdp[] = array(
200
+                            'module' => $params['name'],
201
+                            'table' => 'htmlsnippets',
202
+                            'column' => 'name',
203
+                            'type' => 10,
204
+                            'name' => trim($dependency[1])
205
+                        );
206
+                        break;
207
+                    case 'snippet':
208
+                        $mdp[] = array(
209
+                            'module' => $params['name'],
210
+                            'table' => 'snippets',
211
+                            'column' => 'name',
212
+                            'type' => 40,
213
+                            'name' => trim($dependency[1])
214
+                        );
215
+                        break;
216
+                    case 'plugin':
217
+                        $mdp[] = array(
218
+                            'module' => $params['name'],
219
+                            'table' => 'plugins',
220
+                            'column' => 'name',
221
+                            'type' => 30,
222
+                            'name' => trim($dependency[1])
223
+                        );
224
+                        break;
225
+                    case 'resource':
226
+                        $mdp[] = array(
227
+                            'module' => $params['name'],
228
+                            'table' => 'content',
229
+                            'column' => 'pagetitle',
230
+                            'type' => 20,
231
+                            'name' => trim($dependency[1])
232
+                        );
233
+                        break;
234
+                }
235
+            }
236
+        }
237 237
     }
238 238
     $d->close();
239 239
 }
Please login to merge, or discard this patch.
manager/actions/mutate_tmplvars.dynamic.php 1 patch
Indentation   +117 added lines, -117 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3
-	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
3
+    die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if(!$modx->hasPermission('edit_template') && $modx->manager->action == '301') {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 if(!$modx->hasPermission('new_template') && $modx->manager->action == '300') {
9
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
9
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
10 10
 }
11 11
 
12 12
 $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 
21 21
 // check to see the snippet editor isn't locked
22 22
 if($lockedEl = $modx->elementIsLocked(2, $id)) {
23
-	$modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['tmplvar']));
23
+    $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['tmplvar']));
24 24
 }
25 25
 // end check for lock
26 26
 
@@ -30,25 +30,25 @@  discard block
 block discarded – undo
30 30
 global $content;
31 31
 $content = array();
32 32
 if(isset($_GET['id'])) {
33
-	$rs = $modx->db->select('*', $tbl_site_tmplvars, "id='{$id}'");
34
-	$content = $modx->db->getRow($rs);
35
-	if(!$content) {
36
-		header("Location: " . MODX_SITE_URL . "index.php?id={$site_start}");
37
-	}
38
-
39
-	$_SESSION['itemname'] = $content['caption'];
40
-	if($content['locked'] == 1 && $modx->hasPermission('save_role') != 1) {
41
-		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
42
-	}
33
+    $rs = $modx->db->select('*', $tbl_site_tmplvars, "id='{$id}'");
34
+    $content = $modx->db->getRow($rs);
35
+    if(!$content) {
36
+        header("Location: " . MODX_SITE_URL . "index.php?id={$site_start}");
37
+    }
38
+
39
+    $_SESSION['itemname'] = $content['caption'];
40
+    if($content['locked'] == 1 && $modx->hasPermission('save_role') != 1) {
41
+        $modx->webAlertAndQuit($_lang["error_no_privileges"]);
42
+    }
43 43
 } else if(isset($_REQUEST['itemname'])) {
44
-	$content['name'] = $_REQUEST['itemname'];
44
+    $content['name'] = $_REQUEST['itemname'];
45 45
 } else {
46
-	$_SESSION['itemname'] = $_lang["new_tmplvars"];
47
-	$content['category'] = (int)$_REQUEST['catid'];
46
+    $_SESSION['itemname'] = $_lang["new_tmplvars"];
47
+    $content['category'] = (int)$_REQUEST['catid'];
48 48
 }
49 49
 
50 50
 if($modx->manager->hasFormValues()) {
51
-	$modx->manager->loadFormValues();
51
+    $modx->manager->loadFormValues();
52 52
 }
53 53
 
54 54
 $content = array_merge($content, $_POST);
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 $RTEditors = '';
63 63
 $evtOut = $modx->invokeEvent('OnRichTextEditorRegister', array('forfrontend' => 1));
64 64
 if(is_array($evtOut)) {
65
-	$RTEditors = implode(',', $evtOut);
65
+    $RTEditors = implode(',', $evtOut);
66 66
 }
67 67
 
68 68
 ?>
@@ -277,12 +277,12 @@  discard block
 block discarded – undo
277 277
 
278 278
 <form name="mutate" method="post" action="index.php" enctype="multipart/form-data">
279 279
 	<?php
280
-	// invoke OnTVFormPrerender event
281
-	$evtOut = $modx->invokeEvent('OnTVFormPrerender', array('id' => $id));
282
-	if(is_array($evtOut)) {
283
-		echo implode("", $evtOut);
284
-	}
285
-	?>
280
+    // invoke OnTVFormPrerender event
281
+    $evtOut = $modx->invokeEvent('OnTVFormPrerender', array('id' => $id));
282
+    if(is_array($evtOut)) {
283
+        echo implode("", $evtOut);
284
+    }
285
+    ?>
286 286
 	<input type="hidden" name="id" value="<?= $content['id'] ?>">
287 287
 	<input type="hidden" name="a" value="302">
288 288
 	<input type="hidden" name="or" value="<?= $origin ?>">
@@ -343,11 +343,11 @@  discard block
 block discarded – undo
343 343
 						<select name="categoryid" class="form-control" onChange="documentDirty=true;">
344 344
 							<option>&nbsp;</option>
345 345
 							<?php
346
-							include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
347
-							foreach(getCategories() as $n => $v) {
348
-								echo "<option value='" . $v['id'] . "'" . ($content["category"] == $v["id"] ? " selected='selected'" : "") . ">" . $modx->htmlspecialchars($v["category"]) . "</option>";
349
-							}
350
-							?>
346
+                            include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
347
+                            foreach(getCategories() as $n => $v) {
348
+                                echo "<option value='" . $v['id'] . "'" . ($content["category"] == $v["id"] ? " selected='selected'" : "") . ">" . $modx->htmlspecialchars($v["category"]) . "</option>";
349
+                            }
350
+                            ?>
351 351
 						</select>
352 352
 					</div>
353 353
 				</div>
@@ -383,14 +383,14 @@  discard block
 block discarded – undo
383 383
 							<optgroup label="Custom Type">
384 384
 								<option value="custom_tv" <?= ($content['type'] == 'custom_tv' ? "selected='selected'" : "") ?>>Custom Input</option>
385 385
 								<?php
386
-								$custom_tvs = scandir(MODX_BASE_PATH . 'assets/tvs');
387
-								foreach($custom_tvs as $ctv) {
388
-									if(strpos($ctv, '.') !== 0 && $ctv != 'index.html') {
389
-										$selected = ($content['type'] == 'custom_tv:' . $ctv ? "selected='selected'" : "");
390
-										echo '<option value="custom_tv:' . $ctv . '"  ' . $selected . '>' . $ctv . '</option>';
391
-									}
392
-								}
393
-								?>
386
+                                $custom_tvs = scandir(MODX_BASE_PATH . 'assets/tvs');
387
+                                foreach($custom_tvs as $ctv) {
388
+                                    if(strpos($ctv, '.') !== 0 && $ctv != 'index.html') {
389
+                                        $selected = ($content['type'] == 'custom_tv:' . $ctv ? "selected='selected'" : "");
390
+                                        echo '<option value="custom_tv:' . $ctv . '"  ' . $selected . '>' . $ctv . '</option>';
391
+                                    }
392
+                                }
393
+                                ?>
394 394
 							</optgroup>
395 395
 						</select>
396 396
 					</div>
@@ -455,63 +455,63 @@  discard block
 block discarded – undo
455 455
 					<a class="btn btn-secondary btn-sm" href="javascript:;" onClick="check_toggle(); return false;"><?= $_lang['check_toggle'] ?></a>
456 456
 				</div>
457 457
 				<?php
458
-				$rs = $modx->db->select(sprintf("tpl.id AS id, templatename, tpl.description AS tpldescription, tpl.locked AS tpllocked, tpl.selectable AS selectable, tmplvarid, if(isnull(cat.category),'%s',cat.category) AS category, cat.id AS catid", $_lang['no_category']), sprintf("%s as tpl
458
+                $rs = $modx->db->select(sprintf("tpl.id AS id, templatename, tpl.description AS tpldescription, tpl.locked AS tpllocked, tpl.selectable AS selectable, tmplvarid, if(isnull(cat.category),'%s',cat.category) AS category, cat.id AS catid", $_lang['no_category']), sprintf("%s as tpl
459 459
                     LEFT JOIN %s as stt ON stt.templateid=tpl.id AND stt.tmplvarid='%s'
460 460
                     LEFT JOIN %s as cat ON tpl.category=cat.id", $modx->getFullTableName('site_templates'), $modx->getFullTableName('site_tmplvar_templates'), $id, $modx->getFullTableName('categories')), '', "category, templatename");
461 461
 
462
-				$tplList = '<ul>';
463
-				$preCat = '';
464
-				$insideUl = 0;
465
-				while($row = $modx->db->getRow($rs)) {
466
-					$row['category'] = stripslashes($row['category']); //pixelchutes
467
-					if($preCat !== $row['category']) {
468
-						$tplList .= $insideUl ? '</ul>' : '';
469
-						$tplList .= '<li><strong>' . $row['category'] . ($row['catid'] != '' ? ' <small>(' . $row['catid'] . ')</small>' : '') . '</strong><ul>';
470
-						$insideUl = 1;
471
-					}
472
-
473
-					if($modx->manager->action == '300' && $modx->config['default_template'] == $row['id']) {
474
-						$checked = true;
475
-					} elseif(isset($_GET['tpl']) && $_GET['tpl'] == $row['id']) {
476
-						$checked = true;
477
-					} elseif($id == 0 && is_array($_POST['template'])) {
478
-						$checked = in_array($row['id'], $_POST['template']);
479
-					} else {
480
-						$checked = $row['tmplvarid'];
481
-					}
482
-					$selectable = !$row['selectable'] ? ' class="disabled"' : '';
483
-					$checked = $checked ? ' checked="checked"' : '';
484
-					$tplId = '&nbsp;<small>(' . $row['id'] . ')</small>';
485
-					$desc = !empty($row['tpldescription']) ? ' - ' . $row['tpldescription'] : '';
486
-
487
-					$tplInfo = array();
488
-					if($row['tpllocked']) {
489
-						$tplInfo[] = $_lang['locked'];
490
-					}
491
-					if($row['id'] == $modx->config['default_template']) {
492
-						$tplInfo[] = $_lang['defaulttemplate_title'];
493
-					}
494
-					$tplInfo = !empty($tplInfo) ? ' <em>(' . implode(', ', $tplInfo) . ')</em>' : '';
495
-
496
-					$tplList .= sprintf('<li><label%s><input name="template[]" value="%s" type="checkbox" %s onchange="documentDirty=true;"> %s%s%s%s</label></li>', $selectable, $row['id'], $checked, $row['templatename'], $tplId, $desc, $tplInfo);
497
-					$tplList .= '</li>';
498
-
499
-					$preCat = $row['category'];
500
-				}
501
-				$tplList .= $insideUl ? '</ul>' : '';
502
-				$tplList .= '</ul>';
503
-				echo $tplList;
504
-
505
-				?>
462
+                $tplList = '<ul>';
463
+                $preCat = '';
464
+                $insideUl = 0;
465
+                while($row = $modx->db->getRow($rs)) {
466
+                    $row['category'] = stripslashes($row['category']); //pixelchutes
467
+                    if($preCat !== $row['category']) {
468
+                        $tplList .= $insideUl ? '</ul>' : '';
469
+                        $tplList .= '<li><strong>' . $row['category'] . ($row['catid'] != '' ? ' <small>(' . $row['catid'] . ')</small>' : '') . '</strong><ul>';
470
+                        $insideUl = 1;
471
+                    }
472
+
473
+                    if($modx->manager->action == '300' && $modx->config['default_template'] == $row['id']) {
474
+                        $checked = true;
475
+                    } elseif(isset($_GET['tpl']) && $_GET['tpl'] == $row['id']) {
476
+                        $checked = true;
477
+                    } elseif($id == 0 && is_array($_POST['template'])) {
478
+                        $checked = in_array($row['id'], $_POST['template']);
479
+                    } else {
480
+                        $checked = $row['tmplvarid'];
481
+                    }
482
+                    $selectable = !$row['selectable'] ? ' class="disabled"' : '';
483
+                    $checked = $checked ? ' checked="checked"' : '';
484
+                    $tplId = '&nbsp;<small>(' . $row['id'] . ')</small>';
485
+                    $desc = !empty($row['tpldescription']) ? ' - ' . $row['tpldescription'] : '';
486
+
487
+                    $tplInfo = array();
488
+                    if($row['tpllocked']) {
489
+                        $tplInfo[] = $_lang['locked'];
490
+                    }
491
+                    if($row['id'] == $modx->config['default_template']) {
492
+                        $tplInfo[] = $_lang['defaulttemplate_title'];
493
+                    }
494
+                    $tplInfo = !empty($tplInfo) ? ' <em>(' . implode(', ', $tplInfo) . ')</em>' : '';
495
+
496
+                    $tplList .= sprintf('<li><label%s><input name="template[]" value="%s" type="checkbox" %s onchange="documentDirty=true;"> %s%s%s%s</label></li>', $selectable, $row['id'], $checked, $row['templatename'], $tplId, $desc, $tplInfo);
497
+                    $tplList .= '</li>';
498
+
499
+                    $preCat = $row['category'];
500
+                }
501
+                $tplList .= $insideUl ? '</ul>' : '';
502
+                $tplList .= '</ul>';
503
+                echo $tplList;
504
+
505
+                ?>
506 506
 
507 507
 				<!-- Access Permissions -->
508 508
 				<?php
509
-				if($use_udperms == 1) {
510
-					// fetch permissions for the variable
511
-					$rs = $modx->db->select('documentgroup', $modx->getFullTableName('site_tmplvar_access'), "tmplvarid='{$id}'");
512
-					$groupsarray = $modx->db->getColumn('documentgroup', $rs);
509
+                if($use_udperms == 1) {
510
+                    // fetch permissions for the variable
511
+                    $rs = $modx->db->select('documentgroup', $modx->getFullTableName('site_tmplvar_access'), "tmplvarid='{$id}'");
512
+                    $groupsarray = $modx->db->getColumn('documentgroup', $rs);
513 513
 
514
-					?>
514
+                    ?>
515 515
 					<?php if($modx->hasPermission('access_permissions')) { ?>
516 516
 						<script type="text/javascript">
517 517
 							function makePublic(b) {
@@ -539,29 +539,29 @@  discard block
 block discarded – undo
539 539
 						<!--<b><?php /*echo $_lang['access_permissions']; */ ?></b>-->
540 540
 						<p><?= $_lang['tmplvar_access_msg'] ?></p>
541 541
 						<?php
542
-						$chk = '';
543
-						$rs = $modx->db->select('name, id', $tbl_documentgroup_names);
544
-						if(empty($groupsarray) && is_array($_POST['docgroups']) && empty($_POST['id'])) {
545
-							$groupsarray = $_POST['docgroups'];
546
-						}
547
-						while($row = $modx->db->getRow($rs)) {
548
-							$checked = in_array($row['id'], $groupsarray);
549
-							if($modx->hasPermission('access_permissions')) {
550
-								if($checked) {
551
-									$notPublic = true;
552
-								}
553
-								$chks .= "<li><label><input type='checkbox' name='docgroups[]' value='" . $row['id'] . "' " . ($checked ? "checked='checked'" : '') . " onclick=\"makePublic(false)\" /> " . $row['name'] . "</label></li>";
554
-							} else {
555
-								if($checked) {
556
-									echo "<input type='hidden' name='docgroups[]'  value='" . $row['id'] . "' />";
557
-								}
558
-							}
559
-						}
560
-						if($modx->hasPermission('access_permissions')) {
561
-							$chks = "<li><label><input type='checkbox' name='chkalldocs' " . (!$notPublic ? "checked='checked'" : '') . " onclick=\"makePublic(true)\" /> <span class='warning'>" . $_lang['all_doc_groups'] . "</span></label></li>" . $chks;
562
-						}
563
-						echo '<ul>' . $chks . '</ul>';
564
-						?>
542
+                        $chk = '';
543
+                        $rs = $modx->db->select('name, id', $tbl_documentgroup_names);
544
+                        if(empty($groupsarray) && is_array($_POST['docgroups']) && empty($_POST['id'])) {
545
+                            $groupsarray = $_POST['docgroups'];
546
+                        }
547
+                        while($row = $modx->db->getRow($rs)) {
548
+                            $checked = in_array($row['id'], $groupsarray);
549
+                            if($modx->hasPermission('access_permissions')) {
550
+                                if($checked) {
551
+                                    $notPublic = true;
552
+                                }
553
+                                $chks .= "<li><label><input type='checkbox' name='docgroups[]' value='" . $row['id'] . "' " . ($checked ? "checked='checked'" : '') . " onclick=\"makePublic(false)\" /> " . $row['name'] . "</label></li>";
554
+                            } else {
555
+                                if($checked) {
556
+                                    echo "<input type='hidden' name='docgroups[]'  value='" . $row['id'] . "' />";
557
+                                }
558
+                            }
559
+                        }
560
+                        if($modx->hasPermission('access_permissions')) {
561
+                            $chks = "<li><label><input type='checkbox' name='chkalldocs' " . (!$notPublic ? "checked='checked'" : '') . " onclick=\"makePublic(true)\" /> <span class='warning'>" . $_lang['all_doc_groups'] . "</span></label></li>" . $chks;
562
+                        }
563
+                        echo '<ul>' . $chks . '</ul>';
564
+                        ?>
565 565
 					<?php } ?>
566 566
 				<?php } ?>
567 567
 
@@ -571,12 +571,12 @@  discard block
 block discarded – undo
571 571
 		<input type="submit" name="save" style="display:none">
572 572
 
573 573
 		<?php
574
-		// invoke OnTVFormRender event
575
-		$evtOut = $modx->invokeEvent('OnTVFormRender', array('id' => $id));
576
-		if(is_array($evtOut)) {
577
-			echo implode('', $evtOut);
578
-		}
579
-		?>
574
+        // invoke OnTVFormRender event
575
+        $evtOut = $modx->invokeEvent('OnTVFormRender', array('id' => $id));
576
+        if(is_array($evtOut)) {
577
+            echo implode('', $evtOut);
578
+        }
579
+        ?>
580 580
 	</div>
581 581
 </form>
582 582
 <script type="text/javascript">setTimeout('showParameters()', 10);</script>
Please login to merge, or discard this patch.
manager/includes/config_check.inc.php 1 patch
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -5,14 +5,14 @@  discard block
 block discarded – undo
5 5
 
6 6
 // PROCESSOR FIRST
7 7
 if($_SESSION['mgrRole'] == 1) {
8
-	if($_REQUEST['b'] == 'resetSysfilesChecksum' && $modx->hasPermission('settings')) {
9
-		$current = $modx->manager->getSystemChecksum($modx->config['check_files_onlogin']);
10
-		if(!empty($current)) {
11
-			$modx->manager->setSystemChecksum($current);
12
-			$modx->clearCache('full');
13
-			$modx->config['sys_files_checksum'] = $current;
14
-		};
15
-	}
8
+    if($_REQUEST['b'] == 'resetSysfilesChecksum' && $modx->hasPermission('settings')) {
9
+        $current = $modx->manager->getSystemChecksum($modx->config['check_files_onlogin']);
10
+        if(!empty($current)) {
11
+            $modx->manager->setSystemChecksum($current);
12
+            $modx->clearCache('full');
13
+            $modx->config['sys_files_checksum'] = $current;
14
+        };
15
+    }
16 16
 }
17 17
 
18 18
 // NOW CHECK CONFIG
@@ -20,15 +20,15 @@  discard block
 block discarded – undo
20 20
 
21 21
 $sysfiles_check = $modx->manager->checkSystemChecksum();
22 22
 if ($sysfiles_check!=='0'){
23
-      $warningspresent = 1;
24
-      $warnings[] = array($_lang['configcheck_sysfiles_mod']);
23
+        $warningspresent = 1;
24
+        $warnings[] = array($_lang['configcheck_sysfiles_mod']);
25 25
 }
26 26
 
27 27
 if (is_writable("includes/config.inc.php")){
28 28
     // Warn if world writable
29 29
     if(@fileperms('includes/config.inc.php') & 0x0002) {
30
-      $warningspresent = 1;
31
-      $warnings[] = array($_lang['configcheck_configinc']);
30
+        $warningspresent = 1;
31
+        $warnings[] = array($_lang['configcheck_configinc']);
32 32
     }
33 33
 }
34 34
 
@@ -179,10 +179,10 @@  discard block
 block discarded – undo
179 179
             break;
180 180
         case $_lang['configcheck_sysfiles_mod']:
181 181
             $warnings[$i][1] = $_lang["configcheck_sysfiles_mod_msg"];
182
-			$warnings[$i][2] = '<ul><li>'. implode('</li><li>', $sysfiles_check) .'</li></ul>';
183
-			if($modx->hasPermission('settings')) {
184
-				$warnings[$i][2] .= '<ul class="actionButtons" style="float:right"><li><a href="index.php?a=2&b=resetSysfilesChecksum" onclick="return confirm(\'' . $_lang["reset_sysfiles_checksum_alert"] . '\')">' . $_lang["reset_sysfiles_checksum_button"] . '</a></li></ul>';
185
-			}
182
+            $warnings[$i][2] = '<ul><li>'. implode('</li><li>', $sysfiles_check) .'</li></ul>';
183
+            if($modx->hasPermission('settings')) {
184
+                $warnings[$i][2] .= '<ul class="actionButtons" style="float:right"><li><a href="index.php?a=2&b=resetSysfilesChecksum" onclick="return confirm(\'' . $_lang["reset_sysfiles_checksum_alert"] . '\')">' . $_lang["reset_sysfiles_checksum_button"] . '</a></li></ul>';
185
+            }
186 186
             if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1]." ".implode(', ',$sysfiles_check),$_lang['configcheck_sysfiles_mod']);
187 187
             break;
188 188
         case $_lang['configcheck_lang_difference'] :
Please login to merge, or discard this patch.
manager/actions/resources/functions.inc.php 1 patch
Indentation   +165 added lines, -165 removed lines patch added patch discarded remove patch
@@ -1,14 +1,14 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3
-	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
3
+    die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 
6 6
 $tpl = array(
7
-	'viewForm' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_viewForm.tpl'),
8
-	'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'),
9
-	'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'),
10
-	'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'),
11
-	'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl')
7
+    'viewForm' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_viewForm.tpl'),
8
+    'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'),
9
+    'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'),
10
+    'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'),
11
+    'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl')
12 12
 );
13 13
 
14 14
 /**
@@ -17,9 +17,9 @@  discard block
 block discarded – undo
17 17
  * @return string
18 18
  */
19 19
 function parsePh($tpl, $ph) {
20
-	global $modx, $_lang;
21
-	$tpl = $modx->parseText($tpl, $_lang, '[%', '%]');
22
-	return $modx->parseText($tpl, $ph);
20
+    global $modx, $_lang;
21
+    $tpl = $modx->parseText($tpl, $_lang, '[%', '%]');
22
+    return $modx->parseText($tpl, $ph);
23 23
 }
24 24
 
25 25
 /**
@@ -27,11 +27,11 @@  discard block
 block discarded – undo
27 27
  * @return string
28 28
  */
29 29
 function renderViewSwitchButtons($cssId) {
30
-	global $modx, $_lang, $tpl;
30
+    global $modx, $_lang, $tpl;
31 31
 
32
-	return parsePh($tpl['viewForm'], array(
33
-		'cssId' => $cssId
34
-	));
32
+    return parsePh($tpl['viewForm'], array(
33
+        'cssId' => $cssId
34
+    ));
35 35
 }
36 36
 
37 37
 /**
@@ -40,52 +40,52 @@  discard block
 block discarded – undo
40 40
  * @return string
41 41
  */
42 42
 function createResourceList($resourceTable, $resources) {
43
-	global $modx, $_lang, $_style, $modx_textdir, $tpl;
43
+    global $modx, $_lang, $_style, $modx_textdir, $tpl;
44 44
 
45
-	$items = isset($resources->items[$resourceTable]) ? $resources->items[$resourceTable] : false;
45
+    $items = isset($resources->items[$resourceTable]) ? $resources->items[$resourceTable] : false;
46 46
 
47
-	if( ! is_array($items) || empty($items)) {
48
-		return $_lang['no_results'];
49
-	}
47
+    if( ! is_array($items) || empty($items)) {
48
+        return $_lang['no_results'];
49
+    }
50 50
 
51
-	// Prepare elements- and categories-list
52
-	$elements = array();
53
-	$categories = array();
54
-	foreach($items as $row) {
55
-		$catid = $row['catid'] ? $row['catid'] : 0;
56
-		$categories[$catid] = array('name' => stripslashes($row['category']));
57
-		$elements[$catid][] = prepareElementRowPh($row, $resourceTable, $resources);
58
-	}
51
+    // Prepare elements- and categories-list
52
+    $elements = array();
53
+    $categories = array();
54
+    foreach($items as $row) {
55
+        $catid = $row['catid'] ? $row['catid'] : 0;
56
+        $categories[$catid] = array('name' => stripslashes($row['category']));
57
+        $elements[$catid][] = prepareElementRowPh($row, $resourceTable, $resources);
58
+    }
59 59
 
60
-	// Now render categories / panel-collapse
61
-	$panelGroup = '';
62
-	foreach($elements as $catid => $elList) {
63
-		// Add panel-heading / category-collapse to output
64
-		$panelGroup .= parsePh($tpl['panelHeading'], array(
65
-			'tab' => $resourceTable,
66
-			'category' => $categories[$catid]['name'],
67
-			'categoryid' => $catid != '' ? ' <small>(' . $catid . ')</small>' : '',
68
-			'catid' => $catid,
69
-		));
60
+    // Now render categories / panel-collapse
61
+    $panelGroup = '';
62
+    foreach($elements as $catid => $elList) {
63
+        // Add panel-heading / category-collapse to output
64
+        $panelGroup .= parsePh($tpl['panelHeading'], array(
65
+            'tab' => $resourceTable,
66
+            'category' => $categories[$catid]['name'],
67
+            'categoryid' => $catid != '' ? ' <small>(' . $catid . ')</small>' : '',
68
+            'catid' => $catid,
69
+        ));
70 70
 
71
-		// Prepare content for panel-collapse
72
-		$panelCollapse = '';
73
-		foreach($elList as $el) {
74
-			$panelCollapse .= parsePh($tpl['elementsRow'], $el);
75
-		}
71
+        // Prepare content for panel-collapse
72
+        $panelCollapse = '';
73
+        foreach($elList as $el) {
74
+            $panelCollapse .= parsePh($tpl['elementsRow'], $el);
75
+        }
76 76
 
77
-		// Add panel-collapse with elements to output
78
-		$panelGroup .= parsePh($tpl['panelCollapse'], array(
79
-			'tab' => $resourceTable,
80
-			'catid' => $catid,
81
-			'wrapper' => $panelCollapse,
82
-		));
83
-	}
77
+        // Add panel-collapse with elements to output
78
+        $panelGroup .= parsePh($tpl['panelCollapse'], array(
79
+            'tab' => $resourceTable,
80
+            'catid' => $catid,
81
+            'wrapper' => $panelCollapse,
82
+        ));
83
+    }
84 84
 
85
-	return parsePh($tpl['panelGroup'], array(
86
-		'resourceTable' => $resourceTable,
87
-		'wrapper' => $panelGroup
88
-	));
85
+    return parsePh($tpl['panelGroup'], array(
86
+        'resourceTable' => $resourceTable,
87
+        'wrapper' => $panelGroup
88
+    ));
89 89
 }
90 90
 
91 91
 /**
@@ -93,54 +93,54 @@  discard block
 block discarded – undo
93 93
  * @return string
94 94
  */
95 95
 function createCombinedView($resources) {
96
-	global $modx, $_lang, $_style, $modx_textdir;
96
+    global $modx, $_lang, $_style, $modx_textdir;
97 97
 
98
-	$itemsPerCategory = isset($resources->itemsPerCategory) ? $resources->itemsPerCategory : false;
99
-	$types = isset($resources->types) ? $resources->types : false;
100
-	$categories = isset($resources->categories) ? $resources->categories : false;
98
+    $itemsPerCategory = isset($resources->itemsPerCategory) ? $resources->itemsPerCategory : false;
99
+    $types = isset($resources->types) ? $resources->types : false;
100
+    $categories = isset($resources->categories) ? $resources->categories : false;
101 101
 
102
-	if(!$itemsPerCategory) {
103
-		return $_lang['no_results'];
104
-	}
102
+    if(!$itemsPerCategory) {
103
+        return $_lang['no_results'];
104
+    }
105 105
 
106
-	$tpl = array(
107
-		'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'),
108
-		'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'),
109
-		'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'),
110
-		'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl'),
111
-	);
106
+    $tpl = array(
107
+        'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'),
108
+        'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'),
109
+        'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'),
110
+        'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl'),
111
+    );
112 112
 
113
-	// Easily loop through $itemsPerCategory-Array
114
-	$panelGroup = '';
115
-	foreach($categories as $catid => $category) {
116
-		// Prepare collapse content / elements-list
117
-		$panelCollapse = '';
118
-		foreach($itemsPerCategory[$catid] as $el) {
119
-			$resourceTable = $el['type'];
120
-			$ph = prepareElementRowPh($el, $resourceTable, $resources);
121
-			$panelCollapse .= parsePh($tpl['elementsRow'], $ph);
122
-		}
113
+    // Easily loop through $itemsPerCategory-Array
114
+    $panelGroup = '';
115
+    foreach($categories as $catid => $category) {
116
+        // Prepare collapse content / elements-list
117
+        $panelCollapse = '';
118
+        foreach($itemsPerCategory[$catid] as $el) {
119
+            $resourceTable = $el['type'];
120
+            $ph = prepareElementRowPh($el, $resourceTable, $resources);
121
+            $panelCollapse .= parsePh($tpl['elementsRow'], $ph);
122
+        }
123 123
 
124
-		// Add panel-heading / button
125
-		$panelGroup .= parsePh($tpl['panelHeading'], array(
126
-			'tab' => 'categories_list',
127
-			'category' => $categories[$catid],
128
-			'categoryid' => $catid != '' ? ' <small>(' . $catid . ')</small>' : '',
129
-			'catid' => $catid,
130
-		));
124
+        // Add panel-heading / button
125
+        $panelGroup .= parsePh($tpl['panelHeading'], array(
126
+            'tab' => 'categories_list',
127
+            'category' => $categories[$catid],
128
+            'categoryid' => $catid != '' ? ' <small>(' . $catid . ')</small>' : '',
129
+            'catid' => $catid,
130
+        ));
131 131
 
132
-		// Add panel
133
-		$panelGroup .= parsePh($tpl['panelCollapse'], array(
134
-			'tab' => 'categories_list',
135
-			'catid' => $catid,
136
-			'wrapper' => $panelCollapse,
137
-		));
138
-	}
132
+        // Add panel
133
+        $panelGroup .= parsePh($tpl['panelCollapse'], array(
134
+            'tab' => 'categories_list',
135
+            'catid' => $catid,
136
+            'wrapper' => $panelCollapse,
137
+        ));
138
+    }
139 139
 
140
-	return parsePh($tpl['panelGroup'], array(
141
-		'resourceTable' => 'categories_list',
142
-		'wrapper' => $panelGroup
143
-	));
140
+    return parsePh($tpl['panelGroup'], array(
141
+        'resourceTable' => 'categories_list',
142
+        'wrapper' => $panelGroup
143
+    ));
144 144
 }
145 145
 
146 146
 /**
@@ -150,13 +150,13 @@  discard block
 block discarded – undo
150 150
  * @return array
151 151
  */
152 152
 function prepareElementRowPh($row, $resourceTable, $resources) {
153
-	global $modx, $modx_textdir, $_style, $_lang;
153
+    global $modx, $modx_textdir, $_style, $_lang;
154 154
 
155
-	$types = isset($resources->types[$resourceTable]) ? $resources->types[$resourceTable] : false;
155
+    $types = isset($resources->types[$resourceTable]) ? $resources->types[$resourceTable] : false;
156 156
 
157
-	$_lang["confirm_delete"] = $_lang["delete"];
157
+    $_lang["confirm_delete"] = $_lang["delete"];
158 158
 
159
-	switch($resourceTable){
159
+    switch($resourceTable){
160 160
         case 'site_templates':
161 161
             $class = $row['selectable'] ? '' : 'disabledPlugin';
162 162
             $lockElementType = 1;
@@ -190,77 +190,77 @@  discard block
 block discarded – undo
190 190
             return array();
191 191
     }
192 192
 
193
-	// Prepare displaying user-locks
194
-	$lockedByUser = '';
195
-	$rowLock = $modx->elementIsLocked($lockElementType, $row['id'], true);
196
-	if($rowLock && $modx->hasPermission('display_locks')) {
197
-		if($rowLock['sid'] == $modx->sid) {
198
-			$title = $modx->parseText($_lang["lock_element_editing"], array(
199
-				'element_type' => $_lang["lock_element_type_" . $lockElementType],
200
-				'lasthit_df' => $rowLock['lasthit_df']
201
-			));
202
-			$lockedByUser = '<span title="' . $title . '" class="editResource" style="cursor:context-menu;">' . $_style['tree_preview_resource'] . '</span>&nbsp;';
203
-		} else {
204
-			$title = $modx->parseText($_lang["lock_element_locked_by"], array(
205
-				'element_type' => $_lang["lock_element_type_" . $lockElementType],
206
-				'username' => $rowLock['username'],
207
-				'lasthit_df' => $rowLock['lasthit_df']
208
-			));
209
-			if($modx->hasPermission('remove_locks')) {
210
-				$lockedByUser = '<a href="javascript:;" onclick="unlockElement(' . $lockElementType . ', ' . $row['id'] . ', this);return false;" title="' . $title . '" class="lockedResource"><i class="' . $_style['icons_secured'] . '"></i></a>';
211
-			} else {
212
-				$lockedByUser = '<span title="' . $title . '" class="lockedResource" style="cursor:context-menu;"><i class="' . $_style['icons_secured'] . '"></i></span>';
213
-			}
214
-		}
215
-	}
216
-	if($lockedByUser) {
217
-		$lockedByUser = '<div class="lockCell">' . $lockedByUser . '</div>';
218
-	}
193
+    // Prepare displaying user-locks
194
+    $lockedByUser = '';
195
+    $rowLock = $modx->elementIsLocked($lockElementType, $row['id'], true);
196
+    if($rowLock && $modx->hasPermission('display_locks')) {
197
+        if($rowLock['sid'] == $modx->sid) {
198
+            $title = $modx->parseText($_lang["lock_element_editing"], array(
199
+                'element_type' => $_lang["lock_element_type_" . $lockElementType],
200
+                'lasthit_df' => $rowLock['lasthit_df']
201
+            ));
202
+            $lockedByUser = '<span title="' . $title . '" class="editResource" style="cursor:context-menu;">' . $_style['tree_preview_resource'] . '</span>&nbsp;';
203
+        } else {
204
+            $title = $modx->parseText($_lang["lock_element_locked_by"], array(
205
+                'element_type' => $_lang["lock_element_type_" . $lockElementType],
206
+                'username' => $rowLock['username'],
207
+                'lasthit_df' => $rowLock['lasthit_df']
208
+            ));
209
+            if($modx->hasPermission('remove_locks')) {
210
+                $lockedByUser = '<a href="javascript:;" onclick="unlockElement(' . $lockElementType . ', ' . $row['id'] . ', this);return false;" title="' . $title . '" class="lockedResource"><i class="' . $_style['icons_secured'] . '"></i></a>';
211
+            } else {
212
+                $lockedByUser = '<span title="' . $title . '" class="lockedResource" style="cursor:context-menu;"><i class="' . $_style['icons_secured'] . '"></i></span>';
213
+            }
214
+        }
215
+    }
216
+    if($lockedByUser) {
217
+        $lockedByUser = '<div class="lockCell">' . $lockedByUser . '</div>';
218
+    }
219 219
 
220
-	// Caption
221
-	if($resourceTable == 'site_tmplvars') {
222
-		$caption = !empty($row['description']) ? ' ' . $row['caption'] . ' &nbsp; <small>(' . $row['description'] . ')</small>' : ' ' . $row['caption'];
223
-	} else {
224
-		$caption = !empty($row['description']) ? ' ' . $row['description'] : '';
225
-	}
220
+    // Caption
221
+    if($resourceTable == 'site_tmplvars') {
222
+        $caption = !empty($row['description']) ? ' ' . $row['caption'] . ' &nbsp; <small>(' . $row['description'] . ')</small>' : ' ' . $row['caption'];
223
+    } else {
224
+        $caption = !empty($row['description']) ? ' ' . $row['description'] : '';
225
+    }
226 226
 
227
-	// Special marks
228
-	$tplInfo = array();
229
-	if($row['locked']) {
230
-		$tplInfo[] = $_lang['locked'];
231
-	}
232
-	if($row['id'] == $modx->config['default_template'] && $resourceTable == 'site_templates') {
233
-		$tplInfo[] = $_lang['defaulttemplate_title'];
234
-	}
235
-	$marks = !empty($tplInfo) ? ' <em>(' . implode(', ', $tplInfo) . ')</em>' : '';
227
+    // Special marks
228
+    $tplInfo = array();
229
+    if($row['locked']) {
230
+        $tplInfo[] = $_lang['locked'];
231
+    }
232
+    if($row['id'] == $modx->config['default_template'] && $resourceTable == 'site_templates') {
233
+        $tplInfo[] = $_lang['defaulttemplate_title'];
234
+    }
235
+    $marks = !empty($tplInfo) ? ' <em>(' . implode(', ', $tplInfo) . ')</em>' : '';
236 236
 
237
-	/* row buttons */
238
-	$buttons = '';
239
-	if($modx->hasPermission($types['actions']['edit'][1])) {
240
-		$buttons .= '<li><a title="' . $_lang["edit_resource"] . '" href="index.php?a=' . $types['actions']['edit'][0] . '&amp;id=' . $row['id'] . '"><i class="fa fa-edit fa-fw"></i></a></li>';
241
-	}
242
-	if($modx->hasPermission($types['actions']['duplicate'][1])) {
243
-		$buttons .= '<li><a onclick="return confirm(\'' . $_lang["confirm_duplicate_record"] . '\')" title="' . $_lang["resource_duplicate"] . '" href="index.php?a=' . $types['actions']['duplicate'][0] . '&amp;id=' . $row['id'] . '"><i class="fa fa-clone fa-fw"></i></a></li>';
244
-	}
245
-	if($modx->hasPermission($types['actions']['remove'][1])) {
246
-		$buttons .= '<li><a onclick="return confirm(\'' . $_lang["confirm_delete"] . '\')" title="' . $_lang["delete"] . '" href="index.php?a=' . $types['actions']['remove'][0] . '&amp;id=' . $row['id'] . '"><i class="fa fa-trash fa-fw"></i></a></li>';
247
-	}
248
-	$buttons = $buttons ? '<div class="btnCell"><ul class="elements_buttonbar">' . $buttons . '</ul></div>' : '';
237
+    /* row buttons */
238
+    $buttons = '';
239
+    if($modx->hasPermission($types['actions']['edit'][1])) {
240
+        $buttons .= '<li><a title="' . $_lang["edit_resource"] . '" href="index.php?a=' . $types['actions']['edit'][0] . '&amp;id=' . $row['id'] . '"><i class="fa fa-edit fa-fw"></i></a></li>';
241
+    }
242
+    if($modx->hasPermission($types['actions']['duplicate'][1])) {
243
+        $buttons .= '<li><a onclick="return confirm(\'' . $_lang["confirm_duplicate_record"] . '\')" title="' . $_lang["resource_duplicate"] . '" href="index.php?a=' . $types['actions']['duplicate'][0] . '&amp;id=' . $row['id'] . '"><i class="fa fa-clone fa-fw"></i></a></li>';
244
+    }
245
+    if($modx->hasPermission($types['actions']['remove'][1])) {
246
+        $buttons .= '<li><a onclick="return confirm(\'' . $_lang["confirm_delete"] . '\')" title="' . $_lang["delete"] . '" href="index.php?a=' . $types['actions']['remove'][0] . '&amp;id=' . $row['id'] . '"><i class="fa fa-trash fa-fw"></i></a></li>';
247
+    }
248
+    $buttons = $buttons ? '<div class="btnCell"><ul class="elements_buttonbar">' . $buttons . '</ul></div>' : '';
249 249
 
250
-	$catid = $row['catid'] ? $row['catid'] : 0;
250
+    $catid = $row['catid'] ? $row['catid'] : 0;
251 251
 
252
-	// Placeholders for elements-row
253
-	return array(
254
-		'class' => $class ? ' class="' . $class . '"' : '',
255
-		'lockedByUser' => $lockedByUser,
256
-		'name' => $row['name'],
257
-		'caption' => $caption,
258
-		'buttons' => $buttons,
259
-		'marks' => $marks,
260
-		'id' => $row['id'],
261
-		'resourceTable' => $resourceTable,
262
-		'actionEdit' => $types['actions']['edit'][0],
263
-		'catid' => $catid,
264
-		'textdir' => $modx_textdir ? '&rlm;' : '',
265
-	);
252
+    // Placeholders for elements-row
253
+    return array(
254
+        'class' => $class ? ' class="' . $class . '"' : '',
255
+        'lockedByUser' => $lockedByUser,
256
+        'name' => $row['name'],
257
+        'caption' => $caption,
258
+        'buttons' => $buttons,
259
+        'marks' => $marks,
260
+        'id' => $row['id'],
261
+        'resourceTable' => $resourceTable,
262
+        'actionEdit' => $types['actions']['edit'][0],
263
+        'catid' => $catid,
264
+        'textdir' => $modx_textdir ? '&rlm;' : '',
265
+    );
266 266
 }
Please login to merge, or discard this patch.