Completed
Pull Request — develop (#725)
by Agel_Nash
08:07
created
manager/actions/document_data.static.php 2 patches
Indentation   +151 added lines, -151 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@  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
 if(isset($_REQUEST['id'])) {
7
-	$id = (int) $_REQUEST['id'];
7
+    $id = (int) $_REQUEST['id'];
8 8
 } else {
9
-	$id = 0;
9
+    $id = 0;
10 10
 }
11 11
 
12 12
 if(isset($_GET['opened'])) {
13
-	$_SESSION['openedArray'] = $_GET['opened'];
13
+    $_SESSION['openedArray'] = $_GET['opened'];
14 14
 }
15 15
 
16 16
 $url = $modx->config['site_url'];
@@ -23,17 +23,17 @@  discard block
 block discarded – undo
23 23
 
24 24
 // Get access permissions
25 25
 if($_SESSION['mgrDocgroups']) {
26
-	$docgrp = implode(",", $_SESSION['mgrDocgroups']);
26
+    $docgrp = implode(",", $_SESSION['mgrDocgroups']);
27 27
 }
28 28
 $access = "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0" . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)");
29 29
 
30 30
 //
31 31
 if($_SESSION['tree_show_only_folders']) {
32
-	$parent = $id ? ($modx->getDatabase()->getValue("SELECT parent FROM " . $tbl_site_content . " WHERE id=$id LIMIT 1")) : 0;
33
-	$isfolder = $modx->getDatabase()->getValue("SELECT isfolder FROM " . $tbl_site_content . " WHERE id=$id LIMIT 1");
34
-	if(!$isfolder && $parent != 0) {
35
-		$id = $_REQUEST['id'] = $parent;
36
-	}
32
+    $parent = $id ? ($modx->getDatabase()->getValue("SELECT parent FROM " . $tbl_site_content . " WHERE id=$id LIMIT 1")) : 0;
33
+    $isfolder = $modx->getDatabase()->getValue("SELECT isfolder FROM " . $tbl_site_content . " WHERE id=$id LIMIT 1");
34
+    if(!$isfolder && $parent != 0) {
35
+        $id = $_REQUEST['id'] = $parent;
36
+    }
37 37
 }
38 38
 
39 39
 // Get the document content
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 		LEFT JOIN {$tbl_document_groups} AS dg ON dg.document = sc.id", "sc.id ='{$id}' AND ({$access})");
42 42
 $content = $modx->getDatabase()->getRow($rs);
43 43
 if(!$content) {
44
-	$modx->webAlertAndQuit($_lang["access_permission_denied"]);
44
+    $modx->webAlertAndQuit($_lang["access_permission_denied"]);
45 45
 }
46 46
 
47 47
 /**
@@ -83,134 +83,134 @@  discard block
 block discarded – undo
83 83
 $filter_sort = '';
84 84
 $filter_dir = '';
85 85
 if($numRecords > 0) {
86
-	$filter_sort = '<select size="1" name="sort" class="form-control form-control-sm" onchange="document.location=\'index.php?a=3&id=' . $id . '&dir=' . $dir . '&sort=\'+this.options[this.selectedIndex].value">' . '<option value="createdon"' . (($sort == 'createdon') ? ' selected' : '') . '>' . $_lang['createdon'] . '</option>' . '<option value="pub_date"' . (($sort == 'pub_date') ? ' selected' : '') . '>' . $_lang["page_data_publishdate"] . '</option>' . '<option value="pagetitle"' . (($sort == 'pagetitle') ? ' selected' : '') . '>' . $_lang['pagetitle'] . '</option>' . '<option value="menuindex"' . (($sort == 'menuindex') ? ' selected' : '') . '>' . $_lang['resource_opt_menu_index'] . '</option>' . //********  resource_opt_is_published - //
87
-		'<option value="published"' . (($sort == 'published') ? ' selected' : '') . '>' . $_lang['resource_opt_is_published'] . '</option>' . //********//
88
-		'</select>';
89
-	$filter_dir = '<select size="1" name="dir" class="form-control form-control-sm" onchange="document.location=\'index.php?a=3&id=' . $id . '&sort=' . $sort . '&dir=\'+this.options[this.selectedIndex].value">' . '<option value="DESC"' . (($dir == 'DESC') ? ' selected' : '') . '>' . $_lang['sort_desc'] . '</option>' . '<option value="ASC"' . (($dir == 'ASC') ? ' selected' : '') . '>' . $_lang['sort_asc'] . '</option>' . '</select>';
90
-	$resource = $modx->getDatabase()->makeArray($rs);
91
-
92
-	// CSS style for table
93
-	//	$tableClass = 'grid';
94
-	//	$rowHeaderClass = 'gridHeader';
95
-	//	$rowRegularClass = 'gridItem';
96
-	//	$rowAlternateClass = 'gridAltItem';
97
-	$tableClass = 'table data nowrap';
98
-	$columnHeaderClass = array(
99
-		'text-center',
100
-		'text-left',
101
-		'text-center',
102
-		'text-center',
103
-		'text-center',
104
-		'text-center'
105
-	);
106
-
107
-
108
-	$modx->getMakeTable()->setTableClass($tableClass);
109
-	$modx->getMakeTable()->setColumnHeaderClass($columnHeaderClass);
110
-	//	$modx->getMakeTable()->setRowHeaderClass($rowHeaderClass);
111
-	//	$modx->getMakeTable()->setRowRegularClass($rowRegularClass);
112
-	//	$modx->getMakeTable()->setRowAlternateClass($rowAlternateClass);
113
-
114
-	// Table header
115
-	$listTableHeader = array(
116
-		'docid' => $_lang['id'],
117
-		'title' => $_lang['resource_title'],
118
-		'createdon' => $_lang['createdon'],
119
-		'pub_date' => $_lang['page_data_publishdate'],
120
-		'status' => $_lang['page_data_status'],
121
-		'edit' => $_lang['mgrlog_action'],
122
-	);
123
-	$tbWidth = array(
124
-		'1%',
125
-		'',
126
-		'1%',
127
-		'1%',
128
-		'1%',
129
-		'1%'
130
-	);
131
-	$modx->getMakeTable()->setColumnWidths($tbWidth);
132
-
133
-	$sd = isset($_REQUEST['dir']) ? '&amp;dir=' . $_REQUEST['dir'] : '&amp;dir=DESC';
134
-	$sb = isset($_REQUEST['sort']) ? '&amp;sort=' . $_REQUEST['sort'] : '&amp;sort=createdon';
135
-	$pg = isset($_REQUEST['page']) ? '&amp;page=' . (int) $_REQUEST['page'] : '';
136
-	$add_path = $sd . $sb . $pg;
137
-
138
-	$icons = array(
139
-		'text/html' => $_style['tree_page_html'],
140
-		'text/plain' => $_style['tree_page'],
141
-		'text/xml' => $_style['tree_page_xml'],
142
-		'text/css' => $_style['tree_page_css'],
143
-		'text/javascript' => $_style['tree_page_js'],
144
-		'application/rss+xml' => $_style['tree_page_rss'],
145
-		'application/pdf' => $_style['tree_page_pdf'],
146
-		'application/vnd.ms-word' => $_style['tree_page_word'],
147
-		'application/vnd.ms-excel' => $_style['tree_page_excel'],
148
-		'image/gif' => $_style['tree_page_gif'],
149
-		'image/jpg' => $_style['tree_page_jpg'],
150
-		'image/png' => $_style['tree_page_png']
151
-	);
152
-
153
-	$listDocs = array();
154
-	foreach($resource as $k => $children) {
155
-
156
-		switch($children['id']) {
157
-			case $modx->config['site_start']            :
158
-				$icon = $_style['tree_page_home'];
159
-				break;
160
-			case $modx->config['error_page']            :
161
-				$icon = $_style['tree_page_404'];
162
-				break;
163
-			case $modx->config['site_unavailable_page'] :
164
-				$icon = $_style['tree_page_hourglass'];
165
-				break;
166
-			case $modx->config['unauthorized_page']     :
167
-				$icon = $_style['tree_page_info'];
168
-				break;
169
-			default:
170
-				if($children['isfolder']) {
171
-					$icon = $_style['tree_folder_new'];
172
-				} else {
173
-					if(isset($icons[$children['contentType']])) {
174
-						$icon = $icons[$children['contentType']];
175
-					} else {
176
-						$icon = $_style['tree_page'];
177
-					}
178
-				}
179
-		}
180
-
181
-		$private = ($children['privateweb'] || $children['privatemgr'] ? ' private' : '');
182
-
183
-		// дописываем в заголовок класс для неопубликованных плюс по всем ссылкам обратный путь
184
-		// для сохранения сортировки
185
-		$class = ($children['deleted'] ? 'text-danger text-decoration-through' : (!$children['published'] ? ' font-italic text-muted' : ' publish'));
186
-		//$class .= ($children['hidemenu'] ? ' text-muted' : ' text-primary');
187
-		//$class .= ($children['isfolder'] ? ' font-weight-bold' : '');
188
-		if($modx->hasPermission('edit_document')) {
189
-			$title = '<span class="doc-item' . $private . '">' . $icon . '<a href="index.php?a=27&amp;id=' . $children['id'] . $add_path . '">' . '<span class="' . $class . '">' . $children['pagetitle'] . '</span></a></span>';
190
-		} else {
191
-			$title = '<span class="doc-item' . $private . '">' . $icon . '<span class="' . $class . '">' . $children['pagetitle'] . '</span></span>';
192
-		}
193
-
194
-		$icon_pub_unpub = (!$children['published']) ? '<a href="index.php?a=61&amp;id=' . $children['id'] . $add_path . '" title="' . $_lang["publish_resource"] . '"><i class="' . $_style["icons_publish_document"] . '"></i></a>' : '<a href="index.php?a=62&amp;id=' . $children['id'] . $add_path . '" title="' . $_lang["unpublish_resource"] . '"><i class="' . $_style["icons_unpublish_resource"] . '" ></i></a>';
195
-
196
-		$icon_del_undel = (!$children['deleted']) ? '<a onclick="return confirm(\'' . $_lang["confirm_delete_resource"] . '\')" href="index.php?a=6&amp;id=' . $children['id'] . $add_path . '" title="' . $_lang['delete_resource'] . '"><i class="' . $_style["icons_delete_resource"] . '"></i></a>' : '<a onclick="return confirm(\'' . $_lang["confirm_undelete"] . '\')" href="index.php?a=63&amp;id=' . $children['id'] . $add_path . '" title="' . $_lang['undelete_resource'] . '"><i class="' . $_style["icons_undelete_resource"] . '"></i></a>';
197
-
198
-		$listDocs[] = array(
199
-			'docid' => '<div class="text-right">' . $children['id'] . '</div>',
200
-			'title' => $title,
201
-			'createdon' => '<div class="text-right">' . ($modx->toDateFormat($children['createdon'] + $server_offset_time, 'dateOnly')) . '</div>',
202
-			'pub_date' => '<div class="text-right">' . ($children['pub_date'] ? ($modx->toDateFormat($children['pub_date'] + $server_offset_time, 'dateOnly')) : '') . '</div>',
203
-			'status' => '<div class="text-nowrap">' . ($children['published'] == 0 ? '<span class="unpublishedDoc">' . $_lang['page_data_unpublished'] . '</span>' : '<span class="publishedDoc">' . $_lang['page_data_published'] . '</span>') . '</div>',
204
-			'edit' => '<div class="actions text-center text-nowrap">' . ($modx->hasPermission('edit_document') ? '<a href="index.php?a=27&amp;id=' . $children['id'] . $add_path . '" title="' . $_lang['edit'] . '"><i class="' . $_style["icons_edit_resource"] . '"></i></a><a href="index.php?a=51&amp;id=' . $children['id'] . $add_path . '" title="' . $_lang['move'] . '"><i 
86
+    $filter_sort = '<select size="1" name="sort" class="form-control form-control-sm" onchange="document.location=\'index.php?a=3&id=' . $id . '&dir=' . $dir . '&sort=\'+this.options[this.selectedIndex].value">' . '<option value="createdon"' . (($sort == 'createdon') ? ' selected' : '') . '>' . $_lang['createdon'] . '</option>' . '<option value="pub_date"' . (($sort == 'pub_date') ? ' selected' : '') . '>' . $_lang["page_data_publishdate"] . '</option>' . '<option value="pagetitle"' . (($sort == 'pagetitle') ? ' selected' : '') . '>' . $_lang['pagetitle'] . '</option>' . '<option value="menuindex"' . (($sort == 'menuindex') ? ' selected' : '') . '>' . $_lang['resource_opt_menu_index'] . '</option>' . //********  resource_opt_is_published - //
87
+        '<option value="published"' . (($sort == 'published') ? ' selected' : '') . '>' . $_lang['resource_opt_is_published'] . '</option>' . //********//
88
+        '</select>';
89
+    $filter_dir = '<select size="1" name="dir" class="form-control form-control-sm" onchange="document.location=\'index.php?a=3&id=' . $id . '&sort=' . $sort . '&dir=\'+this.options[this.selectedIndex].value">' . '<option value="DESC"' . (($dir == 'DESC') ? ' selected' : '') . '>' . $_lang['sort_desc'] . '</option>' . '<option value="ASC"' . (($dir == 'ASC') ? ' selected' : '') . '>' . $_lang['sort_asc'] . '</option>' . '</select>';
90
+    $resource = $modx->getDatabase()->makeArray($rs);
91
+
92
+    // CSS style for table
93
+    //	$tableClass = 'grid';
94
+    //	$rowHeaderClass = 'gridHeader';
95
+    //	$rowRegularClass = 'gridItem';
96
+    //	$rowAlternateClass = 'gridAltItem';
97
+    $tableClass = 'table data nowrap';
98
+    $columnHeaderClass = array(
99
+        'text-center',
100
+        'text-left',
101
+        'text-center',
102
+        'text-center',
103
+        'text-center',
104
+        'text-center'
105
+    );
106
+
107
+
108
+    $modx->getMakeTable()->setTableClass($tableClass);
109
+    $modx->getMakeTable()->setColumnHeaderClass($columnHeaderClass);
110
+    //	$modx->getMakeTable()->setRowHeaderClass($rowHeaderClass);
111
+    //	$modx->getMakeTable()->setRowRegularClass($rowRegularClass);
112
+    //	$modx->getMakeTable()->setRowAlternateClass($rowAlternateClass);
113
+
114
+    // Table header
115
+    $listTableHeader = array(
116
+        'docid' => $_lang['id'],
117
+        'title' => $_lang['resource_title'],
118
+        'createdon' => $_lang['createdon'],
119
+        'pub_date' => $_lang['page_data_publishdate'],
120
+        'status' => $_lang['page_data_status'],
121
+        'edit' => $_lang['mgrlog_action'],
122
+    );
123
+    $tbWidth = array(
124
+        '1%',
125
+        '',
126
+        '1%',
127
+        '1%',
128
+        '1%',
129
+        '1%'
130
+    );
131
+    $modx->getMakeTable()->setColumnWidths($tbWidth);
132
+
133
+    $sd = isset($_REQUEST['dir']) ? '&amp;dir=' . $_REQUEST['dir'] : '&amp;dir=DESC';
134
+    $sb = isset($_REQUEST['sort']) ? '&amp;sort=' . $_REQUEST['sort'] : '&amp;sort=createdon';
135
+    $pg = isset($_REQUEST['page']) ? '&amp;page=' . (int) $_REQUEST['page'] : '';
136
+    $add_path = $sd . $sb . $pg;
137
+
138
+    $icons = array(
139
+        'text/html' => $_style['tree_page_html'],
140
+        'text/plain' => $_style['tree_page'],
141
+        'text/xml' => $_style['tree_page_xml'],
142
+        'text/css' => $_style['tree_page_css'],
143
+        'text/javascript' => $_style['tree_page_js'],
144
+        'application/rss+xml' => $_style['tree_page_rss'],
145
+        'application/pdf' => $_style['tree_page_pdf'],
146
+        'application/vnd.ms-word' => $_style['tree_page_word'],
147
+        'application/vnd.ms-excel' => $_style['tree_page_excel'],
148
+        'image/gif' => $_style['tree_page_gif'],
149
+        'image/jpg' => $_style['tree_page_jpg'],
150
+        'image/png' => $_style['tree_page_png']
151
+    );
152
+
153
+    $listDocs = array();
154
+    foreach($resource as $k => $children) {
155
+
156
+        switch($children['id']) {
157
+            case $modx->config['site_start']            :
158
+                $icon = $_style['tree_page_home'];
159
+                break;
160
+            case $modx->config['error_page']            :
161
+                $icon = $_style['tree_page_404'];
162
+                break;
163
+            case $modx->config['site_unavailable_page'] :
164
+                $icon = $_style['tree_page_hourglass'];
165
+                break;
166
+            case $modx->config['unauthorized_page']     :
167
+                $icon = $_style['tree_page_info'];
168
+                break;
169
+            default:
170
+                if($children['isfolder']) {
171
+                    $icon = $_style['tree_folder_new'];
172
+                } else {
173
+                    if(isset($icons[$children['contentType']])) {
174
+                        $icon = $icons[$children['contentType']];
175
+                    } else {
176
+                        $icon = $_style['tree_page'];
177
+                    }
178
+                }
179
+        }
180
+
181
+        $private = ($children['privateweb'] || $children['privatemgr'] ? ' private' : '');
182
+
183
+        // дописываем в заголовок класс для неопубликованных плюс по всем ссылкам обратный путь
184
+        // для сохранения сортировки
185
+        $class = ($children['deleted'] ? 'text-danger text-decoration-through' : (!$children['published'] ? ' font-italic text-muted' : ' publish'));
186
+        //$class .= ($children['hidemenu'] ? ' text-muted' : ' text-primary');
187
+        //$class .= ($children['isfolder'] ? ' font-weight-bold' : '');
188
+        if($modx->hasPermission('edit_document')) {
189
+            $title = '<span class="doc-item' . $private . '">' . $icon . '<a href="index.php?a=27&amp;id=' . $children['id'] . $add_path . '">' . '<span class="' . $class . '">' . $children['pagetitle'] . '</span></a></span>';
190
+        } else {
191
+            $title = '<span class="doc-item' . $private . '">' . $icon . '<span class="' . $class . '">' . $children['pagetitle'] . '</span></span>';
192
+        }
193
+
194
+        $icon_pub_unpub = (!$children['published']) ? '<a href="index.php?a=61&amp;id=' . $children['id'] . $add_path . '" title="' . $_lang["publish_resource"] . '"><i class="' . $_style["icons_publish_document"] . '"></i></a>' : '<a href="index.php?a=62&amp;id=' . $children['id'] . $add_path . '" title="' . $_lang["unpublish_resource"] . '"><i class="' . $_style["icons_unpublish_resource"] . '" ></i></a>';
195
+
196
+        $icon_del_undel = (!$children['deleted']) ? '<a onclick="return confirm(\'' . $_lang["confirm_delete_resource"] . '\')" href="index.php?a=6&amp;id=' . $children['id'] . $add_path . '" title="' . $_lang['delete_resource'] . '"><i class="' . $_style["icons_delete_resource"] . '"></i></a>' : '<a onclick="return confirm(\'' . $_lang["confirm_undelete"] . '\')" href="index.php?a=63&amp;id=' . $children['id'] . $add_path . '" title="' . $_lang['undelete_resource'] . '"><i class="' . $_style["icons_undelete_resource"] . '"></i></a>';
197
+
198
+        $listDocs[] = array(
199
+            'docid' => '<div class="text-right">' . $children['id'] . '</div>',
200
+            'title' => $title,
201
+            'createdon' => '<div class="text-right">' . ($modx->toDateFormat($children['createdon'] + $server_offset_time, 'dateOnly')) . '</div>',
202
+            'pub_date' => '<div class="text-right">' . ($children['pub_date'] ? ($modx->toDateFormat($children['pub_date'] + $server_offset_time, 'dateOnly')) : '') . '</div>',
203
+            'status' => '<div class="text-nowrap">' . ($children['published'] == 0 ? '<span class="unpublishedDoc">' . $_lang['page_data_unpublished'] . '</span>' : '<span class="publishedDoc">' . $_lang['page_data_published'] . '</span>') . '</div>',
204
+            'edit' => '<div class="actions text-center text-nowrap">' . ($modx->hasPermission('edit_document') ? '<a href="index.php?a=27&amp;id=' . $children['id'] . $add_path . '" title="' . $_lang['edit'] . '"><i class="' . $_style["icons_edit_resource"] . '"></i></a><a href="index.php?a=51&amp;id=' . $children['id'] . $add_path . '" title="' . $_lang['move'] . '"><i 
205 205
 				class="' . $_style["icons_move_document"] . '"></i></a>' . $icon_pub_unpub : '') . ($modx->hasPermission('delete_document') ? $icon_del_undel : '') . '</div>'
206
-		);
207
-	}
206
+        );
207
+    }
208 208
 
209
-	$modx->getMakeTable()->createPagingNavigation($numRecords, 'a=3&id=' . $content['id'] . '&dir=' . $dir . '&sort=' . $sort);
210
-	$children_output = $modx->getMakeTable()->create($listDocs, $listTableHeader, 'index.php?a=3&amp;id=' . $content['id']);
209
+    $modx->getMakeTable()->createPagingNavigation($numRecords, 'a=3&id=' . $content['id'] . '&dir=' . $dir . '&sort=' . $sort);
210
+    $children_output = $modx->getMakeTable()->create($listDocs, $listTableHeader, 'index.php?a=3&amp;id=' . $content['id']);
211 211
 } else {
212
-	// No Child documents
213
-	$children_output = '<div class="container"><p>' . $_lang['resources_in_container_no'] . '</p></div>';
212
+    // No Child documents
213
+    $children_output = '<div class="container"><p>' . $_lang['resources_in_container_no'] . '</p></div>';
214 214
 }
215 215
 ?>
216 216
 	<script type="text/javascript">
@@ -411,20 +411,20 @@  discard block
 block discarded – undo
411 411
 				<h2 class="tab"><?= $_lang['page_data_source'] ?></h2>
412 412
 				<script type="text/javascript">docSettings.addTabPage(document.getElementById("tabSource"));</script>
413 413
 				<?php
414
-				$buffer = "";
415
-				$filename = $modx->config['base_path'] . "assets/cache/docid_" . $id . ".pageCache.php";
416
-				$handle = @fopen($filename, "r");
417
-				if(!$handle) {
418
-					$buffer = '<div class="container container-body">' . $_lang['page_data_notcached'] . '</div>';
419
-				} else {
420
-					while(!feof($handle)) {
421
-						$buffer .= fgets($handle, 4096);
422
-					}
423
-					fclose($handle);
424
-					$buffer = '<div class="navbar navbar-editor">' . $_lang['page_data_cached'] . '</div><div class="section-editor clearfix"><textarea rows="20" wrap="soft">' . $modx->getPhpCompat()->htmlspecialchars($buffer) . "</textarea></div>\n";
425
-				}
426
-				echo $buffer;
427
-				?>
414
+                $buffer = "";
415
+                $filename = $modx->config['base_path'] . "assets/cache/docid_" . $id . ".pageCache.php";
416
+                $handle = @fopen($filename, "r");
417
+                if(!$handle) {
418
+                    $buffer = '<div class="container container-body">' . $_lang['page_data_notcached'] . '</div>';
419
+                } else {
420
+                    while(!feof($handle)) {
421
+                        $buffer .= fgets($handle, 4096);
422
+                    }
423
+                    fclose($handle);
424
+                    $buffer = '<div class="navbar navbar-editor">' . $_lang['page_data_cached'] . '</div><div class="section-editor clearfix"><textarea rows="20" wrap="soft">' . $modx->getPhpCompat()->htmlspecialchars($buffer) . "</textarea></div>\n";
425
+                }
426
+                echo $buffer;
427
+                ?>
428 428
 			</div><!-- end tab-page -->
429 429
 		<?php } ?>
430 430
 
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
 
433 433
 <?php
434 434
 if(isset($_GET['tab']) && is_numeric($_GET['tab'])) {
435
-	echo '<script type="text/javascript"> docSettings.setSelectedIndex( ' . $_GET['tab'] . ' );</script>';
435
+    echo '<script type="text/javascript"> docSettings.setSelectedIndex( ' . $_GET['tab'] . ' );</script>';
436 436
 }
437 437
 ?>
438 438
 
Please login to merge, or discard this patch.
Spacing   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -1,15 +1,15 @@  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(isset($_REQUEST['id'])) {
6
+if (isset($_REQUEST['id'])) {
7 7
 	$id = (int) $_REQUEST['id'];
8 8
 } else {
9 9
 	$id = 0;
10 10
 }
11 11
 
12
-if(isset($_GET['opened'])) {
12
+if (isset($_GET['opened'])) {
13 13
 	$_SESSION['openedArray'] = $_GET['opened'];
14 14
 }
15 15
 
@@ -22,16 +22,16 @@  discard block
 block discarded – undo
22 22
 $tbl_site_templates = $modx->getFullTableName('site_templates');
23 23
 
24 24
 // Get access permissions
25
-if($_SESSION['mgrDocgroups']) {
25
+if ($_SESSION['mgrDocgroups']) {
26 26
 	$docgrp = implode(",", $_SESSION['mgrDocgroups']);
27 27
 }
28
-$access = "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0" . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)");
28
+$access = "1='".$_SESSION['mgrRole']."' OR sc.privatemgr=0".(!$docgrp ? "" : " OR dg.document_group IN ($docgrp)");
29 29
 
30 30
 //
31
-if($_SESSION['tree_show_only_folders']) {
32
-	$parent = $id ? ($modx->getDatabase()->getValue("SELECT parent FROM " . $tbl_site_content . " WHERE id=$id LIMIT 1")) : 0;
33
-	$isfolder = $modx->getDatabase()->getValue("SELECT isfolder FROM " . $tbl_site_content . " WHERE id=$id LIMIT 1");
34
-	if(!$isfolder && $parent != 0) {
31
+if ($_SESSION['tree_show_only_folders']) {
32
+	$parent = $id ? ($modx->getDatabase()->getValue("SELECT parent FROM ".$tbl_site_content." WHERE id=$id LIMIT 1")) : 0;
33
+	$isfolder = $modx->getDatabase()->getValue("SELECT isfolder FROM ".$tbl_site_content." WHERE id=$id LIMIT 1");
34
+	if (!$isfolder && $parent != 0) {
35 35
 		$id = $_REQUEST['id'] = $parent;
36 36
 	}
37 37
 }
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 $rs = $modx->getDatabase()->select('DISTINCT sc.*', "{$tbl_site_content} AS sc
41 41
 		LEFT JOIN {$tbl_document_groups} AS dg ON dg.document = sc.id", "sc.id ='{$id}' AND ({$access})");
42 42
 $content = $modx->getDatabase()->getRow($rs);
43
-if(!$content) {
43
+if (!$content) {
44 44
 	$modx->webAlertAndQuit($_lang["access_permission_denied"]);
45 45
 }
46 46
 
@@ -82,11 +82,11 @@  discard block
 block discarded – undo
82 82
 );
83 83
 $filter_sort = '';
84 84
 $filter_dir = '';
85
-if($numRecords > 0) {
86
-	$filter_sort = '<select size="1" name="sort" class="form-control form-control-sm" onchange="document.location=\'index.php?a=3&id=' . $id . '&dir=' . $dir . '&sort=\'+this.options[this.selectedIndex].value">' . '<option value="createdon"' . (($sort == 'createdon') ? ' selected' : '') . '>' . $_lang['createdon'] . '</option>' . '<option value="pub_date"' . (($sort == 'pub_date') ? ' selected' : '') . '>' . $_lang["page_data_publishdate"] . '</option>' . '<option value="pagetitle"' . (($sort == 'pagetitle') ? ' selected' : '') . '>' . $_lang['pagetitle'] . '</option>' . '<option value="menuindex"' . (($sort == 'menuindex') ? ' selected' : '') . '>' . $_lang['resource_opt_menu_index'] . '</option>' . //********  resource_opt_is_published - //
87
-		'<option value="published"' . (($sort == 'published') ? ' selected' : '') . '>' . $_lang['resource_opt_is_published'] . '</option>' . //********//
85
+if ($numRecords > 0) {
86
+	$filter_sort = '<select size="1" name="sort" class="form-control form-control-sm" onchange="document.location=\'index.php?a=3&id='.$id.'&dir='.$dir.'&sort=\'+this.options[this.selectedIndex].value">'.'<option value="createdon"'.(($sort == 'createdon') ? ' selected' : '').'>'.$_lang['createdon'].'</option>'.'<option value="pub_date"'.(($sort == 'pub_date') ? ' selected' : '').'>'.$_lang["page_data_publishdate"].'</option>'.'<option value="pagetitle"'.(($sort == 'pagetitle') ? ' selected' : '').'>'.$_lang['pagetitle'].'</option>'.'<option value="menuindex"'.(($sort == 'menuindex') ? ' selected' : '').'>'.$_lang['resource_opt_menu_index'].'</option>'.//********  resource_opt_is_published - //
87
+		'<option value="published"'.(($sort == 'published') ? ' selected' : '').'>'.$_lang['resource_opt_is_published'].'</option>'.//********//
88 88
 		'</select>';
89
-	$filter_dir = '<select size="1" name="dir" class="form-control form-control-sm" onchange="document.location=\'index.php?a=3&id=' . $id . '&sort=' . $sort . '&dir=\'+this.options[this.selectedIndex].value">' . '<option value="DESC"' . (($dir == 'DESC') ? ' selected' : '') . '>' . $_lang['sort_desc'] . '</option>' . '<option value="ASC"' . (($dir == 'ASC') ? ' selected' : '') . '>' . $_lang['sort_asc'] . '</option>' . '</select>';
89
+	$filter_dir = '<select size="1" name="dir" class="form-control form-control-sm" onchange="document.location=\'index.php?a=3&id='.$id.'&sort='.$sort.'&dir=\'+this.options[this.selectedIndex].value">'.'<option value="DESC"'.(($dir == 'DESC') ? ' selected' : '').'>'.$_lang['sort_desc'].'</option>'.'<option value="ASC"'.(($dir == 'ASC') ? ' selected' : '').'>'.$_lang['sort_asc'].'</option>'.'</select>';
90 90
 	$resource = $modx->getDatabase()->makeArray($rs);
91 91
 
92 92
 	// CSS style for table
@@ -130,10 +130,10 @@  discard block
 block discarded – undo
130 130
 	);
131 131
 	$modx->getMakeTable()->setColumnWidths($tbWidth);
132 132
 
133
-	$sd = isset($_REQUEST['dir']) ? '&amp;dir=' . $_REQUEST['dir'] : '&amp;dir=DESC';
134
-	$sb = isset($_REQUEST['sort']) ? '&amp;sort=' . $_REQUEST['sort'] : '&amp;sort=createdon';
135
-	$pg = isset($_REQUEST['page']) ? '&amp;page=' . (int) $_REQUEST['page'] : '';
136
-	$add_path = $sd . $sb . $pg;
133
+	$sd = isset($_REQUEST['dir']) ? '&amp;dir='.$_REQUEST['dir'] : '&amp;dir=DESC';
134
+	$sb = isset($_REQUEST['sort']) ? '&amp;sort='.$_REQUEST['sort'] : '&amp;sort=createdon';
135
+	$pg = isset($_REQUEST['page']) ? '&amp;page='.(int) $_REQUEST['page'] : '';
136
+	$add_path = $sd.$sb.$pg;
137 137
 
138 138
 	$icons = array(
139 139
 		'text/html' => $_style['tree_page_html'],
@@ -151,9 +151,9 @@  discard block
 block discarded – undo
151 151
 	);
152 152
 
153 153
 	$listDocs = array();
154
-	foreach($resource as $k => $children) {
154
+	foreach ($resource as $k => $children) {
155 155
 
156
-		switch($children['id']) {
156
+		switch ($children['id']) {
157 157
 			case $modx->config['site_start']            :
158 158
 				$icon = $_style['tree_page_home'];
159 159
 				break;
@@ -167,10 +167,10 @@  discard block
 block discarded – undo
167 167
 				$icon = $_style['tree_page_info'];
168 168
 				break;
169 169
 			default:
170
-				if($children['isfolder']) {
170
+				if ($children['isfolder']) {
171 171
 					$icon = $_style['tree_folder_new'];
172 172
 				} else {
173
-					if(isset($icons[$children['contentType']])) {
173
+					if (isset($icons[$children['contentType']])) {
174 174
 						$icon = $icons[$children['contentType']];
175 175
 					} else {
176 176
 						$icon = $_style['tree_page'];
@@ -185,32 +185,32 @@  discard block
 block discarded – undo
185 185
 		$class = ($children['deleted'] ? 'text-danger text-decoration-through' : (!$children['published'] ? ' font-italic text-muted' : ' publish'));
186 186
 		//$class .= ($children['hidemenu'] ? ' text-muted' : ' text-primary');
187 187
 		//$class .= ($children['isfolder'] ? ' font-weight-bold' : '');
188
-		if($modx->hasPermission('edit_document')) {
189
-			$title = '<span class="doc-item' . $private . '">' . $icon . '<a href="index.php?a=27&amp;id=' . $children['id'] . $add_path . '">' . '<span class="' . $class . '">' . $children['pagetitle'] . '</span></a></span>';
188
+		if ($modx->hasPermission('edit_document')) {
189
+			$title = '<span class="doc-item'.$private.'">'.$icon.'<a href="index.php?a=27&amp;id='.$children['id'].$add_path.'">'.'<span class="'.$class.'">'.$children['pagetitle'].'</span></a></span>';
190 190
 		} else {
191
-			$title = '<span class="doc-item' . $private . '">' . $icon . '<span class="' . $class . '">' . $children['pagetitle'] . '</span></span>';
191
+			$title = '<span class="doc-item'.$private.'">'.$icon.'<span class="'.$class.'">'.$children['pagetitle'].'</span></span>';
192 192
 		}
193 193
 
194
-		$icon_pub_unpub = (!$children['published']) ? '<a href="index.php?a=61&amp;id=' . $children['id'] . $add_path . '" title="' . $_lang["publish_resource"] . '"><i class="' . $_style["icons_publish_document"] . '"></i></a>' : '<a href="index.php?a=62&amp;id=' . $children['id'] . $add_path . '" title="' . $_lang["unpublish_resource"] . '"><i class="' . $_style["icons_unpublish_resource"] . '" ></i></a>';
194
+		$icon_pub_unpub = (!$children['published']) ? '<a href="index.php?a=61&amp;id='.$children['id'].$add_path.'" title="'.$_lang["publish_resource"].'"><i class="'.$_style["icons_publish_document"].'"></i></a>' : '<a href="index.php?a=62&amp;id='.$children['id'].$add_path.'" title="'.$_lang["unpublish_resource"].'"><i class="'.$_style["icons_unpublish_resource"].'" ></i></a>';
195 195
 
196
-		$icon_del_undel = (!$children['deleted']) ? '<a onclick="return confirm(\'' . $_lang["confirm_delete_resource"] . '\')" href="index.php?a=6&amp;id=' . $children['id'] . $add_path . '" title="' . $_lang['delete_resource'] . '"><i class="' . $_style["icons_delete_resource"] . '"></i></a>' : '<a onclick="return confirm(\'' . $_lang["confirm_undelete"] . '\')" href="index.php?a=63&amp;id=' . $children['id'] . $add_path . '" title="' . $_lang['undelete_resource'] . '"><i class="' . $_style["icons_undelete_resource"] . '"></i></a>';
196
+		$icon_del_undel = (!$children['deleted']) ? '<a onclick="return confirm(\''.$_lang["confirm_delete_resource"].'\')" href="index.php?a=6&amp;id='.$children['id'].$add_path.'" title="'.$_lang['delete_resource'].'"><i class="'.$_style["icons_delete_resource"].'"></i></a>' : '<a onclick="return confirm(\''.$_lang["confirm_undelete"].'\')" href="index.php?a=63&amp;id='.$children['id'].$add_path.'" title="'.$_lang['undelete_resource'].'"><i class="'.$_style["icons_undelete_resource"].'"></i></a>';
197 197
 
198 198
 		$listDocs[] = array(
199
-			'docid' => '<div class="text-right">' . $children['id'] . '</div>',
199
+			'docid' => '<div class="text-right">'.$children['id'].'</div>',
200 200
 			'title' => $title,
201
-			'createdon' => '<div class="text-right">' . ($modx->toDateFormat($children['createdon'] + $server_offset_time, 'dateOnly')) . '</div>',
202
-			'pub_date' => '<div class="text-right">' . ($children['pub_date'] ? ($modx->toDateFormat($children['pub_date'] + $server_offset_time, 'dateOnly')) : '') . '</div>',
203
-			'status' => '<div class="text-nowrap">' . ($children['published'] == 0 ? '<span class="unpublishedDoc">' . $_lang['page_data_unpublished'] . '</span>' : '<span class="publishedDoc">' . $_lang['page_data_published'] . '</span>') . '</div>',
204
-			'edit' => '<div class="actions text-center text-nowrap">' . ($modx->hasPermission('edit_document') ? '<a href="index.php?a=27&amp;id=' . $children['id'] . $add_path . '" title="' . $_lang['edit'] . '"><i class="' . $_style["icons_edit_resource"] . '"></i></a><a href="index.php?a=51&amp;id=' . $children['id'] . $add_path . '" title="' . $_lang['move'] . '"><i 
205
-				class="' . $_style["icons_move_document"] . '"></i></a>' . $icon_pub_unpub : '') . ($modx->hasPermission('delete_document') ? $icon_del_undel : '') . '</div>'
201
+			'createdon' => '<div class="text-right">'.($modx->toDateFormat($children['createdon'] + $server_offset_time, 'dateOnly')).'</div>',
202
+			'pub_date' => '<div class="text-right">'.($children['pub_date'] ? ($modx->toDateFormat($children['pub_date'] + $server_offset_time, 'dateOnly')) : '').'</div>',
203
+			'status' => '<div class="text-nowrap">'.($children['published'] == 0 ? '<span class="unpublishedDoc">'.$_lang['page_data_unpublished'].'</span>' : '<span class="publishedDoc">'.$_lang['page_data_published'].'</span>').'</div>',
204
+			'edit' => '<div class="actions text-center text-nowrap">'.($modx->hasPermission('edit_document') ? '<a href="index.php?a=27&amp;id='.$children['id'].$add_path.'" title="'.$_lang['edit'].'"><i class="'.$_style["icons_edit_resource"].'"></i></a><a href="index.php?a=51&amp;id='.$children['id'].$add_path.'" title="'.$_lang['move'].'"><i 
205
+				class="' . $_style["icons_move_document"].'"></i></a>'.$icon_pub_unpub : '').($modx->hasPermission('delete_document') ? $icon_del_undel : '').'</div>'
206 206
 		);
207 207
 	}
208 208
 
209
-	$modx->getMakeTable()->createPagingNavigation($numRecords, 'a=3&id=' . $content['id'] . '&dir=' . $dir . '&sort=' . $sort);
210
-	$children_output = $modx->getMakeTable()->create($listDocs, $listTableHeader, 'index.php?a=3&amp;id=' . $content['id']);
209
+	$modx->getMakeTable()->createPagingNavigation($numRecords, 'a=3&id='.$content['id'].'&dir='.$dir.'&sort='.$sort);
210
+	$children_output = $modx->getMakeTable()->create($listDocs, $listTableHeader, 'index.php?a=3&amp;id='.$content['id']);
211 211
 } else {
212 212
 	// No Child documents
213
-	$children_output = '<div class="container"><p>' . $_lang['resources_in_container_no'] . '</p></div>';
213
+	$children_output = '<div class="container"><p>'.$_lang['resources_in_container_no'].'</p></div>';
214 214
 }
215 215
 ?>
216 216
 	<script type="text/javascript">
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
 			},
237 237
 			cancel: function() {
238 238
 				documentDirty = false;
239
-				document.location.href = 'index.php?<?=($id == 0 ? 'a=2' : 'a=3&r=1&id=' . $id . $add_path) ?>';
239
+				document.location.href = 'index.php?<?=($id == 0 ? 'a=2' : 'a=3&r=1&id='.$id.$add_path) ?>';
240 240
 			},
241 241
 			move: function() {
242 242
 				document.location.href = "index.php?id=<?= $_REQUEST['id'] ?>&a=51";
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
 				}
248 248
 			},
249 249
 			view: function() {
250
-				window.open('<?= ($modx->config['friendly_urls'] == '1') ? $modx->makeUrl($id) : $modx->config['site_url'] . 'index.php?id=' . $id ?>', 'previeWin');
250
+				window.open('<?= ($modx->config['friendly_urls'] == '1') ? $modx->makeUrl($id) : $modx->config['site_url'].'index.php?id='.$id ?>', 'previeWin');
251 251
 			}
252 252
 		};
253 253
 
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
 	<script type="text/javascript" src="media/script/tablesort.js"></script>
256 256
 
257 257
 	<h1>
258
-		<i class="fa fa-info"></i><?= iconv_substr($content['pagetitle'], 0, 50, $modx->config['modx_charset']) . (iconv_strlen($content['pagetitle'], $modx->config['modx_charset']) > 50 ? '...' : '') . ' <small>(' . $_REQUEST['id'] . ')</small>' ?>
258
+		<i class="fa fa-info"></i><?= iconv_substr($content['pagetitle'], 0, 50, $modx->config['modx_charset']).(iconv_strlen($content['pagetitle'], $modx->config['modx_charset']) > 50 ? '...' : '').' <small>('.$_REQUEST['id'].')</small>' ?>
259 259
 	</h1>
260 260
 
261 261
 <?= $_style['actionbuttons']['static']['document'] ?>
@@ -282,16 +282,16 @@  discard block
 block discarded – undo
282 282
 					<tr>
283 283
 						<td width="200" valign="top"><?= $_lang['long_title'] ?>:</td>
284 284
 						<td>
285
-							<small><?= $content['longtitle'] != '' ? $content['longtitle'] : "(<i>" . $_lang['not_set'] . "</i>)" ?></small>
285
+							<small><?= $content['longtitle'] != '' ? $content['longtitle'] : "(<i>".$_lang['not_set']."</i>)" ?></small>
286 286
 						</td>
287 287
 					</tr>
288 288
 					<tr>
289 289
 						<td valign="top"><?= $_lang['resource_description'] ?>:</td>
290
-						<td><?= $content['description'] != '' ? $content['description'] : "(<i>" . $_lang['not_set'] . "</i>)" ?></td>
290
+						<td><?= $content['description'] != '' ? $content['description'] : "(<i>".$_lang['not_set']."</i>)" ?></td>
291 291
 					</tr>
292 292
 					<tr>
293 293
 						<td valign="top"><?= $_lang['resource_summary'] ?>:</td>
294
-						<td><?= $content['introtext'] != '' ? $content['introtext'] : "(<i>" . $_lang['not_set'] . "</i>)" ?></td>
294
+						<td><?= $content['introtext'] != '' ? $content['introtext'] : "(<i>".$_lang['not_set']."</i>)" ?></td>
295 295
 					</tr>
296 296
 					<tr>
297 297
 						<td valign="top"><?= $_lang['type'] ?>:</td>
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
 					</tr>
300 300
 					<tr>
301 301
 						<td valign="top"><?= $_lang['resource_alias'] ?>:</td>
302
-						<td><?= $content['alias'] != '' ? $content['alias'] : "(<i>" . $_lang['not_set'] . "</i>)" ?></td>
302
+						<td><?= $content['alias'] != '' ? $content['alias'] : "(<i>".$_lang['not_set']."</i>)" ?></td>
303 303
 					</tr>
304 304
 					<tr>
305 305
 						<td colspan="2">&nbsp;</td>
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
 						<td><?= $modx->toDateFormat($content['createdon'] + $server_offset_time) ?> (<b><?= $createdbyname ?></b>)
313 313
 						</td>
314 314
 					</tr>
315
-					<?php if($editedbyname != '') { ?>
315
+					<?php if ($editedbyname != '') { ?>
316 316
 						<tr>
317 317
 							<td><?= $_lang['page_data_edited'] ?>:</td>
318 318
 							<td><?= $modx->toDateFormat($content['editedon'] + $server_offset_time) ?> (<b><?= $editedbyname ?></b>)
@@ -327,15 +327,15 @@  discard block
 block discarded – undo
327 327
 					</tr>
328 328
 					<tr>
329 329
 						<td><?= $_lang['page_data_status'] ?>:</td>
330
-						<td><?= $content['published'] == 0 ? '<span class="unpublishedDoc">' . $_lang['page_data_unpublished'] . '</span>' : '<span class="publisheddoc">' . $_lang['page_data_published'] . '</span>' ?></td>
330
+						<td><?= $content['published'] == 0 ? '<span class="unpublishedDoc">'.$_lang['page_data_unpublished'].'</span>' : '<span class="publisheddoc">'.$_lang['page_data_published'].'</span>' ?></td>
331 331
 					</tr>
332 332
 					<tr>
333 333
 						<td><?= $_lang['page_data_publishdate'] ?>:</td>
334
-						<td><?= $content['pub_date'] == 0 ? "(<i>" . $_lang['not_set'] . "</i>)" : $modx->toDateFormat($content['pub_date']) ?></td>
334
+						<td><?= $content['pub_date'] == 0 ? "(<i>".$_lang['not_set']."</i>)" : $modx->toDateFormat($content['pub_date']) ?></td>
335 335
 					</tr>
336 336
 					<tr>
337 337
 						<td><?= $_lang['page_data_unpublishdate'] ?>:</td>
338
-						<td><?= $content['unpub_date'] == 0 ? "(<i>" . $_lang['not_set'] . "</i>)" : $modx->toDateFormat($content['unpub_date']) ?></td>
338
+						<td><?= $content['unpub_date'] == 0 ? "(<i>".$_lang['not_set']."</i>)" : $modx->toDateFormat($content['unpub_date']) ?></td>
339 339
 					</tr>
340 340
 					<tr>
341 341
 						<td><?= $_lang['page_data_cacheable'] ?>:</td>
@@ -355,11 +355,11 @@  discard block
 block discarded – undo
355 355
 					</tr>
356 356
 					<tr>
357 357
 						<td><?= $_lang['page_data_web_access'] ?>:</td>
358
-						<td><?= $content['privateweb'] == 0 ? $_lang['public'] : '<b style="color: #821517">' . $_lang['private'] . '</b> ' . $_style["icons_secured"] ?></td>
358
+						<td><?= $content['privateweb'] == 0 ? $_lang['public'] : '<b style="color: #821517">'.$_lang['private'].'</b> '.$_style["icons_secured"] ?></td>
359 359
 					</tr>
360 360
 					<tr>
361 361
 						<td><?= $_lang['page_data_mgr_access'] ?>:</td>
362
-						<td><?= $content['privatemgr'] == 0 ? $_lang['public'] : '<b style="color: #821517">' . $_lang['private'] . '</b> ' . $_style["icons_secured"] ?></td>
362
+						<td><?= $content['privatemgr'] == 0 ? $_lang['public'] : '<b style="color: #821517">'.$_lang['private'].'</b> '.$_style["icons_secured"] ?></td>
363 363
 					</tr>
364 364
 					<tr>
365 365
 						<td colspan="2">&nbsp;</td>
@@ -389,13 +389,13 @@  discard block
 block discarded – undo
389 389
 			<script type="text/javascript">docSettings.addTabPage(document.getElementById("tabChildren"));</script>
390 390
 			<div class="container container-body">
391 391
 				<div class="form-group clearfix">
392
-					<?php if($numRecords > 0) : ?>
392
+					<?php if ($numRecords > 0) : ?>
393 393
 						<div class="float-xs-left">
394
-							<span class="publishedDoc"><?= $numRecords . ' ' . $_lang['resources_in_container'] ?> (<strong><?= $content['pagetitle'] ?></strong>)</span>
394
+							<span class="publishedDoc"><?= $numRecords.' '.$_lang['resources_in_container'] ?> (<strong><?= $content['pagetitle'] ?></strong>)</span>
395 395
 						</div>
396 396
 					<?php endif; ?>
397 397
 					<div class="float-xs-right">
398
-						<?= $filter_sort . ' ' . $filter_dir ?>
398
+						<?= $filter_sort.' '.$filter_dir ?>
399 399
 					</div>
400 400
 
401 401
 				</div>
@@ -405,23 +405,23 @@  discard block
 block discarded – undo
405 405
 			</div>
406 406
 		</div><!-- end tab-page -->
407 407
 
408
-		<?php if($modx->config['cache_type'] != 2) { ?>
408
+		<?php if ($modx->config['cache_type'] != 2) { ?>
409 409
 			<!-- Page Source -->
410 410
 			<div class="tab-page" id="tabSource">
411 411
 				<h2 class="tab"><?= $_lang['page_data_source'] ?></h2>
412 412
 				<script type="text/javascript">docSettings.addTabPage(document.getElementById("tabSource"));</script>
413 413
 				<?php
414 414
 				$buffer = "";
415
-				$filename = $modx->config['base_path'] . "assets/cache/docid_" . $id . ".pageCache.php";
415
+				$filename = $modx->config['base_path']."assets/cache/docid_".$id.".pageCache.php";
416 416
 				$handle = @fopen($filename, "r");
417
-				if(!$handle) {
418
-					$buffer = '<div class="container container-body">' . $_lang['page_data_notcached'] . '</div>';
417
+				if (!$handle) {
418
+					$buffer = '<div class="container container-body">'.$_lang['page_data_notcached'].'</div>';
419 419
 				} else {
420
-					while(!feof($handle)) {
420
+					while (!feof($handle)) {
421 421
 						$buffer .= fgets($handle, 4096);
422 422
 					}
423 423
 					fclose($handle);
424
-					$buffer = '<div class="navbar navbar-editor">' . $_lang['page_data_cached'] . '</div><div class="section-editor clearfix"><textarea rows="20" wrap="soft">' . $modx->getPhpCompat()->htmlspecialchars($buffer) . "</textarea></div>\n";
424
+					$buffer = '<div class="navbar navbar-editor">'.$_lang['page_data_cached'].'</div><div class="section-editor clearfix"><textarea rows="20" wrap="soft">'.$modx->getPhpCompat()->htmlspecialchars($buffer)."</textarea></div>\n";
425 425
 				}
426 426
 				echo $buffer;
427 427
 				?>
@@ -431,12 +431,12 @@  discard block
 block discarded – undo
431 431
 	</div><!-- end documentPane -->
432 432
 
433 433
 <?php
434
-if(isset($_GET['tab']) && is_numeric($_GET['tab'])) {
435
-	echo '<script type="text/javascript"> docSettings.setSelectedIndex( ' . $_GET['tab'] . ' );</script>';
434
+if (isset($_GET['tab']) && is_numeric($_GET['tab'])) {
435
+	echo '<script type="text/javascript"> docSettings.setSelectedIndex( '.$_GET['tab'].' );</script>';
436 436
 }
437 437
 ?>
438 438
 
439
-<?php if($show_preview == 1) { ?>
439
+<?php if ($show_preview == 1) { ?>
440 440
 	<div class="sectionHeader"><?= $_lang['preview'] ?></div>
441 441
 	<div class="sectionBody" id="lyr2">
442 442
 		<iframe src="<?= MODX_SITE_URL ?>index.php?id=<?= $id ?>&z=manprev" frameborder="0" border="0" id="previewIframe"></iframe>
Please login to merge, or discard this patch.
manager/actions/messages.static.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if (!$modx->hasPermission('messages')) {
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
         <div class="container container-body" id="lyr3">
17 17
             <b><?= $_lang['messages_read_message'] ?></b>
18 18
             <?php
19
-            $rs = $modx->getDatabase()->select('*', $modx->getFullTableName('user_messages'), "id='" . (int)$_REQUEST['id'] . "'");
19
+            $rs = $modx->getDatabase()->select('*', $modx->getFullTableName('user_messages'), "id='".(int) $_REQUEST['id']."'");
20 20
             $message = $modx->getDatabase()->getRow($rs);
21 21
             if (!$message) {
22 22
                 echo "Wrong number of messages returned!";
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
         <p><b><?= $_lang['messages_inbox'] ?></b></p>
88 88
         <?php
89 89
         // Get  number of rows
90
-        $rs = $modx->getDatabase()->select('count(id)', $modx->getFullTableName('user_messages'), "recipient=" . $modx->getLoginUserID() . "");
90
+        $rs = $modx->getDatabase()->select('count(id)', $modx->getFullTableName('user_messages'), "recipient=".$modx->getLoginUserID()."");
91 91
         $num_rows = $modx->getDatabase()->getValue($rs);
92 92
 
93 93
         // ==============================================================
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
         if (!isset($_REQUEST['int_cur_position']) || $_REQUEST['int_cur_position'] == 0) {
101 101
             $int_cur_position = 0;
102 102
         } else {
103
-            $int_cur_position = (int)$_REQUEST['int_cur_position'];
103
+            $int_cur_position = (int) $_REQUEST['int_cur_position'];
104 104
         }
105 105
 
106 106
         // Number of result to display on the page, will be in the LIMIT of the sql query also
@@ -116,21 +116,21 @@  discard block
 block discarded – undo
116 116
         $array_row_paging = $p->getPagingRowArray();
117 117
 
118 118
         // Display the result as you like...
119
-        $pager .= $_lang['showing'] . " " . $array_paging['lower'];
120
-        $pager .= " " . $_lang['to'] . " " . $array_paging['upper'];
121
-        $pager .= " (" . $array_paging['total'] . " " . $_lang['total'] . ")";
122
-        $pager .= "<br />" . $array_paging['previous_link'] . "&lt;&lt;" . (isset($array_paging['previous_link']) ? "</a> " : " ");
119
+        $pager .= $_lang['showing']." ".$array_paging['lower'];
120
+        $pager .= " ".$_lang['to']." ".$array_paging['upper'];
121
+        $pager .= " (".$array_paging['total']." ".$_lang['total'].")";
122
+        $pager .= "<br />".$array_paging['previous_link']."&lt;&lt;".(isset($array_paging['previous_link']) ? "</a> " : " ");
123 123
         for ($i = 0; $i < sizeof($array_row_paging); $i++) {
124
-            $pager .= $array_row_paging[$i] . "&nbsp;";
124
+            $pager .= $array_row_paging[$i]."&nbsp;";
125 125
         }
126
-        $pager .= $array_paging['next_link'] . "&gt;&gt;" . (isset($array_paging['next_link']) ? "</a>" : "");
126
+        $pager .= $array_paging['next_link']."&gt;&gt;".(isset($array_paging['next_link']) ? "</a>" : "");
127 127
 
128 128
         // The above exemple print somethings like:
129 129
         // Results 1 to 20 of 597  <<< 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 >>>
130 130
         // Of course you can now play with array_row_paging in order to print
131 131
         // only the results you would like...
132 132
 
133
-        $rs = $modx->getDatabase()->select('*', $modx->getFullTableName('user_messages'), "recipient=" . $modx->getLoginUserID() . "", 'postdate DESC', "{$int_cur_position}, {$int_num_result}");
133
+        $rs = $modx->getDatabase()->select('*', $modx->getFullTableName('user_messages'), "recipient=".$modx->getLoginUserID()."", 'postdate DESC', "{$int_cur_position}, {$int_num_result}");
134 134
         $limit = $modx->getDatabase()->getRecordCount($rs);
135 135
         if ($limit < 1) {
136 136
             echo $_lang['messages_no_messages'];
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
         <p><b><?= $_lang['messages_compose'] ?></b></p>
189 189
         <?php
190 190
         if (($_REQUEST['m'] == 'rp' || $_REQUEST['m'] == 'f') && isset($_REQUEST['id'])) {
191
-            $rs = $modx->getDatabase()->select('*', $modx->getFullTableName('user_messages'), "id='" . $_REQUEST['id'] . "'");
191
+            $rs = $modx->getDatabase()->select('*', $modx->getFullTableName('user_messages'), "id='".$_REQUEST['id']."'");
192 192
             $message = $modx->getDatabase()->getRow($rs);
193 193
             if (!$message) {
194 194
                 echo "Wrong number of messages returned!";
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
                     }
208 208
                     $subjecttext = $_REQUEST['m'] == 'rp' ? "Re: " : "Fwd: ";
209 209
                     $subjecttext .= $message['subject'];
210
-                    $messagetext = "\n\n\n-----\n" . $_lang['messages_from'] . ": $sendername\n" . $_lang['messages_sent'] . ": " . $modx->toDateFormat($message['postdate'] + $server_offset_time) . "\n" . $_lang['messages_subject'] . ": " . $message['subject'] . "\n\n" . $message['message'];
210
+                    $messagetext = "\n\n\n-----\n".$_lang['messages_from'].": $sendername\n".$_lang['messages_sent'].": ".$modx->toDateFormat($message['postdate'] + $server_offset_time)."\n".$_lang['messages_subject'].": ".$message['subject']."\n\n".$message['message'];
211 211
                     if ($_REQUEST['m'] == 'rp') {
212 212
                         $recipientindex = $message['sender'];
213 213
                     }
@@ -294,9 +294,9 @@  discard block
 block discarded – undo
294 294
 
295 295
 <?php
296 296
 // count messages again, as any action on the messages page may have altered the message count
297
-$rs = $modx->getDatabase()->select('COUNT(*)', $modx->getFullTableName('user_messages'), "recipient=" . $modx->getLoginUserID() . " and messageread=0");
297
+$rs = $modx->getDatabase()->select('COUNT(*)', $modx->getFullTableName('user_messages'), "recipient=".$modx->getLoginUserID()." and messageread=0");
298 298
 $_SESSION['nrnewmessages'] = $modx->getDatabase()->getValue($rs);
299
-$rs = $modx->getDatabase()->select('COUNT(*)', $modx->getFullTableName('user_messages'), "recipient=" . $modx->getLoginUserID() . "");
299
+$rs = $modx->getDatabase()->select('COUNT(*)', $modx->getFullTableName('user_messages'), "recipient=".$modx->getLoginUserID()."");
300 300
 $_SESSION['nrtotalmessages'] = $modx->getDatabase()->getValue($rs);
301 301
 $messagesallowed = $modx->hasPermission('messages');
302 302
 ?>
Please login to merge, or discard this patch.
manager/actions/mutate_templates.dynamic.php 3 patches
Indentation   +124 added lines, -124 removed lines patch added patch discarded remove patch
@@ -1,21 +1,21 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3
-	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
3
+    die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 
6 6
 switch($modx->getManagerApi()->action) {
7
-	case 16:
8
-		if(!$modx->hasPermission('edit_template')) {
9
-			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
10
-		}
11
-		break;
12
-	case 19:
13
-		if(!$modx->hasPermission('new_template')) {
14
-			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
15
-		}
16
-		break;
17
-	default:
18
-		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7
+    case 16:
8
+        if(!$modx->hasPermission('edit_template')) {
9
+            $modx->webAlertAndQuit($_lang["error_no_privileges"]);
10
+        }
11
+        break;
12
+    case 19:
13
+        if(!$modx->hasPermission('new_template')) {
14
+            $modx->webAlertAndQuit($_lang["error_no_privileges"]);
15
+        }
16
+        break;
17
+    default:
18
+        $modx->webAlertAndQuit($_lang["error_no_privileges"]);
19 19
 }
20 20
 
21 21
 $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 
25 25
 // check to see the snippet editor isn't locked
26 26
 if($lockedEl = $modx->elementIsLocked(1, $id)) {
27
-	$modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['template']));
27
+    $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['template']));
28 28
 }
29 29
 // end check for lock
30 30
 
@@ -33,23 +33,23 @@  discard block
 block discarded – undo
33 33
 
34 34
 $content = array();
35 35
 if(!empty($id)) {
36
-	$rs = $modx->getDatabase()->select('*', $tbl_site_templates, "id='{$id}'");
37
-	$content = $modx->getDatabase()->getRow($rs);
38
-	if(!$content) {
39
-		$modx->webAlertAndQuit("No database record has been found for this template.");
40
-	}
41
-
42
-	$_SESSION['itemname'] = $content['templatename'];
43
-	if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
44
-		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
45
-	}
36
+    $rs = $modx->getDatabase()->select('*', $tbl_site_templates, "id='{$id}'");
37
+    $content = $modx->getDatabase()->getRow($rs);
38
+    if(!$content) {
39
+        $modx->webAlertAndQuit("No database record has been found for this template.");
40
+    }
41
+
42
+    $_SESSION['itemname'] = $content['templatename'];
43
+    if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
44
+        $modx->webAlertAndQuit($_lang["error_no_privileges"]);
45
+    }
46 46
 } else {
47
-	$_SESSION['itemname'] = $_lang["new_template"];
48
-	$content['category'] = (int)$_REQUEST['catid'];
47
+    $_SESSION['itemname'] = $_lang["new_template"];
48
+    $content['category'] = (int)$_REQUEST['catid'];
49 49
 }
50 50
 
51 51
 if($modx->getManagerApi()->hasFormValues()) {
52
-	$modx->getManagerApi()->loadFormValues();
52
+    $modx->getManagerApi()->loadFormValues();
53 53
 }
54 54
 
55 55
 $content = array_merge($content, $_POST);
@@ -98,12 +98,12 @@  discard block
 block discarded – undo
98 98
 
99 99
 <form name="mutate" method="post" action="index.php">
100 100
 	<?php
101
-	// invoke OnTempFormPrerender event
102
-	$evtOut = $modx->invokeEvent("OnTempFormPrerender", array("id" => $id));
103
-	if(is_array($evtOut)) {
104
-		echo implode("", $evtOut);
105
-	}
106
-	?>
101
+    // invoke OnTempFormPrerender event
102
+    $evtOut = $modx->invokeEvent("OnTempFormPrerender", array("id" => $id));
103
+    if(is_array($evtOut)) {
104
+        echo implode("", $evtOut);
105
+    }
106
+    ?>
107 107
 	<input type="hidden" name="a" value="20">
108 108
 	<input type="hidden" name="id" value="<?= $_REQUEST['id'] ?>">
109 109
 	<input type="hidden" name="mode" value="<?= $modx->getManagerApi()->action ?>">
@@ -133,8 +133,8 @@  discard block
 block discarded – undo
133 133
 						<label class="col-md-3 col-lg-2">
134 134
 							<?= $_lang['template_name'] ?>
135 135
 							<?php if($id == $modx->config['default_template']) {
136
-								echo '<small class="form-text text-danger">' . mb_strtolower(rtrim($_lang['defaulttemplate_title'], ':'), $modx_manager_charset) . '</small>';
137
-							} ?>
136
+                                echo '<small class="form-text text-danger">' . mb_strtolower(rtrim($_lang['defaulttemplate_title'], ':'), $modx_manager_charset) . '</small>';
137
+                            } ?>
138 138
 						</label>
139 139
 						<div class="col-md-9 col-lg-10">
140 140
 							<div class="form-control-name clearfix">
@@ -162,11 +162,11 @@  discard block
 block discarded – undo
162 162
 							<select name="categoryid" class="form-control" onchange="documentDirty=true;">
163 163
 								<option>&nbsp;</option>
164 164
 								<?php
165
-								include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
166
-								foreach(getCategories() as $n => $v) {
167
-									echo "<option value='" . $v['id'] . "'" . ($content["category"] == $v["id"] ? " selected='selected'" : "") . ">" . $modx->getPhpCompat()->htmlspecialchars($v["category"]) . "</option>";
168
-								}
169
-								?>
165
+                                include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
166
+                                foreach(getCategories() as $n => $v) {
167
+                                    echo "<option value='" . $v['id'] . "'" . ($content["category"] == $v["id"] ? " selected='selected'" : "") . ">" . $modx->getPhpCompat()->htmlspecialchars($v["category"]) . "</option>";
168
+                                }
169
+                                ?>
170 170
 							</select>
171 171
 						</div>
172 172
 					</div>
@@ -197,38 +197,38 @@  discard block
 block discarded – undo
197 197
 			<input type="submit" name="save" style="display:none">
198 198
 
199 199
 			<?php
200
-			$selectedTvs = array();
201
-			if(!isset($_POST['assignedTv'])) {
202
-				$rs = $modx->getDatabase()->select(sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category", $_lang['no_category']), sprintf("%s tv
200
+            $selectedTvs = array();
201
+            if(!isset($_POST['assignedTv'])) {
202
+                $rs = $modx->getDatabase()->select(sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category", $_lang['no_category']), sprintf("%s tv
203 203
                 LEFT JOIN %s tr ON tv.id=tr.tmplvarid
204 204
                 LEFT JOIN %s cat ON tv.category=cat.id", $modx->getFullTableName('site_tmplvars'), $modx->getFullTableName('site_tmplvar_templates'), $modx->getFullTableName('categories')), "templateid='{$id}'", "tr.rank DESC, tv.rank DESC, tvcaption DESC, tvid DESC"     // workaround for correct sort of none-existing ranks
205
-				);
206
-				while($row = $modx->getDatabase()->getRow($rs)) {
207
-					$selectedTvs[$row['tvid']] = $row;
208
-				}
209
-				$selectedTvs = array_reverse($selectedTvs, true);       // reverse ORDERBY DESC
210
-			}
211
-
212
-			$unselectedTvs = array();
213
-			$rs = $modx->getDatabase()->select(sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category, cat.id as catid", $_lang['no_category']), sprintf("%s tv
205
+                );
206
+                while($row = $modx->getDatabase()->getRow($rs)) {
207
+                    $selectedTvs[$row['tvid']] = $row;
208
+                }
209
+                $selectedTvs = array_reverse($selectedTvs, true);       // reverse ORDERBY DESC
210
+            }
211
+
212
+            $unselectedTvs = array();
213
+            $rs = $modx->getDatabase()->select(sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category, cat.id as catid", $_lang['no_category']), sprintf("%s tv
214 214
 	    LEFT JOIN %s tr ON tv.id=tr.tmplvarid
215 215
 	    LEFT JOIN %s cat ON tv.category=cat.id", $modx->getFullTableName('site_tmplvars'), $modx->getFullTableName('site_tmplvar_templates'), $modx->getFullTableName('categories')), "", "category, tvcaption");
216
-			while($row = $modx->getDatabase()->getRow($rs)) {
217
-				$unselectedTvs[$row['tvid']] = $row;
218
-			}
219
-
220
-			// Catch checkboxes if form not validated
221
-			if(isset($_POST['assignedTv'])) {
222
-				$selectedTvs = array();
223
-				foreach($_POST['assignedTv'] as $tvid) {
224
-					if(isset($unselectedTvs[$tvid])) {
225
-						$selectedTvs[$tvid] = $unselectedTvs[$tvid];
226
-					}
227
-				};
228
-			}
229
-
230
-			$total = count($selectedTvs);
231
-			?>
216
+            while($row = $modx->getDatabase()->getRow($rs)) {
217
+                $unselectedTvs[$row['tvid']] = $row;
218
+            }
219
+
220
+            // Catch checkboxes if form not validated
221
+            if(isset($_POST['assignedTv'])) {
222
+                $selectedTvs = array();
223
+                foreach($_POST['assignedTv'] as $tvid) {
224
+                    if(isset($unselectedTvs[$tvid])) {
225
+                        $selectedTvs[$tvid] = $unselectedTvs[$tvid];
226
+                    }
227
+                };
228
+            }
229
+
230
+            $total = count($selectedTvs);
231
+            ?>
232 232
 		</div>
233 233
 
234 234
 		<div class="tab-page" id="tabAssignedTVs">
@@ -238,65 +238,65 @@  discard block
 block discarded – undo
238 238
 
239 239
 			<div class="container container-body">
240 240
 				<?php
241
-				if($total > 0) {
242
-					echo '<p>' . $_lang['template_tv_msg'] . '</p>';
243
-				}
244
-				if($modx->hasPermission('save_template') && $total > 1 && $id) {
245
-					echo sprintf('<div class="form-group"><a class="btn btn-primary" href="index.php?a=117&amp;id=%s">%s</a></div>', $id, $_lang['template_tv_edit']);
246
-				}
247
-
248
-				// Selected TVs
249
-				$tvList = '';
250
-				if($total > 0) {
251
-					$tvList .= '<ul>';
252
-					foreach($selectedTvs as $row) {
253
-						$desc = !empty($row['tvdescription']) ? '&nbsp;&nbsp;<small>(' . $row['tvdescription'] . ')</small>' : '';
254
-						$locked = $row['tvlocked'] ? ' <em>(' . $_lang['locked'] . ')</em>' : "";
255
-						$tvList .= sprintf('<li><label><input name="assignedTv[]" value="%s" type="checkbox" checked="checked" onchange="documentDirty=true;jQuery(\'#tvsDirty\').val(\'1\');"> %s <small>(%s)</small> - %s%s</label>%s <a href="index.php?id=%s&a=301&or=%s&oid=%s">%s</a></li>', $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->getManagerApi()->action, $id, $_lang['edit']);
256
-					}
257
-					$tvList .= '</ul>';
258
-
259
-				} else {
260
-					echo $_lang['template_no_tv'];
261
-				}
262
-				echo $tvList;
263
-
264
-				// Unselected TVs
265
-				$tvList = '<hr/><p>' . $_lang['template_notassigned_tv'] . '</p><ul>';
266
-				$preCat = '';
267
-				$insideUl = 0;
268
-				while($row = array_shift($unselectedTvs)) {
269
-					if(isset($selectedTvs[$row['tvid']])) {
270
-						continue;
271
-					} // Skip selected
272
-					$row['category'] = stripslashes($row['category']); //pixelchutes
273
-					if($preCat !== $row['category']) {
274
-						$tvList .= $insideUl ? '</ul>' : '';
275
-						$tvList .= '<li><strong>' . $row['category'] . ($row['catid'] != '' ? ' <small>(' . $row['catid'] . ')</small>' : '') . '</strong><ul>';
276
-						$insideUl = 1;
277
-					}
278
-
279
-					$desc = !empty($row['tvdescription']) ? '&nbsp;&nbsp;<small>(' . $row['tvdescription'] . ')</small>' : '';
280
-					$locked = $row['tvlocked'] ? ' <em>(' . $_lang['locked'] . ')</em>' : "";
281
-					$tvList .= sprintf('<li><label><input name="assignedTv[]" value="%s" type="checkbox" onchange="documentDirty=true;jQuery(\'#tvsDirty\').val(\'1\');"> %s <small>(%s)</small> - %s%s</label>%s <a href="index.php?id=%s&a=301&or=%s&oid=%s">%s</a></li>', $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->getManagerApi()->action, $id, $_lang['edit']);
282
-					$tvList .= '</li>';
283
-
284
-					$preCat = $row['category'];
285
-				}
286
-				$tvList .= $insideUl ? '</ul>' : '';
287
-				$tvList .= '</ul>';
288
-				echo $tvList;
289
-
290
-				?>
241
+                if($total > 0) {
242
+                    echo '<p>' . $_lang['template_tv_msg'] . '</p>';
243
+                }
244
+                if($modx->hasPermission('save_template') && $total > 1 && $id) {
245
+                    echo sprintf('<div class="form-group"><a class="btn btn-primary" href="index.php?a=117&amp;id=%s">%s</a></div>', $id, $_lang['template_tv_edit']);
246
+                }
247
+
248
+                // Selected TVs
249
+                $tvList = '';
250
+                if($total > 0) {
251
+                    $tvList .= '<ul>';
252
+                    foreach($selectedTvs as $row) {
253
+                        $desc = !empty($row['tvdescription']) ? '&nbsp;&nbsp;<small>(' . $row['tvdescription'] . ')</small>' : '';
254
+                        $locked = $row['tvlocked'] ? ' <em>(' . $_lang['locked'] . ')</em>' : "";
255
+                        $tvList .= sprintf('<li><label><input name="assignedTv[]" value="%s" type="checkbox" checked="checked" onchange="documentDirty=true;jQuery(\'#tvsDirty\').val(\'1\');"> %s <small>(%s)</small> - %s%s</label>%s <a href="index.php?id=%s&a=301&or=%s&oid=%s">%s</a></li>', $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->getManagerApi()->action, $id, $_lang['edit']);
256
+                    }
257
+                    $tvList .= '</ul>';
258
+
259
+                } else {
260
+                    echo $_lang['template_no_tv'];
261
+                }
262
+                echo $tvList;
263
+
264
+                // Unselected TVs
265
+                $tvList = '<hr/><p>' . $_lang['template_notassigned_tv'] . '</p><ul>';
266
+                $preCat = '';
267
+                $insideUl = 0;
268
+                while($row = array_shift($unselectedTvs)) {
269
+                    if(isset($selectedTvs[$row['tvid']])) {
270
+                        continue;
271
+                    } // Skip selected
272
+                    $row['category'] = stripslashes($row['category']); //pixelchutes
273
+                    if($preCat !== $row['category']) {
274
+                        $tvList .= $insideUl ? '</ul>' : '';
275
+                        $tvList .= '<li><strong>' . $row['category'] . ($row['catid'] != '' ? ' <small>(' . $row['catid'] . ')</small>' : '') . '</strong><ul>';
276
+                        $insideUl = 1;
277
+                    }
278
+
279
+                    $desc = !empty($row['tvdescription']) ? '&nbsp;&nbsp;<small>(' . $row['tvdescription'] . ')</small>' : '';
280
+                    $locked = $row['tvlocked'] ? ' <em>(' . $_lang['locked'] . ')</em>' : "";
281
+                    $tvList .= sprintf('<li><label><input name="assignedTv[]" value="%s" type="checkbox" onchange="documentDirty=true;jQuery(\'#tvsDirty\').val(\'1\');"> %s <small>(%s)</small> - %s%s</label>%s <a href="index.php?id=%s&a=301&or=%s&oid=%s">%s</a></li>', $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->getManagerApi()->action, $id, $_lang['edit']);
282
+                    $tvList .= '</li>';
283
+
284
+                    $preCat = $row['category'];
285
+                }
286
+                $tvList .= $insideUl ? '</ul>' : '';
287
+                $tvList .= '</ul>';
288
+                echo $tvList;
289
+
290
+                ?>
291 291
 			</div>
292 292
 		</div>
293 293
 
294 294
 		<?php
295
-		// invoke OnTempFormRender event
296
-		$evtOut = $modx->invokeEvent("OnTempFormRender", array("id" => $id));
297
-		if(is_array($evtOut)) {
298
-			echo implode("", $evtOut);
299
-		}
300
-		?>
295
+        // invoke OnTempFormRender event
296
+        $evtOut = $modx->invokeEvent("OnTempFormRender", array("id" => $id));
297
+        if(is_array($evtOut)) {
298
+            echo implode("", $evtOut);
299
+        }
300
+        ?>
301 301
 	</div>
302 302
 </form>
Please login to merge, or discard this patch.
Switch Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -4,18 +4,18 @@
 block discarded – undo
4 4
 }
5 5
 
6 6
 switch($modx->getManagerApi()->action) {
7
-	case 16:
8
-		if(!$modx->hasPermission('edit_template')) {
9
-			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
10
-		}
11
-		break;
12
-	case 19:
13
-		if(!$modx->hasPermission('new_template')) {
14
-			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
15
-		}
16
-		break;
17
-	default:
18
-		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7
+	    case 16:
8
+		    if(!$modx->hasPermission('edit_template')) {
9
+			    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
10
+		    }
11
+		    break;
12
+	    case 19:
13
+		    if(!$modx->hasPermission('new_template')) {
14
+			    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
15
+		    }
16
+		    break;
17
+	    default:
18
+		    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
19 19
 }
20 20
 
21 21
 $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
Please login to merge, or discard this 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->getManagerApi()->action) {
6
+switch ($modx->getManagerApi()->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->getDatabase()->select('*', $tbl_site_templates, "id='{$id}'");
37 37
 	$content = $modx->getDatabase()->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->getManagerApi()->hasFormValues()) {
51
+if ($modx->getManagerApi()->hasFormValues()) {
52 52
 	$modx->getManagerApi()->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->getManagerApi()->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->getPhpCompat()->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->getPhpCompat()->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->getPhpCompat()->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->getDatabase()->select(sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category", $_lang['no_category']), sprintf("%s tv
203 203
                 LEFT JOIN %s tr ON tv.id=tr.tmplvarid
204 204
                 LEFT JOIN %s cat ON tv.category=cat.id", $modx->getFullTableName('site_tmplvars'), $modx->getFullTableName('site_tmplvar_templates'), $modx->getFullTableName('categories')), "templateid='{$id}'", "tr.rank DESC, tv.rank DESC, tvcaption DESC, tvid DESC"     // workaround for correct sort of none-existing ranks
205 205
 				);
206
-				while($row = $modx->getDatabase()->getRow($rs)) {
206
+				while ($row = $modx->getDatabase()->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->getDatabase()->select(sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category, cat.id as catid", $_lang['no_category']), sprintf("%s tv
214 214
 	    LEFT JOIN %s tr ON tv.id=tr.tmplvarid
215 215
 	    LEFT JOIN %s cat ON tv.category=cat.id", $modx->getFullTableName('site_tmplvars'), $modx->getFullTableName('site_tmplvar_templates'), $modx->getFullTableName('categories')), "", "category, tvcaption");
216
-			while($row = $modx->getDatabase()->getRow($rs)) {
216
+			while ($row = $modx->getDatabase()->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->getManagerApi()->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->getManagerApi()->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_snippet.dynamic.php 2 patches
Switch Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -4,18 +4,18 @@
 block discarded – undo
4 4
 }
5 5
 
6 6
 switch ($modx->getManagerApi()->action) {
7
-    case 22:
8
-        if (!$modx->hasPermission('edit_snippet')) {
9
-            $modx->webAlertAndQuit($_lang["error_no_privileges"]);
10
-        }
11
-        break;
12
-    case 23:
13
-        if (!$modx->hasPermission('new_snippet')) {
7
+        case 22:
8
+            if (!$modx->hasPermission('edit_snippet')) {
9
+                $modx->webAlertAndQuit($_lang["error_no_privileges"]);
10
+            }
11
+            break;
12
+        case 23:
13
+            if (!$modx->hasPermission('new_snippet')) {
14
+                $modx->webAlertAndQuit($_lang["error_no_privileges"]);
15
+            }
16
+            break;
17
+        default:
14 18
             $modx->webAlertAndQuit($_lang["error_no_privileges"]);
15
-        }
16
-        break;
17
-    default:
18
-        $modx->webAlertAndQuit($_lang["error_no_privileges"]);
19 19
 }
20 20
 
21 21
 $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
Please login to merge, or discard this 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->getDatabase()->select('*', $tbl_site_snippets, "id='{$id}'");
40 40
     $content = $modx->getDatabase()->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->getManagerApi()->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->getManagerApi()->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->getPhpCompat()->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->getPhpCompat()->htmlspecialchars($v['category']) . '</option>';
486
+                                    echo '<option value="'.$v['id'].'"'.($content['category'] == $v['id'] ? ' selected="selected"' : '').'>'.$modx->getPhpCompat()->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->getPhpCompat()->htmlspecialchars($content['post'])) : "<?php" . "\n" . trim($modx->getPhpCompat()->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->getPhpCompat()->htmlspecialchars($content['post'])) : "<?php"."\n".trim($modx->getPhpCompat()->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->getDatabase()->getRow($ds)) {
555
-                                    echo "<option value='" . $row['guid'] . "'" . ($content['moduleguid'] == $row['guid'] ? " selected='selected'" : "") . ">" . $modx->getPhpCompat()->htmlspecialchars($row['name']) . "</option>";
555
+                                    echo "<option value='".$row['guid']."'".($content['moduleguid'] == $row['guid'] ? " selected='selected'" : "").">".$modx->getPhpCompat()->htmlspecialchars($row['name'])."</option>";
556 556
                                 }
557 557
                                 ?>
558 558
                             </select>
Please login to merge, or discard this patch.
manager/actions/mutate_tv_rank.dynamic.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if (!$modx->hasPermission('save_template')) {
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 $updateMsg = '';
16 16
 
17 17
 if (isset($_POST['listSubmitted'])) {
18
-    $updateMsg .= '<span class="text-success" id="updated">' . $_lang['sort_updated'] . '</span>';
18
+    $updateMsg .= '<span class="text-success" id="updated">'.$_lang['sort_updated'].'</span>';
19 19
     foreach ($_POST as $listName => $listValue) {
20 20
         if ($listName == 'listSubmitted' || $listName == 'reset') {
21 21
             continue;
@@ -40,11 +40,11 @@  discard block
 block discarded – undo
40 40
     $sortableList = '<div class="clearfix"><ul id="sortlist" class="sortableList">';
41 41
     while ($row = $modx->getDatabase()->getRow($rs)) {
42 42
         $caption = $row['caption'] != '' ? $row['caption'] : $row['name'];
43
-        $sortableList .= '<li id="item_' . $row['id'] . '"><i class="fa fa-list-alt"></i> ' . $caption . ' <small class="protectedNode" style="float:right">[*' . $row['name'] . '*]</small></li>';
43
+        $sortableList .= '<li id="item_'.$row['id'].'"><i class="fa fa-list-alt"></i> '.$caption.' <small class="protectedNode" style="float:right">[*'.$row['name'].'*]</small></li>';
44 44
     }
45 45
     $sortableList .= '</ul></div>';
46 46
 } else {
47
-    $updateMsg = '<p class="text-danger">' . $_lang['tmplvars_novars'] . '</p>';
47
+    $updateMsg = '<p class="text-danger">'.$_lang['tmplvars_novars'].'</p>';
48 48
 }
49 49
 ?>
50 50
 
Please login to merge, or discard this patch.
manager/actions/mutate_tmplvars.dynamic.php 2 patches
Indentation   +117 added lines, -117 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3
-	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
3
+    die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if(!$modx->hasPermission('edit_template') && $modx->getManagerApi()->action == '301') {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 if(!$modx->hasPermission('new_template') && $modx->getManagerApi()->action == '300') {
9
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
9
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
10 10
 }
11 11
 
12 12
 $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 
21 21
 // check to see the snippet editor isn't locked
22 22
 if($lockedEl = $modx->elementIsLocked(2, $id)) {
23
-	$modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['tmplvar']));
23
+    $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['tmplvar']));
24 24
 }
25 25
 // end check for lock
26 26
 
@@ -30,25 +30,25 @@  discard block
 block discarded – undo
30 30
 global $content;
31 31
 $content = array();
32 32
 if(isset($_GET['id'])) {
33
-	$rs = $modx->getDatabase()->select('*', $tbl_site_tmplvars, "id='{$id}'");
34
-	$content = $modx->getDatabase()->getRow($rs);
35
-	if(!$content) {
36
-		header("Location: " . MODX_SITE_URL . "index.php?id={$site_start}");
37
-	}
38
-
39
-	$_SESSION['itemname'] = $content['caption'];
40
-	if($content['locked'] == 1 && $modx->hasPermission('save_role') != 1) {
41
-		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
42
-	}
33
+    $rs = $modx->getDatabase()->select('*', $tbl_site_tmplvars, "id='{$id}'");
34
+    $content = $modx->getDatabase()->getRow($rs);
35
+    if(!$content) {
36
+        header("Location: " . MODX_SITE_URL . "index.php?id={$site_start}");
37
+    }
38
+
39
+    $_SESSION['itemname'] = $content['caption'];
40
+    if($content['locked'] == 1 && $modx->hasPermission('save_role') != 1) {
41
+        $modx->webAlertAndQuit($_lang["error_no_privileges"]);
42
+    }
43 43
 } else if(isset($_REQUEST['itemname'])) {
44
-	$content['name'] = $_REQUEST['itemname'];
44
+    $content['name'] = $_REQUEST['itemname'];
45 45
 } else {
46
-	$_SESSION['itemname'] = $_lang["new_tmplvars"];
47
-	$content['category'] = (int)$_REQUEST['catid'];
46
+    $_SESSION['itemname'] = $_lang["new_tmplvars"];
47
+    $content['category'] = (int)$_REQUEST['catid'];
48 48
 }
49 49
 
50 50
 if($modx->getManagerApi()->hasFormValues()) {
51
-	$modx->getManagerApi()->loadFormValues();
51
+    $modx->getManagerApi()->loadFormValues();
52 52
 }
53 53
 
54 54
 $content = array_merge($content, $_POST);
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 $RTEditors = '';
63 63
 $evtOut = $modx->invokeEvent('OnRichTextEditorRegister', array('forfrontend' => 1));
64 64
 if(is_array($evtOut)) {
65
-	$RTEditors = implode(',', $evtOut);
65
+    $RTEditors = implode(',', $evtOut);
66 66
 }
67 67
 
68 68
 ?>
@@ -277,12 +277,12 @@  discard block
 block discarded – undo
277 277
 
278 278
 <form name="mutate" method="post" action="index.php" enctype="multipart/form-data">
279 279
 	<?php
280
-	// invoke OnTVFormPrerender event
281
-	$evtOut = $modx->invokeEvent('OnTVFormPrerender', array('id' => $id));
282
-	if(is_array($evtOut)) {
283
-		echo implode("", $evtOut);
284
-	}
285
-	?>
280
+    // invoke OnTVFormPrerender event
281
+    $evtOut = $modx->invokeEvent('OnTVFormPrerender', array('id' => $id));
282
+    if(is_array($evtOut)) {
283
+        echo implode("", $evtOut);
284
+    }
285
+    ?>
286 286
 	<input type="hidden" name="id" value="<?= $content['id'] ?>">
287 287
 	<input type="hidden" name="a" value="302">
288 288
 	<input type="hidden" name="or" value="<?= $origin ?>">
@@ -343,11 +343,11 @@  discard block
 block discarded – undo
343 343
 						<select name="categoryid" class="form-control" onChange="documentDirty=true;">
344 344
 							<option>&nbsp;</option>
345 345
 							<?php
346
-							include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
347
-							foreach(getCategories() as $n => $v) {
348
-								echo "<option value='" . $v['id'] . "'" . ($content["category"] == $v["id"] ? " selected='selected'" : "") . ">" . $modx->getPhpCompat()->htmlspecialchars($v["category"]) . "</option>";
349
-							}
350
-							?>
346
+                            include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
347
+                            foreach(getCategories() as $n => $v) {
348
+                                echo "<option value='" . $v['id'] . "'" . ($content["category"] == $v["id"] ? " selected='selected'" : "") . ">" . $modx->getPhpCompat()->htmlspecialchars($v["category"]) . "</option>";
349
+                            }
350
+                            ?>
351 351
 						</select>
352 352
 					</div>
353 353
 				</div>
@@ -383,14 +383,14 @@  discard block
 block discarded – undo
383 383
 							<optgroup label="Custom Type">
384 384
 								<option value="custom_tv" <?= ($content['type'] == 'custom_tv' ? "selected='selected'" : "") ?>>Custom Input</option>
385 385
 								<?php
386
-								$custom_tvs = scandir(MODX_BASE_PATH . 'assets/tvs');
387
-								foreach($custom_tvs as $ctv) {
388
-									if(strpos($ctv, '.') !== 0 && $ctv != 'index.html') {
389
-										$selected = ($content['type'] == 'custom_tv:' . $ctv ? "selected='selected'" : "");
390
-										echo '<option value="custom_tv:' . $ctv . '"  ' . $selected . '>' . $ctv . '</option>';
391
-									}
392
-								}
393
-								?>
386
+                                $custom_tvs = scandir(MODX_BASE_PATH . 'assets/tvs');
387
+                                foreach($custom_tvs as $ctv) {
388
+                                    if(strpos($ctv, '.') !== 0 && $ctv != 'index.html') {
389
+                                        $selected = ($content['type'] == 'custom_tv:' . $ctv ? "selected='selected'" : "");
390
+                                        echo '<option value="custom_tv:' . $ctv . '"  ' . $selected . '>' . $ctv . '</option>';
391
+                                    }
392
+                                }
393
+                                ?>
394 394
 							</optgroup>
395 395
 						</select>
396 396
 					</div>
@@ -455,63 +455,63 @@  discard block
 block discarded – undo
455 455
 					<a class="btn btn-secondary btn-sm" href="javascript:;" onClick="check_toggle(); return false;"><?= $_lang['check_toggle'] ?></a>
456 456
 				</div>
457 457
 				<?php
458
-				$rs = $modx->getDatabase()->select(sprintf("tpl.id AS id, templatename, tpl.description AS tpldescription, tpl.locked AS tpllocked, tpl.selectable AS selectable, tmplvarid, if(isnull(cat.category),'%s',cat.category) AS category, cat.id AS catid", $_lang['no_category']), sprintf("%s as tpl
458
+                $rs = $modx->getDatabase()->select(sprintf("tpl.id AS id, templatename, tpl.description AS tpldescription, tpl.locked AS tpllocked, tpl.selectable AS selectable, tmplvarid, if(isnull(cat.category),'%s',cat.category) AS category, cat.id AS catid", $_lang['no_category']), sprintf("%s as tpl
459 459
                     LEFT JOIN %s as stt ON stt.templateid=tpl.id AND stt.tmplvarid='%s'
460 460
                     LEFT JOIN %s as cat ON tpl.category=cat.id", $modx->getFullTableName('site_templates'), $modx->getFullTableName('site_tmplvar_templates'), $id, $modx->getFullTableName('categories')), '', "category, templatename");
461 461
 
462
-				$tplList = '<ul>';
463
-				$preCat = '';
464
-				$insideUl = 0;
465
-				while($row = $modx->getDatabase()->getRow($rs)) {
466
-					$row['category'] = stripslashes($row['category']); //pixelchutes
467
-					if($preCat !== $row['category']) {
468
-						$tplList .= $insideUl ? '</ul>' : '';
469
-						$tplList .= '<li><strong>' . $row['category'] . ($row['catid'] != '' ? ' <small>(' . $row['catid'] . ')</small>' : '') . '</strong><ul>';
470
-						$insideUl = 1;
471
-					}
472
-
473
-					if($modx->getManagerApi()->action == '300' && $modx->config['default_template'] == $row['id']) {
474
-						$checked = true;
475
-					} elseif(isset($_GET['tpl']) && $_GET['tpl'] == $row['id']) {
476
-						$checked = true;
477
-					} elseif($id == 0 && is_array($_POST['template'])) {
478
-						$checked = in_array($row['id'], $_POST['template']);
479
-					} else {
480
-						$checked = $row['tmplvarid'];
481
-					}
482
-					$selectable = !$row['selectable'] ? ' class="disabled"' : '';
483
-					$checked = $checked ? ' checked="checked"' : '';
484
-					$tplId = '&nbsp;<small>(' . $row['id'] . ')</small>';
485
-					$desc = !empty($row['tpldescription']) ? ' - ' . $row['tpldescription'] : '';
486
-
487
-					$tplInfo = array();
488
-					if($row['tpllocked']) {
489
-						$tplInfo[] = $_lang['locked'];
490
-					}
491
-					if($row['id'] == $modx->config['default_template']) {
492
-						$tplInfo[] = $_lang['defaulttemplate_title'];
493
-					}
494
-					$tplInfo = !empty($tplInfo) ? ' <em>(' . implode(', ', $tplInfo) . ')</em>' : '';
495
-
496
-					$tplList .= sprintf('<li><label%s><input name="template[]" value="%s" type="checkbox" %s onchange="documentDirty=true;"> %s%s%s%s</label></li>', $selectable, $row['id'], $checked, $row['templatename'], $tplId, $desc, $tplInfo);
497
-					$tplList .= '</li>';
498
-
499
-					$preCat = $row['category'];
500
-				}
501
-				$tplList .= $insideUl ? '</ul>' : '';
502
-				$tplList .= '</ul>';
503
-				echo $tplList;
504
-
505
-				?>
462
+                $tplList = '<ul>';
463
+                $preCat = '';
464
+                $insideUl = 0;
465
+                while($row = $modx->getDatabase()->getRow($rs)) {
466
+                    $row['category'] = stripslashes($row['category']); //pixelchutes
467
+                    if($preCat !== $row['category']) {
468
+                        $tplList .= $insideUl ? '</ul>' : '';
469
+                        $tplList .= '<li><strong>' . $row['category'] . ($row['catid'] != '' ? ' <small>(' . $row['catid'] . ')</small>' : '') . '</strong><ul>';
470
+                        $insideUl = 1;
471
+                    }
472
+
473
+                    if($modx->getManagerApi()->action == '300' && $modx->config['default_template'] == $row['id']) {
474
+                        $checked = true;
475
+                    } elseif(isset($_GET['tpl']) && $_GET['tpl'] == $row['id']) {
476
+                        $checked = true;
477
+                    } elseif($id == 0 && is_array($_POST['template'])) {
478
+                        $checked = in_array($row['id'], $_POST['template']);
479
+                    } else {
480
+                        $checked = $row['tmplvarid'];
481
+                    }
482
+                    $selectable = !$row['selectable'] ? ' class="disabled"' : '';
483
+                    $checked = $checked ? ' checked="checked"' : '';
484
+                    $tplId = '&nbsp;<small>(' . $row['id'] . ')</small>';
485
+                    $desc = !empty($row['tpldescription']) ? ' - ' . $row['tpldescription'] : '';
486
+
487
+                    $tplInfo = array();
488
+                    if($row['tpllocked']) {
489
+                        $tplInfo[] = $_lang['locked'];
490
+                    }
491
+                    if($row['id'] == $modx->config['default_template']) {
492
+                        $tplInfo[] = $_lang['defaulttemplate_title'];
493
+                    }
494
+                    $tplInfo = !empty($tplInfo) ? ' <em>(' . implode(', ', $tplInfo) . ')</em>' : '';
495
+
496
+                    $tplList .= sprintf('<li><label%s><input name="template[]" value="%s" type="checkbox" %s onchange="documentDirty=true;"> %s%s%s%s</label></li>', $selectable, $row['id'], $checked, $row['templatename'], $tplId, $desc, $tplInfo);
497
+                    $tplList .= '</li>';
498
+
499
+                    $preCat = $row['category'];
500
+                }
501
+                $tplList .= $insideUl ? '</ul>' : '';
502
+                $tplList .= '</ul>';
503
+                echo $tplList;
504
+
505
+                ?>
506 506
 
507 507
 				<!-- Access Permissions -->
508 508
 				<?php
509
-				if($use_udperms == 1) {
510
-					// fetch permissions for the variable
511
-					$rs = $modx->getDatabase()->select('documentgroup', $modx->getFullTableName('site_tmplvar_access'), "tmplvarid='{$id}'");
512
-					$groupsarray = $modx->getDatabase()->getColumn('documentgroup', $rs);
509
+                if($use_udperms == 1) {
510
+                    // fetch permissions for the variable
511
+                    $rs = $modx->getDatabase()->select('documentgroup', $modx->getFullTableName('site_tmplvar_access'), "tmplvarid='{$id}'");
512
+                    $groupsarray = $modx->getDatabase()->getColumn('documentgroup', $rs);
513 513
 
514
-					?>
514
+                    ?>
515 515
 					<?php if($modx->hasPermission('access_permissions')) { ?>
516 516
 						<script type="text/javascript">
517 517
 							function makePublic(b) {
@@ -539,29 +539,29 @@  discard block
 block discarded – undo
539 539
 						<!--<b><?php /*echo $_lang['access_permissions']; */ ?></b>-->
540 540
 						<p><?= $_lang['tmplvar_access_msg'] ?></p>
541 541
 						<?php
542
-						$chk = '';
543
-						$rs = $modx->getDatabase()->select('name, id', $tbl_documentgroup_names);
544
-						if(empty($groupsarray) && is_array($_POST['docgroups']) && empty($_POST['id'])) {
545
-							$groupsarray = $_POST['docgroups'];
546
-						}
547
-						while($row = $modx->getDatabase()->getRow($rs)) {
548
-							$checked = in_array($row['id'], $groupsarray);
549
-							if($modx->hasPermission('access_permissions')) {
550
-								if($checked) {
551
-									$notPublic = true;
552
-								}
553
-								$chks .= "<li><label><input type='checkbox' name='docgroups[]' value='" . $row['id'] . "' " . ($checked ? "checked='checked'" : '') . " onclick=\"makePublic(false)\" /> " . $row['name'] . "</label></li>";
554
-							} else {
555
-								if($checked) {
556
-									echo "<input type='hidden' name='docgroups[]'  value='" . $row['id'] . "' />";
557
-								}
558
-							}
559
-						}
560
-						if($modx->hasPermission('access_permissions')) {
561
-							$chks = "<li><label><input type='checkbox' name='chkalldocs' " . (!$notPublic ? "checked='checked'" : '') . " onclick=\"makePublic(true)\" /> <span class='warning'>" . $_lang['all_doc_groups'] . "</span></label></li>" . $chks;
562
-						}
563
-						echo '<ul>' . $chks . '</ul>';
564
-						?>
542
+                        $chk = '';
543
+                        $rs = $modx->getDatabase()->select('name, id', $tbl_documentgroup_names);
544
+                        if(empty($groupsarray) && is_array($_POST['docgroups']) && empty($_POST['id'])) {
545
+                            $groupsarray = $_POST['docgroups'];
546
+                        }
547
+                        while($row = $modx->getDatabase()->getRow($rs)) {
548
+                            $checked = in_array($row['id'], $groupsarray);
549
+                            if($modx->hasPermission('access_permissions')) {
550
+                                if($checked) {
551
+                                    $notPublic = true;
552
+                                }
553
+                                $chks .= "<li><label><input type='checkbox' name='docgroups[]' value='" . $row['id'] . "' " . ($checked ? "checked='checked'" : '') . " onclick=\"makePublic(false)\" /> " . $row['name'] . "</label></li>";
554
+                            } else {
555
+                                if($checked) {
556
+                                    echo "<input type='hidden' name='docgroups[]'  value='" . $row['id'] . "' />";
557
+                                }
558
+                            }
559
+                        }
560
+                        if($modx->hasPermission('access_permissions')) {
561
+                            $chks = "<li><label><input type='checkbox' name='chkalldocs' " . (!$notPublic ? "checked='checked'" : '') . " onclick=\"makePublic(true)\" /> <span class='warning'>" . $_lang['all_doc_groups'] . "</span></label></li>" . $chks;
562
+                        }
563
+                        echo '<ul>' . $chks . '</ul>';
564
+                        ?>
565 565
 					<?php } ?>
566 566
 				<?php } ?>
567 567
 
@@ -571,12 +571,12 @@  discard block
 block discarded – undo
571 571
 		<input type="submit" name="save" style="display:none">
572 572
 
573 573
 		<?php
574
-		// invoke OnTVFormRender event
575
-		$evtOut = $modx->invokeEvent('OnTVFormRender', array('id' => $id));
576
-		if(is_array($evtOut)) {
577
-			echo implode('', $evtOut);
578
-		}
579
-		?>
574
+        // invoke OnTVFormRender event
575
+        $evtOut = $modx->invokeEvent('OnTVFormRender', array('id' => $id));
576
+        if(is_array($evtOut)) {
577
+            echo implode('', $evtOut);
578
+        }
579
+        ?>
580 580
 	</div>
581 581
 </form>
582 582
 <script type="text/javascript">setTimeout('showParameters()', 10);</script>
Please login to merge, or discard this patch.
Spacing   +53 added lines, -53 removed lines patch added patch discarded remove patch
@@ -1,17 +1,17 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
 	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5
-if(!$modx->hasPermission('edit_template') && $modx->getManagerApi()->action == '301') {
5
+if (!$modx->hasPermission('edit_template') && $modx->getManagerApi()->action == '301') {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8
-if(!$modx->hasPermission('new_template') && $modx->getManagerApi()->action == '300') {
8
+if (!$modx->hasPermission('new_template') && $modx->getManagerApi()->action == '300') {
9 9
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
10 10
 }
11 11
 
12
-$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
13
-$origin = isset($_REQUEST['or']) ? (int)$_REQUEST['or'] : 76;
14
-$originId = isset($_REQUEST['oid']) ? (int)$_REQUEST['oid'] : NULL;
12
+$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0;
13
+$origin = isset($_REQUEST['or']) ? (int) $_REQUEST['or'] : 76;
14
+$originId = isset($_REQUEST['oid']) ? (int) $_REQUEST['oid'] : NULL;
15 15
 
16 16
 $tbl_site_tmplvars = $modx->getFullTableName('site_tmplvars');
17 17
 $tbl_site_templates = $modx->getFullTableName('site_templates');
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 $tbl_documentgroup_names = $modx->getFullTableName('documentgroup_names');
20 20
 
21 21
 // check to see the snippet editor isn't locked
22
-if($lockedEl = $modx->elementIsLocked(2, $id)) {
22
+if ($lockedEl = $modx->elementIsLocked(2, $id)) {
23 23
 	$modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['tmplvar']));
24 24
 }
25 25
 // end check for lock
@@ -29,25 +29,25 @@  discard block
 block discarded – undo
29 29
 
30 30
 global $content;
31 31
 $content = array();
32
-if(isset($_GET['id'])) {
32
+if (isset($_GET['id'])) {
33 33
 	$rs = $modx->getDatabase()->select('*', $tbl_site_tmplvars, "id='{$id}'");
34 34
 	$content = $modx->getDatabase()->getRow($rs);
35
-	if(!$content) {
36
-		header("Location: " . MODX_SITE_URL . "index.php?id={$site_start}");
35
+	if (!$content) {
36
+		header("Location: ".MODX_SITE_URL."index.php?id={$site_start}");
37 37
 	}
38 38
 
39 39
 	$_SESSION['itemname'] = $content['caption'];
40
-	if($content['locked'] == 1 && $modx->hasPermission('save_role') != 1) {
40
+	if ($content['locked'] == 1 && $modx->hasPermission('save_role') != 1) {
41 41
 		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
42 42
 	}
43
-} else if(isset($_REQUEST['itemname'])) {
43
+} else if (isset($_REQUEST['itemname'])) {
44 44
 	$content['name'] = $_REQUEST['itemname'];
45 45
 } else {
46 46
 	$_SESSION['itemname'] = $_lang["new_tmplvars"];
47
-	$content['category'] = (int)$_REQUEST['catid'];
47
+	$content['category'] = (int) $_REQUEST['catid'];
48 48
 }
49 49
 
50
-if($modx->getManagerApi()->hasFormValues()) {
50
+if ($modx->getManagerApi()->hasFormValues()) {
51 51
 	$modx->getManagerApi()->loadFormValues();
52 52
 }
53 53
 
@@ -56,12 +56,12 @@  discard block
 block discarded – undo
56 56
 // Add lock-element JS-Script
57 57
 $lockElementId = $id;
58 58
 $lockElementType = 2;
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
 // get available RichText Editors
62 62
 $RTEditors = '';
63 63
 $evtOut = $modx->invokeEvent('OnRichTextEditorRegister', array('forfrontend' => 1));
64
-if(is_array($evtOut)) {
64
+if (is_array($evtOut)) {
65 65
 	$RTEditors = implode(',', $evtOut);
66 66
 }
67 67
 
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 		},
108 108
 		cancel: function() {
109 109
 			documentDirty = false;
110
-			document.location.href = 'index.php?a=<?= $origin ?><?=(empty($originId) ? '' : '&id=' . $originId) ?>';
110
+			document.location.href = 'index.php?a=<?= $origin ?><?=(empty($originId) ? '' : '&id='.$originId) ?>';
111 111
 		}
112 112
 	};
113 113
 
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 	<?php
280 280
 	// invoke OnTVFormPrerender event
281 281
 	$evtOut = $modx->invokeEvent('OnTVFormPrerender', array('id' => $id));
282
-	if(is_array($evtOut)) {
282
+	if (is_array($evtOut)) {
283 283
 		echo implode("", $evtOut);
284 284
 	}
285 285
 	?>
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 	<input type="hidden" name="params" value="<?= $modx->getPhpCompat()->htmlspecialchars($content['display_params']) ?>">
292 292
 
293 293
 	<h1>
294
-		<i class="fa fa-list-alt"></i><?= ($content['name'] ? $content['name'] . '<small>(' . $content['id'] . ')</small>' : $_lang['new_tmplvars']) ?><i class="fa fa-question-circle help"></i>
294
+		<i class="fa fa-list-alt"></i><?= ($content['name'] ? $content['name'].'<small>('.$content['id'].')</small>' : $_lang['new_tmplvars']) ?><i class="fa fa-question-circle help"></i>
295 295
 	</h1>
296 296
 
297 297
 	<?= $_style['actionbuttons']['dynamic']['element'] ?>
@@ -314,8 +314,8 @@  discard block
 block discarded – undo
314 314
 					<div class="col-md-9 col-lg-10">
315 315
 						<div class="form-control-name clearfix">
316 316
 							<input name="name" type="text" maxlength="50" value="<?= $modx->getPhpCompat()->htmlspecialchars($content['name']) ?>" class="form-control form-control-lg" onchange="documentDirty=true;" />
317
-							<?php if($modx->hasPermission('save_role')): ?>
318
-								<label class="custom-control" title="<?= $_lang['lock_tmplvars'] . "\n" . $_lang['lock_tmplvars_msg'] ?>" tooltip>
317
+							<?php if ($modx->hasPermission('save_role')): ?>
318
+								<label class="custom-control" title="<?= $_lang['lock_tmplvars']."\n".$_lang['lock_tmplvars_msg'] ?>" tooltip>
319 319
 									<input name="locked" type="checkbox"<?= ($content['locked'] == 1 ? ' checked="checked"' : '') ?> />
320 320
 									<i class="fa fa-lock"></i>
321 321
 								</label>
@@ -343,9 +343,9 @@  discard block
 block discarded – undo
343 343
 						<select name="categoryid" class="form-control" onChange="documentDirty=true;">
344 344
 							<option>&nbsp;</option>
345 345
 							<?php
346
-							include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
347
-							foreach(getCategories() as $n => $v) {
348
-								echo "<option value='" . $v['id'] . "'" . ($content["category"] == $v["id"] ? " selected='selected'" : "") . ">" . $modx->getPhpCompat()->htmlspecialchars($v["category"]) . "</option>";
346
+							include_once(MODX_MANAGER_PATH.'includes/categories.inc.php');
347
+							foreach (getCategories() as $n => $v) {
348
+								echo "<option value='".$v['id']."'".($content["category"] == $v["id"] ? " selected='selected'" : "").">".$modx->getPhpCompat()->htmlspecialchars($v["category"])."</option>";
349 349
 							}
350 350
 							?>
351 351
 						</select>
@@ -383,11 +383,11 @@  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>';
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 391
 									}
392 392
 								}
393 393
 								?>
@@ -462,36 +462,36 @@  discard block
 block discarded – undo
462 462
 				$tplList = '<ul>';
463 463
 				$preCat = '';
464 464
 				$insideUl = 0;
465
-				while($row = $modx->getDatabase()->getRow($rs)) {
465
+				while ($row = $modx->getDatabase()->getRow($rs)) {
466 466
 					$row['category'] = stripslashes($row['category']); //pixelchutes
467
-					if($preCat !== $row['category']) {
467
+					if ($preCat !== $row['category']) {
468 468
 						$tplList .= $insideUl ? '</ul>' : '';
469
-						$tplList .= '<li><strong>' . $row['category'] . ($row['catid'] != '' ? ' <small>(' . $row['catid'] . ')</small>' : '') . '</strong><ul>';
469
+						$tplList .= '<li><strong>'.$row['category'].($row['catid'] != '' ? ' <small>('.$row['catid'].')</small>' : '').'</strong><ul>';
470 470
 						$insideUl = 1;
471 471
 					}
472 472
 
473
-					if($modx->getManagerApi()->action == '300' && $modx->config['default_template'] == $row['id']) {
473
+					if ($modx->getManagerApi()->action == '300' && $modx->config['default_template'] == $row['id']) {
474 474
 						$checked = true;
475
-					} elseif(isset($_GET['tpl']) && $_GET['tpl'] == $row['id']) {
475
+					} elseif (isset($_GET['tpl']) && $_GET['tpl'] == $row['id']) {
476 476
 						$checked = true;
477
-					} elseif($id == 0 && is_array($_POST['template'])) {
477
+					} elseif ($id == 0 && is_array($_POST['template'])) {
478 478
 						$checked = in_array($row['id'], $_POST['template']);
479 479
 					} else {
480 480
 						$checked = $row['tmplvarid'];
481 481
 					}
482 482
 					$selectable = !$row['selectable'] ? ' class="disabled"' : '';
483 483
 					$checked = $checked ? ' checked="checked"' : '';
484
-					$tplId = '&nbsp;<small>(' . $row['id'] . ')</small>';
485
-					$desc = !empty($row['tpldescription']) ? ' - ' . $row['tpldescription'] : '';
484
+					$tplId = '&nbsp;<small>('.$row['id'].')</small>';
485
+					$desc = !empty($row['tpldescription']) ? ' - '.$row['tpldescription'] : '';
486 486
 
487 487
 					$tplInfo = array();
488
-					if($row['tpllocked']) {
488
+					if ($row['tpllocked']) {
489 489
 						$tplInfo[] = $_lang['locked'];
490 490
 					}
491
-					if($row['id'] == $modx->config['default_template']) {
491
+					if ($row['id'] == $modx->config['default_template']) {
492 492
 						$tplInfo[] = $_lang['defaulttemplate_title'];
493 493
 					}
494
-					$tplInfo = !empty($tplInfo) ? ' <em>(' . implode(', ', $tplInfo) . ')</em>' : '';
494
+					$tplInfo = !empty($tplInfo) ? ' <em>('.implode(', ', $tplInfo).')</em>' : '';
495 495
 
496 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 497
 					$tplList .= '</li>';
@@ -506,13 +506,13 @@  discard block
 block discarded – undo
506 506
 
507 507
 				<!-- Access Permissions -->
508 508
 				<?php
509
-				if($use_udperms == 1) {
509
+				if ($use_udperms == 1) {
510 510
 					// fetch permissions for the variable
511 511
 					$rs = $modx->getDatabase()->select('documentgroup', $modx->getFullTableName('site_tmplvar_access'), "tmplvarid='{$id}'");
512 512
 					$groupsarray = $modx->getDatabase()->getColumn('documentgroup', $rs);
513 513
 
514 514
 					?>
515
-					<?php if($modx->hasPermission('access_permissions')) { ?>
515
+					<?php if ($modx->hasPermission('access_permissions')) { ?>
516 516
 						<script type="text/javascript">
517 517
 							function makePublic(b) {
518 518
 								var notPublic = false;
@@ -541,26 +541,26 @@  discard block
 block discarded – undo
541 541
 						<?php
542 542
 						$chk = '';
543 543
 						$rs = $modx->getDatabase()->select('name, id', $tbl_documentgroup_names);
544
-						if(empty($groupsarray) && is_array($_POST['docgroups']) && empty($_POST['id'])) {
544
+						if (empty($groupsarray) && is_array($_POST['docgroups']) && empty($_POST['id'])) {
545 545
 							$groupsarray = $_POST['docgroups'];
546 546
 						}
547
-						while($row = $modx->getDatabase()->getRow($rs)) {
547
+						while ($row = $modx->getDatabase()->getRow($rs)) {
548 548
 							$checked = in_array($row['id'], $groupsarray);
549
-							if($modx->hasPermission('access_permissions')) {
550
-								if($checked) {
549
+							if ($modx->hasPermission('access_permissions')) {
550
+								if ($checked) {
551 551
 									$notPublic = true;
552 552
 								}
553
-								$chks .= "<li><label><input type='checkbox' name='docgroups[]' value='" . $row['id'] . "' " . ($checked ? "checked='checked'" : '') . " onclick=\"makePublic(false)\" /> " . $row['name'] . "</label></li>";
553
+								$chks .= "<li><label><input type='checkbox' name='docgroups[]' value='".$row['id']."' ".($checked ? "checked='checked'" : '')." onclick=\"makePublic(false)\" /> ".$row['name']."</label></li>";
554 554
 							} else {
555
-								if($checked) {
556
-									echo "<input type='hidden' name='docgroups[]'  value='" . $row['id'] . "' />";
555
+								if ($checked) {
556
+									echo "<input type='hidden' name='docgroups[]'  value='".$row['id']."' />";
557 557
 								}
558 558
 							}
559 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;
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 562
 						}
563
-						echo '<ul>' . $chks . '</ul>';
563
+						echo '<ul>'.$chks.'</ul>';
564 564
 						?>
565 565
 					<?php } ?>
566 566
 				<?php } ?>
@@ -573,7 +573,7 @@  discard block
 block discarded – undo
573 573
 		<?php
574 574
 		// invoke OnTVFormRender event
575 575
 		$evtOut = $modx->invokeEvent('OnTVFormRender', array('id' => $id));
576
-		if(is_array($evtOut)) {
576
+		if (is_array($evtOut)) {
577 577
 			echo implode('', $evtOut);
578 578
 		}
579 579
 		?>
Please login to merge, or discard this patch.
manager/actions/bkmanager.static.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if (!$modx->hasPermission('bk_manager')) {
@@ -9,10 +9,10 @@  discard block
 block discarded – undo
9 9
 $dbase = trim($dbase, '`');
10 10
 
11 11
 if (!isset($modx->config['snapshot_path'])) {
12
-    if (is_dir(MODX_BASE_PATH . 'temp/backup/')) {
13
-        $modx->config['snapshot_path'] = MODX_BASE_PATH . 'temp/backup/';
12
+    if (is_dir(MODX_BASE_PATH.'temp/backup/')) {
13
+        $modx->config['snapshot_path'] = MODX_BASE_PATH.'temp/backup/';
14 14
     } else {
15
-        $modx->config['snapshot_path'] = MODX_BASE_PATH . 'assets/backup/';
15
+        $modx->config['snapshot_path'] = MODX_BASE_PATH.'assets/backup/';
16 16
     }
17 17
 }
18 18
 
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 if ($mode == 'restore1') {
24 24
     if (isset($_POST['textarea']) && !empty($_POST['textarea'])) {
25 25
         $source = trim($_POST['textarea']);
26
-        $_SESSION['textarea'] = $source . "\n";
26
+        $_SESSION['textarea'] = $source."\n";
27 27
     } else {
28 28
         $source = file_get_contents($_FILES['sqlfile']['tmp_name']);
29 29
     }
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
     header('Location: index.php?r=9&a=93');
32 32
     exit;
33 33
 } elseif ($mode == 'restore2') {
34
-    $path = $modx->config['snapshot_path'] . $_POST['filename'];
34
+    $path = $modx->config['snapshot_path'].$_POST['filename'];
35 35
     if (file_exists($path)) {
36 36
         $source = file_get_contents($path);
37 37
         import_sql($source);
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
     if (!is_writable(rtrim($modx->config['snapshot_path'], '/'))) {
78 78
         $modx->webAlertAndQuit(parsePlaceholder($_lang["bkmgr_alert_mkdir"], array('snapshot_path' => $modx->config['snapshot_path'])));
79 79
     }
80
-    $sql = "SHOW TABLE STATUS FROM `{$dbase}` LIKE '" . $modx->getDatabase()->escape($modx->getDatabase()->config['table_prefix']) . "%'";
80
+    $sql = "SHOW TABLE STATUS FROM `{$dbase}` LIKE '".$modx->getDatabase()->escape($modx->getDatabase()->config['table_prefix'])."%'";
81 81
     $rs = $modx->getDatabase()->query($sql);
82 82
     $tables = $modx->getDatabase()->getColumn('Name', $rs);
83 83
     $today = date('Y-m-d_H-i-s');
@@ -109,18 +109,18 @@  discard block
 block discarded – undo
109 109
         $modx->webAlertAndQuit('Unable to Backup Database');
110 110
     }
111 111
 } else {
112
-    include_once MODX_MANAGER_PATH . "includes/header.inc.php";  // start normal header
112
+    include_once MODX_MANAGER_PATH."includes/header.inc.php"; // start normal header
113 113
 }
114 114
 
115 115
 if (isset($_SESSION['result_msg']) && $_SESSION['result_msg'] != '') {
116 116
     switch ($_SESSION['result_msg']) {
117 117
         case 'import_ok':
118
-            $ph['result_msg_import'] = '<div class="alert alert-success">' . $_lang["bkmgr_import_ok"] . '</div>';
119
-            $ph['result_msg_snapshot'] = '<div class="alert alert-success">' . $_lang["bkmgr_import_ok"] . '</div>';
118
+            $ph['result_msg_import'] = '<div class="alert alert-success">'.$_lang["bkmgr_import_ok"].'</div>';
119
+            $ph['result_msg_snapshot'] = '<div class="alert alert-success">'.$_lang["bkmgr_import_ok"].'</div>';
120 120
             break;
121 121
         case 'snapshot_ok':
122 122
             $ph['result_msg_import'] = '';
123
-            $ph['result_msg_snapshot'] = '<div class="alert alert-success">' . $_lang["bkmgr_snapshot_ok"] . '</div>';
123
+            $ph['result_msg_snapshot'] = '<div class="alert alert-success">'.$_lang["bkmgr_snapshot_ok"].'</div>';
124 124
             break;
125 125
     }
126 126
     $_SESSION['result_msg'] = '';
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
                 f.style.display = 'none';
180 180
             }
181 181
         }
182
-        <?= (isset($_REQUEST['r']) ? " doRefresh(" . $_REQUEST['r'] . ");" : "") ?>
182
+        <?= (isset($_REQUEST['r']) ? " doRefresh(".$_REQUEST['r'].");" : "") ?>
183 183
 
184 184
     </script>
185 185
 
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
                                 </thead>
224 224
                                 <tbody>
225 225
                                 <?php
226
-                                $sql = "SHOW TABLE STATUS FROM `{$dbase}` LIKE '" . $modx->getDatabase()->escape($modx->getDatabase()->config['table_prefix']) . "%'";
226
+                                $sql = "SHOW TABLE STATUS FROM `{$dbase}` LIKE '".$modx->getDatabase()->escape($modx->getDatabase()->config['table_prefix'])."%'";
227 227
                                 $rs = $modx->getDatabase()->query($sql);
228 228
                                 $i = 0;
229 229
                                 while ($db_status = $modx->getDatabase()->getRow($rs)) {
@@ -233,29 +233,29 @@  discard block
 block discarded – undo
233 233
                                         $table_string = '';
234 234
                                     }
235 235
 
236
-                                    echo '<tr>' . "\n" . '<td><label class="form-check form-check-label"><input type="checkbox" name="chk[]" class="form-check-input" value="' . $db_status['Name'] . '"' . (strstr($table_string, $db_status['Name']) === false ? '' : ' checked="checked"') . ' /><b class="text-primary">' . $db_status['Name'] . '</b></label></td>' . "\n";
237
-                                    echo '<td class="text-xs-center">' . (!empty($db_status['Comment']) ? '<i class="' . $_style['actions_help'] . '" data-tooltip="' . $db_status['Comment'] . '"></i>' : '') . '</td>' . "\n";
238
-                                    echo '<td class="text-xs-right">' . $db_status['Rows'] . '</td>' . "\n";
239
-                                    echo '<td class="text-xs-right">' . $db_status['Collation'] . '</td>' . "\n";
236
+                                    echo '<tr>'."\n".'<td><label class="form-check form-check-label"><input type="checkbox" name="chk[]" class="form-check-input" value="'.$db_status['Name'].'"'.(strstr($table_string, $db_status['Name']) === false ? '' : ' checked="checked"').' /><b class="text-primary">'.$db_status['Name'].'</b></label></td>'."\n";
237
+                                    echo '<td class="text-xs-center">'.(!empty($db_status['Comment']) ? '<i class="'.$_style['actions_help'].'" data-tooltip="'.$db_status['Comment'].'"></i>' : '').'</td>'."\n";
238
+                                    echo '<td class="text-xs-right">'.$db_status['Rows'].'</td>'."\n";
239
+                                    echo '<td class="text-xs-right">'.$db_status['Collation'].'</td>'."\n";
240 240
 
241 241
                                     // Enable record deletion for certain tables (TRUNCATE TABLE) if they're not already empty
242 242
                                     $truncateable = array(
243
-                                        $modx->getDatabase()->config['table_prefix'] . 'event_log',
244
-                                        $modx->getDatabase()->config['table_prefix'] . 'manager_log',
243
+                                        $modx->getDatabase()->config['table_prefix'].'event_log',
244
+                                        $modx->getDatabase()->config['table_prefix'].'manager_log',
245 245
                                     );
246 246
                                     if ($modx->hasPermission('settings') && in_array($db_status['Name'], $truncateable) && $db_status['Rows'] > 0) {
247
-                                        echo '<td class="text-xs-right"><a class="text-danger" href="index.php?a=54&mode=' . $action . '&u=' . $db_status['Name'] . '" title="' . $_lang['truncate_table'] . '">' . $modx->nicesize($db_status['Data_length'] + $db_status['Data_free']) . '</a>' . '</td>' . "\n";
247
+                                        echo '<td class="text-xs-right"><a class="text-danger" href="index.php?a=54&mode='.$action.'&u='.$db_status['Name'].'" title="'.$_lang['truncate_table'].'">'.$modx->nicesize($db_status['Data_length'] + $db_status['Data_free']).'</a>'.'</td>'."\n";
248 248
                                     } else {
249
-                                        echo '<td class="text-xs-right">' . $modx->nicesize($db_status['Data_length'] + $db_status['Data_free']) . '</td>' . "\n";
249
+                                        echo '<td class="text-xs-right">'.$modx->nicesize($db_status['Data_length'] + $db_status['Data_free']).'</td>'."\n";
250 250
                                     }
251 251
 
252 252
                                     if ($modx->hasPermission('settings')) {
253
-                                        echo '<td class="text-xs-right">' . ($db_status['Data_free'] > 0 ? '<a class="text-danger" href="index.php?a=54&mode=' . $action . '&t=' . $db_status['Name'] . '" title="' . $_lang['optimize_table'] . '">' . $modx->nicesize($db_status['Data_free']) . '</a>' : '-') . '</td>' . "\n";
253
+                                        echo '<td class="text-xs-right">'.($db_status['Data_free'] > 0 ? '<a class="text-danger" href="index.php?a=54&mode='.$action.'&t='.$db_status['Name'].'" title="'.$_lang['optimize_table'].'">'.$modx->nicesize($db_status['Data_free']).'</a>' : '-').'</td>'."\n";
254 254
                                     } else {
255
-                                        echo '<td class="text-xs-right">' . ($db_status['Data_free'] > 0 ? $modx->nicesize($db_status['Data_free']) : '-') . '</td>' . "\n";
255
+                                        echo '<td class="text-xs-right">'.($db_status['Data_free'] > 0 ? $modx->nicesize($db_status['Data_free']) : '-').'</td>'."\n";
256 256
                                     }
257 257
 
258
-                                    echo '<td class="text-xs-right">' . $modx->nicesize($db_status['Data_length'] - $db_status['Data_free']) . '</td>' . "\n" . '<td class="text-xs-right">' . $modx->nicesize($db_status['Index_length']) . '</td>' . "\n" . '<td class="text-xs-right">' . $modx->nicesize($db_status['Index_length'] + $db_status['Data_length'] + $db_status['Data_free']) . '</td>' . "\n" . "</tr>";
258
+                                    echo '<td class="text-xs-right">'.$modx->nicesize($db_status['Data_length'] - $db_status['Data_free']).'</td>'."\n".'<td class="text-xs-right">'.$modx->nicesize($db_status['Index_length']).'</td>'."\n".'<td class="text-xs-right">'.$modx->nicesize($db_status['Index_length'] + $db_status['Data_length'] + $db_status['Data_free']).'</td>'."\n"."</tr>";
259 259
 
260 260
                                     $total = $total + $db_status['Index_length'] + $db_status['Data_length'];
261 261
                                     $totaloverhead = $totaloverhead + $db_status['Data_free'];
@@ -266,9 +266,9 @@  discard block
 block discarded – undo
266 266
                                 <tr>
267 267
                                     <td class="text-xs-right"><?= $_lang['database_table_totals'] ?></td>
268 268
                                     <td colspan="4">&nbsp;</td>
269
-                                    <td class="text-xs-right"><?= $totaloverhead > 0 ? '<b class="text-danger">' . $modx->nicesize($totaloverhead) . '</b><br />(' . number_format($totaloverhead) . ' B)' : '-' ?></td>
269
+                                    <td class="text-xs-right"><?= $totaloverhead > 0 ? '<b class="text-danger">'.$modx->nicesize($totaloverhead).'</b><br />('.number_format($totaloverhead).' B)' : '-' ?></td>
270 270
                                     <td colspan="2">&nbsp;</td>
271
-                                    <td class="text-xs-right"><?= "<b>" . $modx->nicesize($total) . "</b><br />(" . number_format($total) . " B)" ?></td>
271
+                                    <td class="text-xs-right"><?= "<b>".$modx->nicesize($total)."</b><br />(".number_format($total)." B)" ?></td>
272 272
                                 </tr>
273 273
                                 </tfoot>
274 274
                             </table>
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
                             foreach ($last_result['0'] as $k => $v) {
320 320
                                 $title[] = $k;
321 321
                             }
322
-                            $result = '<thead><tr><th>' . implode('</th><th>', $title) . '</th></tr></thead>';
322
+                            $result = '<thead><tr><th>'.implode('</th><th>', $title).'</th></tr></thead>';
323 323
                             $result .= '<tbody>';
324 324
                             foreach ($last_result as $row) {
325 325
                                 $result_value = array();
@@ -327,11 +327,11 @@  discard block
 block discarded – undo
327 327
                                     foreach ($row as $k => $v) {
328 328
                                         $result_value[] = $v;
329 329
                                     }
330
-                                    $result .= '<tr><td>' . implode('</td><td>', $result_value) . '</td></tr>';
330
+                                    $result .= '<tr><td>'.implode('</td><td>', $result_value).'</td></tr>';
331 331
                                 }
332 332
                             }
333 333
                             $result .= '</tbody>';
334
-                            $result = '<table class="table data">' . $result . '</table>';
334
+                            $result = '<table class="table data">'.$result.'</table>';
335 335
                         }
336 336
                     }
337 337
 
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
                                         while ($count < 11) {
434 434
                                             $line = fgets($file);
435 435
                                             foreach ($detailFields as $label) {
436
-                                                $fileLabel = '# ' . $label;
436
+                                                $fileLabel = '# '.$label;
437 437
                                                 if (strpos($line, $fileLabel) !== false) {
438 438
                                                     $details[$label] = htmlentities(trim(str_replace(array(
439 439
                                                         $fileLabel,
@@ -446,10 +446,10 @@  discard block
 block discarded – undo
446 446
                                         };
447 447
                                         fclose($file);
448 448
 
449
-                                        $tooltip = "Generation Time: " . $details["Generation Time"] . "\n";
450
-                                        $tooltip .= "Server version: " . $details["Server version"] . "\n";
451
-                                        $tooltip .= "PHP Version: " . $details["PHP Version"] . "\n";
452
-                                        $tooltip .= "Host: " . $details["Host"] . "\n";
449
+                                        $tooltip = "Generation Time: ".$details["Generation Time"]."\n";
450
+                                        $tooltip .= "Server version: ".$details["Server version"]."\n";
451
+                                        $tooltip .= "PHP Version: ".$details["PHP Version"]."\n";
452
+                                        $tooltip .= "Host: ".$details["Host"]."\n";
453 453
                                         ?>
454 454
                                         <tr>
455 455
                                             <td><?= $filename ?></td>
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
 <?php
482 482
 
483 483
 if (is_numeric($_GET['tab'])) {
484
-    echo '<script type="text/javascript">tpDBM.setSelectedIndex( ' . $_GET['tab'] . ' );</script>';
484
+    echo '<script type="text/javascript">tpDBM.setSelectedIndex( '.$_GET['tab'].' );</script>';
485 485
 }
486 486
 
487 487
 include_once "footer.inc.php"; // send footer
Please login to merge, or discard this patch.
manager/actions/web_access_permissions.dynamic.php 2 patches
Indentation   +89 added lines, -89 removed lines patch added patch discarded remove patch
@@ -1,32 +1,32 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3
-	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
3
+    die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if(!$modx->hasPermission('web_access_permissions')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 // find all document groups, for the select :)
10 10
 $rs = $modx->getDatabase()->select('*', $modx->getFullTableName('documentgroup_names'), '', 'name');
11 11
 if($modx->getDatabase()->getRecordCount($rs) < 1) {
12
-	$docgroupselector = "[no groups to add]";
12
+    $docgroupselector = "[no groups to add]";
13 13
 } else {
14
-	$docgroupselector = '<select name="docgroup">' . "\n";
15
-	while($row = $modx->getDatabase()->getRow($rs)) {
16
-		$docgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n";
17
-	}
18
-	$docgroupselector .= "</select>\n";
14
+    $docgroupselector = '<select name="docgroup">' . "\n";
15
+    while($row = $modx->getDatabase()->getRow($rs)) {
16
+        $docgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n";
17
+    }
18
+    $docgroupselector .= "</select>\n";
19 19
 }
20 20
 
21 21
 $rs = $modx->getDatabase()->select('*', $modx->getFullTableName('webgroup_names'), '', 'name');
22 22
 if($modx->getDatabase()->getRecordCount($rs) < 1) {
23
-	$usrgroupselector = '[no user groups]';
23
+    $usrgroupselector = '[no user groups]';
24 24
 } else {
25
-	$usrgroupselector = '<select name="usergroup">' . "\n";
26
-	while($row = $modx->getDatabase()->getRow($rs)) {
27
-		$usrgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n";
28
-	}
29
-	$usrgroupselector .= "</select>\n";
25
+    $usrgroupselector = '<select name="usergroup">' . "\n";
26
+    while($row = $modx->getDatabase()->getRow($rs)) {
27
+        $usrgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n";
28
+    }
29
+    $usrgroupselector .= "</select>\n";
30 30
 }
31 31
 
32 32
 ?>
@@ -88,24 +88,24 @@  discard block
 block discarded – undo
88 88
 				</form>
89 89
 			</div>
90 90
 			<?php
91
-			$rs = $modx->getDatabase()->select('groupnames.*, users.id AS user_id, users.username user_name ', $modx->getFullTableName('webgroup_names') . " AS groupnames
91
+            $rs = $modx->getDatabase()->select('groupnames.*, users.id AS user_id, users.username user_name ', $modx->getFullTableName('webgroup_names') . " AS groupnames
92 92
 			LEFT JOIN " . $modx->getFullTableName('web_groups') . " AS groups ON groups.webgroup = groupnames.id
93 93
 			LEFT JOIN " . $modx->getFullTableName('web_users') . " AS users ON users.id = groups.webuser", '', 'groupnames.name, user_name');
94
-			if($modx->getDatabase()->getRecordCount($rs) < 1) {
95
-				?>
94
+            if($modx->getDatabase()->getRecordCount($rs) < 1) {
95
+                ?>
96 96
 				<div class="text-danger"><?= $_lang['no_groups_found'] ?></div>
97 97
 				<?php
98
-			} else {
99
-			?>
98
+            } else {
99
+            ?>
100 100
 			<div class="form-group">
101 101
 				<?php
102
-				$pid = '';
103
-				while($row = $modx->getDatabase()->getRow($rs)) {
104
-					if($pid != $row['id']) {
105
-						if($pid != '') {
106
-							echo '</div><div class="form-group">';
107
-						}
108
-						?>
102
+                $pid = '';
103
+                while($row = $modx->getDatabase()->getRow($rs)) {
104
+                    if($pid != $row['id']) {
105
+                        if($pid != '') {
106
+                            echo '</div><div class="form-group">';
107
+                        }
108
+                        ?>
109 109
 						<form method="post" action="index.php" name="accesspermissions">
110 110
 							<input type="hidden" name="a" value="92" />
111 111
 							<input type="hidden" name="groupid" value="<?= $row['id'] ?>" />
@@ -120,21 +120,21 @@  discard block
 block discarded – undo
120 120
 						</form>
121 121
 						<?= $_lang['web_access_permissions_users_in_group'] ?>
122 122
 						<?php
123
-					}
124
-					if(!$row['user_id']) {
125
-						?>
123
+                    }
124
+                    if(!$row['user_id']) {
125
+                        ?>
126 126
 						<i><?= $_lang['access_permissions_no_users_in_group'] ?></i>
127 127
 						<?php
128
-						$pid = $row['id'];
129
-						continue;
130
-					}
131
-					?>
128
+                        $pid = $row['id'];
129
+                        continue;
130
+                    }
131
+                    ?>
132 132
 					<?= ($pid == $row['id'] ? ', ' : '') ?><a href="index.php?a=88&id=<?= $row['user_id'] ?>"><?= $row['user_name'] ?></a>
133 133
 					<?php
134
-					$pid = $row['id'];
135
-				}
136
-				}
137
-				?>
134
+                    $pid = $row['id'];
135
+                }
136
+                }
137
+                ?>
138 138
 			</div>
139 139
 		</div>
140 140
 	</div>
@@ -159,24 +159,24 @@  discard block
 block discarded – undo
159 159
 				</form>
160 160
 			</div>
161 161
 			<?php
162
-			$rs = $modx->getDatabase()->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', $modx->getFullTableName('documentgroup_names') . " AS dgnames
162
+            $rs = $modx->getDatabase()->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', $modx->getFullTableName('documentgroup_names') . " AS dgnames
163 163
 			LEFT JOIN " . $modx->getFullTableName('document_groups') . " AS dg ON dg.document_group = dgnames.id
164 164
 			LEFT JOIN " . $modx->getFullTableName('site_content') . " AS sc ON sc.id = dg.document", '', 'dgnames.name, sc.id');
165
-			if($modx->getDatabase()->getRecordCount($rs) < 1) {
166
-				?>
165
+            if($modx->getDatabase()->getRecordCount($rs) < 1) {
166
+                ?>
167 167
 				<div class="text-danger"><?= $_lang['no_groups_found'] ?></div>
168 168
 				<?php
169
-			} else {
170
-			?>
169
+            } else {
170
+            ?>
171 171
 			<div class="form-group">
172 172
 				<?php
173
-				$pid = '';
174
-				while($row = $modx->getDatabase()->getRow($rs)) {
175
-					if($pid != $row['id']) {
176
-						if($pid != '') {
177
-							echo '</div><div class="form-group">';
178
-						}
179
-						?>
173
+                $pid = '';
174
+                while($row = $modx->getDatabase()->getRow($rs)) {
175
+                    if($pid != $row['id']) {
176
+                        if($pid != '') {
177
+                            echo '</div><div class="form-group">';
178
+                        }
179
+                        ?>
180 180
 						<form method="post" action="index.php" name="accesspermissions">
181 181
 							<input type="hidden" name="a" value="92" />
182 182
 							<input type="hidden" name="groupid" value="<?= $row['id'] ?>" />
@@ -191,21 +191,21 @@  discard block
 block discarded – undo
191 191
 						</form>
192 192
 						<?= $_lang['access_permissions_resources_in_group'] ?>
193 193
 						<?php
194
-					}
195
-					if(!$row['doc_id']) {
196
-						?>
194
+                    }
195
+                    if(!$row['doc_id']) {
196
+                        ?>
197 197
 						<i><?= $_lang['access_permissions_no_resources_in_group'] ?></i>
198 198
 						<?php
199
-						$pid = $row['id'];
200
-						continue;
201
-					}
202
-					?>
199
+                        $pid = $row['id'];
200
+                        continue;
201
+                    }
202
+                    ?>
203 203
 					<?= ($pid == $row['id'] ? ', ' : '') ?><a href="index.php?a=3&id=<?= $row['doc_id'] ?>" title="<?= $modx->getPhpCompat()->htmlspecialchars($row['doc_title']) ?>"><?= $row['doc_id'] ?></a>
204 204
 					<?php
205
-					$pid = $row['id'];
206
-				}
207
-				}
208
-				?>
205
+                    $pid = $row['id'];
206
+                }
207
+                }
208
+                ?>
209 209
 			</div>
210 210
 		</div>
211 211
 	</div>
@@ -217,15 +217,15 @@  discard block
 block discarded – undo
217 217
 		<div class="container container-body">
218 218
 			<p class="element-edit-message-tab alert alert-warning"><?= $_lang['access_permissions_links_tab'] ?></p>
219 219
 			<?php
220
-			$rs = $modx->getDatabase()->select('groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', $modx->getFullTableName('webgroup_names') . " AS groupnames
220
+            $rs = $modx->getDatabase()->select('groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', $modx->getFullTableName('webgroup_names') . " AS groupnames
221 221
 			LEFT JOIN " . $modx->getFullTableName('webgroup_access') . " AS groupacc ON groupacc.webgroup = groupnames.id
222 222
 			LEFT JOIN " . $modx->getFullTableName('documentgroup_names') . " AS dgnames ON dgnames.id = groupacc.documentgroup", '', 'name, dg_name');
223
-			if($modx->getDatabase()->getRecordCount($rs) < 1) {
224
-				?>
223
+            if($modx->getDatabase()->getRecordCount($rs) < 1) {
224
+                ?>
225 225
 				<div class="text-danger"><?= $_lang['no_groups_found'] ?></div>
226 226
 				<?php
227
-			} else {
228
-				?>
227
+            } else {
228
+                ?>
229 229
 				<div class="form-group">
230 230
 					<b><?= $_lang["access_permissions_group_link"] ?></b>
231 231
 					<form method="post" action="index.php" name="accesspermissions">
@@ -241,38 +241,38 @@  discard block
 block discarded – undo
241 241
 				<hr>
242 242
 				<ul>
243 243
 					<?php
244
-					$pid = '';
245
-					while($row = $modx->getDatabase()->getRow($rs)) {
246
-						if($row['id'] != $pid) {
247
-							if($pid != '') {
248
-								echo '</ul></li>';
249
-							} // close previous one
250
-							?>
244
+                    $pid = '';
245
+                    while($row = $modx->getDatabase()->getRow($rs)) {
246
+                        if($row['id'] != $pid) {
247
+                            if($pid != '') {
248
+                                echo '</ul></li>';
249
+                            } // close previous one
250
+                            ?>
251 251
 							<li><b><?= $row['name'] ?></b></li>
252 252
 							<?php
253
-							if(!$row['dg_id']) {
254
-								echo '<i>' . $_lang['no_groups_found'] . '</i></li>';
255
-								$pid = '';
256
-								continue;
257
-							} else {
258
-								echo '<ul>';
259
-							}
260
-						}
261
-						if(!$row['dg_id']) {
262
-							continue;
263
-						}
264
-						?>
253
+                            if(!$row['dg_id']) {
254
+                                echo '<i>' . $_lang['no_groups_found'] . '</i></li>';
255
+                                $pid = '';
256
+                                continue;
257
+                            } else {
258
+                                echo '<ul>';
259
+                            }
260
+                        }
261
+                        if(!$row['dg_id']) {
262
+                            continue;
263
+                        }
264
+                        ?>
265 265
 						<li><?= $row['dg_name'] ?>
266 266
 							<small><i>(<a class="text-danger" href="index.php?a=92&coupling=<?= $row['link_id'] ?>&operation=remove_document_group_from_user_group"><?= $_lang['remove'] ?></a>)</i></small>
267 267
 						</li>
268 268
 						<?php
269
-						$pid = $row['id'];
270
-					}
271
-					?>
269
+                        $pid = $row['id'];
270
+                    }
271
+                    ?>
272 272
 				</ul>
273 273
 				<?php
274
-			}
275
-			?>
274
+            }
275
+            ?>
276 276
 		</div>
277 277
 	</div>
278 278
 
Please login to merge, or discard this patch.
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -1,30 +1,30 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
 	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5
-if(!$modx->hasPermission('web_access_permissions')) {
5
+if (!$modx->hasPermission('web_access_permissions')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 // find all document groups, for the select :)
10 10
 $rs = $modx->getDatabase()->select('*', $modx->getFullTableName('documentgroup_names'), '', 'name');
11
-if($modx->getDatabase()->getRecordCount($rs) < 1) {
11
+if ($modx->getDatabase()->getRecordCount($rs) < 1) {
12 12
 	$docgroupselector = "[no groups to add]";
13 13
 } else {
14
-	$docgroupselector = '<select name="docgroup">' . "\n";
15
-	while($row = $modx->getDatabase()->getRow($rs)) {
16
-		$docgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n";
14
+	$docgroupselector = '<select name="docgroup">'."\n";
15
+	while ($row = $modx->getDatabase()->getRow($rs)) {
16
+		$docgroupselector .= "\t".'<option value="'.$row['id'].'">'.$row['name']."</option>\n";
17 17
 	}
18 18
 	$docgroupselector .= "</select>\n";
19 19
 }
20 20
 
21 21
 $rs = $modx->getDatabase()->select('*', $modx->getFullTableName('webgroup_names'), '', 'name');
22
-if($modx->getDatabase()->getRecordCount($rs) < 1) {
22
+if ($modx->getDatabase()->getRecordCount($rs) < 1) {
23 23
 	$usrgroupselector = '[no user groups]';
24 24
 } else {
25
-	$usrgroupselector = '<select name="usergroup">' . "\n";
26
-	while($row = $modx->getDatabase()->getRow($rs)) {
27
-		$usrgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n";
25
+	$usrgroupselector = '<select name="usergroup">'."\n";
26
+	while ($row = $modx->getDatabase()->getRow($rs)) {
27
+		$usrgroupselector .= "\t".'<option value="'.$row['id'].'">'.$row['name']."</option>\n";
28 28
 	}
29 29
 	$usrgroupselector .= "</select>\n";
30 30
 }
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 	<div class="alert alert-info"><?= $_lang['access_permissions_introtext'] ?></div>
61 61
 </div>
62 62
 
63
-<div class="container"><?= ($use_udperms != 1 ? '<div class="alert alert-danger">' . $_lang['access_permissions_off'] . '</div>' : '') ?></div>
63
+<div class="container"><?= ($use_udperms != 1 ? '<div class="alert alert-danger">'.$_lang['access_permissions_off'].'</div>' : '') ?></div>
64 64
 
65 65
 
66 66
 <div class="tab-pane" id="wuapPane">
@@ -88,10 +88,10 @@  discard block
 block discarded – undo
88 88
 				</form>
89 89
 			</div>
90 90
 			<?php
91
-			$rs = $modx->getDatabase()->select('groupnames.*, users.id AS user_id, users.username user_name ', $modx->getFullTableName('webgroup_names') . " AS groupnames
92
-			LEFT JOIN " . $modx->getFullTableName('web_groups') . " AS groups ON groups.webgroup = groupnames.id
93
-			LEFT JOIN " . $modx->getFullTableName('web_users') . " AS users ON users.id = groups.webuser", '', 'groupnames.name, user_name');
94
-			if($modx->getDatabase()->getRecordCount($rs) < 1) {
91
+			$rs = $modx->getDatabase()->select('groupnames.*, users.id AS user_id, users.username user_name ', $modx->getFullTableName('webgroup_names')." AS groupnames
92
+			LEFT JOIN " . $modx->getFullTableName('web_groups')." AS groups ON groups.webgroup = groupnames.id
93
+			LEFT JOIN " . $modx->getFullTableName('web_users')." AS users ON users.id = groups.webuser", '', 'groupnames.name, user_name');
94
+			if ($modx->getDatabase()->getRecordCount($rs) < 1) {
95 95
 				?>
96 96
 				<div class="text-danger"><?= $_lang['no_groups_found'] ?></div>
97 97
 				<?php
@@ -100,9 +100,9 @@  discard block
 block discarded – undo
100 100
 			<div class="form-group">
101 101
 				<?php
102 102
 				$pid = '';
103
-				while($row = $modx->getDatabase()->getRow($rs)) {
104
-					if($pid != $row['id']) {
105
-						if($pid != '') {
103
+				while ($row = $modx->getDatabase()->getRow($rs)) {
104
+					if ($pid != $row['id']) {
105
+						if ($pid != '') {
106 106
 							echo '</div><div class="form-group">';
107 107
 						}
108 108
 						?>
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 						<?= $_lang['web_access_permissions_users_in_group'] ?>
122 122
 						<?php
123 123
 					}
124
-					if(!$row['user_id']) {
124
+					if (!$row['user_id']) {
125 125
 						?>
126 126
 						<i><?= $_lang['access_permissions_no_users_in_group'] ?></i>
127 127
 						<?php
@@ -159,10 +159,10 @@  discard block
 block discarded – undo
159 159
 				</form>
160 160
 			</div>
161 161
 			<?php
162
-			$rs = $modx->getDatabase()->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', $modx->getFullTableName('documentgroup_names') . " AS dgnames
163
-			LEFT JOIN " . $modx->getFullTableName('document_groups') . " AS dg ON dg.document_group = dgnames.id
164
-			LEFT JOIN " . $modx->getFullTableName('site_content') . " AS sc ON sc.id = dg.document", '', 'dgnames.name, sc.id');
165
-			if($modx->getDatabase()->getRecordCount($rs) < 1) {
162
+			$rs = $modx->getDatabase()->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', $modx->getFullTableName('documentgroup_names')." AS dgnames
163
+			LEFT JOIN " . $modx->getFullTableName('document_groups')." AS dg ON dg.document_group = dgnames.id
164
+			LEFT JOIN " . $modx->getFullTableName('site_content')." AS sc ON sc.id = dg.document", '', 'dgnames.name, sc.id');
165
+			if ($modx->getDatabase()->getRecordCount($rs) < 1) {
166 166
 				?>
167 167
 				<div class="text-danger"><?= $_lang['no_groups_found'] ?></div>
168 168
 				<?php
@@ -171,9 +171,9 @@  discard block
 block discarded – undo
171 171
 			<div class="form-group">
172 172
 				<?php
173 173
 				$pid = '';
174
-				while($row = $modx->getDatabase()->getRow($rs)) {
175
-					if($pid != $row['id']) {
176
-						if($pid != '') {
174
+				while ($row = $modx->getDatabase()->getRow($rs)) {
175
+					if ($pid != $row['id']) {
176
+						if ($pid != '') {
177 177
 							echo '</div><div class="form-group">';
178 178
 						}
179 179
 						?>
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 						<?= $_lang['access_permissions_resources_in_group'] ?>
193 193
 						<?php
194 194
 					}
195
-					if(!$row['doc_id']) {
195
+					if (!$row['doc_id']) {
196 196
 						?>
197 197
 						<i><?= $_lang['access_permissions_no_resources_in_group'] ?></i>
198 198
 						<?php
@@ -217,10 +217,10 @@  discard block
 block discarded – undo
217 217
 		<div class="container container-body">
218 218
 			<p class="element-edit-message-tab alert alert-warning"><?= $_lang['access_permissions_links_tab'] ?></p>
219 219
 			<?php
220
-			$rs = $modx->getDatabase()->select('groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', $modx->getFullTableName('webgroup_names') . " AS groupnames
221
-			LEFT JOIN " . $modx->getFullTableName('webgroup_access') . " AS groupacc ON groupacc.webgroup = groupnames.id
222
-			LEFT JOIN " . $modx->getFullTableName('documentgroup_names') . " AS dgnames ON dgnames.id = groupacc.documentgroup", '', 'name, dg_name');
223
-			if($modx->getDatabase()->getRecordCount($rs) < 1) {
220
+			$rs = $modx->getDatabase()->select('groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', $modx->getFullTableName('webgroup_names')." AS groupnames
221
+			LEFT JOIN " . $modx->getFullTableName('webgroup_access')." AS groupacc ON groupacc.webgroup = groupnames.id
222
+			LEFT JOIN " . $modx->getFullTableName('documentgroup_names')." AS dgnames ON dgnames.id = groupacc.documentgroup", '', 'name, dg_name');
223
+			if ($modx->getDatabase()->getRecordCount($rs) < 1) {
224 224
 				?>
225 225
 				<div class="text-danger"><?= $_lang['no_groups_found'] ?></div>
226 226
 				<?php
@@ -242,23 +242,23 @@  discard block
 block discarded – undo
242 242
 				<ul>
243 243
 					<?php
244 244
 					$pid = '';
245
-					while($row = $modx->getDatabase()->getRow($rs)) {
246
-						if($row['id'] != $pid) {
247
-							if($pid != '') {
245
+					while ($row = $modx->getDatabase()->getRow($rs)) {
246
+						if ($row['id'] != $pid) {
247
+							if ($pid != '') {
248 248
 								echo '</ul></li>';
249 249
 							} // close previous one
250 250
 							?>
251 251
 							<li><b><?= $row['name'] ?></b></li>
252 252
 							<?php
253
-							if(!$row['dg_id']) {
254
-								echo '<i>' . $_lang['no_groups_found'] . '</i></li>';
253
+							if (!$row['dg_id']) {
254
+								echo '<i>'.$_lang['no_groups_found'].'</i></li>';
255 255
 								$pid = '';
256 256
 								continue;
257 257
 							} else {
258 258
 								echo '<ul>';
259 259
 							}
260 260
 						}
261
-						if(!$row['dg_id']) {
261
+						if (!$row['dg_id']) {
262 262
 							continue;
263 263
 						}
264 264
 						?>
Please login to merge, or discard this patch.
manager/actions/mutate_module.dynamic.php 4 patches
Indentation   +89 added lines, -89 removed lines patch added patch discarded remove patch
@@ -1,20 +1,20 @@  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
 switch($modx->getManagerApi()->action) {
6
-	case 107:
7
-		if(!$modx->hasPermission('new_module')) {
8
-			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
9
-		}
10
-		break;
11
-	case 108:
12
-		if(!$modx->hasPermission('edit_module')) {
13
-			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
14
-		}
15
-		break;
16
-	default:
17
-		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    case 107:
7
+        if(!$modx->hasPermission('new_module')) {
8
+            $modx->webAlertAndQuit($_lang["error_no_privileges"]);
9
+        }
10
+        break;
11
+    case 108:
12
+        if(!$modx->hasPermission('edit_module')) {
13
+            $modx->webAlertAndQuit($_lang["error_no_privileges"]);
14
+        }
15
+        break;
16
+    default:
17
+        $modx->webAlertAndQuit($_lang["error_no_privileges"]);
18 18
 }
19 19
 $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
20 20
 // Get table names (alphabetical)
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 
33 33
 // check to see the module editor isn't locked
34 34
 if($lockedEl = $modx->elementIsLocked(6, $id)) {
35
-	$modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module']));
35
+    $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module']));
36 36
 }
37 37
 // end check for lock
38 38
 
@@ -40,22 +40,22 @@  discard block
 block discarded – undo
40 40
 $modx->lockElement(6, $id);
41 41
 
42 42
 if(isset($_GET['id'])) {
43
-	$rs = $modx->getDatabase()->select('*', $tbl_site_modules, "id='{$id}'");
44
-	$content = $modx->getDatabase()->getRow($rs);
45
-	if(!$content) {
46
-		$modx->webAlertAndQuit("Module not found for id '{$id}'.");
47
-	}
48
-	$content['properties'] = str_replace("&", "&amp;", $content['properties']);
49
-	$_SESSION['itemname'] = $content['name'];
50
-	if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
51
-		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
52
-	}
43
+    $rs = $modx->getDatabase()->select('*', $tbl_site_modules, "id='{$id}'");
44
+    $content = $modx->getDatabase()->getRow($rs);
45
+    if(!$content) {
46
+        $modx->webAlertAndQuit("Module not found for id '{$id}'.");
47
+    }
48
+    $content['properties'] = str_replace("&", "&amp;", $content['properties']);
49
+    $_SESSION['itemname'] = $content['name'];
50
+    if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
51
+        $modx->webAlertAndQuit($_lang["error_no_privileges"]);
52
+    }
53 53
 } else {
54
-	$_SESSION['itemname'] = $_lang["new_module"];
55
-	$content['wrap'] = '1';
54
+    $_SESSION['itemname'] = $_lang["new_module"];
55
+    $content['wrap'] = '1';
56 56
 }
57 57
 if($modx->getManagerApi()->hasFormValues()) {
58
-	$modx->getManagerApi()->loadFormValues();
58
+    $modx->getManagerApi()->loadFormValues();
59 59
 }
60 60
 
61 61
 // Add lock-element JS-Script
@@ -426,18 +426,18 @@  discard block
 block discarded – undo
426 426
 
427 427
 <form name="mutate" id="mutate" class="module" method="post" action="index.php?a=109">
428 428
 	<?php
429
-	// invoke OnModFormPrerender event
430
-	$evtOut = $modx->invokeEvent('OnModFormPrerender', array('id' => $id));
431
-	if(is_array($evtOut)) {
432
-		echo implode('', $evtOut);
433
-	}
434
-
435
-	// Prepare internal params & info-tab via parseDocBlock
436
-	$modulecode = isset($content['modulecode']) ? $modx->getDatabase()->escape($content['modulecode']) : '';
437
-	$docBlock = $modx->parseDocBlockFromString($modulecode);
438
-	$docBlockList = $modx->convertDocBlockIntoList($docBlock);
439
-	$internal = array();
440
-	?>
429
+    // invoke OnModFormPrerender event
430
+    $evtOut = $modx->invokeEvent('OnModFormPrerender', array('id' => $id));
431
+    if(is_array($evtOut)) {
432
+        echo implode('', $evtOut);
433
+    }
434
+
435
+    // Prepare internal params & info-tab via parseDocBlock
436
+    $modulecode = isset($content['modulecode']) ? $modx->getDatabase()->escape($content['modulecode']) : '';
437
+    $docBlock = $modx->parseDocBlockFromString($modulecode);
438
+    $docBlockList = $modx->convertDocBlockIntoList($docBlock);
439
+    $internal = array();
440
+    ?>
441 441
 	<input type="hidden" name="id" value="<?= $content['id'] ?>">
442 442
 	<input type="hidden" name="mode" value="<?= $modx->getManagerApi()->action ?>">
443 443
 
@@ -490,11 +490,11 @@  discard block
 block discarded – undo
490 490
 							<select name="categoryid" class="form-control" onchange="documentDirty=true;">
491 491
 								<option>&nbsp;</option>
492 492
 								<?php
493
-								include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
494
-								foreach(getCategories() as $n => $v) {
495
-									echo "\t\t\t" . '<option value="' . $v['id'] . '"' . ($content['category'] == $v['id'] ? ' selected="selected"' : '') . '>' . $modx->getPhpCompat()->htmlspecialchars($v['category']) . "</option>\n";
496
-								}
497
-								?>
493
+                                include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
494
+                                foreach(getCategories() as $n => $v) {
495
+                                    echo "\t\t\t" . '<option value="' . $v['id'] . '"' . ($content['category'] == $v['id'] ? ' selected="selected"' : '') . '>' . $modx->getPhpCompat()->htmlspecialchars($v['category']) . "</option>\n";
496
+                                }
497
+                                ?>
498 498
 							</select>
499 499
 						</div>
500 500
 					</div>
@@ -601,7 +601,7 @@  discard block
 block discarded – undo
601 601
 							<i class="<?= $_style["actions_save"] ?>"></i> <?= $_lang['manage_depends'] ?></a>
602 602
 					</div>
603 603
 					<?php
604
-					$ds = $modx->getDatabase()->select("smd.id, COALESCE(ss.name,st.templatename,sv.name,sc.name,sp.name,sd.pagetitle) AS name, 
604
+                    $ds = $modx->getDatabase()->select("smd.id, COALESCE(ss.name,st.templatename,sv.name,sc.name,sp.name,sd.pagetitle) AS name, 
605 605
 					CASE smd.type
606 606
 						WHEN 10 THEN 'Chunk'
607 607
 						WHEN 20 THEN 'Document'
@@ -617,17 +617,17 @@  discard block
 block discarded – undo
617 617
 						LEFT JOIN {$tbl_site_templates} AS st ON st.id = smd.resource AND smd.type = 50
618 618
 						LEFT JOIN {$tbl_site_tmplvars} AS sv ON sv.id = smd.resource AND smd.type = 60", "smd.module='{$id}'", 'smd.type,name');
619 619
 
620
-					include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php";
621
-					$grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items
622
-					$grd->noRecordMsg = $_lang['no_records_found'];
623
-					$grd->cssClass = 'grid';
624
-					$grd->columnHeaderClass = 'gridHeader';
625
-					$grd->itemClass = 'gridItem';
626
-					$grd->altItemClass = 'gridAltItem';
627
-					$grd->columns = $_lang['element_name'] . " ," . $_lang['type'];
628
-					$grd->fields = "name,type";
629
-					echo $grd->render();
630
-					?>
620
+                    include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php";
621
+                    $grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items
622
+                    $grd->noRecordMsg = $_lang['no_records_found'];
623
+                    $grd->cssClass = 'grid';
624
+                    $grd->columnHeaderClass = 'gridHeader';
625
+                    $grd->itemClass = 'gridItem';
626
+                    $grd->altItemClass = 'gridAltItem';
627
+                    $grd->columns = $_lang['element_name'] . " ," . $_lang['type'];
628
+                    $grd->fields = "name,type";
629
+                    echo $grd->render();
630
+                    ?>
631 631
 				</div>
632 632
 			</div>
633 633
 		<?php endif; ?>
@@ -639,12 +639,12 @@  discard block
 block discarded – undo
639 639
 			<div class="container container-body">
640 640
 				<?php if($use_udperms == 1) : ?>
641 641
 					<?php
642
-					// fetch user access permissions for the module
643
-					$rs = $modx->getDatabase()->select('usergroup', $tbl_site_module_access, "module='{$id}'");
644
-					$groupsarray = $modx->getDatabase()->getColumn('usergroup', $rs);
642
+                    // fetch user access permissions for the module
643
+                    $rs = $modx->getDatabase()->select('usergroup', $tbl_site_module_access, "module='{$id}'");
644
+                    $groupsarray = $modx->getDatabase()->getColumn('usergroup', $rs);
645 645
 
646
-					if($modx->hasPermission('access_permissions')) {
647
-						?>
646
+                    if($modx->hasPermission('access_permissions')) {
647
+                        ?>
648 648
 						<!-- User Group Access Permissions -->
649 649
 						<script type="text/javascript">
650 650
 							function makePublic(b) {
@@ -668,28 +668,28 @@  discard block
 block discarded – undo
668 668
 						</script>
669 669
 						<p><?= $_lang['module_group_access_msg'] ?></p>
670 670
 						<?php
671
-					}
672
-					$chk = '';
673
-					$rs = $modx->getDatabase()->select('name, id', $tbl_membergroup_names, '', 'name');
674
-					while($row = $modx->getDatabase()->getRow($rs)) {
675
-						$groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array();
676
-						$checked = in_array($row['id'], $groupsarray);
677
-						if($modx->hasPermission('access_permissions')) {
678
-							if($checked) {
679
-								$notPublic = true;
680
-							}
681
-							$chks .= '<label><input type="checkbox" name="usrgroups[]" value="' . $row['id'] . '"' . ($checked ? ' checked="checked"' : '') . ' onclick="makePublic(false)" /> ' . $row['name'] . "</label><br />\n";
682
-						} else {
683
-							if($checked) {
684
-								$chks = '<input type="hidden" name="usrgroups[]"  value="' . $row['id'] . '" />' . "\n" . $chks;
685
-							}
686
-						}
687
-					}
688
-					if($modx->hasPermission('access_permissions')) {
689
-						$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;
690
-					}
691
-					echo $chks;
692
-					?>
671
+                    }
672
+                    $chk = '';
673
+                    $rs = $modx->getDatabase()->select('name, id', $tbl_membergroup_names, '', 'name');
674
+                    while($row = $modx->getDatabase()->getRow($rs)) {
675
+                        $groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array();
676
+                        $checked = in_array($row['id'], $groupsarray);
677
+                        if($modx->hasPermission('access_permissions')) {
678
+                            if($checked) {
679
+                                $notPublic = true;
680
+                            }
681
+                            $chks .= '<label><input type="checkbox" name="usrgroups[]" value="' . $row['id'] . '"' . ($checked ? ' checked="checked"' : '') . ' onclick="makePublic(false)" /> ' . $row['name'] . "</label><br />\n";
682
+                        } else {
683
+                            if($checked) {
684
+                                $chks = '<input type="hidden" name="usrgroups[]"  value="' . $row['id'] . '" />' . "\n" . $chks;
685
+                            }
686
+                        }
687
+                    }
688
+                    if($modx->hasPermission('access_permissions')) {
689
+                        $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;
690
+                    }
691
+                    echo $chks;
692
+                    ?>
693 693
 				<?php endif; ?>
694 694
 			</div>
695 695
 		</div>
@@ -705,11 +705,11 @@  discard block
 block discarded – undo
705 705
 
706 706
 		<input type="submit" name="save" style="display:none;">
707 707
 		<?php
708
-		// invoke OnModFormRender event
709
-		$evtOut = $modx->invokeEvent('OnModFormRender', array('id' => $id));
710
-		if(is_array($evtOut)) {
711
-			echo implode('', $evtOut);
712
-		}
713
-		?>
708
+        // invoke OnModFormRender event
709
+        $evtOut = $modx->invokeEvent('OnModFormRender', array('id' => $id));
710
+        if(is_array($evtOut)) {
711
+            echo implode('', $evtOut);
712
+        }
713
+        ?>
714 714
 </form>
715 715
 <script type="text/javascript">setTimeout('showParameters();', 10);</script>
Please login to merge, or discard this patch.
Switch Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -3,18 +3,18 @@
 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
 switch($modx->getManagerApi()->action) {
6
-	case 107:
7
-		if(!$modx->hasPermission('new_module')) {
8
-			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
9
-		}
10
-		break;
11
-	case 108:
12
-		if(!$modx->hasPermission('edit_module')) {
13
-			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
14
-		}
15
-		break;
16
-	default:
17
-		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+	    case 107:
7
+		    if(!$modx->hasPermission('new_module')) {
8
+			    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
9
+		    }
10
+		    break;
11
+	    case 108:
12
+		    if(!$modx->hasPermission('edit_module')) {
13
+			    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
14
+		    }
15
+		    break;
16
+	    default:
17
+		    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
18 18
 }
19 19
 $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
20 20
 // Get table names (alphabetical)
Please login to merge, or discard this patch.
Spacing   +34 added lines, -34 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->getManagerApi()->action) {
5
+switch ($modx->getManagerApi()->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');
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 
32 32
 
33 33
 // check to see the module editor isn't locked
34
-if($lockedEl = $modx->elementIsLocked(6, $id)) {
34
+if ($lockedEl = $modx->elementIsLocked(6, $id)) {
35 35
 	$modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module']));
36 36
 }
37 37
 // end check for lock
@@ -39,29 +39,29 @@  discard block
 block discarded – undo
39 39
 // Lock snippet for other users to edit
40 40
 $modx->lockElement(6, $id);
41 41
 
42
-if(isset($_GET['id'])) {
42
+if (isset($_GET['id'])) {
43 43
 	$rs = $modx->getDatabase()->select('*', $tbl_site_modules, "id='{$id}'");
44 44
 	$content = $modx->getDatabase()->getRow($rs);
45
-	if(!$content) {
45
+	if (!$content) {
46 46
 		$modx->webAlertAndQuit("Module not found for id '{$id}'.");
47 47
 	}
48 48
 	$content['properties'] = str_replace("&", "&amp;", $content['properties']);
49 49
 	$_SESSION['itemname'] = $content['name'];
50
-	if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
50
+	if ($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
51 51
 		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
52 52
 	}
53 53
 } else {
54 54
 	$_SESSION['itemname'] = $_lang["new_module"];
55 55
 	$content['wrap'] = '1';
56 56
 }
57
-if($modx->getManagerApi()->hasFormValues()) {
57
+if ($modx->getManagerApi()->hasFormValues()) {
58 58
 	$modx->getManagerApi()->loadFormValues();
59 59
 }
60 60
 
61 61
 // Add lock-element JS-Script
62 62
 $lockElementId = $id;
63 63
 $lockElementType = 6;
64
-require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php');
64
+require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php');
65 65
 ?>
66 66
 <script type="text/javascript">
67 67
 	function loadDependencies() {
@@ -408,7 +408,7 @@  discard block
 block discarded – undo
408 408
 	function BrowseServer() {
409 409
 		var w = screen.width * 0.7;
410 410
 		var h = screen.height * 0.7;
411
-		OpenServerBrowser("<?= MODX_MANAGER_URL;?>media/browser/<?= $which_browser;?>/browser.php?Type=images", w, h);
411
+		OpenServerBrowser("<?= MODX_MANAGER_URL; ?>media/browser/<?= $which_browser; ?>/browser.php?Type=images", w, h);
412 412
 	}
413 413
 
414 414
 	function SetUrl(url, width, height, alt) {
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
 	<?php
429 429
 	// invoke OnModFormPrerender event
430 430
 	$evtOut = $modx->invokeEvent('OnModFormPrerender', array('id' => $id));
431
-	if(is_array($evtOut)) {
431
+	if (is_array($evtOut)) {
432 432
 		echo implode('', $evtOut);
433 433
 	}
434 434
 
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
 	<input type="hidden" name="mode" value="<?= $modx->getManagerApi()->action ?>">
443 443
 
444 444
 	<h1>
445
-		<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>
445
+		<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>
446 446
 	</h1>
447 447
 
448 448
 	<?= $_style['actionbuttons']['dynamic']['element'] ?>
@@ -467,8 +467,8 @@  discard block
 block discarded – undo
467 467
 						<div class="col-md-9 col-lg-10">
468 468
 							<div class="form-control-name clearfix">
469 469
 								<input name="name" type="text" maxlength="100" value="<?= $modx->getPhpCompat()->htmlspecialchars($content['name']) ?>" class="form-control form-control-lg" onchange="documentDirty=true;" />
470
-								<?php if($modx->hasPermission('save_role')): ?>
471
-									<label class="custom-control" title="<?= $_lang['lock_module'] . "\n" . $_lang['lock_module_msg'] ?>" tooltip>
470
+								<?php if ($modx->hasPermission('save_role')): ?>
471
+									<label class="custom-control" title="<?= $_lang['lock_module']."\n".$_lang['lock_module_msg'] ?>" tooltip>
472 472
 										<input name="locked" type="checkbox"<?= ($content['locked'] == 1 ? ' checked="checked"' : '') ?> />
473 473
 										<i class="fa fa-lock"></i>
474 474
 									</label>
@@ -490,9 +490,9 @@  discard block
 block discarded – undo
490 490
 							<select name="categoryid" class="form-control" onchange="documentDirty=true;">
491 491
 								<option>&nbsp;</option>
492 492
 								<?php
493
-								include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
494
-								foreach(getCategories() as $n => $v) {
495
-									echo "\t\t\t" . '<option value="' . $v['id'] . '"' . ($content['category'] == $v['id'] ? ' selected="selected"' : '') . '>' . $modx->getPhpCompat()->htmlspecialchars($v['category']) . "</option>\n";
493
+								include_once(MODX_MANAGER_PATH.'includes/categories.inc.php');
494
+								foreach (getCategories() as $n => $v) {
495
+									echo "\t\t\t".'<option value="'.$v['id'].'"'.($content['category'] == $v['id'] ? ' selected="selected"' : '').'>'.$modx->getPhpCompat()->htmlspecialchars($v['category'])."</option>\n";
496 496
 								}
497 497
 								?>
498 498
 							</select>
@@ -524,7 +524,7 @@  discard block
 block discarded – undo
524 524
 				<div class="form-group">
525 525
 					<div class="form-row">
526 526
 						<label for="disabled"><input name="disabled" id="disabled" type="checkbox" value="on"<?= ($content['disabled'] == 1 ? ' checked="checked"' : '') ?> />
527
-							<?= ($content['disabled'] == 1 ? '<span class="text-danger">' . $_lang['module_disabled'] . '</span>' : $_lang['module_disabled']) ?></label>
527
+							<?= ($content['disabled'] == 1 ? '<span class="text-danger">'.$_lang['module_disabled'].'</span>' : $_lang['module_disabled']) ?></label>
528 528
 					</div>
529 529
 					<div class="form-row">
530 530
 						<label for="parse_docblock">
@@ -589,7 +589,7 @@  discard block
 block discarded – undo
589 589
 			</div>
590 590
 			<!-- HTML text editor end -->
591 591
 		</div>
592
-		<?php if($modx->getManagerApi()->action == '108'): ?>
592
+		<?php if ($modx->getManagerApi()->action == '108'): ?>
593 593
 			<!-- Dependencies -->
594 594
 			<div class="tab-page" id="tabDepend">
595 595
 				<h2 class="tab"><?= $_lang['settings_dependencies'] ?></h2>
@@ -617,14 +617,14 @@  discard block
 block discarded – undo
617 617
 						LEFT JOIN {$tbl_site_templates} AS st ON st.id = smd.resource AND smd.type = 50
618 618
 						LEFT JOIN {$tbl_site_tmplvars} AS sv ON sv.id = smd.resource AND smd.type = 60", "smd.module='{$id}'", 'smd.type,name');
619 619
 
620
-					include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php";
620
+					include_once MODX_MANAGER_PATH."includes/controls/datagrid.class.php";
621 621
 					$grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items
622 622
 					$grd->noRecordMsg = $_lang['no_records_found'];
623 623
 					$grd->cssClass = 'grid';
624 624
 					$grd->columnHeaderClass = 'gridHeader';
625 625
 					$grd->itemClass = 'gridItem';
626 626
 					$grd->altItemClass = 'gridAltItem';
627
-					$grd->columns = $_lang['element_name'] . " ," . $_lang['type'];
627
+					$grd->columns = $_lang['element_name']." ,".$_lang['type'];
628 628
 					$grd->fields = "name,type";
629 629
 					echo $grd->render();
630 630
 					?>
@@ -637,13 +637,13 @@  discard block
 block discarded – undo
637 637
 			<h2 class="tab"><?= $_lang['access_permissions'] ?></h2>
638 638
 			<script type="text/javascript">tp.addTabPage(document.getElementById("tabPermissions"));</script>
639 639
 			<div class="container container-body">
640
-				<?php if($use_udperms == 1) : ?>
640
+				<?php if ($use_udperms == 1) : ?>
641 641
 					<?php
642 642
 					// fetch user access permissions for the module
643 643
 					$rs = $modx->getDatabase()->select('usergroup', $tbl_site_module_access, "module='{$id}'");
644 644
 					$groupsarray = $modx->getDatabase()->getColumn('usergroup', $rs);
645 645
 
646
-					if($modx->hasPermission('access_permissions')) {
646
+					if ($modx->hasPermission('access_permissions')) {
647 647
 						?>
648 648
 						<!-- User Group Access Permissions -->
649 649
 						<script type="text/javascript">
@@ -671,22 +671,22 @@  discard block
 block discarded – undo
671 671
 					}
672 672
 					$chk = '';
673 673
 					$rs = $modx->getDatabase()->select('name, id', $tbl_membergroup_names, '', 'name');
674
-					while($row = $modx->getDatabase()->getRow($rs)) {
674
+					while ($row = $modx->getDatabase()->getRow($rs)) {
675 675
 						$groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array();
676 676
 						$checked = in_array($row['id'], $groupsarray);
677
-						if($modx->hasPermission('access_permissions')) {
678
-							if($checked) {
677
+						if ($modx->hasPermission('access_permissions')) {
678
+							if ($checked) {
679 679
 								$notPublic = true;
680 680
 							}
681
-							$chks .= '<label><input type="checkbox" name="usrgroups[]" value="' . $row['id'] . '"' . ($checked ? ' checked="checked"' : '') . ' onclick="makePublic(false)" /> ' . $row['name'] . "</label><br />\n";
681
+							$chks .= '<label><input type="checkbox" name="usrgroups[]" value="'.$row['id'].'"'.($checked ? ' checked="checked"' : '').' onclick="makePublic(false)" /> '.$row['name']."</label><br />\n";
682 682
 						} else {
683
-							if($checked) {
684
-								$chks = '<input type="hidden" name="usrgroups[]"  value="' . $row['id'] . '" />' . "\n" . $chks;
683
+							if ($checked) {
684
+								$chks = '<input type="hidden" name="usrgroups[]"  value="'.$row['id'].'" />'."\n".$chks;
685 685
 							}
686 686
 						}
687 687
 					}
688
-					if($modx->hasPermission('access_permissions')) {
689
-						$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;
688
+					if ($modx->hasPermission('access_permissions')) {
689
+						$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;
690 690
 					}
691 691
 					echo $chks;
692 692
 					?>
@@ -707,7 +707,7 @@  discard block
 block discarded – undo
707 707
 		<?php
708 708
 		// invoke OnModFormRender event
709 709
 		$evtOut = $modx->invokeEvent('OnModFormRender', array('id' => $id));
710
-		if(is_array($evtOut)) {
710
+		if (is_array($evtOut)) {
711 711
 			echo implode('', $evtOut);
712 712
 		}
713 713
 		?>
Please login to merge, or discard this patch.
Braces   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -1,15 +1,15 @@  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->getManagerApi()->action) {
5
+switch($modx->getManagerApi()->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;
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 
32 32
 
33 33
 // check to see the module editor isn't locked
34
-if($lockedEl = $modx->elementIsLocked(6, $id)) {
34
+if($lockedEl = $modx->elementIsLocked(6, $id)) {
35 35
 	$modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module']));
36 36
 }
37 37
 // end check for lock
@@ -39,22 +39,22 @@  discard block
 block discarded – undo
39 39
 // Lock snippet for other users to edit
40 40
 $modx->lockElement(6, $id);
41 41
 
42
-if(isset($_GET['id'])) {
42
+if(isset($_GET['id'])) {
43 43
 	$rs = $modx->getDatabase()->select('*', $tbl_site_modules, "id='{$id}'");
44 44
 	$content = $modx->getDatabase()->getRow($rs);
45
-	if(!$content) {
45
+	if(!$content) {
46 46
 		$modx->webAlertAndQuit("Module not found for id '{$id}'.");
47 47
 	}
48 48
 	$content['properties'] = str_replace("&", "&amp;", $content['properties']);
49 49
 	$_SESSION['itemname'] = $content['name'];
50
-	if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
50
+	if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
51 51
 		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
52 52
 	}
53
-} else {
53
+} else {
54 54
 	$_SESSION['itemname'] = $_lang["new_module"];
55 55
 	$content['wrap'] = '1';
56 56
 }
57
-if($modx->getManagerApi()->hasFormValues()) {
57
+if($modx->getManagerApi()->hasFormValues()) {
58 58
 	$modx->getManagerApi()->loadFormValues();
59 59
 }
60 60
 
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
 	<?php
429 429
 	// invoke OnModFormPrerender event
430 430
 	$evtOut = $modx->invokeEvent('OnModFormPrerender', array('id' => $id));
431
-	if(is_array($evtOut)) {
431
+	if(is_array($evtOut)) {
432 432
 		echo implode('', $evtOut);
433 433
 	}
434 434
 
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
 								<option>&nbsp;</option>
492 492
 								<?php
493 493
 								include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
494
-								foreach(getCategories() as $n => $v) {
494
+								foreach(getCategories() as $n => $v) {
495 495
 									echo "\t\t\t" . '<option value="' . $v['id'] . '"' . ($content['category'] == $v['id'] ? ' selected="selected"' : '') . '>' . $modx->getPhpCompat()->htmlspecialchars($v['category']) . "</option>\n";
496 496
 								}
497 497
 								?>
@@ -643,7 +643,7 @@  discard block
 block discarded – undo
643 643
 					$rs = $modx->getDatabase()->select('usergroup', $tbl_site_module_access, "module='{$id}'");
644 644
 					$groupsarray = $modx->getDatabase()->getColumn('usergroup', $rs);
645 645
 
646
-					if($modx->hasPermission('access_permissions')) {
646
+					if($modx->hasPermission('access_permissions')) {
647 647
 						?>
648 648
 						<!-- User Group Access Permissions -->
649 649
 						<script type="text/javascript">
@@ -671,21 +671,21 @@  discard block
 block discarded – undo
671 671
 					}
672 672
 					$chk = '';
673 673
 					$rs = $modx->getDatabase()->select('name, id', $tbl_membergroup_names, '', 'name');
674
-					while($row = $modx->getDatabase()->getRow($rs)) {
674
+					while($row = $modx->getDatabase()->getRow($rs)) {
675 675
 						$groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array();
676 676
 						$checked = in_array($row['id'], $groupsarray);
677
-						if($modx->hasPermission('access_permissions')) {
678
-							if($checked) {
677
+						if($modx->hasPermission('access_permissions')) {
678
+							if($checked) {
679 679
 								$notPublic = true;
680 680
 							}
681 681
 							$chks .= '<label><input type="checkbox" name="usrgroups[]" value="' . $row['id'] . '"' . ($checked ? ' checked="checked"' : '') . ' onclick="makePublic(false)" /> ' . $row['name'] . "</label><br />\n";
682
-						} else {
683
-							if($checked) {
682
+						} else {
683
+							if($checked) {
684 684
 								$chks = '<input type="hidden" name="usrgroups[]"  value="' . $row['id'] . '" />' . "\n" . $chks;
685 685
 							}
686 686
 						}
687 687
 					}
688
-					if($modx->hasPermission('access_permissions')) {
688
+					if($modx->hasPermission('access_permissions')) {
689 689
 						$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;
690 690
 					}
691 691
 					echo $chks;
@@ -707,7 +707,7 @@  discard block
 block discarded – undo
707 707
 		<?php
708 708
 		// invoke OnModFormRender event
709 709
 		$evtOut = $modx->invokeEvent('OnModFormRender', array('id' => $id));
710
-		if(is_array($evtOut)) {
710
+		if(is_array($evtOut)) {
711 711
 			echo implode('', $evtOut);
712 712
 		}
713 713
 		?>
Please login to merge, or discard this patch.