Completed
Push — develop ( 62a102...75b835 )
by Maxim
05:41
created
manager/processors/export_site.processor.php 3 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  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('export_static')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 $maxtime = (is_numeric($_POST['maxtime'])) ? $_POST['maxtime'] : 30;
@@ -17,11 +17,11 @@  discard block
 block discarded – undo
17 17
 $modx->export->targetDir = $export_dir;
18 18
 
19 19
 if(strpos($modx->config['base_path'],"{$export_dir}/")===0 && 0 <= strlen(str_replace("{$export_dir}/",'',$modx->config['base_path'])))
20
-	return $_lang['export_site.static.php6'];
20
+    return $_lang['export_site.static.php6'];
21 21
 elseif($modx->config['rb_base_dir'] === $export_dir . '/')
22
-	return $modx->parsePlaceholder($_lang['export_site.static.php7'],'rb_base_url=' . $modx->config['base_url'] . $modx->config['rb_base_url']);
22
+    return $modx->parsePlaceholder($_lang['export_site.static.php7'],'rb_base_url=' . $modx->config['base_url'] . $modx->config['rb_base_url']);
23 23
 elseif(!is_writable($export_dir))
24
-	return $_lang['export_site_target_unwritable'];
24
+    return $_lang['export_site_target_unwritable'];
25 25
 
26 26
 $modx->export->generate_mode = $_POST['generate_mode'];
27 27
 
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
  ||$includenoncache!==$_POST['includenoncache']
38 38
  ||$repl_before!==$_POST['repl_before']
39 39
  ||$repl_after !==$_POST['repl_after']) {
40
-	$modx->clearCache('full');
40
+    $modx->clearCache('full');
41 41
 }
42 42
 
43 43
 $total = $modx->export->getTotal($_POST['ignore_ids'], $modx->config['export_includenoncache']);
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 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('export_static')) {
5
+if (!$modx->hasPermission('export_static')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
@@ -12,15 +12,15 @@  discard block
 block discarded – undo
12 12
 $modx->loadExtension('EXPORT_SITE');
13 13
 
14 14
 
15
-if(is_dir(MODX_BASE_PATH . 'temp'))       $export_dir = MODX_BASE_PATH . 'temp/export';
16
-elseif(is_dir(MODX_BASE_PATH . 'assets')) $export_dir = MODX_BASE_PATH . 'assets/export';
15
+if (is_dir(MODX_BASE_PATH.'temp'))       $export_dir = MODX_BASE_PATH.'temp/export';
16
+elseif (is_dir(MODX_BASE_PATH.'assets')) $export_dir = MODX_BASE_PATH.'assets/export';
17 17
 $modx->export->targetDir = $export_dir;
18 18
 
19
-if(strpos($modx->config['base_path'],"{$export_dir}/")===0 && 0 <= strlen(str_replace("{$export_dir}/",'',$modx->config['base_path'])))
19
+if (strpos($modx->config['base_path'], "{$export_dir}/") === 0 && 0 <= strlen(str_replace("{$export_dir}/", '', $modx->config['base_path'])))
20 20
 	return $_lang['export_site.static.php6'];
21
-elseif($modx->config['rb_base_dir'] === $export_dir . '/')
22
-	return $modx->parsePlaceholder($_lang['export_site.static.php7'],'rb_base_url=' . $modx->config['base_url'] . $modx->config['rb_base_url']);
23
-elseif(!is_writable($export_dir))
21
+elseif ($modx->config['rb_base_dir'] === $export_dir.'/')
22
+	return $modx->parsePlaceholder($_lang['export_site.static.php7'], 'rb_base_url='.$modx->config['base_url'].$modx->config['rb_base_url']);
23
+elseif (!is_writable($export_dir))
24 24
 	return $_lang['export_site_target_unwritable'];
25 25
 
26 26
 $modx->export->generate_mode = $_POST['generate_mode'];
@@ -33,10 +33,10 @@  discard block
 block discarded – undo
33 33
 $repl_after      = $_POST['repl_after'];
34 34
 $includenoncache = $_POST['includenoncache'];
35 35
 
36
-if($ignore_ids!==$_POST['ignore_ids']
37
- ||$includenoncache!==$_POST['includenoncache']
38
- ||$repl_before!==$_POST['repl_before']
39
- ||$repl_after !==$_POST['repl_after']) {
36
+if ($ignore_ids !== $_POST['ignore_ids']
37
+ ||$includenoncache !== $_POST['includenoncache']
38
+ ||$repl_before !== $_POST['repl_before']
39
+ ||$repl_after !== $_POST['repl_after']) {
40 40
 	$modx->clearCache('full');
41 41
 }
42 42
 
@@ -52,5 +52,5 @@  discard block
 block discarded – undo
52 52
 
53 53
 $exportend = $modx->export->get_mtime();
54 54
 $totaltime = ($exportend - $modx->export->exportstart);
55
-$output .= sprintf ('<p>'.$_lang["export_site_time"].'</p>', round($totaltime, 3));
55
+$output .= sprintf('<p>'.$_lang["export_site_time"].'</p>', round($totaltime, 3));
56 56
 return $output;
Please login to merge, or discard this patch.
Braces   +9 added lines, -5 removed lines patch added patch discarded remove patch
@@ -12,16 +12,20 @@
 block discarded – undo
12 12
 $modx->loadExtension('EXPORT_SITE');
13 13
 
14 14
 
15
-if(is_dir(MODX_BASE_PATH . 'temp'))       $export_dir = MODX_BASE_PATH . 'temp/export';
16
-elseif(is_dir(MODX_BASE_PATH . 'assets')) $export_dir = MODX_BASE_PATH . 'assets/export';
15
+if(is_dir(MODX_BASE_PATH . 'temp')) {
16
+    $export_dir = MODX_BASE_PATH . 'temp/export';
17
+} elseif(is_dir(MODX_BASE_PATH . 'assets')) {
18
+    $export_dir = MODX_BASE_PATH . 'assets/export';
19
+}
17 20
 $modx->export->targetDir = $export_dir;
18 21
 
19
-if(strpos($modx->config['base_path'],"{$export_dir}/")===0 && 0 <= strlen(str_replace("{$export_dir}/",'',$modx->config['base_path'])))
22
+if(strpos($modx->config['base_path'],"{$export_dir}/")===0 && 0 <= strlen(str_replace("{$export_dir}/",'',$modx->config['base_path']))) {
20 23
 	return $_lang['export_site.static.php6'];
21
-elseif($modx->config['rb_base_dir'] === $export_dir . '/')
24
+} elseif($modx->config['rb_base_dir'] === $export_dir . '/') {
22 25
 	return $modx->parsePlaceholder($_lang['export_site.static.php7'],'rb_base_url=' . $modx->config['base_url'] . $modx->config['rb_base_url']);
23
-elseif(!is_writable($export_dir))
26
+} elseif(!is_writable($export_dir)) {
24 27
 	return $_lang['export_site_target_unwritable'];
28
+}
25 29
 
26 30
 $modx->export->generate_mode = $_POST['generate_mode'];
27 31
 
Please login to merge, or discard this patch.
manager/processors/delete_module.processor.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -3,12 +3,12 @@  discard block
 block discarded – undo
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if(!$modx->hasPermission('delete_module')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 $id = isset($_GET['id'])? intval($_GET['id']) : 0;
10 10
 if($id==0) {
11
-	$modx->webAlertAndQuit($_lang["error_no_id"]);
11
+    $modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
14 14
 // Set the item name for logger
@@ -17,9 +17,9 @@  discard block
 block discarded – undo
17 17
 
18 18
 // invoke OnBeforeModFormDelete event
19 19
 $modx->invokeEvent("OnBeforeModFormDelete",
20
-	array(
21
-		"id"	=> $id
22
-	));
20
+    array(
21
+        "id"	=> $id
22
+    ));
23 23
 
24 24
 // delete the module.
25 25
 $modx->db->delete($modx->getFullTableName('site_modules'), "id='{$id}'");
@@ -32,9 +32,9 @@  discard block
 block discarded – undo
32 32
 
33 33
 // invoke OnModFormDelete event
34 34
 $modx->invokeEvent("OnModFormDelete",
35
-	array(
36
-		"id"	=> $id
37
-	));
35
+    array(
36
+        "id"	=> $id
37
+    ));
38 38
 
39 39
 // empty cache
40 40
 $modx->clearCache('full');
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 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
-if(!$modx->hasPermission('delete_module')) {
5
+if (!$modx->hasPermission('delete_module')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = isset($_GET['id'])? intval($_GET['id']) : 0;
10
-if($id==0) {
9
+$id = isset($_GET['id']) ? intval($_GET['id']) : 0;
10
+if ($id == 0) {
11 11
 	$modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
@@ -40,5 +40,5 @@  discard block
 block discarded – undo
40 40
 $modx->clearCache('full');
41 41
 
42 42
 // finished emptying cache - redirect
43
-$header="Location: index.php?a=106&r=2";
43
+$header = "Location: index.php?a=106&r=2";
44 44
 header($header);
Please login to merge, or discard this patch.
manager/processors/duplicate_content.processor.php 3 patches
Indentation   +96 added lines, -96 removed lines patch added patch discarded remove patch
@@ -3,12 +3,12 @@  discard block
 block discarded – undo
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if(!$modx->hasPermission('new_document') || !$modx->hasPermission('save_document')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 $id = isset($_GET['id'])? intval($_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
 $children = array();
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 $udperms->duplicateDoc = true;
23 23
 
24 24
 if(!$udperms->checkPermissions()) {
25
-	$modx->webAlertAndQuit($_lang["access_permission_denied"]);
25
+    $modx->webAlertAndQuit($_lang["access_permission_denied"]);
26 26
 }
27 27
 
28 28
 // Run the duplicator
@@ -37,125 +37,125 @@  discard block
 block discarded – undo
37 37
 header($header);
38 38
 
39 39
 function duplicateDocument($docid, $parent=null, $_toplevel=0) {
40
-	global $modx, $_lang;
41
-
42
-	// invoke OnBeforeDocDuplicate event
43
-	$evtOut = $modx->invokeEvent('OnBeforeDocDuplicate', array(
44
-		'id' => $docid
45
-	));
46
-
47
-	// if( !in_array( 'false', array_values( $evtOut ) ) ){}
48
-	// TODO: Determine necessary handling for duplicateDocument "return $newparent" if OnBeforeDocDuplicate were able to conditially control duplication
49
-	// [DISABLED]: Proceed with duplicateDocument if OnBeforeDocDuplicate did not return false via: $event->output('false');
50
-
51
-	$userID = $modx->getLoginUserID();
52
-
53
-	$tblsc = $modx->getFullTableName('site_content');
54
-
55
-	// Grab the original document
56
-	$rs = $modx->db->select('*', $tblsc, "id='{$docid}'");
57
-	$content = $modx->db->getRow($rs);
58
-
59
-	// Handle incremental ID
60
-	switch($modx->config['docid_incrmnt_method'])
61
-	{
62
-		case '1':
63
-			$from = "{$tblsc} AS T0 LEFT JOIN {$tblsc} AS T1 ON T0.id + 1 = T1.id";
64
-			$rs = $modx->db->select('MIN(T0.id)+1', $from, "T1.id IS NULL");
65
-			$content['id'] = $modx->db->getValue($rs);
66
-			break;
67
-		case '2':
68
-			$rs = $modx->db->select('MAX(id)+1',$tblsc);
69
-			$content['id'] = $modx->db->getValue($rs);
70
-			break;
71
-
72
-		default:
73
-			unset($content['id']); // remove the current id.
74
-	}
75
-
76
-	// Once we've grabbed the document object, start doing some modifications
77
-	if ($_toplevel == 0) {
78
-		// count duplicates
79
-		$pagetitle = $modx->db->getValue($modx->db->select('pagetitle', $modx->getFullTableName('site_content'), "id='{$docid}'"));
80
-		$pagetitle = $modx->db->escape($pagetitle);
81
-		$count = $modx->db->getRecordCount($modx->db->select('pagetitle', $modx->getFullTableName('site_content'), "pagetitle LIKE '{$pagetitle} Duplicate%'"));
82
-		if($count>=1) $count = ' '.($count+1);
83
-		else $count = '';
84
-
85
-		$content['pagetitle'] = $_lang['duplicated_el_suffix'].$count.' '.$content['pagetitle'];
86
-		$content['alias'] = null;
87
-	} elseif($modx->config['friendly_urls'] == 0 || $modx->config['allow_duplicate_alias'] == 0) {
88
-		$content['alias'] = null;
89
-	}
90
-
91
-	// change the parent accordingly
92
-	if ($parent !== null) $content['parent'] = $parent;
93
-
94
-	// Change the author
95
-	$content['createdby'] = $userID;
96
-	$content['createdon'] = time();
97
-	// Remove other modification times
98
-	$content['editedby'] = $content['editedon'] = $content['deleted'] = $content['deletedby'] = $content['deletedon'] = 0;
99
-
100
-	// [FS#922] Should the published status be honored? - sirlancelot
40
+    global $modx, $_lang;
41
+
42
+    // invoke OnBeforeDocDuplicate event
43
+    $evtOut = $modx->invokeEvent('OnBeforeDocDuplicate', array(
44
+        'id' => $docid
45
+    ));
46
+
47
+    // if( !in_array( 'false', array_values( $evtOut ) ) ){}
48
+    // TODO: Determine necessary handling for duplicateDocument "return $newparent" if OnBeforeDocDuplicate were able to conditially control duplication
49
+    // [DISABLED]: Proceed with duplicateDocument if OnBeforeDocDuplicate did not return false via: $event->output('false');
50
+
51
+    $userID = $modx->getLoginUserID();
52
+
53
+    $tblsc = $modx->getFullTableName('site_content');
54
+
55
+    // Grab the original document
56
+    $rs = $modx->db->select('*', $tblsc, "id='{$docid}'");
57
+    $content = $modx->db->getRow($rs);
58
+
59
+    // Handle incremental ID
60
+    switch($modx->config['docid_incrmnt_method'])
61
+    {
62
+        case '1':
63
+            $from = "{$tblsc} AS T0 LEFT JOIN {$tblsc} AS T1 ON T0.id + 1 = T1.id";
64
+            $rs = $modx->db->select('MIN(T0.id)+1', $from, "T1.id IS NULL");
65
+            $content['id'] = $modx->db->getValue($rs);
66
+            break;
67
+        case '2':
68
+            $rs = $modx->db->select('MAX(id)+1',$tblsc);
69
+            $content['id'] = $modx->db->getValue($rs);
70
+            break;
71
+
72
+        default:
73
+            unset($content['id']); // remove the current id.
74
+    }
75
+
76
+    // Once we've grabbed the document object, start doing some modifications
77
+    if ($_toplevel == 0) {
78
+        // count duplicates
79
+        $pagetitle = $modx->db->getValue($modx->db->select('pagetitle', $modx->getFullTableName('site_content'), "id='{$docid}'"));
80
+        $pagetitle = $modx->db->escape($pagetitle);
81
+        $count = $modx->db->getRecordCount($modx->db->select('pagetitle', $modx->getFullTableName('site_content'), "pagetitle LIKE '{$pagetitle} Duplicate%'"));
82
+        if($count>=1) $count = ' '.($count+1);
83
+        else $count = '';
84
+
85
+        $content['pagetitle'] = $_lang['duplicated_el_suffix'].$count.' '.$content['pagetitle'];
86
+        $content['alias'] = null;
87
+    } elseif($modx->config['friendly_urls'] == 0 || $modx->config['allow_duplicate_alias'] == 0) {
88
+        $content['alias'] = null;
89
+    }
90
+
91
+    // change the parent accordingly
92
+    if ($parent !== null) $content['parent'] = $parent;
93
+
94
+    // Change the author
95
+    $content['createdby'] = $userID;
96
+    $content['createdon'] = time();
97
+    // Remove other modification times
98
+    $content['editedby'] = $content['editedon'] = $content['deleted'] = $content['deletedby'] = $content['deletedon'] = 0;
99
+
100
+    // [FS#922] Should the published status be honored? - sirlancelot
101 101
 //	if ($modx->hasPermission('publish_document')) {
102 102
 //		if ($modx->config['publish_default'])
103 103
 //			$content['pub_date'] = $content['pub_date']; // should this be changed to 1?
104 104
 //		else	$content['pub_date'] = 0;
105 105
 //	} else {
106
-		// User can't publish documents
106
+        // User can't publish documents
107 107
 //		$content['published'] = $content['pub_date'] = 0;
108 108
 //	}
109 109
 
110 110
     // Set the published status to unpublished by default (see above ... commit #3388)
111 111
     $content['published'] = $content['pub_date'] = 0;
112 112
 
113
-	// Escape the proper strings
114
-	$content = $modx->db->escape($content);
113
+    // Escape the proper strings
114
+    $content = $modx->db->escape($content);
115 115
 
116
-	// Duplicate the Document
117
-	$newparent = $modx->db->insert($content, $tblsc);
116
+    // Duplicate the Document
117
+    $newparent = $modx->db->insert($content, $tblsc);
118 118
 
119
-	// duplicate document's TVs
120
-	duplicateTVs($docid, $newparent);
121
-	duplicateAccess($docid, $newparent);
119
+    // duplicate document's TVs
120
+    duplicateTVs($docid, $newparent);
121
+    duplicateAccess($docid, $newparent);
122 122
 
123
-	// invoke OnDocDuplicate event
124
-	$evtOut = $modx->invokeEvent('OnDocDuplicate', array(
125
-		'id' => $docid,
126
-		'new_id' => $newparent
127
-	));
123
+    // invoke OnDocDuplicate event
124
+    $evtOut = $modx->invokeEvent('OnDocDuplicate', array(
125
+        'id' => $docid,
126
+        'new_id' => $newparent
127
+    ));
128 128
 
129
-	// Start duplicating all the child documents that aren't deleted.
130
-	$_toplevel++;
131
-	$rs = $modx->db->select('id', $tblsc, "parent='{$docid}' AND deleted=0", 'id ASC');
132
-		while ($row = $modx->db->getRow($rs))
133
-			duplicateDocument($row['id'], $newparent, $_toplevel);
129
+    // Start duplicating all the child documents that aren't deleted.
130
+    $_toplevel++;
131
+    $rs = $modx->db->select('id', $tblsc, "parent='{$docid}' AND deleted=0", 'id ASC');
132
+        while ($row = $modx->db->getRow($rs))
133
+            duplicateDocument($row['id'], $newparent, $_toplevel);
134 134
 
135
-	// return the new doc id
136
-	return $newparent;
135
+    // return the new doc id
136
+    return $newparent;
137 137
 }
138 138
 
139 139
 // Duplicate Document TVs
140 140
 function duplicateTVs($oldid,$newid){
141
-	global $modx;
141
+    global $modx;
142 142
 
143
-	$tbltvc = $modx->getFullTableName('site_tmplvar_contentvalues');
143
+    $tbltvc = $modx->getFullTableName('site_tmplvar_contentvalues');
144 144
 
145
-	$modx->db->insert(
146
-		array('contentid'=>'', 'tmplvarid'=>'', 'value'=>''), $tbltvc, // Insert into
147
-		"{$newid}, tmplvarid, value", $tbltvc, "contentid='{$oldid}'" // Copy from
148
-	);
145
+    $modx->db->insert(
146
+        array('contentid'=>'', 'tmplvarid'=>'', 'value'=>''), $tbltvc, // Insert into
147
+        "{$newid}, tmplvarid, value", $tbltvc, "contentid='{$oldid}'" // Copy from
148
+    );
149 149
 }
150 150
 
151 151
 // Duplicate Document Access Permissions
152 152
 function duplicateAccess($oldid,$newid){
153
-	global $modx;
153
+    global $modx;
154 154
 
155
-	$tbldg = $modx->getFullTableName('document_groups');
155
+    $tbldg = $modx->getFullTableName('document_groups');
156 156
 
157
-	$modx->db->insert(
158
-		array('document'=>'', 'document_group'=>''), $tbldg, // Insert into
159
-		"{$newid}, document_group", $tbldg, "document='{$oldid}'" // Copy from
160
-	);
157
+    $modx->db->insert(
158
+        array('document'=>'', 'document_group'=>''), $tbldg, // Insert into
159
+        "{$newid}, document_group", $tbldg, "document='{$oldid}'" // Copy from
160
+    );
161 161
 }
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,27 +1,27 @@  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_document') || !$modx->hasPermission('save_document')) {
5
+if (!$modx->hasPermission('new_document') || !$modx->hasPermission('save_document')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = isset($_GET['id'])? intval($_GET['id']) : 0;
10
-if($id==0) {
9
+$id = isset($_GET['id']) ? intval($_GET['id']) : 0;
10
+if ($id == 0) {
11 11
 	$modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
14 14
 $children = array();
15 15
 
16 16
 // check permissions on the document
17
-include_once MODX_MANAGER_PATH . "processors/user_documents_permissions.class.php";
17
+include_once MODX_MANAGER_PATH."processors/user_documents_permissions.class.php";
18 18
 $udperms = new udperms();
19 19
 $udperms->user = $modx->getLoginUserID();
20 20
 $udperms->document = $id;
21 21
 $udperms->role = $_SESSION['mgrRole'];
22 22
 $udperms->duplicateDoc = true;
23 23
 
24
-if(!$udperms->checkPermissions()) {
24
+if (!$udperms->checkPermissions()) {
25 25
 	$modx->webAlertAndQuit($_lang["access_permission_denied"]);
26 26
 }
27 27
 
@@ -33,10 +33,10 @@  discard block
 block discarded – undo
33 33
 $_SESSION['itemname'] = $name;
34 34
 
35 35
 // finish cloning - redirect
36
-$header="Location: index.php?r=1&a=3&id=$id";
36
+$header = "Location: index.php?r=1&a=3&id=$id";
37 37
 header($header);
38 38
 
39
-function duplicateDocument($docid, $parent=null, $_toplevel=0) {
39
+function duplicateDocument($docid, $parent = null, $_toplevel = 0){
40 40
 	global $modx, $_lang;
41 41
 
42 42
 	// invoke OnBeforeDocDuplicate event
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 	$content = $modx->db->getRow($rs);
58 58
 
59 59
 	// Handle incremental ID
60
-	switch($modx->config['docid_incrmnt_method'])
60
+	switch ($modx->config['docid_incrmnt_method'])
61 61
 	{
62 62
 		case '1':
63 63
 			$from = "{$tblsc} AS T0 LEFT JOIN {$tblsc} AS T1 ON T0.id + 1 = T1.id";
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 			$content['id'] = $modx->db->getValue($rs);
66 66
 			break;
67 67
 		case '2':
68
-			$rs = $modx->db->select('MAX(id)+1',$tblsc);
68
+			$rs = $modx->db->select('MAX(id)+1', $tblsc);
69 69
 			$content['id'] = $modx->db->getValue($rs);
70 70
 			break;
71 71
 
@@ -79,12 +79,12 @@  discard block
 block discarded – undo
79 79
 		$pagetitle = $modx->db->getValue($modx->db->select('pagetitle', $modx->getFullTableName('site_content'), "id='{$docid}'"));
80 80
 		$pagetitle = $modx->db->escape($pagetitle);
81 81
 		$count = $modx->db->getRecordCount($modx->db->select('pagetitle', $modx->getFullTableName('site_content'), "pagetitle LIKE '{$pagetitle} Duplicate%'"));
82
-		if($count>=1) $count = ' '.($count+1);
82
+		if ($count >= 1) $count = ' '.($count + 1);
83 83
 		else $count = '';
84 84
 
85 85
 		$content['pagetitle'] = $_lang['duplicated_el_suffix'].$count.' '.$content['pagetitle'];
86 86
 		$content['alias'] = null;
87
-	} elseif($modx->config['friendly_urls'] == 0 || $modx->config['allow_duplicate_alias'] == 0) {
87
+	} elseif ($modx->config['friendly_urls'] == 0 || $modx->config['allow_duplicate_alias'] == 0) {
88 88
 		$content['alias'] = null;
89 89
 	}
90 90
 
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 }
138 138
 
139 139
 // Duplicate Document TVs
140
-function duplicateTVs($oldid,$newid){
140
+function duplicateTVs($oldid, $newid){
141 141
 	global $modx;
142 142
 
143 143
 	$tbltvc = $modx->getFullTableName('site_tmplvar_contentvalues');
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 }
150 150
 
151 151
 // Duplicate Document Access Permissions
152
-function duplicateAccess($oldid,$newid){
152
+function duplicateAccess($oldid, $newid){
153 153
 	global $modx;
154 154
 
155 155
 	$tbldg = $modx->getFullTableName('document_groups');
Please login to merge, or discard this patch.
Braces   +18 added lines, -10 removed lines patch added patch discarded remove patch
@@ -36,7 +36,8 @@  discard block
 block discarded – undo
36 36
 $header="Location: index.php?r=1&a=3&id=$id";
37 37
 header($header);
38 38
 
39
-function duplicateDocument($docid, $parent=null, $_toplevel=0) {
39
+function duplicateDocument($docid, $parent=null, $_toplevel=0)
40
+{
40 41
 	global $modx, $_lang;
41 42
 
42 43
 	// invoke OnBeforeDocDuplicate event
@@ -57,8 +58,7 @@  discard block
 block discarded – undo
57 58
 	$content = $modx->db->getRow($rs);
58 59
 
59 60
 	// Handle incremental ID
60
-	switch($modx->config['docid_incrmnt_method'])
61
-	{
61
+	switch($modx->config['docid_incrmnt_method']) {
62 62
 		case '1':
63 63
 			$from = "{$tblsc} AS T0 LEFT JOIN {$tblsc} AS T1 ON T0.id + 1 = T1.id";
64 64
 			$rs = $modx->db->select('MIN(T0.id)+1', $from, "T1.id IS NULL");
@@ -79,8 +79,11 @@  discard block
 block discarded – undo
79 79
 		$pagetitle = $modx->db->getValue($modx->db->select('pagetitle', $modx->getFullTableName('site_content'), "id='{$docid}'"));
80 80
 		$pagetitle = $modx->db->escape($pagetitle);
81 81
 		$count = $modx->db->getRecordCount($modx->db->select('pagetitle', $modx->getFullTableName('site_content'), "pagetitle LIKE '{$pagetitle} Duplicate%'"));
82
-		if($count>=1) $count = ' '.($count+1);
83
-		else $count = '';
82
+		if($count>=1) {
83
+		    $count = ' '.($count+1);
84
+		} else {
85
+		    $count = '';
86
+		}
84 87
 
85 88
 		$content['pagetitle'] = $_lang['duplicated_el_suffix'].$count.' '.$content['pagetitle'];
86 89
 		$content['alias'] = null;
@@ -89,7 +92,9 @@  discard block
 block discarded – undo
89 92
 	}
90 93
 
91 94
 	// change the parent accordingly
92
-	if ($parent !== null) $content['parent'] = $parent;
95
+	if ($parent !== null) {
96
+	    $content['parent'] = $parent;
97
+	}
93 98
 
94 99
 	// Change the author
95 100
 	$content['createdby'] = $userID;
@@ -129,15 +134,17 @@  discard block
 block discarded – undo
129 134
 	// Start duplicating all the child documents that aren't deleted.
130 135
 	$_toplevel++;
131 136
 	$rs = $modx->db->select('id', $tblsc, "parent='{$docid}' AND deleted=0", 'id ASC');
132
-		while ($row = $modx->db->getRow($rs))
133
-			duplicateDocument($row['id'], $newparent, $_toplevel);
137
+		while ($row = $modx->db->getRow($rs)) {
138
+					duplicateDocument($row['id'], $newparent, $_toplevel);
139
+		}
134 140
 
135 141
 	// return the new doc id
136 142
 	return $newparent;
137 143
 }
138 144
 
139 145
 // Duplicate Document TVs
140
-function duplicateTVs($oldid,$newid){
146
+function duplicateTVs($oldid,$newid)
147
+{
141 148
 	global $modx;
142 149
 
143 150
 	$tbltvc = $modx->getFullTableName('site_tmplvar_contentvalues');
@@ -149,7 +156,8 @@  discard block
 block discarded – undo
149 156
 }
150 157
 
151 158
 // Duplicate Document Access Permissions
152
-function duplicateAccess($oldid,$newid){
159
+function duplicateAccess($oldid,$newid)
160
+{
153 161
 	global $modx;
154 162
 
155 163
 	$tbldg = $modx->getFullTableName('document_groups');
Please login to merge, or discard this patch.
manager/processors/delete_eventlog.processor.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -3,17 +3,17 @@
 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_eventlog')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 if (isset($_GET['cls']) && $_GET['cls']==1) {
10
-	$where = '';
10
+    $where = '';
11 11
 } else {
12
-	$id = isset($_GET['id'])? intval($_GET['id']) : 0;
13
-	if($id==0) {
14
-		$modx->webAlertAndQuit($_lang["error_no_id"]);
15
-	}
16
-	$where = "id='{$id}'";
12
+    $id = isset($_GET['id'])? intval($_GET['id']) : 0;
13
+    if($id==0) {
14
+        $modx->webAlertAndQuit($_lang["error_no_id"]);
15
+    }
16
+    $where = "id='{$id}'";
17 17
 }
18 18
 
19 19
 // delete event log
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5
-if(!$modx->hasPermission('delete_eventlog')) {
5
+if (!$modx->hasPermission('delete_eventlog')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-if (isset($_GET['cls']) && $_GET['cls']==1) {
9
+if (isset($_GET['cls']) && $_GET['cls'] == 1) {
10 10
 	$where = '';
11 11
 } else {
12
-	$id = isset($_GET['id'])? intval($_GET['id']) : 0;
13
-	if($id==0) {
12
+	$id = isset($_GET['id']) ? intval($_GET['id']) : 0;
13
+	if ($id == 0) {
14 14
 		$modx->webAlertAndQuit($_lang["error_no_id"]);
15 15
 	}
16 16
 	$where = "id='{$id}'";
@@ -19,5 +19,5 @@  discard block
 block discarded – undo
19 19
 // delete event log
20 20
 $modx->db->delete($modx->getFullTableName('event_log'), $where);
21 21
 
22
-$header="Location: index.php?a=114";
22
+$header = "Location: index.php?a=114";
23 23
 header($header);
Please login to merge, or discard this patch.
manager/processors/delete_user.processor.php 2 patches
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -3,17 +3,17 @@  discard block
 block discarded – undo
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if(!$modx->hasPermission('delete_user')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 $id = isset($_GET['id'])? intval($_GET['id']) : 0;
10 10
 if($id==0) {
11
-	$modx->webAlertAndQuit($_lang["error_no_id"]);
11
+    $modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
14 14
 // delete the user, but first check if we are deleting our own record
15 15
 if($id==$modx->getLoginUserID()) {
16
-	$modx->webAlertAndQuit("You can't delete yourself!");
16
+    $modx->webAlertAndQuit("You can't delete yourself!");
17 17
 }
18 18
 
19 19
 // Set the item name for logger
@@ -22,9 +22,9 @@  discard block
 block discarded – undo
22 22
 
23 23
 // invoke OnBeforeUserFormDelete event
24 24
 $modx->invokeEvent("OnBeforeUserFormDelete",
25
-	array(
26
-		"id"	=> $id
27
-	));
25
+    array(
26
+        "id"	=> $id
27
+    ));
28 28
 
29 29
 // delete the user.
30 30
 $modx->db->delete($modx->getFullTableName('manager_users'), "id='{$id}'");
@@ -39,16 +39,16 @@  discard block
 block discarded – undo
39 39
 
40 40
 // invoke OnManagerDeleteUser event
41 41
 $modx->invokeEvent("OnManagerDeleteUser",
42
-	array(
43
-		"userid"		=> $id,
44
-		"username"		=> $username
45
-	));
42
+    array(
43
+        "userid"		=> $id,
44
+        "username"		=> $username
45
+    ));
46 46
 
47 47
 // invoke OnUserFormDelete event
48 48
 $modx->invokeEvent("OnUserFormDelete",
49
-	array(
50
-		"id"	=> $id
51
-	));
49
+    array(
50
+        "id"	=> $id
51
+    ));
52 52
 
53 53
 $header="Location: index.php?a=75";
54 54
 header($header);
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,18 +1,18 @@  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_user')) {
5
+if (!$modx->hasPermission('delete_user')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = isset($_GET['id'])? intval($_GET['id']) : 0;
10
-if($id==0) {
9
+$id = isset($_GET['id']) ? intval($_GET['id']) : 0;
10
+if ($id == 0) {
11 11
 	$modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
14 14
 // delete the user, but first check if we are deleting our own record
15
-if($id==$modx->getLoginUserID()) {
15
+if ($id == $modx->getLoginUserID()) {
16 16
 	$modx->webAlertAndQuit("You can't delete yourself!");
17 17
 }
18 18
 
@@ -50,5 +50,5 @@  discard block
 block discarded – undo
50 50
 		"id"	=> $id
51 51
 	));
52 52
 
53
-$header="Location: index.php?a=75";
53
+$header = "Location: index.php?a=75";
54 54
 header($header);
Please login to merge, or discard this patch.
manager/processors/duplicate_plugin.processor.php 3 patches
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -3,12 +3,12 @@  discard block
 block discarded – undo
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if(!$modx->hasPermission('new_plugin')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 $id = isset($_GET['id'])? intval($_GET['id']) : 0;
10 10
 if($id==0) {
11
-	$modx->webAlertAndQuit($_lang["error_no_id"]);
11
+    $modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
14 14
 // count duplicates
@@ -19,25 +19,25 @@  discard block
 block discarded – undo
19 19
 
20 20
 // duplicate Plugin
21 21
 $newid = $modx->db->insert(
22
-	array(
23
-		'name'=>'',
24
-		'description'=>'',
25
-		'disabled'=>'',
26
-		'moduleguid'=>'',
27
-		'plugincode'=>'',
28
-		'properties'=>'',
29
-		'category'=>'',
30
-		), $modx->getFullTableName('site_plugins'), // Insert into
31
-	"CONCAT(name, ' {$_lang['duplicated_el_suffix']}{$count}') AS name, description, '1' AS disabled, moduleguid, plugincode, properties, category", $modx->getFullTableName('site_plugins'), "id='{$id}'"); // Copy from
22
+    array(
23
+        'name'=>'',
24
+        'description'=>'',
25
+        'disabled'=>'',
26
+        'moduleguid'=>'',
27
+        'plugincode'=>'',
28
+        'properties'=>'',
29
+        'category'=>'',
30
+        ), $modx->getFullTableName('site_plugins'), // Insert into
31
+    "CONCAT(name, ' {$_lang['duplicated_el_suffix']}{$count}') AS name, description, '1' AS disabled, moduleguid, plugincode, properties, category", $modx->getFullTableName('site_plugins'), "id='{$id}'"); // Copy from
32 32
 
33 33
 // duplicate Plugin Event Listeners
34 34
 $modx->db->insert(
35
-	array(
36
-		'pluginid'=>'',
37
-		'evtid'=>'',
38
-		'priority'=>'',
39
-		), $modx->getFullTableName('site_plugin_events'), // Insert into
40
-	"'{$newid}', evtid, priority", $modx->getFullTableName('site_plugin_events'), "pluginid='{$id}'"); // Copy from
35
+    array(
36
+        'pluginid'=>'',
37
+        'evtid'=>'',
38
+        'priority'=>'',
39
+        ), $modx->getFullTableName('site_plugin_events'), // Insert into
40
+    "'{$newid}', evtid, priority", $modx->getFullTableName('site_plugin_events'), "pluginid='{$id}'"); // Copy from
41 41
 
42 42
 // Set the item name for logger
43 43
 $name = $modx->db->getValue($modx->db->select('name', $modx->getFullTableName('site_plugins'), "id='{$newid}'"));
Please login to merge, or discard this patch.
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('new_plugin')) {
5
+if (!$modx->hasPermission('new_plugin')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = isset($_GET['id'])? intval($_GET['id']) : 0;
10
-if($id==0) {
9
+$id = isset($_GET['id']) ? intval($_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->db->getValue($modx->db->select('name', $modx->getFullTableName('site_plugins'), "id='{$id}'"));
16 16
 $count = $modx->db->getRecordCount($modx->db->select('name', $modx->getFullTableName('site_plugins'), "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 Plugin
@@ -44,5 +44,5 @@  discard block
 block discarded – undo
44 44
 $_SESSION['itemname'] = $name;
45 45
 
46 46
 // finish duplicating - redirect to new plugin
47
-$header="Location: index.php?r=2&a=102&id=$newid";
47
+$header = "Location: index.php?r=2&a=102&id=$newid";
48 48
 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->db->getValue($modx->db->select('name', $modx->getFullTableName('site_plugins'), "id='{$id}'"));
16 16
 $count = $modx->db->getRecordCount($modx->db->select('name', $modx->getFullTableName('site_plugins'), "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 Plugin
21 24
 $newid = $modx->db->insert(
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'])? intval($_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->db->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->db->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->db->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->db->getValue($modx->db->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'])? intval($_GET['id']) : 0;
10
-if($id==0) {
9
+$id = isset($_GET['id']) ? intval($_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->db->getValue($modx->db->select('name', $modx->getFullTableName('site_tmplvars'), "id='{$id}'"));
16 16
 $count = $modx->db->getRecordCount($modx->db->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->db->getValue($modx->db->select('name', $modx->getFullTableName('site_tmplvars'), "id='{$id}'"));
16 16
 $count = $modx->db->getRecordCount($modx->db->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->db->insert(
Please login to merge, or discard this patch.
manager/processors/remove_locks.processor.php 3 patches
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -4,23 +4,23 @@
 block discarded – undo
4 4
 }
5 5
 
6 6
 if(!isset($_GET['id'])) {
7
-	if(!$modx->hasPermission('remove_locks')) $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7
+    if(!$modx->hasPermission('remove_locks')) $modx->webAlertAndQuit($_lang["error_no_privileges"]);
8 8
 
9
-	// Remove all locks
10
-	$modx->db->truncate($modx->getFullTableName('active_user_locks'));
9
+    // Remove all locks
10
+    $modx->db->truncate($modx->getFullTableName('active_user_locks'));
11 11
 
12
-	$header = "Location: index.php?a=2";
13
-	header($header);
12
+    $header = "Location: index.php?a=2";
13
+    header($header);
14 14
 } else {
15
-	// Remove single locks via AJAX / window.onbeforeunload
16
-	$type = intval($_GET['type']);
17
-	$id = intval($_GET['id']);
18
-	$includeAllUsers = $modx->hasPermission('remove_locks'); // Enables usage of "unlock"-ajax-button
19
-	if($type && $id) {
20
-		$modx->unlockElement($type, $id, $includeAllUsers);
21
-		echo '1';
22
-		exit;
23
-	} else {
24
-		echo 'No type or id sent with request.';
25
-	}
15
+    // Remove single locks via AJAX / window.onbeforeunload
16
+    $type = intval($_GET['type']);
17
+    $id = intval($_GET['id']);
18
+    $includeAllUsers = $modx->hasPermission('remove_locks'); // Enables usage of "unlock"-ajax-button
19
+    if($type && $id) {
20
+        $modx->unlockElement($type, $id, $includeAllUsers);
21
+        echo '1';
22
+        exit;
23
+    } else {
24
+        echo 'No type or id sent with request.';
25
+    }
26 26
 }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@  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($_GET['id'])) {
7
-	if(!$modx->hasPermission('remove_locks')) $modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+if (!isset($_GET['id'])) {
7
+	if (!$modx->hasPermission('remove_locks')) $modx->webAlertAndQuit($_lang["error_no_privileges"]);
8 8
 
9 9
 	// Remove all locks
10 10
 	$modx->db->truncate($modx->getFullTableName('active_user_locks'));
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 	$type = intval($_GET['type']);
17 17
 	$id = intval($_GET['id']);
18 18
 	$includeAllUsers = $modx->hasPermission('remove_locks'); // Enables usage of "unlock"-ajax-button
19
-	if($type && $id) {
19
+	if ($type && $id) {
20 20
 		$modx->unlockElement($type, $id, $includeAllUsers);
21 21
 		echo '1';
22 22
 		exit;
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,9 @@
 block discarded – undo
4 4
 }
5 5
 
6 6
 if(!isset($_GET['id'])) {
7
-	if(!$modx->hasPermission('remove_locks')) $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7
+	if(!$modx->hasPermission('remove_locks')) {
8
+	    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
9
+	}
8 10
 
9 11
 	// Remove all locks
10 12
 	$modx->db->truncate($modx->getFullTableName('active_user_locks'));
Please login to merge, or discard this patch.
manager/processors/web_access_groups.processor.php 3 patches
Indentation   +95 added lines, -95 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  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('web_access_permissions')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 // web access group processor.
@@ -20,111 +20,111 @@  discard block
 block discarded – undo
20 20
 $operation = $_REQUEST['operation'];
21 21
 
22 22
 switch ($operation) {
23
-	case "add_user_group" :
24
-		$newgroup = $_REQUEST['newusergroup'];
25
-		if(empty($newgroup)) {
26
-			$modx->webAlertAndQuit("No group name specified.");
27
-		} else {
28
-			$id = $modx->db->insert(array('name'=>$modx->db->escape($newgroup)), $tbl_webgroup_names);
23
+    case "add_user_group" :
24
+        $newgroup = $_REQUEST['newusergroup'];
25
+        if(empty($newgroup)) {
26
+            $modx->webAlertAndQuit("No group name specified.");
27
+        } else {
28
+            $id = $modx->db->insert(array('name'=>$modx->db->escape($newgroup)), $tbl_webgroup_names);
29 29
 
30
-			// invoke OnWebCreateGroup event
31
-			$modx->invokeEvent('OnWebCreateGroup', array(
32
-				'groupid'   => $id,
33
-				'groupname' => $newgroup,
34
-			));
35
-		}
36
-	break;
37
-	case "add_document_group" :
38
-		$newgroup = $_REQUEST['newdocgroup'];
39
-		if(empty($newgroup)) {
40
-			$modx->webAlertAndQuit("No group name specified.");
41
-		} else {
42
-			$id = $modx->db->insert(array('name'=>$modx->db->escape($newgroup)), $tbl_documentgroup_names);
30
+            // invoke OnWebCreateGroup event
31
+            $modx->invokeEvent('OnWebCreateGroup', array(
32
+                'groupid'   => $id,
33
+                'groupname' => $newgroup,
34
+            ));
35
+        }
36
+    break;
37
+    case "add_document_group" :
38
+        $newgroup = $_REQUEST['newdocgroup'];
39
+        if(empty($newgroup)) {
40
+            $modx->webAlertAndQuit("No group name specified.");
41
+        } else {
42
+            $id = $modx->db->insert(array('name'=>$modx->db->escape($newgroup)), $tbl_documentgroup_names);
43 43
 
44
-			// invoke OnCreateDocGroup event
45
-			$modx->invokeEvent('OnCreateDocGroup', array(
46
-				'groupid'   => $id,
47
-				'groupname' => $newgroup,
48
-			));
49
-		}
50
-	break;
51
-	case "delete_user_group" :
52
-		$updategroupaccess = true;
53
-		$usergroup = intval($_REQUEST['usergroup']);
54
-		if(empty($usergroup)) {
55
-			$modx->webAlertAndQuit("No user group id specified for deletion.");
56
-		} else {
57
-			$modx->db->delete($tbl_webgroup_names, "id='{$usergroup}'");
44
+            // invoke OnCreateDocGroup event
45
+            $modx->invokeEvent('OnCreateDocGroup', array(
46
+                'groupid'   => $id,
47
+                'groupname' => $newgroup,
48
+            ));
49
+        }
50
+    break;
51
+    case "delete_user_group" :
52
+        $updategroupaccess = true;
53
+        $usergroup = intval($_REQUEST['usergroup']);
54
+        if(empty($usergroup)) {
55
+            $modx->webAlertAndQuit("No user group id specified for deletion.");
56
+        } else {
57
+            $modx->db->delete($tbl_webgroup_names, "id='{$usergroup}'");
58 58
 
59
-			$modx->db->delete($tbl_webgroup_access, "webgroup='{$usergroup}'");
59
+            $modx->db->delete($tbl_webgroup_access, "webgroup='{$usergroup}'");
60 60
 
61
-			$modx->db->delete($tbl_web_groups, "webuser='{$usergroup}'");
62
-		}
63
-	break;
64
-	case "delete_document_group" :
65
-		$group = intval($_REQUEST['documentgroup']);
66
-		if(empty($group)) {
67
-			$modx->webAlertAndQuit("No document group id specified for deletion.");
68
-		} else {
69
-			$modx->db->delete($tbl_documentgroup_names, "id='{$group}'");
61
+            $modx->db->delete($tbl_web_groups, "webuser='{$usergroup}'");
62
+        }
63
+    break;
64
+    case "delete_document_group" :
65
+        $group = intval($_REQUEST['documentgroup']);
66
+        if(empty($group)) {
67
+            $modx->webAlertAndQuit("No document group id specified for deletion.");
68
+        } else {
69
+            $modx->db->delete($tbl_documentgroup_names, "id='{$group}'");
70 70
 
71
-			$modx->db->delete($tbl_webgroup_access, "documentgroup='{$group}'");
71
+            $modx->db->delete($tbl_webgroup_access, "documentgroup='{$group}'");
72 72
 
73
-			$modx->db->delete($tbl_document_groups, "document_group='{$group}'");
74
-		}
75
-	break;
76
-	case "rename_user_group" :
77
-		$newgroupname = $_REQUEST['newgroupname'];
78
-		if(empty($newgroupname)) {
79
-			$modx->webAlertAndQuit("No group name specified.");
80
-		}
81
-		$groupid = intval($_REQUEST['groupid']);
82
-		if(empty($groupid)) {
83
-			$modx->webAlertAndQuit("No user group id specified for rename.");
84
-		}
85
-		$modx->db->update(array('name' => $modx->db->escape($newgroupname)), $tbl_webgroup_names, "id='{$groupid}'");
86
-	break;
87
-	case "rename_document_group" :
88
-		$newgroupname = $_REQUEST['newgroupname'];
89
-		if(empty($newgroupname)) {
90
-			$modx->webAlertAndQuit("No group name specified.");
91
-		}
92
-		$groupid = intval($_REQUEST['groupid']);
93
-		if(empty($groupid)) {
94
-			$modx->webAlertAndQuit("No document group id specified for rename.");
95
-		}
96
-		$modx->db->update(array('name' => $modx->db->escape($newgroupname)), $tbl_documentgroup_names, "id='{$groupid}'");
97
-	break;
98
-	case "add_document_group_to_user_group" :
99
-		$updategroupaccess = true;
100
-		$usergroup = intval($_REQUEST['usergroup']);
101
-		$docgroup = intval($_REQUEST['docgroup']);
102
-		$rs = $modx->db->select('COUNT(*)', $tbl_webgroup_access, "webgroup='{$usergroup}' AND documentgroup='{$docgroup}'");
103
-		$limit = $modx->db->getValue($rs);
104
-		if($limit<=0) {
105
-			$modx->db->insert(array('webgroup'=>$usergroup, 'documentgroup'=>$docgroup), $tbl_webgroup_access);
106
-		} else {
107
-			//alert user that coupling already exists?
108
-		}
109
-	break;
110
-	case "remove_document_group_from_user_group" :
111
-		$updategroupaccess = true;
112
-		$coupling = intval($_REQUEST['coupling']);
113
-		$modx->db->delete($tbl_webgroup_access, "id='{$coupling}'");
114
-	break;
115
-	default :
116
-		$modx->webAlertAndQuit("No operation set in request.");
73
+            $modx->db->delete($tbl_document_groups, "document_group='{$group}'");
74
+        }
75
+    break;
76
+    case "rename_user_group" :
77
+        $newgroupname = $_REQUEST['newgroupname'];
78
+        if(empty($newgroupname)) {
79
+            $modx->webAlertAndQuit("No group name specified.");
80
+        }
81
+        $groupid = intval($_REQUEST['groupid']);
82
+        if(empty($groupid)) {
83
+            $modx->webAlertAndQuit("No user group id specified for rename.");
84
+        }
85
+        $modx->db->update(array('name' => $modx->db->escape($newgroupname)), $tbl_webgroup_names, "id='{$groupid}'");
86
+    break;
87
+    case "rename_document_group" :
88
+        $newgroupname = $_REQUEST['newgroupname'];
89
+        if(empty($newgroupname)) {
90
+            $modx->webAlertAndQuit("No group name specified.");
91
+        }
92
+        $groupid = intval($_REQUEST['groupid']);
93
+        if(empty($groupid)) {
94
+            $modx->webAlertAndQuit("No document group id specified for rename.");
95
+        }
96
+        $modx->db->update(array('name' => $modx->db->escape($newgroupname)), $tbl_documentgroup_names, "id='{$groupid}'");
97
+    break;
98
+    case "add_document_group_to_user_group" :
99
+        $updategroupaccess = true;
100
+        $usergroup = intval($_REQUEST['usergroup']);
101
+        $docgroup = intval($_REQUEST['docgroup']);
102
+        $rs = $modx->db->select('COUNT(*)', $tbl_webgroup_access, "webgroup='{$usergroup}' AND documentgroup='{$docgroup}'");
103
+        $limit = $modx->db->getValue($rs);
104
+        if($limit<=0) {
105
+            $modx->db->insert(array('webgroup'=>$usergroup, 'documentgroup'=>$docgroup), $tbl_webgroup_access);
106
+        } else {
107
+            //alert user that coupling already exists?
108
+        }
109
+    break;
110
+    case "remove_document_group_from_user_group" :
111
+        $updategroupaccess = true;
112
+        $coupling = intval($_REQUEST['coupling']);
113
+        $modx->db->delete($tbl_webgroup_access, "id='{$coupling}'");
114
+    break;
115
+    default :
116
+        $modx->webAlertAndQuit("No operation set in request.");
117 117
 }
118 118
 
119 119
 // secure web documents - flag as private
120 120
 if($updategroupaccess==true){
121
-	include MODX_MANAGER_PATH."includes/secure_web_documents.inc.php";
122
-	secureWebDocument();
121
+    include MODX_MANAGER_PATH."includes/secure_web_documents.inc.php";
122
+    secureWebDocument();
123 123
 
124
-	// Update the private group column
125
-	$modx->db->update(
126
-		'dgn.private_webgroup = (wga.webgroup IS NOT NULL)',
127
-		"{$tbl_documentgroup_names} AS dgn LEFT JOIN {$tbl_webgroup_access} AS wga ON wga.documentgroup = dgn.id");
124
+    // Update the private group column
125
+    $modx->db->update(
126
+        'dgn.private_webgroup = (wga.webgroup IS NOT NULL)',
127
+        "{$tbl_documentgroup_names} AS dgn LEFT JOIN {$tbl_webgroup_access} AS wga ON wga.documentgroup = dgn.id");
128 128
 }
129 129
 
130 130
 $header = "Location: index.php?a=91";
Please login to merge, or discard this patch.
Spacing   +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('web_access_permissions')) {
5
+if (!$modx->hasPermission('web_access_permissions')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 switch ($operation) {
23 23
 	case "add_user_group" :
24 24
 		$newgroup = $_REQUEST['newusergroup'];
25
-		if(empty($newgroup)) {
25
+		if (empty($newgroup)) {
26 26
 			$modx->webAlertAndQuit("No group name specified.");
27 27
 		} else {
28 28
 			$id = $modx->db->insert(array('name'=>$modx->db->escape($newgroup)), $tbl_webgroup_names);
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 	break;
37 37
 	case "add_document_group" :
38 38
 		$newgroup = $_REQUEST['newdocgroup'];
39
-		if(empty($newgroup)) {
39
+		if (empty($newgroup)) {
40 40
 			$modx->webAlertAndQuit("No group name specified.");
41 41
 		} else {
42 42
 			$id = $modx->db->insert(array('name'=>$modx->db->escape($newgroup)), $tbl_documentgroup_names);
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 	case "delete_user_group" :
52 52
 		$updategroupaccess = true;
53 53
 		$usergroup = intval($_REQUEST['usergroup']);
54
-		if(empty($usergroup)) {
54
+		if (empty($usergroup)) {
55 55
 			$modx->webAlertAndQuit("No user group id specified for deletion.");
56 56
 		} else {
57 57
 			$modx->db->delete($tbl_webgroup_names, "id='{$usergroup}'");
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 	break;
64 64
 	case "delete_document_group" :
65 65
 		$group = intval($_REQUEST['documentgroup']);
66
-		if(empty($group)) {
66
+		if (empty($group)) {
67 67
 			$modx->webAlertAndQuit("No document group id specified for deletion.");
68 68
 		} else {
69 69
 			$modx->db->delete($tbl_documentgroup_names, "id='{$group}'");
@@ -75,22 +75,22 @@  discard block
 block discarded – undo
75 75
 	break;
76 76
 	case "rename_user_group" :
77 77
 		$newgroupname = $_REQUEST['newgroupname'];
78
-		if(empty($newgroupname)) {
78
+		if (empty($newgroupname)) {
79 79
 			$modx->webAlertAndQuit("No group name specified.");
80 80
 		}
81 81
 		$groupid = intval($_REQUEST['groupid']);
82
-		if(empty($groupid)) {
82
+		if (empty($groupid)) {
83 83
 			$modx->webAlertAndQuit("No user group id specified for rename.");
84 84
 		}
85 85
 		$modx->db->update(array('name' => $modx->db->escape($newgroupname)), $tbl_webgroup_names, "id='{$groupid}'");
86 86
 	break;
87 87
 	case "rename_document_group" :
88 88
 		$newgroupname = $_REQUEST['newgroupname'];
89
-		if(empty($newgroupname)) {
89
+		if (empty($newgroupname)) {
90 90
 			$modx->webAlertAndQuit("No group name specified.");
91 91
 		}
92 92
 		$groupid = intval($_REQUEST['groupid']);
93
-		if(empty($groupid)) {
93
+		if (empty($groupid)) {
94 94
 			$modx->webAlertAndQuit("No document group id specified for rename.");
95 95
 		}
96 96
 		$modx->db->update(array('name' => $modx->db->escape($newgroupname)), $tbl_documentgroup_names, "id='{$groupid}'");
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 		$docgroup = intval($_REQUEST['docgroup']);
102 102
 		$rs = $modx->db->select('COUNT(*)', $tbl_webgroup_access, "webgroup='{$usergroup}' AND documentgroup='{$docgroup}'");
103 103
 		$limit = $modx->db->getValue($rs);
104
-		if($limit<=0) {
104
+		if ($limit <= 0) {
105 105
 			$modx->db->insert(array('webgroup'=>$usergroup, 'documentgroup'=>$docgroup), $tbl_webgroup_access);
106 106
 		} else {
107 107
 			//alert user that coupling already exists?
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 }
118 118
 
119 119
 // secure web documents - flag as private
120
-if($updategroupaccess==true){
120
+if ($updategroupaccess == true) {
121 121
 	include MODX_MANAGER_PATH."includes/secure_web_documents.inc.php";
122 122
 	secureWebDocument();
123 123
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -117,7 +117,7 @@
 block discarded – undo
117 117
 }
118 118
 
119 119
 // secure web documents - flag as private
120
-if($updategroupaccess==true){
120
+if($updategroupaccess==true) {
121 121
 	include MODX_MANAGER_PATH."includes/secure_web_documents.inc.php";
122 122
 	secureWebDocument();
123 123
 
Please login to merge, or discard this patch.