Completed
Push — develop ( 6128e5...aad1a0 )
by Agel_Nash
08:50
created
manager/processors/undelete_content.processor.php 2 patches
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -3,12 +3,12 @@  discard block
 block discarded – undo
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if(!$modx->hasPermission('delete_document')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 $id = isset($_REQUEST['id'])? (int)$_REQUEST['id'] : 0;
10 10
 if($id==0) {
11
-	$modx->webAlertAndQuit($_lang["error_no_id"]);
11
+    $modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
14 14
 /************ webber ********/
@@ -31,14 +31,14 @@  discard block
 block discarded – undo
31 31
 $udperms->role = $_SESSION['mgrRole'];
32 32
 
33 33
 if(!$udperms->checkPermissions()) {
34
-	$modx->webAlertAndQuit($_lang["access_permission_denied"]);
34
+    $modx->webAlertAndQuit($_lang["access_permission_denied"]);
35 35
 }
36 36
 
37 37
 // get the timestamp on which the document was deleted.
38 38
 $rs = $modx->getDatabase()->select('deletedon', $modx->getFullTableName('site_content'), "id='{$id}' AND deleted=1");
39 39
 $deltime = $modx->getDatabase()->getValue($rs);
40 40
 if(!$deltime) {
41
-	$modx->webAlertAndQuit("Couldn't find document to determine it's date of deletion!");
41
+    $modx->webAlertAndQuit("Couldn't find document to determine it's date of deletion!");
42 42
 }
43 43
 
44 44
 $children = array();
@@ -46,20 +46,20 @@  discard block
 block discarded – undo
46 46
 getChildrenForUnDelete($id);
47 47
 
48 48
 if(count($children)>0) {
49
-	$modx->getDatabase()->update(
50
-		array(
51
-			'deleted'   => 0,
52
-			'deletedby' => 0,
53
-			'deletedon' => 0,
54
-		), $modx->getFullTableName('site_content'), "id IN(".implode(", ", $children).")");
49
+    $modx->getDatabase()->update(
50
+        array(
51
+            'deleted'   => 0,
52
+            'deletedby' => 0,
53
+            'deletedon' => 0,
54
+        ), $modx->getFullTableName('site_content'), "id IN(".implode(", ", $children).")");
55 55
 }
56 56
 //'undelete' the document.
57 57
 $modx->getDatabase()->update(
58
-	array(
59
-		'deleted'   => 0,
60
-		'deletedby' => 0,
61
-		'deletedon' => 0,
62
-	), $modx->getFullTableName('site_content'), "id='{$id}'");
58
+    array(
59
+        'deleted'   => 0,
60
+        'deletedby' => 0,
61
+        'deletedon' => 0,
62
+    ), $modx->getFullTableName('site_content'), "id='{$id}'");
63 63
 
64 64
 $modx->invokeEvent("OnDocFormUnDelete",
65 65
     array(
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,25 +1,25 @@  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('delete_document')) {
5
+if (!$modx->hasPermission('delete_document')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = isset($_REQUEST['id'])? (int)$_REQUEST['id'] : 0;
10
-if($id==0) {
9
+$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0;
10
+if ($id == 0) {
11 11
 	$modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
14 14
 /************ webber ********/
15
-$content=$modx->getDatabase()->getRow($modx->getDatabase()->select('parent, pagetitle', $modx->getFullTableName('site_content'), "id='{$id}'"));
16
-$pid=($content['parent']==0?$id:$content['parent']);
15
+$content = $modx->getDatabase()->getRow($modx->getDatabase()->select('parent, pagetitle', $modx->getFullTableName('site_content'), "id='{$id}'"));
16
+$pid = ($content['parent'] == 0 ? $id : $content['parent']);
17 17
 
18 18
 /************** webber *************/
19
-$sd=isset($_REQUEST['dir'])?'&dir='.$_REQUEST['dir']:'&dir=DESC';
20
-$sb=isset($_REQUEST['sort'])?'&sort='.$_REQUEST['sort']:'&sort=createdon';
21
-$pg=isset($_REQUEST['page'])?'&page='.(int)$_REQUEST['page']:'';
22
-$add_path=$sd.$sb.$pg;
19
+$sd = isset($_REQUEST['dir']) ? '&dir='.$_REQUEST['dir'] : '&dir=DESC';
20
+$sb = isset($_REQUEST['sort']) ? '&sort='.$_REQUEST['sort'] : '&sort=createdon';
21
+$pg = isset($_REQUEST['page']) ? '&page='.(int) $_REQUEST['page'] : '';
22
+$add_path = $sd.$sb.$pg;
23 23
 
24 24
 /***********************************/
25 25
 
@@ -30,14 +30,14 @@  discard block
 block discarded – undo
30 30
 $udperms->document = $id;
31 31
 $udperms->role = $_SESSION['mgrRole'];
32 32
 
33
-if(!$udperms->checkPermissions()) {
33
+if (!$udperms->checkPermissions()) {
34 34
 	$modx->webAlertAndQuit($_lang["access_permission_denied"]);
35 35
 }
36 36
 
37 37
 // get the timestamp on which the document was deleted.
38 38
 $rs = $modx->getDatabase()->select('deletedon', $modx->getFullTableName('site_content'), "id='{$id}' AND deleted=1");
39 39
 $deltime = $modx->getDatabase()->getValue($rs);
40
-if(!$deltime) {
40
+if (!$deltime) {
41 41
 	$modx->webAlertAndQuit("Couldn't find document to determine it's date of deletion!");
42 42
 }
43 43
 
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 
46 46
 getChildrenForUnDelete($id);
47 47
 
48
-if(count($children)>0) {
48
+if (count($children) > 0) {
49 49
 	$modx->getDatabase()->update(
50 50
 		array(
51 51
 			'deleted'   => 0,
@@ -74,5 +74,5 @@  discard block
 block discarded – undo
74 74
 $modx->clearCache('full');
75 75
 
76 76
 // finished emptying cache - redirect
77
-$header="Location: index.php?a=3&id=$pid&r=1".$add_path;
77
+$header = "Location: index.php?a=3&id=$pid&r=1".$add_path;
78 78
 header($header);
Please login to merge, or discard this patch.
manager/processors/duplicate_tmplvars.processor.php 3 patches
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -3,12 +3,12 @@  discard block
 block discarded – undo
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if(!$modx->hasPermission('edit_template')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 $id = isset($_GET['id'])? (int)$_GET['id'] : 0;
10 10
 if($id==0) {
11
-	$modx->webAlertAndQuit($_lang["error_no_id"]);
11
+    $modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
14 14
 // count duplicates
@@ -19,37 +19,37 @@  discard block
 block discarded – undo
19 19
 
20 20
 // duplicate TV
21 21
 $newid = $modx->getDatabase()->insert(
22
-	array(
23
-		'type'=>'',
24
-		'name'=>'',
25
-		'caption'=>'',
26
-		'description'=>'',
27
-		'default_text'=>'',
28
-		'elements'=>'',
29
-		'rank'=>'',
30
-		'display'=>'',
31
-		'display_params'=>'',
32
-		'category'=>'',
33
-		), $modx->getFullTableName('site_tmplvars'), // Insert into
34
-	"type, CONCAT(name, ' {$_lang['duplicated_el_suffix']}{$count}') AS name, CONCAT(caption, ' Duplicate{$count}') AS caption, description, default_text, elements, rank, display, display_params, category", $modx->getFullTableName('site_tmplvars'), "id='{$id}'"); // Copy from
22
+    array(
23
+        'type'=>'',
24
+        'name'=>'',
25
+        'caption'=>'',
26
+        'description'=>'',
27
+        'default_text'=>'',
28
+        'elements'=>'',
29
+        'rank'=>'',
30
+        'display'=>'',
31
+        'display_params'=>'',
32
+        'category'=>'',
33
+        ), $modx->getFullTableName('site_tmplvars'), // Insert into
34
+    "type, CONCAT(name, ' {$_lang['duplicated_el_suffix']}{$count}') AS name, CONCAT(caption, ' Duplicate{$count}') AS caption, description, default_text, elements, rank, display, display_params, category", $modx->getFullTableName('site_tmplvars'), "id='{$id}'"); // Copy from
35 35
 
36 36
 
37 37
 // duplicate TV Template Access Permissions
38 38
 $modx->getDatabase()->insert(
39
-	array(
40
-		'tmplvarid'=>'',
41
-		'templateid'=>'',
42
-		'rank'=>'',
43
-		), $modx->getFullTableName('site_tmplvar_templates'), // Insert into
44
-	"'{$newid}', templateid, rank", $modx->getFullTableName('site_tmplvar_templates'), "tmplvarid='{$id}'"); // Copy from
39
+    array(
40
+        'tmplvarid'=>'',
41
+        'templateid'=>'',
42
+        'rank'=>'',
43
+        ), $modx->getFullTableName('site_tmplvar_templates'), // Insert into
44
+    "'{$newid}', templateid, rank", $modx->getFullTableName('site_tmplvar_templates'), "tmplvarid='{$id}'"); // Copy from
45 45
 
46 46
 // duplicate TV Access Permissions
47 47
 $modx->getDatabase()->insert(
48
-	array(
49
-		'tmplvarid'=>'',
50
-		'documentgroup'=>'',
51
-		), $modx->getFullTableName('site_tmplvar_access'), // Insert into
52
-	"'{$newid}', documentgroup", $modx->getFullTableName('site_tmplvar_access'), "tmplvarid='{$id}'"); // Copy from
48
+    array(
49
+        'tmplvarid'=>'',
50
+        'documentgroup'=>'',
51
+        ), $modx->getFullTableName('site_tmplvar_access'), // Insert into
52
+    "'{$newid}', documentgroup", $modx->getFullTableName('site_tmplvar_access'), "tmplvarid='{$id}'"); // Copy from
53 53
 
54 54
 // Set the item name for logger
55 55
 $name = $modx->getDatabase()->getValue($modx->getDatabase()->select('name', $modx->getFullTableName('site_tmplvars'), "id='{$newid}'"));
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,20 +1,20 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5
-if(!$modx->hasPermission('edit_template')) {
5
+if (!$modx->hasPermission('edit_template')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = isset($_GET['id'])? (int)$_GET['id'] : 0;
10
-if($id==0) {
9
+$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
10
+if ($id == 0) {
11 11
 	$modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
14 14
 // count duplicates
15 15
 $name = $modx->getDatabase()->getValue($modx->getDatabase()->select('name', $modx->getFullTableName('site_tmplvars'), "id='{$id}'"));
16 16
 $count = $modx->getDatabase()->getRecordCount($modx->getDatabase()->select('name', $modx->getFullTableName('site_tmplvars'), "name LIKE '{$name} {$_lang['duplicated_el_suffix']}%'"));
17
-if($count>=1) $count = ' '.($count+1);
17
+if ($count >= 1) $count = ' '.($count + 1);
18 18
 else $count = '';
19 19
 
20 20
 // duplicate TV
@@ -56,5 +56,5 @@  discard block
 block discarded – undo
56 56
 $_SESSION['itemname'] = $name;
57 57
 
58 58
 // finish duplicating - redirect to new variable
59
-$header="Location: index.php?r=2&a=301&id=$newid";
59
+$header = "Location: index.php?r=2&a=301&id=$newid";
60 60
 header($header);
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,8 +14,11 @@
 block discarded – undo
14 14
 // count duplicates
15 15
 $name = $modx->getDatabase()->getValue($modx->getDatabase()->select('name', $modx->getFullTableName('site_tmplvars'), "id='{$id}'"));
16 16
 $count = $modx->getDatabase()->getRecordCount($modx->getDatabase()->select('name', $modx->getFullTableName('site_tmplvars'), "name LIKE '{$name} {$_lang['duplicated_el_suffix']}%'"));
17
-if($count>=1) $count = ' '.($count+1);
18
-else $count = '';
17
+if($count>=1) {
18
+    $count = ' '.($count+1);
19
+} else {
20
+    $count = '';
21
+}
19 22
 
20 23
 // duplicate TV
21 24
 $newid = $modx->getDatabase()->insert(
Please login to merge, or discard this patch.
index.php 3 patches
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -44,16 +44,16 @@  discard block
 block discarded – undo
44 44
  * Initialize Document Parsing
45 45
  * -----------------------------
46 46
  */
47
-if(!isset($_SERVER['REQUEST_TIME_FLOAT'])) $_SERVER['REQUEST_TIME_FLOAT'] = microtime(true);
47
+if (!isset($_SERVER['REQUEST_TIME_FLOAT'])) $_SERVER['REQUEST_TIME_FLOAT'] = microtime(true);
48 48
 
49
-$base_path = str_replace('\\','/',dirname(__FILE__)) . '/';
50
-if(is_file($base_path . 'assets/cache/siteManager.php'))
51
-    include_once($base_path . 'assets/cache/siteManager.php');
52
-if(!defined('MGR_DIR') && is_dir("{$base_path}manager"))
49
+$base_path = str_replace('\\', '/', dirname(__FILE__)).'/';
50
+if (is_file($base_path.'assets/cache/siteManager.php'))
51
+    include_once($base_path.'assets/cache/siteManager.php');
52
+if (!defined('MGR_DIR') && is_dir("{$base_path}manager"))
53 53
 	define('MGR_DIR', 'manager');
54
-if(is_file($base_path . 'assets/cache/siteHostnames.php'))
55
-    include_once($base_path . 'assets/cache/siteHostnames.php');
56
-if(!defined('MODX_SITE_HOSTNAMES'))
54
+if (is_file($base_path.'assets/cache/siteHostnames.php'))
55
+    include_once($base_path.'assets/cache/siteHostnames.php');
56
+if (!defined('MODX_SITE_HOSTNAMES'))
57 57
 	define('MODX_SITE_HOSTNAMES', '');
58 58
 
59 59
 // get start time
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 // set some settings, and address some IE issues
66 66
 @ini_set('url_rewriter.tags', '');
67 67
 @ini_set('session.use_trans_sid', 0);
68
-@ini_set('session.use_only_cookies',1);
68
+@ini_set('session.use_only_cookies', 1);
69 69
 session_cache_limiter('');
70 70
 header('P3P: CP="NOI NID ADMa OUR IND UNI COM NAV"'); // header for weird cookie stuff. Blame IE.
71 71
 header('Cache-Control: private, must-revalidate');
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
  */
78 78
 
79 79
 define('IN_PARSER_MODE', true);
80
-if ( ! defined('IN_MANAGER_MODE')) {
80
+if (!defined('IN_MANAGER_MODE')) {
81 81
 	define('IN_MANAGER_MODE', false);
82 82
 }
83 83
 if (!defined('MODX_API_MODE')) {
@@ -85,8 +85,8 @@  discard block
 block discarded – undo
85 85
 }
86 86
 
87 87
 // get the required includes
88
-if(! isset($database_user) || $database_user==="") {
89
-    $rt = @include_once(__DIR__ . '/' . MGR_DIR . '/includes/config.inc.php');
88
+if (!isset($database_user) || $database_user === "") {
89
+    $rt = @include_once(__DIR__.'/'.MGR_DIR.'/includes/config.inc.php');
90 90
     $path = 'install/src/template/not_installed.tpl';
91 91
     // Be sure config.inc.php is there and that it contains some important values
92 92
     if (!$rt || !$database_type || !$database_server || !$database_user || !$dbase) {
@@ -122,13 +122,13 @@  discard block
 block discarded – undo
122 122
 $modx->stopOnNotice = false;
123 123
 
124 124
 // Don't show PHP errors to the public
125
-if(!isset($_SESSION['mgrValidated']) || !$_SESSION['mgrValidated']) {
126
-    @ini_set("display_errors","0");
125
+if (!isset($_SESSION['mgrValidated']) || !$_SESSION['mgrValidated']) {
126
+    @ini_set("display_errors", "0");
127 127
 }
128 128
 
129
-if(MODX_CLI){
129
+if (MODX_CLI) {
130 130
     @set_time_limit(0);
131
-    @ini_set('max_execution_time',0);
131
+    @ini_set('max_execution_time', 0);
132 132
 }
133 133
 
134 134
 // execute the parser if index.php was not included
Please login to merge, or discard this patch.
Braces   +12 added lines, -6 removed lines patch added patch discarded remove patch
@@ -44,17 +44,23 @@  discard block
 block discarded – undo
44 44
  * Initialize Document Parsing
45 45
  * -----------------------------
46 46
  */
47
-if(!isset($_SERVER['REQUEST_TIME_FLOAT'])) $_SERVER['REQUEST_TIME_FLOAT'] = microtime(true);
47
+if(!isset($_SERVER['REQUEST_TIME_FLOAT'])) {
48
+    $_SERVER['REQUEST_TIME_FLOAT'] = microtime(true);
49
+}
48 50
 
49 51
 $base_path = str_replace('\\','/',dirname(__FILE__)) . '/';
50
-if(is_file($base_path . 'assets/cache/siteManager.php'))
52
+if(is_file($base_path . 'assets/cache/siteManager.php')) {
51 53
     include_once($base_path . 'assets/cache/siteManager.php');
52
-if(!defined('MGR_DIR') && is_dir("{$base_path}manager"))
54
+}
55
+if(!defined('MGR_DIR') && is_dir("{$base_path}manager")) {
53 56
 	define('MGR_DIR', 'manager');
54
-if(is_file($base_path . 'assets/cache/siteHostnames.php'))
57
+}
58
+if(is_file($base_path . 'assets/cache/siteHostnames.php')) {
55 59
     include_once($base_path . 'assets/cache/siteHostnames.php');
56
-if(!defined('MODX_SITE_HOSTNAMES'))
60
+}
61
+if(!defined('MODX_SITE_HOSTNAMES')) {
57 62
 	define('MODX_SITE_HOSTNAMES', '');
63
+}
58 64
 
59 65
 // get start time
60 66
 $mstart = memory_get_usage();
@@ -126,7 +132,7 @@  discard block
 block discarded – undo
126 132
     @ini_set("display_errors","0");
127 133
 }
128 134
 
129
-if(MODX_CLI){
135
+if(MODX_CLI) {
130 136
     @set_time_limit(0);
131 137
     @ini_set('max_execution_time',0);
132 138
 }
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -50,11 +50,11 @@  discard block
 block discarded – undo
50 50
 if(is_file($base_path . 'assets/cache/siteManager.php'))
51 51
     include_once($base_path . 'assets/cache/siteManager.php');
52 52
 if(!defined('MGR_DIR') && is_dir("{$base_path}manager"))
53
-	define('MGR_DIR', 'manager');
53
+    define('MGR_DIR', 'manager');
54 54
 if(is_file($base_path . 'assets/cache/siteHostnames.php'))
55 55
     include_once($base_path . 'assets/cache/siteHostnames.php');
56 56
 if(!defined('MODX_SITE_HOSTNAMES'))
57
-	define('MODX_SITE_HOSTNAMES', '');
57
+    define('MODX_SITE_HOSTNAMES', '');
58 58
 
59 59
 // get start time
60 60
 $mstart = memory_get_usage();
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 
79 79
 define('IN_PARSER_MODE', true);
80 80
 if ( ! defined('IN_MANAGER_MODE')) {
81
-	define('IN_MANAGER_MODE', false);
81
+    define('IN_MANAGER_MODE', false);
82 82
 }
83 83
 if (!defined('MODX_API_MODE')) {
84 84
     define('MODX_API_MODE', false);
Please login to merge, or discard this patch.
manager/includes/src/Legacy/Modifiers.php 3 patches
Doc Comments   +26 added lines, -1 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
     /**
102 102
      * @param string $mode
103 103
      * @param string $modifiers
104
-     * @return bool|string
104
+     * @return false|string
105 105
      */
106 106
     public function _getDelim($mode, $modifiers)
107 107
     {
@@ -151,6 +151,13 @@  discard block
 block discarded – undo
151 151
         }
152 152
     }
153 153
 
154
+    /**
155
+     * @param string $mode
156
+     * @param false|string $delim
157
+     * @param string $modifiers
158
+     *
159
+     * @return string
160
+     */
154 161
     public function _getRemainModifiers($mode, $delim, $modifiers)
155 162
     {
156 163
         if ($delim) {
@@ -187,6 +194,9 @@  discard block
 block discarded – undo
187 194
         return substr($string, strpos($string, $delim) + $len);
188 195
     }
189 196
 
197
+    /**
198
+     * @param string $modifiers
199
+     */
190 200
     public function splitEachModifiers($modifiers)
191 201
     {
192 202
         $modx = evolutionCMS();
@@ -259,6 +269,10 @@  discard block
 block discarded – undo
259 269
         return $result;
260 270
     }
261 271
 
272
+    /**
273
+     * @param string $key
274
+     * @param string $value
275
+     */
262 276
     public function parsePhx($key, $value, $modifiers)
263 277
     {
264 278
         $modx = evolutionCMS();
@@ -340,6 +354,10 @@  discard block
 block discarded – undo
340 354
         }
341 355
     }
342 356
 
357
+    /**
358
+     * @param string $cmd
359
+     * @param string $opt
360
+     */
343 361
     public function getValueFromPreset($key, $value, $cmd, $opt)
344 362
     {
345 363
         $modx = evolutionCMS();
@@ -1285,6 +1303,9 @@  discard block
 block discarded – undo
1285 1303
         return $value;
1286 1304
     }
1287 1305
 
1306
+    /**
1307
+     * @param string $cmd
1308
+     */
1288 1309
     public function includeMdfFile($cmd)
1289 1310
     {
1290 1311
         $modx = evolutionCMS();
@@ -1477,6 +1498,10 @@  discard block
 block discarded – undo
1477 1498
     }
1478 1499
 
1479 1500
     // Sets a placeholder variable which can only be access by Modifiers
1501
+
1502
+    /**
1503
+     * @param string $value
1504
+     */
1480 1505
     public function setModifiersVariable($key, $value)
1481 1506
     {
1482 1507
         if ($key != 'phx' && $key != 'dummy') {
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -199,7 +199,8 @@  discard block
 block discarded – undo
199 199
             $c = substr($modifiers, 0, 1);
200 200
             $modifiers = substr($modifiers, 1);
201 201
 
202
-            if ($c === ':' && preg_match('@^(!?[<>=]{1,2})@', $modifiers, $match)) { // :=, :!=, :<=, :>=, :!<=, :!>=
202
+            if ($c === ':' && preg_match('@^(!?[<>=]{1,2})@', $modifiers, $match)) {
203
+// :=, :!=, :<=, :>=, :!<=, :!>=
203 204
                 $c = substr($modifiers, strlen($match[1]), 1);
204 205
                 $debuginfo = "#i=0 #c=[{$c}] #m=[{$modifiers}]";
205 206
                 if ($c === '(') {
@@ -215,7 +216,8 @@  discard block
 block discarded – undo
215 216
                 $result[] = array('cmd' => trim($match[1]), 'opt' => $opt, 'debuginfo' => $debuginfo);
216 217
                 $cmd = '';
217 218
             } elseif (in_array($c, array('+', '-', '*', '/')) && preg_match('@^[0-9]+@', $modifiers,
218
-                    $match)) { // :+3, :-3, :*3 ...
219
+                    $match)) {
220
+// :+3, :-3, :*3 ...
219 221
                 $modifiers = substr($modifiers, strlen($match[0]));
220 222
                 $result[] = array('cmd' => 'math', 'opt' => '%s' . $c . $match[0]);
221 223
                 $cmd = '';
Please login to merge, or discard this patch.
Spacing   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
         }
83 83
         $this->srcValue = $value;
84 84
         $modifiers = trim($modifiers);
85
-        $modifiers = ':' . trim($modifiers, ':');
85
+        $modifiers = ':'.trim($modifiers, ':');
86 86
         $modifiers = str_replace(array("\r\n", "\r"), "\n", $modifiers);
87 87
         $modifiers = $this->splitEachModifiers($modifiers);
88 88
 
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
     {
130 130
         if ($delim) {
131 131
             if ($mode == '(') {
132
-                return substr($modifiers, 1, strpos($modifiers, $delim . ')') - 1);
132
+                return substr($modifiers, 1, strpos($modifiers, $delim.')') - 1);
133 133
             }
134 134
 
135 135
             return substr($modifiers, 1, strpos($modifiers, $delim, 1) - 1);
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
     {
156 156
         if ($delim) {
157 157
             if ($mode == '(') {
158
-                return $this->_fetchContent($modifiers, $delim . ')');
158
+                return $this->_fetchContent($modifiers, $delim.')');
159 159
             } else {
160 160
                 $modifiers = trim($modifiers);
161 161
                 $modifiers = substr($modifiers, 1);
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
             } elseif (in_array($c, array('+', '-', '*', '/')) && preg_match('@^[0-9]+@', $modifiers,
218 218
                     $match)) { // :+3, :-3, :*3 ...
219 219
                 $modifiers = substr($modifiers, strlen($match[0]));
220
-                $result[] = array('cmd' => 'math', 'opt' => '%s' . $c . $match[0]);
220
+                $result[] = array('cmd' => 'math', 'opt' => '%s'.$c.$match[0]);
221 221
                 $cmd = '';
222 222
             } elseif ($c === '(' || $c === '=') {
223 223
                 $modifiers = $m1 = trim($modifiers);
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
         }
333 333
 
334 334
         $_ = explode(',',
335
-            $this->condModifiers . ',_default,default,if,input,or,and,show,this,select,switch,then,else,id,ifempty,smart_desc,smart_description,summary');
335
+            $this->condModifiers.',_default,default,if,input,or,and,show,this,select,switch,then,else,id,ifempty,smart_desc,smart_description,summary');
336 336
         if (in_array($cmd, $_)) {
337 337
             return false;
338 338
         } else {
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
             case 'eq':
366 366
             case 'is':
367 367
             case 'equals':
368
-                $this->condition[] = (int)($value == $opt);
368
+                $this->condition[] = (int) ($value == $opt);
369 369
                 break;
370 370
             case 'neq':
371 371
             case 'ne':
@@ -373,59 +373,59 @@  discard block
 block discarded – undo
373 373
             case 'isnot':
374 374
             case 'isnt':
375 375
             case 'not':
376
-                $this->condition[] = (int)($value != $opt);
376
+                $this->condition[] = (int) ($value != $opt);
377 377
                 break;
378 378
             case '%':
379
-                $this->condition[] = (int)($value % $opt == 0);
379
+                $this->condition[] = (int) ($value % $opt == 0);
380 380
                 break;
381 381
             case 'isempty':
382
-                $this->condition[] = (int)(empty($value));
382
+                $this->condition[] = (int) (empty($value));
383 383
                 break;
384 384
             case 'isntempty':
385 385
             case 'isnotempty':
386
-                $this->condition[] = (int)(!empty($value));
386
+                $this->condition[] = (int) (!empty($value));
387 387
                 break;
388 388
             case '>=':
389 389
             case 'gte':
390 390
             case 'eg':
391 391
             case 'isgte':
392
-                $this->condition[] = (int)($value >= $opt);
392
+                $this->condition[] = (int) ($value >= $opt);
393 393
                 break;
394 394
             case '<=':
395 395
             case 'lte':
396 396
             case 'el':
397 397
             case 'islte':
398
-                $this->condition[] = (int)($value <= $opt);
398
+                $this->condition[] = (int) ($value <= $opt);
399 399
                 break;
400 400
             case '>':
401 401
             case 'gt':
402 402
             case 'greaterthan':
403 403
             case 'isgreaterthan':
404 404
             case 'isgt':
405
-                $this->condition[] = (int)($value > $opt);
405
+                $this->condition[] = (int) ($value > $opt);
406 406
                 break;
407 407
             case '<':
408 408
             case 'lt':
409 409
             case 'lowerthan':
410 410
             case 'islowerthan':
411 411
             case 'islt':
412
-                $this->condition[] = (int)($value < $opt);
412
+                $this->condition[] = (int) ($value < $opt);
413 413
                 break;
414 414
             case 'find':
415
-                $this->condition[] = (int)(strpos($value, $opt) !== false);
415
+                $this->condition[] = (int) (strpos($value, $opt) !== false);
416 416
                 break;
417 417
             case 'inarray':
418 418
             case 'in_array':
419 419
             case 'in':
420 420
                 $opt = explode(',', $opt);
421
-                $this->condition[] = (int)(in_array($value, $opt) !== false);
421
+                $this->condition[] = (int) (in_array($value, $opt) !== false);
422 422
                 break;
423 423
             case 'wildcard_match':
424 424
             case 'wcard_match':
425 425
             case 'wildcard':
426 426
             case 'wcard':
427 427
             case 'fnmatch':
428
-                $this->condition[] = (int)(fnmatch($opt, $value) !== false);
428
+                $this->condition[] = (int) (fnmatch($opt, $value) !== false);
429 429
                 break;
430 430
             case 'is_file':
431 431
             case 'is_dir':
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
                 if (strpos($path, $modx->config['base_path']) === false) {
444 444
                     $path = ltrim($path, '/');
445 445
                 }
446
-                $this->condition[] = (int)($cmd($path) !== false);
446
+                $this->condition[] = (int) ($cmd($path) !== false);
447 447
                 break;
448 448
             case 'is_image':
449 449
                 if (!$opt) {
@@ -456,13 +456,13 @@  discard block
 block discarded – undo
456 456
                     break;
457 457
                 }
458 458
                 $_ = getimagesize($path);
459
-                $this->condition[] = (int)($_[0]);
459
+                $this->condition[] = (int) ($_[0]);
460 460
                 break;
461 461
             case 'regex':
462 462
             case 'preg':
463 463
             case 'preg_match':
464 464
             case 'isinrole':
465
-                $this->condition[] = (int)(preg_match($opt, $value));
465
+                $this->condition[] = (int) (preg_match($opt, $value));
466 466
                 break;
467 467
             case 'ir':
468 468
             case 'memberof':
@@ -479,7 +479,7 @@  discard block
 block discarded – undo
479 479
             case 'show':
480 480
             case 'this':
481 481
                 $conditional = implode(' ', $this->condition);
482
-                $isvalid = (int)(eval("return ({$conditional});"));
482
+                $isvalid = (int) (eval("return ({$conditional});"));
483 483
                 if ($isvalid) {
484 484
                     return $this->srcValue;
485 485
                 }
@@ -487,7 +487,7 @@  discard block
 block discarded – undo
487 487
                 return null;
488 488
             case 'then':
489 489
                 $conditional = implode(' ', $this->condition);
490
-                $isvalid = (int)eval("return ({$conditional});");
490
+                $isvalid = (int) eval("return ({$conditional});");
491 491
                 if ($isvalid) {
492 492
                     return $opt;
493 493
                 }
@@ -495,7 +495,7 @@  discard block
 block discarded – undo
495 495
                 return null;
496 496
             case 'else':
497 497
                 $conditional = implode(' ', $this->condition);
498
-                $isvalid = (int)eval("return ({$conditional});");
498
+                $isvalid = (int) eval("return ({$conditional});");
499 499
                 if (!$isvalid) {
500 500
                     return $opt;
501 501
                 }
@@ -654,7 +654,7 @@  discard block
 block discarded – undo
654 654
                 return $this->strpos($value, $opt);
655 655
             case 'wordwrap':
656 656
                 // default: 70
657
-                $wrapat = (int)$opt > 0 ? (int)$opt : 70;
657
+                $wrapat = (int) $opt > 0 ? (int) $opt : 70;
658 658
                 if (version_compare(PHP_VERSION, '5.3.0') >= 0) {
659 659
                     return $this->includeMdfFile('wordwrap');
660 660
                 } else {
@@ -686,7 +686,7 @@  discard block
 block discarded – undo
686 686
                 if (strpos($opt, ',') !== false) {
687 687
                     list($b, $e) = explode(',', $opt, 2);
688 688
 
689
-                    return $this->substr($value, $b, (int)$e);
689
+                    return $this->substr($value, $b, (int) $e);
690 690
                 } else {
691 691
                     return $this->substr($value, $opt);
692 692
                 }
@@ -705,9 +705,9 @@  discard block
 block discarded – undo
705 705
                     $str = '';
706 706
                 }
707 707
                 if (preg_match('/^[1-9][0-9]*$/', $len)) {
708
-                    return $this->substr($value, 0, $len) . $str;
708
+                    return $this->substr($value, 0, $len).$str;
709 709
                 } elseif (preg_match('/^\-[1-9][0-9]*$/', $len)) {
710
-                    return $str . $this->substr($value, $len);
710
+                    return $str.$this->substr($value, $len);
711 711
                 }
712 712
                 break;
713 713
             case 'summary':
@@ -772,7 +772,7 @@  discard block
 block discarded – undo
772 772
             case 'concatenate':
773 773
             case '.':
774 774
                 if ($value !== '') {
775
-                    return $value . $opt;
775
+                    return $value.$opt;
776 776
                 }
777 777
                 break;
778 778
             case 'sprintf':
@@ -790,7 +790,7 @@  discard block
 block discarded – undo
790 790
             case 'money_format':
791 791
                 setlocale(LC_MONETARY, setlocale(LC_TIME, 0));
792 792
                 if ($value !== '') {
793
-                    return money_format($opt, (double)$value);
793
+                    return money_format($opt, (double) $value);
794 794
                 }
795 795
                 break;
796 796
             case 'tobool':
@@ -865,7 +865,7 @@  discard block
 block discarded – undo
865 865
                 return strtotime($value);
866 866
             #####  mathematical function
867 867
             case 'toint':
868
-                return (int)$value;
868
+                return (int) $value;
869 869
             case 'tofloat':
870 870
                 return floatval($value);
871 871
             case 'round':
@@ -883,7 +883,7 @@  discard block
 block discarded – undo
883 883
                 return $cmd($value);
884 884
             case 'math':
885 885
             case 'calc':
886
-                $value = (int)$value;
886
+                $value = (int) $value;
887 887
                 if (empty($value)) {
888 888
                     $value = '0';
889 889
                 }
@@ -1026,7 +1026,7 @@  discard block
 block discarded – undo
1026 1026
                 $where = implode(' AND ', $where);
1027 1027
                 $children = $modx->getDocumentChildren($value, $published, '0', 'id', $where);
1028 1028
                 $result = array();
1029
-                foreach ((array)$children as $child) {
1029
+                foreach ((array) $children as $child) {
1030 1030
                     $result[] = $child['id'];
1031 1031
                 }
1032 1032
 
@@ -1130,7 +1130,7 @@  discard block
 block discarded – undo
1130 1130
                     $opt .= '/';
1131 1131
                 }
1132 1132
 
1133
-                $filename = MODX_BASE_PATH . $opt . $filename;
1133
+                $filename = MODX_BASE_PATH.$opt.$filename;
1134 1134
 
1135 1135
                 if (is_file($filename)) {
1136 1136
                     clearstatcache();
@@ -1291,7 +1291,7 @@  discard block
 block discarded – undo
1291 1291
         $value = $this->value;
1292 1292
         $opt = $this->opt;
1293 1293
 
1294
-        return include(MODX_MANAGER_PATH . "includes/extenders/modifiers/mdf_{$cmd}.inc.php");
1294
+        return include(MODX_MANAGER_PATH."includes/extenders/modifiers/mdf_{$cmd}.inc.php");
1295 1295
     }
1296 1296
 
1297 1297
     public function getValueFromElement($key, $value, $cmd, $opt)
@@ -1307,13 +1307,13 @@  discard block
 block discarded – undo
1307 1307
                 $row = $modx->getDatabase()->getRow($result);
1308 1308
                 $php = $row['snippet'];
1309 1309
             } elseif ($total == 0) {
1310
-                $assets_path = MODX_BASE_PATH . 'assets/';
1311
-                if (is_file($assets_path . "modifiers/mdf_{$cmd}.inc.php")) {
1312
-                    $modifiers_path = $assets_path . "modifiers/mdf_{$cmd}.inc.php";
1313
-                } elseif (is_file($assets_path . "plugins/phx/modifiers/{$cmd}.phx.php")) {
1314
-                    $modifiers_path = $assets_path . "plugins/phx/modifiers/{$cmd}.phx.php";
1315
-                } elseif (is_file(MODX_MANAGER_PATH . "includes/extenders/modifiers/mdf_{$cmd}.inc.php")) {
1316
-                    $modifiers_path = MODX_MANAGER_PATH . "includes/extenders/modifiers/mdf_{$cmd}.inc.php";
1310
+                $assets_path = MODX_BASE_PATH.'assets/';
1311
+                if (is_file($assets_path."modifiers/mdf_{$cmd}.inc.php")) {
1312
+                    $modifiers_path = $assets_path."modifiers/mdf_{$cmd}.inc.php";
1313
+                } elseif (is_file($assets_path."plugins/phx/modifiers/{$cmd}.phx.php")) {
1314
+                    $modifiers_path = $assets_path."plugins/phx/modifiers/{$cmd}.phx.php";
1315
+                } elseif (is_file(MODX_MANAGER_PATH."includes/extenders/modifiers/mdf_{$cmd}.inc.php")) {
1316
+                    $modifiers_path = MODX_MANAGER_PATH."includes/extenders/modifiers/mdf_{$cmd}.inc.php";
1317 1317
                 } else {
1318 1318
                     $modifiers_path = false;
1319 1319
                 }
@@ -1331,7 +1331,7 @@  discard block
 block discarded – undo
1331 1331
                         $php = substr($php, 0, -2);
1332 1332
                     }
1333 1333
                     if ($this->elmName !== '') {
1334
-                        $modx->snippetCache[$this->elmName . 'Props'] = '';
1334
+                        $modx->snippetCache[$this->elmName.'Props'] = '';
1335 1335
                     }
1336 1336
                 } else {
1337 1337
                     $php = false;
@@ -1368,7 +1368,7 @@  discard block
 block discarded – undo
1368 1368
             $custom = eval($php);
1369 1369
             $msg = ob_get_contents();
1370 1370
             if ($value === $this->bt) {
1371
-                $value = $msg . $custom;
1371
+                $value = $msg.$custom;
1372 1372
             }
1373 1373
             ob_end_clean();
1374 1374
         } elseif ($html !== false && isset($value) && $value !== '') {
@@ -1542,7 +1542,7 @@  discard block
 block discarded – undo
1542 1542
     public function ucfirst($str)
1543 1543
     {
1544 1544
         if (function_exists('mb_strtoupper')) {
1545
-            return mb_strtoupper($this->substr($str, 0, 1)) . $this->substr($str, 1, $this->strlen($str));
1545
+            return mb_strtoupper($this->substr($str, 0, 1)).$this->substr($str, 1, $this->strlen($str));
1546 1546
         }
1547 1547
 
1548 1548
         return ucfirst($str);
@@ -1551,7 +1551,7 @@  discard block
 block discarded – undo
1551 1551
     public function lcfirst($str)
1552 1552
     {
1553 1553
         if (function_exists('mb_strtolower')) {
1554
-            return mb_strtolower($this->substr($str, 0, 1)) . $this->substr($str, 1, $this->strlen($str));
1554
+            return mb_strtolower($this->substr($str, 0, 1)).$this->substr($str, 1, $this->strlen($str));
1555 1555
         }
1556 1556
 
1557 1557
         return lcfirst($str);
Please login to merge, or discard this patch.
manager/actions/mutate_module_resources.dynamic.php 2 patches
Indentation   +85 added lines, -85 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@  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(!$modx->hasPermission('edit_module')) {
7
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
8 8
 }
9 9
 
10 10
 $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
@@ -26,91 +26,91 @@  discard block
 block discarded – undo
26 26
 // check to see the  editor isn't locked
27 27
 $rs = $modx->getDatabase()->select('username', $tbl_active_users, "action=108 AND id='{$id}' AND internalKey!='" . $modx->getLoginUserID() . "'");
28 28
 if($username = $modx->getDatabase()->getValue($rs)) {
29
-	$modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $username, 'module'));
29
+    $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $username, 'module'));
30 30
 }
31 31
 // end check for lock
32 32
 
33 33
 // take action
34 34
 switch($_REQUEST['op']) {
35
-	case 'add':
36
-		// convert ids to numbers
37
-		$opids = array_filter(array_map('intval', explode(',', $_REQUEST['newids'])));
38
-
39
-		if(count($opids) > 0) {
40
-			// 1-snips, 2-tpls, 3-tvs, 4-chunks, 5-plugins, 6-docs
41
-			$rt = strtolower($_REQUEST["rt"]);
42
-			if($rt == 'chunk') {
43
-				$type = 10;
44
-			}
45
-			if($rt == 'doc') {
46
-				$type = 20;
47
-			}
48
-			if($rt == 'plug') {
49
-				$type = 30;
50
-			}
51
-			if($rt == 'snip') {
52
-				$type = 40;
53
-			}
54
-			if($rt == 'tpl') {
55
-				$type = 50;
56
-			}
57
-			if($rt == 'tv') {
58
-				$type = 60;
59
-			}
60
-			$modx->getDatabase()->delete($tbl_site_module_depobj, "module='{$id}' AND resource IN (" . implode(',', $opids) . ") AND type='{$type}'");
61
-			foreach($opids as $opid) {
62
-				$modx->getDatabase()->insert(array(
63
-					'module' => $id,
64
-					'resource' => $opid,
65
-					'type' => $type,
66
-				), $tbl_site_module_depobj);
67
-			}
68
-		}
69
-		break;
70
-	case 'del':
71
-		// convert ids to numbers
72
-		$opids = array_filter(array_map('intval', $_REQUEST['depid']));
73
-
74
-		// get resources that needs to be removed
75
-		$ds = $modx->getDatabase()->select('*', $tbl_site_module_depobj, "id IN (" . implode(",", $opids) . ")");
76
-		// loop through resources and look for plugins and snippets
77
-		$plids = array();
78
-		$snid = array();
79
-		while($row = $modx->getDatabase()->getRow($ds)) {
80
-			if($row['type'] == '30') {
81
-				$plids[$i] = $row['resource'];
82
-			}
83
-			if($row['type'] == '40') {
84
-				$snids[$i] = $row['resource'];
85
-			}
86
-		}
87
-		// get guid
88
-		$ds = $modx->getDatabase()->select('guid', $tbl_site_modules, "id='{$id}'");
89
-		$guid = $modx->getDatabase()->getValue($ds);
90
-		// reset moduleguid for deleted resources
91
-		if(($cp = count($plids)) || ($cs = count($snids))) {
92
-			if($cp) {
93
-				$modx->getDatabase()->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $plids) . ") AND moduleguid='{$guid}'");
94
-			}
95
-			if($cs) {
96
-				$modx->getDatabase()->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $snids) . ") AND moduleguid='{$guid}'");
97
-			}
98
-			// reset cache
99
-			$modx->clearCache('full');
100
-		}
101
-		$modx->getDatabase()->delete($tbl_site_module_depobj, "id IN (" . implode(',', $opids) . ")");
102
-		break;
35
+    case 'add':
36
+        // convert ids to numbers
37
+        $opids = array_filter(array_map('intval', explode(',', $_REQUEST['newids'])));
38
+
39
+        if(count($opids) > 0) {
40
+            // 1-snips, 2-tpls, 3-tvs, 4-chunks, 5-plugins, 6-docs
41
+            $rt = strtolower($_REQUEST["rt"]);
42
+            if($rt == 'chunk') {
43
+                $type = 10;
44
+            }
45
+            if($rt == 'doc') {
46
+                $type = 20;
47
+            }
48
+            if($rt == 'plug') {
49
+                $type = 30;
50
+            }
51
+            if($rt == 'snip') {
52
+                $type = 40;
53
+            }
54
+            if($rt == 'tpl') {
55
+                $type = 50;
56
+            }
57
+            if($rt == 'tv') {
58
+                $type = 60;
59
+            }
60
+            $modx->getDatabase()->delete($tbl_site_module_depobj, "module='{$id}' AND resource IN (" . implode(',', $opids) . ") AND type='{$type}'");
61
+            foreach($opids as $opid) {
62
+                $modx->getDatabase()->insert(array(
63
+                    'module' => $id,
64
+                    'resource' => $opid,
65
+                    'type' => $type,
66
+                ), $tbl_site_module_depobj);
67
+            }
68
+        }
69
+        break;
70
+    case 'del':
71
+        // convert ids to numbers
72
+        $opids = array_filter(array_map('intval', $_REQUEST['depid']));
73
+
74
+        // get resources that needs to be removed
75
+        $ds = $modx->getDatabase()->select('*', $tbl_site_module_depobj, "id IN (" . implode(",", $opids) . ")");
76
+        // loop through resources and look for plugins and snippets
77
+        $plids = array();
78
+        $snid = array();
79
+        while($row = $modx->getDatabase()->getRow($ds)) {
80
+            if($row['type'] == '30') {
81
+                $plids[$i] = $row['resource'];
82
+            }
83
+            if($row['type'] == '40') {
84
+                $snids[$i] = $row['resource'];
85
+            }
86
+        }
87
+        // get guid
88
+        $ds = $modx->getDatabase()->select('guid', $tbl_site_modules, "id='{$id}'");
89
+        $guid = $modx->getDatabase()->getValue($ds);
90
+        // reset moduleguid for deleted resources
91
+        if(($cp = count($plids)) || ($cs = count($snids))) {
92
+            if($cp) {
93
+                $modx->getDatabase()->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $plids) . ") AND moduleguid='{$guid}'");
94
+            }
95
+            if($cs) {
96
+                $modx->getDatabase()->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $snids) . ") AND moduleguid='{$guid}'");
97
+            }
98
+            // reset cache
99
+            $modx->clearCache('full');
100
+        }
101
+        $modx->getDatabase()->delete($tbl_site_module_depobj, "id IN (" . implode(',', $opids) . ")");
102
+        break;
103 103
 }
104 104
 
105 105
 // load record
106 106
 $rs = $modx->getDatabase()->select('*', $tbl_site_modules, "id = '{$id}'");
107 107
 $content = $modx->getDatabase()->getRow($rs);
108 108
 if(!$content) {
109
-	$modx->webAlertAndQuit("Module not found for id '{$id}'.");
109
+    $modx->webAlertAndQuit("Module not found for id '{$id}'.");
110 110
 }
111 111
 $_SESSION['itemname'] = $content['name'];
112 112
 if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
113
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
113
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
114 114
 }
115 115
 
116 116
 ?>
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
 				<tr>
204 204
 					<td valign="top" align="left">
205 205
 						<?php
206
-						$ds = $modx->getDatabase()->select("smd.id,COALESCE(ss.name,st.templatename,sv.name,sc.name,sp.name,sd.pagetitle) as name,
206
+                        $ds = $modx->getDatabase()->select("smd.id,COALESCE(ss.name,st.templatename,sv.name,sc.name,sp.name,sd.pagetitle) as name,
207 207
 				CASE smd.type
208 208
 					WHEN 10 THEN 'Chunk'
209 209
 					WHEN 20 THEN 'Document'
@@ -218,17 +218,17 @@  discard block
 block discarded – undo
218 218
 					LEFT JOIN {$tbl_site_snippets} AS ss ON ss.id = smd.resource AND smd.type = '40'
219 219
 					LEFT JOIN {$tbl_site_templates} AS st ON st.id = smd.resource AND smd.type = '50'
220 220
 					LEFT JOIN {$tbl_site_tmplvars} AS sv ON sv.id = smd.resource AND smd.type = '60'", "smd.module={$id}", "smd.type,name");
221
-						$grd = new \EvolutionCMS\Support\DataGrid('', $ds, 0); // set page size to 0 t show all items
222
-						$grd->noRecordMsg = $_lang["no_records_found"];
223
-						$grd->cssClass = "grid";
224
-						$grd->columnHeaderClass = "gridHeader";
225
-						$grd->itemClass = "gridItem";
226
-						$grd->altItemClass = "gridAltItem";
227
-						$grd->columns = $_lang["element_name"] . " ," . $_lang["type"];
228
-						$grd->colTypes = "template:<input type='checkbox' name='depid[]' value='[+id+]'> [+value+]";
229
-						$grd->fields = "name,type";
230
-						echo $grd->render();
231
-						?>
221
+                        $grd = new \EvolutionCMS\Support\DataGrid('', $ds, 0); // set page size to 0 t show all items
222
+                        $grd->noRecordMsg = $_lang["no_records_found"];
223
+                        $grd->cssClass = "grid";
224
+                        $grd->columnHeaderClass = "gridHeader";
225
+                        $grd->itemClass = "gridItem";
226
+                        $grd->altItemClass = "gridAltItem";
227
+                        $grd->columns = $_lang["element_name"] . " ," . $_lang["type"];
228
+                        $grd->colTypes = "template:<input type='checkbox' name='depid[]' value='[+id+]'> [+value+]";
229
+                        $grd->fields = "name,type";
230
+                        echo $grd->render();
231
+                        ?>
232 232
 					</td>
233 233
 					<td valign="top" style="width: 150px;">
234 234
 						<a class="btn btn-block btn-danger text-left" style="margin-bottom:10px;" href="javascript:;" onclick="removeDependencies();return false;"><i class="<?php echo $_style["actions_delete"] ?>"></i> <?php echo $_lang['remove']; ?></a>
Please login to merge, or discard this patch.
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
 	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 
6
-if(!$modx->hasPermission('edit_module')) {
6
+if (!$modx->hasPermission('edit_module')) {
7 7
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
8 8
 }
9 9
 
10
-$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
10
+$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0;
11 11
 
12 12
 // Get table names (alphabetical)
13 13
 $tbl_active_users = $modx->getFullTableName('active_users');
@@ -24,41 +24,41 @@  discard block
 block discarded – undo
24 24
 $modx->getManagerApi()->initPageViewState();
25 25
 
26 26
 // check to see the  editor isn't locked
27
-$rs = $modx->getDatabase()->select('username', $tbl_active_users, "action=108 AND id='{$id}' AND internalKey!='" . $modx->getLoginUserID() . "'");
28
-if($username = $modx->getDatabase()->getValue($rs)) {
27
+$rs = $modx->getDatabase()->select('username', $tbl_active_users, "action=108 AND id='{$id}' AND internalKey!='".$modx->getLoginUserID()."'");
28
+if ($username = $modx->getDatabase()->getValue($rs)) {
29 29
 	$modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $username, 'module'));
30 30
 }
31 31
 // end check for lock
32 32
 
33 33
 // take action
34
-switch($_REQUEST['op']) {
34
+switch ($_REQUEST['op']) {
35 35
 	case 'add':
36 36
 		// convert ids to numbers
37 37
 		$opids = array_filter(array_map('intval', explode(',', $_REQUEST['newids'])));
38 38
 
39
-		if(count($opids) > 0) {
39
+		if (count($opids) > 0) {
40 40
 			// 1-snips, 2-tpls, 3-tvs, 4-chunks, 5-plugins, 6-docs
41 41
 			$rt = strtolower($_REQUEST["rt"]);
42
-			if($rt == 'chunk') {
42
+			if ($rt == 'chunk') {
43 43
 				$type = 10;
44 44
 			}
45
-			if($rt == 'doc') {
45
+			if ($rt == 'doc') {
46 46
 				$type = 20;
47 47
 			}
48
-			if($rt == 'plug') {
48
+			if ($rt == 'plug') {
49 49
 				$type = 30;
50 50
 			}
51
-			if($rt == 'snip') {
51
+			if ($rt == 'snip') {
52 52
 				$type = 40;
53 53
 			}
54
-			if($rt == 'tpl') {
54
+			if ($rt == 'tpl') {
55 55
 				$type = 50;
56 56
 			}
57
-			if($rt == 'tv') {
57
+			if ($rt == 'tv') {
58 58
 				$type = 60;
59 59
 			}
60
-			$modx->getDatabase()->delete($tbl_site_module_depobj, "module='{$id}' AND resource IN (" . implode(',', $opids) . ") AND type='{$type}'");
61
-			foreach($opids as $opid) {
60
+			$modx->getDatabase()->delete($tbl_site_module_depobj, "module='{$id}' AND resource IN (".implode(',', $opids).") AND type='{$type}'");
61
+			foreach ($opids as $opid) {
62 62
 				$modx->getDatabase()->insert(array(
63 63
 					'module' => $id,
64 64
 					'resource' => $opid,
@@ -72,15 +72,15 @@  discard block
 block discarded – undo
72 72
 		$opids = array_filter(array_map('intval', $_REQUEST['depid']));
73 73
 
74 74
 		// get resources that needs to be removed
75
-		$ds = $modx->getDatabase()->select('*', $tbl_site_module_depobj, "id IN (" . implode(",", $opids) . ")");
75
+		$ds = $modx->getDatabase()->select('*', $tbl_site_module_depobj, "id IN (".implode(",", $opids).")");
76 76
 		// loop through resources and look for plugins and snippets
77 77
 		$plids = array();
78 78
 		$snid = array();
79
-		while($row = $modx->getDatabase()->getRow($ds)) {
80
-			if($row['type'] == '30') {
79
+		while ($row = $modx->getDatabase()->getRow($ds)) {
80
+			if ($row['type'] == '30') {
81 81
 				$plids[$i] = $row['resource'];
82 82
 			}
83
-			if($row['type'] == '40') {
83
+			if ($row['type'] == '40') {
84 84
 				$snids[$i] = $row['resource'];
85 85
 			}
86 86
 		}
@@ -88,28 +88,28 @@  discard block
 block discarded – undo
88 88
 		$ds = $modx->getDatabase()->select('guid', $tbl_site_modules, "id='{$id}'");
89 89
 		$guid = $modx->getDatabase()->getValue($ds);
90 90
 		// reset moduleguid for deleted resources
91
-		if(($cp = count($plids)) || ($cs = count($snids))) {
92
-			if($cp) {
93
-				$modx->getDatabase()->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $plids) . ") AND moduleguid='{$guid}'");
91
+		if (($cp = count($plids)) || ($cs = count($snids))) {
92
+			if ($cp) {
93
+				$modx->getDatabase()->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (".implode(',', $plids).") AND moduleguid='{$guid}'");
94 94
 			}
95
-			if($cs) {
96
-				$modx->getDatabase()->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $snids) . ") AND moduleguid='{$guid}'");
95
+			if ($cs) {
96
+				$modx->getDatabase()->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (".implode(',', $snids).") AND moduleguid='{$guid}'");
97 97
 			}
98 98
 			// reset cache
99 99
 			$modx->clearCache('full');
100 100
 		}
101
-		$modx->getDatabase()->delete($tbl_site_module_depobj, "id IN (" . implode(',', $opids) . ")");
101
+		$modx->getDatabase()->delete($tbl_site_module_depobj, "id IN (".implode(',', $opids).")");
102 102
 		break;
103 103
 }
104 104
 
105 105
 // load record
106 106
 $rs = $modx->getDatabase()->select('*', $tbl_site_modules, "id = '{$id}'");
107 107
 $content = $modx->getDatabase()->getRow($rs);
108
-if(!$content) {
108
+if (!$content) {
109 109
 	$modx->webAlertAndQuit("Module not found for id '{$id}'.");
110 110
 }
111 111
 $_SESSION['itemname'] = $content['name'];
112
-if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
112
+if ($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
113 113
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
114 114
 }
115 115
 
@@ -188,13 +188,13 @@  discard block
 block discarded – undo
188 188
 	<input type="hidden" name="id" value="<?php echo $content['id']; ?>" />
189 189
 
190 190
 	<h1>
191
-		<i class="fa fa-cogs"></i><?= ($content['name'] ? $content['name'] . '<small>(' . $content['id'] . ')</small>' : $_lang['module_resource_title']) ?>
191
+		<i class="fa fa-cogs"></i><?= ($content['name'] ? $content['name'].'<small>('.$content['id'].')</small>' : $_lang['module_resource_title']) ?>
192 192
 	</h1>
193 193
 
194 194
 	<?php echo $_style['actionbuttons']['dynamic']['close'] ?>
195 195
 
196 196
 	<div class="section">
197
-		<div class="sectionHeader"><?php echo $content["name"] . " - " . $_lang['module_resource_title']; ?></div>
197
+		<div class="sectionHeader"><?php echo $content["name"]." - ".$_lang['module_resource_title']; ?></div>
198 198
 		<div class="sectionBody">
199 199
 			<p><?php echo $_lang['module_resource_msg']; ?></p>
200 200
 			<br />
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 						$grd->columnHeaderClass = "gridHeader";
225 225
 						$grd->itemClass = "gridItem";
226 226
 						$grd->altItemClass = "gridAltItem";
227
-						$grd->columns = $_lang["element_name"] . " ," . $_lang["type"];
227
+						$grd->columns = $_lang["element_name"]." ,".$_lang["type"];
228 228
 						$grd->colTypes = "template:<input type='checkbox' name='depid[]' value='[+id+]'> [+value+]";
229 229
 						$grd->fields = "name,type";
230 230
 						echo $grd->render();
Please login to merge, or discard this patch.
manager/actions/modules.static.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if (!($modx->hasPermission('new_module') || $modx->hasPermission('edit_module') || $modx->hasPermission('exec_module'))) {
@@ -107,22 +107,22 @@  discard block
 block discarded – undo
107 107
     <div class="table-responsive">
108 108
         <?php
109 109
         if ($_SESSION['mgrRole'] != 1 && !empty($modx->config['use_udperms'])) {
110
-            $rs = $modx->getDatabase()->query('SELECT DISTINCT sm.id, sm.name, sm.description, mg.member, IF(disabled,"' . $_lang['yes'] . '","-") as disabled, IF(sm.icon<>"",sm.icon,"' . $_style['icons_modules'] . '") as icon
111
-				FROM ' . $modx->getFullTableName('site_modules') . ' AS sm
112
-				LEFT JOIN ' . $modx->getFullTableName('site_module_access') . ' AS sma ON sma.module = sm.id
113
-				LEFT JOIN ' . $modx->getFullTableName('member_groups') . ' AS mg ON sma.usergroup = mg.user_group
114
-                WHERE (mg.member IS NULL OR mg.member = ' . $modx->getLoginUserID() . ') AND sm.disabled != 1 AND sm.locked != 1
110
+            $rs = $modx->getDatabase()->query('SELECT DISTINCT sm.id, sm.name, sm.description, mg.member, IF(disabled,"'.$_lang['yes'].'","-") as disabled, IF(sm.icon<>"",sm.icon,"'.$_style['icons_modules'].'") as icon
111
+				FROM ' . $modx->getFullTableName('site_modules').' AS sm
112
+				LEFT JOIN ' . $modx->getFullTableName('site_module_access').' AS sma ON sma.module = sm.id
113
+				LEFT JOIN ' . $modx->getFullTableName('member_groups').' AS mg ON sma.usergroup = mg.user_group
114
+                WHERE (mg.member IS NULL OR mg.member = ' . $modx->getLoginUserID().') AND sm.disabled != 1 AND sm.locked != 1
115 115
                 ORDER BY sm.name');
116 116
             if ($modx->hasPermission('edit_module')) {
117
-                $title = "<a href='index.php?a=108&id=[+id+]' title='" . $_lang["module_edit_click_title"] . "'>[+value+]</a>";
117
+                $title = "<a href='index.php?a=108&id=[+id+]' title='".$_lang["module_edit_click_title"]."'>[+value+]</a>";
118 118
             } else if ($modx->hasPermission('exec_module')) {
119
-                $title = "<a href='index.php?a=112&id=[+id+]' title='" . $_lang["module_edit_click_title"] . "'>[+value+]</a>";
119
+                $title = "<a href='index.php?a=112&id=[+id+]' title='".$_lang["module_edit_click_title"]."'>[+value+]</a>";
120 120
             } else {
121 121
                 $title = '[+value+]';
122 122
             }
123 123
         } else {
124 124
             $rs = $modx->getDatabase()->select("id, name, description, IF(locked,'{$_lang['yes']}','-') as locked, IF(disabled,'{$_lang['yes']}','-') as disabled, IF(icon<>'',icon,'{$_style['icons_module']}') as icon", $modx->getFullTableName("site_modules"), (!empty($sqlQuery) ? "(name LIKE '%{$sqlQuery}%') OR (description LIKE '%{$sqlQuery}%')" : ""), "name");
125
-            $title = "<a href='index.php?a=108&id=[+id+]' title='" . $_lang["module_edit_click_title"] . "'>[+value+]</a>";
125
+            $title = "<a href='index.php?a=108&id=[+id+]' title='".$_lang["module_edit_click_title"]."'>[+value+]</a>";
126 126
         }
127 127
         $grd = new \EvolutionCMS\Support\DataGrid('', $rs, $number_of_results); // set page size to 0 t show all items
128 128
         $grd->noRecordMsg = $_lang["no_records_found"];
@@ -131,10 +131,10 @@  discard block
 block discarded – undo
131 131
         $grd->itemClass = "tableItem";
132 132
         $grd->altItemClass = "tableAltItem";
133 133
         $grd->fields = "icon,name,description,locked,disabled";
134
-        $grd->columns = $_lang["icon"] . " ," . $_lang["name"] . " ," . $_lang["description"] . " ," . $_lang["locked"] . " ," . $_lang["disabled"];
134
+        $grd->columns = $_lang["icon"]." ,".$_lang["name"]." ,".$_lang["description"]." ,".$_lang["locked"]." ,".$_lang["disabled"];
135 135
         $grd->colWidths = "34,,,60,60";
136 136
         $grd->colAligns = "center,,,center,center";
137
-        $grd->colTypes = "template:<a class='tableRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='" . $_lang["click_to_context"] . "'><i class='[+value+]'></i></a>||template:" . $title;
137
+        $grd->colTypes = "template:<a class='tableRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='".$_lang["click_to_context"]."'><i class='[+value+]'></i></a>||template:".$title;
138 138
         if ($listmode == '1') {
139 139
             $grd->pageSize = 0;
140 140
         }
Please login to merge, or discard this patch.
Braces   +12 added lines, -12 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('new_module') || $modx->hasPermission('edit_module') || $modx->hasPermission('exec_module'))) {
5
+if (!($modx->hasPermission('new_module') || $modx->hasPermission('edit_module') || $modx->hasPermission('exec_module'))) {
6 6
     $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
@@ -10,10 +10,10 @@  discard block
 block discarded – undo
10 10
 $modx->getManagerApi()->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
-} else {
16
+} else {
17 17
     $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search'];
18 18
     $sqlQuery = $modx->getDatabase()->escape($query);
19 19
     $_PAGE['vs']['search'] = $query;
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 // context menu
28 28
 $cm = new \EvolutionCMS\Support\ContextMenu("cntxm", 150);
29 29
 $cm->addItem($_lang["run_module"], "js:menuAction(1)", $_style['actions_run'], (!$modx->hasPermission('exec_module') ? 1 : 0));
30
-if ($modx->hasPermission('edit_module') || $modx->hasPermission('new_module') || $modx->hasPermission('delete_module')) {
30
+if ($modx->hasPermission('edit_module') || $modx->hasPermission('new_module') || $modx->hasPermission('delete_module')) {
31 31
     $cm->addSeparator();
32 32
 }
33 33
 $cm->addItem($_lang["edit"], "js:menuAction(2)", $_style['actions_edit'], (!$modx->hasPermission('edit_module') ? 1 : 0));
@@ -106,21 +106,21 @@  discard block
 block discarded – undo
106 106
 <div class="tab-page">
107 107
     <div class="table-responsive">
108 108
         <?php
109
-        if ($_SESSION['mgrRole'] != 1 && !empty($modx->config['use_udperms'])) {
109
+        if ($_SESSION['mgrRole'] != 1 && !empty($modx->config['use_udperms'])) {
110 110
             $rs = $modx->getDatabase()->query('SELECT DISTINCT sm.id, sm.name, sm.description, mg.member, IF(disabled,"' . $_lang['yes'] . '","-") as disabled, IF(sm.icon<>"",sm.icon,"' . $_style['icons_modules'] . '") as icon
111 111
 				FROM ' . $modx->getFullTableName('site_modules') . ' AS sm
112 112
 				LEFT JOIN ' . $modx->getFullTableName('site_module_access') . ' AS sma ON sma.module = sm.id
113 113
 				LEFT JOIN ' . $modx->getFullTableName('member_groups') . ' AS mg ON sma.usergroup = mg.user_group
114 114
                 WHERE (mg.member IS NULL OR mg.member = ' . $modx->getLoginUserID() . ') AND sm.disabled != 1 AND sm.locked != 1
115 115
                 ORDER BY sm.name');
116
-            if ($modx->hasPermission('edit_module')) {
116
+            if ($modx->hasPermission('edit_module')) {
117 117
                 $title = "<a href='index.php?a=108&id=[+id+]' title='" . $_lang["module_edit_click_title"] . "'>[+value+]</a>";
118
-            } else if ($modx->hasPermission('exec_module')) {
118
+            } else if ($modx->hasPermission('exec_module')) {
119 119
                 $title = "<a href='index.php?a=112&id=[+id+]' title='" . $_lang["module_edit_click_title"] . "'>[+value+]</a>";
120
-            } else {
120
+            } else {
121 121
                 $title = '[+value+]';
122 122
             }
123
-        } else {
123
+        } else {
124 124
             $rs = $modx->getDatabase()->select("id, name, description, IF(locked,'{$_lang['yes']}','-') as locked, IF(disabled,'{$_lang['yes']}','-') as disabled, IF(icon<>'',icon,'{$_style['icons_module']}') as icon", $modx->getFullTableName("site_modules"), (!empty($sqlQuery) ? "(name LIKE '%{$sqlQuery}%') OR (description LIKE '%{$sqlQuery}%')" : ""), "name");
125 125
             $title = "<a href='index.php?a=108&id=[+id+]' title='" . $_lang["module_edit_click_title"] . "'>[+value+]</a>";
126 126
         }
@@ -135,10 +135,10 @@  discard block
 block discarded – undo
135 135
         $grd->colWidths = "34,,,60,60";
136 136
         $grd->colAligns = "center,,,center,center";
137 137
         $grd->colTypes = "template:<a class='tableRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='" . $_lang["click_to_context"] . "'><i class='[+value+]'></i></a>||template:" . $title;
138
-        if ($listmode == '1') {
138
+        if ($listmode == '1') {
139 139
             $grd->pageSize = 0;
140 140
         }
141
-        if ($_REQUEST['op'] == 'reset') {
141
+        if ($_REQUEST['op'] == 'reset') {
142 142
             $grd->pageNumber = 1;
143 143
         }
144 144
         // render grid
Please login to merge, or discard this patch.
manager/actions/resource_selector.static.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if (!$modx->hasPermission('edit_module')) {
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 
64 64
 }
65 65
 
66
-include_once MODX_MANAGER_PATH . "includes/header.inc.php";
66
+include_once MODX_MANAGER_PATH."includes/header.inc.php";
67 67
 ?>
68 68
 <script language="JavaScript" type="text/javascript">
69 69
     function saveSelection()
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 </script>
139 139
 
140 140
 <h1>
141
-    <?= $title . " - " . $_lang['element_selector_title'] ?><i class="fa fa-question-circle help"></i>
141
+    <?= $title." - ".$_lang['element_selector_title'] ?><i class="fa fa-question-circle help"></i>
142 142
 </h1>
143 143
 
144 144
 <div id="actions">
@@ -183,8 +183,8 @@  discard block
 block discarded – undo
183 183
                     $grd->columnHeaderClass = "tableHeader";
184 184
                     $grd->itemClass = "tableItem";
185 185
                     $grd->altItemClass = "tableAltItem";
186
-                    $grd->columns = $_lang["name"] . " ," . $_lang["description"];
187
-                    $grd->colTypes = "template:<input type='" . ($sm == 'm' ? 'checkbox' : 'radio') . "' name='id[]' value='[+id+]' onclick='setCheckbox(this);'> [+value+]";
186
+                    $grd->columns = $_lang["name"]." ,".$_lang["description"];
187
+                    $grd->colTypes = "template:<input type='".($sm == 'm' ? 'checkbox' : 'radio')."' name='id[]' value='[+id+]' onclick='setCheckbox(this);'> [+value+]";
188 188
                     $grd->colWidths = "45%";
189 189
                     $grd->fields = "name,description";
190 190
                     if ($_REQUEST['listmode'] == '1') {
Please login to merge, or discard this patch.
manager/actions/web_user_management.static.php 2 patches
Indentation   +29 added lines, -29 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_web_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->getDatabase()->escape($query);
19
-	$_PAGE['vs']['search'] = $query;
17
+    $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search'];
18
+    $sqlQuery = $modx->getDatabase()->escape($query);
19
+    $_PAGE['vs']['search'] = $query;
20 20
 }
21 21
 
22 22
 // get & save listmode
@@ -119,29 +119,29 @@  discard block
 block discarded – undo
119 119
 			<div class="row">
120 120
 				<div class="table-responsive">
121 121
 					<?php
122
-					$ds = $modx->getDatabase()->select("wu.id, wu.username, wua.fullname, wua.email, wua.lastlogin, wua.logincount, IF(wua.blocked,'{$_lang['yes']}','-') as 'blocked'", $modx->getFullTableName("web_users") . " wu 
122
+                    $ds = $modx->getDatabase()->select("wu.id, wu.username, wua.fullname, wua.email, wua.lastlogin, wua.logincount, IF(wua.blocked,'{$_lang['yes']}','-') as 'blocked'", $modx->getFullTableName("web_users") . " wu 
123 123
 			INNER JOIN " . $modx->getFullTableName("web_user_attributes") . " wua ON wua.internalKey=wu.id", ($sqlQuery ? "(wu.username LIKE '{$sqlQuery}%') OR (wua.fullname LIKE '%{$sqlQuery}%') OR (wua.email LIKE '%{$sqlQuery}%')" : ""), 'username');
124
-					$grd = new \EvolutionCMS\Support\DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items
125
-					$grd->noRecordMsg = $_lang["no_records_found"];
126
-					$grd->cssClass = "table data";
127
-					$grd->columnHeaderClass = "tableHeader";
128
-					$grd->itemClass = "tableItem";
129
-					$grd->altItemClass = "tableAltItem";
130
-					$grd->fields = "id,username,fullname,email,lastlogin,logincount,blocked";
131
-					$grd->columns = $_lang["icon"] . " ," . $_lang["name"] . " ," . $_lang["user_full_name"] . " ," . $_lang["email"] . " ," . $_lang["user_prevlogin"] . " ," . $_lang["user_logincount"] . " ," . $_lang["user_block"];
132
-					$grd->colWidths = "1%,,,,1%,1%,1%";
133
-					$grd->colAligns = "center,,,,right' nowrap='nowrap,right,center";
134
-					$grd->colTypes = "template:<a class='gridRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='" . $_lang["click_to_context"] . "'><i class='" . $_style["icons_user"] . "'></i></a>||template:<a href='index.php?a=88&id=[+id+]' title='" . $_lang["click_to_edit_title"] . "'>[+value+]</a>||template:[+fullname+]||template:[+email+]||date: " . $modx->toDateFormat('[+thislogin+]', 'formatOnly') .
135
-					" %H:%M";
136
-					if($listmode == '1') {
137
-						$grd->pageSize = 0;
138
-					}
139
-					if($_REQUEST['op'] == 'reset') {
140
-						$grd->pageNumber = 1;
141
-					}
142
-					// render grid
143
-					echo $grd->render();
144
-					?>
124
+                    $grd = new \EvolutionCMS\Support\DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items
125
+                    $grd->noRecordMsg = $_lang["no_records_found"];
126
+                    $grd->cssClass = "table data";
127
+                    $grd->columnHeaderClass = "tableHeader";
128
+                    $grd->itemClass = "tableItem";
129
+                    $grd->altItemClass = "tableAltItem";
130
+                    $grd->fields = "id,username,fullname,email,lastlogin,logincount,blocked";
131
+                    $grd->columns = $_lang["icon"] . " ," . $_lang["name"] . " ," . $_lang["user_full_name"] . " ," . $_lang["email"] . " ," . $_lang["user_prevlogin"] . " ," . $_lang["user_logincount"] . " ," . $_lang["user_block"];
132
+                    $grd->colWidths = "1%,,,,1%,1%,1%";
133
+                    $grd->colAligns = "center,,,,right' nowrap='nowrap,right,center";
134
+                    $grd->colTypes = "template:<a class='gridRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='" . $_lang["click_to_context"] . "'><i class='" . $_style["icons_user"] . "'></i></a>||template:<a href='index.php?a=88&id=[+id+]' title='" . $_lang["click_to_edit_title"] . "'>[+value+]</a>||template:[+fullname+]||template:[+email+]||date: " . $modx->toDateFormat('[+thislogin+]', 'formatOnly') .
135
+                    " %H:%M";
136
+                    if($listmode == '1') {
137
+                        $grd->pageSize = 0;
138
+                    }
139
+                    if($_REQUEST['op'] == 'reset') {
140
+                        $grd->pageNumber = 1;
141
+                    }
142
+                    // render grid
143
+                    echo $grd->render();
144
+                    ?>
145 145
 				</div>
146 146
 			</div>
147 147
 		</div>
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 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_web_user')) {
5
+if (!$modx->hasPermission('edit_web_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->getManagerApi()->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 {
@@ -119,8 +119,8 @@  discard block
 block discarded – undo
119 119
 			<div class="row">
120 120
 				<div class="table-responsive">
121 121
 					<?php
122
-					$ds = $modx->getDatabase()->select("wu.id, wu.username, wua.fullname, wua.email, wua.lastlogin, wua.logincount, IF(wua.blocked,'{$_lang['yes']}','-') as 'blocked'", $modx->getFullTableName("web_users") . " wu 
123
-			INNER JOIN " . $modx->getFullTableName("web_user_attributes") . " wua ON wua.internalKey=wu.id", ($sqlQuery ? "(wu.username LIKE '{$sqlQuery}%') OR (wua.fullname LIKE '%{$sqlQuery}%') OR (wua.email LIKE '%{$sqlQuery}%')" : ""), 'username');
122
+					$ds = $modx->getDatabase()->select("wu.id, wu.username, wua.fullname, wua.email, wua.lastlogin, wua.logincount, IF(wua.blocked,'{$_lang['yes']}','-') as 'blocked'", $modx->getFullTableName("web_users")." wu 
123
+			INNER JOIN " . $modx->getFullTableName("web_user_attributes")." wua ON wua.internalKey=wu.id", ($sqlQuery ? "(wu.username LIKE '{$sqlQuery}%') OR (wua.fullname LIKE '%{$sqlQuery}%') OR (wua.email LIKE '%{$sqlQuery}%')" : ""), 'username');
124 124
 					$grd = new \EvolutionCMS\Support\DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items
125 125
 					$grd->noRecordMsg = $_lang["no_records_found"];
126 126
 					$grd->cssClass = "table data";
@@ -128,15 +128,15 @@  discard block
 block discarded – undo
128 128
 					$grd->itemClass = "tableItem";
129 129
 					$grd->altItemClass = "tableAltItem";
130 130
 					$grd->fields = "id,username,fullname,email,lastlogin,logincount,blocked";
131
-					$grd->columns = $_lang["icon"] . " ," . $_lang["name"] . " ," . $_lang["user_full_name"] . " ," . $_lang["email"] . " ," . $_lang["user_prevlogin"] . " ," . $_lang["user_logincount"] . " ," . $_lang["user_block"];
131
+					$grd->columns = $_lang["icon"]." ,".$_lang["name"]." ,".$_lang["user_full_name"]." ,".$_lang["email"]." ,".$_lang["user_prevlogin"]." ,".$_lang["user_logincount"]." ,".$_lang["user_block"];
132 132
 					$grd->colWidths = "1%,,,,1%,1%,1%";
133 133
 					$grd->colAligns = "center,,,,right' nowrap='nowrap,right,center";
134
-					$grd->colTypes = "template:<a class='gridRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='" . $_lang["click_to_context"] . "'><i class='" . $_style["icons_user"] . "'></i></a>||template:<a href='index.php?a=88&id=[+id+]' title='" . $_lang["click_to_edit_title"] . "'>[+value+]</a>||template:[+fullname+]||template:[+email+]||date: " . $modx->toDateFormat('[+thislogin+]', 'formatOnly') .
134
+					$grd->colTypes = "template:<a class='gridRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='".$_lang["click_to_context"]."'><i class='".$_style["icons_user"]."'></i></a>||template:<a href='index.php?a=88&id=[+id+]' title='".$_lang["click_to_edit_title"]."'>[+value+]</a>||template:[+fullname+]||template:[+email+]||date: ".$modx->toDateFormat('[+thislogin+]', 'formatOnly').
135 135
 					" %H:%M";
136
-					if($listmode == '1') {
136
+					if ($listmode == '1') {
137 137
 						$grd->pageSize = 0;
138 138
 					}
139
-					if($_REQUEST['op'] == 'reset') {
139
+					if ($_REQUEST['op'] == 'reset') {
140 140
 						$grd->pageNumber = 1;
141 141
 					}
142 142
 					// render grid
Please login to merge, or discard this patch.
manager/actions/user_management.static.php 2 patches
Indentation   +53 added lines, -53 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->getDatabase()->escape($query);
19
-	$_PAGE['vs']['search'] = $query;
17
+    $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search'];
18
+    $sqlQuery = $modx->getDatabase()->escape($query);
19
+    $_PAGE['vs']['search'] = $query;
20 20
 }
21 21
 
22 22
 // get & save listmode
@@ -119,54 +119,54 @@  discard block
 block discarded – undo
119 119
 			<div class="row">
120 120
 				<div class="table-responsive">
121 121
 					<?php
122
-					$where = "";
123
-					if(!$modx->hasPermission('save_role')) {
124
-						$where .= (empty($where) ? "" : " AND ") . "mua.role != 1";
125
-					}
126
-					if(!empty($sqlQuery)) {
127
-						$where .= (empty($where) ? "" : " AND ") . "((mu.username LIKE '{$sqlQuery}%') OR (mua.fullname LIKE '%{$sqlQuery}%') OR (mua.email LIKE '{$sqlQuery}%'))";
128
-					}
129
-					$ds = $modx->getDatabase()->select("mu.id, mu.username, rname.name AS role, mua.fullname, mua.email, IF(mua.blocked,'{$_lang['yes']}','-') as blocked, mua.thislogin, mua.logincount", $modx->getFullTableName('manager_users') . " AS mu 
122
+                    $where = "";
123
+                    if(!$modx->hasPermission('save_role')) {
124
+                        $where .= (empty($where) ? "" : " AND ") . "mua.role != 1";
125
+                    }
126
+                    if(!empty($sqlQuery)) {
127
+                        $where .= (empty($where) ? "" : " AND ") . "((mu.username LIKE '{$sqlQuery}%') OR (mua.fullname LIKE '%{$sqlQuery}%') OR (mua.email LIKE '{$sqlQuery}%'))";
128
+                    }
129
+                    $ds = $modx->getDatabase()->select("mu.id, mu.username, rname.name AS role, mua.fullname, mua.email, IF(mua.blocked,'{$_lang['yes']}','-') as blocked, mua.thislogin, mua.logincount", $modx->getFullTableName('manager_users') . " AS mu 
130 130
 			INNER JOIN " . $modx->getFullTableName('user_attributes') . " AS mua ON mua.internalKey=mu.id 
131 131
 			LEFT JOIN " . $modx->getFullTableName('user_roles') . " AS rname ON mua.role=rname.id", $where, 'mua.blocked ASC, mua.thislogin DESC');
132
-					$grd = new \EvolutionCMS\Support\DataGrid('', $ds, $modx->config['number_of_results']); // set page size to 0 t show all items
133
-					$grd->noRecordMsg = $_lang["no_records_found"];
134
-					$grd->cssClass = "table data";
135
-					$grd->columnHeaderClass = "tableHeader";
136
-					$grd->itemClass = "tableItem";
137
-					$grd->altItemClass = "tableAltItem";
138
-					$grd->fields = "id,username,fullname,role,email,thislogin,logincount,blocked";
139
-					$grd->columns = implode(',', array(
140
-						$_lang["icon"],
141
-						$_lang["name"],
142
-						$_lang["user_full_name"],
143
-						$_lang['role'],
144
-						$_lang["email"],
145
-						$_lang["user_prevlogin"],
146
-						$_lang["user_logincount"],
147
-						$_lang["user_block"]
148
-					));
149
-					$grd->colWidths = "1%,,,,,1%,1%,1%";
150
-					$grd->colAligns = "center,,,,,right' nowrap='nowrap,right,center";
151
-					$grd->colTypes = implode('||', array(
152
-						'template:<a class="gridRowIcon" href="javascript:;" onclick="return showContentMenu([+id+],event);" title="' . $_lang['click_to_context'] . '"><i class="' . $_style['icons_user'] . '"></i></a>',
153
-						'template:<a href="index.php?a=12&id=[+id+]" title="' . $_lang['click_to_edit_title'] . '">[+value+]</a>',
154
-						'template:[+fullname+]',
155
-						'template:[+role+]',
156
-						'template:[+email+]',
157
-						'date: ' . $modx->toDateFormat('[+thislogin+]', 'formatOnly') . ' %H:%M',
158
-						'template:[+logincount+]',
159
-						'template:[+blocked+]'
160
-					));
161
-					if($listmode == '1') {
162
-						$grd->pageSize = 0;
163
-					}
164
-					if($_REQUEST['op'] == 'reset') {
165
-						$grd->pageNumber = 1;
166
-					}
167
-					// render grid
168
-					echo $grd->render();
169
-					?>
132
+                    $grd = new \EvolutionCMS\Support\DataGrid('', $ds, $modx->config['number_of_results']); // set page size to 0 t show all items
133
+                    $grd->noRecordMsg = $_lang["no_records_found"];
134
+                    $grd->cssClass = "table data";
135
+                    $grd->columnHeaderClass = "tableHeader";
136
+                    $grd->itemClass = "tableItem";
137
+                    $grd->altItemClass = "tableAltItem";
138
+                    $grd->fields = "id,username,fullname,role,email,thislogin,logincount,blocked";
139
+                    $grd->columns = implode(',', array(
140
+                        $_lang["icon"],
141
+                        $_lang["name"],
142
+                        $_lang["user_full_name"],
143
+                        $_lang['role'],
144
+                        $_lang["email"],
145
+                        $_lang["user_prevlogin"],
146
+                        $_lang["user_logincount"],
147
+                        $_lang["user_block"]
148
+                    ));
149
+                    $grd->colWidths = "1%,,,,,1%,1%,1%";
150
+                    $grd->colAligns = "center,,,,,right' nowrap='nowrap,right,center";
151
+                    $grd->colTypes = implode('||', array(
152
+                        'template:<a class="gridRowIcon" href="javascript:;" onclick="return showContentMenu([+id+],event);" title="' . $_lang['click_to_context'] . '"><i class="' . $_style['icons_user'] . '"></i></a>',
153
+                        'template:<a href="index.php?a=12&id=[+id+]" title="' . $_lang['click_to_edit_title'] . '">[+value+]</a>',
154
+                        'template:[+fullname+]',
155
+                        'template:[+role+]',
156
+                        'template:[+email+]',
157
+                        'date: ' . $modx->toDateFormat('[+thislogin+]', 'formatOnly') . ' %H:%M',
158
+                        'template:[+logincount+]',
159
+                        'template:[+blocked+]'
160
+                    ));
161
+                    if($listmode == '1') {
162
+                        $grd->pageSize = 0;
163
+                    }
164
+                    if($_REQUEST['op'] == 'reset') {
165
+                        $grd->pageNumber = 1;
166
+                    }
167
+                    // render grid
168
+                    echo $grd->render();
169
+                    ?>
170 170
 				</div>
171 171
 			</div>
172 172
 		</div>
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 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->getManagerApi()->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 {
@@ -120,15 +120,15 @@  discard block
 block discarded – undo
120 120
 				<div class="table-responsive">
121 121
 					<?php
122 122
 					$where = "";
123
-					if(!$modx->hasPermission('save_role')) {
124
-						$where .= (empty($where) ? "" : " AND ") . "mua.role != 1";
123
+					if (!$modx->hasPermission('save_role')) {
124
+						$where .= (empty($where) ? "" : " AND ")."mua.role != 1";
125 125
 					}
126
-					if(!empty($sqlQuery)) {
127
-						$where .= (empty($where) ? "" : " AND ") . "((mu.username LIKE '{$sqlQuery}%') OR (mua.fullname LIKE '%{$sqlQuery}%') OR (mua.email LIKE '{$sqlQuery}%'))";
126
+					if (!empty($sqlQuery)) {
127
+						$where .= (empty($where) ? "" : " AND ")."((mu.username LIKE '{$sqlQuery}%') OR (mua.fullname LIKE '%{$sqlQuery}%') OR (mua.email LIKE '{$sqlQuery}%'))";
128 128
 					}
129
-					$ds = $modx->getDatabase()->select("mu.id, mu.username, rname.name AS role, mua.fullname, mua.email, IF(mua.blocked,'{$_lang['yes']}','-') as blocked, mua.thislogin, mua.logincount", $modx->getFullTableName('manager_users') . " AS mu 
130
-			INNER JOIN " . $modx->getFullTableName('user_attributes') . " AS mua ON mua.internalKey=mu.id 
131
-			LEFT JOIN " . $modx->getFullTableName('user_roles') . " AS rname ON mua.role=rname.id", $where, 'mua.blocked ASC, mua.thislogin DESC');
129
+					$ds = $modx->getDatabase()->select("mu.id, mu.username, rname.name AS role, mua.fullname, mua.email, IF(mua.blocked,'{$_lang['yes']}','-') as blocked, mua.thislogin, mua.logincount", $modx->getFullTableName('manager_users')." AS mu 
130
+			INNER JOIN " . $modx->getFullTableName('user_attributes')." AS mua ON mua.internalKey=mu.id 
131
+			LEFT JOIN " . $modx->getFullTableName('user_roles')." AS rname ON mua.role=rname.id", $where, 'mua.blocked ASC, mua.thislogin DESC');
132 132
 					$grd = new \EvolutionCMS\Support\DataGrid('', $ds, $modx->config['number_of_results']); // set page size to 0 t show all items
133 133
 					$grd->noRecordMsg = $_lang["no_records_found"];
134 134
 					$grd->cssClass = "table data";
@@ -149,19 +149,19 @@  discard block
 block discarded – undo
149 149
 					$grd->colWidths = "1%,,,,,1%,1%,1%";
150 150
 					$grd->colAligns = "center,,,,,right' nowrap='nowrap,right,center";
151 151
 					$grd->colTypes = implode('||', array(
152
-						'template:<a class="gridRowIcon" href="javascript:;" onclick="return showContentMenu([+id+],event);" title="' . $_lang['click_to_context'] . '"><i class="' . $_style['icons_user'] . '"></i></a>',
153
-						'template:<a href="index.php?a=12&id=[+id+]" title="' . $_lang['click_to_edit_title'] . '">[+value+]</a>',
152
+						'template:<a class="gridRowIcon" href="javascript:;" onclick="return showContentMenu([+id+],event);" title="'.$_lang['click_to_context'].'"><i class="'.$_style['icons_user'].'"></i></a>',
153
+						'template:<a href="index.php?a=12&id=[+id+]" title="'.$_lang['click_to_edit_title'].'">[+value+]</a>',
154 154
 						'template:[+fullname+]',
155 155
 						'template:[+role+]',
156 156
 						'template:[+email+]',
157
-						'date: ' . $modx->toDateFormat('[+thislogin+]', 'formatOnly') . ' %H:%M',
157
+						'date: '.$modx->toDateFormat('[+thislogin+]', 'formatOnly').' %H:%M',
158 158
 						'template:[+logincount+]',
159 159
 						'template:[+blocked+]'
160 160
 					));
161
-					if($listmode == '1') {
161
+					if ($listmode == '1') {
162 162
 						$grd->pageSize = 0;
163 163
 					}
164
-					if($_REQUEST['op'] == 'reset') {
164
+					if ($_REQUEST['op'] == 'reset') {
165 165
 						$grd->pageNumber = 1;
166 166
 					}
167 167
 					// render grid
Please login to merge, or discard this patch.