GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 2c1c8e...59e133 )
by gyeong-won
10:25
created
modules/admin/admin.admin.model.php 3 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -955,10 +955,10 @@
 block discarded – undo
955 955
 
956 956
 		$file_exsit = FileHandler::readFile(_XE_PATH_ . 'files/attach/xeicon/' . $virtual_site . $iconname);
957 957
 		if(!$file_exsit && $default === true)
958
-        {
959
-            $icon_url = './modules/admin/tpl/img/' . $default_icon_name;
960
-        }
961
-        elseif($file_exsit)
958
+		{
959
+			$icon_url = './modules/admin/tpl/img/' . $default_icon_name;
960
+		}
961
+		elseif($file_exsit)
962 962
 		{
963 963
 			$default_url = Context::GetUrl();
964 964
 			if($default_url && substr_compare($default_url, '/', -1) === 0) $default_url = substr($default_url, 0, -1);
Please login to merge, or discard this patch.
Spacing   +141 added lines, -141 removed lines patch added patch discarded remove patch
@@ -30,18 +30,18 @@  discard block
 block discarded – undo
30 30
 	{
31 31
 		$ftp_info = Context::getRequestVars();
32 32
 
33
-		if(!$ftp_info->ftp_host)
33
+		if (!$ftp_info->ftp_host)
34 34
 		{
35 35
 			$ftp_info->ftp_host = "127.0.0.1";
36 36
 		}
37 37
 
38
-		if(!$ftp_info->ftp_port || !is_numeric($ftp_info->ftp_port))
38
+		if (!$ftp_info->ftp_port || !is_numeric($ftp_info->ftp_port))
39 39
 		{
40 40
 			$ftp_info->ftp_port = '22';
41 41
 		}
42 42
 
43 43
 		$connection = ssh2_connect($ftp_info->ftp_host, $ftp_info->ftp_port);
44
-		if(!ssh2_auth_password($connection, $ftp_info->ftp_user, $ftp_info->ftp_password))
44
+		if (!ssh2_auth_password($connection, $ftp_info->ftp_user, $ftp_info->ftp_password))
45 45
 		{
46 46
 			return new BaseObject(-1, 'msg_ftp_invalid_auth_info');
47 47
 		}
@@ -58,29 +58,29 @@  discard block
 block discarded – undo
58 58
 		$path_candidate = array();
59 59
 
60 60
 		$temp = '';
61
-		foreach($path_info as $path)
61
+		foreach ($path_info as $path)
62 62
 		{
63
-			$temp = '/' . $path . $temp;
63
+			$temp = '/'.$path.$temp;
64 64
 			$path_candidate[] = $temp;
65 65
 		}
66 66
 
67 67
 		// try
68
-		foreach($path_candidate as $path)
68
+		foreach ($path_candidate as $path)
69 69
 		{
70 70
 			// upload check file
71
-			if(!@ssh2_scp_send($connection, FileHandler::getRealPath('./files/cache/ftp_check'), $path . 'ftp_check.html'))
71
+			if (!@ssh2_scp_send($connection, FileHandler::getRealPath('./files/cache/ftp_check'), $path.'ftp_check.html'))
72 72
 			{
73 73
 				continue;
74 74
 			}
75 75
 
76 76
 			// get check file
77
-			$result = FileHandler::getRemoteResource(getNotencodedFullUrl() . 'ftp_check.html');
77
+			$result = FileHandler::getRemoteResource(getNotencodedFullUrl().'ftp_check.html');
78 78
 
79 79
 			// delete temp check file
80
-			@ssh2_sftp_unlink($sftp, $path . 'ftp_check.html');
80
+			@ssh2_sftp_unlink($sftp, $path.'ftp_check.html');
81 81
 
82 82
 			// found
83
-			if($result == $pin)
83
+			if ($result == $pin)
84 84
 			{
85 85
 				$found_path = $path;
86 86
 				break;
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 
90 90
 		FileHandler::removeFile('./files/cache/ftp_check', $pin);
91 91
 
92
-		if($found_path)
92
+		if ($found_path)
93 93
 		{
94 94
 			$this->add('found_path', $found_path);
95 95
 		}
@@ -99,24 +99,24 @@  discard block
 block discarded – undo
99 99
 	{
100 100
 		$ftp_info = Context::getRequestVars();
101 101
 
102
-		if(!$ftp_info->ftp_host)
102
+		if (!$ftp_info->ftp_host)
103 103
 		{
104 104
 			$ftp_info->ftp_host = "127.0.0.1";
105 105
 		}
106 106
 
107
-		if(!$ftp_info->ftp_port || !is_numeric($ftp_info->ftp_port))
107
+		if (!$ftp_info->ftp_port || !is_numeric($ftp_info->ftp_port))
108 108
 		{
109 109
 			$ftp_info->ftp_port = '22';
110 110
 		}
111 111
 
112 112
 		$connection = ftp_connect($ftp_info->ftp_host, $ftp_info->ftp_port);
113
-		if(!$connection)
113
+		if (!$connection)
114 114
 		{
115 115
 			return new BaseObject(-1, sprintf(Context::getLang('msg_ftp_not_connected'), 'host'));
116 116
 		}
117 117
 
118 118
 		$login_result = @ftp_login($connection, $ftp_info->ftp_user, $ftp_info->ftp_password);
119
-		if(!$login_result)
119
+		if (!$login_result)
120 120
 		{
121 121
 			ftp_close($connection);
122 122
 			return new BaseObject(-1, 'msg_ftp_invalid_auth_info');
@@ -133,29 +133,29 @@  discard block
 block discarded – undo
133 133
 		$path_candidate = array();
134 134
 
135 135
 		$temp = '';
136
-		foreach($path_info as $path)
136
+		foreach ($path_info as $path)
137 137
 		{
138
-			$temp = '/' . $path . $temp;
138
+			$temp = '/'.$path.$temp;
139 139
 			$path_candidate[] = $temp;
140 140
 		}
141 141
 
142 142
 		// try
143
-		foreach($path_candidate as $path)
143
+		foreach ($path_candidate as $path)
144 144
 		{
145 145
 			// upload check file
146
-			if(!ftp_put($connection, $path . 'ftp_check.html', FileHandler::getRealPath('./files/cache/ftp_check'), FTP_BINARY))
146
+			if (!ftp_put($connection, $path.'ftp_check.html', FileHandler::getRealPath('./files/cache/ftp_check'), FTP_BINARY))
147 147
 			{
148 148
 				continue;
149 149
 			}
150 150
 
151 151
 			// get check file
152
-			$result = FileHandler::getRemoteResource(getNotencodedFullUrl() . 'ftp_check.html');
152
+			$result = FileHandler::getRemoteResource(getNotencodedFullUrl().'ftp_check.html');
153 153
 
154 154
 			// delete temp check file
155
-			ftp_delete($connection, $path . 'ftp_check.html');
155
+			ftp_delete($connection, $path.'ftp_check.html');
156 156
 
157 157
 			// found
158
-			if($result == $pin)
158
+			if ($result == $pin)
159 159
 			{
160 160
 				$found_path = $path;
161 161
 				break;
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 
165 165
 		FileHandler::removeFile('./files/cache/ftp_check', $pin);
166 166
 
167
-		if($found_path)
167
+		if ($found_path)
168 168
 		{
169 169
 			$this->add('found_path', $found_path);
170 170
 		}
@@ -175,39 +175,39 @@  discard block
 block discarded – undo
175 175
 	 */
176 176
 	function getAdminFTPPath()
177 177
 	{
178
-		Context::loadLang(_XE_PATH_ . 'modules/autoinstall/lang');
178
+		Context::loadLang(_XE_PATH_.'modules/autoinstall/lang');
179 179
 		@set_time_limit(5);
180
-		require_once(_XE_PATH_ . 'libs/ftp.class.php');
180
+		require_once(_XE_PATH_.'libs/ftp.class.php');
181 181
 
182 182
 		$ftp_info = Context::getRequestVars();
183 183
 
184
-		if(!$ftp_info->ftp_user || !$ftp_info->ftp_password)
184
+		if (!$ftp_info->ftp_user || !$ftp_info->ftp_password)
185 185
 		{
186 186
 			return new BaseObject(1, 'msg_ftp_invalid_auth_info');
187 187
 		}
188 188
 
189
-		if(!$ftp_info->ftp_host)
189
+		if (!$ftp_info->ftp_host)
190 190
 		{
191 191
 			$ftp_info->ftp_host = '127.0.0.1';
192 192
 		}
193 193
 
194
-		if(!$ftp_info->ftp_port || !is_numeric($ftp_info->ftp_port))
194
+		if (!$ftp_info->ftp_port || !is_numeric($ftp_info->ftp_port))
195 195
 		{
196 196
 			$ftp_info->ftp_port = '21';
197 197
 		}
198 198
 
199
-		if($ftp_info->sftp == 'Y')
199
+		if ($ftp_info->sftp == 'Y')
200 200
 		{
201
-			if(!function_exists('ssh2_sftp'))
201
+			if (!function_exists('ssh2_sftp'))
202 202
 			{
203 203
 				return new BaseObject(-1, 'disable_sftp_support');
204 204
 			}
205 205
 			return $this->getSFTPPath();
206 206
 		}
207 207
 
208
-		if($ftp_info->ftp_pasv == 'N')
208
+		if ($ftp_info->ftp_pasv == 'N')
209 209
 		{
210
-			if(function_exists('ftp_connect'))
210
+			if (function_exists('ftp_connect'))
211 211
 			{
212 212
 				return $this->getFTPPath();
213 213
 			}
@@ -215,12 +215,12 @@  discard block
 block discarded – undo
215 215
 		}
216 216
 
217 217
 		$oFTP = new ftp();
218
-		if(!$oFTP->ftp_connect($ftp_info->ftp_host, $ftp_info->ftp_port))
218
+		if (!$oFTP->ftp_connect($ftp_info->ftp_host, $ftp_info->ftp_port))
219 219
 		{
220 220
 			return new BaseObject(1, sprintf(Context::getLang('msg_ftp_not_connected'), 'host'));
221 221
 		}
222 222
 
223
-		if(!$oFTP->ftp_login($ftp_info->ftp_user, $ftp_info->ftp_password))
223
+		if (!$oFTP->ftp_login($ftp_info->ftp_user, $ftp_info->ftp_password))
224 224
 		{
225 225
 			return new BaseObject(1, 'msg_ftp_invalid_auth_info');
226 226
 		}
@@ -236,29 +236,29 @@  discard block
 block discarded – undo
236 236
 		$path_candidate = array();
237 237
 
238 238
 		$temp = '';
239
-		foreach($path_info as $path)
239
+		foreach ($path_info as $path)
240 240
 		{
241
-			$temp = '/' . $path . $temp;
241
+			$temp = '/'.$path.$temp;
242 242
 			$path_candidate[] = $temp;
243 243
 		}
244 244
 
245 245
 		// try
246
-		foreach($path_candidate as $path)
246
+		foreach ($path_candidate as $path)
247 247
 		{
248 248
 			// upload check file
249
-			if(!$oFTP->ftp_put($path . 'ftp_check.html', FileHandler::getRealPath('./files/cache/ftp_check')))
249
+			if (!$oFTP->ftp_put($path.'ftp_check.html', FileHandler::getRealPath('./files/cache/ftp_check')))
250 250
 			{
251 251
 				continue;
252 252
 			}
253 253
 
254 254
 			// get check file
255
-			$result = FileHandler::getRemoteResource(getNotencodedFullUrl() . 'ftp_check.html');
255
+			$result = FileHandler::getRemoteResource(getNotencodedFullUrl().'ftp_check.html');
256 256
 
257 257
 			// delete temp check file
258
-			$oFTP->ftp_delete($path . 'ftp_check.html');
258
+			$oFTP->ftp_delete($path.'ftp_check.html');
259 259
 
260 260
 			// found
261
-			if($result == $pin)
261
+			if ($result == $pin)
262 262
 			{
263 263
 				$found_path = $path;
264 264
 				break;
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
 
268 268
 		FileHandler::removeFile('./files/cache/ftp_check', $pin);
269 269
 
270
-		if($found_path)
270
+		if ($found_path)
271 271
 		{
272 272
 			$this->add('found_path', $found_path);
273 273
 		}
@@ -280,27 +280,27 @@  discard block
 block discarded – undo
280 280
 	function getSFTPList()
281 281
 	{
282 282
 		$ftp_info = Context::getRequestVars();
283
-		if(!$ftp_info->ftp_host)
283
+		if (!$ftp_info->ftp_host)
284 284
 		{
285 285
 			$ftp_info->ftp_host = "127.0.0.1";
286 286
 		}
287 287
 		$connection = ssh2_connect($ftp_info->ftp_host, $ftp_info->ftp_port);
288
-		if(!ssh2_auth_password($connection, $ftp_info->ftp_user, $ftp_info->ftp_password))
288
+		if (!ssh2_auth_password($connection, $ftp_info->ftp_user, $ftp_info->ftp_password))
289 289
 		{
290 290
 			return new BaseObject(-1, 'msg_ftp_invalid_auth_info');
291 291
 		}
292 292
 
293 293
 		$sftp = ssh2_sftp($connection);
294
-		$curpwd = "ssh2.sftp://$sftp" . $this->pwd;
294
+		$curpwd = "ssh2.sftp://$sftp".$this->pwd;
295 295
 		$dh = @opendir($curpwd);
296
-		if(!$dh)
296
+		if (!$dh)
297 297
 		{
298 298
 			return new BaseObject(-1, 'msg_ftp_invalid_path');
299 299
 		}
300 300
 		$list = array();
301
-		while(($file = readdir($dh)) !== FALSE)
301
+		while (($file = readdir($dh)) !== FALSE)
302 302
 		{
303
-			if(is_dir($curpwd . $file))
303
+			if (is_dir($curpwd.$file))
304 304
 			{
305 305
 				$file .= "/";
306 306
 			}
@@ -320,32 +320,32 @@  discard block
 block discarded – undo
320 320
 	 */
321 321
 	function getAdminFTPList()
322 322
 	{
323
-		Context::loadLang(_XE_PATH_ . 'modules/autoinstall/lang');
323
+		Context::loadLang(_XE_PATH_.'modules/autoinstall/lang');
324 324
 		@set_time_limit(5);
325 325
 
326
-		require_once(_XE_PATH_ . 'libs/ftp.class.php');
326
+		require_once(_XE_PATH_.'libs/ftp.class.php');
327 327
 
328 328
 		$ftp_info = Context::getRequestVars();
329
-		if(!$ftp_info->ftp_user || !$ftp_info->ftp_password)
329
+		if (!$ftp_info->ftp_user || !$ftp_info->ftp_password)
330 330
 		{
331 331
 			return new BaseObject(-1, 'msg_ftp_invalid_auth_info');
332 332
 		}
333 333
 
334 334
 		$this->pwd = $ftp_info->ftp_root_path;
335 335
 
336
-		if(!$ftp_info->ftp_host)
336
+		if (!$ftp_info->ftp_host)
337 337
 		{
338 338
 			$ftp_info->ftp_host = "127.0.0.1";
339 339
 		}
340 340
 
341
-		if(!$ftp_info->ftp_port || !is_numeric($ftp_info->ftp_port))
341
+		if (!$ftp_info->ftp_port || !is_numeric($ftp_info->ftp_port))
342 342
 		{
343 343
 			$ftp_info->ftp_port = "21";
344 344
 		}
345 345
 
346
-		if($ftp_info->sftp == 'Y')
346
+		if ($ftp_info->sftp == 'Y')
347 347
 		{
348
-			if(!function_exists('ssh2_sftp'))
348
+			if (!function_exists('ssh2_sftp'))
349 349
 			{
350 350
 				return new BaseObject(-1, 'disable_sftp_support');
351 351
 			}
@@ -353,9 +353,9 @@  discard block
 block discarded – undo
353 353
 		}
354 354
 
355 355
 		$oFtp = new ftp();
356
-		if($oFtp->ftp_connect($ftp_info->ftp_host, $ftp_info->ftp_port))
356
+		if ($oFtp->ftp_connect($ftp_info->ftp_host, $ftp_info->ftp_port))
357 357
 		{
358
-			if($oFtp->ftp_login($ftp_info->ftp_user, $ftp_info->ftp_password))
358
+			if ($oFtp->ftp_login($ftp_info->ftp_user, $ftp_info->ftp_password))
359 359
 			{
360 360
 				$_list = $oFtp->ftp_rawlist($this->pwd);
361 361
 				$oFtp->ftp_quit();
@@ -367,17 +367,17 @@  discard block
 block discarded – undo
367 367
 		}
368 368
 		$list = array();
369 369
 
370
-		if($_list)
370
+		if ($_list)
371 371
 		{
372
-			foreach($_list as $k => $v)
372
+			foreach ($_list as $k => $v)
373 373
 			{
374 374
 				$src = new stdClass();
375 375
 				$src->data = $v;
376 376
 				$res = Context::convertEncoding($src);
377 377
 				$v = $res->data;
378
-				if(strpos($v, 'd') === 0 || strpos($v, '<DIR>'))
378
+				if (strpos($v, 'd') === 0 || strpos($v, '<DIR>'))
379 379
 				{
380
-					$list[] = substr(strrchr($v, ' '), 1) . '/';
380
+					$list[] = substr(strrchr($v, ' '), 1).'/';
381 381
 				}
382 382
 			}
383 383
 		}
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
 			, 'module' => array('addon', 'admin', 'autoinstall', 'comment', 'communication', 'counter', 'document', 'editor', 'file', 'importer', 'install', 'integration_search', 'layout', 'member', 'menu', 'message', 'module', 'opage', 'page', 'point', 'poll', 'rss', 'session', 'spamfilter', 'tag', 'trackback', 'trash', 'widget')
401 401
 			, 'addon' => array('autolink', 'blogapi', 'captcha', 'counter', 'member_communication', 'member_extra_info', 'mobile', 'openid_delegation_id', 'point_level_icon', 'resize_image')
402 402
 			, 'layout' => array('default')
403
-			, 'widget' => array('content', 'language_select', 'login_info','mcontent')
403
+			, 'widget' => array('content', 'language_select', 'login_info', 'mcontent')
404 404
 			, 'widgetstyle' => array(),
405 405
 		);
406 406
 		$info = array();
@@ -420,86 +420,86 @@  discard block
 block discarded – undo
420 420
 		$info['use_ssl'] = $db_info->use_ssl;
421 421
 		
422 422
 		$info['phpext'] = '';
423
-		foreach(get_loaded_extensions() as $ext)
423
+		foreach (get_loaded_extensions() as $ext)
424 424
 		{
425 425
 			$ext = strtolower($ext);
426
-			if(in_array($ext, $skip['ext']))
426
+			if (in_array($ext, $skip['ext']))
427 427
 			{
428 428
 				continue;
429 429
 			}
430
-			$info['phpext'] .= '|' . $ext;
430
+			$info['phpext'] .= '|'.$ext;
431 431
 		}
432 432
 		$info['phpext'] = substr($info['phpext'], 1);
433 433
 
434 434
 		$info['module'] = '';
435 435
 		$oModuleModel = getModel('module');
436 436
 		$module_list = $oModuleModel->getModuleList();
437
-		if($module_list) foreach($module_list as $module)
437
+		if ($module_list) foreach ($module_list as $module)
438 438
 		{
439
-			if(in_array($module->module, $skip['module']))
439
+			if (in_array($module->module, $skip['module']))
440 440
 			{
441 441
 				continue;
442 442
 			}
443
-			$info['module'] .= '|' . $module->module;
443
+			$info['module'] .= '|'.$module->module;
444 444
 		}
445 445
 		$info['module'] = substr($info['module'], 1);
446 446
 
447 447
 		$info['addon'] = '';
448 448
 		$oAddonAdminModel = getAdminModel('addon');
449 449
 		$addon_list = $oAddonAdminModel->getAddonList();
450
-		if($addon_list) foreach($addon_list as $addon)
450
+		if ($addon_list) foreach ($addon_list as $addon)
451 451
 		{
452
-			if(in_array($addon->addon, $skip['addon']))
452
+			if (in_array($addon->addon, $skip['addon']))
453 453
 			{
454 454
 				continue;
455 455
 			}
456
-			$info['addon'] .= '|' . $addon->addon;
456
+			$info['addon'] .= '|'.$addon->addon;
457 457
 		}
458 458
 		$info['addon'] = substr($info['addon'], 1);
459 459
 
460 460
 		$info['layout'] = "";
461 461
 		$oLayoutModel = getModel('layout');
462 462
 		$layout_list = $oLayoutModel->getDownloadedLayoutList();
463
-		if($layout_list) foreach($layout_list as $layout)
463
+		if ($layout_list) foreach ($layout_list as $layout)
464 464
 		{
465
-			if(in_array($layout->layout, $skip['layout']))
465
+			if (in_array($layout->layout, $skip['layout']))
466 466
 			{
467 467
 				continue;
468 468
 			}
469
-			$info['layout'] .= '|' . $layout->layout;
469
+			$info['layout'] .= '|'.$layout->layout;
470 470
 		}
471 471
 		$info['layout'] = substr($info['layout'], 1);
472 472
 
473 473
 		$info['widget'] = "";
474 474
 		$oWidgetModel = getModel('widget');
475 475
 		$widget_list = $oWidgetModel->getDownloadedWidgetList();
476
-		if($widget_list) foreach($widget_list as $widget)
476
+		if ($widget_list) foreach ($widget_list as $widget)
477 477
 		{
478
-			if(in_array($widget->widget, $skip['widget']))
478
+			if (in_array($widget->widget, $skip['widget']))
479 479
 			{
480 480
 				continue;
481 481
 			}
482
-			$info['widget'] .= '|' . $widget->widget;
482
+			$info['widget'] .= '|'.$widget->widget;
483 483
 		}
484 484
 		$info['widget'] = substr($info['widget'], 1);
485 485
 
486 486
 		$info['widgetstyle'] = "";
487 487
 		$oWidgetModel = getModel('widget');
488 488
 		$widgetstyle_list = $oWidgetModel->getDownloadedWidgetStyleList();
489
-		if($widgetstyle_list) foreach($widgetstyle_list as $widgetstyle)
489
+		if ($widgetstyle_list) foreach ($widgetstyle_list as $widgetstyle)
490 490
 		{
491
-			if(in_array($widgetstyle->widgetStyle, $skip['widgetstyle']))
491
+			if (in_array($widgetstyle->widgetStyle, $skip['widgetstyle']))
492 492
 			{
493 493
 				continue;
494 494
 			}
495
-			$info['widgetstyle'] .= '|' . $widgetstyle->widgetStyle;
495
+			$info['widgetstyle'] .= '|'.$widgetstyle->widgetStyle;
496 496
 		}
497 497
 		$info['widgetstyle'] = substr($info['widgetstyle'], 1);
498 498
 
499 499
 		$param = '';
500
-		foreach($info as $k => $v)
500
+		foreach ($info as $k => $v)
501 501
 		{
502
-			if($v)
502
+			if ($v)
503 503
 			{
504 504
 				$param .= sprintf('&%s=%s', $k, urlencode($v));
505 505
 			}
@@ -515,13 +515,13 @@  discard block
 block discarded – undo
515 515
 	 */
516 516
 	function getThemeList()
517 517
 	{
518
-		$path = _XE_PATH_ . 'themes';
518
+		$path = _XE_PATH_.'themes';
519 519
 		$list = FileHandler::readDir($path);
520 520
 
521 521
 		$theme_info = array();
522
-		if(count($list) > 0)
522
+		if (count($list) > 0)
523 523
 		{
524
-			foreach($list as $val)
524
+			foreach ($list as $val)
525 525
 			{
526 526
 				$theme_info[$val] = $this->getThemeInfo($val);
527 527
 			}
@@ -538,20 +538,20 @@  discard block
 block discarded – undo
538 538
 	 */
539 539
 	function getThemeInfo($theme_name, $layout_list = NULL)
540 540
 	{
541
-		if($GLOBALS['__ThemeInfo__'][$theme_name])
541
+		if ($GLOBALS['__ThemeInfo__'][$theme_name])
542 542
 		{
543 543
 			return $GLOBALS['__ThemeInfo__'][$theme_name];
544 544
 		}
545 545
 
546
-		$info_file = _XE_PATH_ . 'themes/' . $theme_name . '/conf/info.xml';
547
-		if(!file_exists($info_file))
546
+		$info_file = _XE_PATH_.'themes/'.$theme_name.'/conf/info.xml';
547
+		if (!file_exists($info_file))
548 548
 		{
549 549
 			return;
550 550
 		}
551 551
 
552 552
 		$oXmlParser = new XmlParser();
553 553
 		$_xml_obj = $oXmlParser->loadXmlFile($info_file);
554
-		if(!$_xml_obj->theme)
554
+		if (!$_xml_obj->theme)
555 555
 		{
556 556
 			return;
557 557
 		}
@@ -562,16 +562,16 @@  discard block
 block discarded – undo
562 562
 		$theme_info = new stdClass();
563 563
 		$theme_info->name = $theme_name;
564 564
 		$theme_info->title = $xml_obj->title->body;
565
-		$thumbnail = './themes/' . $theme_name . '/thumbnail.png';
565
+		$thumbnail = './themes/'.$theme_name.'/thumbnail.png';
566 566
 		$theme_info->thumbnail = (FileHandler::exists($thumbnail)) ? $thumbnail : NULL;
567 567
 		$theme_info->version = $xml_obj->version->body;
568 568
 		$date_obj = new stdClass();
569 569
 		sscanf($xml_obj->date->body, '%d-%d-%d', $date_obj->y, $date_obj->m, $date_obj->d);
570 570
 		$theme_info->date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d);
571 571
 		$theme_info->description = $xml_obj->description->body;
572
-		$theme_info->path = './themes/' . $theme_name . '/';
572
+		$theme_info->path = './themes/'.$theme_name.'/';
573 573
 
574
-		if(!is_array($xml_obj->publisher))
574
+		if (!is_array($xml_obj->publisher))
575 575
 		{
576 576
 			$publisher_list = array();
577 577
 			$publisher_list[] = $xml_obj->publisher;
@@ -582,7 +582,7 @@  discard block
 block discarded – undo
582 582
 		}
583 583
 
584 584
 		$theme_info->publisher = array();
585
-		foreach($publisher_list as $publisher)
585
+		foreach ($publisher_list as $publisher)
586 586
 		{
587 587
 			$publisher_obj = new stdClass();
588 588
 			$publisher_obj->name = $publisher->name->body;
@@ -595,10 +595,10 @@  discard block
 block discarded – undo
595 595
 		$layout_path = $layout->directory->attrs->path;
596 596
 		$layout_parse = explode('/', $layout_path);
597 597
 		$layout_info = new stdClass();
598
-		switch($layout_parse[1])
598
+		switch ($layout_parse[1])
599 599
 		{
600 600
 			case 'themes' :
601
-					$layout_info->name = $theme_name . '|@|' . $layout_parse[count($layout_parse) - 1];
601
+					$layout_info->name = $theme_name.'|@|'.$layout_parse[count($layout_parse) - 1];
602 602
 					break;
603 603
 
604 604
 			case 'layouts' :
@@ -615,11 +615,11 @@  discard block
 block discarded – undo
615 615
 		$oLayoutModel = getModel('layout');
616 616
 		$layout_info_list = array();
617 617
 		$layout_list = $oLayoutModel->getLayoutList($site_info->site_srl);
618
-		if($layout_list)
618
+		if ($layout_list)
619 619
 		{
620
-			foreach($layout_list as $val)
620
+			foreach ($layout_list as $val)
621 621
 			{
622
-				if($val->layout == $layout_info->name)
622
+				if ($val->layout == $layout_info->name)
623 623
 				{
624 624
 					$is_new_layout = FALSE;
625 625
 					$layout_info->layout_srl = $val->layout_srl;
@@ -628,7 +628,7 @@  discard block
 block discarded – undo
628 628
 			}
629 629
 		}
630 630
 
631
-		if($is_new_layout)
631
+		if ($is_new_layout)
632 632
 		{
633 633
 			$site_module_info = Context::get('site_module_info');
634 634
 			$args = new stdClass();
@@ -646,7 +646,7 @@  discard block
 block discarded – undo
646 646
 		$theme_info->layout_info = $layout_info;
647 647
 
648 648
 		$skin_infos = $xml_obj->skininfos;
649
-		if(is_array($skin_infos->skininfo))
649
+		if (is_array($skin_infos->skininfo))
650 650
 		{
651 651
 			$skin_list = $skin_infos->skininfo;
652 652
 		}
@@ -657,17 +657,17 @@  discard block
 block discarded – undo
657 657
 
658 658
 		$oModuleModel = getModel('module');
659 659
 		$skins = array();
660
-		foreach($skin_list as $val)
660
+		foreach ($skin_list as $val)
661 661
 		{
662 662
 			$skin_info = new stdClass();
663 663
 			unset($skin_parse);
664 664
 			$skin_parse = explode('/', $val->directory->attrs->path);
665
-			switch($skin_parse[1])
665
+			switch ($skin_parse[1])
666 666
 			{
667 667
 				case 'themes' :
668 668
 						$is_theme = TRUE;
669 669
 						$module_name = $skin_parse[count($skin_parse) - 1];
670
-						$skin_info->name = $theme_name . '|@|' . $module_name;
670
+						$skin_info->name = $theme_name.'|@|'.$module_name;
671 671
 						break;
672 672
 
673 673
 				case 'modules' :
@@ -681,9 +681,9 @@  discard block
 block discarded – undo
681 681
 			$skin_info->is_theme = $is_theme;
682 682
 			$skins[$module_name] = $skin_info;
683 683
 
684
-			if($is_theme)
684
+			if ($is_theme)
685 685
 			{
686
-				if(!$GLOBALS['__ThemeModuleSkin__'][$module_name])
686
+				if (!$GLOBALS['__ThemeModuleSkin__'][$module_name])
687 687
 				{
688 688
 					$GLOBALS['__ThemeModuleSkin__'][$module_name] = array();
689 689
 					$GLOBALS['__ThemeModuleSkin__'][$module_name]['skins'] = array();
@@ -705,7 +705,7 @@  discard block
 block discarded – undo
705 705
 	 */
706 706
 	function getModulesSkinList()
707 707
 	{
708
-		if($GLOBALS['__ThemeModuleSkin__']['__IS_PARSE__'])
708
+		if ($GLOBALS['__ThemeModuleSkin__']['__IS_PARSE__'])
709 709
 		{
710 710
 			return $GLOBALS['__ThemeModuleSkin__'];
711 711
 		}
@@ -713,7 +713,7 @@  discard block
 block discarded – undo
713 713
 		sort($searched_list);
714 714
 
715 715
 		$searched_count = count($searched_list);
716
-		if(!$searched_count)
716
+		if (!$searched_count)
717 717
 		{
718 718
 			return;
719 719
 		}
@@ -721,13 +721,13 @@  discard block
 block discarded – undo
721 721
 		$exceptionModule = array('editor', 'poll', 'homepage', 'textyle');
722 722
 
723 723
 		$oModuleModel = getModel('module');
724
-		foreach($searched_list as $val)
724
+		foreach ($searched_list as $val)
725 725
 		{
726
-			$skin_list = $oModuleModel->getSkins(_XE_PATH_ . 'modules/' . $val);
726
+			$skin_list = $oModuleModel->getSkins(_XE_PATH_.'modules/'.$val);
727 727
 
728
-			if(is_array($skin_list) && count($skin_list) > 0 && !in_array($val, $exceptionModule))
728
+			if (is_array($skin_list) && count($skin_list) > 0 && !in_array($val, $exceptionModule))
729 729
 			{
730
-				if(!$GLOBALS['__ThemeModuleSkin__'][$val])
730
+				if (!$GLOBALS['__ThemeModuleSkin__'][$val])
731 731
 				{
732 732
 					$GLOBALS['__ThemeModuleSkin__'][$val] = array();
733 733
 					$moduleInfo = $oModuleModel->getModuleInfoXml($val);
@@ -751,23 +751,23 @@  discard block
 block discarded – undo
751 751
 		static $lang = false;
752 752
 
753 753
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
754
-		if($lang === false && $oCacheHandler->isSupport())
754
+		if ($lang === false && $oCacheHandler->isSupport())
755 755
 		{
756
-			$cache_key = 'admin_menu_langs:' . Context::getLangType();
756
+			$cache_key = 'admin_menu_langs:'.Context::getLangType();
757 757
 			$lang = $oCacheHandler->get($cache_key);
758 758
 
759
-			if($lang === false)
759
+			if ($lang === false)
760 760
 			{
761 761
 				$lang = array();
762 762
 				$oModuleModel = getModel('module');
763 763
 				$installed_module_list = $oModuleModel->getModulesXmlInfo();
764 764
 
765
-				foreach($installed_module_list as $key => $value)
765
+				foreach ($installed_module_list as $key => $value)
766 766
 				{
767 767
 					$moduleActionInfo = $oModuleModel->getModuleActionXml($value->module);
768
-					if(is_object($moduleActionInfo->menu))
768
+					if (is_object($moduleActionInfo->menu))
769 769
 					{
770
-						foreach($moduleActionInfo->menu as $key2 => $value2)
770
+						foreach ($moduleActionInfo->menu as $key2 => $value2)
771 771
 						{
772 772
 							$lang[$key2] = $value2->title;
773 773
 						}
@@ -792,19 +792,19 @@  discard block
 block discarded – undo
792 792
 		$args = new stdClass();
793 793
 		$args->site_srl = $siteSrl;
794 794
 		$output = executeQueryArray('admin.getFavoriteList', $args);
795
-		if(!$output->toBool())
795
+		if (!$output->toBool())
796 796
 		{
797 797
 			return $output;
798 798
 		}
799
-		if(!$output->data)
799
+		if (!$output->data)
800 800
 		{
801 801
 			return new BaseObject();
802 802
 		}
803 803
 
804
-		if($isGetModuleInfo && is_array($output->data))
804
+		if ($isGetModuleInfo && is_array($output->data))
805 805
 		{
806 806
 			$oModuleModel = getModel('module');
807
-			foreach($output->data AS $key => $value)
807
+			foreach ($output->data AS $key => $value)
808 808
 			{
809 809
 				$moduleInfo = $oModuleModel->getModuleInfoXml($value->module);
810 810
 				$output->data[$key]->admin_index_act = $moduleInfo->admin_index_act;
@@ -829,13 +829,13 @@  discard block
 block discarded – undo
829 829
 		$args->site_srl = $siteSrl;
830 830
 		$args->module = $module;
831 831
 		$output = executeQuery('admin.getFavorite', $args);
832
-		if(!$output->toBool())
832
+		if (!$output->toBool())
833 833
 		{
834 834
 			return $output;
835 835
 		}
836 836
 
837 837
 		$returnObject = new BaseObject();
838
-		if($output->data)
838
+		if ($output->data)
839 839
 		{
840 840
 			$returnObject->add('result', TRUE);
841 841
 			$returnObject->add('favoriteSrl', $output->data->admin_favorite_srl);
@@ -854,7 +854,7 @@  discard block
 block discarded – undo
854 854
 	 */
855 855
 	function getSiteAllList()
856 856
 	{
857
-		if(Context::get('domain'))
857
+		if (Context::get('domain'))
858 858
 		{
859 859
 			$domain = Context::get('domain');
860 860
 		}
@@ -871,7 +871,7 @@  discard block
 block discarded – undo
871 871
 	function getAllSitesThatHaveModules($domain = NULL)
872 872
 	{
873 873
 		$args = new stdClass();
874
-		if($domain)
874
+		if ($domain)
875 875
 		{
876 876
 			$args->domain = $domain;
877 877
 		}
@@ -879,31 +879,31 @@  discard block
 block discarded – undo
879 879
 
880 880
 		$siteList = array();
881 881
 		$output = executeQueryArray('admin.getSiteAllList', $args, $columnList);
882
-		if($output->toBool())
882
+		if ($output->toBool())
883 883
 		{
884 884
 			$siteList = $output->data;
885 885
 		}
886 886
 
887 887
 		$oModuleModel = getModel('module');
888
-		foreach($siteList as $key => $value)
888
+		foreach ($siteList as $key => $value)
889 889
 		{
890 890
 			$args->site_srl = $value->site_srl;
891 891
 			$list = $oModuleModel->getModuleSrlList($args);
892 892
 
893
-			if(!is_array($list))
893
+			if (!is_array($list))
894 894
 			{
895 895
 				$list = array($list);
896 896
 			}
897 897
 
898
-			foreach($list as $k => $v)
898
+			foreach ($list as $k => $v)
899 899
 			{
900
-				if(!is_dir(_XE_PATH_ . 'modules/' . $v->module))
900
+				if (!is_dir(_XE_PATH_.'modules/'.$v->module))
901 901
 				{
902 902
 					unset($list[$k]);
903 903
 				}
904 904
 			}
905 905
 
906
-			if(!count($list))
906
+			if (!count($list))
907 907
 			{
908 908
 				unset($siteList[$key]);
909 909
 			}
@@ -920,13 +920,13 @@  discard block
 block discarded – undo
920 920
 	{
921 921
 		$args = new stdClass();
922 922
 
923
-		if($date)
923
+		if ($date)
924 924
 		{
925 925
 			$args->regDate = date('Ymd', strtotime($date));
926 926
 		}
927 927
 
928 928
 		$output = executeQuery('admin.getSiteCountByDate', $args);
929
-		if(!$output->toBool())
929
+		if (!$output->toBool())
930 930
 		{
931 931
 			return 0;
932 932
 		}
@@ -948,21 +948,21 @@  discard block
 block discarded – undo
948 948
 	{
949 949
 		$site_info = Context::get('site_module_info');
950 950
 		$virtual_site = '';
951
-		if($site_info->site_srl) 
951
+		if ($site_info->site_srl) 
952 952
 		{
953
-			$virtual_site = $site_info->site_srl . '/';
953
+			$virtual_site = $site_info->site_srl.'/';
954 954
 		}
955 955
 
956
-		$file_exsit = FileHandler::readFile(_XE_PATH_ . 'files/attach/xeicon/' . $virtual_site . $iconname);
957
-		if(!$file_exsit && $default === true)
956
+		$file_exsit = FileHandler::readFile(_XE_PATH_.'files/attach/xeicon/'.$virtual_site.$iconname);
957
+		if (!$file_exsit && $default === true)
958 958
         {
959
-            $icon_url = './modules/admin/tpl/img/' . $default_icon_name;
959
+            $icon_url = './modules/admin/tpl/img/'.$default_icon_name;
960 960
         }
961
-        elseif($file_exsit)
961
+        elseif ($file_exsit)
962 962
 		{
963 963
 			$default_url = Context::GetUrl();
964
-			if($default_url && substr_compare($default_url, '/', -1) === 0) $default_url = substr($default_url, 0, -1);
965
-			$icon_url = $default_url . '/files/attach/xeicon/' . $virtual_site . $iconname;
964
+			if ($default_url && substr_compare($default_url, '/', -1) === 0) $default_url = substr($default_url, 0, -1);
965
+			$icon_url = $default_url.'/files/attach/xeicon/'.$virtual_site.$iconname;
966 966
 		}
967 967
 		return $icon_url;
968 968
 	}
Please login to merge, or discard this patch.
Braces   +25 added lines, -20 removed lines patch added patch discarded remove patch
@@ -303,8 +303,7 @@  discard block
 block discarded – undo
303 303
 			if(is_dir($curpwd . $file))
304 304
 			{
305 305
 				$file .= "/";
306
-			}
307
-			else
306
+			} else
308 307
 			{
309 308
 				continue;
310 309
 			}
@@ -359,8 +358,7 @@  discard block
 block discarded – undo
359 358
 			{
360 359
 				$_list = $oFtp->ftp_rawlist($this->pwd);
361 360
 				$oFtp->ftp_quit();
362
-			}
363
-			else
361
+			} else
364 362
 			{
365 363
 				return new BaseObject(-1, 'msg_ftp_invalid_auth_info');
366 364
 			}
@@ -380,8 +378,7 @@  discard block
 block discarded – undo
380 378
 					$list[] = substr(strrchr($v, ' '), 1) . '/';
381 379
 				}
382 380
 			}
383
-		}
384
-		else
381
+		} else
385 382
 		{
386 383
 			return new BaseObject(-1, 'msg_ftp_no_directory');
387 384
 		}
@@ -434,11 +431,13 @@  discard block
 block discarded – undo
434 431
 		$info['module'] = '';
435 432
 		$oModuleModel = getModel('module');
436 433
 		$module_list = $oModuleModel->getModuleList();
437
-		if($module_list) foreach($module_list as $module)
434
+		if($module_list) {
435
+			foreach($module_list as $module)
438 436
 		{
439 437
 			if(in_array($module->module, $skip['module']))
440 438
 			{
441 439
 				continue;
440
+		}
442 441
 			}
443 442
 			$info['module'] .= '|' . $module->module;
444 443
 		}
@@ -447,11 +446,13 @@  discard block
 block discarded – undo
447 446
 		$info['addon'] = '';
448 447
 		$oAddonAdminModel = getAdminModel('addon');
449 448
 		$addon_list = $oAddonAdminModel->getAddonList();
450
-		if($addon_list) foreach($addon_list as $addon)
449
+		if($addon_list) {
450
+			foreach($addon_list as $addon)
451 451
 		{
452 452
 			if(in_array($addon->addon, $skip['addon']))
453 453
 			{
454 454
 				continue;
455
+		}
455 456
 			}
456 457
 			$info['addon'] .= '|' . $addon->addon;
457 458
 		}
@@ -460,11 +461,13 @@  discard block
 block discarded – undo
460 461
 		$info['layout'] = "";
461 462
 		$oLayoutModel = getModel('layout');
462 463
 		$layout_list = $oLayoutModel->getDownloadedLayoutList();
463
-		if($layout_list) foreach($layout_list as $layout)
464
+		if($layout_list) {
465
+			foreach($layout_list as $layout)
464 466
 		{
465 467
 			if(in_array($layout->layout, $skip['layout']))
466 468
 			{
467 469
 				continue;
470
+		}
468 471
 			}
469 472
 			$info['layout'] .= '|' . $layout->layout;
470 473
 		}
@@ -473,11 +476,13 @@  discard block
 block discarded – undo
473 476
 		$info['widget'] = "";
474 477
 		$oWidgetModel = getModel('widget');
475 478
 		$widget_list = $oWidgetModel->getDownloadedWidgetList();
476
-		if($widget_list) foreach($widget_list as $widget)
479
+		if($widget_list) {
480
+			foreach($widget_list as $widget)
477 481
 		{
478 482
 			if(in_array($widget->widget, $skip['widget']))
479 483
 			{
480 484
 				continue;
485
+		}
481 486
 			}
482 487
 			$info['widget'] .= '|' . $widget->widget;
483 488
 		}
@@ -486,11 +491,13 @@  discard block
 block discarded – undo
486 491
 		$info['widgetstyle'] = "";
487 492
 		$oWidgetModel = getModel('widget');
488 493
 		$widgetstyle_list = $oWidgetModel->getDownloadedWidgetStyleList();
489
-		if($widgetstyle_list) foreach($widgetstyle_list as $widgetstyle)
494
+		if($widgetstyle_list) {
495
+			foreach($widgetstyle_list as $widgetstyle)
490 496
 		{
491 497
 			if(in_array($widgetstyle->widgetStyle, $skip['widgetstyle']))
492 498
 			{
493 499
 				continue;
500
+		}
494 501
 			}
495 502
 			$info['widgetstyle'] .= '|' . $widgetstyle->widgetStyle;
496 503
 		}
@@ -575,8 +582,7 @@  discard block
 block discarded – undo
575 582
 		{
576 583
 			$publisher_list = array();
577 584
 			$publisher_list[] = $xml_obj->publisher;
578
-		}
579
-		else
585
+		} else
580 586
 		{
581 587
 			$publisher_list = $xml_obj->publisher;
582 588
 		}
@@ -649,8 +655,7 @@  discard block
 block discarded – undo
649 655
 		if(is_array($skin_infos->skininfo))
650 656
 		{
651 657
 			$skin_list = $skin_infos->skininfo;
652
-		}
653
-		else
658
+		} else
654 659
 		{
655 660
 			$skin_list = array($skin_infos->skininfo);
656 661
 		}
@@ -839,8 +844,7 @@  discard block
 block discarded – undo
839 844
 		{
840 845
 			$returnObject->add('result', TRUE);
841 846
 			$returnObject->add('favoriteSrl', $output->data->admin_favorite_srl);
842
-		}
843
-		else
847
+		} else
844 848
 		{
845 849
 			$returnObject->add('result', FALSE);
846 850
 		}
@@ -957,11 +961,12 @@  discard block
 block discarded – undo
957 961
 		if(!$file_exsit && $default === true)
958 962
         {
959 963
             $icon_url = './modules/admin/tpl/img/' . $default_icon_name;
960
-        }
961
-        elseif($file_exsit)
964
+        } elseif($file_exsit)
962 965
 		{
963 966
 			$default_url = Context::GetUrl();
964
-			if($default_url && substr_compare($default_url, '/', -1) === 0) $default_url = substr($default_url, 0, -1);
967
+			if($default_url && substr_compare($default_url, '/', -1) === 0) {
968
+				$default_url = substr($default_url, 0, -1);
969
+			}
965 970
 			$icon_url = $default_url . '/files/attach/xeicon/' . $virtual_site . $iconname;
966 971
 		}
967 972
 		return $icon_url;
Please login to merge, or discard this patch.