Completed
Push — develop ( e6bcf2...351294 )
by Dmytro
06:18
created
manager/processors/delete_htmlsnippet.processor.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if (!$modx->hasPermission('delete_snippet')) {
6 6
     $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = isset($_GET['id'])? (int)$_GET['id'] : 0;
10
-if ($id==0) {
9
+$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
10
+if ($id == 0) {
11 11
     $modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
@@ -34,5 +34,5 @@  discard block
 block discarded – undo
34 34
 $modx->clearCache('full');
35 35
 
36 36
 // finished emptying cache - redirect
37
-$header="Location: index.php?a=76&r=2";
37
+$header = "Location: index.php?a=76&r=2";
38 38
 header($header);
Please login to merge, or discard this patch.
manager/processors/duplicate_htmlsnippet.processor.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,21 +1,21 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if (!$modx->hasPermission('new_chunk')) {
6 6
     $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = isset($_GET['id'])? (int)$_GET['id'] : 0;
10
-if ($id==0) {
9
+$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
10
+if ($id == 0) {
11 11
     $modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
14 14
 // count duplicates
15 15
 $name = $modx->db->getValue($modx->db->select('name', $modx->getFullTableName('site_htmlsnippets'), "id='{$id}'"));
16 16
 $count = $modx->db->getRecordCount($modx->db->select('name', $modx->getFullTableName('site_htmlsnippets'), "name LIKE '{$name} {$_lang['duplicated_el_suffix']}%'"));
17
-if ($count>=1) {
18
-    $count = ' ' . ($count+1);
17
+if ($count >= 1) {
18
+    $count = ' '.($count + 1);
19 19
 } else {
20 20
     $count = '';
21 21
 }
@@ -35,5 +35,5 @@  discard block
 block discarded – undo
35 35
 $_SESSION['itemname'] = $name;
36 36
 
37 37
 // finish duplicating - redirect to new chunk
38
-$header="Location: index.php?r=2&a=78&id=$newid";
38
+$header = "Location: index.php?r=2&a=78&id=$newid";
39 39
 header($header);
Please login to merge, or discard this patch.
manager/processors/duplicate_snippet.processor.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,21 +1,21 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if (!$modx->hasPermission('new_snippet')) {
6 6
     $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = isset($_GET['id'])? (int)$_GET['id'] : 0;
10
-if ($id==0) {
9
+$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
10
+if ($id == 0) {
11 11
     $modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
14 14
 // count duplicates
15 15
 $name = $modx->db->getValue($modx->db->select('name', $modx->getFullTableName('site_snippets'), "id='{$id}'"));
16 16
 $count = $modx->db->getRecordCount($modx->db->select('name', $modx->getFullTableName('site_snippets'), "name LIKE '{$name} {$_lang['duplicated_el_suffix']}%'"));
17
-if ($count>=1) {
18
-    $count = ' ' . ($count+1);
17
+if ($count >= 1) {
18
+    $count = ' '.($count + 1);
19 19
 } else {
20 20
     $count = '';
21 21
 }
@@ -36,5 +36,5 @@  discard block
 block discarded – undo
36 36
 $_SESSION['itemname'] = $name;
37 37
 
38 38
 // finish duplicating - redirect to new snippet
39
-$header="Location: index.php?r=2&a=22&id=$newid";
39
+$header = "Location: index.php?r=2&a=22&id=$newid";
40 40
 header($header);
Please login to merge, or discard this patch.
manager/processors/duplicate_content.processor.php 1 patch
Spacing   +13 added lines, -13 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 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'])? (int)$_GET['id'] : 0;
10
-if ($id==0) {
9
+$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
10
+if ($id == 0) {
11 11
     $modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
14 14
 $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;
@@ -33,7 +33,7 @@  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 39
 /**
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
  * @param int $_toplevel
43 43
  * @return int
44 44
  */
45
-function duplicateDocument($docid, $parent=null, $_toplevel=0)
45
+function duplicateDocument($docid, $parent = null, $_toplevel = 0)
46 46
 {
47 47
     $modx = evolutionCMS();
48 48
     global $_lang;
@@ -86,13 +86,13 @@  discard block
 block discarded – undo
86 86
         $pagetitle = $modx->db->getValue($modx->db->select('pagetitle', $modx->getFullTableName('site_content'), "id='{$docid}'"));
87 87
         $pagetitle = $modx->db->escape($pagetitle);
88 88
         $count = $modx->db->getRecordCount($modx->db->select('pagetitle', $modx->getFullTableName('site_content'), "pagetitle LIKE '{$pagetitle} Duplicate%'"));
89
-        if ($count>=1) {
90
-            $count = ' ' . ($count+1);
89
+        if ($count >= 1) {
90
+            $count = ' '.($count + 1);
91 91
         } else {
92 92
             $count = '';
93 93
         }
94 94
 
95
-        $content['pagetitle'] = $_lang['duplicated_el_suffix'] . $count . ' ' . $content['pagetitle'];
95
+        $content['pagetitle'] = $_lang['duplicated_el_suffix'].$count.' '.$content['pagetitle'];
96 96
         $content['alias'] = null;
97 97
     } elseif ($modx->config['friendly_urls'] == 0 || $modx->config['allow_duplicate_alias'] == 0) {
98 98
         $content['alias'] = null;
@@ -161,8 +161,8 @@  discard block
 block discarded – undo
161 161
 
162 162
     $tbltvc = $modx->getFullTableName('site_tmplvar_contentvalues');
163 163
 
164
-    $newid = (int)$newid;
165
-    $oldid = (int)$oldid;
164
+    $newid = (int) $newid;
165
+    $oldid = (int) $oldid;
166 166
 
167 167
     $modx->db->insert(
168 168
         array('contentid'=>'', 'tmplvarid'=>'', 'value'=>''), $tbltvc, // Insert into
@@ -182,8 +182,8 @@  discard block
 block discarded – undo
182 182
 
183 183
     $tbldg = $modx->getFullTableName('document_groups');
184 184
 
185
-    $newid = (int)$newid;
186
-    $oldid = (int)$oldid;
185
+    $newid = (int) $newid;
186
+    $oldid = (int) $oldid;
187 187
 
188 188
     $modx->db->insert(
189 189
         array('document'=>'', 'document_group'=>''), $tbldg, // Insert into
Please login to merge, or discard this patch.
manager/processors/delete_tmplvars.processor.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if (!$modx->hasPermission('delete_template')) {
6 6
     $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = isset($_GET['id']) ? (int)$_GET['id'] : 0;
9
+$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
10 10
 if ($id == 0) {
11 11
     $modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
@@ -15,8 +15,8 @@  discard block
 block discarded – undo
15 15
 
16 16
 // check for relations
17 17
 if (!$forced) {
18
-    $drs = $modx->db->select('sc.id, sc.pagetitle,sc.description', $modx->getFullTableName('site_content') . " AS sc
19
-			INNER JOIN " . $modx->getFullTableName('site_tmplvar_contentvalues') . " AS stcv ON stcv.contentid=sc.id", "stcv.tmplvarid='{$id}'");
18
+    $drs = $modx->db->select('sc.id, sc.pagetitle,sc.description', $modx->getFullTableName('site_content')." AS sc
19
+			INNER JOIN " . $modx->getFullTableName('site_tmplvar_contentvalues')." AS stcv ON stcv.contentid=sc.id", "stcv.tmplvarid='{$id}'");
20 20
     $count = $modx->db->getRecordCount($drs);
21 21
     if ($count > 0) {
22 22
         include_once "header.inc.php"; ?>
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 				<ul>
43 43
 					<?php
44 44
                     while ($row = $modx->db->getRow($drs)) {
45
-                        echo '<li><span style="width: 200px"><a href="index.php?id=' . $row['id'] . '&a=27">' . $row['pagetitle'] . '</a></span>' . ($row['description'] != '' ? ' - ' . $row['description'] : '') . '</li>';
45
+                        echo '<li><span style="width: 200px"><a href="index.php?id='.$row['id'].'&a=27">'.$row['pagetitle'].'</a></span>'.($row['description'] != '' ? ' - '.$row['description'] : '').'</li>';
46 46
                     } ?>
47 47
 				</ul>
48 48
 			</div>
Please login to merge, or discard this patch.
manager/processors/delete_category.processor.php 1 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 5
 if (!$modx->hasPermission('save_plugin') && !$modx->hasPermission('save_snippet') && !$modx->hasPermission('save_template') && !$modx->hasPermission('save_module')) {
6 6
     $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = isset($_GET['catId'])? (int)$_GET['catId'] : 0;
10
-if ($id==0) {
9
+$id = isset($_GET['catId']) ? (int) $_GET['catId'] : 0;
10
+if ($id == 0) {
11 11
     $modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
@@ -15,9 +15,9 @@  discard block
 block discarded – undo
15 15
 $name = $modx->db->getValue($modx->db->select('category', $modx->getFullTableName('categories'), "id='{$id}'"));
16 16
 $_SESSION['itemname'] = $name;
17 17
 
18
-include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
18
+include_once(MODX_MANAGER_PATH.'includes/categories.inc.php');
19 19
 deleteCategory($id);
20 20
 
21 21
 // finished emptying cache - redirect
22
-$header="Location: index.php?a=76";
22
+$header = "Location: index.php?a=76";
23 23
 header($header);
Please login to merge, or discard this patch.
manager/processors/delete_web_user.processor.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if (!$modx->hasPermission('delete_web_user')) {
6 6
     $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = isset($_GET['id'])? (int)$_GET['id'] : 0;
10
-if ($id==0) {
9
+$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
10
+if ($id == 0) {
11 11
     $modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
@@ -43,5 +43,5 @@  discard block
 block discarded – undo
43 43
         "id"	=> $id
44 44
     ));
45 45
 
46
-$header="Location: index.php?a=99";
46
+$header = "Location: index.php?a=99";
47 47
 header($header);
Please login to merge, or discard this patch.
manager/processors/save_plugin.processor.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die('<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.');
4 4
 }
5 5
 if (!$modx->hasPermission('save_plugin')) {
6 6
     $modx->webAlertAndQuit($_lang['error_no_privileges']);
7 7
 }
8 8
 
9
-$id = (int)$_POST['id'];
9
+$id = (int) $_POST['id'];
10 10
 $name = $modx->db->escape(trim($_POST['name']));
11 11
 $description = $modx->db->escape($_POST['description']);
12 12
 $locked = $_POST['locked'] == 'on' ? '1' : '0';
@@ -20,11 +20,11 @@  discard block
 block discarded – undo
20 20
 
21 21
 //Kyle Jaebker - added category support
22 22
 if (empty($_POST['newcategory']) && $_POST['categoryid'] > 0) {
23
-    $categoryid = (int)$_POST['categoryid'];
23
+    $categoryid = (int) $_POST['categoryid'];
24 24
 } elseif (empty($_POST['newcategory']) && $_POST['categoryid'] <= 0) {
25 25
     $categoryid = 0;
26 26
 } else {
27
-    include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
27
+    include_once(MODX_MANAGER_PATH.'includes/categories.inc.php');
28 28
     $categoryid = getCategory($_POST['newcategory']);
29 29
 }
30 30
 
@@ -40,12 +40,12 @@  discard block
 block discarded – undo
40 40
     $moduleguid = isset($parsed['guid']) ? $parsed['guid'] : $moduleguid;
41 41
 
42 42
     $description = isset($parsed['description']) ? $parsed['description'] : $description;
43
-    $version = isset($parsed['version']) ? '<b>' . $parsed['version'] . '</b> ' : '';
43
+    $version = isset($parsed['version']) ? '<b>'.$parsed['version'].'</b> ' : '';
44 44
     if ($version) {
45
-        $description = $version . trim(preg_replace('/(<b>.+?)+(<\/b>)/i', '', $description));
45
+        $description = $version.trim(preg_replace('/(<b>.+?)+(<\/b>)/i', '', $description));
46 46
     }
47 47
     if (isset($parsed['modx_category'])) {
48
-        include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
48
+        include_once(MODX_MANAGER_PATH.'includes/categories.inc.php');
49 49
         $categoryid = getCategory($parsed['modx_category']);
50 50
     }
51 51
 }
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
         // finished emptying cache - redirect
104 104
         if ($_POST['stay'] != '') {
105 105
             $a = ($_POST['stay'] == '2') ? "102&id=$newid" : '101';
106
-            $header = 'Location: index.php?a=' . $a . '&r=2&stay=' . $_POST['stay'];
106
+            $header = 'Location: index.php?a='.$a.'&r=2&stay='.$_POST['stay'];
107 107
             header($header);
108 108
         } else {
109 109
             $header = 'Location: index.php?a=76&r=2';
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
         // finished emptying cache - redirect
159 159
         if ($_POST['stay'] != '') {
160 160
             $a = ($_POST['stay'] == '2') ? "102&id=$id" : '101';
161
-            $header = 'Location: index.php?a=' . $a . '&r=2&stay=' . $_POST['stay'];
161
+            $header = 'Location: index.php?a='.$a.'&r=2&stay='.$_POST['stay'];
162 162
             header($header);
163 163
         } else {
164 164
             $modx->unlockElement(5, $id);
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 function getEventIdByName($name)
227 227
 {
228 228
     $modx = evolutionCMS();
229
-    static $eventIds=array();
229
+    static $eventIds = array();
230 230
 
231 231
     if (isset($eventIds[$name])) {
232 232
         return $eventIds[$name];
Please login to merge, or discard this patch.
manager/processors/duplicate_module.processor.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if (!$modx->hasPermission('new_module')) {
6 6
     $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = isset($_GET['id'])? (int)$_GET['id'] : 0;
10
-if ($id==0) {
9
+$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
10
+if ($id == 0) {
11 11
     $modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
@@ -18,9 +18,9 @@  discard block
 block discarded – undo
18 18
  */
19 19
 function createGUID()
20 20
 {
21
-    srand((double)microtime()*1000000);
22
-    $r = rand() ;
23
-    $u = uniqid(getmypid() . $r . (double)microtime()*1000000, 1);
21
+    srand((double) microtime() * 1000000);
22
+    $r = rand();
23
+    $u = uniqid(getmypid().$r.(double) microtime() * 1000000, 1);
24 24
     $m = md5($u);
25 25
     return $m;
26 26
 }
@@ -28,8 +28,8 @@  discard block
 block discarded – undo
28 28
 // count duplicates
29 29
 $name = $modx->db->getValue($modx->db->select('name', $modx->getFullTableName('site_modules'), "id='{$id}'"));
30 30
 $count = $modx->db->getRecordCount($modx->db->select('name', $modx->getFullTableName('site_modules'), "name LIKE '{$name} {$_lang['duplicated_el_suffix']}%'"));
31
-if ($count>=1) {
32
-    $count = ' ' . ($count+1);
31
+if ($count >= 1) {
32
+    $count = ' '.($count + 1);
33 33
 } else {
34 34
     $count = '';
35 35
 }
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
         'properties'=>'',
53 53
         'modulecode'=>'',
54 54
         ), $modx->getFullTableName('site_modules'), // Insert into
55
-    "CONCAT(name, ' {$_lang['duplicated_el_suffix']}{$count}') AS name, description, '1' AS disabled, category, wrap, icon, enable_resource, resourcefile, createdon, editedon, '" . createGUID() . "' AS guid, enable_sharedparams, properties, modulecode", $modx->getFullTableName('site_modules'), "id='{$id}'"); // Copy from
55
+    "CONCAT(name, ' {$_lang['duplicated_el_suffix']}{$count}') AS name, description, '1' AS disabled, category, wrap, icon, enable_resource, resourcefile, createdon, editedon, '".createGUID()."' AS guid, enable_sharedparams, properties, modulecode", $modx->getFullTableName('site_modules'), "id='{$id}'"); // Copy from
56 56
 
57 57
 // duplicate module dependencies
58 58
 $modx->db->insert(
@@ -76,5 +76,5 @@  discard block
 block discarded – undo
76 76
 $_SESSION['itemname'] = $name;
77 77
 
78 78
 // finish duplicating - redirect to new module
79
-$header="Location: index.php?r=2&a=108&id=$newid";
79
+$header = "Location: index.php?r=2&a=108&id=$newid";
80 80
 header($header);
Please login to merge, or discard this patch.