Completed
Push — develop ( cb7ecf...5e631f )
by Dmytro
17s
created
manager/processors/delete_template.processor.php 1 patch
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -1,22 +1,22 @@  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('delete_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
 // delete the template, but first check it doesn't have any documents using it
15 15
 $rs = $modx->getDatabase()->select('id, pagetitle,introtext', $modx->getFullTableName('site_content'), "template='{$id}' AND deleted=0");
16 16
 $limit = $modx->getDatabase()->getRecordCount($rs);
17 17
 if($limit > 0) {
18
-	include "header.inc.php";
19
-	?>
18
+    include "header.inc.php";
19
+    ?>
20 20
 
21 21
 	<h1><?php echo $_lang['manage_templates']; ?></h1>
22 22
 
@@ -28,20 +28,20 @@  discard block
 block discarded – undo
28 28
 			<p>Documents using this template:</p>
29 29
 			<ul>
30 30
 				<?php
31
-				while($row = $modx->getDatabase()->getRow($rs)) {
32
-					echo '<li><span style="width: 200px"><a href="index.php?id=' . $row['id'] . '&a=27">' . $row['pagetitle'] . '</a></span>' . ($row['introtext'] != '' ? ' - ' . $row['introtext'] : '') . '</li>';
33
-				}
34
-				?>
31
+                while($row = $modx->getDatabase()->getRow($rs)) {
32
+                    echo '<li><span style="width: 200px"><a href="index.php?id=' . $row['id'] . '&a=27">' . $row['pagetitle'] . '</a></span>' . ($row['introtext'] != '' ? ' - ' . $row['introtext'] : '') . '</li>';
33
+                }
34
+                ?>
35 35
 			</ul>
36 36
 		</div>
37 37
 	</div>
38 38
 	<?php
39
-	include_once "footer.inc.php";
40
-	exit;
39
+    include_once "footer.inc.php";
40
+    exit;
41 41
 }
42 42
 
43 43
 if($id == $default_template) {
44
-	$modx->webAlertAndQuit("This template is set as the default template. Please choose a different default template in the MODX configuration before deleting this template.");
44
+    $modx->webAlertAndQuit("This template is set as the default template. Please choose a different default template in the MODX configuration before deleting this template.");
45 45
 }
46 46
 
47 47
 // Set the item name for logger
@@ -50,8 +50,8 @@  discard block
 block discarded – undo
50 50
 
51 51
 // invoke OnBeforeTempFormDelete event
52 52
 $modx->invokeEvent("OnBeforeTempFormDelete", array(
53
-		"id" => $id
54
-	));
53
+        "id" => $id
54
+    ));
55 55
 
56 56
 // delete the document.
57 57
 $modx->getDatabase()->delete($modx->getFullTableName('site_templates'), "id='{$id}'");
@@ -60,8 +60,8 @@  discard block
 block discarded – undo
60 60
 
61 61
 // invoke OnTempFormDelete event
62 62
 $modx->invokeEvent("OnTempFormDelete", array(
63
-		"id" => $id
64
-	));
63
+        "id" => $id
64
+    ));
65 65
 
66 66
 // empty cache
67 67
 $modx->clearCache('full');
Please login to merge, or discard this patch.
manager/processors/save_settings.processor.php 1 patch
Indentation   +109 added lines, -109 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('settings')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 $data = $_POST;
9 9
 // lose the POST now, gets rid of quirky issue with Safari 3 - see FS#972
@@ -11,41 +11,41 @@  discard block
 block discarded – undo
11 11
 
12 12
 if($data['friendly_urls']==='1' && strpos($_SERVER['SERVER_SOFTWARE'],'IIS')===false)
13 13
 {
14
-	$htaccess        = $modx->config['base_path'] . '.htaccess';
15
-	$sample_htaccess = $modx->config['base_path'] . 'ht.access';
16
-	$dir = '/' . trim($modx->config['base_url'],'/');
17
-	if(is_file($htaccess))
18
-	{
19
-		$_ = file_get_contents($htaccess);
20
-		if(strpos($_,'RewriteBase')===false)
21
-		{
22
-			$warnings[] = $_lang["settings_friendlyurls_alert2"];
23
-		}
24
-		elseif(is_writable($htaccess))
25
-		{
26
-			$_ = preg_replace('@RewriteBase.+@',"RewriteBase {$dir}", $_);
27
-			if(!@file_put_contents($htaccess,$_))
28
-			{
29
-				$warnings[] = $_lang["settings_friendlyurls_alert2"];
30
-			}
31
-		}
32
-	}
33
-	elseif(is_file($sample_htaccess))
34
-	{
35
-		if(!@rename($sample_htaccess,$htaccess))
14
+    $htaccess        = $modx->config['base_path'] . '.htaccess';
15
+    $sample_htaccess = $modx->config['base_path'] . 'ht.access';
16
+    $dir = '/' . trim($modx->config['base_url'],'/');
17
+    if(is_file($htaccess))
18
+    {
19
+        $_ = file_get_contents($htaccess);
20
+        if(strpos($_,'RewriteBase')===false)
36 21
         {
37
-        	$warnings[] = $_lang["settings_friendlyurls_alert"];
38
-		}
39
-		elseif($modx->config['base_url']!=='/')
40
-		{
41
-			$_ = file_get_contents($htaccess);
42
-			$_ = preg_replace('@RewriteBase.+@',"RewriteBase {$dir}", $_);
43
-			if(!@file_put_contents($htaccess,$_))
44
-			{
45
-				$warnings[] = $_lang["settings_friendlyurls_alert2"];
46
-			}
47
-		}
48
-	}
22
+            $warnings[] = $_lang["settings_friendlyurls_alert2"];
23
+        }
24
+        elseif(is_writable($htaccess))
25
+        {
26
+            $_ = preg_replace('@RewriteBase.+@',"RewriteBase {$dir}", $_);
27
+            if(!@file_put_contents($htaccess,$_))
28
+            {
29
+                $warnings[] = $_lang["settings_friendlyurls_alert2"];
30
+            }
31
+        }
32
+    }
33
+    elseif(is_file($sample_htaccess))
34
+    {
35
+        if(!@rename($sample_htaccess,$htaccess))
36
+        {
37
+            $warnings[] = $_lang["settings_friendlyurls_alert"];
38
+        }
39
+        elseif($modx->config['base_url']!=='/')
40
+        {
41
+            $_ = file_get_contents($htaccess);
42
+            $_ = preg_replace('@RewriteBase.+@',"RewriteBase {$dir}", $_);
43
+            if(!@file_put_contents($htaccess,$_))
44
+            {
45
+                $warnings[] = $_lang["settings_friendlyurls_alert2"];
46
+            }
47
+        }
48
+    }
49 49
 }
50 50
 
51 51
 if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) {
@@ -56,22 +56,22 @@  discard block
 block discarded – undo
56 56
 $data['rb_base_dir']      = str_replace('[(base_path)]',MODX_BASE_PATH,$data['rb_base_dir']);
57 57
 
58 58
 if (isset($data) && count($data) > 0) {
59
-	if(isset($data['manager_language'])) {
60
-		$lang_path = MODX_MANAGER_PATH . 'includes/lang/' . $data['manager_language'] . '.inc.php';
61
-		if(is_file($lang_path)) {
62
-			include($lang_path);
59
+    if(isset($data['manager_language'])) {
60
+        $lang_path = MODX_MANAGER_PATH . 'includes/lang/' . $data['manager_language'] . '.inc.php';
61
+        if(is_file($lang_path)) {
62
+            include($lang_path);
63 63
             global $modx_lang_attribute;
64 64
             $data['lang_code'] = !$modx_lang_attribute ? 'en' : $modx_lang_attribute;
65
-		}
66
-	}
67
-	$savethese = array();
68
-	$data['sys_files_checksum'] = $modx->getManagerApi()->getSystemChecksum($data['check_files_onlogin']);
69
-	$data['mail_check_timeperiod'] = (int)$data['mail_check_timeperiod'] < 60 ? 60 : $data['mail_check_timeperiod']; // updateMail() in mainMenu no faster than every minute
70
-	foreach ($data as $k => $v) {
71
-		switch ($k) {
72
-			case 'site_name':
73
-				$v = htmlspecialchars($v);
74
-				break;
65
+        }
66
+    }
67
+    $savethese = array();
68
+    $data['sys_files_checksum'] = $modx->getManagerApi()->getSystemChecksum($data['check_files_onlogin']);
69
+    $data['mail_check_timeperiod'] = (int)$data['mail_check_timeperiod'] < 60 ? 60 : $data['mail_check_timeperiod']; // updateMail() in mainMenu no faster than every minute
70
+    foreach ($data as $k => $v) {
71
+        switch ($k) {
72
+            case 'site_name':
73
+                $v = htmlspecialchars($v);
74
+                break;
75 75
             case 'settings_version':{
76 76
                 if($modx->getVersionData('version')!=$data['settings_version']){
77 77
                     $modx->logEvent(17,2,'<pre>'.var_export($data['settings_version'],true).'</pre>','fake settings_version');
@@ -79,24 +79,24 @@  discard block
 block discarded – undo
79 79
                 }
80 80
                 break;
81 81
             }
82
-			case 'error_page':
83
-			case 'unauthorized_page':
84
-			if (trim($v) == '' || !is_numeric($v)) {
85
-				$v = $data['site_start'];
86
-			}
87
-			break;
82
+            case 'error_page':
83
+            case 'unauthorized_page':
84
+            if (trim($v) == '' || !is_numeric($v)) {
85
+                $v = $data['site_start'];
86
+            }
87
+            break;
88 88
 
89
-			case 'lst_custom_contenttype':
90
-			case 'txt_custom_contenttype':
91
-				// Skip these
92
-				$k = '';
93
-				break;
94
-			case 'rb_base_dir':
95
-			case 'rb_base_url':
96
-			case 'filemanager_path':
97
-				$v = trim($v);
98
-				$v = rtrim($v,'/') . '/';
99
-				break;
89
+            case 'lst_custom_contenttype':
90
+            case 'txt_custom_contenttype':
91
+                // Skip these
92
+                $k = '';
93
+                break;
94
+            case 'rb_base_dir':
95
+            case 'rb_base_url':
96
+            case 'filemanager_path':
97
+                $v = trim($v);
98
+                $v = rtrim($v,'/') . '/';
99
+                break;
100 100
             case 'manager_language':
101 101
                 $langDir = realpath(MODX_MANAGER_PATH . 'includes/lang');
102 102
                 $langFile = realpath(MODX_MANAGER_PATH . 'includes/lang/' . $v . '.inc.php');
@@ -104,56 +104,56 @@  discard block
 block discarded – undo
104 104
                 if($langDir !== $langFileDir || !file_exists($langFile)) {
105 105
                     $v = 'english';
106 106
                 }
107
-				break;
108
-			case 'smtppw':
109
-				if ($v !== '********************' && $v !== '') {
110
-					$v = trim($v);
111
-					$v = base64_encode($v) . substr(str_shuffle('abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789'), 0, 7);
112
-					$v = str_replace('=','%',$v);
113
-				} elseif ($v === '********************') {
114
-					$k = '';
115
-				}
116
-				break;
107
+                break;
108
+            case 'smtppw':
109
+                if ($v !== '********************' && $v !== '') {
110
+                    $v = trim($v);
111
+                    $v = base64_encode($v) . substr(str_shuffle('abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789'), 0, 7);
112
+                    $v = str_replace('=','%',$v);
113
+                } elseif ($v === '********************') {
114
+                    $k = '';
115
+                }
116
+                break;
117 117
             case 'valid_hostnames':
118
-				$v = str_replace(array(' ,', ', '), ',', $v);
119
-				if ($v !== ',') {
120
-					$v = ($v != 'MODX_SITE_HOSTNAMES') ? $v : '';
121
-					$configString = '<?php' . "\n" . 'define(\'MODX_SITE_HOSTNAMES\', \'' . $v . '\');' . "\n";
122
-					@file_put_contents(MODX_BASE_PATH . 'assets/cache/siteHostnames.php', $configString);
123
-				}
124
-				$k = '';
125
-				break;
126
-			case 'session_timeout':
127
-				$mail_check_timeperiod = $data['mail_check_timeperiod'];
128
-				$v = (int)$v < ($data['mail_check_timeperiod']/60+1) ? ($data['mail_check_timeperiod']/60+1) : $v; // updateMail() in mainMenu pings as per mail_check_timeperiod, so +1min is minimum
129
-				break;
130
-			default:
131
-			break;
132
-		}
133
-		$v = is_array($v) ? implode(",", $v) : $v;
118
+                $v = str_replace(array(' ,', ', '), ',', $v);
119
+                if ($v !== ',') {
120
+                    $v = ($v != 'MODX_SITE_HOSTNAMES') ? $v : '';
121
+                    $configString = '<?php' . "\n" . 'define(\'MODX_SITE_HOSTNAMES\', \'' . $v . '\');' . "\n";
122
+                    @file_put_contents(MODX_BASE_PATH . 'assets/cache/siteHostnames.php', $configString);
123
+                }
124
+                $k = '';
125
+                break;
126
+            case 'session_timeout':
127
+                $mail_check_timeperiod = $data['mail_check_timeperiod'];
128
+                $v = (int)$v < ($data['mail_check_timeperiod']/60+1) ? ($data['mail_check_timeperiod']/60+1) : $v; // updateMail() in mainMenu pings as per mail_check_timeperiod, so +1min is minimum
129
+                break;
130
+            default:
131
+            break;
132
+        }
133
+        $v = is_array($v) ? implode(",", $v) : $v;
134 134
 
135
-		$modx->config[$k] = $v;
135
+        $modx->config[$k] = $v;
136 136
 
137
-		if(!empty($k)) $savethese[] = '(\''.$modx->getDatabase()->escape($k).'\', \''.$modx->getDatabase()->escape($v).'\')';
138
-	}
137
+        if(!empty($k)) $savethese[] = '(\''.$modx->getDatabase()->escape($k).'\', \''.$modx->getDatabase()->escape($v).'\')';
138
+    }
139 139
 
140
-	// Run a single query to save all the values
141
-	$sql = "REPLACE INTO ".$modx->getFullTableName("system_settings")." (setting_name, setting_value)
140
+    // Run a single query to save all the values
141
+    $sql = "REPLACE INTO ".$modx->getFullTableName("system_settings")." (setting_name, setting_value)
142 142
 		VALUES ".implode(', ', $savethese);
143
-	$modx->getDatabase()->query($sql);
143
+    $modx->getDatabase()->query($sql);
144 144
 
145
-	// Reset Template Pages
146
-	if (isset($data['reset_template'])) {
147
-		$newtemplate = (int)$data['default_template'];
148
-		$oldtemplate = (int)$data['old_template'];
149
-		$tbl = $modx->getFullTableName('site_content');
150
-		$reset = $data['reset_template'];
151
-		if($reset==1) $modx->getDatabase()->update(array('template' => $newtemplate), $tbl, "type='document'");
152
-		else if($reset==2) $modx->getDatabase()->update(array('template' => $newtemplate), $tbl, "template='{$oldtemplate}'");
153
-	}
145
+    // Reset Template Pages
146
+    if (isset($data['reset_template'])) {
147
+        $newtemplate = (int)$data['default_template'];
148
+        $oldtemplate = (int)$data['old_template'];
149
+        $tbl = $modx->getFullTableName('site_content');
150
+        $reset = $data['reset_template'];
151
+        if($reset==1) $modx->getDatabase()->update(array('template' => $newtemplate), $tbl, "type='document'");
152
+        else if($reset==2) $modx->getDatabase()->update(array('template' => $newtemplate), $tbl, "template='{$oldtemplate}'");
153
+    }
154 154
 
155
-	// empty cache
156
-	$modx->clearCache('full');
155
+    // empty cache
156
+    $modx->clearCache('full');
157 157
 }
158 158
 $header="Location: index.php?a=7&r=10";
159 159
 header($header);
Please login to merge, or discard this patch.
manager/processors/duplicate_plugin.processor.php 1 patch
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'])? (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,25 +19,25 @@  discard block
 block discarded – undo
19 19
 
20 20
 // duplicate Plugin
21 21
 $newid = $modx->getDatabase()->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->getDatabase()->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->getDatabase()->getValue($modx->getDatabase()->select('name', $modx->getFullTableName('site_plugins'), "id='{$newid}'"));
Please login to merge, or discard this patch.
manager/processors/duplicate_snippet.processor.php 1 patch
Indentation   +10 added lines, -10 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_snippet')) {
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,14 +19,14 @@  discard block
 block discarded – undo
19 19
 
20 20
 // duplicate Snippet
21 21
 $newid = $modx->getDatabase()->insert(
22
-	array(
23
-		'name'=>'',
24
-		'description'=>'',
25
-		'snippet'=>'',
26
-		'properties'=>'',
27
-		'category'=>'',
28
-		), $modx->getFullTableName('site_snippets'), // Insert into
29
-	"CONCAT(name, ' {$_lang['duplicated_el_suffix']}{$count}') AS name, description, snippet, properties, category", $modx->getFullTableName('site_snippets'), "id='{$id}'"); // Copy from
22
+    array(
23
+        'name'=>'',
24
+        'description'=>'',
25
+        'snippet'=>'',
26
+        'properties'=>'',
27
+        'category'=>'',
28
+        ), $modx->getFullTableName('site_snippets'), // Insert into
29
+    "CONCAT(name, ' {$_lang['duplicated_el_suffix']}{$count}') AS name, description, snippet, properties, category", $modx->getFullTableName('site_snippets'), "id='{$id}'"); // Copy from
30 30
 
31 31
 // Set the item name for logger
32 32
 $name = $modx->getDatabase()->getValue($modx->getDatabase()->select('name', $modx->getFullTableName('site_snippets'), "id='{$newid}'"));
Please login to merge, or discard this patch.
manager/processors/duplicate_template.processor.php 1 patch
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('new_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,22 +19,22 @@  discard block
 block discarded – undo
19 19
 
20 20
 // duplicate template
21 21
 $newid = $modx->getDatabase()->insert(
22
-	array(
23
-		'templatename'=>'',
24
-		'description'=>'',
25
-		'content'=>'',
26
-		'category'=>'',
27
-		), $modx->getFullTableName('site_templates'), // Insert into
28
-	"CONCAT(templatename, ' {$_lang['duplicated_el_suffix']}{$count}') AS templatename, description, content, category", $modx->getFullTableName('site_templates'), "id='{$id}'"); // Copy from
22
+    array(
23
+        'templatename'=>'',
24
+        'description'=>'',
25
+        'content'=>'',
26
+        'category'=>'',
27
+        ), $modx->getFullTableName('site_templates'), // Insert into
28
+    "CONCAT(templatename, ' {$_lang['duplicated_el_suffix']}{$count}') AS templatename, description, content, category", $modx->getFullTableName('site_templates'), "id='{$id}'"); // Copy from
29 29
 
30 30
 // duplicate TV values
31 31
 $modx->getDatabase()->insert(
32
-	array(
33
-		'tmplvarid'=>'',
34
-		'templateid'=>'',
35
-		'rank'=>'',
36
-		), $modx->getFullTableName('site_tmplvar_templates'), // Insert into
37
-	"tmplvarid, '{$newid}', rank", $modx->getFullTableName('site_tmplvar_templates'), "templateid='{$id}'"); // Copy from
32
+    array(
33
+        'tmplvarid'=>'',
34
+        'templateid'=>'',
35
+        'rank'=>'',
36
+        ), $modx->getFullTableName('site_tmplvar_templates'), // Insert into
37
+    "tmplvarid, '{$newid}', rank", $modx->getFullTableName('site_tmplvar_templates'), "templateid='{$id}'"); // Copy from
38 38
 
39 39
 // Set the item name for logger
40 40
 $name = $modx->getDatabase()->getValue($modx->getDatabase()->select('templatename', $modx->getFullTableName('site_templates'), "id='{$newid}'"));
Please login to merge, or discard this patch.
manager/processors/delete_module.processor.php 1 patch
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'])? (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
 // 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->getDatabase()->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.
manager/processors/login.processor.php 1 patch
Indentation   +127 added lines, -127 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if(!isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
3
-	header('HTTP/1.0 404 Not Found');
4
-	exit('error');
3
+    header('HTTP/1.0 404 Not Found');
4
+    exit('error');
5 5
 }
6 6
 define('IN_MANAGER_MODE', true);  // we use this to make sure files are accessed through
7 7
 define('MODX_API_MODE', true);
@@ -16,12 +16,12 @@  discard block
 block discarded – undo
16 16
 include_once("{$core_path}lang/english.inc.php");
17 17
 
18 18
 if($manager_language !== 'english' && is_file("{$core_path}lang/{$manager_language}.inc.php")) {
19
-	include_once("{$core_path}lang/{$manager_language}.inc.php");
19
+    include_once("{$core_path}lang/{$manager_language}.inc.php");
20 20
 }
21 21
 
22 22
 // Initialize System Alert Message Queque
23 23
 if(!isset($_SESSION['SystemAlertMsgQueque'])) {
24
-	$_SESSION['SystemAlertMsgQueque'] = array();
24
+    $_SESSION['SystemAlertMsgQueque'] = array();
25 25
 }
26 26
 $SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque'];
27 27
 
@@ -36,10 +36,10 @@  discard block
 block discarded – undo
36 36
 
37 37
 // invoke OnBeforeManagerLogin event
38 38
 $modx->invokeEvent('OnBeforeManagerLogin', array(
39
-		'username' => $username,
40
-		'userpassword' => $givenPassword,
41
-		'rememberme' => $rememberme
42
-	));
39
+        'username' => $username,
40
+        'userpassword' => $givenPassword,
41
+        'rememberme' => $rememberme
42
+    ));
43 43
 $fields = 'mu.*, ua.*';
44 44
 $from = '[+prefix+]manager_users AS mu, [+prefix+]user_attributes AS ua';
45 45
 $where = "BINARY mu.username='{$username}' and ua.internalKey=mu.id";
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
 $limit = $modx->getDatabase()->getRecordCount($rs);
48 48
 
49 49
 if($limit == 0 || $limit > 1) {
50
-	jsAlert($_lang['login_processor_unknown_user']);
51
-	return;
50
+    jsAlert($_lang['login_processor_unknown_user']);
51
+    return;
52 52
 }
53 53
 
54 54
 $row = $modx->getDatabase()->getRow($rs);
@@ -69,127 +69,127 @@  discard block
 block discarded – undo
69 69
 // get the user settings from the database
70 70
 $rs = $modx->getDatabase()->select('setting_name, setting_value', '[+prefix+]user_settings', "user='{$internalKey}' AND setting_value!=''");
71 71
 while($row = $modx->getDatabase()->getRow($rs)) {
72
-	extract($row);
73
-	${$setting_name} = $setting_value;
72
+    extract($row);
73
+    ${$setting_name} = $setting_value;
74 74
 }
75 75
 
76 76
 // blocked due to number of login errors.
77 77
 if($failedlogins >= $failed_allowed && $blockeduntildate > time()) {
78
-	@session_destroy();
79
-	session_unset();
80
-	if($cip = getenv("HTTP_CLIENT_IP")) {
81
-		$ip = $cip;
82
-	} elseif($cip = getenv("HTTP_X_FORWARDED_FOR")) {
83
-		$ip = $cip;
84
-	} elseif($cip = getenv("REMOTE_ADDR")) {
85
-		$ip = $cip;
86
-	} else {
87
-		$ip = "UNKNOWN";
88
-	}
89
-	$log = new EvolutionCMS\Legacy\LogHandler();
90
-	$log->initAndWriteLog("Login Fail (Temporary Block)", $internalKey, $username, "119", $internalKey, "IP: " . $ip);
91
-	jsAlert($_lang['login_processor_many_failed_logins']);
92
-	return;
78
+    @session_destroy();
79
+    session_unset();
80
+    if($cip = getenv("HTTP_CLIENT_IP")) {
81
+        $ip = $cip;
82
+    } elseif($cip = getenv("HTTP_X_FORWARDED_FOR")) {
83
+        $ip = $cip;
84
+    } elseif($cip = getenv("REMOTE_ADDR")) {
85
+        $ip = $cip;
86
+    } else {
87
+        $ip = "UNKNOWN";
88
+    }
89
+    $log = new EvolutionCMS\Legacy\LogHandler();
90
+    $log->initAndWriteLog("Login Fail (Temporary Block)", $internalKey, $username, "119", $internalKey, "IP: " . $ip);
91
+    jsAlert($_lang['login_processor_many_failed_logins']);
92
+    return;
93 93
 }
94 94
 
95 95
 // blocked due to number of login errors, but get to try again
96 96
 if($failedlogins >= $failed_allowed && $blockeduntildate < time()) {
97
-	$fields = array();
98
-	$fields['failedlogincount'] = '0';
99
-	$fields['blockeduntil'] = time() - 1;
100
-	$modx->getDatabase()->update($fields, '[+prefix+]user_attributes', "internalKey='{$internalKey}'");
97
+    $fields = array();
98
+    $fields['failedlogincount'] = '0';
99
+    $fields['blockeduntil'] = time() - 1;
100
+    $modx->getDatabase()->update($fields, '[+prefix+]user_attributes', "internalKey='{$internalKey}'");
101 101
 }
102 102
 
103 103
 // this user has been blocked by an admin, so no way he's loggin in!
104 104
 if($blocked == '1') {
105
-	@session_destroy();
106
-	session_unset();
107
-	jsAlert($_lang['login_processor_blocked1']);
108
-	return;
105
+    @session_destroy();
106
+    session_unset();
107
+    jsAlert($_lang['login_processor_blocked1']);
108
+    return;
109 109
 }
110 110
 
111 111
 // blockuntil: this user has a block until date
112 112
 if($blockeduntildate > time()) {
113
-	@session_destroy();
114
-	session_unset();
115
-	jsAlert($_lang['login_processor_blocked2']);
116
-	return;
113
+    @session_destroy();
114
+    session_unset();
115
+    jsAlert($_lang['login_processor_blocked2']);
116
+    return;
117 117
 }
118 118
 
119 119
 // blockafter: this user has a block after date
120 120
 if($blockedafterdate > 0 && $blockedafterdate < time()) {
121
-	@session_destroy();
122
-	session_unset();
123
-	jsAlert($_lang['login_processor_blocked3']);
124
-	return;
121
+    @session_destroy();
122
+    session_unset();
123
+    jsAlert($_lang['login_processor_blocked3']);
124
+    return;
125 125
 }
126 126
 
127 127
 // allowed ip
128 128
 if($allowed_ip) {
129
-	if(($hostname = gethostbyaddr($_SERVER['REMOTE_ADDR'])) && ($hostname != $_SERVER['REMOTE_ADDR'])) {
130
-		if(gethostbyname($hostname) != $_SERVER['REMOTE_ADDR']) {
131
-			jsAlert($_lang['login_processor_remotehost_ip']);
132
-			return;
133
-		}
134
-	}
135
-	if(!in_array($_SERVER['REMOTE_ADDR'], array_filter(array_map('trim', explode(',', $allowed_ip))))) {
136
-		jsAlert($_lang['login_processor_remote_ip']);
137
-		return;
138
-	}
129
+    if(($hostname = gethostbyaddr($_SERVER['REMOTE_ADDR'])) && ($hostname != $_SERVER['REMOTE_ADDR'])) {
130
+        if(gethostbyname($hostname) != $_SERVER['REMOTE_ADDR']) {
131
+            jsAlert($_lang['login_processor_remotehost_ip']);
132
+            return;
133
+        }
134
+    }
135
+    if(!in_array($_SERVER['REMOTE_ADDR'], array_filter(array_map('trim', explode(',', $allowed_ip))))) {
136
+        jsAlert($_lang['login_processor_remote_ip']);
137
+        return;
138
+    }
139 139
 }
140 140
 
141 141
 // allowed days
142 142
 if($allowed_days) {
143
-	$date = getdate();
144
-	$day = $date['wday'] + 1;
145
-	if(!in_array($day,explode(',',$allowed_days))) {
146
-		jsAlert($_lang['login_processor_date']);
147
-		return;
148
-	}
143
+    $date = getdate();
144
+    $day = $date['wday'] + 1;
145
+    if(!in_array($day,explode(',',$allowed_days))) {
146
+        jsAlert($_lang['login_processor_date']);
147
+        return;
148
+    }
149 149
 }
150 150
 
151 151
 // invoke OnManagerAuthentication event
152 152
 $rt = $modx->invokeEvent('OnManagerAuthentication', array(
153
-		'userid' => $internalKey,
154
-		'username' => $username,
155
-		'userpassword' => $givenPassword,
156
-		'savedpassword' => $dbasePassword,
157
-		'rememberme' => $rememberme
158
-	));
153
+        'userid' => $internalKey,
154
+        'username' => $username,
155
+        'userpassword' => $givenPassword,
156
+        'savedpassword' => $dbasePassword,
157
+        'rememberme' => $rememberme
158
+    ));
159 159
 
160 160
 // check if plugin authenticated the user
161 161
 $matchPassword = false;
162 162
 if(!isset($rt) || !$rt || (is_array($rt) && !in_array(true, $rt))) {
163
-	// check user password - local authentication
164
-	$hashType = $modx->getManagerApi()->getHashType($dbasePassword);
165
-	if($hashType == 'phpass') {
166
-		$matchPassword = login($username, $_REQUEST['password'], $dbasePassword);
167
-	} elseif($hashType == 'md5') {
168
-		$matchPassword = loginMD5($internalKey, $_REQUEST['password'], $dbasePassword, $username);
169
-	} elseif($hashType == 'v1') {
170
-		$matchPassword = loginV1($internalKey, $_REQUEST['password'], $dbasePassword, $username);
171
-	} else {
172
-		$matchPassword = false;
173
-	}
163
+    // check user password - local authentication
164
+    $hashType = $modx->getManagerApi()->getHashType($dbasePassword);
165
+    if($hashType == 'phpass') {
166
+        $matchPassword = login($username, $_REQUEST['password'], $dbasePassword);
167
+    } elseif($hashType == 'md5') {
168
+        $matchPassword = loginMD5($internalKey, $_REQUEST['password'], $dbasePassword, $username);
169
+    } elseif($hashType == 'v1') {
170
+        $matchPassword = loginV1($internalKey, $_REQUEST['password'], $dbasePassword, $username);
171
+    } else {
172
+        $matchPassword = false;
173
+    }
174 174
 } else if($rt === true || (is_array($rt) && in_array(true, $rt))) {
175
-	$matchPassword = true;
175
+    $matchPassword = true;
176 176
 }
177 177
 
178 178
 if(!$matchPassword) {
179
-	jsAlert($_lang['login_processor_wrong_password']);
180
-	incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes);
181
-	return;
179
+    jsAlert($_lang['login_processor_wrong_password']);
180
+    incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes);
181
+    return;
182 182
 }
183 183
 
184 184
 if($modx->config['use_captcha'] == 1) {
185
-	if(!isset ($_SESSION['veriword'])) {
186
-		jsAlert($_lang['login_processor_captcha_config']);
187
-		return;
188
-	} elseif($_SESSION['veriword'] != $captcha_code) {
189
-		jsAlert($_lang['login_processor_bad_code']);
190
-		incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes);
191
-		return;
192
-	}
185
+    if(!isset ($_SESSION['veriword'])) {
186
+        jsAlert($_lang['login_processor_captcha_config']);
187
+        return;
188
+    } elseif($_SESSION['veriword'] != $captcha_code) {
189
+        jsAlert($_lang['login_processor_bad_code']);
190
+        incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes);
191
+        return;
192
+    }
193 193
 }
194 194
 
195 195
 $modx->cleanupExpiredLocks();
@@ -224,36 +224,36 @@  discard block
 block discarded – undo
224 224
 $_SESSION['mgrToken'] = md5($currentsessionid);
225 225
 
226 226
 if($rememberme == '1') {
227
-	$_SESSION['modx.mgr.session.cookie.lifetime'] = (int)$modx->config['session.cookie.lifetime'];
228
-
229
-	// Set a cookie separate from the session cookie with the username in it.
230
-	// Are we using secure connection? If so, make sure the cookie is secure
231
-	global $https_port;
232
-
233
-	$secure = ((isset ($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || $_SERVER['SERVER_PORT'] == $https_port);
234
-	if(version_compare(PHP_VERSION, '5.2', '<')) {
235
-		setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, '; HttpOnly', $secure);
236
-	} else {
237
-		setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, NULL, $secure, true);
238
-	}
227
+    $_SESSION['modx.mgr.session.cookie.lifetime'] = (int)$modx->config['session.cookie.lifetime'];
228
+
229
+    // Set a cookie separate from the session cookie with the username in it.
230
+    // Are we using secure connection? If so, make sure the cookie is secure
231
+    global $https_port;
232
+
233
+    $secure = ((isset ($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || $_SERVER['SERVER_PORT'] == $https_port);
234
+    if(version_compare(PHP_VERSION, '5.2', '<')) {
235
+        setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, '; HttpOnly', $secure);
236
+    } else {
237
+        setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, NULL, $secure, true);
238
+    }
239 239
 } else {
240
-	$_SESSION['modx.mgr.session.cookie.lifetime'] = 0;
240
+    $_SESSION['modx.mgr.session.cookie.lifetime'] = 0;
241 241
 
242
-	// Remove the Remember Me cookie
243
-	setcookie('modx_remember_manager', '', time() - 3600, MODX_BASE_URL);
242
+    // Remove the Remember Me cookie
243
+    setcookie('modx_remember_manager', '', time() - 3600, MODX_BASE_URL);
244 244
 }
245 245
 
246 246
 // Check if user already has an active session, if not check if user pressed logout end of last session
247 247
 $rs = $modx->getDatabase()->select('lasthit', $modx->getFullTableName('active_user_sessions'), "internalKey='{$internalKey}'");
248 248
 $activeSession = $modx->getDatabase()->getValue($rs);
249 249
 if(!$activeSession) {
250
-	$rs = $modx->getDatabase()->select('lasthit', $modx->getFullTableName('active_users'), "internalKey='{$internalKey}' AND action != 8");
251
-	if($lastHit = $modx->getDatabase()->getValue($rs)) {
252
-		$_SESSION['show_logout_reminder'] = array(
253
-			'type' => 'logout_reminder',
254
-			'lastHit' => $lastHit
255
-		);
256
-	}
250
+    $rs = $modx->getDatabase()->select('lasthit', $modx->getFullTableName('active_users'), "internalKey='{$internalKey}' AND action != 8");
251
+    if($lastHit = $modx->getDatabase()->getValue($rs)) {
252
+        $_SESSION['show_logout_reminder'] = array(
253
+            'type' => 'logout_reminder',
254
+            'lastHit' => $lastHit
255
+        );
256
+    }
257 257
 }
258 258
 
259 259
 $log = new EvolutionCMS\Legacy\LogHandler();
@@ -261,27 +261,27 @@  discard block
 block discarded – undo
261 261
 
262 262
 // invoke OnManagerLogin event
263 263
 $modx->invokeEvent('OnManagerLogin', array(
264
-		'userid' => $internalKey,
265
-		'username' => $username,
266
-		'userpassword' => $givenPassword,
267
-		'rememberme' => $rememberme
268
-	));
264
+        'userid' => $internalKey,
265
+        'username' => $username,
266
+        'userpassword' => $givenPassword,
267
+        'rememberme' => $rememberme
268
+    ));
269 269
 
270 270
 // check if we should redirect user to a web page
271 271
 $rs = $modx->getDatabase()->select('setting_value', '[+prefix+]user_settings', "user='{$internalKey}' AND setting_name='manager_login_startup'");
272 272
 $id = (int)$modx->getDatabase()->getValue($rs);
273 273
 if($id > 0) {
274
-	$header = 'Location: ' . $modx->makeUrl($id, '', '', 'full');
275
-	if($_POST['ajax'] == 1) {
276
-		echo $header;
277
-	} else {
278
-		header($header);
279
-	}
274
+    $header = 'Location: ' . $modx->makeUrl($id, '', '', 'full');
275
+    if($_POST['ajax'] == 1) {
276
+        echo $header;
277
+    } else {
278
+        header($header);
279
+    }
280 280
 } else {
281
-	$header = 'Location: ' . MODX_MANAGER_URL;
282
-	if($_POST['ajax'] == 1) {
283
-		echo $header;
284
-	} else {
285
-		header($header);
286
-	}
281
+    $header = 'Location: ' . MODX_MANAGER_URL;
282
+    if($_POST['ajax'] == 1) {
283
+        echo $header;
284
+    } else {
285
+        header($header);
286
+    }
287 287
 }
Please login to merge, or discard this patch.
manager/processors/undelete_content.processor.php 1 patch
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.
manager/processors/duplicate_tmplvars.processor.php 1 patch
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.