Completed
Push — develop ( 5c6d12...f266be )
by Dmytro
11:00 queued 04:48
created
manager/media/browser/mcpuk/lib/class_fastImage.php 1 patch
Braces   +26 added lines, -36 removed lines patch added patch discarded remove patch
@@ -21,13 +21,17 @@  discard block
 block discarded – undo
21 21
 
22 22
 	public function __construct($uri = null)
23 23
 	{
24
-		if ($uri) $this->load($uri);
24
+		if ($uri) {
25
+		    $this->load($uri);
26
+		}
25 27
 	}
26 28
 
27 29
 
28 30
 	public function load($uri)
29 31
 	{
30
-		if ($this->handle) $this->close();
32
+		if ($this->handle) {
33
+		    $this->close();
34
+		}
31 35
 
32 36
 		$this->uri = $uri;
33 37
 		$this->handle = fopen($uri, 'r');
@@ -36,15 +40,16 @@  discard block
 block discarded – undo
36 40
 
37 41
 	public function close()
38 42
 	{
39
-		if (is_resource($this->handle)) fclose($this->handle);
43
+		if (is_resource($this->handle)) {
44
+		    fclose($this->handle);
45
+		}
40 46
 	}
41 47
 
42 48
 
43 49
 	public function getSize()
44 50
 	{
45 51
 		$this->strpos = 0;
46
-		if ($this->getType())
47
-		{
52
+		if ($this->getType()) {
48 53
 			return array_values($this->parseSize());
49 54
 		}
50 55
 
@@ -56,10 +61,8 @@  discard block
 block discarded – undo
56 61
 	{
57 62
 		$this->strpos = 0;
58 63
 
59
-		if (!$this->type)
60
-		{
61
-			switch ($this->getChars(2))
62
-			{
64
+		if (!$this->type) {
65
+			switch ($this->getChars(2)) {
63 66
 				case "BM":
64 67
 					return $this->type = 'bmp';
65 68
 				case "GI":
@@ -81,8 +84,7 @@  discard block
 block discarded – undo
81 84
 	{
82 85
 		$this->strpos = 0;
83 86
 
84
-		switch ($this->type)
85
-		{
87
+		switch ($this->type) {
86 88
 			case 'png':
87 89
 				return $this->parseSizeForPNG();
88 90
 			case 'gif':
@@ -127,10 +129,8 @@  discard block
 block discarded – undo
127 129
 	{
128 130
 		$state = null;
129 131
 
130
-		while (true)
131
-		{
132
-			switch ($state)
133
-			{
132
+		while (true) {
133
+			switch ($state) {
134 134
 				default:
135 135
 					$this->getChars(2);
136 136
 					$state = 'started';
@@ -138,27 +138,22 @@  discard block
 block discarded – undo
138 138
 
139 139
 				case 'started':
140 140
 					$b = $this->getByte();
141
-					if ($b === false) return false;
141
+					if ($b === false) {
142
+					    return false;
143
+					}
142 144
 
143 145
 					$state = $b == 0xFF ? 'sof' : 'started';
144 146
 					break;
145 147
 
146 148
 				case 'sof':
147 149
 					$b = $this->getByte();
148
-					if (in_array($b, range(0xe0, 0xef)))
149
-					{
150
+					if (in_array($b, range(0xe0, 0xef))) {
150 151
 						$state = 'skipframe';
151
-					}
152
-					elseif (in_array($b, array_merge(range(0xC0,0xC3), range(0xC5,0xC7), range(0xC9,0xCB), range(0xCD,0xCF))))
153
-					{
152
+					} elseif (in_array($b, array_merge(range(0xC0,0xC3), range(0xC5,0xC7), range(0xC9,0xCB), range(0xCD,0xCF)))) {
154 153
 						$state = 'readsize';
155
-					}
156
-					elseif ($b == 0xFF)
157
-					{
154
+					} elseif ($b == 0xFF) {
158 155
 						$state = 'sof';
159
-					}
160
-					else
161
-					{
156
+					} else {
162 157
 						$state = 'skipframe';
163 158
 					}
164 159
 					break;
@@ -187,21 +182,16 @@  discard block
 block discarded – undo
187 182
 		$response = null;
188 183
 
189 184
 		// do we need more data?
190
-		if ($this->strpos + $n -1 >= strlen($this->str))
191
-		{
185
+		if ($this->strpos + $n -1 >= strlen($this->str)) {
192 186
 			$end = ($this->strpos + $n);
193 187
 
194
-			while (strlen($this->str) < $end && $response !== false)
195
-			{
188
+			while (strlen($this->str) < $end && $response !== false) {
196 189
 				// read more from the file handle
197 190
 				$need = $end - ftell($this->handle);
198 191
 
199
-				if ($response = fread($this->handle, $need))
200
-				{
192
+				if ($response = fread($this->handle, $need)) {
201 193
 					$this->str .= $response;
202
-				}
203
-				else
204
-				{
194
+				} else {
205 195
 					return false;
206 196
 				}
207 197
 			}
Please login to merge, or discard this patch.
manager/actions/site_schedule.static.php 1 patch
Braces   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
 	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5
-if(!$modx->hasPermission('view_eventlog')) {
5
+if(!$modx->hasPermission('view_eventlog')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 ?>
@@ -19,11 +19,11 @@  discard block
 block discarded – undo
19 19
 			<?php
20 20
 			$rs = $modx->db->select('id, pagetitle, pub_date', $modx->getFullTableName('site_content'), "pub_date > " . time() . "", 'pub_date ASC');
21 21
 			$limit = $modx->db->getRecordCount($rs);
22
-			if($limit < 1) {
22
+			if($limit < 1) {
23 23
 				?>
24 24
 				<p><?= $_lang["no_docs_pending_publishing"] ?></p>
25 25
 				<?php
26
-			} else {
26
+			} else {
27 27
 				?>
28 28
 				<div class="table-responsive">
29 29
 					<table class="grid sortabletable" id="table-1">
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 						</thead>
37 37
 						<tbody>
38 38
 						<?php
39
-						while($row = $modx->db->getRow($rs)) {
39
+						while($row = $modx->db->getRow($rs)) {
40 40
 							?>
41 41
 							<tr>
42 42
 								<td class="text-right"><?= $row['id'] ?></td>
@@ -58,11 +58,11 @@  discard block
 block discarded – undo
58 58
 			<?php
59 59
 			$rs = $modx->db->select('id, pagetitle, unpub_date', $modx->getFullTableName('site_content'), "unpub_date > " . time() . "", 'unpub_date ASC');
60 60
 			$limit = $modx->db->getRecordCount($rs);
61
-			if($limit < 1) {
61
+			if($limit < 1) {
62 62
 				?>
63 63
 				<p><?= $_lang["no_docs_pending_unpublishing"] ?></p>
64 64
 				<?php
65
-			} else {
65
+			} else {
66 66
 				?>
67 67
 				<div class="table-responsive">
68 68
 					<table class="grid sortabletable" id="table-2">
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 						</thead>
76 76
 						<tbody>
77 77
 						<?php
78
-						while($row = $modx->db->getRow($rs)) {
78
+						while($row = $modx->db->getRow($rs)) {
79 79
 							?>
80 80
 							<tr>
81 81
 								<td class="text-right"><?= $row['id'] ?></td>
@@ -97,11 +97,11 @@  discard block
 block discarded – undo
97 97
 			<?php
98 98
 			$rs = $modx->db->select('id, pagetitle, pub_date, unpub_date', $modx->getFullTableName('site_content'), "pub_date > 0 OR unpub_date > 0", "pub_date DESC");
99 99
 			$limit = $modx->db->getRecordCount($rs);
100
-			if($limit < 1) {
100
+			if($limit < 1) {
101 101
 				?>
102 102
 				<p><?= $_lang["no_docs_pending_pubunpub"] ?></p>
103 103
 				<?php
104
-			} else {
104
+			} else {
105 105
 				?>
106 106
 				<div class="table-responsive">
107 107
 					<table class="grid sortabletable" id="table-3">
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 						</thead>
116 116
 						<tbody>
117 117
 						<?php
118
-						while($row = $modx->db->getRow($rs)) {
118
+						while($row = $modx->db->getRow($rs)) {
119 119
 							?>
120 120
 							<tr>
121 121
 								<td class="text-right"><?= $row['id'] ?></td>
Please login to merge, or discard this patch.
manager/actions/modules.static.php 1 patch
Braces   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5
-if (!($modx->hasPermission('new_module') || $modx->hasPermission('edit_module') || $modx->hasPermission('exec_module'))) {
5
+if (!($modx->hasPermission('new_module') || $modx->hasPermission('edit_module') || $modx->hasPermission('exec_module'))) {
6 6
     $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
@@ -10,10 +10,10 @@  discard block
 block discarded – undo
10 10
 $modx->manager->initPageViewState();
11 11
 
12 12
 // get and save search string
13
-if ($_REQUEST['op'] == 'reset') {
13
+if ($_REQUEST['op'] == 'reset') {
14 14
     $query = '';
15 15
     $_PAGE['vs']['search'] = '';
16
-} else {
16
+} else {
17 17
     $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search'];
18 18
     $sqlQuery = $modx->db->escape($query);
19 19
     $_PAGE['vs']['search'] = $query;
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 include_once MODX_MANAGER_PATH . "includes/controls/contextmenu.php";
29 29
 $cm = new ContextMenu("cntxm", 150);
30 30
 $cm->addItem($_lang["run_module"], "js:menuAction(1)", $_style['actions_run'], (!$modx->hasPermission('exec_module') ? 1 : 0));
31
-if ($modx->hasPermission('edit_module') || $modx->hasPermission('new_module') || $modx->hasPermission('delete_module')) {
31
+if ($modx->hasPermission('edit_module') || $modx->hasPermission('new_module') || $modx->hasPermission('delete_module')) {
32 32
     $cm->addSeparator();
33 33
 }
34 34
 $cm->addItem($_lang["edit"], "js:menuAction(2)", $_style['actions_edit'], (!$modx->hasPermission('edit_module') ? 1 : 0));
@@ -107,21 +107,21 @@  discard block
 block discarded – undo
107 107
 <div class="tab-page">
108 108
     <div class="table-responsive">
109 109
         <?php
110
-        if ($_SESSION['mgrRole'] != 1 && !empty($modx->config['use_udperms'])) {
110
+        if ($_SESSION['mgrRole'] != 1 && !empty($modx->config['use_udperms'])) {
111 111
             $rs = $modx->db->query('SELECT DISTINCT sm.id, sm.name, sm.description, mg.member, IF(disabled,"' . $_lang['yes'] . '","-") as disabled, IF(sm.icon<>"",sm.icon,"' . $_style['icons_modules'] . '") as icon
112 112
 				FROM ' . $modx->getFullTableName('site_modules') . ' AS sm
113 113
 				LEFT JOIN ' . $modx->getFullTableName('site_module_access') . ' AS sma ON sma.module = sm.id
114 114
 				LEFT JOIN ' . $modx->getFullTableName('member_groups') . ' AS mg ON sma.usergroup = mg.user_group
115 115
                 WHERE (mg.member IS NULL OR mg.member = ' . $modx->getLoginUserID() . ') AND sm.disabled != 1 AND sm.locked != 1
116 116
                 ORDER BY sm.name');
117
-            if ($modx->hasPermission('edit_module')) {
117
+            if ($modx->hasPermission('edit_module')) {
118 118
                 $title = "<a href='index.php?a=108&id=[+id+]' title='" . $_lang["module_edit_click_title"] . "'>[+value+]</a>";
119
-            } else if ($modx->hasPermission('exec_module')) {
119
+            } else if ($modx->hasPermission('exec_module')) {
120 120
                 $title = "<a href='index.php?a=112&id=[+id+]' title='" . $_lang["module_edit_click_title"] . "'>[+value+]</a>";
121
-            } else {
121
+            } else {
122 122
                 $title = '[+value+]';
123 123
             }
124
-        } else {
124
+        } else {
125 125
             $rs = $modx->db->select("id, name, description, IF(locked,'{$_lang['yes']}','-') as locked, IF(disabled,'{$_lang['yes']}','-') as disabled, IF(icon<>'',icon,'{$_style['icons_module']}') as icon", $modx->getFullTableName("site_modules"), (!empty($sqlQuery) ? "(name LIKE '%{$sqlQuery}%') OR (description LIKE '%{$sqlQuery}%')" : ""), "name");
126 126
             $title = "<a href='index.php?a=108&id=[+id+]' title='" . $_lang["module_edit_click_title"] . "'>[+value+]</a>";
127 127
         }
@@ -137,10 +137,10 @@  discard block
 block discarded – undo
137 137
         $grd->colWidths = "34,,,60,60";
138 138
         $grd->colAligns = "center,,,center,center";
139 139
         $grd->colTypes = "template:<a class='tableRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='" . $_lang["click_to_context"] . "'><i class='[+value+]'></i></a>||template:" . $title;
140
-        if ($listmode == '1') {
140
+        if ($listmode == '1') {
141 141
             $grd->pageSize = 0;
142 142
         }
143
-        if ($_REQUEST['op'] == 'reset') {
143
+        if ($_REQUEST['op'] == 'reset') {
144 144
             $grd->pageNumber = 1;
145 145
         }
146 146
         // render grid
Please login to merge, or discard this patch.
manager/actions/sysinfo.static.php 1 patch
Braces   +8 added lines, -8 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('logs')) {
5
+if (!$modx->hasPermission('logs')) {
6 6
     $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
                 <table class="table data table-sm nowrap">
56 56
                     <tbody>
57 57
                     <?php
58
-                    foreach ($serverArr as $key => $value) {
58
+                    foreach ($serverArr as $key => $value) {
59 59
                         ?>
60 60
                         <tr>
61 61
                             <td width="1%"><?= $key ?></td>
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
                     $sql = "SHOW TABLE STATUS FROM $dbase LIKE '" . $modx->db->escape($modx->db->config['table_prefix']) . "%';";
99 99
                     $rs = $modx->db->query($sql);
100 100
                     $i = 0;
101
-                    while ($log_status = $modx->db->getRow($rs)) {
101
+                    while ($log_status = $modx->db->getRow($rs)) {
102 102
                         ?>
103 103
                         <tr>
104 104
                             <td class="text-primary"><b><?= $log_status['Name'] ?></b></td>
@@ -110,17 +110,17 @@  discard block
 block discarded – undo
110 110
                                 $modx->db->config['table_prefix'] . 'event_log',
111 111
                                 $modx->db->config['table_prefix'] . 'manager_log',
112 112
                             );
113
-                            if ($modx->hasPermission('settings') && in_array($log_status['Name'], $truncateable)) {
113
+                            if ($modx->hasPermission('settings') && in_array($log_status['Name'], $truncateable)) {
114 114
                                 echo "<td class=\"text-xs-right\">";
115 115
                                 echo "<a class=\"text-danger\" href='index.php?a=54&mode=$action&u=" . $log_status['Name'] . "' title='" . $_lang['truncate_table'] . "'>" . $modx->nicesize($log_status['Data_length'] + $log_status['Data_free']) . "</a>";
116 116
                                 echo "</td>";
117
-                            } else {
117
+                            } else {
118 118
                                 echo "<td class=\"text-xs-right\">" . $modx->nicesize($log_status['Data_length'] + $log_status['Data_free']) . "</td>";
119 119
                             }
120 120
 
121
-                            if ($modx->hasPermission('settings')) {
121
+                            if ($modx->hasPermission('settings')) {
122 122
                                 echo "<td class=\"text-xs-right\">" . ($log_status['Data_free'] > 0 ? "<a class=\"text-danger\" href='index.php?a=54&mode=$action&t=" . $log_status['Name'] . "' title='" . $_lang['optimize_table'] . "' ><span>" . $modx->nicesize($log_status['Data_free']) . "</span></a>" : "-") . "</td>";
123
-                            } else {
123
+                            } else {
124 124
                                 echo "<td class=\"text-xs-right\">" . ($log_status['Data_free'] > 0 ? $modx->nicesize($log_status['Data_free']) : "-") . "</td>";
125 125
                             }
126 126
                             ?>
Please login to merge, or discard this patch.
manager/actions/help.static.php 1 patch
Braces   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
 	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 $helpBasePath = "actions/help/";
@@ -16,9 +16,9 @@  discard block
 block discarded – undo
16 16
 		</script>
17 17
 
18 18
 		<?php
19
-		if($handle = opendir('actions/help')) {
20
-			while(false !== ($file = readdir($handle))) {
21
-				if($file != "." && $file != ".." && $file != ".svn" && $file != 'index.html' && !is_dir($helpBasePath . $file)) {
19
+		if($handle = opendir('actions/help')) {
20
+			while(false !== ($file = readdir($handle))) {
21
+				if($file != "." && $file != ".." && $file != ".svn" && $file != 'index.html' && !is_dir($helpBasePath . $file)) {
22 22
 					$help[] = $file;
23 23
 				}
24 24
 			}
@@ -27,12 +27,12 @@  discard block
 block discarded – undo
27 27
 
28 28
 		natcasesort($help);
29 29
 
30
-		foreach($help as $k => $v) {
30
+		foreach($help as $k => $v) {
31 31
 
32 32
 			$helpname = substr($v, 0, strrpos($v, '.'));
33 33
 
34 34
 			$prefix = substr($helpname, 0, 2);
35
-			if(is_numeric($prefix)) {
35
+			if(is_numeric($prefix)) {
36 36
 				$helpname = substr($helpname, 2, strlen($helpname) - 1);
37 37
 			}
38 38
 
Please login to merge, or discard this patch.
manager/actions/help/03Version_Notices.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,8 +18,7 @@
 block discarded – undo
18 18
     foreach($notices as $v) {
19 19
         if ($v >= '1.3.0') {
20 20
             $cms = 'EVO';
21
-        }
22
-        else {
21
+        } else {
23 22
             $cms = 'MODX EVO';
24 23
         }
25 24
         echo '<div class="sectionHeader"> '.$cms.' '.$v.'</div><div class="sectionBody">';
Please login to merge, or discard this patch.
manager/actions/help/04Changelog.php 1 patch
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -8,7 +8,8 @@
 block discarded – undo
8 8
 <div class="sectionBody">
9 9
 <?php
10 10
 	$changeLog = MODX_BASE_PATH . 'assets/docs/changelog.txt';
11
-	if(is_readable($changeLog))
12
-		echo str_replace("\n",'<br>',file_get_contents($changeLog));
13
-?>
11
+	if(is_readable($changeLog)) {
12
+			echo str_replace("\n",'<br>',file_get_contents($changeLog));
13
+	}
14
+	?>
14 15
 </div>
Please login to merge, or discard this patch.
manager/actions/mutate_categories.dynamic.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -28,16 +28,14 @@
 block discarded – undo
28 28
 $cm = new Module_Categories_Manager();
29 29
 
30 30
 // assign module_params to internal params
31
-foreach( $_module_params as $param => $value )
32
-{
31
+foreach( $_module_params as $param => $value ) {
33 32
 	$cm->set( $param, $value );
34 33
 }
35 34
 
36 35
 // catch the request actions
37 36
 include_once $cm->get('inc_dir') . 'request_trigger.inc.php';
38 37
 
39
-if( !$categories = $cm->getCategories() )
40
-{
38
+if( !$categories = $cm->getCategories() ) {
41 39
 	setcookie('webfxtab_manage-categories-pane', 0 );
42 40
 	$cm->addMessage( $cm->txt('Currently no categories available... JUST ADD A NEW ONE!'), 'global' );
43 41
 }
Please login to merge, or discard this patch.
manager/actions/mutate_password.dynamic.php 1 patch
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
 	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5
-if(!$modx->hasPermission('change_password')) {
5
+if(!$modx->hasPermission('change_password')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 ?>
Please login to merge, or discard this patch.