Completed
Push — develop ( 75b835...a38a21 )
by Maxim
09:33 queued 04:23
created
manager/actions/mutate_categories.dynamic.php 3 patches
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -4,24 +4,24 @@  discard block
 block discarded – undo
4 4
 }
5 5
 
6 6
 if(!$modx->hasPermission('category_manager')) {
7
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
8 8
 }
9 9
 
10 10
 $_module_params = array(
11
-	'module_version'   => '1.0.0',
12
-	'module_params'    => '',
13
-	'module_id'        => $_GET['id'],
14
-	'package_name'     => 'Module_Categories_Manager',
15
-	'native_language'  => 'de',
16
-	'name'             => 'Categories Manager',
17
-	'dirname'          => $site_manager_url,
18
-	'url'              => 'index.php?a=120&id=' . $_GET['id'],
19
-	'path'             => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR,
20
-	'inc_dir'          => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR,
21
-	'languages_dir'    => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'lang' . DIRECTORY_SEPARATOR,
22
-	'views_dir'        => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'skin' . DIRECTORY_SEPARATOR,
23
-	'request_key'      => 'module_categories_manager',
24
-	'messages'         => array()
11
+    'module_version'   => '1.0.0',
12
+    'module_params'    => '',
13
+    'module_id'        => $_GET['id'],
14
+    'package_name'     => 'Module_Categories_Manager',
15
+    'native_language'  => 'de',
16
+    'name'             => 'Categories Manager',
17
+    'dirname'          => $site_manager_url,
18
+    'url'              => 'index.php?a=120&id=' . $_GET['id'],
19
+    'path'             => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR,
20
+    'inc_dir'          => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR,
21
+    'languages_dir'    => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'lang' . DIRECTORY_SEPARATOR,
22
+    'views_dir'        => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'skin' . DIRECTORY_SEPARATOR,
23
+    'request_key'      => 'module_categories_manager',
24
+    'messages'         => array()
25 25
 );
26 26
 
27 27
 require_once $_module_params['inc_dir'] . 'Module_Categories_Manager.php';
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 // assign module_params to internal params
31 31
 foreach( $_module_params as $param => $value )
32 32
 {
33
-	$cm->set( $param, $value );
33
+    $cm->set( $param, $value );
34 34
 }
35 35
 
36 36
 // catch the request actions
@@ -38,8 +38,8 @@  discard block
 block discarded – undo
38 38
 
39 39
 if( !$categories = $cm->getCategories() )
40 40
 {
41
-	setcookie('webfxtab_manage-categories-pane', 0 );
42
-	$cm->addMessage( $cm->txt('Currently no categories available... JUST ADD A NEW ONE!'), 'global' );
41
+    setcookie('webfxtab_manage-categories-pane', 0 );
42
+    $cm->addMessage( $cm->txt('Currently no categories available... JUST ADD A NEW ONE!'), 'global' );
43 43
 }
44 44
 
45 45
 $cm->renderView('main', $categories );
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 
6
-if(!$modx->hasPermission('category_manager')) {
6
+if (!$modx->hasPermission('category_manager')) {
7 7
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
8 8
 }
9 9
 
@@ -15,32 +15,32 @@  discard block
 block discarded – undo
15 15
 	'native_language'  => 'de',
16 16
 	'name'             => 'Categories Manager',
17 17
 	'dirname'          => $site_manager_url,
18
-	'url'              => 'index.php?a=120&amp;id=' . $_GET['id'],
19
-	'path'             => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR,
20
-	'inc_dir'          => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR,
21
-	'languages_dir'    => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'lang' . DIRECTORY_SEPARATOR,
22
-	'views_dir'        => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'skin' . DIRECTORY_SEPARATOR,
18
+	'url'              => 'index.php?a=120&amp;id='.$_GET['id'],
19
+	'path'             => realpath(dirname(__FILE__)).DIRECTORY_SEPARATOR.'category_mgr'.DIRECTORY_SEPARATOR,
20
+	'inc_dir'          => realpath(dirname(__FILE__)).DIRECTORY_SEPARATOR.'category_mgr'.DIRECTORY_SEPARATOR.'inc'.DIRECTORY_SEPARATOR,
21
+	'languages_dir'    => realpath(dirname(__FILE__)).DIRECTORY_SEPARATOR.'category_mgr'.DIRECTORY_SEPARATOR.'lang'.DIRECTORY_SEPARATOR,
22
+	'views_dir'        => realpath(dirname(__FILE__)).DIRECTORY_SEPARATOR.'category_mgr'.DIRECTORY_SEPARATOR.'skin'.DIRECTORY_SEPARATOR,
23 23
 	'request_key'      => 'module_categories_manager',
24 24
 	'messages'         => array()
25 25
 );
26 26
 
27
-require_once $_module_params['inc_dir'] . 'Module_Categories_Manager.php';
27
+require_once $_module_params['inc_dir'].'Module_Categories_Manager.php';
28 28
 $cm = new Module_Categories_Manager();
29 29
 
30 30
 // assign module_params to internal params
31
-foreach( $_module_params as $param => $value )
31
+foreach ($_module_params as $param => $value)
32 32
 {
33
-	$cm->set( $param, $value );
33
+	$cm->set($param, $value);
34 34
 }
35 35
 
36 36
 // catch the request actions
37
-include_once $cm->get('inc_dir') . 'request_trigger.inc.php';
37
+include_once $cm->get('inc_dir').'request_trigger.inc.php';
38 38
 
39
-if( !$categories = $cm->getCategories() )
39
+if (!$categories = $cm->getCategories())
40 40
 {
41
-	setcookie('webfxtab_manage-categories-pane', 0 );
42
-	$cm->addMessage( $cm->txt('Currently no categories available... JUST ADD A NEW ONE!'), 'global' );
41
+	setcookie('webfxtab_manage-categories-pane', 0);
42
+	$cm->addMessage($cm->txt('Currently no categories available... JUST ADD A NEW ONE!'), 'global');
43 43
 }
44 44
 
45
-$cm->renderView('main', $categories );
45
+$cm->renderView('main', $categories);
46 46
 return;
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -28,16 +28,14 @@
 block discarded – undo
28 28
 $cm = new Module_Categories_Manager();
29 29
 
30 30
 // assign module_params to internal params
31
-foreach( $_module_params as $param => $value )
32
-{
31
+foreach( $_module_params as $param => $value ) {
33 32
 	$cm->set( $param, $value );
34 33
 }
35 34
 
36 35
 // catch the request actions
37 36
 include_once $cm->get('inc_dir') . 'request_trigger.inc.php';
38 37
 
39
-if( !$categories = $cm->getCategories() )
40
-{
38
+if( !$categories = $cm->getCategories() ) {
41 39
 	setcookie('webfxtab_manage-categories-pane', 0 );
42 40
 	$cm->addMessage( $cm->txt('Currently no categories available... JUST ADD A NEW ONE!'), 'global' );
43 41
 }
Please login to merge, or discard this patch.
manager/actions/user_management.static.php 2 patches
Indentation   +54 added lines, -54 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
 // initialize page view state - the $_PAGE object
@@ -11,12 +11,12 @@  discard block
 block discarded – undo
11 11
 
12 12
 // get and save search string
13 13
 if($_REQUEST['op'] == 'reset') {
14
-	$query = '';
15
-	$_PAGE['vs']['search'] = '';
14
+    $query = '';
15
+    $_PAGE['vs']['search'] = '';
16 16
 } else {
17
-	$query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search'];
18
-	$sqlQuery = $modx->db->escape($query);
19
-	$_PAGE['vs']['search'] = $query;
17
+    $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search'];
18
+    $sqlQuery = $modx->db->escape($query);
19
+    $_PAGE['vs']['search'] = $query;
20 20
 }
21 21
 
22 22
 // get & save listmode
@@ -120,55 +120,55 @@  discard block
 block discarded – undo
120 120
 			<div class="row">
121 121
 				<div class="table-responsive">
122 122
 					<?php
123
-					$where = "";
124
-					if(!$modx->hasPermission('save_role')) {
125
-						$where .= (empty($where) ? "" : " AND ") . "mua.role != 1";
126
-					}
127
-					if(!empty($sqlQuery)) {
128
-						$where .= (empty($where) ? "" : " AND ") . "((mu.username LIKE '{$sqlQuery}%') OR (mua.fullname LIKE '%{$sqlQuery}%') OR (mua.email LIKE '{$sqlQuery}%'))";
129
-					}
130
-					$ds = $modx->db->select("mu.id, mu.username, rname.name AS role, mua.fullname, mua.email, ELT(mua.gender, '{$_lang['user_male']}', '{$_lang['user_female']}', '{$_lang['user_other']}') AS gender, IF(mua.blocked,'{$_lang['yes']}','-') as blocked, mua.thislogin", $modx->getFullTableName('manager_users') . " AS mu 
123
+                    $where = "";
124
+                    if(!$modx->hasPermission('save_role')) {
125
+                        $where .= (empty($where) ? "" : " AND ") . "mua.role != 1";
126
+                    }
127
+                    if(!empty($sqlQuery)) {
128
+                        $where .= (empty($where) ? "" : " AND ") . "((mu.username LIKE '{$sqlQuery}%') OR (mua.fullname LIKE '%{$sqlQuery}%') OR (mua.email LIKE '{$sqlQuery}%'))";
129
+                    }
130
+                    $ds = $modx->db->select("mu.id, mu.username, rname.name AS role, mua.fullname, mua.email, ELT(mua.gender, '{$_lang['user_male']}', '{$_lang['user_female']}', '{$_lang['user_other']}') AS gender, IF(mua.blocked,'{$_lang['yes']}','-') as blocked, mua.thislogin", $modx->getFullTableName('manager_users') . " AS mu 
131 131
 			INNER JOIN " . $modx->getFullTableName('user_attributes') . " AS mua ON mua.internalKey=mu.id 
132 132
 			LEFT JOIN " . $modx->getFullTableName('user_roles') . " AS rname ON mua.role=rname.id", $where, 'mua.blocked ASC, mua.thislogin DESC');
133
-					include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php";
134
-					$grd = new DataGrid('', $ds, $modx->config['number_of_results']); // set page size to 0 t show all items
135
-					$grd->noRecordMsg = $_lang["no_records_found"];
136
-					$grd->cssClass = "table data";
137
-					$grd->columnHeaderClass = "tableHeader";
138
-					$grd->itemClass = "tableItem";
139
-					$grd->altItemClass = "tableAltItem";
140
-					$grd->fields = "id,username,fullname,role,email,gender,blocked,thislogin";
141
-					$grd->columns = implode(',', array(
142
-						$_lang["icon"],
143
-						$_lang["name"],
144
-						$_lang["user_full_name"],
145
-						$_lang['role'],
146
-						$_lang["email"],
147
-						$_lang["user_gender"],
148
-						$_lang["user_block"],
149
-						$_lang["login_button"]
150
-					));
151
-					$grd->colWidths = "1%,,,,,,1%,1%";
152
-					$grd->colAligns = "center,,,,,center,center,right' nowrap='nowrap";
153
-					$grd->colTypes = implode('||', array(
154
-						'template:<a class="gridRowIcon" href="javascript:;" onclick="return showContentMenu([+id+],event);" title="' . $_lang['click_to_context'] . '"><i class="' . $_style['icons_user'] . '"></i></a>',
155
-						'template:<a href="index.php?a=12&id=[+id+]" title="' . $_lang['click_to_edit_title'] . '">[+value+]</a>',
156
-						'template:[+fullname+]',
157
-						'template:[+role+]',
158
-						'template:[+email+]',
159
-						'template:[+gender+]',
160
-						'template:[+blocked+]',
161
-						'date: ' . $modx->toDateFormat('[+thislogin+]', 'formatOnly') . ' %H:%M'
162
-					));
163
-					if($listmode == '1') {
164
-						$grd->pageSize = 0;
165
-					}
166
-					if($_REQUEST['op'] == 'reset') {
167
-						$grd->pageNumber = 1;
168
-					}
169
-					// render grid
170
-					echo $grd->render();
171
-					?>
133
+                    include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php";
134
+                    $grd = new DataGrid('', $ds, $modx->config['number_of_results']); // set page size to 0 t show all items
135
+                    $grd->noRecordMsg = $_lang["no_records_found"];
136
+                    $grd->cssClass = "table data";
137
+                    $grd->columnHeaderClass = "tableHeader";
138
+                    $grd->itemClass = "tableItem";
139
+                    $grd->altItemClass = "tableAltItem";
140
+                    $grd->fields = "id,username,fullname,role,email,gender,blocked,thislogin";
141
+                    $grd->columns = implode(',', array(
142
+                        $_lang["icon"],
143
+                        $_lang["name"],
144
+                        $_lang["user_full_name"],
145
+                        $_lang['role'],
146
+                        $_lang["email"],
147
+                        $_lang["user_gender"],
148
+                        $_lang["user_block"],
149
+                        $_lang["login_button"]
150
+                    ));
151
+                    $grd->colWidths = "1%,,,,,,1%,1%";
152
+                    $grd->colAligns = "center,,,,,center,center,right' nowrap='nowrap";
153
+                    $grd->colTypes = implode('||', array(
154
+                        'template:<a class="gridRowIcon" href="javascript:;" onclick="return showContentMenu([+id+],event);" title="' . $_lang['click_to_context'] . '"><i class="' . $_style['icons_user'] . '"></i></a>',
155
+                        'template:<a href="index.php?a=12&id=[+id+]" title="' . $_lang['click_to_edit_title'] . '">[+value+]</a>',
156
+                        'template:[+fullname+]',
157
+                        'template:[+role+]',
158
+                        'template:[+email+]',
159
+                        'template:[+gender+]',
160
+                        'template:[+blocked+]',
161
+                        'date: ' . $modx->toDateFormat('[+thislogin+]', 'formatOnly') . ' %H:%M'
162
+                    ));
163
+                    if($listmode == '1') {
164
+                        $grd->pageSize = 0;
165
+                    }
166
+                    if($_REQUEST['op'] == 'reset') {
167
+                        $grd->pageNumber = 1;
168
+                    }
169
+                    // render grid
170
+                    echo $grd->render();
171
+                    ?>
172 172
 				</div>
173 173
 			</div>
174 174
 		</div>
Please login to merge, or discard this patch.
Spacing   +17 added lines, -17 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
 
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 $modx->manager->initPageViewState();
11 11
 
12 12
 // get and save search string
13
-if($_REQUEST['op'] == 'reset') {
13
+if ($_REQUEST['op'] == 'reset') {
14 14
 	$query = '';
15 15
 	$_PAGE['vs']['search'] = '';
16 16
 } else {
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
 
27 27
 // context menu
28
-include_once MODX_MANAGER_PATH . "includes/controls/contextmenu.php";
28
+include_once MODX_MANAGER_PATH."includes/controls/contextmenu.php";
29 29
 $cm = new ContextMenu("cntxm", 150);
30 30
 $cm->addItem($_lang["edit"], "js:menuAction(1)", $_style["actions_edit"], (!$modx->hasPermission('edit_user') ? 1 : 0));
31 31
 $cm->addItem($_lang["delete"], "js:menuAction(2)", $_style["actions_delete"], (!$modx->hasPermission('delete_user') ? 1 : 0));
@@ -121,16 +121,16 @@  discard block
 block discarded – undo
121 121
 				<div class="table-responsive">
122 122
 					<?php
123 123
 					$where = "";
124
-					if(!$modx->hasPermission('save_role')) {
125
-						$where .= (empty($where) ? "" : " AND ") . "mua.role != 1";
124
+					if (!$modx->hasPermission('save_role')) {
125
+						$where .= (empty($where) ? "" : " AND ")."mua.role != 1";
126 126
 					}
127
-					if(!empty($sqlQuery)) {
128
-						$where .= (empty($where) ? "" : " AND ") . "((mu.username LIKE '{$sqlQuery}%') OR (mua.fullname LIKE '%{$sqlQuery}%') OR (mua.email LIKE '{$sqlQuery}%'))";
127
+					if (!empty($sqlQuery)) {
128
+						$where .= (empty($where) ? "" : " AND ")."((mu.username LIKE '{$sqlQuery}%') OR (mua.fullname LIKE '%{$sqlQuery}%') OR (mua.email LIKE '{$sqlQuery}%'))";
129 129
 					}
130
-					$ds = $modx->db->select("mu.id, mu.username, rname.name AS role, mua.fullname, mua.email, ELT(mua.gender, '{$_lang['user_male']}', '{$_lang['user_female']}', '{$_lang['user_other']}') AS gender, IF(mua.blocked,'{$_lang['yes']}','-') as blocked, mua.thislogin", $modx->getFullTableName('manager_users') . " AS mu 
131
-			INNER JOIN " . $modx->getFullTableName('user_attributes') . " AS mua ON mua.internalKey=mu.id 
132
-			LEFT JOIN " . $modx->getFullTableName('user_roles') . " AS rname ON mua.role=rname.id", $where, 'mua.blocked ASC, mua.thislogin DESC');
133
-					include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php";
130
+					$ds = $modx->db->select("mu.id, mu.username, rname.name AS role, mua.fullname, mua.email, ELT(mua.gender, '{$_lang['user_male']}', '{$_lang['user_female']}', '{$_lang['user_other']}') AS gender, IF(mua.blocked,'{$_lang['yes']}','-') as blocked, mua.thislogin", $modx->getFullTableName('manager_users')." AS mu 
131
+			INNER JOIN " . $modx->getFullTableName('user_attributes')." AS mua ON mua.internalKey=mu.id 
132
+			LEFT JOIN " . $modx->getFullTableName('user_roles')." AS rname ON mua.role=rname.id", $where, 'mua.blocked ASC, mua.thislogin DESC');
133
+					include_once MODX_MANAGER_PATH."includes/controls/datagrid.class.php";
134 134
 					$grd = new DataGrid('', $ds, $modx->config['number_of_results']); // set page size to 0 t show all items
135 135
 					$grd->noRecordMsg = $_lang["no_records_found"];
136 136
 					$grd->cssClass = "table data";
@@ -151,19 +151,19 @@  discard block
 block discarded – undo
151 151
 					$grd->colWidths = "1%,,,,,,1%,1%";
152 152
 					$grd->colAligns = "center,,,,,center,center,right' nowrap='nowrap";
153 153
 					$grd->colTypes = implode('||', array(
154
-						'template:<a class="gridRowIcon" href="javascript:;" onclick="return showContentMenu([+id+],event);" title="' . $_lang['click_to_context'] . '"><i class="' . $_style['icons_user'] . '"></i></a>',
155
-						'template:<a href="index.php?a=12&id=[+id+]" title="' . $_lang['click_to_edit_title'] . '">[+value+]</a>',
154
+						'template:<a class="gridRowIcon" href="javascript:;" onclick="return showContentMenu([+id+],event);" title="'.$_lang['click_to_context'].'"><i class="'.$_style['icons_user'].'"></i></a>',
155
+						'template:<a href="index.php?a=12&id=[+id+]" title="'.$_lang['click_to_edit_title'].'">[+value+]</a>',
156 156
 						'template:[+fullname+]',
157 157
 						'template:[+role+]',
158 158
 						'template:[+email+]',
159 159
 						'template:[+gender+]',
160 160
 						'template:[+blocked+]',
161
-						'date: ' . $modx->toDateFormat('[+thislogin+]', 'formatOnly') . ' %H:%M'
161
+						'date: '.$modx->toDateFormat('[+thislogin+]', 'formatOnly').' %H:%M'
162 162
 					));
163
-					if($listmode == '1') {
163
+					if ($listmode == '1') {
164 164
 						$grd->pageSize = 0;
165 165
 					}
166
-					if($_REQUEST['op'] == 'reset') {
166
+					if ($_REQUEST['op'] == 'reset') {
167 167
 						$grd->pageNumber = 1;
168 168
 					}
169 169
 					// render grid
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
Indentation   +18 added lines, -18 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 />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
 include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/functions.inc.php');
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
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 13
 if($username = $modx->db->getValue($rs)) {
14
-	$modx->webAlertAndQuit(sprintf($_lang['lock_settings_msg'], $username));
14
+    $modx->webAlertAndQuit(sprintf($_lang['lock_settings_msg'], $username));
15 15
 }
16 16
 // end check for lock
17 17
 
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
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 23
 while($row = $modx->db->getRow($rs)) {
24
-	$settings[$row['setting_name']] = $row['setting_value'];
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']);
27 27
 $settings['rb_base_dir'] = preg_replace('@^' . preg_quote(MODX_BASE_PATH) . '@', '[(base_path)]', $settings['rb_base_dir']);
@@ -32,11 +32,11 @@  discard block
 block discarded – undo
32 32
 $lang_keys = array();
33 33
 $dir = dir('includes/lang');
34 34
 while($file = $dir->read()) {
35
-	if(strpos($file, '.inc.php') > 0) {
36
-		$endpos = strpos($file, '.');
37
-		$languagename = substr($file, 0, $endpos);
38
-		$lang_keys[$languagename] = get_lang_keys($file);
39
-	}
35
+    if(strpos($file, '.inc.php') > 0) {
36
+        $endpos = strpos($file, '.');
37
+        $languagename = substr($file, 0, $endpos);
38
+        $lang_keys[$languagename] = get_lang_keys($file);
39
+    }
40 40
 }
41 41
 $dir->close();
42 42
 $displayStyle = ($_SESSION['browser'] === 'modern') ? 'table-row' : 'block';
@@ -78,14 +78,14 @@  discard block
 block discarded – undo
78 78
 				</script>
79 79
 
80 80
 				<?php
81
-				include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab1_site_settings.inc.php');
82
-				include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab2_furl_settings.inc.php');
83
-				include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab3_user_settings.inc.php');
84
-				include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab4_manager_settings.inc.php');
85
-				include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab5_security_settings.inc.php');
86
-				include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab6_filemanager_settings.inc.php');
87
-				include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab7_filebrowser_settings.inc.php');
88
-				?>
81
+                include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab1_site_settings.inc.php');
82
+                include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab2_furl_settings.inc.php');
83
+                include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab3_user_settings.inc.php');
84
+                include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab4_manager_settings.inc.php');
85
+                include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab5_security_settings.inc.php');
86
+                include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab6_filemanager_settings.inc.php');
87
+                include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab7_filebrowser_settings.inc.php');
88
+                ?>
89 89
 			</div>
90 90
 		</div>
91 91
 	</form>
@@ -132,5 +132,5 @@  discard block
 block discarded – undo
132 132
 	</script>
133 133
 <?php
134 134
 if(is_numeric($_GET['tab'])) {
135
-	echo '<script type="text/javascript">tpSettings.setSelectedIndex( ' . $_GET['tab'] . ' );</script>';
135
+    echo '<script type="text/javascript">tpSettings.setSelectedIndex( ' . $_GET['tab'] . ' );</script>';
136 136
 }
Please login to merge, or discard this patch.
Spacing   +21 added lines, -21 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 />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
-include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/functions.inc.php');
9
+include_once(MODX_MANAGER_PATH.'actions/mutate_settings/functions.inc.php');
10 10
 
11 11
 // check to see the edit settings page isn't locked
12
-$rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=17 AND internalKey!='" . $modx->getLoginUserID() . "'");
13
-if($username = $modx->db->getValue($rs)) {
12
+$rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=17 AND internalKey!='".$modx->getLoginUserID()."'");
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
@@ -18,21 +18,21 @@  discard block
 block discarded – undo
18 18
 // reload system settings from the database.
19 19
 // this will prevent user-defined settings from being saved as system setting
20 20
 $settings = array();
21
-include_once(MODX_MANAGER_PATH . 'includes/default_config.php');
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
-$settings['filemanager_path'] = preg_replace('@^' . preg_quote(MODX_BASE_PATH) . '@', '[(base_path)]', $settings['filemanager_path']);
27
-$settings['rb_base_dir'] = preg_replace('@^' . preg_quote(MODX_BASE_PATH) . '@', '[(base_path)]', $settings['rb_base_dir']);
26
+$settings['filemanager_path'] = preg_replace('@^'.preg_quote(MODX_BASE_PATH).'@', '[(base_path)]', $settings['filemanager_path']);
27
+$settings['rb_base_dir'] = preg_replace('@^'.preg_quote(MODX_BASE_PATH).'@', '[(base_path)]', $settings['rb_base_dir']);
28 28
 
29 29
 extract($settings, EXTR_OVERWRITE);
30 30
 
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);
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 			<input type="hidden" name="site_id" value="<?php echo $site_id; ?>" />
70 70
 			<input type="hidden" name="settings_version" value="<?php echo $modx->getVersionData('version'); ?>" />
71 71
 			<!-- this field is used to check site settings have been entered/ updated after install or upgrade -->
72
-			<?php if(!isset($settings_version) || $settings_version != $modx->getVersionData('version')) { ?>
72
+			<?php if (!isset($settings_version) || $settings_version != $modx->getVersionData('version')) { ?>
73 73
 				<div class='sectionBody'><p class='element-edit-message-tab alert alert-warning'><?php echo $_lang['settings_after_install']; ?></p></div>
74 74
 			<?php } ?>
75 75
 			<div class="tab-pane" id="settingsPane">
@@ -78,13 +78,13 @@  discard block
 block discarded – undo
78 78
 				</script>
79 79
 
80 80
 				<?php
81
-				include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab1_site_settings.inc.php');
82
-				include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab2_furl_settings.inc.php');
83
-				include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab3_user_settings.inc.php');
84
-				include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab4_manager_settings.inc.php');
85
-				include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab5_security_settings.inc.php');
86
-				include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab6_filemanager_settings.inc.php');
87
-				include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab7_filebrowser_settings.inc.php');
81
+				include_once(MODX_MANAGER_PATH.'actions/mutate_settings/tab1_site_settings.inc.php');
82
+				include_once(MODX_MANAGER_PATH.'actions/mutate_settings/tab2_furl_settings.inc.php');
83
+				include_once(MODX_MANAGER_PATH.'actions/mutate_settings/tab3_user_settings.inc.php');
84
+				include_once(MODX_MANAGER_PATH.'actions/mutate_settings/tab4_manager_settings.inc.php');
85
+				include_once(MODX_MANAGER_PATH.'actions/mutate_settings/tab5_security_settings.inc.php');
86
+				include_once(MODX_MANAGER_PATH.'actions/mutate_settings/tab6_filemanager_settings.inc.php');
87
+				include_once(MODX_MANAGER_PATH.'actions/mutate_settings/tab7_filebrowser_settings.inc.php');
88 88
 				?>
89 89
 			</div>
90 90
 		</div>
@@ -131,6 +131,6 @@  discard block
 block discarded – undo
131 131
 		});
132 132
 	</script>
133 133
 <?php
134
-if(is_numeric($_GET['tab'])) {
135
-	echo '<script type="text/javascript">tpSettings.setSelectedIndex( ' . $_GET['tab'] . ' );</script>';
134
+if (is_numeric($_GET['tab'])) {
135
+	echo '<script type="text/javascript">tpSettings.setSelectedIndex( '.$_GET['tab'].' );</script>';
136 136
 }
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 />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.
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
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -113,31 +113,31 @@  discard block
 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
         }
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
             $sqladd .= " OR sc.introtext LIKE '%{$searchlongtitle}%'";
158 158
             $sqladd .= " OR sc.menutitle LIKE '%{$searchlongtitle}%'";
159 159
             $sqladd .= " OR sc.alias LIKE '%{$search_alias}%'";
160
-			$sqladd .= $articul_id_query;//search by TV
160
+            $sqladd .= $articul_id_query;//search by TV
161 161
         }
162 162
     } else if ($idFromAlias) {
163 163
         $sqladd .= " sc.id='{$idFromAlias}'";
Please login to merge, or discard this patch.
Spacing   +74 added lines, -74 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
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
                         $option[] = '<option value="">No selected</option>';
44 44
                         $templateid = (isset($_REQUEST['templateid']) && $_REQUEST['templateid'] !== '') ? intval($_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"' : '';
@@ -100,12 +100,12 @@  discard block
 block discarded – undo
100 100
         $friendly_url_suffix = $modx->config['friendly_url_suffix'];
101 101
         $base_url = $modx->config['base_url'];
102 102
         $site_url = $modx->config['site_url'];
103
-        $url = preg_replace('@' . $friendly_url_suffix . '$@', '', $url);
103
+        $url = preg_replace('@'.$friendly_url_suffix.'$@', '', $url);
104 104
         if ($url[0] === '/') {
105
-            $url = preg_replace('@^' . $base_url . '@', '', $url);
105
+            $url = preg_replace('@^'.$base_url.'@', '', $url);
106 106
         }
107 107
         if (substr($url, 0, 4) === 'http') {
108
-            $url = preg_replace('@^' . $site_url . '@', '', $url);
108
+            $url = preg_replace('@^'.$site_url.'@', '', $url);
109 109
         }
110 110
         $idFromAlias = $modx->getIdFromAlias($url);
111 111
     }
@@ -118,18 +118,18 @@  discard block
 block discarded – undo
118 118
 		$articul_query = "SELECT `contentid` FROM {$tbl_site_tmplvar_contentvalues} WHERE `value` LIKE '%{$searchfields}%'";
119 119
 		$articul_result = $modx->db->query($articul_query);
120 120
 		$articul_id_array = $modx->db->makeArray($articul_result);
121
-		if(count($articul_id_array)>0){
121
+		if (count($articul_id_array) > 0) {
122 122
 			$articul_id = '';
123 123
 			$i = 1;
124
-			foreach( $articul_id_array as $articul ) {
125
-				$articul_id.=$articul['contentid'];
126
-				if($i !== count($articul_id_array)){
127
-					$articul_id.=',';
124
+			foreach ($articul_id_array as $articul) {
125
+				$articul_id .= $articul['contentid'];
126
+				if ($i !== count($articul_id_array)) {
127
+					$articul_id .= ',';
128 128
 				}
129 129
 				$i++;
130 130
 			}
131 131
 		$articul_id_query = " OR sc.id IN ({$articul_id})";
132
-		}else{
132
+		} else {
133 133
 			$articul_id_query = '';
134 134
 		}
135 135
 		/*end search by TV*/
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
         if (ctype_digit($searchfields)) {
138 138
             $sqladd .= "sc.id='{$searchfields}'";
139 139
             if (strlen($searchfields) > 3) {
140
-				$sqladd .= $articul_id_query;//search by TV
140
+				$sqladd .= $articul_id_query; //search by TV
141 141
                 $sqladd .= " OR sc.pagetitle LIKE '%{$searchfields}%'";
142 142
             }
143 143
         }
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
             $sqladd .= " OR sc.introtext LIKE '%{$searchlongtitle}%'";
158 158
             $sqladd .= " OR sc.menutitle LIKE '%{$searchlongtitle}%'";
159 159
             $sqladd .= " OR sc.alias LIKE '%{$search_alias}%'";
160
-			$sqladd .= $articul_id_query;//search by TV
160
+			$sqladd .= $articul_id_query; //search by TV
161 161
         }
162 162
     } else if ($idFromAlias) {
163 163
         $sqladd .= " sc.id='{$idFromAlias}'";
@@ -180,8 +180,8 @@  discard block
 block discarded – undo
180 180
         $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(',', $_SESSION['mgrDocgroups']) : '';
181 181
         $mgrRole = (isset ($_SESSION['mgrRole']) && $_SESSION['mgrRole'] == 1) ? 1 : 0;
182 182
         $docgrp_cond = $docgrp ? " OR dg.document_group IN ({$docgrp})" : '';
183
-        $fields .= ', MAX(IF(1=' . $mgrRole . ' OR sc.privatemgr=0' . $docgrp_cond . ',1,0)) AS hasAccess';
184
-        $sqladd = '(' . $sqladd . ") AND (1={$mgrRole} OR sc.privatemgr=0" . (!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))");
183
+        $fields .= ', MAX(IF(1='.$mgrRole.' OR sc.privatemgr=0'.$docgrp_cond.',1,0)) AS hasAccess';
184
+        $sqladd = '('.$sqladd.") AND (1={$mgrRole} OR sc.privatemgr=0".(!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))");
185 185
     }
186 186
 
187 187
     if ($sqladd) {
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
     $where = $sqladd;
192 192
 
193 193
     if ($where) {
194
-        $rs = $modx->db->select($fields, $tbl_site_content . ' AS sc LEFT JOIN ' . $tbldg . ' AS dg ON dg.document=sc.id', $where, 'sc.id');
194
+        $rs = $modx->db->select($fields, $tbl_site_content.' AS sc LEFT JOIN '.$tbldg.' AS dg ON dg.document=sc.id', $where, 'sc.id');
195 195
         $limit = $modx->db->getRecordCount($rs);
196 196
     } else {
197 197
         $limit = 0;
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
                 if ($limit < 1) {
211 211
                     echo $_lang['search_empty'];
212 212
                 } else {
213
-                    printf('<p>' . $_lang['search_results_returned_msg'] . '</p>', $limit);
213
+                    printf('<p>'.$_lang['search_results_returned_msg'].'</p>', $limit);
214 214
                     ?>
215 215
                     <script type="text/javascript" src="media/script/tablesort.js"></script>
216 216
                     <table class="grid sortabletable sortable-onload-2 rowstyle-even" id="table-1">
@@ -270,14 +270,14 @@  discard block
 block discarded – undo
270 270
                                 if (function_exists('mb_strlen') && function_exists('mb_substr')) {
271 271
                                     ?>
272 272
                                     <td<?= $tdClass ?>>
273
-                                        <a href="index.php?a=27&id=<?= $row['id'] ?>"><?= mb_strlen($row['pagetitle'], $modx_manager_charset) > 70 ? mb_substr($row['pagetitle'], 0, 70, $modx_manager_charset) . "..." : $row['pagetitle'] ?></a>
273
+                                        <a href="index.php?a=27&id=<?= $row['id'] ?>"><?= mb_strlen($row['pagetitle'], $modx_manager_charset) > 70 ? mb_substr($row['pagetitle'], 0, 70, $modx_manager_charset)."..." : $row['pagetitle'] ?></a>
274 274
                                     </td>
275
-                                    <td<?= $tdClass ?>><?= mb_strlen($row['description'], $modx_manager_charset) > 70 ? mb_substr($row['description'], 0, 70, $modx_manager_charset) . "..." : $row['description'] ?></td>
275
+                                    <td<?= $tdClass ?>><?= mb_strlen($row['description'], $modx_manager_charset) > 70 ? mb_substr($row['description'], 0, 70, $modx_manager_charset)."..." : $row['description'] ?></td>
276 276
                                     <?php
277 277
                                 } else {
278 278
                                     ?>
279
-                                    <td<?= $tdClass ?>><?= strlen($row['pagetitle']) > 20 ? substr($row['pagetitle'], 0, 20) . '...' : $row['pagetitle'] ?></td>
280
-                                    <td<?= $tdClass ?>><?= strlen($row['description']) > 35 ? substr($row['description'], 0, 35) . '...' : $row['description'] ?></td>
279
+                                    <td<?= $tdClass ?>><?= strlen($row['pagetitle']) > 20 ? substr($row['pagetitle'], 0, 20).'...' : $row['pagetitle'] ?></td>
280
+                                    <td<?= $tdClass ?>><?= strlen($row['description']) > 35 ? substr($row['description'], 0, 35).'...' : $row['description'] ?></td>
281 281
                                     <?php
282 282
                                 }
283 283
                                 ?>
@@ -297,115 +297,115 @@  discard block
 block discarded – undo
297 297
                 if ($modx->hasPermission('new_document') && $modx->hasPermission('edit_document') && $modx->hasPermission('save_document')) {
298 298
                     $docscounts = $modx->db->getRecordCount($rs);
299 299
                     if ($docscounts > 0) {
300
-                        $output .= '<li><b><i class="fa fa-sitemap"></i> ' . $_lang["manage_documents"] . ' (' . $docscounts . ')</b></li>';
300
+                        $output .= '<li><b><i class="fa fa-sitemap"></i> '.$_lang["manage_documents"].' ('.$docscounts.')</b></li>';
301 301
                         while ($row = $modx->db->getRow($rs)) {
302
-                            $output .= '<li' . addClassForItemList('', !$row['published'], $row['deleted']) . '><a href="index.php?a=27&id=' . $row['id'] . '" id="content_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['pagetitle'] . ' <small>(' . $row['id'] . ')</small>', $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>';
302
+                            $output .= '<li'.addClassForItemList('', !$row['published'], $row['deleted']).'><a href="index.php?a=27&id='.$row['id'].'" id="content_'.$row['id'].'" target="main">'.highlightingCoincidence($row['pagetitle'].' <small>('.$row['id'].')</small>', $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>';
303 303
                         }
304 304
                     }
305 305
                 }
306 306
 
307 307
                 //templates
308 308
                 if ($modx->hasPermission('edit_template')) {
309
-                    $rs = $modx->db->select("id,templatename,locked", $modx->getFullTableName('site_templates'), "`id` like '%" . $searchfields . "%' 
310
-					OR `templatename` like '%" . $searchfields . "%' 
311
-					OR `description` like '%" . $searchfields . "%' 
312
-					OR `content` like '%" . $searchfields . "%'");
309
+                    $rs = $modx->db->select("id,templatename,locked", $modx->getFullTableName('site_templates'), "`id` like '%".$searchfields."%' 
310
+					OR `templatename` like '%" . $searchfields."%' 
311
+					OR `description` like '%" . $searchfields."%' 
312
+					OR `content` like '%" . $searchfields."%'");
313 313
                     $templatecounts = $modx->db->getRecordCount($rs);
314 314
                     if ($templatecounts > 0) {
315
-                        $output .= '<li><b><i class="fa fa-newspaper-o"></i> ' . $_lang["manage_templates"] . ' (' . $templatecounts . ')</b></li>';
315
+                        $output .= '<li><b><i class="fa fa-newspaper-o"></i> '.$_lang["manage_templates"].' ('.$templatecounts.')</b></li>';
316 316
                         while ($row = $modx->db->getRow($rs)) {
317
-                            $output .= '<li' . addClassForItemList($row['locked']) . '><a href="index.php?a=16&id=' . $row['id'] . '" id="templates_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['templatename'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>';
317
+                            $output .= '<li'.addClassForItemList($row['locked']).'><a href="index.php?a=16&id='.$row['id'].'" id="templates_'.$row['id'].'" target="main">'.highlightingCoincidence($row['templatename'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>';
318 318
                         }
319 319
                     }
320 320
                 }
321 321
 
322 322
                 //tvs
323 323
                 if ($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) {
324
-                    $rs = $modx->db->select("id,name,locked", $modx->getFullTableName('site_tmplvars'), "`id` like '%" . $searchfields . "%' 
325
-					OR `name` like '%" . $searchfields . "%' 
326
-					OR `description` like '%" . $searchfields . "%' 
327
-					OR `type` like '%" . $searchfields . "%' 
328
-					OR `elements` like '%" . $searchfields . "%' 
329
-					OR `display` like '%" . $searchfields . "%' 
330
-					OR `display_params` like '%" . $searchfields . "%' 
331
-					OR `default_text` like '%" . $searchfields . "%'");
324
+                    $rs = $modx->db->select("id,name,locked", $modx->getFullTableName('site_tmplvars'), "`id` like '%".$searchfields."%' 
325
+					OR `name` like '%" . $searchfields."%' 
326
+					OR `description` like '%" . $searchfields."%' 
327
+					OR `type` like '%" . $searchfields."%' 
328
+					OR `elements` like '%" . $searchfields."%' 
329
+					OR `display` like '%" . $searchfields."%' 
330
+					OR `display_params` like '%" . $searchfields."%' 
331
+					OR `default_text` like '%" . $searchfields."%'");
332 332
                     $tvscounts = $modx->db->getRecordCount($rs);
333 333
                     if ($tvscounts > 0) {
334
-                        $output .= '<li><b><i class="fa fa-list-alt"></i> ' . $_lang["settings_templvars"] . ' (' . $tvscounts . ')</b></li>';
334
+                        $output .= '<li><b><i class="fa fa-list-alt"></i> '.$_lang["settings_templvars"].' ('.$tvscounts.')</b></li>';
335 335
                         while ($row = $modx->db->getRow($rs)) {
336
-                            $output .= '<li' . addClassForItemList($row['locked']) . '><a href="index.php?a=301&id=' . $row['id'] . '" id="tmplvars_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['name'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>';
336
+                            $output .= '<li'.addClassForItemList($row['locked']).'><a href="index.php?a=301&id='.$row['id'].'" id="tmplvars_'.$row['id'].'" target="main">'.highlightingCoincidence($row['name'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>';
337 337
                         }
338 338
                     }
339 339
                 }
340 340
 
341 341
                 //Chunks
342 342
                 if ($modx->hasPermission('edit_chunk')) {
343
-                    $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_htmlsnippets'), "`id` like '%" . $searchfields . "%' 
344
-					OR `name` like '%" . $searchfields . "%' 
345
-					OR `description` like '%" . $searchfields . "%'     
346
-					OR `snippet` like '%" . $searchfields . "%'");
343
+                    $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_htmlsnippets'), "`id` like '%".$searchfields."%' 
344
+					OR `name` like '%" . $searchfields."%' 
345
+					OR `description` like '%" . $searchfields."%'     
346
+					OR `snippet` like '%" . $searchfields."%'");
347 347
                     $chunkscounts = $modx->db->getRecordCount($rs);
348 348
                     if ($chunkscounts > 0) {
349
-                        $output .= '<li><b><i class="fa fa-th-large"></i> ' . $_lang["manage_htmlsnippets"] . ' (' . $chunkscounts . ')</b></li>';
349
+                        $output .= '<li><b><i class="fa fa-th-large"></i> '.$_lang["manage_htmlsnippets"].' ('.$chunkscounts.')</b></li>';
350 350
                         while ($row = $modx->db->getRow($rs)) {
351
-                            $output .= '<li' . addClassForItemList($row['locked'], $row['disabled']) . '><a href="index.php?a=78&id=' . $row['id'] . '" id="htmlsnippets_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['name'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>';
351
+                            $output .= '<li'.addClassForItemList($row['locked'], $row['disabled']).'><a href="index.php?a=78&id='.$row['id'].'" id="htmlsnippets_'.$row['id'].'" target="main">'.highlightingCoincidence($row['name'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>';
352 352
                         }
353 353
                     }
354 354
                 }
355 355
 
356 356
                 //Snippets
357 357
                 if ($modx->hasPermission('edit_snippet')) {
358
-                    $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_snippets'), "`id` like '%" . $searchfields . "%' 
359
-					OR `name` like '%" . $searchfields . "%' 
360
-					OR `description` like '%" . $searchfields . "%' 
361
-					OR `snippet` like '%" . $searchfields . "%'  
362
-					OR `properties` like '%" . $searchfields . "%'      
363
-					OR `moduleguid` like '%" . $searchfields . "%'");
358
+                    $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_snippets'), "`id` like '%".$searchfields."%' 
359
+					OR `name` like '%" . $searchfields."%' 
360
+					OR `description` like '%" . $searchfields."%' 
361
+					OR `snippet` like '%" . $searchfields."%'  
362
+					OR `properties` like '%" . $searchfields."%'      
363
+					OR `moduleguid` like '%" . $searchfields."%'");
364 364
                     $snippetscounts = $modx->db->getRecordCount($rs);
365 365
                     if ($snippetscounts > 0) {
366
-                        $output .= '<li><b><i class="fa fa-code"></i> ' . $_lang["manage_snippets"] . ' (' . $snippetscounts . ')</b></li>';
366
+                        $output .= '<li><b><i class="fa fa-code"></i> '.$_lang["manage_snippets"].' ('.$snippetscounts.')</b></li>';
367 367
                         while ($row = $modx->db->getRow($rs)) {
368
-                            $output .= '<li' . addClassForItemList($row['locked'], $row['disabled']) . '><a href="index.php?a=22&id=' . $row['id'] . '" id="snippets_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['name'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>';
368
+                            $output .= '<li'.addClassForItemList($row['locked'], $row['disabled']).'><a href="index.php?a=22&id='.$row['id'].'" id="snippets_'.$row['id'].'" target="main">'.highlightingCoincidence($row['name'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>';
369 369
                         }
370 370
                     }
371 371
                 }
372 372
 
373 373
                 //plugins
374 374
                 if ($modx->hasPermission('edit_plugin')) {
375
-                    $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_plugins'), "`id` like '%" . $searchfields . "%' 
376
-					OR `name` like '%" . $searchfields . "%' 
377
-					OR `description` like '%" . $searchfields . "%' 
378
-					OR `plugincode` like '%" . $searchfields . "%'  
379
-					OR `properties` like '%" . $searchfields . "%'      
380
-					OR `moduleguid` like '%" . $searchfields . "%'");
375
+                    $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_plugins'), "`id` like '%".$searchfields."%' 
376
+					OR `name` like '%" . $searchfields."%' 
377
+					OR `description` like '%" . $searchfields."%' 
378
+					OR `plugincode` like '%" . $searchfields."%'  
379
+					OR `properties` like '%" . $searchfields."%'      
380
+					OR `moduleguid` like '%" . $searchfields."%'");
381 381
                     $pluginscounts = $modx->db->getRecordCount($rs);
382 382
                     if ($pluginscounts > 0) {
383
-                        $output .= '<li><b><i class="fa fa-plug"></i> ' . $_lang["manage_plugins"] . ' (' . $pluginscounts . ')</b></li>';
383
+                        $output .= '<li><b><i class="fa fa-plug"></i> '.$_lang["manage_plugins"].' ('.$pluginscounts.')</b></li>';
384 384
                         while ($row = $modx->db->getRow($rs)) {
385
-                            $output .= '<li' . addClassForItemList($row['locked'], $row['disabled']) . '><a href="index.php?a=102&id=' . $row['id'] . '" id="plugins_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['name'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>';
385
+                            $output .= '<li'.addClassForItemList($row['locked'], $row['disabled']).'><a href="index.php?a=102&id='.$row['id'].'" id="plugins_'.$row['id'].'" target="main">'.highlightingCoincidence($row['name'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>';
386 386
                         }
387 387
                     }
388 388
                 }
389 389
 
390 390
                 //modules
391 391
                 if ($modx->hasPermission('edit_module')) {
392
-                    $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_modules'), "`id` like '%" . $searchfields . "%' 
393
-                    OR `name` like '%" . $searchfields . "%' 
394
-                    OR `description` like '%" . $searchfields . "%' 
395
-                    OR `modulecode` like '%" . $searchfields . "%'  
396
-                    OR `properties` like '%" . $searchfields . "%'  
397
-                    OR `guid` like '%" . $searchfields . "%'      
398
-                    OR `resourcefile` like '%" . $searchfields . "%'");
392
+                    $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_modules'), "`id` like '%".$searchfields."%' 
393
+                    OR `name` like '%" . $searchfields."%' 
394
+                    OR `description` like '%" . $searchfields."%' 
395
+                    OR `modulecode` like '%" . $searchfields."%'  
396
+                    OR `properties` like '%" . $searchfields."%'  
397
+                    OR `guid` like '%" . $searchfields."%'      
398
+                    OR `resourcefile` like '%" . $searchfields."%'");
399 399
                     $modulescounts = $modx->db->getRecordCount($rs);
400 400
                     if ($modulescounts > 0) {
401
-                        $output .= '<li><b><i class="fa fa-cogs"></i> ' . $_lang["modules"] . ' (' . $modulescounts . ')</b></li>';
401
+                        $output .= '<li><b><i class="fa fa-cogs"></i> '.$_lang["modules"].' ('.$modulescounts.')</b></li>';
402 402
                         while ($row = $modx->db->getRow($rs)) {
403
-                            $output .= '<li' . addClassForItemList($row['locked'], $row['disabled']) . '><a href="index.php?a=108&id=' . $row['id'] . '" id="modules_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['name'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>';
403
+                            $output .= '<li'.addClassForItemList($row['locked'], $row['disabled']).'><a href="index.php?a=108&id='.$row['id'].'" id="modules_'.$row['id'].'" target="main">'.highlightingCoincidence($row['name'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>';
404 404
                         }
405 405
                     }
406 406
                 }
407 407
 
408
-                echo $output ? '<div class="ajaxSearchResults"><ul>' . $output . '</ul></div>' : '1';
408
+                echo $output ? '<div class="ajaxSearchResults"><ul>'.$output.'</ul></div>' : '1';
409 409
             }
410 410
 
411 411
             ?>
@@ -416,13 +416,13 @@  discard block
 block discarded – undo
416 416
 
417 417
 function highlightingCoincidence($text, $search)
418 418
 {
419
-    $regexp = '!(' . str_replace(array(
419
+    $regexp = '!('.str_replace(array(
420 420
             '(',
421 421
             ')'
422 422
         ), array(
423 423
             '\(',
424 424
             '\)'
425
-        ), trim($search)) . ')!isu';
425
+        ), trim($search)).')!isu';
426 426
     return preg_replace($regexp, '<span class="text-danger">$1</span>', $text);
427 427
 }
428 428
 
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
         $class .= ' deleted';
440 440
     }
441 441
     if ($class) {
442
-        $class = ' class="' . trim($class) . '"';
442
+        $class = ' class="'.trim($class).'"';
443 443
     }
444 444
     return $class;
445 445
 }
Please login to merge, or discard this patch.
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.
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/welcome.static.php 3 patches
Indentation   +226 added lines, -226 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3
-	die('<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.');
3
+    die('<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.');
4 4
 }
5 5
 
6 6
 unset($_SESSION['itemname']); // clear this, because it's only set for logging purposes
7 7
 
8 8
 if($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) {
9
-	// seems to be a new install - send the user to the configuration page
10
-	exit('<script type="text/javascript">document.location.href="index.php?a=17";</script>');
9
+    // seems to be a new install - send the user to the configuration page
10
+    exit('<script type="text/javascript">document.location.href="index.php?a=17";</script>');
11 11
 }
12 12
 
13 13
 // set placeholders
@@ -17,70 +17,70 @@  discard block
 block discarded – undo
17 17
 
18 18
 // setup message info
19 19
 if($modx->hasPermission('messages')) {
20
-	include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php');
21
-	$_SESSION['nrtotalmessages'] = $nrtotalmessages;
22
-	$_SESSION['nrnewmessages'] = $nrnewmessages;
23
-
24
-	$msg = array();
25
-	$msg[] = sprintf('<a href="index.php?a=10" target="main"><img src="%s" /></a>', $_style['icons_mail_large']);
26
-	$nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? ' (<span style="color:red">' . $_SESSION['nrnewmessages'] . '</span>)' : '';
27
-	$msg[] = sprintf('<span style="color:#909090;font-size:15px;font-weight:bold">&nbsp;<a class="wm_messages_inbox_link" href="index.php?a=10" target="main">[%%inbox%%]</a>%s</span><br />', $nrnewmessages);
28
-	$nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? '<span style="color:red;">' . $_SESSION['nrnewmessages'] . '</span>' : '0';
29
-	$welcome_messages = sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages);
30
-	$msg[] = sprintf('<span class="comment">%s</span>', $welcome_messages);
31
-	$ph['MessageInfo'] = join("\n", $msg);
20
+    include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php');
21
+    $_SESSION['nrtotalmessages'] = $nrtotalmessages;
22
+    $_SESSION['nrnewmessages'] = $nrnewmessages;
23
+
24
+    $msg = array();
25
+    $msg[] = sprintf('<a href="index.php?a=10" target="main"><img src="%s" /></a>', $_style['icons_mail_large']);
26
+    $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? ' (<span style="color:red">' . $_SESSION['nrnewmessages'] . '</span>)' : '';
27
+    $msg[] = sprintf('<span style="color:#909090;font-size:15px;font-weight:bold">&nbsp;<a class="wm_messages_inbox_link" href="index.php?a=10" target="main">[%%inbox%%]</a>%s</span><br />', $nrnewmessages);
28
+    $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? '<span style="color:red;">' . $_SESSION['nrnewmessages'] . '</span>' : '0';
29
+    $welcome_messages = sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages);
30
+    $msg[] = sprintf('<span class="comment">%s</span>', $welcome_messages);
31
+    $ph['MessageInfo'] = join("\n", $msg);
32 32
 }
33 33
 
34 34
 // setup icons
35 35
 if($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) {
36
-	$icon = '<i class="[&icons_security_large&]" alt="[%user_management_title%]"> </i>[%user_management_title%]';
37
-	$ph['SecurityIcon'] = wrapIcon($icon, 75);
36
+    $icon = '<i class="[&icons_security_large&]" alt="[%user_management_title%]"> </i>[%user_management_title%]';
37
+    $ph['SecurityIcon'] = wrapIcon($icon, 75);
38 38
 }
39 39
 if($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) {
40
-	$icon = '<i class="[&icons_webusers_large&]" alt="[%web_user_management_title%]"> </i>[%web_user_management_title%]';
41
-	$ph['WebUserIcon'] = wrapIcon($icon, 99);
40
+    $icon = '<i class="[&icons_webusers_large&]" alt="[%web_user_management_title%]"> </i>[%web_user_management_title%]';
41
+    $ph['WebUserIcon'] = wrapIcon($icon, 99);
42 42
 }
43 43
 if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) {
44
-	$icon = '<i class="[&icons_modules_large&]" alt="[%manage_modules%]"> </i>[%modules%]';
45
-	$ph['ModulesIcon'] = wrapIcon($icon, 106);
44
+    $icon = '<i class="[&icons_modules_large&]" alt="[%manage_modules%]"> </i>[%modules%]';
45
+    $ph['ModulesIcon'] = wrapIcon($icon, 106);
46 46
 }
47 47
 if($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) {
48
-	$icon = '<i class="[&icons_resources_large&]" alt="[%element_management%]"> </i>[%elements%]';
49
-	$ph['ResourcesIcon'] = wrapIcon($icon, 76);
48
+    $icon = '<i class="[&icons_resources_large&]" alt="[%element_management%]"> </i>[%elements%]';
49
+    $ph['ResourcesIcon'] = wrapIcon($icon, 76);
50 50
 }
51 51
 if($modx->hasPermission('bk_manager')) {
52
-	$icon = '<i class="[&icons_backup_large&]" alt="[%bk_manager%]"> </i>[%backup%]';
53
-	$ph['BackupIcon'] = wrapIcon($icon, 93);
52
+    $icon = '<i class="[&icons_backup_large&]" alt="[%bk_manager%]"> </i>[%backup%]';
53
+    $ph['BackupIcon'] = wrapIcon($icon, 93);
54 54
 }
55 55
 if($modx->hasPermission('help')) {
56
-	$icon = '<i class="[&icons_help_large&]" alt="[%help%]" /> </i>[%help%]';
57
-	$ph['HelpIcon'] = wrapIcon($icon, 9);
56
+    $icon = '<i class="[&icons_help_large&]" alt="[%help%]" /> </i>[%help%]';
57
+    $ph['HelpIcon'] = wrapIcon($icon, 9);
58 58
 }
59 59
 // do some config checks
60 60
 if(($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) {
61
-	include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php');
62
-	if($config_check_results != $_lang['configcheck_ok']) {
63
-		$ph['config_check_results'] = $config_check_results;
64
-		$ph['config_display'] = 'block';
65
-	} else {
66
-		$ph['config_display'] = 'none';
67
-	}
61
+    include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php');
62
+    if($config_check_results != $_lang['configcheck_ok']) {
63
+        $ph['config_check_results'] = $config_check_results;
64
+        $ph['config_display'] = 'block';
65
+    } else {
66
+        $ph['config_display'] = 'none';
67
+    }
68 68
 } else {
69
-	$ph['config_display'] = 'none';
69
+    $ph['config_display'] = 'none';
70 70
 }
71 71
 
72 72
 // Check logout-reminder
73 73
 if(isset($_SESSION['show_logout_reminder'])) {
74
-	switch($_SESSION['show_logout_reminder']['type']) {
75
-		case 'logout_reminder':
76
-			$date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly');
77
-			$ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']);
78
-			break;
79
-	}
80
-	$ph['show_logout_reminder'] = 'block';
81
-	unset($_SESSION['show_logout_reminder']);
74
+    switch($_SESSION['show_logout_reminder']['type']) {
75
+        case 'logout_reminder':
76
+            $date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly');
77
+            $ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']);
78
+            break;
79
+    }
80
+    $ph['show_logout_reminder'] = 'block';
81
+    unset($_SESSION['show_logout_reminder']);
82 82
 } else {
83
-	$ph['show_logout_reminder'] = 'none';
83
+    $ph['show_logout_reminder'] = 'none';
84 84
 }
85 85
 
86 86
 // Check multiple sessions
@@ -128,11 +128,11 @@  discard block
 block discarded – undo
128 128
 $nrnewmessages = '<span class="text-danger">' . $_SESSION['nrnewmessages'] . '</span>';
129 129
 
130 130
 $ph['UserInfo'] = $modx->parseText($tpl, array(
131
-	'username' => $modx->getLoginUserName(),
132
-	'role' => $_SESSION['mgrPermissions']['name'],
133
-	'lastlogin' => $modx->toDateFormat($_SESSION['mgrLastlogin'] + $server_offset_time),
134
-	'logincount' => $_SESSION['mgrLogincount'] + 1,
135
-	'msginfo' => sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages)
131
+    'username' => $modx->getLoginUserName(),
132
+    'role' => $_SESSION['mgrPermissions']['name'],
133
+    'lastlogin' => $modx->toDateFormat($_SESSION['mgrLastlogin'] + $server_offset_time),
134
+    'logincount' => $_SESSION['mgrLogincount'] + 1,
135
+    'msginfo' => sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages)
136 136
 ));
137 137
 
138 138
 $from = array();
@@ -141,13 +141,13 @@  discard block
 block discarded – undo
141 141
 $rs = $modx->db->select('*', $from, '', 'username ASC, au.sid ASC');
142 142
 
143 143
 if($modx->db->getRecordCount($rs) < 1) {
144
-	$html = '<p>[%no_active_users_found%]</p>';
144
+    $html = '<p>[%no_active_users_found%]</p>';
145 145
 } else {
146
-	include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php');
147
-	$now = $_SERVER['REQUEST_TIME'] + $server_offset_time;
148
-	$ph['now'] = strftime('%H:%M:%S', $now);
149
-	$timetocheck = ($now - (60 * 20)); //+$server_offset_time;
150
-	$html = '
146
+    include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php');
147
+    $now = $_SERVER['REQUEST_TIME'] + $server_offset_time;
148
+    $ph['now'] = strftime('%H:%M:%S', $now);
149
+    $timetocheck = ($now - (60 * 20)); //+$server_offset_time;
150
+    $html = '
151 151
 	<div class="card-body">
152 152
 		[%onlineusers_message%] 
153 153
 		<b>[+now+]</b>):
@@ -165,33 +165,33 @@  discard block
 block discarded – undo
165 165
 	</thead>
166 166
 	<tbody>';
167 167
 
168
-	$userList = array();
169
-	$userCount = array();
170
-	// Create userlist with session-count first before output
171
-	while($activeusers = $modx->db->getRow($rs)) {
172
-		$userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1;
173
-
174
-		$idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : '';
175
-		$webicon = $activeusers['internalKey'] < 0 ? '<img src="[&tree_globe&]" alt="Web user" />&nbsp;' : '';
176
-		$ip = $activeusers['ip'] === '::1' ? '127.0.0.1' : $activeusers['ip'];
177
-		$currentaction = getAction($activeusers['action'], $activeusers['id']);
178
-		$userList[] = array(
179
-			$idle,
180
-			'',
181
-			$activeusers['username'],
182
-			$webicon,
183
-			abs($activeusers['internalKey']),
184
-			$ip,
185
-			strftime('%H:%M:%S', $activeusers['lasthit'] + $server_offset_time),
186
-			$currentaction
187
-		);
188
-	}
189
-	foreach($userList as $params) {
190
-		$params[1] = $userCount[$params[4]] > 1 ? ' class="userMultipleSessions"' : '';
191
-		$html .= "\n\t\t" . vsprintf('<tr%s><td><strong%s>%s</strong></td><td>%s%s</td><td>%s</td><td>%s</td><td>%s</td></tr>', $params);
192
-	}
193
-
194
-	$html .= '
168
+    $userList = array();
169
+    $userCount = array();
170
+    // Create userlist with session-count first before output
171
+    while($activeusers = $modx->db->getRow($rs)) {
172
+        $userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1;
173
+
174
+        $idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : '';
175
+        $webicon = $activeusers['internalKey'] < 0 ? '<img src="[&tree_globe&]" alt="Web user" />&nbsp;' : '';
176
+        $ip = $activeusers['ip'] === '::1' ? '127.0.0.1' : $activeusers['ip'];
177
+        $currentaction = getAction($activeusers['action'], $activeusers['id']);
178
+        $userList[] = array(
179
+            $idle,
180
+            '',
181
+            $activeusers['username'],
182
+            $webicon,
183
+            abs($activeusers['internalKey']),
184
+            $ip,
185
+            strftime('%H:%M:%S', $activeusers['lasthit'] + $server_offset_time),
186
+            $currentaction
187
+        );
188
+    }
189
+    foreach($userList as $params) {
190
+        $params[1] = $userCount[$params[4]] > 1 ? ' class="userMultipleSessions"' : '';
191
+        $html .= "\n\t\t" . vsprintf('<tr%s><td><strong%s>%s</strong></td><td>%s%s</td><td>%s</td><td>%s</td><td>%s</td></tr>', $params);
192
+    }
193
+
194
+    $html .= '
195 195
 	</tbody>
196 196
 	</table>
197 197
 </div>
@@ -232,17 +232,17 @@  discard block
 block discarded – undo
232 232
 // invoke event OnManagerWelcomePrerender
233 233
 $evtOut = $modx->invokeEvent('OnManagerWelcomePrerender');
234 234
 if(is_array($evtOut)) {
235
-	$output = implode('', $evtOut);
236
-	$ph['OnManagerWelcomePrerender'] = $output;
235
+    $output = implode('', $evtOut);
236
+    $ph['OnManagerWelcomePrerender'] = $output;
237 237
 }
238 238
 
239 239
 $widgets['welcome'] = array(
240
-	'menuindex' => '10',
241
-	'id' => 'welcome',
242
-	'cols' => 'col-sm-6',
243
-	'icon' => 'fa-home',
244
-	'title' => '[%welcome_title%]',
245
-	'body' => '
240
+    'menuindex' => '10',
241
+    'id' => 'welcome',
242
+    'cols' => 'col-sm-6',
243
+    'icon' => 'fa-home',
244
+    'title' => '[%welcome_title%]',
245
+    'body' => '
246 246
 				<div class="wm_buttons card-body"> 
247 247
 					<!--@IF:[[#hasPermission?key=new_user]] OR [[#hasPermission?key=edit_user]]--> 
248 248
 					<span class="wm_button">
@@ -320,25 +320,25 @@  discard block
 block discarded – undo
320 320
 					</table>
321 321
 				</div>
322 322
 		',
323
-	'hide'=>'0'
323
+    'hide'=>'0'
324 324
 );
325 325
 $widgets['onlineinfo'] = array(
326
-	'menuindex' => '20',
327
-	'id' => 'onlineinfo',
328
-	'cols' => 'col-sm-6',
329
-	'icon' => 'fa-user',
330
-	'title' => '[%onlineusers_title%]',
331
-	'body' => '<div class="userstable">[+OnlineInfo+]</div>',
332
-	'hide'=>'0'
326
+    'menuindex' => '20',
327
+    'id' => 'onlineinfo',
328
+    'cols' => 'col-sm-6',
329
+    'icon' => 'fa-user',
330
+    'title' => '[%onlineusers_title%]',
331
+    'body' => '<div class="userstable">[+OnlineInfo+]</div>',
332
+    'hide'=>'0'
333 333
 );
334 334
 $widgets['recentinfo'] = array(
335
-	'menuindex' => '30',
336
-	'id' => 'modxrecent_widget',
337
-	'cols' => 'col-sm-12',
338
-	'icon' => 'fa-pencil-square-o',
339
-	'title' => '[%activity_title%]',
340
-	'body' => '<div class="widget-stage">[+RecentInfo+]</div>',
341
-	'hide'=>'0'
335
+    'menuindex' => '30',
336
+    'id' => 'modxrecent_widget',
337
+    'cols' => 'col-sm-12',
338
+    'icon' => 'fa-pencil-square-o',
339
+    'title' => '[%activity_title%]',
340
+    'body' => '<div class="widget-stage">[+RecentInfo+]</div>',
341
+    'hide'=>'0'
342 342
 );
343 343
 if ($modx->config['rss_url_news']) {
344 344
     $widgets['news'] = array(
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
 // invoke OnManagerWelcomeHome event
367 367
 $sitewidgets = $modx->invokeEvent("OnManagerWelcomeHome", array('widgets' => $widgets));
368 368
 if(is_array($sitewidgets)) {
369
-	$newwidgets = array();
369
+    $newwidgets = array();
370 370
     foreach($sitewidgets as $widget){
371 371
         $newwidgets = array_merge($newwidgets, unserialize($widget));
372 372
     }
@@ -374,21 +374,21 @@  discard block
 block discarded – undo
374 374
 }
375 375
 
376 376
 usort($widgets, function ($a, $b) {
377
-	return $a['menuindex'] - $b['menuindex'];
377
+    return $a['menuindex'] - $b['menuindex'];
378 378
 });
379 379
 
380 380
 $tpl = getTplWidget();
381 381
 $output = '';
382 382
 foreach($widgets as $widget) {
383
-	if ($widget['hide'] != '1'){
384
-		$output .= $modx->parseText($tpl, $widget);
385
-	}
383
+    if ($widget['hide'] != '1'){
384
+        $output .= $modx->parseText($tpl, $widget);
385
+    }
386 386
 }
387 387
 $ph['widgets'] = $output;
388 388
 
389 389
 // load template
390 390
 if(!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) {
391
-	$modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl';
391
+    $modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl';
392 392
 }
393 393
 
394 394
 $target = $modx->config['manager_welcome_tpl'];
@@ -396,27 +396,27 @@  discard block
 block discarded – undo
396 396
 $target = $modx->mergeSettingsContent($target);
397 397
 
398 398
 if(substr($target, 0, 1) === '@') {
399
-	if(substr($target, 0, 6) === '@CHUNK') {
400
-		$content = $modx->getChunk(trim(substr($target, 7)));
401
-	} elseif(substr($target, 0, 5) === '@FILE') {
402
-		$content = file_get_contents(trim(substr($target, 6)));
403
-	} else {
404
-		$content = '';
405
-	}
399
+    if(substr($target, 0, 6) === '@CHUNK') {
400
+        $content = $modx->getChunk(trim(substr($target, 7)));
401
+    } elseif(substr($target, 0, 5) === '@FILE') {
402
+        $content = file_get_contents(trim(substr($target, 6)));
403
+    } else {
404
+        $content = '';
405
+    }
406 406
 } else {
407
-	$chunk = $modx->getChunk($target);
408
-	if($chunk !== false && !empty($chunk)) {
409
-		$content = $chunk;
410
-	} elseif(is_file(MODX_BASE_PATH . $target)) {
411
-		$content = file_get_contents(MODX_BASE_PATH . $target);
412
-	} elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) {
413
-		$content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl');
414
-	} elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) // ClipperCMS compatible
415
-	{
416
-		$content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html');
417
-	} else {
418
-		$content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl');
419
-	}
407
+    $chunk = $modx->getChunk($target);
408
+    if($chunk !== false && !empty($chunk)) {
409
+        $content = $chunk;
410
+    } elseif(is_file(MODX_BASE_PATH . $target)) {
411
+        $content = file_get_contents(MODX_BASE_PATH . $target);
412
+    } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) {
413
+        $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl');
414
+    } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) // ClipperCMS compatible
415
+    {
416
+        $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html');
417
+    } else {
418
+        $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl');
419
+    }
420 420
 }
421 421
 
422 422
 // merge placeholders
@@ -424,8 +424,8 @@  discard block
 block discarded – undo
424 424
 $content = $modx->mergeSettingsContent($content);
425 425
 $content = $modx->parseText($content, $ph);
426 426
 if(strpos($content, '[+') !== false) {
427
-	$modx->toPlaceholders($ph);
428
-	$content = $modx->mergePlaceholderContent($content);
427
+    $modx->toPlaceholders($ph);
428
+    $content = $modx->mergePlaceholderContent($content);
429 429
 }
430 430
 $content = $modx->parseDocumentSource($content);
431 431
 $content = $modx->parseText($content, $_lang, '[%', '%]');
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
 $content = $modx->cleanUpMODXTags($content); //cleanup
434 434
 
435 435
 if($js = $modx->getRegisteredClientScripts()) {
436
-	$content .= $js;
436
+    $content .= $js;
437 437
 }
438 438
 
439 439
 echo $content;
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
 //  <a href="javascript:;" class="closed"><i class="fa fa-close"></i></a>
444 444
 //</span>
445 445
 function getTplWidget() { // recent document info
446
-	return '
446
+    return '
447 447
 		<div class="[+cols+]" id="[+id+]">
448 448
 			<div class="card"[+cardAttr+]>
449 449
 				<div class="card-header"[+headAttr+]> <i class="fa [+icon+]"></i> [+title+] </div>
@@ -454,11 +454,11 @@  discard block
 block discarded – undo
454 454
 }
455 455
 
456 456
 function getRecentInfo() { // recent document info
457
-	global $modx;
457
+    global $modx;
458 458
 
459
-	$modx->addSnippet('recentInfoList', 'getRecentInfoList');
459
+    $modx->addSnippet('recentInfoList', 'getRecentInfoList');
460 460
 
461
-	$html = '
461
+    $html = '
462 462
 			<div class="table-responsive">
463 463
 				<table class="table data">
464 464
 					<thead>
@@ -476,96 +476,96 @@  discard block
 block discarded – undo
476 476
 				</table>
477 477
 			</div>
478 478
 ';
479
-	return $html;
479
+    return $html;
480 480
 }
481 481
 
482 482
 function getRecentInfoList() {
483
-	global $modx;
484
-
485
-	$rs = $modx->db->select('*', '[+prefix+]site_content', '', 'editedon DESC', 10);
486
-
487
-	if($modx->db->getRecordCount($rs) < 1) {
488
-		return '<tr><td>[%no_activity_message%]</td></tr>';
489
-	}
490
-
491
-	$tpl = getRecentInfoRowTpl();
492
-
493
-	$btntpl['edit'] = '<a title="[%edit_resource%]" href="index.php?a=27&amp;id=[+id+]" target="main"><i class="fa fa-edit fa-fw"></i></a> ';
494
-	$btntpl['preview_btn'] = '<a [+preview_disabled+]" title="[%preview_resource%]" target="_blank" href="../index.php?&amp;id=[+id+]"><i class="fa fa-eye fa-fw"></i></a> ';
495
-
496
-	$output = array();
497
-	while($ph = $modx->db->getRow($rs)) {
498
-		$docid = $ph['id'];
499
-		$_ = $modx->getUserInfo($ph['editedby']);
500
-		$ph['username'] = $_['username'];
501
-
502
-		if($ph['deleted'] == 1) {
503
-			$ph['status'] = 'deleted text-danger';
504
-		} elseif($ph['published'] == 0) {
505
-			$ph['status'] = 'unpublished font-italic text-muted';
506
-		} else {
507
-			$ph['status'] = 'published';
508
-		}
509
-
510
-		if($modx->hasPermission('edit_document')) {
511
-			$ph['edit_btn'] = str_replace('[+id+]', $docid, $btntpl['edit']);
512
-		} else {
513
-			$ph['edit_btn'] = '';
514
-		}
515
-
516
-		$preview_disabled = ($ph['deleted'] == 1) ? 'disabled' : '';
517
-		$ph['preview_btn'] = str_replace(array(
518
-			'[+id+]',
519
-			'[+preview_disabled+]'
520
-		), array(
521
-			$docid,
522
-			$preview_disabled
523
-		), $btntpl['preview_btn']);
524
-
525
-		if($modx->hasPermission('delete_document')) {
526
-			if($ph['deleted'] == 0) {
527
-				$delete_btn = '<a onclick="return confirm(\'[%confirm_delete_record%]\')" title="[%delete_resource%]" href="index.php?a=6&amp;id=[+id+]" target="main"><i class="fa fa-trash fa-fw"></i></a> ';
528
-			} else {
529
-				$delete_btn = '<a onclick="return confirm(\'[%confirm_undelete%]\')" title="[%undelete_resource%]" href="index.php?a=63&amp;id=[+id+]" target="main"><i class="fa fa-arrow-circle-o-up fa-fw"></i></a> ';
530
-			}
531
-			$ph['delete_btn'] = str_replace('[+id+]', $docid, $delete_btn);
532
-		} else {
533
-			$ph['delete_btn'] = '';
534
-		}
535
-
536
-		if($ph['deleted'] == 1 && $ph['published'] == 0) {
537
-			$publish_btn = '<a class="disabled" title="[%publish_resource%]" href="index.php?a=61&amp;id=[+id+]" target="main"><i class="fa fa-arrow-up fa-fw"></i></a> ';
538
-		} elseif($ph['deleted'] == 1 && $ph['published'] == 1) {
539
-			$publish_btn = '<a class="disabled" title="[%publish_resource%]" href="index.php?a=61&amp;id=[+id+]" target="main"><i class="fa fa-arrow-down fa-fw"></i></a> ';
540
-		} elseif($ph['deleted'] == 0 && $ph['published'] == 0) {
541
-			$publish_btn = '<a title="[%publish_resource%]" href="index.php?a=61&amp;id=[+id+]" target="main"><i class="fa fa-arrow-up fa-fw"></i></a> ';
542
-		} else {
543
-			$publish_btn = '<a title="[%unpublish_resource%]" href="index.php?a=62&amp;id=[+id+]" target="main"><i class="fa fa-arrow-down fa-fw"></i></a> ';
544
-		}
545
-		$ph['publish_btn'] = str_replace('[+id+]', $docid, $publish_btn);
546
-
547
-		$ph['info_btn'] = str_replace('[+id+]', $docid, '<a title="[%resource_overview%]" data-toggle="collapse" data-target=".collapse[+id+]"><i class="fa fa-info fa-fw"></i></a>');
548
-
549
-		if($ph['longtitle'] == '') {
550
-			$ph['longtitle'] = '(<i>[%not_set%]</i>)';
551
-		}
552
-		if($ph['description'] == '') {
553
-			$ph['description'] = '(<i>[%not_set%]</i>)';
554
-		}
555
-		if($ph['introtext'] == '') {
556
-			$ph['introtext'] = '(<i>[%not_set%]</i>)';
557
-		}
558
-		if($ph['alias'] == '') {
559
-			$ph['alias'] = '(<i>[%not_set%]</i>)';
560
-		}
561
-
562
-		$output[] = $modx->parseText($tpl, $ph);
563
-	}
564
-	return join("\n", $output);
483
+    global $modx;
484
+
485
+    $rs = $modx->db->select('*', '[+prefix+]site_content', '', 'editedon DESC', 10);
486
+
487
+    if($modx->db->getRecordCount($rs) < 1) {
488
+        return '<tr><td>[%no_activity_message%]</td></tr>';
489
+    }
490
+
491
+    $tpl = getRecentInfoRowTpl();
492
+
493
+    $btntpl['edit'] = '<a title="[%edit_resource%]" href="index.php?a=27&amp;id=[+id+]" target="main"><i class="fa fa-edit fa-fw"></i></a> ';
494
+    $btntpl['preview_btn'] = '<a [+preview_disabled+]" title="[%preview_resource%]" target="_blank" href="../index.php?&amp;id=[+id+]"><i class="fa fa-eye fa-fw"></i></a> ';
495
+
496
+    $output = array();
497
+    while($ph = $modx->db->getRow($rs)) {
498
+        $docid = $ph['id'];
499
+        $_ = $modx->getUserInfo($ph['editedby']);
500
+        $ph['username'] = $_['username'];
501
+
502
+        if($ph['deleted'] == 1) {
503
+            $ph['status'] = 'deleted text-danger';
504
+        } elseif($ph['published'] == 0) {
505
+            $ph['status'] = 'unpublished font-italic text-muted';
506
+        } else {
507
+            $ph['status'] = 'published';
508
+        }
509
+
510
+        if($modx->hasPermission('edit_document')) {
511
+            $ph['edit_btn'] = str_replace('[+id+]', $docid, $btntpl['edit']);
512
+        } else {
513
+            $ph['edit_btn'] = '';
514
+        }
515
+
516
+        $preview_disabled = ($ph['deleted'] == 1) ? 'disabled' : '';
517
+        $ph['preview_btn'] = str_replace(array(
518
+            '[+id+]',
519
+            '[+preview_disabled+]'
520
+        ), array(
521
+            $docid,
522
+            $preview_disabled
523
+        ), $btntpl['preview_btn']);
524
+
525
+        if($modx->hasPermission('delete_document')) {
526
+            if($ph['deleted'] == 0) {
527
+                $delete_btn = '<a onclick="return confirm(\'[%confirm_delete_record%]\')" title="[%delete_resource%]" href="index.php?a=6&amp;id=[+id+]" target="main"><i class="fa fa-trash fa-fw"></i></a> ';
528
+            } else {
529
+                $delete_btn = '<a onclick="return confirm(\'[%confirm_undelete%]\')" title="[%undelete_resource%]" href="index.php?a=63&amp;id=[+id+]" target="main"><i class="fa fa-arrow-circle-o-up fa-fw"></i></a> ';
530
+            }
531
+            $ph['delete_btn'] = str_replace('[+id+]', $docid, $delete_btn);
532
+        } else {
533
+            $ph['delete_btn'] = '';
534
+        }
535
+
536
+        if($ph['deleted'] == 1 && $ph['published'] == 0) {
537
+            $publish_btn = '<a class="disabled" title="[%publish_resource%]" href="index.php?a=61&amp;id=[+id+]" target="main"><i class="fa fa-arrow-up fa-fw"></i></a> ';
538
+        } elseif($ph['deleted'] == 1 && $ph['published'] == 1) {
539
+            $publish_btn = '<a class="disabled" title="[%publish_resource%]" href="index.php?a=61&amp;id=[+id+]" target="main"><i class="fa fa-arrow-down fa-fw"></i></a> ';
540
+        } elseif($ph['deleted'] == 0 && $ph['published'] == 0) {
541
+            $publish_btn = '<a title="[%publish_resource%]" href="index.php?a=61&amp;id=[+id+]" target="main"><i class="fa fa-arrow-up fa-fw"></i></a> ';
542
+        } else {
543
+            $publish_btn = '<a title="[%unpublish_resource%]" href="index.php?a=62&amp;id=[+id+]" target="main"><i class="fa fa-arrow-down fa-fw"></i></a> ';
544
+        }
545
+        $ph['publish_btn'] = str_replace('[+id+]', $docid, $publish_btn);
546
+
547
+        $ph['info_btn'] = str_replace('[+id+]', $docid, '<a title="[%resource_overview%]" data-toggle="collapse" data-target=".collapse[+id+]"><i class="fa fa-info fa-fw"></i></a>');
548
+
549
+        if($ph['longtitle'] == '') {
550
+            $ph['longtitle'] = '(<i>[%not_set%]</i>)';
551
+        }
552
+        if($ph['description'] == '') {
553
+            $ph['description'] = '(<i>[%not_set%]</i>)';
554
+        }
555
+        if($ph['introtext'] == '') {
556
+            $ph['introtext'] = '(<i>[%not_set%]</i>)';
557
+        }
558
+        if($ph['alias'] == '') {
559
+            $ph['alias'] = '(<i>[%not_set%]</i>)';
560
+        }
561
+
562
+        $output[] = $modx->parseText($tpl, $ph);
563
+    }
564
+    return join("\n", $output);
565 565
 }
566 566
 
567 567
 function getRecentInfoRowTpl() {
568
-	$tpl = '
568
+    $tpl = '
569 569
 						<tr>
570 570
 							<td data-toggle="collapse" data-target=".collapse[+id+]" class="text-right"><span class="label label-info">[+id+]</span></td>
571 571
 							<td data-toggle="collapse" data-target=".collapse[+id+]"><a class="[+status+]" title="[%edit_resource%]" href="index.php?a=3&amp;id=[+id+]" target="main">[+pagetitle+]</a></td>
@@ -589,16 +589,16 @@  discard block
 block discarded – undo
589 589
 								</div>
590 590
 							</td>
591 591
 						</tr>';
592
-	return $tpl;
592
+    return $tpl;
593 593
 }
594 594
 
595 595
 // setup icons
596 596
 function wrapIcon($i, $action) {
597
-	return sprintf('<a href="index.php?a=%s" target="main"><span class="wm_button" style="border:0">%s</span></a>', $action, $i);
597
+    return sprintf('<a href="index.php?a=%s" target="main"><span class="wm_button" style="border:0">%s</span></a>', $action, $i);
598 598
 }
599 599
 
600 600
 function getStartUpScript() {
601
-	$script = '
601
+    $script = '
602 602
         <script type="text/javascript">
603 603
         function hideConfigCheckWarning(key) {
604 604
         	var xhr = new XMLHttpRequest();
@@ -622,5 +622,5 @@  discard block
 block discarded – undo
622 622
 		})(jQuery);        
623 623
         </script>
624 624
 ';
625
-	return $script;
625
+    return $script;
626 626
 }
Please login to merge, or discard this patch.
Spacing   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  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 6
 unset($_SESSION['itemname']); // clear this, because it's only set for logging purposes
7 7
 
8
-if($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) {
8
+if ($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) {
9 9
 	// seems to be a new install - send the user to the configuration page
10 10
 	exit('<script type="text/javascript">document.location.href="index.php?a=17";</script>');
11 11
 }
@@ -16,50 +16,50 @@  discard block
 block discarded – undo
16 16
 $_SESSION['nrnewmessages'] = 0;
17 17
 
18 18
 // setup message info
19
-if($modx->hasPermission('messages')) {
20
-	include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php');
19
+if ($modx->hasPermission('messages')) {
20
+	include_once(MODX_MANAGER_PATH.'includes/messageCount.inc.php');
21 21
 	$_SESSION['nrtotalmessages'] = $nrtotalmessages;
22 22
 	$_SESSION['nrnewmessages'] = $nrnewmessages;
23 23
 
24 24
 	$msg = array();
25 25
 	$msg[] = sprintf('<a href="index.php?a=10" target="main"><img src="%s" /></a>', $_style['icons_mail_large']);
26
-	$nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? ' (<span style="color:red">' . $_SESSION['nrnewmessages'] . '</span>)' : '';
26
+	$nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? ' (<span style="color:red">'.$_SESSION['nrnewmessages'].'</span>)' : '';
27 27
 	$msg[] = sprintf('<span style="color:#909090;font-size:15px;font-weight:bold">&nbsp;<a class="wm_messages_inbox_link" href="index.php?a=10" target="main">[%%inbox%%]</a>%s</span><br />', $nrnewmessages);
28
-	$nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? '<span style="color:red;">' . $_SESSION['nrnewmessages'] . '</span>' : '0';
28
+	$nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? '<span style="color:red;">'.$_SESSION['nrnewmessages'].'</span>' : '0';
29 29
 	$welcome_messages = sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages);
30 30
 	$msg[] = sprintf('<span class="comment">%s</span>', $welcome_messages);
31 31
 	$ph['MessageInfo'] = join("\n", $msg);
32 32
 }
33 33
 
34 34
 // setup icons
35
-if($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) {
35
+if ($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) {
36 36
 	$icon = '<i class="[&icons_security_large&]" alt="[%user_management_title%]"> </i>[%user_management_title%]';
37 37
 	$ph['SecurityIcon'] = wrapIcon($icon, 75);
38 38
 }
39
-if($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) {
39
+if ($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) {
40 40
 	$icon = '<i class="[&icons_webusers_large&]" alt="[%web_user_management_title%]"> </i>[%web_user_management_title%]';
41 41
 	$ph['WebUserIcon'] = wrapIcon($icon, 99);
42 42
 }
43
-if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) {
43
+if ($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) {
44 44
 	$icon = '<i class="[&icons_modules_large&]" alt="[%manage_modules%]"> </i>[%modules%]';
45 45
 	$ph['ModulesIcon'] = wrapIcon($icon, 106);
46 46
 }
47
-if($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) {
47
+if ($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) {
48 48
 	$icon = '<i class="[&icons_resources_large&]" alt="[%element_management%]"> </i>[%elements%]';
49 49
 	$ph['ResourcesIcon'] = wrapIcon($icon, 76);
50 50
 }
51
-if($modx->hasPermission('bk_manager')) {
51
+if ($modx->hasPermission('bk_manager')) {
52 52
 	$icon = '<i class="[&icons_backup_large&]" alt="[%bk_manager%]"> </i>[%backup%]';
53 53
 	$ph['BackupIcon'] = wrapIcon($icon, 93);
54 54
 }
55
-if($modx->hasPermission('help')) {
55
+if ($modx->hasPermission('help')) {
56 56
 	$icon = '<i class="[&icons_help_large&]" alt="[%help%]" /> </i>[%help%]';
57 57
 	$ph['HelpIcon'] = wrapIcon($icon, 9);
58 58
 }
59 59
 // do some config checks
60
-if(($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) {
61
-	include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php');
62
-	if($config_check_results != $_lang['configcheck_ok']) {
60
+if (($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) {
61
+	include_once(MODX_MANAGER_PATH.'includes/config_check.inc.php');
62
+	if ($config_check_results != $_lang['configcheck_ok']) {
63 63
 		$ph['config_check_results'] = $config_check_results;
64 64
 		$ph['config_display'] = 'block';
65 65
 	} else {
@@ -70,8 +70,8 @@  discard block
 block discarded – undo
70 70
 }
71 71
 
72 72
 // Check logout-reminder
73
-if(isset($_SESSION['show_logout_reminder'])) {
74
-	switch($_SESSION['show_logout_reminder']['type']) {
73
+if (isset($_SESSION['show_logout_reminder'])) {
74
+	switch ($_SESSION['show_logout_reminder']['type']) {
75 75
 		case 'logout_reminder':
76 76
 			$date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly');
77 77
 			$ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']);
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 	</tr>
126 126
 </table>';
127 127
 
128
-$nrnewmessages = '<span class="text-danger">' . $_SESSION['nrnewmessages'] . '</span>';
128
+$nrnewmessages = '<span class="text-danger">'.$_SESSION['nrnewmessages'].'</span>';
129 129
 
130 130
 $ph['UserInfo'] = $modx->parseText($tpl, array(
131 131
 	'username' => $modx->getLoginUserName(),
@@ -140,10 +140,10 @@  discard block
 block discarded – undo
140 140
 $from[] = " us LEFT JOIN [+prefix+]active_users au ON au.sid=us.sid WHERE au.action <> '8'";
141 141
 $rs = $modx->db->select('*', $from, '', 'username ASC, au.sid ASC');
142 142
 
143
-if($modx->db->getRecordCount($rs) < 1) {
143
+if ($modx->db->getRecordCount($rs) < 1) {
144 144
 	$html = '<p>[%no_active_users_found%]</p>';
145 145
 } else {
146
-	include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php');
146
+	include_once(MODX_MANAGER_PATH.'includes/actionlist.inc.php');
147 147
 	$now = $_SERVER['REQUEST_TIME'] + $server_offset_time;
148 148
 	$ph['now'] = strftime('%H:%M:%S', $now);
149 149
 	$timetocheck = ($now - (60 * 20)); //+$server_offset_time;
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 	$userList = array();
169 169
 	$userCount = array();
170 170
 	// Create userlist with session-count first before output
171
-	while($activeusers = $modx->db->getRow($rs)) {
171
+	while ($activeusers = $modx->db->getRow($rs)) {
172 172
 		$userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1;
173 173
 
174 174
 		$idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : '';
@@ -186,9 +186,9 @@  discard block
 block discarded – undo
186 186
 			$currentaction
187 187
 		);
188 188
 	}
189
-	foreach($userList as $params) {
189
+	foreach ($userList as $params) {
190 190
 		$params[1] = $userCount[$params[4]] > 1 ? ' class="userMultipleSessions"' : '';
191
-		$html .= "\n\t\t" . vsprintf('<tr%s><td><strong%s>%s</strong></td><td>%s%s</td><td>%s</td><td>%s</td><td>%s</td></tr>', $params);
191
+		$html .= "\n\t\t".vsprintf('<tr%s><td><strong%s>%s</strong></td><td>%s%s</td><td>%s</td><td>%s</td><td>%s</td></tr>', $params);
192 192
 	}
193 193
 
194 194
 	$html .= '
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 $ph['OnlineInfo'] = $html;
201 201
 
202 202
 // include rss feeds for important forum topics
203
-include_once(MODX_MANAGER_PATH . 'includes/rss.inc.php');
203
+include_once(MODX_MANAGER_PATH.'includes/rss.inc.php');
204 204
 $ph['modx_security_notices_content'] = $feedData['modx_security_notices_content'];
205 205
 $ph['modx_news_content'] = $feedData['modx_news_content'];
206 206
 
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 
232 232
 // invoke event OnManagerWelcomePrerender
233 233
 $evtOut = $modx->invokeEvent('OnManagerWelcomePrerender');
234
-if(is_array($evtOut)) {
234
+if (is_array($evtOut)) {
235 235
 	$output = implode('', $evtOut);
236 236
 	$ph['OnManagerWelcomePrerender'] = $output;
237 237
 }
@@ -365,57 +365,57 @@  discard block
 block discarded – undo
365 365
 
366 366
 // invoke OnManagerWelcomeHome event
367 367
 $sitewidgets = $modx->invokeEvent("OnManagerWelcomeHome", array('widgets' => $widgets));
368
-if(is_array($sitewidgets)) {
368
+if (is_array($sitewidgets)) {
369 369
 	$newwidgets = array();
370
-    foreach($sitewidgets as $widget){
370
+    foreach ($sitewidgets as $widget) {
371 371
         $newwidgets = array_merge($newwidgets, unserialize($widget));
372 372
     }
373 373
     $widgets = (count($newwidgets) > 0) ? $newwidgets : $widgets;
374 374
 }
375 375
 
376
-usort($widgets, function ($a, $b) {
376
+usort($widgets, function($a, $b){
377 377
 	return $a['menuindex'] - $b['menuindex'];
378 378
 });
379 379
 
380 380
 $tpl = getTplWidget();
381 381
 $output = '';
382
-foreach($widgets as $widget) {
383
-	if ($widget['hide'] != '1'){
382
+foreach ($widgets as $widget) {
383
+	if ($widget['hide'] != '1') {
384 384
 		$output .= $modx->parseText($tpl, $widget);
385 385
 	}
386 386
 }
387 387
 $ph['widgets'] = $output;
388 388
 
389 389
 // load template
390
-if(!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) {
391
-	$modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl';
390
+if (!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) {
391
+	$modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH.'media/style/common/welcome.tpl';
392 392
 }
393 393
 
394 394
 $target = $modx->config['manager_welcome_tpl'];
395 395
 $target = str_replace('[+base_path+]', MODX_BASE_PATH, $target);
396 396
 $target = $modx->mergeSettingsContent($target);
397 397
 
398
-if(substr($target, 0, 1) === '@') {
399
-	if(substr($target, 0, 6) === '@CHUNK') {
398
+if (substr($target, 0, 1) === '@') {
399
+	if (substr($target, 0, 6) === '@CHUNK') {
400 400
 		$content = $modx->getChunk(trim(substr($target, 7)));
401
-	} elseif(substr($target, 0, 5) === '@FILE') {
401
+	} elseif (substr($target, 0, 5) === '@FILE') {
402 402
 		$content = file_get_contents(trim(substr($target, 6)));
403 403
 	} else {
404 404
 		$content = '';
405 405
 	}
406 406
 } else {
407 407
 	$chunk = $modx->getChunk($target);
408
-	if($chunk !== false && !empty($chunk)) {
408
+	if ($chunk !== false && !empty($chunk)) {
409 409
 		$content = $chunk;
410
-	} elseif(is_file(MODX_BASE_PATH . $target)) {
411
-		$content = file_get_contents(MODX_BASE_PATH . $target);
412
-	} elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) {
413
-		$content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl');
414
-	} elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) // ClipperCMS compatible
410
+	} elseif (is_file(MODX_BASE_PATH.$target)) {
411
+		$content = file_get_contents(MODX_BASE_PATH.$target);
412
+	} elseif (is_file(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/welcome.tpl')) {
413
+		$content = file_get_contents(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/welcome.tpl');
414
+	} elseif (is_file(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/html/welcome.html')) // ClipperCMS compatible
415 415
 	{
416
-		$content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html');
416
+		$content = file_get_contents(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/html/welcome.html');
417 417
 	} else {
418
-		$content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl');
418
+		$content = file_get_contents(MODX_MANAGER_PATH.'media/style/common/welcome.tpl');
419 419
 	}
420 420
 }
421 421
 
@@ -423,7 +423,7 @@  discard block
 block discarded – undo
423 423
 $content = $modx->mergeConditionalTagsContent($content);
424 424
 $content = $modx->mergeSettingsContent($content);
425 425
 $content = $modx->parseText($content, $ph);
426
-if(strpos($content, '[+') !== false) {
426
+if (strpos($content, '[+') !== false) {
427 427
 	$modx->toPlaceholders($ph);
428 428
 	$content = $modx->mergePlaceholderContent($content);
429 429
 }
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
 $content = $modx->parseText($content, $_style, '[&', '&]');
433 433
 $content = $modx->cleanUpMODXTags($content); //cleanup
434 434
 
435
-if($js = $modx->getRegisteredClientScripts()) {
435
+if ($js = $modx->getRegisteredClientScripts()) {
436 436
 	$content .= $js;
437 437
 }
438 438
 
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
 //	<a href="javascript:;" class="setting"><i class="fa fa-cog"></i></a>
443 443
 //  <a href="javascript:;" class="closed"><i class="fa fa-close"></i></a>
444 444
 //</span>
445
-function getTplWidget() { // recent document info
445
+function getTplWidget(){ // recent document info
446 446
 	return '
447 447
 		<div class="[+cols+]" id="[+id+]">
448 448
 			<div class="card"[+cardAttr+]>
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
 ';
454 454
 }
455 455
 
456
-function getRecentInfo() { // recent document info
456
+function getRecentInfo(){ // recent document info
457 457
 	global $modx;
458 458
 
459 459
 	$modx->addSnippet('recentInfoList', 'getRecentInfoList');
@@ -479,12 +479,12 @@  discard block
 block discarded – undo
479 479
 	return $html;
480 480
 }
481 481
 
482
-function getRecentInfoList() {
482
+function getRecentInfoList(){
483 483
 	global $modx;
484 484
 
485 485
 	$rs = $modx->db->select('*', '[+prefix+]site_content', '', 'editedon DESC', 10);
486 486
 
487
-	if($modx->db->getRecordCount($rs) < 1) {
487
+	if ($modx->db->getRecordCount($rs) < 1) {
488 488
 		return '<tr><td>[%no_activity_message%]</td></tr>';
489 489
 	}
490 490
 
@@ -494,20 +494,20 @@  discard block
 block discarded – undo
494 494
 	$btntpl['preview_btn'] = '<a [+preview_disabled+]" title="[%preview_resource%]" target="_blank" href="../index.php?&amp;id=[+id+]"><i class="fa fa-eye fa-fw"></i></a> ';
495 495
 
496 496
 	$output = array();
497
-	while($ph = $modx->db->getRow($rs)) {
497
+	while ($ph = $modx->db->getRow($rs)) {
498 498
 		$docid = $ph['id'];
499 499
 		$_ = $modx->getUserInfo($ph['editedby']);
500 500
 		$ph['username'] = $_['username'];
501 501
 
502
-		if($ph['deleted'] == 1) {
502
+		if ($ph['deleted'] == 1) {
503 503
 			$ph['status'] = 'deleted text-danger';
504
-		} elseif($ph['published'] == 0) {
504
+		} elseif ($ph['published'] == 0) {
505 505
 			$ph['status'] = 'unpublished font-italic text-muted';
506 506
 		} else {
507 507
 			$ph['status'] = 'published';
508 508
 		}
509 509
 
510
-		if($modx->hasPermission('edit_document')) {
510
+		if ($modx->hasPermission('edit_document')) {
511 511
 			$ph['edit_btn'] = str_replace('[+id+]', $docid, $btntpl['edit']);
512 512
 		} else {
513 513
 			$ph['edit_btn'] = '';
@@ -522,8 +522,8 @@  discard block
 block discarded – undo
522 522
 			$preview_disabled
523 523
 		), $btntpl['preview_btn']);
524 524
 
525
-		if($modx->hasPermission('delete_document')) {
526
-			if($ph['deleted'] == 0) {
525
+		if ($modx->hasPermission('delete_document')) {
526
+			if ($ph['deleted'] == 0) {
527 527
 				$delete_btn = '<a onclick="return confirm(\'[%confirm_delete_record%]\')" title="[%delete_resource%]" href="index.php?a=6&amp;id=[+id+]" target="main"><i class="fa fa-trash fa-fw"></i></a> ';
528 528
 			} else {
529 529
 				$delete_btn = '<a onclick="return confirm(\'[%confirm_undelete%]\')" title="[%undelete_resource%]" href="index.php?a=63&amp;id=[+id+]" target="main"><i class="fa fa-arrow-circle-o-up fa-fw"></i></a> ';
@@ -533,11 +533,11 @@  discard block
 block discarded – undo
533 533
 			$ph['delete_btn'] = '';
534 534
 		}
535 535
 
536
-		if($ph['deleted'] == 1 && $ph['published'] == 0) {
536
+		if ($ph['deleted'] == 1 && $ph['published'] == 0) {
537 537
 			$publish_btn = '<a class="disabled" title="[%publish_resource%]" href="index.php?a=61&amp;id=[+id+]" target="main"><i class="fa fa-arrow-up fa-fw"></i></a> ';
538
-		} elseif($ph['deleted'] == 1 && $ph['published'] == 1) {
538
+		} elseif ($ph['deleted'] == 1 && $ph['published'] == 1) {
539 539
 			$publish_btn = '<a class="disabled" title="[%publish_resource%]" href="index.php?a=61&amp;id=[+id+]" target="main"><i class="fa fa-arrow-down fa-fw"></i></a> ';
540
-		} elseif($ph['deleted'] == 0 && $ph['published'] == 0) {
540
+		} elseif ($ph['deleted'] == 0 && $ph['published'] == 0) {
541 541
 			$publish_btn = '<a title="[%publish_resource%]" href="index.php?a=61&amp;id=[+id+]" target="main"><i class="fa fa-arrow-up fa-fw"></i></a> ';
542 542
 		} else {
543 543
 			$publish_btn = '<a title="[%unpublish_resource%]" href="index.php?a=62&amp;id=[+id+]" target="main"><i class="fa fa-arrow-down fa-fw"></i></a> ';
@@ -546,16 +546,16 @@  discard block
 block discarded – undo
546 546
 
547 547
 		$ph['info_btn'] = str_replace('[+id+]', $docid, '<a title="[%resource_overview%]" data-toggle="collapse" data-target=".collapse[+id+]"><i class="fa fa-info fa-fw"></i></a>');
548 548
 
549
-		if($ph['longtitle'] == '') {
549
+		if ($ph['longtitle'] == '') {
550 550
 			$ph['longtitle'] = '(<i>[%not_set%]</i>)';
551 551
 		}
552
-		if($ph['description'] == '') {
552
+		if ($ph['description'] == '') {
553 553
 			$ph['description'] = '(<i>[%not_set%]</i>)';
554 554
 		}
555
-		if($ph['introtext'] == '') {
555
+		if ($ph['introtext'] == '') {
556 556
 			$ph['introtext'] = '(<i>[%not_set%]</i>)';
557 557
 		}
558
-		if($ph['alias'] == '') {
558
+		if ($ph['alias'] == '') {
559 559
 			$ph['alias'] = '(<i>[%not_set%]</i>)';
560 560
 		}
561 561
 
@@ -564,7 +564,7 @@  discard block
 block discarded – undo
564 564
 	return join("\n", $output);
565 565
 }
566 566
 
567
-function getRecentInfoRowTpl() {
567
+function getRecentInfoRowTpl(){
568 568
 	$tpl = '
569 569
 						<tr>
570 570
 							<td data-toggle="collapse" data-target=".collapse[+id+]" class="text-right"><span class="label label-info">[+id+]</span></td>
@@ -593,11 +593,11 @@  discard block
 block discarded – undo
593 593
 }
594 594
 
595 595
 // setup icons
596
-function wrapIcon($i, $action) {
596
+function wrapIcon($i, $action){
597 597
 	return sprintf('<a href="index.php?a=%s" target="main"><span class="wm_button" style="border:0">%s</span></a>', $action, $i);
598 598
 }
599 599
 
600
-function getStartUpScript() {
600
+function getStartUpScript(){
601 601
 	$script = '
602 602
         <script type="text/javascript">
603 603
         function hideConfigCheckWarning(key) {
Please login to merge, or discard this patch.
Braces   +77 added lines, -67 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  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 6
 unset($_SESSION['itemname']); // clear this, because it's only set for logging purposes
7 7
 
8
-if($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) {
8
+if($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) {
9 9
 	// seems to be a new install - send the user to the configuration page
10 10
 	exit('<script type="text/javascript">document.location.href="index.php?a=17";</script>');
11 11
 }
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 $_SESSION['nrnewmessages'] = 0;
17 17
 
18 18
 // setup message info
19
-if($modx->hasPermission('messages')) {
19
+if($modx->hasPermission('messages')) {
20 20
 	include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php');
21 21
 	$_SESSION['nrtotalmessages'] = $nrtotalmessages;
22 22
 	$_SESSION['nrnewmessages'] = $nrnewmessages;
@@ -32,46 +32,46 @@  discard block
 block discarded – undo
32 32
 }
33 33
 
34 34
 // setup icons
35
-if($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) {
35
+if($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) {
36 36
 	$icon = '<i class="[&icons_security_large&]" alt="[%user_management_title%]"> </i>[%user_management_title%]';
37 37
 	$ph['SecurityIcon'] = wrapIcon($icon, 75);
38 38
 }
39
-if($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) {
39
+if($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) {
40 40
 	$icon = '<i class="[&icons_webusers_large&]" alt="[%web_user_management_title%]"> </i>[%web_user_management_title%]';
41 41
 	$ph['WebUserIcon'] = wrapIcon($icon, 99);
42 42
 }
43
-if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) {
43
+if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) {
44 44
 	$icon = '<i class="[&icons_modules_large&]" alt="[%manage_modules%]"> </i>[%modules%]';
45 45
 	$ph['ModulesIcon'] = wrapIcon($icon, 106);
46 46
 }
47
-if($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) {
47
+if($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) {
48 48
 	$icon = '<i class="[&icons_resources_large&]" alt="[%element_management%]"> </i>[%elements%]';
49 49
 	$ph['ResourcesIcon'] = wrapIcon($icon, 76);
50 50
 }
51
-if($modx->hasPermission('bk_manager')) {
51
+if($modx->hasPermission('bk_manager')) {
52 52
 	$icon = '<i class="[&icons_backup_large&]" alt="[%bk_manager%]"> </i>[%backup%]';
53 53
 	$ph['BackupIcon'] = wrapIcon($icon, 93);
54 54
 }
55
-if($modx->hasPermission('help')) {
55
+if($modx->hasPermission('help')) {
56 56
 	$icon = '<i class="[&icons_help_large&]" alt="[%help%]" /> </i>[%help%]';
57 57
 	$ph['HelpIcon'] = wrapIcon($icon, 9);
58 58
 }
59 59
 // do some config checks
60
-if(($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) {
60
+if(($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) {
61 61
 	include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php');
62
-	if($config_check_results != $_lang['configcheck_ok']) {
62
+	if($config_check_results != $_lang['configcheck_ok']) {
63 63
 		$ph['config_check_results'] = $config_check_results;
64 64
 		$ph['config_display'] = 'block';
65
-	} else {
65
+	} else {
66 66
 		$ph['config_display'] = 'none';
67 67
 	}
68
-} else {
68
+} else {
69 69
 	$ph['config_display'] = 'none';
70 70
 }
71 71
 
72 72
 // Check logout-reminder
73
-if(isset($_SESSION['show_logout_reminder'])) {
74
-	switch($_SESSION['show_logout_reminder']['type']) {
73
+if(isset($_SESSION['show_logout_reminder'])) {
74
+	switch($_SESSION['show_logout_reminder']['type']) {
75 75
 		case 'logout_reminder':
76 76
 			$date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly');
77 77
 			$ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']);
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 	}
80 80
 	$ph['show_logout_reminder'] = 'block';
81 81
 	unset($_SESSION['show_logout_reminder']);
82
-} else {
82
+} else {
83 83
 	$ph['show_logout_reminder'] = 'none';
84 84
 }
85 85
 
@@ -140,9 +140,9 @@  discard block
 block discarded – undo
140 140
 $from[] = " us LEFT JOIN [+prefix+]active_users au ON au.sid=us.sid WHERE au.action <> '8'";
141 141
 $rs = $modx->db->select('*', $from, '', 'username ASC, au.sid ASC');
142 142
 
143
-if($modx->db->getRecordCount($rs) < 1) {
143
+if($modx->db->getRecordCount($rs) < 1) {
144 144
 	$html = '<p>[%no_active_users_found%]</p>';
145
-} else {
145
+} else {
146 146
 	include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php');
147 147
 	$now = $_SERVER['REQUEST_TIME'] + $server_offset_time;
148 148
 	$ph['now'] = strftime('%H:%M:%S', $now);
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 	$userList = array();
169 169
 	$userCount = array();
170 170
 	// Create userlist with session-count first before output
171
-	while($activeusers = $modx->db->getRow($rs)) {
171
+	while($activeusers = $modx->db->getRow($rs)) {
172 172
 		$userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1;
173 173
 
174 174
 		$idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : '';
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 			$currentaction
187 187
 		);
188 188
 	}
189
-	foreach($userList as $params) {
189
+	foreach($userList as $params) {
190 190
 		$params[1] = $userCount[$params[4]] > 1 ? ' class="userMultipleSessions"' : '';
191 191
 		$html .= "\n\t\t" . vsprintf('<tr%s><td><strong%s>%s</strong></td><td>%s%s</td><td>%s</td><td>%s</td><td>%s</td></tr>', $params);
192 192
 	}
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 
232 232
 // invoke event OnManagerWelcomePrerender
233 233
 $evtOut = $modx->invokeEvent('OnManagerWelcomePrerender');
234
-if(is_array($evtOut)) {
234
+if(is_array($evtOut)) {
235 235
 	$output = implode('', $evtOut);
236 236
 	$ph['OnManagerWelcomePrerender'] = $output;
237 237
 }
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
 	'body' => '<div class="widget-stage">[+RecentInfo+]</div>',
341 341
 	'hide'=>'0'
342 342
 );
343
-if ($modx->config['rss_url_news']) {
343
+if ($modx->config['rss_url_news']) {
344 344
     $widgets['news'] = array(
345 345
         'menuindex' => '40',
346 346
         'id' => 'news',
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
         'hide'=>'0'
352 352
     );
353 353
 }
354
-if ($modx->config['rss_url_security']) {
354
+if ($modx->config['rss_url_security']) {
355 355
     $widgets['security'] = array(
356 356
         'menuindex' => '50',
357 357
         'id' => 'security',
@@ -365,29 +365,29 @@  discard block
 block discarded – undo
365 365
 
366 366
 // invoke OnManagerWelcomeHome event
367 367
 $sitewidgets = $modx->invokeEvent("OnManagerWelcomeHome", array('widgets' => $widgets));
368
-if(is_array($sitewidgets)) {
368
+if(is_array($sitewidgets)) {
369 369
 	$newwidgets = array();
370
-    foreach($sitewidgets as $widget){
370
+    foreach($sitewidgets as $widget) {
371 371
         $newwidgets = array_merge($newwidgets, unserialize($widget));
372 372
     }
373 373
     $widgets = (count($newwidgets) > 0) ? $newwidgets : $widgets;
374 374
 }
375 375
 
376
-usort($widgets, function ($a, $b) {
376
+usort($widgets, function ($a, $b){
377 377
 	return $a['menuindex'] - $b['menuindex'];
378 378
 });
379 379
 
380 380
 $tpl = getTplWidget();
381 381
 $output = '';
382
-foreach($widgets as $widget) {
383
-	if ($widget['hide'] != '1'){
382
+foreach($widgets as $widget) {
383
+	if ($widget['hide'] != '1') {
384 384
 		$output .= $modx->parseText($tpl, $widget);
385 385
 	}
386 386
 }
387 387
 $ph['widgets'] = $output;
388 388
 
389 389
 // load template
390
-if(!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) {
390
+if(!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) {
391 391
 	$modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl';
392 392
 }
393 393
 
@@ -395,26 +395,28 @@  discard block
 block discarded – undo
395 395
 $target = str_replace('[+base_path+]', MODX_BASE_PATH, $target);
396 396
 $target = $modx->mergeSettingsContent($target);
397 397
 
398
-if(substr($target, 0, 1) === '@') {
399
-	if(substr($target, 0, 6) === '@CHUNK') {
398
+if(substr($target, 0, 1) === '@') {
399
+	if(substr($target, 0, 6) === '@CHUNK') {
400 400
 		$content = $modx->getChunk(trim(substr($target, 7)));
401
-	} elseif(substr($target, 0, 5) === '@FILE') {
401
+	} elseif(substr($target, 0, 5) === '@FILE') {
402 402
 		$content = file_get_contents(trim(substr($target, 6)));
403
-	} else {
403
+	} else {
404 404
 		$content = '';
405 405
 	}
406
-} else {
406
+} else {
407 407
 	$chunk = $modx->getChunk($target);
408
-	if($chunk !== false && !empty($chunk)) {
408
+	if($chunk !== false && !empty($chunk)) {
409 409
 		$content = $chunk;
410
-	} elseif(is_file(MODX_BASE_PATH . $target)) {
410
+	} elseif(is_file(MODX_BASE_PATH . $target)) {
411 411
 		$content = file_get_contents(MODX_BASE_PATH . $target);
412
-	} elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) {
412
+	} elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) {
413 413
 		$content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl');
414
-	} elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) // ClipperCMS compatible
414
+	} elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) {
415
+	    // ClipperCMS compatible
415 416
 	{
416
-		$content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html');
417
-	} else {
417
+		$content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html');
418
+	}
419
+	} else {
418 420
 		$content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl');
419 421
 	}
420 422
 }
@@ -423,7 +425,7 @@  discard block
 block discarded – undo
423 425
 $content = $modx->mergeConditionalTagsContent($content);
424 426
 $content = $modx->mergeSettingsContent($content);
425 427
 $content = $modx->parseText($content, $ph);
426
-if(strpos($content, '[+') !== false) {
428
+if(strpos($content, '[+') !== false) {
427 429
 	$modx->toPlaceholders($ph);
428 430
 	$content = $modx->mergePlaceholderContent($content);
429 431
 }
@@ -432,7 +434,7 @@  discard block
 block discarded – undo
432 434
 $content = $modx->parseText($content, $_style, '[&', '&]');
433 435
 $content = $modx->cleanUpMODXTags($content); //cleanup
434 436
 
435
-if($js = $modx->getRegisteredClientScripts()) {
437
+if($js = $modx->getRegisteredClientScripts()) {
436 438
 	$content .= $js;
437 439
 }
438 440
 
@@ -442,7 +444,9 @@  discard block
 block discarded – undo
442 444
 //	<a href="javascript:;" class="setting"><i class="fa fa-cog"></i></a>
443 445
 //  <a href="javascript:;" class="closed"><i class="fa fa-close"></i></a>
444 446
 //</span>
445
-function getTplWidget() { // recent document info
447
+function getTplWidget()
448
+{
449
+// recent document info
446 450
 	return '
447 451
 		<div class="[+cols+]" id="[+id+]">
448 452
 			<div class="card"[+cardAttr+]>
@@ -453,7 +457,9 @@  discard block
 block discarded – undo
453 457
 ';
454 458
 }
455 459
 
456
-function getRecentInfo() { // recent document info
460
+function getRecentInfo()
461
+{
462
+// recent document info
457 463
 	global $modx;
458 464
 
459 465
 	$modx->addSnippet('recentInfoList', 'getRecentInfoList');
@@ -479,12 +485,13 @@  discard block
 block discarded – undo
479 485
 	return $html;
480 486
 }
481 487
 
482
-function getRecentInfoList() {
488
+function getRecentInfoList()
489
+{
483 490
 	global $modx;
484 491
 
485 492
 	$rs = $modx->db->select('*', '[+prefix+]site_content', '', 'editedon DESC', 10);
486 493
 
487
-	if($modx->db->getRecordCount($rs) < 1) {
494
+	if($modx->db->getRecordCount($rs) < 1) {
488 495
 		return '<tr><td>[%no_activity_message%]</td></tr>';
489 496
 	}
490 497
 
@@ -494,22 +501,22 @@  discard block
 block discarded – undo
494 501
 	$btntpl['preview_btn'] = '<a [+preview_disabled+]" title="[%preview_resource%]" target="_blank" href="../index.php?&amp;id=[+id+]"><i class="fa fa-eye fa-fw"></i></a> ';
495 502
 
496 503
 	$output = array();
497
-	while($ph = $modx->db->getRow($rs)) {
504
+	while($ph = $modx->db->getRow($rs)) {
498 505
 		$docid = $ph['id'];
499 506
 		$_ = $modx->getUserInfo($ph['editedby']);
500 507
 		$ph['username'] = $_['username'];
501 508
 
502
-		if($ph['deleted'] == 1) {
509
+		if($ph['deleted'] == 1) {
503 510
 			$ph['status'] = 'deleted text-danger';
504
-		} elseif($ph['published'] == 0) {
511
+		} elseif($ph['published'] == 0) {
505 512
 			$ph['status'] = 'unpublished font-italic text-muted';
506
-		} else {
513
+		} else {
507 514
 			$ph['status'] = 'published';
508 515
 		}
509 516
 
510
-		if($modx->hasPermission('edit_document')) {
517
+		if($modx->hasPermission('edit_document')) {
511 518
 			$ph['edit_btn'] = str_replace('[+id+]', $docid, $btntpl['edit']);
512
-		} else {
519
+		} else {
513 520
 			$ph['edit_btn'] = '';
514 521
 		}
515 522
 
@@ -522,40 +529,40 @@  discard block
 block discarded – undo
522 529
 			$preview_disabled
523 530
 		), $btntpl['preview_btn']);
524 531
 
525
-		if($modx->hasPermission('delete_document')) {
526
-			if($ph['deleted'] == 0) {
532
+		if($modx->hasPermission('delete_document')) {
533
+			if($ph['deleted'] == 0) {
527 534
 				$delete_btn = '<a onclick="return confirm(\'[%confirm_delete_record%]\')" title="[%delete_resource%]" href="index.php?a=6&amp;id=[+id+]" target="main"><i class="fa fa-trash fa-fw"></i></a> ';
528
-			} else {
535
+			} else {
529 536
 				$delete_btn = '<a onclick="return confirm(\'[%confirm_undelete%]\')" title="[%undelete_resource%]" href="index.php?a=63&amp;id=[+id+]" target="main"><i class="fa fa-arrow-circle-o-up fa-fw"></i></a> ';
530 537
 			}
531 538
 			$ph['delete_btn'] = str_replace('[+id+]', $docid, $delete_btn);
532
-		} else {
539
+		} else {
533 540
 			$ph['delete_btn'] = '';
534 541
 		}
535 542
 
536
-		if($ph['deleted'] == 1 && $ph['published'] == 0) {
543
+		if($ph['deleted'] == 1 && $ph['published'] == 0) {
537 544
 			$publish_btn = '<a class="disabled" title="[%publish_resource%]" href="index.php?a=61&amp;id=[+id+]" target="main"><i class="fa fa-arrow-up fa-fw"></i></a> ';
538
-		} elseif($ph['deleted'] == 1 && $ph['published'] == 1) {
545
+		} elseif($ph['deleted'] == 1 && $ph['published'] == 1) {
539 546
 			$publish_btn = '<a class="disabled" title="[%publish_resource%]" href="index.php?a=61&amp;id=[+id+]" target="main"><i class="fa fa-arrow-down fa-fw"></i></a> ';
540
-		} elseif($ph['deleted'] == 0 && $ph['published'] == 0) {
547
+		} elseif($ph['deleted'] == 0 && $ph['published'] == 0) {
541 548
 			$publish_btn = '<a title="[%publish_resource%]" href="index.php?a=61&amp;id=[+id+]" target="main"><i class="fa fa-arrow-up fa-fw"></i></a> ';
542
-		} else {
549
+		} else {
543 550
 			$publish_btn = '<a title="[%unpublish_resource%]" href="index.php?a=62&amp;id=[+id+]" target="main"><i class="fa fa-arrow-down fa-fw"></i></a> ';
544 551
 		}
545 552
 		$ph['publish_btn'] = str_replace('[+id+]', $docid, $publish_btn);
546 553
 
547 554
 		$ph['info_btn'] = str_replace('[+id+]', $docid, '<a title="[%resource_overview%]" data-toggle="collapse" data-target=".collapse[+id+]"><i class="fa fa-info fa-fw"></i></a>');
548 555
 
549
-		if($ph['longtitle'] == '') {
556
+		if($ph['longtitle'] == '') {
550 557
 			$ph['longtitle'] = '(<i>[%not_set%]</i>)';
551 558
 		}
552
-		if($ph['description'] == '') {
559
+		if($ph['description'] == '') {
553 560
 			$ph['description'] = '(<i>[%not_set%]</i>)';
554 561
 		}
555
-		if($ph['introtext'] == '') {
562
+		if($ph['introtext'] == '') {
556 563
 			$ph['introtext'] = '(<i>[%not_set%]</i>)';
557 564
 		}
558
-		if($ph['alias'] == '') {
565
+		if($ph['alias'] == '') {
559 566
 			$ph['alias'] = '(<i>[%not_set%]</i>)';
560 567
 		}
561 568
 
@@ -564,7 +571,8 @@  discard block
 block discarded – undo
564 571
 	return join("\n", $output);
565 572
 }
566 573
 
567
-function getRecentInfoRowTpl() {
574
+function getRecentInfoRowTpl()
575
+{
568 576
 	$tpl = '
569 577
 						<tr>
570 578
 							<td data-toggle="collapse" data-target=".collapse[+id+]" class="text-right"><span class="label label-info">[+id+]</span></td>
@@ -593,11 +601,13 @@  discard block
 block discarded – undo
593 601
 }
594 602
 
595 603
 // setup icons
596
-function wrapIcon($i, $action) {
604
+function wrapIcon($i, $action)
605
+{
597 606
 	return sprintf('<a href="index.php?a=%s" target="main"><span class="wm_button" style="border:0">%s</span></a>', $action, $i);
598 607
 }
599 608
 
600
-function getStartUpScript() {
609
+function getStartUpScript()
610
+{
601 611
 	$script = '
602 612
         <script type="text/javascript">
603 613
         function hideConfigCheckWarning(key) {
Please login to merge, or discard this patch.