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 ( b119a5...2262ef )
by gyeong-won
19:32 queued 13:26
created
modules/autoinstall/autoinstall.admin.view.php 3 patches
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -36,8 +36,7 @@  discard block
 block discarded – undo
36 36
 		if(!$ftp_info->ftp_root_path)
37 37
 		{
38 38
 			Context::set('show_ftp_note', TRUE);
39
-		}
40
-		else
39
+		} else
41 40
 		{
42 41
 			$this->ftp_set = TRUE;
43 42
 		}
@@ -217,12 +216,10 @@  discard block
 block discarded – undo
217 216
 				if($v->type == "core")
218 217
 				{
219 218
 					$v->avail_remove = FALSE;
220
-				}
221
-				else if($v->type == "module")
219
+				} else if($v->type == "module")
222 220
 				{
223 221
 					$v->avail_remove = $oModel->checkRemovable($packages[$v->package_srl]->path);
224
-				}
225
-				else
222
+				} else
226 223
 				{
227 224
 					$v->avail_remove = TRUE;
228 225
 				}
@@ -455,8 +452,7 @@  discard block
 block discarded – undo
455 452
 		if($childrenList)
456 453
 		{
457 454
 			$params["category_srl"] = $childrenList;
458
-		}
459
-		else if($category_srl)
455
+		} else if($category_srl)
460 456
 		{
461 457
 			$params["category_srl"] = $category_srl;
462 458
 		}
@@ -565,8 +561,7 @@  discard block
 block discarded – undo
565 561
 			$security->encodeHTML('package.');
566 562
 
567 563
 			$this->setTemplateFile('uninstall');
568
-		}
569
-		else
564
+		} else
570 565
 		{
571 566
 			return $this->stop('msg_connection_fail');
572 567
 		}
Please login to merge, or discard this patch.
Spacing   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 		$this->setTemplatePath($template_path);
34 34
 
35 35
 		$ftp_info = Context::getFTPInfo();
36
-		if(!$ftp_info->ftp_root_path)
36
+		if (!$ftp_info->ftp_root_path)
37 37
 		{
38 38
 			Context::set('show_ftp_note', TRUE);
39 39
 		}
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 	function rearrange(&$item, &$targets)
91 91
 	{
92 92
 		$ret = new stdClass();
93
-		foreach($targets as $target)
93
+		foreach ($targets as $target)
94 94
 		{
95 95
 			$ret->{$target} = $item->{$target}->body;
96 96
 		}
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
 	 */
170 170
 	function rearranges($items, $packages = null)
171 171
 	{
172
-		if(!is_array($items))
172
+		if (!is_array($items))
173 173
 		{
174 174
 			$items = array($items);
175 175
 		}
@@ -178,47 +178,47 @@  discard block
 block discarded – undo
178 178
 		$targets = array('category_srl', 'package_srl', 'item_screenshot_url', 'package_voted', 'package_voter', 'package_description', 'package_downloaded', 'item_regdate', 'title', 'item_version', 'package_star', 'depfrom');
179 179
 		$targetpackages = array();
180 180
 
181
-		foreach($items as $item)
181
+		foreach ($items as $item)
182 182
 		{
183 183
 			$targetpackages[$item->package_srl->body] = 0;
184 184
 		}
185 185
 
186 186
 		$oModel = getModel('autoinstall');
187 187
 		
188
-		if($package == null)
188
+		if ($package == null)
189 189
 		{
190 190
 			$packages = $oModel->getInstalledPackages(array_keys($targetpackages));
191 191
 		}
192 192
 
193 193
 		$depto = array();
194 194
 
195
-		foreach($items as $item)
195
+		foreach ($items as $item)
196 196
 		{
197 197
 			$v = $this->rearrange($item, $targets);
198 198
 			$v->item_screenshot_url = str_replace('./', _XE_DOWNLOAD_SERVER_, $v->item_screenshot_url);
199 199
 			$v->category = $this->categories[$v->category_srl]->title;
200
-			$v->url = _XE_LOCATION_SITE_ . '?mid=download&package_srl=' . $v->package_srl;
200
+			$v->url = _XE_LOCATION_SITE_.'?mid=download&package_srl='.$v->package_srl;
201 201
 
202
-			if($packages[$v->package_srl])
202
+			if ($packages[$v->package_srl])
203 203
 			{
204 204
 				$v->current_version = $packages[$v->package_srl]->current_version;
205 205
 				$v->need_update = $packages[$v->package_srl]->need_update;
206 206
 				$v->type = $oModel->getTypeFromPath($packages[$v->package_srl]->path);
207 207
 
208
-				if($this->ftp_set && $v->depfrom)
208
+				if ($this->ftp_set && $v->depfrom)
209 209
 				{
210 210
 					$depfrom = explode(",", $v->depfrom);
211
-					foreach($depfrom as $package_srl)
211
+					foreach ($depfrom as $package_srl)
212 212
 					{
213 213
 						$depto[$package_srl][] = $v->package_srl;
214 214
 					}
215 215
 				}
216 216
 
217
-				if($v->type == "core")
217
+				if ($v->type == "core")
218 218
 				{
219 219
 					$v->avail_remove = FALSE;
220 220
 				}
221
-				else if($v->type == "module")
221
+				else if ($v->type == "module")
222 222
 				{
223 223
 					$v->avail_remove = $oModel->checkRemovable($packages[$v->package_srl]->path);
224 224
 				}
@@ -230,41 +230,41 @@  discard block
 block discarded – undo
230 230
 			$item_list[$v->package_srl] = $v;
231 231
 		}
232 232
 
233
-		if(count($depto) > 0)
233
+		if (count($depto) > 0)
234 234
 		{
235 235
 			$installed = $oModel->getInstalledPackages(implode(",", array_keys($depto)));
236
-			foreach($installed as $key => $val)
236
+			foreach ($installed as $key => $val)
237 237
 			{
238 238
 				$path = $val->path;
239 239
 				$type = $oModel->getTypeFromPath($path);
240 240
 
241
-				if(!$type || $type == "core")
241
+				if (!$type || $type == "core")
242 242
 				{
243 243
 					continue;
244 244
 				}
245 245
 
246 246
 				$config_file = $oModel->getConfigFilePath($type);
247
-				if(!$config_file)
247
+				if (!$config_file)
248 248
 				{
249 249
 					continue;
250 250
 				}
251 251
 
252 252
 				$xml = new XmlParser();
253
-				$xmlDoc = $xml->loadXmlFile(FileHandler::getRealPath($path) . $config_file);
254
-				if(!$xmlDoc)
253
+				$xmlDoc = $xml->loadXmlFile(FileHandler::getRealPath($path).$config_file);
254
+				if (!$xmlDoc)
255 255
 				{
256 256
 					continue;
257 257
 				}
258 258
 
259
-				if($type == "drcomponent")
259
+				if ($type == "drcomponent")
260 260
 				{
261 261
 					$type = "component";
262 262
 				}
263
-				if($type == "style" || $type == "m.skin")
263
+				if ($type == "style" || $type == "m.skin")
264 264
 				{
265 265
 					$type = "skin";
266 266
 				}
267
-				if($type == "m.layout")
267
+				if ($type == "m.layout")
268 268
 				{
269 269
 					$type = "layout";
270 270
 				}
@@ -276,9 +276,9 @@  discard block
 block discarded – undo
276 276
 			$oSecurity = new Security();
277 277
 			$oSecurity->encodeHTML('installed..');
278 278
 
279
-			foreach($installed as $key => $val)
279
+			foreach ($installed as $key => $val)
280 280
 			{
281
-				foreach($depto[$key] as $package_srl)
281
+				foreach ($depto[$key] as $package_srl)
282 282
 				{
283 283
 					$item_list[$package_srl]->avail_remove = false;
284 284
 					$item_list[$package_srl]->deps[] = $key;
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
 	function dispAutoinstallAdminInstalledPackages()
298 298
 	{
299 299
 		$page = Context::get('page');
300
-		if(!$page)
300
+		if (!$page)
301 301
 		{
302 302
 			$page = 1;
303 303
 		}
@@ -313,13 +313,13 @@  discard block
 block discarded – undo
313 313
 		$buff = FileHandler::getRemoteResource(_XE_DOWNLOAD_SERVER_, $body, 3, "POST", "application/xml");
314 314
 		$xml_lUpdate = new XmlParser();
315 315
 		$xmlDoc = $xml_lUpdate->parse($buff);
316
-		if($xmlDoc && $xmlDoc->response->packagelist->item)
316
+		if ($xmlDoc && $xmlDoc->response->packagelist->item)
317 317
 		{
318 318
 			$item_list = $this->rearranges($xmlDoc->response->packagelist->item, $package_list);
319 319
 			$res = array();
320
-			foreach($package_list as $package_srl => $package)
320
+			foreach ($package_list as $package_srl => $package)
321 321
 			{
322
-				if($item_list[$package_srl])
322
+				if ($item_list[$package_srl])
323 323
 				{
324 324
 					$res[] = $item_list[$package_srl];
325 325
 				}
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
 			Context::set('item_list', $res);
328 328
 		}
329 329
 
330
-		if(count($package_list) != count($res))
330
+		if (count($package_list) != count($res))
331 331
 		{
332 332
 			$localPackageSrls = array_keys($package_list);
333 333
 			$remotePackageSrls = array_keys($item_list);
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
 	function dispAutoinstallAdminInstall()
353 353
 	{
354 354
 		$package_srl = Context::get('package_srl');
355
-		if(!$package_srl)
355
+		if (!$package_srl)
356 356
 		{
357 357
 			return $this->dispAutoinstallAdminIndex();
358 358
 		}
@@ -363,13 +363,13 @@  discard block
 block discarded – undo
363 363
 		Context::set("package", $package);
364 364
 		Context::set('contain_core', $package->contain_core);
365 365
 
366
-		if(!$_SESSION['ftp_password'])
366
+		if (!$_SESSION['ftp_password'])
367 367
 		{
368 368
 			Context::set('need_password', TRUE);
369 369
 		}
370 370
 
371 371
 		$output = $oAdminModel->checkUseDirectModuleInstall($package);
372
-		if($output->toBool()==TRUE)
372
+		if ($output->toBool() == TRUE)
373 373
 		{
374 374
 			Context::set('show_ftp_note', FALSE);
375 375
 		}
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
 		$oModuleModel = getModel('module');
392 392
 		$config = $oModuleModel->getModuleConfig('autoinstall');
393 393
 		$ftp_info = Context::getFTPInfo();
394
-		if(!$ftp_info->ftp_root_path)
394
+		if (!$ftp_info->ftp_root_path)
395 395
 		{
396 396
 			Context::set('show_ftp_note', TRUE);
397 397
 		}
@@ -406,21 +406,21 @@  discard block
 block discarded – undo
406 406
 		$lUpdateDoc = $xml_lUpdate->parse($buff);
407 407
 		$updateDate = $lUpdateDoc->response->updatedate->body;
408 408
 
409
-		if(!$updateDate)
409
+		if (!$updateDate)
410 410
 		{
411 411
 			return $this->stop('msg_connection_fail');
412 412
 		}
413 413
 
414 414
 		$oModel = getModel('autoinstall');
415 415
 		$item = $oModel->getLatestPackage();
416
-		if(!$item || $item->updatedate < $updateDate || count($this->categories) < 1)
416
+		if (!$item || $item->updatedate < $updateDate || count($this->categories) < 1)
417 417
 		{
418 418
 			$oController = getAdminController('autoinstall');
419 419
 			$oController->_updateinfo();
420 420
 
421
-			if(!$_SESSION['__XE_EASYINSTALL_REDIRECT__'])
421
+			if (!$_SESSION['__XE_EASYINSTALL_REDIRECT__'])
422 422
 			{
423
-				header('location: ' . getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAutoinstallAdminIndex'));
423
+				header('location: '.getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAutoinstallAdminIndex'));
424 424
 				$_SESSION['__XE_EASYINSTALL_REDIRECT__'] = TRUE;
425 425
 				return;
426 426
 			}
@@ -428,21 +428,21 @@  discard block
 block discarded – undo
428 428
 		unset($_SESSION['__XE_EASYINSTALL_REDIRECT__']);
429 429
 
430 430
 		$page = Context::get('page');
431
-		if(!$page)
431
+		if (!$page)
432 432
 		{
433 433
 			$page = 1;
434 434
 		}
435 435
 		Context::set('page', $page);
436 436
 
437 437
 		$order_type = Context::get('order_type');
438
-		if(!in_array($order_type, array('asc', 'desc')))
438
+		if (!in_array($order_type, array('asc', 'desc')))
439 439
 		{
440 440
 			$order_type = 'desc';
441 441
 		}
442 442
 		Context::set('order_type', $order_type);
443 443
 
444 444
 		$order_target = Context::get('order_target');
445
-		if(!in_array($order_target, array('newest', 'download', 'popular')))
445
+		if (!in_array($order_target, array('newest', 'download', 'popular')))
446 446
 		{
447 447
 			$order_target = 'newest';
448 448
 		}
@@ -452,11 +452,11 @@  discard block
 block discarded – undo
452 452
 
453 453
 		$childrenList = Context::get('childrenList');
454 454
 		$category_srl = Context::get('category_srl');
455
-		if($childrenList)
455
+		if ($childrenList)
456 456
 		{
457 457
 			$params["category_srl"] = $childrenList;
458 458
 		}
459
-		else if($category_srl)
459
+		else if ($category_srl)
460 460
 		{
461 461
 			$params["category_srl"] = $category_srl;
462 462
 		}
@@ -465,12 +465,12 @@  discard block
 block discarded – undo
465 465
 		$params["order_target"] = $order_target;
466 466
 		$params["order_type"] = $order_type;
467 467
 		$params["page"] = $page;
468
-		if($search_keyword)
468
+		if ($search_keyword)
469 469
 		{
470 470
 			$params["search_keyword"] = $search_keyword;
471 471
 		}
472 472
 		$xmlDoc = XmlGenerater::getXmlDoc($params);
473
-		if($xmlDoc && $xmlDoc->response->packagelist->item)
473
+		if ($xmlDoc && $xmlDoc->response->packagelist->item)
474 474
 		{
475 475
 			$item_list = $this->rearranges($xmlDoc->response->packagelist->item);
476 476
 			Context::set('item_list', $item_list);
@@ -504,7 +504,7 @@  discard block
 block discarded – undo
504 504
 	function dispAutoinstallAdminUninstall()
505 505
 	{
506 506
 		$package_srl = Context::get('package_srl');
507
-		if(!$package_srl)
507
+		if (!$package_srl)
508 508
 		{
509 509
 			return $this->dispAutoinstallAdminIndex();
510 510
 		}
@@ -512,12 +512,12 @@  discard block
 block discarded – undo
512 512
 		$oModel = getModel('autoinstall');
513 513
 		$oAdminModel = getAdminModel('autoinstall');
514 514
 		$installedPackage = $oModel->getInstalledPackage($package_srl);
515
-		if(!$installedPackage)
515
+		if (!$installedPackage)
516 516
 		{
517 517
 			return $this->dispAutoinstallAdminInstalledPackages();
518 518
 		}
519 519
 
520
-		if(!$_SESSION['ftp_password'])
520
+		if (!$_SESSION['ftp_password'])
521 521
 		{
522 522
 			Context::set('need_password', TRUE);
523 523
 		}
@@ -526,19 +526,19 @@  discard block
 block discarded – undo
526 526
 		$path = $installedPackage->path;
527 527
 		$type = $oModel->getTypeFromPath($path);
528 528
 
529
-		if(!$type || $type == "core")
529
+		if (!$type || $type == "core")
530 530
 		{
531 531
 			return $this->stop("msg_invalid_request");
532 532
 		}
533 533
 
534 534
 		$config_file = $oModel->getConfigFilePath($type);
535
-		if(!$config_file)
535
+		if (!$config_file)
536 536
 		{
537 537
 			return $this->stop("msg_invalid_request");
538 538
 		}
539 539
 
540 540
 		$output = $oAdminModel->checkUseDirectModuleInstall($installedPackage);
541
-		if($output->toBool()==TRUE)
541
+		if ($output->toBool() == TRUE)
542 542
 		{
543 543
 			Context::set('show_ftp_note', FALSE);
544 544
 		}
@@ -550,7 +550,7 @@  discard block
 block discarded – undo
550 550
 		$buff = FileHandler::getRemoteResource(_XE_DOWNLOAD_SERVER_, $body, 3, "POST", "application/xml");
551 551
 		$xml_lUpdate = new XmlParser();
552 552
 		$xmlDoc = $xml_lUpdate->parse($buff);
553
-		if($xmlDoc && $xmlDoc->response->packagelist->item)
553
+		if ($xmlDoc && $xmlDoc->response->packagelist->item)
554 554
 		{
555 555
 			$item_list = $this->rearranges($xmlDoc->response->packagelist->item);
556 556
 			$installedPackage->title = $item_list[$package_srl]->title;
@@ -559,7 +559,7 @@  discard block
 block discarded – undo
559 559
 			$installedPackage->deps = $item_list[$package_srl]->deps;
560 560
 			Context::set('package', $installedPackage);
561 561
 			$this->setTemplateFile('uninstall');
562
-			Context::addJsFilter($this->module_path . 'tpl/filter', 'uninstall_package.xml');
562
+			Context::addJsFilter($this->module_path.'tpl/filter', 'uninstall_package.xml');
563 563
 
564 564
 			$security = new Security();
565 565
 			$security->encodeHTML('package.');
Please login to merge, or discard this patch.
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 	 *
86 86
 	 * @param object $item
87 87
 	 * @param object $targets
88
-	 * @return object
88
+	 * @return stdClass
89 89
 	 */
90 90
 	function rearrange(&$item, &$targets)
91 91
 	{
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
 	/**
348 348
 	 * Display install package
349 349
 	 *
350
-	 * @return BaseObject
350
+	 * @return ModuleObject|null
351 351
 	 */
352 352
 	function dispAutoinstallAdminInstall()
353 353
 	{
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
 	/**
385 385
 	 * Display package list
386 386
 	 *
387
-	 * @return BaseObject
387
+	 * @return ModuleObject|null
388 388
 	 */
389 389
 	function dispAutoinstallAdminIndex()
390 390
 	{
Please login to merge, or discard this patch.
modules/autoinstall/autoinstall.model.php 2 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -103,8 +103,7 @@  discard block
 block discarded – undo
103 103
 			if($category->parent_srl)
104 104
 			{
105 105
 				$categoryList[$category->parent_srl]->children[] = & $categoryList[$key];
106
-			}
107
-			else
106
+			} else
108 107
 			{
109 108
 				$depth0[] = $key;
110 109
 			}
@@ -324,8 +323,7 @@  discard block
 block discarded – undo
324 323
 		if(method_exists($oModule, "moduleUninstall"))
325 324
 		{
326 325
 			return TRUE;
327
-		}
328
-		else
326
+		} else
329 327
 		{
330 328
 			return FALSE;
331 329
 		}
Please login to merge, or discard this patch.
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 		$args = new stdClass();
20 20
 		$args->category_srl = $category_srl;
21 21
 		$output = executeQueryArray("autoinstall.getCategory", $args);
22
-		if(!$output->data)
22
+		if (!$output->data)
23 23
 		{
24 24
 			return null;
25 25
 		}
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 	function getPackages()
35 35
 	{
36 36
 		$output = executeQueryArray("autoinstall.getPackages");
37
-		if(!$output->data)
37
+		if (!$output->data)
38 38
 		{
39 39
 			return array();
40 40
 		}
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 		$args = new stdClass();
53 53
 		$args->package_srl = $package_srl;
54 54
 		$output = executeQueryArray("autoinstall.getInstalledPackage", $args);
55
-		if(!$output->data)
55
+		if (!$output->data)
56 56
 		{
57 57
 			return null;
58 58
 		}
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 		$args = new stdClass();
71 71
 		$args->package_srl = $package_srl;
72 72
 		$output = executeQueryArray("autoinstall.getPackage", $args);
73
-		if(!$output->data)
73
+		if (!$output->data)
74 74
 		{
75 75
 			return null;
76 76
 		}
@@ -85,22 +85,22 @@  discard block
 block discarded – undo
85 85
 	function getCategoryList()
86 86
 	{
87 87
 		$output = executeQueryArray("autoinstall.getCategories");
88
-		if(!$output->toBool() || !$output->data)
88
+		if (!$output->toBool() || !$output->data)
89 89
 		{
90 90
 			return array();
91 91
 		}
92 92
 
93 93
 		$categoryList = array();
94
-		foreach($output->data as $category)
94
+		foreach ($output->data as $category)
95 95
 		{
96 96
 			$category->children = array();
97 97
 			$categoryList[$category->category_srl] = $category;
98 98
 		}
99 99
 
100 100
 		$depth0 = array();
101
-		foreach($categoryList as $key => $category)
101
+		foreach ($categoryList as $key => $category)
102 102
 		{
103
-			if($category->parent_srl)
103
+			if ($category->parent_srl)
104 104
 			{
105 105
 				$categoryList[$category->parent_srl]->children[] = & $categoryList[$key];
106 106
 			}
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 			}
111 111
 		}
112 112
 		$resultList = array();
113
-		foreach($depth0 as $category_srl)
113
+		foreach ($depth0 as $category_srl)
114 114
 		{
115 115
 			$this->setDepth($categoryList[$category_srl], 0, $categoryList, $resultList);
116 116
 		}
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 		$args = new stdClass();
129 129
 		$args->category_srl = $category_srl;
130 130
 		$output = executeQuery("autoinstall.getPackageCount", $args);
131
-		if(!$output->data)
131
+		if (!$output->data)
132 132
 		{
133 133
 			return 0;
134 134
 		}
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 	function getInstalledPackageCount()
144 144
 	{
145 145
 		$output = executeQuery("autoinstall.getInstalledPackageCount");
146
-		if(!$output->data)
146
+		if (!$output->data)
147 147
 		{
148 148
 			return 0;
149 149
 		}
@@ -164,11 +164,11 @@  discard block
 block discarded – undo
164 164
 		$resultList[$item->category_srl] = &$item;
165 165
 		$item->depth = $depth;
166 166
 		$siblingList = $item->category_srl;
167
-		foreach($item->children as $child)
167
+		foreach ($item->children as $child)
168 168
 		{
169
-			$siblingList .= "," . $this->setDepth($list[$child->category_srl], $depth + 1, $list, $resultList);
169
+			$siblingList .= ",".$this->setDepth($list[$child->category_srl], $depth + 1, $list, $resultList);
170 170
 		}
171
-		if(count($item->children) < 1)
171
+		if (count($item->children) < 1)
172 172
 		{
173 173
 			$item->nPackages = $this->getPackageCount($item->category_srl);
174 174
 		}
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 	function getLatestPackage()
185 185
 	{
186 186
 		$output = executeQueryArray("autoinstall.getLatestPackage");
187
-		if(!$output->data)
187
+		if (!$output->data)
188 188
 		{
189 189
 			return null;
190 190
 		}
@@ -203,11 +203,11 @@  discard block
 block discarded – undo
203 203
 		$args->package_list = $package_list;
204 204
 		$output = executeQueryArray("autoinstall.getInstalledPackages", $args);
205 205
 		$result = array();
206
-		if(!$output->data)
206
+		if (!$output->data)
207 207
 		{
208 208
 			return $result;
209 209
 		}
210
-		foreach($output->data as $value)
210
+		foreach ($output->data as $value)
211 211
 		{
212 212
 			$result[$value->package_srl] = $value;
213 213
 		}
@@ -226,15 +226,15 @@  discard block
 block discarded – undo
226 226
 		$args->page = $page;
227 227
 		$args->list_count = 10;
228 228
 		$args->page_count = 5;
229
-		if(Context::getDBType() == 'mssql')
229
+		if (Context::getDBType() == 'mssql')
230 230
 		{
231 231
 			$args->sort_index = 'package_srl';
232 232
 		}
233 233
 		$output = executeQueryArray("autoinstall.getInstalledPackageList", $args);
234 234
 		$res = array();
235
-		if($output->data)
235
+		if ($output->data)
236 236
 		{
237
-			foreach($output->data as $val)
237
+			foreach ($output->data as $val)
238 238
 			{
239 239
 				$res[$val->package_srl] = $val;
240 240
 			}
@@ -251,19 +251,19 @@  discard block
 block discarded – undo
251 251
 	 */
252 252
 	function getTypeFromPath($path)
253 253
 	{
254
-		if(!$path)
254
+		if (!$path)
255 255
 		{
256 256
 			return NULL;
257 257
 		}
258 258
 
259
-		if($path == ".")
259
+		if ($path == ".")
260 260
 		{
261 261
 			return "core";
262 262
 		}
263 263
 
264 264
 		$path_array = explode("/", $path);
265 265
 		$target_name = array_pop($path_array);
266
-		if(!$target_name)
266
+		if (!$target_name)
267 267
 		{
268 268
 			$target_name = array_pop($path_array);
269 269
 		}
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 	function getConfigFilePath($type)
281 281
 	{
282 282
 		$config_file = NULL;
283
-		switch($type)
283
+		switch ($type)
284 284
 		{
285 285
 			case "m.layout":
286 286
 			case "module":
@@ -317,11 +317,11 @@  discard block
 block discarded – undo
317 317
 		$path_array = explode("/", $path);
318 318
 		$target_name = array_pop($path_array);
319 319
 		$oModule = getModule($target_name, "class");
320
-		if(!$oModule)
320
+		if (!$oModule)
321 321
 		{
322 322
 			return FALSE;
323 323
 		}
324
-		if(method_exists($oModule, "moduleUninstall"))
324
+		if (method_exists($oModule, "moduleUninstall"))
325 325
 		{
326 326
 			return TRUE;
327 327
 		}
@@ -339,17 +339,17 @@  discard block
 block discarded – undo
339 339
 	 */
340 340
 	function getPackageSrlByPath($path)
341 341
 	{
342
-		if(!$path)
342
+		if (!$path)
343 343
 		{
344 344
 			return;
345 345
 		}
346 346
 
347
-		if(substr($path, -1) == '/')
347
+		if (substr($path, -1) == '/')
348 348
 		{
349 349
 			$path = substr($path, 0, strlen($path) - 1);
350 350
 		}
351 351
 
352
-		if(!$GLOBLAS['XE_AUTOINSTALL_PACKAGE_SRL_BY_PATH'][$path])
352
+		if (!$GLOBLAS['XE_AUTOINSTALL_PACKAGE_SRL_BY_PATH'][$path])
353 353
 		{
354 354
 			$args = new stdClass();
355 355
 			$args->path = $path;
@@ -370,12 +370,12 @@  discard block
 block discarded – undo
370 370
 	function getRemoveUrlByPackageSrl($packageSrl)
371 371
 	{
372 372
 		$ftp_info = Context::getFTPInfo();
373
-		if(!$ftp_info->ftp_root_path)
373
+		if (!$ftp_info->ftp_root_path)
374 374
 		{
375 375
 			return;
376 376
 		}
377 377
 
378
-		if(!$packageSrl)
378
+		if (!$packageSrl)
379 379
 		{
380 380
 			return;
381 381
 		}
@@ -391,19 +391,19 @@  discard block
 block discarded – undo
391 391
 	 */
392 392
 	function getRemoveUrlByPath($path)
393 393
 	{
394
-		if(!$path)
394
+		if (!$path)
395 395
 		{
396 396
 			return;
397 397
 		}
398 398
 
399 399
 		$ftp_info = Context::getFTPInfo();
400
-		if(!$ftp_info->ftp_root_path)
400
+		if (!$ftp_info->ftp_root_path)
401 401
 		{
402 402
 			return;
403 403
 		}
404 404
 
405 405
 		$packageSrl = $this->getPackageSrlByPath($path);
406
-		if(!$packageSrl)
406
+		if (!$packageSrl)
407 407
 		{
408 408
 			return;
409 409
 		}
@@ -419,7 +419,7 @@  discard block
 block discarded – undo
419 419
 	 */
420 420
 	function getUpdateUrlByPackageSrl($packageSrl)
421 421
 	{
422
-		if(!$packageSrl)
422
+		if (!$packageSrl)
423 423
 		{
424 424
 			return;
425 425
 		}
@@ -435,13 +435,13 @@  discard block
 block discarded – undo
435 435
 	 */
436 436
 	function getUpdateUrlByPath($path)
437 437
 	{
438
-		if(!$path)
438
+		if (!$path)
439 439
 		{
440 440
 			return;
441 441
 		}
442 442
 
443 443
 		$packageSrl = $this->getPackageSrlByPath($path);
444
-		if(!$packageSrl)
444
+		if (!$packageSrl)
445 445
 		{
446 446
 			return;
447 447
 		}
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
 	function getHaveInstance($columnList = array())
453 453
 	{
454 454
 		$output = executeQueryArray('autoinstall.getHaveInstance', NULL, $columnList);
455
-		if(!$output->data)
455
+		if (!$output->data)
456 456
 		{
457 457
 			return array();
458 458
 		}
Please login to merge, or discard this patch.
modules/board/board.admin.controller.php 2 patches
Braces   +41 added lines, -16 removed lines patch added patch discarded remove patch
@@ -27,7 +27,9 @@  discard block
 block discarded – undo
27 27
 		$args = Context::getRequestVars();
28 28
 		$args->module = 'board';
29 29
 		$args->mid = $args->board_name;
30
-		if(is_array($args->use_status)) $args->use_status = implode('|@|', $args->use_status);
30
+		if(is_array($args->use_status)) {
31
+			$args->use_status = implode('|@|', $args->use_status);
32
+		}
31 33
 		unset($args->board_name);
32 34
 
33 35
 		// setup extra_order_target
@@ -43,17 +45,31 @@  discard block
 block discarded – undo
43 45
 		}
44 46
 
45 47
 		// setup other variables
46
-		if($args->except_notice != 'Y') $args->except_notice = 'N';
47
-		if($args->use_anonymous != 'Y') $args->use_anonymous = 'N';
48
-		if($args->consultation != 'Y') $args->consultation = 'N';
49
-		if($args->protect_content!= 'Y') $args->protect_content = 'N';
50
-		if(!in_array($args->order_target,$this->order_target) && !array_key_exists($args->order_target, $extra_order_target)) $args->order_target = 'list_order';
51
-		if(!in_array($args->order_type, array('asc', 'desc'))) $args->order_type = 'asc';
48
+		if($args->except_notice != 'Y') {
49
+			$args->except_notice = 'N';
50
+		}
51
+		if($args->use_anonymous != 'Y') {
52
+			$args->use_anonymous = 'N';
53
+		}
54
+		if($args->consultation != 'Y') {
55
+			$args->consultation = 'N';
56
+		}
57
+		if($args->protect_content!= 'Y') {
58
+			$args->protect_content = 'N';
59
+		}
60
+		if(!in_array($args->order_target,$this->order_target) && !array_key_exists($args->order_target, $extra_order_target)) {
61
+			$args->order_target = 'list_order';
62
+		}
63
+		if(!in_array($args->order_type, array('asc', 'desc'))) {
64
+			$args->order_type = 'asc';
65
+		}
52 66
 
53 67
 		// if there is an existed module
54 68
 		if($args->module_srl) {
55 69
 			$module_info = $oModuleModel->getModuleInfoByModuleSrl($args->module_srl);
56
-			if($module_info->module_srl != $args->module_srl) unset($args->module_srl);
70
+			if($module_info->module_srl != $args->module_srl) {
71
+				unset($args->module_srl);
72
+			}
57 73
 		}
58 74
 
59 75
 		// insert/update the board module based on module_srl
@@ -67,7 +83,9 @@  discard block
 block discarded – undo
67 83
 			$msg_code = 'success_updated';
68 84
 		}
69 85
 
70
-		if(!$output->toBool()) return $output;
86
+		if(!$output->toBool()) {
87
+			return $output;
88
+		}
71 89
 
72 90
 		// setup list config
73 91
 		$list = explode(',',Context::get('list'));
@@ -77,8 +95,12 @@  discard block
 block discarded – undo
77 95
 			foreach($list as $val)
78 96
 			{
79 97
 				$val = trim($val);
80
-				if(!$val) continue;
81
-				if(substr($val,0,10)=='extra_vars') $val = substr($val,10);
98
+				if(!$val) {
99
+					continue;
100
+				}
101
+				if(substr($val,0,10)=='extra_vars') {
102
+					$val = substr($val,10);
103
+				}
82 104
 				$list_arr[] = $val;
83 105
 			}
84 106
 			$oModuleController = getController('module');
@@ -89,7 +111,7 @@  discard block
 block discarded – undo
89 111
 		if (Context::get('success_return_url')){
90 112
 			changeValueInUrl('mid', $args->mid, $module_info->mid);
91 113
 			$this->setRedirectUrl(Context::get('success_return_url'));
92
-		}else{
114
+		} else{
93 115
 			$this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispBoardAdminBoardInfo', 'module_srl', $output->get('module_srl')));
94 116
 		}
95 117
 	}
@@ -131,7 +153,9 @@  discard block
 block discarded – undo
131 153
 			for($i=0;$i<count($admin_members);$i++)
132 154
 			{
133 155
 				$admin_id = trim($admin_members[$i]);
134
-				if(!$admin_id) continue;
156
+				if(!$admin_id) {
157
+					continue;
158
+				}
135 159
 				$oModuleController->insertAdminId($args->module_srl, $admin_id);
136 160
 			}
137 161
 		}
@@ -146,7 +170,9 @@  discard block
 block discarded – undo
146 170
 		// get the current module
147 171
 		$oModuleController = getController('module');
148 172
 		$output = $oModuleController->deleteModule($module_srl);
149
-		if(!$output->toBool()) return $output;
173
+		if(!$output->toBool()) {
174
+			return $output;
175
+		}
150 176
 
151 177
 		$this->add('module','board');
152 178
 		$this->add('page',Context::get('page'));
@@ -177,8 +203,7 @@  discard block
 block discarded – undo
177 203
 		if (Context::get('success_return_url'))
178 204
 		{
179 205
 			$this->setRedirectUrl(Context::get('success_return_url'));
180
-		}
181
-		else
206
+		} else
182 207
 		{
183 208
 			$this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispBoardAdminCategoryInfo', 'module_srl', $output->get('module_srl')));
184 209
 		}
Please login to merge, or discard this patch.
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -27,37 +27,37 @@  discard block
 block discarded – undo
27 27
 		$args = Context::getRequestVars();
28 28
 		$args->module = 'board';
29 29
 		$args->mid = $args->board_name;
30
-		if(is_array($args->use_status)) $args->use_status = implode('|@|', $args->use_status);
30
+		if (is_array($args->use_status)) $args->use_status = implode('|@|', $args->use_status);
31 31
 		unset($args->board_name);
32 32
 
33 33
 		// setup extra_order_target
34 34
 		$extra_order_target = array();
35
-		if($args->module_srl)
35
+		if ($args->module_srl)
36 36
 		{
37 37
 			$oDocumentModel = getModel('document');
38 38
 			$module_extra_vars = $oDocumentModel->getExtraKeys($args->module_srl);
39
-			foreach($module_extra_vars as $oExtraItem)
39
+			foreach ($module_extra_vars as $oExtraItem)
40 40
 			{
41 41
 				$extra_order_target[$oExtraItem->eid] = $oExtraItem->name;
42 42
 			}
43 43
 		}
44 44
 
45 45
 		// setup other variables
46
-		if($args->except_notice != 'Y') $args->except_notice = 'N';
47
-		if($args->use_anonymous != 'Y') $args->use_anonymous = 'N';
48
-		if($args->consultation != 'Y') $args->consultation = 'N';
49
-		if($args->protect_content!= 'Y') $args->protect_content = 'N';
50
-		if(!in_array($args->order_target,$this->order_target) && !array_key_exists($args->order_target, $extra_order_target)) $args->order_target = 'list_order';
51
-		if(!in_array($args->order_type, array('asc', 'desc'))) $args->order_type = 'asc';
46
+		if ($args->except_notice != 'Y') $args->except_notice = 'N';
47
+		if ($args->use_anonymous != 'Y') $args->use_anonymous = 'N';
48
+		if ($args->consultation != 'Y') $args->consultation = 'N';
49
+		if ($args->protect_content != 'Y') $args->protect_content = 'N';
50
+		if (!in_array($args->order_target, $this->order_target) && !array_key_exists($args->order_target, $extra_order_target)) $args->order_target = 'list_order';
51
+		if (!in_array($args->order_type, array('asc', 'desc'))) $args->order_type = 'asc';
52 52
 
53 53
 		// if there is an existed module
54
-		if($args->module_srl) {
54
+		if ($args->module_srl) {
55 55
 			$module_info = $oModuleModel->getModuleInfoByModuleSrl($args->module_srl);
56
-			if($module_info->module_srl != $args->module_srl) unset($args->module_srl);
56
+			if ($module_info->module_srl != $args->module_srl) unset($args->module_srl);
57 57
 		}
58 58
 
59 59
 		// insert/update the board module based on module_srl
60
-		if(!$args->module_srl) {
60
+		if (!$args->module_srl) {
61 61
 			$args->hide_category = 'N';
62 62
 			$output = $oModuleController->insertModule($args);
63 63
 			$msg_code = 'success_registed';
@@ -67,18 +67,18 @@  discard block
 block discarded – undo
67 67
 			$msg_code = 'success_updated';
68 68
 		}
69 69
 
70
-		if(!$output->toBool()) return $output;
70
+		if (!$output->toBool()) return $output;
71 71
 
72 72
 		// setup list config
73
-		$list = explode(',',Context::get('list'));
74
-		if(count($list))
73
+		$list = explode(',', Context::get('list'));
74
+		if (count($list))
75 75
 		{
76 76
 			$list_arr = array();
77
-			foreach($list as $val)
77
+			foreach ($list as $val)
78 78
 			{
79 79
 				$val = trim($val);
80
-				if(!$val) continue;
81
-				if(substr($val,0,10)=='extra_vars') $val = substr($val,10);
80
+				if (!$val) continue;
81
+				if (substr($val, 0, 10) == 'extra_vars') $val = substr($val, 10);
82 82
 				$list_arr[] = $val;
83 83
 			}
84 84
 			$oModuleController = getController('module');
@@ -86,10 +86,10 @@  discard block
 block discarded – undo
86 86
 		}
87 87
 
88 88
 		$this->setMessage($msg_code);
89
-		if (Context::get('success_return_url')){
89
+		if (Context::get('success_return_url')) {
90 90
 			changeValueInUrl('mid', $args->mid, $module_info->mid);
91 91
 			$this->setRedirectUrl(Context::get('success_return_url'));
92
-		}else{
92
+		} else {
93 93
 			$this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispBoardAdminBoardInfo', 'module_srl', $output->get('module_srl')));
94 94
 		}
95 95
 	}
@@ -105,17 +105,17 @@  discard block
 block discarded – undo
105 105
 		// for board info
106 106
 		$args->module = 'board';
107 107
 		$args->mid = $args->board_name;
108
-		if(is_array($args->use_status))
108
+		if (is_array($args->use_status))
109 109
 		{
110 110
 			$args->use_status = implode('|@|', $args->use_status);
111 111
 		}
112 112
 		unset($args->board_name);
113 113
 
114
-		if(!in_array($args->order_target, $this->order_target))
114
+		if (!in_array($args->order_target, $this->order_target))
115 115
 		{
116 116
 			$args->order_target = 'list_order';
117 117
 		}
118
-		if(!in_array($args->order_type, array('asc', 'desc')))
118
+		if (!in_array($args->order_type, array('asc', 'desc')))
119 119
 		{
120 120
 			$args->order_type = 'asc';
121 121
 		}
@@ -125,13 +125,13 @@  discard block
 block discarded – undo
125 125
 
126 126
 		// for grant info, Register Admin ID
127 127
 		$oModuleController->deleteAdminId($args->module_srl);
128
-		if($args->admin_member)
128
+		if ($args->admin_member)
129 129
 		{
130
-			$admin_members = explode(',',$args->admin_member);
131
-			for($i=0;$i<count($admin_members);$i++)
130
+			$admin_members = explode(',', $args->admin_member);
131
+			for ($i = 0; $i < count($admin_members); $i++)
132 132
 			{
133 133
 				$admin_id = trim($admin_members[$i]);
134
-				if(!$admin_id) continue;
134
+				if (!$admin_id) continue;
135 135
 				$oModuleController->insertAdminId($args->module_srl, $admin_id);
136 136
 			}
137 137
 		}
@@ -146,10 +146,10 @@  discard block
 block discarded – undo
146 146
 		// get the current module
147 147
 		$oModuleController = getController('module');
148 148
 		$output = $oModuleController->deleteModule($module_srl);
149
-		if(!$output->toBool()) return $output;
149
+		if (!$output->toBool()) return $output;
150 150
 
151
-		$this->add('module','board');
152
-		$this->add('page',Context::get('page'));
151
+		$this->add('module', 'board');
152
+		$this->add('page', Context::get('page'));
153 153
 		$this->setMessage('success_deleted');
154 154
 	}
155 155
 
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 
161 161
 		$oModuleModel = getModel('module');
162 162
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
163
-		if($module_info->mid != $mid)
163
+		if ($module_info->mid != $mid)
164 164
 		{
165 165
 			return new BaseObject(-1, 'msg_invalid_request');
166 166
 		}
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 		$module_info->hide_category = Context::get('hide_category') == 'Y' ? 'Y' : 'N';
169 169
 		$oModuleController = getController('module'); /* @var $oModuleController moduleController */
170 170
 		$output = $oModuleController->updateModule($module_info);
171
-		if(!$output->toBool())
171
+		if (!$output->toBool())
172 172
 		{
173 173
 			return $output;
174 174
 		}
Please login to merge, or discard this patch.
modules/board/board.admin.view.php 2 patches
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 	function init() {
18 18
 		// check module_srl is existed or not
19 19
 		$module_srl = Context::get('module_srl');
20
-		if(!$module_srl && $this->module_srl) {
20
+		if (!$module_srl && $this->module_srl) {
21 21
 			$module_srl = $this->module_srl;
22 22
 			Context::set('module_srl', $module_srl);
23 23
 		}
@@ -26,20 +26,20 @@  discard block
 block discarded – undo
26 26
 		$oModuleModel = getModel('module');
27 27
 
28 28
 		// get the module infomation based on the module_srl
29
-		if($module_srl) {
29
+		if ($module_srl) {
30 30
 			$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
31
-			if(!$module_info) {
32
-				Context::set('module_srl','');
31
+			if (!$module_info) {
32
+				Context::set('module_srl', '');
33 33
 				$this->act = 'list';
34 34
 			} else {
35 35
 				ModuleModel::syncModuleToSite($module_info);
36 36
 				$this->module_info = $module_info;
37 37
 				$this->module_info->use_status = explode('|@|', $module_info->use_status);
38
-				Context::set('module_info',$module_info);
38
+				Context::set('module_info', $module_info);
39 39
 			}
40 40
 		}
41 41
 
42
-		if($module_info && $module_info->module != 'board') return $this->stop("msg_invalid_request");
42
+		if ($module_info && $module_info->module != 'board') return $this->stop("msg_invalid_request");
43 43
 
44 44
 		// get the module category list
45 45
 		$module_category = $oModuleModel->getModuleCategories();
@@ -50,11 +50,11 @@  discard block
 block discarded – undo
50 50
 		$security->encodeHTML('module_category..');
51 51
 
52 52
 		// setup template path (board admin panel templates is resided in the tpl folder)
53
-		$template_path = sprintf("%stpl/",$this->module_path);
53
+		$template_path = sprintf("%stpl/", $this->module_path);
54 54
 		$this->setTemplatePath($template_path);
55 55
 
56 56
 		// install order (sorting) options
57
-		foreach($this->order_target as $key) $order_target[$key] = Context::getLang($key);
57
+		foreach ($this->order_target as $key) $order_target[$key] = Context::getLang($key);
58 58
 		$order_target['list_order'] = Context::getLang('document_srl');
59 59
 		$order_target['update_order'] = Context::getLang('last_update');
60 60
 		Context::set('order_target', $order_target);
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 		$search_target = Context::get('search_target');
76 76
 		$search_keyword = Context::get('search_keyword');
77 77
 
78
-		switch ($search_target){
78
+		switch ($search_target) {
79 79
 			case 'mid':
80 80
 				$args->s_mid = $search_keyword;
81 81
 				break;
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 		// get the skins path
91 91
 		$oModuleModel = getModel('module');
92 92
 		$skin_list = $oModuleModel->getSkins($this->module_path);
93
-		Context::set('skin_list',$skin_list);
93
+		Context::set('skin_list', $skin_list);
94 94
 
95 95
 		$mskin_list = $oModuleModel->getSkins($this->module_path, "m.skins");
96 96
 		Context::set('mskin_list', $mskin_list);
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 		$layout_list = $oLayoutModel->getLayoutList();
101 101
 		Context::set('layout_list', $layout_list);
102 102
 
103
-		$mobile_layout_list = $oLayoutModel->getLayoutList(0,"M");
103
+		$mobile_layout_list = $oLayoutModel->getLayoutList(0, "M");
104 104
 		Context::set('mlayout_list', $mobile_layout_list);
105 105
 
106 106
 		$oModuleAdminModel = getAdminModel('module');
@@ -115,10 +115,10 @@  discard block
 block discarded – undo
115 115
 		Context::set('page_navigation', $output->page_navigation);
116 116
 
117 117
 		$security = new Security();
118
-		$security->encodeHTML('board_list..browser_title','board_list..mid');
119
-		$security->encodeHTML('skin_list..title','mskin_list..title');
120
-		$security->encodeHTML('layout_list..title','layout_list..layout');
121
-		$security->encodeHTML('mlayout_list..title','mlayout_list..layout');
118
+		$security->encodeHTML('board_list..browser_title', 'board_list..mid');
119
+		$security->encodeHTML('skin_list..title', 'mskin_list..title');
120
+		$security->encodeHTML('layout_list..title', 'layout_list..layout');
121
+		$security->encodeHTML('mlayout_list..title', 'mlayout_list..layout');
122 122
 
123 123
 		// 템플릿 파일 지정
124 124
 		$this->setTemplateFile('index');
@@ -135,14 +135,14 @@  discard block
 block discarded – undo
135 135
 	 * @brief display the module insert form
136 136
 	 **/
137 137
 	function dispBoardAdminInsertBoard() {
138
-		if(!in_array($this->module_info->module, array('admin', 'board','blog','guestbook'))) {
138
+		if (!in_array($this->module_info->module, array('admin', 'board', 'blog', 'guestbook'))) {
139 139
 			return $this->alertMessage('msg_invalid_request');
140 140
 		}
141 141
 
142 142
 		// get the skins list
143 143
 		$oModuleModel = getModel('module');
144 144
 		$skin_list = $oModuleModel->getSkins($this->module_path);
145
-		Context::set('skin_list',$skin_list);
145
+		Context::set('skin_list', $skin_list);
146 146
 
147 147
 		$mskin_list = $oModuleModel->getSkins($this->module_path, "m.skins");
148 148
 		Context::set('mskin_list', $mskin_list);
@@ -152,13 +152,13 @@  discard block
 block discarded – undo
152 152
 		$layout_list = $oLayoutModel->getLayoutList();
153 153
 		Context::set('layout_list', $layout_list);
154 154
 
155
-		$mobile_layout_list = $oLayoutModel->getLayoutList(0,"M");
155
+		$mobile_layout_list = $oLayoutModel->getLayoutList(0, "M");
156 156
 		Context::set('mlayout_list', $mobile_layout_list);
157 157
 
158 158
 		$security = new Security();
159
-		$security->encodeHTML('skin_list..title','mskin_list..title');
160
-		$security->encodeHTML('layout_list..title','layout_list..layout');
161
-		$security->encodeHTML('mlayout_list..title','mlayout_list..layout');
159
+		$security->encodeHTML('skin_list..title', 'mskin_list..title');
160
+		$security->encodeHTML('layout_list..title', 'layout_list..layout');
161
+		$security->encodeHTML('mlayout_list..title', 'mlayout_list..layout');
162 162
 
163 163
 		// get document status list
164 164
 		$oDocumentModel = getModel('document');
@@ -177,14 +177,14 @@  discard block
 block discarded – undo
177 177
 		// setup extra_order_target
178 178
 		$module_extra_vars = $oDocumentModel->getExtraKeys($this->module_info->module_srl);
179 179
 		$extra_order_target = array();
180
-		foreach($module_extra_vars as $oExtraItem)
180
+		foreach ($module_extra_vars as $oExtraItem)
181 181
 		{
182 182
 			$extra_order_target[$oExtraItem->eid] = $oExtraItem->name;
183 183
 		}
184 184
 		Context::set('extra_order_target', $extra_order_target);
185 185
 
186 186
 		$security = new Security();
187
-		$security->encodeHTML('extra_vars..name','list_config..name');
187
+		$security->encodeHTML('extra_vars..name', 'list_config..name');
188 188
 
189 189
 		// set the template file
190 190
 		$this->setTemplateFile('board_insert');
@@ -212,8 +212,8 @@  discard block
 block discarded – undo
212 212
 	 * @brief display the board mdoule delete page
213 213
 	 **/
214 214
 	function dispBoardAdminDeleteBoard() {
215
-		if(!Context::get('module_srl')) return $this->dispBoardAdminContent();
216
-		if(!in_array($this->module_info->module, array('admin', 'board','blog','guestbook'))) {
215
+		if (!Context::get('module_srl')) return $this->dispBoardAdminContent();
216
+		if (!in_array($this->module_info->module, array('admin', 'board', 'blog', 'guestbook'))) {
217 217
 			return $this->alertMessage('msg_invalid_request');
218 218
 		}
219 219
 
@@ -223,10 +223,10 @@  discard block
 block discarded – undo
223 223
 		$document_count = $oDocumentModel->getDocumentCount($module_info->module_srl);
224 224
 		$module_info->document_count = $document_count;
225 225
 
226
-		Context::set('module_info',$module_info);
226
+		Context::set('module_info', $module_info);
227 227
 
228 228
 		$security = new Security();
229
-		$security->encodeHTML('module_info..mid','module_info..module','module_info..document_count');
229
+		$security->encodeHTML('module_info..mid', 'module_info..module', 'module_info..document_count');
230 230
 
231 231
 		// setup the template file
232 232
 		$this->setTemplateFile('board_delete');
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
 	 * @brief board module message
296 296
 	 **/
297 297
 	function alertMessage($message) {
298
-		$script =  sprintf('<script> xAddEventListener(window,"load", function() { alert("%s"); } );</script>', Context::getLang($message));
299
-		Context::addHtmlHeader( $script );
298
+		$script = sprintf('<script> xAddEventListener(window,"load", function() { alert("%s"); } );</script>', Context::getLang($message));
299
+		Context::addHtmlHeader($script);
300 300
 	}
301 301
 }
Please login to merge, or discard this patch.
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -39,7 +39,9 @@  discard block
 block discarded – undo
39 39
 			}
40 40
 		}
41 41
 
42
-		if($module_info && $module_info->module != 'board') return $this->stop("msg_invalid_request");
42
+		if($module_info && $module_info->module != 'board') {
43
+			return $this->stop("msg_invalid_request");
44
+		}
43 45
 
44 46
 		// get the module category list
45 47
 		$module_category = $oModuleModel->getModuleCategories();
@@ -54,7 +56,9 @@  discard block
 block discarded – undo
54 56
 		$this->setTemplatePath($template_path);
55 57
 
56 58
 		// install order (sorting) options
57
-		foreach($this->order_target as $key) $order_target[$key] = Context::getLang($key);
59
+		foreach($this->order_target as $key) {
60
+			$order_target[$key] = Context::getLang($key);
61
+		}
58 62
 		$order_target['list_order'] = Context::getLang('document_srl');
59 63
 		$order_target['update_order'] = Context::getLang('last_update');
60 64
 		Context::set('order_target', $order_target);
@@ -212,7 +216,9 @@  discard block
 block discarded – undo
212 216
 	 * @brief display the board mdoule delete page
213 217
 	 **/
214 218
 	function dispBoardAdminDeleteBoard() {
215
-		if(!Context::get('module_srl')) return $this->dispBoardAdminContent();
219
+		if(!Context::get('module_srl')) {
220
+			return $this->dispBoardAdminContent();
221
+		}
216 222
 		if(!in_array($this->module_info->module, array('admin', 'board','blog','guestbook'))) {
217 223
 			return $this->alertMessage('msg_invalid_request');
218 224
 		}
Please login to merge, or discard this patch.
modules/comment/comment.controller.php 4 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -581,7 +581,7 @@
 block discarded – undo
581 581
 				//mail to author of thread - START
582 582
 				/**
583 583
 				 * @todo Removed code send email to document author.
584
-				*/
584
+				 */
585 585
 				/*
586 586
 				if($document_author_email != $obj->email_address && $logged_info->email_address != $document_author_email)
587 587
 				{
Please login to merge, or discard this patch.
Doc Comments   +3 added lines, -4 removed lines patch added patch discarded remove patch
@@ -160,7 +160,6 @@  discard block
 block discarded – undo
160 160
 
161 161
 	/**
162 162
 	 * Check if module is using comment validation system
163
-	 * @param int $document_srl
164 163
 	 * @param int $module_srl
165 164
 	 * @return bool
166 165
 	 */
@@ -1151,7 +1150,7 @@  discard block
 block discarded – undo
1151 1150
 
1152 1151
 	/**
1153 1152
 	 * Report a blamed comment
1154
-	 * @param $comment_srl
1153
+	 * @param string $comment_srl
1155 1154
 	 * @return void
1156 1155
 	 */
1157 1156
 	function declaredComment($comment_srl)
@@ -1356,7 +1355,7 @@  discard block
 block discarded – undo
1356 1355
 	/**
1357 1356
 	 * Comment module config setting
1358 1357
 	 * @param int $srl
1359
-	 * @param object $comment_config
1358
+	 * @param stdClass $comment_config
1360 1359
 	 * @return BaseObject
1361 1360
 	 */
1362 1361
 	function setCommentModuleConfig($srl, $comment_config)
@@ -1368,7 +1367,7 @@  discard block
 block discarded – undo
1368 1367
 
1369 1368
 	/**
1370 1369
 	 * Get comment all list
1371
-	 * @return void
1370
+	 * @return BaseObject|null
1372 1371
 	 */
1373 1372
 	function procCommentGetList()
1374 1373
 	{
Please login to merge, or discard this patch.
Braces   +22 added lines, -44 removed lines patch added patch discarded remove patch
@@ -211,14 +211,12 @@  discard block
 block discarded – undo
211 211
 				if($logged_info->is_admin == 'Y')
212 212
 				{
213 213
 					$is_admin = TRUE;
214
-				}
215
-				else
214
+				} else
216 215
 				{
217 216
 					$is_admin = FALSE;
218 217
 				}
219 218
 			}
220
-		}
221
-		else
219
+		} else
222 220
 		{
223 221
 			$is_admin = FALSE;
224 222
 		}
@@ -226,14 +224,12 @@  discard block
 block discarded – undo
226 224
 		if(!$using_validation)
227 225
 		{
228 226
 			$obj->status = 1;
229
-		}
230
-		else
227
+		} else
231 228
 		{
232 229
 			if($is_admin)
233 230
 			{
234 231
 				$obj->status = 1;
235
-			}
236
-			else
232
+			} else
237 233
 			{
238 234
 				$obj->status = 0;
239 235
 			}
@@ -310,8 +306,7 @@  discard block
 block discarded – undo
310 306
 		if(!$obj->comment_srl)
311 307
 		{
312 308
 			$obj->comment_srl = getNextSequence();
313
-		}
314
-		elseif(!$is_admin && !$manual_inserted && !checkUserSequence($obj->comment_srl)) 
309
+		} elseif(!$is_admin && !$manual_inserted && !checkUserSequence($obj->comment_srl)) 
315 310
 		{
316 311
 			return new BaseObject(-1, 'msg_not_permitted');
317 312
 		}
@@ -369,8 +364,7 @@  discard block
 block discarded – undo
369 364
 			$list_args->head = $list_args->arrange = $obj->comment_srl;
370 365
 			$list_args->depth = 0;
371 366
 			// If parent comment exists, get information of the parent comment
372
-		}
373
-		else
367
+		} else
374 368
 		{
375 369
 			// get information of the parent comment posting
376 370
 			$parent_args = new stdClass();
@@ -393,8 +387,7 @@  discard block
 block discarded – undo
393 387
 			{
394 388
 				$list_args->arrange = $obj->comment_srl;
395 389
 				// if the depth of comments is greater than 2, execute update.
396
-			}
397
-			else
390
+			} else
398 391
 			{
399 392
 				// get the top listed comment among those in lower depth and same head with parent's.
400 393
 				$p_args = new stdClass();
@@ -407,8 +400,7 @@  discard block
 block discarded – undo
407 400
 				{
408 401
 					$list_args->arrange = $output->data->arrange;
409 402
 					$output = executeQuery('comment.updateCommentListArrange', $list_args);
410
-				}
411
-				else
403
+				} else
412 404
 				{
413 405
 					$list_args->arrange = $obj->comment_srl;
414 406
 				}
@@ -442,8 +434,7 @@  discard block
 block discarded – undo
442 434
 		if(!$using_validation)
443 435
 		{
444 436
 			$output = $oDocumentController->updateCommentCount($document_srl, $comment_count, $obj->nick_name, TRUE);
445
-		}
446
-		else
437
+		} else
447 438
 		{
448 439
 			if($is_admin)
449 440
 			{
@@ -511,8 +502,7 @@  discard block
 block discarded – undo
511 502
 		if(isset($obj->member_srl) && !is_null($obj->member_srl))
512 503
 		{
513 504
 			$member_info = $oMemberModel->getMemberInfoByMemberSrl($obj->member_srl);
514
-		}
515
-		else
505
+		} else
516 506
 		{
517 507
 			$member_info = new stdClass();
518 508
 			$member_info->is_admin = "N";
@@ -558,8 +548,7 @@  discard block
 block discarded – undo
558 548
 					<br /><a href=\"" . getFullUrl('', 'module', 'admin', 'act', 'dispCommentAdminList', 'search_target', 'module', 'search_keyword', $obj->module_srl) . "\">" . getFullUrl('', 'module', 'admin', 'act', 'dispCommentAdminList', 'search_target', 'module', 'search_keyword', $obj->module_srl) . "</a>
559 549
 					";
560 550
 				$oMail->setContent($mail_content);
561
-			}
562
-			else
551
+			} else
563 552
 			{
564 553
 				$mail_content = "
565 554
 					Author: " . $member_info->nick_name . "
@@ -832,8 +821,7 @@  discard block
 block discarded – undo
832 821
 			if(!$deleteAllComment)
833 822
 			{
834 823
 				return new BaseObject(-1, 'fail_to_delete_have_children');
835
-			}
836
-			else
824
+			} else
837 825
 			{
838 826
 				foreach($childs as $val)
839 827
 				{
@@ -897,8 +885,7 @@  discard block
 block discarded – undo
897 885
 		{
898 886
 			$this->_deleteDeclaredComments($args);
899 887
 			$this->_deleteVotedComments($args);
900
-		} 
901
-		else 
888
+		} else 
902 889
 		{
903 890
 			$args = new stdClass();
904 891
 			$args->upload_target_srl = $comment_srl;
@@ -941,8 +928,7 @@  discard block
 block discarded – undo
941 928
 		{
942 929
 			$oDocument = new documentItem();
943 930
 			$oDocument->setAttribute($obj);
944
-		}
945
-		else
931
+		} else
946 932
 		{
947 933
 			$oDocument = $oDocumentModel->getDocument($document_srl);
948 934
 		}
@@ -1035,8 +1021,7 @@  discard block
 block discarded – undo
1035 1021
 		{
1036 1022
 			$failed_voted = 'failed_voted';
1037 1023
 			$success_message = 'success_voted';
1038
-		}
1039
-		else
1024
+		} else
1040 1025
 		{
1041 1026
 			$failed_voted = 'failed_blamed';
1042 1027
 			$success_message = 'success_blamed';
@@ -1079,8 +1064,7 @@  discard block
 block discarded – undo
1079 1064
 		if($member_srl)
1080 1065
 		{
1081 1066
 			$args->member_srl = $member_srl;
1082
-		}
1083
-		else
1067
+		} else
1084 1068
 		{
1085 1069
 			$args->ipaddress = $_SERVER['REMOTE_ADDR'];
1086 1070
 		}
@@ -1120,8 +1104,7 @@  discard block
 block discarded – undo
1120 1104
 		{
1121 1105
 			$args->blamed_count = $trigger_obj->after_point;
1122 1106
 			$output = executeQuery('comment.updateBlamedCount', $args);
1123
-		}
1124
-		else
1107
+		} else
1125 1108
 		{
1126 1109
 			$args->voted_count = $trigger_obj->after_point;
1127 1110
 			$output = executeQuery('comment.updateVotedCount', $args);
@@ -1149,8 +1132,7 @@  discard block
 block discarded – undo
1149 1132
 		if($trigger_obj->update_target === 'voted_count')
1150 1133
 		{
1151 1134
 			$output->add('voted_count', $trigger_obj->after_point);
1152
-		}
1153
-		else
1135
+		} else
1154 1136
 		{
1155 1137
 			$output->add('blamed_count', $trigger_obj->after_point);
1156 1138
 		}
@@ -1222,8 +1204,7 @@  discard block
 block discarded – undo
1222 1204
 		if($member_srl)
1223 1205
 		{
1224 1206
 			$args->member_srl = $member_srl;
1225
-		}
1226
-		else
1207
+		} else
1227 1208
 		{
1228 1209
 			$args->ipaddress = $_SERVER['REMOTE_ADDR'];
1229 1210
 		}
@@ -1245,8 +1226,7 @@  discard block
 block discarded – undo
1245 1226
 		if($output->data->declared_count > 0)
1246 1227
 		{
1247 1228
 			$output = executeQuery('comment.updateDeclaredComment', $args);
1248
-		}
1249
-		else
1229
+		} else
1250 1230
 		{
1251 1231
 			$output = executeQuery('comment.insertDeclaredComment', $args);
1252 1232
 		}
@@ -1313,8 +1293,7 @@  discard block
 block discarded – undo
1313 1293
 		if(preg_match('/^([0-9,]+)$/', $module_srl))
1314 1294
 		{
1315 1295
 			$module_srl = explode(',', $module_srl);
1316
-		}
1317
-		else
1296
+		} else
1318 1297
 		{
1319 1298
 			$module_srl = array($module_srl);
1320 1299
 		}
@@ -1404,8 +1383,7 @@  discard block
 block discarded – undo
1404 1383
 					$value->content = strip_tags($value->content);
1405 1384
 				}
1406 1385
 			}
1407
-		}
1408
-		else
1386
+		} else
1409 1387
 		{
1410 1388
 			global $lang;
1411 1389
 			$commentList = array();
Please login to merge, or discard this patch.
Spacing   +154 added lines, -154 removed lines patch added patch discarded remove patch
@@ -27,13 +27,13 @@  discard block
 block discarded – undo
27 27
 	 */
28 28
 	function procCommentVoteUp()
29 29
 	{
30
-		if(!Context::get('is_logged'))
30
+		if (!Context::get('is_logged'))
31 31
 		{
32 32
 			return new BaseObject(-1, 'msg_invalid_request');
33 33
 		}
34 34
 
35 35
 		$comment_srl = Context::get('target_srl');
36
-		if(!$comment_srl)
36
+		if (!$comment_srl)
37 37
 		{
38 38
 			return new BaseObject(-1, 'msg_invalid_request');
39 39
 		}
@@ -41,14 +41,14 @@  discard block
 block discarded – undo
41 41
 		$oCommentModel = getModel('comment');
42 42
 		$oComment = $oCommentModel->getComment($comment_srl, FALSE, FALSE);
43 43
 		$module_srl = $oComment->get('module_srl');
44
-		if(!$module_srl)
44
+		if (!$module_srl)
45 45
 		{
46 46
 			return new BaseObject(-1, 'msg_invalid_request');
47 47
 		}
48 48
 
49 49
 		$oModuleModel = getModel('module');
50 50
 		$comment_config = $oModuleModel->getModulePartConfig('comment', $module_srl);
51
-		if($comment_config->use_vote_up == 'N')
51
+		if ($comment_config->use_vote_up == 'N')
52 52
 		{
53 53
 			return new BaseObject(-1, 'msg_invalid_request');
54 54
 		}
@@ -65,13 +65,13 @@  discard block
 block discarded – undo
65 65
 	 */
66 66
 	function procCommentVoteDown()
67 67
 	{
68
-		if(!Context::get('is_logged'))
68
+		if (!Context::get('is_logged'))
69 69
 		{
70 70
 			return new BaseObject(-1, 'msg_invalid_request');
71 71
 		}
72 72
 
73 73
 		$comment_srl = Context::get('target_srl');
74
-		if(!$comment_srl)
74
+		if (!$comment_srl)
75 75
 		{
76 76
 			return new BaseObject(-1, 'msg_invalid_request');
77 77
 		}
@@ -79,14 +79,14 @@  discard block
 block discarded – undo
79 79
 		$oCommentModel = getModel('comment');
80 80
 		$oComment = $oCommentModel->getComment($comment_srl, FALSE, FALSE);
81 81
 		$module_srl = $oComment->get('module_srl');
82
-		if(!$module_srl)
82
+		if (!$module_srl)
83 83
 		{
84 84
 			return new BaseObject(-1, 'msg_invalid_request');
85 85
 		}
86 86
 
87 87
 		$oModuleModel = getModel('module');
88 88
 		$comment_config = $oModuleModel->getModulePartConfig('comment', $module_srl);
89
-		if($comment_config->use_vote_down == 'N')
89
+		if ($comment_config->use_vote_down == 'N')
90 90
 		{
91 91
 			return new BaseObject(-1, 'msg_invalid_request');
92 92
 		}
@@ -103,13 +103,13 @@  discard block
 block discarded – undo
103 103
 	 */
104 104
 	function procCommentDeclare()
105 105
 	{
106
-		if(!Context::get('is_logged'))
106
+		if (!Context::get('is_logged'))
107 107
 		{
108 108
 			return new BaseObject(-1, 'msg_invalid_request');
109 109
 		}
110 110
 
111 111
 		$comment_srl = Context::get('target_srl');
112
-		if(!$comment_srl)
112
+		if (!$comment_srl)
113 113
 		{
114 114
 			return new BaseObject(-1, 'msg_invalid_request');
115 115
 		}
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 	function triggerDeleteDocumentComments(&$obj)
125 125
 	{
126 126
 		$document_srl = $obj->document_srl;
127
-		if(!$document_srl)
127
+		if (!$document_srl)
128 128
 		{
129 129
 			return new BaseObject();
130 130
 		}
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 	function triggerDeleteModuleComments(&$obj)
140 140
 	{
141 141
 		$module_srl = $obj->module_srl;
142
-		if(!$module_srl)
142
+		if (!$module_srl)
143 143
 		{
144 144
 			return new BaseObject();
145 145
 		}
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 	 */
167 167
 	function isModuleUsingPublishValidation($module_srl = NULL)
168 168
 	{
169
-		if($module_srl == NULL)
169
+		if ($module_srl == NULL)
170 170
 		{
171 171
 			return FALSE;
172 172
 		}
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
176 176
 		$module_part_config = $oModuleModel->getModulePartConfig('comment', $module_info->module_srl);
177 177
 		$use_validation = FALSE;
178
-		if(isset($module_part_config->use_comment_validation) && $module_part_config->use_comment_validation == "Y")
178
+		if (isset($module_part_config->use_comment_validation) && $module_part_config->use_comment_validation == "Y")
179 179
 		{
180 180
 			$use_validation = TRUE;
181 181
 		}
@@ -190,12 +190,12 @@  discard block
 block discarded – undo
190 190
 	 */
191 191
 	function insertComment($obj, $manual_inserted = FALSE)
192 192
 	{
193
-		if(!$manual_inserted && !checkCSRF())
193
+		if (!$manual_inserted && !checkCSRF())
194 194
 		{
195 195
 			return new BaseObject(-1, 'msg_invalid_request');
196 196
 		}
197 197
 
198
-		if(!is_object($obj))
198
+		if (!is_object($obj))
199 199
 		{
200 200
 			$obj = new stdClass();
201 201
 		}
@@ -203,12 +203,12 @@  discard block
 block discarded – undo
203 203
 		// check if comment's module is using comment validation and set the publish status to 0 (false)
204 204
 		// for inserting query, otherwise default is 1 (true - means comment is published)
205 205
 		$using_validation = $this->isModuleUsingPublishValidation($obj->module_srl);
206
-		if(!$manual_inserted)
206
+		if (!$manual_inserted)
207 207
 		{
208
-			if(Context::get('is_logged'))
208
+			if (Context::get('is_logged'))
209 209
 			{
210 210
 				$logged_info = Context::get('logged_info');
211
-				if($logged_info->is_admin == 'Y')
211
+				if ($logged_info->is_admin == 'Y')
212 212
 				{
213 213
 					$is_admin = TRUE;
214 214
 				}
@@ -223,13 +223,13 @@  discard block
 block discarded – undo
223 223
 			$is_admin = FALSE;
224 224
 		}
225 225
 
226
-		if(!$using_validation)
226
+		if (!$using_validation)
227 227
 		{
228 228
 			$obj->status = 1;
229 229
 		}
230 230
 		else
231 231
 		{
232
-			if($is_admin)
232
+			if ($is_admin)
233 233
 			{
234 234
 				$obj->status = 1;
235 235
 			}
@@ -242,14 +242,14 @@  discard block
 block discarded – undo
242 242
 
243 243
 		// call a trigger (before)
244 244
 		$output = ModuleHandler::triggerCall('comment.insertComment', 'before', $obj);
245
-		if(!$output->toBool())
245
+		if (!$output->toBool())
246 246
 		{
247 247
 			return $output;
248 248
 		}
249 249
 
250 250
 		// check if a posting of the corresponding document_srl exists
251 251
 		$document_srl = $obj->document_srl;
252
-		if(!$document_srl)
252
+		if (!$document_srl)
253 253
 		{
254 254
 			return new BaseObject(-1, 'msg_invalid_document');
255 255
 		}
@@ -258,36 +258,36 @@  discard block
 block discarded – undo
258 258
 		$oDocumentModel = getModel('document');
259 259
 
260 260
 		// even for manual_inserted if password exists, hash it.
261
-		if($obj->password)
261
+		if ($obj->password)
262 262
 		{
263 263
 			$obj->password = getModel('member')->hashPassword($obj->password);
264 264
 		}
265 265
 
266 266
 		// get the original posting
267
-		if(!$manual_inserted)
267
+		if (!$manual_inserted)
268 268
 		{
269 269
 			$oDocument = $oDocumentModel->getDocument($document_srl);
270 270
 
271
-			if($document_srl != $oDocument->document_srl)
271
+			if ($document_srl != $oDocument->document_srl)
272 272
 			{
273 273
 				return new BaseObject(-1, 'msg_invalid_document');
274 274
 			}
275
-			if($oDocument->isLocked())
275
+			if ($oDocument->isLocked())
276 276
 			{
277 277
 				return new BaseObject(-1, 'msg_invalid_request');
278 278
 			}
279 279
 
280
-			if($obj->homepage)
280
+			if ($obj->homepage)
281 281
 			{
282 282
 				$obj->homepage = escape($obj->homepage, false);
283
-				if(!preg_match('/^[a-z]+:\/\//i',$obj->homepage))
283
+				if (!preg_match('/^[a-z]+:\/\//i', $obj->homepage))
284 284
 				{
285 285
 					$obj->homepage = 'http://'.$obj->homepage;
286 286
 				}
287 287
 			}
288 288
 
289 289
 			// input the member's information if logged-in
290
-			if(Context::get('is_logged'))
290
+			if (Context::get('is_logged'))
291 291
 			{
292 292
 				$logged_info = Context::get('logged_info');
293 293
 				$obj->member_srl = $logged_info->member_srl;
@@ -302,16 +302,16 @@  discard block
 block discarded – undo
302 302
 		}
303 303
 
304 304
 		// error display if neither of log-in info and user name exist.
305
-		if(!$logged_info->member_srl && !$obj->nick_name)
305
+		if (!$logged_info->member_srl && !$obj->nick_name)
306 306
 		{
307 307
 			return new BaseObject(-1, 'msg_invalid_request');
308 308
 		}
309 309
 
310
-		if(!$obj->comment_srl)
310
+		if (!$obj->comment_srl)
311 311
 		{
312 312
 			$obj->comment_srl = getNextSequence();
313 313
 		}
314
-		elseif(!$is_admin && !$manual_inserted && !checkUserSequence($obj->comment_srl)) 
314
+		elseif (!$is_admin && !$manual_inserted && !checkUserSequence($obj->comment_srl)) 
315 315
 		{
316 316
 			return new BaseObject(-1, 'msg_not_permitted');
317 317
 		}
@@ -322,32 +322,32 @@  discard block
 block discarded – undo
322 322
 		// remove XE's own tags from the contents
323 323
 		$obj->content = preg_replace('!<\!--(Before|After)(Document|Comment)\(([0-9]+),([0-9]+)\)-->!is', '', $obj->content);
324 324
 
325
-		if(Mobile::isFromMobilePhone() && $obj->use_editor != 'Y')
325
+		if (Mobile::isFromMobilePhone() && $obj->use_editor != 'Y')
326 326
 		{
327
-			if($obj->use_html != 'Y')
327
+			if ($obj->use_html != 'Y')
328 328
 			{
329 329
 				$obj->content = htmlspecialchars($obj->content, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
330 330
 			}
331 331
 			$obj->content = nl2br($obj->content);
332 332
 		}
333 333
 
334
-		if(!$obj->regdate)
334
+		if (!$obj->regdate)
335 335
 		{
336 336
 			$obj->regdate = date("YmdHis");
337 337
 		}
338 338
 
339 339
 		// remove iframe and script if not a top administrator on the session.
340
-		if($logged_info->is_admin != 'Y')
340
+		if ($logged_info->is_admin != 'Y')
341 341
 		{
342 342
 			$obj->content = removeHackTag($obj->content);
343 343
 		}
344 344
 
345
-		if(!$obj->notify_message)
345
+		if (!$obj->notify_message)
346 346
 		{
347 347
 			$obj->notify_message = 'N';
348 348
 		}
349 349
 
350
-		if(!$obj->is_secret)
350
+		if (!$obj->is_secret)
351 351
 		{
352 352
 			$obj->is_secret = 'N';
353 353
 		}
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
 		$list_args->regdate = $obj->regdate;
365 365
 
366 366
 		// If parent comment doesn't exist, set data directly
367
-		if(!$obj->parent_srl)
367
+		if (!$obj->parent_srl)
368 368
 		{
369 369
 			$list_args->head = $list_args->arrange = $obj->comment_srl;
370 370
 			$list_args->depth = 0;
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
 			$parent_output = executeQuery('comment.getCommentListItem', $parent_args);
379 379
 
380 380
 			// return if no parent comment exists
381
-			if(!$parent_output->toBool() || !$parent_output->data)
381
+			if (!$parent_output->toBool() || !$parent_output->data)
382 382
 			{
383 383
 				return;
384 384
 			}
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
 			$list_args->depth = $parent->depth + 1;
390 390
 
391 391
 			// if the depth of comments is less than 2, execute insert.
392
-			if($list_args->depth < 2)
392
+			if ($list_args->depth < 2)
393 393
 			{
394 394
 				$list_args->arrange = $obj->comment_srl;
395 395
 				// if the depth of comments is greater than 2, execute update.
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
 				$p_args->depth = $parent->depth;
404 404
 				$output = executeQuery('comment.getCommentParentNextSibling', $p_args);
405 405
 
406
-				if($output->data->arrange)
406
+				if ($output->data->arrange)
407 407
 				{
408 408
 					$list_args->arrange = $output->data->arrange;
409 409
 					$output = executeQuery('comment.updateCommentListArrange', $list_args);
@@ -416,14 +416,14 @@  discard block
 block discarded – undo
416 416
 		}
417 417
 
418 418
 		$output = executeQuery('comment.insertCommentList', $list_args);
419
-		if(!$output->toBool())
419
+		if (!$output->toBool())
420 420
 		{
421 421
 			return $output;
422 422
 		}
423 423
 
424 424
 		// insert comment
425 425
 		$output = executeQuery('comment.insertComment', $obj);
426
-		if(!$output->toBool())
426
+		if (!$output->toBool())
427 427
 		{
428 428
 			$oDB->rollback();
429 429
 			return $output;
@@ -439,29 +439,29 @@  discard block
 block discarded – undo
439 439
 		$oDocumentController = getController('document');
440 440
 
441 441
 		// Update the number of comments in the post
442
-		if(!$using_validation)
442
+		if (!$using_validation)
443 443
 		{
444 444
 			$output = $oDocumentController->updateCommentCount($document_srl, $comment_count, $obj->nick_name, TRUE);
445 445
 		}
446 446
 		else
447 447
 		{
448
-			if($is_admin)
448
+			if ($is_admin)
449 449
 			{
450 450
 				$output = $oDocumentController->updateCommentCount($document_srl, $comment_count, $obj->nick_name, TRUE);
451 451
 			}
452 452
 		}
453 453
 
454 454
 		// grant autority of the comment
455
-		if(!$manual_inserted)
455
+		if (!$manual_inserted)
456 456
 		{
457 457
 			$this->addGrant($obj->comment_srl);
458 458
 		}
459 459
 
460 460
 		// call a trigger(after)
461
-		if($output->toBool())
461
+		if ($output->toBool())
462 462
 		{
463 463
 			$trigger_output = ModuleHandler::triggerCall('comment.insertComment', 'after', $obj);
464
-			if(!$trigger_output->toBool())
464
+			if (!$trigger_output->toBool())
465 465
 			{
466 466
 				$oDB->rollback();
467 467
 				return $trigger_output;
@@ -471,16 +471,16 @@  discard block
 block discarded – undo
471 471
 		// commit
472 472
 		$oDB->commit();
473 473
 
474
-		if(!$manual_inserted)
474
+		if (!$manual_inserted)
475 475
 		{
476 476
 			// send a message if notify_message option in enabled in the original article
477 477
 			$oDocument->notify(Context::getLang('comment'), $obj->content);
478 478
 
479 479
 			// send a message if notify_message option in enabled in the original comment
480
-			if($obj->parent_srl)
480
+			if ($obj->parent_srl)
481 481
 			{
482 482
 				$oParent = $oCommentModel->getComment($obj->parent_srl);
483
-				if($oParent->get('member_srl') != $oDocument->get('member_srl'))
483
+				if ($oParent->get('member_srl') != $oDocument->get('member_srl'))
484 484
 				{
485 485
 					$oParent->notify(Context::getLang('comment'), $obj->content);
486 486
 				}
@@ -508,7 +508,7 @@  discard block
 block discarded – undo
508 508
 		$oDocument = $oDocumentModel->getDocument($obj->document_srl);
509 509
 
510 510
 		$oMemberModel = getModel("member");
511
-		if(isset($obj->member_srl) && !is_null($obj->member_srl))
511
+		if (isset($obj->member_srl) && !is_null($obj->member_srl))
512 512
 		{
513 513
 			$member_info = $oMemberModel->getMemberInfoByMemberSrl($obj->member_srl);
514 514
 		}
@@ -528,47 +528,47 @@  discard block
 block discarded – undo
528 528
 		$module_info = $oModuleModel->getModuleInfoByDocumentSrl($obj->document_srl);
529 529
 
530 530
 		// If there is no problem to register comment then send an email to all admin were set in module admin panel
531
-		if($module_info->admin_mail && $member_info->is_admin != 'Y')
531
+		if ($module_info->admin_mail && $member_info->is_admin != 'Y')
532 532
 		{
533 533
 			$oMail = new Mail();
534 534
 			$oMail->setSender($obj->email_address, $obj->email_address);
535
-			$mail_title = "[XE - " . Context::get('mid') . "] A new comment was posted on document: \"" . $oDocument->getTitleText() . "\"";
535
+			$mail_title = "[XE - ".Context::get('mid')."] A new comment was posted on document: \"".$oDocument->getTitleText()."\"";
536 536
 			$oMail->setTitle($mail_title);
537
-			$url_comment = getFullUrl('','document_srl',$obj->document_srl).'#comment_'.$obj->comment_srl;
538
-			if($using_validation)
537
+			$url_comment = getFullUrl('', 'document_srl', $obj->document_srl).'#comment_'.$obj->comment_srl;
538
+			if ($using_validation)
539 539
 			{
540 540
 				$url_approve = getFullUrl('', 'module', 'admin', 'act', 'procCommentAdminChangePublishedStatusChecked', 'cart[]', $obj->comment_srl, 'will_publish', '1', 'search_target', 'is_published', 'search_keyword', 'N');
541 541
 				$url_trash = getFullUrl('', 'module', 'admin', 'act', 'procCommentAdminDeleteChecked', 'cart[]', $obj->comment_srl, 'search_target', 'is_trash', 'search_keyword', 'true');
542 542
 				$mail_content = "
543
-					A new comment on the document \"" . $oDocument->getTitleText() . "\" is waiting for your approval.
543
+					A new comment on the document \"" . $oDocument->getTitleText()."\" is waiting for your approval.
544 544
 					<br />
545 545
 					<br />
546
-					Author: " . $member_info->nick_name . "
547
-					<br />Author e-mail: " . $member_info->email_address . "
548
-					<br />From : <a href=\"" . $url_comment . "\">" . $url_comment . "</a>
546
+					Author: " . $member_info->nick_name."
547
+					<br />Author e-mail: " . $member_info->email_address."
548
+					<br />From : <a href=\"" . $url_comment."\">".$url_comment."</a>
549 549
 					<br />Comment:
550
-					<br />\"" . $obj->content . "\"
550
+					<br />\"" . $obj->content."\"
551 551
 					<br />Document:
552
-					<br />\"" . $oDocument->getContentText(). "\"
552
+					<br />\"" . $oDocument->getContentText()."\"
553 553
 					<br />
554 554
 					<br />
555
-					Approve it: <a href=\"" . $url_approve . "\">" . $url_approve . "</a>
556
-					<br />Trash it: <a href=\"" . $url_trash . "\">" . $url_trash . "</a>
557
-					<br />Currently " . $nr_comments_not_approved . " comments on \"" . Context::get('mid') . "\" module are waiting for approval. Please visit the moderation panel:
558
-					<br /><a href=\"" . getFullUrl('', 'module', 'admin', 'act', 'dispCommentAdminList', 'search_target', 'module', 'search_keyword', $obj->module_srl) . "\">" . getFullUrl('', 'module', 'admin', 'act', 'dispCommentAdminList', 'search_target', 'module', 'search_keyword', $obj->module_srl) . "</a>
555
+					Approve it: <a href=\"" . $url_approve."\">".$url_approve."</a>
556
+					<br />Trash it: <a href=\"" . $url_trash."\">".$url_trash."</a>
557
+					<br />Currently " . $nr_comments_not_approved." comments on \"".Context::get('mid')."\" module are waiting for approval. Please visit the moderation panel:
558
+					<br /><a href=\"" . getFullUrl('', 'module', 'admin', 'act', 'dispCommentAdminList', 'search_target', 'module', 'search_keyword', $obj->module_srl)."\">".getFullUrl('', 'module', 'admin', 'act', 'dispCommentAdminList', 'search_target', 'module', 'search_keyword', $obj->module_srl)."</a>
559 559
 					";
560 560
 				$oMail->setContent($mail_content);
561 561
 			}
562 562
 			else
563 563
 			{
564 564
 				$mail_content = "
565
-					Author: " . $member_info->nick_name . "
566
-					<br />Author e-mail: " . $member_info->email_address . "
567
-					<br />From : <a href=\"" . $url_comment . "\">" . $url_comment . "</a>
565
+					Author: " . $member_info->nick_name."
566
+					<br />Author e-mail: " . $member_info->email_address."
567
+					<br />From : <a href=\"" . $url_comment."\">".$url_comment."</a>
568 568
 					<br />Comment:
569
-					<br />\"" . $obj->content . "\"
569
+					<br />\"" . $obj->content."\"
570 570
 					<br />Document:
571
-					<br />\"" . $oDocument->getContentText(). "\"
571
+					<br />\"" . $oDocument->getContentText()."\"
572 572
 					";
573 573
 				$oMail->setContent($mail_content);
574 574
 
@@ -597,10 +597,10 @@  discard block
 block discarded – undo
597 597
 			$target_mail = explode(',', $admins_emails);
598 598
 
599 599
 			// send email to all admins - START
600
-			for($i = 0; $i < count($target_mail); $i++)
600
+			for ($i = 0; $i < count($target_mail); $i++)
601 601
 			{
602 602
 				$email_address = trim($target_mail[$i]);
603
-				if(!$email_address)
603
+				if (!$email_address)
604 604
 				{
605 605
 					continue;
606 606
 				}
@@ -646,12 +646,12 @@  discard block
 block discarded – undo
646 646
 	 */
647 647
 	function updateComment($obj, $is_admin = FALSE, $manual_updated = FALSE)
648 648
 	{
649
-		if(!$manual_updated && !checkCSRF())
649
+		if (!$manual_updated && !checkCSRF())
650 650
 		{
651 651
 			return new BaseObject(-1, 'msg_invalid_request');
652 652
 		}
653 653
 
654
-		if(!is_object($obj))
654
+		if (!is_object($obj))
655 655
 		{
656 656
 			$obj = new stdClass();
657 657
 		}
@@ -660,7 +660,7 @@  discard block
 block discarded – undo
660 660
 
661 661
 		// call a trigger (before)
662 662
 		$output = ModuleHandler::triggerCall('comment.updateComment', 'before', $obj);
663
-		if(!$output->toBool())
663
+		if (!$output->toBool())
664 664
 		{
665 665
 			return $output;
666 666
 		}
@@ -670,7 +670,7 @@  discard block
 block discarded – undo
670 670
 
671 671
 		// get the original data
672 672
 		$source_obj = $oCommentModel->getComment($obj->comment_srl);
673
-		if(!$source_obj->getMemberSrl())
673
+		if (!$source_obj->getMemberSrl())
674 674
 		{
675 675
 			$obj->member_srl = $source_obj->get('member_srl');
676 676
 			$obj->user_name = $source_obj->get('user_name');
@@ -680,30 +680,30 @@  discard block
 block discarded – undo
680 680
 		}
681 681
 
682 682
 		// check if permission is granted
683
-		if(!$is_admin && !$source_obj->isGranted())
683
+		if (!$is_admin && !$source_obj->isGranted())
684 684
 		{
685 685
 			return new BaseObject(-1, 'msg_not_permitted');
686 686
 		}
687 687
 
688
-		if($obj->password)
688
+		if ($obj->password)
689 689
 		{
690 690
 			$obj->password = getModel('member')->hashPassword($obj->password);
691 691
 		}
692 692
 
693
-		if($obj->homepage) 
693
+		if ($obj->homepage) 
694 694
 		{
695 695
 			$obj->homepage = escape($obj->homepage);
696
-			if(!preg_match('/^[a-z]+:\/\//i',$obj->homepage))
696
+			if (!preg_match('/^[a-z]+:\/\//i', $obj->homepage))
697 697
 			{
698 698
 				$obj->homepage = 'http://'.$obj->homepage;
699 699
 			}
700 700
 		}
701 701
 
702 702
 		// set modifier's information if logged-in and posting author and modifier are matched.
703
-		if(Context::get('is_logged'))
703
+		if (Context::get('is_logged'))
704 704
 		{
705 705
 			$logged_info = Context::get('logged_info');
706
-			if($source_obj->member_srl == $logged_info->member_srl)
706
+			if ($source_obj->member_srl == $logged_info->member_srl)
707 707
 			{
708 708
 				$obj->member_srl = $logged_info->member_srl;
709 709
 				$obj->user_name = $logged_info->user_name;
@@ -714,7 +714,7 @@  discard block
 block discarded – undo
714 714
 		}
715 715
 
716 716
 		// if nick_name of the logged-in author doesn't exist
717
-		if($source_obj->get('member_srl') && !$obj->nick_name)
717
+		if ($source_obj->get('member_srl') && !$obj->nick_name)
718 718
 		{
719 719
 			$obj->member_srl = $source_obj->get('member_srl');
720 720
 			$obj->user_name = $source_obj->get('user_name');
@@ -723,7 +723,7 @@  discard block
 block discarded – undo
723 723
 			$obj->homepage = $source_obj->get('homepage');
724 724
 		}
725 725
 
726
-		if(!$obj->content)
726
+		if (!$obj->content)
727 727
 		{
728 728
 			$obj->content = $source_obj->get('content');
729 729
 		}
@@ -731,9 +731,9 @@  discard block
 block discarded – undo
731 731
 		// remove XE's wn tags from contents
732 732
 		$obj->content = preg_replace('!<\!--(Before|After)(Document|Comment)\(([0-9]+),([0-9]+)\)-->!is', '', $obj->content);
733 733
 
734
-		if(Mobile::isFromMobilePhone() && $obj->use_editor != 'Y')
734
+		if (Mobile::isFromMobilePhone() && $obj->use_editor != 'Y')
735 735
 		{
736
-			if($obj->use_html != 'Y')
736
+			if ($obj->use_html != 'Y')
737 737
 			{
738 738
 				$obj->content = htmlspecialchars($obj->content, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
739 739
 			}
@@ -741,7 +741,7 @@  discard block
 block discarded – undo
741 741
 		}
742 742
 
743 743
 		// remove iframe and script if not a top administrator on the session
744
-		if($logged_info->is_admin != 'Y')
744
+		if ($logged_info->is_admin != 'Y')
745 745
 		{
746 746
 			$obj->content = removeHackTag($obj->content);
747 747
 		}
@@ -752,17 +752,17 @@  discard block
 block discarded – undo
752 752
 
753 753
 		// Update
754 754
 		$output = executeQuery('comment.updateComment', $obj);
755
-		if(!$output->toBool())
755
+		if (!$output->toBool())
756 756
 		{
757 757
 			$oDB->rollback();
758 758
 			return $output;
759 759
 		}
760 760
 
761 761
 		// call a trigger (after)
762
-		if($output->toBool())
762
+		if ($output->toBool())
763 763
 		{
764 764
 			$trigger_output = ModuleHandler::triggerCall('comment.updateComment', 'after', $obj);
765
-			if(!$trigger_output->toBool())
765
+			if (!$trigger_output->toBool())
766 766
 			{
767 767
 				$oDB->rollback();
768 768
 				return $trigger_output;
@@ -791,7 +791,7 @@  discard block
 block discarded – undo
791 791
 
792 792
 		// check if comment already exists
793 793
 		$comment = $oCommentModel->getComment($comment_srl);
794
-		if($comment->comment_srl != $comment_srl)
794
+		if ($comment->comment_srl != $comment_srl)
795 795
 		{
796 796
 			return new BaseObject(-1, 'msg_invalid_request');
797 797
 		}
@@ -800,28 +800,28 @@  discard block
 block discarded – undo
800 800
 
801 801
 		// call a trigger (before)
802 802
 		$output = ModuleHandler::triggerCall('comment.deleteComment', 'before', $comment);
803
-		if(!$output->toBool())
803
+		if (!$output->toBool())
804 804
 		{
805 805
 			return $output;
806 806
 		}
807 807
 
808 808
 		// check if permission is granted
809
-		if(!$is_admin && !$comment->isGranted())
809
+		if (!$is_admin && !$comment->isGranted())
810 810
 		{
811 811
 			return new BaseObject(-1, 'msg_not_permitted');
812 812
 		}
813 813
 
814 814
 		// check if child comment exists on the comment
815 815
 		$childs = $oCommentModel->getChildComments($comment_srl);
816
-		if(count($childs) > 0)
816
+		if (count($childs) > 0)
817 817
 		{
818 818
 			$deleteAllComment = TRUE;
819
-			if(!$is_admin)
819
+			if (!$is_admin)
820 820
 			{
821 821
 				$logged_info = Context::get('logged_info');
822
-				foreach($childs as $val)
822
+				foreach ($childs as $val)
823 823
 				{
824
-					if($val->member_srl != $logged_info->member_srl)
824
+					if ($val->member_srl != $logged_info->member_srl)
825 825
 					{
826 826
 						$deleteAllComment = FALSE;
827 827
 						break;
@@ -829,16 +829,16 @@  discard block
 block discarded – undo
829 829
 				}
830 830
 			}
831 831
 
832
-			if(!$deleteAllComment)
832
+			if (!$deleteAllComment)
833 833
 			{
834 834
 				return new BaseObject(-1, 'fail_to_delete_have_children');
835 835
 			}
836 836
 			else
837 837
 			{
838
-				foreach($childs as $val)
838
+				foreach ($childs as $val)
839 839
 				{
840 840
 					$output = $this->deleteComment($val->comment_srl, $is_admin, $isMoveToTrash);
841
-					if(!$output->toBool())
841
+					if (!$output->toBool())
842 842
 					{
843 843
 						return $output;
844 844
 					}
@@ -854,7 +854,7 @@  discard block
 block discarded – undo
854 854
 		$args = new stdClass();
855 855
 		$args->comment_srl = $comment_srl;
856 856
 		$output = executeQuery('comment.deleteComment', $args);
857
-		if(!$output->toBool())
857
+		if (!$output->toBool())
858 858
 		{
859 859
 			$oDB->rollback();
860 860
 			return $output;
@@ -866,14 +866,14 @@  discard block
 block discarded – undo
866 866
 		$comment_count = $oCommentModel->getCommentCount($document_srl);
867 867
 
868 868
 		// only document is exists
869
-		if(isset($comment_count))
869
+		if (isset($comment_count))
870 870
 		{
871 871
 			// create the controller object of the document
872 872
 			$oDocumentController = getController('document');
873 873
 
874 874
 			// update comment count of the article posting
875 875
 			$output = $oDocumentController->updateCommentCount($document_srl, $comment_count, NULL, FALSE);
876
-			if(!$output->toBool())
876
+			if (!$output->toBool())
877 877
 			{
878 878
 				$oDB->rollback();
879 879
 				return $output;
@@ -881,11 +881,11 @@  discard block
 block discarded – undo
881 881
 		}
882 882
 
883 883
 		// call a trigger (after)
884
-		if($output->toBool())
884
+		if ($output->toBool())
885 885
 		{
886 886
 			$comment->isMoveToTrash = $isMoveToTrash;
887 887
 			$trigger_output = ModuleHandler::triggerCall('comment.deleteComment', 'after', $comment);
888
-			if(!$trigger_output->toBool())
888
+			if (!$trigger_output->toBool())
889 889
 			{
890 890
 				$oDB->rollback();
891 891
 				return $trigger_output;
@@ -893,7 +893,7 @@  discard block
 block discarded – undo
893 893
 			unset($comment->isMoveToTrash);
894 894
 		}
895 895
 
896
-		if(!$isMoveToTrash)
896
+		if (!$isMoveToTrash)
897 897
 		{
898 898
 			$this->_deleteDeclaredComments($args);
899 899
 			$this->_deleteVotedComments($args);
@@ -937,7 +937,7 @@  discard block
 block discarded – undo
937 937
 		$oCommentModel = getModel('comment');
938 938
 
939 939
 		// check if permission is granted
940
-		if(is_object($obj))
940
+		if (is_object($obj))
941 941
 		{
942 942
 			$oDocument = new documentItem();
943 943
 			$oDocument->setAttribute($obj);
@@ -947,7 +947,7 @@  discard block
 block discarded – undo
947 947
 			$oDocument = $oDocumentModel->getDocument($document_srl);
948 948
 		}
949 949
 
950
-		if(!$oDocument->isExists() || !$oDocument->isGranted())
950
+		if (!$oDocument->isExists() || !$oDocument->isGranted())
951 951
 		{
952 952
 			return new BaseObject(-1, 'msg_not_permitted');
953 953
 		}
@@ -956,23 +956,23 @@  discard block
 block discarded – undo
956 956
 		$args = new stdClass();
957 957
 		$args->document_srl = $document_srl;
958 958
 		$comments = executeQueryArray('comment.getAllComments', $args);
959
-		if($comments->data)
959
+		if ($comments->data)
960 960
 		{
961 961
 			$commentSrlList = array();
962
-			foreach($comments->data as $comment)
962
+			foreach ($comments->data as $comment)
963 963
 			{
964 964
 				$commentSrlList[] = $comment->comment_srl;
965 965
 
966 966
 				// call a trigger (before)
967 967
 				$output = ModuleHandler::triggerCall('comment.deleteComment', 'before', $comment);
968
-				if(!$output->toBool())
968
+				if (!$output->toBool())
969 969
 				{
970 970
 					continue;
971 971
 				}
972 972
 
973 973
 				// call a trigger (after)
974 974
 				$output = ModuleHandler::triggerCall('comment.deleteComment', 'after', $comment);
975
-				if(!$output->toBool())
975
+				if (!$output->toBool())
976 976
 				{
977 977
 					continue;
978 978
 				}
@@ -982,7 +982,7 @@  discard block
 block discarded – undo
982 982
 		// delete the comment
983 983
 		$args->document_srl = $document_srl;
984 984
 		$output = executeQuery('comment.deleteComments', $args);
985
-		if(!$output->toBool())
985
+		if (!$output->toBool())
986 986
 		{
987 987
 			return $output;
988 988
 		}
@@ -991,7 +991,7 @@  discard block
 block discarded – undo
991 991
 		$output = executeQuery('comment.deleteCommentsList', $args);
992 992
 
993 993
 		//delete declared, declared_log, voted_log
994
-		if(is_array($commentSrlList) && count($commentSrlList) > 0)
994
+		if (is_array($commentSrlList) && count($commentSrlList) > 0)
995 995
 		{
996 996
 			$args = new stdClass();
997 997
 			$args->comment_srl = join(',', $commentSrlList);
@@ -1031,7 +1031,7 @@  discard block
 block discarded – undo
1031 1031
 	 */
1032 1032
 	function updateVotedCount($comment_srl, $point = 1)
1033 1033
 	{
1034
-		if($point > 0)
1034
+		if ($point > 0)
1035 1035
 		{
1036 1036
 			$failed_voted = 'failed_voted';
1037 1037
 			$success_message = 'success_voted';
@@ -1043,7 +1043,7 @@  discard block
 block discarded – undo
1043 1043
 		}
1044 1044
 
1045 1045
 		// invalid vote if vote info exists in the session info.
1046
-		if($_SESSION['voted_comment'][$comment_srl])
1046
+		if ($_SESSION['voted_comment'][$comment_srl])
1047 1047
 		{
1048 1048
 			return new BaseObject(-1, $failed_voted);
1049 1049
 		}
@@ -1052,21 +1052,21 @@  discard block
 block discarded – undo
1052 1052
 		$oComment = $oCommentModel->getComment($comment_srl, FALSE, FALSE);
1053 1053
 
1054 1054
 		// invalid vote if both ip addresses between author's and the current user are same.
1055
-		if($oComment->get('ipaddress') == $_SERVER['REMOTE_ADDR'])
1055
+		if ($oComment->get('ipaddress') == $_SERVER['REMOTE_ADDR'])
1056 1056
 		{
1057 1057
 			$_SESSION['voted_comment'][$comment_srl] = TRUE;
1058 1058
 			return new BaseObject(-1, $failed_voted);
1059 1059
 		}
1060 1060
 
1061 1061
 		// if the comment author is a member
1062
-		if($oComment->get('member_srl'))
1062
+		if ($oComment->get('member_srl'))
1063 1063
 		{
1064 1064
 			// create the member model object
1065 1065
 			$oMemberModel = getModel('member');
1066 1066
 			$member_srl = $oMemberModel->getLoggedMemberSrl();
1067 1067
 
1068 1068
 			// session registered if the author information matches to the current logged-in user's.
1069
-			if($member_srl && $member_srl == abs($oComment->get('member_srl')))
1069
+			if ($member_srl && $member_srl == abs($oComment->get('member_srl')))
1070 1070
 			{
1071 1071
 				$_SESSION['voted_comment'][$comment_srl] = TRUE;
1072 1072
 				return new BaseObject(-1, $failed_voted);
@@ -1076,7 +1076,7 @@  discard block
 block discarded – undo
1076 1076
 		$args = new stdClass();
1077 1077
 
1078 1078
 		// If logged-in, use the member_srl. otherwise use the ipaddress.
1079
-		if($member_srl)
1079
+		if ($member_srl)
1080 1080
 		{
1081 1081
 			$args->member_srl = $member_srl;
1082 1082
 		}
@@ -1089,7 +1089,7 @@  discard block
 block discarded – undo
1089 1089
 		$output = executeQuery('comment.getCommentVotedLogInfo', $args);
1090 1090
 
1091 1091
 		// session registered if log info contains recommendation vote log.
1092
-		if($output->data->count)
1092
+		if ($output->data->count)
1093 1093
 		{
1094 1094
 			$_SESSION['voted_comment'][$comment_srl] = TRUE;
1095 1095
 			return new BaseObject(-1, $failed_voted);
@@ -1106,7 +1106,7 @@  discard block
 block discarded – undo
1106 1106
 		$trigger_obj->before_point = ($point < 0) ? $oComment->get('blamed_count') : $oComment->get('voted_count');
1107 1107
 		$trigger_obj->after_point = $trigger_obj->before_point + $point;
1108 1108
 		$trigger_output = ModuleHandler::triggerCall('comment.updateVotedCount', 'before', $trigger_obj);
1109
-		if(!$trigger_output->toBool())
1109
+		if (!$trigger_output->toBool())
1110 1110
 		{
1111 1111
 			return $trigger_output;
1112 1112
 		}
@@ -1116,7 +1116,7 @@  discard block
 block discarded – undo
1116 1116
 		$oDB->begin();
1117 1117
 
1118 1118
 		// update the number of votes
1119
-		if($trigger_obj->update_target === 'blamed_count')
1119
+		if ($trigger_obj->update_target === 'blamed_count')
1120 1120
 		{
1121 1121
 			$args->blamed_count = $trigger_obj->after_point;
1122 1122
 			$output = executeQuery('comment.updateBlamedCount', $args);
@@ -1133,7 +1133,7 @@  discard block
 block discarded – undo
1133 1133
 
1134 1134
 		// Call a trigger (after)
1135 1135
 		$trigger_output = ModuleHandler::triggerCall('comment.updateVotedCount', 'after', $trigger_obj);
1136
-		if(!$trigger_output->toBool())
1136
+		if (!$trigger_output->toBool())
1137 1137
 		{
1138 1138
 			$oDB->rollback();
1139 1139
 			return $trigger_output;
@@ -1146,7 +1146,7 @@  discard block
 block discarded – undo
1146 1146
 
1147 1147
 		// Return the result
1148 1148
 		$output = new BaseObject(0, $success_message);
1149
-		if($trigger_obj->update_target === 'voted_count')
1149
+		if ($trigger_obj->update_target === 'voted_count')
1150 1150
 		{
1151 1151
 			$output->add('voted_count', $trigger_obj->after_point);
1152 1152
 		}
@@ -1166,7 +1166,7 @@  discard block
 block discarded – undo
1166 1166
 	function declaredComment($comment_srl)
1167 1167
 	{
1168 1168
 		// Fail if session information already has a reported document
1169
-		if($_SESSION['declared_comment'][$comment_srl])
1169
+		if ($_SESSION['declared_comment'][$comment_srl])
1170 1170
 		{
1171 1171
 			return new BaseObject(-1, 'failed_declared');
1172 1172
 		}
@@ -1175,7 +1175,7 @@  discard block
 block discarded – undo
1175 1175
 		$args = new stdClass();
1176 1176
 		$args->comment_srl = $comment_srl;
1177 1177
 		$output = executeQuery('comment.getDeclaredComment', $args);
1178
-		if(!$output->toBool())
1178
+		if (!$output->toBool())
1179 1179
 		{
1180 1180
 			return $output;
1181 1181
 		}
@@ -1187,7 +1187,7 @@  discard block
 block discarded – undo
1187 1187
 
1188 1188
 		// Call a trigger (before)
1189 1189
 		$trigger_output = ModuleHandler::triggerCall('comment.declaredComment', 'before', $trigger_obj);
1190
-		if(!$trigger_output->toBool())
1190
+		if (!$trigger_output->toBool())
1191 1191
 		{
1192 1192
 			return $trigger_output;
1193 1193
 		}
@@ -1197,21 +1197,21 @@  discard block
 block discarded – undo
1197 1197
 		$oComment = $oCommentModel->getComment($comment_srl, FALSE, FALSE);
1198 1198
 
1199 1199
 		// failed if both ip addresses between author's and the current user are same.
1200
-		if($oComment->get('ipaddress') == $_SERVER['REMOTE_ADDR'])
1200
+		if ($oComment->get('ipaddress') == $_SERVER['REMOTE_ADDR'])
1201 1201
 		{
1202 1202
 			$_SESSION['declared_comment'][$comment_srl] = TRUE;
1203 1203
 			return new BaseObject(-1, 'failed_declared');
1204 1204
 		}
1205 1205
 
1206 1206
 		// if the comment author is a member
1207
-		if($oComment->get('member_srl'))
1207
+		if ($oComment->get('member_srl'))
1208 1208
 		{
1209 1209
 			// create the member model object
1210 1210
 			$oMemberModel = getModel('member');
1211 1211
 			$member_srl = $oMemberModel->getLoggedMemberSrl();
1212 1212
 
1213 1213
 			// session registered if the author information matches to the current logged-in user's.
1214
-			if($member_srl && $member_srl == abs($oComment->get('member_srl')))
1214
+			if ($member_srl && $member_srl == abs($oComment->get('member_srl')))
1215 1215
 			{
1216 1216
 				$_SESSION['declared_comment'][$comment_srl] = TRUE;
1217 1217
 				return new BaseObject(-1, 'failed_declared');
@@ -1219,7 +1219,7 @@  discard block
 block discarded – undo
1219 1219
 		}
1220 1220
 
1221 1221
 		// If logged-in, use the member_srl. otherwise use the ipaddress.
1222
-		if($member_srl)
1222
+		if ($member_srl)
1223 1223
 		{
1224 1224
 			$args->member_srl = $member_srl;
1225 1225
 		}
@@ -1231,7 +1231,7 @@  discard block
 block discarded – undo
1231 1231
 		$log_output = executeQuery('comment.getCommentDeclaredLogInfo', $args);
1232 1232
 
1233 1233
 		// session registered if log info contains report log.
1234
-		if($log_output->data->count)
1234
+		if ($log_output->data->count)
1235 1235
 		{
1236 1236
 			$_SESSION['declared_comment'][$comment_srl] = TRUE;
1237 1237
 			return new BaseObject(-1, 'failed_declared');
@@ -1242,7 +1242,7 @@  discard block
 block discarded – undo
1242 1242
 		$oDB->begin();
1243 1243
 
1244 1244
 		// execute insert
1245
-		if($output->data->declared_count > 0)
1245
+		if ($output->data->declared_count > 0)
1246 1246
 		{
1247 1247
 			$output = executeQuery('comment.updateDeclaredComment', $args);
1248 1248
 		}
@@ -1251,7 +1251,7 @@  discard block
 block discarded – undo
1251 1251
 			$output = executeQuery('comment.insertDeclaredComment', $args);
1252 1252
 		}
1253 1253
 
1254
-		if(!$output->toBool())
1254
+		if (!$output->toBool())
1255 1255
 		{
1256 1256
 			$oDB->rollback();
1257 1257
 			return $output;
@@ -1263,7 +1263,7 @@  discard block
 block discarded – undo
1263 1263
 		// Call a trigger (after)
1264 1264
 		$trigger_obj->declared_count = $declared_count + 1;
1265 1265
 		$trigger_output = ModuleHandler::triggerCall('comment.declaredComment', 'after', $trigger_obj);
1266
-		if(!$trigger_output->toBool())
1266
+		if (!$trigger_output->toBool())
1267 1267
 		{
1268 1268
 			$oDB->rollback();
1269 1269
 			return $trigger_output;
@@ -1288,7 +1288,7 @@  discard block
 block discarded – undo
1288 1288
 	function addCommentPopupMenu($url, $str, $icon = '', $target = 'self')
1289 1289
 	{
1290 1290
 		$comment_popup_menu_list = Context::get('comment_popup_menu_list');
1291
-		if(!is_array($comment_popup_menu_list))
1291
+		if (!is_array($comment_popup_menu_list))
1292 1292
 		{
1293 1293
 			$comment_popup_menu_list = array();
1294 1294
 		}
@@ -1310,7 +1310,7 @@  discard block
 block discarded – undo
1310 1310
 	function procCommentInsertModuleConfig()
1311 1311
 	{
1312 1312
 		$module_srl = Context::get('target_module_srl');
1313
-		if(preg_match('/^([0-9,]+)$/', $module_srl))
1313
+		if (preg_match('/^([0-9,]+)$/', $module_srl))
1314 1314
 		{
1315 1315
 			$module_srl = explode(',', $module_srl);
1316 1316
 		}
@@ -1321,33 +1321,33 @@  discard block
 block discarded – undo
1321 1321
 
1322 1322
 		$comment_config = new stdClass();
1323 1323
 		$comment_config->comment_count = (int) Context::get('comment_count');
1324
-		if(!$comment_config->comment_count)
1324
+		if (!$comment_config->comment_count)
1325 1325
 		{
1326 1326
 			$comment_config->comment_count = 50;
1327 1327
 		}
1328 1328
 
1329 1329
 		$comment_config->use_vote_up = Context::get('use_vote_up');
1330
-		if(!$comment_config->use_vote_up)
1330
+		if (!$comment_config->use_vote_up)
1331 1331
 		{
1332 1332
 			$comment_config->use_vote_up = 'Y';
1333 1333
 		}
1334 1334
 
1335 1335
 		$comment_config->use_vote_down = Context::get('use_vote_down');
1336
-		if(!$comment_config->use_vote_down)
1336
+		if (!$comment_config->use_vote_down)
1337 1337
 		{
1338 1338
 			$comment_config->use_vote_down = 'Y';
1339 1339
 		}
1340 1340
 
1341 1341
 		$comment_config->use_comment_validation = Context::get('use_comment_validation');
1342
-		if(!$comment_config->use_comment_validation)
1342
+		if (!$comment_config->use_comment_validation)
1343 1343
 		{
1344 1344
 			$comment_config->use_comment_validation = 'N';
1345 1345
 		}
1346 1346
 
1347
-		for($i = 0; $i < count($module_srl); $i++)
1347
+		for ($i = 0; $i < count($module_srl); $i++)
1348 1348
 		{
1349 1349
 			$srl = trim($module_srl[$i]);
1350
-			if(!$srl)
1350
+			if (!$srl)
1351 1351
 			{
1352 1352
 				continue;
1353 1353
 			}
@@ -1381,25 +1381,25 @@  discard block
 block discarded – undo
1381 1381
 	 */
1382 1382
 	function procCommentGetList()
1383 1383
 	{
1384
-		if(!Context::get('is_logged'))
1384
+		if (!Context::get('is_logged'))
1385 1385
 		{
1386 1386
 			return new BaseObject(-1, 'msg_not_permitted');
1387 1387
 		}
1388 1388
 
1389 1389
 		$commentSrls = Context::get('comment_srls');
1390
-		if($commentSrls)
1390
+		if ($commentSrls)
1391 1391
 		{
1392 1392
 			$commentSrlList = explode(',', $commentSrls);
1393 1393
 		}
1394 1394
 
1395
-		if(count($commentSrlList) > 0)
1395
+		if (count($commentSrlList) > 0)
1396 1396
 		{
1397 1397
 			$oCommentModel = getModel('comment');
1398 1398
 			$commentList = $oCommentModel->getComments($commentSrlList);
1399 1399
 
1400
-			if(is_array($commentList))
1400
+			if (is_array($commentList))
1401 1401
 			{
1402
-				foreach($commentList as $value)
1402
+				foreach ($commentList as $value)
1403 1403
 				{
1404 1404
 					$value->content = strip_tags($value->content);
1405 1405
 				}
@@ -1424,9 +1424,9 @@  discard block
 block discarded – undo
1424 1424
 		$commentConfig = $oModuleModel->getModulePartConfig('comment', $obj->originModuleSrl);
1425 1425
 
1426 1426
 		$oModuleController = getController('module');
1427
-		if(is_array($obj->moduleSrlList))
1427
+		if (is_array($obj->moduleSrlList))
1428 1428
 		{
1429
-			foreach($obj->moduleSrlList as $moduleSrl)
1429
+			foreach ($obj->moduleSrlList as $moduleSrl)
1430 1430
 			{
1431 1431
 				$oModuleController->insertModulePartConfig('comment', $moduleSrl, $commentConfig);
1432 1432
 			}
Please login to merge, or discard this patch.
modules/comment/comment.model.php 2 patches
Braces   +15 added lines, -20 removed lines patch added patch discarded remove patch
@@ -308,14 +308,12 @@  discard block
 block discarded – undo
308 308
 			{
309 309
 				$args->status = 1;
310 310
 			}
311
-		}
312
-		else
311
+		} else
313 312
 		{
314 313
 			if($published)
315 314
 			{
316 315
 				$args->status = 1;
317
-			}
318
-			else
316
+			} else
319 317
 			{
320 318
 				$args->status = 0;
321 319
 			}
@@ -379,8 +377,7 @@  discard block
 block discarded – undo
379 377
 		if(is_array($obj->module_srl))
380 378
 		{
381 379
 			$args->module_srl = implode(',', $obj->module_srl);
382
-		}
383
-		else
380
+		} else
384 381
 		{
385 382
 			$args->module_srl = $obj->module_srl;
386 383
 		}
@@ -481,8 +478,7 @@  discard block
 block discarded – undo
481 478
 			{
482 479
 				$comment_count = 50;
483 480
 			}
484
-		}
485
-		else
481
+		} else
486 482
 		{
487 483
 			$comment_count = $count;
488 484
 		}
@@ -591,8 +587,7 @@  discard block
 block discarded – undo
591 587
 			if($parent_srl)
592 588
 			{
593 589
 				$list[$parent_srl]->child[] = &$list[$comment_srl];
594
-			}
595
-			else
590
+			} else
596 591
 			{
597 592
 				$root->child[] = &$list[$comment_srl];
598 593
 			}
@@ -641,8 +636,7 @@  discard block
 block discarded – undo
641 636
 			if($parent)
642 637
 			{
643 638
 				$val->head = $parent->head;
644
-			}
645
-			else
639
+			} else
646 640
 			{
647 641
 				$val->head = $val->comment_srl;
648 642
 			}
@@ -655,8 +649,7 @@  discard block
 block discarded – undo
655 649
 				$comment_list[$val->comment_srl] = $val;
656 650
 				$this->_arrangeComment($comment_list, $val->child, $depth + 1, $val);
657 651
 				unset($val->child);
658
-			}
659
-			else
652
+			} else
660 653
 			{
661 654
 				$val->depth = $depth;
662 655
 				$comment_list[$val->comment_srl] = $val;
@@ -984,8 +977,7 @@  discard block
 block discarded – undo
984 977
 			}
985 978
 
986 979
 			$args->below_point = 0;
987
-		}
988
-		else
980
+		} else
989 981
 		{
990 982
 			if($comment_config->use_vote_up != 'S')
991 983
 			{
@@ -1026,8 +1018,7 @@  discard block
 block discarded – undo
1026 1018
 		if(!isset($lang->secret_name_list))
1027 1019
 		{
1028 1020
 			return array('Y' => 'Secret', 'N' => 'Public');
1029
-		}
1030
-		else
1021
+		} else
1031 1022
 		{
1032 1023
 			return $lang->secret_name_list;
1033 1024
 		}
@@ -1064,8 +1055,12 @@  discard block
 block discarded – undo
1064 1055
 		$output = executeQuery('comment.getCommentListByMemberSrl', $args, $columnList);
1065 1056
 		$comment_list = $output->data;
1066 1057
 
1067
-		if(!$comment_list) return array();
1068
-		if(!is_array($comment_list)) $comment_list = array($comment_list);
1058
+		if(!$comment_list) {
1059
+			return array();
1060
+		}
1061
+		if(!is_array($comment_list)) {
1062
+			$comment_list = array($comment_list);
1063
+		}
1069 1064
 
1070 1065
 		return $comment_list;
1071 1066
 
Please login to merge, or discard this patch.
Spacing   +99 added lines, -99 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 		$oCommentController = getController('comment');
44 44
 
45 45
 		// feature that only member can do
46
-		if($logged_info->member_srl)
46
+		if ($logged_info->member_srl)
47 47
 		{
48 48
 			$oCommentModel = getModel('comment');
49 49
 			$columnList = array('comment_srl', 'module_srl', 'member_srl', 'ipaddress');
@@ -54,14 +54,14 @@  discard block
 block discarded – undo
54 54
 			$oModuleModel = getModel('module');
55 55
 			$comment_config = $oModuleModel->getModulePartConfig('document', $module_srl);
56 56
 
57
-			if($comment_config->use_vote_up != 'N' && $member_srl != $logged_info->member_srl)
57
+			if ($comment_config->use_vote_up != 'N' && $member_srl != $logged_info->member_srl)
58 58
 			{
59 59
 				// Add a vote-up button for positive feedback
60 60
 				$url = sprintf("doCallModuleAction('comment','procCommentVoteUp','%s')", $comment_srl);
61 61
 				$oCommentController->addCommentPopupMenu($url, 'cmd_vote', '', 'javascript');
62 62
 			}
63 63
 
64
-			if($comment_config->use_vote_down != 'N' && $member_srl != $logged_info->member_srl)
64
+			if ($comment_config->use_vote_down != 'N' && $member_srl != $logged_info->member_srl)
65 65
 			{
66 66
 				// Add a vote-down button for negative feedback
67 67
 				$url = sprintf("doCallModuleAction('comment','procCommentVoteDown','%s')", $comment_srl);
@@ -76,20 +76,20 @@  discard block
 block discarded – undo
76 76
 		// call a trigger (after)
77 77
 		ModuleHandler::triggerCall('comment.getCommentMenu', 'after', $menu_list);
78 78
 
79
-		if($this->grant->manager){
79
+		if ($this->grant->manager) {
80 80
 			$str_confirm = Context::getLang('confirm_move');
81 81
 			$url = sprintf("if(!confirm('%s')) return; var params = new Array(); params['comment_srl']='%s'; params['mid']=current_mid;params['cur_url']=current_url; exec_xml('comment', 'procCommentAdminMoveToTrash', params)", $str_confirm, $comment_srl);
82
-			$oCommentController->addCommentPopupMenu($url,'cmd_trash','','javascript');
82
+			$oCommentController->addCommentPopupMenu($url, 'cmd_trash', '', 'javascript');
83 83
 
84 84
 		}
85 85
 
86 86
 		// find a comment by IP matching if an administrator.
87
-		if($logged_info->is_admin == 'Y')
87
+		if ($logged_info->is_admin == 'Y')
88 88
 		{
89 89
 			$oCommentModel = getModel('comment');
90 90
 			$oComment = $oCommentModel->getComment($comment_srl);
91 91
 
92
-			if($oComment->isExists())
92
+			if ($oComment->isExists())
93 93
 			{
94 94
 				// Find a post of the corresponding ip address
95 95
 				$url = getUrl('', 'module', 'admin', 'act', 'dispCommentAdminList', 'search_target', 'ipaddress', 'search_keyword', $oComment->getIpAddress());
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 		$menus = Context::get('comment_popup_menu_list');
105 105
 		$menus_count = count($menus);
106 106
 
107
-		for($i = 0; $i < $menus_count; $i++)
107
+		for ($i = 0; $i < $menus_count; $i++)
108 108
 		{
109 109
 			$menus[$i]->str = Context::getLang($menus[$i]->str);
110 110
 		}
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 	function getComment($comment_srl = 0, $is_admin = FALSE, $columnList = array())
161 161
 	{
162 162
 		$oComment = new commentItem($comment_srl, $columnList);
163
-		if($is_admin)
163
+		if ($is_admin)
164 164
 		{
165 165
 			$oComment->setGrant();
166 166
 		}
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 	 */
177 177
 	function getComments($comment_srl_list, $columnList = array())
178 178
 	{
179
-		if(is_array($comment_srl_list))
179
+		if (is_array($comment_srl_list))
180 180
 		{
181 181
 			$comment_srls = implode(',', $comment_srl_list);
182 182
 		}
@@ -185,25 +185,25 @@  discard block
 block discarded – undo
185 185
 		$args = new stdClass();
186 186
 		$args->comment_srls = $comment_srls;
187 187
 		$output = executeQuery('comment.getComments', $args, $columnList);
188
-		if(!$output->toBool())
188
+		if (!$output->toBool())
189 189
 		{
190 190
 			return;
191 191
 		}
192 192
 
193 193
 		$comment_list = $output->data;
194
-		if(!$comment_list)
194
+		if (!$comment_list)
195 195
 		{
196 196
 			return;
197 197
 		}
198
-		if(!is_array($comment_list))
198
+		if (!is_array($comment_list))
199 199
 		{
200 200
 			$comment_list = array($comment_list);
201 201
 		}
202 202
 
203 203
 		$comment_count = count($comment_list);
204
-		foreach($comment_list as $key => $attribute)
204
+		foreach ($comment_list as $key => $attribute)
205 205
 		{
206
-			if(!$attribute->comment_srl)
206
+			if (!$attribute->comment_srl)
207 207
 			{
208 208
 				continue;
209 209
 			}
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
 			$oComment = NULL;
212 212
 			$oComment = new commentItem();
213 213
 			$oComment->setAttribute($attribute);
214
-			if($is_admin)
214
+			if ($is_admin)
215 215
 			{
216 216
 				$oComment->setGrant();
217 217
 			}
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
 		$oDocument = $oDocumentModel->getDocument($document_srl, FALSE, TRUE, $columnList);
239 239
 
240 240
 		// return if no doc exists.
241
-		if(!$oDocument->isExists())
241
+		if (!$oDocument->isExists())
242 242
 		{
243 243
 			return;
244 244
 		}
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
 		$oCommentController = getController('comment');
251 251
 
252 252
 		$using_validation = $oCommentController->isModuleUsingPublishValidation($module_srl);
253
-		if($using_validation)
253
+		if ($using_validation)
254 254
 		{
255 255
 			$args->status = 1;
256 256
 		}
@@ -269,18 +269,18 @@  discard block
 block discarded – undo
269 269
 	 */
270 270
 	function getCommentCountByDate($date = '', $moduleSrlList = array())
271 271
 	{
272
-		if($date)
272
+		if ($date)
273 273
 		{
274 274
 			$args->regDate = date('Ymd', strtotime($date));
275 275
 		}
276 276
 
277
-		if(count($moduleSrlList) > 0)
277
+		if (count($moduleSrlList) > 0)
278 278
 		{
279 279
 			$args->module_srl = $moduleSrlList;
280 280
 		}
281 281
 
282 282
 		$output = executeQuery('comment.getCommentCount', $args);
283
-		if(!$output->toBool())
283
+		if (!$output->toBool())
284 284
 		{
285 285
 			return 0;
286 286
 		}
@@ -299,19 +299,19 @@  discard block
 block discarded – undo
299 299
 		$args = new stdClass();
300 300
 		$args->module_srl = $module_srl;
301 301
 
302
-		if(is_null($published))
302
+		if (is_null($published))
303 303
 		{
304 304
 			// check if module is using comment validation system
305 305
 			$oCommentController = getController("comment");
306 306
 			$is_using_validation = $oCommentController->isModuleUsingPublishValidation($module_srl);
307
-			if($is_using_validation)
307
+			if ($is_using_validation)
308 308
 			{
309 309
 				$args->status = 1;
310 310
 			}
311 311
 		}
312 312
 		else
313 313
 		{
314
-			if($published)
314
+			if ($published)
315 315
 			{
316 316
 				$args->status = 1;
317 317
 			}
@@ -363,12 +363,12 @@  discard block
 block discarded – undo
363 363
 	{
364 364
 		$args = new stdClass();
365 365
 
366
-		if(!is_object($obj))
366
+		if (!is_object($obj))
367 367
 		{
368 368
 			$obj = new stdClass();
369 369
 		}
370 370
 
371
-		if($obj->mid)
371
+		if ($obj->mid)
372 372
 		{
373 373
 			$oModuleModel = getModel('module');
374 374
 			$obj->module_srl = $oModuleModel->getModuleSrlByMid($obj->mid);
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
 		}
377 377
 
378 378
 		// check if module_srl is an arrary.
379
-		if(is_array($obj->module_srl))
379
+		if (is_array($obj->module_srl))
380 380
 		{
381 381
 			$args->module_srl = implode(',', $obj->module_srl);
382 382
 		}
@@ -388,14 +388,14 @@  discard block
 block discarded – undo
388 388
 		$args->document_srl = $obj->document_srl;
389 389
 		$args->list_count = $obj->list_count;
390 390
 
391
-		if(strpos($args->module_srl, ",") === false)
391
+		if (strpos($args->module_srl, ",") === false)
392 392
 		{
393
-			if($args->module_srl)
393
+			if ($args->module_srl)
394 394
 			{
395 395
 				// check if module is using comment validation system
396 396
 				$oCommentController = getController("comment");
397 397
 				$is_using_validation = $oCommentController->isModuleUsingPublishValidation($obj->module_srl);
398
-				if($is_using_validation)
398
+				if ($is_using_validation)
399 399
 				{
400 400
 					$args->status = 1;
401 401
 				}
@@ -404,24 +404,24 @@  discard block
 block discarded – undo
404 404
 
405 405
 		$output = executeQuery('comment.getNewestCommentList', $args, $columnList);
406 406
 
407
-		if(!$output->toBool())
407
+		if (!$output->toBool())
408 408
 		{
409 409
 			return $output;
410 410
 		}
411 411
 
412 412
 		$comment_list = $output->data;
413
-		if($comment_list)
413
+		if ($comment_list)
414 414
 		{
415
-			if(!is_array($comment_list))
415
+			if (!is_array($comment_list))
416 416
 			{
417 417
 				$comment_list = array($comment_list);
418 418
 			}
419 419
 
420 420
 			$comment_count = count($comment_list);
421 421
 
422
-			foreach($comment_list as $key => $attribute)
422
+			foreach ($comment_list as $key => $attribute)
423 423
 			{
424
-				if(!$attribute->comment_srl)
424
+				if (!$attribute->comment_srl)
425 425
 				{
426 426
 					continue;
427 427
 				}
@@ -448,7 +448,7 @@  discard block
 block discarded – undo
448 448
 	 */
449 449
 	function getCommentList($document_srl, $page = 0, $is_admin = FALSE, $count = 0)
450 450
 	{
451
-		if(!isset($document_srl))
451
+		if (!isset($document_srl))
452 452
 		{
453 453
 			return;
454 454
 		}
@@ -459,13 +459,13 @@  discard block
 block discarded – undo
459 459
 		$oDocument = $oDocumentModel->getDocument($document_srl, FALSE, TRUE, $columnList);
460 460
 
461 461
 		// return if no doc exists.
462
-		if(!$oDocument->isExists())
462
+		if (!$oDocument->isExists())
463 463
 		{
464 464
 			return;
465 465
 		}
466 466
 
467 467
 		// return if no comment exists
468
-		if($oDocument->getCommentCount() < 1)
468
+		if ($oDocument->getCommentCount() < 1)
469 469
 		{
470 470
 			return;
471 471
 		}
@@ -473,11 +473,11 @@  discard block
 block discarded – undo
473 473
 		// get a list of comments
474 474
 		$module_srl = $oDocument->get('module_srl');
475 475
 
476
-		if(!$count)
476
+		if (!$count)
477 477
 		{
478 478
 			$comment_config = $this->getCommentConfig($module_srl);
479 479
 			$comment_count = $comment_config->comment_count;
480
-			if(!$comment_count)
480
+			if (!$comment_count)
481 481
 			{
482 482
 				$comment_count = 50;
483 483
 			}
@@ -488,9 +488,9 @@  discard block
 block discarded – undo
488 488
 		}
489 489
 
490 490
 		// get a very last page if no page exists
491
-		if(!$page)
491
+		if (!$page)
492 492
 		{
493
-			$page = (int) ( ($oDocument->getCommentCount() - 1) / $comment_count) + 1;
493
+			$page = (int) (($oDocument->getCommentCount() - 1) / $comment_count) + 1;
494 494
 		}
495 495
 
496 496
 		// get a list of comments
@@ -503,14 +503,14 @@  discard block
 block discarded – undo
503 503
 		//check if module is using validation system
504 504
 		$oCommentController = getController('comment');
505 505
 		$using_validation = $oCommentController->isModuleUsingPublishValidation($module_srl);
506
-		if($using_validation)
506
+		if ($using_validation)
507 507
 		{
508 508
 			$args->status = 1;
509 509
 		}
510 510
 
511 511
 		// call trigger (before)
512 512
 		$trigger_output = ModuleHandler::triggerCall('comment.getCommentList', 'before', $args);
513
-		if($trigger_output instanceof BaseObject && !$trigger_output->toBool())
513
+		if ($trigger_output instanceof BaseObject && !$trigger_output->toBool())
514 514
 		{
515 515
 			return $output;
516 516
 		}
@@ -518,17 +518,17 @@  discard block
 block discarded – undo
518 518
 		$output = executeQueryArray('comment.getCommentPageList', $args);
519 519
 
520 520
 		// return if an error occurs in the query results
521
-		if(!$output->toBool())
521
+		if (!$output->toBool())
522 522
 		{
523 523
 			return;
524 524
 		}
525 525
 
526 526
 		// insert data into CommentPageList table if the number of results is different from stored comments
527
-		if(!$output->data)
527
+		if (!$output->data)
528 528
 		{
529 529
 			$this->fixCommentList($oDocument->get('module_srl'), $document_srl);
530 530
 			$output = executeQueryArray('comment.getCommentPageList', $args);
531
-			if(!$output->toBool())
531
+			if (!$output->toBool())
532 532
 			{
533 533
 				return;
534 534
 			}
@@ -536,7 +536,7 @@  discard block
 block discarded – undo
536 536
 
537 537
 		// call trigger (after)
538 538
 		$trigger_output = ModuleHandler::triggerCall('comment.getCommentList', 'after', $output);
539
-		if($trigger_output instanceof BaseObject && !$trigger_output->toBool())
539
+		if ($trigger_output instanceof BaseObject && !$trigger_output->toBool())
540 540
 		{
541 541
 			return $trigger_output;
542 542
 		}
@@ -554,9 +554,9 @@  discard block
 block discarded – undo
554 554
 	function fixCommentList($module_srl, $document_srl)
555 555
 	{
556 556
 		// create a lock file to prevent repeated work when performing a batch job
557
-		$lock_file = "./files/cache/tmp/lock." . $document_srl;
557
+		$lock_file = "./files/cache/tmp/lock.".$document_srl;
558 558
 
559
-		if(file_exists($lock_file) && filemtime($lock_file) + 60 * 60 * 10 < $_SERVER['REQUEST_TIME'])
559
+		if (file_exists($lock_file) && filemtime($lock_file) + 60 * 60 * 10 < $_SERVER['REQUEST_TIME'])
560 560
 		{
561 561
 			return;
562 562
 		}
@@ -568,13 +568,13 @@  discard block
 block discarded – undo
568 568
 		$args->document_srl = $document_srl;
569 569
 		$args->list_order = 'list_order';
570 570
 		$output = executeQuery('comment.getCommentList', $args);
571
-		if(!$output->toBool())
571
+		if (!$output->toBool())
572 572
 		{
573 573
 			return $output;
574 574
 		}
575 575
 
576 576
 		$source_list = $output->data;
577
-		if(!is_array($source_list))
577
+		if (!is_array($source_list))
578 578
 		{
579 579
 			$source_list = array($source_list);
580 580
 		}
@@ -590,11 +590,11 @@  discard block
 block discarded – undo
590 590
 		$logged_info = Context::get('logged_info');
591 591
 
592 592
 		// generate a hierarchical structure of comments for loop
593
-		for($i = $comment_count - 1; $i >= 0; $i--)
593
+		for ($i = $comment_count - 1; $i >= 0; $i--)
594 594
 		{
595 595
 			$comment_srl = $source_list[$i]->comment_srl;
596 596
 			$parent_srl = $source_list[$i]->parent_srl;
597
-			if(!$comment_srl)
597
+			if (!$comment_srl)
598 598
 			{
599 599
 				continue;
600 600
 			}
@@ -602,7 +602,7 @@  discard block
 block discarded – undo
602 602
 			// generate a list
603 603
 			$list[$comment_srl] = $source_list[$i];
604 604
 
605
-			if($parent_srl)
605
+			if ($parent_srl)
606 606
 			{
607 607
 				$list[$parent_srl]->child[] = &$list[$comment_srl];
608 608
 			}
@@ -614,9 +614,9 @@  discard block
 block discarded – undo
614 614
 		$this->_arrangeComment($comment_list, $root->child, 0, NULL);
615 615
 
616 616
 		// insert values to the database
617
-		if(count($comment_list))
617
+		if (count($comment_list))
618 618
 		{
619
-			foreach($comment_list as $comment_srl => $item)
619
+			foreach ($comment_list as $comment_srl => $item)
620 620
 			{
621 621
 				$comment_args = new stdClass();
622 622
 				$comment_args->comment_srl = $comment_srl;
@@ -645,14 +645,14 @@  discard block
 block discarded – undo
645 645
 	 */
646 646
 	function _arrangeComment(&$comment_list, $list, $depth, $parent = NULL)
647 647
 	{
648
-		if(!count($list))
648
+		if (!count($list))
649 649
 		{
650 650
 			return;
651 651
 		}
652 652
 
653
-		foreach($list as $key => $val)
653
+		foreach ($list as $key => $val)
654 654
 		{
655
-			if($parent)
655
+			if ($parent)
656 656
 			{
657 657
 				$val->head = $parent->head;
658 658
 			}
@@ -663,7 +663,7 @@  discard block
 block discarded – undo
663 663
 
664 664
 			$val->arrange = count($comment_list) + 1;
665 665
 
666
-			if($val->child)
666
+			if ($val->child)
667 667
 			{
668 668
 				$val->depth = $depth;
669 669
 				$comment_list[$val->comment_srl] = $val;
@@ -700,7 +700,7 @@  discard block
 block discarded – undo
700 700
 		// check if module is using comment validation system
701 701
 		$oCommentController = getController("comment");
702 702
 		$is_using_validation = $oCommentController->isModuleUsingPublishValidation($obj->module_srl);
703
-		if($is_using_validation)
703
+		if ($is_using_validation)
704 704
 		{
705 705
 			$args->s_is_published = 1;
706 706
 		}
@@ -708,12 +708,12 @@  discard block
 block discarded – undo
708 708
 		// Search options
709 709
 		$search_target = $obj->search_target ? $obj->search_target : trim(Context::get('search_target'));
710 710
 		$search_keyword = $obj->search_keyword ? $obj->search_keyword : trim(Context::get('search_keyword'));
711
-		if($search_target && $search_keyword)
711
+		if ($search_target && $search_keyword)
712 712
 		{
713
-			switch($search_target)
713
+			switch ($search_target)
714 714
 			{
715 715
 				case 'content' :
716
-					if($search_keyword)
716
+					if ($search_keyword)
717 717
 					{
718 718
 						$search_keyword = str_replace(' ', '%', $search_keyword);
719 719
 					}
@@ -722,7 +722,7 @@  discard block
 block discarded – undo
722 722
 					break;
723 723
 
724 724
 				case 'user_id' :
725
-					if($search_keyword)
725
+					if ($search_keyword)
726 726
 					{
727 727
 						$search_keyword = str_replace(' ', '%', $search_keyword);
728 728
 					}
@@ -733,7 +733,7 @@  discard block
 block discarded – undo
733 733
 					break;
734 734
 
735 735
 				case 'user_name' :
736
-					if($search_keyword)
736
+					if ($search_keyword)
737 737
 					{
738 738
 						$search_keyword = str_replace(' ', '%', $search_keyword);
739 739
 					}
@@ -742,7 +742,7 @@  discard block
 block discarded – undo
742 742
 					break;
743 743
 
744 744
 				case 'nick_name' :
745
-					if($search_keyword)
745
+					if ($search_keyword)
746 746
 					{
747 747
 						$search_keyword = str_replace(' ', '%', $search_keyword);
748 748
 					}
@@ -751,7 +751,7 @@  discard block
 block discarded – undo
751 751
 					break;
752 752
 
753 753
 				case 'email_address' :
754
-					if($search_keyword)
754
+					if ($search_keyword)
755 755
 					{
756 756
 						$search_keyword = str_replace(' ', '%', $search_keyword);
757 757
 					}
@@ -760,7 +760,7 @@  discard block
 block discarded – undo
760 760
 					break;
761 761
 
762 762
 				case 'homepage' :
763
-					if($search_keyword)
763
+					if ($search_keyword)
764 764
 					{
765 765
 						$search_keyword = str_replace(' ', '%', $search_keyword);
766 766
 					}
@@ -785,12 +785,12 @@  discard block
 block discarded – undo
785 785
 					break;
786 786
 
787 787
 				case 'is_published' :
788
-					if($search_keyword == 'Y')
788
+					if ($search_keyword == 'Y')
789 789
 					{
790 790
 						$args->s_is_published = 1;
791 791
 					}
792 792
 
793
-					if($search_keyword == 'N')
793
+					if ($search_keyword == 'N')
794 794
 					{
795 795
 						$args->s_is_published = 0;
796 796
 					}
@@ -802,7 +802,7 @@  discard block
 block discarded – undo
802 802
 					break;
803 803
 
804 804
 				case 'member_srl' :
805
-					$args->{"s_" . $search_target} = (int) $search_keyword;
805
+					$args->{"s_".$search_target} = (int) $search_keyword;
806 806
 					break;
807 807
 			}
808 808
 		}
@@ -811,12 +811,12 @@  discard block
 block discarded – undo
811 811
 		$output = executeQueryArray($query_id, $args, $columnList);
812 812
 
813 813
 		// return when no result or error occurance
814
-		if(!$output->toBool() || !count($output->data))
814
+		if (!$output->toBool() || !count($output->data))
815 815
 		{
816 816
 			return $output;
817 817
 		}
818 818
 
819
-		foreach($output->data as $key => $val)
819
+		foreach ($output->data as $key => $val)
820 820
 		{
821 821
 			unset($_oComment);
822 822
 			$_oComment = new CommentItem(0);
@@ -845,12 +845,12 @@  discard block
 block discarded – undo
845 845
 		$search_target = $obj->search_target ? $obj->search_target : trim(Context::get('search_target'));
846 846
 		$search_keyword = $obj->search_keyword ? $obj->search_keyword : trim(Context::get('search_keyword'));
847 847
 
848
-		if($search_target && $search_keyword)
848
+		if ($search_target && $search_keyword)
849 849
 		{
850
-			switch($search_target)
850
+			switch ($search_target)
851 851
 			{
852 852
 				case 'content' :
853
-					if($search_keyword)
853
+					if ($search_keyword)
854 854
 					{
855 855
 						$search_keyword = str_replace(' ', '%', $search_keyword);
856 856
 					}
@@ -859,7 +859,7 @@  discard block
 block discarded – undo
859 859
 					break;
860 860
 
861 861
 				case 'user_id' :
862
-					if($search_keyword)
862
+					if ($search_keyword)
863 863
 					{
864 864
 						$search_keyword = str_replace(' ', '%', $search_keyword);
865 865
 					}
@@ -869,7 +869,7 @@  discard block
 block discarded – undo
869 869
 					break;
870 870
 
871 871
 				case 'user_name' :
872
-					if($search_keyword)
872
+					if ($search_keyword)
873 873
 					{
874 874
 						$search_keyword = str_replace(' ', '%', $search_keyword);
875 875
 					}
@@ -878,7 +878,7 @@  discard block
 block discarded – undo
878 878
 					break;
879 879
 
880 880
 				case 'nick_name' :
881
-					if($search_keyword)
881
+					if ($search_keyword)
882 882
 					{
883 883
 						$search_keyword = str_replace(' ', '%', $search_keyword);
884 884
 					}
@@ -887,7 +887,7 @@  discard block
 block discarded – undo
887 887
 					break;
888 888
 
889 889
 				case 'email_address' :
890
-					if($search_keyword)
890
+					if ($search_keyword)
891 891
 					{
892 892
 						$search_keyword = str_replace(' ', '%', $search_keyword);
893 893
 					}
@@ -896,7 +896,7 @@  discard block
 block discarded – undo
896 896
 					break;
897 897
 
898 898
 				case 'homepage' :
899
-					if($search_keyword)
899
+					if ($search_keyword)
900 900
 					{
901 901
 						$search_keyword = str_replace(' ', '%', $search_keyword);
902 902
 					}
@@ -921,7 +921,7 @@  discard block
 block discarded – undo
921 921
 					break;
922 922
 
923 923
 				case 'member_srl' :
924
-					$args->{"s_" . $search_target} = (int) $search_keyword;
924
+					$args->{"s_".$search_target} = (int) $search_keyword;
925 925
 					break;
926 926
 			}
927 927
 		}
@@ -929,7 +929,7 @@  discard block
 block discarded – undo
929 929
 		$output = executeQueryArray($query_id, $args);
930 930
 
931 931
 		// return when no result or error occurance
932
-		if(!$output->toBool() || !count($output->data))
932
+		if (!$output->toBool() || !count($output->data))
933 933
 		{
934 934
 			return $output;
935 935
 		}
@@ -946,12 +946,12 @@  discard block
 block discarded – undo
946 946
 	{
947 947
 		$oModuleModel = getModel('module');
948 948
 		$comment_config = $oModuleModel->getModulePartConfig('comment', $module_srl);
949
-		if(!is_object($comment_config))
949
+		if (!is_object($comment_config))
950 950
 		{
951 951
 			$comment_config = new stdClass();
952 952
 		}
953 953
 
954
-		if(!isset($comment_config->comment_count))
954
+		if (!isset($comment_config->comment_count))
955 955
 		{
956 956
 			$comment_config->comment_count = 50;
957 957
 		}
@@ -966,13 +966,13 @@  discard block
 block discarded – undo
966 966
 	function getCommentVotedMemberList()
967 967
 	{
968 968
 		$comment_srl = Context::get('comment_srl');
969
-		if(!$comment_srl)
969
+		if (!$comment_srl)
970 970
 		{
971 971
 			return new BaseObject(-1, 'msg_invalid_request');
972 972
 		}
973 973
 
974 974
 		$point = Context::get('point');
975
-		if($point != -1)
975
+		if ($point != -1)
976 976
 		{
977 977
 			$point = 1;
978 978
 		}
@@ -980,7 +980,7 @@  discard block
 block discarded – undo
980 980
 		$oCommentModel = getModel('comment');
981 981
 		$oComment = $oCommentModel->getComment($comment_srl, FALSE, FALSE);
982 982
 		$module_srl = $oComment->get('module_srl');
983
-		if(!$module_srl)
983
+		if (!$module_srl)
984 984
 		{
985 985
 			return new BaseObject(-1, 'msg_invalid_request');
986 986
 		}
@@ -990,9 +990,9 @@  discard block
 block discarded – undo
990 990
 
991 991
 		$args = new stdClass();
992 992
 
993
-		if($point == -1)
993
+		if ($point == -1)
994 994
 		{
995
-			if($comment_config->use_vote_down != 'S')
995
+			if ($comment_config->use_vote_down != 'S')
996 996
 			{
997 997
 				return new BaseObject(-1, 'msg_invalid_request');
998 998
 			}
@@ -1001,7 +1001,7 @@  discard block
 block discarded – undo
1001 1001
 		}
1002 1002
 		else
1003 1003
 		{
1004
-			if($comment_config->use_vote_up != 'S')
1004
+			if ($comment_config->use_vote_up != 'S')
1005 1005
 			{
1006 1006
 				return new BaseObject(-1, 'msg_invalid_request');
1007 1007
 			}
@@ -1011,15 +1011,15 @@  discard block
 block discarded – undo
1011 1011
 
1012 1012
 		$args->comment_srl = $comment_srl;
1013 1013
 		$output = executeQueryArray('comment.getVotedMemberList', $args);
1014
-		if(!$output->toBool())
1014
+		if (!$output->toBool())
1015 1015
 		{
1016 1016
 			return $output;
1017 1017
 		}
1018 1018
 
1019 1019
 		$oMemberModel = getModel('member');
1020
-		if($output->data)
1020
+		if ($output->data)
1021 1021
 		{
1022
-			foreach($output->data as $k => $d)
1022
+			foreach ($output->data as $k => $d)
1023 1023
 			{
1024 1024
 				$profile_image = $oMemberModel->getProfileImage($d->member_srl);
1025 1025
 				$output->data[$k]->src = $profile_image->src;
@@ -1037,7 +1037,7 @@  discard block
 block discarded – undo
1037 1037
 	{
1038 1038
 		global $lang;
1039 1039
 
1040
-		if(!isset($lang->secret_name_list))
1040
+		if (!isset($lang->secret_name_list))
1041 1041
 		{
1042 1042
 			return array('Y' => 'Secret', 'N' => 'Public');
1043 1043
 		}
@@ -1078,8 +1078,8 @@  discard block
 block discarded – undo
1078 1078
 		$output = executeQuery('comment.getCommentListByMemberSrl', $args, $columnList);
1079 1079
 		$comment_list = $output->data;
1080 1080
 
1081
-		if(!$comment_list) return array();
1082
-		if(!is_array($comment_list)) $comment_list = array($comment_list);
1081
+		if (!$comment_list) return array();
1082
+		if (!is_array($comment_list)) $comment_list = array($comment_list);
1083 1083
 
1084 1084
 		return $comment_list;
1085 1085
 
Please login to merge, or discard this patch.
modules/communication/communication.admin.controller.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -24,31 +24,31 @@
 block discarded – undo
24 24
 	function procCommunicationAdminInsertConfig()
25 25
 	{
26 26
 		// get the default information
27
-		$args = Context::gets('skin', 'colorset', 'editor_skin', 'sel_editor_colorset', 'mskin', 'mcolorset', 'layout_srl', 'mlayout_srl', 'grant_write_default','grant_write_group');
27
+		$args = Context::gets('skin', 'colorset', 'editor_skin', 'sel_editor_colorset', 'mskin', 'mcolorset', 'layout_srl', 'mlayout_srl', 'grant_write_default', 'grant_write_group');
28 28
 		$args->editor_colorset = $args->sel_editor_colorset;
29 29
 		unset($args->sel_editor_colorset);
30 30
 
31
-		if(!$args->skin)
31
+		if (!$args->skin)
32 32
 		{
33 33
 			$args->skin = 'default';
34 34
 		}
35 35
 
36
-		if(!$args->colorset)
36
+		if (!$args->colorset)
37 37
 		{
38 38
 			$args->colorset = 'white';
39 39
 		}
40 40
 
41
-		if(!$args->editor_skin)
41
+		if (!$args->editor_skin)
42 42
 		{
43 43
 			$args->editor_skin = 'default';
44 44
 		}
45 45
 
46
-		if(!$args->mskin)
46
+		if (!$args->mskin)
47 47
 		{
48 48
 			$args->mskin = 'default';
49 49
 		}
50 50
 
51
-		if(!$args->layout_srl)
51
+		if (!$args->layout_srl)
52 52
 		{
53 53
 			$args->layout_srl = NULL;
54 54
 		}
Please login to merge, or discard this patch.
modules/communication/communication.admin.model.php 2 patches
Braces   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -30,8 +30,7 @@  discard block
 block discarded – undo
30 30
 		if($type == 'P')
31 31
 		{
32 32
 			$dir = 'skins';
33
-		}
34
-		else
33
+		} else
35 34
 		{
36 35
 			$dir = 'm.skins';
37 36
 		}
@@ -39,8 +38,7 @@  discard block
 block discarded – undo
39 38
 		if(!$skin)
40 39
 		{
41 40
 			$tpl = "";
42
-		}
43
-		else
41
+		} else
44 42
 		{
45 43
 			$oModuleModel = getModel('module');
46 44
 			$skin_info = $oModuleModel->loadSkinInfo($this->module_path, $skin, $dir);
@@ -48,7 +46,9 @@  discard block
 block discarded – undo
48 46
 
49 47
 			$oModuleModel = getModel('module');
50 48
 			$communication_config = $oModuleModel->getModuleConfig('communication');
51
-			if(!is_object($communication_config)) $communication_config = new stdClass;
49
+			if(!is_object($communication_config)) {
50
+				$communication_config = new stdClass;
51
+			}
52 52
 			if(!$communication_config->colorset)
53 53
 			{
54 54
 				$communication_config->colorset = "white";
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 		$type = Context::get('type') == 'P' ? 'P' : 'M';
28 28
 		Context::set('type', $type);
29 29
 
30
-		if($type == 'P')
30
+		if ($type == 'P')
31 31
 		{
32 32
 			$dir = 'skins';
33 33
 		}
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 			$dir = 'm.skins';
37 37
 		}
38 38
 
39
-		if(!$skin)
39
+		if (!$skin)
40 40
 		{
41 41
 			$tpl = "";
42 42
 		}
@@ -48,8 +48,8 @@  discard block
 block discarded – undo
48 48
 
49 49
 			$oModuleModel = getModel('module');
50 50
 			$communication_config = $oModuleModel->getModuleConfig('communication');
51
-			if(!is_object($communication_config)) $communication_config = new stdClass;
52
-			if(!$communication_config->colorset)
51
+			if (!is_object($communication_config)) $communication_config = new stdClass;
52
+			if (!$communication_config->colorset)
53 53
 			{
54 54
 				$communication_config->colorset = "white";
55 55
 			}
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 			$security->encodeHTML('skin_info.colorset..name');
61 61
 
62 62
 			$oTemplate = TemplateHandler::getInstance();
63
-			$tpl = $oTemplate->compile($this->module_path . 'tpl', 'colorset_list');
63
+			$tpl = $oTemplate->compile($this->module_path.'tpl', 'colorset_list');
64 64
 		}
65 65
 
66 66
 		$this->add('tpl', $tpl);
Please login to merge, or discard this patch.
modules/communication/communication.mobile.php 3 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -96,8 +96,7 @@
 block discarded – undo
96 96
 				stripEmbedTagForAdmin($message->content, $message->sender_srl);
97 97
 				Context::set('message', $message);
98 98
 			}
99
-		}
100
-		else
99
+		} else
101 100
 		{
102 101
 			$templateFile = 'messages';
103 102
 		}
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 
35 35
 	/**
36 36
 	 * Display message box
37
-	 * @return void|BaseObject (void : success, BaseObject : fail)
37
+	 * @return ModuleObject|null (void : success, BaseObject : fail)
38 38
 	 */
39 39
 	function dispCommunicationMessages()
40 40
 	{
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 
131 131
 	/**
132 132
 	 * Display message sending
133
-	 * @return void|BaseObject (void : success, BaseObject : fail)
133
+	 * @return ModuleObject|null (void : success, BaseObject : fail)
134 134
 	 */
135 135
 	function dispCommunicationSendMessage()
136 136
 	{
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /* Copyright (C) XEHub <https://www.xehub.io> */
3 3
 
4
-require_once(_XE_PATH_ . 'modules/communication/communication.view.php');
4
+require_once(_XE_PATH_.'modules/communication/communication.view.php');
5 5
 
6 6
 /**
7 7
  * @class  communicationMobile
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
 		$oLayoutModel = getModel('layout');
27 27
 		$layout_info = $oLayoutModel->getLayout($this->communication_config->mlayout_srl);
28
-		if($layout_info)
28
+		if ($layout_info)
29 29
 		{
30 30
 			$this->module_info->mlayout_srl = $this->communication_config->mlayout_srl;
31 31
 			$this->setLayoutPath($layout_info->path);
@@ -39,13 +39,13 @@  discard block
 block discarded – undo
39 39
 	function dispCommunicationMessages()
40 40
 	{
41 41
 		// Error appears if not logged-in
42
-		if(!Context::get('is_logged'))
42
+		if (!Context::get('is_logged'))
43 43
 		{
44 44
 			return $this->stop('msg_not_logged');
45 45
 		}
46 46
 
47 47
 		$logged_info = Context::get('logged_info');
48
-		if(!array_key_exists('dispCommunicationMessages', $logged_info->menu_list))
48
+		if (!array_key_exists('dispCommunicationMessages', $logged_info->menu_list))
49 49
 		{
50 50
 			return $this->stop('msg_invalid_request');
51 51
 		}
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 		// Set the variables
54 54
 		$message_srl = Context::get('message_srl');
55 55
 		$message_type = Context::get('message_type');
56
-		if(!in_array($message_type, array('R', 'S', 'T')))
56
+		if (!in_array($message_type, array('R', 'S', 'T')))
57 57
 		{
58 58
 			$message_type = 'R';
59 59
 			Context::set('message_type', $message_type);
@@ -61,37 +61,37 @@  discard block
 block discarded – undo
61 61
 		$oCommunicationModel = getModel('communication');
62 62
 
63 63
 		// extract contents if message_srl exists
64
-		if($message_srl)
64
+		if ($message_srl)
65 65
 		{
66 66
 			$templateFile = 'read_message';
67 67
 			$columnList = array('message_srl', 'sender_srl', 'receiver_srl', 'message_type', 'title', 'content', 'readed', 'regdate');
68 68
 			$message = $oCommunicationModel->getSelectedMessage($message_srl, $columnList);
69 69
 
70
-			switch($message->message_type)
70
+			switch ($message->message_type)
71 71
 			{
72 72
 				case 'R':
73
-					if($message->receiver_srl != $logged_info->member_srl)
73
+					if ($message->receiver_srl != $logged_info->member_srl)
74 74
 					{
75 75
 						return $this->stop('msg_invalid_request');
76 76
 					}
77 77
 					break;
78 78
 
79 79
 				case 'S':
80
-					if($message->sender_srl != $logged_info->member_srl)
80
+					if ($message->sender_srl != $logged_info->member_srl)
81 81
 					{
82 82
 						return $this->stop('msg_invalid_request');
83 83
 					}
84 84
 					break;
85 85
 
86 86
 				case 'T':
87
-					if($message->receiver_srl != $logged_info->member_srl && $message->sender_srl != $logged_info->member_srl)
87
+					if ($message->receiver_srl != $logged_info->member_srl && $message->sender_srl != $logged_info->member_srl)
88 88
 					{
89 89
 						return $this->stop('msg_invalid_request');
90 90
 					}
91 91
 					break;
92 92
 			}
93 93
 
94
-			if($message->message_srl == $message_srl && ($message->receiver_srl == $logged_info->member_srl || $message->sender_srl == $logged_info->member_srl))
94
+			if ($message->message_srl == $message_srl && ($message->receiver_srl == $logged_info->member_srl || $message->sender_srl == $logged_info->member_srl))
95 95
 			{
96 96
 				stripEmbedTagForAdmin($message->content, $message->sender_srl);
97 97
 				Context::set('message', $message);
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 		$oMemberModel = getModel('member');
139 139
 
140 140
 		// Error appears if not logged-in
141
-		if(!Context::get('is_logged'))
141
+		if (!Context::get('is_logged'))
142 142
 		{
143 143
 			return $this->stop('msg_not_logged');
144 144
 		}
@@ -148,32 +148,32 @@  discard block
 block discarded – undo
148 148
 		// get receipient's information
149 149
 		// check inalid request
150 150
 		$receiver_srl = Context::get('receiver_srl');
151
-		if(!$receiver_srl)
151
+		if (!$receiver_srl)
152 152
 		{
153 153
 			return $this->stop('msg_invalid_request');
154 154
 		}
155 155
 
156 156
 		// check receiver and sender are same
157
-		if($logged_info->member_srl == $receiver_srl)
157
+		if ($logged_info->member_srl == $receiver_srl)
158 158
 		{
159 159
 			return $this->stop('msg_cannot_send_to_yourself');
160 160
 		}
161 161
 
162 162
 		// get message_srl of the original message if it is a reply
163 163
 		$message_srl = Context::get('message_srl');
164
-		if($message_srl)
164
+		if ($message_srl)
165 165
 		{
166 166
 			$source_message = $oCommunicationModel->getSelectedMessage($message_srl);
167
-			if($source_message->message_srl == $message_srl && $source_message->sender_srl == $receiver_srl)
167
+			if ($source_message->message_srl == $message_srl && $source_message->sender_srl == $receiver_srl)
168 168
 			{
169
-				$source_message->title = "[re] " . $source_message->title;
170
-				$source_message->content = "\r\n<br />\r\n<br /><div style=\"padding-left:5px; border-left:5px solid #DDDDDD;\">" . trim($source_message->content) . "</div>";
169
+				$source_message->title = "[re] ".$source_message->title;
170
+				$source_message->content = "\r\n<br />\r\n<br /><div style=\"padding-left:5px; border-left:5px solid #DDDDDD;\">".trim($source_message->content)."</div>";
171 171
 				Context::set('source_message', $source_message);
172 172
 			}
173 173
 		}
174 174
 
175 175
 		$receiver_info = $oMemberModel->getMemberInfoByMemberSrl($receiver_srl);
176
-		if(!$receiver_info)
176
+		if (!$receiver_info)
177 177
 		{
178 178
 			return $this->stop('msg_invalid_request');
179 179
 		}
Please login to merge, or discard this patch.