Completed
Push — develop ( b2c942...8bfc17 )
by Serg
05:46
created
manager/actions/role_management.static.php 2 patches
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3
-	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
3
+    die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if(!$modx->hasPermission('edit_user')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 ?>
@@ -18,14 +18,14 @@  discard block
 block discarded – undo
18 18
 		<div class="form-group"><?= $_lang['role_management_msg'] ?> <a class="btn btn-secondary btn-sm" href="index.php?a=38"><i class="<?= $_style["actions_new"] ?> hide4desktop"></i> <?= $_lang['new_role'] ?></a></div>
19 19
 		<div class="form-group">
20 20
 			<?php
21
-			$rs = $modx->db->select('name, id, description', $modx->getFullTableName('user_roles'), '', 'name');
22
-			$limit = $modx->db->getRecordCount($rs);
23
-			if($limit < 1) {
24
-				?>
21
+            $rs = $modx->db->select('name, id, description', $modx->getFullTableName('user_roles'), '', 'name');
22
+            $limit = $modx->db->getRecordCount($rs);
23
+            if($limit < 1) {
24
+                ?>
25 25
 				<p><?= $_lang["no_records_found"] ?></p>
26 26
 				<?php
27
-			} else {
28
-				?>
27
+            } else {
28
+                ?>
29 29
 				<div class="row">
30 30
 					<div class="table-responsive">
31 31
 						<table class="table data">
@@ -37,24 +37,24 @@  discard block
 block discarded – undo
37 37
 							</thead>
38 38
 							<tbody>
39 39
 							<?php
40
-							while($row = $modx->db->getRow($rs)) {
41
-								if($row['id'] == 1) {
42
-									?>
40
+                            while($row = $modx->db->getRow($rs)) {
41
+                                if($row['id'] == 1) {
42
+                                    ?>
43 43
 									<tr class="text-muted disabled">
44 44
 										<td><b><?= $row['name'] ?></b></td>
45 45
 										<td><span><?= $_lang['administrator_role_message'] ?></span></td>
46 46
 									</tr>
47 47
 									<?php
48
-								} else {
49
-									?>
48
+                                } else {
49
+                                    ?>
50 50
 									<tr>
51 51
 										<td><a class="text-primary" href="index.php?id=<?= $row['id'] ?>&a=35"><?= $row['name'] ?></a></td>
52 52
 										<td><?= $row['description'] ?></td>
53 53
 									</tr>
54 54
 									<?php
55
-								}
56
-							}
57
-							?>
55
+                                }
56
+                            }
57
+                            ?>
58 58
 							</tbody>
59 59
 						</table>
60 60
 					</div>
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  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_user')) {
5
+if (!$modx->hasPermission('edit_user')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 			<?php
21 21
 			$rs = $modx->db->select('name, id, description', $modx->getFullTableName('user_roles'), '', 'name');
22 22
 			$limit = $modx->db->getRecordCount($rs);
23
-			if($limit < 1) {
23
+			if ($limit < 1) {
24 24
 				?>
25 25
 				<p><?= $_lang["no_records_found"] ?></p>
26 26
 				<?php
@@ -37,8 +37,8 @@  discard block
 block discarded – undo
37 37
 							</thead>
38 38
 							<tbody>
39 39
 							<?php
40
-							while($row = $modx->db->getRow($rs)) {
41
-								if($row['id'] == 1) {
40
+							while ($row = $modx->db->getRow($rs)) {
41
+								if ($row['id'] == 1) {
42 42
 									?>
43 43
 									<tr class="text-muted disabled">
44 44
 										<td><b><?= $row['name'] ?></b></td>
Please login to merge, or discard this patch.
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->db->getValue("SELECT parent FROM " . $tbl_site_content . " WHERE id=$id LIMIT 1")) : 0;
33
-	$isfolder = $modx->db->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->db->getValue("SELECT parent FROM " . $tbl_site_content . " WHERE id=$id LIMIT 1")) : 0;
33
+    $isfolder = $modx->db->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->db->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
 /**
@@ -85,134 +85,134 @@  discard block
 block discarded – undo
85 85
 $filter_sort = '';
86 86
 $filter_dir = '';
87 87
 if($numRecords > 0) {
88
-	$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 - //
89
-		'<option value="published"' . (($sort == 'published') ? ' selected' : '') . '>' . $_lang['resource_opt_is_published'] . '</option>' . //********//
90
-		'</select>';
91
-	$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>';
92
-	$resource = $modx->db->makeArray($rs);
93
-
94
-	// CSS style for table
95
-	//	$tableClass = 'grid';
96
-	//	$rowHeaderClass = 'gridHeader';
97
-	//	$rowRegularClass = 'gridItem';
98
-	//	$rowAlternateClass = 'gridAltItem';
99
-	$tableClass = 'table data nowrap';
100
-	$columnHeaderClass = array(
101
-		'text-center',
102
-		'text-left',
103
-		'text-center',
104
-		'text-center',
105
-		'text-center',
106
-		'text-center'
107
-	);
108
-
109
-
110
-	$modx->table->setTableClass($tableClass);
111
-	$modx->table->setColumnHeaderClass($columnHeaderClass);
112
-	//	$modx->table->setRowHeaderClass($rowHeaderClass);
113
-	//	$modx->table->setRowRegularClass($rowRegularClass);
114
-	//	$modx->table->setRowAlternateClass($rowAlternateClass);
115
-
116
-	// Table header
117
-	$listTableHeader = array(
118
-		'docid' => $_lang['id'],
119
-		'title' => $_lang['resource_title'],
120
-		'createdon' => $_lang['createdon'],
121
-		'pub_date' => $_lang['page_data_publishdate'],
122
-		'status' => $_lang['page_data_status'],
123
-		'edit' => $_lang['mgrlog_action'],
124
-	);
125
-	$tbWidth = array(
126
-		'1%',
127
-		'',
128
-		'1%',
129
-		'1%',
130
-		'1%',
131
-		'1%'
132
-	);
133
-	$modx->table->setColumnWidths($tbWidth);
134
-
135
-	$sd = isset($_REQUEST['dir']) ? '&amp;dir=' . $_REQUEST['dir'] : '&amp;dir=DESC';
136
-	$sb = isset($_REQUEST['sort']) ? '&amp;sort=' . $_REQUEST['sort'] : '&amp;sort=createdon';
137
-	$pg = isset($_REQUEST['page']) ? '&amp;page=' . (int) $_REQUEST['page'] : '';
138
-	$add_path = $sd . $sb . $pg;
139
-
140
-	$icons = array(
141
-		'text/html' => $_style['tree_page_html'],
142
-		'text/plain' => $_style['tree_page'],
143
-		'text/xml' => $_style['tree_page_xml'],
144
-		'text/css' => $_style['tree_page_css'],
145
-		'text/javascript' => $_style['tree_page_js'],
146
-		'application/rss+xml' => $_style['tree_page_rss'],
147
-		'application/pdf' => $_style['tree_page_pdf'],
148
-		'application/vnd.ms-word' => $_style['tree_page_word'],
149
-		'application/vnd.ms-excel' => $_style['tree_page_excel'],
150
-		'image/gif' => $_style['tree_page_gif'],
151
-		'image/jpg' => $_style['tree_page_jpg'],
152
-		'image/png' => $_style['tree_page_png']
153
-	);
154
-
155
-	$listDocs = array();
156
-	foreach($resource as $k => $children) {
157
-
158
-		switch($children['id']) {
159
-			case $modx->config['site_start']            :
160
-				$icon = $_style['tree_page_home'];
161
-				break;
162
-			case $modx->config['error_page']            :
163
-				$icon = $_style['tree_page_404'];
164
-				break;
165
-			case $modx->config['site_unavailable_page'] :
166
-				$icon = $_style['tree_page_hourglass'];
167
-				break;
168
-			case $modx->config['unauthorized_page']     :
169
-				$icon = $_style['tree_page_info'];
170
-				break;
171
-			default:
172
-				if($children['isfolder']) {
173
-					$icon = $_style['tree_folder_new'];
174
-				} else {
175
-					if(isset($icons[$children['contentType']])) {
176
-						$icon = $icons[$children['contentType']];
177
-					} else {
178
-						$icon = $_style['tree_page'];
179
-					}
180
-				}
181
-		}
182
-
183
-		$private = ($children['privateweb'] || $children['privatemgr'] ? ' private' : '');
184
-
185
-		// дописываем в заголовок класс для неопубликованных плюс по всем ссылкам обратный путь
186
-		// для сохранения сортировки
187
-		$class = ($children['deleted'] ? 'text-danger text-decoration-through' : (!$children['published'] ? ' font-italic text-muted' : ' publish'));
188
-		//$class .= ($children['hidemenu'] ? ' text-muted' : ' text-primary');
189
-		//$class .= ($children['isfolder'] ? ' font-weight-bold' : '');
190
-		if($modx->hasPermission('edit_document')) {
191
-			$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>';
192
-		} else {
193
-			$title = '<span class="doc-item' . $private . '">' . $icon . '<span class="' . $class . '">' . $children['pagetitle'] . '</span></span>';
194
-		}
195
-
196
-		$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>';
197
-
198
-		$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>';
199
-
200
-		$listDocs[] = array(
201
-			'docid' => '<div class="text-right">' . $children['id'] . '</div>',
202
-			'title' => $title,
203
-			'createdon' => '<div class="text-right">' . ($modx->toDateFormat($children['createdon'] + $server_offset_time, 'dateOnly')) . '</div>',
204
-			'pub_date' => '<div class="text-right">' . ($children['pub_date'] ? ($modx->toDateFormat($children['pub_date'] + $server_offset_time, 'dateOnly')) : '') . '</div>',
205
-			'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>',
206
-			'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 
88
+    $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 - //
89
+        '<option value="published"' . (($sort == 'published') ? ' selected' : '') . '>' . $_lang['resource_opt_is_published'] . '</option>' . //********//
90
+        '</select>';
91
+    $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>';
92
+    $resource = $modx->db->makeArray($rs);
93
+
94
+    // CSS style for table
95
+    //	$tableClass = 'grid';
96
+    //	$rowHeaderClass = 'gridHeader';
97
+    //	$rowRegularClass = 'gridItem';
98
+    //	$rowAlternateClass = 'gridAltItem';
99
+    $tableClass = 'table data nowrap';
100
+    $columnHeaderClass = array(
101
+        'text-center',
102
+        'text-left',
103
+        'text-center',
104
+        'text-center',
105
+        'text-center',
106
+        'text-center'
107
+    );
108
+
109
+
110
+    $modx->table->setTableClass($tableClass);
111
+    $modx->table->setColumnHeaderClass($columnHeaderClass);
112
+    //	$modx->table->setRowHeaderClass($rowHeaderClass);
113
+    //	$modx->table->setRowRegularClass($rowRegularClass);
114
+    //	$modx->table->setRowAlternateClass($rowAlternateClass);
115
+
116
+    // Table header
117
+    $listTableHeader = array(
118
+        'docid' => $_lang['id'],
119
+        'title' => $_lang['resource_title'],
120
+        'createdon' => $_lang['createdon'],
121
+        'pub_date' => $_lang['page_data_publishdate'],
122
+        'status' => $_lang['page_data_status'],
123
+        'edit' => $_lang['mgrlog_action'],
124
+    );
125
+    $tbWidth = array(
126
+        '1%',
127
+        '',
128
+        '1%',
129
+        '1%',
130
+        '1%',
131
+        '1%'
132
+    );
133
+    $modx->table->setColumnWidths($tbWidth);
134
+
135
+    $sd = isset($_REQUEST['dir']) ? '&amp;dir=' . $_REQUEST['dir'] : '&amp;dir=DESC';
136
+    $sb = isset($_REQUEST['sort']) ? '&amp;sort=' . $_REQUEST['sort'] : '&amp;sort=createdon';
137
+    $pg = isset($_REQUEST['page']) ? '&amp;page=' . (int) $_REQUEST['page'] : '';
138
+    $add_path = $sd . $sb . $pg;
139
+
140
+    $icons = array(
141
+        'text/html' => $_style['tree_page_html'],
142
+        'text/plain' => $_style['tree_page'],
143
+        'text/xml' => $_style['tree_page_xml'],
144
+        'text/css' => $_style['tree_page_css'],
145
+        'text/javascript' => $_style['tree_page_js'],
146
+        'application/rss+xml' => $_style['tree_page_rss'],
147
+        'application/pdf' => $_style['tree_page_pdf'],
148
+        'application/vnd.ms-word' => $_style['tree_page_word'],
149
+        'application/vnd.ms-excel' => $_style['tree_page_excel'],
150
+        'image/gif' => $_style['tree_page_gif'],
151
+        'image/jpg' => $_style['tree_page_jpg'],
152
+        'image/png' => $_style['tree_page_png']
153
+    );
154
+
155
+    $listDocs = array();
156
+    foreach($resource as $k => $children) {
157
+
158
+        switch($children['id']) {
159
+            case $modx->config['site_start']            :
160
+                $icon = $_style['tree_page_home'];
161
+                break;
162
+            case $modx->config['error_page']            :
163
+                $icon = $_style['tree_page_404'];
164
+                break;
165
+            case $modx->config['site_unavailable_page'] :
166
+                $icon = $_style['tree_page_hourglass'];
167
+                break;
168
+            case $modx->config['unauthorized_page']     :
169
+                $icon = $_style['tree_page_info'];
170
+                break;
171
+            default:
172
+                if($children['isfolder']) {
173
+                    $icon = $_style['tree_folder_new'];
174
+                } else {
175
+                    if(isset($icons[$children['contentType']])) {
176
+                        $icon = $icons[$children['contentType']];
177
+                    } else {
178
+                        $icon = $_style['tree_page'];
179
+                    }
180
+                }
181
+        }
182
+
183
+        $private = ($children['privateweb'] || $children['privatemgr'] ? ' private' : '');
184
+
185
+        // дописываем в заголовок класс для неопубликованных плюс по всем ссылкам обратный путь
186
+        // для сохранения сортировки
187
+        $class = ($children['deleted'] ? 'text-danger text-decoration-through' : (!$children['published'] ? ' font-italic text-muted' : ' publish'));
188
+        //$class .= ($children['hidemenu'] ? ' text-muted' : ' text-primary');
189
+        //$class .= ($children['isfolder'] ? ' font-weight-bold' : '');
190
+        if($modx->hasPermission('edit_document')) {
191
+            $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>';
192
+        } else {
193
+            $title = '<span class="doc-item' . $private . '">' . $icon . '<span class="' . $class . '">' . $children['pagetitle'] . '</span></span>';
194
+        }
195
+
196
+        $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>';
197
+
198
+        $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>';
199
+
200
+        $listDocs[] = array(
201
+            'docid' => '<div class="text-right">' . $children['id'] . '</div>',
202
+            'title' => $title,
203
+            'createdon' => '<div class="text-right">' . ($modx->toDateFormat($children['createdon'] + $server_offset_time, 'dateOnly')) . '</div>',
204
+            'pub_date' => '<div class="text-right">' . ($children['pub_date'] ? ($modx->toDateFormat($children['pub_date'] + $server_offset_time, 'dateOnly')) : '') . '</div>',
205
+            '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>',
206
+            '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 
207 207
 				class="' . $_style["icons_move_document"] . '"></i></a>' . $icon_pub_unpub : '') . ($modx->hasPermission('delete_document') ? $icon_del_undel : '') . '</div>'
208
-		);
209
-	}
208
+        );
209
+    }
210 210
 
211
-	$modx->table->createPagingNavigation($numRecords, 'a=3&id=' . $content['id'] . '&dir=' . $dir . '&sort=' . $sort);
212
-	$children_output = $modx->table->create($listDocs, $listTableHeader, 'index.php?a=3&amp;id=' . $content['id']);
211
+    $modx->table->createPagingNavigation($numRecords, 'a=3&id=' . $content['id'] . '&dir=' . $dir . '&sort=' . $sort);
212
+    $children_output = $modx->table->create($listDocs, $listTableHeader, 'index.php?a=3&amp;id=' . $content['id']);
213 213
 } else {
214
-	// No Child documents
215
-	$children_output = '<div class="container"><p>' . $_lang['resources_in_container_no'] . '</p></div>';
214
+    // No Child documents
215
+    $children_output = '<div class="container"><p>' . $_lang['resources_in_container_no'] . '</p></div>';
216 216
 }
217 217
 ?>
218 218
 	<script type="text/javascript">
@@ -413,20 +413,20 @@  discard block
 block discarded – undo
413 413
 				<h2 class="tab"><?= $_lang['page_data_source'] ?></h2>
414 414
 				<script type="text/javascript">docSettings.addTabPage(document.getElementById("tabSource"));</script>
415 415
 				<?php
416
-				$buffer = "";
417
-				$filename = $modx->config['base_path'] . "assets/cache/docid_" . $id . ".pageCache.php";
418
-				$handle = @fopen($filename, "r");
419
-				if(!$handle) {
420
-					$buffer = '<div class="container container-body">' . $_lang['page_data_notcached'] . '</div>';
421
-				} else {
422
-					while(!feof($handle)) {
423
-						$buffer .= fgets($handle, 4096);
424
-					}
425
-					fclose($handle);
426
-					$buffer = '<div class="navbar navbar-editor">' . $_lang['page_data_cached'] . '</div><div class="section-editor clearfix"><textarea rows="20" wrap="soft">' . $modx->htmlspecialchars($buffer) . "</textarea></div>\n";
427
-				}
428
-				echo $buffer;
429
-				?>
416
+                $buffer = "";
417
+                $filename = $modx->config['base_path'] . "assets/cache/docid_" . $id . ".pageCache.php";
418
+                $handle = @fopen($filename, "r");
419
+                if(!$handle) {
420
+                    $buffer = '<div class="container container-body">' . $_lang['page_data_notcached'] . '</div>';
421
+                } else {
422
+                    while(!feof($handle)) {
423
+                        $buffer .= fgets($handle, 4096);
424
+                    }
425
+                    fclose($handle);
426
+                    $buffer = '<div class="navbar navbar-editor">' . $_lang['page_data_cached'] . '</div><div class="section-editor clearfix"><textarea rows="20" wrap="soft">' . $modx->htmlspecialchars($buffer) . "</textarea></div>\n";
427
+                }
428
+                echo $buffer;
429
+                ?>
430 430
 			</div><!-- end tab-page -->
431 431
 		<?php } ?>
432 432
 
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
 
435 435
 <?php
436 436
 if(isset($_GET['tab']) && is_numeric($_GET['tab'])) {
437
-	echo '<script type="text/javascript"> docSettings.setSelectedIndex( ' . $_GET['tab'] . ' );</script>';
437
+    echo '<script type="text/javascript"> docSettings.setSelectedIndex( ' . $_GET['tab'] . ' );</script>';
438 438
 }
439 439
 ?>
440 440
 
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->db->getValue("SELECT parent FROM " . $tbl_site_content . " WHERE id=$id LIMIT 1")) : 0;
33
-	$isfolder = $modx->db->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->db->getValue("SELECT parent FROM ".$tbl_site_content." WHERE id=$id LIMIT 1")) : 0;
33
+	$isfolder = $modx->db->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->db->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->db->getRow($rs);
43
-if(!$content) {
43
+if (!$content) {
44 44
 	$modx->webAlertAndQuit($_lang["access_permission_denied"]);
45 45
 }
46 46
 
@@ -84,11 +84,11 @@  discard block
 block discarded – undo
84 84
 );
85 85
 $filter_sort = '';
86 86
 $filter_dir = '';
87
-if($numRecords > 0) {
88
-	$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 - //
89
-		'<option value="published"' . (($sort == 'published') ? ' selected' : '') . '>' . $_lang['resource_opt_is_published'] . '</option>' . //********//
87
+if ($numRecords > 0) {
88
+	$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 - //
89
+		'<option value="published"'.(($sort == 'published') ? ' selected' : '').'>'.$_lang['resource_opt_is_published'].'</option>'.//********//
90 90
 		'</select>';
91
-	$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>';
91
+	$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>';
92 92
 	$resource = $modx->db->makeArray($rs);
93 93
 
94 94
 	// CSS style for table
@@ -132,10 +132,10 @@  discard block
 block discarded – undo
132 132
 	);
133 133
 	$modx->table->setColumnWidths($tbWidth);
134 134
 
135
-	$sd = isset($_REQUEST['dir']) ? '&amp;dir=' . $_REQUEST['dir'] : '&amp;dir=DESC';
136
-	$sb = isset($_REQUEST['sort']) ? '&amp;sort=' . $_REQUEST['sort'] : '&amp;sort=createdon';
137
-	$pg = isset($_REQUEST['page']) ? '&amp;page=' . (int) $_REQUEST['page'] : '';
138
-	$add_path = $sd . $sb . $pg;
135
+	$sd = isset($_REQUEST['dir']) ? '&amp;dir='.$_REQUEST['dir'] : '&amp;dir=DESC';
136
+	$sb = isset($_REQUEST['sort']) ? '&amp;sort='.$_REQUEST['sort'] : '&amp;sort=createdon';
137
+	$pg = isset($_REQUEST['page']) ? '&amp;page='.(int) $_REQUEST['page'] : '';
138
+	$add_path = $sd.$sb.$pg;
139 139
 
140 140
 	$icons = array(
141 141
 		'text/html' => $_style['tree_page_html'],
@@ -153,9 +153,9 @@  discard block
 block discarded – undo
153 153
 	);
154 154
 
155 155
 	$listDocs = array();
156
-	foreach($resource as $k => $children) {
156
+	foreach ($resource as $k => $children) {
157 157
 
158
-		switch($children['id']) {
158
+		switch ($children['id']) {
159 159
 			case $modx->config['site_start']            :
160 160
 				$icon = $_style['tree_page_home'];
161 161
 				break;
@@ -169,10 +169,10 @@  discard block
 block discarded – undo
169 169
 				$icon = $_style['tree_page_info'];
170 170
 				break;
171 171
 			default:
172
-				if($children['isfolder']) {
172
+				if ($children['isfolder']) {
173 173
 					$icon = $_style['tree_folder_new'];
174 174
 				} else {
175
-					if(isset($icons[$children['contentType']])) {
175
+					if (isset($icons[$children['contentType']])) {
176 176
 						$icon = $icons[$children['contentType']];
177 177
 					} else {
178 178
 						$icon = $_style['tree_page'];
@@ -187,32 +187,32 @@  discard block
 block discarded – undo
187 187
 		$class = ($children['deleted'] ? 'text-danger text-decoration-through' : (!$children['published'] ? ' font-italic text-muted' : ' publish'));
188 188
 		//$class .= ($children['hidemenu'] ? ' text-muted' : ' text-primary');
189 189
 		//$class .= ($children['isfolder'] ? ' font-weight-bold' : '');
190
-		if($modx->hasPermission('edit_document')) {
191
-			$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
+		if ($modx->hasPermission('edit_document')) {
191
+			$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>';
192 192
 		} else {
193
-			$title = '<span class="doc-item' . $private . '">' . $icon . '<span class="' . $class . '">' . $children['pagetitle'] . '</span></span>';
193
+			$title = '<span class="doc-item'.$private.'">'.$icon.'<span class="'.$class.'">'.$children['pagetitle'].'</span></span>';
194 194
 		}
195 195
 
196
-		$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>';
196
+		$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>';
197 197
 
198
-		$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>';
198
+		$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>';
199 199
 
200 200
 		$listDocs[] = array(
201
-			'docid' => '<div class="text-right">' . $children['id'] . '</div>',
201
+			'docid' => '<div class="text-right">'.$children['id'].'</div>',
202 202
 			'title' => $title,
203
-			'createdon' => '<div class="text-right">' . ($modx->toDateFormat($children['createdon'] + $server_offset_time, 'dateOnly')) . '</div>',
204
-			'pub_date' => '<div class="text-right">' . ($children['pub_date'] ? ($modx->toDateFormat($children['pub_date'] + $server_offset_time, 'dateOnly')) : '') . '</div>',
205
-			'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>',
206
-			'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 
207
-				class="' . $_style["icons_move_document"] . '"></i></a>' . $icon_pub_unpub : '') . ($modx->hasPermission('delete_document') ? $icon_del_undel : '') . '</div>'
203
+			'createdon' => '<div class="text-right">'.($modx->toDateFormat($children['createdon'] + $server_offset_time, 'dateOnly')).'</div>',
204
+			'pub_date' => '<div class="text-right">'.($children['pub_date'] ? ($modx->toDateFormat($children['pub_date'] + $server_offset_time, 'dateOnly')) : '').'</div>',
205
+			'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>',
206
+			'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 
207
+				class="' . $_style["icons_move_document"].'"></i></a>'.$icon_pub_unpub : '').($modx->hasPermission('delete_document') ? $icon_del_undel : '').'</div>'
208 208
 		);
209 209
 	}
210 210
 
211
-	$modx->table->createPagingNavigation($numRecords, 'a=3&id=' . $content['id'] . '&dir=' . $dir . '&sort=' . $sort);
212
-	$children_output = $modx->table->create($listDocs, $listTableHeader, 'index.php?a=3&amp;id=' . $content['id']);
211
+	$modx->table->createPagingNavigation($numRecords, 'a=3&id='.$content['id'].'&dir='.$dir.'&sort='.$sort);
212
+	$children_output = $modx->table->create($listDocs, $listTableHeader, 'index.php?a=3&amp;id='.$content['id']);
213 213
 } else {
214 214
 	// No Child documents
215
-	$children_output = '<div class="container"><p>' . $_lang['resources_in_container_no'] . '</p></div>';
215
+	$children_output = '<div class="container"><p>'.$_lang['resources_in_container_no'].'</p></div>';
216 216
 }
217 217
 ?>
218 218
 	<script type="text/javascript">
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
 			},
239 239
 			cancel: function() {
240 240
 				documentDirty = false;
241
-				document.location.href = 'index.php?<?=($id == 0 ? 'a=2' : 'a=3&r=1&id=' . $id . $add_path) ?>';
241
+				document.location.href = 'index.php?<?=($id == 0 ? 'a=2' : 'a=3&r=1&id='.$id.$add_path) ?>';
242 242
 			},
243 243
 			move: function() {
244 244
 				document.location.href = "index.php?id=<?= $_REQUEST['id'] ?>&a=51";
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 				}
250 250
 			},
251 251
 			view: function() {
252
-				window.open('<?= ($modx->config['friendly_urls'] == '1') ? $modx->makeUrl($id) : $modx->config['site_url'] . 'index.php?id=' . $id ?>', 'previeWin');
252
+				window.open('<?= ($modx->config['friendly_urls'] == '1') ? $modx->makeUrl($id) : $modx->config['site_url'].'index.php?id='.$id ?>', 'previeWin');
253 253
 			}
254 254
 		};
255 255
 
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 	<script type="text/javascript" src="media/script/tablesort.js"></script>
258 258
 
259 259
 	<h1>
260
-		<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>' ?>
260
+		<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>' ?>
261 261
 	</h1>
262 262
 
263 263
 <?= $_style['actionbuttons']['static']['document'] ?>
@@ -284,16 +284,16 @@  discard block
 block discarded – undo
284 284
 					<tr>
285 285
 						<td width="200" valign="top"><?= $_lang['long_title'] ?>:</td>
286 286
 						<td>
287
-							<small><?= $content['longtitle'] != '' ? $content['longtitle'] : "(<i>" . $_lang['not_set'] . "</i>)" ?></small>
287
+							<small><?= $content['longtitle'] != '' ? $content['longtitle'] : "(<i>".$_lang['not_set']."</i>)" ?></small>
288 288
 						</td>
289 289
 					</tr>
290 290
 					<tr>
291 291
 						<td valign="top"><?= $_lang['resource_description'] ?>:</td>
292
-						<td><?= $content['description'] != '' ? $content['description'] : "(<i>" . $_lang['not_set'] . "</i>)" ?></td>
292
+						<td><?= $content['description'] != '' ? $content['description'] : "(<i>".$_lang['not_set']."</i>)" ?></td>
293 293
 					</tr>
294 294
 					<tr>
295 295
 						<td valign="top"><?= $_lang['resource_summary'] ?>:</td>
296
-						<td><?= $content['introtext'] != '' ? $content['introtext'] : "(<i>" . $_lang['not_set'] . "</i>)" ?></td>
296
+						<td><?= $content['introtext'] != '' ? $content['introtext'] : "(<i>".$_lang['not_set']."</i>)" ?></td>
297 297
 					</tr>
298 298
 					<tr>
299 299
 						<td valign="top"><?= $_lang['type'] ?>:</td>
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 					</tr>
302 302
 					<tr>
303 303
 						<td valign="top"><?= $_lang['resource_alias'] ?>:</td>
304
-						<td><?= $content['alias'] != '' ? $content['alias'] : "(<i>" . $_lang['not_set'] . "</i>)" ?></td>
304
+						<td><?= $content['alias'] != '' ? $content['alias'] : "(<i>".$_lang['not_set']."</i>)" ?></td>
305 305
 					</tr>
306 306
 					<tr>
307 307
 						<td colspan="2">&nbsp;</td>
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
 						<td><?= $modx->toDateFormat($content['createdon'] + $server_offset_time) ?> (<b><?= $createdbyname ?></b>)
315 315
 						</td>
316 316
 					</tr>
317
-					<?php if($editedbyname != '') { ?>
317
+					<?php if ($editedbyname != '') { ?>
318 318
 						<tr>
319 319
 							<td><?= $_lang['page_data_edited'] ?>:</td>
320 320
 							<td><?= $modx->toDateFormat($content['editedon'] + $server_offset_time) ?> (<b><?= $editedbyname ?></b>)
@@ -329,15 +329,15 @@  discard block
 block discarded – undo
329 329
 					</tr>
330 330
 					<tr>
331 331
 						<td><?= $_lang['page_data_status'] ?>:</td>
332
-						<td><?= $content['published'] == 0 ? '<span class="unpublishedDoc">' . $_lang['page_data_unpublished'] . '</span>' : '<span class="publisheddoc">' . $_lang['page_data_published'] . '</span>' ?></td>
332
+						<td><?= $content['published'] == 0 ? '<span class="unpublishedDoc">'.$_lang['page_data_unpublished'].'</span>' : '<span class="publisheddoc">'.$_lang['page_data_published'].'</span>' ?></td>
333 333
 					</tr>
334 334
 					<tr>
335 335
 						<td><?= $_lang['page_data_publishdate'] ?>:</td>
336
-						<td><?= $content['pub_date'] == 0 ? "(<i>" . $_lang['not_set'] . "</i>)" : $modx->toDateFormat($content['pub_date']) ?></td>
336
+						<td><?= $content['pub_date'] == 0 ? "(<i>".$_lang['not_set']."</i>)" : $modx->toDateFormat($content['pub_date']) ?></td>
337 337
 					</tr>
338 338
 					<tr>
339 339
 						<td><?= $_lang['page_data_unpublishdate'] ?>:</td>
340
-						<td><?= $content['unpub_date'] == 0 ? "(<i>" . $_lang['not_set'] . "</i>)" : $modx->toDateFormat($content['unpub_date']) ?></td>
340
+						<td><?= $content['unpub_date'] == 0 ? "(<i>".$_lang['not_set']."</i>)" : $modx->toDateFormat($content['unpub_date']) ?></td>
341 341
 					</tr>
342 342
 					<tr>
343 343
 						<td><?= $_lang['page_data_cacheable'] ?>:</td>
@@ -357,11 +357,11 @@  discard block
 block discarded – undo
357 357
 					</tr>
358 358
 					<tr>
359 359
 						<td><?= $_lang['page_data_web_access'] ?>:</td>
360
-						<td><?= $content['privateweb'] == 0 ? $_lang['public'] : '<b style="color: #821517">' . $_lang['private'] . '</b> ' . $_style["icons_secured"] ?></td>
360
+						<td><?= $content['privateweb'] == 0 ? $_lang['public'] : '<b style="color: #821517">'.$_lang['private'].'</b> '.$_style["icons_secured"] ?></td>
361 361
 					</tr>
362 362
 					<tr>
363 363
 						<td><?= $_lang['page_data_mgr_access'] ?>:</td>
364
-						<td><?= $content['privatemgr'] == 0 ? $_lang['public'] : '<b style="color: #821517">' . $_lang['private'] . '</b> ' . $_style["icons_secured"] ?></td>
364
+						<td><?= $content['privatemgr'] == 0 ? $_lang['public'] : '<b style="color: #821517">'.$_lang['private'].'</b> '.$_style["icons_secured"] ?></td>
365 365
 					</tr>
366 366
 					<tr>
367 367
 						<td colspan="2">&nbsp;</td>
@@ -391,13 +391,13 @@  discard block
 block discarded – undo
391 391
 			<script type="text/javascript">docSettings.addTabPage(document.getElementById("tabChildren"));</script>
392 392
 			<div class="container container-body">
393 393
 				<div class="form-group clearfix">
394
-					<?php if($numRecords > 0) : ?>
394
+					<?php if ($numRecords > 0) : ?>
395 395
 						<div class="float-xs-left">
396
-							<span class="publishedDoc"><?= $numRecords . ' ' . $_lang['resources_in_container'] ?> (<strong><?= $content['pagetitle'] ?></strong>)</span>
396
+							<span class="publishedDoc"><?= $numRecords.' '.$_lang['resources_in_container'] ?> (<strong><?= $content['pagetitle'] ?></strong>)</span>
397 397
 						</div>
398 398
 					<?php endif; ?>
399 399
 					<div class="float-xs-right">
400
-						<?= $filter_sort . ' ' . $filter_dir ?>
400
+						<?= $filter_sort.' '.$filter_dir ?>
401 401
 					</div>
402 402
 
403 403
 				</div>
@@ -407,23 +407,23 @@  discard block
 block discarded – undo
407 407
 			</div>
408 408
 		</div><!-- end tab-page -->
409 409
 
410
-		<?php if($modx->config['cache_type'] != 2) { ?>
410
+		<?php if ($modx->config['cache_type'] != 2) { ?>
411 411
 			<!-- Page Source -->
412 412
 			<div class="tab-page" id="tabSource">
413 413
 				<h2 class="tab"><?= $_lang['page_data_source'] ?></h2>
414 414
 				<script type="text/javascript">docSettings.addTabPage(document.getElementById("tabSource"));</script>
415 415
 				<?php
416 416
 				$buffer = "";
417
-				$filename = $modx->config['base_path'] . "assets/cache/docid_" . $id . ".pageCache.php";
417
+				$filename = $modx->config['base_path']."assets/cache/docid_".$id.".pageCache.php";
418 418
 				$handle = @fopen($filename, "r");
419
-				if(!$handle) {
420
-					$buffer = '<div class="container container-body">' . $_lang['page_data_notcached'] . '</div>';
419
+				if (!$handle) {
420
+					$buffer = '<div class="container container-body">'.$_lang['page_data_notcached'].'</div>';
421 421
 				} else {
422
-					while(!feof($handle)) {
422
+					while (!feof($handle)) {
423 423
 						$buffer .= fgets($handle, 4096);
424 424
 					}
425 425
 					fclose($handle);
426
-					$buffer = '<div class="navbar navbar-editor">' . $_lang['page_data_cached'] . '</div><div class="section-editor clearfix"><textarea rows="20" wrap="soft">' . $modx->htmlspecialchars($buffer) . "</textarea></div>\n";
426
+					$buffer = '<div class="navbar navbar-editor">'.$_lang['page_data_cached'].'</div><div class="section-editor clearfix"><textarea rows="20" wrap="soft">'.$modx->htmlspecialchars($buffer)."</textarea></div>\n";
427 427
 				}
428 428
 				echo $buffer;
429 429
 				?>
@@ -433,12 +433,12 @@  discard block
 block discarded – undo
433 433
 	</div><!-- end documentPane -->
434 434
 
435 435
 <?php
436
-if(isset($_GET['tab']) && is_numeric($_GET['tab'])) {
437
-	echo '<script type="text/javascript"> docSettings.setSelectedIndex( ' . $_GET['tab'] . ' );</script>';
436
+if (isset($_GET['tab']) && is_numeric($_GET['tab'])) {
437
+	echo '<script type="text/javascript"> docSettings.setSelectedIndex( '.$_GET['tab'].' );</script>';
438 438
 }
439 439
 ?>
440 440
 
441
-<?php if($show_preview == 1) { ?>
441
+<?php if ($show_preview == 1) { ?>
442 442
 	<div class="sectionHeader"><?= $_lang['preview'] ?></div>
443 443
 	<div class="sectionBody" id="lyr2">
444 444
 		<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/mutate_password.dynamic.php 3 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 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('change_password')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 ?>
9 9
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 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('change_password')) {
5
+if (!$modx->hasPermission('change_password')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 ?>
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 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('change_password')) {
5
+if(!$modx->hasPermission('change_password')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 ?>
Please login to merge, or discard this patch.
manager/actions/mutate_settings.dynamic.php 3 patches
Braces   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  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 />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5
-if(!$modx->hasPermission('settings')) {
5
+if(!$modx->hasPermission('settings')) {
6 6
 	$modx->webAlertAndQuit($_lang['error_no_privileges']);
7 7
 }
8 8
 
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 
11 11
 // check to see the edit settings page isn't locked
12 12
 $rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=17 AND internalKey!='" . $modx->getLoginUserID() . "'");
13
-if($username = $modx->db->getValue($rs)) {
13
+if($username = $modx->db->getValue($rs)) {
14 14
 	$modx->webAlertAndQuit(sprintf($_lang['lock_settings_msg'], $username));
15 15
 }
16 16
 // end check for lock
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 $settings = array();
21 21
 include_once(MODX_MANAGER_PATH . 'includes/default_config.php');
22 22
 $rs = $modx->db->select('setting_name, setting_value', '[+prefix+]system_settings');
23
-while($row = $modx->db->getRow($rs)) {
23
+while($row = $modx->db->getRow($rs)) {
24 24
 	$settings[$row['setting_name']] = $row['setting_value'];
25 25
 }
26 26
 $settings['filemanager_path'] = preg_replace('@^' . preg_quote(MODX_BASE_PATH) . '@', '[(base_path)]', $settings['filemanager_path']);
@@ -31,8 +31,8 @@  discard block
 block discarded – undo
31 31
 // load languages and keys
32 32
 $lang_keys = array();
33 33
 $dir = dir('includes/lang');
34
-while($file = $dir->read()) {
35
-	if(strpos($file, '.inc.php') > 0) {
34
+while($file = $dir->read()) {
35
+	if(strpos($file, '.inc.php') > 0) {
36 36
 		$endpos = strpos($file, '.');
37 37
 		$languagename = substr($file, 0, $endpos);
38 38
 		$lang_keys[$languagename] = get_lang_keys($file);
@@ -131,6 +131,6 @@  discard block
 block discarded – undo
131 131
 		});
132 132
 	</script>
133 133
 <?php
134
-if(is_numeric($_GET['tab'])) {
134
+if(is_numeric($_GET['tab'])) {
135 135
 	echo '<script type="text/javascript">tpSettings.setSelectedIndex( ' . $_GET['tab'] . ' );</script>';
136 136
 }
Please login to merge, or discard this patch.
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -1,15 +1,15 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3
-	die("<b>INCLUDE_ORDERING_ERROR</b><br />Please use the EVO Content Manager instead of accessing this file directly.");
3
+    die("<b>INCLUDE_ORDERING_ERROR</b><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if(!$modx->hasPermission('settings')) {
6
-	$modx->webAlertAndQuit($_lang['error_no_privileges']);
6
+    $modx->webAlertAndQuit($_lang['error_no_privileges']);
7 7
 }
8 8
 
9 9
 // check to see the edit settings page isn't locked
10 10
 $rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=17 AND internalKey!='" . $modx->getLoginUserID() . "'");
11 11
 if($username = $modx->db->getValue($rs)) {
12
-	$modx->webAlertAndQuit(sprintf($_lang['lock_settings_msg'], $username));
12
+    $modx->webAlertAndQuit(sprintf($_lang['lock_settings_msg'], $username));
13 13
 }
14 14
 // end check for lock
15 15
 
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 include_once(MODX_MANAGER_PATH . 'includes/default_config.php');
20 20
 $rs = $modx->db->select('setting_name, setting_value', '[+prefix+]system_settings');
21 21
 while($row = $modx->db->getRow($rs)) {
22
-	$settings[$row['setting_name']] = $row['setting_value'];
22
+    $settings[$row['setting_name']] = $row['setting_value'];
23 23
 }
24 24
 $settings['filemanager_path'] = preg_replace('@^' . preg_quote(MODX_BASE_PATH) . '@', '[(base_path)]', $settings['filemanager_path']);
25 25
 $settings['rb_base_dir'] = preg_replace('@^' . preg_quote(MODX_BASE_PATH) . '@', '[(base_path)]', $settings['rb_base_dir']);
@@ -30,11 +30,11 @@  discard block
 block discarded – undo
30 30
 $lang_keys = array();
31 31
 $dir = dir('includes/lang');
32 32
 while($file = $dir->read()) {
33
-	if(strpos($file, '.inc.php') > 0) {
34
-		$endpos = strpos($file, '.');
35
-		$languagename = substr($file, 0, $endpos);
36
-		$lang_keys[$languagename] = get_lang_keys($file);
37
-	}
33
+    if(strpos($file, '.inc.php') > 0) {
34
+        $endpos = strpos($file, '.');
35
+        $languagename = substr($file, 0, $endpos);
36
+        $lang_keys[$languagename] = get_lang_keys($file);
37
+    }
38 38
 }
39 39
 $dir->close();
40 40
 $displayStyle = ($_SESSION['browser'] === 'modern') ? 'table-row' : 'block';
@@ -76,14 +76,14 @@  discard block
 block discarded – undo
76 76
 				</script>
77 77
 
78 78
 				<?php
79
-				include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab1_site_settings.inc.php');
80
-				include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab2_furl_settings.inc.php');
81
-				include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab3_user_settings.inc.php');
82
-				include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab4_manager_settings.inc.php');
83
-				include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab5_security_settings.inc.php');
84
-				include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab6_filemanager_settings.inc.php');
85
-				include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab7_filebrowser_settings.inc.php');
86
-				?>
79
+                include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab1_site_settings.inc.php');
80
+                include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab2_furl_settings.inc.php');
81
+                include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab3_user_settings.inc.php');
82
+                include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab4_manager_settings.inc.php');
83
+                include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab5_security_settings.inc.php');
84
+                include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab6_filemanager_settings.inc.php');
85
+                include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab7_filebrowser_settings.inc.php');
86
+                ?>
87 87
 			</div>
88 88
 		</div>
89 89
 	</form>
@@ -130,5 +130,5 @@  discard block
 block discarded – undo
130 130
 	</script>
131 131
 <?php
132 132
 if(is_numeric($_GET['tab'])) {
133
-	echo '<script type="text/javascript">tpSettings.setSelectedIndex( ' . $_GET['tab'] . ' );</script>';
133
+    echo '<script type="text/javascript">tpSettings.setSelectedIndex( ' . $_GET['tab'] . ' );</script>';
134 134
 }
Please login to merge, or discard this patch.
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -1,14 +1,14 @@  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 />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5
-if(!$modx->hasPermission('settings')) {
5
+if (!$modx->hasPermission('settings')) {
6 6
 	$modx->webAlertAndQuit($_lang['error_no_privileges']);
7 7
 }
8 8
 
9 9
 // check to see the edit settings page isn't locked
10
-$rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=17 AND internalKey!='" . $modx->getLoginUserID() . "'");
11
-if($username = $modx->db->getValue($rs)) {
10
+$rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=17 AND internalKey!='".$modx->getLoginUserID()."'");
11
+if ($username = $modx->db->getValue($rs)) {
12 12
 	$modx->webAlertAndQuit(sprintf($_lang['lock_settings_msg'], $username));
13 13
 }
14 14
 // end check for lock
@@ -16,21 +16,21 @@  discard block
 block discarded – undo
16 16
 // reload system settings from the database.
17 17
 // this will prevent user-defined settings from being saved as system setting
18 18
 $settings = array();
19
-include_once(MODX_MANAGER_PATH . 'includes/default_config.php');
19
+include_once(MODX_MANAGER_PATH.'includes/default_config.php');
20 20
 $rs = $modx->db->select('setting_name, setting_value', '[+prefix+]system_settings');
21
-while($row = $modx->db->getRow($rs)) {
21
+while ($row = $modx->db->getRow($rs)) {
22 22
 	$settings[$row['setting_name']] = $row['setting_value'];
23 23
 }
24
-$settings['filemanager_path'] = preg_replace('@^' . preg_quote(MODX_BASE_PATH) . '@', '[(base_path)]', $settings['filemanager_path']);
25
-$settings['rb_base_dir'] = preg_replace('@^' . preg_quote(MODX_BASE_PATH) . '@', '[(base_path)]', $settings['rb_base_dir']);
24
+$settings['filemanager_path'] = preg_replace('@^'.preg_quote(MODX_BASE_PATH).'@', '[(base_path)]', $settings['filemanager_path']);
25
+$settings['rb_base_dir'] = preg_replace('@^'.preg_quote(MODX_BASE_PATH).'@', '[(base_path)]', $settings['rb_base_dir']);
26 26
 
27 27
 extract($settings, EXTR_OVERWRITE);
28 28
 
29 29
 // load languages and keys
30 30
 $lang_keys = array();
31 31
 $dir = dir('includes/lang');
32
-while($file = $dir->read()) {
33
-	if(strpos($file, '.inc.php') > 0) {
32
+while ($file = $dir->read()) {
33
+	if (strpos($file, '.inc.php') > 0) {
34 34
 		$endpos = strpos($file, '.');
35 35
 		$languagename = substr($file, 0, $endpos);
36 36
 		$lang_keys[$languagename] = get_lang_keys($file);
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 			<input type="hidden" name="site_id" value="<?php echo $site_id; ?>" />
68 68
 			<input type="hidden" name="settings_version" value="<?php echo $modx->getVersionData('version'); ?>" />
69 69
 			<!-- this field is used to check site settings have been entered/ updated after install or upgrade -->
70
-			<?php if(!isset($settings_version) || $settings_version != $modx->getVersionData('version')) { ?>
70
+			<?php if (!isset($settings_version) || $settings_version != $modx->getVersionData('version')) { ?>
71 71
 				<div class='sectionBody'><p class='element-edit-message-tab alert alert-warning'><?php echo $_lang['settings_after_install']; ?></p></div>
72 72
 			<?php } ?>
73 73
 			<div class="tab-pane" id="settingsPane">
@@ -76,13 +76,13 @@  discard block
 block discarded – undo
76 76
 				</script>
77 77
 
78 78
 				<?php
79
-				include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab1_site_settings.inc.php');
80
-				include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab2_furl_settings.inc.php');
81
-				include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab3_user_settings.inc.php');
82
-				include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab4_manager_settings.inc.php');
83
-				include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab5_security_settings.inc.php');
84
-				include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab6_filemanager_settings.inc.php');
85
-				include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab7_filebrowser_settings.inc.php');
79
+				include_once(MODX_MANAGER_PATH.'actions/mutate_settings/tab1_site_settings.inc.php');
80
+				include_once(MODX_MANAGER_PATH.'actions/mutate_settings/tab2_furl_settings.inc.php');
81
+				include_once(MODX_MANAGER_PATH.'actions/mutate_settings/tab3_user_settings.inc.php');
82
+				include_once(MODX_MANAGER_PATH.'actions/mutate_settings/tab4_manager_settings.inc.php');
83
+				include_once(MODX_MANAGER_PATH.'actions/mutate_settings/tab5_security_settings.inc.php');
84
+				include_once(MODX_MANAGER_PATH.'actions/mutate_settings/tab6_filemanager_settings.inc.php');
85
+				include_once(MODX_MANAGER_PATH.'actions/mutate_settings/tab7_filebrowser_settings.inc.php');
86 86
 				?>
87 87
 			</div>
88 88
 		</div>
@@ -129,6 +129,6 @@  discard block
 block discarded – undo
129 129
 		});
130 130
 	</script>
131 131
 <?php
132
-if(is_numeric($_GET['tab'])) {
133
-	echo '<script type="text/javascript">tpSettings.setSelectedIndex( ' . $_GET['tab'] . ' );</script>';
132
+if (is_numeric($_GET['tab'])) {
133
+	echo '<script type="text/javascript">tpSettings.setSelectedIndex( '.$_GET['tab'].' );</script>';
134 134
 }
Please login to merge, or discard this patch.
manager/actions/access_permissions.dynamic.php 2 patches
Indentation   +90 added lines, -90 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3
-	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
3
+    die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if(!$modx->hasPermission('access_permissions')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 // Get table names (alphabetical)
@@ -18,24 +18,24 @@  discard block
 block discarded – undo
18 18
 // find all document groups, for the select :)
19 19
 $rs = $modx->db->select('*', $tbl_documentgroup_names, '', 'name');
20 20
 if($modx->db->getRecordCount($rs) < 1) {
21
-	$docgroupselector = '[no groups to add]';
21
+    $docgroupselector = '[no groups to add]';
22 22
 } else {
23
-	$docgroupselector = '<select name="docgroup">' . "\n";
24
-	while($row = $modx->db->getRow($rs)) {
25
-		$docgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n";
26
-	}
27
-	$docgroupselector .= "</select>\n";
23
+    $docgroupselector = '<select name="docgroup">' . "\n";
24
+    while($row = $modx->db->getRow($rs)) {
25
+        $docgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n";
26
+    }
27
+    $docgroupselector .= "</select>\n";
28 28
 }
29 29
 
30 30
 $rs = $modx->db->select('*', $tbl_membergroup_names, '', 'name');
31 31
 if($modx->db->getRecordCount($rs) < 1) {
32
-	$usrgroupselector = '[no user groups]';
32
+    $usrgroupselector = '[no user groups]';
33 33
 } else {
34
-	$usrgroupselector = '<select name="usergroup">' . "\n";
35
-	while($row = $modx->db->getRow($rs)) {
36
-		$usrgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n";
37
-	}
38
-	$usrgroupselector .= "</select>\n";
34
+    $usrgroupselector = '<select name="usergroup">' . "\n";
35
+    while($row = $modx->db->getRow($rs)) {
36
+        $usrgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n";
37
+    }
38
+    $usrgroupselector .= "</select>\n";
39 39
 }
40 40
 
41 41
 ?>
@@ -96,24 +96,24 @@  discard block
 block discarded – undo
96 96
 				</form>
97 97
 			</div>
98 98
 			<?php
99
-			$rs = $modx->db->select('groupnames.*, users.id AS user_id, users.username user_name', $tbl_membergroup_names . ' AS groupnames
99
+            $rs = $modx->db->select('groupnames.*, users.id AS user_id, users.username user_name', $tbl_membergroup_names . ' AS groupnames
100 100
 			LEFT JOIN ' . $tbl_member_groups . ' AS groups ON groups.user_group = groupnames.id
101 101
 			LEFT JOIN ' . $tbl_manager_users . ' AS users ON users.id = groups.member', '', 'groupnames.name, user_name');
102
-			if($modx->db->getRecordCount($rs) < 1) {
103
-				?>
102
+            if($modx->db->getRecordCount($rs) < 1) {
103
+                ?>
104 104
 				<div class="text-danger"><?= $_lang['no_groups_found'] ?></div>
105 105
 				<?php
106
-			} else {
107
-			?>
106
+            } else {
107
+            ?>
108 108
 			<div class="form-group">
109 109
 				<?php
110
-				$pid = '';
111
-				while($row = $modx->db->getRow($rs)) {
112
-					if($pid != $row['id']) {
113
-						if($pid != '') {
114
-							echo '</div><div class="form-group">';
115
-						}
116
-						?>
110
+                $pid = '';
111
+                while($row = $modx->db->getRow($rs)) {
112
+                    if($pid != $row['id']) {
113
+                        if($pid != '') {
114
+                            echo '</div><div class="form-group">';
115
+                        }
116
+                        ?>
117 117
 						<form method="post" action="index.php" name="accesspermissions">
118 118
 							<input type="hidden" name="a" value="41" />
119 119
 							<input type="hidden" name="groupid" value="<?= $row['id'] ?>" />
@@ -128,21 +128,21 @@  discard block
 block discarded – undo
128 128
 						</form>
129 129
 						<?= $_lang['access_permissions_users_in_group'] ?>
130 130
 						<?php
131
-					}
132
-					if(!$row['user_id']) {
133
-						?>
131
+                    }
132
+                    if(!$row['user_id']) {
133
+                        ?>
134 134
 						<i><?= $_lang['access_permissions_no_users_in_group'] ?></i>
135 135
 						<?php
136
-						$pid = $row['id'];
137
-						continue;
138
-					}
139
-					?>
136
+                        $pid = $row['id'];
137
+                        continue;
138
+                    }
139
+                    ?>
140 140
 					<?= ($pid == $row['id'] ? ', ' : '') ?><a href="index.php?a=12&id=<?= $row['user_id'] ?>"><?= $row['user_name'] ?></a>
141 141
 					<?php
142
-					$pid = $row['id'];
143
-				}
144
-				}
145
-				?>
142
+                    $pid = $row['id'];
143
+                }
144
+                }
145
+                ?>
146 146
 			</div>
147 147
 		</div>
148 148
 	</div>
@@ -167,24 +167,24 @@  discard block
 block discarded – undo
167 167
 				</form>
168 168
 			</div>
169 169
 			<?php
170
-			$rs = $modx->db->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', $tbl_documentgroup_names . ' AS dgnames
170
+            $rs = $modx->db->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', $tbl_documentgroup_names . ' AS dgnames
171 171
 			LEFT JOIN ' . $tbl_document_groups . ' AS dg ON dg.document_group = dgnames.id
172 172
 			LEFT JOIN ' . $tbl_site_content . ' AS sc ON sc.id = dg.document', '', 'dgnames.name, sc.id');
173
-			if($modx->db->getRecordCount($rs) < 1) {
174
-				?>
173
+            if($modx->db->getRecordCount($rs) < 1) {
174
+                ?>
175 175
 				<div class="text-danger"><?= $_lang['no_groups_found'] ?></div>
176 176
 				<?php
177
-			} else {
178
-			?>
177
+            } else {
178
+            ?>
179 179
 			<div class="form-group">
180 180
 				<?php
181
-				$pid = '';
182
-				while($row = $modx->db->getRow($rs)) {
183
-					if($pid != $row['id']) {
184
-						if($pid != '') {
185
-							echo '</div><div class="form-group">';
186
-						}
187
-						?>
181
+                $pid = '';
182
+                while($row = $modx->db->getRow($rs)) {
183
+                    if($pid != $row['id']) {
184
+                        if($pid != '') {
185
+                            echo '</div><div class="form-group">';
186
+                        }
187
+                        ?>
188 188
 						<form method="post" action="index.php" name="accesspermissions">
189 189
 							<input type="hidden" name="a" value="41" />
190 190
 							<input type="hidden" name="groupid" value="<?= $row['id'] ?>" />
@@ -199,21 +199,21 @@  discard block
 block discarded – undo
199 199
 						</form>
200 200
 						<?= $_lang['access_permissions_resources_in_group'] ?>
201 201
 						<?php
202
-					}
203
-					if(!$row['doc_id']) {
204
-						?>
202
+                    }
203
+                    if(!$row['doc_id']) {
204
+                        ?>
205 205
 						<i><?= $_lang['access_permissions_no_resources_in_group'] ?></i>
206 206
 						<?php
207
-						$pid = $row['id'];
208
-						continue;
209
-					}
210
-					?>
207
+                        $pid = $row['id'];
208
+                        continue;
209
+                    }
210
+                    ?>
211 211
 					<?= ($pid == $row['id'] ? ', ' : '') ?><a href="index.php?a=3&id=<?= $row['doc_id'] ?>" title="<?= $modx->htmlspecialchars($row['doc_title']) ?>"><?= $row['doc_id'] ?></a>
212 212
 					<?php
213
-					$pid = $row['id'];
214
-				}
215
-				}
216
-				?>
213
+                    $pid = $row['id'];
214
+                }
215
+                }
216
+                ?>
217 217
 			</div>
218 218
 		</div>
219 219
 	</div>
@@ -225,16 +225,16 @@  discard block
 block discarded – undo
225 225
 		<div class="container container-body">
226 226
 			<p class="element-edit-message-tab alert alert-warning"><?= $_lang['access_permissions_links_tab'] ?></p>
227 227
 			<?php
228
-			// User/Document Group Links
229
-			$rs = $modx->db->select('groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', $tbl_membergroup_names . ' AS groupnames
228
+            // User/Document Group Links
229
+            $rs = $modx->db->select('groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', $tbl_membergroup_names . ' AS groupnames
230 230
 			LEFT JOIN ' . $tbl_membergroup_access . ' AS groupacc ON groupacc.membergroup = groupnames.id
231 231
 			LEFT JOIN ' . $tbl_documentgroup_names . ' AS dgnames ON dgnames.id = groupacc.documentgroup', '', 'name, dg_name');
232
-			if($modx->db->getRecordCount($rs) < 1) {
233
-				?>
232
+            if($modx->db->getRecordCount($rs) < 1) {
233
+                ?>
234 234
 				<div class="text-danger"><?= $_lang['no_groups_found'] ?></div>
235 235
 				<?php
236
-			} else {
237
-				?>
236
+            } else {
237
+                ?>
238 238
 				<div class="form-group">
239 239
 					<b><?= $_lang["access_permissions_group_link"] ?></b>
240 240
 					<form method="post" action="index.php" name="accesspermissions">
@@ -250,38 +250,38 @@  discard block
 block discarded – undo
250 250
 				<hr>
251 251
 				<ul>
252 252
 					<?php
253
-					$pid = '';
254
-					while($row = $modx->db->getRow($rs)) {
255
-						if($row['id'] != $pid) {
256
-							if($pid != '') {
257
-								echo '</ul></li>';
258
-							} // close previous one
259
-							?>
253
+                    $pid = '';
254
+                    while($row = $modx->db->getRow($rs)) {
255
+                        if($row['id'] != $pid) {
256
+                            if($pid != '') {
257
+                                echo '</ul></li>';
258
+                            } // close previous one
259
+                            ?>
260 260
 							<li><b><?= $row['name'] ?></b></li>
261 261
 							<?php
262
-							if(!$row['dg_id']) {
263
-								echo '<i>' . $_lang['no_groups_found'] . '</i></li>';
264
-								$pid = '';
265
-								continue;
266
-							} else {
267
-								echo '<ul>';
268
-							}
269
-						}
270
-						if(!$row['dg_id']) {
271
-							continue;
272
-						}
273
-						?>
262
+                            if(!$row['dg_id']) {
263
+                                echo '<i>' . $_lang['no_groups_found'] . '</i></li>';
264
+                                $pid = '';
265
+                                continue;
266
+                            } else {
267
+                                echo '<ul>';
268
+                            }
269
+                        }
270
+                        if(!$row['dg_id']) {
271
+                            continue;
272
+                        }
273
+                        ?>
274 274
 						<li><?= $row['dg_name'] ?>
275 275
 							<small><i>(<a class="text-danger" href="index.php?a=41&coupling=<?= $row['link_id'] ?>&operation=remove_document_group_from_user_group"><?= $_lang['remove'] ?></a>)</i></small>
276 276
 						</li>
277 277
 						<?php
278
-						$pid = $row['id'];
279
-					}
280
-					?>
278
+                        $pid = $row['id'];
279
+                    }
280
+                    ?>
281 281
 				</ul>
282 282
 				<?php
283
-			}
284
-			?>
283
+            }
284
+            ?>
285 285
 		</div>
286 286
 	</div>
287 287
 
Please login to merge, or discard this patch.
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  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('access_permissions')) {
5
+if (!$modx->hasPermission('access_permissions')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
@@ -17,23 +17,23 @@  discard block
 block discarded – undo
17 17
 
18 18
 // find all document groups, for the select :)
19 19
 $rs = $modx->db->select('*', $tbl_documentgroup_names, '', 'name');
20
-if($modx->db->getRecordCount($rs) < 1) {
20
+if ($modx->db->getRecordCount($rs) < 1) {
21 21
 	$docgroupselector = '[no groups to add]';
22 22
 } else {
23
-	$docgroupselector = '<select name="docgroup">' . "\n";
24
-	while($row = $modx->db->getRow($rs)) {
25
-		$docgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n";
23
+	$docgroupselector = '<select name="docgroup">'."\n";
24
+	while ($row = $modx->db->getRow($rs)) {
25
+		$docgroupselector .= "\t".'<option value="'.$row['id'].'">'.$row['name']."</option>\n";
26 26
 	}
27 27
 	$docgroupselector .= "</select>\n";
28 28
 }
29 29
 
30 30
 $rs = $modx->db->select('*', $tbl_membergroup_names, '', 'name');
31
-if($modx->db->getRecordCount($rs) < 1) {
31
+if ($modx->db->getRecordCount($rs) < 1) {
32 32
 	$usrgroupselector = '[no user groups]';
33 33
 } else {
34
-	$usrgroupselector = '<select name="usergroup">' . "\n";
35
-	while($row = $modx->db->getRow($rs)) {
36
-		$usrgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n";
34
+	$usrgroupselector = '<select name="usergroup">'."\n";
35
+	while ($row = $modx->db->getRow($rs)) {
36
+		$usrgroupselector .= "\t".'<option value="'.$row['id'].'">'.$row['name']."</option>\n";
37 37
 	}
38 38
 	$usrgroupselector .= "</select>\n";
39 39
 }
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 	<div class="alert alert-info"><?= $_lang['access_permissions_introtext'] ?></div>
70 70
 </div>
71 71
 
72
-<div class="container"><?= ($use_udperms != 1 ? '<div class="alert alert-danger">' . $_lang['access_permissions_off'] . '</div>' : '') ?></div>
72
+<div class="container"><?= ($use_udperms != 1 ? '<div class="alert alert-danger">'.$_lang['access_permissions_off'].'</div>' : '') ?></div>
73 73
 
74 74
 <div class="tab-pane" id="uapPane">
75 75
 	<script type="text/javascript">
@@ -96,10 +96,10 @@  discard block
 block discarded – undo
96 96
 				</form>
97 97
 			</div>
98 98
 			<?php
99
-			$rs = $modx->db->select('groupnames.*, users.id AS user_id, users.username user_name', $tbl_membergroup_names . ' AS groupnames
100
-			LEFT JOIN ' . $tbl_member_groups . ' AS groups ON groups.user_group = groupnames.id
101
-			LEFT JOIN ' . $tbl_manager_users . ' AS users ON users.id = groups.member', '', 'groupnames.name, user_name');
102
-			if($modx->db->getRecordCount($rs) < 1) {
99
+			$rs = $modx->db->select('groupnames.*, users.id AS user_id, users.username user_name', $tbl_membergroup_names.' AS groupnames
100
+			LEFT JOIN ' . $tbl_member_groups.' AS groups ON groups.user_group = groupnames.id
101
+			LEFT JOIN ' . $tbl_manager_users.' AS users ON users.id = groups.member', '', 'groupnames.name, user_name');
102
+			if ($modx->db->getRecordCount($rs) < 1) {
103 103
 				?>
104 104
 				<div class="text-danger"><?= $_lang['no_groups_found'] ?></div>
105 105
 				<?php
@@ -108,9 +108,9 @@  discard block
 block discarded – undo
108 108
 			<div class="form-group">
109 109
 				<?php
110 110
 				$pid = '';
111
-				while($row = $modx->db->getRow($rs)) {
112
-					if($pid != $row['id']) {
113
-						if($pid != '') {
111
+				while ($row = $modx->db->getRow($rs)) {
112
+					if ($pid != $row['id']) {
113
+						if ($pid != '') {
114 114
 							echo '</div><div class="form-group">';
115 115
 						}
116 116
 						?>
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 						<?= $_lang['access_permissions_users_in_group'] ?>
130 130
 						<?php
131 131
 					}
132
-					if(!$row['user_id']) {
132
+					if (!$row['user_id']) {
133 133
 						?>
134 134
 						<i><?= $_lang['access_permissions_no_users_in_group'] ?></i>
135 135
 						<?php
@@ -167,10 +167,10 @@  discard block
 block discarded – undo
167 167
 				</form>
168 168
 			</div>
169 169
 			<?php
170
-			$rs = $modx->db->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', $tbl_documentgroup_names . ' AS dgnames
171
-			LEFT JOIN ' . $tbl_document_groups . ' AS dg ON dg.document_group = dgnames.id
172
-			LEFT JOIN ' . $tbl_site_content . ' AS sc ON sc.id = dg.document', '', 'dgnames.name, sc.id');
173
-			if($modx->db->getRecordCount($rs) < 1) {
170
+			$rs = $modx->db->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', $tbl_documentgroup_names.' AS dgnames
171
+			LEFT JOIN ' . $tbl_document_groups.' AS dg ON dg.document_group = dgnames.id
172
+			LEFT JOIN ' . $tbl_site_content.' AS sc ON sc.id = dg.document', '', 'dgnames.name, sc.id');
173
+			if ($modx->db->getRecordCount($rs) < 1) {
174 174
 				?>
175 175
 				<div class="text-danger"><?= $_lang['no_groups_found'] ?></div>
176 176
 				<?php
@@ -179,9 +179,9 @@  discard block
 block discarded – undo
179 179
 			<div class="form-group">
180 180
 				<?php
181 181
 				$pid = '';
182
-				while($row = $modx->db->getRow($rs)) {
183
-					if($pid != $row['id']) {
184
-						if($pid != '') {
182
+				while ($row = $modx->db->getRow($rs)) {
183
+					if ($pid != $row['id']) {
184
+						if ($pid != '') {
185 185
 							echo '</div><div class="form-group">';
186 186
 						}
187 187
 						?>
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 						<?= $_lang['access_permissions_resources_in_group'] ?>
201 201
 						<?php
202 202
 					}
203
-					if(!$row['doc_id']) {
203
+					if (!$row['doc_id']) {
204 204
 						?>
205 205
 						<i><?= $_lang['access_permissions_no_resources_in_group'] ?></i>
206 206
 						<?php
@@ -226,10 +226,10 @@  discard block
 block discarded – undo
226 226
 			<p class="element-edit-message-tab alert alert-warning"><?= $_lang['access_permissions_links_tab'] ?></p>
227 227
 			<?php
228 228
 			// User/Document Group Links
229
-			$rs = $modx->db->select('groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', $tbl_membergroup_names . ' AS groupnames
230
-			LEFT JOIN ' . $tbl_membergroup_access . ' AS groupacc ON groupacc.membergroup = groupnames.id
231
-			LEFT JOIN ' . $tbl_documentgroup_names . ' AS dgnames ON dgnames.id = groupacc.documentgroup', '', 'name, dg_name');
232
-			if($modx->db->getRecordCount($rs) < 1) {
229
+			$rs = $modx->db->select('groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', $tbl_membergroup_names.' AS groupnames
230
+			LEFT JOIN ' . $tbl_membergroup_access.' AS groupacc ON groupacc.membergroup = groupnames.id
231
+			LEFT JOIN ' . $tbl_documentgroup_names.' AS dgnames ON dgnames.id = groupacc.documentgroup', '', 'name, dg_name');
232
+			if ($modx->db->getRecordCount($rs) < 1) {
233 233
 				?>
234 234
 				<div class="text-danger"><?= $_lang['no_groups_found'] ?></div>
235 235
 				<?php
@@ -251,23 +251,23 @@  discard block
 block discarded – undo
251 251
 				<ul>
252 252
 					<?php
253 253
 					$pid = '';
254
-					while($row = $modx->db->getRow($rs)) {
255
-						if($row['id'] != $pid) {
256
-							if($pid != '') {
254
+					while ($row = $modx->db->getRow($rs)) {
255
+						if ($row['id'] != $pid) {
256
+							if ($pid != '') {
257 257
 								echo '</ul></li>';
258 258
 							} // close previous one
259 259
 							?>
260 260
 							<li><b><?= $row['name'] ?></b></li>
261 261
 							<?php
262
-							if(!$row['dg_id']) {
263
-								echo '<i>' . $_lang['no_groups_found'] . '</i></li>';
262
+							if (!$row['dg_id']) {
263
+								echo '<i>'.$_lang['no_groups_found'].'</i></li>';
264 264
 								$pid = '';
265 265
 								continue;
266 266
 							} else {
267 267
 								echo '<ul>';
268 268
 							}
269 269
 						}
270
-						if(!$row['dg_id']) {
270
+						if (!$row['dg_id']) {
271 271
 							continue;
272 272
 						}
273 273
 						?>
Please login to merge, or discard this patch.
manager/actions/search.static.php 3 patches
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -118,18 +118,18 @@
 block discarded – undo
118 118
 		$articul_query = "SELECT `contentid` FROM {$tbl_site_tmplvar_contentvalues} WHERE `value` LIKE '%{$searchfields}%'";
119 119
 		$articul_result = $modx->db->query($articul_query);
120 120
 		$articul_id_array = $modx->db->makeArray($articul_result);
121
-		if(count($articul_id_array)>0){
121
+		if(count($articul_id_array)>0) {
122 122
 			$articul_id = '';
123 123
 			$i = 1;
124 124
 			foreach( $articul_id_array as $articul ) {
125 125
 				$articul_id.=$articul['contentid'];
126
-				if($i !== count($articul_id_array)){
126
+				if($i !== count($articul_id_array)) {
127 127
 					$articul_id.=',';
128 128
 				}
129 129
 				$i++;
130 130
 			}
131 131
 		$articul_id_query = " OR sc.id IN ({$articul_id})";
132
-		}else{
132
+		} else {
133 133
 			$articul_id_query = '';
134 134
 		}
135 135
 		/*end search by TV*/
Please login to merge, or discard this patch.
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -113,31 +113,31 @@
 block discarded – undo
113 113
     // Handle Input "Search in main fields"
114 114
     if ($searchfields != '') {
115 115
 
116
-		/*start search by TV. Added Rising13*/
117
-		$tbl_site_tmplvar_contentvalues = $modx->getFullTableName('site_tmplvar_contentvalues');
118
-		$articul_query = "SELECT `contentid` FROM {$tbl_site_tmplvar_contentvalues} WHERE `value` LIKE '%{$searchfields}%'";
119
-		$articul_result = $modx->db->query($articul_query);
120
-		$articul_id_array = $modx->db->makeArray($articul_result);
121
-		if(count($articul_id_array)>0){
122
-			$articul_id = '';
123
-			$i = 1;
124
-			foreach( $articul_id_array as $articul ) {
125
-				$articul_id.=$articul['contentid'];
126
-				if($i !== count($articul_id_array)){
127
-					$articul_id.=',';
128
-				}
129
-				$i++;
130
-			}
131
-		$articul_id_query = " OR sc.id IN ({$articul_id})";
132
-		}else{
133
-			$articul_id_query = '';
134
-		}
135
-		/*end search by TV*/
116
+        /*start search by TV. Added Rising13*/
117
+        $tbl_site_tmplvar_contentvalues = $modx->getFullTableName('site_tmplvar_contentvalues');
118
+        $articul_query = "SELECT `contentid` FROM {$tbl_site_tmplvar_contentvalues} WHERE `value` LIKE '%{$searchfields}%'";
119
+        $articul_result = $modx->db->query($articul_query);
120
+        $articul_id_array = $modx->db->makeArray($articul_result);
121
+        if(count($articul_id_array)>0){
122
+            $articul_id = '';
123
+            $i = 1;
124
+            foreach( $articul_id_array as $articul ) {
125
+                $articul_id.=$articul['contentid'];
126
+                if($i !== count($articul_id_array)){
127
+                    $articul_id.=',';
128
+                }
129
+                $i++;
130
+            }
131
+        $articul_id_query = " OR sc.id IN ({$articul_id})";
132
+        }else{
133
+            $articul_id_query = '';
134
+        }
135
+        /*end search by TV*/
136 136
 
137 137
         if (ctype_digit($searchfields)) {
138 138
             $sqladd .= "sc.id='{$searchfields}'";
139 139
             if (strlen($searchfields) > 3) {
140
-				$sqladd .= $articul_id_query;//search by TV
140
+                $sqladd .= $articul_id_query;//search by TV
141 141
                 $sqladd .= " OR sc.pagetitle LIKE '%{$searchfields}%'";
142 142
             }
143 143
         }
Please login to merge, or discard this patch.
Spacing   +73 added lines, -73 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     exit();
4 4
 }
5 5
 unset($_SESSION['itemname']); // clear this, because it's only set for logging purposes
@@ -41,9 +41,9 @@  discard block
 block discarded – undo
41 41
                         <?php
42 42
                         $rs = $modx->db->select('*', $modx->getFullTableName('site_templates'));
43 43
                         $option[] = '<option value="">No selected</option>';
44
-                        $templateid = (isset($_REQUEST['templateid']) && $_REQUEST['templateid'] !== '') ? (int)$_REQUEST['templateid'] : '';
44
+                        $templateid = (isset($_REQUEST['templateid']) && $_REQUEST['templateid'] !== '') ? (int) $_REQUEST['templateid'] : '';
45 45
                         $selected = $templateid === 0 ? ' selected="selected"' : '';
46
-                        $option[] = '<option value="0"' . $selected . '>(blank)</option>';
46
+                        $option[] = '<option value="0"'.$selected.'>(blank)</option>';
47 47
                         while ($row = $modx->db->getRow($rs)) {
48 48
                             $templatename = htmlspecialchars($row['templatename'], ENT_QUOTES, $modx->config['modx_charset']);
49 49
                             $selected = $row['id'] == $templateid ? ' selected="selected"' : '';
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
     $searchfields = htmlentities(trim($_POST['searchfields']), ENT_QUOTES, $modx_manager_charset);
87 87
     $searchlongtitle = $modx->db->escape(trim($_REQUEST['searchfields']));
88 88
     $search_alias = $modx->db->escape(trim($_REQUEST['searchfields']));
89
-    $templateid = isset($_REQUEST['templateid']) && $_REQUEST['templateid'] !== '' ? (int)$_REQUEST['templateid'] : '';
89
+    $templateid = isset($_REQUEST['templateid']) && $_REQUEST['templateid'] !== '' ? (int) $_REQUEST['templateid'] : '';
90 90
     $searchcontent = $modx->db->escape($_REQUEST['content']);
91 91
 
92 92
     $fields = 'DISTINCT sc.id, contenttype, pagetitle, longtitle, description, introtext, menutitle, deleted, published, isfolder, type';
@@ -100,12 +100,12 @@  discard block
 block discarded – undo
100 100
         $friendly_url_suffix = $modx->config['friendly_url_suffix'];
101 101
         $base_url = $modx->config['base_url'];
102 102
         $site_url = $modx->config['site_url'];
103
-        $url = preg_replace('@' . $friendly_url_suffix . '$@', '', $url);
103
+        $url = preg_replace('@'.$friendly_url_suffix.'$@', '', $url);
104 104
         if ($url[0] === '/') {
105
-            $url = preg_replace('@^' . $base_url . '@', '', $url);
105
+            $url = preg_replace('@^'.$base_url.'@', '', $url);
106 106
         }
107 107
         if (substr($url, 0, 4) === 'http') {
108
-            $url = preg_replace('@^' . $site_url . '@', '', $url);
108
+            $url = preg_replace('@^'.$site_url.'@', '', $url);
109 109
         }
110 110
         $idFromAlias = $modx->getIdFromAlias($url);
111 111
     }
@@ -118,18 +118,18 @@  discard block
 block discarded – undo
118 118
 		$articul_query = "SELECT `contentid` FROM {$tbl_site_tmplvar_contentvalues} WHERE `value` LIKE '%{$searchfields}%'";
119 119
 		$articul_result = $modx->db->query($articul_query);
120 120
 		$articul_id_array = $modx->db->makeArray($articul_result);
121
-		if(count($articul_id_array)>0){
121
+		if (count($articul_id_array) > 0) {
122 122
 			$articul_id = '';
123 123
 			$i = 1;
124
-			foreach( $articul_id_array as $articul ) {
125
-				$articul_id.=$articul['contentid'];
126
-				if($i !== count($articul_id_array)){
127
-					$articul_id.=',';
124
+			foreach ($articul_id_array as $articul) {
125
+				$articul_id .= $articul['contentid'];
126
+				if ($i !== count($articul_id_array)) {
127
+					$articul_id .= ',';
128 128
 				}
129 129
 				$i++;
130 130
 			}
131 131
 		$articul_id_query = " OR sc.id IN ({$articul_id})";
132
-		}else{
132
+		} else {
133 133
 			$articul_id_query = '';
134 134
 		}
135 135
 		/*end search by TV*/
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
         if (ctype_digit($searchfields)) {
138 138
             $sqladd .= "sc.id='{$searchfields}'";
139 139
             if (strlen($searchfields) > 3) {
140
-				$sqladd .= $articul_id_query;//search by TV
140
+				$sqladd .= $articul_id_query; //search by TV
141 141
                 $sqladd .= " OR sc.pagetitle LIKE '%{$searchfields}%'";
142 142
             }
143 143
         }
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
             $sqladd .= " OR sc.introtext LIKE '%{$searchlongtitle}%'";
158 158
             $sqladd .= " OR sc.menutitle LIKE '%{$searchlongtitle}%'";
159 159
             $sqladd .= " OR sc.alias LIKE '%{$search_alias}%'";
160
-            $sqladd .= $articul_id_query;//search by TV
160
+            $sqladd .= $articul_id_query; //search by TV
161 161
             $sqladd .= ")";
162 162
         }
163 163
     } else if ($idFromAlias) {
@@ -181,8 +181,8 @@  discard block
 block discarded – undo
181 181
         $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(',', $_SESSION['mgrDocgroups']) : '';
182 182
         $mgrRole = (isset ($_SESSION['mgrRole']) && $_SESSION['mgrRole'] == 1) ? 1 : 0;
183 183
         $docgrp_cond = $docgrp ? " OR dg.document_group IN ({$docgrp})" : '';
184
-        $fields .= ', MAX(IF(1=' . $mgrRole . ' OR sc.privatemgr=0' . $docgrp_cond . ',1,0)) AS hasAccess';
185
-        $sqladd = '(' . $sqladd . ") AND (1={$mgrRole} OR sc.privatemgr=0" . (!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))");
184
+        $fields .= ', MAX(IF(1='.$mgrRole.' OR sc.privatemgr=0'.$docgrp_cond.',1,0)) AS hasAccess';
185
+        $sqladd = '('.$sqladd.") AND (1={$mgrRole} OR sc.privatemgr=0".(!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))");
186 186
     }
187 187
 
188 188
     if ($sqladd) {
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
     $where = $sqladd;
193 193
 
194 194
     if ($where) {
195
-        $rs = $modx->db->select($fields, $tbl_site_content . ' AS sc LEFT JOIN ' . $tbldg . ' AS dg ON dg.document=sc.id', $where, 'sc.id');
195
+        $rs = $modx->db->select($fields, $tbl_site_content.' AS sc LEFT JOIN '.$tbldg.' AS dg ON dg.document=sc.id', $where, 'sc.id');
196 196
         $limit = $modx->db->getRecordCount($rs);
197 197
     } else {
198 198
         $limit = 0;
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
                 if ($limit < 1) {
212 212
                     echo $_lang['search_empty'];
213 213
                 } else {
214
-                    printf('<p>' . $_lang['search_results_returned_msg'] . '</p>', $limit);
214
+                    printf('<p>'.$_lang['search_results_returned_msg'].'</p>', $limit);
215 215
                     ?>
216 216
                     <script type="text/javascript" src="media/script/tablesort.js"></script>
217 217
                     <table class="grid sortabletable sortable-onload-2 rowstyle-even" id="table-1">
@@ -271,14 +271,14 @@  discard block
 block discarded – undo
271 271
                                 if (function_exists('mb_strlen') && function_exists('mb_substr')) {
272 272
                                     ?>
273 273
                                     <td<?= $tdClass ?>>
274
-                                        <a href="index.php?a=27&id=<?= $row['id'] ?>"><?= mb_strlen($row['pagetitle'], $modx_manager_charset) > 70 ? mb_substr($row['pagetitle'], 0, 70, $modx_manager_charset) . "..." : $row['pagetitle'] ?></a>
274
+                                        <a href="index.php?a=27&id=<?= $row['id'] ?>"><?= mb_strlen($row['pagetitle'], $modx_manager_charset) > 70 ? mb_substr($row['pagetitle'], 0, 70, $modx_manager_charset)."..." : $row['pagetitle'] ?></a>
275 275
                                     </td>
276
-                                    <td<?= $tdClass ?>><?= mb_strlen($row['description'], $modx_manager_charset) > 70 ? mb_substr($row['description'], 0, 70, $modx_manager_charset) . "..." : $row['description'] ?></td>
276
+                                    <td<?= $tdClass ?>><?= mb_strlen($row['description'], $modx_manager_charset) > 70 ? mb_substr($row['description'], 0, 70, $modx_manager_charset)."..." : $row['description'] ?></td>
277 277
                                     <?php
278 278
                                 } else {
279 279
                                     ?>
280
-                                    <td<?= $tdClass ?>><?= strlen($row['pagetitle']) > 20 ? substr($row['pagetitle'], 0, 20) . '...' : $row['pagetitle'] ?></td>
281
-                                    <td<?= $tdClass ?>><?= strlen($row['description']) > 35 ? substr($row['description'], 0, 35) . '...' : $row['description'] ?></td>
280
+                                    <td<?= $tdClass ?>><?= strlen($row['pagetitle']) > 20 ? substr($row['pagetitle'], 0, 20).'...' : $row['pagetitle'] ?></td>
281
+                                    <td<?= $tdClass ?>><?= strlen($row['description']) > 35 ? substr($row['description'], 0, 35).'...' : $row['description'] ?></td>
282 282
                                     <?php
283 283
                                 }
284 284
                                 ?>
@@ -298,115 +298,115 @@  discard block
 block discarded – undo
298 298
                 if ($modx->hasPermission('new_document') && $modx->hasPermission('edit_document') && $modx->hasPermission('save_document')) {
299 299
                     $docscounts = $modx->db->getRecordCount($rs);
300 300
                     if ($docscounts > 0) {
301
-                        $output .= '<li><b><i class="fa fa-sitemap"></i> ' . $_lang["manage_documents"] . ' (' . $docscounts . ')</b></li>';
301
+                        $output .= '<li><b><i class="fa fa-sitemap"></i> '.$_lang["manage_documents"].' ('.$docscounts.')</b></li>';
302 302
                         while ($row = $modx->db->getRow($rs)) {
303
-                            $output .= '<li' . addClassForItemList('', !$row['published'], $row['deleted']) . '><a href="index.php?a=27&id=' . $row['id'] . '" id="content_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['pagetitle'] . ' <small>(' . $row['id'] . ')</small>', $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>';
303
+                            $output .= '<li'.addClassForItemList('', !$row['published'], $row['deleted']).'><a href="index.php?a=27&id='.$row['id'].'" id="content_'.$row['id'].'" target="main">'.highlightingCoincidence($row['pagetitle'].' <small>('.$row['id'].')</small>', $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>';
304 304
                         }
305 305
                     }
306 306
                 }
307 307
 
308 308
                 //templates
309 309
                 if ($modx->hasPermission('edit_template')) {
310
-                    $rs = $modx->db->select("id,templatename,locked", $modx->getFullTableName('site_templates'), "`id` like '%" . $searchfields . "%' 
311
-					OR `templatename` like '%" . $searchfields . "%' 
312
-					OR `description` like '%" . $searchfields . "%' 
313
-					OR `content` like '%" . $searchfields . "%'");
310
+                    $rs = $modx->db->select("id,templatename,locked", $modx->getFullTableName('site_templates'), "`id` like '%".$searchfields."%' 
311
+					OR `templatename` like '%" . $searchfields."%' 
312
+					OR `description` like '%" . $searchfields."%' 
313
+					OR `content` like '%" . $searchfields."%'");
314 314
                     $templatecounts = $modx->db->getRecordCount($rs);
315 315
                     if ($templatecounts > 0) {
316
-                        $output .= '<li><b><i class="fa fa-newspaper-o"></i> ' . $_lang["manage_templates"] . ' (' . $templatecounts . ')</b></li>';
316
+                        $output .= '<li><b><i class="fa fa-newspaper-o"></i> '.$_lang["manage_templates"].' ('.$templatecounts.')</b></li>';
317 317
                         while ($row = $modx->db->getRow($rs)) {
318
-                            $output .= '<li' . addClassForItemList($row['locked']) . '><a href="index.php?a=16&id=' . $row['id'] . '" id="templates_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['templatename'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>';
318
+                            $output .= '<li'.addClassForItemList($row['locked']).'><a href="index.php?a=16&id='.$row['id'].'" id="templates_'.$row['id'].'" target="main">'.highlightingCoincidence($row['templatename'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>';
319 319
                         }
320 320
                     }
321 321
                 }
322 322
 
323 323
                 //tvs
324 324
                 if ($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) {
325
-                    $rs = $modx->db->select("id,name,locked", $modx->getFullTableName('site_tmplvars'), "`id` like '%" . $searchfields . "%' 
326
-					OR `name` like '%" . $searchfields . "%' 
327
-					OR `description` like '%" . $searchfields . "%' 
328
-					OR `type` like '%" . $searchfields . "%' 
329
-					OR `elements` like '%" . $searchfields . "%' 
330
-					OR `display` like '%" . $searchfields . "%' 
331
-					OR `display_params` like '%" . $searchfields . "%' 
332
-					OR `default_text` like '%" . $searchfields . "%'");
325
+                    $rs = $modx->db->select("id,name,locked", $modx->getFullTableName('site_tmplvars'), "`id` like '%".$searchfields."%' 
326
+					OR `name` like '%" . $searchfields."%' 
327
+					OR `description` like '%" . $searchfields."%' 
328
+					OR `type` like '%" . $searchfields."%' 
329
+					OR `elements` like '%" . $searchfields."%' 
330
+					OR `display` like '%" . $searchfields."%' 
331
+					OR `display_params` like '%" . $searchfields."%' 
332
+					OR `default_text` like '%" . $searchfields."%'");
333 333
                     $tvscounts = $modx->db->getRecordCount($rs);
334 334
                     if ($tvscounts > 0) {
335
-                        $output .= '<li><b><i class="fa fa-list-alt"></i> ' . $_lang["settings_templvars"] . ' (' . $tvscounts . ')</b></li>';
335
+                        $output .= '<li><b><i class="fa fa-list-alt"></i> '.$_lang["settings_templvars"].' ('.$tvscounts.')</b></li>';
336 336
                         while ($row = $modx->db->getRow($rs)) {
337
-                            $output .= '<li' . addClassForItemList($row['locked']) . '><a href="index.php?a=301&id=' . $row['id'] . '" id="tmplvars_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['name'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>';
337
+                            $output .= '<li'.addClassForItemList($row['locked']).'><a href="index.php?a=301&id='.$row['id'].'" id="tmplvars_'.$row['id'].'" target="main">'.highlightingCoincidence($row['name'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>';
338 338
                         }
339 339
                     }
340 340
                 }
341 341
 
342 342
                 //Chunks
343 343
                 if ($modx->hasPermission('edit_chunk')) {
344
-                    $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_htmlsnippets'), "`id` like '%" . $searchfields . "%' 
345
-					OR `name` like '%" . $searchfields . "%' 
346
-					OR `description` like '%" . $searchfields . "%'     
347
-					OR `snippet` like '%" . $searchfields . "%'");
344
+                    $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_htmlsnippets'), "`id` like '%".$searchfields."%' 
345
+					OR `name` like '%" . $searchfields."%' 
346
+					OR `description` like '%" . $searchfields."%'     
347
+					OR `snippet` like '%" . $searchfields."%'");
348 348
                     $chunkscounts = $modx->db->getRecordCount($rs);
349 349
                     if ($chunkscounts > 0) {
350
-                        $output .= '<li><b><i class="fa fa-th-large"></i> ' . $_lang["manage_htmlsnippets"] . ' (' . $chunkscounts . ')</b></li>';
350
+                        $output .= '<li><b><i class="fa fa-th-large"></i> '.$_lang["manage_htmlsnippets"].' ('.$chunkscounts.')</b></li>';
351 351
                         while ($row = $modx->db->getRow($rs)) {
352
-                            $output .= '<li' . addClassForItemList($row['locked'], $row['disabled']) . '><a href="index.php?a=78&id=' . $row['id'] . '" id="htmlsnippets_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['name'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>';
352
+                            $output .= '<li'.addClassForItemList($row['locked'], $row['disabled']).'><a href="index.php?a=78&id='.$row['id'].'" id="htmlsnippets_'.$row['id'].'" target="main">'.highlightingCoincidence($row['name'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>';
353 353
                         }
354 354
                     }
355 355
                 }
356 356
 
357 357
                 //Snippets
358 358
                 if ($modx->hasPermission('edit_snippet')) {
359
-                    $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_snippets'), "`id` like '%" . $searchfields . "%' 
360
-					OR `name` like '%" . $searchfields . "%' 
361
-					OR `description` like '%" . $searchfields . "%' 
362
-					OR `snippet` like '%" . $searchfields . "%'  
363
-					OR `properties` like '%" . $searchfields . "%'      
364
-					OR `moduleguid` like '%" . $searchfields . "%'");
359
+                    $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_snippets'), "`id` like '%".$searchfields."%' 
360
+					OR `name` like '%" . $searchfields."%' 
361
+					OR `description` like '%" . $searchfields."%' 
362
+					OR `snippet` like '%" . $searchfields."%'  
363
+					OR `properties` like '%" . $searchfields."%'      
364
+					OR `moduleguid` like '%" . $searchfields."%'");
365 365
                     $snippetscounts = $modx->db->getRecordCount($rs);
366 366
                     if ($snippetscounts > 0) {
367
-                        $output .= '<li><b><i class="fa fa-code"></i> ' . $_lang["manage_snippets"] . ' (' . $snippetscounts . ')</b></li>';
367
+                        $output .= '<li><b><i class="fa fa-code"></i> '.$_lang["manage_snippets"].' ('.$snippetscounts.')</b></li>';
368 368
                         while ($row = $modx->db->getRow($rs)) {
369
-                            $output .= '<li' . addClassForItemList($row['locked'], $row['disabled']) . '><a href="index.php?a=22&id=' . $row['id'] . '" id="snippets_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['name'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>';
369
+                            $output .= '<li'.addClassForItemList($row['locked'], $row['disabled']).'><a href="index.php?a=22&id='.$row['id'].'" id="snippets_'.$row['id'].'" target="main">'.highlightingCoincidence($row['name'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>';
370 370
                         }
371 371
                     }
372 372
                 }
373 373
 
374 374
                 //plugins
375 375
                 if ($modx->hasPermission('edit_plugin')) {
376
-                    $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_plugins'), "`id` like '%" . $searchfields . "%' 
377
-					OR `name` like '%" . $searchfields . "%' 
378
-					OR `description` like '%" . $searchfields . "%' 
379
-					OR `plugincode` like '%" . $searchfields . "%'  
380
-					OR `properties` like '%" . $searchfields . "%'      
381
-					OR `moduleguid` like '%" . $searchfields . "%'");
376
+                    $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_plugins'), "`id` like '%".$searchfields."%' 
377
+					OR `name` like '%" . $searchfields."%' 
378
+					OR `description` like '%" . $searchfields."%' 
379
+					OR `plugincode` like '%" . $searchfields."%'  
380
+					OR `properties` like '%" . $searchfields."%'      
381
+					OR `moduleguid` like '%" . $searchfields."%'");
382 382
                     $pluginscounts = $modx->db->getRecordCount($rs);
383 383
                     if ($pluginscounts > 0) {
384
-                        $output .= '<li><b><i class="fa fa-plug"></i> ' . $_lang["manage_plugins"] . ' (' . $pluginscounts . ')</b></li>';
384
+                        $output .= '<li><b><i class="fa fa-plug"></i> '.$_lang["manage_plugins"].' ('.$pluginscounts.')</b></li>';
385 385
                         while ($row = $modx->db->getRow($rs)) {
386
-                            $output .= '<li' . addClassForItemList($row['locked'], $row['disabled']) . '><a href="index.php?a=102&id=' . $row['id'] . '" id="plugins_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['name'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>';
386
+                            $output .= '<li'.addClassForItemList($row['locked'], $row['disabled']).'><a href="index.php?a=102&id='.$row['id'].'" id="plugins_'.$row['id'].'" target="main">'.highlightingCoincidence($row['name'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>';
387 387
                         }
388 388
                     }
389 389
                 }
390 390
 
391 391
                 //modules
392 392
                 if ($modx->hasPermission('edit_module')) {
393
-                    $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_modules'), "`id` like '%" . $searchfields . "%' 
394
-                    OR `name` like '%" . $searchfields . "%' 
395
-                    OR `description` like '%" . $searchfields . "%' 
396
-                    OR `modulecode` like '%" . $searchfields . "%'  
397
-                    OR `properties` like '%" . $searchfields . "%'  
398
-                    OR `guid` like '%" . $searchfields . "%'      
399
-                    OR `resourcefile` like '%" . $searchfields . "%'");
393
+                    $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_modules'), "`id` like '%".$searchfields."%' 
394
+                    OR `name` like '%" . $searchfields."%' 
395
+                    OR `description` like '%" . $searchfields."%' 
396
+                    OR `modulecode` like '%" . $searchfields."%'  
397
+                    OR `properties` like '%" . $searchfields."%'  
398
+                    OR `guid` like '%" . $searchfields."%'      
399
+                    OR `resourcefile` like '%" . $searchfields."%'");
400 400
                     $modulescounts = $modx->db->getRecordCount($rs);
401 401
                     if ($modulescounts > 0) {
402
-                        $output .= '<li><b><i class="fa fa-cogs"></i> ' . $_lang["modules"] . ' (' . $modulescounts . ')</b></li>';
402
+                        $output .= '<li><b><i class="fa fa-cogs"></i> '.$_lang["modules"].' ('.$modulescounts.')</b></li>';
403 403
                         while ($row = $modx->db->getRow($rs)) {
404
-                            $output .= '<li' . addClassForItemList($row['locked'], $row['disabled']) . '><a href="index.php?a=108&id=' . $row['id'] . '" id="modules_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['name'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>';
404
+                            $output .= '<li'.addClassForItemList($row['locked'], $row['disabled']).'><a href="index.php?a=108&id='.$row['id'].'" id="modules_'.$row['id'].'" target="main">'.highlightingCoincidence($row['name'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>';
405 405
                         }
406 406
                     }
407 407
                 }
408 408
 
409
-                echo $output ? '<div class="ajaxSearchResults"><ul>' . $output . '</ul></div>' : '1';
409
+                echo $output ? '<div class="ajaxSearchResults"><ul>'.$output.'</ul></div>' : '1';
410 410
             }
411 411
 
412 412
             ?>
Please login to merge, or discard this patch.
manager/actions/eventlog.dynamic.php 3 patches
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3
-	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
3
+    die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if(!$modx->hasPermission('view_eventlog')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 // Get table Names (alphabetical)
@@ -16,14 +16,14 @@  discard block
 block discarded – undo
16 16
 
17 17
 // get and save search string
18 18
 if($_REQUEST['op'] == 'reset') {
19
-	$sqlQuery = $query = '';
20
-	$_PAGE['vs']['search'] = '';
19
+    $sqlQuery = $query = '';
20
+    $_PAGE['vs']['search'] = '';
21 21
 } else {
22
-	$sqlQuery = $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search'];
23
-	if(!is_numeric($sqlQuery)) {
24
-		$sqlQuery = $modx->db->escape($query);
25
-	}
26
-	$_PAGE['vs']['search'] = $query;
22
+    $sqlQuery = $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search'];
23
+    if(!is_numeric($sqlQuery)) {
24
+        $sqlQuery = $modx->db->escape($query);
25
+    }
26
+    $_PAGE['vs']['search'] = $query;
27 27
 }
28 28
 
29 29
 // get & save listmode
@@ -125,33 +125,33 @@  discard block
 block discarded – undo
125 125
 			<div class="row">
126 126
 				<div class="table-responsive">
127 127
 					<?php
128
-					$ds = $modx->db->select("el.id, ELT(el.type , 'text-info {$_style['actions_info']}' , 'text-warning {$_style['actions_triangle']}' , 'text-danger {$_style['actions_error']}' ) as icon, el.createdon, el.source, el.eventid,IFNULL(wu.username,mu.username) as username", "{$tbl_event_log} AS el 
128
+                    $ds = $modx->db->select("el.id, ELT(el.type , 'text-info {$_style['actions_info']}' , 'text-warning {$_style['actions_triangle']}' , 'text-danger {$_style['actions_error']}' ) as icon, el.createdon, el.source, el.eventid,IFNULL(wu.username,mu.username) as username", "{$tbl_event_log} AS el 
129 129
 			LEFT JOIN {$tbl_manager_users} AS mu ON mu.id=el.user AND el.usertype=0
130 130
 			LEFT JOIN {$tbl_web_users} AS wu ON wu.id=el.user AND el.usertype=1", ($sqlQuery ? "" . (is_numeric($sqlQuery) ? "(eventid='{$sqlQuery}') OR " : '') . "(source LIKE '%{$sqlQuery}%') OR (description LIKE '%{$sqlQuery}%')" : ""), "createdon DESC");
131
-					include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php";
132
-					$grd = new DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items
133
-					$grd->pagerClass = '';
134
-					$grd->pageClass = 'page-item';
135
-					$grd->selPageClass = 'page-item active';
136
-					$grd->noRecordMsg = $_lang['no_records_found'];
137
-					$grd->cssClass = "table data nowrap";
138
-					$grd->columnHeaderClass = "tableHeader";
139
-					$grd->itemClass = "tableItem";
140
-					$grd->altItemClass = "tableAltItem";
141
-					$grd->fields = "type,source,createdon,eventid,username";
142
-					$grd->columns = $_lang['type'] . " ," . $_lang['source'] . " ," . $_lang['date'] . " ," . $_lang['event_id'] . " ," . $_lang['sysinfo_userid'];
143
-					$grd->colWidths = "1%,,1%,1%,1%";
144
-					$grd->colAligns = "center,,,center,center";
145
-					$grd->colTypes = "template:<a class='gridRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='" . $_lang['click_to_context'] . "'><i class='[+icon+]'></i></a>||template:<a href='index.php?a=115&id=[+id+]' title='" . $_lang['click_to_view_details'] . "'>[+source+]</a>||date: " . $modx->toDateFormat(null, 'formatOnly') . ' %I:%M %p';
146
-					if($listmode == '1') {
147
-						$grd->pageSize = 0;
148
-					}
149
-					if($_REQUEST['op'] == 'reset') {
150
-						$grd->pageNumber = 1;
151
-					}
152
-					// render grid
153
-					echo $grd->render();
154
-					?>
131
+                    include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php";
132
+                    $grd = new DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items
133
+                    $grd->pagerClass = '';
134
+                    $grd->pageClass = 'page-item';
135
+                    $grd->selPageClass = 'page-item active';
136
+                    $grd->noRecordMsg = $_lang['no_records_found'];
137
+                    $grd->cssClass = "table data nowrap";
138
+                    $grd->columnHeaderClass = "tableHeader";
139
+                    $grd->itemClass = "tableItem";
140
+                    $grd->altItemClass = "tableAltItem";
141
+                    $grd->fields = "type,source,createdon,eventid,username";
142
+                    $grd->columns = $_lang['type'] . " ," . $_lang['source'] . " ," . $_lang['date'] . " ," . $_lang['event_id'] . " ," . $_lang['sysinfo_userid'];
143
+                    $grd->colWidths = "1%,,1%,1%,1%";
144
+                    $grd->colAligns = "center,,,center,center";
145
+                    $grd->colTypes = "template:<a class='gridRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='" . $_lang['click_to_context'] . "'><i class='[+icon+]'></i></a>||template:<a href='index.php?a=115&id=[+id+]' title='" . $_lang['click_to_view_details'] . "'>[+source+]</a>||date: " . $modx->toDateFormat(null, 'formatOnly') . ' %I:%M %p';
146
+                    if($listmode == '1') {
147
+                        $grd->pageSize = 0;
148
+                    }
149
+                    if($_REQUEST['op'] == 'reset') {
150
+                        $grd->pageNumber = 1;
151
+                    }
152
+                    // render grid
153
+                    echo $grd->render();
154
+                    ?>
155 155
 				</div>
156 156
 			</div>
157 157
 		</div>
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  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('view_eventlog')) {
5
+if (!$modx->hasPermission('view_eventlog')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
@@ -15,12 +15,12 @@  discard block
 block discarded – undo
15 15
 $modx->manager->initPageViewState();
16 16
 
17 17
 // get and save search string
18
-if($_REQUEST['op'] == 'reset') {
18
+if ($_REQUEST['op'] == 'reset') {
19 19
 	$sqlQuery = $query = '';
20 20
 	$_PAGE['vs']['search'] = '';
21 21
 } else {
22 22
 	$sqlQuery = $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search'];
23
-	if(!is_numeric($sqlQuery)) {
23
+	if (!is_numeric($sqlQuery)) {
24 24
 		$sqlQuery = $modx->db->escape($query);
25 25
 	}
26 26
 	$_PAGE['vs']['search'] = $query;
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 $_PAGE['vs']['lm'] = $listmode;
32 32
 
33 33
 // context menu
34
-include_once MODX_MANAGER_PATH . "includes/controls/contextmenu.php";
34
+include_once MODX_MANAGER_PATH."includes/controls/contextmenu.php";
35 35
 $cm = new ContextMenu("cntxm", 150);
36 36
 $cm->addItem($_lang['view_log'], "js:menuAction(1)", $_style['actions_preview']);
37 37
 $cm->addSeparator();
@@ -127,8 +127,8 @@  discard block
 block discarded – undo
127 127
 					<?php
128 128
 					$ds = $modx->db->select("el.id, ELT(el.type , 'text-info {$_style['actions_info']}' , 'text-warning {$_style['actions_triangle']}' , 'text-danger {$_style['actions_error']}' ) as icon, el.createdon, el.source, el.eventid,IFNULL(wu.username,mu.username) as username", "{$tbl_event_log} AS el 
129 129
 			LEFT JOIN {$tbl_manager_users} AS mu ON mu.id=el.user AND el.usertype=0
130
-			LEFT JOIN {$tbl_web_users} AS wu ON wu.id=el.user AND el.usertype=1", ($sqlQuery ? "" . (is_numeric($sqlQuery) ? "(eventid='{$sqlQuery}') OR " : '') . "(source LIKE '%{$sqlQuery}%') OR (description LIKE '%{$sqlQuery}%')" : ""), "createdon DESC");
131
-					include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php";
130
+			LEFT JOIN {$tbl_web_users} AS wu ON wu.id=el.user AND el.usertype=1", ($sqlQuery ? "".(is_numeric($sqlQuery) ? "(eventid='{$sqlQuery}') OR " : '')."(source LIKE '%{$sqlQuery}%') OR (description LIKE '%{$sqlQuery}%')" : ""), "createdon DESC");
131
+					include_once MODX_MANAGER_PATH."includes/controls/datagrid.class.php";
132 132
 					$grd = new DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items
133 133
 					$grd->pagerClass = '';
134 134
 					$grd->pageClass = 'page-item';
@@ -139,14 +139,14 @@  discard block
 block discarded – undo
139 139
 					$grd->itemClass = "tableItem";
140 140
 					$grd->altItemClass = "tableAltItem";
141 141
 					$grd->fields = "type,source,createdon,eventid,username";
142
-					$grd->columns = $_lang['type'] . " ," . $_lang['source'] . " ," . $_lang['date'] . " ," . $_lang['event_id'] . " ," . $_lang['sysinfo_userid'];
142
+					$grd->columns = $_lang['type']." ,".$_lang['source']." ,".$_lang['date']." ,".$_lang['event_id']." ,".$_lang['sysinfo_userid'];
143 143
 					$grd->colWidths = "1%,,1%,1%,1%";
144 144
 					$grd->colAligns = "center,,,center,center";
145
-					$grd->colTypes = "template:<a class='gridRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='" . $_lang['click_to_context'] . "'><i class='[+icon+]'></i></a>||template:<a href='index.php?a=115&id=[+id+]' title='" . $_lang['click_to_view_details'] . "'>[+source+]</a>||date: " . $modx->toDateFormat(null, 'formatOnly') . ' %I:%M %p';
146
-					if($listmode == '1') {
145
+					$grd->colTypes = "template:<a class='gridRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='".$_lang['click_to_context']."'><i class='[+icon+]'></i></a>||template:<a href='index.php?a=115&id=[+id+]' title='".$_lang['click_to_view_details']."'>[+source+]</a>||date: ".$modx->toDateFormat(null, 'formatOnly').' %I:%M %p';
146
+					if ($listmode == '1') {
147 147
 						$grd->pageSize = 0;
148 148
 					}
149
-					if($_REQUEST['op'] == 'reset') {
149
+					if ($_REQUEST['op'] == 'reset') {
150 150
 						$grd->pageNumber = 1;
151 151
 					}
152 152
 					// render grid
Please login to merge, or discard this patch.
Braces   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  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('view_eventlog')) {
5
+if(!$modx->hasPermission('view_eventlog')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
@@ -15,12 +15,12 @@  discard block
 block discarded – undo
15 15
 $modx->manager->initPageViewState();
16 16
 
17 17
 // get and save search string
18
-if($_REQUEST['op'] == 'reset') {
18
+if($_REQUEST['op'] == 'reset') {
19 19
 	$sqlQuery = $query = '';
20 20
 	$_PAGE['vs']['search'] = '';
21
-} else {
21
+} else {
22 22
 	$sqlQuery = $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search'];
23
-	if(!is_numeric($sqlQuery)) {
23
+	if(!is_numeric($sqlQuery)) {
24 24
 		$sqlQuery = $modx->db->escape($query);
25 25
 	}
26 26
 	$_PAGE['vs']['search'] = $query;
@@ -143,10 +143,10 @@  discard block
 block discarded – undo
143 143
 					$grd->colWidths = "1%,,1%,1%,1%";
144 144
 					$grd->colAligns = "center,,,center,center";
145 145
 					$grd->colTypes = "template:<a class='gridRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='" . $_lang['click_to_context'] . "'><i class='[+icon+]'></i></a>||template:<a href='index.php?a=115&id=[+id+]' title='" . $_lang['click_to_view_details'] . "'>[+source+]</a>||date: " . $modx->toDateFormat(null, 'formatOnly') . ' %I:%M %p';
146
-					if($listmode == '1') {
146
+					if($listmode == '1') {
147 147
 						$grd->pageSize = 0;
148 148
 					}
149
-					if($_REQUEST['op'] == 'reset') {
149
+					if($_REQUEST['op'] == 'reset') {
150 150
 						$grd->pageNumber = 1;
151 151
 					}
152 152
 					// render grid
Please login to merge, or discard this patch.
manager/actions/mutate_web_user.dynamic.php 4 patches
Braces   +27 added lines, -22 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
 	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 
6
-switch($modx->manager->action) {
6
+switch($modx->manager->action) {
7 7
 	case 88:
8
-		if(!$modx->hasPermission('edit_web_user')) {
8
+		if(!$modx->hasPermission('edit_web_user')) {
9 9
 			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
10 10
 		}
11 11
 		break;
12 12
 	case 87:
13
-		if(!$modx->hasPermission('new_web_user')) {
13
+		if(!$modx->hasPermission('new_web_user')) {
14 14
 			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
15 15
 		}
16 16
 		break;
@@ -23,33 +23,35 @@  discard block
 block discarded – undo
23 23
 
24 24
 // check to see the snippet editor isn't locked
25 25
 $rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=88 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'");
26
-if($username = $modx->db->getValue($rs)) {
26
+if($username = $modx->db->getValue($rs)) {
27 27
 	$modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "web user"));
28 28
 }
29 29
 // end check for lock
30 30
 
31
-if($modx->manager->action == '88') {
31
+if($modx->manager->action == '88') {
32 32
 	// get user attributes
33 33
 	$rs = $modx->db->select('*', $modx->getFullTableName('web_user_attributes'), "internalKey = '{$user}'");
34 34
 	$userdata = $modx->db->getRow($rs);
35
-	if(!$userdata) {
35
+	if(!$userdata) {
36 36
 		$modx->webAlertAndQuit("No user returned!");
37 37
 	}
38 38
 
39 39
 	// get user settings
40 40
 	$rs = $modx->db->select('*', $modx->getFullTableName('web_user_settings'), "webuser = '{$user}'");
41 41
 	$usersettings = array();
42
-	while($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value'];
42
+	while($row = $modx->db->getRow($rs)) {
43
+	    $usersettings[$row['setting_name']] = $row['setting_value'];
44
+	}
43 45
 	extract($usersettings, EXTR_OVERWRITE);
44 46
 
45 47
 	// get user name
46 48
 	$rs = $modx->db->select('*', $modx->getFullTableName('web_users'), "id = '{$user}'");
47 49
 	$usernamedata = $modx->db->getRow($rs);
48
-	if(!$usernamedata) {
50
+	if(!$usernamedata) {
49 51
 		$modx->webAlertAndQuit("No user returned while getting username!");
50 52
 	}
51 53
 	$_SESSION['itemname'] = $usernamedata['username'];
52
-} else {
54
+} else {
53 55
 	$userdata = array();
54 56
 	$usersettings = array();
55 57
 	$usernamedata = array();
@@ -57,14 +59,14 @@  discard block
 block discarded – undo
57 59
 }
58 60
 
59 61
 // avoid doubling htmlspecialchars (already encoded in DB)
60
-foreach($userdata as $key => $val) {
62
+foreach($userdata as $key => $val) {
61 63
 	$userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']);
62 64
 };
63 65
 $usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']);
64 66
 
65 67
 // restore saved form
66 68
 $formRestored = false;
67
-if($modx->manager->hasFormValues()) {
69
+if($modx->manager->hasFormValues()) {
68 70
 	$modx->manager->loadFormValues();
69 71
 	// restore post values
70 72
 	$userdata = array_merge($userdata, $_POST);
@@ -78,9 +80,9 @@  discard block
 block discarded – undo
78 80
 
79 81
 // include the country list language file
80 82
 $_country_lang = array();
81
-if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) {
83
+if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) {
82 84
 	include_once "lang/country/" . $manager_language . "_country.inc.php";
83
-} else {
85
+} else {
84 86
 	include_once "lang/country/english_country.inc.php";
85 87
 }
86 88
 asort($_country_lang);
@@ -191,7 +193,7 @@  discard block
 block discarded – undo
191 193
 	<?php
192 194
 	// invoke OnWUsrFormPrerender event
193 195
 	$evtOut = $modx->invokeEvent("OnWUsrFormPrerender", array("id" => $user));
194
-	if(is_array($evtOut)) {
196
+	if(is_array($evtOut)) {
195 197
 		echo implode("", $evtOut);
196 198
 	}
197 199
 	?>
@@ -324,7 +326,7 @@  discard block
 block discarded – undo
324 326
 								<?php $chosenCountry = isset($_POST['country']) ? $_POST['country'] : $userdata['country']; ?>
325 327
 								<option value="" <?php (!isset($chosenCountry) ? ' selected' : '') ?> >&nbsp;</option>
326 328
 								<?php
327
-								foreach($_country_lang as $key => $country) {
329
+								foreach($_country_lang as $key => $country) {
328 330
 									echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>";
329 331
 								}
330 332
 								?>
@@ -496,17 +498,20 @@  discard block
 block discarded – undo
496 498
 				</table>
497 499
 			</div>
498 500
 			<?php
499
-			if($use_udperms == 1) {
501
+			if($use_udperms == 1) {
500 502
 
501 503
 			$groupsarray = array();
502 504
 
503
-			if($modx->manager->action == '88') { // only do this bit if the user is being edited
505
+			if($modx->manager->action == '88') {
506
+// only do this bit if the user is being edited
504 507
 				$rs = $modx->db->select('webgroup', $modx->getFullTableName('web_groups'), "webuser='{$user}'");
505 508
 				$groupsarray = $modx->db->getColumn('webgroup', $rs);
506 509
 			}
507 510
 			// retain selected user groups between post
508
-			if(is_array($_POST['user_groups'])) {
509
-				foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v;
511
+			if(is_array($_POST['user_groups'])) {
512
+				foreach($_POST['user_groups'] as $n => $v) {
513
+				    $groupsarray[] = $v;
514
+				}
510 515
 			}
511 516
 			?>
512 517
 			<div class="tab-page" id="tabPermissions">
@@ -515,7 +520,7 @@  discard block
 block discarded – undo
515 520
 				<p><?php echo $_lang['access_permissions_user_message'] ?></p>
516 521
 				<?php
517 522
 				$rs = $modx->db->select('name, id', $modx->getFullTableName('webgroup_names'), '', 'name');
518
-				while($row = $modx->db->getRow($rs)) {
523
+				while($row = $modx->db->getRow($rs)) {
519 524
 					echo '<label><input type="checkbox" name="user_groups[]" value="' . $row['id'] . '"' . (in_array($row['id'], $groupsarray) ? ' checked="checked"' : '') . ' />' . $row['name'] . '</label><br />';
520 525
 				}
521 526
 				}
@@ -526,7 +531,7 @@  discard block
 block discarded – undo
526 531
 			$evtOut = $modx->invokeEvent("OnWUsrFormRender", array(
527 532
 				"id" => $user
528 533
 			));
529
-			if(is_array($evtOut)) {
534
+			if(is_array($evtOut)) {
530 535
 				echo implode("", $evtOut);
531 536
 			}
532 537
 			?>
Please login to merge, or discard this patch.
Indentation   +89 added lines, -89 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->manager->action) {
7
-	case 88:
8
-		if(!$modx->hasPermission('edit_web_user')) {
9
-			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
10
-		}
11
-		break;
12
-	case 87:
13
-		if(!$modx->hasPermission('new_web_user')) {
14
-			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
15
-		}
16
-		break;
17
-	default:
18
-		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7
+    case 88:
8
+        if(!$modx->hasPermission('edit_web_user')) {
9
+            $modx->webAlertAndQuit($_lang["error_no_privileges"]);
10
+        }
11
+        break;
12
+    case 87:
13
+        if(!$modx->hasPermission('new_web_user')) {
14
+            $modx->webAlertAndQuit($_lang["error_no_privileges"]);
15
+        }
16
+        break;
17
+    default:
18
+        $modx->webAlertAndQuit($_lang["error_no_privileges"]);
19 19
 }
20 20
 
21 21
 $user = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
@@ -24,64 +24,64 @@  discard block
 block discarded – undo
24 24
 // check to see the snippet editor isn't locked
25 25
 $rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=88 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'");
26 26
 if($username = $modx->db->getValue($rs)) {
27
-	$modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "web user"));
27
+    $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "web user"));
28 28
 }
29 29
 // end check for lock
30 30
 
31 31
 if($modx->manager->action == '88') {
32
-	// get user attributes
33
-	$rs = $modx->db->select('*', $modx->getFullTableName('web_user_attributes'), "internalKey = '{$user}'");
34
-	$userdata = $modx->db->getRow($rs);
35
-	if(!$userdata) {
36
-		$modx->webAlertAndQuit("No user returned!");
37
-	}
38
-
39
-	// get user settings
40
-	$rs = $modx->db->select('*', $modx->getFullTableName('web_user_settings'), "webuser = '{$user}'");
41
-	$usersettings = array();
42
-	while($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value'];
43
-	extract($usersettings, EXTR_OVERWRITE);
44
-
45
-	// get user name
46
-	$rs = $modx->db->select('*', $modx->getFullTableName('web_users'), "id = '{$user}'");
47
-	$usernamedata = $modx->db->getRow($rs);
48
-	if(!$usernamedata) {
49
-		$modx->webAlertAndQuit("No user returned while getting username!");
50
-	}
51
-	$_SESSION['itemname'] = $usernamedata['username'];
32
+    // get user attributes
33
+    $rs = $modx->db->select('*', $modx->getFullTableName('web_user_attributes'), "internalKey = '{$user}'");
34
+    $userdata = $modx->db->getRow($rs);
35
+    if(!$userdata) {
36
+        $modx->webAlertAndQuit("No user returned!");
37
+    }
38
+
39
+    // get user settings
40
+    $rs = $modx->db->select('*', $modx->getFullTableName('web_user_settings'), "webuser = '{$user}'");
41
+    $usersettings = array();
42
+    while($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value'];
43
+    extract($usersettings, EXTR_OVERWRITE);
44
+
45
+    // get user name
46
+    $rs = $modx->db->select('*', $modx->getFullTableName('web_users'), "id = '{$user}'");
47
+    $usernamedata = $modx->db->getRow($rs);
48
+    if(!$usernamedata) {
49
+        $modx->webAlertAndQuit("No user returned while getting username!");
50
+    }
51
+    $_SESSION['itemname'] = $usernamedata['username'];
52 52
 } else {
53
-	$userdata = array();
54
-	$usersettings = array();
55
-	$usernamedata = array();
56
-	$_SESSION['itemname'] = $_lang["new_web_user"];
53
+    $userdata = array();
54
+    $usersettings = array();
55
+    $usernamedata = array();
56
+    $_SESSION['itemname'] = $_lang["new_web_user"];
57 57
 }
58 58
 
59 59
 // avoid doubling htmlspecialchars (already encoded in DB)
60 60
 foreach($userdata as $key => $val) {
61
-	$userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']);
61
+    $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']);
62 62
 };
63 63
 $usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']);
64 64
 
65 65
 // restore saved form
66 66
 $formRestored = false;
67 67
 if($modx->manager->hasFormValues()) {
68
-	$modx->manager->loadFormValues();
69
-	// restore post values
70
-	$userdata = array_merge($userdata, $_POST);
71
-	$userdata['dob'] = $modx->toTimeStamp($userdata['dob']);
72
-	$usernamedata['username'] = $userdata['newusername'];
73
-	$usernamedata['oldusername'] = $_POST['oldusername'];
74
-	$usersettings = array_merge($usersettings, $userdata);
75
-	$usersettings['allowed_days'] = is_array($_POST['allowed_days']) ? implode(",", $_POST['allowed_days']) : "";
76
-	extract($usersettings, EXTR_OVERWRITE);
68
+    $modx->manager->loadFormValues();
69
+    // restore post values
70
+    $userdata = array_merge($userdata, $_POST);
71
+    $userdata['dob'] = $modx->toTimeStamp($userdata['dob']);
72
+    $usernamedata['username'] = $userdata['newusername'];
73
+    $usernamedata['oldusername'] = $_POST['oldusername'];
74
+    $usersettings = array_merge($usersettings, $userdata);
75
+    $usersettings['allowed_days'] = is_array($_POST['allowed_days']) ? implode(",", $_POST['allowed_days']) : "";
76
+    extract($usersettings, EXTR_OVERWRITE);
77 77
 }
78 78
 
79 79
 // include the country list language file
80 80
 $_country_lang = array();
81 81
 if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) {
82
-	include_once "lang/country/" . $manager_language . "_country.inc.php";
82
+    include_once "lang/country/" . $manager_language . "_country.inc.php";
83 83
 } else {
84
-	include_once "lang/country/english_country.inc.php";
84
+    include_once "lang/country/english_country.inc.php";
85 85
 }
86 86
 asort($_country_lang);
87 87
 
@@ -189,12 +189,12 @@  discard block
 block discarded – undo
189 189
 
190 190
 <form action="index.php?a=89" method="post" name="userform">
191 191
 	<?php
192
-	// invoke OnWUsrFormPrerender event
193
-	$evtOut = $modx->invokeEvent("OnWUsrFormPrerender", array("id" => $user));
194
-	if(is_array($evtOut)) {
195
-		echo implode("", $evtOut);
196
-	}
197
-	?>
192
+    // invoke OnWUsrFormPrerender event
193
+    $evtOut = $modx->invokeEvent("OnWUsrFormPrerender", array("id" => $user));
194
+    if(is_array($evtOut)) {
195
+        echo implode("", $evtOut);
196
+    }
197
+    ?>
198 198
 	<input type="hidden" name="mode" value="<?php echo $modx->manager->action; ?>" />
199 199
 	<input type="hidden" name="id" value="<?php echo $user ?>" />
200 200
 	<input type="hidden" name="blockedmode" value="<?php echo ($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || ($userdata['blockedafter'] < time() && $userdata['blockedafter'] != 0) || $userdata['failedlogins'] > 3) ? "1" : "0" ?>" />
@@ -324,10 +324,10 @@  discard block
 block discarded – undo
324 324
 								<?php $chosenCountry = isset($_POST['country']) ? $_POST['country'] : $userdata['country']; ?>
325 325
 								<option value="" <?php (!isset($chosenCountry) ? ' selected' : '') ?> >&nbsp;</option>
326 326
 								<?php
327
-								foreach($_country_lang as $key => $country) {
328
-									echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>";
329
-								}
330
-								?>
327
+                                foreach($_country_lang as $key => $country) {
328
+                                    echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>";
329
+                                }
330
+                                ?>
331 331
 							</select></td>
332 332
 					</tr>
333 333
 					<tr>
@@ -387,8 +387,8 @@  discard block
 block discarded – undo
387 387
 								<i onClick="document.userform.blockedafter.value=''; return true;" class="clearDate <?php echo $_style["actions_calendar_delete"] ?>" data-tooltip="<?php echo $_lang['remove_date']; ?>"></i></td>
388 388
 						</tr>
389 389
 						<?php
390
-					}
391
-					?>
390
+                    }
391
+                    ?>
392 392
 				</table>
393 393
 			</div>
394 394
 
@@ -496,40 +496,40 @@  discard block
 block discarded – undo
496 496
 				</table>
497 497
 			</div>
498 498
 			<?php
499
-			if($use_udperms == 1) {
500
-
501
-			$groupsarray = array();
502
-
503
-			if($modx->manager->action == '88') { // only do this bit if the user is being edited
504
-				$rs = $modx->db->select('webgroup', $modx->getFullTableName('web_groups'), "webuser='{$user}'");
505
-				$groupsarray = $modx->db->getColumn('webgroup', $rs);
506
-			}
507
-			// retain selected user groups between post
508
-			if(is_array($_POST['user_groups'])) {
509
-				foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v;
510
-			}
511
-			?>
499
+            if($use_udperms == 1) {
500
+
501
+            $groupsarray = array();
502
+
503
+            if($modx->manager->action == '88') { // only do this bit if the user is being edited
504
+                $rs = $modx->db->select('webgroup', $modx->getFullTableName('web_groups'), "webuser='{$user}'");
505
+                $groupsarray = $modx->db->getColumn('webgroup', $rs);
506
+            }
507
+            // retain selected user groups between post
508
+            if(is_array($_POST['user_groups'])) {
509
+                foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v;
510
+            }
511
+            ?>
512 512
 			<div class="tab-page" id="tabPermissions">
513 513
 				<h2 class="tab"><?php echo $_lang['web_access_permissions'] ?></h2>
514 514
 				<script type="text/javascript">tpUser.addTabPage(document.getElementById("tabPermissions"));</script>
515 515
 				<p><?php echo $_lang['access_permissions_user_message'] ?></p>
516 516
 				<?php
517
-				$rs = $modx->db->select('name, id', $modx->getFullTableName('webgroup_names'), '', 'name');
518
-				while($row = $modx->db->getRow($rs)) {
519
-					echo '<label><input type="checkbox" name="user_groups[]" value="' . $row['id'] . '"' . (in_array($row['id'], $groupsarray) ? ' checked="checked"' : '') . ' />' . $row['name'] . '</label><br />';
520
-				}
521
-				}
522
-				?>
517
+                $rs = $modx->db->select('name, id', $modx->getFullTableName('webgroup_names'), '', 'name');
518
+                while($row = $modx->db->getRow($rs)) {
519
+                    echo '<label><input type="checkbox" name="user_groups[]" value="' . $row['id'] . '"' . (in_array($row['id'], $groupsarray) ? ' checked="checked"' : '') . ' />' . $row['name'] . '</label><br />';
520
+                }
521
+                }
522
+                ?>
523 523
 			</div>
524 524
 			<?php
525
-			// invoke OnWUsrFormRender event
526
-			$evtOut = $modx->invokeEvent("OnWUsrFormRender", array(
527
-				"id" => $user
528
-			));
529
-			if(is_array($evtOut)) {
530
-				echo implode("", $evtOut);
531
-			}
532
-			?>
525
+            // invoke OnWUsrFormRender event
526
+            $evtOut = $modx->invokeEvent("OnWUsrFormRender", array(
527
+                "id" => $user
528
+            ));
529
+            if(is_array($evtOut)) {
530
+                echo implode("", $evtOut);
531
+            }
532
+            ?>
533 533
 		</div>
534 534
 	</div>
535 535
 	<input type="submit" name="save" style="display:none">
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->manager->action) {
7
-	case 88:
8
-		if(!$modx->hasPermission('edit_web_user')) {
9
-			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
10
-		}
11
-		break;
12
-	case 87:
13
-		if(!$modx->hasPermission('new_web_user')) {
14
-			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
15
-		}
16
-		break;
17
-	default:
18
-		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7
+	    case 88:
8
+		    if(!$modx->hasPermission('edit_web_user')) {
9
+			    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
10
+		    }
11
+		    break;
12
+	    case 87:
13
+		    if(!$modx->hasPermission('new_web_user')) {
14
+			    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
15
+		    }
16
+		    break;
17
+	    default:
18
+		    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
19 19
 }
20 20
 
21 21
 $user = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
Please login to merge, or discard this patch.
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
 	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 
6
-switch($modx->manager->action) {
6
+switch ($modx->manager->action) {
7 7
 	case 88:
8
-		if(!$modx->hasPermission('edit_web_user')) {
8
+		if (!$modx->hasPermission('edit_web_user')) {
9 9
 			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
10 10
 		}
11 11
 		break;
12 12
 	case 87:
13
-		if(!$modx->hasPermission('new_web_user')) {
13
+		if (!$modx->hasPermission('new_web_user')) {
14 14
 			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
15 15
 		}
16 16
 		break;
@@ -18,34 +18,34 @@  discard block
 block discarded – undo
18 18
 		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
19 19
 }
20 20
 
21
-$user = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
21
+$user = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0;
22 22
 
23 23
 
24 24
 // check to see the snippet editor isn't locked
25
-$rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=88 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'");
26
-if($username = $modx->db->getValue($rs)) {
25
+$rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=88 AND id='{$user}' AND internalKey!='".$modx->getLoginUserID()."'");
26
+if ($username = $modx->db->getValue($rs)) {
27 27
 	$modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "web user"));
28 28
 }
29 29
 // end check for lock
30 30
 
31
-if($modx->manager->action == '88') {
31
+if ($modx->manager->action == '88') {
32 32
 	// get user attributes
33 33
 	$rs = $modx->db->select('*', $modx->getFullTableName('web_user_attributes'), "internalKey = '{$user}'");
34 34
 	$userdata = $modx->db->getRow($rs);
35
-	if(!$userdata) {
35
+	if (!$userdata) {
36 36
 		$modx->webAlertAndQuit("No user returned!");
37 37
 	}
38 38
 
39 39
 	// get user settings
40 40
 	$rs = $modx->db->select('*', $modx->getFullTableName('web_user_settings'), "webuser = '{$user}'");
41 41
 	$usersettings = array();
42
-	while($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value'];
42
+	while ($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value'];
43 43
 	extract($usersettings, EXTR_OVERWRITE);
44 44
 
45 45
 	// get user name
46 46
 	$rs = $modx->db->select('*', $modx->getFullTableName('web_users'), "id = '{$user}'");
47 47
 	$usernamedata = $modx->db->getRow($rs);
48
-	if(!$usernamedata) {
48
+	if (!$usernamedata) {
49 49
 		$modx->webAlertAndQuit("No user returned while getting username!");
50 50
 	}
51 51
 	$_SESSION['itemname'] = $usernamedata['username'];
@@ -57,14 +57,14 @@  discard block
 block discarded – undo
57 57
 }
58 58
 
59 59
 // avoid doubling htmlspecialchars (already encoded in DB)
60
-foreach($userdata as $key => $val) {
60
+foreach ($userdata as $key => $val) {
61 61
 	$userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']);
62 62
 };
63 63
 $usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']);
64 64
 
65 65
 // restore saved form
66 66
 $formRestored = false;
67
-if($modx->manager->hasFormValues()) {
67
+if ($modx->manager->hasFormValues()) {
68 68
 	$modx->manager->loadFormValues();
69 69
 	// restore post values
70 70
 	$userdata = array_merge($userdata, $_POST);
@@ -78,8 +78,8 @@  discard block
 block discarded – undo
78 78
 
79 79
 // include the country list language file
80 80
 $_country_lang = array();
81
-if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) {
82
-	include_once "lang/country/" . $manager_language . "_country.inc.php";
81
+if ($manager_language != "english" && file_exists($modx->config['site_manager_path']."includes/lang/country/".$manager_language."_country.inc.php")) {
82
+	include_once "lang/country/".$manager_language."_country.inc.php";
83 83
 } else {
84 84
 	include_once "lang/country/english_country.inc.php";
85 85
 }
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 	<?php
192 192
 	// invoke OnWUsrFormPrerender event
193 193
 	$evtOut = $modx->invokeEvent("OnWUsrFormPrerender", array("id" => $user));
194
-	if(is_array($evtOut)) {
194
+	if (is_array($evtOut)) {
195 195
 		echo implode("", $evtOut);
196 196
 	}
197 197
 	?>
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 	<input type="hidden" name="blockedmode" value="<?php echo ($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || ($userdata['blockedafter'] < time() && $userdata['blockedafter'] != 0) || $userdata['failedlogins'] > 3) ? "1" : "0" ?>" />
201 201
 
202 202
 	<h1>
203
-        <i class="fa fa fa-users"></i><?= ($usernamedata['username'] ? $usernamedata['username'] . '<small>(' . $usernamedata['id'] . ')</small>' : $_lang['web_user_title']) ?>
203
+        <i class="fa fa fa-users"></i><?= ($usernamedata['username'] ? $usernamedata['username'].'<small>('.$usernamedata['id'].')</small>' : $_lang['web_user_title']) ?>
204 204
     </h1>
205 205
 
206 206
 	<?php echo $_style['actionbuttons']['dynamic']['user'] ?>
@@ -218,13 +218,13 @@  discard block
 block discarded – undo
218 218
 				<table border="0" cellspacing="0" cellpadding="3" class="table table--edit table--editUser">
219 219
 					<tr>
220 220
 						<td colspan="3"><span id="blocked" class="warning">
221
-							<?php if($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || ($userdata['blockedafter'] < time() && $userdata['blockedafter'] != 0) || $userdata['failedlogins'] > 3) { ?>
221
+							<?php if ($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || ($userdata['blockedafter'] < time() && $userdata['blockedafter'] != 0) || $userdata['failedlogins'] > 3) { ?>
222 222
 								<b><?php echo $_lang['user_is_blocked']; ?></b>
223 223
 							<?php } ?>
224 224
 							</span>
225 225
 							<br /></td>
226 226
 					</tr>
227
-					<?php if(!empty($userdata['id'])) { ?>
227
+					<?php if (!empty($userdata['id'])) { ?>
228 228
 						<tr id="showname" style="display: <?php echo ($modx->manager->action == '88' && (!isset($usernamedata['oldusername']) || $usernamedata['oldusername'] == $usernamedata['username'])) ? $displayStyle : 'none'; ?> ">
229 229
 							<td colspan="3"><i class="<?php echo $_style["icons_user"] ?>"></i>&nbsp;<b><?php echo $modx->htmlspecialchars(!empty($usernamedata['oldusername']) ? $usernamedata['oldusername'] : $usernamedata['username']); ?></b> - <span class="comment"><a href="javascript:;" onClick="changeName();return false;"><?php echo $_lang["change_name"]; ?></a></span>
230 230
 								<input type="hidden" name="oldusername" value="<?php echo $modx->htmlspecialchars(!empty($usernamedata['oldusername']) ? $usernamedata['oldusername'] : $usernamedata['username']); ?>" />
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
 						<td><input type="text" name="newusername" class="inputBox" value="<?php echo $modx->htmlspecialchars(isset($_POST['newusername']) ? $_POST['newusername'] : $usernamedata['username']); ?>" onChange='documentDirty=true;' maxlength="100" /></td>
238 238
 					</tr>
239 239
 					<tr>
240
-						<th><?php echo $modx->manager->action == '87' ? $_lang['password'] . ":" : $_lang['change_password_new'] . ":"; ?></th>
240
+						<th><?php echo $modx->manager->action == '87' ? $_lang['password'].":" : $_lang['change_password_new'].":"; ?></th>
241 241
 						<td>&nbsp;</td>
242 242
 						<td><input name="newpasswordcheck" type="checkbox" onClick="changestate(document.userform.newpassword);changePasswordState(document.userform.newpassword);"<?php echo $modx->manager->action == "87" ? " checked disabled" : ""; ?>>
243 243
 							<input type="hidden" name="newpassword" value="<?php echo $modx->manager->action == "87" ? 1 : 0; ?>" onChange="documentDirty=true;" />
@@ -324,8 +324,8 @@  discard block
 block discarded – undo
324 324
 								<?php $chosenCountry = isset($_POST['country']) ? $_POST['country'] : $userdata['country']; ?>
325 325
 								<option value="" <?php (!isset($chosenCountry) ? ' selected' : '') ?> >&nbsp;</option>
326 326
 								<?php
327
-								foreach($_country_lang as $key => $country) {
328
-									echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>";
327
+								foreach ($_country_lang as $key => $country) {
328
+									echo "<option value=\"$key\"".(isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '').">$country</option>";
329 329
 								}
330 330
 								?>
331 331
 							</select></td>
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
 						<td>&nbsp;</td>
352 352
 						<td><textarea type="text" name="comment" class="inputBox" rows="5" onChange="documentDirty=true;"><?php echo $modx->htmlspecialchars(isset($_POST['comment']) ? $_POST['comment'] : $userdata['comment']); ?></textarea></td>
353 353
 					</tr>
354
-					<?php if($modx->manager->action == '88') { ?>
354
+					<?php if ($modx->manager->action == '88') { ?>
355 355
 						<tr>
356 356
 							<th><?php echo $_lang['user_logincount']; ?>:</th>
357 357
 							<td>&nbsp;</td>
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
 					function BrowseServer() {
473 473
 						var w = screen.width * 0.7;
474 474
 						var h = screen.height * 0.7;
475
-						OpenServerBrowser("<?php echo MODX_MANAGER_URL;?>media/browser/<?php echo $which_browser;?>/browser.php?Type=images", w, h);
475
+						OpenServerBrowser("<?php echo MODX_MANAGER_URL; ?>media/browser/<?php echo $which_browser; ?>/browser.php?Type=images", w, h);
476 476
 					}
477 477
 
478 478
 					function SetUrl(url, width, height, alt) {
@@ -491,22 +491,22 @@  discard block
 block discarded – undo
491 491
 						<td class='comment'><?php echo $_lang["user_photo_message"] ?></td>
492 492
 					</tr>
493 493
 					<tr>
494
-						<td colspan="2" align="center"><img name="iphoto" src="<?php echo isset($_POST['photo']) ? (strpos($_POST['photo'], "http://") === false ? MODX_SITE_URL : "") . $_POST['photo'] : !empty($userdata['photo']) ? (strpos($userdata['photo'], "http://") === false ? MODX_SITE_URL : "") . $userdata['photo'] : $_style["tx"]; ?>" /></td>
494
+						<td colspan="2" align="center"><img name="iphoto" src="<?php echo isset($_POST['photo']) ? (strpos($_POST['photo'], "http://") === false ? MODX_SITE_URL : "").$_POST['photo'] : !empty($userdata['photo']) ? (strpos($userdata['photo'], "http://") === false ? MODX_SITE_URL : "").$userdata['photo'] : $_style["tx"]; ?>" /></td>
495 495
 					</tr>
496 496
 				</table>
497 497
 			</div>
498 498
 			<?php
499
-			if($use_udperms == 1) {
499
+			if ($use_udperms == 1) {
500 500
 
501 501
 			$groupsarray = array();
502 502
 
503
-			if($modx->manager->action == '88') { // only do this bit if the user is being edited
503
+			if ($modx->manager->action == '88') { // only do this bit if the user is being edited
504 504
 				$rs = $modx->db->select('webgroup', $modx->getFullTableName('web_groups'), "webuser='{$user}'");
505 505
 				$groupsarray = $modx->db->getColumn('webgroup', $rs);
506 506
 			}
507 507
 			// retain selected user groups between post
508
-			if(is_array($_POST['user_groups'])) {
509
-				foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v;
508
+			if (is_array($_POST['user_groups'])) {
509
+				foreach ($_POST['user_groups'] as $n => $v) $groupsarray[] = $v;
510 510
 			}
511 511
 			?>
512 512
 			<div class="tab-page" id="tabPermissions">
@@ -515,8 +515,8 @@  discard block
 block discarded – undo
515 515
 				<p><?php echo $_lang['access_permissions_user_message'] ?></p>
516 516
 				<?php
517 517
 				$rs = $modx->db->select('name, id', $modx->getFullTableName('webgroup_names'), '', 'name');
518
-				while($row = $modx->db->getRow($rs)) {
519
-					echo '<label><input type="checkbox" name="user_groups[]" value="' . $row['id'] . '"' . (in_array($row['id'], $groupsarray) ? ' checked="checked"' : '') . ' />' . $row['name'] . '</label><br />';
518
+				while ($row = $modx->db->getRow($rs)) {
519
+					echo '<label><input type="checkbox" name="user_groups[]" value="'.$row['id'].'"'.(in_array($row['id'], $groupsarray) ? ' checked="checked"' : '').' />'.$row['name'].'</label><br />';
520 520
 				}
521 521
 				}
522 522
 				?>
@@ -526,7 +526,7 @@  discard block
 block discarded – undo
526 526
 			$evtOut = $modx->invokeEvent("OnWUsrFormRender", array(
527 527
 				"id" => $user
528 528
 			));
529
-			if(is_array($evtOut)) {
529
+			if (is_array($evtOut)) {
530 530
 				echo implode("", $evtOut);
531 531
 			}
532 532
 			?>
Please login to merge, or discard this patch.
manager/actions/category_mgr/inc/request_trigger.inc.php 3 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 
22 22
             if( $uncategorized_elements = $cm->getAssignedElements( 0, $_data['elements'] ) )
23 23
             {
24
-               $output .= $cm->renderView('chunks/categorize/uncategorized_elements', $uncategorized_elements);
24
+                $output .= $cm->renderView('chunks/categorize/uncategorized_elements', $uncategorized_elements);
25 25
             }
26 26
 
27 27
             foreach( $cm->getCategories() as $category )
@@ -106,14 +106,14 @@  discard block
 block discarded – undo
106 106
 
107 107
     if( empty( $category ) )
108 108
     {
109
-       $cm->addMessage( $cm->txt('cm_enter_name_for_category'), 'add' );
110
-       return;
109
+        $cm->addMessage( $cm->txt('cm_enter_name_for_category'), 'add' );
110
+        return;
111 111
     }
112 112
 
113 113
     if( $cm->isCategoryExists( $category ) )
114 114
     {
115
-       $cm->addMessage( sprintf( $cm->txt('cm_category_x_exists'), $category ), 'add' );
116
-       return;
115
+        $cm->addMessage( sprintf( $cm->txt('cm_category_x_exists'), $category ), 'add' );
116
+        return;
117 117
     }
118 118
 
119 119
     if( $cm->addCategory( $category, $rank ) !== 0 )
Please login to merge, or discard this patch.
Spacing   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -2,16 +2,16 @@  discard block
 block discarded – undo
2 2
 /**
3 3
  * Ajax Requests
4 4
  */
5
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
5
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
6 6
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
7 7
 }
8 8
 
9
-if( isset( $_REQUEST[$cm->get('request_key')]['ajax'] ) )
9
+if (isset($_REQUEST[$cm->get('request_key')]['ajax']))
10 10
 {
11 11
     $_data  = $_REQUEST[$cm->get('request_key')];
12 12
     $output = '';
13 13
     $task   = $_data['task'];
14
-    switch( $task )
14
+    switch ($task)
15 15
     {
16 16
         /**
17 17
          * get categories
@@ -19,19 +19,19 @@  discard block
 block discarded – undo
19 19
         case 'categorize_load_elements':
20 20
             $elements = $_data['elements'];
21 21
 
22
-            if( $uncategorized_elements = $cm->getAssignedElements( 0, $_data['elements'] ) )
22
+            if ($uncategorized_elements = $cm->getAssignedElements(0, $_data['elements']))
23 23
             {
24 24
                $output .= $cm->renderView('chunks/categorize/uncategorized_elements', $uncategorized_elements);
25 25
             }
26 26
 
27
-            foreach( $cm->getCategories() as $category )
27
+            foreach ($cm->getCategories() as $category)
28 28
             {
29
-                $category['elements'] = $cm->getAssignedElements( $category['id'], $_data['elements'] );
29
+                $category['elements'] = $cm->getAssignedElements($category['id'], $_data['elements']);
30 30
                 $output .= $cm->renderView('chunks/categorize/category', $category);
31 31
             }
32 32
             break;
33 33
     }
34
-    exit( $output );
34
+    exit($output);
35 35
 }
36 36
 /**
37 37
  * Categorize elements
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
  * @see http://modxcms.com/forums/index.php/topic,40430.msg251476.html#msg251476
42 42
  *
43 43
  */
44
-if( isset( $_POST[$cm->get('request_key')]['categorize']['submit'] ) )
44
+if (isset($_POST[$cm->get('request_key')]['categorize']['submit']))
45 45
 {
46 46
     $_data = $_POST[$cm->get('request_key')]['categorize'];
47 47
     $_changes = 0;
@@ -54,15 +54,15 @@  discard block
 block discarded – undo
54 54
         'categorize'
55 55
     );
56 56
 
57
-    if( !isset( $_data['elements'] ) )
57
+    if (!isset($_data['elements']))
58 58
     {
59
-        $cm->addMessage( $cm->txt('cm_unknown_error'), 'categorize' );
59
+        $cm->addMessage($cm->txt('cm_unknown_error'), 'categorize');
60 60
         return;
61 61
     }
62 62
 
63
-    foreach( $_data['elements'] as $element_id => $data )
63
+    foreach ($_data['elements'] as $element_id => $data)
64 64
     {
65
-        if( $cm->updateElement( $_data['elementsgroup'], $element_id, $data['category_id'] ) )
65
+        if ($cm->updateElement($_data['elementsgroup'], $element_id, $data['category_id']))
66 66
         {
67 67
             $cm->addMessage(
68 68
                 sprintf(
@@ -78,9 +78,9 @@  discard block
 block discarded – undo
78 78
         }
79 79
     }
80 80
 
81
-    if( $_changes === 0 )
81
+    if ($_changes === 0)
82 82
     {
83
-        $cm->addMessage( $cm->txt('cm_no_categorization'), 'categorize' );
83
+        $cm->addMessage($cm->txt('cm_no_categorization'), 'categorize');
84 84
         return;
85 85
     }
86 86
     else
@@ -98,29 +98,29 @@  discard block
 block discarded – undo
98 98
 /**
99 99
  * Add a new category
100 100
  */
101
-if( isset( $_POST[$cm->get('request_key')]['add']['submit'] ) )
101
+if (isset($_POST[$cm->get('request_key')]['add']['submit']))
102 102
 {
103 103
     $_data    = $_POST[$cm->get('request_key')]['add']['data'];
104
-    $category = trim( html_entity_decode($_data['name']) );
104
+    $category = trim(html_entity_decode($_data['name']));
105 105
     $rank     = (int) $_data['rank'];
106 106
 
107
-    if( empty( $category ) )
107
+    if (empty($category))
108 108
     {
109
-       $cm->addMessage( $cm->txt('cm_enter_name_for_category'), 'add' );
109
+       $cm->addMessage($cm->txt('cm_enter_name_for_category'), 'add');
110 110
        return;
111 111
     }
112 112
 
113
-    if( $cm->isCategoryExists( $category ) )
113
+    if ($cm->isCategoryExists($category))
114 114
     {
115
-       $cm->addMessage( sprintf( $cm->txt('cm_category_x_exists'), $category ), 'add' );
115
+       $cm->addMessage(sprintf($cm->txt('cm_category_x_exists'), $category), 'add');
116 116
        return;
117 117
     }
118 118
 
119
-    if( $cm->addCategory( $category, $rank ) !== 0 )
119
+    if ($cm->addCategory($category, $rank) !== 0)
120 120
     {
121 121
         $cm->addMessage(
122 122
             sprintf(
123
-                $cm->txt( 'cm_category_x_saved_at_position_y' ),
123
+                $cm->txt('cm_category_x_saved_at_position_y'),
124 124
                 $category,
125 125
                 $rank
126 126
             ),
@@ -129,26 +129,26 @@  discard block
 block discarded – undo
129 129
     }
130 130
     else
131 131
     {
132
-        $cm->addMessage( $cm->txt('cm_unknown_error'), 'add' );
132
+        $cm->addMessage($cm->txt('cm_unknown_error'), 'add');
133 133
     }
134 134
 }
135 135
 
136 136
 /**
137 137
  * Sort categories
138 138
  */
139
-if( isset( $_POST[$cm->get('request_key')]['sort']['submit'] ) )
139
+if (isset($_POST[$cm->get('request_key')]['sort']['submit']))
140 140
 {
141 141
     $categories = $_POST[$cm->get('request_key')]['sort']['data'];
142 142
     $_changes   = 0;
143 143
 
144
-    foreach( $categories as $category_id => $_data  )
144
+    foreach ($categories as $category_id => $_data)
145 145
     {
146 146
         $data = array(
147
-            'category' => urldecode( $_data['category'] ),
147
+            'category' => urldecode($_data['category']),
148 148
             'rank'     => $_data['rank']
149 149
         );
150 150
 
151
-        if( $cm->updateCategory( $category_id, $data ) )
151
+        if ($cm->updateCategory($category_id, $data))
152 152
         {
153 153
             $cm->addMessage(
154 154
                 sprintf(
@@ -162,9 +162,9 @@  discard block
 block discarded – undo
162 162
         }
163 163
     }
164 164
 
165
-    if( $_changes === 0 )
165
+    if ($_changes === 0)
166 166
     {
167
-        $cm->addMessage( $cm->txt( 'cm_no_changes' ), 'sort');
167
+        $cm->addMessage($cm->txt('cm_no_changes'), 'sort');
168 168
     }
169 169
     else
170 170
     {
@@ -181,21 +181,21 @@  discard block
 block discarded – undo
181 181
 /**
182 182
  * Edit categories
183 183
  */
184
-if( isset( $_POST[$cm->get('request_key')]['edit']['submit'] ) )
184
+if (isset($_POST[$cm->get('request_key')]['edit']['submit']))
185 185
 {
186 186
     $categories = $_POST[$cm->get('request_key')]['edit']['data'];
187 187
     $_changes   = 0;
188 188
 
189
-    foreach( $categories as $category_id => $_data  )
189
+    foreach ($categories as $category_id => $_data)
190 190
     {
191
-        if( isset( $_data['delete'] ) )
191
+        if (isset($_data['delete']))
192 192
         {
193
-            if( $cm->deleteCategory( $category_id ) )
193
+            if ($cm->deleteCategory($category_id))
194 194
             {
195 195
                 $cm->addMessage(
196 196
                     sprintf(
197 197
                         $cm->txt('cm_category_x_deleted'),
198
-                        urldecode( $_data['origin'] )
198
+                        urldecode($_data['origin'])
199 199
                     ),
200 200
                     'edit'
201 201
                 );
@@ -205,16 +205,16 @@  discard block
 block discarded – undo
205 205
         }
206 206
 
207 207
         $data = array(
208
-            'category' => trim( html_entity_decode( $_data['category'] ) ),
208
+            'category' => trim(html_entity_decode($_data['category'])),
209 209
             'rank'     => $_data['rank']
210 210
         );
211 211
 
212
-        if( $cm->updateCategory( $category_id, $data ) )
212
+        if ($cm->updateCategory($category_id, $data))
213 213
         {
214 214
             $cm->addMessage(
215 215
                 sprintf(
216 216
                     $cm->txt('cm_category_x_renamed_to_y'),
217
-                    urldecode( $_data['origin'] ),
217
+                    urldecode($_data['origin']),
218 218
                     $data['category']
219 219
                 ),
220 220
                 'edit'
@@ -223,26 +223,26 @@  discard block
 block discarded – undo
223 223
         }
224 224
     }
225 225
 
226
-    if( $_changes === 0 )
226
+    if ($_changes === 0)
227 227
     {
228
-        $cm->addMessage( $cm->txt( 'cm_no_changes' ), 'edit');
228
+        $cm->addMessage($cm->txt('cm_no_changes'), 'edit');
229 229
     }
230 230
 }
231 231
 
232 232
 /**
233 233
  * Delete singel category by $_GET
234 234
  */
235
-if( isset( $_GET[$cm->get('request_key')]['delete'] )
236
-    && !empty( $_GET[$cm->get('request_key')]['delete'] ) )
235
+if (isset($_GET[$cm->get('request_key')]['delete'])
236
+    && !empty($_GET[$cm->get('request_key')]['delete']))
237 237
 {
238
-    $category_id = (int)$_GET[$cm->get('request_key')]['delete'];
238
+    $category_id = (int) $_GET[$cm->get('request_key')]['delete'];
239 239
 
240
-    if( $cm->deleteCategory( $category_id ) )
240
+    if ($cm->deleteCategory($category_id))
241 241
     {
242 242
         $cm->addMessage(
243 243
             sprintf(
244 244
                 $cm->txt('cm_category_x_deleted'),
245
-                urldecode( $_GET[$cm->get('request_key')]['category'] )
245
+                urldecode($_GET[$cm->get('request_key')]['category'])
246 246
             ),
247 247
             'edit'
248 248
         );
@@ -251,15 +251,15 @@  discard block
 block discarded – undo
251 251
 /**
252 252
  * Translate phrases
253 253
  */
254
-if( isset( $_POST[$cm->get('request_key')]['translate']['submit'] ) )
254
+if (isset($_POST[$cm->get('request_key')]['translate']['submit']))
255 255
 {
256 256
     $translations = $_POST[$cm->get('request_key')]['translate']['data'];
257 257
 
258
-    foreach( $translations as $native_phrase => $translation )
258
+    foreach ($translations as $native_phrase => $translation)
259 259
     {
260
-        $native_phrase = urldecode( $native_phrase );
260
+        $native_phrase = urldecode($native_phrase);
261 261
 
262
-        if( empty( $translation ) )
262
+        if (empty($translation))
263 263
         {
264 264
             $translation = $native_phrase;
265 265
 
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
             );
273 273
         }
274 274
 
275
-        $cm->c('Translator')->addTranslation( $native_phrase, $translation, 'phrase' );
275
+        $cm->c('Translator')->addTranslation($native_phrase, $translation, 'phrase');
276 276
 
277 277
         $cm->addMessage(
278 278
             sprintf(
Please login to merge, or discard this patch.
Braces   +31 added lines, -65 removed lines patch added patch discarded remove patch
@@ -6,26 +6,22 @@  discard block
 block discarded – undo
6 6
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
7 7
 }
8 8
 
9
-if( isset( $_REQUEST[$cm->get('request_key')]['ajax'] ) )
10
-{
9
+if( isset( $_REQUEST[$cm->get('request_key')]['ajax'] ) ) {
11 10
     $_data  = $_REQUEST[$cm->get('request_key')];
12 11
     $output = '';
13 12
     $task   = $_data['task'];
14
-    switch( $task )
15
-    {
13
+    switch( $task ) {
16 14
         /**
17 15
          * get categories
18 16
          */
19 17
         case 'categorize_load_elements':
20 18
             $elements = $_data['elements'];
21 19
 
22
-            if( $uncategorized_elements = $cm->getAssignedElements( 0, $_data['elements'] ) )
23
-            {
20
+            if( $uncategorized_elements = $cm->getAssignedElements( 0, $_data['elements'] ) ) {
24 21
                $output .= $cm->renderView('chunks/categorize/uncategorized_elements', $uncategorized_elements);
25 22
             }
26 23
 
27
-            foreach( $cm->getCategories() as $category )
28
-            {
24
+            foreach( $cm->getCategories() as $category ) {
29 25
                 $category['elements'] = $cm->getAssignedElements( $category['id'], $_data['elements'] );
30 26
                 $output .= $cm->renderView('chunks/categorize/category', $category);
31 27
             }
@@ -41,8 +37,7 @@  discard block
 block discarded – undo
41 37
  * @see http://modxcms.com/forums/index.php/topic,40430.msg251476.html#msg251476
42 38
  *
43 39
  */
44
-if( isset( $_POST[$cm->get('request_key')]['categorize']['submit'] ) )
45
-{
40
+if( isset( $_POST[$cm->get('request_key')]['categorize']['submit'] ) ) {
46 41
     $_data = $_POST[$cm->get('request_key')]['categorize'];
47 42
     $_changes = 0;
48 43
 
@@ -54,16 +49,13 @@  discard block
 block discarded – undo
54 49
         'categorize'
55 50
     );
56 51
 
57
-    if( !isset( $_data['elements'] ) )
58
-    {
52
+    if( !isset( $_data['elements'] ) ) {
59 53
         $cm->addMessage( $cm->txt('cm_unknown_error'), 'categorize' );
60 54
         return;
61 55
     }
62 56
 
63
-    foreach( $_data['elements'] as $element_id => $data )
64
-    {
65
-        if( $cm->updateElement( $_data['elementsgroup'], $element_id, $data['category_id'] ) )
66
-        {
57
+    foreach( $_data['elements'] as $element_id => $data ) {
58
+        if( $cm->updateElement( $_data['elementsgroup'], $element_id, $data['category_id'] ) ) {
67 59
             $cm->addMessage(
68 60
                 sprintf(
69 61
                     $cm->txt('cm_x_assigned_to_category_y'),
@@ -78,13 +70,10 @@  discard block
 block discarded – undo
78 70
         }
79 71
     }
80 72
 
81
-    if( $_changes === 0 )
82
-    {
73
+    if( $_changes === 0 ) {
83 74
         $cm->addMessage( $cm->txt('cm_no_categorization'), 'categorize' );
84 75
         return;
85
-    }
86
-    else
87
-    {
76
+    } else {
88 77
         $cm->addMessage(
89 78
             sprintf(
90 79
                 $cm->txt('cm_x_changes_made'),
@@ -98,26 +87,22 @@  discard block
 block discarded – undo
98 87
 /**
99 88
  * Add a new category
100 89
  */
101
-if( isset( $_POST[$cm->get('request_key')]['add']['submit'] ) )
102
-{
90
+if( isset( $_POST[$cm->get('request_key')]['add']['submit'] ) ) {
103 91
     $_data    = $_POST[$cm->get('request_key')]['add']['data'];
104 92
     $category = trim( html_entity_decode($_data['name']) );
105 93
     $rank     = (int) $_data['rank'];
106 94
 
107
-    if( empty( $category ) )
108
-    {
95
+    if( empty( $category ) ) {
109 96
        $cm->addMessage( $cm->txt('cm_enter_name_for_category'), 'add' );
110 97
        return;
111 98
     }
112 99
 
113
-    if( $cm->isCategoryExists( $category ) )
114
-    {
100
+    if( $cm->isCategoryExists( $category ) ) {
115 101
        $cm->addMessage( sprintf( $cm->txt('cm_category_x_exists'), $category ), 'add' );
116 102
        return;
117 103
     }
118 104
 
119
-    if( $cm->addCategory( $category, $rank ) !== 0 )
120
-    {
105
+    if( $cm->addCategory( $category, $rank ) !== 0 ) {
121 106
         $cm->addMessage(
122 107
             sprintf(
123 108
                 $cm->txt( 'cm_category_x_saved_at_position_y' ),
@@ -126,9 +111,7 @@  discard block
 block discarded – undo
126 111
             ),
127 112
             'add'
128 113
         );
129
-    }
130
-    else
131
-    {
114
+    } else {
132 115
         $cm->addMessage( $cm->txt('cm_unknown_error'), 'add' );
133 116
     }
134 117
 }
@@ -136,20 +119,17 @@  discard block
 block discarded – undo
136 119
 /**
137 120
  * Sort categories
138 121
  */
139
-if( isset( $_POST[$cm->get('request_key')]['sort']['submit'] ) )
140
-{
122
+if( isset( $_POST[$cm->get('request_key')]['sort']['submit'] ) ) {
141 123
     $categories = $_POST[$cm->get('request_key')]['sort']['data'];
142 124
     $_changes   = 0;
143 125
 
144
-    foreach( $categories as $category_id => $_data  )
145
-    {
126
+    foreach( $categories as $category_id => $_data  ) {
146 127
         $data = array(
147 128
             'category' => urldecode( $_data['category'] ),
148 129
             'rank'     => $_data['rank']
149 130
         );
150 131
 
151
-        if( $cm->updateCategory( $category_id, $data ) )
152
-        {
132
+        if( $cm->updateCategory( $category_id, $data ) ) {
153 133
             $cm->addMessage(
154 134
                 sprintf(
155 135
                     $cm->txt('cm_category_x_moved_to_position_y'),
@@ -162,12 +142,9 @@  discard block
 block discarded – undo
162 142
         }
163 143
     }
164 144
 
165
-    if( $_changes === 0 )
166
-    {
145
+    if( $_changes === 0 ) {
167 146
         $cm->addMessage( $cm->txt( 'cm_no_changes' ), 'sort');
168
-    }
169
-    else
170
-    {
147
+    } else {
171 148
         $cm->addMessage(
172 149
             sprintf(
173 150
                 $cm->txt('cm_x_changes_made'),
@@ -181,17 +158,13 @@  discard block
 block discarded – undo
181 158
 /**
182 159
  * Edit categories
183 160
  */
184
-if( isset( $_POST[$cm->get('request_key')]['edit']['submit'] ) )
185
-{
161
+if( isset( $_POST[$cm->get('request_key')]['edit']['submit'] ) ) {
186 162
     $categories = $_POST[$cm->get('request_key')]['edit']['data'];
187 163
     $_changes   = 0;
188 164
 
189
-    foreach( $categories as $category_id => $_data  )
190
-    {
191
-        if( isset( $_data['delete'] ) )
192
-        {
193
-            if( $cm->deleteCategory( $category_id ) )
194
-            {
165
+    foreach( $categories as $category_id => $_data  ) {
166
+        if( isset( $_data['delete'] ) ) {
167
+            if( $cm->deleteCategory( $category_id ) ) {
195 168
                 $cm->addMessage(
196 169
                     sprintf(
197 170
                         $cm->txt('cm_category_x_deleted'),
@@ -209,8 +182,7 @@  discard block
 block discarded – undo
209 182
             'rank'     => $_data['rank']
210 183
         );
211 184
 
212
-        if( $cm->updateCategory( $category_id, $data ) )
213
-        {
185
+        if( $cm->updateCategory( $category_id, $data ) ) {
214 186
             $cm->addMessage(
215 187
                 sprintf(
216 188
                     $cm->txt('cm_category_x_renamed_to_y'),
@@ -223,8 +195,7 @@  discard block
 block discarded – undo
223 195
         }
224 196
     }
225 197
 
226
-    if( $_changes === 0 )
227
-    {
198
+    if( $_changes === 0 ) {
228 199
         $cm->addMessage( $cm->txt( 'cm_no_changes' ), 'edit');
229 200
     }
230 201
 }
@@ -233,12 +204,10 @@  discard block
 block discarded – undo
233 204
  * Delete singel category by $_GET
234 205
  */
235 206
 if( isset( $_GET[$cm->get('request_key')]['delete'] )
236
-    && !empty( $_GET[$cm->get('request_key')]['delete'] ) )
237
-{
207
+    && !empty( $_GET[$cm->get('request_key')]['delete'] ) ) {
238 208
     $category_id = (int)$_GET[$cm->get('request_key')]['delete'];
239 209
 
240
-    if( $cm->deleteCategory( $category_id ) )
241
-    {
210
+    if( $cm->deleteCategory( $category_id ) ) {
242 211
         $cm->addMessage(
243 212
             sprintf(
244 213
                 $cm->txt('cm_category_x_deleted'),
@@ -251,16 +220,13 @@  discard block
 block discarded – undo
251 220
 /**
252 221
  * Translate phrases
253 222
  */
254
-if( isset( $_POST[$cm->get('request_key')]['translate']['submit'] ) )
255
-{
223
+if( isset( $_POST[$cm->get('request_key')]['translate']['submit'] ) ) {
256 224
     $translations = $_POST[$cm->get('request_key')]['translate']['data'];
257 225
 
258
-    foreach( $translations as $native_phrase => $translation )
259
-    {
226
+    foreach( $translations as $native_phrase => $translation ) {
260 227
         $native_phrase = urldecode( $native_phrase );
261 228
 
262
-        if( empty( $translation ) )
263
-        {
229
+        if( empty( $translation ) ) {
264 230
             $translation = $native_phrase;
265 231
 
266 232
             $cm->addMessage(
Please login to merge, or discard this patch.