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 ( dafa19...3a5b79 )
by gyeong-won
28:39 queued 16:53
created
modules/layout/layout.model.php 3 patches
Doc Comments   +4 added lines, -5 removed lines patch added patch discarded remove patch
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
 	 * It uses caching to reduce time for xml parsing ..
436 436
 	 * @param string $layout
437 437
 	 * @param object $info
438
-	 * @param string $layoutType (P : PC, M : Mobile)
438
+	 * @param string $layout_type (P : PC, M : Mobile)
439 439
 	 * @return object info of layout
440 440
 	 */
441 441
 	function getLayoutInfo($layout, $info = null, $layout_type = "P")
@@ -737,7 +737,7 @@  discard block
 block discarded – undo
737 737
 	/**
738 738
 	 * Return a list of images which are uploaded on the layout setting page
739 739
 	 * @param int $layout_srl
740
-	 * @return array image list in layout
740
+	 * @return string[] image list in layout
741 741
 	 */
742 742
 	function getUserLayoutImageList($layout_srl)
743 743
 	{
@@ -892,7 +892,6 @@  discard block
 block discarded – undo
892 892
 
893 893
 	/**
894 894
 	 * layout cache
895
-	 * @param int $layout_srl
896 895
 	 * @param string $lang_type
897 896
 	 * @return string
898 897
 	 */
@@ -972,7 +971,7 @@  discard block
 block discarded – undo
972 971
 	/**
973 972
 	 * Temp file list for User Layout
974 973
 	 * @param int $layout_srl
975
-	 * @return array temp files info
974
+	 * @return string[] temp files info
976 975
 	 */
977 976
 	function getUserLayoutTempFileList($layout_srl)
978 977
 	{
@@ -986,7 +985,7 @@  discard block
 block discarded – undo
986 985
 	/**
987 986
 	 * Saved file list for User Layout
988 987
 	 * @param int $layout_srl
989
-	 * @return array files info
988
+	 * @return string[] files info
990 989
 	 */
991 990
 	function getUserLayoutFileList($layout_srl)
992 991
 	{
Please login to merge, or discard this patch.
Braces   +115 added lines, -61 removed lines patch added patch discarded remove patch
@@ -92,16 +92,14 @@  discard block
 block discarded – undo
92 92
 			if(count($token) == 2)
93 93
 			{
94 94
 				$thumbnailPath = sprintf('./themes/%s/layouts/%s/thumbnail.png' , $token[0], $token[1]);
95
-			}
96
-			else
95
+			} else
97 96
 			{
98 97
 				$thumbnailPath = sprintf('./layouts/%s/thumbnail.png' , $val->layout);
99 98
 			}
100 99
 			if(is_readable($thumbnailPath))
101 100
 			{
102 101
 				$val->thumbnail = $thumbnailPath;
103
-			}
104
-			else
102
+			} else
105 103
 			{
106 104
 				$val->thumbnail = sprintf('./modules/layout/tpl/img/noThumbnail.png');
107 105
 			}
@@ -140,8 +138,7 @@  discard block
 block discarded – undo
140 138
 				if($this->isExistsLayoutFile($iInfo->layout, $layoutType))
141 139
 				{
142 140
 					$instanceList[] = $iInfo->layout;
143
-				}
144
-				else
141
+				} else
145 142
 				{
146 143
 					unset($output->data[$no]);
147 144
 				}
@@ -176,8 +173,7 @@  discard block
 block discarded – undo
176 173
 				$oLayoutAdminController->insertLayout($insertArgs);
177 174
 				$isCreateInstance = TRUE;
178 175
 			}
179
-		}
180
-		else
176
+		} else
181 177
 		{
182 178
 			// Get downloaded name list have no instance
183 179
 			$noInstanceList = array_diff($downloadedList, $instanceList);
@@ -230,8 +226,7 @@  discard block
 block discarded – undo
230 226
 		{
231 227
 			$pathPrefix = _XE_PATH_ . 'layouts/';
232 228
 			$themePathFormat = _XE_PATH_ . 'themes/%s/layouts/%s';
233
-		}
234
-		else
229
+		} else
235 230
 		{
236 231
 			$pathPrefix = _XE_PATH_ . 'm.layouts/';
237 232
 			$themePathFormat = _XE_PATH_ . 'themes/%s/m.layouts/%s';
@@ -241,8 +236,7 @@  discard block
 block discarded – undo
241 236
 		{
242 237
 			list($themeName, $layoutName) = explode('|@|', $layout);
243 238
 			$path = sprintf($themePathFormat, $themeName, $layoutName);
244
-		}
245
-		else
239
+		} else
246 240
 		{
247 241
 			$path = $pathPrefix . $layout;
248 242
 		}
@@ -262,7 +256,9 @@  discard block
 block discarded – undo
262 256
 		$args = new stdClass();
263 257
 		$args->layout_srl = $layout_srl;
264 258
 		$output = executeQuery('layout.getLayout', $args);
265
-		if(!$output->data) return;
259
+		if(!$output->data) {
260
+			return;
261
+		}
266 262
 
267 263
 		// Return xml file informaton after listing up the layout and extra_vars
268 264
 		$layout_info = $this->getLayoutInfo($layout, $output->data, $output->data->layout_type);
@@ -295,20 +291,19 @@  discard block
 block discarded – undo
295 291
 		if(count($layout_parse) > 1)
296 292
 		{
297 293
 			$class_path = './themes/'.$layout_parse[0].'/layouts/'.$layout_parse[1].'/';
298
-		}
299
-		else if($layout_name == 'faceoff')
294
+		} else if($layout_name == 'faceoff')
300 295
 		{
301 296
 			$class_path = './modules/layout/faceoff/';
302
-		}
303
-		else if($layout_type == "M")
297
+		} else if($layout_type == "M")
304 298
 		{
305 299
 			$class_path = sprintf("./m.layouts/%s/", $layout_name);
306
-		}
307
-		else
300
+		} else
308 301
 		{
309 302
 			$class_path = sprintf('./layouts/%s/', $layout_name);
310 303
 		}
311
-		if(is_dir($class_path)) return $class_path;
304
+		if(is_dir($class_path)) {
305
+			return $class_path;
306
+		}
312 307
 		return "";
313 308
 	}
314 309
 
@@ -321,12 +316,16 @@  discard block
 block discarded – undo
321 316
 	 */
322 317
 	function getDownloadedLayoutList($layout_type = "P", $withAutoinstallInfo = false)
323 318
 	{
324
-		if ($withAutoinstallInfo) $oAutoinstallModel = getModel('autoinstall');
319
+		if ($withAutoinstallInfo) {
320
+			$oAutoinstallModel = getModel('autoinstall');
321
+		}
325 322
 
326 323
 		// Get a list of downloaded layout and installed layout
327 324
 		$searched_list = $this->_getInstalledLayoutDirectories($layout_type);
328 325
 		$searched_count = count($searched_list);
329
-		if(!$searched_count) return;
326
+		if(!$searched_count) {
327
+			return;
328
+		}
330 329
 
331 330
 		// natcasesort($searched_list);
332 331
 		// Return information for looping searched list of layouts
@@ -414,17 +413,20 @@  discard block
 block discarded – undo
414 413
 		{
415 414
 			$directory = './m.layouts';
416 415
 			$globalValueKey = 'MOBILE_LAYOUT_DIRECTOIES';
417
-		}
418
-		else
416
+		} else
419 417
 		{
420 418
 			$directory = './layouts';
421 419
 			$globalValueKey = 'PC_LAYOUT_DIRECTORIES';
422 420
 		}
423 421
 
424
-		if($GLOBALS[$globalValueKey]) return $GLOBALS[$globalValueKey];
422
+		if($GLOBALS[$globalValueKey]) {
423
+			return $GLOBALS[$globalValueKey];
424
+		}
425 425
 
426 426
 		$searchedList = FileHandler::readDir($directory);
427
-		if (!$searchedList) $searchedList = array();
427
+		if (!$searchedList) {
428
+			$searchedList = array();
429
+		}
428 430
 		$GLOBALS[$globalValueKey] = $searchedList;
429 431
 
430 432
 		return $searchedList;
@@ -456,11 +458,17 @@  discard block
 block discarded – undo
456 458
 		}
457 459
 
458 460
 		// Get a path of the requested module. Return if not exists.
459
-		if(!$layout_path) $layout_path = $this->getLayoutPath($layout, $layout_type);
460
-		if(!is_dir($layout_path)) return;
461
+		if(!$layout_path) {
462
+			$layout_path = $this->getLayoutPath($layout, $layout_type);
463
+		}
464
+		if(!is_dir($layout_path)) {
465
+			return;
466
+		}
461 467
 
462 468
 		// Read the xml file for module skin information
463
-		if(!$xml_file) $xml_file = sprintf("%sconf/info.xml", $layout_path);
469
+		if(!$xml_file) {
470
+			$xml_file = sprintf("%sconf/info.xml", $layout_path);
471
+		}
464 472
 		if(!file_exists($xml_file))
465 473
 		{
466 474
 			$layout_info = new stdClass;
@@ -479,8 +487,7 @@  discard block
 block discarded – undo
479 487
 		if(!$layout_srl)
480 488
 		{
481 489
 			$cache_file = $this->getLayoutCache($layout, Context::getLangType(), $layout_type);
482
-		}
483
-		else
490
+		} else
484 491
 		{
485 492
 			$cache_file = $this->getUserLayoutCache($layout_srl, Context::getLangType());
486 493
 		}
@@ -511,10 +518,15 @@  discard block
 block discarded – undo
511 518
 		$oXmlParser = new XmlParser();
512 519
 		$tmp_xml_obj = $oXmlParser->loadXmlFile($xml_file);
513 520
 
514
-		if($tmp_xml_obj->layout) $xml_obj = $tmp_xml_obj->layout;
515
-		elseif($tmp_xml_obj->skin) $xml_obj = $tmp_xml_obj->skin;
521
+		if($tmp_xml_obj->layout) {
522
+			$xml_obj = $tmp_xml_obj->layout;
523
+		} elseif($tmp_xml_obj->skin) {
524
+			$xml_obj = $tmp_xml_obj->skin;
525
+		}
516 526
 
517
-		if(!$xml_obj) return;
527
+		if(!$xml_obj) {
528
+			return;
529
+		}
518 530
 
519 531
 		$buff = array();
520 532
 		$buff[] = '$layout_info = new stdClass;';
@@ -540,8 +552,11 @@  discard block
 block discarded – undo
540 552
 			$buff[] = sprintf('$layout_info->layout_type = "%s";', $layout_type);
541 553
 
542 554
 			// Author information
543
-			if(!is_array($xml_obj->author)) $author_list[] = $xml_obj->author;
544
-			else $author_list = $xml_obj->author;
555
+			if(!is_array($xml_obj->author)) {
556
+				$author_list[] = $xml_obj->author;
557
+			} else {
558
+				$author_list = $xml_obj->author;
559
+			}
545 560
 
546 561
 			$buff[] = '$layout_info->author = array();';
547 562
 			for($i=0, $c=count($author_list); $i<$c; $i++)
@@ -554,8 +569,12 @@  discard block
 block discarded – undo
554 569
 
555 570
 			// Extra vars (user defined variables to use in a template)
556 571
 			$extra_var_groups = $xml_obj->extra_vars->group;
557
-			if(!$extra_var_groups) $extra_var_groups = $xml_obj->extra_vars;
558
-			if(!is_array($extra_var_groups)) $extra_var_groups = array($extra_var_groups);
572
+			if(!$extra_var_groups) {
573
+				$extra_var_groups = $xml_obj->extra_vars;
574
+			}
575
+			if(!is_array($extra_var_groups)) {
576
+				$extra_var_groups = array($extra_var_groups);
577
+			}
559 578
 
560 579
 			$buff[] = '$layout_info->extra_var = new stdClass;';
561 580
 			$extra_var_count = 0;
@@ -564,7 +583,9 @@  discard block
 block discarded – undo
564 583
 				$extra_vars = $group->var;
565 584
 				if($extra_vars)
566 585
 				{
567
-					if(!is_array($extra_vars)) $extra_vars = array($extra_vars);
586
+					if(!is_array($extra_vars)) {
587
+						$extra_vars = array($extra_vars);
588
+					}
568 589
 
569 590
 					$count = count($extra_vars);
570 591
 					$extra_var_count += $count;
@@ -583,8 +604,12 @@  discard block
 block discarded – undo
583 604
 						$buff[] = sprintf('$layout_info->extra_var->%s->description = "%s";', $name, str_replace('"','\"',$var->description->body));
584 605
 
585 606
 						$options = $var->options;
586
-						if(!$options) continue;
587
-						if(!is_array($options)) $options = array($options);
607
+						if(!$options) {
608
+							continue;
609
+						}
610
+						if(!is_array($options)) {
611
+							$options = array($options);
612
+						}
588 613
 
589 614
 						$buff[] = sprintf('$layout_info->extra_var->%s->options = array();', $var->attrs->name);
590 615
 						$options_count = count($options);
@@ -616,7 +641,9 @@  discard block
 block discarded – undo
616 641
 			if($xml_obj->menus->menu)
617 642
 			{
618 643
 				$menus = $xml_obj->menus->menu;
619
-				if(!is_array($menus)) $menus = array($menus);
644
+				if(!is_array($menus)) {
645
+					$menus = array($menus);
646
+				}
620 647
 
621 648
 				$menu_count = count($menus);
622 649
 				$buff[] = sprintf('$layout_info->menu_count = "%s";', $menu_count);
@@ -624,7 +651,9 @@  discard block
 block discarded – undo
624 651
 				for($i=0;$i<$menu_count;$i++)
625 652
 				{
626 653
 					$name = $menus[$i]->attrs->name;
627
-					if($menus[$i]->attrs->default == "true") $buff[] = sprintf('$layout_info->default_menu = "%s";', $name);
654
+					if($menus[$i]->attrs->default == "true") {
655
+						$buff[] = sprintf('$layout_info->default_menu = "%s";', $name);
656
+					}
628 657
 					$buff[] = sprintf('$layout_info->menu->%s = new stdClass;', $name);
629 658
 					$buff[] = sprintf('$layout_info->menu->%s->name = "%s";',$name, $menus[$i]->attrs->name);
630 659
 					$buff[] = sprintf('$layout_info->menu->%s->title = "%s";',$name, $menus[$i]->title->body);
@@ -635,8 +664,7 @@  discard block
 block discarded – undo
635 664
 					$buff[] = sprintf('$layout_info->menu->%s->php_file = "./files/cache/menu/".$vars->%s.".php";',$name, $name);
636 665
 				}
637 666
 			}
638
-		}
639
-		else
667
+		} else
640 668
 		{
641 669
 			// Layout title, version and other information
642 670
 			sscanf($xml_obj->author->attrs->date, '%d. %d. %d', $date_obj->y, $date_obj->m, $date_obj->d);
@@ -655,14 +683,20 @@  discard block
 block discarded – undo
655 683
 			$buff[] = sprintf('$layout_info->author[0]->homepage = "%s";', $xml_obj->author->attrs->link);
656 684
 			// Extra vars (user defined variables to use in a template)
657 685
 			$extra_var_groups = $xml_obj->extra_vars->group;
658
-			if(!$extra_var_groups) $extra_var_groups = $xml_obj->extra_vars;
659
-			if(!is_array($extra_var_groups)) $extra_var_groups = array($extra_var_groups);
686
+			if(!$extra_var_groups) {
687
+				$extra_var_groups = $xml_obj->extra_vars;
688
+			}
689
+			if(!is_array($extra_var_groups)) {
690
+				$extra_var_groups = array($extra_var_groups);
691
+			}
660 692
 			foreach($extra_var_groups as $group)
661 693
 			{
662 694
 				$extra_vars = $group->var;
663 695
 				if($extra_vars)
664 696
 				{
665
-					if(!is_array($extra_vars)) $extra_vars = array($extra_vars);
697
+					if(!is_array($extra_vars)) {
698
+						$extra_vars = array($extra_vars);
699
+					}
666 700
 
667 701
 					$extra_var_count = count($extra_vars);
668 702
 
@@ -680,9 +714,13 @@  discard block
 block discarded – undo
680 714
 						$buff[] = sprintf('$layout_info->extra_var->%s->description = "%s";', $name, str_replace('"','\"',$var->description->body));
681 715
 
682 716
 						$options = $var->options;
683
-						if(!$options) continue;
717
+						if(!$options) {
718
+							continue;
719
+						}
684 720
 
685
-						if(!is_array($options)) $options = array($options);
721
+						if(!is_array($options)) {
722
+							$options = array($options);
723
+						}
686 724
 						$options_count = count($options);
687 725
 						for($j=0;$j<$options_count;$j++)
688 726
 						{
@@ -695,14 +733,18 @@  discard block
 block discarded – undo
695 733
 			if($xml_obj->menus->menu)
696 734
 			{
697 735
 				$menus = $xml_obj->menus->menu;
698
-				if(!is_array($menus)) $menus = array($menus);
736
+				if(!is_array($menus)) {
737
+					$menus = array($menus);
738
+				}
699 739
 
700 740
 				$menu_count = count($menus);
701 741
 				$buff[] = sprintf('$layout_info->menu_count = "%s";', $menu_count);
702 742
 				for($i=0;$i<$menu_count;$i++)
703 743
 				{
704 744
 					$name = $menus[$i]->attrs->name;
705
-					if($menus[$i]->attrs->default == "true") $buff[] = sprintf('$layout_info->default_menu = "%s";', $name);
745
+					if($menus[$i]->attrs->default == "true") {
746
+						$buff[] = sprintf('$layout_info->default_menu = "%s";', $name);
747
+					}
706 748
 					$buff[] = sprintf('$layout_info->menu->%s->name = "%s";',$name, $name);
707 749
 					$buff[] = sprintf('$layout_info->menu->%s->title = "%s";',$name, $menus[$i]->title->body);
708 750
 					$buff[] = sprintf('$layout_info->menu->%s->maxdepth = "%s";',$name, $menus[$i]->maxdepth->body);
@@ -724,7 +766,9 @@  discard block
 block discarded – undo
724 766
 		}
725 767
 
726 768
 		FileHandler::writeFile($cache_file, '<?php if(!defined("__XE__")) exit(); ' . join(PHP_EOL, $buff));
727
-		if(FileHandler::exists($cache_file)) include($cache_file);
769
+		if(FileHandler::exists($cache_file)) {
770
+			include($cache_file);
771
+		}
728 772
 
729 773
 		if(!$layout_info->title)
730 774
 		{
@@ -798,7 +842,9 @@  discard block
 block discarded – undo
798 842
 	 */
799 843
 	function getUserLayoutFaceOffCss($layout_srl)
800 844
 	{
801
-		if($this->useUserLayoutTemp == 'temp') return;
845
+		if($this->useUserLayoutTemp == 'temp') {
846
+			return;
847
+		}
802 848
 		return $this->_getUserLayoutFaceOffCss($layout_srl);
803 849
 	}
804 850
 
@@ -833,7 +879,9 @@  discard block
 block discarded – undo
833 879
 		if($this->useUserLayoutTemp == 'temp')
834 880
 		{
835 881
 			$temp = $this->getUserLayoutTempHtml($layout_srl);
836
-			if(FileHandler::exists($temp) === FALSE) FileHandler::copyFile($src,$temp);
882
+			if(FileHandler::exists($temp) === FALSE) {
883
+				FileHandler::copyFile($src,$temp);
884
+			}
837 885
 			return $temp;
838 886
 		}
839 887
 
@@ -861,7 +909,9 @@  discard block
 block discarded – undo
861 909
 		if($this->useUserLayoutTemp == 'temp')
862 910
 		{
863 911
 			$temp = $this->getUserLayoutTempIni($layout_srl);
864
-			if(!file_exists(FileHandler::getRealPath($temp))) FileHandler::copyFile($src,$temp);
912
+			if(!file_exists(FileHandler::getRealPath($temp))) {
913
+				FileHandler::copyFile($src,$temp);
914
+			}
865 915
 			return $temp;
866 916
 		}
867 917
 
@@ -901,8 +951,7 @@  discard block
 block discarded – undo
901 951
 		if($layout_type=='P')
902 952
 		{
903 953
 			return sprintf("%sfiles/cache/layout/%s.%s.cache.php", _XE_PATH_, $layout_name,$lang_type);
904
-		}
905
-		else
954
+		} else
906 955
 		{
907 956
 			return sprintf("%sfiles/cache/layout/m.%s.%s.cache.php", _XE_PATH_, $layout_name,$lang_type);
908 957
 		}
@@ -1020,11 +1069,16 @@  discard block
 block discarded – undo
1020 1069
 		Context::addCSSFile($this->getDefaultLayoutCss($layout_info->layout));
1021 1070
 		// CSS generated in the layout manager
1022 1071
 		$faceoff_layout_css = $this->getUserLayoutFaceOffCss($layout_info->layout_srl);
1023
-		if($faceoff_layout_css) Context::addCSSFile($faceoff_layout_css);
1072
+		if($faceoff_layout_css) {
1073
+			Context::addCSSFile($faceoff_layout_css);
1074
+		}
1024 1075
 		// CSS output for the widget
1025 1076
 		Context::loadFile($this->module_path.'/tpl/css/widget.css', true);
1026
-		if($layout_info->extra_var->colorset->value == 'black') Context::loadFile($this->module_path.'/tpl/css/[email protected]', true);
1027
-		else Context::loadFile($this->module_path.'/tpl/css/[email protected]', true);
1077
+		if($layout_info->extra_var->colorset->value == 'black') {
1078
+			Context::loadFile($this->module_path.'/tpl/css/[email protected]', true);
1079
+		} else {
1080
+			Context::loadFile($this->module_path.'/tpl/css/[email protected]', true);
1081
+		}
1028 1082
 		// Different page displayed upon user's permission
1029 1083
 		$logged_info = Context::get('logged_info');
1030 1084
 		// Display edit button for faceoff layout
Please login to merge, or discard this patch.
Spacing   +151 added lines, -151 removed lines patch added patch discarded remove patch
@@ -31,21 +31,21 @@  discard block
 block discarded – undo
31 31
 	 * @param array $columnList
32 32
 	 * @return array layout lists in site
33 33
 	 */
34
-	function getLayoutList($site_srl = 0, $layout_type="P", $columnList = array())
34
+	function getLayoutList($site_srl = 0, $layout_type = "P", $columnList = array())
35 35
 	{
36
-		if(!$site_srl)
36
+		if (!$site_srl)
37 37
 		{
38 38
 			$site_module_info = Context::get('site_module_info');
39
-			$site_srl = (int)$site_module_info->site_srl;
39
+			$site_srl = (int) $site_module_info->site_srl;
40 40
 		}
41 41
 		$args = new stdClass();
42 42
 		$args->site_srl = $site_srl;
43 43
 		$args->layout_type = $layout_type;
44 44
 		$output = executeQueryArray('layout.getLayoutList', $args, $columnList);
45 45
 
46
-		foreach($output->data as $no => &$val)
46
+		foreach ($output->data as $no => &$val)
47 47
 		{
48
-			if(!$this->isExistsLayoutFile($val->layout, $layout_type))
48
+			if (!$this->isExistsLayoutFile($val->layout, $layout_type))
49 49
 			{
50 50
 				unset($output->data[$no]);
51 51
 			}
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 
54 54
 		$oLayoutAdminModel = getAdminModel('layout');
55 55
 		$siteDefaultLayoutSrl = $oLayoutAdminModel->getSiteDefaultLayout($layout_type, $site_srl);
56
-		if($siteDefaultLayoutSrl)
56
+		if ($siteDefaultLayoutSrl)
57 57
 		{
58 58
 			$siteDefaultLayoutInfo = $this->getlayout($siteDefaultLayoutSrl);
59 59
 			$newLayout = sprintf('%s, %s', $siteDefaultLayoutInfo->title, $siteDefaultLayoutInfo->layout);
@@ -80,24 +80,24 @@  discard block
 block discarded – undo
80 80
 		$layoutList = $this->getLayoutInstanceList($siteSrl, $layoutType);
81 81
 		$thumbs = array();
82 82
 
83
-		foreach($layoutList as $key => $val)
83
+		foreach ($layoutList as $key => $val)
84 84
 		{
85
-			if($thumbs[$val->layouts])
85
+			if ($thumbs[$val->layouts])
86 86
 			{
87 87
 				$val->thumbnail = $thumbs[$val->layouts];
88 88
 				continue;
89 89
 			}
90 90
 
91 91
 			$token = explode('|@|', $val->layout);
92
-			if(count($token) == 2)
92
+			if (count($token) == 2)
93 93
 			{
94
-				$thumbnailPath = sprintf('./themes/%s/layouts/%s/thumbnail.png' , $token[0], $token[1]);
94
+				$thumbnailPath = sprintf('./themes/%s/layouts/%s/thumbnail.png', $token[0], $token[1]);
95 95
 			}
96 96
 			else
97 97
 			{
98
-				$thumbnailPath = sprintf('./layouts/%s/thumbnail.png' , $val->layout);
98
+				$thumbnailPath = sprintf('./layouts/%s/thumbnail.png', $val->layout);
99 99
 			}
100
-			if(is_readable($thumbnailPath))
100
+			if (is_readable($thumbnailPath))
101 101
 			{
102 102
 				$val->thumbnail = $thumbnailPath;
103 103
 			}
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 		if (!$siteSrl)
124 124
 		{
125 125
 			$siteModuleInfo = Context::get('site_module_info');
126
-			$siteSrl = (int)$siteModuleInfo->site_srl;
126
+			$siteSrl = (int) $siteModuleInfo->site_srl;
127 127
 		}
128 128
 		$args = new stdClass();
129 129
 		$args->site_srl = $siteSrl;
@@ -133,11 +133,11 @@  discard block
 block discarded – undo
133 133
 
134 134
 		// Create instance name list
135 135
 		$instanceList = array();
136
-		if(is_array($output->data))
136
+		if (is_array($output->data))
137 137
 		{
138
-			foreach($output->data as $no => $iInfo)
138
+			foreach ($output->data as $no => $iInfo)
139 139
 			{
140
-				if($this->isExistsLayoutFile($iInfo->layout, $layoutType))
140
+				if ($this->isExistsLayoutFile($iInfo->layout, $layoutType))
141 141
 				{
142 142
 					$instanceList[] = $iInfo->layout;
143 143
 				}
@@ -152,18 +152,18 @@  discard block
 block discarded – undo
152 152
 		$downloadedList = array();
153 153
 		$titleList = array();
154 154
 		$_downloadedList = $this->getDownloadedLayoutList($layoutType);
155
-		if(is_array($_downloadedList))
155
+		if (is_array($_downloadedList))
156 156
 		{
157
-			foreach($_downloadedList as $dLayoutInfo)
157
+			foreach ($_downloadedList as $dLayoutInfo)
158 158
 			{
159 159
 				$downloadedList[$dLayoutInfo->layout] = $dLayoutInfo->layout;
160 160
 				$titleList[$dLayoutInfo->layout] = $dLayoutInfo->title;
161 161
 			}
162 162
 		}
163 163
 
164
-		if($layout)
164
+		if ($layout)
165 165
 		{
166
-			if(count($instanceList) < 1 && $downloadedList[$layout])
166
+			if (count($instanceList) < 1 && $downloadedList[$layout])
167 167
 			{
168 168
 				$insertArgs = new stdClass();
169 169
 				$insertArgs->site_srl = $siteSrl;
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 		{
182 182
 			// Get downloaded name list have no instance
183 183
 			$noInstanceList = array_diff($downloadedList, $instanceList);
184
-			foreach($noInstanceList as $layoutName)
184
+			foreach ($noInstanceList as $layoutName)
185 185
 			{
186 186
 				$insertArgs = new stdClass();
187 187
 				$insertArgs->site_srl = $siteSrl;
@@ -197,15 +197,15 @@  discard block
 block discarded – undo
197 197
 		}
198 198
 
199 199
 		// If create layout instance, reload instance list
200
-		if($isCreateInstance)
200
+		if ($isCreateInstance)
201 201
 		{
202 202
 			$output = executeQueryArray('layout.getLayoutList', $args, $columnList);
203 203
 
204
-			if(is_array($output->data))
204
+			if (is_array($output->data))
205 205
 			{
206
-				foreach($output->data as $no => $iInfo)
206
+				foreach ($output->data as $no => $iInfo)
207 207
 				{
208
-					if(!$this->isExistsLayoutFile($iInfo->layout, $layoutType))
208
+					if (!$this->isExistsLayoutFile($iInfo->layout, $layoutType))
209 209
 					{
210 210
 						unset($output->data[$no]);
211 211
 					}
@@ -226,28 +226,28 @@  discard block
 block discarded – undo
226 226
 	function isExistsLayoutFile($layout, $layoutType)
227 227
 	{
228 228
 		//TODO If remove a support themes, remove this codes also.
229
-		if($layoutType == 'P')
229
+		if ($layoutType == 'P')
230 230
 		{
231
-			$pathPrefix = _XE_PATH_ . 'layouts/';
232
-			$themePathFormat = _XE_PATH_ . 'themes/%s/layouts/%s';
231
+			$pathPrefix = _XE_PATH_.'layouts/';
232
+			$themePathFormat = _XE_PATH_.'themes/%s/layouts/%s';
233 233
 		}
234 234
 		else
235 235
 		{
236
-			$pathPrefix = _XE_PATH_ . 'm.layouts/';
237
-			$themePathFormat = _XE_PATH_ . 'themes/%s/m.layouts/%s';
236
+			$pathPrefix = _XE_PATH_.'m.layouts/';
237
+			$themePathFormat = _XE_PATH_.'themes/%s/m.layouts/%s';
238 238
 		}
239 239
 
240
-		if(strpos($layout, '|@|') !== FALSE)
240
+		if (strpos($layout, '|@|') !== FALSE)
241 241
 		{
242 242
 			list($themeName, $layoutName) = explode('|@|', $layout);
243 243
 			$path = sprintf($themePathFormat, $themeName, $layoutName);
244 244
 		}
245 245
 		else
246 246
 		{
247
-			$path = $pathPrefix . $layout;
247
+			$path = $pathPrefix.$layout;
248 248
 		}
249 249
 
250
-		return is_readable($path . '/layout.html');
250
+		return is_readable($path.'/layout.html');
251 251
 	}
252 252
 
253 253
 	/**
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
 		$args = new stdClass();
263 263
 		$args->layout_srl = $layout_srl;
264 264
 		$output = executeQuery('layout.getLayout', $args);
265
-		if(!$output->data) return;
265
+		if (!$output->data) return;
266 266
 
267 267
 		// Return xml file informaton after listing up the layout and extra_vars
268 268
 		$layout_info = $this->getLayoutInfo($layout, $output->data, $output->data->layout_type);
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
 		$args = new stdClass();
276 276
 		$args->layout_srl = $layout_srl;
277 277
 		$output = executeQuery('layout.getLayout', $args, $columnList);
278
-		if(!$output->toBool())
278
+		if (!$output->toBool())
279 279
 		{
280 280
 			return;
281 281
 		}
@@ -292,15 +292,15 @@  discard block
 block discarded – undo
292 292
 	function getLayoutPath($layout_name = "", $layout_type = "P")
293 293
 	{
294 294
 		$layout_parse = explode('|@|', $layout_name);
295
-		if(count($layout_parse) > 1)
295
+		if (count($layout_parse) > 1)
296 296
 		{
297 297
 			$class_path = './themes/'.$layout_parse[0].'/layouts/'.$layout_parse[1].'/';
298 298
 		}
299
-		else if($layout_name == 'faceoff')
299
+		else if ($layout_name == 'faceoff')
300 300
 		{
301 301
 			$class_path = './modules/layout/faceoff/';
302 302
 		}
303
-		else if($layout_type == "M")
303
+		else if ($layout_type == "M")
304 304
 		{
305 305
 			$class_path = sprintf("./m.layouts/%s/", $layout_name);
306 306
 		}
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
 		{
309 309
 			$class_path = sprintf('./layouts/%s/', $layout_name);
310 310
 		}
311
-		if(is_dir($class_path)) return $class_path;
311
+		if (is_dir($class_path)) return $class_path;
312 312
 		return "";
313 313
 	}
314 314
 
@@ -326,24 +326,24 @@  discard block
 block discarded – undo
326 326
 		// Get a list of downloaded layout and installed layout
327 327
 		$searched_list = $this->_getInstalledLayoutDirectories($layout_type);
328 328
 		$searched_count = count($searched_list);
329
-		if(!$searched_count) return;
329
+		if (!$searched_count) return;
330 330
 
331 331
 		// natcasesort($searched_list);
332 332
 		// Return information for looping searched list of layouts
333 333
 		$list = array();
334
-		for($i=0;$i<$searched_count;$i++)
334
+		for ($i = 0; $i < $searched_count; $i++)
335 335
 		{
336 336
 			// Name of the layout
337 337
 			$layout = $searched_list[$i];
338 338
 			// Get information of the layout
339 339
 			$layout_info = $this->getLayoutInfo($layout, null, $layout_type);
340 340
 
341
-			if(!$layout_info)
341
+			if (!$layout_info)
342 342
 			{
343 343
 				continue;
344 344
 			}
345 345
 
346
-			if($withAutoinstallInfo)
346
+			if ($withAutoinstallInfo)
347 347
 			{
348 348
 				// get easyinstall remove url
349 349
 				$packageSrl = $oAutoinstallModel->getPackageSrlByPath($layout_info->path);
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
 				$layout_info->need_update = $package[$packageSrl]->need_update;
355 355
 
356 356
 				// get easyinstall update url
357
-				if($layout_info->need_update)
357
+				if ($layout_info->need_update)
358 358
 				{
359 359
 					$layout_info->update_url = $oAutoinstallModel->getUpdateUrlByPackageSrl($packageSrl);
360 360
 				}
@@ -371,12 +371,12 @@  discard block
 block discarded – undo
371 371
 	 */
372 372
 	function sortLayoutByTitle($a, $b)
373 373
 	{
374
-		if(!$a->title)
374
+		if (!$a->title)
375 375
 		{
376 376
 			$a->title = $a->layout;
377 377
 		}
378 378
 
379
-		if(!$b->title)
379
+		if (!$b->title)
380 380
 		{
381 381
 			$b->title = $b->layout;
382 382
 		}
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
 		$aTitle = strtolower($a->title);
385 385
 		$bTitle = strtolower($b->title);
386 386
 
387
-		if($aTitle == $bTitle)
387
+		if ($aTitle == $bTitle)
388 388
 		{
389 389
 			return 0;
390 390
 		}
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
 	 */
411 411
 	function _getInstalledLayoutDirectories($layoutType = 'P')
412 412
 	{
413
-		if($layoutType == 'M')
413
+		if ($layoutType == 'M')
414 414
 		{
415 415
 			$directory = './m.layouts';
416 416
 			$globalValueKey = 'MOBILE_LAYOUT_DIRECTOIES';
@@ -421,7 +421,7 @@  discard block
 block discarded – undo
421 421
 			$globalValueKey = 'PC_LAYOUT_DIRECTORIES';
422 422
 		}
423 423
 
424
-		if($GLOBALS[$globalValueKey]) return $GLOBALS[$globalValueKey];
424
+		if ($GLOBALS[$globalValueKey]) return $GLOBALS[$globalValueKey];
425 425
 
426 426
 		$searchedList = FileHandler::readDir($directory);
427 427
 		if (!$searchedList) $searchedList = array();
@@ -440,7 +440,7 @@  discard block
 block discarded – undo
440 440
 	 */
441 441
 	function getLayoutInfo($layout, $info = null, $layout_type = "P")
442 442
 	{
443
-		if($info)
443
+		if ($info)
444 444
 		{
445 445
 			$layout_title = $info->title;
446 446
 			$layout = $info->layout;
@@ -448,35 +448,35 @@  discard block
 block discarded – undo
448 448
 			$site_srl = $info->site_srl;
449 449
 			$vars = unserialize($info->extra_vars);
450 450
 
451
-			if($info->module_srl)
451
+			if ($info->module_srl)
452 452
 			{
453
-				$layout_path = preg_replace('/([a-zA-Z0-9\_\.]+)(\.html)$/','',$info->layout_path);
453
+				$layout_path = preg_replace('/([a-zA-Z0-9\_\.]+)(\.html)$/', '', $info->layout_path);
454 454
 				$xml_file = sprintf('%sskin.xml', $layout_path);
455 455
 			}
456 456
 		}
457 457
 
458 458
 		// Get a path of the requested module. Return if not exists.
459
-		if(!$layout_path) $layout_path = $this->getLayoutPath($layout, $layout_type);
460
-		if(!is_dir($layout_path)) return;
459
+		if (!$layout_path) $layout_path = $this->getLayoutPath($layout, $layout_type);
460
+		if (!is_dir($layout_path)) return;
461 461
 
462 462
 		// Read the xml file for module skin information
463
-		if(!$xml_file) $xml_file = sprintf("%sconf/info.xml", $layout_path);
464
-		if(!file_exists($xml_file))
463
+		if (!$xml_file) $xml_file = sprintf("%sconf/info.xml", $layout_path);
464
+		if (!file_exists($xml_file))
465 465
 		{
466 466
 			$layout_info = new stdClass;
467 467
 			$layout_info->title = $layout;
468 468
 			$layout_info->layout = $layout;
469 469
 			$layout_info->path = $layout_path;
470 470
 			$layout_info->layout_title = $layout_title;
471
-			if(!$layout_info->layout_type)
471
+			if (!$layout_info->layout_type)
472 472
 			{
473
-				$layout_info->layout_type =  $layout_type;
473
+				$layout_info->layout_type = $layout_type;
474 474
 			}
475 475
 			return $layout_info;
476 476
 		}
477 477
 
478 478
 		// Include the cache file if it is valid and then return $layout_info variable
479
-		if(!$layout_srl)
479
+		if (!$layout_srl)
480 480
 		{
481 481
 			$cache_file = $this->getLayoutCache($layout, Context::getLangType(), $layout_type);
482 482
 		}
@@ -485,22 +485,22 @@  discard block
 block discarded – undo
485 485
 			$cache_file = $this->getUserLayoutCache($layout_srl, Context::getLangType());
486 486
 		}
487 487
 
488
-		if(file_exists($cache_file)&&filemtime($cache_file)>filemtime($xml_file))
488
+		if (file_exists($cache_file) && filemtime($cache_file) > filemtime($xml_file))
489 489
 		{
490 490
 			include($cache_file);
491 491
 
492
-			if($layout_info->extra_var && $vars)
492
+			if ($layout_info->extra_var && $vars)
493 493
 			{
494
-				foreach($vars as $key => $value)
494
+				foreach ($vars as $key => $value)
495 495
 				{
496
-					if(!$layout_info->extra_var->{$key} && !$layout_info->{$key})
496
+					if (!$layout_info->extra_var->{$key} && !$layout_info->{$key})
497 497
 					{
498 498
 						$layout_info->{$key} = $value;
499 499
 					}
500 500
 				}
501 501
 			}
502 502
 
503
-			if(!$layout_info->title)
503
+			if (!$layout_info->title)
504 504
 			{
505 505
 				$layout_info->title = $layout;
506 506
 			}
@@ -511,16 +511,16 @@  discard block
 block discarded – undo
511 511
 		$oXmlParser = new XmlParser();
512 512
 		$tmp_xml_obj = $oXmlParser->loadXmlFile($xml_file);
513 513
 
514
-		if($tmp_xml_obj->layout) $xml_obj = $tmp_xml_obj->layout;
515
-		elseif($tmp_xml_obj->skin) $xml_obj = $tmp_xml_obj->skin;
514
+		if ($tmp_xml_obj->layout) $xml_obj = $tmp_xml_obj->layout;
515
+		elseif ($tmp_xml_obj->skin) $xml_obj = $tmp_xml_obj->skin;
516 516
 
517
-		if(!$xml_obj) return;
517
+		if (!$xml_obj) return;
518 518
 
519 519
 		$buff = array();
520 520
 		$buff[] = '$layout_info = new stdClass;';
521 521
 		$buff[] = sprintf('$layout_info->site_srl = "%s";', $site_srl);
522 522
 
523
-		if($xml_obj->version && $xml_obj->attrs->version == '0.2')
523
+		if ($xml_obj->version && $xml_obj->attrs->version == '0.2')
524 524
 		{
525 525
 			// Layout title, version and other information
526 526
 			sscanf($xml_obj->date->body, '%d-%d-%d', $date_obj->y, $date_obj->m, $date_obj->d);
@@ -540,11 +540,11 @@  discard block
 block discarded – undo
540 540
 			$buff[] = sprintf('$layout_info->layout_type = "%s";', $layout_type);
541 541
 
542 542
 			// Author information
543
-			if(!is_array($xml_obj->author)) $author_list[] = $xml_obj->author;
543
+			if (!is_array($xml_obj->author)) $author_list[] = $xml_obj->author;
544 544
 			else $author_list = $xml_obj->author;
545 545
 
546 546
 			$buff[] = '$layout_info->author = array();';
547
-			for($i=0, $c=count($author_list); $i<$c; $i++)
547
+			for ($i = 0, $c = count($author_list); $i < $c; $i++)
548 548
 			{
549 549
 				$buff[] = sprintf('$layout_info->author[%d] = new stdClass;', $i);
550 550
 				$buff[] = sprintf('$layout_info->author[%d]->name = "%s";', $i, $author_list[$i]->name->body);
@@ -554,22 +554,22 @@  discard block
 block discarded – undo
554 554
 
555 555
 			// Extra vars (user defined variables to use in a template)
556 556
 			$extra_var_groups = $xml_obj->extra_vars->group;
557
-			if(!$extra_var_groups) $extra_var_groups = $xml_obj->extra_vars;
558
-			if(!is_array($extra_var_groups)) $extra_var_groups = array($extra_var_groups);
557
+			if (!$extra_var_groups) $extra_var_groups = $xml_obj->extra_vars;
558
+			if (!is_array($extra_var_groups)) $extra_var_groups = array($extra_var_groups);
559 559
 
560 560
 			$buff[] = '$layout_info->extra_var = new stdClass;';
561 561
 			$extra_var_count = 0;
562
-			foreach($extra_var_groups as $group)
562
+			foreach ($extra_var_groups as $group)
563 563
 			{
564 564
 				$extra_vars = $group->var;
565
-				if($extra_vars)
565
+				if ($extra_vars)
566 566
 				{
567
-					if(!is_array($extra_vars)) $extra_vars = array($extra_vars);
567
+					if (!is_array($extra_vars)) $extra_vars = array($extra_vars);
568 568
 
569 569
 					$count = count($extra_vars);
570 570
 					$extra_var_count += $count;
571 571
 					
572
-					for($i=0;$i<$count;$i++)
572
+					for ($i = 0; $i < $count; $i++)
573 573
 					{
574 574
 						unset($var, $options);
575 575
 						$var = $extra_vars[$i];
@@ -580,26 +580,26 @@  discard block
 block discarded – undo
580 580
 						$buff[] = sprintf('$layout_info->extra_var->%s->title = "%s";', $name, $var->title->body);
581 581
 						$buff[] = sprintf('$layout_info->extra_var->%s->type = "%s";', $name, $var->attrs->type);
582 582
 						$buff[] = sprintf('$layout_info->extra_var->%s->value = $vars->%s;', $name, $name);
583
-						$buff[] = sprintf('$layout_info->extra_var->%s->description = "%s";', $name, str_replace('"','\"',$var->description->body));
583
+						$buff[] = sprintf('$layout_info->extra_var->%s->description = "%s";', $name, str_replace('"', '\"', $var->description->body));
584 584
 
585 585
 						$options = $var->options;
586
-						if(!$options) continue;
587
-						if(!is_array($options)) $options = array($options);
586
+						if (!$options) continue;
587
+						if (!is_array($options)) $options = array($options);
588 588
 
589 589
 						$buff[] = sprintf('$layout_info->extra_var->%s->options = array();', $var->attrs->name);
590 590
 						$options_count = count($options);
591 591
 						$thumbnail_exist = false;
592
-						for($j=0; $j < $options_count; $j++)
592
+						for ($j = 0; $j < $options_count; $j++)
593 593
 						{
594 594
 							$buff[] = sprintf('$layout_info->extra_var->%s->options["%s"] = new stdClass;', $var->attrs->name, $options[$j]->attrs->value);
595 595
 							$thumbnail = $options[$j]->attrs->src;
596
-							if($thumbnail)
596
+							if ($thumbnail)
597 597
 							{
598 598
 								$thumbnail = $layout_path.$thumbnail;
599
-								if(file_exists($thumbnail))
599
+								if (file_exists($thumbnail))
600 600
 								{
601 601
 									$buff[] = sprintf('$layout_info->extra_var->%s->options["%s"]->thumbnail = "%s";', $var->attrs->name, $options[$j]->attrs->value, $thumbnail);
602
-									if(!$thumbnail_exist)
602
+									if (!$thumbnail_exist)
603 603
 									{
604 604
 										$buff[] = sprintf('$layout_info->extra_var->%s->thumbnail_exist = true;', $var->attrs->name);
605 605
 										$thumbnail_exist = true;
@@ -613,26 +613,26 @@  discard block
 block discarded – undo
613 613
 			}
614 614
 			$buff[] = sprintf('$layout_info->extra_var_count = "%s";', $extra_var_count);
615 615
 			// Menu
616
-			if($xml_obj->menus->menu)
616
+			if ($xml_obj->menus->menu)
617 617
 			{
618 618
 				$menus = $xml_obj->menus->menu;
619
-				if(!is_array($menus)) $menus = array($menus);
619
+				if (!is_array($menus)) $menus = array($menus);
620 620
 
621 621
 				$menu_count = count($menus);
622 622
 				$buff[] = sprintf('$layout_info->menu_count = "%s";', $menu_count);
623 623
 				$buff[] = '$layout_info->menu = new stdClass;';
624
-				for($i=0;$i<$menu_count;$i++)
624
+				for ($i = 0; $i < $menu_count; $i++)
625 625
 				{
626 626
 					$name = $menus[$i]->attrs->name;
627
-					if($menus[$i]->attrs->default == "true") $buff[] = sprintf('$layout_info->default_menu = "%s";', $name);
627
+					if ($menus[$i]->attrs->default == "true") $buff[] = sprintf('$layout_info->default_menu = "%s";', $name);
628 628
 					$buff[] = sprintf('$layout_info->menu->%s = new stdClass;', $name);
629
-					$buff[] = sprintf('$layout_info->menu->%s->name = "%s";',$name, $menus[$i]->attrs->name);
630
-					$buff[] = sprintf('$layout_info->menu->%s->title = "%s";',$name, $menus[$i]->title->body);
631
-					$buff[] = sprintf('$layout_info->menu->%s->maxdepth = "%s";',$name, $menus[$i]->attrs->maxdepth);
629
+					$buff[] = sprintf('$layout_info->menu->%s->name = "%s";', $name, $menus[$i]->attrs->name);
630
+					$buff[] = sprintf('$layout_info->menu->%s->title = "%s";', $name, $menus[$i]->title->body);
631
+					$buff[] = sprintf('$layout_info->menu->%s->maxdepth = "%s";', $name, $menus[$i]->attrs->maxdepth);
632 632
 
633 633
 					$buff[] = sprintf('$layout_info->menu->%s->menu_srl = $vars->%s;', $name, $name);
634
-					$buff[] = sprintf('$layout_info->menu->%s->xml_file = "./files/cache/menu/".$vars->%s.".xml.php";',$name, $name);
635
-					$buff[] = sprintf('$layout_info->menu->%s->php_file = "./files/cache/menu/".$vars->%s.".php";',$name, $name);
634
+					$buff[] = sprintf('$layout_info->menu->%s->xml_file = "./files/cache/menu/".$vars->%s.".xml.php";', $name, $name);
635
+					$buff[] = sprintf('$layout_info->menu->%s->php_file = "./files/cache/menu/".$vars->%s.".php";', $name, $name);
636 636
 				}
637 637
 			}
638 638
 		}
@@ -655,19 +655,19 @@  discard block
 block discarded – undo
655 655
 			$buff[] = sprintf('$layout_info->author[0]->homepage = "%s";', $xml_obj->author->attrs->link);
656 656
 			// Extra vars (user defined variables to use in a template)
657 657
 			$extra_var_groups = $xml_obj->extra_vars->group;
658
-			if(!$extra_var_groups) $extra_var_groups = $xml_obj->extra_vars;
659
-			if(!is_array($extra_var_groups)) $extra_var_groups = array($extra_var_groups);
660
-			foreach($extra_var_groups as $group)
658
+			if (!$extra_var_groups) $extra_var_groups = $xml_obj->extra_vars;
659
+			if (!is_array($extra_var_groups)) $extra_var_groups = array($extra_var_groups);
660
+			foreach ($extra_var_groups as $group)
661 661
 			{
662 662
 				$extra_vars = $group->var;
663
-				if($extra_vars)
663
+				if ($extra_vars)
664 664
 				{
665
-					if(!is_array($extra_vars)) $extra_vars = array($extra_vars);
665
+					if (!is_array($extra_vars)) $extra_vars = array($extra_vars);
666 666
 
667 667
 					$extra_var_count = count($extra_vars);
668 668
 
669 669
 					$buff[] = sprintf('$layout_info->extra_var_count = "%s";', $extra_var_count);
670
-					for($i=0;$i<$extra_var_count;$i++)
670
+					for ($i = 0; $i < $extra_var_count; $i++)
671 671
 					{
672 672
 						unset($var, $options);
673 673
 						$var = $extra_vars[$i];
@@ -677,14 +677,14 @@  discard block
 block discarded – undo
677 677
 						$buff[] = sprintf('$layout_info->extra_var->%s->title = "%s";', $name, $var->title->body);
678 678
 						$buff[] = sprintf('$layout_info->extra_var->%s->type = "%s";', $name, $var->attrs->type);
679 679
 						$buff[] = sprintf('$layout_info->extra_var->%s->value = $vars->%s;', $name, $name);
680
-						$buff[] = sprintf('$layout_info->extra_var->%s->description = "%s";', $name, str_replace('"','\"',$var->description->body));
680
+						$buff[] = sprintf('$layout_info->extra_var->%s->description = "%s";', $name, str_replace('"', '\"', $var->description->body));
681 681
 
682 682
 						$options = $var->options;
683
-						if(!$options) continue;
683
+						if (!$options) continue;
684 684
 
685
-						if(!is_array($options)) $options = array($options);
685
+						if (!is_array($options)) $options = array($options);
686 686
 						$options_count = count($options);
687
-						for($j=0;$j<$options_count;$j++)
687
+						for ($j = 0; $j < $options_count; $j++)
688 688
 						{
689 689
 							$buff[] = sprintf('$layout_info->extra_var->%s->options["%s"]->val = "%s";', $var->attrs->name, $options[$j]->value->body, $options[$j]->title->body);
690 690
 						}
@@ -692,23 +692,23 @@  discard block
 block discarded – undo
692 692
 				}
693 693
 			}
694 694
 			// Menu
695
-			if($xml_obj->menus->menu)
695
+			if ($xml_obj->menus->menu)
696 696
 			{
697 697
 				$menus = $xml_obj->menus->menu;
698
-				if(!is_array($menus)) $menus = array($menus);
698
+				if (!is_array($menus)) $menus = array($menus);
699 699
 
700 700
 				$menu_count = count($menus);
701 701
 				$buff[] = sprintf('$layout_info->menu_count = "%s";', $menu_count);
702
-				for($i=0;$i<$menu_count;$i++)
702
+				for ($i = 0; $i < $menu_count; $i++)
703 703
 				{
704 704
 					$name = $menus[$i]->attrs->name;
705
-					if($menus[$i]->attrs->default == "true") $buff[] = sprintf('$layout_info->default_menu = "%s";', $name);
706
-					$buff[] = sprintf('$layout_info->menu->%s->name = "%s";',$name, $name);
707
-					$buff[] = sprintf('$layout_info->menu->%s->title = "%s";',$name, $menus[$i]->title->body);
708
-					$buff[] = sprintf('$layout_info->menu->%s->maxdepth = "%s";',$name, $menus[$i]->maxdepth->body);
705
+					if ($menus[$i]->attrs->default == "true") $buff[] = sprintf('$layout_info->default_menu = "%s";', $name);
706
+					$buff[] = sprintf('$layout_info->menu->%s->name = "%s";', $name, $name);
707
+					$buff[] = sprintf('$layout_info->menu->%s->title = "%s";', $name, $menus[$i]->title->body);
708
+					$buff[] = sprintf('$layout_info->menu->%s->maxdepth = "%s";', $name, $menus[$i]->maxdepth->body);
709 709
 					$buff[] = sprintf('$layout_info->menu->%s->menu_srl = $vars->%s;', $name, $name);
710
-					$buff[] = sprintf('$layout_info->menu->%s->xml_file = "./files/cache/menu/".$vars->%s.".xml.php";',$name, $name);
711
-					$buff[] = sprintf('$layout_info->menu->%s->php_file = "./files/cache/menu/".$vars->%s.".php";',$name, $name);
710
+					$buff[] = sprintf('$layout_info->menu->%s->xml_file = "./files/cache/menu/".$vars->%s.".xml.php";', $name, $name);
711
+					$buff[] = sprintf('$layout_info->menu->%s->php_file = "./files/cache/menu/".$vars->%s.".php";', $name, $name);
712 712
 				}
713 713
 			}
714 714
 		}
@@ -718,15 +718,15 @@  discard block
 block discarded – undo
718 718
 		$layout_config = $oModuleModel->getModulePartConfig('layout', $layout_srl);
719 719
 		$header_script = trim($layout_config->header_script);
720 720
 
721
-		if($header_script)
721
+		if ($header_script)
722 722
 		{
723
-			$buff[] = sprintf(' $layout_info->header_script = "%s"; ', str_replace(array('$','"'),array('\$','\\"'),$header_script));
723
+			$buff[] = sprintf(' $layout_info->header_script = "%s"; ', str_replace(array('$', '"'), array('\$', '\\"'), $header_script));
724 724
 		}
725 725
 
726
-		FileHandler::writeFile($cache_file, '<?php if(!defined("__XE__")) exit(); ' . join(PHP_EOL, $buff));
727
-		if(FileHandler::exists($cache_file)) include($cache_file);
726
+		FileHandler::writeFile($cache_file, '<?php if(!defined("__XE__")) exit(); '.join(PHP_EOL, $buff));
727
+		if (FileHandler::exists($cache_file)) include($cache_file);
728 728
 
729
-		if(!$layout_info->title)
729
+		if (!$layout_info->title)
730 730
 		{
731 731
 			$layout_info->title = $layout;
732 732
 		}
@@ -750,12 +750,12 @@  discard block
 block discarded – undo
750 750
 	 * @param string $layout_name
751 751
 	 * @return array
752 752
 	 */
753
-	function getUserLayoutIniConfig($layout_srl, $layout_name=null)
753
+	function getUserLayoutIniConfig($layout_srl, $layout_name = null)
754 754
 	{
755 755
 		$file = $this->getUserLayoutIni($layout_srl);
756
-		if($layout_name && FileHandler::exists($file) === FALSE)
756
+		if ($layout_name && FileHandler::exists($file) === FALSE)
757 757
 		{
758
-			FileHandler::copyFile($this->getDefaultLayoutIni($layout_name),$this->getUserLayoutIni($layout_srl));
758
+			FileHandler::copyFile($this->getDefaultLayoutIni($layout_name), $this->getUserLayoutIni($layout_srl));
759 759
 		}
760 760
 
761 761
 		return FileHandler::readIniFile($file);
@@ -768,7 +768,7 @@  discard block
 block discarded – undo
768 768
 	 */
769 769
 	function getUserLayoutPath($layout_srl)
770 770
 	{
771
-		return sprintf("./files/faceOff/%s", getNumberingPath($layout_srl,3));
771
+		return sprintf("./files/faceOff/%s", getNumberingPath($layout_srl, 3));
772 772
 	}
773 773
 
774 774
 	/**
@@ -778,7 +778,7 @@  discard block
 block discarded – undo
778 778
 	 */
779 779
 	function getUserLayoutImagePath($layout_srl)
780 780
 	{
781
-		return $this->getUserLayoutPath($layout_srl). 'images/';
781
+		return $this->getUserLayoutPath($layout_srl).'images/';
782 782
 	}
783 783
 
784 784
 	/**
@@ -788,7 +788,7 @@  discard block
 block discarded – undo
788 788
 	 */
789 789
 	function getUserLayoutCss($layout_srl)
790 790
 	{
791
-		return $this->getUserLayoutPath($layout_srl). 'layout.css';
791
+		return $this->getUserLayoutPath($layout_srl).'layout.css';
792 792
 	}
793 793
 
794 794
 	/**
@@ -798,7 +798,7 @@  discard block
 block discarded – undo
798 798
 	 */
799 799
 	function getUserLayoutFaceOffCss($layout_srl)
800 800
 	{
801
-		if($this->useUserLayoutTemp == 'temp') return;
801
+		if ($this->useUserLayoutTemp == 'temp') return;
802 802
 		return $this->_getUserLayoutFaceOffCss($layout_srl);
803 803
 	}
804 804
 
@@ -809,7 +809,7 @@  discard block
 block discarded – undo
809 809
 	 */
810 810
 	function _getUserLayoutFaceOffCss($layout_srl)
811 811
 	{
812
-		return $this->getUserLayoutPath($layout_srl). 'faceoff.css';
812
+		return $this->getUserLayoutPath($layout_srl).'faceoff.css';
813 813
 	}
814 814
 
815 815
 	/**
@@ -819,7 +819,7 @@  discard block
 block discarded – undo
819 819
 	 */
820 820
 	function getUserLayoutTempFaceOffCss($layout_srl)
821 821
 	{
822
-		return $this->getUserLayoutPath($layout_srl). 'tmp.faceoff.css';
822
+		return $this->getUserLayoutPath($layout_srl).'tmp.faceoff.css';
823 823
 	}
824 824
 
825 825
 	/**
@@ -829,11 +829,11 @@  discard block
 block discarded – undo
829 829
 	 */
830 830
 	function getUserLayoutHtml($layout_srl)
831 831
 	{
832
-		$src = $this->getUserLayoutPath($layout_srl). 'layout.html';
833
-		if($this->useUserLayoutTemp == 'temp')
832
+		$src = $this->getUserLayoutPath($layout_srl).'layout.html';
833
+		if ($this->useUserLayoutTemp == 'temp')
834 834
 		{
835 835
 			$temp = $this->getUserLayoutTempHtml($layout_srl);
836
-			if(FileHandler::exists($temp) === FALSE) FileHandler::copyFile($src,$temp);
836
+			if (FileHandler::exists($temp) === FALSE) FileHandler::copyFile($src, $temp);
837 837
 			return $temp;
838 838
 		}
839 839
 
@@ -847,7 +847,7 @@  discard block
 block discarded – undo
847 847
 	 */
848 848
 	function getUserLayoutTempHtml($layout_srl)
849 849
 	{
850
-		return $this->getUserLayoutPath($layout_srl). 'tmp.layout.html';
850
+		return $this->getUserLayoutPath($layout_srl).'tmp.layout.html';
851 851
 	}
852 852
 
853 853
 	/**
@@ -857,11 +857,11 @@  discard block
 block discarded – undo
857 857
 	 */
858 858
 	function getUserLayoutIni($layout_srl)
859 859
 	{
860
-		$src = $this->getUserLayoutPath($layout_srl). 'layout.ini';
861
-		if($this->useUserLayoutTemp == 'temp')
860
+		$src = $this->getUserLayoutPath($layout_srl).'layout.ini';
861
+		if ($this->useUserLayoutTemp == 'temp')
862 862
 		{
863 863
 			$temp = $this->getUserLayoutTempIni($layout_srl);
864
-			if(!file_exists(FileHandler::getRealPath($temp))) FileHandler::copyFile($src,$temp);
864
+			if (!file_exists(FileHandler::getRealPath($temp))) FileHandler::copyFile($src, $temp);
865 865
 			return $temp;
866 866
 		}
867 867
 
@@ -875,7 +875,7 @@  discard block
 block discarded – undo
875 875
 	 */
876 876
 	function getUserLayoutTempIni($layout_srl)
877 877
 	{
878
-		return $this->getUserLayoutPath($layout_srl). 'tmp.layout.ini';
878
+		return $this->getUserLayoutPath($layout_srl).'tmp.layout.ini';
879 879
 	}
880 880
 
881 881
 	/**
@@ -885,9 +885,9 @@  discard block
 block discarded – undo
885 885
 	 * @param string $lang_type
886 886
 	 * @return string
887 887
 	 */
888
-	function getUserLayoutCache($layout_srl,$lang_type)
888
+	function getUserLayoutCache($layout_srl, $lang_type)
889 889
 	{
890
-		return $this->getUserLayoutPath($layout_srl). "{$lang_type}.cache.php";
890
+		return $this->getUserLayoutPath($layout_srl)."{$lang_type}.cache.php";
891 891
 	}
892 892
 
893 893
 	/**
@@ -896,15 +896,15 @@  discard block
 block discarded – undo
896 896
 	 * @param string $lang_type
897 897
 	 * @return string
898 898
 	 */
899
-	function getLayoutCache($layout_name,$lang_type,$layout_type='P')
899
+	function getLayoutCache($layout_name, $lang_type, $layout_type = 'P')
900 900
 	{
901
-		if($layout_type=='P')
901
+		if ($layout_type == 'P')
902 902
 		{
903
-			return sprintf("%sfiles/cache/layout/%s.%s.cache.php", _XE_PATH_, $layout_name,$lang_type);
903
+			return sprintf("%sfiles/cache/layout/%s.%s.cache.php", _XE_PATH_, $layout_name, $lang_type);
904 904
 		}
905 905
 		else
906 906
 		{
907
-			return sprintf("%sfiles/cache/layout/m.%s.%s.cache.php", _XE_PATH_, $layout_name,$lang_type);
907
+			return sprintf("%sfiles/cache/layout/m.%s.%s.cache.php", _XE_PATH_, $layout_name, $lang_type);
908 908
 		}
909 909
 	}
910 910
 
@@ -915,7 +915,7 @@  discard block
 block discarded – undo
915 915
 	 */
916 916
 	function getDefaultLayoutIni($layout_name)
917 917
 	{
918
-		return $this->getDefaultLayoutPath($layout_name). 'layout.ini';
918
+		return $this->getDefaultLayoutPath($layout_name).'layout.ini';
919 919
 	}
920 920
 
921 921
 	/**
@@ -925,7 +925,7 @@  discard block
 block discarded – undo
925 925
 	 */
926 926
 	function getDefaultLayoutHtml($layout_name)
927 927
 	{
928
-		return $this->getDefaultLayoutPath($layout_name). 'layout.html';
928
+		return $this->getDefaultLayoutPath($layout_name).'layout.html';
929 929
 	}
930 930
 
931 931
 	/**
@@ -935,7 +935,7 @@  discard block
 block discarded – undo
935 935
 	 */
936 936
 	function getDefaultLayoutCss($layout_name)
937 937
 	{
938
-		return $this->getDefaultLayoutPath($layout_name). 'css/layout.css';
938
+		return $this->getDefaultLayoutPath($layout_name).'css/layout.css';
939 939
 	}
940 940
 
941 941
 	/**
@@ -964,7 +964,7 @@  discard block
 block discarded – undo
964 964
 	 * @param string $flag (default 'temp')
965 965
 	 * @return void
966 966
 	 */
967
-	function setUseUserLayoutTemp($flag='temp')
967
+	function setUseUserLayoutTemp($flag = 'temp')
968 968
 	{
969 969
 		$this->useUserLayoutTemp = $flag;
970 970
 	}
@@ -998,11 +998,11 @@  discard block
 block discarded – undo
998 998
 		);
999 999
 
1000 1000
 		$image_path = $this->getUserLayoutImagePath($layout_srl);
1001
-		$image_list = FileHandler::readDir($image_path,'/(.*(?:swf|jpg|jpeg|gif|bmp|png)$)/i');
1001
+		$image_list = FileHandler::readDir($image_path, '/(.*(?:swf|jpg|jpeg|gif|bmp|png)$)/i');
1002 1002
 
1003
-		foreach($image_list as $image)
1003
+		foreach ($image_list as $image)
1004 1004
 		{
1005
-			$file_list[] = 'images/' . $image;
1005
+			$file_list[] = 'images/'.$image;
1006 1006
 		}
1007 1007
 		return $file_list;
1008 1008
 	}
@@ -1020,20 +1020,20 @@  discard block
 block discarded – undo
1020 1020
 		Context::addCSSFile($this->getDefaultLayoutCss($layout_info->layout));
1021 1021
 		// CSS generated in the layout manager
1022 1022
 		$faceoff_layout_css = $this->getUserLayoutFaceOffCss($layout_info->layout_srl);
1023
-		if($faceoff_layout_css) Context::addCSSFile($faceoff_layout_css);
1023
+		if ($faceoff_layout_css) Context::addCSSFile($faceoff_layout_css);
1024 1024
 		// CSS output for the widget
1025 1025
 		Context::loadFile($this->module_path.'/tpl/css/widget.css', true);
1026
-		if($layout_info->extra_var->colorset->value == 'black') Context::loadFile($this->module_path.'/tpl/css/[email protected]', true);
1026
+		if ($layout_info->extra_var->colorset->value == 'black') Context::loadFile($this->module_path.'/tpl/css/[email protected]', true);
1027 1027
 		else Context::loadFile($this->module_path.'/tpl/css/[email protected]', true);
1028 1028
 		// Different page displayed upon user's permission
1029 1029
 		$logged_info = Context::get('logged_info');
1030 1030
 		// Display edit button for faceoff layout
1031
-		if(Context::get('module')!='admin' && strpos(Context::get('act'),'Admin')===false && ($logged_info->is_admin == 'Y' || $logged_info->is_site_admin))
1031
+		if (Context::get('module') != 'admin' && strpos(Context::get('act'), 'Admin') === false && ($logged_info->is_admin == 'Y' || $logged_info->is_site_admin))
1032 1032
 		{
1033
-			Context::addHtmlFooter('<div class="faceOffManager" style="height: 23px; position: fixed; right: 3px; top: 3px;"><a href="'.getUrl('','mid',Context::get('mid'),'act','dispLayoutAdminLayoutModify','delete_tmp','Y').'">'.Context::getLang('cmd_layout_edit').'</a></div>');
1033
+			Context::addHtmlFooter('<div class="faceOffManager" style="height: 23px; position: fixed; right: 3px; top: 3px;"><a href="'.getUrl('', 'mid', Context::get('mid'), 'act', 'dispLayoutAdminLayoutModify', 'delete_tmp', 'Y').'">'.Context::getLang('cmd_layout_edit').'</a></div>');
1034 1034
 		}
1035 1035
 		// Display menu when editing the faceOff page
1036
-		if(Context::get('act')=='dispLayoutAdminLayoutModify' && ($logged_info->is_admin == 'Y' || $logged_info->is_site_admin))
1036
+		if (Context::get('act') == 'dispLayoutAdminLayoutModify' && ($logged_info->is_admin == 'Y' || $logged_info->is_site_admin))
1037 1037
 		{
1038 1038
 			$oTemplate = &TemplateHandler::getInstance();
1039 1039
 			Context::addBodyHeader($oTemplate->compile($this->module_path.'/tpl', 'faceoff_layout_menu'));
Please login to merge, or discard this patch.
modules/layout/layout.view.php 3 patches
Doc Comments   +7 added lines, -1 removed lines patch added patch discarded remove patch
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
 
313 313
 	/**
314 314
 	 * Preview a layout
315
-	 * @return void|Object (void : success, Object : fail)
315
+	 * @return Object|null (void : success, Object : fail)
316 316
 	 */
317 317
 	function dispLayoutPreview()
318 318
 	{
@@ -376,6 +376,9 @@  discard block
 block discarded – undo
376 376
 		$this->setTemplateFile('layout_preview');
377 377
 	}
378 378
 
379
+	/**
380
+	 * @return string
381
+	 */
379 382
 	private function getRealLayoutFile($layoutSrl)
380 383
 	{
381 384
 		$oLayoutModel = getModel('layout');
@@ -392,6 +395,9 @@  discard block
 block discarded – undo
392 395
 
393 396
 	}
394 397
 
398
+	/**
399
+	 * @return string
400
+	 */
395 401
 	private function getRealLayoutCSS($layoutSrl)
396 402
 	{
397 403
 		$oLayoutModel = getModel('layout');
Please login to merge, or discard this patch.
Braces   +26 added lines, -22 removed lines patch added patch discarded remove patch
@@ -25,7 +25,9 @@  discard block
 block discarded – undo
25 25
 		// Get the layout information
26 26
 		$oLayoutModel = getModel('layout');
27 27
 		$layout_info = $oLayoutModel->getLayoutInfo(Context::get('selected_layout'));
28
-		if(!$layout_info) exit();
28
+		if(!$layout_info) {
29
+			exit();
30
+		}
29 31
 		Context::set('layout_info', $layout_info);
30 32
 		// Set the layout to be pop-up
31 33
 		$this->setLayoutFile('popup_layout');
@@ -89,8 +91,7 @@  discard block
 block discarded – undo
89 91
 				{
90 92
 					$templatePath = _XE_PATH_ . 'modules/page/m.skins/' . $skin;
91 93
 					$templateFile = 'mobile';
92
-				}
93
-				else
94
+				} else
94 95
 				{
95 96
 					$templatePath = _XE_PATH_ . 'modules/page/skins/' . $skin;
96 97
 					$templateFile = 'content';
@@ -119,8 +120,7 @@  discard block
 block discarded – undo
119 120
 					if($skinType == 'M')
120 121
 					{
121 122
 						$layoutSrl = $designInfo->mlayout_srl;
122
-					}
123
-					else
123
+					} else
124 124
 					{
125 125
 						$layoutSrl = $designInfo->layout_srl;
126 126
 					}
@@ -172,8 +172,7 @@  discard block
 block discarded – undo
172 172
 									$menu->xml_file = str_replace('.xml.php', $homeMenuSrl . '.xml.php', $menu->xml_file);
173 173
 									$menu->php_file = str_replace('.php', $homeMenuSrl . '.php', $menu->php_file);
174 174
 									$layoutInfo->menu->{$menu_id}->menu_srl = $homeMenuSrl;
175
-								}
176
-								else
175
+								} else
177 176
 								{
178 177
 									$menu->xml_file = str_replace($menu->menu_srl, $homeMenuSrl, $menu->xml_file);
179 178
 									$menu->php_file = str_replace($menu->menu_srl, $homeMenuSrl, $menu->php_file);
@@ -192,8 +191,7 @@  discard block
 block discarded – undo
192 191
 					Context::set('layout_info', $layoutInfo);
193 192
 				}
194 193
 			}
195
-		}
196
-		catch(Exception $e)
194
+		} catch(Exception $e)
197 195
 		{
198 196
 			$content = '<div class="message error"><p id="preview_error">' . $e->getMessage() . '</p></div>';
199 197
 			Context::set('content', $content);
@@ -217,8 +215,7 @@  discard block
 block discarded – undo
217 215
 			$oModuleModel = getModel('module');
218 216
 			$part_config = $oModuleModel->getModulePartConfig('layout', $layoutSrl);
219 217
 			Context::addHtmlHeader($part_config->header_script);
220
-		}
221
-		else
218
+		} else
222 219
 		{
223 220
 			$layout_path = './common/tpl';
224 221
 			$layout_file = 'default_layout';
@@ -290,8 +287,7 @@  discard block
 block discarded – undo
290 287
 		{
291 288
 			Mobile::setMobile(TRUE);
292 289
 			$oModuleHandler->module_info->mskin = $skin;
293
-		}
294
-		else
290
+		} else
295 291
 		{
296 292
 			Mobile::setMobile(FALSE);
297 293
 			$oModuleHandler->module_info->skin = $skin;
@@ -319,19 +315,27 @@  discard block
 block discarded – undo
319 315
 		// admin check
320 316
 		// this act is admin view but in normal view because do not load admin css/js files
321 317
 		$logged_info = Context::get('logged_info');
322
-		if($logged_info->is_admin != 'Y') return $this->stop('msg_invalid_request');
318
+		if($logged_info->is_admin != 'Y') {
319
+			return $this->stop('msg_invalid_request');
320
+		}
323 321
 
324 322
 		$layout_srl = Context::get('layout_srl');
325 323
 		$code = Context::get('code');
326 324
 
327 325
 		$code_css = Context::get('code_css');
328
-		if(!$layout_srl || !$code) return new Object(-1, 'msg_invalid_request');
326
+		if(!$layout_srl || !$code) {
327
+			return new Object(-1, 'msg_invalid_request');
328
+		}
329 329
 		// Get the layout information
330 330
 		$oLayoutModel = getModel('layout');
331 331
 		$layout_info = $oLayoutModel->getLayout($layout_srl);
332
-		if(!$layout_info) return new Object(-1, 'msg_invalid_request');
332
+		if(!$layout_info) {
333
+			return new Object(-1, 'msg_invalid_request');
334
+		}
333 335
 		// Separately handle the layout if its type is faceoff
334
-		if($layout_info && $layout_info->type == 'faceoff') $oLayoutModel->doActivateFaceOff($layout_info);
336
+		if($layout_info && $layout_info->type == 'faceoff') {
337
+			$oLayoutModel->doActivateFaceOff($layout_info);
338
+		}
335 339
 		// Apply CSS directly
336 340
 		Context::addHtmlHeader("<style type=\"text/css\" charset=\"UTF-8\">".$code_css."</style>");
337 341
 		// Set names and values of extra_vars to $layout_info
@@ -348,7 +352,9 @@  discard block
 block discarded – undo
348 352
 			foreach($layout_info->menu as $menu_id => $menu)
349 353
 			{
350 354
 				$menu->php_file = FileHandler::getRealPath($menu->php_file);
351
-				if(FileHandler::exists($menu->php_file)) include($menu->php_file);
355
+				if(FileHandler::exists($menu->php_file)) {
356
+					include($menu->php_file);
357
+				}
352 358
 
353 359
 				Context::set($menu_id, $menu);
354 360
 			}
@@ -384,8 +390,7 @@  discard block
 block discarded – undo
384 390
 		if(file_exists($layoutFile))
385 391
 		{
386 392
 			return $layoutFile;
387
-		}
388
-		else
393
+		} else
389 394
 		{
390 395
 			return ''; 
391 396
 		}
@@ -400,8 +405,7 @@  discard block
 block discarded – undo
400 405
 		if(file_exists($cssFile))
401 406
 		{
402 407
 			return $cssFile;
403
-		}
404
-		else
408
+		} else
405 409
 		{
406 410
 			return ''; 
407 411
 		}
Please login to merge, or discard this patch.
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 		// Get the layout information
26 26
 		$oLayoutModel = getModel('layout');
27 27
 		$layout_info = $oLayoutModel->getLayoutInfo(Context::get('selected_layout'));
28
-		if(!$layout_info) exit();
28
+		if (!$layout_info) exit();
29 29
 		Context::set('layout_info', $layout_info);
30 30
 		// Set the layout to be pop-up
31 31
 		$this->setLayoutFile('popup_layout');
@@ -53,13 +53,13 @@  discard block
 block discarded – undo
53 53
 			// admin check
54 54
 			// this act is admin view but in normal view because do not load admin css/js files
55 55
 			$logged_info = Context::get('logged_info');
56
-			if($logged_info->is_admin != 'Y')
56
+			if ($logged_info->is_admin != 'Y')
57 57
 			{
58 58
 				throw new Exception(Context::getLang('msg_invalid_request'));
59 59
 			}
60 60
 
61 61
 			// if module is 'ARTiCLE' and from site design setting, make content directly
62
-			if($module == 'ARTICLE' && !$mid)
62
+			if ($module == 'ARTICLE' && !$mid)
63 63
 			{
64 64
 				$oDocumentModel = getModel('document');
65 65
 				$oDocument = $oDocumentModel->getDocument(0, true);
@@ -67,12 +67,12 @@  discard block
 block discarded – undo
67 67
 				$t = Context::getLang('article_preview_title');
68 68
 
69 69
 				$c = '';
70
-				for($i = 0; $i < 4; $i++)
70
+				for ($i = 0; $i < 4; $i++)
71 71
 				{
72 72
 					$c .= '<p>';
73
-					for($j = 0; $j < 20; $j++)
73
+					for ($j = 0; $j < 20; $j++)
74 74
 					{
75
-						$c .= Context::getLang('article_preview_content') . ' ';
75
+						$c .= Context::getLang('article_preview_content').' ';
76 76
 					}
77 77
 					$c .= '</p>';
78 78
 				}
@@ -87,12 +87,12 @@  discard block
 block discarded – undo
87 87
 
88 88
 				if ($skinType == 'M')
89 89
 				{
90
-					$templatePath = _XE_PATH_ . 'modules/page/m.skins/' . $skin;
90
+					$templatePath = _XE_PATH_.'modules/page/m.skins/'.$skin;
91 91
 					$templateFile = 'mobile';
92 92
 				}
93 93
 				else
94 94
 				{
95
-					$templatePath = _XE_PATH_ . 'modules/page/skins/' . $skin;
95
+					$templatePath = _XE_PATH_.'modules/page/skins/'.$skin;
96 96
 					$templateFile = 'content';
97 97
 				}
98 98
 
@@ -108,15 +108,15 @@  discard block
 block discarded – undo
108 108
 			Context::set('content', $content);
109 109
 
110 110
 			// find layout
111
-			if($layoutSrl)
111
+			if ($layoutSrl)
112 112
 			{
113
-				if($layoutSrl == -1)
113
+				if ($layoutSrl == -1)
114 114
 				{
115 115
 					$site_srl = ($oModule) ? $oModule->module_info->site_srl : 0;
116
-					$designInfoFile = sprintf(_XE_PATH_ . 'files/site_design/design_%s.php', $site_srl);
116
+					$designInfoFile = sprintf(_XE_PATH_.'files/site_design/design_%s.php', $site_srl);
117 117
 					include($designInfoFile);
118 118
 
119
-					if($skinType == 'M')
119
+					if ($skinType == 'M')
120 120
 					{
121 121
 						$layoutSrl = $designInfo->mlayout_srl;
122 122
 					}
@@ -130,21 +130,21 @@  discard block
 block discarded – undo
130 130
 				$layoutInfo = $oLayoutModel->getLayout($layoutSrl);
131 131
 
132 132
 				// If there is no layout, pass it.
133
-				if($layoutInfo)
133
+				if ($layoutInfo)
134 134
 				{
135 135
 					// Adhoc...
136 136
 
137 137
 					// Input extra_vars into $layout_info
138
-					if($layoutInfo->extra_var_count)
138
+					if ($layoutInfo->extra_var_count)
139 139
 					{
140 140
 
141
-						foreach($layoutInfo->extra_var as $var_id => $val)
141
+						foreach ($layoutInfo->extra_var as $var_id => $val)
142 142
 						{
143
-							if($val->type == 'image')
143
+							if ($val->type == 'image')
144 144
 							{
145
-								if(strncmp('./files/attach/images/', $val->value, 22) === 0)
145
+								if (strncmp('./files/attach/images/', $val->value, 22) === 0)
146 146
 								{
147
-									$val->value = Context::getRequestUri() . substr($val->value, 2);
147
+									$val->value = Context::getRequestUri().substr($val->value, 2);
148 148
 								}
149 149
 							}
150 150
 							$layoutInfo->{$var_id} = $val->value;
@@ -152,25 +152,25 @@  discard block
 block discarded – undo
152 152
 					}
153 153
 
154 154
 					// Set menus into context
155
-					if($layoutInfo->menu_count)
155
+					if ($layoutInfo->menu_count)
156 156
 					{
157
-						foreach($layoutInfo->menu as $menu_id => $menu)
157
+						foreach ($layoutInfo->menu as $menu_id => $menu)
158 158
 						{
159 159
 							// set default menu set(included home menu)
160
-							if(!$menu->menu_srl || $menu->menu_srl == -1)
160
+							if (!$menu->menu_srl || $menu->menu_srl == -1)
161 161
 							{
162 162
 								$oMenuAdminController = getAdminController('menu');
163 163
 								$homeMenuCacheFile = $oMenuAdminController->getHomeMenuCacheFile();
164 164
 
165
-								if(file_exists($homeMenuCacheFile))
165
+								if (file_exists($homeMenuCacheFile))
166 166
 								{
167 167
 									include($homeMenuCacheFile);
168 168
 								}
169 169
 
170
-								if(!$menu->menu_srl)
170
+								if (!$menu->menu_srl)
171 171
 								{
172
-									$menu->xml_file = str_replace('.xml.php', $homeMenuSrl . '.xml.php', $menu->xml_file);
173
-									$menu->php_file = str_replace('.php', $homeMenuSrl . '.php', $menu->php_file);
172
+									$menu->xml_file = str_replace('.xml.php', $homeMenuSrl.'.xml.php', $menu->xml_file);
173
+									$menu->php_file = str_replace('.php', $homeMenuSrl.'.php', $menu->php_file);
174 174
 									$layoutInfo->menu->{$menu_id}->menu_srl = $homeMenuSrl;
175 175
 								}
176 176
 								else
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 							}
182 182
 
183 183
 							$menu->php_file = FileHandler::getRealPath($menu->php_file);
184
-							if(FileHandler::exists($menu->php_file))
184
+							if (FileHandler::exists($menu->php_file))
185 185
 							{
186 186
 								include($menu->php_file);
187 187
 							}
@@ -193,9 +193,9 @@  discard block
 block discarded – undo
193 193
 				}
194 194
 			}
195 195
 		}
196
-		catch(Exception $e)
196
+		catch (Exception $e)
197 197
 		{
198
-			$content = '<div class="message error"><p id="preview_error">' . $e->getMessage() . '</p></div>';
198
+			$content = '<div class="message error"><p id="preview_error">'.$e->getMessage().'</p></div>';
199 199
 			Context::set('content', $content);
200 200
 			$layoutSrl = 0;
201 201
 		}
@@ -204,12 +204,12 @@  discard block
 block discarded – undo
204 204
 		$oTemplate = TemplateHandler::getInstance();
205 205
 		Context::clearHtmlHeader();
206 206
 
207
-		if($layoutInfo)
207
+		if ($layoutInfo)
208 208
 		{
209 209
 			$layout_path = $layoutInfo->path;
210 210
 			$editLayoutTPL = $this->getRealLayoutFile($layoutSrl);
211 211
 			$editLayoutCSS = $this->getRealLayoutCSS($layoutSrl);
212
-			if($editLayoutCSS != '')
212
+			if ($editLayoutCSS != '')
213 213
 			{
214 214
 				Context::addCSSFile($editLayoutCSS);
215 215
 			}
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 		}
226 226
 
227 227
 		$layout_tpl = $oTemplate->compile($layout_path, $layout_file, $editLayoutTPL);
228
-		Context::set('layout','none');
228
+		Context::set('layout', 'none');
229 229
 
230 230
 		// Convert widgets and others
231 231
 		$oContext = Context::getInstance();
@@ -246,18 +246,18 @@  discard block
 block discarded – undo
246 246
 	private function procRealModule($module, $mid, $skin, $skinType)
247 247
 	{
248 248
 		// if form site design and preview module, find target module
249
-		if($module && !$mid)
249
+		if ($module && !$mid)
250 250
 		{
251 251
 			$args = new stdClass();
252 252
 			$args->module = $module;
253 253
 			$output = executeQuery('layout.getOneModuleInstanceByModuleName', $args);
254
-			if(!$output->toBool())
254
+			if (!$output->toBool())
255 255
 			{
256 256
 				throw new Exception($output->getMessage());
257 257
 			}
258 258
 
259 259
 			// if there is no module instance, error...
260
-			if(!$output->data)
260
+			if (!$output->data)
261 261
 			{
262 262
 				throw new Exception(Context::getLang('msg_unabled_preview'));
263 263
 			}
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
 		}
267 267
 
268 268
 		// if form site design and preview layout, find start module
269
-		elseif(!$module && !$mid)
269
+		elseif (!$module && !$mid)
270 270
 		{
271 271
 			$oModuleModel = getModel('module');
272 272
 			$columnList = array('modules.mid', 'sites.index_module_srl');
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
 		$oModuleHandler->module_info->is_skin_fix = 'Y';
287 287
 		$oModuleHandler->module_info->is_mskin_fix = 'Y';
288 288
 
289
-		if($skinType == 'M')
289
+		if ($skinType == 'M')
290 290
 		{
291 291
 			Mobile::setMobile(TRUE);
292 292
 			$oModuleHandler->module_info->mskin = $skin;
@@ -299,13 +299,13 @@  discard block
 block discarded – undo
299 299
 
300 300
 		// Proc module
301 301
 		$oModule = $oModuleHandler->procModule();
302
-		if(!$oModule->toBool())
302
+		if (!$oModule->toBool())
303 303
 		{
304 304
 			throw new Exception(Context::getLang('not_support_layout_preview'));
305 305
 		}
306 306
 
307 307
 		// get module html
308
-		require_once(_XE_PATH_ . "classes/display/HTMLDisplayHandler.php");
308
+		require_once(_XE_PATH_."classes/display/HTMLDisplayHandler.php");
309 309
 		$handler = new HTMLDisplayHandler();
310 310
 		return $handler->toDoc($oModule);
311 311
 	}
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 	 */
317 317
 	function dispLayoutPreview()
318 318
 	{
319
-		if(!checkCSRF())
319
+		if (!checkCSRF())
320 320
 		{
321 321
 			$this->stop('msg_invalid_request');
322 322
 			return new Object(-1, 'msg_invalid_request');
@@ -325,36 +325,36 @@  discard block
 block discarded – undo
325 325
 		// admin check
326 326
 		// this act is admin view but in normal view because do not load admin css/js files
327 327
 		$logged_info = Context::get('logged_info');
328
-		if($logged_info->is_admin != 'Y') return $this->stop('msg_invalid_request');
328
+		if ($logged_info->is_admin != 'Y') return $this->stop('msg_invalid_request');
329 329
 
330 330
 		$layout_srl = Context::get('layout_srl');
331 331
 		$code = Context::get('code');
332 332
 
333 333
 		$code_css = Context::get('code_css');
334
-		if(!$layout_srl || !$code) return new Object(-1, 'msg_invalid_request');
334
+		if (!$layout_srl || !$code) return new Object(-1, 'msg_invalid_request');
335 335
 		// Get the layout information
336 336
 		$oLayoutModel = getModel('layout');
337 337
 		$layout_info = $oLayoutModel->getLayout($layout_srl);
338
-		if(!$layout_info) return new Object(-1, 'msg_invalid_request');
338
+		if (!$layout_info) return new Object(-1, 'msg_invalid_request');
339 339
 		// Separately handle the layout if its type is faceoff
340
-		if($layout_info && $layout_info->type == 'faceoff') $oLayoutModel->doActivateFaceOff($layout_info);
340
+		if ($layout_info && $layout_info->type == 'faceoff') $oLayoutModel->doActivateFaceOff($layout_info);
341 341
 		// Apply CSS directly
342 342
 		Context::addHtmlHeader("<style type=\"text/css\" charset=\"UTF-8\">".$code_css."</style>");
343 343
 		// Set names and values of extra_vars to $layout_info
344
-		if($layout_info->extra_var_count)
344
+		if ($layout_info->extra_var_count)
345 345
 		{
346
-			foreach($layout_info->extra_var as $var_id => $val)
346
+			foreach ($layout_info->extra_var as $var_id => $val)
347 347
 			{
348 348
 				$layout_info->{$var_id} = $val->value;
349 349
 			}
350 350
 		}
351 351
 		// menu in layout information becomes an argument for Context:: set
352
-		if($layout_info->menu_count)
352
+		if ($layout_info->menu_count)
353 353
 		{
354
-			foreach($layout_info->menu as $menu_id => $menu)
354
+			foreach ($layout_info->menu as $menu_id => $menu)
355 355
 			{
356 356
 				$menu->php_file = FileHandler::getRealPath($menu->php_file);
357
-				if(FileHandler::exists($menu->php_file)) include($menu->php_file);
357
+				if (FileHandler::exists($menu->php_file)) include($menu->php_file);
358 358
 
359 359
 				Context::set($menu_id, $menu);
360 360
 			}
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
 		Context::set('layout_info', $layout_info);
364 364
 		Context::set('content', Context::getLang('layout_preview_content'));
365 365
 		// Temporary save the codes
366
-		$edited_layout_file = _XE_PATH_ . 'files/cache/layout/tmp.tpl';
366
+		$edited_layout_file = _XE_PATH_.'files/cache/layout/tmp.tpl';
367 367
 		FileHandler::writeFile($edited_layout_file, $code);
368 368
 
369 369
 		// Compile
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
 		$layout_file = 'layout';
374 374
 
375 375
 		$layout_tpl = $oTemplate->compile($layout_path, $layout_file, $edited_layout_file);
376
-		Context::set('layout','none');
376
+		Context::set('layout', 'none');
377 377
 		// Convert widgets and others
378 378
 		$oContext = &Context::getInstance();
379 379
 		Context::set('layout_tpl', $layout_tpl);
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
 		$oLayoutModel = getModel('layout');
388 388
 		$layoutFile = $oLayoutModel->getUserLayoutHtml($layoutSrl);
389 389
 
390
-		if(file_exists($layoutFile))
390
+		if (file_exists($layoutFile))
391 391
 		{
392 392
 			return $layoutFile;
393 393
 		}
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
 		$oLayoutModel = getModel('layout');
404 404
 		$cssFile = $oLayoutModel->getUserLayoutCss($layoutSrl);
405 405
 
406
-		if(file_exists($cssFile))
406
+		if (file_exists($cssFile))
407 407
 		{
408 408
 			return $cssFile;
409 409
 		}
Please login to merge, or discard this patch.
modules/member/member.admin.controller.php 4 patches
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1114,7 +1114,7 @@  discard block
 block discarded – undo
1114 1114
 
1115 1115
 	/**
1116 1116
 	 * Insert a group
1117
-	 * @param object $args
1117
+	 * @param null|stdClass $args
1118 1118
 	 * @return Object
1119 1119
 	 */
1120 1120
 	function insertGroup($args)
@@ -1311,6 +1311,9 @@  discard block
 block discarded – undo
1311 1311
 		return executeQuery('member.insertDeniedID', $args);
1312 1312
 	}
1313 1313
 
1314
+	/**
1315
+	 * @param string $nick_name
1316
+	 */
1314 1317
 	function insertDeniedNickName($nick_name, $description = '')
1315 1318
 	{
1316 1319
 		$args = new stdClass();
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1284,7 +1284,7 @@
 block discarded – undo
1284 1284
 	/**
1285 1285
 	 * Delete cached group data
1286 1286
 	 * @return void
1287
-	*/
1287
+	 */
1288 1288
 	function _deleteMemberGroupCache($site_srl = 0)
1289 1289
 	{
1290 1290
 		//remove from cache
Please login to merge, or discard this patch.
Spacing   +175 added lines, -175 removed lines patch added patch discarded remove patch
@@ -24,31 +24,31 @@  discard block
 block discarded – undo
24 24
 		// if(Context::getRequestMethod() == "GET") return new Object(-1, "msg_invalid_request");
25 25
 		// Extract the necessary information in advance
26 26
 		$logged_info = Context::get('logged_info');
27
-		if($logged_info->is_admin != 'Y' || !checkCSRF())
27
+		if ($logged_info->is_admin != 'Y' || !checkCSRF())
28 28
 		{
29 29
 			return new Object(-1, 'msg_invalid_request');
30 30
 		}
31 31
 
32
-		$args = Context::gets('member_srl','email_address','find_account_answer', 'allow_mailing','allow_message','denied','is_admin','description','group_srl_list','limit_date');
33
-		$oMemberModel = &getModel ('member');
34
-		$config = $oMemberModel->getMemberConfig ();
32
+		$args = Context::gets('member_srl', 'email_address', 'find_account_answer', 'allow_mailing', 'allow_message', 'denied', 'is_admin', 'description', 'group_srl_list', 'limit_date');
33
+		$oMemberModel = &getModel('member');
34
+		$config = $oMemberModel->getMemberConfig();
35 35
 		$getVars = array();
36
-		if($config->signupForm)
36
+		if ($config->signupForm)
37 37
 		{
38
-			foreach($config->signupForm as $formInfo)
38
+			foreach ($config->signupForm as $formInfo)
39 39
 			{
40
-				if($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
40
+				if ($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
41 41
 				{
42 42
 					$getVars[] = $formInfo->name;
43 43
 				}
44 44
 			}
45 45
 		}
46
-		foreach($getVars as $val)
46
+		foreach ($getVars as $val)
47 47
 		{
48 48
 			$args->{$val} = Context::get($val);
49 49
 		}
50 50
 		$args->member_srl = Context::get('member_srl');
51
-		if(Context::get('reset_password'))
51
+		if (Context::get('reset_password'))
52 52
 			$args->password = Context::get('reset_password');
53 53
 		else unset($args->password);
54 54
 
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 		unset($all_args->error_return_url);
61 61
 		unset($all_args->success_return_url);
62 62
 		unset($all_args->ruleset);
63
-		if(!isset($args->limit_date)) $args->limit_date = "";
63
+		if (!isset($args->limit_date)) $args->limit_date = "";
64 64
 		unset($all_args->password);
65 65
 		unset($all_args->password2);
66 66
 		unset($all_args->reset_password);
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 		$extra_vars = delObjectVars($all_args, $args);
69 69
 		$args->extra_vars = serialize($extra_vars);
70 70
 		// Check if an original member exists having the member_srl
71
-		if($args->member_srl)
71
+		if ($args->member_srl)
72 72
 		{
73 73
 			// Create a member model object
74 74
 			$oMemberModel = getModel('member');
@@ -76,14 +76,14 @@  discard block
 block discarded – undo
76 76
 			$columnList = array('member_srl');
77 77
 			$member_info = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl, 0, $columnList);
78 78
 			// If no original member exists, make a new one
79
-			if($member_info->member_srl != $args->member_srl) unset($args->member_srl);
79
+			if ($member_info->member_srl != $args->member_srl) unset($args->member_srl);
80 80
 		}
81 81
 
82 82
 		// remove whitespace
83 83
 		$checkInfos = array('user_id', 'user_name', 'nick_name', 'email_address');
84
-		foreach($checkInfos as $val)
84
+		foreach ($checkInfos as $val)
85 85
 		{
86
-			if(isset($args->{$val}))
86
+			if (isset($args->{$val}))
87 87
 			{
88 88
 				$args->{$val} = preg_replace('/[\pZ\pC]+/u', '', $args->{$val});
89 89
 			}
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 
92 92
 		$oMemberController = getController('member');
93 93
 		// Execute insert or update depending on the value of member_srl
94
-		if(!$args->member_srl)
94
+		if (!$args->member_srl)
95 95
 		{
96 96
 			$args->password = Context::get('password');
97 97
 			$output = $oMemberController->insertMember($args);
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 			$msg_code = 'success_updated';
104 104
 		}
105 105
 
106
-		if(!$output->toBool()) return $output;
106
+		if (!$output->toBool()) return $output;
107 107
 		// Save Signature
108 108
 		$signature = Context::get('signature');
109 109
 		$oMemberController->putSignature($args->member_srl, $signature);
@@ -112,13 +112,13 @@  discard block
 block discarded – undo
112 112
 		$this->setMessage($msg_code);
113 113
 
114 114
 		$profile_image = $_FILES['profile_image'];
115
-		if(is_uploaded_file($profile_image['tmp_name']))
115
+		if (is_uploaded_file($profile_image['tmp_name']))
116 116
 		{
117 117
 			$oMemberController->insertProfileImage($args->member_srl, $profile_image['tmp_name']);
118 118
 		}
119 119
 
120 120
 		$image_mark = $_FILES['image_mark'];
121
-		if(is_uploaded_file($image_mark['tmp_name']))
121
+		if (is_uploaded_file($image_mark['tmp_name']))
122 122
 		{
123 123
 			$oMemberController->insertImageMark($args->member_srl, $image_mark['tmp_name']);
124 124
 		}
@@ -144,9 +144,9 @@  discard block
 block discarded – undo
144 144
 
145 145
 		$oMemberController = getController('member');
146 146
 		$output = $oMemberController->deleteMember($member_srl);
147
-		if(!$output->toBool()) return $output;
147
+		if (!$output->toBool()) return $output;
148 148
 
149
-		$this->add('page',Context::get('page'));
149
+		$this->add('page', Context::get('page'));
150 150
 		$this->setMessage("success_deleted");
151 151
 	}
152 152
 
@@ -165,26 +165,26 @@  discard block
 block discarded – undo
165 165
 		);
166 166
 		
167 167
 		$oPassword = new Password();
168
-		if(!array_key_exists($args->password_hashing_algorithm, $oPassword->getSupportedAlgorithms()))
168
+		if (!array_key_exists($args->password_hashing_algorithm, $oPassword->getSupportedAlgorithms()))
169 169
 		{
170 170
 			$args->password_hashing_algorithm = 'md5';
171 171
 		}
172 172
 		
173 173
 		$args->password_hashing_work_factor = intval($args->password_hashing_work_factor, 10);
174
-		if($args->password_hashing_work_factor < 4)
174
+		if ($args->password_hashing_work_factor < 4)
175 175
 		{
176 176
 			$args->password_hashing_work_factor = 4;
177 177
 		}
178
-		if($args->password_hashing_work_factor > 16)
178
+		if ($args->password_hashing_work_factor > 16)
179 179
 		{
180 180
 			$args->password_hashing_work_factor = 16;
181 181
 		}
182
-		if($args->password_hashing_auto_upgrade != 'Y')
182
+		if ($args->password_hashing_auto_upgrade != 'Y')
183 183
 		{
184 184
 			$args->password_hashing_auto_upgrade = 'N';
185 185
 		}
186 186
 
187
-		if((!$args->webmaster_name || !$args->webmaster_email) && $args->enable_confirm == 'Y')
187
+		if ((!$args->webmaster_name || !$args->webmaster_email) && $args->enable_confirm == 'Y')
188 188
 		{
189 189
 			return new Object(-1, 'msg_mail_authorization');
190 190
 		}
@@ -219,20 +219,20 @@  discard block
 block discarded – undo
219 219
 		$usable_list = Context::get('usable_list');
220 220
 		$all_args = Context::getRequestVars();
221 221
 
222
-		$args->limit_day = (int)$args->limit_day;
223
-		if(!trim(strip_tags($args->agreement)))
222
+		$args->limit_day = (int) $args->limit_day;
223
+		if (!trim(strip_tags($args->agreement)))
224 224
 		{
225
-			$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_' . Context::get('lang_type') . '.txt';
225
+			$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_'.Context::get('lang_type').'.txt';
226 226
 			FileHandler::removeFile($agreement_file);
227 227
 			$args->agreement = NULL;
228 228
 		}
229 229
 
230
-		if($args->redirect_url)
230
+		if ($args->redirect_url)
231 231
 		{
232 232
 			$oModuleModel = getModel('module');
233 233
 			$redirectModuleInfo = $oModuleModel->getModuleInfoByModuleSrl($args->redirect_url, array('mid'));
234 234
 
235
-			if(!$redirectModuleInfo)
235
+			if (!$redirectModuleInfo)
236 236
 			{
237 237
 				return new Object('-1', 'msg_exist_selected_module');
238 238
 			}
@@ -256,28 +256,28 @@  discard block
 block discarded – undo
256 256
 		$items = array('user_id', 'password', 'user_name', 'nick_name', 'email_address', 'find_account_question', 'homepage', 'blog', 'birthday', 'signature', 'profile_image', 'image_name', 'image_mark', 'profile_image_max_width', 'profile_image_max_height', 'image_name_max_width', 'image_name_max_height', 'image_mark_max_width', 'image_mark_max_height');
257 257
 		$mustRequireds = array('email_address', 'nick_name', 'password', 'find_account_question');
258 258
 		$extendItems = $oMemberModel->getJoinFormList();
259
-		foreach($list_order as $key)
259
+		foreach ($list_order as $key)
260 260
 		{
261 261
 			$signupItem = new stdClass();
262 262
 			$signupItem->isIdentifier = ($key == $all_args->identifier);
263 263
 			$signupItem->isDefaultForm = in_array($key, $items);
264 264
 
265 265
 			$signupItem->name = $key;
266
-			if(!in_array($key, $items)) $signupItem->title = $key;
266
+			if (!in_array($key, $items)) $signupItem->title = $key;
267 267
 			else $signupItem->title = $lang->{$key};
268 268
 			$signupItem->mustRequired = in_array($key, $mustRequireds);
269 269
 			$signupItem->imageType = (strpos($key, 'image') !== false);
270 270
 			$signupItem->required = ($all_args->{$key} == 'required') || $signupItem->mustRequired || $signupItem->isIdentifier;
271 271
 			$signupItem->isUse = in_array($key, $usable_list) || $signupItem->required;
272 272
 			$signupItem->isPublic = ($all_args->{'is_'.$key.'_public'} == 'Y' && $signupItem->isUse) ? 'Y' : 'N';
273
-			if($signupItem->imageType)
273
+			if ($signupItem->imageType)
274 274
 			{
275 275
 				$signupItem->max_width = $all_args->{$key.'_max_width'};
276 276
 				$signupItem->max_height = $all_args->{$key.'_max_height'};
277 277
 			}
278 278
 
279 279
 			// set extends form
280
-			if(!$signupItem->isDefaultForm)
280
+			if (!$signupItem->isDefaultForm)
281 281
 			{
282 282
 				$extendItem = $extendItems[$all_args->{$key.'_member_join_form_srl'}];
283 283
 				$signupItem->type = $extendItem->column_type;
@@ -286,13 +286,13 @@  discard block
 block discarded – undo
286 286
 				$signupItem->description = $extendItem->description;
287 287
 
288 288
 				// check usable value change, required/option
289
-				if($signupItem->isUse != ($extendItem->is_active == 'Y') || $signupItem->required != ($extendItem->required == 'Y'))
289
+				if ($signupItem->isUse != ($extendItem->is_active == 'Y') || $signupItem->required != ($extendItem->required == 'Y'))
290 290
 				{
291 291
 					unset($update_args);
292 292
 					$update_args = new stdClass;
293 293
 					$update_args->member_join_form_srl = $extendItem->member_join_form_srl;
294
-					$update_args->is_active = $signupItem->isUse?'Y':'N';
295
-					$update_args->required = $signupItem->required?'Y':'N';
294
+					$update_args->is_active = $signupItem->isUse ? 'Y' : 'N';
295
+					$update_args->required = $signupItem->required ? 'Y' : 'N';
296 296
 
297 297
 					$update_output = executeQuery('member.updateJoinForm', $update_args);
298 298
 				}
@@ -309,9 +309,9 @@  discard block
 block discarded – undo
309 309
 		$this->_createFindAccountByQuestion($args->identifier);
310 310
 
311 311
 		// check agreement value exist
312
-		if($args->agreement)
312
+		if ($args->agreement)
313 313
 		{
314
-			$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_' . Context::get('lang_type') . '.txt';
314
+			$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_'.Context::get('lang_type').'.txt';
315 315
 			$output = FileHandler::writeFile($agreement_file, $args->agreement);
316 316
 
317 317
 			unset($args->agreement);
@@ -339,16 +339,16 @@  discard block
 block discarded – undo
339 339
 			'after_logout_url'
340 340
 		);
341 341
 
342
-		if(!$args->change_password_date)
342
+		if (!$args->change_password_date)
343 343
 		{
344 344
 			$args->change_password_date = 0;
345 345
 		}
346 346
 
347
-		if(!trim(strip_tags($args->after_login_url)))
347
+		if (!trim(strip_tags($args->after_login_url)))
348 348
 		{
349 349
 			$args->after_login_url = NULL;
350 350
 		}
351
-		if(!trim(strip_tags($args->after_logout_url)))
351
+		if (!trim(strip_tags($args->after_logout_url)))
352 352
 		{
353 353
 			$args->after_logout_url = NULL;
354 354
 		}
@@ -375,17 +375,17 @@  discard block
 block discarded – undo
375 375
 		);
376 376
 
377 377
 		$args->layout_srl = $args->layout_srl ? $args->layout_srl : NULL;
378
-		if(!$args->skin)
378
+		if (!$args->skin)
379 379
 		{
380 380
 			$args->skin = 'default';
381 381
 		}
382
-		if(!$args->colorset)
382
+		if (!$args->colorset)
383 383
 		{
384 384
 			$args->colorset = 'white';
385 385
 		}
386 386
 
387 387
 		$args->mlayout_srl = $args->mlayout_srl ? $args->mlayout_srl : NULL;
388
-		if(!$args->mskin)
388
+		if (!$args->mskin)
389 389
 		{
390 390
 			$args->mskin = 'default';
391 391
 		}
@@ -408,12 +408,12 @@  discard block
 block discarded – undo
408 408
 		$extendItems = $oMemberModel->getJoinFormList();
409 409
 
410 410
 		$items = array('user_id', 'password', 'user_name', 'nick_name', 'email_address', 'find_account_question', 'homepage', 'blog', 'birthday', 'signature', 'profile_image', 'image_name', 'image_mark');
411
-		$mustRequireds = array('email_address', 'nick_name','password', 'find_account_question');
411
+		$mustRequireds = array('email_address', 'nick_name', 'password', 'find_account_question');
412 412
 		$orgRequireds = array('email_address', 'password', 'find_account_question', 'user_id', 'nick_name', 'user_name');
413 413
 		$orgUse = array('email_address', 'password', 'find_account_question', 'user_id', 'nick_name', 'user_name', 'homepage', 'blog', 'birthday');
414 414
 		$list_order = array();
415 415
 
416
-		foreach($items as $key)
416
+		foreach ($items as $key)
417 417
 		{
418 418
 			unset($signupItem);
419 419
 			$signupItem = new stdClass;
@@ -425,23 +425,23 @@  discard block
 block discarded – undo
425 425
 			$signupItem->required = in_array($key, $orgRequireds);
426 426
 			$signupItem->isUse = ($config->{$key} == 'Y') || in_array($key, $orgUse);
427 427
 			$signupItem->isPublic = ($signupItem->isUse) ? 'Y' : 'N';
428
-			if($key == 'find_account_question' || $key == 'password')
428
+			if ($key == 'find_account_question' || $key == 'password')
429 429
 			{
430 430
 				$signupItem->isPublic = 'N';
431 431
 			}
432 432
 			$signupItem->isIdentifier = ($key == $identifier);
433
-			if ($signupItem->imageType){
433
+			if ($signupItem->imageType) {
434 434
 				$signupItem->max_width = $config->{$key.'_max_width'};
435 435
 				$signupItem->max_height = $config->{$key.'_max_height'};
436 436
 			}
437
-			if($signupItem->isIdentifier)
437
+			if ($signupItem->isIdentifier)
438 438
 				array_unshift($list_order, $signupItem);
439 439
 			else
440 440
 				$list_order[] = $signupItem;
441 441
 		}
442
-		if(is_array($extendItems))
442
+		if (is_array($extendItems))
443 443
 		{
444
-			foreach($extendItems as $form_srl=>$item_info)
444
+			foreach ($extendItems as $form_srl=>$item_info)
445 445
 			{
446 446
 				unset($signupItem);
447 447
 				$signupItem = new stdClass;
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
 				$signupItem->isUse = ($item_info->is_active == 'Y');
455 455
 				$signupItem->isPublic = ($signupItem->isUse) ? 'Y' : 'N';
456 456
 				$signupItem->description = $item_info->description;
457
-				if($signupItem->imageType)
457
+				if ($signupItem->imageType)
458 458
 				{
459 459
 					$signupItem->max_width = $config->{$key.'_max_width'};
460 460
 					$signupItem->max_height = $config->{$key.'_max_height'};
@@ -472,13 +472,13 @@  discard block
 block discarded – undo
472 472
 	 * @param string $agreement
473 473
 	 * @return void
474 474
 	 */
475
-	function _createSignupRuleset($signupForm, $agreement = null){
475
+	function _createSignupRuleset($signupForm, $agreement = null) {
476 476
 		$xml_file = './files/ruleset/insertMember.xml';
477
-		$buff = '<?xml version="1.0" encoding="utf-8"?>' . PHP_EOL.
478
-			'<ruleset version="1.5.0">' . PHP_EOL.
479
-			'<customrules>' . PHP_EOL.
480
-			'</customrules>' . PHP_EOL.
481
-			'<fields>' . PHP_EOL . '%s' . PHP_EOL . '</fields>' . PHP_EOL.
477
+		$buff = '<?xml version="1.0" encoding="utf-8"?>'.PHP_EOL.
478
+			'<ruleset version="1.5.0">'.PHP_EOL.
479
+			'<customrules>'.PHP_EOL.
480
+			'</customrules>'.PHP_EOL.
481
+			'<fields>'.PHP_EOL.'%s'.PHP_EOL.'</fields>'.PHP_EOL.
482 482
 			'</ruleset>';
483 483
 
484 484
 		$fields = array();
@@ -487,41 +487,41 @@  discard block
 block discarded – undo
487 487
 		{
488 488
 			$fields[] = '<field name="accept_agreement"><if test="$act == \'procMemberInsert\'" attr="required" value="true" /></field>';
489 489
 		}
490
-		foreach($signupForm as $formInfo)
490
+		foreach ($signupForm as $formInfo)
491 491
 		{
492
-			if($formInfo->required || $formInfo->mustRequired)
492
+			if ($formInfo->required || $formInfo->mustRequired)
493 493
 			{
494
-				if($formInfo->type == 'tel' || $formInfo->type == 'kr_zip')
494
+				if ($formInfo->type == 'tel' || $formInfo->type == 'kr_zip')
495 495
 				{
496 496
 					$fields[] = sprintf('<field name="%s[]" required="true" />', $formInfo->name);
497 497
 				}
498
-				else if($formInfo->name == 'password')
498
+				else if ($formInfo->name == 'password')
499 499
 				{
500 500
 					$fields[] = '<field name="password"><if test="$act == \'procMemberInsert\'" attr="required" value="true" /><if test="$act == \'procMemberInsert\'" attr="length" value="4:60" /></field>';
501 501
 					$fields[] = '<field name="password2"><if test="$act == \'procMemberInsert\'" attr="required" value="true" /><if test="$act == \'procMemberInsert\'" attr="equalto" value="password" /></field>';
502 502
 				}
503
-				else if($formInfo->name == 'find_account_question')
503
+				else if ($formInfo->name == 'find_account_question')
504 504
 				{
505 505
 					$fields[] = '<field name="find_account_question" required="true" />';
506 506
 					$fields[] = '<field name="find_account_answer" required="true" length=":250" />';
507 507
 				}
508
-				else if($formInfo->name == 'email_address')
508
+				else if ($formInfo->name == 'email_address')
509 509
 				{
510 510
 					$fields[] = sprintf('<field name="%s" required="true" rule="email"/>', $formInfo->name);
511 511
 				}
512
-				else if($formInfo->name == 'user_id')
512
+				else if ($formInfo->name == 'user_id')
513 513
 				{
514 514
 					$fields[] = sprintf('<field name="%s" required="true" rule="userid" length="3:20" />', $formInfo->name);
515 515
 				}
516
-				else if($formInfo->name == 'nick_name')
516
+				else if ($formInfo->name == 'nick_name')
517 517
 				{
518 518
 					$fields[] = sprintf('<field name="%s" required="true" length="2:20" />', $formInfo->name);
519 519
 				}
520
-				else if(strpos($formInfo->name, 'image') !== false)
520
+				else if (strpos($formInfo->name, 'image') !== false)
521 521
 				{
522 522
 					$fields[] = sprintf('<field name="%s"><if test="$act != \'procMemberAdminInsert\' &amp;&amp; $__%s_exist != \'true\'" attr="required" value="true" /></field>', $formInfo->name, $formInfo->name);
523 523
 				}
524
-				else if($formInfo->name == 'signature')
524
+				else if ($formInfo->name == 'signature')
525 525
 				{
526 526
 					$fields[] = '<field name="signature"><if test="$member_srl" attr="required" value="true" /></field>';
527 527
 				}
@@ -536,7 +536,7 @@  discard block
 block discarded – undo
536 536
 		FileHandler::writeFile($xml_file, $xml_buff);
537 537
 		unset($xml_buff);
538 538
 
539
-		$validator   = new Validator($xml_file);
539
+		$validator = new Validator($xml_file);
540 540
 		$validator->setCacheDir('files/cache');
541 541
 		$validator->getJsPath();
542 542
 	}
@@ -564,7 +564,7 @@  discard block
 block discarded – undo
564 564
 		$xml_buff = sprintf($buff, implode('', $fields));
565 565
 		Filehandler::writeFile($xml_file, $xml_buff);
566 566
 
567
-		$validator   = new Validator($xml_file);
567
+		$validator = new Validator($xml_file);
568 568
 		$validator->setCacheDir('files/cache');
569 569
 		$validator->getJsPath();
570 570
 	}
@@ -585,7 +585,7 @@  discard block
 block discarded – undo
585 585
 			'</ruleset>';
586 586
 
587 587
 		$fields = array();
588
-		if($identifier == 'user_id')
588
+		if ($identifier == 'user_id')
589 589
 			$fields[] = '<field name="user_id" required="true" rule="userid" />';
590 590
 
591 591
 		$fields[] = '<field name="email_address" required="true" rule="email" />';
@@ -595,7 +595,7 @@  discard block
 block discarded – undo
595 595
 		$xml_buff = sprintf($buff, implode('', $fields));
596 596
 		Filehandler::writeFile($xml_file, $xml_buff);
597 597
 
598
-		$validator   = new Validator($xml_file);
598
+		$validator = new Validator($xml_file);
599 599
 		$validator->setCacheDir('files/cache');
600 600
 		$validator->getJsPath();
601 601
 	}
@@ -606,12 +606,12 @@  discard block
 block discarded – undo
606 606
 	 */
607 607
 	function procMemberAdminInsertGroup()
608 608
 	{
609
-		$args = Context::gets('title','description','is_default','image_mark');
609
+		$args = Context::gets('title', 'description', 'is_default', 'image_mark');
610 610
 		$output = $this->insertGroup($args);
611
-		if(!$output->toBool()) return $output;
611
+		if (!$output->toBool()) return $output;
612 612
 
613
-		$this->add('group_srl','');
614
-		$this->add('page',Context::get('page'));
613
+		$this->add('group_srl', '');
614
+		$this->add('page', Context::get('page'));
615 615
 		$this->setMessage('success_registed');
616 616
 
617 617
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispMemberAdminGroupList');
@@ -626,13 +626,13 @@  discard block
 block discarded – undo
626 626
 	{
627 627
 		$group_srl = Context::get('group_srl');
628 628
 
629
-		$args = Context::gets('group_srl','title','description','is_default','image_mark');
629
+		$args = Context::gets('group_srl', 'title', 'description', 'is_default', 'image_mark');
630 630
 		$args->site_srl = 0;
631 631
 		$output = $this->updateGroup($args);
632
-		if(!$output->toBool()) return $output;
632
+		if (!$output->toBool()) return $output;
633 633
 
634
-		$this->add('group_srl','');
635
-		$this->add('page',Context::get('page'));
634
+		$this->add('group_srl', '');
635
+		$this->add('page', Context::get('page'));
636 636
 		$this->setMessage('success_updated');
637 637
 
638 638
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispMemberAdminGroupList');
@@ -648,10 +648,10 @@  discard block
 block discarded – undo
648 648
 		$group_srl = Context::get('group_srl');
649 649
 
650 650
 		$output = $this->deleteGroup($group_srl);
651
-		if(!$output->toBool()) return $output;
651
+		if (!$output->toBool()) return $output;
652 652
 
653
-		$this->add('group_srl','');
654
-		$this->add('page',Context::get('page'));
653
+		$this->add('group_srl', '');
654
+		$this->add('page', Context::get('page'));
655 655
 		$this->setMessage('success_deleted');
656 656
 
657 657
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispMemberAdminGroupList');
@@ -673,10 +673,10 @@  discard block
 block discarded – undo
673 673
 		$args->default_value = explode("\n", str_replace("\r", '', Context::get('default_value')));
674 674
 		$args->required = Context::get('required');
675 675
 		$args->is_active = (isset($args->required));
676
-		if(!in_array(strtoupper($args->required), array('Y','N')))$args->required = 'N';
676
+		if (!in_array(strtoupper($args->required), array('Y', 'N')))$args->required = 'N';
677 677
 		$args->description = Context::get('description') ? Context::get('description') : '';
678 678
 		// Default values
679
-		if(in_array($args->column_type, array('checkbox','select','radio')) && count($args->default_value))
679
+		if (in_array($args->column_type, array('checkbox', 'select', 'radio')) && count($args->default_value))
680 680
 		{
681 681
 			$args->default_value = serialize($args->default_value);
682 682
 		}
@@ -688,17 +688,17 @@  discard block
 block discarded – undo
688 688
 		// Check ID duplicated
689 689
 		$oMemberModel = getModel('member');
690 690
 		$config = $oMemberModel->getMemberConfig();
691
-		foreach($config->signupForm as $item)
691
+		foreach ($config->signupForm as $item)
692 692
 		{
693
-			if($item->name == $args->column_name)
693
+			if ($item->name == $args->column_name)
694 694
 			{
695
-				if($args->member_join_form_srl && $args->member_join_form_srl == $item->member_join_form_srl) continue;
696
-				return new Object(-1,'msg_exists_user_id');
695
+				if ($args->member_join_form_srl && $args->member_join_form_srl == $item->member_join_form_srl) continue;
696
+				return new Object(-1, 'msg_exists_user_id');
697 697
 			}
698 698
 		}
699 699
 		// Fix if member_join_form_srl exists. Add if not exists.
700 700
 		$isInsert;
701
-		if(!$args->member_join_form_srl)
701
+		if (!$args->member_join_form_srl)
702 702
 		{
703 703
 			$isInsert = true;
704 704
 			$args->list_order = $args->member_join_form_srl = getNextSequence();
@@ -709,7 +709,7 @@  discard block
 block discarded – undo
709 709
 			$output = executeQuery('member.updateJoinForm', $args);
710 710
 		}
711 711
 
712
-		if(!$output->toBool()) return $output;
712
+		if (!$output->toBool()) return $output;
713 713
 
714 714
 		// memberConfig update
715 715
 		$signupItem = new stdClass();
@@ -726,15 +726,15 @@  discard block
 block discarded – undo
726 726
 		$config = $oMemberModel->getMemberConfig();
727 727
 		unset($config->agreement);
728 728
 
729
-		if($isInsert)
729
+		if ($isInsert)
730 730
 		{
731 731
 			$config->signupForm[] = $signupItem;
732 732
 		}
733 733
 		else
734 734
 		{
735
-			foreach($config->signupForm as $key=>$val)
735
+			foreach ($config->signupForm as $key=>$val)
736 736
 			{
737
-				if($val->member_join_form_srl == $signupItem->member_join_form_srl)
737
+				if ($val->member_join_form_srl == $signupItem->member_join_form_srl)
738 738
 				{
739 739
 					$config->signupForm[$key] = $signupItem;
740 740
 				}
@@ -762,9 +762,9 @@  discard block
 block discarded – undo
762 762
 		$config = $oMemberModel->getMemberConfig();
763 763
 		unset($config->agreement);
764 764
 
765
-		foreach($config->signupForm as $key=>$val)
765
+		foreach ($config->signupForm as $key=>$val)
766 766
 		{
767
-			if($val->member_join_form_srl == $member_join_form_srl)
767
+			if ($val->member_join_form_srl == $member_join_form_srl)
768 768
 			{
769 769
 				unset($config->signupForm[$key]);
770 770
 				break;
@@ -784,7 +784,7 @@  discard block
 block discarded – undo
784 784
 		$member_join_form_srl = Context::get('member_join_form_srl');
785 785
 		$mode = Context::get('mode');
786 786
 
787
-		switch($mode)
787
+		switch ($mode)
788 788
 		{
789 789
 			case 'up' :
790 790
 				$output = $this->moveJoinFormUp($member_join_form_srl);
@@ -801,7 +801,7 @@  discard block
 block discarded – undo
801 801
 			case 'update' :
802 802
 				break;
803 803
 		}
804
-		if(!$output->toBool()) return $output;
804
+		if (!$output->toBool()) return $output;
805 805
 
806 806
 		$this->setMessage($msg_code);
807 807
 	}
@@ -820,40 +820,40 @@  discard block
 block discarded – undo
820 820
 		$oDB->begin();
821 821
 
822 822
 		$oMemberController = getController('member');
823
-		foreach($members as $key=>$member_srl)
823
+		foreach ($members as $key=>$member_srl)
824 824
 		{
825 825
 			$args = new stdClass();
826 826
 			$args->member_srl = $member_srl;
827
-			switch($var->type)
827
+			switch ($var->type)
828 828
 			{
829 829
 				case 'modify':
830 830
 					{
831
-						if(count($groups) > 0)
831
+						if (count($groups) > 0)
832 832
 						{
833 833
 							$args->site_srl = 0;
834 834
 							// One of its members to delete all the group
835 835
 							$output = executeQuery('member.deleteMemberGroupMember', $args);
836
-							if(!$output->toBool())
836
+							if (!$output->toBool())
837 837
 							{
838 838
 								$oDB->rollback();
839 839
 								return $output;
840 840
 							}
841 841
 							// Enter one of the loop a
842
-							foreach($groups as $group_srl)
842
+							foreach ($groups as $group_srl)
843 843
 							{
844
-								$output = $oMemberController->addMemberToGroup($args->member_srl,$group_srl);
845
-								if(!$output->toBool())
844
+								$output = $oMemberController->addMemberToGroup($args->member_srl, $group_srl);
845
+								if (!$output->toBool())
846 846
 								{
847 847
 									$oDB->rollback();
848 848
 									return $output;
849 849
 								}
850 850
 							}
851 851
 						}
852
-						if($var->denied)
852
+						if ($var->denied)
853 853
 						{
854 854
 							$args->denied = $var->denied;
855 855
 							$output = executeQuery('member.updateMemberDeniedInfo', $args);
856
-							if(!$output->toBool())
856
+							if (!$output->toBool())
857 857
 							{
858 858
 								$oDB->rollback();
859 859
 								return $output;
@@ -866,7 +866,7 @@  discard block
 block discarded – undo
866 866
 					{
867 867
 						$oMemberController->memberInfo = null;
868 868
 						$output = $oMemberController->deleteMember($member_srl);
869
-						if(!$output->toBool())
869
+						if (!$output->toBool())
870 870
 						{
871 871
 							$oDB->rollback();
872 872
 							return $output;
@@ -879,15 +879,15 @@  discard block
 block discarded – undo
879 879
 
880 880
 		$message = $var->message;
881 881
 		// Send a message
882
-		if($message)
882
+		if ($message)
883 883
 		{
884 884
 			$oCommunicationController = getController('communication');
885 885
 
886 886
 			$logged_info = Context::get('logged_info');
887
-			$title = cut_str($message,10,'...');
887
+			$title = cut_str($message, 10, '...');
888 888
 			$sender_member_srl = $logged_info->member_srl;
889 889
 
890
-			foreach($members as $member_srl)
890
+			foreach ($members as $member_srl)
891 891
 			{
892 892
 				$oCommunicationController->sendMessage($sender_member_srl, $member_srl, $title, $message, false);
893 893
 			}
@@ -904,14 +904,14 @@  discard block
 block discarded – undo
904 904
 	function procMemberAdminDeleteMembers()
905 905
 	{
906 906
 		$target_member_srls = Context::get('target_member_srls');
907
-		if(!$target_member_srls) return new Object(-1, 'msg_invalid_request');
907
+		if (!$target_member_srls) return new Object(-1, 'msg_invalid_request');
908 908
 		$member_srls = explode(',', $target_member_srls);
909 909
 		$oMemberController = getController('member');
910 910
 
911
-		foreach($member_srls as $member)
911
+		foreach ($member_srls as $member)
912 912
 		{
913 913
 			$output = $oMemberController->deleteMember($member);
914
-			if(!$output->toBool())
914
+			if (!$output->toBool())
915 915
 			{
916 916
 				$this->setMessage('failed_deleted');
917 917
 				return $output;
@@ -928,11 +928,11 @@  discard block
 block discarded – undo
928 928
 	function procMemberAdminUpdateMembersGroup()
929 929
 	{
930 930
 		$member_srl = Context::get('member_srl');
931
-		if(!$member_srl) return new Object(-1,'msg_invalid_request');
932
-		$member_srls = explode(',',$member_srl);
931
+		if (!$member_srl) return new Object(-1, 'msg_invalid_request');
932
+		$member_srls = explode(',', $member_srl);
933 933
 
934 934
 		$group_srl = Context::get('group_srls');
935
-		if(!is_array($group_srl)) $group_srls = explode('|@|', $group_srl);
935
+		if (!is_array($group_srl)) $group_srls = explode('|@|', $group_srl);
936 936
 		else $group_srls = $group_srl;
937 937
 
938 938
 		$oDB = &DB::getInstance();
@@ -941,7 +941,7 @@  discard block
 block discarded – undo
941 941
 		$args = new stdClass;
942 942
 		$args->member_srl = $member_srl;
943 943
 		$output = executeQuery('member.deleteMembersGroup', $args);
944
-		if(!$output->toBool())
944
+		if (!$output->toBool())
945 945
 		{
946 946
 			$oDB->rollback();
947 947
 			return $output;
@@ -949,21 +949,21 @@  discard block
 block discarded – undo
949 949
 		// Add to a selected group
950 950
 		$group_count = count($group_srls);
951 951
 		$member_count = count($member_srls);
952
-		for($j=0;$j<$group_count;$j++)
952
+		for ($j = 0; $j < $group_count; $j++)
953 953
 		{
954
-			$group_srl = (int)trim($group_srls[$j]);
955
-			if(!$group_srl) continue;
956
-			for($i=0;$i<$member_count;$i++)
954
+			$group_srl = (int) trim($group_srls[$j]);
955
+			if (!$group_srl) continue;
956
+			for ($i = 0; $i < $member_count; $i++)
957 957
 			{
958
-				$member_srl = (int)trim($member_srls[$i]);
959
-				if(!$member_srl) continue;
958
+				$member_srl = (int) trim($member_srls[$i]);
959
+				if (!$member_srl) continue;
960 960
 
961 961
 				$args = new stdClass;
962 962
 				$args->member_srl = $member_srl;
963 963
 				$args->group_srl = $group_srl;
964 964
 
965 965
 				$output = executeQuery('member.addMemberToGroup', $args);
966
-				if(!$output->toBool())
966
+				if (!$output->toBool())
967 967
 				{
968 968
 					$oDB->rollback();
969 969
 					return $output;
@@ -976,7 +976,7 @@  discard block
 block discarded – undo
976 976
 
977 977
 		$this->setMessage('success_updated');
978 978
 
979
-		if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON')))
979
+		if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON')))
980 980
 		{
981 981
 			global $lang;
982 982
 			htmlHeader();
@@ -997,19 +997,19 @@  discard block
 block discarded – undo
997 997
 	{
998 998
 		$user_ids = Context::get('user_id');
999 999
 
1000
-		$user_ids = explode(',',$user_ids);
1000
+		$user_ids = explode(',', $user_ids);
1001 1001
 		$success_ids = array();
1002 1002
 
1003
-		foreach($user_ids as $val)
1003
+		foreach ($user_ids as $val)
1004 1004
 		{
1005 1005
 			$val = trim($val);
1006
-			if(!$val) continue;
1006
+			if (!$val) continue;
1007 1007
 
1008 1008
 			$output = $this->insertDeniedID($val, '');
1009
-			if($output->toBool()) $success_ids[] = $val;
1009
+			if ($output->toBool()) $success_ids[] = $val;
1010 1010
 		}
1011 1011
 
1012
-		$this->add('user_ids', implode(',',$success_ids));
1012
+		$this->add('user_ids', implode(',', $success_ids));
1013 1013
 
1014 1014
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispMemberAdminDeniedIDList');
1015 1015
 		$this->setRedirectUrl($returnUrl);
@@ -1026,10 +1026,10 @@  discard block
 block discarded – undo
1026 1026
 		$mode = Context::get('mode');
1027 1027
 		$mode = $mode ? $mode : 'insert';
1028 1028
 
1029
-		if($mode == 'delete')
1029
+		if ($mode == 'delete')
1030 1030
 		{
1031 1031
 			$output = $this->deleteDeniedNickName($nick_name);
1032
-			if(!$output->toBool())
1032
+			if (!$output->toBool())
1033 1033
 			{
1034 1034
 				return $output;
1035 1035
 			}
@@ -1038,19 +1038,19 @@  discard block
 block discarded – undo
1038 1038
 		}
1039 1039
 		else
1040 1040
 		{
1041
-			$nick_names = explode(',',$nick_name);
1041
+			$nick_names = explode(',', $nick_name);
1042 1042
 			$success_nick_names = array();
1043 1043
 
1044
-			foreach($nick_names as $val)
1044
+			foreach ($nick_names as $val)
1045 1045
 			{
1046 1046
 				$val = trim($val);
1047
-				if(!$val) continue;
1047
+				if (!$val) continue;
1048 1048
 
1049 1049
 				$output = $this->insertDeniedNickName($val, '');
1050
-				if($output->toBool()) $success_nick_names[] = $val;
1050
+				if ($output->toBool()) $success_nick_names[] = $val;
1051 1051
 			}
1052 1052
 
1053
-			$this->add('nick_names', implode(',',$success_nick_names));
1053
+			$this->add('nick_names', implode(',', $success_nick_names));
1054 1054
 		}
1055 1055
 	}
1056 1056
 
@@ -1063,16 +1063,16 @@  discard block
 block discarded – undo
1063 1063
 		$user_id = Context::get('user_id');
1064 1064
 		$mode = Context::get('mode');
1065 1065
 
1066
-		switch($mode)
1066
+		switch ($mode)
1067 1067
 		{
1068 1068
 			case 'delete' :
1069 1069
 				$output = $this->deleteDeniedID($user_id);
1070
-				if(!$output->toBool()) return $output;
1070
+				if (!$output->toBool()) return $output;
1071 1071
 				$msg_code = 'success_deleted';
1072 1072
 				break;
1073 1073
 		}
1074 1074
 
1075
-		$this->add('page',Context::get('page'));
1075
+		$this->add('page', Context::get('page'));
1076 1076
 		$this->setMessage($msg_code);
1077 1077
 	}
1078 1078
 
@@ -1119,24 +1119,24 @@  discard block
 block discarded – undo
1119 1119
 	 */
1120 1120
 	function insertGroup($args)
1121 1121
 	{
1122
-		if(!$args->site_srl) $args->site_srl = 0;
1122
+		if (!$args->site_srl) $args->site_srl = 0;
1123 1123
 		// Check the value of is_default.
1124
-		if($args->is_default != 'Y')
1124
+		if ($args->is_default != 'Y')
1125 1125
 		{
1126 1126
 			$args->is_default = 'N';
1127 1127
 		}
1128 1128
 		else
1129 1129
 		{
1130 1130
 			$output = executeQuery('member.updateGroupDefaultClear', $args);
1131
-			if(!$output->toBool()) return $output;
1131
+			if (!$output->toBool()) return $output;
1132 1132
 		}
1133 1133
 
1134
-		if(!isset($args->list_order) || $args->list_order=='')
1134
+		if (!isset($args->list_order) || $args->list_order == '')
1135 1135
 		{
1136 1136
 			$args->list_order = $args->group_srl;
1137 1137
 		}
1138 1138
 
1139
-		if(!$args->group_srl) $args->group_srl = getNextSequence();
1139
+		if (!$args->group_srl) $args->group_srl = getNextSequence();
1140 1140
 		$args->list_order = $args->group_srl;
1141 1141
 		$output = executeQuery('member.insertGroup', $args);
1142 1142
 		$this->_deleteMemberGroupCache($args->site_srl);
@@ -1151,17 +1151,17 @@  discard block
 block discarded – undo
1151 1151
 	 */
1152 1152
 	function updateGroup($args)
1153 1153
 	{
1154
-		if(!$args->site_srl) $args->site_srl = 0;
1154
+		if (!$args->site_srl) $args->site_srl = 0;
1155 1155
 		// Check the value of is_default.
1156
-		if(!$args->group_srl) return new Object(-1, 'lang->msg_not_founded');
1157
-		if($args->is_default!='Y')
1156
+		if (!$args->group_srl) return new Object(-1, 'lang->msg_not_founded');
1157
+		if ($args->is_default != 'Y')
1158 1158
 		{
1159 1159
 			$args->is_default = 'N';
1160 1160
 		}
1161 1161
 		else
1162 1162
 		{
1163 1163
 			$output = executeQuery('member.updateGroupDefaultClear', $args);
1164
-			if(!$output->toBool()) return $output;
1164
+			if (!$output->toBool()) return $output;
1165 1165
 		}
1166 1166
 
1167 1167
 		$output = executeQuery('member.updateGroup', $args);
@@ -1184,8 +1184,8 @@  discard block
 block discarded – undo
1184 1184
 		$columnList = array('group_srl', 'is_default');
1185 1185
 		$group_info = $oMemberModel->getGroup($group_srl, $columnList);
1186 1186
 
1187
-		if(!$group_info) return new Object(-1, 'lang->msg_not_founded');
1188
-		if($group_info->is_default == 'Y') return new Object(-1, 'msg_not_delete_default');
1187
+		if (!$group_info) return new Object(-1, 'lang->msg_not_founded');
1188
+		if ($group_info->is_default == 'Y') return new Object(-1, 'msg_not_delete_default');
1189 1189
 
1190 1190
 		// Get groups where is_default == 'Y'
1191 1191
 		$columnList = array('site_srl', 'group_srl');
@@ -1222,7 +1222,7 @@  discard block
 block discarded – undo
1222 1222
 		$defaultGroup = $oMemberModel->getDefaultGroup(0);
1223 1223
 		$defaultGroupSrl = $defaultGroup->group_srl;
1224 1224
 		$group_srls = $vars->group_srls;
1225
-		foreach($group_srls as $order=>$group_srl)
1225
+		foreach ($group_srls as $order=>$group_srl)
1226 1226
 		{
1227 1227
 			$isInsert = false;
1228 1228
 			$update_args = new stdClass();
@@ -1231,9 +1231,9 @@  discard block
 block discarded – undo
1231 1231
 			$update_args->image_mark = $vars->image_marks[$order];
1232 1232
 			$update_args->list_order = $order + 1;
1233 1233
 
1234
-			if(!$update_args->title) continue;
1234
+			if (!$update_args->title) continue;
1235 1235
 
1236
-			if(is_numeric($group_srl)) {
1236
+			if (is_numeric($group_srl)) {
1237 1237
 				$update_args->group_srl = $group_srl;
1238 1238
 				$output = $this->updateGroup($update_args);
1239 1239
 			}
@@ -1242,7 +1242,7 @@  discard block
 block discarded – undo
1242 1242
 				$output = $this->insertGroup($update_args);
1243 1243
 			}
1244 1244
 
1245
-			if($vars->defaultGroup == $group_srl) {
1245
+			if ($vars->defaultGroup == $group_srl) {
1246 1246
 				$defaultGroupSrl = $update_args->group_srl;
1247 1247
 			}
1248 1248
 		}
@@ -1268,7 +1268,7 @@  discard block
 block discarded – undo
1268 1268
 	{
1269 1269
 		$vars = Context::getRequestVars();
1270 1270
 
1271
-		foreach($vars->group_srls as $key => $val)
1271
+		foreach ($vars->group_srls as $key => $val)
1272 1272
 		{
1273 1273
 			$args = new stdClass;
1274 1274
 			$args->group_srl = $val;
@@ -1289,7 +1289,7 @@  discard block
 block discarded – undo
1289 1289
 	{
1290 1290
 		//remove from cache
1291 1291
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
1292
-		if($oCacheHandler->isSupport())
1292
+		if ($oCacheHandler->isSupport())
1293 1293
 		{
1294 1294
 			$oCacheHandler->invalidateGroupKey('member');
1295 1295
 		}
@@ -1306,7 +1306,7 @@  discard block
 block discarded – undo
1306 1306
 		$args = new stdClass();
1307 1307
 		$args->user_id = $user_id;
1308 1308
 		$args->description = $description;
1309
-		$args->list_order = -1*getNextSequence();
1309
+		$args->list_order = -1 * getNextSequence();
1310 1310
 
1311 1311
 		return executeQuery('member.insertDeniedID', $args);
1312 1312
 	}
@@ -1327,7 +1327,7 @@  discard block
 block discarded – undo
1327 1327
 	 */
1328 1328
 	function deleteDeniedID($user_id)
1329 1329
 	{
1330
-		if(!$user_id) unset($user_id);
1330
+		if (!$user_id) unset($user_id);
1331 1331
 
1332 1332
 		$args = new stdClass;
1333 1333
 		$args->user_id = $user_id;
@@ -1341,7 +1341,7 @@  discard block
 block discarded – undo
1341 1341
 	 */
1342 1342
 	function deleteDeniedNickName($nick_name)
1343 1343
 	{
1344
-		if(!$nick_name) unset($nick_name);
1344
+		if (!$nick_name) unset($nick_name);
1345 1345
 
1346 1346
 		$args = new stdClass;
1347 1347
 		$args->nick_name = $nick_name;
@@ -1380,16 +1380,16 @@  discard block
 block discarded – undo
1380 1380
 		// Get a list of all join forms
1381 1381
 		$join_form_list = $oMemberModel->getJoinFormList();
1382 1382
 		$join_form_srl_list = array_keys($join_form_list);
1383
-		if(count($join_form_srl_list)<2) return new Object();
1383
+		if (count($join_form_srl_list) < 2) return new Object();
1384 1384
 
1385 1385
 		$prev_member_join_form = NULL;
1386
-		foreach($join_form_list as $key => $val)
1386
+		foreach ($join_form_list as $key => $val)
1387 1387
 		{
1388
-			if($val->member_join_form_srl == $member_join_form_srl) break;
1388
+			if ($val->member_join_form_srl == $member_join_form_srl) break;
1389 1389
 			$prev_member_join_form = $val;
1390 1390
 		}
1391 1391
 		// Return if no previous join form exists
1392
-		if(!$prev_member_join_form) return new Object();
1392
+		if (!$prev_member_join_form) return new Object();
1393 1393
 		// Information of the join form
1394 1394
 		$cur_args = new stdClass;
1395 1395
 		$cur_args->member_join_form_srl = $member_join_form_srl;
@@ -1400,10 +1400,10 @@  discard block
 block discarded – undo
1400 1400
 		$prev_args->list_order = $list_order;
1401 1401
 		// Execute Query
1402 1402
 		$output = executeQuery('member.updateMemberJoinFormListorder', $cur_args);
1403
-		if(!$output->toBool()) return $output;
1403
+		if (!$output->toBool()) return $output;
1404 1404
 
1405 1405
 		executeQuery('member.updateMemberJoinFormListorder', $prev_args);
1406
-		if(!$output->toBool()) return $output;
1406
+		if (!$output->toBool()) return $output;
1407 1407
 
1408 1408
 		return new Object();
1409 1409
 	}
@@ -1427,16 +1427,16 @@  discard block
 block discarded – undo
1427 1427
 		// Get information of all join forms
1428 1428
 		$join_form_list = $oMemberModel->getJoinFormList();
1429 1429
 		$join_form_srl_list = array_keys($join_form_list);
1430
-		if(count($join_form_srl_list)<2) return new Object();
1430
+		if (count($join_form_srl_list) < 2) return new Object();
1431 1431
 
1432
-		for($i=0;$i<count($join_form_srl_list);$i++)
1432
+		for ($i = 0; $i < count($join_form_srl_list); $i++)
1433 1433
 		{
1434
-			if($join_form_srl_list[$i]==$member_join_form_srl) break;
1434
+			if ($join_form_srl_list[$i] == $member_join_form_srl) break;
1435 1435
 		}
1436 1436
 
1437
-		$next_member_join_form_srl = $join_form_srl_list[$i+1];
1437
+		$next_member_join_form_srl = $join_form_srl_list[$i + 1];
1438 1438
 		// Return if no previous join form exists
1439
-		if(!$next_member_join_form_srl) return new Object();
1439
+		if (!$next_member_join_form_srl) return new Object();
1440 1440
 		$next_member_join_form = $join_form_list[$next_member_join_form_srl];
1441 1441
 		// Information of the join form
1442 1442
 		$cur_args = new stdClass;
@@ -1448,10 +1448,10 @@  discard block
 block discarded – undo
1448 1448
 		$next_args->list_order = $list_order;
1449 1449
 		// Execute Query
1450 1450
 		$output = executeQuery('member.updateMemberJoinFormListorder', $cur_args);
1451
-		if(!$output->toBool()) return $output;
1451
+		if (!$output->toBool()) return $output;
1452 1452
 
1453 1453
 		$output = executeQuery('member.updateMemberJoinFormListorder', $next_args);
1454
-		if(!$output->toBool()) return $output;
1454
+		if (!$output->toBool()) return $output;
1455 1455
 
1456 1456
 		return new Object();
1457 1457
 	}
Please login to merge, or discard this patch.
Braces   +162 added lines, -86 removed lines patch added patch discarded remove patch
@@ -48,9 +48,11 @@  discard block
 block discarded – undo
48 48
 			$args->{$val} = Context::get($val);
49 49
 		}
50 50
 		$args->member_srl = Context::get('member_srl');
51
-		if(Context::get('reset_password'))
52
-			$args->password = Context::get('reset_password');
53
-		else unset($args->password);
51
+		if(Context::get('reset_password')) {
52
+					$args->password = Context::get('reset_password');
53
+		} else {
54
+			unset($args->password);
55
+		}
54 56
 
55 57
 		// Remove some unnecessary variables from all the vars
56 58
 		$all_args = Context::getRequestVars();
@@ -60,7 +62,9 @@  discard block
 block discarded – undo
60 62
 		unset($all_args->error_return_url);
61 63
 		unset($all_args->success_return_url);
62 64
 		unset($all_args->ruleset);
63
-		if(!isset($args->limit_date)) $args->limit_date = "";
65
+		if(!isset($args->limit_date)) {
66
+			$args->limit_date = "";
67
+		}
64 68
 		unset($all_args->password);
65 69
 		unset($all_args->password2);
66 70
 		unset($all_args->reset_password);
@@ -76,7 +80,9 @@  discard block
 block discarded – undo
76 80
 			$columnList = array('member_srl');
77 81
 			$member_info = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl, 0, $columnList);
78 82
 			// If no original member exists, make a new one
79
-			if($member_info->member_srl != $args->member_srl) unset($args->member_srl);
83
+			if($member_info->member_srl != $args->member_srl) {
84
+				unset($args->member_srl);
85
+			}
80 86
 		}
81 87
 
82 88
 		// remove whitespace
@@ -96,14 +102,15 @@  discard block
 block discarded – undo
96 102
 			$args->password = Context::get('password');
97 103
 			$output = $oMemberController->insertMember($args);
98 104
 			$msg_code = 'success_registed';
99
-		}
100
-		else
105
+		} else
101 106
 		{
102 107
 			$output = $oMemberController->updateMember($args);
103 108
 			$msg_code = 'success_updated';
104 109
 		}
105 110
 
106
-		if(!$output->toBool()) return $output;
111
+		if(!$output->toBool()) {
112
+			return $output;
113
+		}
107 114
 		// Save Signature
108 115
 		$signature = Context::get('signature');
109 116
 		$oMemberController->putSignature($args->member_srl, $signature);
@@ -144,7 +151,9 @@  discard block
 block discarded – undo
144 151
 
145 152
 		$oMemberController = getController('member');
146 153
 		$output = $oMemberController->deleteMember($member_srl);
147
-		if(!$output->toBool()) return $output;
154
+		if(!$output->toBool()) {
155
+			return $output;
156
+		}
148 157
 
149 158
 		$this->add('page',Context::get('page'));
150 159
 		$this->setMessage("success_deleted");
@@ -263,8 +272,11 @@  discard block
 block discarded – undo
263 272
 			$signupItem->isDefaultForm = in_array($key, $items);
264 273
 
265 274
 			$signupItem->name = $key;
266
-			if(!in_array($key, $items)) $signupItem->title = $key;
267
-			else $signupItem->title = $lang->{$key};
275
+			if(!in_array($key, $items)) {
276
+				$signupItem->title = $key;
277
+			} else {
278
+				$signupItem->title = $lang->{$key};
279
+			}
268 280
 			$signupItem->mustRequired = in_array($key, $mustRequireds);
269 281
 			$signupItem->imageType = (strpos($key, 'image') !== false);
270 282
 			$signupItem->required = ($all_args->{$key} == 'required') || $signupItem->mustRequired || $signupItem->isIdentifier;
@@ -434,10 +446,11 @@  discard block
 block discarded – undo
434 446
 				$signupItem->max_width = $config->{$key.'_max_width'};
435 447
 				$signupItem->max_height = $config->{$key.'_max_height'};
436 448
 			}
437
-			if($signupItem->isIdentifier)
438
-				array_unshift($list_order, $signupItem);
439
-			else
440
-				$list_order[] = $signupItem;
449
+			if($signupItem->isIdentifier) {
450
+							array_unshift($list_order, $signupItem);
451
+			} else {
452
+							$list_order[] = $signupItem;
453
+			}
441 454
 		}
442 455
 		if(is_array($extendItems))
443 456
 		{
@@ -494,38 +507,30 @@  discard block
 block discarded – undo
494 507
 				if($formInfo->type == 'tel' || $formInfo->type == 'kr_zip')
495 508
 				{
496 509
 					$fields[] = sprintf('<field name="%s[]" required="true" />', $formInfo->name);
497
-				}
498
-				else if($formInfo->name == 'password')
510
+				} else if($formInfo->name == 'password')
499 511
 				{
500 512
 					$fields[] = '<field name="password"><if test="$act == \'procMemberInsert\'" attr="required" value="true" /><if test="$act == \'procMemberInsert\'" attr="length" value="4:60" /></field>';
501 513
 					$fields[] = '<field name="password2"><if test="$act == \'procMemberInsert\'" attr="required" value="true" /><if test="$act == \'procMemberInsert\'" attr="equalto" value="password" /></field>';
502
-				}
503
-				else if($formInfo->name == 'find_account_question')
514
+				} else if($formInfo->name == 'find_account_question')
504 515
 				{
505 516
 					$fields[] = '<field name="find_account_question" required="true" />';
506 517
 					$fields[] = '<field name="find_account_answer" required="true" length=":250" />';
507
-				}
508
-				else if($formInfo->name == 'email_address')
518
+				} else if($formInfo->name == 'email_address')
509 519
 				{
510 520
 					$fields[] = sprintf('<field name="%s" required="true" rule="email"/>', $formInfo->name);
511
-				}
512
-				else if($formInfo->name == 'user_id')
521
+				} else if($formInfo->name == 'user_id')
513 522
 				{
514 523
 					$fields[] = sprintf('<field name="%s" required="true" rule="userid" length="3:20" />', $formInfo->name);
515
-				}
516
-				else if($formInfo->name == 'nick_name')
524
+				} else if($formInfo->name == 'nick_name')
517 525
 				{
518 526
 					$fields[] = sprintf('<field name="%s" required="true" length="2:20" />', $formInfo->name);
519
-				}
520
-				else if(strpos($formInfo->name, 'image') !== false)
527
+				} else if(strpos($formInfo->name, 'image') !== false)
521 528
 				{
522 529
 					$fields[] = sprintf('<field name="%s"><if test="$act != \'procMemberAdminInsert\' &amp;&amp; $__%s_exist != \'true\'" attr="required" value="true" /></field>', $formInfo->name, $formInfo->name);
523
-				}
524
-				else if($formInfo->name == 'signature')
530
+				} else if($formInfo->name == 'signature')
525 531
 				{
526 532
 					$fields[] = '<field name="signature"><if test="$member_srl" attr="required" value="true" /></field>';
527
-				}
528
-				else
533
+				} else
529 534
 				{
530 535
 					$fields[] = sprintf('<field name="%s" required="true" />', $formInfo->name);
531 536
 				}
@@ -585,8 +590,9 @@  discard block
 block discarded – undo
585 590
 			'</ruleset>';
586 591
 
587 592
 		$fields = array();
588
-		if($identifier == 'user_id')
589
-			$fields[] = '<field name="user_id" required="true" rule="userid" />';
593
+		if($identifier == 'user_id') {
594
+					$fields[] = '<field name="user_id" required="true" rule="userid" />';
595
+		}
590 596
 
591 597
 		$fields[] = '<field name="email_address" required="true" rule="email" />';
592 598
 		$fields[] = '<field name="find_account_question" required="true" />';
@@ -608,7 +614,9 @@  discard block
 block discarded – undo
608 614
 	{
609 615
 		$args = Context::gets('title','description','is_default','image_mark');
610 616
 		$output = $this->insertGroup($args);
611
-		if(!$output->toBool()) return $output;
617
+		if(!$output->toBool()) {
618
+			return $output;
619
+		}
612 620
 
613 621
 		$this->add('group_srl','');
614 622
 		$this->add('page',Context::get('page'));
@@ -629,7 +637,9 @@  discard block
 block discarded – undo
629 637
 		$args = Context::gets('group_srl','title','description','is_default','image_mark');
630 638
 		$args->site_srl = 0;
631 639
 		$output = $this->updateGroup($args);
632
-		if(!$output->toBool()) return $output;
640
+		if(!$output->toBool()) {
641
+			return $output;
642
+		}
633 643
 
634 644
 		$this->add('group_srl','');
635 645
 		$this->add('page',Context::get('page'));
@@ -648,7 +658,9 @@  discard block
 block discarded – undo
648 658
 		$group_srl = Context::get('group_srl');
649 659
 
650 660
 		$output = $this->deleteGroup($group_srl);
651
-		if(!$output->toBool()) return $output;
661
+		if(!$output->toBool()) {
662
+			return $output;
663
+		}
652 664
 
653 665
 		$this->add('group_srl','');
654 666
 		$this->add('page',Context::get('page'));
@@ -673,14 +685,15 @@  discard block
 block discarded – undo
673 685
 		$args->default_value = explode("\n", str_replace("\r", '', Context::get('default_value')));
674 686
 		$args->required = Context::get('required');
675 687
 		$args->is_active = (isset($args->required));
676
-		if(!in_array(strtoupper($args->required), array('Y','N')))$args->required = 'N';
688
+		if(!in_array(strtoupper($args->required), array('Y','N'))) {
689
+			$args->required = 'N';
690
+		}
677 691
 		$args->description = Context::get('description') ? Context::get('description') : '';
678 692
 		// Default values
679 693
 		if(in_array($args->column_type, array('checkbox','select','radio')) && count($args->default_value))
680 694
 		{
681 695
 			$args->default_value = serialize($args->default_value);
682
-		}
683
-		else
696
+		} else
684 697
 		{
685 698
 			$args->default_value = '';
686 699
 		}
@@ -692,7 +705,9 @@  discard block
 block discarded – undo
692 705
 		{
693 706
 			if($item->name == $args->column_name)
694 707
 			{
695
-				if($args->member_join_form_srl && $args->member_join_form_srl == $item->member_join_form_srl) continue;
708
+				if($args->member_join_form_srl && $args->member_join_form_srl == $item->member_join_form_srl) {
709
+					continue;
710
+				}
696 711
 				return new Object(-1,'msg_exists_user_id');
697 712
 			}
698 713
 		}
@@ -703,13 +718,14 @@  discard block
 block discarded – undo
703 718
 			$isInsert = true;
704 719
 			$args->list_order = $args->member_join_form_srl = getNextSequence();
705 720
 			$output = executeQuery('member.insertJoinForm', $args);
706
-		}
707
-		else
721
+		} else
708 722
 		{
709 723
 			$output = executeQuery('member.updateJoinForm', $args);
710 724
 		}
711 725
 
712
-		if(!$output->toBool()) return $output;
726
+		if(!$output->toBool()) {
727
+			return $output;
728
+		}
713 729
 
714 730
 		// memberConfig update
715 731
 		$signupItem = new stdClass();
@@ -729,8 +745,7 @@  discard block
 block discarded – undo
729 745
 		if($isInsert)
730 746
 		{
731 747
 			$config->signupForm[] = $signupItem;
732
-		}
733
-		else
748
+		} else
734 749
 		{
735 750
 			foreach($config->signupForm as $key=>$val)
736 751
 			{
@@ -801,7 +816,9 @@  discard block
 block discarded – undo
801 816
 			case 'update' :
802 817
 				break;
803 818
 		}
804
-		if(!$output->toBool()) return $output;
819
+		if(!$output->toBool()) {
820
+			return $output;
821
+		}
805 822
 
806 823
 		$this->setMessage($msg_code);
807 824
 	}
@@ -904,7 +921,9 @@  discard block
 block discarded – undo
904 921
 	function procMemberAdminDeleteMembers()
905 922
 	{
906 923
 		$target_member_srls = Context::get('target_member_srls');
907
-		if(!$target_member_srls) return new Object(-1, 'msg_invalid_request');
924
+		if(!$target_member_srls) {
925
+			return new Object(-1, 'msg_invalid_request');
926
+		}
908 927
 		$member_srls = explode(',', $target_member_srls);
909 928
 		$oMemberController = getController('member');
910 929
 
@@ -928,12 +947,17 @@  discard block
 block discarded – undo
928 947
 	function procMemberAdminUpdateMembersGroup()
929 948
 	{
930 949
 		$member_srl = Context::get('member_srl');
931
-		if(!$member_srl) return new Object(-1,'msg_invalid_request');
950
+		if(!$member_srl) {
951
+			return new Object(-1,'msg_invalid_request');
952
+		}
932 953
 		$member_srls = explode(',',$member_srl);
933 954
 
934 955
 		$group_srl = Context::get('group_srls');
935
-		if(!is_array($group_srl)) $group_srls = explode('|@|', $group_srl);
936
-		else $group_srls = $group_srl;
956
+		if(!is_array($group_srl)) {
957
+			$group_srls = explode('|@|', $group_srl);
958
+		} else {
959
+			$group_srls = $group_srl;
960
+		}
937 961
 
938 962
 		$oDB = &DB::getInstance();
939 963
 		$oDB->begin();
@@ -952,11 +976,15 @@  discard block
 block discarded – undo
952 976
 		for($j=0;$j<$group_count;$j++)
953 977
 		{
954 978
 			$group_srl = (int)trim($group_srls[$j]);
955
-			if(!$group_srl) continue;
979
+			if(!$group_srl) {
980
+				continue;
981
+			}
956 982
 			for($i=0;$i<$member_count;$i++)
957 983
 			{
958 984
 				$member_srl = (int)trim($member_srls[$i]);
959
-				if(!$member_srl) continue;
985
+				if(!$member_srl) {
986
+					continue;
987
+				}
960 988
 
961 989
 				$args = new stdClass;
962 990
 				$args->member_srl = $member_srl;
@@ -1003,10 +1031,14 @@  discard block
 block discarded – undo
1003 1031
 		foreach($user_ids as $val)
1004 1032
 		{
1005 1033
 			$val = trim($val);
1006
-			if(!$val) continue;
1034
+			if(!$val) {
1035
+				continue;
1036
+			}
1007 1037
 
1008 1038
 			$output = $this->insertDeniedID($val, '');
1009
-			if($output->toBool()) $success_ids[] = $val;
1039
+			if($output->toBool()) {
1040
+				$success_ids[] = $val;
1041
+			}
1010 1042
 		}
1011 1043
 
1012 1044
 		$this->add('user_ids', implode(',',$success_ids));
@@ -1035,8 +1067,7 @@  discard block
 block discarded – undo
1035 1067
 			}
1036 1068
 			$msg_code = 'success_deleted';
1037 1069
 			$this->setMessage($msg_code);
1038
-		}
1039
-		else
1070
+		} else
1040 1071
 		{
1041 1072
 			$nick_names = explode(',',$nick_name);
1042 1073
 			$success_nick_names = array();
@@ -1044,10 +1075,14 @@  discard block
 block discarded – undo
1044 1075
 			foreach($nick_names as $val)
1045 1076
 			{
1046 1077
 				$val = trim($val);
1047
-				if(!$val) continue;
1078
+				if(!$val) {
1079
+					continue;
1080
+				}
1048 1081
 
1049 1082
 				$output = $this->insertDeniedNickName($val, '');
1050
-				if($output->toBool()) $success_nick_names[] = $val;
1083
+				if($output->toBool()) {
1084
+					$success_nick_names[] = $val;
1085
+				}
1051 1086
 			}
1052 1087
 
1053 1088
 			$this->add('nick_names', implode(',',$success_nick_names));
@@ -1067,7 +1102,9 @@  discard block
 block discarded – undo
1067 1102
 		{
1068 1103
 			case 'delete' :
1069 1104
 				$output = $this->deleteDeniedID($user_id);
1070
-				if(!$output->toBool()) return $output;
1105
+				if(!$output->toBool()) {
1106
+					return $output;
1107
+				}
1071 1108
 				$msg_code = 'success_deleted';
1072 1109
 				break;
1073 1110
 		}
@@ -1119,16 +1156,19 @@  discard block
 block discarded – undo
1119 1156
 	 */
1120 1157
 	function insertGroup($args)
1121 1158
 	{
1122
-		if(!$args->site_srl) $args->site_srl = 0;
1159
+		if(!$args->site_srl) {
1160
+			$args->site_srl = 0;
1161
+		}
1123 1162
 		// Check the value of is_default.
1124 1163
 		if($args->is_default != 'Y')
1125 1164
 		{
1126 1165
 			$args->is_default = 'N';
1127
-		}
1128
-		else
1166
+		} else
1129 1167
 		{
1130 1168
 			$output = executeQuery('member.updateGroupDefaultClear', $args);
1131
-			if(!$output->toBool()) return $output;
1169
+			if(!$output->toBool()) {
1170
+				return $output;
1171
+			}
1132 1172
 		}
1133 1173
 
1134 1174
 		if(!isset($args->list_order) || $args->list_order=='')
@@ -1136,7 +1176,9 @@  discard block
 block discarded – undo
1136 1176
 			$args->list_order = $args->group_srl;
1137 1177
 		}
1138 1178
 
1139
-		if(!$args->group_srl) $args->group_srl = getNextSequence();
1179
+		if(!$args->group_srl) {
1180
+			$args->group_srl = getNextSequence();
1181
+		}
1140 1182
 		$args->list_order = $args->group_srl;
1141 1183
 		$output = executeQuery('member.insertGroup', $args);
1142 1184
 		$this->_deleteMemberGroupCache($args->site_srl);
@@ -1151,17 +1193,22 @@  discard block
 block discarded – undo
1151 1193
 	 */
1152 1194
 	function updateGroup($args)
1153 1195
 	{
1154
-		if(!$args->site_srl) $args->site_srl = 0;
1196
+		if(!$args->site_srl) {
1197
+			$args->site_srl = 0;
1198
+		}
1155 1199
 		// Check the value of is_default.
1156
-		if(!$args->group_srl) return new Object(-1, 'lang->msg_not_founded');
1200
+		if(!$args->group_srl) {
1201
+			return new Object(-1, 'lang->msg_not_founded');
1202
+		}
1157 1203
 		if($args->is_default!='Y')
1158 1204
 		{
1159 1205
 			$args->is_default = 'N';
1160
-		}
1161
-		else
1206
+		} else
1162 1207
 		{
1163 1208
 			$output = executeQuery('member.updateGroupDefaultClear', $args);
1164
-			if(!$output->toBool()) return $output;
1209
+			if(!$output->toBool()) {
1210
+				return $output;
1211
+			}
1165 1212
 		}
1166 1213
 
1167 1214
 		$output = executeQuery('member.updateGroup', $args);
@@ -1184,8 +1231,12 @@  discard block
 block discarded – undo
1184 1231
 		$columnList = array('group_srl', 'is_default');
1185 1232
 		$group_info = $oMemberModel->getGroup($group_srl, $columnList);
1186 1233
 
1187
-		if(!$group_info) return new Object(-1, 'lang->msg_not_founded');
1188
-		if($group_info->is_default == 'Y') return new Object(-1, 'msg_not_delete_default');
1234
+		if(!$group_info) {
1235
+			return new Object(-1, 'lang->msg_not_founded');
1236
+		}
1237
+		if($group_info->is_default == 'Y') {
1238
+			return new Object(-1, 'msg_not_delete_default');
1239
+		}
1189 1240
 
1190 1241
 		// Get groups where is_default == 'Y'
1191 1242
 		$columnList = array('site_srl', 'group_srl');
@@ -1231,13 +1282,14 @@  discard block
 block discarded – undo
1231 1282
 			$update_args->image_mark = $vars->image_marks[$order];
1232 1283
 			$update_args->list_order = $order + 1;
1233 1284
 
1234
-			if(!$update_args->title) continue;
1285
+			if(!$update_args->title) {
1286
+				continue;
1287
+			}
1235 1288
 
1236 1289
 			if(is_numeric($group_srl)) {
1237 1290
 				$update_args->group_srl = $group_srl;
1238 1291
 				$output = $this->updateGroup($update_args);
1239
-			}
1240
-			else {
1292
+			} else {
1241 1293
 				$update_args->group_srl = getNextSequence();
1242 1294
 				$output = $this->insertGroup($update_args);
1243 1295
 			}
@@ -1327,7 +1379,9 @@  discard block
 block discarded – undo
1327 1379
 	 */
1328 1380
 	function deleteDeniedID($user_id)
1329 1381
 	{
1330
-		if(!$user_id) unset($user_id);
1382
+		if(!$user_id) {
1383
+			unset($user_id);
1384
+		}
1331 1385
 
1332 1386
 		$args = new stdClass;
1333 1387
 		$args->user_id = $user_id;
@@ -1341,7 +1395,9 @@  discard block
 block discarded – undo
1341 1395
 	 */
1342 1396
 	function deleteDeniedNickName($nick_name)
1343 1397
 	{
1344
-		if(!$nick_name) unset($nick_name);
1398
+		if(!$nick_name) {
1399
+			unset($nick_name);
1400
+		}
1345 1401
 
1346 1402
 		$args = new stdClass;
1347 1403
 		$args->nick_name = $nick_name;
@@ -1380,16 +1436,22 @@  discard block
 block discarded – undo
1380 1436
 		// Get a list of all join forms
1381 1437
 		$join_form_list = $oMemberModel->getJoinFormList();
1382 1438
 		$join_form_srl_list = array_keys($join_form_list);
1383
-		if(count($join_form_srl_list)<2) return new Object();
1439
+		if(count($join_form_srl_list)<2) {
1440
+			return new Object();
1441
+		}
1384 1442
 
1385 1443
 		$prev_member_join_form = NULL;
1386 1444
 		foreach($join_form_list as $key => $val)
1387 1445
 		{
1388
-			if($val->member_join_form_srl == $member_join_form_srl) break;
1446
+			if($val->member_join_form_srl == $member_join_form_srl) {
1447
+				break;
1448
+			}
1389 1449
 			$prev_member_join_form = $val;
1390 1450
 		}
1391 1451
 		// Return if no previous join form exists
1392
-		if(!$prev_member_join_form) return new Object();
1452
+		if(!$prev_member_join_form) {
1453
+			return new Object();
1454
+		}
1393 1455
 		// Information of the join form
1394 1456
 		$cur_args = new stdClass;
1395 1457
 		$cur_args->member_join_form_srl = $member_join_form_srl;
@@ -1400,10 +1462,14 @@  discard block
 block discarded – undo
1400 1462
 		$prev_args->list_order = $list_order;
1401 1463
 		// Execute Query
1402 1464
 		$output = executeQuery('member.updateMemberJoinFormListorder', $cur_args);
1403
-		if(!$output->toBool()) return $output;
1465
+		if(!$output->toBool()) {
1466
+			return $output;
1467
+		}
1404 1468
 
1405 1469
 		executeQuery('member.updateMemberJoinFormListorder', $prev_args);
1406
-		if(!$output->toBool()) return $output;
1470
+		if(!$output->toBool()) {
1471
+			return $output;
1472
+		}
1407 1473
 
1408 1474
 		return new Object();
1409 1475
 	}
@@ -1427,16 +1493,22 @@  discard block
 block discarded – undo
1427 1493
 		// Get information of all join forms
1428 1494
 		$join_form_list = $oMemberModel->getJoinFormList();
1429 1495
 		$join_form_srl_list = array_keys($join_form_list);
1430
-		if(count($join_form_srl_list)<2) return new Object();
1496
+		if(count($join_form_srl_list)<2) {
1497
+			return new Object();
1498
+		}
1431 1499
 
1432 1500
 		for($i=0;$i<count($join_form_srl_list);$i++)
1433 1501
 		{
1434
-			if($join_form_srl_list[$i]==$member_join_form_srl) break;
1502
+			if($join_form_srl_list[$i]==$member_join_form_srl) {
1503
+				break;
1504
+			}
1435 1505
 		}
1436 1506
 
1437 1507
 		$next_member_join_form_srl = $join_form_srl_list[$i+1];
1438 1508
 		// Return if no previous join form exists
1439
-		if(!$next_member_join_form_srl) return new Object();
1509
+		if(!$next_member_join_form_srl) {
1510
+			return new Object();
1511
+		}
1440 1512
 		$next_member_join_form = $join_form_list[$next_member_join_form_srl];
1441 1513
 		// Information of the join form
1442 1514
 		$cur_args = new stdClass;
@@ -1448,10 +1520,14 @@  discard block
 block discarded – undo
1448 1520
 		$next_args->list_order = $list_order;
1449 1521
 		// Execute Query
1450 1522
 		$output = executeQuery('member.updateMemberJoinFormListorder', $cur_args);
1451
-		if(!$output->toBool()) return $output;
1523
+		if(!$output->toBool()) {
1524
+			return $output;
1525
+		}
1452 1526
 
1453 1527
 		$output = executeQuery('member.updateMemberJoinFormListorder', $next_args);
1454
-		if(!$output->toBool()) return $output;
1528
+		if(!$output->toBool()) {
1529
+			return $output;
1530
+		}
1455 1531
 
1456 1532
 		return new Object();
1457 1533
 	}
Please login to merge, or discard this patch.
modules/member/member.admin.view.php 3 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -380,10 +380,10 @@
 block discarded – undo
380 380
 	/**
381 381
 	 * Get tags by the member info type 
382 382
 	 *
383
-	 * @param object $memberInfo
383
+	 * @param string $memberInfo
384 384
 	 * @param boolean $isAdmin (true : admin, false : not admin)
385 385
 	 *
386
-	 * @return array
386
+	 * @return string
387 387
 	 */
388 388
 	function _getMemberInputTag($memberInfo, $isAdmin = false)
389 389
 	{
Please login to merge, or discard this patch.
Spacing   +68 added lines, -68 removed lines patch added patch discarded remove patch
@@ -43,16 +43,16 @@  discard block
 block discarded – undo
43 43
 
44 44
 		// if member_srl exists, set memberInfo
45 45
 		$member_srl = Context::get('member_srl');
46
-		if($member_srl) 
46
+		if ($member_srl) 
47 47
 		{
48 48
 			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl);
49
-			if(!$this->memberInfo)
49
+			if (!$this->memberInfo)
50 50
 			{
51
-				Context::set('member_srl','');
51
+				Context::set('member_srl', '');
52 52
 			}
53 53
 			else
54 54
 			{
55
-				Context::set('member_info',$this->memberInfo);
55
+				Context::set('member_info', $this->memberInfo);
56 56
 			}
57 57
 		}
58 58
 
@@ -79,30 +79,30 @@  discard block
 block discarded – undo
79 79
 
80 80
 		$filter = Context::get('filter_type');
81 81
 		global $lang;
82
-		switch($filter)
82
+		switch ($filter)
83 83
 		{
84
-			case 'super_admin' : Context::set('filter_type_title', $lang->cmd_show_super_admin_member);break;
85
-			case 'site_admin' : Context::set('filter_type_title', $lang->cmd_show_site_admin_member);break;
86
-			default : Context::set('filter_type_title', $lang->cmd_show_all_member);break;
84
+			case 'super_admin' : Context::set('filter_type_title', $lang->cmd_show_super_admin_member); break;
85
+			case 'site_admin' : Context::set('filter_type_title', $lang->cmd_show_site_admin_member); break;
86
+			default : Context::set('filter_type_title', $lang->cmd_show_all_member); break;
87 87
 		}
88 88
 		// retrieve list of groups for each member
89
-		if($output->data)
89
+		if ($output->data)
90 90
 		{
91
-			foreach($output->data as $key => $member)
91
+			foreach ($output->data as $key => $member)
92 92
 			{
93
-				$output->data[$key]->group_list = $oMemberModel->getMemberGroups($member->member_srl,0);
93
+				$output->data[$key]->group_list = $oMemberModel->getMemberGroups($member->member_srl, 0);
94 94
 			}
95 95
 		}
96 96
 		$config = $this->memberConfig;
97 97
 		$memberIdentifiers = array('user_id'=>'user_id', 'user_name'=>'user_name', 'nick_name'=>'nick_name');
98 98
 		$usedIdentifiers = array();	
99 99
 
100
-		if(is_array($config->signupForm))
100
+		if (is_array($config->signupForm))
101 101
 		{
102
-			foreach($config->signupForm as $signupItem)
102
+			foreach ($config->signupForm as $signupItem)
103 103
 			{
104
-				if(!count($memberIdentifiers)) break;
105
-				if(in_array($signupItem->name, $memberIdentifiers) && ($signupItem->required || $signupItem->isUse))
104
+				if (!count($memberIdentifiers)) break;
105
+				if (in_array($signupItem->name, $memberIdentifiers) && ($signupItem->required || $signupItem->isUse))
106 106
 				{
107 107
 					unset($memberIdentifiers[$signupItem->name]);
108 108
 					$usedIdentifiers[$signupItem->name] = $lang->{$signupItem->name};
@@ -139,14 +139,14 @@  discard block
 block discarded – undo
139 139
 	{
140 140
 		$config = $this->memberConfig;
141 141
 
142
-		if($config->redirect_url)
142
+		if ($config->redirect_url)
143 143
 		{
144 144
 			$mid = str_ireplace(Context::getDefaultUrl(), '', $config->redirect_url);
145 145
 
146 146
 			$siteModuleInfo = Context::get('site_module_info');
147 147
 
148 148
 			$oModuleModel = getModel('module');
149
-			$moduleInfo = $oModuleModel->getModuleInfoByMid($mid, (int)$siteModuleInfo->site_srl);
149
+			$moduleInfo = $oModuleModel->getModuleInfoByMid($mid, (int) $siteModuleInfo->site_srl);
150 150
 
151 151
 			$config->redirect_url = $moduleInfo->module_srl;
152 152
 			Context::set('config', $config);
@@ -171,9 +171,9 @@  discard block
 block discarded – undo
171 171
 		Context::set('editor', $editor);
172 172
 
173 173
 		$signupForm = $config->signupForm;
174
-		foreach($signupForm as $val)
174
+		foreach ($signupForm as $val)
175 175
 		{
176
-			if($val->name == 'user_id')
176
+			if ($val->name == 'user_id')
177 177
 			{
178 178
 				$userIdInfo = $val;
179 179
 				break;
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 		}
182 182
 
183 183
 		$oSecurity = new Security();
184
-		if($userIdInfo->isUse)
184
+		if ($userIdInfo->isUse)
185 185
 		{
186 186
 			// get denied ID list
187 187
 			Context::set('useUserID', 1);
@@ -271,16 +271,16 @@  discard block
 block discarded – undo
271 271
 		Context::set('editor', $editor);
272 272
 
273 273
 		$signupForm = $config->signupForm;
274
-		foreach($signupForm as $val)
274
+		foreach ($signupForm as $val)
275 275
 		{
276
-			if($val->name == 'user_id')
276
+			if ($val->name == 'user_id')
277 277
 			{
278 278
 				$userIdInfo = $val;
279 279
 				break;
280 280
 			}
281 281
 		}
282 282
 
283
-		if($userIdInfo->isUse)
283
+		if ($userIdInfo->isUse)
284 284
 		{
285 285
 			// get denied ID list
286 286
 			Context::set('useUserID', 1);
@@ -341,14 +341,14 @@  discard block
 block discarded – undo
341 341
 		$oMemberModel = getModel('member');
342 342
 
343 343
 		$memberInfo = Context::get('member_info');
344
-		if(isset($memberInfo))
344
+		if (isset($memberInfo))
345 345
 		{
346 346
 			$memberInfo->signature = $oMemberModel->getSignature($this->memberInfo->member_srl);
347 347
 		}
348 348
 		Context::set('member_info', $memberInfo);
349 349
 
350 350
 		// get an editor for the signature
351
-		if($memberInfo->member_srl)
351
+		if ($memberInfo->member_srl)
352 352
 		{
353 353
 			$oEditorModel = getModel('editor');
354 354
 			$option = new stdClass();
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
 		}
399 399
 
400 400
 		$member_config = $this->memberConfig;
401
-		if(!$this->memberConfig)
401
+		if (!$this->memberConfig)
402 402
 		{
403 403
 			$member_config = $this->memberConfig = $oMemberModel->getMemberConfig();
404 404
 		}
@@ -406,16 +406,16 @@  discard block
 block discarded – undo
406 406
 		$formTags = array();
407 407
 		global $lang;
408 408
 
409
-		foreach($member_config->signupForm as $no=>$formInfo)
409
+		foreach ($member_config->signupForm as $no=>$formInfo)
410 410
 		{
411
-			if(!$formInfo->isUse)continue;
412
-			if($formInfo->name == $member_config->identifier || $formInfo->name == 'password') continue;
411
+			if (!$formInfo->isUse)continue;
412
+			if ($formInfo->name == $member_config->identifier || $formInfo->name == 'password') continue;
413 413
 			$formTag = new stdClass();
414 414
 			$inputTag = '';
415 415
 			$formTag->title = ($formInfo->isDefaultForm) ? $lang->{$formInfo->name} : $formInfo->title;
416
-			if($isAdmin)
416
+			if ($isAdmin)
417 417
 			{
418
-				if($formInfo->mustRequired) $formTag->title = '<em style="color:red">*</em> '.$formTag->title;
418
+				if ($formInfo->mustRequired) $formTag->title = '<em style="color:red">*</em> '.$formTag->title;
419 419
 			}
420 420
 			else
421 421
 			{
@@ -423,28 +423,28 @@  discard block
 block discarded – undo
423 423
 			}
424 424
 			$formTag->name = $formInfo->name;
425 425
 
426
-			if($formInfo->isDefaultForm)
426
+			if ($formInfo->isDefaultForm)
427 427
 			{
428
-				if($formInfo->imageType)
428
+				if ($formInfo->imageType)
429 429
 				{
430 430
 					$formTag->type = 'image';
431
-					if($formInfo->name == 'profile_image')
431
+					if ($formInfo->name == 'profile_image')
432 432
 					{
433 433
 						$target = $memberInfo['profile_image'];
434 434
 						$functionName = 'doDeleteProfileImage';
435 435
 					}
436
-					else if($formInfo->name == 'image_name')
436
+					else if ($formInfo->name == 'image_name')
437 437
 					{
438 438
 						$target = $memberInfo['image_name'];
439 439
 						$functionName = 'doDeleteImageName';
440 440
 					}
441
-					else if($formInfo->name == 'image_mark')
441
+					else if ($formInfo->name == 'image_mark')
442 442
 					{
443 443
 						$target = $memberInfo['image_mark'];
444 444
 						$functionName = 'doDeleteImageMark';
445 445
 					}
446 446
 
447
-					if($target->src)
447
+					if ($target->src)
448 448
 					{
449 449
 						$inputTag = sprintf('<input type="hidden" name="__%s_exist" value="true" /><span id="%s"><img src="%s" alt="%s" /> <button type="button" onclick="%s(%d);return false;">%s</button></span>',
450 450
 							$formInfo->name,
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
 						$lang->{$formInfo->name.'_max_height'},
468 468
 						$member_config->{$formInfo->name.'_max_height'});
469 469
 					}//end imageType
470
-					else if($formInfo->name == 'birthday')
470
+					else if ($formInfo->name == 'birthday')
471 471
 					{
472 472
 						$formTag->type = 'date';
473 473
 						$inputTag = sprintf('<input type="hidden" name="birthday" id="date_birthday" value="%s" /><input type="text" placeholder="YYYY-MM-DD" name="birthday_ui" class="inputDate" id="birthday" value="%s" readonly="readonly" /> <input type="button" value="%s" class="btn dateRemover" />',
@@ -475,14 +475,14 @@  discard block
 block discarded – undo
475 475
 							zdate($memberInfo['birthday'], 'Y-m-d', false),
476 476
 							$lang->cmd_delete);
477 477
 					}
478
-					else if($formInfo->name == 'find_account_question')
478
+					else if ($formInfo->name == 'find_account_question')
479 479
 					{
480 480
 						$formTag->type = 'select';
481 481
 						$inputTag = '<select name="find_account_question" id="find_account_question" style="display:block;margin:0 0 8px 0">%s</select>';
482 482
 						$optionTag = array();
483
-						foreach($lang->find_account_question_items as $key=>$val)
483
+						foreach ($lang->find_account_question_items as $key=>$val)
484 484
 						{
485
-							if($key == $memberInfo['find_account_question']) $selected = 'selected="selected"';
485
+							if ($key == $memberInfo['find_account_question']) $selected = 'selected="selected"';
486 486
 							else $selected = '';
487 487
 							$optionTag[] = sprintf('<option value="%s" %s >%s</option>',
488 488
 								$key,
@@ -492,17 +492,17 @@  discard block
 block discarded – undo
492 492
 						$inputTag = sprintf($inputTag, implode('', $optionTag));
493 493
 						$inputTag .= '<input type="text" name="find_account_answer" id="find_account_answer" title="'.Context::getLang('find_account_answer').'" value="'.$memberInfo['find_account_answer'].'" />';
494 494
 					}
495
-					else if($formInfo->name == 'email_address')
495
+					else if ($formInfo->name == 'email_address')
496 496
 					{
497 497
 						$formTag->type = 'email';
498 498
 						$inputTag = '<input type="email" name="email_address" id="email_address" value="'.$memberInfo['email_address'].'" />';
499 499
 					}
500
-					else if($formInfo->name == 'homepage')
500
+					else if ($formInfo->name == 'homepage')
501 501
 					{
502 502
 						$formTag->type = 'url';
503 503
 						$inputTag = '<input type="url" name="homepage" id="homepage" value="'.$memberInfo['homepage'].'" />';
504 504
 					}
505
-					else if($formInfo->name == 'blog')
505
+					else if ($formInfo->name == 'blog')
506 506
 					{
507 507
 						$formTag->type = 'url';
508 508
 						$inputTag = '<input type="url" name="blog" id="blog" value="'.$memberInfo['blog'].'" />';
@@ -523,92 +523,92 @@  discard block
 block discarded – undo
523 523
 					$extentionReplace = array();
524 524
 
525 525
 					$formTag->type = $extendForm->column_type;
526
-					if($extendForm->column_type == 'text')
526
+					if ($extendForm->column_type == 'text')
527 527
 					{
528 528
 						$template = '<input type="text" name="%column_name%" id="%column_name%" value="%value%" />';
529 529
 					}
530
-					else if($extendForm->column_type == 'homepage')
530
+					else if ($extendForm->column_type == 'homepage')
531 531
 					{
532 532
 						$template = '<input type="url" name="%column_name%" id="%column_name%" value="%value%" />';
533 533
 					}
534
-					else if($extendForm->column_type == 'email_address')
534
+					else if ($extendForm->column_type == 'email_address')
535 535
 					{
536 536
 						$template = '<input type="email" name="%column_name%" id="%column_name%" value="%value%" />';
537 537
 					}
538
-					else if($extendForm->column_type == 'tel')
538
+					else if ($extendForm->column_type == 'tel')
539 539
 					{
540 540
 						$extentionReplace = array('tel_0' => $extendForm->value[0],
541 541
 							'tel_1' => $extendForm->value[1],
542 542
 							'tel_2' => $extendForm->value[2]);
543 543
 						$template = '<input type="tel" name="%column_name%[]" id="%column_name%" value="%tel_0%" size="4" maxlength="4" style="width:30px" title="First Number" /> - <input type="tel" name="%column_name%[]" value="%tel_1%" size="4" maxlength="4" style="width:35px" title="Second Number" /> - <input type="tel" name="%column_name%[]" value="%tel_2%" size="4" maxlength="4" style="width:35px" title="Third Number" />';
544 544
 					}
545
-					else if($extendForm->column_type == 'textarea')
545
+					else if ($extendForm->column_type == 'textarea')
546 546
 					{
547 547
 						$template = '<textarea name="%column_name%" id="%column_name%" rows="4" cols="42">%value%</textarea>';
548 548
 					}
549
-					else if($extendForm->column_type == 'checkbox')
549
+					else if ($extendForm->column_type == 'checkbox')
550 550
 					{
551 551
 						$template = '';
552
-						if($extendForm->default_value)
552
+						if ($extendForm->default_value)
553 553
 						{
554 554
 							$template = '<div style="padding-top:5px">%s</div>';
555 555
 							$__i = 0;
556 556
 							$optionTag = array();
557
-							foreach($extendForm->default_value as $v)
557
+							foreach ($extendForm->default_value as $v)
558 558
 							{
559 559
 								$checked = '';
560
-								if(is_array($extendForm->value) && in_array($v, $extendForm->value))$checked = 'checked="checked"';
560
+								if (is_array($extendForm->value) && in_array($v, $extendForm->value))$checked = 'checked="checked"';
561 561
 								$optionTag[] = '<label for="%column_name%'.$__i.'"><input type="checkbox" id="%column_name%'.$__i.'" name="%column_name%[]" value="'.$v.'" '.$checked.' /> '.$v.'</label>';
562 562
 								$__i++;
563 563
 							}
564 564
 							$template = sprintf($template, implode('', $optionTag));
565 565
 						}
566 566
 					}
567
-					else if($extendForm->column_type == 'radio')
567
+					else if ($extendForm->column_type == 'radio')
568 568
 					{
569 569
 						$template = '';
570
-						if($extendForm->default_value)
570
+						if ($extendForm->default_value)
571 571
 						{
572 572
 							$template = '<div style="padding-top:5px">%s</div>';
573 573
 							$optionTag = array();
574
-							foreach($extendForm->default_value as $v)
574
+							foreach ($extendForm->default_value as $v)
575 575
 							{
576
-								if($extendForm->value == $v)$checked = 'checked="checked"';
576
+								if ($extendForm->value == $v)$checked = 'checked="checked"';
577 577
 								else $checked = '';
578 578
 								$optionTag[] = '<label><input type="radio" name="%column_name%" value="'.$v.'" '.$checked.' /> '.$v.'</label>';
579 579
 							}
580 580
 							$template = sprintf($template, implode('', $optionTag));
581 581
 						}
582 582
 					}
583
-					else if($extendForm->column_type == 'select')
583
+					else if ($extendForm->column_type == 'select')
584 584
 					{
585 585
 						$template = '<select name="'.$formInfo->name.'" id="'.$formInfo->name.'">%s</select>';
586 586
 						$optionTag = array();
587 587
 						$optionTag[] = sprintf('<option value="">%s</option>', $lang->cmd_select);
588
-						if($extendForm->default_value)
588
+						if ($extendForm->default_value)
589 589
 						{
590
-							foreach($extendForm->default_value as $v)
590
+							foreach ($extendForm->default_value as $v)
591 591
 							{
592
-								if($v == $extendForm->value) $selected = 'selected="selected"';
592
+								if ($v == $extendForm->value) $selected = 'selected="selected"';
593 593
 								else $selected = '';
594 594
 								$optionTag[] = sprintf('<option value="%s" %s >%s</option>', $v, $selected, $v);
595 595
 							}
596 596
 						}
597 597
 						$template = sprintf($template, implode('', $optionTag));
598 598
 					}
599
-					else if($extendForm->column_type == 'kr_zip')
599
+					else if ($extendForm->column_type == 'kr_zip')
600 600
 					{
601 601
 						$krzipModel = getModel('krzip');
602
-						if($krzipModel && method_exists($krzipModel , 'getKrzipCodeSearchHtml' ))
602
+						if ($krzipModel && method_exists($krzipModel, 'getKrzipCodeSearchHtml'))
603 603
 						{
604 604
 							$template = $krzipModel->getKrzipCodeSearchHtml($extendForm->column_name, $extendForm->value);
605 605
 						}
606 606
 					}
607
-					else if($extendForm->column_type == 'jp_zip')
607
+					else if ($extendForm->column_type == 'jp_zip')
608 608
 					{
609 609
 						$template = '<input type="text" name="%column_name%" id="%column_name%" value="%value%" />';
610 610
 					}
611
-					else if($extendForm->column_type == 'date')
611
+					else if ($extendForm->column_type == 'date')
612 612
 					{
613 613
 						$extentionReplace = array('date' => zdate($extendForm->value, 'Y-m-d'), 'cmd_delete' => $lang->cmd_delete);
614 614
 						$template = '<input type="hidden" name="%column_name%" id="date_%column_name%" value="%value%" /><input type="text" placeholder="YYYY-MM-DD" class="inputDate" value="%date%" readonly="readonly" /> <input type="button" value="%cmd_delete%" class="btn dateRemover" />';
@@ -617,7 +617,7 @@  discard block
 block discarded – undo
617 617
 					$replace = array_merge($extentionReplace, $replace);
618 618
 					$inputTag = preg_replace_callback('@%(\w+)%@', function($n) use($replace) { return $replace[$n[1]]; }, $template);
619 619
 
620
-					if($extendForm->description)
620
+					if ($extendForm->description)
621 621
 						$inputTag .= '<p class="help-block">'.$extendForm->description.'</p>';
622 622
 				}
623 623
 				$formTag->inputTag = $inputTag;
@@ -648,12 +648,12 @@  discard block
 block discarded – undo
648 648
 	function dispMemberAdminInsertJoinForm() {
649 649
 		// Get the value of join_form
650 650
 		$member_join_form_srl = Context::get('member_join_form_srl');
651
-		if($member_join_form_srl)
651
+		if ($member_join_form_srl)
652 652
 		{
653 653
 			$oMemberModel = getModel('member');
654 654
 			$join_form = $oMemberModel->getJoinForm($member_join_form_srl);
655 655
 
656
-			if(!$join_form) Context::set('member_join_form_srl','',true);
656
+			if (!$join_form) Context::set('member_join_form_srl', '', true);
657 657
 			else
658 658
 			{
659 659
 				Context::set('join_form', $join_form);
Please login to merge, or discard this patch.
Braces   +62 added lines, -57 removed lines patch added patch discarded remove patch
@@ -49,8 +49,7 @@  discard block
 block discarded – undo
49 49
 			if(!$this->memberInfo)
50 50
 			{
51 51
 				Context::set('member_srl','');
52
-			}
53
-			else
52
+			} else
54 53
 			{
55 54
 				Context::set('member_info',$this->memberInfo);
56 55
 			}
@@ -101,7 +100,9 @@  discard block
 block discarded – undo
101 100
 		{
102 101
 			foreach($config->signupForm as $signupItem)
103 102
 			{
104
-				if(!count($memberIdentifiers)) break;
103
+				if(!count($memberIdentifiers)) {
104
+					break;
105
+				}
105 106
 				if(in_array($signupItem->name, $memberIdentifiers) && ($signupItem->required || $signupItem->isUse))
106 107
 				{
107 108
 					unset($memberIdentifiers[$signupItem->name]);
@@ -316,7 +317,9 @@  discard block
 block discarded – undo
316 317
 		$extendForm = $oMemberModel->getCombineJoinForm($this->memberInfo);
317 318
 		Context::set('extend_form_list', $extendForm);
318 319
 		$memberInfo = get_object_vars(Context::get('member_info'));
319
-		if (!is_array($memberInfo['group_list'])) $memberInfo['group_list'] = array();
320
+		if (!is_array($memberInfo['group_list'])) {
321
+			$memberInfo['group_list'] = array();
322
+		}
320 323
 		Context::set('memberInfo', $memberInfo);
321 324
 
322 325
 		$disableColumns = array('password', 'find_account_question');
@@ -412,18 +415,25 @@  discard block
 block discarded – undo
412 415
 
413 416
 		foreach($member_config->signupForm as $no=>$formInfo)
414 417
 		{
415
-			if(!$formInfo->isUse)continue;
416
-			if($formInfo->name == $member_config->identifier || $formInfo->name == 'password') continue;
418
+			if(!$formInfo->isUse) {
419
+				continue;
420
+			}
421
+			if($formInfo->name == $member_config->identifier || $formInfo->name == 'password') {
422
+				continue;
423
+			}
417 424
 			$formTag = new stdClass();
418 425
 			$inputTag = '';
419 426
 			$formTag->title = ($formInfo->isDefaultForm) ? $lang->{$formInfo->name} : $formInfo->title;
420 427
 			if($isAdmin)
421 428
 			{
422
-				if($formInfo->mustRequired) $formTag->title = '<em style="color:red">*</em> '.$formTag->title;
423
-			}
424
-			else
429
+				if($formInfo->mustRequired) {
430
+					$formTag->title = '<em style="color:red">*</em> '.$formTag->title;
431
+				}
432
+			} else
425 433
 			{
426
-				if ($formInfo->required && $formInfo->name != 'password') $formTag->title = '<em style="color:red">*</em> '.$formTag->title;
434
+				if ($formInfo->required && $formInfo->name != 'password') {
435
+					$formTag->title = '<em style="color:red">*</em> '.$formTag->title;
436
+				}
427 437
 			}
428 438
 			$formTag->name = $formInfo->name;
429 439
 
@@ -436,13 +446,11 @@  discard block
 block discarded – undo
436 446
 					{
437 447
 						$target = $memberInfo['profile_image'];
438 448
 						$functionName = 'doDeleteProfileImage';
439
-					}
440
-					else if($formInfo->name == 'image_name')
449
+					} else if($formInfo->name == 'image_name')
441 450
 					{
442 451
 						$target = $memberInfo['image_name'];
443 452
 						$functionName = 'doDeleteImageName';
444
-					}
445
-					else if($formInfo->name == 'image_mark')
453
+					} else if($formInfo->name == 'image_mark')
446 454
 					{
447 455
 						$target = $memberInfo['image_mark'];
448 456
 						$functionName = 'doDeleteImageMark';
@@ -458,8 +466,7 @@  discard block
 block discarded – undo
458 466
 							$functionName,
459 467
 							$memberInfo['member_srl'],
460 468
 							$lang->cmd_delete);
461
-					}
462
-					else
469
+					} else
463 470
 					{
464 471
 						$inputTag = sprintf('<input type="hidden" name="__%s_exist" value="false" />', $formInfo->name);
465 472
 					}
@@ -478,16 +485,18 @@  discard block
 block discarded – undo
478 485
 							$memberInfo['birthday'],
479 486
 							zdate($memberInfo['birthday'], 'Y-m-d', false),
480 487
 							$lang->cmd_delete);
481
-					}
482
-					else if($formInfo->name == 'find_account_question')
488
+					} else if($formInfo->name == 'find_account_question')
483 489
 					{
484 490
 						$formTag->type = 'select';
485 491
 						$inputTag = '<select name="find_account_question" id="find_account_question" style="display:block;margin:0 0 8px 0">%s</select>';
486 492
 						$optionTag = array();
487 493
 						foreach($lang->find_account_question_items as $key=>$val)
488 494
 						{
489
-							if($key == $memberInfo['find_account_question']) $selected = 'selected="selected"';
490
-							else $selected = '';
495
+							if($key == $memberInfo['find_account_question']) {
496
+								$selected = 'selected="selected"';
497
+							} else {
498
+								$selected = '';
499
+							}
491 500
 							$optionTag[] = sprintf('<option value="%s" %s >%s</option>',
492 501
 								$key,
493 502
 								$selected,
@@ -495,23 +504,19 @@  discard block
 block discarded – undo
495 504
 						}
496 505
 						$inputTag = sprintf($inputTag, implode('', $optionTag));
497 506
 						$inputTag .= '<input type="text" name="find_account_answer" id="find_account_answer" title="'.Context::getLang('find_account_answer').'" value="'.$memberInfo['find_account_answer'].'" />';
498
-					}
499
-					else if($formInfo->name == 'email_address')
507
+					} else if($formInfo->name == 'email_address')
500 508
 					{
501 509
 						$formTag->type = 'email';
502 510
 						$inputTag = '<input type="email" name="email_address" id="email_address" value="'.$memberInfo['email_address'].'" />';
503
-					}
504
-					else if($formInfo->name == 'homepage')
511
+					} else if($formInfo->name == 'homepage')
505 512
 					{
506 513
 						$formTag->type = 'url';
507 514
 						$inputTag = '<input type="url" name="homepage" id="homepage" value="'.$memberInfo['homepage'].'" />';
508
-					}
509
-					else if($formInfo->name == 'blog')
515
+					} else if($formInfo->name == 'blog')
510 516
 					{
511 517
 						$formTag->type = 'url';
512 518
 						$inputTag = '<input type="url" name="blog" id="blog" value="'.$memberInfo['blog'].'" />';
513
-					}
514
-					else
519
+					} else
515 520
 					{
516 521
 						$formTag->type = 'text';
517 522
 						$inputTag = sprintf('<input type="text" name="%s" id="%s" value="%s" />',
@@ -530,27 +535,22 @@  discard block
 block discarded – undo
530 535
 					if($extendForm->column_type == 'text')
531 536
 					{
532 537
 						$template = '<input type="text" name="%column_name%" id="%column_name%" value="%value%" />';
533
-					}
534
-					else if($extendForm->column_type == 'homepage')
538
+					} else if($extendForm->column_type == 'homepage')
535 539
 					{
536 540
 						$template = '<input type="url" name="%column_name%" id="%column_name%" value="%value%" />';
537
-					}
538
-					else if($extendForm->column_type == 'email_address')
541
+					} else if($extendForm->column_type == 'email_address')
539 542
 					{
540 543
 						$template = '<input type="email" name="%column_name%" id="%column_name%" value="%value%" />';
541
-					}
542
-					else if($extendForm->column_type == 'tel')
544
+					} else if($extendForm->column_type == 'tel')
543 545
 					{
544 546
 						$extentionReplace = array('tel_0' => $extendForm->value[0],
545 547
 							'tel_1' => $extendForm->value[1],
546 548
 							'tel_2' => $extendForm->value[2]);
547 549
 						$template = '<input type="tel" name="%column_name%[]" id="%column_name%" value="%tel_0%" size="4" maxlength="4" style="width:30px" title="First Number" /> - <input type="tel" name="%column_name%[]" value="%tel_1%" size="4" maxlength="4" style="width:35px" title="Second Number" /> - <input type="tel" name="%column_name%[]" value="%tel_2%" size="4" maxlength="4" style="width:35px" title="Third Number" />';
548
-					}
549
-					else if($extendForm->column_type == 'textarea')
550
+					} else if($extendForm->column_type == 'textarea')
550 551
 					{
551 552
 						$template = '<textarea name="%column_name%" id="%column_name%" rows="4" cols="42">%value%</textarea>';
552
-					}
553
-					else if($extendForm->column_type == 'checkbox')
553
+					} else if($extendForm->column_type == 'checkbox')
554 554
 					{
555 555
 						$template = '';
556 556
 						if($extendForm->default_value)
@@ -561,14 +561,15 @@  discard block
 block discarded – undo
561 561
 							foreach($extendForm->default_value as $v)
562 562
 							{
563 563
 								$checked = '';
564
-								if(is_array($extendForm->value) && in_array($v, $extendForm->value))$checked = 'checked="checked"';
564
+								if(is_array($extendForm->value) && in_array($v, $extendForm->value)) {
565
+									$checked = 'checked="checked"';
566
+								}
565 567
 								$optionTag[] = '<label for="%column_name%'.$__i.'"><input type="checkbox" id="%column_name%'.$__i.'" name="%column_name%[]" value="'.$v.'" '.$checked.' /> '.$v.'</label>';
566 568
 								$__i++;
567 569
 							}
568 570
 							$template = sprintf($template, implode('', $optionTag));
569 571
 						}
570
-					}
571
-					else if($extendForm->column_type == 'radio')
572
+					} else if($extendForm->column_type == 'radio')
572 573
 					{
573 574
 						$template = '';
574 575
 						if($extendForm->default_value)
@@ -577,14 +578,16 @@  discard block
 block discarded – undo
577 578
 							$optionTag = array();
578 579
 							foreach($extendForm->default_value as $v)
579 580
 							{
580
-								if($extendForm->value == $v)$checked = 'checked="checked"';
581
-								else $checked = '';
581
+								if($extendForm->value == $v) {
582
+									$checked = 'checked="checked"';
583
+								} else {
584
+									$checked = '';
585
+								}
582 586
 								$optionTag[] = '<label><input type="radio" name="%column_name%" value="'.$v.'" '.$checked.' /> '.$v.'</label>';
583 587
 							}
584 588
 							$template = sprintf($template, implode('', $optionTag));
585 589
 						}
586
-					}
587
-					else if($extendForm->column_type == 'select')
590
+					} else if($extendForm->column_type == 'select')
588 591
 					{
589 592
 						$template = '<select name="'.$formInfo->name.'" id="'.$formInfo->name.'">%s</select>';
590 593
 						$optionTag = array();
@@ -593,26 +596,26 @@  discard block
 block discarded – undo
593 596
 						{
594 597
 							foreach($extendForm->default_value as $v)
595 598
 							{
596
-								if($v == $extendForm->value) $selected = 'selected="selected"';
597
-								else $selected = '';
599
+								if($v == $extendForm->value) {
600
+									$selected = 'selected="selected"';
601
+								} else {
602
+									$selected = '';
603
+								}
598 604
 								$optionTag[] = sprintf('<option value="%s" %s >%s</option>', $v, $selected, $v);
599 605
 							}
600 606
 						}
601 607
 						$template = sprintf($template, implode('', $optionTag));
602
-					}
603
-					else if($extendForm->column_type == 'kr_zip')
608
+					} else if($extendForm->column_type == 'kr_zip')
604 609
 					{
605 610
 						$krzipModel = getModel('krzip');
606 611
 						if($krzipModel && method_exists($krzipModel , 'getKrzipCodeSearchHtml' ))
607 612
 						{
608 613
 							$template = $krzipModel->getKrzipCodeSearchHtml($extendForm->column_name, $extendForm->value);
609 614
 						}
610
-					}
611
-					else if($extendForm->column_type == 'jp_zip')
615
+					} else if($extendForm->column_type == 'jp_zip')
612 616
 					{
613 617
 						$template = '<input type="text" name="%column_name%" id="%column_name%" value="%value%" />';
614
-					}
615
-					else if($extendForm->column_type == 'date')
618
+					} else if($extendForm->column_type == 'date')
616 619
 					{
617 620
 						$extentionReplace = array('date' => zdate($extendForm->value, 'Y-m-d'), 'cmd_delete' => $lang->cmd_delete);
618 621
 						$template = '<input type="hidden" name="%column_name%" id="date_%column_name%" value="%value%" /><input type="text" placeholder="YYYY-MM-DD" class="inputDate" value="%date%" readonly="readonly" /> <input type="button" value="%cmd_delete%" class="btn dateRemover" />';
@@ -621,8 +624,9 @@  discard block
 block discarded – undo
621 624
 					$replace = array_merge($extentionReplace, $replace);
622 625
 					$inputTag = preg_replace_callback('@%(\w+)%@', function($n) use($replace) { return $replace[$n[1]]; }, $template);
623 626
 
624
-					if($extendForm->description)
625
-						$inputTag .= '<p class="help-block">'.$extendForm->description.'</p>';
627
+					if($extendForm->description) {
628
+											$inputTag .= '<p class="help-block">'.$extendForm->description.'</p>';
629
+					}
626 630
 				}
627 631
 				$formTag->inputTag = $inputTag;
628 632
 				$formTags[] = $formTag;
@@ -657,8 +661,9 @@  discard block
 block discarded – undo
657 661
 			$oMemberModel = getModel('member');
658 662
 			$join_form = $oMemberModel->getJoinForm($member_join_form_srl);
659 663
 
660
-			if(!$join_form) Context::set('member_join_form_srl','',true);
661
-			else
664
+			if(!$join_form) {
665
+				Context::set('member_join_form_srl','',true);
666
+			} else
662 667
 			{
663 668
 				Context::set('join_form', $join_form);
664 669
 				$security = new Security();
Please login to merge, or discard this patch.
modules/member/member.api.php 3 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 	/**
25 25
 	 * Arrange Contents
26 26
 	 *
27
-	 * @param array $content_list
27
+	 * @param string $content_list
28 28
 	 *
29 29
 	 * @return array
30 30
 	 */
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 	/**
42 42
 	 * Arrange Contents
43 43
 	 *
44
-	 * @param array $content_list
44
+	 * @param array $content
45 45
 	 *
46 46
 	 * @return array
47 47
 	 */
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -17,8 +17,8 @@  discard block
 block discarded – undo
17 17
 	function dispSavedDocumentList(&$oModule)
18 18
 	{
19 19
 		$document_list = $this->arrangeContentList(Context::get('document_list'));
20
-		$oModule->add('document_list',$document_list);
21
-		$oModule->add('page_navigation',Context::get('page_navigation'));
20
+		$oModule->add('document_list', $document_list);
21
+		$oModule->add('page_navigation', Context::get('page_navigation'));
22 22
 	}
23 23
 
24 24
 	/**
@@ -31,9 +31,9 @@  discard block
 block discarded – undo
31 31
 	function arrangeContentList($content_list)
32 32
 	{
33 33
 		$output = array();
34
-		if(count($content_list))
34
+		if (count($content_list))
35 35
 		{
36
-			foreach($content_list as $key => $val) $output[] = $this->arrangeContent($val);
36
+			foreach ($content_list as $key => $val) $output[] = $this->arrangeContent($val);
37 37
 		}
38 38
 		return $output;
39 39
 	}
@@ -48,9 +48,9 @@  discard block
 block discarded – undo
48 48
 	function arrangeContent($content)
49 49
 	{
50 50
 		$output = null;
51
-		if($content)
51
+		if ($content)
52 52
 		{
53
-			$output= $content->gets('document_srl','category_srl','nick_name','user_id','user_name','title','content','tags','voted_count','blamed_count','comment_count','regdate','last_update','extra_vars','status');
53
+			$output = $content->gets('document_srl', 'category_srl', 'nick_name', 'user_id', 'user_name', 'title', 'content', 'tags', 'voted_count', 'blamed_count', 'comment_count', 'regdate', 'last_update', 'extra_vars', 'status');
54 54
 		}
55 55
 		return $output;
56 56
 	}
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,9 @@
 block discarded – undo
33 33
 		$output = array();
34 34
 		if(count($content_list))
35 35
 		{
36
-			foreach($content_list as $key => $val) $output[] = $this->arrangeContent($val);
36
+			foreach($content_list as $key => $val) {
37
+				$output[] = $this->arrangeContent($val);
38
+			}
37 39
 		}
38 40
 		return $output;
39 41
 	}
Please login to merge, or discard this patch.
modules/member/member.controller.php 4 patches
Doc Comments   +21 added lines, -13 removed lines patch added patch discarded remove patch
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 	/**
188 188
 	 * Delete the post
189 189
 	 *
190
-	 * @return void|Object (void : success, Object : fail)
190
+	 * @return Object|null (void : success, Object : fail)
191 191
 	 */
192 192
 	function procMemberDeleteSavedDocument()
193 193
 	{
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 	/**
206 206
 	 * Check values when member joining
207 207
 	 *
208
-	 * @return void|Object (void : success, Object : fail)
208
+	 * @return null|Object (void : success, Object : fail)
209 209
 	 */
210 210
 	function procMemberCheckValue()
211 211
 	{
@@ -672,7 +672,7 @@  discard block
 block discarded – undo
672 672
 	/**
673 673
 	 * Add a profile image
674 674
 	 *
675
-	 * @return void|Object (void : success, Object : fail)
675
+	 * @return ModuleObject|null (void : success, Object : fail)
676 676
 	 */
677 677
 	function procMemberInsertProfileImage()
678 678
 	{
@@ -751,7 +751,7 @@  discard block
 block discarded – undo
751 751
 	/**
752 752
 	 * Add an image name
753 753
 	 *
754
-	 * @return void|Object (void : success, Object : fail)
754
+	 * @return ModuleObject|null (void : success, Object : fail)
755 755
 	 */
756 756
 	function procMemberInsertImageName()
757 757
 	{
@@ -836,7 +836,7 @@  discard block
 block discarded – undo
836 836
 	/**
837 837
 	 * Delete Image name
838 838
 	 *
839
-	 * @return void
839
+	 * @return Object
840 840
 	 */
841 841
 	function procMemberDeleteImageName($_memberSrl = 0)
842 842
 	{
@@ -860,7 +860,7 @@  discard block
 block discarded – undo
860 860
 	/**
861 861
 	 * Add an image to mark
862 862
 	 *
863
-	 * @return void|Object (void : success, Object : fail)
863
+	 * @return ModuleObject|null (void : success, Object : fail)
864 864
 	 */
865 865
 	function procMemberInsertImageMark()
866 866
 	{
@@ -1100,7 +1100,7 @@  discard block
 block discarded – undo
1100 1100
 	 * Execute finding ID/Passoword
1101 1101
 	 * When clicking the link in the verification email, a method is called to change the old password and to authenticate it
1102 1102
 	 *
1103
-	 * @return void|Object (void : success, Object : fail)
1103
+	 * @return ModuleObject|null (void : success, Object : fail)
1104 1104
 	 */
1105 1105
 	function procMemberAuthAccount()
1106 1106
 	{
@@ -1172,7 +1172,7 @@  discard block
 block discarded – undo
1172 1172
 	/**
1173 1173
 	 * Request to re-send the authentication mail
1174 1174
 	 *
1175
-	 * @return void|Object (void : success, Object : fail)
1175
+	 * @return Object|null (void : success, Object : fail)
1176 1176
 	 */
1177 1177
 	function procMemberResendAuthMail()
1178 1178
 	{
@@ -1331,6 +1331,9 @@  discard block
 block discarded – undo
1331 1331
 		$this->setRedirectUrl($returnUrl);
1332 1332
 	}
1333 1333
 
1334
+	/**
1335
+	 * @param stdClass $auth_args
1336
+	 */
1334 1337
 	function _sendAuthMail($auth_args, $member_info)
1335 1338
 	{
1336 1339
 		$oMemberModel = getModel('member');
@@ -1386,7 +1389,7 @@  discard block
 block discarded – undo
1386 1389
 	/**
1387 1390
 	 * Join a virtual site
1388 1391
 	 *
1389
-	 * @return void|Object (void : success, Object : fail)
1392
+	 * @return Object|null (void : success, Object : fail)
1390 1393
 	 */
1391 1394
 	function procMemberSiteSignUp()
1392 1395
 	{
@@ -1463,7 +1466,7 @@  discard block
 block discarded – undo
1463 1466
 	 * @param int $member_srl
1464 1467
 	 * @param string $signature
1465 1468
 	 *
1466
-	 * @return void
1469
+	 * @return boolean|null
1467 1470
 	 */
1468 1471
 	function putSignature($member_srl, $signature)
1469 1472
 	{
@@ -1865,6 +1868,8 @@  discard block
 block discarded – undo
1865 1868
 	/**
1866 1869
 	 * Logged method for providing a personalized menu
1867 1870
 	 * Login information is used in the output widget, or personalized page
1871
+	 * @param string $act
1872
+	 * @param string $str
1868 1873
 	 */
1869 1874
 	function addMemberMenu($act, $str)
1870 1875
 	{
@@ -1895,6 +1900,7 @@  discard block
 block discarded – undo
1895 1900
 
1896 1901
 	/**
1897 1902
 	 * Add users to the member table
1903
+	 * @param stdClass $args
1898 1904
 	 */
1899 1905
 	function insertMember(&$args, $password_is_hashed = false)
1900 1906
 	{
@@ -2086,6 +2092,7 @@  discard block
 block discarded – undo
2086 2092
 	 * Modify member information
2087 2093
 	 *
2088 2094
 	 * @param bool $is_admin , modified 2013-11-22
2095
+	 * @param stdClass $args
2089 2096
 	 */
2090 2097
 	function updateMember($args, $is_admin = FALSE)
2091 2098
 	{
@@ -2272,6 +2279,7 @@  discard block
 block discarded – undo
2272 2279
 
2273 2280
 	/**
2274 2281
 	 * Modify member password
2282
+	 * @param stdClass $args
2275 2283
 	 */
2276 2284
 	function updateMemberPassword($args)
2277 2285
 	{
@@ -2555,7 +2563,7 @@  discard block
 block discarded – undo
2555 2563
 	 *
2556 2564
 	 * @param array &$menu_list
2557 2565
 	 *
2558
-	 * @return object
2566
+	 * @return Object
2559 2567
 	**/
2560 2568
 	function triggerGetDocumentMenu(&$menu_list)
2561 2569
 	{
@@ -2585,7 +2593,7 @@  discard block
 block discarded – undo
2585 2593
 	 *
2586 2594
 	 * @param array &$menu_list
2587 2595
 	 *
2588
-	 * @return object
2596
+	 * @return Object
2589 2597
 	**/
2590 2598
 	function triggerGetCommentMenu(&$menu_list)
2591 2599
 	{
@@ -2613,7 +2621,7 @@  discard block
 block discarded – undo
2613 2621
 	/**
2614 2622
 	 * Spammer manage. Denied user login. And delete or trash all documents. Response Ajax string
2615 2623
 	 *
2616
-	 * @return object
2624
+	 * @return Object
2617 2625
 	**/
2618 2626
 	function procMemberSpammerManage()
2619 2627
 	{
Please login to merge, or discard this patch.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -2556,7 +2556,7 @@  discard block
 block discarded – undo
2556 2556
 	 * @param array &$menu_list
2557 2557
 	 *
2558 2558
 	 * @return object
2559
-	**/
2559
+	 **/
2560 2560
 	function triggerGetDocumentMenu(&$menu_list)
2561 2561
 	{
2562 2562
 		if(!Context::get('is_logged')) return new Object();
@@ -2586,7 +2586,7 @@  discard block
 block discarded – undo
2586 2586
 	 * @param array &$menu_list
2587 2587
 	 *
2588 2588
 	 * @return object
2589
-	**/
2589
+	 **/
2590 2590
 	function triggerGetCommentMenu(&$menu_list)
2591 2591
 	{
2592 2592
 		if(!Context::get('is_logged')) return new Object();
@@ -2614,7 +2614,7 @@  discard block
 block discarded – undo
2614 2614
 	 * Spammer manage. Denied user login. And delete or trash all documents. Response Ajax string
2615 2615
 	 *
2616 2616
 	 * @return object
2617
-	**/
2617
+	 **/
2618 2618
 	function procMemberSpammerManage()
2619 2619
 	{
2620 2620
 		if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
@@ -2680,7 +2680,7 @@  discard block
 block discarded – undo
2680 2680
 	 * @param int $member_srl
2681 2681
 	 *
2682 2682
 	 * @return object
2683
-	**/
2683
+	 **/
2684 2684
 	private function _spammerMember($member_srl) {
2685 2685
 		$logged_info = Context::get('logged_info');
2686 2686
 		$spam_description = trim( Context::get('spam_description') );
@@ -2721,7 +2721,7 @@  discard block
 block discarded – undo
2721 2721
 	 * @param bool $isMoveToTrash
2722 2722
 	 *
2723 2723
 	 * @return object
2724
-	**/
2724
+	 **/
2725 2725
 	private function _spammerDocuments($member_srl, $isMoveToTrash) {
2726 2726
 		$oDocumentController = getController('document');
2727 2727
 		$oDocumentModel = getModel('document');
Please login to merge, or discard this patch.
Spacing   +441 added lines, -441 removed lines patch added patch discarded remove patch
@@ -34,25 +34,25 @@  discard block
 block discarded – undo
34 34
 	 */
35 35
 	function procMemberLogin($user_id = null, $password = null, $keep_signed = null)
36 36
 	{
37
-		if(!$user_id && !$password && Context::getRequestMethod() == 'GET')
37
+		if (!$user_id && !$password && Context::getRequestMethod() == 'GET')
38 38
 		{
39 39
 			$this->setRedirectUrl(getNotEncodedUrl(''));
40 40
 			return new Object(-1, 'null_user_id');
41 41
 		}
42 42
 
43 43
 		// Variables
44
-		if(!$user_id) $user_id = Context::get('user_id');
44
+		if (!$user_id) $user_id = Context::get('user_id');
45 45
 		$user_id = trim($user_id);
46 46
 
47
-		if(!$password) $password = Context::get('password');
47
+		if (!$password) $password = Context::get('password');
48 48
 		$password = trim($password);
49 49
 
50
-		if(!$keep_signed) $keep_signed = Context::get('keep_signed');
50
+		if (!$keep_signed) $keep_signed = Context::get('keep_signed');
51 51
 		// Return an error when id and password doesn't exist
52
-		if(!$user_id) return new Object(-1,'null_user_id');
53
-		if(!$password) return new Object(-1,'null_password');
52
+		if (!$user_id) return new Object(-1, 'null_user_id');
53
+		if (!$password) return new Object(-1, 'null_password');
54 54
 
55
-		$output = $this->doLogin($user_id, $password, $keep_signed=='Y'?true:false);
55
+		$output = $this->doLogin($user_id, $password, $keep_signed == 'Y' ? true : false);
56 56
 		if (!$output->toBool()) return $output;
57 57
 
58 58
 		$oModuleModel = getModel('module');
@@ -62,13 +62,13 @@  discard block
 block discarded – undo
62 62
 		$limit_date = $config->change_password_date;
63 63
 
64 64
 		// Check if change_password_date is set
65
-		if($limit_date > 0)
65
+		if ($limit_date > 0)
66 66
 		{
67 67
 			$oMemberModel = getModel('member');
68
-			if($this->memberInfo->change_password_date < date ('YmdHis', strtotime ('-' . $limit_date . ' day')))
68
+			if ($this->memberInfo->change_password_date < date('YmdHis', strtotime('-'.$limit_date.' day')))
69 69
 			{
70 70
 				$msg = sprintf(Context::getLang('msg_change_password_date'), $limit_date);
71
-				return $this->setRedirectUrl(getNotEncodedUrl('','vid',Context::get('vid'),'mid',Context::get('mid'),'act','dispMemberModifyPassword'), new Object(-1, $msg));
71
+				return $this->setRedirectUrl(getNotEncodedUrl('', 'vid', Context::get('vid'), 'mid', Context::get('mid'), 'act', 'dispMemberModifyPassword'), new Object(-1, $msg));
72 72
 			}
73 73
 		}
74 74
 
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 		$args->member_srl = $this->memberInfo->member_srl;
78 78
 		executeQuery('member.deleteAuthMail', $args);
79 79
 
80
-		if(!$config->after_login_url)
80
+		if (!$config->after_login_url)
81 81
 		{
82 82
 			$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', '');
83 83
 		}
@@ -98,18 +98,18 @@  discard block
 block discarded – undo
98 98
 		// Call a trigger before log-out (before)
99 99
 		$logged_info = Context::get('logged_info');
100 100
 		$trigger_output = ModuleHandler::triggerCall('member.doLogout', 'before', $logged_info);
101
-		if(!$trigger_output->toBool()) return $trigger_output;
101
+		if (!$trigger_output->toBool()) return $trigger_output;
102 102
 		// Destroy session information
103 103
 		$this->destroySessionInfo();
104 104
 		// Call a trigger after log-out (after)
105 105
 		$trigger_output = ModuleHandler::triggerCall('member.doLogout', 'after', $logged_info);
106
-		if(!$trigger_output->toBool()) return $trigger_output;
106
+		if (!$trigger_output->toBool()) return $trigger_output;
107 107
 
108 108
 		$output = new Object();
109 109
 
110 110
 		$oModuleModel = getModel('module');
111 111
 		$config = $oModuleModel->getModuleConfig('member');
112
-		if($config->after_logout_url)
112
+		if ($config->after_logout_url)
113 113
 			$output->redirect_url = $config->after_logout_url;
114 114
 
115 115
 		$this->_clearMemberCache($logged_info->member_srl);
@@ -125,12 +125,12 @@  discard block
 block discarded – undo
125 125
 	function procMemberScrapDocument()
126 126
 	{
127 127
 		// Check login information
128
-		if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
128
+		if (!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
129 129
 		$logged_info = Context::get('logged_info');
130 130
 
131
-		$document_srl = (int)Context::get('document_srl');
132
-		if(!$document_srl) $document_srl = (int)Context::get('target_srl');
133
-		if(!$document_srl) return new Object(-1,'msg_invalid_request');
131
+		$document_srl = (int) Context::get('document_srl');
132
+		if (!$document_srl) $document_srl = (int) Context::get('target_srl');
133
+		if (!$document_srl) return new Object(-1, 'msg_invalid_request');
134 134
 		// Get document
135 135
 		$oDocumentModel = getModel('document');
136 136
 		$oDocument = $oDocumentModel->getDocument($document_srl);
@@ -145,10 +145,10 @@  discard block
 block discarded – undo
145 145
 		$args->title = $oDocument->get('title');
146 146
 		// Check if already scrapped
147 147
 		$output = executeQuery('member.getScrapDocument', $args);
148
-		if($output->data->count) return new Object(-1, 'msg_alreay_scrapped');
148
+		if ($output->data->count) return new Object(-1, 'msg_alreay_scrapped');
149 149
 		// Insert
150 150
 		$output = executeQuery('member.addScrapDocument', $args);
151
-		if(!$output->toBool()) return $output;
151
+		if (!$output->toBool()) return $output;
152 152
 
153 153
 		$this->setError(-1);
154 154
 		$this->setMessage('success_registed');
@@ -162,11 +162,11 @@  discard block
 block discarded – undo
162 162
 	function procMemberDeleteScrap()
163 163
 	{
164 164
 		// Check login information
165
-		if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
165
+		if (!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
166 166
 		$logged_info = Context::get('logged_info');
167 167
 
168
-		$document_srl = (int)Context::get('document_srl');
169
-		if(!$document_srl) return new Object(-1,'msg_invalid_request');
168
+		$document_srl = (int) Context::get('document_srl');
169
+		if (!$document_srl) return new Object(-1, 'msg_invalid_request');
170 170
 		// Variables
171 171
 		$args = new stdClass;
172 172
 		$args->member_srl = $logged_info->member_srl;
@@ -192,11 +192,11 @@  discard block
 block discarded – undo
192 192
 	function procMemberDeleteSavedDocument()
193 193
 	{
194 194
 		// Check login information
195
-		if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
195
+		if (!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
196 196
 		$logged_info = Context::get('logged_info');
197 197
 
198
-		$document_srl = (int)Context::get('document_srl');
199
-		if(!$document_srl) return new Object(-1,'msg_invalid_request');
198
+		$document_srl = (int) Context::get('document_srl');
199
+		if (!$document_srl) return new Object(-1, 'msg_invalid_request');
200 200
 		// Variables
201 201
 		$oDocumentController = getController('document');
202 202
 		$oDocumentController->deleteDocument($document_srl, true);
@@ -211,37 +211,37 @@  discard block
 block discarded – undo
211 211
 	{
212 212
 		$name = Context::get('name');
213 213
 		$value = Context::get('value');
214
-		if(!$value) return;
214
+		if (!$value) return;
215 215
 
216 216
 		$oMemberModel = getModel('member');
217 217
 		// Check if logged-in
218 218
 		$logged_info = Context::get('logged_info');
219 219
 
220 220
 
221
-		switch($name)
221
+		switch ($name)
222 222
 		{
223 223
 			case 'user_id' :
224 224
 				// Check denied ID
225
-				if($oMemberModel->isDeniedID($value)) return new Object(0,'denied_user_id');
225
+				if ($oMemberModel->isDeniedID($value)) return new Object(0, 'denied_user_id');
226 226
 				// Check if duplicated
227 227
 				$member_srl = $oMemberModel->getMemberSrlByUserID($value);
228
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_user_id');
228
+				if ($member_srl && $logged_info->member_srl != $member_srl) return new Object(0, 'msg_exists_user_id');
229 229
 				break;
230 230
 			case 'nick_name' :
231 231
 				// Check denied ID
232
-				if($oMemberModel->isDeniedNickName($value))
232
+				if ($oMemberModel->isDeniedNickName($value))
233 233
 				{
234
-					return new Object(0,'denied_nick_name');
234
+					return new Object(0, 'denied_nick_name');
235 235
 				}
236 236
 				// Check if duplicated
237 237
 				$member_srl = $oMemberModel->getMemberSrlByNickName($value);
238
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_nick_name');
238
+				if ($member_srl && $logged_info->member_srl != $member_srl) return new Object(0, 'msg_exists_nick_name');
239 239
 
240 240
 				break;
241 241
 			case 'email_address' :
242 242
 				// Check if duplicated
243 243
 				$member_srl = $oMemberModel->getMemberSrlByEmailAddress($value);
244
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_email_address');
244
+				if ($member_srl && $logged_info->member_srl != $member_srl) return new Object(0, 'msg_exists_email_address');
245 245
 				break;
246 246
 		}
247 247
 	}
@@ -253,25 +253,25 @@  discard block
 block discarded – undo
253 253
 	 */
254 254
 	function procMemberInsert()
255 255
 	{
256
-		if (Context::getRequestMethod () == "GET") return new Object (-1, "msg_invalid_request");
257
-		$oMemberModel = &getModel ('member');
256
+		if (Context::getRequestMethod() == "GET") return new Object(-1, "msg_invalid_request");
257
+		$oMemberModel = &getModel('member');
258 258
 		$config = $oMemberModel->getMemberConfig();
259 259
 
260 260
 		// call a trigger (before)
261
-		$trigger_output = ModuleHandler::triggerCall ('member.procMemberInsert', 'before', $config);
262
-		if(!$trigger_output->toBool ()) return $trigger_output;
261
+		$trigger_output = ModuleHandler::triggerCall('member.procMemberInsert', 'before', $config);
262
+		if (!$trigger_output->toBool()) return $trigger_output;
263 263
 		// Check if an administrator allows a membership
264
-		if($config->enable_join != 'Y') return $this->stop ('msg_signup_disabled');
264
+		if ($config->enable_join != 'Y') return $this->stop('msg_signup_disabled');
265 265
 		// Check if the user accept the license terms (only if terms exist)
266
-		if($config->agreement && Context::get('accept_agreement')!='Y') return $this->stop('msg_accept_agreement');
266
+		if ($config->agreement && Context::get('accept_agreement') != 'Y') return $this->stop('msg_accept_agreement');
267 267
 
268 268
 		// Extract the necessary information in advance
269 269
 		$getVars = array();
270
-		if($config->signupForm)
270
+		if ($config->signupForm)
271 271
 		{
272
-			foreach($config->signupForm as $formInfo)
272
+			foreach ($config->signupForm as $formInfo)
273 273
 			{
274
-				if($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
274
+				if ($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
275 275
 				{
276 276
 					$getVars[] = $formInfo->name;
277 277
 				}
@@ -279,22 +279,22 @@  discard block
 block discarded – undo
279 279
 		}
280 280
 
281 281
 		$args = new stdClass;
282
-		foreach($getVars as $val)
282
+		foreach ($getVars as $val)
283 283
 		{
284 284
 			$args->{$val} = Context::get($val);
285
-			if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
285
+			if ($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
286 286
 		}
287 287
 		$args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
288
-		if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
288
+		if (!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
289 289
 
290 290
 		$args->find_account_answer = Context::get('find_account_answer');
291 291
 		$args->allow_mailing = Context::get('allow_mailing');
292 292
 		$args->allow_message = Context::get('allow_message');
293 293
 
294
-		if($args->password1) $args->password = $args->password1;
294
+		if ($args->password1) $args->password = $args->password1;
295 295
 
296 296
 		// check password strength
297
-		if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
297
+		if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
298 298
 		{
299 299
 			$message = Context::getLang('about_password_strength');
300 300
 			return new Object(-1, $message[$config->password_strength]);
@@ -320,58 +320,58 @@  discard block
 block discarded – undo
320 320
 		unset($all_args->secret_text);
321 321
 
322 322
 		// Set the user state as "denied" when using mail authentication
323
-		if($config->enable_confirm == 'Y') $args->denied = 'Y';
323
+		if ($config->enable_confirm == 'Y') $args->denied = 'Y';
324 324
 		// Add extra vars after excluding necessary information from all the requested arguments
325 325
 		$extra_vars = delObjectVars($all_args, $args);
326 326
 		$args->extra_vars = serialize($extra_vars);
327 327
 
328 328
 		// remove whitespace
329 329
 		$checkInfos = array('user_id', 'user_name', 'nick_name', 'email_address');
330
-		foreach($checkInfos as $val)
330
+		foreach ($checkInfos as $val)
331 331
 		{
332
-			if(isset($args->{$val}))
332
+			if (isset($args->{$val}))
333 333
 			{
334 334
 				$args->{$val} = preg_replace('/[\pZ\pC]+/u', '', $args->{$val});
335 335
 			}
336 336
 		}
337 337
 		$output = $this->insertMember($args);
338
-		if(!$output->toBool()) return $output;
338
+		if (!$output->toBool()) return $output;
339 339
 
340 340
 		// insert ProfileImage, ImageName, ImageMark
341 341
 		$profile_image = $_FILES['profile_image'];
342
-		if(is_uploaded_file($profile_image['tmp_name']))
342
+		if (is_uploaded_file($profile_image['tmp_name']))
343 343
 		{
344 344
 			$this->insertProfileImage($args->member_srl, $profile_image['tmp_name']);
345 345
 		}
346 346
 
347 347
 		$image_mark = $_FILES['image_mark'];
348
-		if(is_uploaded_file($image_mark['tmp_name']))
348
+		if (is_uploaded_file($image_mark['tmp_name']))
349 349
 		{
350 350
 			$this->insertImageMark($args->member_srl, $image_mark['tmp_name']);
351 351
 		}
352 352
 
353 353
 		$image_name = $_FILES['image_name'];
354
-		if(is_uploaded_file($image_name['tmp_name']))
354
+		if (is_uploaded_file($image_name['tmp_name']))
355 355
 		{
356 356
 			$this->insertImageName($args->member_srl, $image_name['tmp_name']);
357 357
 		}
358 358
 
359 359
 		// If a virtual site, join the site
360 360
 		$site_module_info = Context::get('site_module_info');
361
-		if($site_module_info->site_srl > 0)
361
+		if ($site_module_info->site_srl > 0)
362 362
 		{
363 363
 			$columnList = array('site_srl', 'group_srl');
364 364
 			$default_group = $oMemberModel->getDefaultGroup($site_module_info->site_srl, $columnList);
365
-			if($default_group->group_srl)
365
+			if ($default_group->group_srl)
366 366
 			{
367 367
 				$this->addMemberToGroup($args->member_srl, $default_group->group_srl, $site_module_info->site_srl);
368 368
 			}
369 369
 
370 370
 		}
371 371
 		// Log-in
372
-		if($config->enable_confirm != 'Y')
372
+		if ($config->enable_confirm != 'Y')
373 373
 		{
374
-			if($config->identifier == 'email_address')
374
+			if ($config->identifier == 'email_address')
375 375
 			{
376 376
 				$output = $this->doLogin($args->email_address);
377 377
 			}
@@ -379,8 +379,8 @@  discard block
 block discarded – undo
379 379
 			{
380 380
 				$output = $this->doLogin($args->user_id);
381 381
 			}
382
-			if(!$output->toBool()) {
383
-				if($output->error == -9)
382
+			if (!$output->toBool()) {
383
+				if ($output->error == -9)
384 384
 					$output->error = -11;
385 385
 				return $this->setRedirectUrl(getUrl('', 'act', 'dispMemberLoginForm'), $output);
386 386
 			}
@@ -388,8 +388,8 @@  discard block
 block discarded – undo
388 388
 
389 389
 		// Results
390 390
 		$this->add('member_srl', $args->member_srl);
391
-		if($config->redirect_url) $this->add('redirect_url', $config->redirect_url);
392
-		if($config->enable_confirm == 'Y')
391
+		if ($config->redirect_url) $this->add('redirect_url', $config->redirect_url);
392
+		if ($config->enable_confirm == 'Y')
393 393
 		{
394 394
 			$msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address);
395 395
 			$this->setMessage($msg);
@@ -398,19 +398,19 @@  discard block
 block discarded – undo
398 398
 		else $this->setMessage('success_registed');
399 399
 		// Call a trigger (after)
400 400
 		$trigger_output = ModuleHandler::triggerCall('member.procMemberInsert', 'after', $config);
401
-		if(!$trigger_output->toBool()) return $trigger_output;
401
+		if (!$trigger_output->toBool()) return $trigger_output;
402 402
 
403
-		if($config->redirect_url)
403
+		if ($config->redirect_url)
404 404
 		{
405 405
 			$returnUrl = $config->redirect_url;
406 406
 		}
407 407
 		else
408 408
 		{
409
-			if(Context::get('success_return_url'))
409
+			if (Context::get('success_return_url'))
410 410
 			{
411 411
 				$returnUrl = Context::get('success_return_url');
412 412
 			}
413
-			else if($_COOKIE['XE_REDIRECT_URL'])
413
+			else if ($_COOKIE['XE_REDIRECT_URL'])
414 414
 			{
415 415
 				$returnUrl = $_COOKIE['XE_REDIRECT_URL'];
416 416
 				setcookie("XE_REDIRECT_URL", '', 1);
@@ -424,26 +424,26 @@  discard block
 block discarded – undo
424 424
 
425 425
 	function procMemberModifyInfoBefore()
426 426
 	{
427
-		if($_SESSION['rechecked_password_step'] != 'INPUT_PASSWORD')
427
+		if ($_SESSION['rechecked_password_step'] != 'INPUT_PASSWORD')
428 428
 		{
429 429
 			return $this->stop('msg_invalid_request');
430 430
 		}
431 431
 
432
-		if(!Context::get('is_logged'))
432
+		if (!Context::get('is_logged'))
433 433
 		{
434 434
 			return $this->stop('msg_not_logged');
435 435
 		}
436 436
 
437 437
 		$password = Context::get('password');
438 438
 
439
-		if(!$password)
439
+		if (!$password)
440 440
 		{
441 441
 			return $this->stop('msg_invalid_request');
442 442
 		}
443 443
 
444 444
 		$oMemberModel = getModel('member');
445 445
 
446
-		if(!$this->memberInfo->password)
446
+		if (!$this->memberInfo->password)
447 447
 		{
448 448
 			// Get information of logged-in user
449 449
 			$logged_info = Context::get('logged_info');
@@ -454,14 +454,14 @@  discard block
 block discarded – undo
454 454
 			$this->memberInfo->password = $memberInfo->password;
455 455
 		}
456 456
 		// Verify the current password
457
-		if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password))
457
+		if (!$oMemberModel->isValidPassword($this->memberInfo->password, $password))
458 458
 		{
459 459
 			return new Object(-1, 'invalid_password');
460 460
 		}
461 461
 
462 462
 		$_SESSION['rechecked_password_step'] = 'VALIDATE_PASSWORD';
463 463
 
464
-		if(Context::get('success_return_url'))
464
+		if (Context::get('success_return_url'))
465 465
 		{
466 466
 			$redirectUrl = Context::get('success_return_url');
467 467
 		}
@@ -479,12 +479,12 @@  discard block
 block discarded – undo
479 479
 	 */
480 480
 	function procMemberModifyInfo()
481 481
 	{
482
-		if(!Context::get('is_logged'))
482
+		if (!Context::get('is_logged'))
483 483
 		{
484 484
 			return $this->stop('msg_not_logged');
485 485
 		}
486 486
 
487
-		if($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
487
+		if ($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
488 488
 		{
489 489
 			return $this->stop('msg_invalid_request');
490 490
 		}
@@ -492,13 +492,13 @@  discard block
 block discarded – undo
492 492
 
493 493
 		// Extract the necessary information in advance
494 494
 		$oMemberModel = getModel('member');
495
-		$config = $oMemberModel->getMemberConfig ();
496
-		$getVars = array('find_account_answer','allow_mailing','allow_message');
497
-		if($config->signupForm)
495
+		$config = $oMemberModel->getMemberConfig();
496
+		$getVars = array('find_account_answer', 'allow_mailing', 'allow_message');
497
+		if ($config->signupForm)
498 498
 		{
499
-			foreach($config->signupForm as $formInfo)
499
+			foreach ($config->signupForm as $formInfo)
500 500
 			{
501
-				if($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
501
+				if ($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
502 502
 				{
503 503
 					$getVars[] = $formInfo->name;
504 504
 				}
@@ -506,16 +506,16 @@  discard block
 block discarded – undo
506 506
 		}
507 507
 
508 508
 		$args = new stdClass;
509
-		foreach($getVars as $val)
509
+		foreach ($getVars as $val)
510 510
 		{
511 511
 			$args->{$val} = Context::get($val);
512
-			if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
512
+			if ($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
513 513
 		}
514 514
 		// Login Information
515 515
 		$logged_info = Context::get('logged_info');
516 516
 		$args->member_srl = $logged_info->member_srl;
517 517
 		$args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
518
-		if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
518
+		if (!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
519 519
 		// Remove some unnecessary variables from all the vars
520 520
 		$all_args = Context::getRequestVars();
521 521
 		unset($all_args->module);
@@ -539,9 +539,9 @@  discard block
 block discarded – undo
539 539
 
540 540
 		// remove whitespace
541 541
 		$checkInfos = array('user_id', 'user_name', 'nick_name', 'email_address');
542
-		foreach($checkInfos as $val)
542
+		foreach ($checkInfos as $val)
543 543
 		{
544
-			if(isset($args->{$val}))
544
+			if (isset($args->{$val}))
545 545
 			{
546 546
 				$args->{$val} = preg_replace('/[\pZ\pC]+/u', '', $args->{$val});
547 547
 			}
@@ -549,22 +549,22 @@  discard block
 block discarded – undo
549 549
 
550 550
 		// Execute insert or update depending on the value of member_srl
551 551
 		$output = $this->updateMember($args);
552
-		if(!$output->toBool()) return $output;
552
+		if (!$output->toBool()) return $output;
553 553
 
554 554
 		$profile_image = $_FILES['profile_image'];
555
-		if(is_uploaded_file($profile_image['tmp_name']))
555
+		if (is_uploaded_file($profile_image['tmp_name']))
556 556
 		{
557 557
 			$this->insertProfileImage($args->member_srl, $profile_image['tmp_name']);
558 558
 		}
559 559
 
560 560
 		$image_mark = $_FILES['image_mark'];
561
-		if(is_uploaded_file($image_mark['tmp_name']))
561
+		if (is_uploaded_file($image_mark['tmp_name']))
562 562
 		{
563 563
 			$this->insertImageMark($args->member_srl, $image_mark['tmp_name']);
564 564
 		}
565 565
 
566 566
 		$image_name = $_FILES['image_name'];
567
-		if(is_uploaded_file($image_name['tmp_name']))
567
+		if (is_uploaded_file($image_name['tmp_name']))
568 568
 		{
569 569
 			$this->insertImageName($args->member_srl, $image_name['tmp_name']);
570 570
 		}
@@ -579,7 +579,7 @@  discard block
 block discarded – undo
579 579
 
580 580
 		// Call a trigger after successfully log-in (after)
581 581
 		$trigger_output = ModuleHandler::triggerCall('member.procMemberModifyInfo', 'after', $this->memberInfo);
582
-		if(!$trigger_output->toBool()) return $trigger_output;
582
+		if (!$trigger_output->toBool()) return $trigger_output;
583 583
 
584 584
 		$this->setSessionInfo();
585 585
 		// Return result
@@ -600,7 +600,7 @@  discard block
 block discarded – undo
600 600
 	 */
601 601
 	function procMemberModifyPassword()
602 602
 	{
603
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
603
+		if (!Context::get('is_logged')) return $this->stop('msg_not_logged');
604 604
 		// Extract the necessary information in advance
605 605
 		$current_password = trim(Context::get('current_password'));
606 606
 		$password = trim(Context::get('password1'));
@@ -614,17 +614,17 @@  discard block
 block discarded – undo
614 614
 
615 615
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
616 616
 		// Verify the cuttent password
617
-		if(!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) return new Object(-1, 'invalid_password');
617
+		if (!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) return new Object(-1, 'invalid_password');
618 618
 
619 619
 		// Check if a new password is as same as the previous password
620
-		if($current_password == $password) return new Object(-1, 'invalid_new_password');
620
+		if ($current_password == $password) return new Object(-1, 'invalid_new_password');
621 621
 
622 622
 		// Execute insert or update depending on the value of member_srl
623 623
 		$args = new stdClass;
624 624
 		$args->member_srl = $member_srl;
625 625
 		$args->password = $password;
626 626
 		$output = $this->updateMemberPassword($args);
627
-		if(!$output->toBool()) return $output;
627
+		if (!$output->toBool()) return $output;
628 628
 
629 629
 		$this->add('member_srl', $args->member_srl);
630 630
 		$this->setMessage('success_updated');
@@ -640,7 +640,7 @@  discard block
 block discarded – undo
640 640
 	 */
641 641
 	function procMemberLeave()
642 642
 	{
643
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
643
+		if (!Context::get('is_logged')) return $this->stop('msg_not_logged');
644 644
 		// Extract the necessary information in advance
645 645
 		$password = trim(Context::get('password'));
646 646
 		// Get information of logged-in user
@@ -649,17 +649,17 @@  discard block
 block discarded – undo
649 649
 		// Create a member model object
650 650
 		$oMemberModel = getModel('member');
651 651
 		// Get information of member_srl
652
-		if(!$this->memberInfo->password)
652
+		if (!$this->memberInfo->password)
653 653
 		{
654 654
 			$columnList = array('member_srl', 'password');
655 655
 			$memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
656 656
 			$this->memberInfo->password = $memberInfo->password;
657 657
 		}
658 658
 		// Verify the cuttent password
659
-		if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) return new Object(-1, 'invalid_password');
659
+		if (!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) return new Object(-1, 'invalid_password');
660 660
 
661 661
 		$output = $this->deleteMember($member_srl);
662
-		if(!$output->toBool()) return $output;
662
+		if (!$output->toBool()) return $output;
663 663
 		// Destroy all session information
664 664
 		$this->destroySessionInfo();
665 665
 		// Return success message
@@ -678,17 +678,17 @@  discard block
 block discarded – undo
678 678
 	{
679 679
 		// Check if the file is successfully uploaded
680 680
 		$file = $_FILES['profile_image'];
681
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_profile_image');
681
+		if (!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_profile_image');
682 682
 		// Ignore if member_srl is invalid or doesn't exist.
683 683
 		$member_srl = Context::get('member_srl');
684
-		if(!$member_srl) return $this->stop('msg_not_uploaded_profile_image');
684
+		if (!$member_srl) return $this->stop('msg_not_uploaded_profile_image');
685 685
 
686 686
 		$logged_info = Context::get('logged_info');
687
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_profile_image');
687
+		if ($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_profile_image');
688 688
 		// Return if member module is set not to use an image name or the user is not an administrator ;
689 689
 		$oModuleModel = getModel('module');
690 690
 		$config = $oModuleModel->getModuleConfig('member');
691
-		if($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') return $this->stop('msg_not_uploaded_profile_image');
691
+		if ($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') return $this->stop('msg_not_uploaded_profile_image');
692 692
 
693 693
 		$this->insertProfileImage($member_srl, $file['tmp_name']);
694 694
 		// Page refresh
@@ -710,25 +710,25 @@  discard block
 block discarded – undo
710 710
 	{
711 711
 
712 712
 		// Check uploaded file
713
-		if(!checkUploadedFile($target_file)) return;
713
+		if (!checkUploadedFile($target_file)) return;
714 714
 
715 715
 		$oMemberModel = getModel('member');
716 716
 		$config = $oMemberModel->getMemberConfig();
717 717
 
718 718
 		// Get an image size
719 719
 		$max_width = $config->profile_image_max_width;
720
-		if(!$max_width) $max_width = "90";
720
+		if (!$max_width) $max_width = "90";
721 721
 		$max_height = $config->profile_image_max_height;
722
-		if(!$max_height) $max_height = "90";
722
+		if (!$max_height) $max_height = "90";
723 723
 		// Get a target path to save
724 724
 		$target_path = sprintf('files/member_extra_info/profile_image/%s', getNumberingPath($member_srl));
725 725
 		FileHandler::makeDir($target_path);
726 726
 
727 727
 		// Get file information
728 728
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
729
-		if(IMAGETYPE_PNG == $type) $ext = 'png';
730
-		elseif(IMAGETYPE_JPEG == $type) $ext = 'jpg';
731
-		elseif(IMAGETYPE_GIF == $type) $ext = 'gif';
729
+		if (IMAGETYPE_PNG == $type) $ext = 'png';
730
+		elseif (IMAGETYPE_JPEG == $type) $ext = 'jpg';
731
+		elseif (IMAGETYPE_GIF == $type) $ext = 'gif';
732 732
 		else
733 733
 		{
734 734
 			return;
@@ -738,7 +738,7 @@  discard block
 block discarded – undo
738 738
 
739 739
 		$target_filename = sprintf('%s%d.%s', $target_path, $member_srl, $ext);
740 740
 		// Convert if the image size is larger than a given size or if the format is not a gif
741
-		if(($width > $max_width || $height > $max_height ) && $type != 1)
741
+		if (($width > $max_width || $height > $max_height) && $type != 1)
742 742
 		{
743 743
 			FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, $ext);
744 744
 		}
@@ -757,17 +757,17 @@  discard block
 block discarded – undo
757 757
 	{
758 758
 		// Check if the file is successfully uploaded
759 759
 		$file = $_FILES['image_name'];
760
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name');
760
+		if (!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name');
761 761
 		// Ignore if member_srl is invalid or doesn't exist.
762 762
 		$member_srl = Context::get('member_srl');
763
-		if(!$member_srl) return $this->stop('msg_not_uploaded_image_name');
763
+		if (!$member_srl) return $this->stop('msg_not_uploaded_image_name');
764 764
 
765 765
 		$logged_info = Context::get('logged_info');
766
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name');
766
+		if ($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name');
767 767
 		// Return if member module is set not to use an image name or the user is not an administrator ;
768 768
 		$oModuleModel = getModel('module');
769 769
 		$config = $oModuleModel->getModuleConfig('member');
770
-		if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name');
770
+		if ($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name');
771 771
 
772 772
 		$this->insertImageName($member_srl, $file['tmp_name']);
773 773
 		// Page refresh
@@ -788,15 +788,15 @@  discard block
 block discarded – undo
788 788
 	function insertImageName($member_srl, $target_file)
789 789
 	{
790 790
 		// Check uploaded file
791
-		if(!checkUploadedFile($target_file)) return;
791
+		if (!checkUploadedFile($target_file)) return;
792 792
 
793 793
 		$oModuleModel = getModel('module');
794 794
 		$config = $oModuleModel->getModuleConfig('member');
795 795
 		// Get an image size
796 796
 		$max_width = $config->image_name_max_width;
797
-		if(!$max_width) $max_width = "90";
797
+		if (!$max_width) $max_width = "90";
798 798
 		$max_height = $config->image_name_max_height;
799
-		if(!$max_height) $max_height = "20";
799
+		if (!$max_height) $max_height = "20";
800 800
 		// Get a target path to save
801 801
 		$target_path = sprintf('files/member_extra_info/image_name/%s/', getNumberingPath($member_srl));
802 802
 		FileHandler::makeDir($target_path);
@@ -805,7 +805,7 @@  discard block
 block discarded – undo
805 805
 		// Get file information
806 806
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
807 807
 		// Convert if the image size is larger than a given size or if the format is not a gif
808
-		if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
808
+		if ($width > $max_width || $height > $max_height || $type != 1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
809 809
 		else @copy($target_file, $target_filename);
810 810
 	}
811 811
 
@@ -817,20 +817,20 @@  discard block
 block discarded – undo
817 817
 	function procMemberDeleteProfileImage($_memberSrl = 0)
818 818
 	{
819 819
 		$member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl');
820
-		if(!$member_srl)
820
+		if (!$member_srl)
821 821
 		{
822
-			return new Object(0,'success');
822
+			return new Object(0, 'success');
823 823
 		}
824 824
 
825 825
 		$logged_info = Context::get('logged_info');
826 826
 
827
-		if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
827
+		if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
828 828
 		{
829 829
 			$oMemberModel = getModel('member');
830 830
 			$profile_image = $oMemberModel->getProfileImage($member_srl);
831 831
 			FileHandler::removeFile($profile_image->file);
832 832
 		}
833
-		return new Object(0,'success');
833
+		return new Object(0, 'success');
834 834
 	}
835 835
 
836 836
 	/**
@@ -841,20 +841,20 @@  discard block
 block discarded – undo
841 841
 	function procMemberDeleteImageName($_memberSrl = 0)
842 842
 	{
843 843
 		$member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl');
844
-		if(!$member_srl)
844
+		if (!$member_srl)
845 845
 		{
846
-			return new Object(0,'success');
846
+			return new Object(0, 'success');
847 847
 		}
848 848
 
849 849
 		$logged_info = Context::get('logged_info');
850 850
 
851
-		if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
851
+		if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
852 852
 		{
853 853
 			$oMemberModel = getModel('member');
854 854
 			$image_name = $oMemberModel->getImageName($member_srl);
855 855
 			FileHandler::removeFile($image_name->file);
856 856
 		}
857
-		return new Object(0,'success');
857
+		return new Object(0, 'success');
858 858
 	}
859 859
 
860 860
 	/**
@@ -866,17 +866,17 @@  discard block
 block discarded – undo
866 866
 	{
867 867
 		// Check if the file is successfully uploaded
868 868
 		$file = $_FILES['image_mark'];
869
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark');
869
+		if (!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark');
870 870
 		// Ignore if member_srl is invalid or doesn't exist.
871 871
 		$member_srl = Context::get('member_srl');
872
-		if(!$member_srl) return $this->stop('msg_not_uploaded_image_mark');
872
+		if (!$member_srl) return $this->stop('msg_not_uploaded_image_mark');
873 873
 
874 874
 		$logged_info = Context::get('logged_info');
875
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark');
875
+		if ($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark');
876 876
 		// Membership in the images mark the module using the ban was set by an administrator or return;
877 877
 		$oModuleModel = getModel('module');
878 878
 		$config = $oModuleModel->getModuleConfig('member');
879
-		if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark');
879
+		if ($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark');
880 880
 
881 881
 		$this->insertImageMark($member_srl, $file['tmp_name']);
882 882
 		// Page refresh
@@ -897,15 +897,15 @@  discard block
 block discarded – undo
897 897
 	function insertImageMark($member_srl, $target_file)
898 898
 	{
899 899
 		// Check uploaded file
900
-		if(!checkUploadedFile($target_file)) return;
900
+		if (!checkUploadedFile($target_file)) return;
901 901
 
902 902
 		$oModuleModel = getModel('module');
903 903
 		$config = $oModuleModel->getModuleConfig('member');
904 904
 		// Get an image size
905 905
 		$max_width = $config->image_mark_max_width;
906
-		if(!$max_width) $max_width = "20";
906
+		if (!$max_width) $max_width = "20";
907 907
 		$max_height = $config->image_mark_max_height;
908
-		if(!$max_height) $max_height = "20";
908
+		if (!$max_height) $max_height = "20";
909 909
 
910 910
 		$target_path = sprintf('files/member_extra_info/image_mark/%s/', getNumberingPath($member_srl));
911 911
 		FileHandler::makeDir($target_path);
@@ -914,7 +914,7 @@  discard block
 block discarded – undo
914 914
 		// Get file information
915 915
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
916 916
 
917
-		if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
917
+		if ($width > $max_width || $height > $max_height || $type != 1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
918 918
 		else @copy($target_file, $target_filename);
919 919
 	}
920 920
 
@@ -926,20 +926,20 @@  discard block
 block discarded – undo
926 926
 	function procMemberDeleteImageMark($_memberSrl = 0)
927 927
 	{
928 928
 		$member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl');
929
-		if(!$member_srl)
929
+		if (!$member_srl)
930 930
 		{
931
-			return new Object(0,'success');
931
+			return new Object(0, 'success');
932 932
 		}
933 933
 
934 934
 		$logged_info = Context::get('logged_info');
935 935
 
936
-		if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
936
+		if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
937 937
 		{
938 938
 			$oMemberModel = getModel('member');
939 939
 			$image_mark = $oMemberModel->getImageMark($member_srl);
940 940
 			FileHandler::removeFile($image_mark->file);
941 941
 		}
942
-		return new Object(0,'success');
942
+		return new Object(0, 'success');
943 943
 	}
944 944
 
945 945
 	/**
@@ -950,26 +950,26 @@  discard block
 block discarded – undo
950 950
 	function procMemberFindAccount()
951 951
 	{
952 952
 		$email_address = Context::get('email_address');
953
-		if(!$email_address) return new Object(-1, 'msg_invalid_request');
953
+		if (!$email_address) return new Object(-1, 'msg_invalid_request');
954 954
 
955 955
 		$oMemberModel = getModel('member');
956 956
 		$oModuleModel = getModel('module');
957 957
 
958 958
 		// Check if a member having the same email address exists
959 959
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
960
-		if(!$member_srl) return new Object(-1, 'msg_email_not_exists');
960
+		if (!$member_srl) return new Object(-1, 'msg_email_not_exists');
961 961
 
962 962
 		// Get information of the member
963 963
 		$columnList = array('denied', 'member_srl', 'user_id', 'user_name', 'email_address', 'nick_name');
964 964
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
965 965
 
966 966
 		// Check if possible to find member's ID and password
967
-		if($member_info->denied == 'Y')
967
+		if ($member_info->denied == 'Y')
968 968
 		{
969 969
 			$chk_args = new stdClass;
970 970
 			$chk_args->member_srl = $member_info->member_srl;
971 971
 			$output = executeQuery('member.chkAuthMail', $chk_args);
972
-			if($output->toBool() && $output->data->count != '0') return new Object(-1, 'msg_user_not_confirmed');
972
+			if ($output->toBool() && $output->data->count != '0') return new Object(-1, 'msg_user_not_confirmed');
973 973
 		}
974 974
 
975 975
 		// Insert data into the authentication DB
@@ -982,19 +982,19 @@  discard block
 block discarded – undo
982 982
 		$args->is_register = 'N';
983 983
 
984 984
 		$output = executeQuery('member.insertAuthMail', $args);
985
-		if(!$output->toBool()) return $output;
985
+		if (!$output->toBool()) return $output;
986 986
 		// Get content of the email to send a member
987 987
 		Context::set('auth_args', $args);
988 988
 
989 989
 		$member_config = $oModuleModel->getModuleConfig('member');
990 990
 		$memberInfo = array();
991 991
 		global $lang;
992
-		if(is_array($member_config->signupForm))
992
+		if (is_array($member_config->signupForm))
993 993
 		{
994
-			$exceptForm=array('password', 'find_account_question');
995
-			foreach($member_config->signupForm as $form)
994
+			$exceptForm = array('password', 'find_account_question');
995
+			foreach ($member_config->signupForm as $form)
996 996
 			{
997
-				if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
997
+				if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
998 998
 				{
999 999
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1000 1000
 				}
@@ -1009,15 +1009,15 @@  discard block
 block discarded – undo
1009 1009
 		}
1010 1010
 		Context::set('memberInfo', $memberInfo);
1011 1011
 
1012
-		if(!$member_config->skin) $member_config->skin = "default";
1013
-		if(!$member_config->colorset) $member_config->colorset = "white";
1012
+		if (!$member_config->skin) $member_config->skin = "default";
1013
+		if (!$member_config->colorset) $member_config->colorset = "white";
1014 1014
 
1015 1015
 		Context::set('member_config', $member_config);
1016 1016
 
1017 1017
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1018
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1018
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1019 1019
 
1020
-		$find_url = getFullUrl ('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key);
1020
+		$find_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key);
1021 1021
 		Context::set('find_url', $find_url);
1022 1022
 
1023 1023
 		$oTemplate = &TemplateHandler::getInstance();
@@ -1027,19 +1027,19 @@  discard block
 block discarded – undo
1027 1027
 		$member_config = $oModuleModel->getModuleConfig('member');
1028 1028
 		// Send a mail
1029 1029
 		$oMail = new Mail();
1030
-		$oMail->setTitle( Context::getLang('msg_find_account_title') );
1030
+		$oMail->setTitle(Context::getLang('msg_find_account_title'));
1031 1031
 		$oMail->setContent($content);
1032
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
1033
-		$oMail->setReceiptor( $member_info->user_name, $member_info->email_address );
1032
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
1033
+		$oMail->setReceiptor($member_info->user_name, $member_info->email_address);
1034 1034
 		$oMail->send();
1035 1035
 		// Return message
1036 1036
 		$msg = sprintf(Context::getLang('msg_auth_mail_sent'), $member_info->email_address);
1037
-		if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON')))
1037
+		if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON')))
1038 1038
 		{
1039 1039
 			$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberFindAccount');
1040 1040
 			$this->setRedirectUrl($returnUrl);
1041 1041
 		}
1042
-		return new Object(0,$msg);
1042
+		return new Object(0, $msg);
1043 1043
 	}
1044 1044
 
1045 1045
 	/**
@@ -1057,28 +1057,28 @@  discard block
 block discarded – undo
1057 1057
 		$find_account_question = trim(Context::get('find_account_question'));
1058 1058
 		$find_account_answer = trim(Context::get('find_account_answer'));
1059 1059
 
1060
-		if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new Object(-1, 'msg_invalid_request');
1060
+		if (($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new Object(-1, 'msg_invalid_request');
1061 1061
 
1062 1062
 		$oModuleModel = getModel('module');
1063 1063
 		// Check if a member having the same email address exists
1064 1064
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1065
-		if(!$member_srl) return new Object(-1, 'msg_email_not_exists');
1065
+		if (!$member_srl) return new Object(-1, 'msg_email_not_exists');
1066 1066
 		// Get information of the member
1067 1067
 		$columnList = array('member_srl', 'find_account_question', 'find_account_answer');
1068 1068
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
1069 1069
 
1070 1070
 		// Display a message if no answer is entered
1071
-		if(!$member_info->find_account_question || !$member_info->find_account_answer) return new Object(-1, 'msg_question_not_exists');
1071
+		if (!$member_info->find_account_question || !$member_info->find_account_answer) return new Object(-1, 'msg_question_not_exists');
1072 1072
 
1073
-		if(trim($member_info->find_account_question) != $find_account_question || trim($member_info->find_account_answer) != $find_account_answer) return new Object(-1, 'msg_answer_not_matches');
1073
+		if (trim($member_info->find_account_question) != $find_account_question || trim($member_info->find_account_answer) != $find_account_answer) return new Object(-1, 'msg_answer_not_matches');
1074 1074
 
1075
-		if($config->identifier == 'email_address')
1075
+		if ($config->identifier == 'email_address')
1076 1076
 		{
1077 1077
 			$user_id = $email_address;
1078 1078
 		}
1079 1079
 
1080 1080
 		// Update to a temporary password and set change_password_date to 1
1081
-		$oPassword =  new Password();
1081
+		$oPassword = new Password();
1082 1082
 		$temp_password = $oPassword->createTemporaryPassword(8);
1083 1083
 
1084 1084
 		$args = new stdClass();
@@ -1086,11 +1086,11 @@  discard block
 block discarded – undo
1086 1086
 		$args->password = $temp_password;
1087 1087
 		$args->change_password_date = '1';
1088 1088
 		$output = $this->updateMemberPassword($args);
1089
-		if(!$output->toBool()) return $output;
1089
+		if (!$output->toBool()) return $output;
1090 1090
 
1091
-		$_SESSION['xe_temp_password_' . $user_id] = $temp_password;
1091
+		$_SESSION['xe_temp_password_'.$user_id] = $temp_password;
1092 1092
 
1093
-		$this->add('user_id',$user_id);
1093
+		$this->add('user_id', $user_id);
1094 1094
 
1095 1095
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', '');
1096 1096
 		$this->setRedirectUrl($returnUrl.'&user_id='.$user_id);
@@ -1110,7 +1110,7 @@  discard block
 block discarded – undo
1110 1110
 		$member_srl = Context::get('member_srl');
1111 1111
 		$auth_key = Context::get('auth_key');
1112 1112
 
1113
-		if(!$member_srl || !$auth_key)
1113
+		if (!$member_srl || !$auth_key)
1114 1114
 		{
1115 1115
 			return $this->stop('msg_invalid_request');
1116 1116
 		}
@@ -1121,9 +1121,9 @@  discard block
 block discarded – undo
1121 1121
 		$args->auth_key = $auth_key;
1122 1122
 		$output = executeQuery('member.getAuthMail', $args);
1123 1123
 
1124
-		if(!$output->toBool() || $output->data->auth_key != $auth_key)
1124
+		if (!$output->toBool() || $output->data->auth_key != $auth_key)
1125 1125
 		{
1126
-			if(strlen($output->data->auth_key) !== strlen($auth_key))
1126
+			if (strlen($output->data->auth_key) !== strlen($auth_key))
1127 1127
 			{
1128 1128
 				executeQuery('member.deleteAuthMail', $args);
1129 1129
 			}
@@ -1131,7 +1131,7 @@  discard block
 block discarded – undo
1131 1131
 			return $this->stop('msg_invalid_auth_key');
1132 1132
 		}
1133 1133
 
1134
-		if(ztime($output->data->regdate) < $_SERVER['REQUEST_TIME'] + zgap() - 86400)
1134
+		if (ztime($output->data->regdate) < $_SERVER['REQUEST_TIME'] + zgap() - 86400)
1135 1135
 		{
1136 1136
 			executeQuery('member.deleteAuthMail', $args);
1137 1137
 			return $this->stop('msg_invalid_auth_key');
@@ -1140,7 +1140,7 @@  discard block
 block discarded – undo
1140 1140
 		$args->password = $output->data->new_password;
1141 1141
 
1142 1142
 		// If credentials are correct, change the password to a new one
1143
-		if($output->data->is_register == 'Y')
1143
+		if ($output->data->is_register == 'Y')
1144 1144
 		{
1145 1145
 			$args->denied = 'N';
1146 1146
 		}
@@ -1153,13 +1153,13 @@  discard block
 block discarded – undo
1153 1153
 		$is_register = $output->data->is_register;
1154 1154
 
1155 1155
 		$output = executeQuery('member.updateMemberPassword', $args);
1156
-		if(!$output->toBool())
1156
+		if (!$output->toBool())
1157 1157
 		{
1158 1158
 			return $this->stop($output->getMessage());
1159 1159
 		}
1160 1160
 
1161 1161
 		// Remove all values having the member_srl from authentication table
1162
-		executeQuery('member.deleteAuthMail',$args);
1162
+		executeQuery('member.deleteAuthMail', $args);
1163 1163
 
1164 1164
 		$this->_clearMemberCache($args->member_srl);
1165 1165
 
@@ -1178,33 +1178,33 @@  discard block
 block discarded – undo
1178 1178
 	{
1179 1179
 		// Get an email_address
1180 1180
 		$email_address = Context::get('email_address');
1181
-		if(!$email_address) return new Object(-1, 'msg_invalid_request');
1181
+		if (!$email_address) return new Object(-1, 'msg_invalid_request');
1182 1182
 		// Log test by using email_address
1183 1183
 		$oMemberModel = getModel('member');
1184 1184
 
1185 1185
 		$args = new stdClass;
1186 1186
 		$args->email_address = $email_address;
1187 1187
 		$memberSrl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1188
-		if(!$memberSrl) return new Object(-1, 'msg_not_exists_member');
1188
+		if (!$memberSrl) return new Object(-1, 'msg_not_exists_member');
1189 1189
 
1190 1190
 		$columnList = array('member_srl', 'user_id', 'user_name', 'nick_name', 'email_address');
1191 1191
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($memberSrl, 0, $columnList);
1192 1192
 
1193 1193
 		$oModuleModel = getModel('module');
1194 1194
 		$member_config = $oModuleModel->getModuleConfig('member');
1195
-		if(!$member_config->skin) $member_config->skin = "default";
1196
-		if(!$member_config->colorset) $member_config->colorset = "white";
1195
+		if (!$member_config->skin) $member_config->skin = "default";
1196
+		if (!$member_config->colorset) $member_config->colorset = "white";
1197 1197
 
1198 1198
 		// Check if a authentication mail has been sent previously
1199 1199
 		$chk_args = new stdClass;
1200 1200
 		$chk_args->member_srl = $member_info->member_srl;
1201 1201
 		$output = executeQuery('member.chkAuthMail', $chk_args);
1202
-		if($output->toBool() && $output->data->count == '0') return new Object(-1, 'msg_invalid_request');
1202
+		if ($output->toBool() && $output->data->count == '0') return new Object(-1, 'msg_invalid_request');
1203 1203
 
1204 1204
 		$auth_args = new stdClass;
1205 1205
 		$auth_args->member_srl = $member_info->member_srl;
1206 1206
 		$output = executeQueryArray('member.getAuthMailInfo', $auth_args);
1207
-		if(!$output->data || !$output->data[0]->auth_key)  return new Object(-1, 'msg_invalid_request');
1207
+		if (!$output->data || !$output->data[0]->auth_key)  return new Object(-1, 'msg_invalid_request');
1208 1208
 		$auth_info = $output->data[0];
1209 1209
 
1210 1210
 		// Update the regdate of authmail entry
@@ -1215,12 +1215,12 @@  discard block
 block discarded – undo
1215 1215
 
1216 1216
 		$memberInfo = array();
1217 1217
 		global $lang;
1218
-		if(is_array($member_config->signupForm))
1218
+		if (is_array($member_config->signupForm))
1219 1219
 		{
1220
-			$exceptForm=array('password', 'find_account_question');
1221
-			foreach($member_config->signupForm as $form)
1220
+			$exceptForm = array('password', 'find_account_question');
1221
+			foreach ($member_config->signupForm as $form)
1222 1222
 			{
1223
-				if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1223
+				if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1224 1224
 				{
1225 1225
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1226 1226
 				}
@@ -1239,19 +1239,19 @@  discard block
 block discarded – undo
1239 1239
 		Context::set('member_config', $member_config);
1240 1240
 
1241 1241
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1242
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1242
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1243 1243
 
1244
-		$auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_info->auth_key);
1244
+		$auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $auth_info->auth_key);
1245 1245
 		Context::set('auth_url', $auth_url);
1246 1246
 
1247 1247
 		$oTemplate = &TemplateHandler::getInstance();
1248 1248
 		$content = $oTemplate->compile($tpl_path, 'confirm_member_account_mail');
1249 1249
 		// Send a mail
1250 1250
 		$oMail = new Mail();
1251
-		$oMail->setTitle( Context::getLang('msg_confirm_account_title') );
1251
+		$oMail->setTitle(Context::getLang('msg_confirm_account_title'));
1252 1252
 		$oMail->setContent($content);
1253
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
1254
-		$oMail->setReceiptor( $args->user_name, $args->email_address );
1253
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
1254
+		$oMail->setReceiptor($args->user_name, $args->email_address);
1255 1255
 		$oMail->send();
1256 1256
 
1257 1257
 		$msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address);
@@ -1266,23 +1266,23 @@  discard block
 block discarded – undo
1266 1266
 		$memberInfo = $_SESSION['auth_member_info'];
1267 1267
 		unset($_SESSION['auth_member_info']);
1268 1268
 
1269
-		if(!$memberInfo)
1269
+		if (!$memberInfo)
1270 1270
 		{
1271 1271
 			return $this->stop('msg_invalid_request');
1272 1272
 		}
1273 1273
 
1274 1274
 		$newEmail = Context::get('email_address');
1275 1275
 
1276
-		if(!$newEmail)
1276
+		if (!$newEmail)
1277 1277
 		{
1278 1278
 			return $this->stop('msg_invalid_request');
1279 1279
 		}
1280 1280
 
1281 1281
 		$oMemberModel = getModel('member');
1282 1282
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail);
1283
-		if($member_srl)
1283
+		if ($member_srl)
1284 1284
 		{
1285
-			return new Object(-1,'msg_exists_email_address');
1285
+			return new Object(-1, 'msg_exists_email_address');
1286 1286
 		}
1287 1287
 
1288 1288
 		// remove all key by member_srl
@@ -1290,7 +1290,7 @@  discard block
 block discarded – undo
1290 1290
 		$args->member_srl = $memberInfo->member_srl;
1291 1291
 		$output = executeQuery('member.deleteAuthMail', $args);
1292 1292
 
1293
-		if(!$output->toBool())
1293
+		if (!$output->toBool())
1294 1294
 		{
1295 1295
 			return $output;
1296 1296
 		}
@@ -1300,7 +1300,7 @@  discard block
 block discarded – undo
1300 1300
 		list($args->email_id, $args->email_host) = explode('@', $newEmail);
1301 1301
 
1302 1302
 		$output = executeQuery('member.updateMemberEmailAddress', $args);
1303
-		if(!$output->toBool())
1303
+		if (!$output->toBool())
1304 1304
 		{
1305 1305
 			return $this->stop($output->getMessage());
1306 1306
 		}
@@ -1317,7 +1317,7 @@  discard block
 block discarded – undo
1317 1317
 		$auth_args->is_register = 'Y';
1318 1318
 
1319 1319
 		$output = executeQuery('member.insertAuthMail', $auth_args);
1320
-		if(!$output->toBool()) return $output;
1320
+		if (!$output->toBool()) return $output;
1321 1321
 
1322 1322
 		$memberInfo->email_address = $newEmail;
1323 1323
 
@@ -1341,12 +1341,12 @@  discard block
 block discarded – undo
1341 1341
 		$memberInfo = array();
1342 1342
 
1343 1343
 		global $lang;
1344
-		if(is_array($member_config->signupForm))
1344
+		if (is_array($member_config->signupForm))
1345 1345
 		{
1346
-			$exceptForm=array('password', 'find_account_question');
1347
-			foreach($member_config->signupForm as $form)
1346
+			$exceptForm = array('password', 'find_account_question');
1347
+			foreach ($member_config->signupForm as $form)
1348 1348
 			{
1349
-				if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1349
+				if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1350 1350
 				{
1351 1351
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1352 1352
 				}
@@ -1361,25 +1361,25 @@  discard block
 block discarded – undo
1361 1361
 		}
1362 1362
 		Context::set('memberInfo', $memberInfo);
1363 1363
 
1364
-		if(!$member_config->skin) $member_config->skin = "default";
1365
-		if(!$member_config->colorset) $member_config->colorset = "white";
1364
+		if (!$member_config->skin) $member_config->skin = "default";
1365
+		if (!$member_config->colorset) $member_config->colorset = "white";
1366 1366
 
1367 1367
 		Context::set('member_config', $member_config);
1368 1368
 
1369 1369
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1370
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1370
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1371 1371
 
1372
-		$auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key);
1372
+		$auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $auth_args->auth_key);
1373 1373
 		Context::set('auth_url', $auth_url);
1374 1374
 
1375 1375
 		$oTemplate = &TemplateHandler::getInstance();
1376 1376
 		$content = $oTemplate->compile($tpl_path, 'confirm_member_account_mail');
1377 1377
 		// Send a mail
1378 1378
 		$oMail = new Mail();
1379
-		$oMail->setTitle( Context::getLang('msg_confirm_account_title') );
1379
+		$oMail->setTitle(Context::getLang('msg_confirm_account_title'));
1380 1380
 		$oMail->setContent($content);
1381
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
1382
-		$oMail->setReceiptor( $member_info->user_name, $member_info->email_address );
1381
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
1382
+		$oMail->setReceiptor($member_info->user_name, $member_info->email_address);
1383 1383
 		$oMail->send();
1384 1384
 	}
1385 1385
 
@@ -1392,7 +1392,7 @@  discard block
 block discarded – undo
1392 1392
 	{
1393 1393
 		$site_module_info = Context::get('site_module_info');
1394 1394
 		$logged_info = Context::get('logged_info');
1395
-		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new Object(-1,'msg_invalid_request');
1395
+		if (!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list)) return new Object(-1, 'msg_invalid_request');
1396 1396
 
1397 1397
 		$oMemberModel = getModel('member');
1398 1398
 		$columnList = array('site_srl', 'group_srl', 'title');
@@ -1411,13 +1411,13 @@  discard block
 block discarded – undo
1411 1411
 	{
1412 1412
 		$site_module_info = Context::get('site_module_info');
1413 1413
 		$logged_info = Context::get('logged_info');
1414
-		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new Object(-1,'msg_invalid_request');
1414
+		if (!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list)) return new Object(-1, 'msg_invalid_request');
1415 1415
 
1416 1416
 		$args = new stdClass;
1417
-		$args->site_srl= $site_module_info->site_srl;
1417
+		$args->site_srl = $site_module_info->site_srl;
1418 1418
 		$args->member_srl = $logged_info->member_srl;
1419 1419
 		$output = executeQuery('member.deleteMembersGroup', $args);
1420
-		if(!$output->toBool()) return $output;
1420
+		if (!$output->toBool()) return $output;
1421 1421
 		$this->setMessage('success_deleted');
1422 1422
 		$this->_clearMemberCache($args->member_srl, $site_module_info->site_srl);
1423 1423
 	}
@@ -1431,25 +1431,25 @@  discard block
 block discarded – undo
1431 1431
 	 */
1432 1432
 	function setMemberConfig($args)
1433 1433
 	{
1434
-		if(!$args->skin) $args->skin = "default";
1435
-		if(!$args->colorset) $args->colorset = "white";
1436
-		if(!$args->editor_skin) $args->editor_skin= "ckeditor";
1437
-		if(!$args->editor_colorset) $args->editor_colorset = "moono";
1438
-		if($args->enable_join!='Y') $args->enable_join = 'N';
1439
-		$args->enable_openid= 'N';
1440
-		if($args->profile_image !='Y') $args->profile_image = 'N';
1441
-		if($args->image_name!='Y') $args->image_name = 'N';
1442
-		if($args->image_mark!='Y') $args->image_mark = 'N';
1443
-		if($args->group_image_mark!='Y') $args->group_image_mark = 'N';
1444
-		if(!trim(strip_tags($args->agreement))) $args->agreement = null;
1445
-		$args->limit_day = (int)$args->limit_day;
1434
+		if (!$args->skin) $args->skin = "default";
1435
+		if (!$args->colorset) $args->colorset = "white";
1436
+		if (!$args->editor_skin) $args->editor_skin = "ckeditor";
1437
+		if (!$args->editor_colorset) $args->editor_colorset = "moono";
1438
+		if ($args->enable_join != 'Y') $args->enable_join = 'N';
1439
+		$args->enable_openid = 'N';
1440
+		if ($args->profile_image != 'Y') $args->profile_image = 'N';
1441
+		if ($args->image_name != 'Y') $args->image_name = 'N';
1442
+		if ($args->image_mark != 'Y') $args->image_mark = 'N';
1443
+		if ($args->group_image_mark != 'Y') $args->group_image_mark = 'N';
1444
+		if (!trim(strip_tags($args->agreement))) $args->agreement = null;
1445
+		$args->limit_day = (int) $args->limit_day;
1446 1446
 
1447 1447
 		$agreement = trim($args->agreement);
1448 1448
 		unset($args->agreement);
1449 1449
 
1450 1450
 		$oModuleController = getController('module');
1451
-		$output = $oModuleController->insertModuleConfig('member',$args);
1452
-		if(!$output->toBool()) return $output;
1451
+		$output = $oModuleController->insertModuleConfig('member', $args);
1452
+		if (!$output->toBool()) return $output;
1453 1453
 
1454 1454
 		$agreement_file = _XE_PATH_.'files/member_extra_info/agreement.txt';
1455 1455
 		FileHandler::writeFile($agreement_file, $agreement);
@@ -1470,11 +1470,11 @@  discard block
 block discarded – undo
1470 1470
 		$signature = trim(removeHackTag($signature));
1471 1471
 		$signature = preg_replace('/<(\/?)(embed|object|param)/is', '&lt;$1$2', $signature);
1472 1472
 
1473
-		$check_signature = trim(str_replace(array('&nbsp;',"\n","\r"), '', strip_tags($signature, '<img><object>')));
1473
+		$check_signature = trim(str_replace(array('&nbsp;', "\n", "\r"), '', strip_tags($signature, '<img><object>')));
1474 1474
 		$path = sprintf('files/member_extra_info/signature/%s/', getNumberingPath($member_srl));
1475 1475
 		$filename = sprintf('%s%d.signature.php', $path, $member_srl);
1476 1476
 
1477
-		if(!$check_signature) return FileHandler::removeFile($filename);
1477
+		if (!$check_signature) return FileHandler::removeFile($filename);
1478 1478
 
1479 1479
 		$buff = sprintf('<?php if(!defined("__XE__")) exit();?>%s', $signature);
1480 1480
 		FileHandler::makeDir($path);
@@ -1503,15 +1503,15 @@  discard block
 block discarded – undo
1503 1503
 	 *
1504 1504
 	 * @return Object
1505 1505
 	 */
1506
-	function addMemberToGroup($member_srl, $group_srl, $site_srl=0)
1506
+	function addMemberToGroup($member_srl, $group_srl, $site_srl = 0)
1507 1507
 	{
1508 1508
 		$args = new stdClass();
1509 1509
 		$args->member_srl = $member_srl;
1510 1510
 		$args->group_srl = $group_srl;
1511
-		if($site_srl) $args->site_srl = $site_srl;
1511
+		if ($site_srl) $args->site_srl = $site_srl;
1512 1512
 
1513 1513
 		// Add
1514
-		$output = executeQuery('member.addMemberToGroup',$args);
1514
+		$output = executeQuery('member.addMemberToGroup', $args);
1515 1515
 		$output2 = ModuleHandler::triggerCall('member.addMemberToGroup', 'after', $args);
1516 1516
 
1517 1517
 		$this->_clearMemberCache($member_srl, $site_srl);
@@ -1531,18 +1531,18 @@  discard block
 block discarded – undo
1531 1531
 	{
1532 1532
 		$obj = new stdClass;
1533 1533
 		$obj->site_srl = $args->site_srl;
1534
-		$obj->member_srl = implode(',',$args->member_srl);
1534
+		$obj->member_srl = implode(',', $args->member_srl);
1535 1535
 
1536 1536
 		$output = executeQueryArray('member.getMembersGroup', $obj);
1537
-		if($output->data) foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate;
1537
+		if ($output->data) foreach ($output->data as $key => $val) $date[$val->member_srl] = $val->regdate;
1538 1538
 
1539 1539
 		$output = executeQuery('member.deleteMembersGroup', $obj);
1540
-		if(!$output->toBool()) return $output;
1540
+		if (!$output->toBool()) return $output;
1541 1541
 
1542 1542
 		$inserted_members = array();
1543
-		foreach($args->member_srl as $key => $val)
1543
+		foreach ($args->member_srl as $key => $val)
1544 1544
 		{
1545
-			if($inserted_members[$val]) continue;
1545
+			if ($inserted_members[$val]) continue;
1546 1546
 			$inserted_members[$val] = true;
1547 1547
 
1548 1548
 			unset($obj);
@@ -1552,7 +1552,7 @@  discard block
 block discarded – undo
1552 1552
 			$obj->site_srl = $args->site_srl;
1553 1553
 			$obj->regdate = $date[$obj->member_srl];
1554 1554
 			$output = executeQuery('member.addMemberToGroup', $obj);
1555
-			if(!$output->toBool()) return $output;
1555
+			if (!$output->toBool()) return $output;
1556 1556
 
1557 1557
 			$this->_clearMemberCache($obj->member_srl, $args->site_srl);
1558 1558
 		}
@@ -1574,9 +1574,9 @@  discard block
 block discarded – undo
1574 1574
 		// Get information of the key
1575 1575
 		$output = executeQuery('member.getAutologin', $args);
1576 1576
 		// If no information exists, delete a cookie
1577
-		if(!$output->toBool() || !$output->data)
1577
+		if (!$output->toBool() || !$output->data)
1578 1578
 		{
1579
-			setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365, '/');
1579
+			setCookie('xeak', null, $_SERVER['REQUEST_TIME'] + 60 * 60 * 24 * 365, '/');
1580 1580
 			return;
1581 1581
 		}
1582 1582
 
@@ -1586,9 +1586,9 @@  discard block
 block discarded – undo
1586 1586
 		$user_id = ($config->identifier == 'user_id') ? $output->data->user_id : $output->data->email_address;
1587 1587
 		$password = $output->data->password;
1588 1588
 
1589
-		if(!$user_id || !$password)
1589
+		if (!$user_id || !$password)
1590 1590
 		{
1591
-			setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365, '/');
1591
+			setCookie('xeak', null, $_SERVER['REQUEST_TIME'] + 60 * 60 * 24 * 365, '/');
1592 1592
 			return;
1593 1593
 		}
1594 1594
 
@@ -1598,7 +1598,7 @@  discard block
 block discarded – undo
1598 1598
 		$check_key = strtolower($user_id).$password.$_SERVER['HTTP_USER_AGENT'];
1599 1599
 		$check_key = substr(hash_hmac('sha256', $check_key, substr($args->autologin_key, 0, 32)), 0, 32);
1600 1600
 
1601
-		if($check_key === substr($args->autologin_key, 32))
1601
+		if ($check_key === substr($args->autologin_key, 32))
1602 1602
 		{
1603 1603
 			// Check change_password_date
1604 1604
 			$oModuleModel = getModel('module');
@@ -1606,12 +1606,12 @@  discard block
 block discarded – undo
1606 1606
 			$limit_date = $member_config->change_password_date;
1607 1607
 
1608 1608
 			// Check if change_password_date is set
1609
-			if($limit_date > 0)
1609
+			if ($limit_date > 0)
1610 1610
 			{
1611 1611
 				$oMemberModel = getModel('member');
1612 1612
 				$columnList = array('member_srl', 'change_password_date');
1613 1613
 
1614
-				if($config->identifier == 'user_id')
1614
+				if ($config->identifier == 'user_id')
1615 1615
 				{
1616 1616
 					$member_info = $oMemberModel->getMemberInfoByUserID($user_id, $columnList);
1617 1617
 				}
@@ -1620,7 +1620,7 @@  discard block
 block discarded – undo
1620 1620
 					$member_info = $oMemberModel->getMemberInfoByEmailAddress($user_id, $columnList);
1621 1621
 				}
1622 1622
 
1623
-				if($member_info->change_password_date >= date('YmdHis', strtotime('-'.$limit_date.' day')) ){
1623
+				if ($member_info->change_password_date >= date('YmdHis', strtotime('-'.$limit_date.' day'))) {
1624 1624
 					$do_auto_login = true;
1625 1625
 				}
1626 1626
 
@@ -1631,14 +1631,14 @@  discard block
 block discarded – undo
1631 1631
 			}
1632 1632
 		}
1633 1633
 
1634
-		if($do_auto_login)
1634
+		if ($do_auto_login)
1635 1635
 		{
1636 1636
 			$output = $this->doLogin($user_id);
1637 1637
 		}
1638 1638
 		else
1639 1639
 		{
1640 1640
 			executeQuery('member.deleteAutologin', $args);
1641
-			setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365, '/');
1641
+			setCookie('xeak', null, $_SERVER['REQUEST_TIME'] + 60 * 60 * 24 * 365, '/');
1642 1642
 		}
1643 1643
 	}
1644 1644
 
@@ -1654,13 +1654,13 @@  discard block
 block discarded – undo
1654 1654
 	function doLogin($user_id, $password = '', $keep_signed = false)
1655 1655
 	{
1656 1656
 		$user_id = strtolower($user_id);
1657
-		if(!$user_id) return new Object(-1, 'null_user_id');
1657
+		if (!$user_id) return new Object(-1, 'null_user_id');
1658 1658
 		// Call a trigger before log-in (before)
1659 1659
 		$trigger_obj = new stdClass();
1660 1660
 		$trigger_obj->user_id = $user_id;
1661 1661
 		$trigger_obj->password = $password;
1662 1662
 		$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'before', $trigger_obj);
1663
-		if(!$trigger_output->toBool()) return $trigger_output;
1663
+		if (!$trigger_output->toBool()) return $trigger_output;
1664 1664
 		// Create a member model object
1665 1665
 		$oMemberModel = getModel('member');
1666 1666
 
@@ -1670,12 +1670,12 @@  discard block
 block discarded – undo
1670 1670
 		$args->ipaddress = $_SERVER['REMOTE_ADDR'];
1671 1671
 
1672 1672
 		// check identifier
1673
-		if($config->identifier == 'email_address')
1673
+		if ($config->identifier == 'email_address')
1674 1674
 		{
1675 1675
 			// Get user_id information
1676 1676
 			$this->memberInfo = $oMemberModel->getMemberInfoByEmailAddress($user_id);
1677 1677
 			// Set an invalid user if no value returned
1678
-			if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address');
1678
+			if (!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address');
1679 1679
 
1680 1680
 		}
1681 1681
 		else
@@ -1683,24 +1683,24 @@  discard block
 block discarded – undo
1683 1683
 			// Get user_id information
1684 1684
 			$this->memberInfo = $oMemberModel->getMemberInfoByUserID($user_id);
1685 1685
 			// Set an invalid user if no value returned
1686
-			if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id');
1686
+			if (!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id');
1687 1687
 		}
1688 1688
 
1689 1689
 		$output = executeQuery('member.getLoginCountByIp', $args);
1690 1690
 		$errorCount = $output->data->count;
1691
-		if($errorCount >= $config->max_error_count)
1691
+		if ($errorCount >= $config->max_error_count)
1692 1692
 		{
1693 1693
 			$last_update = strtotime($output->data->last_update);
1694
-			$term = intval($_SERVER['REQUEST_TIME']-$last_update);
1695
-			if($term < $config->max_error_count_time)
1694
+			$term = intval($_SERVER['REQUEST_TIME'] - $last_update);
1695
+			if ($term < $config->max_error_count_time)
1696 1696
 			{
1697 1697
 				$term = $config->max_error_count_time - $term;
1698
-				if($term < 60) $term = intval($term).Context::getLang('unit_sec');
1699
-				elseif(60 <= $term && $term < 3600) $term = intval($term/60).Context::getLang('unit_min');
1700
-				elseif(3600 <= $term && $term < 86400) $term = intval($term/3600).Context::getLang('unit_hour');
1701
-				else $term = intval($term/86400).Context::getLang('unit_day');
1698
+				if ($term < 60) $term = intval($term).Context::getLang('unit_sec');
1699
+				elseif (60 <= $term && $term < 3600) $term = intval($term / 60).Context::getLang('unit_min');
1700
+				elseif (3600 <= $term && $term < 86400) $term = intval($term / 3600).Context::getLang('unit_hour');
1701
+				else $term = intval($term / 86400).Context::getLang('unit_day');
1702 1702
 
1703
-				return new Object(-1, sprintf(Context::getLang('excess_ip_access_count'),$term));
1703
+				return new Object(-1, sprintf(Context::getLang('excess_ip_access_count'), $term));
1704 1704
 			}
1705 1705
 			else
1706 1706
 			{
@@ -1710,13 +1710,13 @@  discard block
 block discarded – undo
1710 1710
 		}
1711 1711
 
1712 1712
 		// Password Check
1713
-		if($password && !$oMemberModel->isValidPassword($this->memberInfo->password, $password, $this->memberInfo->member_srl))
1713
+		if ($password && !$oMemberModel->isValidPassword($this->memberInfo->password, $password, $this->memberInfo->member_srl))
1714 1714
 		{
1715
-			return $this->recordMemberLoginError(-1, 'invalid_password',$this->memberInfo);
1715
+			return $this->recordMemberLoginError(-1, 'invalid_password', $this->memberInfo);
1716 1716
 		}
1717 1717
 
1718 1718
 		// If denied == 'Y', notify
1719
-		if($this->memberInfo->denied == 'Y')
1719
+		if ($this->memberInfo->denied == 'Y')
1720 1720
 		{
1721 1721
 			$args->member_srl = $this->memberInfo->member_srl;
1722 1722
 			$output = executeQuery('member.chkAuthMail', $args);
@@ -1724,12 +1724,12 @@  discard block
 block discarded – undo
1724 1724
 			{
1725 1725
 				$_SESSION['auth_member_srl'] = $this->memberInfo->member_srl;
1726 1726
 				$redirectUrl = getUrl('', 'act', 'dispMemberResendAuthMail');
1727
-				return $this->setRedirectUrl($redirectUrl, new Object(-1,'msg_user_not_confirmed'));
1727
+				return $this->setRedirectUrl($redirectUrl, new Object(-1, 'msg_user_not_confirmed'));
1728 1728
 			}
1729
-			return new Object(-1,'msg_user_denied');
1729
+			return new Object(-1, 'msg_user_denied');
1730 1730
 		}
1731 1731
 		// Notify if denied_date is less than the current time
1732
-		if($this->memberInfo->limit_date && substr($this->memberInfo->limit_date,0,8) >= date("Ymd")) return new Object(-9,sprintf(Context::getLang('msg_user_limited'),zdate($this->memberInfo->limit_date,"Y-m-d")));
1732
+		if ($this->memberInfo->limit_date && substr($this->memberInfo->limit_date, 0, 8) >= date("Ymd")) return new Object(-9, sprintf(Context::getLang('msg_user_limited'), zdate($this->memberInfo->limit_date, "Y-m-d")));
1733 1733
 		// Update the latest login time
1734 1734
 		$args->member_srl = $this->memberInfo->member_srl;
1735 1735
 		$output = executeQuery('member.updateLastLogin', $args);
@@ -1739,36 +1739,36 @@  discard block
 block discarded – undo
1739 1739
 
1740 1740
 		// Check if there is recoding table.
1741 1741
 		$oDB = &DB::getInstance();
1742
-		if($oDB->isTableExists('member_count_history') && $config->enable_login_fail_report != 'N')
1742
+		if ($oDB->isTableExists('member_count_history') && $config->enable_login_fail_report != 'N')
1743 1743
 		{
1744 1744
 			// check if there is login fail records.
1745 1745
 			$output = executeQuery('member.getLoginCountHistoryByMemberSrl', $args);
1746
-			if($output->data && $output->data->content)
1746
+			if ($output->data && $output->data->content)
1747 1747
 			{
1748 1748
 				$title = Context::getLang('login_fail_report');
1749 1749
 				$message = '<ul>';
1750 1750
 				$content = unserialize($output->data->content);
1751
-				if(count($content) > $config->max_error_count)
1751
+				if (count($content) > $config->max_error_count)
1752 1752
 				{
1753
-					foreach($content as $val)
1753
+					foreach ($content as $val)
1754 1754
 					{
1755
-						$message .= '<li>'.Context::getLang('regdate').': '.date('Y-m-d h:i:sa',$val[2]).'<ul><li>'.Context::getLang('ipaddress').': '.$val[0].'</li><li>'.Context::getLang('message').': '.$val[1].'</li></ul></li>';
1755
+						$message .= '<li>'.Context::getLang('regdate').': '.date('Y-m-d h:i:sa', $val[2]).'<ul><li>'.Context::getLang('ipaddress').': '.$val[0].'</li><li>'.Context::getLang('message').': '.$val[1].'</li></ul></li>';
1756 1756
 					}
1757 1757
 					$message .= '</ul>';
1758
-					$content = sprintf(Context::getLang('login_fail_report_contents'),$message,date('Y-m-d h:i:sa'));
1758
+					$content = sprintf(Context::getLang('login_fail_report_contents'), $message, date('Y-m-d h:i:sa'));
1759 1759
 
1760 1760
 					//send message
1761 1761
 					$oCommunicationController = getController('communication');
1762 1762
 					$oCommunicationController->sendMessage($args->member_srl, $args->member_srl, $title, $content, true);
1763 1763
 
1764
-					if($this->memberInfo->email_address && $this->memberInfo->allow_mailing == 'Y')
1764
+					if ($this->memberInfo->email_address && $this->memberInfo->allow_mailing == 'Y')
1765 1765
 					{
1766 1766
 						$view_url = Context::getRequestUri();
1767
-						$content = sprintf("%s<hr /><p>From: <a href=\"%s\" target=\"_blank\">%s</a><br />To: %s(%s)</p>",$content, $view_url, $view_url, $this->memberInfo->nick_name, $this->memberInfo->email_id);
1767
+						$content = sprintf("%s<hr /><p>From: <a href=\"%s\" target=\"_blank\">%s</a><br />To: %s(%s)</p>", $content, $view_url, $view_url, $this->memberInfo->nick_name, $this->memberInfo->email_id);
1768 1768
 						$oMail = new Mail();
1769 1769
 						$oMail->setTitle($title);
1770 1770
 						$oMail->setContent($content);
1771
-						$oMail->setSender($config->webmaster_name?$config->webmaster_name:'webmaster', $config->webmaster_email);
1771
+						$oMail->setSender($config->webmaster_name ? $config->webmaster_name : 'webmaster', $config->webmaster_email);
1772 1772
 						$oMail->setReceiptor($this->memberInfo->email_id.'('.$this->memberInfo->nick_name.')', $this->memberInfo->email_address);
1773 1773
 						$oMail->send();
1774 1774
 					}
@@ -1778,9 +1778,9 @@  discard block
 block discarded – undo
1778 1778
 		}
1779 1779
 		// Call a trigger after successfully log-in (after)
1780 1780
 		$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'after', $this->memberInfo);
1781
-		if(!$trigger_output->toBool()) return $trigger_output;
1781
+		if (!$trigger_output->toBool()) return $trigger_output;
1782 1782
 		// When user checked to use auto-login
1783
-		if($keep_signed)
1783
+		if ($keep_signed)
1784 1784
 		{
1785 1785
 			// Key generate for auto login
1786 1786
 			$oPassword = new Password();
@@ -1792,12 +1792,12 @@  discard block
 block discarded – undo
1792 1792
 			$autologin_args->member_srl = $this->memberInfo->member_srl;
1793 1793
 			executeQuery('member.deleteAutologin', $autologin_args);
1794 1794
 			$autologin_output = executeQuery('member.insertAutologin', $autologin_args);
1795
-			if($autologin_output->toBool()) setCookie('xeak',$autologin_args->autologin_key, $_SERVER['REQUEST_TIME']+31536000, '/');
1795
+			if ($autologin_output->toBool()) setCookie('xeak', $autologin_args->autologin_key, $_SERVER['REQUEST_TIME'] + 31536000, '/');
1796 1796
 		}
1797
-		if($this->memberInfo->is_admin == 'Y')
1797
+		if ($this->memberInfo->is_admin == 'Y')
1798 1798
 		{
1799 1799
 			$oMemberAdminModel = getAdminModel('member');
1800
-			if(!$oMemberAdminModel->getMemberAdminIPCheck())
1800
+			if (!$oMemberAdminModel->getMemberAdminIPCheck())
1801 1801
 			{
1802 1802
 				$_SESSION['denied_admin'] = 'Y';
1803 1803
 			}
@@ -1815,18 +1815,18 @@  discard block
 block discarded – undo
1815 1815
 	{
1816 1816
 		$oMemberModel = getModel('member');
1817 1817
 		// If your information came through the current session information to extract information from the users
1818
-		if(!$this->memberInfo && $_SESSION['member_srl'] && $oMemberModel->isLogged() )
1818
+		if (!$this->memberInfo && $_SESSION['member_srl'] && $oMemberModel->isLogged())
1819 1819
 		{
1820 1820
 			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($_SESSION['member_srl']);
1821 1821
 			// If you do not destroy the session Profile
1822
-			if($this->memberInfo->member_srl != $_SESSION['member_srl'])
1822
+			if ($this->memberInfo->member_srl != $_SESSION['member_srl'])
1823 1823
 			{
1824 1824
 				$this->destroySessionInfo();
1825 1825
 				return;
1826 1826
 			}
1827 1827
 		}
1828 1828
 		// Stop using the session id is destroyed
1829
-		if($this->memberInfo->denied=='Y')
1829
+		if ($this->memberInfo->denied == 'Y')
1830 1830
 		{
1831 1831
 			$this->destroySessionInfo();
1832 1832
 			return;
@@ -1856,10 +1856,10 @@  discard block
 block discarded – undo
1856 1856
 		Context::set('logged_info', $this->memberInfo);
1857 1857
 
1858 1858
 		// Only the menu configuration of the user (such as an add-on to the menu can be changed)
1859
-		$this->addMemberMenu( 'dispMemberInfo', 'cmd_view_member_info');
1860
-		$this->addMemberMenu( 'dispMemberScrappedDocument', 'cmd_view_scrapped_document');
1861
-		$this->addMemberMenu( 'dispMemberSavedDocument', 'cmd_view_saved_document');
1862
-		$this->addMemberMenu( 'dispMemberOwnDocument', 'cmd_view_own_document');
1859
+		$this->addMemberMenu('dispMemberInfo', 'cmd_view_member_info');
1860
+		$this->addMemberMenu('dispMemberScrappedDocument', 'cmd_view_scrapped_document');
1861
+		$this->addMemberMenu('dispMemberSavedDocument', 'cmd_view_saved_document');
1862
+		$this->addMemberMenu('dispMemberOwnDocument', 'cmd_view_own_document');
1863 1863
 	}
1864 1864
 
1865 1865
 	/**
@@ -1881,7 +1881,7 @@  discard block
 block discarded – undo
1881 1881
 	function addMemberPopupMenu($url, $str, $icon = '', $target = 'self')
1882 1882
 	{
1883 1883
 		$member_popup_menu_list = Context::get('member_popup_menu_list');
1884
-		if(!is_array($member_popup_menu_list)) $member_popup_menu_list = array();
1884
+		if (!is_array($member_popup_menu_list)) $member_popup_menu_list = array();
1885 1885
 
1886 1886
 		$obj = new stdClass;
1887 1887
 		$obj->url = $url;
@@ -1900,33 +1900,33 @@  discard block
 block discarded – undo
1900 1900
 	{
1901 1901
 		// Call a trigger (before)
1902 1902
 		$output = ModuleHandler::triggerCall('member.insertMember', 'before', $args);
1903
-		if(!$output->toBool()) return $output;
1903
+		if (!$output->toBool()) return $output;
1904 1904
 		// Terms and Conditions portion of the information set up by members reaffirmed
1905 1905
 		$oModuleModel = getModel('module');
1906 1906
 		$config = $oModuleModel->getModuleConfig('member');
1907 1907
 
1908 1908
 		$logged_info = Context::get('logged_info');
1909 1909
 		// If the date of the temporary restrictions limit further information on the date of
1910
-		if($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24);
1910
+		if ($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME'] + $config->limit_day * 60 * 60 * 24);
1911 1911
 
1912 1912
 		$args->member_srl = getNextSequence();
1913 1913
 		$args->list_order = -1 * $args->member_srl;
1914 1914
 
1915 1915
 		// Execute insert or update depending on the value of member_srl
1916
-		if(!$args->user_id) $args->user_id = 't'.$args->member_srl;
1916
+		if (!$args->user_id) $args->user_id = 't'.$args->member_srl;
1917 1917
 		// Enter the user's identity changed to lowercase
1918 1918
 		else $args->user_id = strtolower($args->user_id);
1919
-		if(!$args->user_name) $args->user_name = $args->member_srl;
1920
-		if(!$args->nick_name) $args->nick_name = $args->member_srl;
1919
+		if (!$args->user_name) $args->user_name = $args->member_srl;
1920
+		if (!$args->nick_name) $args->nick_name = $args->member_srl;
1921 1921
 
1922 1922
 		// Control of essential parameters
1923
-		if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
1924
-		if($args->denied!='Y') $args->denied = 'N';
1925
-		if(!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y','N','F')))) $args->allow_message = 'Y';
1923
+		if ($args->allow_mailing != 'Y') $args->allow_mailing = 'N';
1924
+		if ($args->denied != 'Y') $args->denied = 'N';
1925
+		if (!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y', 'N', 'F')))) $args->allow_message = 'Y';
1926 1926
 
1927
-		if($logged_info->is_admin == 'Y')
1927
+		if ($logged_info->is_admin == 'Y')
1928 1928
 		{
1929
-			if($args->is_admin!='Y') $args->is_admin = 'N';
1929
+			if ($args->is_admin != 'Y') $args->is_admin = 'N';
1930 1930
 		}
1931 1931
 		else
1932 1932
 		{
@@ -1941,88 +1941,88 @@  discard block
 block discarded – undo
1941 1941
 		$args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
1942 1942
 		$args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
1943 1943
 		$args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
1944
-		if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
1945
-		if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) $args->blog = 'http://'.$args->blog;
1944
+		if ($args->homepage && !preg_match("/^[a-z]+:\/\//i", $args->homepage)) $args->homepage = 'http://'.$args->homepage;
1945
+		if ($args->blog && !preg_match("/^[a-z]+:\/\//i", $args->blog)) $args->blog = 'http://'.$args->blog;
1946 1946
 
1947 1947
 		// Create a model object
1948 1948
 		$oMemberModel = getModel('member');
1949 1949
 
1950 1950
 		// Check password strength
1951
-		if($args->password && !$password_is_hashed)
1951
+		if ($args->password && !$password_is_hashed)
1952 1952
 		{
1953
-			if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
1953
+			if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
1954 1954
 			{
1955 1955
 				$message = Context::getLang('about_password_strength');
1956 1956
 				return new Object(-1, $message[$config->password_strength]);
1957 1957
 			}
1958 1958
 			$args->password = $oMemberModel->hashPassword($args->password);
1959 1959
 		}
1960
-		elseif(!$args->password)
1960
+		elseif (!$args->password)
1961 1961
 		{
1962 1962
 			unset($args->password);
1963 1963
 		}
1964 1964
 
1965 1965
 		// Check if ID is prohibited
1966
-		if($oMemberModel->isDeniedID($args->user_id))
1966
+		if ($oMemberModel->isDeniedID($args->user_id))
1967 1967
 		{
1968
-			return new Object(-1,'denied_user_id');
1968
+			return new Object(-1, 'denied_user_id');
1969 1969
 		}
1970 1970
 
1971 1971
 		// Check if ID is duplicate
1972 1972
 		$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
1973
-		if($member_srl)
1973
+		if ($member_srl)
1974 1974
 		{
1975
-			return new Object(-1,'msg_exists_user_id');
1975
+			return new Object(-1, 'msg_exists_user_id');
1976 1976
 		}
1977 1977
 
1978 1978
 		// Check if nickname is prohibited
1979
-		if($oMemberModel->isDeniedNickName($args->nick_name))
1979
+		if ($oMemberModel->isDeniedNickName($args->nick_name))
1980 1980
 		{
1981
-			return new Object(-1,'denied_nick_name');
1981
+			return new Object(-1, 'denied_nick_name');
1982 1982
 		}
1983 1983
 
1984 1984
 		// Check if nickname is duplicate
1985 1985
 		$member_srl = $oMemberModel->getMemberSrlByNickName($args->nick_name);
1986
-		if($member_srl)
1986
+		if ($member_srl)
1987 1987
 		{
1988
-			return new Object(-1,'msg_exists_nick_name');
1988
+			return new Object(-1, 'msg_exists_nick_name');
1989 1989
 		}
1990 1990
 
1991 1991
 		// Check if email address is duplicate
1992 1992
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($args->email_address);
1993
-		if($member_srl)
1993
+		if ($member_srl)
1994 1994
 		{
1995
-			return new Object(-1,'msg_exists_email_address');
1995
+			return new Object(-1, 'msg_exists_email_address');
1996 1996
 		}
1997 1997
 
1998 1998
 		// Insert data into the DB
1999 1999
 		$args->list_order = -1 * $args->member_srl;
2000 2000
 
2001
-		if(!$args->user_id) $args->user_id = 't'.$args->member_srl;
2002
-		if(!$args->user_name) $args->user_name = $args->member_srl;
2001
+		if (!$args->user_id) $args->user_id = 't'.$args->member_srl;
2002
+		if (!$args->user_name) $args->user_name = $args->member_srl;
2003 2003
 
2004 2004
 		$oDB = &DB::getInstance();
2005 2005
 		$oDB->begin();
2006 2006
 
2007 2007
 		$output = executeQuery('member.insertMember', $args);
2008
-		if(!$output->toBool())
2008
+		if (!$output->toBool())
2009 2009
 		{
2010 2010
 			$oDB->rollback();
2011 2011
 			return $output;
2012 2012
 		}
2013 2013
 
2014
-		if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2014
+		if (is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2015 2015
 		else $group_srl_list = explode('|@|', $args->group_srl_list);
2016 2016
 		// If no value is entered the default group, the value of group registration
2017
-		if(!$args->group_srl_list)
2017
+		if (!$args->group_srl_list)
2018 2018
 		{
2019 2019
 			$columnList = array('site_srl', 'group_srl');
2020 2020
 			$default_group = $oMemberModel->getDefaultGroup(0, $columnList);
2021
-			if($default_group)
2021
+			if ($default_group)
2022 2022
 			{
2023 2023
 				// Add to the default group
2024
-				$output = $this->addMemberToGroup($args->member_srl,$default_group->group_srl);
2025
-				if(!$output->toBool())
2024
+				$output = $this->addMemberToGroup($args->member_srl, $default_group->group_srl);
2025
+				if (!$output->toBool())
2026 2026
 				{
2027 2027
 					$oDB->rollback();
2028 2028
 					return $output;
@@ -2032,11 +2032,11 @@  discard block
 block discarded – undo
2032 2032
 		}
2033 2033
 		else
2034 2034
 		{
2035
-			for($i=0;$i<count($group_srl_list);$i++)
2035
+			for ($i = 0; $i < count($group_srl_list); $i++)
2036 2036
 			{
2037
-				$output = $this->addMemberToGroup($args->member_srl,$group_srl_list[$i]);
2037
+				$output = $this->addMemberToGroup($args->member_srl, $group_srl_list[$i]);
2038 2038
 
2039
-				if(!$output->toBool())
2039
+				if (!$output->toBool())
2040 2040
 				{
2041 2041
 					$oDB->rollback();
2042 2042
 					return $output;
@@ -2046,7 +2046,7 @@  discard block
 block discarded – undo
2046 2046
 
2047 2047
 		$member_config = $oModuleModel->getModuleConfig('member');
2048 2048
 		// When using email authentication mode (when you subscribed members denied a) certified mail sent
2049
-		if($args->denied == 'Y')
2049
+		if ($args->denied == 'Y')
2050 2050
 		{
2051 2051
 			// Insert data into the authentication DB
2052 2052
 			$oPassword = new Password();
@@ -2058,7 +2058,7 @@  discard block
 block discarded – undo
2058 2058
 			$auth_args->is_register = 'Y';
2059 2059
 
2060 2060
 			$output = executeQuery('member.insertAuthMail', $auth_args);
2061
-			if(!$output->toBool())
2061
+			if (!$output->toBool())
2062 2062
 			{
2063 2063
 				$oDB->rollback();
2064 2064
 				return $output;
@@ -2066,10 +2066,10 @@  discard block
 block discarded – undo
2066 2066
 			$this->_sendAuthMail($auth_args, $args);
2067 2067
 		}
2068 2068
 		// Call a trigger (after)
2069
-		if($output->toBool())
2069
+		if ($output->toBool())
2070 2070
 		{
2071 2071
 			$trigger_output = ModuleHandler::triggerCall('member.insertMember', 'after', $args);
2072
-			if(!$trigger_output->toBool())
2072
+			if (!$trigger_output->toBool())
2073 2073
 			{
2074 2074
 				$oDB->rollback();
2075 2075
 				return $trigger_output;
@@ -2091,41 +2091,41 @@  discard block
 block discarded – undo
2091 2091
 	{
2092 2092
 		// Call a trigger (before)
2093 2093
 		$output = ModuleHandler::triggerCall('member.updateMember', 'before', $args);
2094
-		if(!$output->toBool()) return $output;
2094
+		if (!$output->toBool()) return $output;
2095 2095
 		// Create a model object
2096 2096
 		$oMemberModel = getModel('member');
2097 2097
 
2098 2098
 		$logged_info = Context::get('logged_info');
2099 2099
 		// Get what you want to modify the original information
2100
-		if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2100
+		if (!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2101 2101
 		// Control of essential parameters
2102
-		if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
2103
-		if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) $args->allow_message = 'Y';
2102
+		if ($args->allow_mailing != 'Y') $args->allow_mailing = 'N';
2103
+		if ($args->allow_message && !in_array($args->allow_message, array('Y', 'N', 'F'))) $args->allow_message = 'Y';
2104 2104
 
2105
-		if($logged_info->is_admin == 'Y')
2105
+		if ($logged_info->is_admin == 'Y')
2106 2106
 		{
2107
-			if($args->denied!='Y') $args->denied = 'N';
2108
-			if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N';
2107
+			if ($args->denied != 'Y') $args->denied = 'N';
2108
+			if ($args->is_admin != 'Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N';
2109 2109
 		}
2110 2110
 		else
2111 2111
 		{
2112 2112
 			unset($args->is_admin);
2113
-			if($is_admin == false)
2113
+			if ($is_admin == false)
2114 2114
 				unset($args->denied);
2115
-			if($logged_info->member_srl != $args->member_srl && $is_admin == false)
2115
+			if ($logged_info->member_srl != $args->member_srl && $is_admin == false)
2116 2116
 			{
2117 2117
 				return $this->stop('msg_invalid_request');
2118 2118
 			}
2119 2119
 		}
2120 2120
 
2121 2121
 		// Sanitize user ID, username, nickname, homepage, blog
2122
-		if($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2122
+		if ($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2123 2123
 		$args->user_name = htmlspecialchars($args->user_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2124 2124
 		$args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2125 2125
 		$args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2126 2126
 		$args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2127
-		if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
2128
-		if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) $args->blog = 'http://'.$args->blog;
2127
+		if ($args->homepage && !preg_match("/^[a-z]+:\/\//is", $args->homepage)) $args->homepage = 'http://'.$args->homepage;
2128
+		if ($args->blog && !preg_match("/^[a-z]+:\/\//is", $args->blog)) $args->blog = 'http://'.$args->blog;
2129 2129
 
2130 2130
 		// check member identifier form
2131 2131
 		$config = $oMemberModel->getMemberConfig();
@@ -2134,56 +2134,56 @@  discard block
 block discarded – undo
2134 2134
 		$orgMemberInfo = $output->data;
2135 2135
 
2136 2136
 		// Check if email address or user ID is duplicate
2137
-		if($config->identifier == 'email_address')
2137
+		if ($config->identifier == 'email_address')
2138 2138
 		{
2139 2139
 			$member_srl = $oMemberModel->getMemberSrlByEmailAddress($args->email_address);
2140
-			if($member_srl && $args->member_srl != $member_srl)
2140
+			if ($member_srl && $args->member_srl != $member_srl)
2141 2141
 			{
2142
-				return new Object(-1,'msg_exists_email_address');
2142
+				return new Object(-1, 'msg_exists_email_address');
2143 2143
 			}
2144 2144
 			$args->email_address = $orgMemberInfo->email_address;
2145 2145
 		}
2146 2146
 		else
2147 2147
 		{
2148 2148
 			$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
2149
-			if($member_srl && $args->member_srl != $member_srl)
2149
+			if ($member_srl && $args->member_srl != $member_srl)
2150 2150
 			{
2151
-				return new Object(-1,'msg_exists_user_id');
2151
+				return new Object(-1, 'msg_exists_user_id');
2152 2152
 			}
2153 2153
 
2154 2154
 			$args->user_id = $orgMemberInfo->user_id;
2155 2155
 		}
2156 2156
 
2157
-		if($logged_info->is_admin !== 'Y')
2157
+		if ($logged_info->is_admin !== 'Y')
2158 2158
 		{
2159 2159
 			// Check if ID is prohibited
2160
-			if($args->user_id && $oMemberModel->isDeniedID($args->user_id))
2160
+			if ($args->user_id && $oMemberModel->isDeniedID($args->user_id))
2161 2161
 			{
2162
-				return new Object(-1,'denied_user_id');
2162
+				return new Object(-1, 'denied_user_id');
2163 2163
 			}
2164 2164
 
2165 2165
 			// Check if nickname is prohibited
2166
-			if($args->nick_name && $oMemberModel->isDeniedNickName($args->nick_name))
2166
+			if ($args->nick_name && $oMemberModel->isDeniedNickName($args->nick_name))
2167 2167
 			{
2168 2168
 				return new Object(-1, 'denied_nick_name');
2169 2169
 			}
2170 2170
 		}
2171 2171
 
2172 2172
 		// Check if ID is duplicate
2173
-		if($args->user_id)
2173
+		if ($args->user_id)
2174 2174
 		{
2175 2175
 			$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
2176
-			if($member_srl && $args->member_srl != $member_srl)
2176
+			if ($member_srl && $args->member_srl != $member_srl)
2177 2177
 			{
2178
-				return new Object(-1,'msg_exists_user_id');
2178
+				return new Object(-1, 'msg_exists_user_id');
2179 2179
 			}
2180 2180
 		}
2181 2181
 
2182 2182
 		// Check if nickname is duplicate
2183 2183
 		$member_srl = $oMemberModel->getMemberSrlByNickName($args->nick_name);
2184
- 		if($member_srl && $args->member_srl != $member_srl)
2184
+ 		if ($member_srl && $args->member_srl != $member_srl)
2185 2185
  		{
2186
- 			return new Object(-1,'msg_exists_nick_name');
2186
+ 			return new Object(-1, 'msg_exists_nick_name');
2187 2187
  		}
2188 2188
 
2189 2189
 		list($args->email_id, $args->email_host) = explode('@', $args->email_address);
@@ -2192,9 +2192,9 @@  discard block
 block discarded – undo
2192 2192
 		$oDB->begin();
2193 2193
 
2194 2194
 		// Check password strength
2195
-		if($args->password)
2195
+		if ($args->password)
2196 2196
 		{
2197
-			if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2197
+			if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2198 2198
 			{
2199 2199
 				$message = Context::getLang('about_password_strength');
2200 2200
 				return new Object(-1, $message[$config->password_strength]);
@@ -2206,40 +2206,40 @@  discard block
 block discarded – undo
2206 2206
 			$args->password = $orgMemberInfo->password;
2207 2207
 		}
2208 2208
 
2209
-		if(!$args->user_name) $args->user_name = $orgMemberInfo->user_name;
2210
-		if(!$args->user_id) $args->user_id = $orgMemberInfo->user_id;
2211
-		if(!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name;
2212
-		if(!$args->description) $args->description = $orgMemberInfo->description;
2213
-		if(!$args->birthday) $args->birthday = '';
2209
+		if (!$args->user_name) $args->user_name = $orgMemberInfo->user_name;
2210
+		if (!$args->user_id) $args->user_id = $orgMemberInfo->user_id;
2211
+		if (!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name;
2212
+		if (!$args->description) $args->description = $orgMemberInfo->description;
2213
+		if (!$args->birthday) $args->birthday = '';
2214 2214
 
2215 2215
 		$output = executeQuery('member.updateMember', $args);
2216 2216
 
2217
-		if(!$output->toBool())
2217
+		if (!$output->toBool())
2218 2218
 		{
2219 2219
 			$oDB->rollback();
2220 2220
 			return $output;
2221 2221
 		}
2222 2222
 
2223
-		if($args->group_srl_list)
2223
+		if ($args->group_srl_list)
2224 2224
 		{
2225
-			if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2225
+			if (is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2226 2226
 			else $group_srl_list = explode('|@|', $args->group_srl_list);
2227 2227
 			// If the group information, group information changes
2228
-			if(count($group_srl_list) > 0)
2228
+			if (count($group_srl_list) > 0)
2229 2229
 			{
2230 2230
 				$args->site_srl = 0;
2231 2231
 				// One of its members to delete all the group
2232 2232
 				$output = executeQuery('member.deleteMemberGroupMember', $args);
2233
-				if(!$output->toBool())
2233
+				if (!$output->toBool())
2234 2234
 				{
2235 2235
 					$oDB->rollback();
2236 2236
 					return $output;
2237 2237
 				}
2238 2238
 				// Enter one of the loop a
2239
-				for($i=0;$i<count($group_srl_list);$i++)
2239
+				for ($i = 0; $i < count($group_srl_list); $i++)
2240 2240
 				{
2241
-					$output = $this->addMemberToGroup($args->member_srl,$group_srl_list[$i]);
2242
-					if(!$output->toBool())
2241
+					$output = $this->addMemberToGroup($args->member_srl, $group_srl_list[$i]);
2242
+					if (!$output->toBool())
2243 2243
 					{
2244 2244
 						$oDB->rollback();
2245 2245
 						return $output;
@@ -2251,9 +2251,9 @@  discard block
 block discarded – undo
2251 2251
 			}
2252 2252
 		}
2253 2253
 		// Call a trigger (after)
2254
-		if($output->toBool()) {
2254
+		if ($output->toBool()) {
2255 2255
 			$trigger_output = ModuleHandler::triggerCall('member.updateMember', 'after', $args);
2256
-			if(!$trigger_output->toBool())
2256
+			if (!$trigger_output->toBool())
2257 2257
 			{
2258 2258
 				$oDB->rollback();
2259 2259
 				return $trigger_output;
@@ -2266,7 +2266,7 @@  discard block
 block discarded – undo
2266 2266
 		$this->_clearMemberCache($args->member_srl, $args->site_srl);
2267 2267
 
2268 2268
 		// Save Session
2269
-		if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2269
+		if (!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2270 2270
 		$logged_info = Context::get('logged_info');
2271 2271
 
2272 2272
 		$output->add('member_srl', $args->member_srl);
@@ -2278,14 +2278,14 @@  discard block
 block discarded – undo
2278 2278
 	 */
2279 2279
 	function updateMemberPassword($args)
2280 2280
 	{
2281
-		if($args->password)
2281
+		if ($args->password)
2282 2282
 		{
2283 2283
 
2284 2284
 			// check password strength
2285 2285
 			$oMemberModel = getModel('member');
2286 2286
 			$config = $oMemberModel->getMemberConfig();
2287 2287
 
2288
-			if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2288
+			if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2289 2289
 			{
2290 2290
 				$message = Context::getLang('about_password_strength');
2291 2291
 				return new Object(-1, $message[$config->password_strength]);
@@ -2293,13 +2293,13 @@  discard block
 block discarded – undo
2293 2293
 
2294 2294
 			$args->password = $oMemberModel->hashPassword($args->password);
2295 2295
 		}
2296
-		else if($args->hashed_password)
2296
+		else if ($args->hashed_password)
2297 2297
 		{
2298 2298
 			$args->password = $args->hashed_password;
2299 2299
 		}
2300 2300
 
2301 2301
 		$output = executeQuery('member.updateMemberPassword', $args);
2302
-		if($output->toBool())
2302
+		if ($output->toBool())
2303 2303
 		{
2304 2304
 			$result = executeQuery('member.updateChangePasswordDate', $args);
2305 2305
 		}
@@ -2318,18 +2318,18 @@  discard block
 block discarded – undo
2318 2318
 		$trigger_obj = new stdClass();
2319 2319
 		$trigger_obj->member_srl = $member_srl;
2320 2320
 		$output = ModuleHandler::triggerCall('member.deleteMember', 'before', $trigger_obj);
2321
-		if(!$output->toBool()) return $output;
2321
+		if (!$output->toBool()) return $output;
2322 2322
 		// Create a model object
2323 2323
 		$oMemberModel = getModel('member');
2324 2324
 		// Bringing the user's information
2325
-		if(!$this->memberInfo || $this->memberInfo->member_srl != $member_srl || !isset($this->memberInfo->is_admin))
2325
+		if (!$this->memberInfo || $this->memberInfo->member_srl != $member_srl || !isset($this->memberInfo->is_admin))
2326 2326
 		{
2327 2327
 			$columnList = array('member_srl', 'is_admin');
2328 2328
 			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
2329 2329
 		}
2330
-		if(!$this->memberInfo) return new Object(-1, 'msg_not_exists_member');
2330
+		if (!$this->memberInfo) return new Object(-1, 'msg_not_exists_member');
2331 2331
 		// If managers can not be deleted
2332
-		if($this->memberInfo->is_admin == 'Y') return new Object(-1, 'msg_cannot_delete_admin');
2332
+		if ($this->memberInfo->is_admin == 'Y') return new Object(-1, 'msg_cannot_delete_admin');
2333 2333
 
2334 2334
 		$oDB = &DB::getInstance();
2335 2335
 		$oDB->begin();
@@ -2338,7 +2338,7 @@  discard block
 block discarded – undo
2338 2338
 		$args->member_srl = $member_srl;
2339 2339
 		// Delete the entries in member_auth_mail
2340 2340
 		$output = executeQuery('member.deleteAuthMail', $args);
2341
-		if(!$output->toBool())
2341
+		if (!$output->toBool())
2342 2342
 		{
2343 2343
 			$oDB->rollback();
2344 2344
 			return $output;
@@ -2353,23 +2353,23 @@  discard block
 block discarded – undo
2353 2353
 		 */
2354 2354
 		// Delete the entries in member_group_member
2355 2355
 		$output = executeQuery('member.deleteMemberGroupMember', $args);
2356
-		if(!$output->toBool())
2356
+		if (!$output->toBool())
2357 2357
 		{
2358 2358
 			$oDB->rollback();
2359 2359
 			return $output;
2360 2360
 		}
2361 2361
 		// member removed from the table
2362 2362
 		$output = executeQuery('member.deleteMember', $args);
2363
-		if(!$output->toBool())
2363
+		if (!$output->toBool())
2364 2364
 		{
2365 2365
 			$oDB->rollback();
2366 2366
 			return $output;
2367 2367
 		}
2368 2368
 		// Call a trigger (after)
2369
-		if($output->toBool())
2369
+		if ($output->toBool())
2370 2370
 		{
2371 2371
 			$trigger_output = ModuleHandler::triggerCall('member.deleteMember', 'after', $trigger_obj);
2372
-			if(!$trigger_output->toBool())
2372
+			if (!$trigger_output->toBool())
2373 2373
 			{
2374 2374
 				$oDB->rollback();
2375 2375
 				return $trigger_output;
@@ -2393,23 +2393,23 @@  discard block
 block discarded – undo
2393 2393
 	 */
2394 2394
 	function destroySessionInfo()
2395 2395
 	{
2396
-		if(!$_SESSION || !is_array($_SESSION)) return;
2396
+		if (!$_SESSION || !is_array($_SESSION)) return;
2397 2397
 
2398 2398
 		$memberInfo = Context::get('logged_info');
2399 2399
 		$memberSrl = $memberInfo->member_srl;
2400 2400
 
2401
-		foreach($_SESSION as $key => $val)
2401
+		foreach ($_SESSION as $key => $val)
2402 2402
 		{
2403 2403
 			$_SESSION[$key] = '';
2404 2404
 		}
2405 2405
 
2406 2406
 		session_destroy();
2407
-		setcookie(session_name(), '', $_SERVER['REQUEST_TIME']-42000, '/');
2408
-		setcookie('sso','',$_SERVER['REQUEST_TIME']-42000, '/');
2409
-		setcookie('xeak','',$_SERVER['REQUEST_TIME']-42000, '/');
2407
+		setcookie(session_name(), '', $_SERVER['REQUEST_TIME'] - 42000, '/');
2408
+		setcookie('sso', '', $_SERVER['REQUEST_TIME'] - 42000, '/');
2409
+		setcookie('xeak', '', $_SERVER['REQUEST_TIME'] - 42000, '/');
2410 2410
 		setcookie('xe_logged', 'false', $_SERVER['REQUEST_TIME'] - 42000, '/');
2411 2411
 
2412
-		if($memberSrl || $_COOKIE['xeak'])
2412
+		if ($memberSrl || $_COOKIE['xeak'])
2413 2413
 		{
2414 2414
 			$args = new stdClass();
2415 2415
 			$args->member_srl = $memberSrl;
@@ -2425,22 +2425,22 @@  discard block
 block discarded – undo
2425 2425
 		$pointGroup = $pointModuleConfig->point_group;
2426 2426
 
2427 2427
 		$levelGroup = array();
2428
-		if(is_array($pointGroup) && count($pointGroup)>0)
2428
+		if (is_array($pointGroup) && count($pointGroup) > 0)
2429 2429
 		{
2430 2430
 			$levelGroup = array_flip($pointGroup);
2431 2431
 			ksort($levelGroup);
2432 2432
 		}
2433 2433
 		$maxLevel = 0;
2434 2434
 		$resultGroup = array_intersect($levelGroup, $groupSrlList);
2435
-		if(count($resultGroup) > 0)
2435
+		if (count($resultGroup) > 0)
2436 2436
 			$maxLevel = max(array_flip($resultGroup));
2437 2437
 
2438
-		if($maxLevel > 0)
2438
+		if ($maxLevel > 0)
2439 2439
 		{
2440 2440
 			$oPointModel = getModel('point');
2441 2441
 			$originPoint = $oPointModel->getPoint($memberSrl);
2442 2442
 
2443
-			if($pointModuleConfig->level_step[$maxLevel] > $originPoint)
2443
+			if ($pointModuleConfig->level_step[$maxLevel] > $originPoint)
2444 2444
 			{
2445 2445
 				$oPointController = getController('point');
2446 2446
 				$oPointController->setPoint($memberSrl, $pointModuleConfig->level_step[$maxLevel], 'update');
@@ -2450,18 +2450,18 @@  discard block
 block discarded – undo
2450 2450
 
2451 2451
 	function procMemberModifyEmailAddress()
2452 2452
 	{
2453
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
2453
+		if (!Context::get('is_logged')) return $this->stop('msg_not_logged');
2454 2454
 
2455 2455
 		$member_info = Context::get('logged_info');
2456 2456
 		$newEmail = Context::get('email_address');
2457 2457
 
2458
-		if(!$newEmail) return $this->stop('msg_invalid_request');
2458
+		if (!$newEmail) return $this->stop('msg_invalid_request');
2459 2459
 
2460 2460
 		$oMemberModel = getModel('member');
2461 2461
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail);
2462
-		if($member_srl) return new Object(-1,'msg_exists_email_address');
2462
+		if ($member_srl) return new Object(-1, 'msg_exists_email_address');
2463 2463
 
2464
-		if($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
2464
+		if ($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
2465 2465
 		{
2466 2466
 			return $this->stop('msg_invalid_request');
2467 2467
 		}
@@ -2477,7 +2477,7 @@  discard block
 block discarded – undo
2477 2477
 		$oDB = &DB::getInstance();
2478 2478
 		$oDB->begin();
2479 2479
 		$output = executeQuery('member.insertAuthMail', $auth_args);
2480
-		if(!$output->toBool())
2480
+		if (!$output->toBool())
2481 2481
 		{
2482 2482
 			$oDB->rollback();
2483 2483
 			return $output;
@@ -2487,7 +2487,7 @@  discard block
 block discarded – undo
2487 2487
 		$member_config = $oModuleModel->getModuleConfig('member');
2488 2488
 
2489 2489
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
2490
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
2490
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
2491 2491
 
2492 2492
 		global $lang;
2493 2493
 
@@ -2499,17 +2499,17 @@  discard block
 block discarded – undo
2499 2499
 
2500 2500
 		Context::set('newEmail', $newEmail);
2501 2501
 
2502
-		$auth_url = getFullUrl('','module','member','act','procMemberAuthEmailAddress','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key);
2502
+		$auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthEmailAddress', 'member_srl', $member_info->member_srl, 'auth_key', $auth_args->auth_key);
2503 2503
 		Context::set('auth_url', $auth_url);
2504 2504
 
2505 2505
 		$oTemplate = &TemplateHandler::getInstance();
2506 2506
 		$content = $oTemplate->compile($tpl_path, 'confirm_member_new_email');
2507 2507
 
2508 2508
 		$oMail = new Mail();
2509
-		$oMail->setTitle( Context::getLang('title_modify_email_address') );
2509
+		$oMail->setTitle(Context::getLang('title_modify_email_address'));
2510 2510
 		$oMail->setContent($content);
2511
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
2512
-		$oMail->setReceiptor( $member_info->nick_name, $newEmail );
2511
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
2512
+		$oMail->setReceiptor($member_info->nick_name, $newEmail);
2513 2513
 		$result = $oMail->send();
2514 2514
 
2515 2515
 		$msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $newEmail);
@@ -2523,16 +2523,16 @@  discard block
 block discarded – undo
2523 2523
 	{
2524 2524
 		$member_srl = Context::get('member_srl');
2525 2525
 		$auth_key = Context::get('auth_key');
2526
-		if(!$member_srl || !$auth_key) return $this->stop('msg_invalid_request');
2526
+		if (!$member_srl || !$auth_key) return $this->stop('msg_invalid_request');
2527 2527
 
2528 2528
 		// Test logs for finding password by user_id and authkey
2529 2529
 		$args = new stdClass;
2530 2530
 		$args->member_srl = $member_srl;
2531 2531
 		$args->auth_key = $auth_key;
2532 2532
 		$output = executeQuery('member.getAuthMail', $args);
2533
-		if(!$output->toBool() || $output->data->auth_key != $auth_key)
2533
+		if (!$output->toBool() || $output->data->auth_key != $auth_key)
2534 2534
 		{
2535
-			if(strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args);
2535
+			if (strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args);
2536 2536
 			return $this->stop('msg_invalid_modify_email_auth_key');
2537 2537
 		}
2538 2538
 
@@ -2541,10 +2541,10 @@  discard block
 block discarded – undo
2541 2541
 		list($args->email_id, $args->email_host) = explode('@', $newEmail);
2542 2542
 
2543 2543
 		$output = executeQuery('member.updateMemberEmailAddress', $args);
2544
-		if(!$output->toBool()) return $this->stop($output->getMessage());
2544
+		if (!$output->toBool()) return $this->stop($output->getMessage());
2545 2545
 
2546 2546
 		// Remove all values having the member_srl and new_password equal to 'XE_change_emaill_address' from authentication table
2547
-		executeQuery('member.deleteAuthChangeEmailAddress',$args);
2547
+		executeQuery('member.deleteAuthChangeEmailAddress', $args);
2548 2548
 
2549 2549
 		$this->_clearMemberCache($args->member_srl);
2550 2550
 
@@ -2562,7 +2562,7 @@  discard block
 block discarded – undo
2562 2562
 	**/
2563 2563
 	function triggerGetDocumentMenu(&$menu_list)
2564 2564
 	{
2565
-		if(!Context::get('is_logged')) return new Object();
2565
+		if (!Context::get('is_logged')) return new Object();
2566 2566
 
2567 2567
 		$logged_info = Context::get('logged_info');
2568 2568
 		$document_srl = Context::get('target_srl');
@@ -2573,12 +2573,12 @@  discard block
 block discarded – undo
2573 2573
 		$member_srl = $oDocument->get('member_srl');
2574 2574
 		$module_srl = $oDocument->get('module_srl');
2575 2575
 
2576
-		if(!$member_srl) return new Object();
2577
-		if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new Object();
2576
+		if (!$member_srl) return new Object();
2577
+		if ($oDocumentModel->grant->manager != 1 || $member_srl == $logged_info->member_srl) return new Object();
2578 2578
 
2579 2579
 		$oDocumentController = getController('document');
2580
-		$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
2581
-		$oDocumentController->addDocumentPopupMenu($url,'cmd_spammer','','popup');
2580
+		$url = getUrl('', 'module', 'member', 'act', 'dispMemberSpammer', 'member_srl', $member_srl, 'module_srl', $module_srl);
2581
+		$oDocumentController->addDocumentPopupMenu($url, 'cmd_spammer', '', 'popup');
2582 2582
 
2583 2583
 		return new Object();
2584 2584
 	}
@@ -2592,7 +2592,7 @@  discard block
 block discarded – undo
2592 2592
 	**/
2593 2593
 	function triggerGetCommentMenu(&$menu_list)
2594 2594
 	{
2595
-		if(!Context::get('is_logged')) return new Object();
2595
+		if (!Context::get('is_logged')) return new Object();
2596 2596
 
2597 2597
 		$logged_info = Context::get('logged_info');
2598 2598
 		$comment_srl = Context::get('target_srl');
@@ -2603,12 +2603,12 @@  discard block
 block discarded – undo
2603 2603
 		$module_srl = $oComment->get('module_srl');
2604 2604
 		$member_srl = $oComment->get('member_srl');
2605 2605
 
2606
-		if(!$member_srl) return new Object();
2607
-		if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new Object();
2606
+		if (!$member_srl) return new Object();
2607
+		if ($oCommentModel->grant->manager != 1 || $member_srl == $logged_info->member_srl) return new Object();
2608 2608
 
2609 2609
 		$oCommentController = getController('comment');
2610
-		$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
2611
-		$oCommentController->addCommentPopupMenu($url,'cmd_spammer','','popup');
2610
+		$url = getUrl('', 'module', 'member', 'act', 'dispMemberSpammer', 'member_srl', $member_srl, 'module_srl', $module_srl);
2611
+		$oCommentController->addCommentPopupMenu($url, 'cmd_spammer', '', 'popup');
2612 2612
 
2613 2613
 		return new Object();
2614 2614
 	}
@@ -2620,7 +2620,7 @@  discard block
 block discarded – undo
2620 2620
 	**/
2621 2621
 	function procMemberSpammerManage()
2622 2622
 	{
2623
-		if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
2623
+		if (!Context::get('is_logged')) return new Object(-1, 'msg_not_permitted');
2624 2624
 
2625 2625
 		$logged_info = Context::get('logged_info');
2626 2626
 		$member_srl = Context::get('member_srl');
@@ -2628,7 +2628,7 @@  discard block
 block discarded – undo
2628 2628
 		$cnt_loop = Context::get('cnt_loop');
2629 2629
 		$proc_type = Context::get('proc_type');
2630 2630
 		$isMoveToTrash = true;
2631
-		if($proc_type == "delete")
2631
+		if ($proc_type == "delete")
2632 2632
 			$isMoveToTrash = false;
2633 2633
 
2634 2634
 		// check grant
@@ -2637,7 +2637,7 @@  discard block
 block discarded – undo
2637 2637
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
2638 2638
 		$grant = $oModuleModel->getGrant($module_info, $logged_info);
2639 2639
 
2640
-		if(!$grant->manager) return new Object(-1,'msg_not_permitted');
2640
+		if (!$grant->manager) return new Object(-1, 'msg_not_permitted');
2641 2641
 
2642 2642
 		$proc_msg = "";
2643 2643
 
@@ -2646,10 +2646,10 @@  discard block
 block discarded – undo
2646 2646
 
2647 2647
 		// delete or trash destination
2648 2648
 		// proc member
2649
-		if($cnt_loop == 1)
2649
+		if ($cnt_loop == 1)
2650 2650
 			$this->_spammerMember($member_srl);
2651 2651
 		// proc document and comment
2652
-		elseif($cnt_loop>1)
2652
+		elseif ($cnt_loop > 1)
2653 2653
 			$this->_spammerDocuments($member_srl, $isMoveToTrash);
2654 2654
 
2655 2655
 		// get destination count
@@ -2658,11 +2658,11 @@  discard block
 block discarded – undo
2658 2658
 
2659 2659
 		$total_count = Context::get('total_count');
2660 2660
 		$remain_count = $cnt_document + $cnt_comment;
2661
-		if($cnt_loop == 1) $total_count = $remain_count;
2661
+		if ($cnt_loop == 1) $total_count = $remain_count;
2662 2662
 
2663 2663
 		// get progress percent
2664
-		if($total_count > 0)
2665
-			$progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 );
2664
+		if ($total_count > 0)
2665
+			$progress = intval((($total_count - $remain_count) / $total_count) * 100);
2666 2666
 		else
2667 2667
 			$progress = 100;
2668 2668
 
@@ -2686,7 +2686,7 @@  discard block
 block discarded – undo
2686 2686
 	**/
2687 2687
 	private function _spammerMember($member_srl) {
2688 2688
 		$logged_info = Context::get('logged_info');
2689
-		$spam_description = trim( Context::get('spam_description') );
2689
+		$spam_description = trim(Context::get('spam_description'));
2690 2690
 
2691 2691
 		$oMemberModel = getModel('member');
2692 2692
 		$columnList = array('member_srl', 'email_address', 'user_id', 'nick_name', 'description');
@@ -2705,10 +2705,10 @@  discard block
 block discarded – undo
2705 2705
 		$args->user_id = $member_info->user_id;
2706 2706
 		$args->nick_name = $member_info->nick_name;
2707 2707
 		$args->denied = "Y";
2708
-		$args->description = trim( $member_info->description );
2709
-		if( $args->description != "" ) $args->description .= "\n";	// add new line
2708
+		$args->description = trim($member_info->description);
2709
+		if ($args->description != "") $args->description .= "\n"; // add new line
2710 2710
 
2711
-		$args->description .= Context::getLang('cmd_spammer') . "[" . date("Y-m-d H:i:s") . " from:" . $logged_info->user_id . " info:" . $spam_description . " docuemnts count:" . $total_count . "]";
2711
+		$args->description .= Context::getLang('cmd_spammer')."[".date("Y-m-d H:i:s")." from:".$logged_info->user_id." info:".$spam_description." docuemnts count:".$total_count."]";
2712 2712
 
2713 2713
 		$output = $this->updateMember($args, true);
2714 2714
 
@@ -2737,21 +2737,21 @@  discard block
 block discarded – undo
2737 2737
 		// 1. proc comment, 2. proc document
2738 2738
 		$cnt_comment = $oCommentModel->getCommentCountByMemberSrl($member_srl);
2739 2739
 		$cnt_document = $oDocumentModel->getDocumentCountByMemberSrl($member_srl);
2740
-		if($cnt_comment > 0)
2740
+		if ($cnt_comment > 0)
2741 2741
 		{
2742 2742
 			$columnList = array();
2743 2743
 			$commentList = $oCommentModel->getCommentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount);
2744
-			if($commentList) {
2745
-				foreach($commentList as $v) {
2744
+			if ($commentList) {
2745
+				foreach ($commentList as $v) {
2746 2746
 					$oCommentController->deleteComment($v->comment_srl, true, $isMoveToTrash);
2747 2747
 				}
2748 2748
 			}
2749
-		} elseif($cnt_document > 0) {
2749
+		} elseif ($cnt_document > 0) {
2750 2750
 			$columnList = array();
2751 2751
 			$documentList = $oDocumentModel->getDocumentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount);
2752
-			if($documentList) {
2753
-				foreach($documentList as $v) {
2754
-					if($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v);
2752
+			if ($documentList) {
2753
+				foreach ($documentList as $v) {
2754
+					if ($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v);
2755 2755
 					else $oDocumentController->deleteDocument($v->document_srl);
2756 2756
 				}
2757 2757
 			}
@@ -2763,24 +2763,24 @@  discard block
 block discarded – undo
2763 2763
 	function _clearMemberCache($member_srl, $site_srl = 0)
2764 2764
 	{
2765 2765
 		$oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE);
2766
-		if($oCacheHandler->isSupport())
2766
+		if ($oCacheHandler->isSupport())
2767 2767
 		{
2768
-			$object_key = 'member_groups:' . getNumberingPath($member_srl) . $member_srl . '_' . $site_srl;
2768
+			$object_key = 'member_groups:'.getNumberingPath($member_srl).$member_srl.'_'.$site_srl;
2769 2769
 			$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
2770 2770
 			$oCacheHandler->delete($cache_key);
2771 2771
 
2772
-			if($site_srl !== 0)
2772
+			if ($site_srl !== 0)
2773 2773
 			{
2774
-				$object_key = 'member_groups:' . getNumberingPath($member_srl) . $member_srl . '_0';
2774
+				$object_key = 'member_groups:'.getNumberingPath($member_srl).$member_srl.'_0';
2775 2775
 				$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
2776 2776
 				$oCacheHandler->delete($cache_key);
2777 2777
 			}
2778 2778
 		}
2779 2779
 
2780 2780
 		$oCacheHandler = CacheHandler::getInstance('object');
2781
-		if($oCacheHandler->isSupport())
2781
+		if ($oCacheHandler->isSupport())
2782 2782
 		{
2783
-			$object_key = 'member_info:' . getNumberingPath($member_srl) . $member_srl;
2783
+			$object_key = 'member_info:'.getNumberingPath($member_srl).$member_srl;
2784 2784
 			$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
2785 2785
 			$oCacheHandler->delete($cache_key);
2786 2786
 		}
Please login to merge, or discard this patch.
Braces   +590 added lines, -247 removed lines patch added patch discarded remove patch
@@ -41,19 +41,31 @@  discard block
 block discarded – undo
41 41
 		}
42 42
 
43 43
 		// Variables
44
-		if(!$user_id) $user_id = Context::get('user_id');
44
+		if(!$user_id) {
45
+			$user_id = Context::get('user_id');
46
+		}
45 47
 		$user_id = trim($user_id);
46 48
 
47
-		if(!$password) $password = Context::get('password');
49
+		if(!$password) {
50
+			$password = Context::get('password');
51
+		}
48 52
 		$password = trim($password);
49 53
 
50
-		if(!$keep_signed) $keep_signed = Context::get('keep_signed');
54
+		if(!$keep_signed) {
55
+			$keep_signed = Context::get('keep_signed');
56
+		}
51 57
 		// Return an error when id and password doesn't exist
52
-		if(!$user_id) return new Object(-1,'null_user_id');
53
-		if(!$password) return new Object(-1,'null_password');
58
+		if(!$user_id) {
59
+			return new Object(-1,'null_user_id');
60
+		}
61
+		if(!$password) {
62
+			return new Object(-1,'null_password');
63
+		}
54 64
 
55 65
 		$output = $this->doLogin($user_id, $password, $keep_signed=='Y'?true:false);
56
-		if (!$output->toBool()) return $output;
66
+		if (!$output->toBool()) {
67
+			return $output;
68
+		}
57 69
 
58 70
 		$oModuleModel = getModel('module');
59 71
 		$config = $oModuleModel->getModuleConfig('member');
@@ -80,8 +92,7 @@  discard block
 block discarded – undo
80 92
 		if(!$config->after_login_url)
81 93
 		{
82 94
 			$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', '');
83
-		}
84
-		else
95
+		} else
85 96
 		{
86 97
 			$returnUrl = $config->after_login_url;
87 98
 		}
@@ -98,19 +109,24 @@  discard block
 block discarded – undo
98 109
 		// Call a trigger before log-out (before)
99 110
 		$logged_info = Context::get('logged_info');
100 111
 		$trigger_output = ModuleHandler::triggerCall('member.doLogout', 'before', $logged_info);
101
-		if(!$trigger_output->toBool()) return $trigger_output;
112
+		if(!$trigger_output->toBool()) {
113
+			return $trigger_output;
114
+		}
102 115
 		// Destroy session information
103 116
 		$this->destroySessionInfo();
104 117
 		// Call a trigger after log-out (after)
105 118
 		$trigger_output = ModuleHandler::triggerCall('member.doLogout', 'after', $logged_info);
106
-		if(!$trigger_output->toBool()) return $trigger_output;
119
+		if(!$trigger_output->toBool()) {
120
+			return $trigger_output;
121
+		}
107 122
 
108 123
 		$output = new Object();
109 124
 
110 125
 		$oModuleModel = getModel('module');
111 126
 		$config = $oModuleModel->getModuleConfig('member');
112
-		if($config->after_logout_url)
113
-			$output->redirect_url = $config->after_logout_url;
127
+		if($config->after_logout_url) {
128
+					$output->redirect_url = $config->after_logout_url;
129
+		}
114 130
 
115 131
 		$this->_clearMemberCache($logged_info->member_srl);
116 132
 
@@ -125,12 +141,18 @@  discard block
 block discarded – undo
125 141
 	function procMemberScrapDocument()
126 142
 	{
127 143
 		// Check login information
128
-		if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
144
+		if(!Context::get('is_logged')) {
145
+			return new Object(-1, 'msg_not_logged');
146
+		}
129 147
 		$logged_info = Context::get('logged_info');
130 148
 
131 149
 		$document_srl = (int)Context::get('document_srl');
132
-		if(!$document_srl) $document_srl = (int)Context::get('target_srl');
133
-		if(!$document_srl) return new Object(-1,'msg_invalid_request');
150
+		if(!$document_srl) {
151
+			$document_srl = (int)Context::get('target_srl');
152
+		}
153
+		if(!$document_srl) {
154
+			return new Object(-1,'msg_invalid_request');
155
+		}
134 156
 		// Get document
135 157
 		$oDocumentModel = getModel('document');
136 158
 		$oDocument = $oDocumentModel->getDocument($document_srl);
@@ -145,10 +167,14 @@  discard block
 block discarded – undo
145 167
 		$args->title = $oDocument->get('title');
146 168
 		// Check if already scrapped
147 169
 		$output = executeQuery('member.getScrapDocument', $args);
148
-		if($output->data->count) return new Object(-1, 'msg_alreay_scrapped');
170
+		if($output->data->count) {
171
+			return new Object(-1, 'msg_alreay_scrapped');
172
+		}
149 173
 		// Insert
150 174
 		$output = executeQuery('member.addScrapDocument', $args);
151
-		if(!$output->toBool()) return $output;
175
+		if(!$output->toBool()) {
176
+			return $output;
177
+		}
152 178
 
153 179
 		$this->setError(-1);
154 180
 		$this->setMessage('success_registed');
@@ -162,11 +188,15 @@  discard block
 block discarded – undo
162 188
 	function procMemberDeleteScrap()
163 189
 	{
164 190
 		// Check login information
165
-		if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
191
+		if(!Context::get('is_logged')) {
192
+			return new Object(-1, 'msg_not_logged');
193
+		}
166 194
 		$logged_info = Context::get('logged_info');
167 195
 
168 196
 		$document_srl = (int)Context::get('document_srl');
169
-		if(!$document_srl) return new Object(-1,'msg_invalid_request');
197
+		if(!$document_srl) {
198
+			return new Object(-1,'msg_invalid_request');
199
+		}
170 200
 		// Variables
171 201
 		$args = new stdClass;
172 202
 		$args->member_srl = $logged_info->member_srl;
@@ -192,11 +222,15 @@  discard block
 block discarded – undo
192 222
 	function procMemberDeleteSavedDocument()
193 223
 	{
194 224
 		// Check login information
195
-		if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
225
+		if(!Context::get('is_logged')) {
226
+			return new Object(-1, 'msg_not_logged');
227
+		}
196 228
 		$logged_info = Context::get('logged_info');
197 229
 
198 230
 		$document_srl = (int)Context::get('document_srl');
199
-		if(!$document_srl) return new Object(-1,'msg_invalid_request');
231
+		if(!$document_srl) {
232
+			return new Object(-1,'msg_invalid_request');
233
+		}
200 234
 		// Variables
201 235
 		$oDocumentController = getController('document');
202 236
 		$oDocumentController->deleteDocument($document_srl, true);
@@ -211,7 +245,9 @@  discard block
 block discarded – undo
211 245
 	{
212 246
 		$name = Context::get('name');
213 247
 		$value = Context::get('value');
214
-		if(!$value) return;
248
+		if(!$value) {
249
+			return;
250
+		}
215 251
 
216 252
 		$oMemberModel = getModel('member');
217 253
 		// Check if logged-in
@@ -222,10 +258,14 @@  discard block
 block discarded – undo
222 258
 		{
223 259
 			case 'user_id' :
224 260
 				// Check denied ID
225
-				if($oMemberModel->isDeniedID($value)) return new Object(0,'denied_user_id');
261
+				if($oMemberModel->isDeniedID($value)) {
262
+					return new Object(0,'denied_user_id');
263
+				}
226 264
 				// Check if duplicated
227 265
 				$member_srl = $oMemberModel->getMemberSrlByUserID($value);
228
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_user_id');
266
+				if($member_srl && $logged_info->member_srl != $member_srl ) {
267
+					return new Object(0,'msg_exists_user_id');
268
+				}
229 269
 				break;
230 270
 			case 'nick_name' :
231 271
 				// Check denied ID
@@ -235,13 +275,17 @@  discard block
 block discarded – undo
235 275
 				}
236 276
 				// Check if duplicated
237 277
 				$member_srl = $oMemberModel->getMemberSrlByNickName($value);
238
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_nick_name');
278
+				if($member_srl && $logged_info->member_srl != $member_srl ) {
279
+					return new Object(0,'msg_exists_nick_name');
280
+				}
239 281
 
240 282
 				break;
241 283
 			case 'email_address' :
242 284
 				// Check if duplicated
243 285
 				$member_srl = $oMemberModel->getMemberSrlByEmailAddress($value);
244
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_email_address');
286
+				if($member_srl && $logged_info->member_srl != $member_srl ) {
287
+					return new Object(0,'msg_exists_email_address');
288
+				}
245 289
 				break;
246 290
 		}
247 291
 	}
@@ -253,17 +297,25 @@  discard block
 block discarded – undo
253 297
 	 */
254 298
 	function procMemberInsert()
255 299
 	{
256
-		if (Context::getRequestMethod () == "GET") return new Object (-1, "msg_invalid_request");
300
+		if (Context::getRequestMethod () == "GET") {
301
+			return new Object (-1, "msg_invalid_request");
302
+		}
257 303
 		$oMemberModel = &getModel ('member');
258 304
 		$config = $oMemberModel->getMemberConfig();
259 305
 
260 306
 		// call a trigger (before)
261 307
 		$trigger_output = ModuleHandler::triggerCall ('member.procMemberInsert', 'before', $config);
262
-		if(!$trigger_output->toBool ()) return $trigger_output;
308
+		if(!$trigger_output->toBool ()) {
309
+			return $trigger_output;
310
+		}
263 311
 		// Check if an administrator allows a membership
264
-		if($config->enable_join != 'Y') return $this->stop ('msg_signup_disabled');
312
+		if($config->enable_join != 'Y') {
313
+			return $this->stop ('msg_signup_disabled');
314
+		}
265 315
 		// Check if the user accept the license terms (only if terms exist)
266
-		if($config->agreement && Context::get('accept_agreement')!='Y') return $this->stop('msg_accept_agreement');
316
+		if($config->agreement && Context::get('accept_agreement')!='Y') {
317
+			return $this->stop('msg_accept_agreement');
318
+		}
267 319
 
268 320
 		// Extract the necessary information in advance
269 321
 		$getVars = array();
@@ -282,16 +334,22 @@  discard block
 block discarded – undo
282 334
 		foreach($getVars as $val)
283 335
 		{
284 336
 			$args->{$val} = Context::get($val);
285
-			if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
337
+			if($val == 'birthday') {
338
+				$args->birthday_ui = Context::get('birthday_ui');
339
+			}
286 340
 		}
287 341
 		$args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
288
-		if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
342
+		if(!$args->birthday && $args->birthday_ui) {
343
+			$args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
344
+		}
289 345
 
290 346
 		$args->find_account_answer = Context::get('find_account_answer');
291 347
 		$args->allow_mailing = Context::get('allow_mailing');
292 348
 		$args->allow_message = Context::get('allow_message');
293 349
 
294
-		if($args->password1) $args->password = $args->password1;
350
+		if($args->password1) {
351
+			$args->password = $args->password1;
352
+		}
295 353
 
296 354
 		// check password strength
297 355
 		if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
@@ -320,7 +378,9 @@  discard block
 block discarded – undo
320 378
 		unset($all_args->secret_text);
321 379
 
322 380
 		// Set the user state as "denied" when using mail authentication
323
-		if($config->enable_confirm == 'Y') $args->denied = 'Y';
381
+		if($config->enable_confirm == 'Y') {
382
+			$args->denied = 'Y';
383
+		}
324 384
 		// Add extra vars after excluding necessary information from all the requested arguments
325 385
 		$extra_vars = delObjectVars($all_args, $args);
326 386
 		$args->extra_vars = serialize($extra_vars);
@@ -335,7 +395,9 @@  discard block
 block discarded – undo
335 395
 			}
336 396
 		}
337 397
 		$output = $this->insertMember($args);
338
-		if(!$output->toBool()) return $output;
398
+		if(!$output->toBool()) {
399
+			return $output;
400
+		}
339 401
 
340 402
 		// insert ProfileImage, ImageName, ImageMark
341 403
 		$profile_image = $_FILES['profile_image'];
@@ -374,43 +436,46 @@  discard block
 block discarded – undo
374 436
 			if($config->identifier == 'email_address')
375 437
 			{
376 438
 				$output = $this->doLogin($args->email_address);
377
-			}
378
-			else
439
+			} else
379 440
 			{
380 441
 				$output = $this->doLogin($args->user_id);
381 442
 			}
382 443
 			if(!$output->toBool()) {
383
-				if($output->error == -9)
384
-					$output->error = -11;
444
+				if($output->error == -9) {
445
+									$output->error = -11;
446
+				}
385 447
 				return $this->setRedirectUrl(getUrl('', 'act', 'dispMemberLoginForm'), $output);
386 448
 			}
387 449
 		}
388 450
 
389 451
 		// Results
390 452
 		$this->add('member_srl', $args->member_srl);
391
-		if($config->redirect_url) $this->add('redirect_url', $config->redirect_url);
453
+		if($config->redirect_url) {
454
+			$this->add('redirect_url', $config->redirect_url);
455
+		}
392 456
 		if($config->enable_confirm == 'Y')
393 457
 		{
394 458
 			$msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address);
395 459
 			$this->setMessage($msg);
396 460
 			return $this->setRedirectUrl(getUrl('', 'act', 'dispMemberLoginForm'), new Object(-12, $msg));
461
+		} else {
462
+			$this->setMessage('success_registed');
397 463
 		}
398
-		else $this->setMessage('success_registed');
399 464
 		// Call a trigger (after)
400 465
 		$trigger_output = ModuleHandler::triggerCall('member.procMemberInsert', 'after', $config);
401
-		if(!$trigger_output->toBool()) return $trigger_output;
466
+		if(!$trigger_output->toBool()) {
467
+			return $trigger_output;
468
+		}
402 469
 
403 470
 		if($config->redirect_url)
404 471
 		{
405 472
 			$returnUrl = $config->redirect_url;
406
-		}
407
-		else
473
+		} else
408 474
 		{
409 475
 			if(Context::get('success_return_url'))
410 476
 			{
411 477
 				$returnUrl = Context::get('success_return_url');
412
-			}
413
-			else if($_COOKIE['XE_REDIRECT_URL'])
478
+			} else if($_COOKIE['XE_REDIRECT_URL'])
414 479
 			{
415 480
 				$returnUrl = $_COOKIE['XE_REDIRECT_URL'];
416 481
 				setcookie("XE_REDIRECT_URL", '', 1);
@@ -464,8 +529,7 @@  discard block
 block discarded – undo
464 529
 		if(Context::get('success_return_url'))
465 530
 		{
466 531
 			$redirectUrl = Context::get('success_return_url');
467
-		}
468
-		else
532
+		} else
469 533
 		{
470 534
 			$redirectUrl = getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberModifyInfo');
471 535
 		}
@@ -509,13 +573,17 @@  discard block
 block discarded – undo
509 573
 		foreach($getVars as $val)
510 574
 		{
511 575
 			$args->{$val} = Context::get($val);
512
-			if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
576
+			if($val == 'birthday') {
577
+				$args->birthday_ui = Context::get('birthday_ui');
578
+			}
513 579
 		}
514 580
 		// Login Information
515 581
 		$logged_info = Context::get('logged_info');
516 582
 		$args->member_srl = $logged_info->member_srl;
517 583
 		$args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
518
-		if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
584
+		if(!$args->birthday && $args->birthday_ui) {
585
+			$args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
586
+		}
519 587
 		// Remove some unnecessary variables from all the vars
520 588
 		$all_args = Context::getRequestVars();
521 589
 		unset($all_args->module);
@@ -549,7 +617,9 @@  discard block
 block discarded – undo
549 617
 
550 618
 		// Execute insert or update depending on the value of member_srl
551 619
 		$output = $this->updateMember($args);
552
-		if(!$output->toBool()) return $output;
620
+		if(!$output->toBool()) {
621
+			return $output;
622
+		}
553 623
 
554 624
 		$profile_image = $_FILES['profile_image'];
555 625
 		if(is_uploaded_file($profile_image['tmp_name']))
@@ -579,7 +649,9 @@  discard block
 block discarded – undo
579 649
 
580 650
 		// Call a trigger after successfully log-in (after)
581 651
 		$trigger_output = ModuleHandler::triggerCall('member.procMemberModifyInfo', 'after', $this->memberInfo);
582
-		if(!$trigger_output->toBool()) return $trigger_output;
652
+		if(!$trigger_output->toBool()) {
653
+			return $trigger_output;
654
+		}
583 655
 
584 656
 		$this->setSessionInfo();
585 657
 		// Return result
@@ -600,7 +672,9 @@  discard block
 block discarded – undo
600 672
 	 */
601 673
 	function procMemberModifyPassword()
602 674
 	{
603
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
675
+		if(!Context::get('is_logged')) {
676
+			return $this->stop('msg_not_logged');
677
+		}
604 678
 		// Extract the necessary information in advance
605 679
 		$current_password = trim(Context::get('current_password'));
606 680
 		$password = trim(Context::get('password1'));
@@ -614,17 +688,23 @@  discard block
 block discarded – undo
614 688
 
615 689
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
616 690
 		// Verify the cuttent password
617
-		if(!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) return new Object(-1, 'invalid_password');
691
+		if(!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) {
692
+			return new Object(-1, 'invalid_password');
693
+		}
618 694
 
619 695
 		// Check if a new password is as same as the previous password
620
-		if($current_password == $password) return new Object(-1, 'invalid_new_password');
696
+		if($current_password == $password) {
697
+			return new Object(-1, 'invalid_new_password');
698
+		}
621 699
 
622 700
 		// Execute insert or update depending on the value of member_srl
623 701
 		$args = new stdClass;
624 702
 		$args->member_srl = $member_srl;
625 703
 		$args->password = $password;
626 704
 		$output = $this->updateMemberPassword($args);
627
-		if(!$output->toBool()) return $output;
705
+		if(!$output->toBool()) {
706
+			return $output;
707
+		}
628 708
 
629 709
 		$this->add('member_srl', $args->member_srl);
630 710
 		$this->setMessage('success_updated');
@@ -640,7 +720,9 @@  discard block
 block discarded – undo
640 720
 	 */
641 721
 	function procMemberLeave()
642 722
 	{
643
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
723
+		if(!Context::get('is_logged')) {
724
+			return $this->stop('msg_not_logged');
725
+		}
644 726
 		// Extract the necessary information in advance
645 727
 		$password = trim(Context::get('password'));
646 728
 		// Get information of logged-in user
@@ -656,10 +738,14 @@  discard block
 block discarded – undo
656 738
 			$this->memberInfo->password = $memberInfo->password;
657 739
 		}
658 740
 		// Verify the cuttent password
659
-		if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) return new Object(-1, 'invalid_password');
741
+		if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) {
742
+			return new Object(-1, 'invalid_password');
743
+		}
660 744
 
661 745
 		$output = $this->deleteMember($member_srl);
662
-		if(!$output->toBool()) return $output;
746
+		if(!$output->toBool()) {
747
+			return $output;
748
+		}
663 749
 		// Destroy all session information
664 750
 		$this->destroySessionInfo();
665 751
 		// Return success message
@@ -678,17 +764,25 @@  discard block
 block discarded – undo
678 764
 	{
679 765
 		// Check if the file is successfully uploaded
680 766
 		$file = $_FILES['profile_image'];
681
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_profile_image');
767
+		if(!is_uploaded_file($file['tmp_name'])) {
768
+			return $this->stop('msg_not_uploaded_profile_image');
769
+		}
682 770
 		// Ignore if member_srl is invalid or doesn't exist.
683 771
 		$member_srl = Context::get('member_srl');
684
-		if(!$member_srl) return $this->stop('msg_not_uploaded_profile_image');
772
+		if(!$member_srl) {
773
+			return $this->stop('msg_not_uploaded_profile_image');
774
+		}
685 775
 
686 776
 		$logged_info = Context::get('logged_info');
687
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_profile_image');
777
+		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) {
778
+			return $this->stop('msg_not_uploaded_profile_image');
779
+		}
688 780
 		// Return if member module is set not to use an image name or the user is not an administrator ;
689 781
 		$oModuleModel = getModel('module');
690 782
 		$config = $oModuleModel->getModuleConfig('member');
691
-		if($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') return $this->stop('msg_not_uploaded_profile_image');
783
+		if($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') {
784
+			return $this->stop('msg_not_uploaded_profile_image');
785
+		}
692 786
 
693 787
 		$this->insertProfileImage($member_srl, $file['tmp_name']);
694 788
 		// Page refresh
@@ -710,26 +804,35 @@  discard block
 block discarded – undo
710 804
 	{
711 805
 
712 806
 		// Check uploaded file
713
-		if(!checkUploadedFile($target_file)) return;
807
+		if(!checkUploadedFile($target_file)) {
808
+			return;
809
+		}
714 810
 
715 811
 		$oMemberModel = getModel('member');
716 812
 		$config = $oMemberModel->getMemberConfig();
717 813
 
718 814
 		// Get an image size
719 815
 		$max_width = $config->profile_image_max_width;
720
-		if(!$max_width) $max_width = "90";
816
+		if(!$max_width) {
817
+			$max_width = "90";
818
+		}
721 819
 		$max_height = $config->profile_image_max_height;
722
-		if(!$max_height) $max_height = "90";
820
+		if(!$max_height) {
821
+			$max_height = "90";
822
+		}
723 823
 		// Get a target path to save
724 824
 		$target_path = sprintf('files/member_extra_info/profile_image/%s', getNumberingPath($member_srl));
725 825
 		FileHandler::makeDir($target_path);
726 826
 
727 827
 		// Get file information
728 828
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
729
-		if(IMAGETYPE_PNG == $type) $ext = 'png';
730
-		elseif(IMAGETYPE_JPEG == $type) $ext = 'jpg';
731
-		elseif(IMAGETYPE_GIF == $type) $ext = 'gif';
732
-		else
829
+		if(IMAGETYPE_PNG == $type) {
830
+			$ext = 'png';
831
+		} elseif(IMAGETYPE_JPEG == $type) {
832
+			$ext = 'jpg';
833
+		} elseif(IMAGETYPE_GIF == $type) {
834
+			$ext = 'gif';
835
+		} else
733 836
 		{
734 837
 			return;
735 838
 		}
@@ -741,8 +844,7 @@  discard block
 block discarded – undo
741 844
 		if(($width > $max_width || $height > $max_height ) && $type != 1)
742 845
 		{
743 846
 			FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, $ext);
744
-		}
745
-		else
847
+		} else
746 848
 		{
747 849
 			@copy($target_file, $target_filename);
748 850
 		}
@@ -757,17 +859,25 @@  discard block
 block discarded – undo
757 859
 	{
758 860
 		// Check if the file is successfully uploaded
759 861
 		$file = $_FILES['image_name'];
760
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name');
862
+		if(!is_uploaded_file($file['tmp_name'])) {
863
+			return $this->stop('msg_not_uploaded_image_name');
864
+		}
761 865
 		// Ignore if member_srl is invalid or doesn't exist.
762 866
 		$member_srl = Context::get('member_srl');
763
-		if(!$member_srl) return $this->stop('msg_not_uploaded_image_name');
867
+		if(!$member_srl) {
868
+			return $this->stop('msg_not_uploaded_image_name');
869
+		}
764 870
 
765 871
 		$logged_info = Context::get('logged_info');
766
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name');
872
+		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) {
873
+			return $this->stop('msg_not_uploaded_image_name');
874
+		}
767 875
 		// Return if member module is set not to use an image name or the user is not an administrator ;
768 876
 		$oModuleModel = getModel('module');
769 877
 		$config = $oModuleModel->getModuleConfig('member');
770
-		if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name');
878
+		if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') {
879
+			return $this->stop('msg_not_uploaded_image_name');
880
+		}
771 881
 
772 882
 		$this->insertImageName($member_srl, $file['tmp_name']);
773 883
 		// Page refresh
@@ -788,15 +898,21 @@  discard block
 block discarded – undo
788 898
 	function insertImageName($member_srl, $target_file)
789 899
 	{
790 900
 		// Check uploaded file
791
-		if(!checkUploadedFile($target_file)) return;
901
+		if(!checkUploadedFile($target_file)) {
902
+			return;
903
+		}
792 904
 
793 905
 		$oModuleModel = getModel('module');
794 906
 		$config = $oModuleModel->getModuleConfig('member');
795 907
 		// Get an image size
796 908
 		$max_width = $config->image_name_max_width;
797
-		if(!$max_width) $max_width = "90";
909
+		if(!$max_width) {
910
+			$max_width = "90";
911
+		}
798 912
 		$max_height = $config->image_name_max_height;
799
-		if(!$max_height) $max_height = "20";
913
+		if(!$max_height) {
914
+			$max_height = "20";
915
+		}
800 916
 		// Get a target path to save
801 917
 		$target_path = sprintf('files/member_extra_info/image_name/%s/', getNumberingPath($member_srl));
802 918
 		FileHandler::makeDir($target_path);
@@ -805,8 +921,11 @@  discard block
 block discarded – undo
805 921
 		// Get file information
806 922
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
807 923
 		// Convert if the image size is larger than a given size or if the format is not a gif
808
-		if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
809
-		else @copy($target_file, $target_filename);
924
+		if($width > $max_width || $height > $max_height || $type!=1) {
925
+			FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
926
+		} else {
927
+			@copy($target_file, $target_filename);
928
+		}
810 929
 	}
811 930
 
812 931
 	/**
@@ -866,17 +985,25 @@  discard block
 block discarded – undo
866 985
 	{
867 986
 		// Check if the file is successfully uploaded
868 987
 		$file = $_FILES['image_mark'];
869
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark');
988
+		if(!is_uploaded_file($file['tmp_name'])) {
989
+			return $this->stop('msg_not_uploaded_image_mark');
990
+		}
870 991
 		// Ignore if member_srl is invalid or doesn't exist.
871 992
 		$member_srl = Context::get('member_srl');
872
-		if(!$member_srl) return $this->stop('msg_not_uploaded_image_mark');
993
+		if(!$member_srl) {
994
+			return $this->stop('msg_not_uploaded_image_mark');
995
+		}
873 996
 
874 997
 		$logged_info = Context::get('logged_info');
875
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark');
998
+		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) {
999
+			return $this->stop('msg_not_uploaded_image_mark');
1000
+		}
876 1001
 		// Membership in the images mark the module using the ban was set by an administrator or return;
877 1002
 		$oModuleModel = getModel('module');
878 1003
 		$config = $oModuleModel->getModuleConfig('member');
879
-		if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark');
1004
+		if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') {
1005
+			return $this->stop('msg_not_uploaded_image_mark');
1006
+		}
880 1007
 
881 1008
 		$this->insertImageMark($member_srl, $file['tmp_name']);
882 1009
 		// Page refresh
@@ -897,15 +1024,21 @@  discard block
 block discarded – undo
897 1024
 	function insertImageMark($member_srl, $target_file)
898 1025
 	{
899 1026
 		// Check uploaded file
900
-		if(!checkUploadedFile($target_file)) return;
1027
+		if(!checkUploadedFile($target_file)) {
1028
+			return;
1029
+		}
901 1030
 
902 1031
 		$oModuleModel = getModel('module');
903 1032
 		$config = $oModuleModel->getModuleConfig('member');
904 1033
 		// Get an image size
905 1034
 		$max_width = $config->image_mark_max_width;
906
-		if(!$max_width) $max_width = "20";
1035
+		if(!$max_width) {
1036
+			$max_width = "20";
1037
+		}
907 1038
 		$max_height = $config->image_mark_max_height;
908
-		if(!$max_height) $max_height = "20";
1039
+		if(!$max_height) {
1040
+			$max_height = "20";
1041
+		}
909 1042
 
910 1043
 		$target_path = sprintf('files/member_extra_info/image_mark/%s/', getNumberingPath($member_srl));
911 1044
 		FileHandler::makeDir($target_path);
@@ -914,8 +1047,11 @@  discard block
 block discarded – undo
914 1047
 		// Get file information
915 1048
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
916 1049
 
917
-		if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
918
-		else @copy($target_file, $target_filename);
1050
+		if($width > $max_width || $height > $max_height || $type!=1) {
1051
+			FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
1052
+		} else {
1053
+			@copy($target_file, $target_filename);
1054
+		}
919 1055
 	}
920 1056
 
921 1057
 	/**
@@ -950,14 +1086,18 @@  discard block
 block discarded – undo
950 1086
 	function procMemberFindAccount()
951 1087
 	{
952 1088
 		$email_address = Context::get('email_address');
953
-		if(!$email_address) return new Object(-1, 'msg_invalid_request');
1089
+		if(!$email_address) {
1090
+			return new Object(-1, 'msg_invalid_request');
1091
+		}
954 1092
 
955 1093
 		$oMemberModel = getModel('member');
956 1094
 		$oModuleModel = getModel('module');
957 1095
 
958 1096
 		// Check if a member having the same email address exists
959 1097
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
960
-		if(!$member_srl) return new Object(-1, 'msg_email_not_exists');
1098
+		if(!$member_srl) {
1099
+			return new Object(-1, 'msg_email_not_exists');
1100
+		}
961 1101
 
962 1102
 		// Get information of the member
963 1103
 		$columnList = array('denied', 'member_srl', 'user_id', 'user_name', 'email_address', 'nick_name');
@@ -969,7 +1109,9 @@  discard block
 block discarded – undo
969 1109
 			$chk_args = new stdClass;
970 1110
 			$chk_args->member_srl = $member_info->member_srl;
971 1111
 			$output = executeQuery('member.chkAuthMail', $chk_args);
972
-			if($output->toBool() && $output->data->count != '0') return new Object(-1, 'msg_user_not_confirmed');
1112
+			if($output->toBool() && $output->data->count != '0') {
1113
+				return new Object(-1, 'msg_user_not_confirmed');
1114
+			}
973 1115
 		}
974 1116
 
975 1117
 		// Insert data into the authentication DB
@@ -982,7 +1124,9 @@  discard block
 block discarded – undo
982 1124
 		$args->is_register = 'N';
983 1125
 
984 1126
 		$output = executeQuery('member.insertAuthMail', $args);
985
-		if(!$output->toBool()) return $output;
1127
+		if(!$output->toBool()) {
1128
+			return $output;
1129
+		}
986 1130
 		// Get content of the email to send a member
987 1131
 		Context::set('auth_args', $args);
988 1132
 
@@ -999,8 +1143,7 @@  discard block
 block discarded – undo
999 1143
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1000 1144
 				}
1001 1145
 			}
1002
-		}
1003
-		else
1146
+		} else
1004 1147
 		{
1005 1148
 			$memberInfo[$lang->user_id] = $args->user_id;
1006 1149
 			$memberInfo[$lang->user_name] = $args->user_name;
@@ -1009,13 +1152,19 @@  discard block
 block discarded – undo
1009 1152
 		}
1010 1153
 		Context::set('memberInfo', $memberInfo);
1011 1154
 
1012
-		if(!$member_config->skin) $member_config->skin = "default";
1013
-		if(!$member_config->colorset) $member_config->colorset = "white";
1155
+		if(!$member_config->skin) {
1156
+			$member_config->skin = "default";
1157
+		}
1158
+		if(!$member_config->colorset) {
1159
+			$member_config->colorset = "white";
1160
+		}
1014 1161
 
1015 1162
 		Context::set('member_config', $member_config);
1016 1163
 
1017 1164
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1018
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1165
+		if(!is_dir($tpl_path)) {
1166
+			$tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1167
+		}
1019 1168
 
1020 1169
 		$find_url = getFullUrl ('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key);
1021 1170
 		Context::set('find_url', $find_url);
@@ -1057,20 +1206,28 @@  discard block
 block discarded – undo
1057 1206
 		$find_account_question = trim(Context::get('find_account_question'));
1058 1207
 		$find_account_answer = trim(Context::get('find_account_answer'));
1059 1208
 
1060
-		if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new Object(-1, 'msg_invalid_request');
1209
+		if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) {
1210
+			return new Object(-1, 'msg_invalid_request');
1211
+		}
1061 1212
 
1062 1213
 		$oModuleModel = getModel('module');
1063 1214
 		// Check if a member having the same email address exists
1064 1215
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1065
-		if(!$member_srl) return new Object(-1, 'msg_email_not_exists');
1216
+		if(!$member_srl) {
1217
+			return new Object(-1, 'msg_email_not_exists');
1218
+		}
1066 1219
 		// Get information of the member
1067 1220
 		$columnList = array('member_srl', 'find_account_question', 'find_account_answer');
1068 1221
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
1069 1222
 
1070 1223
 		// Display a message if no answer is entered
1071
-		if(!$member_info->find_account_question || !$member_info->find_account_answer) return new Object(-1, 'msg_question_not_exists');
1224
+		if(!$member_info->find_account_question || !$member_info->find_account_answer) {
1225
+			return new Object(-1, 'msg_question_not_exists');
1226
+		}
1072 1227
 
1073
-		if(trim($member_info->find_account_question) != $find_account_question || trim($member_info->find_account_answer) != $find_account_answer) return new Object(-1, 'msg_answer_not_matches');
1228
+		if(trim($member_info->find_account_question) != $find_account_question || trim($member_info->find_account_answer) != $find_account_answer) {
1229
+			return new Object(-1, 'msg_answer_not_matches');
1230
+		}
1074 1231
 
1075 1232
 		if($config->identifier == 'email_address')
1076 1233
 		{
@@ -1086,7 +1243,9 @@  discard block
 block discarded – undo
1086 1243
 		$args->password = $temp_password;
1087 1244
 		$args->change_password_date = '1';
1088 1245
 		$output = $this->updateMemberPassword($args);
1089
-		if(!$output->toBool()) return $output;
1246
+		if(!$output->toBool()) {
1247
+			return $output;
1248
+		}
1090 1249
 
1091 1250
 		$_SESSION['xe_temp_password_' . $user_id] = $temp_password;
1092 1251
 
@@ -1143,8 +1302,7 @@  discard block
 block discarded – undo
1143 1302
 		if($output->data->is_register == 'Y')
1144 1303
 		{
1145 1304
 			$args->denied = 'N';
1146
-		}
1147
-		else
1305
+		} else
1148 1306
 		{
1149 1307
 			$args->password = $oMemberModel->hashPassword($args->password);
1150 1308
 		}
@@ -1178,33 +1336,45 @@  discard block
 block discarded – undo
1178 1336
 	{
1179 1337
 		// Get an email_address
1180 1338
 		$email_address = Context::get('email_address');
1181
-		if(!$email_address) return new Object(-1, 'msg_invalid_request');
1339
+		if(!$email_address) {
1340
+			return new Object(-1, 'msg_invalid_request');
1341
+		}
1182 1342
 		// Log test by using email_address
1183 1343
 		$oMemberModel = getModel('member');
1184 1344
 
1185 1345
 		$args = new stdClass;
1186 1346
 		$args->email_address = $email_address;
1187 1347
 		$memberSrl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1188
-		if(!$memberSrl) return new Object(-1, 'msg_not_exists_member');
1348
+		if(!$memberSrl) {
1349
+			return new Object(-1, 'msg_not_exists_member');
1350
+		}
1189 1351
 
1190 1352
 		$columnList = array('member_srl', 'user_id', 'user_name', 'nick_name', 'email_address');
1191 1353
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($memberSrl, 0, $columnList);
1192 1354
 
1193 1355
 		$oModuleModel = getModel('module');
1194 1356
 		$member_config = $oModuleModel->getModuleConfig('member');
1195
-		if(!$member_config->skin) $member_config->skin = "default";
1196
-		if(!$member_config->colorset) $member_config->colorset = "white";
1357
+		if(!$member_config->skin) {
1358
+			$member_config->skin = "default";
1359
+		}
1360
+		if(!$member_config->colorset) {
1361
+			$member_config->colorset = "white";
1362
+		}
1197 1363
 
1198 1364
 		// Check if a authentication mail has been sent previously
1199 1365
 		$chk_args = new stdClass;
1200 1366
 		$chk_args->member_srl = $member_info->member_srl;
1201 1367
 		$output = executeQuery('member.chkAuthMail', $chk_args);
1202
-		if($output->toBool() && $output->data->count == '0') return new Object(-1, 'msg_invalid_request');
1368
+		if($output->toBool() && $output->data->count == '0') {
1369
+			return new Object(-1, 'msg_invalid_request');
1370
+		}
1203 1371
 
1204 1372
 		$auth_args = new stdClass;
1205 1373
 		$auth_args->member_srl = $member_info->member_srl;
1206 1374
 		$output = executeQueryArray('member.getAuthMailInfo', $auth_args);
1207
-		if(!$output->data || !$output->data[0]->auth_key)  return new Object(-1, 'msg_invalid_request');
1375
+		if(!$output->data || !$output->data[0]->auth_key) {
1376
+			return new Object(-1, 'msg_invalid_request');
1377
+		}
1208 1378
 		$auth_info = $output->data[0];
1209 1379
 
1210 1380
 		// Update the regdate of authmail entry
@@ -1225,8 +1395,7 @@  discard block
 block discarded – undo
1225 1395
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1226 1396
 				}
1227 1397
 			}
1228
-		}
1229
-		else
1398
+		} else
1230 1399
 		{
1231 1400
 			$memberInfo[$lang->user_id] = $member_info->user_id;
1232 1401
 			$memberInfo[$lang->user_name] = $member_info->user_name;
@@ -1239,7 +1408,9 @@  discard block
 block discarded – undo
1239 1408
 		Context::set('member_config', $member_config);
1240 1409
 
1241 1410
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1242
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1411
+		if(!is_dir($tpl_path)) {
1412
+			$tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1413
+		}
1243 1414
 
1244 1415
 		$auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_info->auth_key);
1245 1416
 		Context::set('auth_url', $auth_url);
@@ -1317,7 +1488,9 @@  discard block
 block discarded – undo
1317 1488
 		$auth_args->is_register = 'Y';
1318 1489
 
1319 1490
 		$output = executeQuery('member.insertAuthMail', $auth_args);
1320
-		if(!$output->toBool()) return $output;
1491
+		if(!$output->toBool()) {
1492
+			return $output;
1493
+		}
1321 1494
 
1322 1495
 		$memberInfo->email_address = $newEmail;
1323 1496
 
@@ -1351,8 +1524,7 @@  discard block
 block discarded – undo
1351 1524
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1352 1525
 				}
1353 1526
 			}
1354
-		}
1355
-		else
1527
+		} else
1356 1528
 		{
1357 1529
 			$memberInfo[$lang->user_id] = $member_info->user_id;
1358 1530
 			$memberInfo[$lang->user_name] = $member_info->user_name;
@@ -1361,13 +1533,19 @@  discard block
 block discarded – undo
1361 1533
 		}
1362 1534
 		Context::set('memberInfo', $memberInfo);
1363 1535
 
1364
-		if(!$member_config->skin) $member_config->skin = "default";
1365
-		if(!$member_config->colorset) $member_config->colorset = "white";
1536
+		if(!$member_config->skin) {
1537
+			$member_config->skin = "default";
1538
+		}
1539
+		if(!$member_config->colorset) {
1540
+			$member_config->colorset = "white";
1541
+		}
1366 1542
 
1367 1543
 		Context::set('member_config', $member_config);
1368 1544
 
1369 1545
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1370
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1546
+		if(!is_dir($tpl_path)) {
1547
+			$tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1548
+		}
1371 1549
 
1372 1550
 		$auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key);
1373 1551
 		Context::set('auth_url', $auth_url);
@@ -1392,7 +1570,9 @@  discard block
 block discarded – undo
1392 1570
 	{
1393 1571
 		$site_module_info = Context::get('site_module_info');
1394 1572
 		$logged_info = Context::get('logged_info');
1395
-		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new Object(-1,'msg_invalid_request');
1573
+		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) {
1574
+			return new Object(-1,'msg_invalid_request');
1575
+		}
1396 1576
 
1397 1577
 		$oMemberModel = getModel('member');
1398 1578
 		$columnList = array('site_srl', 'group_srl', 'title');
@@ -1411,13 +1591,17 @@  discard block
 block discarded – undo
1411 1591
 	{
1412 1592
 		$site_module_info = Context::get('site_module_info');
1413 1593
 		$logged_info = Context::get('logged_info');
1414
-		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new Object(-1,'msg_invalid_request');
1594
+		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) {
1595
+			return new Object(-1,'msg_invalid_request');
1596
+		}
1415 1597
 
1416 1598
 		$args = new stdClass;
1417 1599
 		$args->site_srl= $site_module_info->site_srl;
1418 1600
 		$args->member_srl = $logged_info->member_srl;
1419 1601
 		$output = executeQuery('member.deleteMembersGroup', $args);
1420
-		if(!$output->toBool()) return $output;
1602
+		if(!$output->toBool()) {
1603
+			return $output;
1604
+		}
1421 1605
 		$this->setMessage('success_deleted');
1422 1606
 		$this->_clearMemberCache($args->member_srl, $site_module_info->site_srl);
1423 1607
 	}
@@ -1431,17 +1615,37 @@  discard block
 block discarded – undo
1431 1615
 	 */
1432 1616
 	function setMemberConfig($args)
1433 1617
 	{
1434
-		if(!$args->skin) $args->skin = "default";
1435
-		if(!$args->colorset) $args->colorset = "white";
1436
-		if(!$args->editor_skin) $args->editor_skin= "ckeditor";
1437
-		if(!$args->editor_colorset) $args->editor_colorset = "moono";
1438
-		if($args->enable_join!='Y') $args->enable_join = 'N';
1618
+		if(!$args->skin) {
1619
+			$args->skin = "default";
1620
+		}
1621
+		if(!$args->colorset) {
1622
+			$args->colorset = "white";
1623
+		}
1624
+		if(!$args->editor_skin) {
1625
+			$args->editor_skin= "ckeditor";
1626
+		}
1627
+		if(!$args->editor_colorset) {
1628
+			$args->editor_colorset = "moono";
1629
+		}
1630
+		if($args->enable_join!='Y') {
1631
+			$args->enable_join = 'N';
1632
+		}
1439 1633
 		$args->enable_openid= 'N';
1440
-		if($args->profile_image !='Y') $args->profile_image = 'N';
1441
-		if($args->image_name!='Y') $args->image_name = 'N';
1442
-		if($args->image_mark!='Y') $args->image_mark = 'N';
1443
-		if($args->group_image_mark!='Y') $args->group_image_mark = 'N';
1444
-		if(!trim(strip_tags($args->agreement))) $args->agreement = null;
1634
+		if($args->profile_image !='Y') {
1635
+			$args->profile_image = 'N';
1636
+		}
1637
+		if($args->image_name!='Y') {
1638
+			$args->image_name = 'N';
1639
+		}
1640
+		if($args->image_mark!='Y') {
1641
+			$args->image_mark = 'N';
1642
+		}
1643
+		if($args->group_image_mark!='Y') {
1644
+			$args->group_image_mark = 'N';
1645
+		}
1646
+		if(!trim(strip_tags($args->agreement))) {
1647
+			$args->agreement = null;
1648
+		}
1445 1649
 		$args->limit_day = (int)$args->limit_day;
1446 1650
 
1447 1651
 		$agreement = trim($args->agreement);
@@ -1449,7 +1653,9 @@  discard block
 block discarded – undo
1449 1653
 
1450 1654
 		$oModuleController = getController('module');
1451 1655
 		$output = $oModuleController->insertModuleConfig('member',$args);
1452
-		if(!$output->toBool()) return $output;
1656
+		if(!$output->toBool()) {
1657
+			return $output;
1658
+		}
1453 1659
 
1454 1660
 		$agreement_file = _XE_PATH_.'files/member_extra_info/agreement.txt';
1455 1661
 		FileHandler::writeFile($agreement_file, $agreement);
@@ -1474,7 +1680,9 @@  discard block
 block discarded – undo
1474 1680
 		$path = sprintf('files/member_extra_info/signature/%s/', getNumberingPath($member_srl));
1475 1681
 		$filename = sprintf('%s%d.signature.php', $path, $member_srl);
1476 1682
 
1477
-		if(!$check_signature) return FileHandler::removeFile($filename);
1683
+		if(!$check_signature) {
1684
+			return FileHandler::removeFile($filename);
1685
+		}
1478 1686
 
1479 1687
 		$buff = sprintf('<?php if(!defined("__XE__")) exit();?>%s', $signature);
1480 1688
 		FileHandler::makeDir($path);
@@ -1508,7 +1716,9 @@  discard block
 block discarded – undo
1508 1716
 		$args = new stdClass();
1509 1717
 		$args->member_srl = $member_srl;
1510 1718
 		$args->group_srl = $group_srl;
1511
-		if($site_srl) $args->site_srl = $site_srl;
1719
+		if($site_srl) {
1720
+			$args->site_srl = $site_srl;
1721
+		}
1512 1722
 
1513 1723
 		// Add
1514 1724
 		$output = executeQuery('member.addMemberToGroup',$args);
@@ -1534,15 +1744,21 @@  discard block
 block discarded – undo
1534 1744
 		$obj->member_srl = implode(',',$args->member_srl);
1535 1745
 
1536 1746
 		$output = executeQueryArray('member.getMembersGroup', $obj);
1537
-		if($output->data) foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate;
1747
+		if($output->data) {
1748
+			foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate;
1749
+		}
1538 1750
 
1539 1751
 		$output = executeQuery('member.deleteMembersGroup', $obj);
1540
-		if(!$output->toBool()) return $output;
1752
+		if(!$output->toBool()) {
1753
+			return $output;
1754
+		}
1541 1755
 
1542 1756
 		$inserted_members = array();
1543 1757
 		foreach($args->member_srl as $key => $val)
1544 1758
 		{
1545
-			if($inserted_members[$val]) continue;
1759
+			if($inserted_members[$val]) {
1760
+				continue;
1761
+			}
1546 1762
 			$inserted_members[$val] = true;
1547 1763
 
1548 1764
 			unset($obj);
@@ -1552,7 +1768,9 @@  discard block
 block discarded – undo
1552 1768
 			$obj->site_srl = $args->site_srl;
1553 1769
 			$obj->regdate = $date[$obj->member_srl];
1554 1770
 			$output = executeQuery('member.addMemberToGroup', $obj);
1555
-			if(!$output->toBool()) return $output;
1771
+			if(!$output->toBool()) {
1772
+				return $output;
1773
+			}
1556 1774
 
1557 1775
 			$this->_clearMemberCache($obj->member_srl, $args->site_srl);
1558 1776
 		}
@@ -1614,8 +1832,7 @@  discard block
 block discarded – undo
1614 1832
 				if($config->identifier == 'user_id')
1615 1833
 				{
1616 1834
 					$member_info = $oMemberModel->getMemberInfoByUserID($user_id, $columnList);
1617
-				}
1618
-				else
1835
+				} else
1619 1836
 				{
1620 1837
 					$member_info = $oMemberModel->getMemberInfoByEmailAddress($user_id, $columnList);
1621 1838
 				}
@@ -1624,8 +1841,7 @@  discard block
 block discarded – undo
1624 1841
 					$do_auto_login = true;
1625 1842
 				}
1626 1843
 
1627
-			}
1628
-			else
1844
+			} else
1629 1845
 			{
1630 1846
 				$do_auto_login = true;
1631 1847
 			}
@@ -1634,8 +1850,7 @@  discard block
 block discarded – undo
1634 1850
 		if($do_auto_login)
1635 1851
 		{
1636 1852
 			$output = $this->doLogin($user_id);
1637
-		}
1638
-		else
1853
+		} else
1639 1854
 		{
1640 1855
 			executeQuery('member.deleteAutologin', $args);
1641 1856
 			setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365, '/');
@@ -1654,13 +1869,17 @@  discard block
 block discarded – undo
1654 1869
 	function doLogin($user_id, $password = '', $keep_signed = false)
1655 1870
 	{
1656 1871
 		$user_id = strtolower($user_id);
1657
-		if(!$user_id) return new Object(-1, 'null_user_id');
1872
+		if(!$user_id) {
1873
+			return new Object(-1, 'null_user_id');
1874
+		}
1658 1875
 		// Call a trigger before log-in (before)
1659 1876
 		$trigger_obj = new stdClass();
1660 1877
 		$trigger_obj->user_id = $user_id;
1661 1878
 		$trigger_obj->password = $password;
1662 1879
 		$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'before', $trigger_obj);
1663
-		if(!$trigger_output->toBool()) return $trigger_output;
1880
+		if(!$trigger_output->toBool()) {
1881
+			return $trigger_output;
1882
+		}
1664 1883
 		// Create a member model object
1665 1884
 		$oMemberModel = getModel('member');
1666 1885
 
@@ -1675,15 +1894,18 @@  discard block
 block discarded – undo
1675 1894
 			// Get user_id information
1676 1895
 			$this->memberInfo = $oMemberModel->getMemberInfoByEmailAddress($user_id);
1677 1896
 			// Set an invalid user if no value returned
1678
-			if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address');
1897
+			if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) {
1898
+				return $this->recordLoginError(-1, 'invalid_email_address');
1899
+			}
1679 1900
 
1680
-		}
1681
-		else
1901
+		} else
1682 1902
 		{
1683 1903
 			// Get user_id information
1684 1904
 			$this->memberInfo = $oMemberModel->getMemberInfoByUserID($user_id);
1685 1905
 			// Set an invalid user if no value returned
1686
-			if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id');
1906
+			if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) {
1907
+				return $this->recordLoginError(-1, 'invalid_user_id');
1908
+			}
1687 1909
 		}
1688 1910
 
1689 1911
 		$output = executeQuery('member.getLoginCountByIp', $args);
@@ -1695,14 +1917,18 @@  discard block
 block discarded – undo
1695 1917
 			if($term < $config->max_error_count_time)
1696 1918
 			{
1697 1919
 				$term = $config->max_error_count_time - $term;
1698
-				if($term < 60) $term = intval($term).Context::getLang('unit_sec');
1699
-				elseif(60 <= $term && $term < 3600) $term = intval($term/60).Context::getLang('unit_min');
1700
-				elseif(3600 <= $term && $term < 86400) $term = intval($term/3600).Context::getLang('unit_hour');
1701
-				else $term = intval($term/86400).Context::getLang('unit_day');
1920
+				if($term < 60) {
1921
+					$term = intval($term).Context::getLang('unit_sec');
1922
+				} elseif(60 <= $term && $term < 3600) {
1923
+					$term = intval($term/60).Context::getLang('unit_min');
1924
+				} elseif(3600 <= $term && $term < 86400) {
1925
+					$term = intval($term/3600).Context::getLang('unit_hour');
1926
+				} else {
1927
+					$term = intval($term/86400).Context::getLang('unit_day');
1928
+				}
1702 1929
 
1703 1930
 				return new Object(-1, sprintf(Context::getLang('excess_ip_access_count'),$term));
1704
-			}
1705
-			else
1931
+			} else
1706 1932
 			{
1707 1933
 				$args->ipaddress = $_SERVER['REMOTE_ADDR'];
1708 1934
 				$output = executeQuery('member.deleteLoginCountByIp', $args);
@@ -1729,7 +1955,9 @@  discard block
 block discarded – undo
1729 1955
 			return new Object(-1,'msg_user_denied');
1730 1956
 		}
1731 1957
 		// Notify if denied_date is less than the current time
1732
-		if($this->memberInfo->limit_date && substr($this->memberInfo->limit_date,0,8) >= date("Ymd")) return new Object(-9,sprintf(Context::getLang('msg_user_limited'),zdate($this->memberInfo->limit_date,"Y-m-d")));
1958
+		if($this->memberInfo->limit_date && substr($this->memberInfo->limit_date,0,8) >= date("Ymd")) {
1959
+			return new Object(-9,sprintf(Context::getLang('msg_user_limited'),zdate($this->memberInfo->limit_date,"Y-m-d")));
1960
+		}
1733 1961
 		// Update the latest login time
1734 1962
 		$args->member_srl = $this->memberInfo->member_srl;
1735 1963
 		$output = executeQuery('member.updateLastLogin', $args);
@@ -1778,7 +2006,9 @@  discard block
 block discarded – undo
1778 2006
 		}
1779 2007
 		// Call a trigger after successfully log-in (after)
1780 2008
 		$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'after', $this->memberInfo);
1781
-		if(!$trigger_output->toBool()) return $trigger_output;
2009
+		if(!$trigger_output->toBool()) {
2010
+			return $trigger_output;
2011
+		}
1782 2012
 		// When user checked to use auto-login
1783 2013
 		if($keep_signed)
1784 2014
 		{
@@ -1792,7 +2022,9 @@  discard block
 block discarded – undo
1792 2022
 			$autologin_args->member_srl = $this->memberInfo->member_srl;
1793 2023
 			executeQuery('member.deleteAutologin', $autologin_args);
1794 2024
 			$autologin_output = executeQuery('member.insertAutologin', $autologin_args);
1795
-			if($autologin_output->toBool()) setCookie('xeak',$autologin_args->autologin_key, $_SERVER['REQUEST_TIME']+31536000, '/');
2025
+			if($autologin_output->toBool()) {
2026
+				setCookie('xeak',$autologin_args->autologin_key, $_SERVER['REQUEST_TIME']+31536000, '/');
2027
+			}
1796 2028
 		}
1797 2029
 		if($this->memberInfo->is_admin == 'Y')
1798 2030
 		{
@@ -1881,7 +2113,9 @@  discard block
 block discarded – undo
1881 2113
 	function addMemberPopupMenu($url, $str, $icon = '', $target = 'self')
1882 2114
 	{
1883 2115
 		$member_popup_menu_list = Context::get('member_popup_menu_list');
1884
-		if(!is_array($member_popup_menu_list)) $member_popup_menu_list = array();
2116
+		if(!is_array($member_popup_menu_list)) {
2117
+			$member_popup_menu_list = array();
2118
+		}
1885 2119
 
1886 2120
 		$obj = new stdClass;
1887 2121
 		$obj->url = $url;
@@ -1900,35 +2134,54 @@  discard block
 block discarded – undo
1900 2134
 	{
1901 2135
 		// Call a trigger (before)
1902 2136
 		$output = ModuleHandler::triggerCall('member.insertMember', 'before', $args);
1903
-		if(!$output->toBool()) return $output;
2137
+		if(!$output->toBool()) {
2138
+			return $output;
2139
+		}
1904 2140
 		// Terms and Conditions portion of the information set up by members reaffirmed
1905 2141
 		$oModuleModel = getModel('module');
1906 2142
 		$config = $oModuleModel->getModuleConfig('member');
1907 2143
 
1908 2144
 		$logged_info = Context::get('logged_info');
1909 2145
 		// If the date of the temporary restrictions limit further information on the date of
1910
-		if($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24);
2146
+		if($config->limit_day) {
2147
+			$args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24);
2148
+		}
1911 2149
 
1912 2150
 		$args->member_srl = getNextSequence();
1913 2151
 		$args->list_order = -1 * $args->member_srl;
1914 2152
 
1915 2153
 		// Execute insert or update depending on the value of member_srl
1916
-		if(!$args->user_id) $args->user_id = 't'.$args->member_srl;
2154
+		if(!$args->user_id) {
2155
+			$args->user_id = 't'.$args->member_srl;
2156
+		}
1917 2157
 		// Enter the user's identity changed to lowercase
1918
-		else $args->user_id = strtolower($args->user_id);
1919
-		if(!$args->user_name) $args->user_name = $args->member_srl;
1920
-		if(!$args->nick_name) $args->nick_name = $args->member_srl;
2158
+		else {
2159
+			$args->user_id = strtolower($args->user_id);
2160
+		}
2161
+		if(!$args->user_name) {
2162
+			$args->user_name = $args->member_srl;
2163
+		}
2164
+		if(!$args->nick_name) {
2165
+			$args->nick_name = $args->member_srl;
2166
+		}
1921 2167
 
1922 2168
 		// Control of essential parameters
1923
-		if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
1924
-		if($args->denied!='Y') $args->denied = 'N';
1925
-		if(!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y','N','F')))) $args->allow_message = 'Y';
2169
+		if($args->allow_mailing!='Y') {
2170
+			$args->allow_mailing = 'N';
2171
+		}
2172
+		if($args->denied!='Y') {
2173
+			$args->denied = 'N';
2174
+		}
2175
+		if(!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y','N','F')))) {
2176
+			$args->allow_message = 'Y';
2177
+		}
1926 2178
 
1927 2179
 		if($logged_info->is_admin == 'Y')
1928 2180
 		{
1929
-			if($args->is_admin!='Y') $args->is_admin = 'N';
1930
-		}
1931
-		else
2181
+			if($args->is_admin!='Y') {
2182
+				$args->is_admin = 'N';
2183
+			}
2184
+		} else
1932 2185
 		{
1933 2186
 			unset($args->is_admin);
1934 2187
 		}
@@ -1941,8 +2194,12 @@  discard block
 block discarded – undo
1941 2194
 		$args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
1942 2195
 		$args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
1943 2196
 		$args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
1944
-		if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
1945
-		if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) $args->blog = 'http://'.$args->blog;
2197
+		if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) {
2198
+			$args->homepage = 'http://'.$args->homepage;
2199
+		}
2200
+		if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) {
2201
+			$args->blog = 'http://'.$args->blog;
2202
+		}
1946 2203
 
1947 2204
 		// Create a model object
1948 2205
 		$oMemberModel = getModel('member');
@@ -1956,8 +2213,7 @@  discard block
 block discarded – undo
1956 2213
 				return new Object(-1, $message[$config->password_strength]);
1957 2214
 			}
1958 2215
 			$args->password = $oMemberModel->hashPassword($args->password);
1959
-		}
1960
-		elseif(!$args->password)
2216
+		} elseif(!$args->password)
1961 2217
 		{
1962 2218
 			unset($args->password);
1963 2219
 		}
@@ -1998,8 +2254,12 @@  discard block
 block discarded – undo
1998 2254
 		// Insert data into the DB
1999 2255
 		$args->list_order = -1 * $args->member_srl;
2000 2256
 
2001
-		if(!$args->user_id) $args->user_id = 't'.$args->member_srl;
2002
-		if(!$args->user_name) $args->user_name = $args->member_srl;
2257
+		if(!$args->user_id) {
2258
+			$args->user_id = 't'.$args->member_srl;
2259
+		}
2260
+		if(!$args->user_name) {
2261
+			$args->user_name = $args->member_srl;
2262
+		}
2003 2263
 
2004 2264
 		$oDB = &DB::getInstance();
2005 2265
 		$oDB->begin();
@@ -2011,8 +2271,11 @@  discard block
 block discarded – undo
2011 2271
 			return $output;
2012 2272
 		}
2013 2273
 
2014
-		if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2015
-		else $group_srl_list = explode('|@|', $args->group_srl_list);
2274
+		if(is_array($args->group_srl_list)) {
2275
+			$group_srl_list = $args->group_srl_list;
2276
+		} else {
2277
+			$group_srl_list = explode('|@|', $args->group_srl_list);
2278
+		}
2016 2279
 		// If no value is entered the default group, the value of group registration
2017 2280
 		if(!$args->group_srl_list)
2018 2281
 		{
@@ -2029,8 +2292,7 @@  discard block
 block discarded – undo
2029 2292
 				}
2030 2293
 			}
2031 2294
 			// If the value is the value of the group entered the group registration
2032
-		}
2033
-		else
2295
+		} else
2034 2296
 		{
2035 2297
 			for($i=0;$i<count($group_srl_list);$i++)
2036 2298
 			{
@@ -2091,27 +2353,39 @@  discard block
 block discarded – undo
2091 2353
 	{
2092 2354
 		// Call a trigger (before)
2093 2355
 		$output = ModuleHandler::triggerCall('member.updateMember', 'before', $args);
2094
-		if(!$output->toBool()) return $output;
2356
+		if(!$output->toBool()) {
2357
+			return $output;
2358
+		}
2095 2359
 		// Create a model object
2096 2360
 		$oMemberModel = getModel('member');
2097 2361
 
2098 2362
 		$logged_info = Context::get('logged_info');
2099 2363
 		// Get what you want to modify the original information
2100
-		if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2364
+		if(!$this->memberInfo) {
2365
+			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2366
+		}
2101 2367
 		// Control of essential parameters
2102
-		if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
2103
-		if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) $args->allow_message = 'Y';
2368
+		if($args->allow_mailing!='Y') {
2369
+			$args->allow_mailing = 'N';
2370
+		}
2371
+		if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) {
2372
+			$args->allow_message = 'Y';
2373
+		}
2104 2374
 
2105 2375
 		if($logged_info->is_admin == 'Y')
2106 2376
 		{
2107
-			if($args->denied!='Y') $args->denied = 'N';
2108
-			if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N';
2109
-		}
2110
-		else
2377
+			if($args->denied!='Y') {
2378
+				$args->denied = 'N';
2379
+			}
2380
+			if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) {
2381
+				$args->is_admin = 'N';
2382
+			}
2383
+		} else
2111 2384
 		{
2112 2385
 			unset($args->is_admin);
2113
-			if($is_admin == false)
2114
-				unset($args->denied);
2386
+			if($is_admin == false) {
2387
+							unset($args->denied);
2388
+			}
2115 2389
 			if($logged_info->member_srl != $args->member_srl && $is_admin == false)
2116 2390
 			{
2117 2391
 				return $this->stop('msg_invalid_request');
@@ -2119,13 +2393,19 @@  discard block
 block discarded – undo
2119 2393
 		}
2120 2394
 
2121 2395
 		// Sanitize user ID, username, nickname, homepage, blog
2122
-		if($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2396
+		if($args->user_id) {
2397
+			$args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2398
+		}
2123 2399
 		$args->user_name = htmlspecialchars($args->user_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2124 2400
 		$args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2125 2401
 		$args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2126 2402
 		$args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2127
-		if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
2128
-		if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) $args->blog = 'http://'.$args->blog;
2403
+		if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) {
2404
+			$args->homepage = 'http://'.$args->homepage;
2405
+		}
2406
+		if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) {
2407
+			$args->blog = 'http://'.$args->blog;
2408
+		}
2129 2409
 
2130 2410
 		// check member identifier form
2131 2411
 		$config = $oMemberModel->getMemberConfig();
@@ -2142,8 +2422,7 @@  discard block
 block discarded – undo
2142 2422
 				return new Object(-1,'msg_exists_email_address');
2143 2423
 			}
2144 2424
 			$args->email_address = $orgMemberInfo->email_address;
2145
-		}
2146
-		else
2425
+		} else
2147 2426
 		{
2148 2427
 			$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
2149 2428
 			if($member_srl && $args->member_srl != $member_srl)
@@ -2200,17 +2479,26 @@  discard block
 block discarded – undo
2200 2479
 				return new Object(-1, $message[$config->password_strength]);
2201 2480
 			}
2202 2481
 			$args->password = $oMemberModel->hashPassword($args->password);
2203
-		}
2204
-		else
2482
+		} else
2205 2483
 		{
2206 2484
 			$args->password = $orgMemberInfo->password;
2207 2485
 		}
2208 2486
 
2209
-		if(!$args->user_name) $args->user_name = $orgMemberInfo->user_name;
2210
-		if(!$args->user_id) $args->user_id = $orgMemberInfo->user_id;
2211
-		if(!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name;
2212
-		if(!$args->description) $args->description = $orgMemberInfo->description;
2213
-		if(!$args->birthday) $args->birthday = '';
2487
+		if(!$args->user_name) {
2488
+			$args->user_name = $orgMemberInfo->user_name;
2489
+		}
2490
+		if(!$args->user_id) {
2491
+			$args->user_id = $orgMemberInfo->user_id;
2492
+		}
2493
+		if(!$args->nick_name) {
2494
+			$args->nick_name = $orgMemberInfo->nick_name;
2495
+		}
2496
+		if(!$args->description) {
2497
+			$args->description = $orgMemberInfo->description;
2498
+		}
2499
+		if(!$args->birthday) {
2500
+			$args->birthday = '';
2501
+		}
2214 2502
 
2215 2503
 		$output = executeQuery('member.updateMember', $args);
2216 2504
 
@@ -2222,8 +2510,11 @@  discard block
 block discarded – undo
2222 2510
 
2223 2511
 		if($args->group_srl_list)
2224 2512
 		{
2225
-			if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2226
-			else $group_srl_list = explode('|@|', $args->group_srl_list);
2513
+			if(is_array($args->group_srl_list)) {
2514
+				$group_srl_list = $args->group_srl_list;
2515
+			} else {
2516
+				$group_srl_list = explode('|@|', $args->group_srl_list);
2517
+			}
2227 2518
 			// If the group information, group information changes
2228 2519
 			if(count($group_srl_list) > 0)
2229 2520
 			{
@@ -2266,7 +2557,9 @@  discard block
 block discarded – undo
2266 2557
 		$this->_clearMemberCache($args->member_srl, $args->site_srl);
2267 2558
 
2268 2559
 		// Save Session
2269
-		if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2560
+		if(!$this->memberInfo) {
2561
+			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2562
+		}
2270 2563
 		$logged_info = Context::get('logged_info');
2271 2564
 
2272 2565
 		$output->add('member_srl', $args->member_srl);
@@ -2292,8 +2585,7 @@  discard block
 block discarded – undo
2292 2585
 			}
2293 2586
 
2294 2587
 			$args->password = $oMemberModel->hashPassword($args->password);
2295
-		}
2296
-		else if($args->hashed_password)
2588
+		} else if($args->hashed_password)
2297 2589
 		{
2298 2590
 			$args->password = $args->hashed_password;
2299 2591
 		}
@@ -2318,7 +2610,9 @@  discard block
 block discarded – undo
2318 2610
 		$trigger_obj = new stdClass();
2319 2611
 		$trigger_obj->member_srl = $member_srl;
2320 2612
 		$output = ModuleHandler::triggerCall('member.deleteMember', 'before', $trigger_obj);
2321
-		if(!$output->toBool()) return $output;
2613
+		if(!$output->toBool()) {
2614
+			return $output;
2615
+		}
2322 2616
 		// Create a model object
2323 2617
 		$oMemberModel = getModel('member');
2324 2618
 		// Bringing the user's information
@@ -2327,9 +2621,13 @@  discard block
 block discarded – undo
2327 2621
 			$columnList = array('member_srl', 'is_admin');
2328 2622
 			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
2329 2623
 		}
2330
-		if(!$this->memberInfo) return new Object(-1, 'msg_not_exists_member');
2624
+		if(!$this->memberInfo) {
2625
+			return new Object(-1, 'msg_not_exists_member');
2626
+		}
2331 2627
 		// If managers can not be deleted
2332
-		if($this->memberInfo->is_admin == 'Y') return new Object(-1, 'msg_cannot_delete_admin');
2628
+		if($this->memberInfo->is_admin == 'Y') {
2629
+			return new Object(-1, 'msg_cannot_delete_admin');
2630
+		}
2333 2631
 
2334 2632
 		$oDB = &DB::getInstance();
2335 2633
 		$oDB->begin();
@@ -2393,7 +2691,9 @@  discard block
 block discarded – undo
2393 2691
 	 */
2394 2692
 	function destroySessionInfo()
2395 2693
 	{
2396
-		if(!$_SESSION || !is_array($_SESSION)) return;
2694
+		if(!$_SESSION || !is_array($_SESSION)) {
2695
+			return;
2696
+		}
2397 2697
 
2398 2698
 		$memberInfo = Context::get('logged_info');
2399 2699
 		$memberSrl = $memberInfo->member_srl;
@@ -2432,8 +2732,9 @@  discard block
 block discarded – undo
2432 2732
 		}
2433 2733
 		$maxLevel = 0;
2434 2734
 		$resultGroup = array_intersect($levelGroup, $groupSrlList);
2435
-		if(count($resultGroup) > 0)
2436
-			$maxLevel = max(array_flip($resultGroup));
2735
+		if(count($resultGroup) > 0) {
2736
+					$maxLevel = max(array_flip($resultGroup));
2737
+		}
2437 2738
 
2438 2739
 		if($maxLevel > 0)
2439 2740
 		{
@@ -2450,16 +2751,22 @@  discard block
 block discarded – undo
2450 2751
 
2451 2752
 	function procMemberModifyEmailAddress()
2452 2753
 	{
2453
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
2754
+		if(!Context::get('is_logged')) {
2755
+			return $this->stop('msg_not_logged');
2756
+		}
2454 2757
 
2455 2758
 		$member_info = Context::get('logged_info');
2456 2759
 		$newEmail = Context::get('email_address');
2457 2760
 
2458
-		if(!$newEmail) return $this->stop('msg_invalid_request');
2761
+		if(!$newEmail) {
2762
+			return $this->stop('msg_invalid_request');
2763
+		}
2459 2764
 
2460 2765
 		$oMemberModel = getModel('member');
2461 2766
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail);
2462
-		if($member_srl) return new Object(-1,'msg_exists_email_address');
2767
+		if($member_srl) {
2768
+			return new Object(-1,'msg_exists_email_address');
2769
+		}
2463 2770
 
2464 2771
 		if($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
2465 2772
 		{
@@ -2487,7 +2794,9 @@  discard block
 block discarded – undo
2487 2794
 		$member_config = $oModuleModel->getModuleConfig('member');
2488 2795
 
2489 2796
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
2490
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
2797
+		if(!is_dir($tpl_path)) {
2798
+			$tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
2799
+		}
2491 2800
 
2492 2801
 		global $lang;
2493 2802
 
@@ -2523,7 +2832,9 @@  discard block
 block discarded – undo
2523 2832
 	{
2524 2833
 		$member_srl = Context::get('member_srl');
2525 2834
 		$auth_key = Context::get('auth_key');
2526
-		if(!$member_srl || !$auth_key) return $this->stop('msg_invalid_request');
2835
+		if(!$member_srl || !$auth_key) {
2836
+			return $this->stop('msg_invalid_request');
2837
+		}
2527 2838
 
2528 2839
 		// Test logs for finding password by user_id and authkey
2529 2840
 		$args = new stdClass;
@@ -2532,7 +2843,9 @@  discard block
 block discarded – undo
2532 2843
 		$output = executeQuery('member.getAuthMail', $args);
2533 2844
 		if(!$output->toBool() || $output->data->auth_key != $auth_key)
2534 2845
 		{
2535
-			if(strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args);
2846
+			if(strlen($output->data->auth_key) !== strlen($auth_key)) {
2847
+				executeQuery('member.deleteAuthChangeEmailAddress', $args);
2848
+			}
2536 2849
 			return $this->stop('msg_invalid_modify_email_auth_key');
2537 2850
 		}
2538 2851
 
@@ -2541,7 +2854,9 @@  discard block
 block discarded – undo
2541 2854
 		list($args->email_id, $args->email_host) = explode('@', $newEmail);
2542 2855
 
2543 2856
 		$output = executeQuery('member.updateMemberEmailAddress', $args);
2544
-		if(!$output->toBool()) return $this->stop($output->getMessage());
2857
+		if(!$output->toBool()) {
2858
+			return $this->stop($output->getMessage());
2859
+		}
2545 2860
 
2546 2861
 		// Remove all values having the member_srl and new_password equal to 'XE_change_emaill_address' from authentication table
2547 2862
 		executeQuery('member.deleteAuthChangeEmailAddress',$args);
@@ -2562,7 +2877,9 @@  discard block
 block discarded – undo
2562 2877
 	**/
2563 2878
 	function triggerGetDocumentMenu(&$menu_list)
2564 2879
 	{
2565
-		if(!Context::get('is_logged')) return new Object();
2880
+		if(!Context::get('is_logged')) {
2881
+			return new Object();
2882
+		}
2566 2883
 
2567 2884
 		$logged_info = Context::get('logged_info');
2568 2885
 		$document_srl = Context::get('target_srl');
@@ -2573,8 +2890,12 @@  discard block
 block discarded – undo
2573 2890
 		$member_srl = $oDocument->get('member_srl');
2574 2891
 		$module_srl = $oDocument->get('module_srl');
2575 2892
 
2576
-		if(!$member_srl) return new Object();
2577
-		if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new Object();
2893
+		if(!$member_srl) {
2894
+			return new Object();
2895
+		}
2896
+		if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) {
2897
+			return new Object();
2898
+		}
2578 2899
 
2579 2900
 		$oDocumentController = getController('document');
2580 2901
 		$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
@@ -2592,7 +2913,9 @@  discard block
 block discarded – undo
2592 2913
 	**/
2593 2914
 	function triggerGetCommentMenu(&$menu_list)
2594 2915
 	{
2595
-		if(!Context::get('is_logged')) return new Object();
2916
+		if(!Context::get('is_logged')) {
2917
+			return new Object();
2918
+		}
2596 2919
 
2597 2920
 		$logged_info = Context::get('logged_info');
2598 2921
 		$comment_srl = Context::get('target_srl');
@@ -2603,8 +2926,12 @@  discard block
 block discarded – undo
2603 2926
 		$module_srl = $oComment->get('module_srl');
2604 2927
 		$member_srl = $oComment->get('member_srl');
2605 2928
 
2606
-		if(!$member_srl) return new Object();
2607
-		if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new Object();
2929
+		if(!$member_srl) {
2930
+			return new Object();
2931
+		}
2932
+		if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) {
2933
+			return new Object();
2934
+		}
2608 2935
 
2609 2936
 		$oCommentController = getController('comment');
2610 2937
 		$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
@@ -2620,7 +2947,9 @@  discard block
 block discarded – undo
2620 2947
 	**/
2621 2948
 	function procMemberSpammerManage()
2622 2949
 	{
2623
-		if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
2950
+		if(!Context::get('is_logged')) {
2951
+			return new Object(-1,'msg_not_permitted');
2952
+		}
2624 2953
 
2625 2954
 		$logged_info = Context::get('logged_info');
2626 2955
 		$member_srl = Context::get('member_srl');
@@ -2628,8 +2957,9 @@  discard block
 block discarded – undo
2628 2957
 		$cnt_loop = Context::get('cnt_loop');
2629 2958
 		$proc_type = Context::get('proc_type');
2630 2959
 		$isMoveToTrash = true;
2631
-		if($proc_type == "delete")
2632
-			$isMoveToTrash = false;
2960
+		if($proc_type == "delete") {
2961
+					$isMoveToTrash = false;
2962
+		}
2633 2963
 
2634 2964
 		// check grant
2635 2965
 		$oModuleModel = getModel('module');
@@ -2637,7 +2967,9 @@  discard block
 block discarded – undo
2637 2967
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
2638 2968
 		$grant = $oModuleModel->getGrant($module_info, $logged_info);
2639 2969
 
2640
-		if(!$grant->manager) return new Object(-1,'msg_not_permitted');
2970
+		if(!$grant->manager) {
2971
+			return new Object(-1,'msg_not_permitted');
2972
+		}
2641 2973
 
2642 2974
 		$proc_msg = "";
2643 2975
 
@@ -2646,11 +2978,13 @@  discard block
 block discarded – undo
2646 2978
 
2647 2979
 		// delete or trash destination
2648 2980
 		// proc member
2649
-		if($cnt_loop == 1)
2650
-			$this->_spammerMember($member_srl);
2981
+		if($cnt_loop == 1) {
2982
+					$this->_spammerMember($member_srl);
2983
+		}
2651 2984
 		// proc document and comment
2652
-		elseif($cnt_loop>1)
2653
-			$this->_spammerDocuments($member_srl, $isMoveToTrash);
2985
+		elseif($cnt_loop>1) {
2986
+					$this->_spammerDocuments($member_srl, $isMoveToTrash);
2987
+		}
2654 2988
 
2655 2989
 		// get destination count
2656 2990
 		$cnt_document = $oDocumentModel->getDocumentCountByMemberSrl($member_srl);
@@ -2658,13 +2992,16 @@  discard block
 block discarded – undo
2658 2992
 
2659 2993
 		$total_count = Context::get('total_count');
2660 2994
 		$remain_count = $cnt_document + $cnt_comment;
2661
-		if($cnt_loop == 1) $total_count = $remain_count;
2995
+		if($cnt_loop == 1) {
2996
+			$total_count = $remain_count;
2997
+		}
2662 2998
 
2663 2999
 		// get progress percent
2664
-		if($total_count > 0)
2665
-			$progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 );
2666
-		else
2667
-			$progress = 100;
3000
+		if($total_count > 0) {
3001
+					$progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 );
3002
+		} else {
3003
+					$progress = 100;
3004
+		}
2668 3005
 
2669 3006
 		$this->add('total_count', $total_count);
2670 3007
 		$this->add('remain_count', $remain_count);
@@ -2706,7 +3043,10 @@  discard block
 block discarded – undo
2706 3043
 		$args->nick_name = $member_info->nick_name;
2707 3044
 		$args->denied = "Y";
2708 3045
 		$args->description = trim( $member_info->description );
2709
-		if( $args->description != "" ) $args->description .= "\n";	// add new line
3046
+		if( $args->description != "" ) {
3047
+			$args->description .= "\n";
3048
+		}
3049
+		// add new line
2710 3050
 
2711 3051
 		$args->description .= Context::getLang('cmd_spammer') . "[" . date("Y-m-d H:i:s") . " from:" . $logged_info->user_id . " info:" . $spam_description . " docuemnts count:" . $total_count . "]";
2712 3052
 
@@ -2751,8 +3091,11 @@  discard block
 block discarded – undo
2751 3091
 			$documentList = $oDocumentModel->getDocumentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount);
2752 3092
 			if($documentList) {
2753 3093
 				foreach($documentList as $v) {
2754
-					if($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v);
2755
-					else $oDocumentController->deleteDocument($v->document_srl);
3094
+					if($isMoveToTrash) {
3095
+						$oDocumentController->moveDocumentToTrash($v);
3096
+					} else {
3097
+						$oDocumentController->deleteDocument($v->document_srl);
3098
+					}
2756 3099
 				}
2757 3100
 			}
2758 3101
 		}
Please login to merge, or discard this patch.
modules/member/member.model.php 3 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -297,6 +297,7 @@
 block discarded – undo
297 297
 
298 298
 	/**
299 299
 	 * @brief Return member information with member_srl
300
+	 * @param string $member_srl
300 301
 	 */
301 302
 	function getMemberInfoByMemberSrl($member_srl, $site_srl = 0, $columnList = array())
302 303
 	{
Please login to merge, or discard this patch.
Spacing   +175 added lines, -175 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 	{
27 27
 		static $member_config;
28 28
 
29
-		if($member_config)
29
+		if ($member_config)
30 30
 		{
31 31
 			return $member_config;
32 32
 		}
@@ -35,42 +35,42 @@  discard block
 block discarded – undo
35 35
 		$oModuleModel = getModel('module');
36 36
 		$config = $oModuleModel->getModuleConfig('member');
37 37
 
38
-		if(!$config->signupForm || !is_array($config->signupForm))
38
+		if (!$config->signupForm || !is_array($config->signupForm))
39 39
 		{
40 40
 			$oMemberAdminController = getAdminController('member');
41 41
 			$identifier = ($config->identifier) ? $config->identifier : 'email_address';
42 42
 			$config->signupForm = $oMemberAdminController->createSignupForm($identifier);
43 43
 		}
44 44
 		//for multi language
45
-		foreach($config->signupForm AS $key=>$value)
45
+		foreach ($config->signupForm AS $key=>$value)
46 46
 		{
47 47
 			$config->signupForm[$key]->title = ($value->isDefaultForm) ? Context::getLang($value->name) : $value->title;
48
-			if($config->signupForm[$key]->isPublic != 'N') $config->signupForm[$key]->isPublic = 'Y';
49
-			if($value->name == 'find_account_question') $config->signupForm[$key]->isPublic = 'N';
48
+			if ($config->signupForm[$key]->isPublic != 'N') $config->signupForm[$key]->isPublic = 'Y';
49
+			if ($value->name == 'find_account_question') $config->signupForm[$key]->isPublic = 'N';
50 50
 		}
51 51
 
52 52
 		// Get terms of user
53 53
 		$config->agreement = memberModel::_getAgreement();
54 54
 
55
-		if(!$config->webmaster_name) $config->webmaster_name = 'webmaster';
56
-		if(!$config->image_name_max_width) $config->image_name_max_width = 90;
57
-		if(!$config->image_name_max_height) $config->image_name_max_height = 20;
58
-		if(!$config->image_mark_max_width) $config->image_mark_max_width = 20;
59
-		if(!$config->image_mark_max_height) $config->image_mark_max_height = 20;
60
-		if(!$config->profile_image_max_width) $config->profile_image_max_width = 90;
61
-		if(!$config->profile_image_max_height) $config->profile_image_max_height = 90;
62
-		if(!$config->skin) $config->skin = 'default';
63
-		if(!$config->colorset) $config->colorset = 'white';
64
-		if(!$config->editor_skin || $config->editor_skin == 'default') $config->editor_skin = 'ckeditor';
65
-		if(!$config->group_image_mark) $config->group_image_mark = "N";
55
+		if (!$config->webmaster_name) $config->webmaster_name = 'webmaster';
56
+		if (!$config->image_name_max_width) $config->image_name_max_width = 90;
57
+		if (!$config->image_name_max_height) $config->image_name_max_height = 20;
58
+		if (!$config->image_mark_max_width) $config->image_mark_max_width = 20;
59
+		if (!$config->image_mark_max_height) $config->image_mark_max_height = 20;
60
+		if (!$config->profile_image_max_width) $config->profile_image_max_width = 90;
61
+		if (!$config->profile_image_max_height) $config->profile_image_max_height = 90;
62
+		if (!$config->skin) $config->skin = 'default';
63
+		if (!$config->colorset) $config->colorset = 'white';
64
+		if (!$config->editor_skin || $config->editor_skin == 'default') $config->editor_skin = 'ckeditor';
65
+		if (!$config->group_image_mark) $config->group_image_mark = "N";
66 66
 
67
-		if(!$config->identifier) $config->identifier = 'user_id';
67
+		if (!$config->identifier) $config->identifier = 'user_id';
68 68
 
69
-		if(!$config->max_error_count) $config->max_error_count = 10;
70
-		if(!$config->max_error_count_time) $config->max_error_count_time = 300;
69
+		if (!$config->max_error_count) $config->max_error_count = 10;
70
+		if (!$config->max_error_count_time) $config->max_error_count_time = 300;
71 71
 
72
-		if(!$config->signature_editor_skin || $config->signature_editor_skin == 'default') $config->signature_editor_skin = 'ckeditor';
73
-		if(!$config->sel_editor_colorset) $config->sel_editor_colorset = 'moono';
72
+		if (!$config->signature_editor_skin || $config->signature_editor_skin == 'default') $config->signature_editor_skin = 'ckeditor';
73
+		if (!$config->sel_editor_colorset) $config->sel_editor_colorset = 'moono';
74 74
 
75 75
 		$member_config = $config;
76 76
 
@@ -79,24 +79,24 @@  discard block
 block discarded – undo
79 79
 
80 80
 	function _getAgreement()
81 81
 	{
82
-		$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_' . Context::get('lang_type') . '.txt';
83
-		if(is_readable($agreement_file))
82
+		$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_'.Context::get('lang_type').'.txt';
83
+		if (is_readable($agreement_file))
84 84
 		{
85 85
 			return FileHandler::readFile($agreement_file);
86 86
 		}
87 87
 
88 88
 		$db_info = Context::getDBInfo();
89
-		$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_' . $db_info->lang_type . '.txt';
90
-		if(is_readable($agreement_file))
89
+		$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_'.$db_info->lang_type.'.txt';
90
+		if (is_readable($agreement_file))
91 91
 		{
92 92
 			return FileHandler::readFile($agreement_file);
93 93
 		}
94 94
 
95 95
 		$lang_selected = Context::loadLangSelected();
96
-		foreach($lang_selected as $key => $val)
96
+		foreach ($lang_selected as $key => $val)
97 97
 		{
98
-			$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_' . $key . '.txt';
99
-			if(is_readable($agreement_file))
98
+			$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_'.$key.'.txt';
99
+			if (is_readable($agreement_file))
100 100
 			{
101 101
 				return FileHandler::readFile($agreement_file);
102 102
 			}
@@ -116,12 +116,12 @@  discard block
 block discarded – undo
116 116
 		$logged_info = Context::get('logged_info');
117 117
 		$act = Context::get('cur_act');
118 118
 		// When click user's own nickname
119
-		if($member_srl == $logged_info->member_srl) $member_info = $logged_info;
119
+		if ($member_srl == $logged_info->member_srl) $member_info = $logged_info;
120 120
 		// When click other's nickname
121 121
 		else $member_info = $this->getMemberInfoByMemberSrl($member_srl);
122 122
 
123 123
 		$member_srl = $member_info->member_srl;
124
-		if(!$member_srl) return;
124
+		if (!$member_srl) return;
125 125
 		// List variables
126 126
 		$user_id = $member_info->user_id;
127 127
 		$user_name = $member_info->user_name;
@@ -130,18 +130,18 @@  discard block
 block discarded – undo
130 130
 
131 131
 		$oMemberController = getController('member');
132 132
 		// Display member information (Don't display to non-logged user)
133
-		if($logged_info->member_srl)
133
+		if ($logged_info->member_srl)
134 134
 		{
135
-			$url = getUrl('','mid',$mid,'act','dispMemberInfo','member_srl',$member_srl);
136
-			$oMemberController->addMemberPopupMenu($url,'cmd_view_member_info',$icon_path,'self');
135
+			$url = getUrl('', 'mid', $mid, 'act', 'dispMemberInfo', 'member_srl', $member_srl);
136
+			$oMemberController->addMemberPopupMenu($url, 'cmd_view_member_info', $icon_path, 'self');
137 137
 		}
138 138
 		// When click other's nickname
139
-		if($member_srl != $logged_info->member_srl && $logged_info->member_srl)
139
+		if ($member_srl != $logged_info->member_srl && $logged_info->member_srl)
140 140
 		{
141 141
 			// Get email config
142
-			foreach($this->module_config->signupForm as $field)
142
+			foreach ($this->module_config->signupForm as $field)
143 143
 			{
144
-				if($field->name == 'email_address')
144
+				if ($field->name == 'email_address')
145 145
 				{
146 146
 					$email_config = $field;
147 147
 					break;
@@ -149,36 +149,36 @@  discard block
 block discarded – undo
149 149
 			}
150 150
 
151 151
 			// Send an email only if email address is public
152
-			if(($logged_info->is_admin == 'Y' || $email_config->isPublic == 'Y') && $member_info->email_address)
152
+			if (($logged_info->is_admin == 'Y' || $email_config->isPublic == 'Y') && $member_info->email_address)
153 153
 			{
154 154
 				$url = 'mailto:'.htmlspecialchars($member_info->email_address, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
155
-				$oMemberController->addMemberPopupMenu($url,'cmd_send_email',$icon_path);
155
+				$oMemberController->addMemberPopupMenu($url, 'cmd_send_email', $icon_path);
156 156
 			}
157 157
 		}
158 158
 		// View homepage info
159
-		if($member_info->homepage)
159
+		if ($member_info->homepage)
160 160
 			$oMemberController->addMemberPopupMenu(htmlspecialchars($member_info->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false), 'homepage', '', 'blank');
161 161
 		// View blog info
162
-		if($member_info->blog)
162
+		if ($member_info->blog)
163 163
 			$oMemberController->addMemberPopupMenu(htmlspecialchars($member_info->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false), 'blog', '', 'blank');
164 164
 		// Call a trigger (after)
165 165
 		ModuleHandler::triggerCall('member.getMemberMenu', 'after', $null);
166 166
 		// Display a menu for editting member info to a top administrator
167
-		if($logged_info->is_admin == 'Y')
167
+		if ($logged_info->is_admin == 'Y')
168 168
 		{
169
-			$url = getUrl('','module','admin','act','dispMemberAdminInsert','member_srl',$member_srl);
170
-			$oMemberController->addMemberPopupMenu($url,'cmd_manage_member_info',$icon_path,'MemberModifyInfo');
169
+			$url = getUrl('', 'module', 'admin', 'act', 'dispMemberAdminInsert', 'member_srl', $member_srl);
170
+			$oMemberController->addMemberPopupMenu($url, 'cmd_manage_member_info', $icon_path, 'MemberModifyInfo');
171 171
 
172
-			$url = getUrl('','module','admin','act','dispDocumentAdminList','search_target','member_srl','search_keyword',$member_srl);
173
-			$oMemberController->addMemberPopupMenu($url,'cmd_trace_document',$icon_path,'TraceMemberDocument');
172
+			$url = getUrl('', 'module', 'admin', 'act', 'dispDocumentAdminList', 'search_target', 'member_srl', 'search_keyword', $member_srl);
173
+			$oMemberController->addMemberPopupMenu($url, 'cmd_trace_document', $icon_path, 'TraceMemberDocument');
174 174
 
175
-			$url = getUrl('','module','admin','act','dispCommentAdminList','search_target','member_srl','search_keyword',$member_srl);
176
-			$oMemberController->addMemberPopupMenu($url,'cmd_trace_comment',$icon_path,'TraceMemberComment');
175
+			$url = getUrl('', 'module', 'admin', 'act', 'dispCommentAdminList', 'search_target', 'member_srl', 'search_keyword', $member_srl);
176
+			$oMemberController->addMemberPopupMenu($url, 'cmd_trace_comment', $icon_path, 'TraceMemberComment');
177 177
 		}
178 178
 		// Change a language of pop-up menu
179 179
 		$menus = Context::get('member_popup_menu_list');
180 180
 		$menus_count = count($menus);
181
-		for($i=0;$i<$menus_count;$i++)
181
+		for ($i = 0; $i < $menus_count; $i++)
182 182
 		{
183 183
 			$menus[$i]->str = Context::getLang($menus[$i]->str);
184 184
 		}
@@ -190,16 +190,16 @@  discard block
 block discarded – undo
190 190
 	 * @brief Check if logged-in
191 191
 	 */
192 192
 	function isLogged() {
193
-		if($_SESSION['is_logged'])
193
+		if ($_SESSION['is_logged'])
194 194
 		{
195
-			if(Mobile::isFromMobilePhone())
195
+			if (Mobile::isFromMobilePhone())
196 196
 			{
197 197
 				return true;
198 198
 			}
199
-			elseif(filter_var($_SESSION['ipaddress'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6))
199
+			elseif (filter_var($_SESSION['ipaddress'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6))
200 200
 			{
201 201
 				// IPv6: require same /48
202
-				if(strncmp(inet_pton($_SESSION['ipaddress']), inet_pton($_SERVER['REMOTE_ADDR']), 6) == 0)
202
+				if (strncmp(inet_pton($_SESSION['ipaddress']), inet_pton($_SERVER['REMOTE_ADDR']), 6) == 0)
203 203
 				{
204 204
 					return true;
205 205
 				}
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 			else
208 208
 			{
209 209
 				// IPv4: require same /24
210
-				if(ip2long($_SESSION['ipaddress']) >> 8 == ip2long($_SERVER['REMOTE_ADDR']) >> 8)
210
+				if (ip2long($_SESSION['ipaddress']) >> 8 == ip2long($_SERVER['REMOTE_ADDR']) >> 8)
211 211
 				{
212 212
 					return true;
213 213
 				}
@@ -224,23 +224,23 @@  discard block
 block discarded – undo
224 224
 	function getLoggedInfo()
225 225
 	{
226 226
 		// Return session info if session info is requested and the user is logged-in
227
-		if($this->isLogged())
227
+		if ($this->isLogged())
228 228
 		{
229 229
 			$logged_info = Context::get('logged_info');
230 230
 			// Admin/Group list defined depending on site_module_info
231 231
 			$site_module_info = Context::get('site_module_info');
232
-			if($site_module_info->site_srl)
232
+			if ($site_module_info->site_srl)
233 233
 			{
234 234
 				$logged_info->group_list = $this->getMemberGroups($logged_info->member_srl, $site_module_info->site_srl);
235 235
 				// Add is_site_admin bool variable into logged_info if site_administrator is
236 236
 				$oModuleModel = getModel('module');
237
-				if($oModuleModel->isSiteAdmin($logged_info)) $logged_info->is_site_admin = true;
237
+				if ($oModuleModel->isSiteAdmin($logged_info)) $logged_info->is_site_admin = true;
238 238
 				else $logged_info->is_site_admin = false;
239 239
 			}
240 240
 			else
241 241
 			{
242 242
 				// Register a default group if the site doesn't have a member group
243
-				if(count($logged_info->group_list) === 0)
243
+				if (count($logged_info->group_list) === 0)
244 244
 				{
245 245
 					$default_group = $this->getDefaultGroup(0);
246 246
 					$oMemberController = getController('member');
@@ -263,13 +263,13 @@  discard block
 block discarded – undo
263 263
 	 */
264 264
 	function getMemberInfoByUserID($user_id, $columnList = array())
265 265
 	{
266
-		if(!$user_id) return;
266
+		if (!$user_id) return;
267 267
 
268 268
 		$args = new stdClass;
269 269
 		$args->user_id = $user_id;
270 270
 		$output = executeQuery('member.getMemberInfo', $args);
271
-		if(!$output->toBool()) return $output;
272
-		if(!$output->data) return;
271
+		if (!$output->toBool()) return $output;
272
+		if (!$output->data) return;
273 273
 
274 274
 		$member_info = $this->arrangeMemberInfo($output->data);
275 275
 
@@ -281,12 +281,12 @@  discard block
 block discarded – undo
281 281
 	 */
282 282
 	function getMemberInfoByEmailAddress($email_address)
283 283
 	{
284
-		if(!$email_address) return;
284
+		if (!$email_address) return;
285 285
 
286 286
 		$args = new stdClass();
287 287
 		
288
-		$db_info = Context::getDBInfo ();
289
-		if($db_info->master_db['db_type'] == "cubrid")
288
+		$db_info = Context::getDBInfo();
289
+		if ($db_info->master_db['db_type'] == "cubrid")
290 290
 		{
291 291
 			$args->email_address = strtolower($email_address);
292 292
 			$output = executeQuery('member.getMemberInfoByEmailAddressForCubrid', $args);
@@ -297,8 +297,8 @@  discard block
 block discarded – undo
297 297
 			$output = executeQuery('member.getMemberInfoByEmailAddress', $args);
298 298
 		}
299 299
 		
300
-		if(!$output->toBool()) return $output;
301
-		if(!$output->data) return;
300
+		if (!$output->toBool()) return $output;
301
+		if (!$output->data) return;
302 302
 
303 303
 		$member_info = $this->arrangeMemberInfo($output->data);
304 304
 		return $member_info;
@@ -309,36 +309,36 @@  discard block
 block discarded – undo
309 309
 	 */
310 310
 	function getMemberInfoByMemberSrl($member_srl, $site_srl = 0, $columnList = array())
311 311
 	{
312
-		if(!$member_srl) return;
312
+		if (!$member_srl) return;
313 313
 
314 314
 		//columnList size zero... get full member info
315
-		if(!$GLOBALS['__member_info__'][$member_srl] || count($columnList) == 0)
315
+		if (!$GLOBALS['__member_info__'][$member_srl] || count($columnList) == 0)
316 316
 		{
317 317
 			$GLOBALS['__member_info__'][$member_srl] = false;
318 318
 
319 319
 			$oCacheHandler = CacheHandler::getInstance('object');
320
-			if($oCacheHandler->isSupport())
320
+			if ($oCacheHandler->isSupport())
321 321
 			{
322 322
 				$columnList = array();
323
-				$object_key = 'member_info:' . getNumberingPath($member_srl) . $member_srl;
323
+				$object_key = 'member_info:'.getNumberingPath($member_srl).$member_srl;
324 324
 				$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
325 325
 				$GLOBALS['__member_info__'][$member_srl] = $oCacheHandler->get($cache_key);
326 326
 			}
327 327
 
328
-			if($GLOBALS['__member_info__'][$member_srl] === false)
328
+			if ($GLOBALS['__member_info__'][$member_srl] === false)
329 329
 			{
330 330
 				$args = new stdClass();
331 331
 				$args->member_srl = $member_srl;
332 332
 				$output = executeQuery('member.getMemberInfoByMemberSrl', $args, $columnList);
333
-				if(!$output->data) 
333
+				if (!$output->data) 
334 334
 				{
335
-					if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, new stdClass);
335
+					if ($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, new stdClass);
336 336
 					return;
337 337
 				}
338 338
 				$this->arrangeMemberInfo($output->data, $site_srl);
339 339
 
340 340
 				//insert in cache
341
-				if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $GLOBALS['__member_info__'][$member_srl]);
341
+				if ($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $GLOBALS['__member_info__'][$member_srl]);
342 342
 			}
343 343
 		}
344 344
 
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
 	 */
351 351
 	function arrangeMemberInfo($info, $site_srl = 0)
352 352
 	{
353
-		if(!$GLOBALS['__member_info__'][$info->member_srl])
353
+		if (!$GLOBALS['__member_info__'][$info->member_srl])
354 354
 		{
355 355
 			$oModuleModel = getModel('module');
356 356
 			$config = $oModuleModel->getModuleConfig('member');
@@ -359,25 +359,25 @@  discard block
 block discarded – undo
359 359
 			$info->profile_image = $this->getProfileImage($info->member_srl);
360 360
 			$info->image_name = $this->getImageName($info->member_srl);
361 361
 			$info->image_mark = $this->getImageMark($info->member_srl);
362
-			if($config->group_image_mark=='Y')
362
+			if ($config->group_image_mark == 'Y')
363 363
 			{
364
-				$info->group_mark = $this->getGroupImageMark($info->member_srl,$site_srl);
364
+				$info->group_mark = $this->getGroupImageMark($info->member_srl, $site_srl);
365 365
 			}
366 366
 			$info->signature = $this->getSignature($info->member_srl);
367 367
 			$info->group_list = $this->getMemberGroups($info->member_srl, $site_srl);
368 368
 
369 369
 			$extra_vars = unserialize($info->extra_vars);
370 370
 			unset($info->extra_vars);
371
-			if($extra_vars)
371
+			if ($extra_vars)
372 372
 			{
373
-				foreach($extra_vars as $key => $val)
373
+				foreach ($extra_vars as $key => $val)
374 374
 				{
375
-					if(!is_array($val) && strpos($val, '|@|') !== FALSE) $val = explode('|@|', $val);
376
-					if(!$info->{$key}) $info->{$key} = $val;
375
+					if (!is_array($val) && strpos($val, '|@|') !== FALSE) $val = explode('|@|', $val);
376
+					if (!$info->{$key}) $info->{$key} = $val;
377 377
 				}
378 378
 			}
379 379
 
380
-			if(strlen($info->find_account_answer) == 32 && preg_match('/[a-zA-Z0-9]+/', $info->find_account_answer))
380
+			if (strlen($info->find_account_answer) == 32 && preg_match('/[a-zA-Z0-9]+/', $info->find_account_answer))
381 381
 			{
382 382
 				$info->find_account_answer = null;
383 383
 			}
@@ -389,13 +389,13 @@  discard block
 block discarded – undo
389 389
 			$info->homepage = strip_tags($info->homepage);
390 390
 			$info->blog = strip_tags($info->blog);
391 391
 
392
-			if($extra_vars)
392
+			if ($extra_vars)
393 393
 			{
394
-				foreach($extra_vars as $key => $val)
394
+				foreach ($extra_vars as $key => $val)
395 395
 				{
396
-					if(is_array($val))
396
+					if (is_array($val))
397 397
 					{
398
-						$oSecurity->encodeHTML($key . '.');
398
+						$oSecurity->encodeHTML($key.'.');
399 399
 					}
400 400
 					else
401 401
 					{
@@ -406,12 +406,12 @@  discard block
 block discarded – undo
406 406
 
407 407
 			// Check format.
408 408
 			$oValidator = new Validator();
409
-			if(!$oValidator->applyRule('url', $info->homepage))
409
+			if (!$oValidator->applyRule('url', $info->homepage))
410 410
 			{
411 411
 				$info->homepage = '';
412 412
 			}
413 413
 
414
-			if(!$oValidator->applyRule('url', $info->blog))
414
+			if (!$oValidator->applyRule('url', $info->blog))
415 415
 			{
416 416
 				$info->blog = '';
417 417
 			}
@@ -460,7 +460,7 @@  discard block
 block discarded – undo
460 460
 	 */
461 461
 	function getLoggedMemberSrl()
462 462
 	{
463
-		if(!$this->isLogged()) return;
463
+		if (!$this->isLogged()) return;
464 464
 		return $_SESSION['member_srl'];
465 465
 	}
466 466
 
@@ -469,7 +469,7 @@  discard block
 block discarded – undo
469 469
 	 */
470 470
 	function getLoggedUserID()
471 471
 	{
472
-		if(!$this->isLogged()) return;
472
+		if (!$this->isLogged()) return;
473 473
 		$logged_info = Context::get('logged_info');
474 474
 		return $logged_info->user_id;
475 475
 	}
@@ -484,16 +484,16 @@  discard block
 block discarded – undo
484 484
 		// cache controll
485 485
 		$group_list = false;
486 486
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
487
-		if($oCacheHandler->isSupport())
487
+		if ($oCacheHandler->isSupport())
488 488
 		{
489
-			$object_key = 'member_groups:' . getNumberingPath($member_srl) . $member_srl . '_'.$site_srl;
489
+			$object_key = 'member_groups:'.getNumberingPath($member_srl).$member_srl.'_'.$site_srl;
490 490
 			$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
491 491
 			$group_list = $oCacheHandler->get($cache_key);
492 492
 		}
493 493
 
494
-		if(!$member_groups[$member_srl][$site_srl] || $force_reload)
494
+		if (!$member_groups[$member_srl][$site_srl] || $force_reload)
495 495
 		{
496
-			if($group_list === false)
496
+			if ($group_list === false)
497 497
 			{
498 498
 				$args = new stdClass();
499 499
 				$args->member_srl = $member_srl;
@@ -501,11 +501,11 @@  discard block
 block discarded – undo
501 501
 				$output = executeQueryArray('member.getMemberGroups', $args);
502 502
 				$group_list = $output->data;
503 503
 				//insert in cache
504
-				if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list);
504
+				if ($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list);
505 505
 			}
506
-			if(!$group_list) return array();
506
+			if (!$group_list) return array();
507 507
 
508
-			foreach($group_list as $group)
508
+			foreach ($group_list as $group)
509 509
 			{
510 510
 				$result[$group->group_srl] = $group->title;
511 511
 			}
@@ -519,14 +519,14 @@  discard block
 block discarded – undo
519 519
 	 */
520 520
 	function getMembersGroups($member_srls, $site_srl = 0)
521 521
 	{
522
-		$args->member_srls = implode(',',$member_srls);
522
+		$args->member_srls = implode(',', $member_srls);
523 523
 		$args->site_srl = $site_srl;
524 524
 		$args->sort_index = 'list_order';
525 525
 		$output = executeQueryArray('member.getMembersGroups', $args);
526
-		if(!$output->data) return array();
526
+		if (!$output->data) return array();
527 527
 
528 528
 		$result = array();
529
-		foreach($output->data as $key=>$val)
529
+		foreach ($output->data as $key=>$val)
530 530
 		{
531 531
 			$result[$val->member_srl][] = $val->title;
532 532
 		}
@@ -540,21 +540,21 @@  discard block
 block discarded – undo
540 540
 	{
541 541
 		$default_group = false;
542 542
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
543
-		if($oCacheHandler->isSupport())
543
+		if ($oCacheHandler->isSupport())
544 544
 		{
545 545
 			$columnList = array();
546
-			$object_key = 'default_group_' . $site_srl;
546
+			$object_key = 'default_group_'.$site_srl;
547 547
 			$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
548 548
 			$default_group = $oCacheHandler->get($cache_key);
549 549
 		}
550 550
 
551
-		if($default_group === false)
551
+		if ($default_group === false)
552 552
 		{
553 553
 			$args = new stdClass();
554 554
 			$args->site_srl = $site_srl;
555 555
 			$output = executeQuery('member.getDefaultGroup', $args, $columnList);
556 556
 			$default_group = $output->data;
557
-			if($oCacheHandler->isSupport())
557
+			if ($oCacheHandler->isSupport())
558 558
 			{
559 559
 				$oCacheHandler->put($cache_key, $default_group);
560 560
 			}
@@ -588,25 +588,25 @@  discard block
 block discarded – undo
588 588
 	 */
589 589
 	function getGroups($site_srl = 0)
590 590
 	{
591
-		if(!$GLOBALS['__group_info__'][$site_srl])
591
+		if (!$GLOBALS['__group_info__'][$site_srl])
592 592
 		{
593 593
 			$result = array();
594 594
 
595
-			if(!isset($site_srl))
595
+			if (!isset($site_srl))
596 596
 			{
597 597
 				$site_srl = 0;
598 598
 			}
599 599
 
600 600
 			$group_list = false;
601 601
 			$oCacheHandler = CacheHandler::getInstance('object', null, true);
602
-			if($oCacheHandler->isSupport())
602
+			if ($oCacheHandler->isSupport())
603 603
 			{
604 604
 				$object_key = 'member_groups:site_'.$site_srl;
605 605
 				$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
606 606
 				$group_list = $oCacheHandler->get($cache_key);
607 607
 			}
608 608
 
609
-			if($group_list === false)
609
+			if ($group_list === false)
610 610
 			{
611 611
 				$args = new stdClass();
612 612
 				$args->site_srl = $site_srl;
@@ -615,16 +615,16 @@  discard block
 block discarded – undo
615 615
 				$output = executeQueryArray('member.getGroups', $args);
616 616
 				$group_list = $output->data;
617 617
 				//insert in cache
618
-				if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list);
618
+				if ($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list);
619 619
 			}
620 620
 
621
-			if(!$group_list)
621
+			if (!$group_list)
622 622
 			{
623 623
 				return array();
624 624
 			}
625 625
 
626 626
 
627
-			foreach($group_list as $val)
627
+			foreach ($group_list as $val)
628 628
 			{
629 629
 				$result[$val->group_srl] = $val;
630 630
 			}
@@ -655,7 +655,7 @@  discard block
 block discarded – undo
655 655
 		// Set to ignore if a super administrator.
656 656
 		$logged_info = Context::get('logged_info');
657 657
 
658
-		if(!$this->join_form_list)
658
+		if (!$this->join_form_list)
659 659
 		{
660 660
 			// Argument setting to sort list_order column
661 661
 			$args = new stdClass();
@@ -663,11 +663,11 @@  discard block
 block discarded – undo
663 663
 			$output = executeQuery('member.getJoinFormList', $args);
664 664
 			// NULL if output data deosn't exist
665 665
 			$join_form_list = $output->data;
666
-			if(!$join_form_list) return NULL;
666
+			if (!$join_form_list) return NULL;
667 667
 			// Need to unserialize because serialized array is inserted into DB in case of default_value
668
-			if(!is_array($join_form_list)) $join_form_list = array($join_form_list);
668
+			if (!is_array($join_form_list)) $join_form_list = array($join_form_list);
669 669
 			$join_form_count = count($join_form_list);
670
-			for($i=0;$i<$join_form_count;$i++)
670
+			for ($i = 0; $i < $join_form_count; $i++)
671 671
 			{
672 672
 				$join_form_list[$i]->column_name = strtolower($join_form_list[$i]->column_name);
673 673
 
@@ -679,10 +679,10 @@  discard block
 block discarded – undo
679 679
 				// Add language variable
680 680
 				$lang->extend_vars[$column_name] = $column_title;
681 681
 				// unserialize if the data type if checkbox, select and so on
682
-				if(in_array($column_type, array('checkbox','select','radio')))
682
+				if (in_array($column_type, array('checkbox', 'select', 'radio')))
683 683
 				{
684 684
 					$join_form_list[$i]->default_value = unserialize($default_value);
685
-					if(!$join_form_list[$i]->default_value[0]) $join_form_list[$i]->default_value = '';
685
+					if (!$join_form_list[$i]->default_value[0]) $join_form_list[$i]->default_value = '';
686 686
 				}
687 687
 				else
688 688
 				{
@@ -694,16 +694,16 @@  discard block
 block discarded – undo
694 694
 			$this->join_form_list = $list;
695 695
 		}
696 696
 		// Get object style if the filter_response is true
697
-		if($filter_response && count($this->join_form_list))
697
+		if ($filter_response && count($this->join_form_list))
698 698
 		{
699
-			foreach($this->join_form_list as $key => $val)
699
+			foreach ($this->join_form_list as $key => $val)
700 700
 			{
701
-				if($val->is_active != 'Y') continue;
701
+				if ($val->is_active != 'Y') continue;
702 702
 				unset($obj);
703 703
 				$obj->type = $val->column_type;
704 704
 				$obj->name = $val->column_name;
705 705
 				$obj->lang = $val->column_title;
706
-				if($logged_info->is_admin != 'Y') $obj->required = $val->required=='Y'?true:false;
706
+				if ($logged_info->is_admin != 'Y') $obj->required = $val->required == 'Y' ? true : false;
707 707
 				else $obj->required = false;
708 708
 				$filter_output[] = $obj;
709 709
 
@@ -730,15 +730,15 @@  discard block
 block discarded – undo
730 730
 		$args->sort_index = "list_order";
731 731
 		$output = executeQueryArray('member.getJoinFormList', $args);
732 732
 
733
-		if(!$output->toBool())
733
+		if (!$output->toBool())
734 734
 		{
735 735
 			return array();
736 736
 		}
737 737
 
738 738
 		$joinFormList = array();
739
-		foreach($output->data as $val)
739
+		foreach ($output->data as $val)
740 740
 		{
741
-			if($val->is_active != 'Y')
741
+			if ($val->is_active != 'Y')
742 742
 			{
743 743
 				continue;
744 744
 			}
@@ -755,20 +755,20 @@  discard block
 block discarded – undo
755 755
 	function getCombineJoinForm($member_info)
756 756
 	{
757 757
 		$extend_form_list = $this->getJoinFormlist();
758
-		if(!$extend_form_list) return;
758
+		if (!$extend_form_list) return;
759 759
 		// Member info is open only to an administrator and him/herself when is_private is true.
760 760
 		$logged_info = Context::get('logged_info');
761 761
 
762
-		foreach($extend_form_list as $srl => $item)
762
+		foreach ($extend_form_list as $srl => $item)
763 763
 		{
764 764
 			$column_name = $item->column_name;
765 765
 			$value = $member_info->{$column_name};
766 766
 
767 767
 			// Change values depening on the type of extend form
768
-			switch($item->column_type)
768
+			switch ($item->column_type)
769 769
 			{
770 770
 				case 'checkbox' :
771
-					if($value && !is_array($value)) $value = array($value);
771
+					if ($value && !is_array($value)) $value = array($value);
772 772
 					break;
773 773
 				case 'text' :
774 774
 				case 'homepage' :
@@ -782,7 +782,7 @@  discard block
 block discarded – undo
782 782
 
783 783
 			$extend_form_list[$srl]->value = $value;
784 784
 
785
-			if($member_info->{'open_'.$column_name}=='Y') $extend_form_list[$srl]->is_opened = true;
785
+			if ($member_info->{'open_'.$column_name} == 'Y') $extend_form_list[$srl]->is_opened = true;
786 786
 			else $extend_form_list[$srl]->is_opened = false;
787 787
 		}
788 788
 		return $extend_form_list;
@@ -796,12 +796,12 @@  discard block
 block discarded – undo
796 796
 		$args->member_join_form_srl = $member_join_form_srl;
797 797
 		$output = executeQuery('member.getJoinForm', $args);
798 798
 		$join_form = $output->data;
799
-		if(!$join_form) return NULL;
799
+		if (!$join_form) return NULL;
800 800
 
801 801
 		$column_type = $join_form->column_type;
802 802
 		$default_value = $join_form->default_value;
803 803
 
804
-		if(in_array($column_type, array('checkbox','select','radio')))
804
+		if (in_array($column_type, array('checkbox', 'select', 'radio')))
805 805
 		{
806 806
 			$join_form->default_value = unserialize($default_value);
807 807
 		}
@@ -818,7 +818,7 @@  discard block
 block discarded – undo
818 818
 	 */
819 819
 	function getDeniedIDList()
820 820
 	{
821
-		if(!$this->denied_id_list)
821
+		if (!$this->denied_id_list)
822 822
 		{
823 823
 			$args->sort_index = "list_order";
824 824
 			$args->page = Context::get('page');
@@ -834,14 +834,14 @@  discard block
 block discarded – undo
834 834
 	function getDeniedIDs()
835 835
 	{
836 836
 		$output = executeQueryArray('member.getDeniedIDs');
837
-		if(!$output->toBool()) return array();
837
+		if (!$output->toBool()) return array();
838 838
 		return $output->data;
839 839
 	}
840 840
 
841 841
 	function getDeniedNickNames()
842 842
 	{
843 843
 		$output = executeQueryArray('member.getDeniedNickNames');
844
-		if(!$output->toBool())
844
+		if (!$output->toBool())
845 845
 		{
846 846
 			return array();
847 847
 		}
@@ -857,7 +857,7 @@  discard block
 block discarded – undo
857 857
 		$args = new stdClass();
858 858
 		$args->user_id = $user_id;
859 859
 		$output = executeQuery('member.chkDeniedID', $args);
860
-		if($output->data->count) return true;
860
+		if ($output->data->count) return true;
861 861
 		return false;
862 862
 	}
863 863
 
@@ -869,8 +869,8 @@  discard block
 block discarded – undo
869 869
 		$args = new stdClass();
870 870
 		$args->nick_name = $nickName;
871 871
 		$output = executeQuery('member.chkDeniedNickName', $args);
872
-		if($output->data->count) return true;
873
-		if(!$output->toBool())
872
+		if ($output->data->count) return true;
873
+		if (!$output->toBool())
874 874
 		{
875 875
 			return true;
876 876
 		}
@@ -881,20 +881,20 @@  discard block
 block discarded – undo
881 881
 	 */
882 882
 	function getProfileImage($member_srl)
883 883
 	{
884
-		if(!isset($GLOBALS['__member_info__']['profile_image'][$member_srl]))
884
+		if (!isset($GLOBALS['__member_info__']['profile_image'][$member_srl]))
885 885
 		{
886 886
 			$GLOBALS['__member_info__']['profile_image'][$member_srl] = null;
887
-			$exts = array('gif','jpg','png');
888
-			for($i=0;$i<3;$i++)
887
+			$exts = array('gif', 'jpg', 'png');
888
+			for ($i = 0; $i < 3; $i++)
889 889
 			{
890 890
 				$image_name_file = sprintf('files/member_extra_info/profile_image/%s%d.%s', getNumberingPath($member_srl), $member_srl, $exts[$i]);
891
-				if(file_exists($image_name_file))
891
+				if (file_exists($image_name_file))
892 892
 				{
893 893
 					list($width, $height, $type, $attrs) = getimagesize($image_name_file);
894 894
 					$info = new stdClass();
895 895
 					$info->width = $width;
896 896
 					$info->height = $height;
897
-					$info->src = Context::getRequestUri().$image_name_file . '?' . date('YmdHis', filemtime($image_name_file));
897
+					$info->src = Context::getRequestUri().$image_name_file.'?'.date('YmdHis', filemtime($image_name_file));
898 898
 					$info->file = './'.$image_name_file;
899 899
 					$GLOBALS['__member_info__']['profile_image'][$member_srl] = $info;
900 900
 					break;
@@ -910,16 +910,16 @@  discard block
 block discarded – undo
910 910
 	 */
911 911
 	function getImageName($member_srl)
912 912
 	{
913
-		if(!isset($GLOBALS['__member_info__']['image_name'][$member_srl]))
913
+		if (!isset($GLOBALS['__member_info__']['image_name'][$member_srl]))
914 914
 		{
915 915
 			$image_name_file = sprintf('files/member_extra_info/image_name/%s%d.gif', getNumberingPath($member_srl), $member_srl);
916
-			if(file_exists($image_name_file))
916
+			if (file_exists($image_name_file))
917 917
 			{
918 918
 				list($width, $height, $type, $attrs) = getimagesize($image_name_file);
919 919
 				$info = new stdClass;
920 920
 				$info->width = $width;
921 921
 				$info->height = $height;
922
-				$info->src = Context::getRequestUri().$image_name_file. '?' . date('YmdHis', filemtime($image_name_file));
922
+				$info->src = Context::getRequestUri().$image_name_file.'?'.date('YmdHis', filemtime($image_name_file));
923 923
 				$info->file = './'.$image_name_file;
924 924
 				$GLOBALS['__member_info__']['image_name'][$member_srl] = $info;
925 925
 			}
@@ -933,15 +933,15 @@  discard block
 block discarded – undo
933 933
 	 */
934 934
 	function getImageMark($member_srl)
935 935
 	{
936
-		if(!isset($GLOBALS['__member_info__']['image_mark'][$member_srl]))
936
+		if (!isset($GLOBALS['__member_info__']['image_mark'][$member_srl]))
937 937
 		{
938 938
 			$image_mark_file = sprintf('files/member_extra_info/image_mark/%s%d.gif', getNumberingPath($member_srl), $member_srl);
939
-			if(file_exists($image_mark_file))
939
+			if (file_exists($image_mark_file))
940 940
 			{
941 941
 				list($width, $height, $type, $attrs) = getimagesize($image_mark_file);
942 942
 				$info->width = $width;
943 943
 				$info->height = $height;
944
-				$info->src = Context::getRequestUri().$image_mark_file . '?' . date('YmdHis', filemtime($image_mark_file));
944
+				$info->src = Context::getRequestUri().$image_mark_file.'?'.date('YmdHis', filemtime($image_mark_file));
945 945
 				$info->file = './'.$image_mark_file;
946 946
 				$GLOBALS['__member_info__']['image_mark'][$member_srl] = $info;
947 947
 			}
@@ -955,27 +955,27 @@  discard block
 block discarded – undo
955 955
 	/**
956 956
 	 * @brief Get the image mark of the group
957 957
 	 */
958
-	function getGroupImageMark($member_srl,$site_srl=0)
958
+	function getGroupImageMark($member_srl, $site_srl = 0)
959 959
 	{
960
-		if(!isset($GLOBALS['__member_info__']['group_image_mark'][$member_srl]))
960
+		if (!isset($GLOBALS['__member_info__']['group_image_mark'][$member_srl]))
961 961
 		{
962 962
 			$oModuleModel = getModel('module');
963 963
 			$config = $oModuleModel->getModuleConfig('member');
964
-			if($config->group_image_mark!='Y')
964
+			if ($config->group_image_mark != 'Y')
965 965
 			{
966 966
 				return null;
967 967
 			}
968
-			$member_group = $this->getMemberGroups($member_srl,$site_srl);
968
+			$member_group = $this->getMemberGroups($member_srl, $site_srl);
969 969
 			$groups_info = $this->getGroups($site_srl);
970
-			if(count($member_group) > 0 && is_array($member_group))
970
+			if (count($member_group) > 0 && is_array($member_group))
971 971
 			{
972 972
 				$memberGroups = array_keys($member_group);
973 973
 
974
-				foreach($groups_info as $group_srl=>$group_info)
974
+				foreach ($groups_info as $group_srl=>$group_info)
975 975
 				{
976
-					if(in_array($group_srl, $memberGroups))
976
+					if (in_array($group_srl, $memberGroups))
977 977
 					{
978
-						if($group_info->image_mark)
978
+						if ($group_info->image_mark)
979 979
 						{
980 980
 							$info = new stdClass();
981 981
 							$info->title = $group_info->title;
@@ -999,10 +999,10 @@  discard block
 block discarded – undo
999 999
 	 */
1000 1000
 	function getSignature($member_srl)
1001 1001
 	{
1002
-		if(!isset($GLOBALS['__member_info__']['signature'][$member_srl]))
1002
+		if (!isset($GLOBALS['__member_info__']['signature'][$member_srl]))
1003 1003
 		{
1004 1004
 			$filename = sprintf('files/member_extra_info/signature/%s%d.signature.php', getNumberingPath($member_srl), $member_srl);
1005
-			if(file_exists($filename))
1005
+			if (file_exists($filename))
1006 1006
 			{
1007 1007
 				$buff = FileHandler::readFile($filename);
1008 1008
 				$signature = preg_replace('/<\?.*?\?>/', '', $buff);
@@ -1020,10 +1020,10 @@  discard block
 block discarded – undo
1020 1020
 	 * @param int $member_srl Set this to member_srl when comparing a member's password (optional)
1021 1021
 	 * @return bool
1022 1022
 	 */
1023
-	function isValidPassword($hashed_password, $password_text, $member_srl=null)
1023
+	function isValidPassword($hashed_password, $password_text, $member_srl = null)
1024 1024
 	{
1025 1025
 		// False if no password in entered
1026
-		if(!$password_text)
1026
+		if (!$password_text)
1027 1027
 		{
1028 1028
 			return false;
1029 1029
 		}
@@ -1032,31 +1032,31 @@  discard block
 block discarded – undo
1032 1032
 		$oPassword = new Password();
1033 1033
 		$current_algorithm = $oPassword->checkAlgorithm($hashed_password);
1034 1034
 		$match = $oPassword->checkPassword($password_text, $hashed_password, $current_algorithm);
1035
-		if(!$match)
1035
+		if (!$match)
1036 1036
 		{
1037 1037
 			return false;
1038 1038
 		}
1039 1039
 		
1040 1040
 		// Update the encryption method if necessary
1041 1041
 		$config = $this->getMemberConfig();
1042
-		if($member_srl > 0 && $config->password_hashing_auto_upgrade != 'N')
1042
+		if ($member_srl > 0 && $config->password_hashing_auto_upgrade != 'N')
1043 1043
 		{
1044 1044
 			$need_upgrade = false;
1045 1045
 			
1046
-			if(!$need_upgrade)
1046
+			if (!$need_upgrade)
1047 1047
 			{
1048 1048
 				$required_algorithm = $oPassword->getCurrentlySelectedAlgorithm();
1049
-				if($required_algorithm !== $current_algorithm) $need_upgrade = true;
1049
+				if ($required_algorithm !== $current_algorithm) $need_upgrade = true;
1050 1050
 			}
1051 1051
 			
1052
-			if(!$need_upgrade)
1052
+			if (!$need_upgrade)
1053 1053
 			{
1054 1054
 				$required_work_factor = $oPassword->getWorkFactor();
1055 1055
 				$current_work_factor = $oPassword->checkWorkFactor($hashed_password);
1056
-				if($current_work_factor !== false && $required_work_factor > $current_work_factor) $need_upgrade = true;
1056
+				if ($current_work_factor !== false && $required_work_factor > $current_work_factor) $need_upgrade = true;
1057 1057
 			}
1058 1058
 			
1059
-			if($need_upgrade === true)
1059
+			if ($need_upgrade === true)
1060 1060
 			{
1061 1061
 				$args = new stdClass();
1062 1062
 				$args->member_srl = $member_srl;
@@ -1084,27 +1084,27 @@  discard block
 block discarded – undo
1084 1084
 	function checkPasswordStrength($password, $strength)
1085 1085
 	{
1086 1086
 		$logged_info = Context::get('logged_info');
1087
-		if($logged_info->is_admin == 'Y') return true;
1087
+		if ($logged_info->is_admin == 'Y') return true;
1088 1088
 		
1089
-		if($strength == NULL)
1089
+		if ($strength == NULL)
1090 1090
 		{
1091 1091
 			$config = $this->getMemberConfig();
1092
-			$strength = $config->password_strength?$config->password_strength:'normal';
1092
+			$strength = $config->password_strength ? $config->password_strength : 'normal';
1093 1093
 		}
1094 1094
 		
1095 1095
 		$length = strlen($password);
1096 1096
 		
1097 1097
 		switch ($strength) {
1098 1098
 			case 'high':
1099
-				if($length < 8 || !preg_match('/[^a-zA-Z0-9]/', $password)) return false;
1099
+				if ($length < 8 || !preg_match('/[^a-zA-Z0-9]/', $password)) return false;
1100 1100
 				/* no break */
1101 1101
 				
1102 1102
 			case 'normal':
1103
-				if($length < 6 || !preg_match('/[a-zA-Z]/', $password) || !preg_match('/[0-9]/', $password)) return false;
1103
+				if ($length < 6 || !preg_match('/[a-zA-Z]/', $password) || !preg_match('/[0-9]/', $password)) return false;
1104 1104
 				break;
1105 1105
 				
1106 1106
 			case 'low':
1107
-				if($length < 4) return false;
1107
+				if ($length < 4) return false;
1108 1108
 				break; 
1109 1109
 		}
1110 1110
 		
@@ -1115,11 +1115,11 @@  discard block
 block discarded – undo
1115 1115
 	{
1116 1116
 		$groupSrl = 0;
1117 1117
 		$output = $this->getGroups($site_srl);
1118
-		if(is_array($output))
1118
+		if (is_array($output))
1119 1119
 		{
1120
-			foreach($output AS $key=>$value)
1120
+			foreach ($output AS $key=>$value)
1121 1121
 			{
1122
-				if($value->is_admin == 'Y')
1122
+				if ($value->is_admin == 'Y')
1123 1123
 				{
1124 1124
 					$groupSrl = $value->group_srl;
1125 1125
 					break;
Please login to merge, or discard this patch.
Braces   +202 added lines, -83 removed lines patch added patch discarded remove patch
@@ -45,32 +45,68 @@  discard block
 block discarded – undo
45 45
 		foreach($config->signupForm AS $key=>$value)
46 46
 		{
47 47
 			$config->signupForm[$key]->title = ($value->isDefaultForm) ? Context::getLang($value->name) : $value->title;
48
-			if($config->signupForm[$key]->isPublic != 'N') $config->signupForm[$key]->isPublic = 'Y';
49
-			if($value->name == 'find_account_question') $config->signupForm[$key]->isPublic = 'N';
48
+			if($config->signupForm[$key]->isPublic != 'N') {
49
+				$config->signupForm[$key]->isPublic = 'Y';
50
+			}
51
+			if($value->name == 'find_account_question') {
52
+				$config->signupForm[$key]->isPublic = 'N';
53
+			}
50 54
 		}
51 55
 
52 56
 		// Get terms of user
53 57
 		$config->agreement = memberModel::_getAgreement();
54 58
 
55
-		if(!$config->webmaster_name) $config->webmaster_name = 'webmaster';
56
-		if(!$config->image_name_max_width) $config->image_name_max_width = 90;
57
-		if(!$config->image_name_max_height) $config->image_name_max_height = 20;
58
-		if(!$config->image_mark_max_width) $config->image_mark_max_width = 20;
59
-		if(!$config->image_mark_max_height) $config->image_mark_max_height = 20;
60
-		if(!$config->profile_image_max_width) $config->profile_image_max_width = 90;
61
-		if(!$config->profile_image_max_height) $config->profile_image_max_height = 90;
62
-		if(!$config->skin) $config->skin = 'default';
63
-		if(!$config->colorset) $config->colorset = 'white';
64
-		if(!$config->editor_skin || $config->editor_skin == 'default') $config->editor_skin = 'ckeditor';
65
-		if(!$config->group_image_mark) $config->group_image_mark = "N";
59
+		if(!$config->webmaster_name) {
60
+			$config->webmaster_name = 'webmaster';
61
+		}
62
+		if(!$config->image_name_max_width) {
63
+			$config->image_name_max_width = 90;
64
+		}
65
+		if(!$config->image_name_max_height) {
66
+			$config->image_name_max_height = 20;
67
+		}
68
+		if(!$config->image_mark_max_width) {
69
+			$config->image_mark_max_width = 20;
70
+		}
71
+		if(!$config->image_mark_max_height) {
72
+			$config->image_mark_max_height = 20;
73
+		}
74
+		if(!$config->profile_image_max_width) {
75
+			$config->profile_image_max_width = 90;
76
+		}
77
+		if(!$config->profile_image_max_height) {
78
+			$config->profile_image_max_height = 90;
79
+		}
80
+		if(!$config->skin) {
81
+			$config->skin = 'default';
82
+		}
83
+		if(!$config->colorset) {
84
+			$config->colorset = 'white';
85
+		}
86
+		if(!$config->editor_skin || $config->editor_skin == 'default') {
87
+			$config->editor_skin = 'ckeditor';
88
+		}
89
+		if(!$config->group_image_mark) {
90
+			$config->group_image_mark = "N";
91
+		}
66 92
 
67
-		if(!$config->identifier) $config->identifier = 'user_id';
93
+		if(!$config->identifier) {
94
+			$config->identifier = 'user_id';
95
+		}
68 96
 
69
-		if(!$config->max_error_count) $config->max_error_count = 10;
70
-		if(!$config->max_error_count_time) $config->max_error_count_time = 300;
97
+		if(!$config->max_error_count) {
98
+			$config->max_error_count = 10;
99
+		}
100
+		if(!$config->max_error_count_time) {
101
+			$config->max_error_count_time = 300;
102
+		}
71 103
 
72
-		if(!$config->signature_editor_skin || $config->signature_editor_skin == 'default') $config->signature_editor_skin = 'ckeditor';
73
-		if(!$config->sel_editor_colorset) $config->sel_editor_colorset = 'moono';
104
+		if(!$config->signature_editor_skin || $config->signature_editor_skin == 'default') {
105
+			$config->signature_editor_skin = 'ckeditor';
106
+		}
107
+		if(!$config->sel_editor_colorset) {
108
+			$config->sel_editor_colorset = 'moono';
109
+		}
74 110
 
75 111
 		$member_config = $config;
76 112
 
@@ -116,12 +152,18 @@  discard block
 block discarded – undo
116 152
 		$logged_info = Context::get('logged_info');
117 153
 		$act = Context::get('cur_act');
118 154
 		// When click user's own nickname
119
-		if($member_srl == $logged_info->member_srl) $member_info = $logged_info;
155
+		if($member_srl == $logged_info->member_srl) {
156
+			$member_info = $logged_info;
157
+		}
120 158
 		// When click other's nickname
121
-		else $member_info = $this->getMemberInfoByMemberSrl($member_srl);
159
+		else {
160
+			$member_info = $this->getMemberInfoByMemberSrl($member_srl);
161
+		}
122 162
 
123 163
 		$member_srl = $member_info->member_srl;
124
-		if(!$member_srl) return;
164
+		if(!$member_srl) {
165
+			return;
166
+		}
125 167
 		// List variables
126 168
 		$user_id = $member_info->user_id;
127 169
 		$user_name = $member_info->user_name;
@@ -156,11 +198,13 @@  discard block
 block discarded – undo
156 198
 			}
157 199
 		}
158 200
 		// View homepage info
159
-		if($member_info->homepage)
160
-			$oMemberController->addMemberPopupMenu(htmlspecialchars($member_info->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false), 'homepage', '', 'blank');
201
+		if($member_info->homepage) {
202
+					$oMemberController->addMemberPopupMenu(htmlspecialchars($member_info->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false), 'homepage', '', 'blank');
203
+		}
161 204
 		// View blog info
162
-		if($member_info->blog)
163
-			$oMemberController->addMemberPopupMenu(htmlspecialchars($member_info->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false), 'blog', '', 'blank');
205
+		if($member_info->blog) {
206
+					$oMemberController->addMemberPopupMenu(htmlspecialchars($member_info->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false), 'blog', '', 'blank');
207
+		}
164 208
 		// Call a trigger (after)
165 209
 		ModuleHandler::triggerCall('member.getMemberMenu', 'after', $null);
166 210
 		// Display a menu for editting member info to a top administrator
@@ -195,16 +239,14 @@  discard block
 block discarded – undo
195 239
 			if(Mobile::isFromMobilePhone())
196 240
 			{
197 241
 				return true;
198
-			}
199
-			elseif(filter_var($_SESSION['ipaddress'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6))
242
+			} elseif(filter_var($_SESSION['ipaddress'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6))
200 243
 			{
201 244
 				// IPv6: require same /48
202 245
 				if(strncmp(inet_pton($_SESSION['ipaddress']), inet_pton($_SERVER['REMOTE_ADDR']), 6) == 0)
203 246
 				{
204 247
 					return true;
205 248
 				}
206
-			}
207
-			else
249
+			} else
208 250
 			{
209 251
 				// IPv4: require same /24
210 252
 				if(ip2long($_SESSION['ipaddress']) >> 8 == ip2long($_SERVER['REMOTE_ADDR']) >> 8)
@@ -234,10 +276,12 @@  discard block
 block discarded – undo
234 276
 				$logged_info->group_list = $this->getMemberGroups($logged_info->member_srl, $site_module_info->site_srl);
235 277
 				// Add is_site_admin bool variable into logged_info if site_administrator is
236 278
 				$oModuleModel = getModel('module');
237
-				if($oModuleModel->isSiteAdmin($logged_info)) $logged_info->is_site_admin = true;
238
-				else $logged_info->is_site_admin = false;
239
-			}
240
-			else
279
+				if($oModuleModel->isSiteAdmin($logged_info)) {
280
+					$logged_info->is_site_admin = true;
281
+				} else {
282
+					$logged_info->is_site_admin = false;
283
+				}
284
+			} else
241 285
 			{
242 286
 				// Register a default group if the site doesn't have a member group
243 287
 				if(count($logged_info->group_list) === 0)
@@ -263,13 +307,19 @@  discard block
 block discarded – undo
263 307
 	 */
264 308
 	function getMemberInfoByUserID($user_id, $columnList = array())
265 309
 	{
266
-		if(!$user_id) return;
310
+		if(!$user_id) {
311
+			return;
312
+		}
267 313
 
268 314
 		$args = new stdClass;
269 315
 		$args->user_id = $user_id;
270 316
 		$output = executeQuery('member.getMemberInfo', $args);
271
-		if(!$output->toBool()) return $output;
272
-		if(!$output->data) return;
317
+		if(!$output->toBool()) {
318
+			return $output;
319
+		}
320
+		if(!$output->data) {
321
+			return;
322
+		}
273 323
 
274 324
 		$member_info = $this->arrangeMemberInfo($output->data);
275 325
 
@@ -281,7 +331,9 @@  discard block
 block discarded – undo
281 331
 	 */
282 332
 	function getMemberInfoByEmailAddress($email_address)
283 333
 	{
284
-		if(!$email_address) return;
334
+		if(!$email_address) {
335
+			return;
336
+		}
285 337
 
286 338
 		$args = new stdClass();
287 339
 		
@@ -290,15 +342,18 @@  discard block
 block discarded – undo
290 342
 		{
291 343
 			$args->email_address = strtolower($email_address);
292 344
 			$output = executeQuery('member.getMemberInfoByEmailAddressForCubrid', $args);
293
-		}
294
-		else
345
+		} else
295 346
 		{
296 347
 			$args->email_address = $email_address;
297 348
 			$output = executeQuery('member.getMemberInfoByEmailAddress', $args);
298 349
 		}
299 350
 		
300
-		if(!$output->toBool()) return $output;
301
-		if(!$output->data) return;
351
+		if(!$output->toBool()) {
352
+			return $output;
353
+		}
354
+		if(!$output->data) {
355
+			return;
356
+		}
302 357
 
303 358
 		$member_info = $this->arrangeMemberInfo($output->data);
304 359
 		return $member_info;
@@ -309,7 +364,9 @@  discard block
 block discarded – undo
309 364
 	 */
310 365
 	function getMemberInfoByMemberSrl($member_srl, $site_srl = 0, $columnList = array())
311 366
 	{
312
-		if(!$member_srl) return;
367
+		if(!$member_srl) {
368
+			return;
369
+		}
313 370
 
314 371
 		//columnList size zero... get full member info
315 372
 		if(!$GLOBALS['__member_info__'][$member_srl] || count($columnList) == 0)
@@ -332,13 +389,17 @@  discard block
 block discarded – undo
332 389
 				$output = executeQuery('member.getMemberInfoByMemberSrl', $args, $columnList);
333 390
 				if(!$output->data) 
334 391
 				{
335
-					if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, new stdClass);
392
+					if($oCacheHandler->isSupport()) {
393
+						$oCacheHandler->put($cache_key, new stdClass);
394
+					}
336 395
 					return;
337 396
 				}
338 397
 				$this->arrangeMemberInfo($output->data, $site_srl);
339 398
 
340 399
 				//insert in cache
341
-				if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $GLOBALS['__member_info__'][$member_srl]);
400
+				if($oCacheHandler->isSupport()) {
401
+					$oCacheHandler->put($cache_key, $GLOBALS['__member_info__'][$member_srl]);
402
+				}
342 403
 			}
343 404
 		}
344 405
 
@@ -372,8 +433,12 @@  discard block
 block discarded – undo
372 433
 			{
373 434
 				foreach($extra_vars as $key => $val)
374 435
 				{
375
-					if(!is_array($val) && strpos($val, '|@|') !== FALSE) $val = explode('|@|', $val);
376
-					if(!$info->{$key}) $info->{$key} = $val;
436
+					if(!is_array($val) && strpos($val, '|@|') !== FALSE) {
437
+						$val = explode('|@|', $val);
438
+					}
439
+					if(!$info->{$key}) {
440
+						$info->{$key} = $val;
441
+					}
377 442
 				}
378 443
 			}
379 444
 
@@ -396,8 +461,7 @@  discard block
 block discarded – undo
396 461
 					if(is_array($val))
397 462
 					{
398 463
 						$oSecurity->encodeHTML($key . '.');
399
-					}
400
-					else
464
+					} else
401 465
 					{
402 466
 						$oSecurity->encodeHTML($key);
403 467
 					}
@@ -460,7 +524,9 @@  discard block
 block discarded – undo
460 524
 	 */
461 525
 	function getLoggedMemberSrl()
462 526
 	{
463
-		if(!$this->isLogged()) return;
527
+		if(!$this->isLogged()) {
528
+			return;
529
+		}
464 530
 		return $_SESSION['member_srl'];
465 531
 	}
466 532
 
@@ -469,7 +535,9 @@  discard block
 block discarded – undo
469 535
 	 */
470 536
 	function getLoggedUserID()
471 537
 	{
472
-		if(!$this->isLogged()) return;
538
+		if(!$this->isLogged()) {
539
+			return;
540
+		}
473 541
 		$logged_info = Context::get('logged_info');
474 542
 		return $logged_info->user_id;
475 543
 	}
@@ -501,9 +569,13 @@  discard block
 block discarded – undo
501 569
 				$output = executeQueryArray('member.getMemberGroups', $args);
502 570
 				$group_list = $output->data;
503 571
 				//insert in cache
504
-				if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list);
572
+				if($oCacheHandler->isSupport()) {
573
+					$oCacheHandler->put($cache_key, $group_list);
574
+				}
575
+			}
576
+			if(!$group_list) {
577
+				return array();
505 578
 			}
506
-			if(!$group_list) return array();
507 579
 
508 580
 			foreach($group_list as $group)
509 581
 			{
@@ -523,7 +595,9 @@  discard block
 block discarded – undo
523 595
 		$args->site_srl = $site_srl;
524 596
 		$args->sort_index = 'list_order';
525 597
 		$output = executeQueryArray('member.getMembersGroups', $args);
526
-		if(!$output->data) return array();
598
+		if(!$output->data) {
599
+			return array();
600
+		}
527 601
 
528 602
 		$result = array();
529 603
 		foreach($output->data as $key=>$val)
@@ -615,7 +689,9 @@  discard block
 block discarded – undo
615 689
 				$output = executeQueryArray('member.getGroups', $args);
616 690
 				$group_list = $output->data;
617 691
 				//insert in cache
618
-				if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list);
692
+				if($oCacheHandler->isSupport()) {
693
+					$oCacheHandler->put($cache_key, $group_list);
694
+				}
619 695
 			}
620 696
 
621 697
 			if(!$group_list)
@@ -663,9 +739,13 @@  discard block
 block discarded – undo
663 739
 			$output = executeQuery('member.getJoinFormList', $args);
664 740
 			// NULL if output data deosn't exist
665 741
 			$join_form_list = $output->data;
666
-			if(!$join_form_list) return NULL;
742
+			if(!$join_form_list) {
743
+				return NULL;
744
+			}
667 745
 			// Need to unserialize because serialized array is inserted into DB in case of default_value
668
-			if(!is_array($join_form_list)) $join_form_list = array($join_form_list);
746
+			if(!is_array($join_form_list)) {
747
+				$join_form_list = array($join_form_list);
748
+			}
669 749
 			$join_form_count = count($join_form_list);
670 750
 			for($i=0;$i<$join_form_count;$i++)
671 751
 			{
@@ -682,9 +762,10 @@  discard block
 block discarded – undo
682 762
 				if(in_array($column_type, array('checkbox','select','radio')))
683 763
 				{
684 764
 					$join_form_list[$i]->default_value = unserialize($default_value);
685
-					if(!$join_form_list[$i]->default_value[0]) $join_form_list[$i]->default_value = '';
686
-				}
687
-				else
765
+					if(!$join_form_list[$i]->default_value[0]) {
766
+						$join_form_list[$i]->default_value = '';
767
+					}
768
+				} else
688 769
 				{
689 770
 					$join_form_list[$i]->default_value = '';
690 771
 				}
@@ -698,13 +779,18 @@  discard block
 block discarded – undo
698 779
 		{
699 780
 			foreach($this->join_form_list as $key => $val)
700 781
 			{
701
-				if($val->is_active != 'Y') continue;
782
+				if($val->is_active != 'Y') {
783
+					continue;
784
+				}
702 785
 				unset($obj);
703 786
 				$obj->type = $val->column_type;
704 787
 				$obj->name = $val->column_name;
705 788
 				$obj->lang = $val->column_title;
706
-				if($logged_info->is_admin != 'Y') $obj->required = $val->required=='Y'?true:false;
707
-				else $obj->required = false;
789
+				if($logged_info->is_admin != 'Y') {
790
+					$obj->required = $val->required=='Y'?true:false;
791
+				} else {
792
+					$obj->required = false;
793
+				}
708 794
 				$filter_output[] = $obj;
709 795
 
710 796
 				unset($open_obj);
@@ -755,7 +841,9 @@  discard block
 block discarded – undo
755 841
 	function getCombineJoinForm($member_info)
756 842
 	{
757 843
 		$extend_form_list = $this->getJoinFormlist();
758
-		if(!$extend_form_list) return;
844
+		if(!$extend_form_list) {
845
+			return;
846
+		}
759 847
 		// Member info is open only to an administrator and him/herself when is_private is true.
760 848
 		$logged_info = Context::get('logged_info');
761 849
 
@@ -768,7 +856,9 @@  discard block
 block discarded – undo
768 856
 			switch($item->column_type)
769 857
 			{
770 858
 				case 'checkbox' :
771
-					if($value && !is_array($value)) $value = array($value);
859
+					if($value && !is_array($value)) {
860
+						$value = array($value);
861
+					}
772 862
 					break;
773 863
 				case 'text' :
774 864
 				case 'homepage' :
@@ -782,8 +872,11 @@  discard block
 block discarded – undo
782 872
 
783 873
 			$extend_form_list[$srl]->value = $value;
784 874
 
785
-			if($member_info->{'open_'.$column_name}=='Y') $extend_form_list[$srl]->is_opened = true;
786
-			else $extend_form_list[$srl]->is_opened = false;
875
+			if($member_info->{'open_'.$column_name}=='Y') {
876
+				$extend_form_list[$srl]->is_opened = true;
877
+			} else {
878
+				$extend_form_list[$srl]->is_opened = false;
879
+			}
787 880
 		}
788 881
 		return $extend_form_list;
789 882
 	}
@@ -796,7 +889,9 @@  discard block
 block discarded – undo
796 889
 		$args->member_join_form_srl = $member_join_form_srl;
797 890
 		$output = executeQuery('member.getJoinForm', $args);
798 891
 		$join_form = $output->data;
799
-		if(!$join_form) return NULL;
892
+		if(!$join_form) {
893
+			return NULL;
894
+		}
800 895
 
801 896
 		$column_type = $join_form->column_type;
802 897
 		$default_value = $join_form->default_value;
@@ -804,8 +899,7 @@  discard block
 block discarded – undo
804 899
 		if(in_array($column_type, array('checkbox','select','radio')))
805 900
 		{
806 901
 			$join_form->default_value = unserialize($default_value);
807
-		}
808
-		else
902
+		} else
809 903
 		{
810 904
 			$join_form->default_value = '';
811 905
 		}
@@ -834,7 +928,9 @@  discard block
 block discarded – undo
834 928
 	function getDeniedIDs()
835 929
 	{
836 930
 		$output = executeQueryArray('member.getDeniedIDs');
837
-		if(!$output->toBool()) return array();
931
+		if(!$output->toBool()) {
932
+			return array();
933
+		}
838 934
 		return $output->data;
839 935
 	}
840 936
 
@@ -857,7 +953,9 @@  discard block
 block discarded – undo
857 953
 		$args = new stdClass();
858 954
 		$args->user_id = $user_id;
859 955
 		$output = executeQuery('member.chkDeniedID', $args);
860
-		if($output->data->count) return true;
956
+		if($output->data->count) {
957
+			return true;
958
+		}
861 959
 		return false;
862 960
 	}
863 961
 
@@ -869,7 +967,9 @@  discard block
 block discarded – undo
869 967
 		$args = new stdClass();
870 968
 		$args->nick_name = $nickName;
871 969
 		$output = executeQuery('member.chkDeniedNickName', $args);
872
-		if($output->data->count) return true;
970
+		if($output->data->count) {
971
+			return true;
972
+		}
873 973
 		if(!$output->toBool())
874 974
 		{
875 975
 			return true;
@@ -922,8 +1022,9 @@  discard block
 block discarded – undo
922 1022
 				$info->src = Context::getRequestUri().$image_name_file. '?' . date('YmdHis', filemtime($image_name_file));
923 1023
 				$info->file = './'.$image_name_file;
924 1024
 				$GLOBALS['__member_info__']['image_name'][$member_srl] = $info;
1025
+			} else {
1026
+				$GLOBALS['__member_info__']['image_name'][$member_srl] = null;
925 1027
 			}
926
-			else $GLOBALS['__member_info__']['image_name'][$member_srl] = null;
927 1028
 		}
928 1029
 		return $GLOBALS['__member_info__']['image_name'][$member_srl];
929 1030
 	}
@@ -944,8 +1045,9 @@  discard block
 block discarded – undo
944 1045
 				$info->src = Context::getRequestUri().$image_mark_file . '?' . date('YmdHis', filemtime($image_mark_file));
945 1046
 				$info->file = './'.$image_mark_file;
946 1047
 				$GLOBALS['__member_info__']['image_mark'][$member_srl] = $info;
1048
+			} else {
1049
+				$GLOBALS['__member_info__']['image_mark'][$member_srl] = null;
947 1050
 			}
948
-			else $GLOBALS['__member_info__']['image_mark'][$member_srl] = null;
949 1051
 		}
950 1052
 
951 1053
 		return $GLOBALS['__member_info__']['image_mark'][$member_srl];
@@ -987,9 +1089,13 @@  discard block
 block discarded – undo
987 1089
 					}
988 1090
 				}
989 1091
 			}
990
-			if (!$info) $GLOBALS['__member_info__']['group_image_mark'][$member_srl] == 'N';
1092
+			if (!$info) {
1093
+				$GLOBALS['__member_info__']['group_image_mark'][$member_srl] == 'N';
1094
+			}
1095
+		}
1096
+		if ($GLOBALS['__member_info__']['group_image_mark'][$member_srl] == 'N') {
1097
+			return null;
991 1098
 		}
992
-		if ($GLOBALS['__member_info__']['group_image_mark'][$member_srl] == 'N') return null;
993 1099
 
994 1100
 		return $GLOBALS['__member_info__']['group_image_mark'][$member_srl];
995 1101
 	}
@@ -1007,8 +1113,9 @@  discard block
 block discarded – undo
1007 1113
 				$buff = FileHandler::readFile($filename);
1008 1114
 				$signature = preg_replace('/<\?.*?\?>/', '', $buff);
1009 1115
 				$GLOBALS['__member_info__']['signature'][$member_srl] = $signature;
1116
+			} else {
1117
+				$GLOBALS['__member_info__']['signature'][$member_srl] = null;
1010 1118
 			}
1011
-			else $GLOBALS['__member_info__']['signature'][$member_srl] = null;
1012 1119
 		}
1013 1120
 		return $GLOBALS['__member_info__']['signature'][$member_srl];
1014 1121
 	}
@@ -1046,14 +1153,18 @@  discard block
 block discarded – undo
1046 1153
 			if(!$need_upgrade)
1047 1154
 			{
1048 1155
 				$required_algorithm = $oPassword->getCurrentlySelectedAlgorithm();
1049
-				if($required_algorithm !== $current_algorithm) $need_upgrade = true;
1156
+				if($required_algorithm !== $current_algorithm) {
1157
+					$need_upgrade = true;
1158
+				}
1050 1159
 			}
1051 1160
 			
1052 1161
 			if(!$need_upgrade)
1053 1162
 			{
1054 1163
 				$required_work_factor = $oPassword->getWorkFactor();
1055 1164
 				$current_work_factor = $oPassword->checkWorkFactor($hashed_password);
1056
-				if($current_work_factor !== false && $required_work_factor > $current_work_factor) $need_upgrade = true;
1165
+				if($current_work_factor !== false && $required_work_factor > $current_work_factor) {
1166
+					$need_upgrade = true;
1167
+				}
1057 1168
 			}
1058 1169
 			
1059 1170
 			if($need_upgrade === true)
@@ -1084,7 +1195,9 @@  discard block
 block discarded – undo
1084 1195
 	function checkPasswordStrength($password, $strength)
1085 1196
 	{
1086 1197
 		$logged_info = Context::get('logged_info');
1087
-		if($logged_info->is_admin == 'Y') return true;
1198
+		if($logged_info->is_admin == 'Y') {
1199
+			return true;
1200
+		}
1088 1201
 		
1089 1202
 		if($strength == NULL)
1090 1203
 		{
@@ -1096,15 +1209,21 @@  discard block
 block discarded – undo
1096 1209
 		
1097 1210
 		switch ($strength) {
1098 1211
 			case 'high':
1099
-				if($length < 8 || !preg_match('/[^a-zA-Z0-9]/', $password)) return false;
1212
+				if($length < 8 || !preg_match('/[^a-zA-Z0-9]/', $password)) {
1213
+					return false;
1214
+				}
1100 1215
 				/* no break */
1101 1216
 				
1102 1217
 			case 'normal':
1103
-				if($length < 6 || !preg_match('/[a-zA-Z]/', $password) || !preg_match('/[0-9]/', $password)) return false;
1218
+				if($length < 6 || !preg_match('/[a-zA-Z]/', $password) || !preg_match('/[0-9]/', $password)) {
1219
+					return false;
1220
+				}
1104 1221
 				break;
1105 1222
 				
1106 1223
 			case 'low':
1107
-				if($length < 4) return false;
1224
+				if($length < 4) {
1225
+					return false;
1226
+				}
1108 1227
 				break; 
1109 1228
 		}
1110 1229
 		
Please login to merge, or discard this patch.
modules/member/member.view.php 4 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -634,7 +634,7 @@
 block discarded – undo
634 634
 	/**
635 635
 	 * Spammer manage popup
636 636
 	 * 
637
-	 * @return void
637
+	 * @return Object|null
638 638
 	**/
639 639
 	function dispMemberSpammer()
640 640
 	{
Please login to merge, or discard this patch.
Braces   +77 added lines, -58 removed lines patch added patch discarded remove patch
@@ -29,16 +29,14 @@  discard block
 block discarded – undo
29 29
 		{
30 30
 			$skin = 'default';
31 31
 			$template_path = sprintf('%sskins/%s', $this->module_path, $skin);
32
-		}
33
-		else
32
+		} else
34 33
 		{
35 34
 			//check theme
36 35
 			$config_parse = explode('|@|', $skin);
37 36
 			if (count($config_parse) > 1)
38 37
 			{
39 38
 				$template_path = sprintf('./themes/%s/modules/member/', $config_parse[0]);
40
-			}
41
-			else
39
+			} else
42 40
 			{
43 41
 				$template_path = sprintf('%sskins/%s', $this->module_path, $skin);
44 42
 			}
@@ -63,14 +61,15 @@  discard block
 block discarded – undo
63 61
 		$oMemberModel = getModel('member');
64 62
 		$logged_info = Context::get('logged_info');
65 63
 		// Don't display member info to non-logged user
66
-		if(!$logged_info->member_srl) return $this->stop('msg_not_permitted');
64
+		if(!$logged_info->member_srl) {
65
+			return $this->stop('msg_not_permitted');
66
+		}
67 67
 
68 68
 		$member_srl = Context::get('member_srl');
69 69
 		if(!$member_srl && Context::get('is_logged'))
70 70
 		{
71 71
 			$member_srl = $logged_info->member_srl;
72
-		}
73
-		elseif(!$member_srl)
72
+		} elseif(!$member_srl)
74 73
 		{
75 74
 			return $this->dispMemberSignUpForm();
76 75
 		}
@@ -89,7 +88,9 @@  discard block
 block discarded – undo
89 88
 			$member_info->email_address = substr_replace($member_info->email_address, $replaceStr, $start);
90 89
 		}
91 90
 
92
-		if(!$member_info->member_srl) return $this->dispMemberSignUpForm();
91
+		if(!$member_info->member_srl) {
92
+			return $this->dispMemberSignUpForm();
93
+		}
93 94
 
94 95
 		Context::set('memberInfo', get_object_vars($member_info));
95 96
 
@@ -135,43 +136,35 @@  discard block
 block discarded – undo
135 136
 				{
136 137
 					$target = $memberInfo->profile_image;
137 138
 					$item->value = '<img src="'.$target->src.'" />';
138
-				}
139
-				elseif($formInfo->name == 'image_name' && $memberInfo->image_name)
139
+				} elseif($formInfo->name == 'image_name' && $memberInfo->image_name)
140 140
 				{
141 141
 					$target = $memberInfo->image_name;
142 142
 					$item->value = '<img src="'.$target->src.'" />';
143
-				}
144
-				elseif($formInfo->name == 'image_mark' && $memberInfo->image_mark)
143
+				} elseif($formInfo->name == 'image_mark' && $memberInfo->image_mark)
145 144
 				{
146 145
 					$target = $memberInfo->image_mark;
147 146
 					$item->value = '<img src="'.$target->src.'" />';
148
-				}
149
-				elseif($formInfo->name == 'birthday' && $memberInfo->birthday)
147
+				} elseif($formInfo->name == 'birthday' && $memberInfo->birthday)
150 148
 				{
151 149
 					$item->value = zdate($item->value, 'Y-m-d');
152 150
 				}
153
-			}
154
-			else
151
+			} else
155 152
 			{
156 153
 				$item->title = $extendFormInfo[$formInfo->member_join_form_srl]->column_title;
157 154
 				$orgValue = $extendFormInfo[$formInfo->member_join_form_srl]->value;
158 155
 				if($formInfo->type=='tel' && is_array($orgValue))
159 156
 				{
160 157
 					$item->value = implode('-', $orgValue);
161
-				}
162
-				elseif($formInfo->type=='kr_zip' && is_array($orgValue))
158
+				} elseif($formInfo->type=='kr_zip' && is_array($orgValue))
163 159
 				{
164 160
 					$item->value = implode(' ', $orgValue);
165
-				}
166
-				elseif($formInfo->type=='checkbox' && is_array($orgValue))
161
+				} elseif($formInfo->type=='checkbox' && is_array($orgValue))
167 162
 				{
168 163
 					$item->value = implode(", ",$orgValue);
169
-				}
170
-				elseif($formInfo->type=='date')
164
+				} elseif($formInfo->type=='date')
171 165
 				{
172 166
 					$item->value = zdate($orgValue, "Y-m-d");
173
-				}
174
-				else
167
+				} else
175 168
 				{
176 169
 					$item->value = nl2br($orgValue);
177 170
 				}
@@ -198,12 +191,18 @@  discard block
 block discarded – undo
198 191
 
199 192
 		$oMemberModel = getModel('member');
200 193
 		// Get the member information if logged-in
201
-		if($oMemberModel->isLogged()) return $this->stop('msg_already_logged');
194
+		if($oMemberModel->isLogged()) {
195
+			return $this->stop('msg_already_logged');
196
+		}
202 197
 		// call a trigger (before) 
203 198
 		$trigger_output = ModuleHandler::triggerCall('member.dispMemberSignUpForm', 'before', $member_config);
204
-		if(!$trigger_output->toBool()) return $trigger_output;
199
+		if(!$trigger_output->toBool()) {
200
+			return $trigger_output;
201
+		}
205 202
 		// Error appears if the member is not allowed to join
206
-		if($member_config->enable_join != 'Y') return $this->stop('msg_signup_disabled');
203
+		if($member_config->enable_join != 'Y') {
204
+			return $this->stop('msg_signup_disabled');
205
+		}
207 206
 
208 207
 		$oMemberAdminView = getAdminView('member');
209 208
 		$formTags = $oMemberAdminView->_getMemberInputTag($member_info);
@@ -244,8 +243,7 @@  discard block
 block discarded – undo
244 243
 		{
245 244
 			Context::set('identifierTitle', Context::getLang('email_address'));
246 245
 			Context::set('identifierValue', $logged_info->email_address); 
247
-		}
248
-		else
246
+		} else
249 247
 		{
250 248
 			Context::set('identifierTitle', Context::getLang('user_id'));
251 249
 			Context::set('identifierValue', $logged_info->user_id);
@@ -271,7 +269,9 @@  discard block
 block discarded – undo
271 269
 
272 270
 		$oMemberModel = getModel('member');
273 271
 		// A message appears if the user is not logged-in
274
-		if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
272
+		if(!$oMemberModel->isLogged()) {
273
+			return $this->stop('msg_not_logged');
274
+		}
275 275
 
276 276
 		$logged_info = Context::get('logged_info');
277 277
 		$member_srl = $logged_info->member_srl;
@@ -330,7 +330,9 @@  discard block
 block discarded – undo
330 330
 	{
331 331
 		$oMemberModel = getModel('member');
332 332
 		// A message appears if the user is not logged-in
333
-		if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
333
+		if(!$oMemberModel->isLogged()) {
334
+			return $this->stop('msg_not_logged');
335
+		}
334 336
 
335 337
 		$logged_info = Context::get('logged_info');
336 338
 		$member_srl = $logged_info->member_srl;
@@ -357,7 +359,9 @@  discard block
 block discarded – undo
357 359
 	{
358 360
 		$oMemberModel = getModel('member');
359 361
 		// A message appears if the user is not logged-in
360
-		if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
362
+		if(!$oMemberModel->isLogged()) {
363
+			return $this->stop('msg_not_logged');
364
+		}
361 365
 
362 366
 		$logged_info = Context::get('logged_info');
363 367
 		$args = new stdClass();
@@ -381,7 +385,9 @@  discard block
 block discarded – undo
381 385
 	{
382 386
 		$oMemberModel = getModel('member');
383 387
 		// A message appears if the user is not logged-in
384
-		if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
388
+		if(!$oMemberModel->isLogged()) {
389
+			return $this->stop('msg_not_logged');
390
+		}
385 391
 		// Get the saved document(module_srl is set to member_srl instead)
386 392
 		$logged_info = Context::get('logged_info');
387 393
 		$args = new stdClass();
@@ -420,13 +426,15 @@  discard block
 block discarded – undo
420 426
 
421 427
 		$XE_VALIDATOR_MESSAGE = Context::get('XE_VALIDATOR_MESSAGE');
422 428
 		$XE_VALIDATOR_ERROR = Context::get('XE_VALIDATOR_ERROR');
423
-		if($XE_VALIDATOR_ERROR == -11)
424
-			Context::set('XE_VALIDATOR_MESSAGE', $XE_VALIDATOR_MESSAGE . $config->limit_day_description);
429
+		if($XE_VALIDATOR_ERROR == -11) {
430
+					Context::set('XE_VALIDATOR_MESSAGE', $XE_VALIDATOR_MESSAGE . $config->limit_day_description);
431
+		}
425 432
 
426
-		if($XE_VALIDATOR_ERROR < -10 && $XE_VALIDATOR_ERROR > -21)
427
-			Context::set('referer_url', getUrl('')); 
428
-		else
429
-			Context::set('referer_url', htmlspecialchars($_SERVER['HTTP_REFERER'], ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
433
+		if($XE_VALIDATOR_ERROR < -10 && $XE_VALIDATOR_ERROR > -21) {
434
+					Context::set('referer_url', getUrl(''));
435
+		} else {
436
+					Context::set('referer_url', htmlspecialchars($_SERVER['HTTP_REFERER'], ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
437
+		}
430 438
 
431 439
 		// Set a template file
432 440
 		$this->setTemplateFile('login_form');
@@ -439,7 +447,9 @@  discard block
 block discarded – undo
439 447
 	{
440 448
 		$oMemberModel = getModel('member');
441 449
 		// A message appears if the user is not logged-in
442
-		if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
450
+		if(!$oMemberModel->isLogged()) {
451
+			return $this->stop('msg_not_logged');
452
+		}
443 453
 
444 454
 		$memberConfig = $this->member_config;
445 455
 
@@ -454,8 +464,7 @@  discard block
 block discarded – undo
454 464
 		{
455 465
 			Context::set('identifier', 'user_id');
456 466
 			Context::set('formValue', $member_info->user_id);
457
-		}
458
-		else
467
+		} else
459 468
 		{
460 469
 			Context::set('identifier', 'email_address');
461 470
 			Context::set('formValue', $member_info->email_address);
@@ -471,7 +480,9 @@  discard block
 block discarded – undo
471 480
 	{
472 481
 		$oMemberModel = getModel('member');
473 482
 		// A message appears if the user is not logged-in
474
-		if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
483
+		if(!$oMemberModel->isLogged()) {
484
+			return $this->stop('msg_not_logged');
485
+		}
475 486
 
476 487
 		$memberConfig = $this->member_config;
477 488
 
@@ -485,8 +496,7 @@  discard block
 block discarded – undo
485 496
 		{
486 497
 			Context::set('identifier', 'user_id');
487 498
 			Context::set('formValue', $member_info->user_id);
488
-		}
489
-		else
499
+		} else
490 500
 		{
491 501
 			Context::set('identifier', 'email_address');
492 502
 			Context::set('formValue', $member_info->email_address);
@@ -502,10 +512,11 @@  discard block
 block discarded – undo
502 512
 	{
503 513
 		$oMemberController = getController('member');
504 514
 		$output = $oMemberController->procMemberLogout();
505
-		if(!$output->redirect_url)
506
-			$this->setRedirectUrl(getNotEncodedUrl('act', ''));
507
-		else
508
-			$this->setRedirectUrl($output->redirect_url);
515
+		if(!$output->redirect_url) {
516
+					$this->setRedirectUrl(getNotEncodedUrl('act', ''));
517
+		} else {
518
+					$this->setRedirectUrl($output->redirect_url);
519
+		}
509 520
 
510 521
 		return;
511 522
 	}
@@ -524,7 +535,9 @@  discard block
 block discarded – undo
524 535
 	 */
525 536
 	function dispMemberFindAccount()
526 537
 	{
527
-		if(Context::get('is_logged')) return $this->stop('already_logged');
538
+		if(Context::get('is_logged')) {
539
+			return $this->stop('already_logged');
540
+		}
528 541
 
529 542
 		$config = $this->member_config;
530 543
 
@@ -538,13 +551,17 @@  discard block
 block discarded – undo
538 551
 	 */
539 552
 	function dispMemberGetTempPassword()
540 553
 	{
541
-		if(Context::get('is_logged')) return $this->stop('already_logged');
554
+		if(Context::get('is_logged')) {
555
+			return $this->stop('already_logged');
556
+		}
542 557
 
543 558
 		$user_id = Context::get('user_id');
544 559
 		$temp_password = $_SESSION['xe_temp_password_'.$user_id];
545 560
 		unset($_SESSION['xe_temp_password_'.$user_id]);
546 561
 
547
-		if(!$user_id||!$temp_password) return new Object(-1,'msg_invaild_request');
562
+		if(!$user_id||!$temp_password) {
563
+			return new Object(-1,'msg_invaild_request');
564
+		}
548 565
 
549 566
 		Context::set('temp_password', $temp_password);
550 567
 
@@ -572,8 +589,7 @@  discard block
 block discarded – undo
572 589
 			$_SESSION['auth_member_info'] = $memberInfo;
573 590
 			Context::set('memberInfo', $memberInfo);
574 591
 			$this->setTemplateFile('reset_mail');
575
-		}
576
-		else
592
+		} else
577 593
 		{
578 594
 			$this->setTemplateFile('resend_auth_mail');
579 595
 		}
@@ -615,8 +631,7 @@  discard block
 block discarded – undo
615 631
 			if($val->column_type == 'kr_zip' || $val->column_type == 'tel')
616 632
 			{
617 633
 				$js_code[] = sprintf('validator.cast("ADD_MESSAGE", ["%s[]","%s"]);', $val->column_name, $title);
618
-			}
619
-			else
634
+			} else
620 635
 			{
621 636
 				$js_code[] = sprintf('validator.cast("ADD_MESSAGE", ["%s","%s"]);', $val->column_name, $title);
622 637
 			}
@@ -638,7 +653,9 @@  discard block
 block discarded – undo
638 653
 	**/
639 654
 	function dispMemberSpammer()
640 655
 	{
641
-		if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
656
+		if(!Context::get('is_logged')) {
657
+			return new Object(-1,'msg_not_permitted');
658
+		}
642 659
 
643 660
 		$member_srl = Context::get('member_srl');
644 661
 		$module_srl = Context::get('module_srl');
@@ -649,7 +666,9 @@  discard block
 block discarded – undo
649 666
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
650 667
 		$grant = $oModuleModel->getGrant($module_info, Context::get('logged_info'));
651 668
 
652
-		if(!$grant->manager) return new Object(-1,'msg_not_permitted');
669
+		if(!$grant->manager) {
670
+			return new Object(-1,'msg_not_permitted');
671
+		}
653 672
 
654 673
 		$oMemberModel = getModel('member');
655 674
 
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -635,7 +635,7 @@
 block discarded – undo
635 635
 	 * Spammer manage popup
636 636
 	 * 
637 637
 	 * @return void
638
-	**/
638
+	 **/
639 639
 	function dispMemberSpammer()
640 640
 	{
641 641
 		if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
Please login to merge, or discard this patch.
Spacing   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
 		$skin = $this->member_config->skin;
27 27
 		// Set the template path
28
-		if(!$skin)
28
+		if (!$skin)
29 29
 		{
30 30
 			$skin = 'default';
31 31
 			$template_path = sprintf('%sskins/%s', $this->module_path, $skin);
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 
49 49
 		$oLayoutModel = getModel('layout');
50 50
 		$layout_info = $oLayoutModel->getLayout($this->member_config->layout_srl);
51
-		if($layout_info)
51
+		if ($layout_info)
52 52
 		{
53 53
 			$this->module_info->layout_srl = $this->member_config->layout_srl;
54 54
 			$this->setLayoutPath($layout_info->path);
@@ -63,14 +63,14 @@  discard block
 block discarded – undo
63 63
 		$oMemberModel = getModel('member');
64 64
 		$logged_info = Context::get('logged_info');
65 65
 		// Don't display member info to non-logged user
66
-		if(!$logged_info->member_srl) return $this->stop('msg_not_permitted');
66
+		if (!$logged_info->member_srl) return $this->stop('msg_not_permitted');
67 67
 
68 68
 		$member_srl = Context::get('member_srl');
69
-		if(!$member_srl && Context::get('is_logged'))
69
+		if (!$member_srl && Context::get('is_logged'))
70 70
 		{
71 71
 			$member_srl = $logged_info->member_srl;
72 72
 		}
73
-		elseif(!$member_srl)
73
+		elseif (!$member_srl)
74 74
 		{
75 75
 			return $this->dispMemberSignUpForm();
76 76
 		}
@@ -82,14 +82,14 @@  discard block
 block discarded – undo
82 82
 		unset($member_info->email_id);
83 83
 		unset($member_info->email_host);
84 84
 
85
-		if($logged_info->is_admin != 'Y' && ($member_info->member_srl != $logged_info->member_srl))
85
+		if ($logged_info->is_admin != 'Y' && ($member_info->member_srl != $logged_info->member_srl))
86 86
 		{
87
-			$start = strpos($member_info->email_address, '@')+1;
87
+			$start = strpos($member_info->email_address, '@') + 1;
88 88
 			$replaceStr = str_repeat('*', (strlen($member_info->email_address) - $start));
89 89
 			$member_info->email_address = substr_replace($member_info->email_address, $replaceStr, $start);
90 90
 		}
91 91
 
92
-		if(!$member_info->member_srl) return $this->dispMemberSignUpForm();
92
+		if (!$member_info->member_srl) return $this->dispMemberSignUpForm();
93 93
 
94 94
 		Context::set('memberInfo', get_object_vars($member_info));
95 95
 
@@ -107,46 +107,46 @@  discard block
 block discarded – undo
107 107
 	{
108 108
 		$logged_info = Context::get('logged_info');
109 109
 		$displayDatas = array();
110
-		foreach($memberConfig->signupForm as $no=>$formInfo)
110
+		foreach ($memberConfig->signupForm as $no=>$formInfo)
111 111
 		{
112
-			if(!$formInfo->isUse)
112
+			if (!$formInfo->isUse)
113 113
 			{
114 114
 				continue;
115 115
 			}
116 116
 
117
-			if($formInfo->name == 'password' || $formInfo->name == 'find_account_question')
117
+			if ($formInfo->name == 'password' || $formInfo->name == 'find_account_question')
118 118
 			{
119 119
 				continue;
120 120
 			}
121 121
 
122
-			if($logged_info->is_admin != 'Y' && $memberInfo->member_srl != $logged_info->member_srl && $formInfo->isPublic != 'Y')
122
+			if ($logged_info->is_admin != 'Y' && $memberInfo->member_srl != $logged_info->member_srl && $formInfo->isPublic != 'Y')
123 123
 			{
124 124
 				continue;
125 125
 			}
126 126
 
127 127
 			$item = $formInfo;
128 128
 
129
-			if($formInfo->isDefaultForm)
129
+			if ($formInfo->isDefaultForm)
130 130
 			{
131 131
 				$item->title = Context::getLang($formInfo->name);
132 132
 				$item->value = $memberInfo->{$formInfo->name};
133 133
 
134
-				if($formInfo->name == 'profile_image' && $memberInfo->profile_image)
134
+				if ($formInfo->name == 'profile_image' && $memberInfo->profile_image)
135 135
 				{
136 136
 					$target = $memberInfo->profile_image;
137 137
 					$item->value = '<img src="'.$target->src.'" />';
138 138
 				}
139
-				elseif($formInfo->name == 'image_name' && $memberInfo->image_name)
139
+				elseif ($formInfo->name == 'image_name' && $memberInfo->image_name)
140 140
 				{
141 141
 					$target = $memberInfo->image_name;
142 142
 					$item->value = '<img src="'.$target->src.'" />';
143 143
 				}
144
-				elseif($formInfo->name == 'image_mark' && $memberInfo->image_mark)
144
+				elseif ($formInfo->name == 'image_mark' && $memberInfo->image_mark)
145 145
 				{
146 146
 					$target = $memberInfo->image_mark;
147 147
 					$item->value = '<img src="'.$target->src.'" />';
148 148
 				}
149
-				elseif($formInfo->name == 'birthday' && $memberInfo->birthday)
149
+				elseif ($formInfo->name == 'birthday' && $memberInfo->birthday)
150 150
 				{
151 151
 					$item->value = zdate($item->value, 'Y-m-d');
152 152
 				}
@@ -155,19 +155,19 @@  discard block
 block discarded – undo
155 155
 			{
156 156
 				$item->title = $extendFormInfo[$formInfo->member_join_form_srl]->column_title;
157 157
 				$orgValue = $extendFormInfo[$formInfo->member_join_form_srl]->value;
158
-				if($formInfo->type=='tel' && is_array($orgValue))
158
+				if ($formInfo->type == 'tel' && is_array($orgValue))
159 159
 				{
160 160
 					$item->value = implode('-', $orgValue);
161 161
 				}
162
-				elseif($formInfo->type=='kr_zip' && is_array($orgValue))
162
+				elseif ($formInfo->type == 'kr_zip' && is_array($orgValue))
163 163
 				{
164 164
 					$item->value = implode(' ', $orgValue);
165 165
 				}
166
-				elseif($formInfo->type=='checkbox' && is_array($orgValue))
166
+				elseif ($formInfo->type == 'checkbox' && is_array($orgValue))
167 167
 				{
168
-					$item->value = implode(", ",$orgValue);
168
+					$item->value = implode(", ", $orgValue);
169 169
 				}
170
-				elseif($formInfo->type=='date')
170
+				elseif ($formInfo->type == 'date')
171 171
 				{
172 172
 					$item->value = zdate($orgValue, "Y-m-d");
173 173
 				}
@@ -198,12 +198,12 @@  discard block
 block discarded – undo
198 198
 
199 199
 		$oMemberModel = getModel('member');
200 200
 		// Get the member information if logged-in
201
-		if($oMemberModel->isLogged()) return $this->stop('msg_already_logged');
201
+		if ($oMemberModel->isLogged()) return $this->stop('msg_already_logged');
202 202
 		// call a trigger (before) 
203 203
 		$trigger_output = ModuleHandler::triggerCall('member.dispMemberSignUpForm', 'before', $member_config);
204
-		if(!$trigger_output->toBool()) return $trigger_output;
204
+		if (!$trigger_output->toBool()) return $trigger_output;
205 205
 		// Error appears if the member is not allowed to join
206
-		if($member_config->enable_join != 'Y') return $this->stop('msg_signup_disabled');
206
+		if ($member_config->enable_join != 'Y') return $this->stop('msg_signup_disabled');
207 207
 
208 208
 		$oMemberAdminView = getAdminView('member');
209 209
 		$formTags = $oMemberAdminView->_getMemberInputTag($member_info);
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 	{
227 227
 		$logged_info = Context::get('logged_info');
228 228
 		$oMemberModel = getModel('member');
229
-		if(!$oMemberModel->isLogged() || empty($logged_info))
229
+		if (!$oMemberModel->isLogged() || empty($logged_info))
230 230
 		{
231 231
 			return $this->stop('msg_not_logged');
232 232
 		}
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 		$_SESSION['rechecked_password_step'] = 'INPUT_PASSWORD';
235 235
 
236 236
 		$templateFile = $this->getTemplatePath().'rechecked_password.html';
237
-		if(!is_readable($templateFile))
237
+		if (!is_readable($templateFile))
238 238
 		{
239 239
 			$templatePath = sprintf('%sskins/default', $this->module_path);
240 240
 			$this->setTemplatePath($templatePath);
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
 	 */
260 260
 	function dispMemberModifyInfo() 
261 261
 	{
262
-		if($_SESSION['rechecked_password_step'] != 'VALIDATE_PASSWORD' && $_SESSION['rechecked_password_step'] != 'INPUT_DATA')
262
+		if ($_SESSION['rechecked_password_step'] != 'VALIDATE_PASSWORD' && $_SESSION['rechecked_password_step'] != 'INPUT_DATA')
263 263
 		{
264 264
 			$this->dispMemberModifyInfoBefore();
265 265
 			return;
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
 
272 272
 		$oMemberModel = getModel('member');
273 273
 		// A message appears if the user is not logged-in
274
-		if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
274
+		if (!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
275 275
 
276 276
 		$logged_info = Context::get('logged_info');
277 277
 		$member_srl = $logged_info->member_srl;
@@ -279,13 +279,13 @@  discard block
 block discarded – undo
279 279
 		$columnList = array('member_srl', 'user_id', 'user_name', 'nick_name', 'email_address', 'find_account_answer', 'homepage', 'blog', 'birthday', 'allow_mailing');
280 280
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
281 281
 		$member_info->signature = $oMemberModel->getSignature($member_srl);
282
-		Context::set('member_info',$member_info);
282
+		Context::set('member_info', $member_info);
283 283
 
284 284
 		// Get a list of extend join form
285 285
 		Context::set('extend_form_list', $oMemberModel->getCombineJoinForm($member_info));
286 286
 
287 287
 		// Editor of the module set for signing by calling getEditor
288
-		if($member_info->member_srl)
288
+		if ($member_info->member_srl)
289 289
 		{
290 290
 			$oEditorModel = getModel('editor');
291 291
 			$option = new stdClass();
@@ -330,15 +330,15 @@  discard block
 block discarded – undo
330 330
 	{
331 331
 		$oMemberModel = getModel('member');
332 332
 		// A message appears if the user is not logged-in
333
-		if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
333
+		if (!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
334 334
 
335 335
 		$logged_info = Context::get('logged_info');
336 336
 		$member_srl = $logged_info->member_srl;
337 337
 
338 338
 		$module_srl = Context::get('module_srl');
339
-		Context::set('module_srl',Context::get('selected_module_srl'));
340
-		Context::set('search_target','member_srl');
341
-		Context::set('search_keyword',$member_srl);
339
+		Context::set('module_srl', Context::get('selected_module_srl'));
340
+		Context::set('search_target', 'member_srl');
341
+		Context::set('search_keyword', $member_srl);
342 342
 
343 343
 		$oDocumentAdminView = getAdminView('document');
344 344
 		$oDocumentAdminView->dispDocumentAdminList();
@@ -357,12 +357,12 @@  discard block
 block discarded – undo
357 357
 	{
358 358
 		$oMemberModel = getModel('member');
359 359
 		// A message appears if the user is not logged-in
360
-		if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
360
+		if (!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
361 361
 
362 362
 		$logged_info = Context::get('logged_info');
363 363
 		$args = new stdClass();
364 364
 		$args->member_srl = $logged_info->member_srl;
365
-		$args->page = (int)Context::get('page');
365
+		$args->page = (int) Context::get('page');
366 366
 
367 367
 		$output = executeQuery('member.getScrapDocumentList', $args);
368 368
 		Context::set('total_count', $output->total_count);
@@ -381,12 +381,12 @@  discard block
 block discarded – undo
381 381
 	{
382 382
 		$oMemberModel = getModel('member');
383 383
 		// A message appears if the user is not logged-in
384
-		if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
384
+		if (!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
385 385
 		// Get the saved document(module_srl is set to member_srl instead)
386 386
 		$logged_info = Context::get('logged_info');
387 387
 		$args = new stdClass();
388 388
 		$args->member_srl = $logged_info->member_srl;
389
-		$args->page = (int)Context::get('page');
389
+		$args->page = (int) Context::get('page');
390 390
 		$args->statusList = array('TEMP');
391 391
 
392 392
 		$oDocumentModel = getModel('document');
@@ -405,9 +405,9 @@  discard block
 block discarded – undo
405 405
 	 */
406 406
 	function dispMemberLoginForm()
407 407
 	{
408
-		if(Context::get('is_logged'))
408
+		if (Context::get('is_logged'))
409 409
 		{
410
-			Context::set('redirect_url', getNotEncodedUrl('act',''));
410
+			Context::set('redirect_url', getNotEncodedUrl('act', ''));
411 411
 			$this->setTemplatePath($this->module_path.'tpl');
412 412
 			$this->setTemplateFile('redirect.html');
413 413
 			return;
@@ -420,10 +420,10 @@  discard block
 block discarded – undo
420 420
 
421 421
 		$XE_VALIDATOR_MESSAGE = Context::get('XE_VALIDATOR_MESSAGE');
422 422
 		$XE_VALIDATOR_ERROR = Context::get('XE_VALIDATOR_ERROR');
423
-		if($XE_VALIDATOR_ERROR == -11)
424
-			Context::set('XE_VALIDATOR_MESSAGE', $XE_VALIDATOR_MESSAGE . $config->limit_day_description);
423
+		if ($XE_VALIDATOR_ERROR == -11)
424
+			Context::set('XE_VALIDATOR_MESSAGE', $XE_VALIDATOR_MESSAGE.$config->limit_day_description);
425 425
 
426
-		if($XE_VALIDATOR_ERROR < -10 && $XE_VALIDATOR_ERROR > -21)
426
+		if ($XE_VALIDATOR_ERROR < -10 && $XE_VALIDATOR_ERROR > -21)
427 427
 			Context::set('referer_url', getUrl('')); 
428 428
 		else
429 429
 			Context::set('referer_url', htmlspecialchars($_SERVER['HTTP_REFERER'], ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
 	{
440 440
 		$oMemberModel = getModel('member');
441 441
 		// A message appears if the user is not logged-in
442
-		if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
442
+		if (!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
443 443
 
444 444
 		$memberConfig = $this->member_config;
445 445
 
@@ -448,9 +448,9 @@  discard block
 block discarded – undo
448 448
 
449 449
 		$columnList = array('member_srl', 'user_id');
450 450
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
451
-		Context::set('member_info',$member_info);
451
+		Context::set('member_info', $member_info);
452 452
 
453
-		if($memberConfig->identifier == 'user_id')
453
+		if ($memberConfig->identifier == 'user_id')
454 454
 		{
455 455
 			Context::set('identifier', 'user_id');
456 456
 			Context::set('formValue', $member_info->user_id);
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
 	{
472 472
 		$oMemberModel = getModel('member');
473 473
 		// A message appears if the user is not logged-in
474
-		if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
474
+		if (!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
475 475
 
476 476
 		$memberConfig = $this->member_config;
477 477
 
@@ -479,9 +479,9 @@  discard block
 block discarded – undo
479 479
 		$member_srl = $logged_info->member_srl;
480 480
 
481 481
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl);
482
-		Context::set('member_info',$member_info);
482
+		Context::set('member_info', $member_info);
483 483
 
484
-		if($memberConfig->identifier == 'user_id')
484
+		if ($memberConfig->identifier == 'user_id')
485 485
 		{
486 486
 			Context::set('identifier', 'user_id');
487 487
 			Context::set('formValue', $member_info->user_id);
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
 	{
503 503
 		$oMemberController = getController('member');
504 504
 		$output = $oMemberController->procMemberLogout();
505
-		if(!$output->redirect_url)
505
+		if (!$output->redirect_url)
506 506
 			$this->setRedirectUrl(getNotEncodedUrl('act', ''));
507 507
 		else
508 508
 			$this->setRedirectUrl($output->redirect_url);
@@ -524,7 +524,7 @@  discard block
 block discarded – undo
524 524
 	 */
525 525
 	function dispMemberFindAccount()
526 526
 	{
527
-		if(Context::get('is_logged')) return $this->stop('already_logged');
527
+		if (Context::get('is_logged')) return $this->stop('already_logged');
528 528
 
529 529
 		$config = $this->member_config;
530 530
 
@@ -538,13 +538,13 @@  discard block
 block discarded – undo
538 538
 	 */
539 539
 	function dispMemberGetTempPassword()
540 540
 	{
541
-		if(Context::get('is_logged')) return $this->stop('already_logged');
541
+		if (Context::get('is_logged')) return $this->stop('already_logged');
542 542
 
543 543
 		$user_id = Context::get('user_id');
544 544
 		$temp_password = $_SESSION['xe_temp_password_'.$user_id];
545 545
 		unset($_SESSION['xe_temp_password_'.$user_id]);
546 546
 
547
-		if(!$user_id||!$temp_password) return new Object(-1,'msg_invaild_request');
547
+		if (!$user_id || !$temp_password) return new Object(-1, 'msg_invaild_request');
548 548
 
549 549
 		Context::set('temp_password', $temp_password);
550 550
 
@@ -559,12 +559,12 @@  discard block
 block discarded – undo
559 559
 		$authMemberSrl = $_SESSION['auth_member_srl'];
560 560
 		unset($_SESSION['auth_member_srl']);
561 561
 
562
-		if(Context::get('is_logged')) 
562
+		if (Context::get('is_logged')) 
563 563
 		{
564 564
 			return $this->stop('already_logged');
565 565
 		}
566 566
 
567
-		if($authMemberSrl)
567
+		if ($authMemberSrl)
568 568
 		{
569 569
 			$oMemberModel = getModel('member');
570 570
 			$memberInfo = $oMemberModel->getMemberInfoByMemberSrl($authMemberSrl);
@@ -581,7 +581,7 @@  discard block
 block discarded – undo
581 581
 
582 582
 	function dispMemberModifyEmailAddress()
583 583
 	{
584
-		if($_SESSION['rechecked_password_step'] != 'VALIDATE_PASSWORD' && $_SESSION['rechecked_password_step'] != 'INPUT_DATA')
584
+		if ($_SESSION['rechecked_password_step'] != 'VALIDATE_PASSWORD' && $_SESSION['rechecked_password_step'] != 'INPUT_DATA')
585 585
 		{
586 586
 			Context::set('success_return_url', getUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberModifyEmailAddress'));
587 587
 			$this->dispMemberModifyInfoBefore();
@@ -609,10 +609,10 @@  discard block
 block discarded – undo
609 609
 		$js_code[] = 'if(!validator) return false;';
610 610
 
611 611
 		$errorLang = array();
612
-		foreach($extraList as $val) 
612
+		foreach ($extraList as $val) 
613 613
 		{
614 614
 			$title = str_ireplace(array('<script', '</script'), array('<scr"+"ipt', '</scr"+"ipt'), addslashes($val->column_title));
615
-			if($val->column_type == 'kr_zip' || $val->column_type == 'tel')
615
+			if ($val->column_type == 'kr_zip' || $val->column_type == 'tel')
616 616
 			{
617 617
 				$js_code[] = sprintf('validator.cast("ADD_MESSAGE", ["%s[]","%s"]);', $val->column_name, $title);
618 618
 			}
@@ -638,7 +638,7 @@  discard block
 block discarded – undo
638 638
 	**/
639 639
 	function dispMemberSpammer()
640 640
 	{
641
-		if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
641
+		if (!Context::get('is_logged')) return new Object(-1, 'msg_not_permitted');
642 642
 
643 643
 		$member_srl = Context::get('member_srl');
644 644
 		$module_srl = Context::get('module_srl');
@@ -649,7 +649,7 @@  discard block
 block discarded – undo
649 649
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
650 650
 		$grant = $oModuleModel->getGrant($module_info, Context::get('logged_info'));
651 651
 
652
-		if(!$grant->manager) return new Object(-1,'msg_not_permitted');
652
+		if (!$grant->manager) return new Object(-1, 'msg_not_permitted');
653 653
 
654 654
 		$oMemberModel = getModel('member');
655 655
 
Please login to merge, or discard this patch.
modules/menu/menu.admin.controller.php 3 patches
Doc Comments   +23 added lines, -3 removed lines patch added patch discarded remove patch
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
 
246 246
 	/**
247 247
 	 * Delete menu process method
248
-	 * @return void|Object
248
+	 * @return Object|null
249 249
 	 */
250 250
 	function procMenuAdminDelete()
251 251
 	{
@@ -304,6 +304,7 @@  discard block
 block discarded – undo
304 304
 	/**
305 305
 	 * Delete menu
306 306
 	 * Delete menu_item and xml cache files
307
+	 * @param string $menu_srl
307 308
 	 * @return Object
308 309
 	 */
309 310
 	function deleteMenu($menu_srl)
@@ -380,6 +381,7 @@  discard block
 block discarded – undo
380 381
 
381 382
 	/**
382 383
 	 * Add an item to the menu, simple version
384
+	 * @param stdClass $request
383 385
 	 * @return void
384 386
 	 */
385 387
 	public function procMenuAdminInsertItem($request = NULL)
@@ -519,6 +521,9 @@  discard block
 block discarded – undo
519 521
 		$this->setMessage('success_registed', 'info');
520 522
 	}
521 523
 
524
+	/**
525
+	 * @param boolean $isProc
526
+	 */
522 527
 	private function _insertMenu(&$request, $isProc)
523 528
 	{
524 529
 		$oDB = DB::getInstance();
@@ -584,6 +589,7 @@  discard block
 block discarded – undo
584 589
 	 * insert module by men create value
585 590
 	 * @request value of client request
586 591
 	 * @args value for menu create
592
+	 * @param stdClass $args
587 593
 	 * @return bool result of create module
588 594
 	 */
589 595
 	private function _insertModule(&$request, &$args)
@@ -641,7 +647,7 @@  discard block
 block discarded – undo
641 647
 
642 648
 	/**
643 649
 	 * Update an item to the menu, simple version
644
-	 * @return void
650
+	 * @return Object|null
645 651
 	 */
646 652
 	public function procMenuAdminUpdateItem()
647 653
 	{
@@ -842,6 +848,7 @@  discard block
 block discarded – undo
842 848
 	/**
843 849
 	 * Delete menu item ( Only include BO )
844 850
 	 * @args menu_srl, menu_item_srl, is_force
851
+	 * @param stdClass $args
845 852
 	 * @return void|Object
846 853
 	 */
847 854
 	public function deleteItem($args)
@@ -990,6 +997,9 @@  discard block
 block discarded – undo
990 997
 		return new Object(0, 'success');
991 998
 	}
992 999
 
1000
+	/**
1001
+	 * @param DB $oDB
1002
+	 */
993 1003
 	private function _recursiveDeleteMenuItem(&$oDB, &$menuInfo, $node)
994 1004
 	{
995 1005
 		$output = $this->_deleteMenuItem($oDB, $menuInfo, $node);
@@ -1009,7 +1019,7 @@  discard block
 block discarded – undo
1009 1019
 
1010 1020
 	/**
1011 1021
 	 * Move menu items
1012
-	 * @return void
1022
+	 * @return Object|null
1013 1023
 	 */
1014 1024
 	function procMenuAdminMoveItem()
1015 1025
 	{
@@ -1174,6 +1184,9 @@  discard block
 block discarded – undo
1174 1184
 		}
1175 1185
 	}
1176 1186
 
1187
+	/**
1188
+	 * @param string $parentSrl
1189
+	 */
1177 1190
 	private function _copyMenu($menuSrl, $parentSrl, &$originMenu)
1178 1191
 	{
1179 1192
 		$oMenuAdminModel = getAdminModel('menu');
@@ -2182,6 +2195,7 @@  discard block
 block discarded – undo
2182 2195
 	/**
2183 2196
 	 * When copy a menu, button copied also.
2184 2197
 	 * @param $args menuItemInfo with button values
2198
+	 * @param string $insertedMenuItemSrl
2185 2199
 	 */
2186 2200
 	private function _copyButton($insertedMenuItemSrl, $insertedMenuSrl, &$menuItemInfo)
2187 2201
 	{
@@ -2222,6 +2236,9 @@  discard block
 block discarded – undo
2222 2236
 		return $copied_info;
2223 2237
 	}
2224 2238
 
2239
+	/**
2240
+	 * @param string $mode
2241
+	 */
2225 2242
 	private function _changeMenuItemSrlInButtonPath($buttonPath, $menuSrl, $menuItemSrl, $mode)
2226 2243
 	{
2227 2244
 		$path = sprintf('./files/attach/menu_button/%d/', $menuSrl);
@@ -2231,6 +2248,9 @@  discard block
 block discarded – undo
2231 2248
 		return sprintf('%s%d.%s.%s.%s', $path, $menuItemSrl,$date,'menu_'.$mode.'_btn', $ext);
2232 2249
 	}
2233 2250
 
2251
+	/**
2252
+	 * @param integer $menuSrl
2253
+	 */
2234 2254
 	public function makeHomemenuCacheFile($menuSrl)
2235 2255
 	{
2236 2256
 		$cacheBuff .= sprintf('<?php if(!defined("__XE__")) exit();');
Please login to merge, or discard this patch.
Spacing   +298 added lines, -298 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 	}
57 57
 
58 58
 	function __construct() {
59
-		$this->homeMenuCacheFile = _XE_PATH_ . $this->homeMenuCacheFile;
59
+		$this->homeMenuCacheFile = _XE_PATH_.$this->homeMenuCacheFile;
60 60
 	}
61 61
 
62 62
 	/**
@@ -68,8 +68,8 @@  discard block
 block discarded – undo
68 68
 		// List variables
69 69
 		$site_module_info = Context::get('site_module_info');
70 70
 
71
-		$output = $this->addMenu(Context::get('title'), (int)$site_module_info->site_srl);
72
-		if(!$output->toBool()) return $output;
71
+		$output = $this->addMenu(Context::get('title'), (int) $site_module_info->site_srl);
72
+		if (!$output->toBool()) return $output;
73 73
 
74 74
 		$this->add('menu_srl', $output->get('menuSrl'));
75 75
 		$this->setMessage('success_registed');
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 		$args->listorder = $args->menu_srl * -1;
96 96
 
97 97
 		$output = executeQuery('menu.insertMenu', $args);
98
-		if(!$output->toBool())
98
+		if (!$output->toBool())
99 99
 		{
100 100
 			return $output;
101 101
 		}
@@ -109,13 +109,13 @@  discard block
 block discarded – undo
109 109
 		$unlinked_modules = false;
110 110
 		$args = new stdClass;
111 111
 		$args->site_srl = 0;
112
-		$output = executeQueryArray('module.getNotLinkedModuleBySiteSrl',$args);
113
-		if($output->toBool() && $output->data && count($output->data) > 0)
112
+		$output = executeQueryArray('module.getNotLinkedModuleBySiteSrl', $args);
113
+		if ($output->toBool() && $output->data && count($output->data) > 0)
114 114
 		{
115 115
 			$unlinked_modules = $output->data;
116 116
 		}
117 117
 
118
-		if($unlinked_modules)
118
+		if ($unlinked_modules)
119 119
 		{
120 120
 			$unlinked_menu_srl = $this->getUnlinkedMenu();
121 121
 			$output = $this->updateLinkModule($unlinked_modules, $unlinked_menu_srl);
@@ -129,21 +129,21 @@  discard block
 block discarded – undo
129 129
 		$oModuleModel = getModel('module');
130 130
 		$moduleConfig = $oModuleModel->getModuleConfig('menu');
131 131
 
132
-		if($moduleConfig->unlinked_menu_srl)
132
+		if ($moduleConfig->unlinked_menu_srl)
133 133
 		{
134 134
 			$menuArgs = new stdClass;
135 135
 			$menuArgs->menu_srl = $moduleConfig->unlinked_menu_srl;
136 136
 			$menuOutput = executeQuery('menu.getMenu', $menuArgs);
137
-			if(!$menuOutput->data)
137
+			if (!$menuOutput->data)
138 138
 			{
139 139
 				unset($moduleConfig->unlinked_menu_srl);
140 140
 			}
141 141
 		}
142 142
 
143
-		if(!$moduleConfig->unlinked_menu_srl)
143
+		if (!$moduleConfig->unlinked_menu_srl)
144 144
 		{
145 145
 			$output = $this->addMenu('unlinked', 0);
146
-			if($output->toBool())
146
+			if ($output->toBool())
147 147
 			{
148 148
 				$moduleConfig->unlinked_menu_srl = $output->get('menuSrl');
149 149
 				$oModuleController = getController('module');
@@ -168,12 +168,12 @@  discard block
 block discarded – undo
168 168
 	 */
169 169
 	function updateLinkModule($moduleInfos, $menuSrl)
170 170
 	{
171
-		if(!$moduleInfos || !is_array($moduleInfos) || count($moduleInfos) == 0 || $menuSrl == 0)
171
+		if (!$moduleInfos || !is_array($moduleInfos) || count($moduleInfos) == 0 || $menuSrl == 0)
172 172
 		{
173 173
 			return new Object(-1, 'msg_invalid_request');
174 174
 		}
175 175
 
176
-		foreach($moduleInfos as $moduleInfo)
176
+		foreach ($moduleInfos as $moduleInfo)
177 177
 		{
178 178
 			// search menu.
179 179
 			$args = new stdClass;
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 
184 184
 			$output = executeQuery('menu.getMenuItemByUrl', $args);
185 185
 
186
-			if($output->toBool() && $output->data)
186
+			if ($output->toBool() && $output->data)
187 187
 			{
188 188
 				$moduleInfo->menu_srl = $output->data->menu_srl;
189 189
 			}
@@ -194,10 +194,10 @@  discard block
 block discarded – undo
194 194
 				$item_args->url = $moduleInfo->mid;
195 195
 				$item_args->name = $moduleInfo->mid;
196 196
 				$item_args->menu_item_srl = getNextSequence();
197
-				$item_args->listorder = -1*$item_args->menu_item_srl;
197
+				$item_args->listorder = -1 * $item_args->menu_item_srl;
198 198
 
199 199
 				$output = executeQuery('menu.insertMenuItem', $item_args);
200
-				if(!$output->toBool())
200
+				if (!$output->toBool())
201 201
 				{
202 202
 					return $output;
203 203
 				}
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 		}
211 211
 
212 212
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
213
-		if($oCacheHandler->isSupport())
213
+		if ($oCacheHandler->isSupport())
214 214
 		{
215 215
 			$oCacheHandler->invalidateGroupKey('site_and_module');
216 216
 		}
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 		$args->menu_srl = Context::get('menu_srl');
236 236
 
237 237
 		$output = executeQuery('menu.updateMenu', $args);
238
-		if(!$output->toBool()) return $output;
238
+		if (!$output->toBool()) return $output;
239 239
 
240 240
 		$this->setMessage('success_registed');
241 241
 
@@ -255,14 +255,14 @@  discard block
 block discarded – undo
255 255
 		$menuInfo = $oMenuAdminModel->getMenu($menu_srl);
256 256
 
257 257
 		$oAdmin = getClass('admin');
258
-		if($menuInfo->title == $oAdmin->getAdminMenuName())
258
+		if ($menuInfo->title == $oAdmin->getAdminMenuName())
259 259
 			return new Object(-1, 'msg_adminmenu_cannot_delete');
260 260
 
261 261
 		// get menu properies with child menu
262 262
 		$phpFile = sprintf("./files/cache/menu/%s.php", $menu_srl);
263 263
 		$originMenu = NULL;
264 264
 
265
-		if(is_readable(FileHandler::getRealPath($phpFile)))
265
+		if (is_readable(FileHandler::getRealPath($phpFile)))
266 266
 		{
267 267
 			include(FileHandler::getRealPath($phpFile));
268 268
 		}
@@ -273,25 +273,25 @@  discard block
 block discarded – undo
273 273
 
274 274
 		$isStartmenuInclude = false;
275 275
 
276
-		if(is_array($menu->list))
276
+		if (is_array($menu->list))
277 277
 		{
278
-			foreach($menu->list AS $key=>$value)
278
+			foreach ($menu->list AS $key=>$value)
279 279
 			{
280 280
 				$originMenu = $value;
281 281
 				$this->_checkHomeMenuInOriginMenu($originMenu, $siteInfo->mid, $isStartmenuInclude);
282 282
 
283
-				if($isStartmenuInclude)
283
+				if ($isStartmenuInclude)
284 284
 					break;
285 285
 			}
286 286
 		}
287 287
 
288
-		if($isStartmenuInclude)
288
+		if ($isStartmenuInclude)
289 289
 		{
290 290
 			return new Object(-1, 'msg_cannot_delete_homemenu');
291 291
 		}
292 292
 
293 293
 		$output = $this->deleteMenu($menu_srl);
294
-		if(!$output->toBool())
294
+		if (!$output->toBool())
295 295
 		{
296 296
 			return new Object(-1, $output->message);
297 297
 		}
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 
320 320
 		// Delete modules
321 321
 		$output = executeQueryArray('menu.getMenuItems', $args);
322
-		if(!$output->toBool())
322
+		if (!$output->toBool())
323 323
 		{
324 324
 			return $output;
325 325
 		}
@@ -327,15 +327,15 @@  discard block
 block discarded – undo
327 327
 		$oModuleController = getController('module');
328 328
 		$oModuleModel = getModel('module');
329 329
 
330
-		foreach($output->data as $itemInfo)
330
+		foreach ($output->data as $itemInfo)
331 331
 		{
332
-			if($itemInfo->is_shortcut != 'Y' && strncasecmp('http', $itemInfo->url, 4) !== 0)
332
+			if ($itemInfo->is_shortcut != 'Y' && strncasecmp('http', $itemInfo->url, 4) !== 0)
333 333
 			{
334 334
 				$moduleInfo = $oModuleModel->getModuleInfoByMid($itemInfo->url, $menuInfo->site_srl);
335
-				if($moduleInfo->module_srl)
335
+				if ($moduleInfo->module_srl)
336 336
 				{
337 337
 					$output = $oModuleController->onlyDeleteModule($moduleInfo->module_srl);
338
-					if(!$output->toBool())
338
+					if (!$output->toBool())
339 339
 					{
340 340
 						$oDB->rollback();
341 341
 						return $output;
@@ -346,27 +346,27 @@  discard block
 block discarded – undo
346 346
 
347 347
 		// Delete menu items
348 348
 		$output = executeQuery("menu.deleteMenuItems", $args);
349
-		if(!$output->toBool())
349
+		if (!$output->toBool())
350 350
 		{
351 351
 			$oDB->rollback();
352 352
 			return $output;
353 353
 		}
354 354
 		// Delete the menu
355 355
 		$output = executeQuery("menu.deleteMenu", $args);
356
-		if(!$output->toBool())
356
+		if (!$output->toBool())
357 357
 		{
358 358
 			$oDB->rollback();
359 359
 			return $output;
360 360
 		}
361 361
 
362 362
 		// Delete cache files
363
-		$cache_list = FileHandler::readDir("./files/cache/menu","",false,true);
364
-		if(count($cache_list))
363
+		$cache_list = FileHandler::readDir("./files/cache/menu", "", false, true);
364
+		if (count($cache_list))
365 365
 		{
366
-			foreach($cache_list as $cache_file)
366
+			foreach ($cache_list as $cache_file)
367 367
 			{
368 368
 				$pos = strpos($cache_file, $menu_srl.'.');
369
-				if($pos>0)FileHandler::removeFile($cache_file);
369
+				if ($pos > 0)FileHandler::removeFile($cache_file);
370 370
 			}
371 371
 		}
372 372
 		// Delete images of menu buttons
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
 
376 376
 		$oDB->commit();
377 377
 
378
-		return new Object(0,'success_deleted');
378
+		return new Object(0, 'success_deleted');
379 379
 	}
380 380
 
381 381
 	/**
@@ -385,24 +385,24 @@  discard block
 block discarded – undo
385 385
 	public function procMenuAdminInsertItem($request = NULL)
386 386
 	{
387 387
 		$isProc = false;
388
-		if(!$request)
388
+		if (!$request)
389 389
 		{
390 390
 			$isProc = true;
391 391
 			$request = Context::getRequestVars();
392 392
 		}
393 393
 
394
-		if(!$request->parent_srl || !$request->menu_name)
394
+		if (!$request->parent_srl || !$request->menu_name)
395 395
 		{
396 396
 			return new Object(-1, 'msg_invalid_request');
397 397
 		}
398 398
 
399 399
 		$this->_setMenuSrl($request->parent_srl, $request->menu_srl);
400
-		if(!$request->menu_srl)
400
+		if (!$request->menu_srl)
401 401
 		{
402 402
 			return new Object(-1, 'msg_invalid_request');
403 403
 		}
404 404
 
405
-		if($request->is_shortcut == 'Y')
405
+		if ($request->is_shortcut == 'Y')
406 406
 		{
407 407
 			$result = $this->_insertShortcut($request);
408 408
 		}
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
 			$result = $this->_insertMenu($request, $isProc);
412 412
 		}
413 413
 
414
-		if($result->error < 0)
414
+		if ($result->error < 0)
415 415
 		{
416 416
 			return new Object($result->error, $result->message);
417 417
 		}
@@ -419,7 +419,7 @@  discard block
 block discarded – undo
419 419
 		// recreate menu cache file
420 420
 		$this->makeXmlFile($request->menu_srl);
421 421
 
422
-		if(!$isProc)
422
+		if (!$isProc)
423 423
 		{
424 424
 			return $this->get('menu_item_srl');
425 425
 		}
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
 		$oMenuAdminModel = getAdminModel('menu');
432 432
 		$itemInfo = $oMenuAdminModel->getMenuItemInfo($parent_srl);
433 433
 		// parent_srl is parent menu item's srl
434
-		if($itemInfo->menu_srl)
434
+		if ($itemInfo->menu_srl)
435 435
 		{
436 436
 			$menu_srl = $itemInfo->menu_srl;
437 437
 		}
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
 		else
440 440
 		{
441 441
 			$output = $oMenuAdminModel->getMenu($parent_srl);
442
-			if($output->menu_srl == $parent_srl)
442
+			if ($output->menu_srl == $parent_srl)
443 443
 			{
444 444
 				$menu_srl = $output->menu_srl;
445 445
 				$parent_srl = 0;
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
 		$oDB->begin();
454 454
 
455 455
 		// type is url
456
-		if(strncasecmp('http', $request->shortcut_target, 4) === 0 || preg_match('/^(\.\/|\.\.\/|\/).*$/', $request->shortcut_target))
456
+		if (strncasecmp('http', $request->shortcut_target, 4) === 0 || preg_match('/^(\.\/|\.\.\/|\/).*$/', $request->shortcut_target))
457 457
 		{
458 458
 			// set menu variable
459 459
 			$args = new stdClass();
@@ -465,27 +465,27 @@  discard block
 block discarded – undo
465 465
 			$args->is_shortcut = $request->is_shortcut;
466 466
 			$args->url = $request->shortcut_target;
467 467
 
468
-			if(!$args->open_window) $args->open_window = 'N';
469
-			if(!$args->expand) $args->expand = 'N';
470
-			if(!$args->is_shortcut) $args->is_shortcut = 'Y';
468
+			if (!$args->open_window) $args->open_window = 'N';
469
+			if (!$args->expand) $args->expand = 'N';
470
+			if (!$args->is_shortcut) $args->is_shortcut = 'Y';
471 471
 
472
-			if($request->menu_name_key) $args->name = $request->menu_name_key;
472
+			if ($request->menu_name_key) $args->name = $request->menu_name_key;
473 473
 			else $args->name = $request->menu_name;
474 474
 		}
475 475
 		// type is module short cut
476
-		else if(is_numeric($request->shortcut_target))
476
+		else if (is_numeric($request->shortcut_target))
477 477
 		{
478 478
 			// Get original information
479 479
 			$oMenuAdminModel = getAdminModel('menu');
480 480
 			$itemInfo = $oMenuAdminModel->getMenuItemInfo($request->shortcut_target);
481
-			if(!$itemInfo->menu_item_srl)
481
+			if (!$itemInfo->menu_item_srl)
482 482
 			{
483 483
 				return new Object(-1, 'msg_invalid_request');
484 484
 			}
485 485
 			unset($itemInfo->normal_btn, $itemInfo->hover_btn, $itemInfo->active_btn);
486 486
 
487 487
 			$args = $itemInfo;
488
-			if(count($args->group_srls) == 0)
488
+			if (count($args->group_srls) == 0)
489 489
 			{
490 490
 				unset($args->group_srls);
491 491
 			}
@@ -505,13 +505,13 @@  discard block
 block discarded – undo
505 505
 			$args->url = '#';
506 506
 		}
507 507
 
508
-		if($request->menu_desc) $args->desc = $request->menu_desc;
508
+		if ($request->menu_desc) $args->desc = $request->menu_desc;
509 509
 		else $args->desc = '';
510 510
 
511 511
 		$args->menu_item_srl = getNextSequence();
512
-		$args->listorder = -1*$args->menu_item_srl;
512
+		$args->listorder = -1 * $args->menu_item_srl;
513 513
 		$output = executeQuery('menu.insertMenuItem', $args);
514
-		if(!$output->toBool()) return $output;
514
+		if (!$output->toBool()) return $output;
515 515
 
516 516
 		$oDB->commit();
517 517
 
@@ -533,46 +533,46 @@  discard block
 block discarded – undo
533 533
 		$args->expand = $request->menu_expand;
534 534
 		$args->is_shortcut = $request->is_shortcut;
535 535
 
536
-		if(!$args->open_window) $args->open_window = 'N';
537
-		if(!$args->expand) $args->expand = 'N';
538
-		if(!$args->is_shortcut) $args->is_shortcut = 'N';
536
+		if (!$args->open_window) $args->open_window = 'N';
537
+		if (!$args->expand) $args->expand = 'N';
538
+		if (!$args->is_shortcut) $args->is_shortcut = 'N';
539 539
 
540
-		if($request->menu_name_key) $args->name = $request->menu_name_key;
540
+		if ($request->menu_name_key) $args->name = $request->menu_name_key;
541 541
 		else $args->name = $request->menu_name;
542 542
 
543
-		if($request->menu_desc) $args->desc = $request->menu_desc;
543
+		if ($request->menu_desc) $args->desc = $request->menu_desc;
544 544
 		else $args->desc = '';
545 545
 
546
-		if($request->module_id && strncasecmp('http', $request->module_id, 4) === 0)
546
+		if ($request->module_id && strncasecmp('http', $request->module_id, 4) === 0)
547 547
 		{
548 548
 			return new Object(-1, 'msg_invalid_request');
549 549
 		}
550 550
 
551 551
 		// when menu copy, module already copied
552
-		if($isProc)
552
+		if ($isProc)
553 553
 		{
554 554
 			$result = $this->_insertModule($request, $args);
555
-			if(!$result->toBool())
555
+			if (!$result->toBool())
556 556
 			{
557 557
 				return new Object(-1, $result->message);
558 558
 			}
559 559
 		}
560 560
 
561 561
 		// if setting button variables, set argument button variables for db insert. but not upload in this method
562
-		if($request->normal_btn) $args->normal_btn = $request->normal_btn;
563
-		if($request->hover_btn) $args->hover_btn = $request->hover_btn;
564
-		if($request->active_btn) $args->active_btn = $request->active_btn;
562
+		if ($request->normal_btn) $args->normal_btn = $request->normal_btn;
563
+		if ($request->hover_btn) $args->hover_btn = $request->hover_btn;
564
+		if ($request->active_btn) $args->active_btn = $request->active_btn;
565 565
 
566
-		if(!$request->module_id)
566
+		if (!$request->module_id)
567 567
 		{
568 568
 			return new Object(-1, 'msg_invalid_request');
569 569
 		}
570 570
 
571 571
 		$args->url = $request->module_id;
572 572
 		$args->menu_item_srl = getNextSequence();
573
-		$args->listorder = -1*$args->menu_item_srl;
573
+		$args->listorder = -1 * $args->menu_item_srl;
574 574
 		$output = executeQuery('menu.insertMenuItem', $args);
575
-		if(!$output->toBool()) return $output;
575
+		if (!$output->toBool()) return $output;
576 576
 
577 577
 		$oDB->commit();
578 578
 
@@ -604,7 +604,7 @@  discard block
 block discarded – undo
604 604
 
605 605
 		//module create
606 606
 		$site_module_info = Context::get('site_module_info');
607
-		$cmArgs->site_srl = (int)$site_module_info->site_srl;
607
+		$cmArgs->site_srl = (int) $site_module_info->site_srl;
608 608
 		$cmArgs->browser_title = $args->name;
609 609
 		$cmArgs->menu_srl = $request->menu_srl;
610 610
 		$cmArgs->layout_srl = -1;
@@ -612,13 +612,13 @@  discard block
 block discarded – undo
612 612
 		$cmArgs->is_skin_fix = 'N';
613 613
 		$cmArgs->is_mskin_fix = 'N';
614 614
 
615
-		if(Mobile::isMobileEnabled() === true)
615
+		if (Mobile::isMobileEnabled() === true)
616 616
 		{
617 617
 			$cmArgs->use_mobile = 'Y';
618 618
 		}
619 619
 
620 620
 		// if mid is empty, auto create mid
621
-		if(!$request->module_id)
621
+		if (!$request->module_id)
622 622
 		{
623 623
 			$randomMid = $this->_makeRandomMid();
624 624
 			$request->module_id = $cmArgs->module.'_'.$randomMid;
@@ -628,7 +628,7 @@  discard block
 block discarded – undo
628 628
 		// check already created module instance
629 629
 		$oModuleModel = getModel('module');
630 630
 		$output = $oModuleModel->getModuleInfoByMid($request->module_id);
631
-		if($output->module_srl)
631
+		if ($output->module_srl)
632 632
 		{
633 633
 			return new Object(-1, 'msg_module_name_exists');
634 634
 		}
@@ -647,14 +647,14 @@  discard block
 block discarded – undo
647 647
 	{
648 648
 		$request = Context::getRequestVars();
649 649
 
650
-		if(!$request->menu_item_srl || !$request->menu_name)
650
+		if (!$request->menu_item_srl || !$request->menu_name)
651 651
 		{
652 652
 			return new Object(-1, 'msg_invalid_request');
653 653
 		}
654 654
 
655 655
 		// variables set
656
-		if($request->menu_open_window != "Y") $request->menu_open_window = "N";
657
-		if($request->menu_expand != "Y") $request->menu_expand = "N";
656
+		if ($request->menu_open_window != "Y") $request->menu_open_window = "N";
657
+		if ($request->menu_expand != "Y") $request->menu_expand = "N";
658 658
 
659 659
 		// Get original information
660 660
 		$oMenuAdminModel = getAdminModel('menu');
@@ -662,19 +662,19 @@  discard block
 block discarded – undo
662 662
 		$args = $itemInfo;
663 663
 
664 664
 		// if menu type is module, check exists module and update
665
-		if($itemInfo->is_shortcut == 'Y')
665
+		if ($itemInfo->is_shortcut == 'Y')
666 666
 		{
667 667
 			// type is url
668
-			if(strncasecmp('http', $request->shortcut_target, 4) === 0 || preg_match('/^(\.\/|\.\.\/|\/).*$/', $request->shortcut_target))
668
+			if (strncasecmp('http', $request->shortcut_target, 4) === 0 || preg_match('/^(\.\/|\.\.\/|\/).*$/', $request->shortcut_target))
669 669
 			{
670 670
 				$args->url = $request->shortcut_target;
671 671
 			}
672 672
 			// type is module short cut
673
-			else if(is_numeric($request->shortcut_target))
673
+			else if (is_numeric($request->shortcut_target))
674 674
 			{
675 675
 				// Get new original information
676 676
 				$newItemInfo = $oMenuAdminModel->getMenuItemInfo($request->shortcut_target);
677
-				if(!$newItemInfo->menu_item_srl)
677
+				if (!$newItemInfo->menu_item_srl)
678 678
 				{
679 679
 					return new Object(-1, 'msg_invalid_request');
680 680
 				}
@@ -691,10 +691,10 @@  discard block
 block discarded – undo
691 691
 		{
692 692
 			// check already created module instance
693 693
 			$oModuleModel = getModel('module');
694
-			if($request->module_id != $itemInfo->url)
694
+			if ($request->module_id != $itemInfo->url)
695 695
 			{
696 696
 				$output = $oModuleModel->getModuleInfoByMid($request->module_id);
697
-				if($output->module_srl)
697
+				if ($output->module_srl)
698 698
 				{
699 699
 					return new Object(-1, 'msg_module_name_exists');
700 700
 				}
@@ -702,13 +702,13 @@  discard block
 block discarded – undo
702 702
 
703 703
 			// if not exist module, return error
704 704
 			$moduleInfo = $oModuleModel->getModuleInfoByMid($itemInfo->url);
705
-			if(!$moduleInfo)
705
+			if (!$moduleInfo)
706 706
 			{
707 707
 				return new Object(-1, 'msg_invalid_request');
708 708
 			}
709 709
 
710 710
 			$moduleInfo->mid = $request->module_id;
711
-			if($request->browser_title)
711
+			if ($request->browser_title)
712 712
 			{
713 713
 				$moduleInfo->browser_title = $request->browser_title;
714 714
 			}
@@ -717,7 +717,7 @@  discard block
 block discarded – undo
717 717
 			$args->url = $request->module_id;
718 718
 		}
719 719
 
720
-		if($request->menu_name_key)
720
+		if ($request->menu_name_key)
721 721
 		{
722 722
 			$args->name = $request->menu_name_key;
723 723
 		}
@@ -726,7 +726,7 @@  discard block
 block discarded – undo
726 726
 			$args->name = $request->menu_name;
727 727
 		}
728 728
 
729
-		if($request->menu_desc) $args->desc = $request->menu_desc;
729
+		if ($request->menu_desc) $args->desc = $request->menu_desc;
730 730
 		else $args->desc = '';
731 731
 
732 732
 		unset($args->group_srls);
@@ -754,38 +754,38 @@  discard block
 block discarded – undo
754 754
 
755 755
 		$btnOutput = $this->_uploadButton($args);
756 756
 
757
-		if($btnOutput['normal_btn'])
757
+		if ($btnOutput['normal_btn'])
758 758
 		{
759 759
 			$this->add('normal_btn', $btnOutput['normal_btn']);
760 760
 			$item_info->normal_btn = $btnOutput['normal_btn'];
761 761
 		}
762
-		if($btnOutput['hover_btn'])
762
+		if ($btnOutput['hover_btn'])
763 763
 		{
764 764
 			$this->add('hover_btn', $btnOutput['hover_btn']);
765 765
 			$item_info->hover_btn = $btnOutput['hover_btn'];
766 766
 		}
767
-		if($btnOutput['active_btn'])
767
+		if ($btnOutput['active_btn'])
768 768
 		{
769 769
 			$this->add('active_btn', $btnOutput['active_btn']);
770 770
 			$item_info->active_btn = $btnOutput['active_btn'];
771 771
 		}
772 772
 
773 773
 		// group_srls check
774
-		if(count($item_info->group_srls) == 0)
774
+		if (count($item_info->group_srls) == 0)
775 775
 		{
776 776
 			unset($item_info->group_srls);
777 777
 		}
778 778
 
779 779
 		// Button delete check
780
-		if(!$btnOutput['normal_btn'] && $args->isNormalDelete == 'Y')
780
+		if (!$btnOutput['normal_btn'] && $args->isNormalDelete == 'Y')
781 781
 		{
782 782
 			$item_info->normal_btn = '';
783 783
 		}
784
-		if(!$btnOutput['hover_btn'] && $args->isHoverDelete == 'Y')
784
+		if (!$btnOutput['hover_btn'] && $args->isHoverDelete == 'Y')
785 785
 		{
786 786
 			$item_info->hover_btn = '';
787 787
 		}
788
-		if(!$btnOutput['active_btn'] && $args->isActiveDelete == 'Y')
788
+		if (!$btnOutput['active_btn'] && $args->isActiveDelete == 'Y')
789 789
 		{
790 790
 			$item_info->active_btn = '';
791 791
 		}
@@ -825,7 +825,7 @@  discard block
 block discarded – undo
825 825
 		$args->is_force = Context::get('is_force');
826 826
 
827 827
 		$returnObj = $this->deleteItem($args);
828
-		if(is_object($returnObj))
828
+		if (is_object($returnObj))
829 829
 		{
830 830
 			$this->setError($returnObj->error);
831 831
 			$this->setMessage($returnObj->message);
@@ -854,11 +854,11 @@  discard block
 block discarded – undo
854 854
 		$args->menu_srl = $itemInfo->menu_srl;
855 855
 
856 856
 		// Display an error that the category cannot be deleted if it has a child node	603
857
-		if($args->is_force != 'Y')
857
+		if ($args->is_force != 'Y')
858 858
 		{
859 859
 			$output = executeQuery('menu.getChildMenuCount', $args);
860
-			if(!$output->toBool()) return $output;
861
-			if($output->data->count > 0)
860
+			if (!$output->toBool()) return $output;
861
+			if ($output->data->count > 0)
862 862
 			{
863 863
 				return new Object(-1001, 'msg_cannot_delete_for_child');
864 864
 			}
@@ -870,22 +870,22 @@  discard block
 block discarded – undo
870 870
 
871 871
 		// check admin menu delete
872 872
 		$oAdmin = getClass('admin');
873
-		if($menu_title == $oAdmin->getAdminMenuName() && $itemInfo->parent_srl == 0)
873
+		if ($menu_title == $oAdmin->getAdminMenuName() && $itemInfo->parent_srl == 0)
874 874
 		{
875 875
 			return $this->stop('msg_cannot_delete_for_admin_topmenu');
876 876
 		}
877 877
 
878
-		if($itemInfo->parent_srl) $parent_srl = $itemInfo->parent_srl;
878
+		if ($itemInfo->parent_srl) $parent_srl = $itemInfo->parent_srl;
879 879
 
880 880
 		// get menu properies with child menu
881 881
 		$phpFile = sprintf("./files/cache/menu/%s.php", $args->menu_srl);
882 882
 		$originMenu = NULL;
883 883
 
884
-		if(is_readable(FileHandler::getRealPath($phpFile)))
884
+		if (is_readable(FileHandler::getRealPath($phpFile)))
885 885
 		{
886 886
 			include(FileHandler::getRealPath($phpFile));
887 887
 
888
-			if(is_array($menu->list))
888
+			if (is_array($menu->list))
889 889
 			{
890 890
 				$this->_searchMenu($menu->list, $args->menu_item_srl, $originMenu);
891 891
 			}
@@ -895,7 +895,7 @@  discard block
 block discarded – undo
895 895
 		$siteInfo = $oModuleModel->getSiteInfo($menuInfo->site_srl);
896 896
 		$isStartmenuInclude = false;
897 897
 		$this->_checkHomeMenuInOriginMenu($originMenu, $siteInfo->mid, $isStartmenuInclude);
898
-		if($isStartmenuInclude)
898
+		if ($isStartmenuInclude)
899 899
 		{
900 900
 			return new Object(-1, 'msg_cannot_delete_homemenu');
901 901
 		}
@@ -919,14 +919,14 @@  discard block
 block discarded – undo
919 919
 
920 920
 	private function _checkHomeMenuInOriginMenu($originMenu, $startMid, &$isStartmenuInclude)
921 921
 	{
922
-		if($originMenu['is_shortcut'] != 'Y' && $originMenu['url'] == $startMid)
922
+		if ($originMenu['is_shortcut'] != 'Y' && $originMenu['url'] == $startMid)
923 923
 		{
924 924
 			$isStartmenuInclude = true;
925 925
 		}
926 926
 
927
-		if(!$isStartmenuInclude && is_array($originMenu['list']))
927
+		if (!$isStartmenuInclude && is_array($originMenu['list']))
928 928
 		{
929
-			foreach($originMenu['list'] AS $key=>$value)
929
+			foreach ($originMenu['list'] AS $key=>$value)
930 930
 			{
931 931
 				$this->_checkHomeMenuInOriginMenu($value, $startMid, $isStartmenuInclude);
932 932
 			}
@@ -940,7 +940,7 @@  discard block
 block discarded – undo
940 940
 		$args->menu_srl = $menuSrl;
941 941
 		$args->menu_item_srl = $node['node_srl'];
942 942
 		$output = executeQuery("menu.deleteMenuItem", $args);
943
-		if(!$output->toBool())
943
+		if (!$output->toBool())
944 944
 		{
945 945
 			$oDB->rollback();
946 946
 			return $output;
@@ -949,12 +949,12 @@  discard block
 block discarded – undo
949 949
 		// Update the xml file and get its location
950 950
 		$xml_file = $this->makeXmlFile($args->menu_srl);
951 951
 		// Delete all of image buttons
952
-		if($node['normal_btn']) FileHandler::removeFile($node['normal_btn']);
953
-		if($node['hover_btn']) FileHandler::removeFile($node['hover_btn']);
954
-		if($node['active_btn']) FileHandler::removeFile($node['active_btn']);
952
+		if ($node['normal_btn']) FileHandler::removeFile($node['normal_btn']);
953
+		if ($node['hover_btn']) FileHandler::removeFile($node['hover_btn']);
954
+		if ($node['active_btn']) FileHandler::removeFile($node['active_btn']);
955 955
 
956 956
 		// Delete module
957
-		if($node['is_shortcut'] != 'Y' && strncasecmp('http', $node['url'], 4) !== 0)
957
+		if ($node['is_shortcut'] != 'Y' && strncasecmp('http', $node['url'], 4) !== 0)
958 958
 		{
959 959
 			$oModuleController = getController('module');
960 960
 			$oModuleModel = getModel('module');
@@ -964,12 +964,12 @@  discard block
 block discarded – undo
964 964
 			$args->site_srl = $menuInfo->site_srl;
965 965
 			$args->is_shortcut = 'Y';
966 966
 			$output = executeQuery('menu.getMenuItemByUrl', $args);
967
-			if($output->data->menu_item_srl)
967
+			if ($output->data->menu_item_srl)
968 968
 			{
969 969
 				$output->data->url = '';
970 970
 				$referenceItem = $output->data;
971 971
 				$output = $this->_updateMenuItem($referenceItem);
972
-				if(!$output->toBool())
972
+				if (!$output->toBool())
973 973
 				{
974 974
 					$oDB->rollback();
975 975
 					return $output;
@@ -977,10 +977,10 @@  discard block
 block discarded – undo
977 977
 			}
978 978
 
979 979
 			$moduleInfo = $oModuleModel->getModuleInfoByMid($node['url'], $menuInfo->site_srl);
980
-			if($moduleInfo->module_srl)
980
+			if ($moduleInfo->module_srl)
981 981
 			{
982 982
 				$output = $oModuleController->onlyDeleteModule($moduleInfo->module_srl);
983
-				if(!$output->toBool())
983
+				if (!$output->toBool())
984 984
 				{
985 985
 					$oDB->rollback();
986 986
 					return $output;
@@ -993,14 +993,14 @@  discard block
 block discarded – undo
993 993
 	private function _recursiveDeleteMenuItem(&$oDB, &$menuInfo, $node)
994 994
 	{
995 995
 		$output = $this->_deleteMenuItem($oDB, $menuInfo, $node);
996
-		if(!$output->toBool())
996
+		if (!$output->toBool())
997 997
 		{
998 998
 			return new Object(-1, $output->message);
999 999
 		}
1000 1000
 
1001
-		if(is_array($node['list']))
1001
+		if (is_array($node['list']))
1002 1002
 		{
1003
-			foreach($node['list'] AS $key=>$value)
1003
+			foreach ($node['list'] AS $key=>$value)
1004 1004
 			{
1005 1005
 				$this->_recursiveDeleteMenuItem($oDB, $menuInfo, $value);
1006 1006
 			}
@@ -1013,31 +1013,31 @@  discard block
 block discarded – undo
1013 1013
 	 */
1014 1014
 	function procMenuAdminMoveItem()
1015 1015
 	{
1016
-		$mode = Context::get('mode');	//move
1017
-		$parent_srl = Context::get('parent_srl');	// Parent menu item serial number
1018
-		$source_srl = Context::get('source_srl');	// Same hierarchy's menu item serial number
1019
-		$target_srl = Context::get('target_srl');	// Self menu item serial number
1016
+		$mode = Context::get('mode'); //move
1017
+		$parent_srl = Context::get('parent_srl'); // Parent menu item serial number
1018
+		$source_srl = Context::get('source_srl'); // Same hierarchy's menu item serial number
1019
+		$target_srl = Context::get('target_srl'); // Self menu item serial number
1020 1020
 
1021
-		if(!$mode || !$parent_srl || !$target_srl) return new Object(-1,'msg_invalid_request');
1021
+		if (!$mode || !$parent_srl || !$target_srl) return new Object(-1, 'msg_invalid_request');
1022 1022
 
1023 1023
 		$oMenuAdminModel = getAdminModel('menu');
1024 1024
 
1025 1025
 		// get original menu item info for cache file recreate
1026 1026
 		$originalItemInfo = $oMenuAdminModel->getMenuItemInfo($target_srl);
1027
-		if(!$originalItemInfo->menu_item_srl)
1027
+		if (!$originalItemInfo->menu_item_srl)
1028 1028
 		{
1029 1029
 			return new Object(-1, 'msg_empty_menu_item');
1030 1030
 		}
1031 1031
 
1032 1032
 		// get menu properies with child menu
1033
-		$phpFile = sprintf(_XE_PATH_ . "files/cache/menu/%s.php", $originalItemInfo->menu_srl);
1033
+		$phpFile = sprintf(_XE_PATH_."files/cache/menu/%s.php", $originalItemInfo->menu_srl);
1034 1034
 		$originMenu = NULL;
1035 1035
 
1036
-		if(is_readable(FileHandler::getRealPath($phpFile)))
1036
+		if (is_readable(FileHandler::getRealPath($phpFile)))
1037 1037
 		{
1038 1038
 			include(FileHandler::getRealPath($phpFile));
1039 1039
 
1040
-			if(is_array($menu->list))
1040
+			if (is_array($menu->list))
1041 1041
 			{
1042 1042
 				$this->_searchMenu($menu->list, $originalItemInfo->menu_item_srl, $originMenu);
1043 1043
 			}
@@ -1046,7 +1046,7 @@  discard block
 block discarded – undo
1046 1046
 		// get target menu info for move
1047 1047
 		$targetMenuItemInfo = $oMenuAdminModel->getMenuItemInfo($parent_srl);
1048 1048
 		// if move in same sitemap
1049
-		if($targetMenuItemInfo->menu_item_srl)
1049
+		if ($targetMenuItemInfo->menu_item_srl)
1050 1050
 		{
1051 1051
 			$menu_srl = $targetMenuItemInfo->menu_srl;
1052 1052
 		}
@@ -1058,20 +1058,20 @@  discard block
 block discarded – undo
1058 1058
 			$parent_srl = 0;
1059 1059
 		}
1060 1060
 
1061
-		if(!$this->homeModuleMid)
1061
+		if (!$this->homeModuleMid)
1062 1062
 		{
1063 1063
 			$oModuleModel = getModel('module');
1064 1064
 			$oMenuAdminController = getAdminController('menu');
1065 1065
 			$columnList = array('modules.mid',);
1066 1066
 			$output = $oModuleModel->getSiteInfo(0, $columnList);
1067
-			if($output->mid)
1067
+			if ($output->mid)
1068 1068
 			{
1069 1069
 				$this->homeModuleMid = $output->mid;
1070 1070
 			}
1071 1071
 		}
1072 1072
 
1073 1073
 		$this->moveMenuItem($menu_srl, $parent_srl, $source_srl, $target_srl, $mode, $originMenu['is_shortcut'], $originMenu['url']);
1074
-		if(count($originMenu['list']) > 0)
1074
+		if (count($originMenu['list']) > 0)
1075 1075
 		{
1076 1076
 			$this->_recursiveUpdateMenuItem($originMenu['list'], $menu_srl);
1077 1077
 		}
@@ -1085,9 +1085,9 @@  discard block
 block discarded – undo
1085 1085
 
1086 1086
 	private function _recursiveUpdateMenuItem($node, $menu_srl)
1087 1087
 	{
1088
-		if(is_array($node))
1088
+		if (is_array($node))
1089 1089
 		{
1090
-			foreach($node AS $key=>$node)
1090
+			foreach ($node AS $key=>$node)
1091 1091
 			{
1092 1092
 				$args = new stdClass();
1093 1093
 				$args->menu_srl = $menu_srl;
@@ -1095,11 +1095,11 @@  discard block
 block discarded – undo
1095 1095
 				$output = $this->_updateMenuItem($args);
1096 1096
 
1097 1097
 				//module's menu_srl move also
1098
-				if($node['is_shortcut'] == 'N' && !empty($node['url']))
1098
+				if ($node['is_shortcut'] == 'N' && !empty($node['url']))
1099 1099
 				{
1100 1100
 					$oModuleModel = getModel('module');
1101 1101
 					$moduleInfo = $oModuleModel->getModuleInfoByMid($node['url']);
1102
-					if($menu_srl != $moduleInfo->menu_srl)
1102
+					if ($menu_srl != $moduleInfo->menu_srl)
1103 1103
 					{
1104 1104
 						$moduleInfo->menu_srl = $menu_srl;
1105 1105
 						$oModuleController = getController('module');
@@ -1107,7 +1107,7 @@  discard block
 block discarded – undo
1107 1107
 					}
1108 1108
 				}
1109 1109
 
1110
-				if(count($node['list']) > 0)
1110
+				if (count($node['list']) > 0)
1111 1111
 				{
1112 1112
 					$this->_recursiveUpdateMenuItem($node['list'], $menu_srl);
1113 1113
 				}
@@ -1129,21 +1129,21 @@  discard block
 block discarded – undo
1129 1129
 		$menuSrl = $itemInfo->menu_srl;
1130 1130
 
1131 1131
 		// get menu properies with child menu
1132
-		$phpFile = sprintf(_XE_PATH_ . "files/cache/menu/%s.php", $menuSrl);
1132
+		$phpFile = sprintf(_XE_PATH_."files/cache/menu/%s.php", $menuSrl);
1133 1133
 		$originMenu = NULL;
1134 1134
 
1135
-		if(is_readable(FileHandler::getRealPath($phpFile)))
1135
+		if (is_readable(FileHandler::getRealPath($phpFile)))
1136 1136
 		{
1137 1137
 			include(FileHandler::getRealPath($phpFile));
1138 1138
 
1139
-			if(is_array($menu->list))
1139
+			if (is_array($menu->list))
1140 1140
 			{
1141 1141
 				$this->_searchMenu($menu->list, $menuItemSrl, $originMenu);
1142 1142
 			}
1143 1143
 		}
1144 1144
 
1145 1145
 		// copy the menu item with recursively
1146
-		if(is_array($originMenu))
1146
+		if (is_array($originMenu))
1147 1147
 		{
1148 1148
 			$this->_copyMenu($menuSrl, $parentSrl, $originMenu);
1149 1149
 		}
@@ -1159,15 +1159,15 @@  discard block
 block discarded – undo
1159 1159
 	 */
1160 1160
 	private function _searchMenu(&$menuList, $menuItemSrl, &$originMenu)
1161 1161
 	{
1162
-		if(array_key_exists($menuItemSrl, $menuList))
1162
+		if (array_key_exists($menuItemSrl, $menuList))
1163 1163
 		{
1164 1164
 			$originMenu = $menuList[$menuItemSrl];
1165 1165
 			return;
1166 1166
 		}
1167 1167
 
1168
-		foreach($menuList AS $key=>$value)
1168
+		foreach ($menuList AS $key=>$value)
1169 1169
 		{
1170
-			if(count($value['list']) > 0)
1170
+			if (count($value['list']) > 0)
1171 1171
 			{
1172 1172
 				$this->_searchMenu($value['list'], $menuItemSrl, $originMenu);
1173 1173
 			}
@@ -1182,7 +1182,7 @@  discard block
 block discarded – undo
1182 1182
 		// default argument setting
1183 1183
 		$args = new stdClass();
1184 1184
 		$args->menu_srl = $menuSrl;
1185
-		if($parentSrl == 0) $args->parent_srl = $menuSrl;
1185
+		if ($parentSrl == 0) $args->parent_srl = $menuSrl;
1186 1186
 		else $args->parent_srl = $parentSrl;
1187 1187
 		$args->menu_name_key = $originMenu['text'];
1188 1188
 		$args->menu_name = $originMenu['text'];
@@ -1195,7 +1195,7 @@  discard block
 block discarded – undo
1195 1195
 
1196 1196
 		$isModuleCopySuccess = false;
1197 1197
 		// if menu have a reference of module instance
1198
-		if($menuItemInfo->is_shortcut == 'N' && strncasecmp('http', $originMenu['url'], 4) !== 0 )
1198
+		if ($menuItemInfo->is_shortcut == 'N' && strncasecmp('http', $originMenu['url'], 4) !== 0)
1199 1199
 		{
1200 1200
 			$oModuleModel = getModel('module');
1201 1201
 			$moduleInfo = $oModuleModel->getModuleInfoByMid($originMenu['url']);
@@ -1215,22 +1215,22 @@  discard block
 block discarded – undo
1215 1215
 
1216 1216
 			$args->module_srl = $copiedModuleSrl;
1217 1217
 
1218
-			if($copiedModuleSrl)
1218
+			if ($copiedModuleSrl)
1219 1219
 			{
1220 1220
 				$isModuleCopySuccess = true;
1221 1221
 			}
1222 1222
 		}
1223 1223
 		// if menu type is shortcut
1224
-		else if($menuItemInfo->is_shortcut == 'Y')
1224
+		else if ($menuItemInfo->is_shortcut == 'Y')
1225 1225
 		{
1226 1226
 			$args->shortcut_target = $originMenu['url'];
1227 1227
 			$isModuleCopySuccess = true;
1228 1228
 		}
1229 1229
 
1230
-		if($isModuleCopySuccess)
1230
+		if ($isModuleCopySuccess)
1231 1231
 		{
1232 1232
 			// if have a group permission
1233
-			if($menuItemInfo->group_srls)
1233
+			if ($menuItemInfo->group_srls)
1234 1234
 			{
1235 1235
 				$args->group_srls = $menuItemInfo->group_srls;
1236 1236
 			}
@@ -1244,12 +1244,12 @@  discard block
 block discarded – undo
1244 1244
 
1245 1245
 			// if have a button, copy a button image also
1246 1246
 			$insertedMenuItemSrl = $this->get('menu_item_srl');
1247
-			if($menuItemInfo->normal_btn || $menuItemInfo->hover_btn || $menuItemInfo->active_btn)
1247
+			if ($menuItemInfo->normal_btn || $menuItemInfo->hover_btn || $menuItemInfo->active_btn)
1248 1248
 			{
1249 1249
 				// copy & upate
1250 1250
 				$update_item_info = $oMenuAdminModel->getMenuItemInfo($insertedMenuItemSrl);
1251
-				$copied_info = $this->_copyButton($insertedMenuItemSrl,$update_item_info->menu_srl, $menuItemInfo);
1252
-				if(count($update_item_info->group_srls) == 0)
1251
+				$copied_info = $this->_copyButton($insertedMenuItemSrl, $update_item_info->menu_srl, $menuItemInfo);
1252
+				if (count($update_item_info->group_srls) == 0)
1253 1253
 				{
1254 1254
 					unset($update_item_info->group_srls);
1255 1255
 				}
@@ -1263,7 +1263,7 @@  discard block
 block discarded – undo
1263 1263
 
1264 1264
 		// if have a child menu, copy child menu also
1265 1265
 		$childMenu = array_shift($originMenu['list']);
1266
-		if(count($childMenu) > 0)
1266
+		if (count($childMenu) > 0)
1267 1267
 		{
1268 1268
 			$this->_copyMenu($menuSrl, $insertedMenuItemSrl, $childMenu);
1269 1269
 		}
@@ -1273,10 +1273,10 @@  discard block
 block discarded – undo
1273 1273
 	{
1274 1274
 		$time = $_SERVER['REQUEST_TIME'];
1275 1275
 		$randomString = "";
1276
-		for($i=0;$i<4;$i++)
1276
+		for ($i = 0; $i < 4; $i++)
1277 1277
 		{
1278 1278
 			$case = rand(0, 1);
1279
-			if($case) $doc = rand(65, 90);
1279
+			if ($case) $doc = rand(65, 90);
1280 1280
 			else $doc = rand(97, 122);
1281 1281
 
1282 1282
 			$randomString .= chr($doc);
@@ -1300,32 +1300,32 @@  discard block
 block discarded – undo
1300 1300
 		// menu name update
1301 1301
 		$args->menu_srl = $this->menuSrl;
1302 1302
 		$output = executeQuery('menu.updateMenu', $args);
1303
-		if(!$output->toBool()) return $output;
1303
+		if (!$output->toBool()) return $output;
1304 1304
 
1305 1305
 		$this->map = array();
1306
-		if(is_array($parentKeyList))
1306
+		if (is_array($parentKeyList))
1307 1307
 		{
1308
-			foreach($parentKeyList as $no=>$srl)
1308
+			foreach ($parentKeyList as $no=>$srl)
1309 1309
 			{
1310
-				if($srl === 0) continue;
1311
-				if(!is_array($this->map[$srl]))$this->map[$srl] = array();
1310
+				if ($srl === 0) continue;
1311
+				if (!is_array($this->map[$srl]))$this->map[$srl] = array();
1312 1312
 				$this->map[$srl][] = $no;
1313 1313
 			}
1314 1314
 		}
1315 1315
 
1316 1316
 		$result = array();
1317
-		if(is_array($this->itemKeyList))
1317
+		if (is_array($this->itemKeyList))
1318 1318
 		{
1319
-			foreach($this->itemKeyList as $srl)
1319
+			foreach ($this->itemKeyList as $srl)
1320 1320
 			{
1321
-				if(!$this->checked[$srl])
1321
+				if (!$this->checked[$srl])
1322 1322
 				{
1323 1323
 					$target = new stdClass();
1324 1324
 					$this->checked[$srl] = 1;
1325 1325
 					$target->node = $srl;
1326
-					$target->child= array();
1326
+					$target->child = array();
1327 1327
 
1328
-					while(count($this->map[$srl]))
1328
+					while (count($this->map[$srl]))
1329 1329
 					{
1330 1330
 						$this->_setParent($srl, array_shift($this->map[$srl]), $target);
1331 1331
 					}
@@ -1334,13 +1334,13 @@  discard block
 block discarded – undo
1334 1334
 			}
1335 1335
 		}
1336 1336
 
1337
-		if(is_array($result))
1337
+		if (is_array($result))
1338 1338
 		{
1339 1339
 			$i = 0;
1340
-			foreach($result AS $key=>$node)
1340
+			foreach ($result AS $key=>$node)
1341 1341
 			{
1342
-				$this->moveMenuItem($this->menuSrl, 0, $i, $node->node, 'move');	//move parent node
1343
-				$this->_recursiveMoveMenuItem($node);	//move child node
1342
+				$this->moveMenuItem($this->menuSrl, 0, $i, $node->node, 'move'); //move parent node
1343
+				$this->_recursiveMoveMenuItem($node); //move child node
1344 1344
 				$i = $node->node;
1345 1345
 			}
1346 1346
 		}
@@ -1369,7 +1369,7 @@  discard block
 block discarded – undo
1369 1369
 		$child_node->child = array();
1370 1370
 		$target->child[] = $child_node;
1371 1371
 
1372
-		while(count($this->map[$child_srl]))
1372
+		while (count($this->map[$child_srl]))
1373 1373
 		{
1374 1374
 			$this->_setParent($child_srl, array_shift($this->map[$child_srl]), $child_node);
1375 1375
 		}
@@ -1384,7 +1384,7 @@  discard block
 block discarded – undo
1384 1384
 	function _recursiveMoveMenuItem($result)
1385 1385
 	{
1386 1386
 		$i = 0;
1387
-		while(count($result->child))
1387
+		while (count($result->child))
1388 1388
 		{
1389 1389
 			unset($node);
1390 1390
 			$node = array_shift($result->child);
@@ -1404,48 +1404,48 @@  discard block
 block discarded – undo
1404 1404
 	 * @param string $mode 'move' or 'insert'
1405 1405
 	 * @return void
1406 1406
 	 */
1407
-	function moveMenuItem($menu_srl, $parent_srl, $source_srl, $target_srl, $mode, $isShortcut='Y', $url=NULL)
1407
+	function moveMenuItem($menu_srl, $parent_srl, $source_srl, $target_srl, $mode, $isShortcut = 'Y', $url = NULL)
1408 1408
 	{
1409 1409
 		// Get the original menus
1410 1410
 		$oMenuAdminModel = getAdminModel('menu');
1411 1411
 
1412 1412
 		$target_item = $oMenuAdminModel->getMenuItemInfo($target_srl);
1413
-		if($target_item->menu_item_srl != $target_srl) return new Object(-1,'msg_invalid_request');
1413
+		if ($target_item->menu_item_srl != $target_srl) return new Object(-1, 'msg_invalid_request');
1414 1414
 		// Move the menu location(change the order menu appears)
1415
-		if($mode == 'move')
1415
+		if ($mode == 'move')
1416 1416
 		{
1417 1417
 			$args = new stdClass();
1418 1418
 			$args->parent_srl = $parent_srl;
1419 1419
 			$args->menu_srl = $menu_srl;
1420 1420
 
1421
-			if($source_srl)
1421
+			if ($source_srl)
1422 1422
 			{
1423 1423
 				$source_item = $oMenuAdminModel->getMenuItemInfo($source_srl);
1424
-				if($source_item->menu_item_srl != $source_srl) return new Object(-1,'msg_invalid_request');
1425
-				$args->listorder = $source_item->listorder-1;
1424
+				if ($source_item->menu_item_srl != $source_srl) return new Object(-1, 'msg_invalid_request');
1425
+				$args->listorder = $source_item->listorder - 1;
1426 1426
 			}
1427 1427
 			else
1428 1428
 			{
1429 1429
 				$output = executeQuery('menu.getMaxListorder', $args);
1430
-				if(!$output->toBool()) return $output;
1431
-				$args->listorder = (int)$output->data->listorder;
1432
-				if(!$args->listorder) $args->listorder= 0;
1430
+				if (!$output->toBool()) return $output;
1431
+				$args->listorder = (int) $output->data->listorder;
1432
+				if (!$args->listorder) $args->listorder = 0;
1433 1433
 			}
1434 1434
 			$args->parent_srl = $parent_srl;
1435 1435
 			$output = executeQuery('menu.updateMenuItemListorder', $args);
1436
-			if(!$output->toBool()) return $output;
1436
+			if (!$output->toBool()) return $output;
1437 1437
 
1438 1438
 			$args->parent_srl = $parent_srl;
1439 1439
 			$args->menu_item_srl = $target_srl;
1440 1440
 			$output = executeQuery('menu.updateMenuItemNode', $args);
1441
-			if(!$output->toBool()) return $output;
1441
+			if (!$output->toBool()) return $output;
1442 1442
 
1443 1443
 			//module's menu_srl move also
1444
-			if($isShortcut == 'N' && !empty($url))
1444
+			if ($isShortcut == 'N' && !empty($url))
1445 1445
 			{
1446 1446
 				$oModuleModel = getModel('module');
1447 1447
 				$moduleInfo = $oModuleModel->getModuleInfoByMid($url);
1448
-				if($menu_srl != $moduleInfo->menu_srl)
1448
+				if ($menu_srl != $moduleInfo->menu_srl)
1449 1449
 				{
1450 1450
 					$moduleInfo->menu_srl = $menu_srl;
1451 1451
 					$oModuleController = getController('module');
@@ -1453,13 +1453,13 @@  discard block
 block discarded – undo
1453 1453
 				}
1454 1454
 
1455 1455
 				// change home menu cache file
1456
-				if($url == $this->homeModuleMid)
1456
+				if ($url == $this->homeModuleMid)
1457 1457
 				{
1458
-					if(file_exists($this->homeMenuCacheFile))
1458
+					if (file_exists($this->homeMenuCacheFile))
1459 1459
 					{
1460 1460
 						include($this->homeMenuCacheFile);
1461 1461
 					}
1462
-					if(!$homeMenuSrl || $homeMenuSrl != $menu_srl)
1462
+					if (!$homeMenuSrl || $homeMenuSrl != $menu_srl)
1463 1463
 					{
1464 1464
 						$this->makeHomemenuCacheFile($menu_srl);
1465 1465
 					}
@@ -1467,13 +1467,13 @@  discard block
 block discarded – undo
1467 1467
 			}
1468 1468
 			// Add a child
1469 1469
 		}
1470
-		elseif($mode == 'insert')
1470
+		elseif ($mode == 'insert')
1471 1471
 		{
1472 1472
 			$args->menu_item_srl = $target_srl;
1473 1473
 			$args->parent_srl = $parent_srl;
1474
-			$args->listorder = -1*getNextSequence();
1474
+			$args->listorder = -1 * getNextSequence();
1475 1475
 			$output = executeQuery('menu.updateMenuItemNode', $args);
1476
-			if(!$output->toBool()) return $output;
1476
+			if (!$output->toBool()) return $output;
1477 1477
 		}
1478 1478
 
1479 1479
 		$xml_file = $this->makeXmlFile($menu_srl);
@@ -1498,8 +1498,8 @@  discard block
 block discarded – undo
1498 1498
 		// Re-generate the xml file
1499 1499
 		$xml_file = $this->makeXmlFile($menu_srl);
1500 1500
 		// Set return value
1501
-		$this->add('menu_title',$menu_title);
1502
-		$this->add('xml_file',$xml_file);
1501
+		$this->add('menu_title', $menu_title);
1502
+		$this->add('xml_file', $xml_file);
1503 1503
 	}
1504 1504
 
1505 1505
 	/**
@@ -1513,12 +1513,12 @@  discard block
 block discarded – undo
1513 1513
 		$target = Context::get('target');
1514 1514
 		$target_file = Context::get($target);
1515 1515
 		// Error occurs when the target is neither a uploaded file nor a valid file
1516
-		if(!$menu_srl || !$menu_item_srl)
1516
+		if (!$menu_srl || !$menu_item_srl)
1517 1517
 		{
1518 1518
 			Context::set('error_messge', Context::getLang('msg_invalid_request'));
1519 1519
 
1520 1520
 		}
1521
-		else if(!$target_file || !is_uploaded_file($target_file['tmp_name']) || !preg_match('/\.(gif|jpeg|jpg|png)$/i',$target_file['name'])  || !checkUploadedFile($target_file['tmp_name']))
1521
+		else if (!$target_file || !is_uploaded_file($target_file['tmp_name']) || !preg_match('/\.(gif|jpeg|jpg|png)$/i', $target_file['name']) || !checkUploadedFile($target_file['tmp_name']))
1522 1522
 		{
1523 1523
 			Context::set('error_messge', Context::getLang('msg_invalid_request'));
1524 1524
 		}
@@ -1526,13 +1526,13 @@  discard block
 block discarded – undo
1526 1526
 		// Move the file to a specific director if the uploaded file meets requirement
1527 1527
 		else
1528 1528
 		{
1529
-			$tmp_arr = explode('.',$target_file['name']);
1530
-			$ext = $tmp_arr[count($tmp_arr)-1];
1529
+			$tmp_arr = explode('.', $target_file['name']);
1530
+			$ext = $tmp_arr[count($tmp_arr) - 1];
1531 1531
 
1532 1532
 			$path = sprintf('./files/attach/menu_button/%d/', $menu_srl);
1533 1533
 			$filename = sprintf('%s%d.%s.%s', $path, $menu_item_srl, $target, $ext);
1534 1534
 
1535
-			if(!is_dir($path)) FileHandler::makeDir($path);
1535
+			if (!is_dir($path)) FileHandler::makeDir($path);
1536 1536
 
1537 1537
 			move_uploaded_file($target_file['tmp_name'], $filename);
1538 1538
 			Context::set('filename', $filename);
@@ -1565,14 +1565,14 @@  discard block
 block discarded – undo
1565 1565
 	{
1566 1566
 		$oModuleModel = getModel('module');
1567 1567
 		$installed_module_list = $oModuleModel->getModulesXmlInfo();
1568
-		if(is_array($installed_module_list))
1568
+		if (is_array($installed_module_list))
1569 1569
 		{
1570 1570
 			$currentLang = Context::getLangType();
1571 1571
 			$menuList = array();
1572
-			foreach($installed_module_list AS $key=>$value)
1572
+			foreach ($installed_module_list AS $key=>$value)
1573 1573
 			{
1574 1574
 				$info = $oModuleModel->getModuleActionXml($value->module);
1575
-				if($info->menu) $menuList[$value->module] = $info->menu;
1575
+				if ($info->menu) $menuList[$value->module] = $info->menu;
1576 1576
 				unset($info->menu);
1577 1577
 			}
1578 1578
 		}
@@ -1604,8 +1604,8 @@  discard block
 block discarded – undo
1604 1604
 		$info = $oModuleModel->getModuleActionXml($moduleName);
1605 1605
 
1606 1606
 		$url = getNotEncodedFullUrl('', 'module', 'admin', 'act', $info->menu->{$menuName}->index);
1607
-		if(empty($url)) $url = getNotEncodedFullUrl('', 'module', 'admin', 'act', $info->admin_index_act);
1608
-		if(empty($url)) $url = getNotEncodedFullUrl('', 'module', 'admin');
1607
+		if (empty($url)) $url = getNotEncodedFullUrl('', 'module', 'admin', 'act', $info->admin_index_act);
1608
+		if (empty($url)) $url = getNotEncodedFullUrl('', 'module', 'admin');
1609 1609
 		$dbInfo = Context::getDBInfo();
1610 1610
 
1611 1611
 		$args = new stdClass();
@@ -1614,7 +1614,7 @@  discard block
 block discarded – undo
1614 1614
 		$args->menu_srl = $requestArgs->menu_srl;
1615 1615
 		$args->name = sprintf('{$lang->menu_gnb_sub[\'%s\']}', $menuName);
1616 1616
 		//if now page is https...
1617
-		if(strpos($url, 'https') !== false)
1617
+		if (strpos($url, 'https') !== false)
1618 1618
 		{
1619 1619
 			$args->url = str_replace('https'.substr($dbInfo->default_url, 4), '', $url);
1620 1620
 		}
@@ -1628,23 +1628,23 @@  discard block
 block discarded – undo
1628 1628
 		$args->hover_btn = '';
1629 1629
 		$args->active_btn = '';
1630 1630
 		$args->group_srls = implode(',', array_keys($groupSrlList));
1631
-		$args->listorder = -1*$args->menu_item_srl;
1631
+		$args->listorder = -1 * $args->menu_item_srl;
1632 1632
 
1633 1633
 		// Check if already exists
1634 1634
 		$oMenuModel = getAdminModel('menu');
1635 1635
 		$item_info = $oMenuModel->getMenuItemInfo($args->menu_item_srl);
1636 1636
 		// Update if exists
1637
-		if($item_info->menu_item_srl == $args->menu_item_srl)
1637
+		if ($item_info->menu_item_srl == $args->menu_item_srl)
1638 1638
 		{
1639 1639
 			$output = $this->_updateMenuItem($args);
1640
-			if(!$output->toBool()) return $output;
1640
+			if (!$output->toBool()) return $output;
1641 1641
 		}
1642 1642
 		// Insert if not exist
1643 1643
 		else
1644 1644
 		{
1645
-			$args->listorder = -1*$args->menu_item_srl;
1645
+			$args->listorder = -1 * $args->menu_item_srl;
1646 1646
 			$output = executeQuery('menu.insertMenuItem', $args);
1647
-			if(!$output->toBool()) return $output;
1647
+			if (!$output->toBool()) return $output;
1648 1648
 		}
1649 1649
 		// Get information of the menu
1650 1650
 		$menu_info = $oMenuModel->getMenu($args->menu_srl);
@@ -1672,23 +1672,23 @@  discard block
 block discarded – undo
1672 1672
 
1673 1673
 		// Menu Exposure update
1674 1674
 		// if exposure target is only login user...
1675
-		if(!$exposure)
1675
+		if (!$exposure)
1676 1676
 		{
1677 1677
 			$args->group_srls = '';
1678 1678
 		}
1679 1679
 		else
1680 1680
 		{
1681 1681
 			$exposure = explode(',', $exposure);
1682
-			if(in_array($exposure, array('-1','-3')))
1682
+			if (in_array($exposure, array('-1', '-3')))
1683 1683
 			{
1684 1684
 				$args->group_srls = $exposure;
1685 1685
 			}
1686 1686
 
1687
-			if($exposure) $args->group_srls = implode(',', $exposure);
1687
+			if ($exposure) $args->group_srls = implode(',', $exposure);
1688 1688
 		}
1689 1689
 
1690 1690
 		$output = $this->_updateMenuItem($args);
1691
-		if(!$output->toBool())
1691
+		if (!$output->toBool())
1692 1692
 		{
1693 1693
 			return $output;
1694 1694
 		}
@@ -1704,7 +1704,7 @@  discard block
 block discarded – undo
1704 1704
 		$xml_info = $oModuleModel->getModuleActionXML($moduleInfo->module);
1705 1705
 
1706 1706
 		$grantList = $xml_info->grant;
1707
-		if(!$grantList) $grantList = new stdClass;
1707
+		if (!$grantList) $grantList = new stdClass;
1708 1708
 
1709 1709
 		$grantList->access = new stdClass();
1710 1710
 		$grantList->access->default = 'guest';
@@ -1712,9 +1712,9 @@  discard block
 block discarded – undo
1712 1712
 		$grantList->manager->default = 'manager';
1713 1713
 
1714 1714
 		$grant = new stdClass;
1715
-		foreach($grantList AS $grantName=>$grantInfo)
1715
+		foreach ($grantList AS $grantName=>$grantInfo)
1716 1716
 		{
1717
-			if(!$htPerm[$grantName])
1717
+			if (!$htPerm[$grantName])
1718 1718
 			{
1719 1719
 				continue;
1720 1720
 			}
@@ -1722,7 +1722,7 @@  discard block
 block discarded – undo
1722 1722
 			$htPerm[$grantName] = explode(',', $htPerm[$grantName]);
1723 1723
 
1724 1724
 			// users in a particular group
1725
-			if(is_array($htPerm[$grantName]))
1725
+			if (is_array($htPerm[$grantName]))
1726 1726
 			{
1727 1727
 				$grant->{$grantName} = $htPerm[$grantName];
1728 1728
 				continue;
@@ -1736,7 +1736,7 @@  discard block
 block discarded – undo
1736 1736
 			$grant->{$group_srls} = array();
1737 1737
 		}
1738 1738
 
1739
-		if(count($grant))
1739
+		if (count($grant))
1740 1740
 		{
1741 1741
 			$oModuleController = getController('module');
1742 1742
 			$oModuleController->insertModuleGrants($moduleInfo->module_srl, $grant);
@@ -1754,15 +1754,15 @@  discard block
 block discarded – undo
1754 1754
 	function makeXmlFile($menu_srl)
1755 1755
 	{
1756 1756
 		// Return if there is no information when creating the xml file
1757
-		if(!$menu_srl) return;
1757
+		if (!$menu_srl) return;
1758 1758
 		// Get menu informaton
1759 1759
 		$args = new stdClass();
1760 1760
 		$args->menu_srl = $menu_srl;
1761 1761
 		$output = executeQuery('menu.getMenu', $args);
1762
-		if(!$output->toBool() || !$output->data) return $output;
1763
-		$site_srl = (int)$output->data->site_srl;
1762
+		if (!$output->toBool() || !$output->data) return $output;
1763
+		$site_srl = (int) $output->data->site_srl;
1764 1764
 
1765
-		if($site_srl)
1765
+		if ($site_srl)
1766 1766
 		{
1767 1767
 			$oModuleModel = getModel('module');
1768 1768
 			$columnList = array('sites.domain');
@@ -1773,13 +1773,13 @@  discard block
 block discarded – undo
1773 1773
 		$args->menu_srl = $menu_srl;
1774 1774
 		$args->sort_index = 'listorder';
1775 1775
 		$output = executeQuery('menu.getMenuItems', $args);
1776
-		if(!$output->toBool()) return;
1776
+		if (!$output->toBool()) return;
1777 1777
 		// Specify the name of the cache file
1778
-		$xml_file = sprintf(_XE_PATH_ . "files/cache/menu/%s.xml.php", $menu_srl);
1779
-		$php_file = sprintf(_XE_PATH_ . "files/cache/menu/%s.php", $menu_srl);
1778
+		$xml_file = sprintf(_XE_PATH_."files/cache/menu/%s.xml.php", $menu_srl);
1779
+		$php_file = sprintf(_XE_PATH_."files/cache/menu/%s.php", $menu_srl);
1780 1780
 		// If no data found, generate an XML file without node data
1781 1781
 		$list = $output->data;
1782
-		if(!$list)
1782
+		if (!$list)
1783 1783
 		{
1784 1784
 			$xml_buff = "<root />";
1785 1785
 			FileHandler::writeFile($xml_file, $xml_buff);
@@ -1787,10 +1787,10 @@  discard block
 block discarded – undo
1787 1787
 			return $xml_file;
1788 1788
 		}
1789 1789
 		// Change to an array if only a single data is obtained
1790
-		if(!is_array($list)) $list = array($list);
1790
+		if (!is_array($list)) $list = array($list);
1791 1791
 		// Create a tree for loop
1792 1792
 		$list_count = count($list);
1793
-		for($i=0;$i<$list_count;$i++)
1793
+		for ($i = 0; $i < $list_count; $i++)
1794 1794
 		{
1795 1795
 			$node = $list[$i];
1796 1796
 			$menu_item_srl = $node->menu_item_srl;
@@ -1846,7 +1846,7 @@  discard block
 block discarded – undo
1846 1846
 		$php_buff = sprintf(
1847 1847
 			'<?php '.
1848 1848
 			'if(!defined("__XE__")) exit(); '.
1849
-			'$menu = new stdClass();' .
1849
+			'$menu = new stdClass();'.
1850 1850
 			'%s; '.
1851 1851
 			'%s; '.
1852 1852
 			'$menu->list = array(%s); '.
@@ -1875,26 +1875,26 @@  discard block
 block discarded – undo
1875 1875
 	 */
1876 1876
 	function getXmlTree($source_node, $tree, $site_srl, $domain)
1877 1877
 	{
1878
-		if(!$source_node) return;
1878
+		if (!$source_node) return;
1879 1879
 
1880 1880
 		$oMenuAdminModel = getAdminModel('menu');
1881 1881
 
1882
-		foreach($source_node as $menu_item_srl => $node)
1882
+		foreach ($source_node as $menu_item_srl => $node)
1883 1883
 		{
1884 1884
 			$child_buff = "";
1885 1885
 			// Get data of the child nodes
1886
-			if($menu_item_srl&&$tree[$menu_item_srl]) $child_buff = $this->getXmlTree($tree[$menu_item_srl], $tree, $site_srl, $domain);
1886
+			if ($menu_item_srl && $tree[$menu_item_srl]) $child_buff = $this->getXmlTree($tree[$menu_item_srl], $tree, $site_srl, $domain);
1887 1887
 			// List variables
1888 1888
 			$names = $oMenuAdminModel->getMenuItemNames($node->name, $site_srl);
1889
-			foreach($names as $key => $val)
1889
+			foreach ($names as $key => $val)
1890 1890
 			{
1891
-				$name_arr_str .= sprintf('"%s"=>\'%s\',',$key, str_replace(array('\\', '\''), array('\\\\', '\\\''), $val));
1891
+				$name_arr_str .= sprintf('"%s"=>\'%s\',', $key, str_replace(array('\\', '\''), array('\\\\', '\\\''), $val));
1892 1892
 			}
1893 1893
 			$name_str = sprintf('$_names = array(%s); print $_names[$lang_type];', $name_arr_str);
1894 1894
 
1895
-			$url = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->url);
1896
-			$desc = str_replace(array('&','"',"'"),array('&amp;','&quot;','\\\''),$node->desc);
1897
-			if(preg_match('/^([0-9a-zA-Z\_\-]+)$/', $node->url))
1895
+			$url = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $node->url);
1896
+			$desc = str_replace(array('&', '"', "'"), array('&amp;', '&quot;', '\\\''), $node->desc);
1897
+			if (preg_match('/^([0-9a-zA-Z\_\-]+)$/', $node->url))
1898 1898
 			{
1899 1899
 				$href = "getSiteUrl('$domain', '','mid','$node->url')";
1900 1900
 			}
@@ -1904,21 +1904,21 @@  discard block
 block discarded – undo
1904 1904
 			$expand = $node->expand;
1905 1905
 
1906 1906
 			$normal_btn = $node->normal_btn;
1907
-			if($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) $normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$normal_btn);
1907
+			if ($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) $normal_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $normal_btn);
1908 1908
 			else $normal_btn = '';
1909 1909
 			$hover_btn = $node->hover_btn;
1910
-			if($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) $hover_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$hover_btn);
1910
+			if ($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) $hover_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $hover_btn);
1911 1911
 			else $hover_btn = '';
1912 1912
 			$active_btn = $node->active_btn;
1913
-			if($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) $active_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$active_btn);
1913
+			if ($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) $active_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $active_btn);
1914 1914
 			else $active_btn = '';
1915 1915
 
1916 1916
 			$group_srls = $node->group_srls;
1917 1917
 
1918
-			if($normal_btn)
1918
+			if ($normal_btn)
1919 1919
 			{
1920
-				if($hover_btn) $hover_str = sprintf('onmouseover=&quot;this.src=\'%s\'&quot;', $hover_btn); else $hover_str = '';
1921
-				if($active_btn) $active_str = sprintf('onmousedown=&quot;this.src=\'%s\'&quot;', $active_btn); else $active_str = '';
1920
+				if ($hover_btn) $hover_str = sprintf('onmouseover=&quot;this.src=\'%s\'&quot;', $hover_btn); else $hover_str = '';
1921
+				if ($active_btn) $active_str = sprintf('onmousedown=&quot;this.src=\'%s\'&quot;', $active_btn); else $active_str = '';
1922 1922
 				$link = sprintf('&lt;img src=&quot;%s&quot; onmouseout=&quot;this.src=\'%s\'&quot; alt=&quot;<?php print htmlspecialchars($_names[$lang_type], ENT_COMPAT | ENT_HTML401, \'UTF-8\', false) ?>&quot; %s %s /&gt;', $normal_btn, $normal_btn, $hover_str, $active_str);
1923 1923
 			}
1924 1924
 			else
@@ -1926,7 +1926,7 @@  discard block
 block discarded – undo
1926 1926
 				$link = '<?php print $_names[$lang_type]; ?>';
1927 1927
 			}
1928 1928
 			// If the value of node->group_srls exists
1929
-			if($group_srls)$group_check_code = sprintf('($is_admin==true||(is_array($group_srls)&&count(array_intersect($group_srls, array(%s))))||($is_logged&&%s))',$group_srls,$group_srls == -1?1:0);
1929
+			if ($group_srls)$group_check_code = sprintf('($is_admin==true||(is_array($group_srls)&&count(array_intersect($group_srls, array(%s))))||($is_logged&&%s))', $group_srls, $group_srls == -1 ? 1 : 0);
1930 1930
 			else $group_check_code = "true";
1931 1931
 			$attribute = sprintf(
1932 1932
 				'node_srl="%s" parent_srl="%s" menu_name_key=\'%s\' text="<?php if(%s) { %s }?>" url="<?php print(%s?"%s":"")?>" href="<?php print(%s?%s:"")?>" is_shortcut="%s" desc="%s" open_window="%s" expand="%s" normal_btn="%s" hover_btn="%s" active_btn="%s" link="<?php if(%s) {?>%s<?php }?>"',
@@ -1950,8 +1950,8 @@  discard block
 block discarded – undo
1950 1950
 				$link
1951 1951
 			);
1952 1952
 
1953
-			if($child_buff) $buff .= sprintf('<node %s>%s</node>', $attribute, $child_buff);
1954
-			else $buff .=  sprintf('<node %s />', $attribute);
1953
+			if ($child_buff) $buff .= sprintf('<node %s>%s</node>', $attribute, $child_buff);
1954
+			else $buff .= sprintf('<node %s />', $attribute);
1955 1955
 		}
1956 1956
 		return $buff;
1957 1957
 	}
@@ -1970,84 +1970,84 @@  discard block
 block discarded – undo
1970 1970
 	function getPhpCacheCode($source_node, $tree, $site_srl, $domain)
1971 1971
 	{
1972 1972
 		$output = array("buff"=>"", "url_list"=>array());
1973
-		if(!$source_node) return $output;
1973
+		if (!$source_node) return $output;
1974 1974
 
1975 1975
 		$oMenuAdminModel = getAdminModel('menu');
1976 1976
 
1977
-		foreach($source_node as $menu_item_srl => $node)
1977
+		foreach ($source_node as $menu_item_srl => $node)
1978 1978
 		{
1979 1979
 			// Get data from child nodes if exist.
1980
-			if($menu_item_srl&&$tree[$menu_item_srl]) $child_output = $this->getPhpCacheCode($tree[$menu_item_srl], $tree, $site_srl, $domain);
1980
+			if ($menu_item_srl && $tree[$menu_item_srl]) $child_output = $this->getPhpCacheCode($tree[$menu_item_srl], $tree, $site_srl, $domain);
1981 1981
 			else $child_output = array("buff"=>"", "url_list"=>array());
1982 1982
 
1983 1983
 			// List variables
1984 1984
 			$names = $oMenuAdminModel->getMenuItemNames($node->name, $site_srl);
1985 1985
 			unset($name_arr_str);
1986
-			foreach($names as $key => $val)
1986
+			foreach ($names as $key => $val)
1987 1987
 			{
1988
-				if(preg_match('/\{\$lang->menu_gnb(?:_sub)?\[\'([a-zA-Z_]+)\'\]\}/', $val) === 1)
1988
+				if (preg_match('/\{\$lang->menu_gnb(?:_sub)?\[\'([a-zA-Z_]+)\'\]\}/', $val) === 1)
1989 1989
 				{
1990 1990
 					$name_arr_str .= sprintf('"%s"=>"%s",', $key, $val);
1991 1991
 				}
1992 1992
 				else
1993 1993
 				{
1994
-					$name_arr_str .= sprintf('"%s"=>\'%s\',', $key, str_replace(array('\\','\''), array('\\\\','\\\''), strip_tags($val)));
1994
+					$name_arr_str .= sprintf('"%s"=>\'%s\',', $key, str_replace(array('\\', '\''), array('\\\\', '\\\''), strip_tags($val)));
1995 1995
 				}
1996 1996
 			}
1997 1997
 			$name_str = sprintf('$_menu_names[%d] = array(%s); %s', $node->menu_item_srl, $name_arr_str, $child_output['name']);
1998 1998
 
1999 1999
 			// If url value is not empty in the current node, put the value into an array url_list
2000
-			if($node->url) $child_output['url_list'][] = $node->url;
2000
+			if ($node->url) $child_output['url_list'][] = $node->url;
2001 2001
 			$output['url_list'] = array_merge($output['url_list'], $child_output['url_list']);
2002 2002
 			// If node->group_srls value exists
2003
-			if($node->group_srls)$group_check_code = sprintf('($is_admin==true||(is_array($group_srls)&&count(array_intersect($group_srls, array(%s))))||($is_logged && %s))',$node->group_srls,$node->group_srls == -1?1:0);
2003
+			if ($node->group_srls)$group_check_code = sprintf('($is_admin==true||(is_array($group_srls)&&count(array_intersect($group_srls, array(%s))))||($is_logged && %s))', $node->group_srls, $node->group_srls == -1 ? 1 : 0);
2004 2004
 			else $group_check_code = "true";
2005 2005
 
2006 2006
 			// List variables
2007
-			$href = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->href);
2008
-			$url = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->url);
2009
-			$desc = str_replace(array('&','"',"'"),array('&amp;','&quot;','\\\''),$node->desc);
2010
-			if(preg_match('/^([0-9a-zA-Z\_\-]+)$/i', $node->url))
2007
+			$href = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $node->href);
2008
+			$url = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $node->url);
2009
+			$desc = str_replace(array('&', '"', "'"), array('&amp;', '&quot;', '\\\''), $node->desc);
2010
+			if (preg_match('/^([0-9a-zA-Z\_\-]+)$/i', $node->url))
2011 2011
 			{
2012 2012
 				$href = "getSiteUrl('$domain', '','mid','$node->url')";
2013 2013
 			}
2014 2014
 			else $href = sprintf('"%s"', $url);
2015 2015
 			$is_shortcut = $node->is_shortcut;
2016 2016
 			$open_window = $node->open_window;
2017
-			$normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->normal_btn);
2018
-			$hover_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->hover_btn);
2019
-			$active_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->active_btn);
2017
+			$normal_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $node->normal_btn);
2018
+			$hover_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $node->hover_btn);
2019
+			$active_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $node->active_btn);
2020 2020
 
2021
-			foreach($child_output['url_list'] as $key =>$val)
2021
+			foreach ($child_output['url_list'] as $key =>$val)
2022 2022
 			{
2023 2023
 				$child_output['url_list'][$key] = addslashes($val);
2024 2024
 			}
2025 2025
 
2026
-			$selected = '"'.implode('","',$child_output['url_list']).'"';
2026
+			$selected = '"'.implode('","', $child_output['url_list']).'"';
2027 2027
 			$child_buff = $child_output['buff'];
2028 2028
 			$expand = $node->expand;
2029 2029
 
2030 2030
 			$normal_btn = $node->normal_btn;
2031
-			if($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) $normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$normal_btn);
2031
+			if ($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) $normal_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $normal_btn);
2032 2032
 			else $normal_btn = '';
2033 2033
 
2034 2034
 			$hover_btn = $node->hover_btn;
2035
-			if($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) $hover_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$hover_btn);
2035
+			if ($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) $hover_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $hover_btn);
2036 2036
 			else $hover_btn = '';
2037 2037
 
2038 2038
 			$active_btn = $node->active_btn;
2039
-			if($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) $active_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$active_btn);
2039
+			if ($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) $active_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $active_btn);
2040 2040
 			else $active_btn = '';
2041 2041
 
2042 2042
 
2043 2043
 			$group_srls = $node->group_srls;
2044 2044
 
2045
-			if($normal_btn)
2045
+			if ($normal_btn)
2046 2046
 			{
2047
-				if($hover_btn) $hover_str = sprintf('onmouseover=\"this.src=\'%s\'\"', $hover_btn); else $hover_str = '';
2048
-				if($active_btn) $active_str = sprintf('onmousedown=\"this.src=\'%s\'\"', $active_btn); else $active_str = '';
2047
+				if ($hover_btn) $hover_str = sprintf('onmouseover=\"this.src=\'%s\'\"', $hover_btn); else $hover_str = '';
2048
+				if ($active_btn) $active_str = sprintf('onmousedown=\"this.src=\'%s\'\"', $active_btn); else $active_str = '';
2049 2049
 				$link = sprintf('"<img src=\"%s\" onmouseout=\"this.src=\'%s\'\" alt=\"".$_menu_names[%d][$lang_type]."\" %s %s />"', $normal_btn, $normal_btn, $node->menu_item_srl, $hover_str, $active_str);
2050
-				if($active_btn) $link_active = sprintf('"<img src=\"%s\" onmouseout=\"this.src=\'%s\'\" alt=\"".$_menu_names[%d][$lang_type]."\" %s />"', $active_btn, $active_btn, $node->menu_item_srl, $hover_str);
2050
+				if ($active_btn) $link_active = sprintf('"<img src=\"%s\" onmouseout=\"this.src=\'%s\'\" alt=\"".$_menu_names[%d][$lang_type]."\" %s />"', $active_btn, $active_btn, $node->menu_item_srl, $hover_str);
2051 2051
 				else $link_active = $link;
2052 2052
 			}
2053 2053
 			else
@@ -2085,7 +2085,7 @@  discard block
 block discarded – undo
2085 2085
 			);
2086 2086
 
2087 2087
 			// Generate buff data
2088
-			$output['buff'] .=  sprintf('%s=>array(%s),', $node->menu_item_srl, $attribute);
2088
+			$output['buff'] .= sprintf('%s=>array(%s),', $node->menu_item_srl, $attribute);
2089 2089
 			$output['name'] .= $name_str;
2090 2090
 		}
2091 2091
 		return $output;
@@ -2099,19 +2099,19 @@  discard block
 block discarded – undo
2099 2099
 	 */
2100 2100
 	function updateMenuLayout($layout_srl, $menu_srl_list)
2101 2101
 	{
2102
-		if(!count($menu_srl_list)) return;
2102
+		if (!count($menu_srl_list)) return;
2103 2103
 		// Delete the value of menu_srls
2104
-		$args->menu_srls = implode(',',$menu_srl_list);
2104
+		$args->menu_srls = implode(',', $menu_srl_list);
2105 2105
 		$output = executeQuery('menu.deleteMenuLayout', $args);
2106
-		if(!$output->toBool()) return $output;
2106
+		if (!$output->toBool()) return $output;
2107 2107
 
2108 2108
 		$args->layout_srl = $layout_srl;
2109 2109
 		// Mapping menu_srls, layout_srl
2110
-		for($i=0;$i<count($menu_srl_list);$i++)
2110
+		for ($i = 0; $i < count($menu_srl_list); $i++)
2111 2111
 		{
2112 2112
 			$args->menu_srl = $menu_srl_list[$i];
2113 2113
 			$output = executeQuery('menu.insertMenuLayout', $args);
2114
-			if(!$output->toBool()) return $output;
2114
+			if (!$output->toBool()) return $output;
2115 2115
 		}
2116 2116
 	}
2117 2117
 
@@ -2124,47 +2124,47 @@  discard block
 block discarded – undo
2124 2124
 	{
2125 2125
 		// path setting
2126 2126
 		$path = sprintf('./files/attach/menu_button/%d/', $args->menu_srl);
2127
-		if($args->menu_normal_btn || $args->menu_hover_btn || $args->menu_active_btn && !is_dir($path))
2127
+		if ($args->menu_normal_btn || $args->menu_hover_btn || $args->menu_active_btn && !is_dir($path))
2128 2128
 		{
2129 2129
 			FileHandler::makeDir($path);
2130 2130
 		}
2131 2131
 
2132
-		if($args->isNormalDelete == 'Y' || $args->isHoverDelete == 'Y' || $args->isActiveDelete == 'Y')
2132
+		if ($args->isNormalDelete == 'Y' || $args->isHoverDelete == 'Y' || $args->isActiveDelete == 'Y')
2133 2133
 		{
2134 2134
 			$oMenuModel = getAdminModel('menu');
2135 2135
 			$itemInfo = $oMenuModel->getMenuItemInfo($args->menu_item_srl);
2136 2136
 
2137
-			if($args->isNormalDelete == 'Y' && $itemInfo->normal_btn) FileHandler::removeFile($itemInfo->normal_btn);
2138
-			if($args->isHoverDelete == 'Y' && $itemInfo->hover_btn) FileHandler::removeFile($itemInfo->hover_btn);
2139
-			if($args->isActiveDelete == 'Y' && $itemInfo->active_btn) FileHandler::removeFile($itemInfo->active_btn);
2137
+			if ($args->isNormalDelete == 'Y' && $itemInfo->normal_btn) FileHandler::removeFile($itemInfo->normal_btn);
2138
+			if ($args->isHoverDelete == 'Y' && $itemInfo->hover_btn) FileHandler::removeFile($itemInfo->hover_btn);
2139
+			if ($args->isActiveDelete == 'Y' && $itemInfo->active_btn) FileHandler::removeFile($itemInfo->active_btn);
2140 2140
 		}
2141 2141
 
2142 2142
 		$returnArray = array();
2143 2143
 		$date = date('YmdHis');
2144 2144
 		// normal button
2145
-		if($args->menu_normal_btn)
2145
+		if ($args->menu_normal_btn)
2146 2146
 		{
2147
-			$tmp_arr = explode('.',$args->menu_normal_btn['name']);
2148
-			$ext = $tmp_arr[count($tmp_arr)-1];
2147
+			$tmp_arr = explode('.', $args->menu_normal_btn['name']);
2148
+			$ext = $tmp_arr[count($tmp_arr) - 1];
2149 2149
 
2150 2150
 			$filename = sprintf('%s%d.%s.%s.%s', $path, $args->menu_item_srl, $date, 'menu_normal_btn', $ext);
2151 2151
 
2152
-			if(checkUploadedFile($args->menu_normal_btn['tmp_name']))
2152
+			if (checkUploadedFile($args->menu_normal_btn['tmp_name']))
2153 2153
 			{
2154
-				move_uploaded_file ( $args->menu_normal_btn ['tmp_name'], $filename );
2154
+				move_uploaded_file($args->menu_normal_btn ['tmp_name'], $filename);
2155 2155
 				$returnArray ['normal_btn'] = $filename;
2156 2156
 			}
2157 2157
 		}
2158 2158
 
2159 2159
 		// hover button
2160
-		if($args->menu_hover_btn)
2160
+		if ($args->menu_hover_btn)
2161 2161
 		{
2162
-			$tmp_arr = explode('.',$args->menu_hover_btn['name']);
2163
-			$ext = $tmp_arr[count($tmp_arr)-1];
2162
+			$tmp_arr = explode('.', $args->menu_hover_btn['name']);
2163
+			$ext = $tmp_arr[count($tmp_arr) - 1];
2164 2164
 
2165 2165
 			$filename = sprintf('%s%d.%s.%s.%s', $path, $args->menu_item_srl, $date, 'menu_hover_btn', $ext);
2166 2166
 
2167
-			if(checkUploadedFile($args->menu_hover_btn['tmp_name']))
2167
+			if (checkUploadedFile($args->menu_hover_btn['tmp_name']))
2168 2168
 			{
2169 2169
 				move_uploaded_file($args->menu_hover_btn['tmp_name'], $filename);
2170 2170
 				$returnArray['hover_btn'] = $filename;
@@ -2172,14 +2172,14 @@  discard block
 block discarded – undo
2172 2172
 		}
2173 2173
 
2174 2174
 		// active button
2175
-		if($args->menu_active_btn)
2175
+		if ($args->menu_active_btn)
2176 2176
 		{
2177
-			$tmp_arr = explode('.',$args->menu_active_btn['name']);
2178
-			$ext = $tmp_arr[count($tmp_arr)-1];
2177
+			$tmp_arr = explode('.', $args->menu_active_btn['name']);
2178
+			$ext = $tmp_arr[count($tmp_arr) - 1];
2179 2179
 
2180 2180
 			$filename = sprintf('%s%d.%s.%s.%s', $path, $args->menu_item_srl, $date, 'menu_active_btn', $ext);
2181 2181
 
2182
-			if(checkUploadedFile($args->menu_active_btn['tmp_name']))
2182
+			if (checkUploadedFile($args->menu_active_btn['tmp_name']))
2183 2183
 			{
2184 2184
 				move_uploaded_file($args->menu_active_btn['tmp_name'], $filename);
2185 2185
 				$returnArray['active_btn'] = $filename;
@@ -2201,7 +2201,7 @@  discard block
 block discarded – undo
2201 2201
 			"active_btn"=>"",
2202 2202
 		);
2203 2203
 		//normal_btn
2204
-		if($menuItemInfo->normal_btn)
2204
+		if ($menuItemInfo->normal_btn)
2205 2205
 		{
2206 2206
 			$originFile = FileHandler::getRealPath($menuItemInfo->normal_btn);
2207 2207
 			$targetFile = $this->_changeMenuItemSrlInButtonPath($menuItemInfo->normal_btn, $insertedMenuSrl, $insertedMenuItemSrl, 'normal');
@@ -2211,7 +2211,7 @@  discard block
 block discarded – undo
2211 2211
 		}
2212 2212
 
2213 2213
 		//hover_btn
2214
-		if($menuItemInfo->hover_btn)
2214
+		if ($menuItemInfo->hover_btn)
2215 2215
 		{
2216 2216
 			$originFile = FileHandler::getRealPath($menuItemInfo->hover_btn);
2217 2217
 			$targetFile = $this->_changeMenuItemSrlInButtonPath($menuItemInfo->hover_btn, $insertedMenuSrl, $insertedMenuItemSrl, 'hover');
@@ -2221,7 +2221,7 @@  discard block
 block discarded – undo
2221 2221
 		}
2222 2222
 
2223 2223
 		//active_btn
2224
-		if($menuItemInfo->active_btn)
2224
+		if ($menuItemInfo->active_btn)
2225 2225
 		{
2226 2226
 			$originFile = FileHandler::getRealPath($menuItemInfo->active_btn);
2227 2227
 			$targetFile = $this->_changeMenuItemSrlInButtonPath($menuItemInfo->active_btn, $insertedMenuSrl, $insertedMenuItemSrl, 'active');
@@ -2236,9 +2236,9 @@  discard block
 block discarded – undo
2236 2236
 	{
2237 2237
 		$path = sprintf('./files/attach/menu_button/%d/', $menuSrl);
2238 2238
 		$tmp_arr = explode('.', $buttonPath);
2239
-		$ext = $tmp_arr[count($tmp_arr)-1];
2239
+		$ext = $tmp_arr[count($tmp_arr) - 1];
2240 2240
 		$date = date("YmdHis");
2241
-		return sprintf('%s%d.%s.%s.%s', $path, $menuItemSrl,$date,'menu_'.$mode.'_btn', $ext);
2241
+		return sprintf('%s%d.%s.%s.%s', $path, $menuItemSrl, $date, 'menu_'.$mode.'_btn', $ext);
2242 2242
 	}
2243 2243
 
2244 2244
 	public function makeHomemenuCacheFile($menuSrl)
Please login to merge, or discard this patch.
Braces   +297 added lines, -130 removed lines patch added patch discarded remove patch
@@ -69,7 +69,9 @@  discard block
 block discarded – undo
69 69
 		$site_module_info = Context::get('site_module_info');
70 70
 
71 71
 		$output = $this->addMenu(Context::get('title'), (int)$site_module_info->site_srl);
72
-		if(!$output->toBool()) return $output;
72
+		if(!$output->toBool()) {
73
+			return $output;
74
+		}
73 75
 
74 76
 		$this->add('menu_srl', $output->get('menuSrl'));
75 77
 		$this->setMessage('success_registed');
@@ -148,8 +150,7 @@  discard block
 block discarded – undo
148 150
 				$moduleConfig->unlinked_menu_srl = $output->get('menuSrl');
149 151
 				$oModuleController = getController('module');
150 152
 				$oModuleController->updateModuleConfig('menu', $moduleConfig);
151
-			}
152
-			else
153
+			} else
153 154
 			{
154 155
 				return false;
155 156
 			}
@@ -186,8 +187,7 @@  discard block
 block discarded – undo
186 187
 			if($output->toBool() && $output->data)
187 188
 			{
188 189
 				$moduleInfo->menu_srl = $output->data->menu_srl;
189
-			}
190
-			else
190
+			} else
191 191
 			{
192 192
 				// create menu item.
193 193
 				$item_args->menu_srl = $menuSrl;
@@ -235,7 +235,9 @@  discard block
 block discarded – undo
235 235
 		$args->menu_srl = Context::get('menu_srl');
236 236
 
237 237
 		$output = executeQuery('menu.updateMenu', $args);
238
-		if(!$output->toBool()) return $output;
238
+		if(!$output->toBool()) {
239
+			return $output;
240
+		}
239 241
 
240 242
 		$this->setMessage('success_registed');
241 243
 
@@ -255,8 +257,9 @@  discard block
 block discarded – undo
255 257
 		$menuInfo = $oMenuAdminModel->getMenu($menu_srl);
256 258
 
257 259
 		$oAdmin = getClass('admin');
258
-		if($menuInfo->title == $oAdmin->getAdminMenuName())
259
-			return new Object(-1, 'msg_adminmenu_cannot_delete');
260
+		if($menuInfo->title == $oAdmin->getAdminMenuName()) {
261
+					return new Object(-1, 'msg_adminmenu_cannot_delete');
262
+		}
260 263
 
261 264
 		// get menu properies with child menu
262 265
 		$phpFile = sprintf("./files/cache/menu/%s.php", $menu_srl);
@@ -280,8 +283,9 @@  discard block
 block discarded – undo
280 283
 				$originMenu = $value;
281 284
 				$this->_checkHomeMenuInOriginMenu($originMenu, $siteInfo->mid, $isStartmenuInclude);
282 285
 
283
-				if($isStartmenuInclude)
284
-					break;
286
+				if($isStartmenuInclude) {
287
+									break;
288
+				}
285 289
 			}
286 290
 		}
287 291
 
@@ -366,7 +370,9 @@  discard block
 block discarded – undo
366 370
 			foreach($cache_list as $cache_file)
367 371
 			{
368 372
 				$pos = strpos($cache_file, $menu_srl.'.');
369
-				if($pos>0)FileHandler::removeFile($cache_file);
373
+				if($pos>0) {
374
+					FileHandler::removeFile($cache_file);
375
+				}
370 376
 			}
371 377
 		}
372 378
 		// Delete images of menu buttons
@@ -405,8 +411,7 @@  discard block
 block discarded – undo
405 411
 		if($request->is_shortcut == 'Y')
406 412
 		{
407 413
 			$result = $this->_insertShortcut($request);
408
-		}
409
-		else
414
+		} else
410 415
 		{
411 416
 			$result = $this->_insertMenu($request, $isProc);
412 417
 		}
@@ -465,12 +470,21 @@  discard block
 block discarded – undo
465 470
 			$args->is_shortcut = $request->is_shortcut;
466 471
 			$args->url = $request->shortcut_target;
467 472
 
468
-			if(!$args->open_window) $args->open_window = 'N';
469
-			if(!$args->expand) $args->expand = 'N';
470
-			if(!$args->is_shortcut) $args->is_shortcut = 'Y';
473
+			if(!$args->open_window) {
474
+				$args->open_window = 'N';
475
+			}
476
+			if(!$args->expand) {
477
+				$args->expand = 'N';
478
+			}
479
+			if(!$args->is_shortcut) {
480
+				$args->is_shortcut = 'Y';
481
+			}
471 482
 
472
-			if($request->menu_name_key) $args->name = $request->menu_name_key;
473
-			else $args->name = $request->menu_name;
483
+			if($request->menu_name_key) {
484
+				$args->name = $request->menu_name_key;
485
+			} else {
486
+				$args->name = $request->menu_name;
487
+			}
474 488
 		}
475 489
 		// type is module short cut
476 490
 		else if(is_numeric($request->shortcut_target))
@@ -505,13 +519,18 @@  discard block
 block discarded – undo
505 519
 			$args->url = '#';
506 520
 		}
507 521
 
508
-		if($request->menu_desc) $args->desc = $request->menu_desc;
509
-		else $args->desc = '';
522
+		if($request->menu_desc) {
523
+			$args->desc = $request->menu_desc;
524
+		} else {
525
+			$args->desc = '';
526
+		}
510 527
 
511 528
 		$args->menu_item_srl = getNextSequence();
512 529
 		$args->listorder = -1*$args->menu_item_srl;
513 530
 		$output = executeQuery('menu.insertMenuItem', $args);
514
-		if(!$output->toBool()) return $output;
531
+		if(!$output->toBool()) {
532
+			return $output;
533
+		}
515 534
 
516 535
 		$oDB->commit();
517 536
 
@@ -533,15 +552,27 @@  discard block
 block discarded – undo
533 552
 		$args->expand = $request->menu_expand;
534 553
 		$args->is_shortcut = $request->is_shortcut;
535 554
 
536
-		if(!$args->open_window) $args->open_window = 'N';
537
-		if(!$args->expand) $args->expand = 'N';
538
-		if(!$args->is_shortcut) $args->is_shortcut = 'N';
555
+		if(!$args->open_window) {
556
+			$args->open_window = 'N';
557
+		}
558
+		if(!$args->expand) {
559
+			$args->expand = 'N';
560
+		}
561
+		if(!$args->is_shortcut) {
562
+			$args->is_shortcut = 'N';
563
+		}
539 564
 
540
-		if($request->menu_name_key) $args->name = $request->menu_name_key;
541
-		else $args->name = $request->menu_name;
565
+		if($request->menu_name_key) {
566
+			$args->name = $request->menu_name_key;
567
+		} else {
568
+			$args->name = $request->menu_name;
569
+		}
542 570
 
543
-		if($request->menu_desc) $args->desc = $request->menu_desc;
544
-		else $args->desc = '';
571
+		if($request->menu_desc) {
572
+			$args->desc = $request->menu_desc;
573
+		} else {
574
+			$args->desc = '';
575
+		}
545 576
 
546 577
 		if($request->module_id && strncasecmp('http', $request->module_id, 4) === 0)
547 578
 		{
@@ -559,9 +590,15 @@  discard block
 block discarded – undo
559 590
 		}
560 591
 
561 592
 		// if setting button variables, set argument button variables for db insert. but not upload in this method
562
-		if($request->normal_btn) $args->normal_btn = $request->normal_btn;
563
-		if($request->hover_btn) $args->hover_btn = $request->hover_btn;
564
-		if($request->active_btn) $args->active_btn = $request->active_btn;
593
+		if($request->normal_btn) {
594
+			$args->normal_btn = $request->normal_btn;
595
+		}
596
+		if($request->hover_btn) {
597
+			$args->hover_btn = $request->hover_btn;
598
+		}
599
+		if($request->active_btn) {
600
+			$args->active_btn = $request->active_btn;
601
+		}
565 602
 
566 603
 		if(!$request->module_id)
567 604
 		{
@@ -572,7 +609,9 @@  discard block
 block discarded – undo
572 609
 		$args->menu_item_srl = getNextSequence();
573 610
 		$args->listorder = -1*$args->menu_item_srl;
574 611
 		$output = executeQuery('menu.insertMenuItem', $args);
575
-		if(!$output->toBool()) return $output;
612
+		if(!$output->toBool()) {
613
+			return $output;
614
+		}
576 615
 
577 616
 		$oDB->commit();
578 617
 
@@ -653,8 +692,12 @@  discard block
 block discarded – undo
653 692
 		}
654 693
 
655 694
 		// variables set
656
-		if($request->menu_open_window != "Y") $request->menu_open_window = "N";
657
-		if($request->menu_expand != "Y") $request->menu_expand = "N";
695
+		if($request->menu_open_window != "Y") {
696
+			$request->menu_open_window = "N";
697
+		}
698
+		if($request->menu_expand != "Y") {
699
+			$request->menu_expand = "N";
700
+		}
658 701
 
659 702
 		// Get original information
660 703
 		$oMenuAdminModel = getAdminModel('menu');
@@ -681,13 +724,11 @@  discard block
 block discarded – undo
681 724
 
682 725
 				$args->url = $newItemInfo->url;
683 726
 				$args->is_shortcut = 'Y';
684
-			}
685
-			else
727
+			} else
686 728
 			{
687 729
 				$args->url = '#';
688 730
 			}
689
-		}
690
-		else
731
+		} else
691 732
 		{
692 733
 			// check already created module instance
693 734
 			$oModuleModel = getModel('module');
@@ -720,14 +761,16 @@  discard block
 block discarded – undo
720 761
 		if($request->menu_name_key)
721 762
 		{
722 763
 			$args->name = $request->menu_name_key;
723
-		}
724
-		else
764
+		} else
725 765
 		{
726 766
 			$args->name = $request->menu_name;
727 767
 		}
728 768
 
729
-		if($request->menu_desc) $args->desc = $request->menu_desc;
730
-		else $args->desc = '';
769
+		if($request->menu_desc) {
770
+			$args->desc = $request->menu_desc;
771
+		} else {
772
+			$args->desc = '';
773
+		}
731 774
 
732 775
 		unset($args->group_srls);
733 776
 		$args->open_window = $request->menu_open_window;
@@ -829,8 +872,7 @@  discard block
 block discarded – undo
829 872
 		{
830 873
 			$this->setError($returnObj->error);
831 874
 			$this->setMessage($returnObj->message);
832
-		}
833
-		else
875
+		} else
834 876
 		{
835 877
 			$this->setMessage('success_deleted');
836 878
 		}
@@ -857,7 +899,9 @@  discard block
 block discarded – undo
857 899
 		if($args->is_force != 'Y')
858 900
 		{
859 901
 			$output = executeQuery('menu.getChildMenuCount', $args);
860
-			if(!$output->toBool()) return $output;
902
+			if(!$output->toBool()) {
903
+				return $output;
904
+			}
861 905
 			if($output->data->count > 0)
862 906
 			{
863 907
 				return new Object(-1001, 'msg_cannot_delete_for_child');
@@ -875,7 +919,9 @@  discard block
 block discarded – undo
875 919
 			return $this->stop('msg_cannot_delete_for_admin_topmenu');
876 920
 		}
877 921
 
878
-		if($itemInfo->parent_srl) $parent_srl = $itemInfo->parent_srl;
922
+		if($itemInfo->parent_srl) {
923
+			$parent_srl = $itemInfo->parent_srl;
924
+		}
879 925
 
880 926
 		// get menu properies with child menu
881 927
 		$phpFile = sprintf("./files/cache/menu/%s.php", $args->menu_srl);
@@ -949,9 +995,15 @@  discard block
 block discarded – undo
949 995
 		// Update the xml file and get its location
950 996
 		$xml_file = $this->makeXmlFile($args->menu_srl);
951 997
 		// Delete all of image buttons
952
-		if($node['normal_btn']) FileHandler::removeFile($node['normal_btn']);
953
-		if($node['hover_btn']) FileHandler::removeFile($node['hover_btn']);
954
-		if($node['active_btn']) FileHandler::removeFile($node['active_btn']);
998
+		if($node['normal_btn']) {
999
+			FileHandler::removeFile($node['normal_btn']);
1000
+		}
1001
+		if($node['hover_btn']) {
1002
+			FileHandler::removeFile($node['hover_btn']);
1003
+		}
1004
+		if($node['active_btn']) {
1005
+			FileHandler::removeFile($node['active_btn']);
1006
+		}
955 1007
 
956 1008
 		// Delete module
957 1009
 		if($node['is_shortcut'] != 'Y' && strncasecmp('http', $node['url'], 4) !== 0)
@@ -1018,7 +1070,9 @@  discard block
 block discarded – undo
1018 1070
 		$source_srl = Context::get('source_srl');	// Same hierarchy's menu item serial number
1019 1071
 		$target_srl = Context::get('target_srl');	// Self menu item serial number
1020 1072
 
1021
-		if(!$mode || !$parent_srl || !$target_srl) return new Object(-1,'msg_invalid_request');
1073
+		if(!$mode || !$parent_srl || !$target_srl) {
1074
+			return new Object(-1,'msg_invalid_request');
1075
+		}
1022 1076
 
1023 1077
 		$oMenuAdminModel = getAdminModel('menu');
1024 1078
 
@@ -1182,8 +1236,11 @@  discard block
 block discarded – undo
1182 1236
 		// default argument setting
1183 1237
 		$args = new stdClass();
1184 1238
 		$args->menu_srl = $menuSrl;
1185
-		if($parentSrl == 0) $args->parent_srl = $menuSrl;
1186
-		else $args->parent_srl = $parentSrl;
1239
+		if($parentSrl == 0) {
1240
+			$args->parent_srl = $menuSrl;
1241
+		} else {
1242
+			$args->parent_srl = $parentSrl;
1243
+		}
1187 1244
 		$args->menu_name_key = $originMenu['text'];
1188 1245
 		$args->menu_name = $originMenu['text'];
1189 1246
 		$args->menu_open_window = $originMenu['open_window'];
@@ -1276,8 +1333,11 @@  discard block
 block discarded – undo
1276 1333
 		for($i=0;$i<4;$i++)
1277 1334
 		{
1278 1335
 			$case = rand(0, 1);
1279
-			if($case) $doc = rand(65, 90);
1280
-			else $doc = rand(97, 122);
1336
+			if($case) {
1337
+				$doc = rand(65, 90);
1338
+			} else {
1339
+				$doc = rand(97, 122);
1340
+			}
1281 1341
 
1282 1342
 			$randomString .= chr($doc);
1283 1343
 		}
@@ -1300,15 +1360,21 @@  discard block
 block discarded – undo
1300 1360
 		// menu name update
1301 1361
 		$args->menu_srl = $this->menuSrl;
1302 1362
 		$output = executeQuery('menu.updateMenu', $args);
1303
-		if(!$output->toBool()) return $output;
1363
+		if(!$output->toBool()) {
1364
+			return $output;
1365
+		}
1304 1366
 
1305 1367
 		$this->map = array();
1306 1368
 		if(is_array($parentKeyList))
1307 1369
 		{
1308 1370
 			foreach($parentKeyList as $no=>$srl)
1309 1371
 			{
1310
-				if($srl === 0) continue;
1311
-				if(!is_array($this->map[$srl]))$this->map[$srl] = array();
1372
+				if($srl === 0) {
1373
+					continue;
1374
+				}
1375
+				if(!is_array($this->map[$srl])) {
1376
+					$this->map[$srl] = array();
1377
+				}
1312 1378
 				$this->map[$srl][] = $no;
1313 1379
 			}
1314 1380
 		}
@@ -1410,7 +1476,9 @@  discard block
 block discarded – undo
1410 1476
 		$oMenuAdminModel = getAdminModel('menu');
1411 1477
 
1412 1478
 		$target_item = $oMenuAdminModel->getMenuItemInfo($target_srl);
1413
-		if($target_item->menu_item_srl != $target_srl) return new Object(-1,'msg_invalid_request');
1479
+		if($target_item->menu_item_srl != $target_srl) {
1480
+			return new Object(-1,'msg_invalid_request');
1481
+		}
1414 1482
 		// Move the menu location(change the order menu appears)
1415 1483
 		if($mode == 'move')
1416 1484
 		{
@@ -1421,24 +1489,33 @@  discard block
 block discarded – undo
1421 1489
 			if($source_srl)
1422 1490
 			{
1423 1491
 				$source_item = $oMenuAdminModel->getMenuItemInfo($source_srl);
1424
-				if($source_item->menu_item_srl != $source_srl) return new Object(-1,'msg_invalid_request');
1492
+				if($source_item->menu_item_srl != $source_srl) {
1493
+					return new Object(-1,'msg_invalid_request');
1494
+				}
1425 1495
 				$args->listorder = $source_item->listorder-1;
1426
-			}
1427
-			else
1496
+			} else
1428 1497
 			{
1429 1498
 				$output = executeQuery('menu.getMaxListorder', $args);
1430
-				if(!$output->toBool()) return $output;
1499
+				if(!$output->toBool()) {
1500
+					return $output;
1501
+				}
1431 1502
 				$args->listorder = (int)$output->data->listorder;
1432
-				if(!$args->listorder) $args->listorder= 0;
1503
+				if(!$args->listorder) {
1504
+					$args->listorder= 0;
1505
+				}
1433 1506
 			}
1434 1507
 			$args->parent_srl = $parent_srl;
1435 1508
 			$output = executeQuery('menu.updateMenuItemListorder', $args);
1436
-			if(!$output->toBool()) return $output;
1509
+			if(!$output->toBool()) {
1510
+				return $output;
1511
+			}
1437 1512
 
1438 1513
 			$args->parent_srl = $parent_srl;
1439 1514
 			$args->menu_item_srl = $target_srl;
1440 1515
 			$output = executeQuery('menu.updateMenuItemNode', $args);
1441
-			if(!$output->toBool()) return $output;
1516
+			if(!$output->toBool()) {
1517
+				return $output;
1518
+			}
1442 1519
 
1443 1520
 			//module's menu_srl move also
1444 1521
 			if($isShortcut == 'N' && !empty($url))
@@ -1466,14 +1543,15 @@  discard block
 block discarded – undo
1466 1543
 				}
1467 1544
 			}
1468 1545
 			// Add a child
1469
-		}
1470
-		elseif($mode == 'insert')
1546
+		} elseif($mode == 'insert')
1471 1547
 		{
1472 1548
 			$args->menu_item_srl = $target_srl;
1473 1549
 			$args->parent_srl = $parent_srl;
1474 1550
 			$args->listorder = -1*getNextSequence();
1475 1551
 			$output = executeQuery('menu.updateMenuItemNode', $args);
1476
-			if(!$output->toBool()) return $output;
1552
+			if(!$output->toBool()) {
1553
+				return $output;
1554
+			}
1477 1555
 		}
1478 1556
 
1479 1557
 		$xml_file = $this->makeXmlFile($menu_srl);
@@ -1517,8 +1595,7 @@  discard block
 block discarded – undo
1517 1595
 		{
1518 1596
 			Context::set('error_messge', Context::getLang('msg_invalid_request'));
1519 1597
 
1520
-		}
1521
-		else if(!$target_file || !is_uploaded_file($target_file['tmp_name']) || !preg_match('/\.(gif|jpeg|jpg|png)$/i',$target_file['name'])  || !checkUploadedFile($target_file['tmp_name']))
1598
+		} else if(!$target_file || !is_uploaded_file($target_file['tmp_name']) || !preg_match('/\.(gif|jpeg|jpg|png)$/i',$target_file['name'])  || !checkUploadedFile($target_file['tmp_name']))
1522 1599
 		{
1523 1600
 			Context::set('error_messge', Context::getLang('msg_invalid_request'));
1524 1601
 		}
@@ -1532,7 +1609,9 @@  discard block
 block discarded – undo
1532 1609
 			$path = sprintf('./files/attach/menu_button/%d/', $menu_srl);
1533 1610
 			$filename = sprintf('%s%d.%s.%s', $path, $menu_item_srl, $target, $ext);
1534 1611
 
1535
-			if(!is_dir($path)) FileHandler::makeDir($path);
1612
+			if(!is_dir($path)) {
1613
+				FileHandler::makeDir($path);
1614
+			}
1536 1615
 
1537 1616
 			move_uploaded_file($target_file['tmp_name'], $filename);
1538 1617
 			Context::set('filename', $filename);
@@ -1572,7 +1651,9 @@  discard block
 block discarded – undo
1572 1651
 			foreach($installed_module_list AS $key=>$value)
1573 1652
 			{
1574 1653
 				$info = $oModuleModel->getModuleActionXml($value->module);
1575
-				if($info->menu) $menuList[$value->module] = $info->menu;
1654
+				if($info->menu) {
1655
+					$menuList[$value->module] = $info->menu;
1656
+				}
1576 1657
 				unset($info->menu);
1577 1658
 			}
1578 1659
 		}
@@ -1604,8 +1685,12 @@  discard block
 block discarded – undo
1604 1685
 		$info = $oModuleModel->getModuleActionXml($moduleName);
1605 1686
 
1606 1687
 		$url = getNotEncodedFullUrl('', 'module', 'admin', 'act', $info->menu->{$menuName}->index);
1607
-		if(empty($url)) $url = getNotEncodedFullUrl('', 'module', 'admin', 'act', $info->admin_index_act);
1608
-		if(empty($url)) $url = getNotEncodedFullUrl('', 'module', 'admin');
1688
+		if(empty($url)) {
1689
+			$url = getNotEncodedFullUrl('', 'module', 'admin', 'act', $info->admin_index_act);
1690
+		}
1691
+		if(empty($url)) {
1692
+			$url = getNotEncodedFullUrl('', 'module', 'admin');
1693
+		}
1609 1694
 		$dbInfo = Context::getDBInfo();
1610 1695
 
1611 1696
 		$args = new stdClass();
@@ -1617,8 +1702,7 @@  discard block
 block discarded – undo
1617 1702
 		if(strpos($url, 'https') !== false)
1618 1703
 		{
1619 1704
 			$args->url = str_replace('https'.substr($dbInfo->default_url, 4), '', $url);
1620
-		}
1621
-		else
1705
+		} else
1622 1706
 		{
1623 1707
 			$args->url = str_replace($dbInfo->default_url, '', $url);
1624 1708
 		}
@@ -1637,14 +1721,18 @@  discard block
 block discarded – undo
1637 1721
 		if($item_info->menu_item_srl == $args->menu_item_srl)
1638 1722
 		{
1639 1723
 			$output = $this->_updateMenuItem($args);
1640
-			if(!$output->toBool()) return $output;
1724
+			if(!$output->toBool()) {
1725
+				return $output;
1726
+			}
1641 1727
 		}
1642 1728
 		// Insert if not exist
1643 1729
 		else
1644 1730
 		{
1645 1731
 			$args->listorder = -1*$args->menu_item_srl;
1646 1732
 			$output = executeQuery('menu.insertMenuItem', $args);
1647
-			if(!$output->toBool()) return $output;
1733
+			if(!$output->toBool()) {
1734
+				return $output;
1735
+			}
1648 1736
 		}
1649 1737
 		// Get information of the menu
1650 1738
 		$menu_info = $oMenuModel->getMenu($args->menu_srl);
@@ -1675,8 +1763,7 @@  discard block
 block discarded – undo
1675 1763
 		if(!$exposure)
1676 1764
 		{
1677 1765
 			$args->group_srls = '';
1678
-		}
1679
-		else
1766
+		} else
1680 1767
 		{
1681 1768
 			$exposure = explode(',', $exposure);
1682 1769
 			if(in_array($exposure, array('-1','-3')))
@@ -1684,7 +1771,9 @@  discard block
 block discarded – undo
1684 1771
 				$args->group_srls = $exposure;
1685 1772
 			}
1686 1773
 
1687
-			if($exposure) $args->group_srls = implode(',', $exposure);
1774
+			if($exposure) {
1775
+				$args->group_srls = implode(',', $exposure);
1776
+			}
1688 1777
 		}
1689 1778
 
1690 1779
 		$output = $this->_updateMenuItem($args);
@@ -1704,7 +1793,9 @@  discard block
 block discarded – undo
1704 1793
 		$xml_info = $oModuleModel->getModuleActionXML($moduleInfo->module);
1705 1794
 
1706 1795
 		$grantList = $xml_info->grant;
1707
-		if(!$grantList) $grantList = new stdClass;
1796
+		if(!$grantList) {
1797
+			$grantList = new stdClass;
1798
+		}
1708 1799
 
1709 1800
 		$grantList->access = new stdClass();
1710 1801
 		$grantList->access->default = 'guest';
@@ -1754,12 +1845,16 @@  discard block
 block discarded – undo
1754 1845
 	function makeXmlFile($menu_srl)
1755 1846
 	{
1756 1847
 		// Return if there is no information when creating the xml file
1757
-		if(!$menu_srl) return;
1848
+		if(!$menu_srl) {
1849
+			return;
1850
+		}
1758 1851
 		// Get menu informaton
1759 1852
 		$args = new stdClass();
1760 1853
 		$args->menu_srl = $menu_srl;
1761 1854
 		$output = executeQuery('menu.getMenu', $args);
1762
-		if(!$output->toBool() || !$output->data) return $output;
1855
+		if(!$output->toBool() || !$output->data) {
1856
+			return $output;
1857
+		}
1763 1858
 		$site_srl = (int)$output->data->site_srl;
1764 1859
 
1765 1860
 		if($site_srl)
@@ -1773,7 +1868,9 @@  discard block
 block discarded – undo
1773 1868
 		$args->menu_srl = $menu_srl;
1774 1869
 		$args->sort_index = 'listorder';
1775 1870
 		$output = executeQuery('menu.getMenuItems', $args);
1776
-		if(!$output->toBool()) return;
1871
+		if(!$output->toBool()) {
1872
+			return;
1873
+		}
1777 1874
 		// Specify the name of the cache file
1778 1875
 		$xml_file = sprintf(_XE_PATH_ . "files/cache/menu/%s.xml.php", $menu_srl);
1779 1876
 		$php_file = sprintf(_XE_PATH_ . "files/cache/menu/%s.php", $menu_srl);
@@ -1787,7 +1884,9 @@  discard block
 block discarded – undo
1787 1884
 			return $xml_file;
1788 1885
 		}
1789 1886
 		// Change to an array if only a single data is obtained
1790
-		if(!is_array($list)) $list = array($list);
1887
+		if(!is_array($list)) {
1888
+			$list = array($list);
1889
+		}
1791 1890
 		// Create a tree for loop
1792 1891
 		$list_count = count($list);
1793 1892
 		for($i=0;$i<$list_count;$i++)
@@ -1875,7 +1974,9 @@  discard block
 block discarded – undo
1875 1974
 	 */
1876 1975
 	function getXmlTree($source_node, $tree, $site_srl, $domain)
1877 1976
 	{
1878
-		if(!$source_node) return;
1977
+		if(!$source_node) {
1978
+			return;
1979
+		}
1879 1980
 
1880 1981
 		$oMenuAdminModel = getAdminModel('menu');
1881 1982
 
@@ -1883,7 +1984,9 @@  discard block
 block discarded – undo
1883 1984
 		{
1884 1985
 			$child_buff = "";
1885 1986
 			// Get data of the child nodes
1886
-			if($menu_item_srl&&$tree[$menu_item_srl]) $child_buff = $this->getXmlTree($tree[$menu_item_srl], $tree, $site_srl, $domain);
1987
+			if($menu_item_srl&&$tree[$menu_item_srl]) {
1988
+				$child_buff = $this->getXmlTree($tree[$menu_item_srl], $tree, $site_srl, $domain);
1989
+			}
1887 1990
 			// List variables
1888 1991
 			$names = $oMenuAdminModel->getMenuItemNames($node->name, $site_srl);
1889 1992
 			foreach($names as $key => $val)
@@ -1897,37 +2000,57 @@  discard block
 block discarded – undo
1897 2000
 			if(preg_match('/^([0-9a-zA-Z\_\-]+)$/', $node->url))
1898 2001
 			{
1899 2002
 				$href = "getSiteUrl('$domain', '','mid','$node->url')";
2003
+			} else {
2004
+				$href = sprintf('"%s"', $url);
1900 2005
 			}
1901
-			else $href = sprintf('"%s"', $url);
1902 2006
 			$is_shortcut = $node->is_shortcut;
1903 2007
 			$open_window = $node->open_window;
1904 2008
 			$expand = $node->expand;
1905 2009
 
1906 2010
 			$normal_btn = $node->normal_btn;
1907
-			if($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) $normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$normal_btn);
1908
-			else $normal_btn = '';
2011
+			if($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) {
2012
+				$normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$normal_btn);
2013
+			} else {
2014
+				$normal_btn = '';
2015
+			}
1909 2016
 			$hover_btn = $node->hover_btn;
1910
-			if($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) $hover_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$hover_btn);
1911
-			else $hover_btn = '';
2017
+			if($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) {
2018
+				$hover_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$hover_btn);
2019
+			} else {
2020
+				$hover_btn = '';
2021
+			}
1912 2022
 			$active_btn = $node->active_btn;
1913
-			if($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) $active_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$active_btn);
1914
-			else $active_btn = '';
2023
+			if($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) {
2024
+				$active_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$active_btn);
2025
+			} else {
2026
+				$active_btn = '';
2027
+			}
1915 2028
 
1916 2029
 			$group_srls = $node->group_srls;
1917 2030
 
1918 2031
 			if($normal_btn)
1919 2032
 			{
1920
-				if($hover_btn) $hover_str = sprintf('onmouseover=&quot;this.src=\'%s\'&quot;', $hover_btn); else $hover_str = '';
1921
-				if($active_btn) $active_str = sprintf('onmousedown=&quot;this.src=\'%s\'&quot;', $active_btn); else $active_str = '';
2033
+				if($hover_btn) {
2034
+					$hover_str = sprintf('onmouseover=&quot;this.src=\'%s\'&quot;', $hover_btn);
2035
+				} else {
2036
+					$hover_str = '';
2037
+				}
2038
+				if($active_btn) {
2039
+					$active_str = sprintf('onmousedown=&quot;this.src=\'%s\'&quot;', $active_btn);
2040
+				} else {
2041
+					$active_str = '';
2042
+				}
1922 2043
 				$link = sprintf('&lt;img src=&quot;%s&quot; onmouseout=&quot;this.src=\'%s\'&quot; alt=&quot;<?php print htmlspecialchars($_names[$lang_type], ENT_COMPAT | ENT_HTML401, \'UTF-8\', false) ?>&quot; %s %s /&gt;', $normal_btn, $normal_btn, $hover_str, $active_str);
1923
-			}
1924
-			else
2044
+			} else
1925 2045
 			{
1926 2046
 				$link = '<?php print $_names[$lang_type]; ?>';
1927 2047
 			}
1928 2048
 			// If the value of node->group_srls exists
1929
-			if($group_srls)$group_check_code = sprintf('($is_admin==true||(is_array($group_srls)&&count(array_intersect($group_srls, array(%s))))||($is_logged&&%s))',$group_srls,$group_srls == -1?1:0);
1930
-			else $group_check_code = "true";
2049
+			if($group_srls) {
2050
+				$group_check_code = sprintf('($is_admin==true||(is_array($group_srls)&&count(array_intersect($group_srls, array(%s))))||($is_logged&&%s))',$group_srls,$group_srls == -1?1:0);
2051
+			} else {
2052
+				$group_check_code = "true";
2053
+			}
1931 2054
 			$attribute = sprintf(
1932 2055
 				'node_srl="%s" parent_srl="%s" menu_name_key=\'%s\' text="<?php if(%s) { %s }?>" url="<?php print(%s?"%s":"")?>" href="<?php print(%s?%s:"")?>" is_shortcut="%s" desc="%s" open_window="%s" expand="%s" normal_btn="%s" hover_btn="%s" active_btn="%s" link="<?php if(%s) {?>%s<?php }?>"',
1933 2056
 				$menu_item_srl,
@@ -1950,8 +2073,11 @@  discard block
 block discarded – undo
1950 2073
 				$link
1951 2074
 			);
1952 2075
 
1953
-			if($child_buff) $buff .= sprintf('<node %s>%s</node>', $attribute, $child_buff);
1954
-			else $buff .=  sprintf('<node %s />', $attribute);
2076
+			if($child_buff) {
2077
+				$buff .= sprintf('<node %s>%s</node>', $attribute, $child_buff);
2078
+			} else {
2079
+				$buff .=  sprintf('<node %s />', $attribute);
2080
+			}
1955 2081
 		}
1956 2082
 		return $buff;
1957 2083
 	}
@@ -1970,15 +2096,20 @@  discard block
 block discarded – undo
1970 2096
 	function getPhpCacheCode($source_node, $tree, $site_srl, $domain)
1971 2097
 	{
1972 2098
 		$output = array("buff"=>"", "url_list"=>array());
1973
-		if(!$source_node) return $output;
2099
+		if(!$source_node) {
2100
+			return $output;
2101
+		}
1974 2102
 
1975 2103
 		$oMenuAdminModel = getAdminModel('menu');
1976 2104
 
1977 2105
 		foreach($source_node as $menu_item_srl => $node)
1978 2106
 		{
1979 2107
 			// Get data from child nodes if exist.
1980
-			if($menu_item_srl&&$tree[$menu_item_srl]) $child_output = $this->getPhpCacheCode($tree[$menu_item_srl], $tree, $site_srl, $domain);
1981
-			else $child_output = array("buff"=>"", "url_list"=>array());
2108
+			if($menu_item_srl&&$tree[$menu_item_srl]) {
2109
+				$child_output = $this->getPhpCacheCode($tree[$menu_item_srl], $tree, $site_srl, $domain);
2110
+			} else {
2111
+				$child_output = array("buff"=>"", "url_list"=>array());
2112
+			}
1982 2113
 
1983 2114
 			// List variables
1984 2115
 			$names = $oMenuAdminModel->getMenuItemNames($node->name, $site_srl);
@@ -1988,8 +2119,7 @@  discard block
 block discarded – undo
1988 2119
 				if(preg_match('/\{\$lang->menu_gnb(?:_sub)?\[\'([a-zA-Z_]+)\'\]\}/', $val) === 1)
1989 2120
 				{
1990 2121
 					$name_arr_str .= sprintf('"%s"=>"%s",', $key, $val);
1991
-				}
1992
-				else
2122
+				} else
1993 2123
 				{
1994 2124
 					$name_arr_str .= sprintf('"%s"=>\'%s\',', $key, str_replace(array('\\','\''), array('\\\\','\\\''), strip_tags($val)));
1995 2125
 				}
@@ -1997,11 +2127,16 @@  discard block
 block discarded – undo
1997 2127
 			$name_str = sprintf('$_menu_names[%d] = array(%s); %s', $node->menu_item_srl, $name_arr_str, $child_output['name']);
1998 2128
 
1999 2129
 			// If url value is not empty in the current node, put the value into an array url_list
2000
-			if($node->url) $child_output['url_list'][] = $node->url;
2130
+			if($node->url) {
2131
+				$child_output['url_list'][] = $node->url;
2132
+			}
2001 2133
 			$output['url_list'] = array_merge($output['url_list'], $child_output['url_list']);
2002 2134
 			// If node->group_srls value exists
2003
-			if($node->group_srls)$group_check_code = sprintf('($is_admin==true||(is_array($group_srls)&&count(array_intersect($group_srls, array(%s))))||($is_logged && %s))',$node->group_srls,$node->group_srls == -1?1:0);
2004
-			else $group_check_code = "true";
2135
+			if($node->group_srls) {
2136
+				$group_check_code = sprintf('($is_admin==true||(is_array($group_srls)&&count(array_intersect($group_srls, array(%s))))||($is_logged && %s))',$node->group_srls,$node->group_srls == -1?1:0);
2137
+			} else {
2138
+				$group_check_code = "true";
2139
+			}
2005 2140
 
2006 2141
 			// List variables
2007 2142
 			$href = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->href);
@@ -2010,8 +2145,9 @@  discard block
 block discarded – undo
2010 2145
 			if(preg_match('/^([0-9a-zA-Z\_\-]+)$/i', $node->url))
2011 2146
 			{
2012 2147
 				$href = "getSiteUrl('$domain', '','mid','$node->url')";
2148
+			} else {
2149
+				$href = sprintf('"%s"', $url);
2013 2150
 			}
2014
-			else $href = sprintf('"%s"', $url);
2015 2151
 			$is_shortcut = $node->is_shortcut;
2016 2152
 			$open_window = $node->open_window;
2017 2153
 			$normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->normal_btn);
@@ -2028,29 +2164,48 @@  discard block
 block discarded – undo
2028 2164
 			$expand = $node->expand;
2029 2165
 
2030 2166
 			$normal_btn = $node->normal_btn;
2031
-			if($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) $normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$normal_btn);
2032
-			else $normal_btn = '';
2167
+			if($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) {
2168
+				$normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$normal_btn);
2169
+			} else {
2170
+				$normal_btn = '';
2171
+			}
2033 2172
 
2034 2173
 			$hover_btn = $node->hover_btn;
2035
-			if($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) $hover_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$hover_btn);
2036
-			else $hover_btn = '';
2174
+			if($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) {
2175
+				$hover_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$hover_btn);
2176
+			} else {
2177
+				$hover_btn = '';
2178
+			}
2037 2179
 
2038 2180
 			$active_btn = $node->active_btn;
2039
-			if($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) $active_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$active_btn);
2040
-			else $active_btn = '';
2181
+			if($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) {
2182
+				$active_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$active_btn);
2183
+			} else {
2184
+				$active_btn = '';
2185
+			}
2041 2186
 
2042 2187
 
2043 2188
 			$group_srls = $node->group_srls;
2044 2189
 
2045 2190
 			if($normal_btn)
2046 2191
 			{
2047
-				if($hover_btn) $hover_str = sprintf('onmouseover=\"this.src=\'%s\'\"', $hover_btn); else $hover_str = '';
2048
-				if($active_btn) $active_str = sprintf('onmousedown=\"this.src=\'%s\'\"', $active_btn); else $active_str = '';
2192
+				if($hover_btn) {
2193
+					$hover_str = sprintf('onmouseover=\"this.src=\'%s\'\"', $hover_btn);
2194
+				} else {
2195
+					$hover_str = '';
2196
+				}
2197
+				if($active_btn) {
2198
+					$active_str = sprintf('onmousedown=\"this.src=\'%s\'\"', $active_btn);
2199
+				} else {
2200
+					$active_str = '';
2201
+				}
2049 2202
 				$link = sprintf('"<img src=\"%s\" onmouseout=\"this.src=\'%s\'\" alt=\"".$_menu_names[%d][$lang_type]."\" %s %s />"', $normal_btn, $normal_btn, $node->menu_item_srl, $hover_str, $active_str);
2050
-				if($active_btn) $link_active = sprintf('"<img src=\"%s\" onmouseout=\"this.src=\'%s\'\" alt=\"".$_menu_names[%d][$lang_type]."\" %s />"', $active_btn, $active_btn, $node->menu_item_srl, $hover_str);
2051
-				else $link_active = $link;
2052
-			}
2053
-			else
2203
+				if($active_btn) {
2204
+					$link_active = sprintf('"<img src=\"%s\" onmouseout=\"this.src=\'%s\'\" alt=\"".$_menu_names[%d][$lang_type]."\" %s />"', $active_btn, $active_btn, $node->menu_item_srl, $hover_str);
2205
+				} else {
2206
+					$link_active = $link;
2207
+				}
2208
+			} else
2054 2209
 			{
2055 2210
 				$link_active = $link = sprintf('$_menu_names[%d][$lang_type]', $node->menu_item_srl);
2056 2211
 			}
@@ -2099,11 +2254,15 @@  discard block
 block discarded – undo
2099 2254
 	 */
2100 2255
 	function updateMenuLayout($layout_srl, $menu_srl_list)
2101 2256
 	{
2102
-		if(!count($menu_srl_list)) return;
2257
+		if(!count($menu_srl_list)) {
2258
+			return;
2259
+		}
2103 2260
 		// Delete the value of menu_srls
2104 2261
 		$args->menu_srls = implode(',',$menu_srl_list);
2105 2262
 		$output = executeQuery('menu.deleteMenuLayout', $args);
2106
-		if(!$output->toBool()) return $output;
2263
+		if(!$output->toBool()) {
2264
+			return $output;
2265
+		}
2107 2266
 
2108 2267
 		$args->layout_srl = $layout_srl;
2109 2268
 		// Mapping menu_srls, layout_srl
@@ -2111,7 +2270,9 @@  discard block
 block discarded – undo
2111 2270
 		{
2112 2271
 			$args->menu_srl = $menu_srl_list[$i];
2113 2272
 			$output = executeQuery('menu.insertMenuLayout', $args);
2114
-			if(!$output->toBool()) return $output;
2273
+			if(!$output->toBool()) {
2274
+				return $output;
2275
+			}
2115 2276
 		}
2116 2277
 	}
2117 2278
 
@@ -2134,9 +2295,15 @@  discard block
 block discarded – undo
2134 2295
 			$oMenuModel = getAdminModel('menu');
2135 2296
 			$itemInfo = $oMenuModel->getMenuItemInfo($args->menu_item_srl);
2136 2297
 
2137
-			if($args->isNormalDelete == 'Y' && $itemInfo->normal_btn) FileHandler::removeFile($itemInfo->normal_btn);
2138
-			if($args->isHoverDelete == 'Y' && $itemInfo->hover_btn) FileHandler::removeFile($itemInfo->hover_btn);
2139
-			if($args->isActiveDelete == 'Y' && $itemInfo->active_btn) FileHandler::removeFile($itemInfo->active_btn);
2298
+			if($args->isNormalDelete == 'Y' && $itemInfo->normal_btn) {
2299
+				FileHandler::removeFile($itemInfo->normal_btn);
2300
+			}
2301
+			if($args->isHoverDelete == 'Y' && $itemInfo->hover_btn) {
2302
+				FileHandler::removeFile($itemInfo->hover_btn);
2303
+			}
2304
+			if($args->isActiveDelete == 'Y' && $itemInfo->active_btn) {
2305
+				FileHandler::removeFile($itemInfo->active_btn);
2306
+			}
2140 2307
 		}
2141 2308
 
2142 2309
 		$returnArray = array();
Please login to merge, or discard this patch.