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 ( 78ace2...4b54c6 )
by gyeong-won
09:15
created
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"><if test="$modify_find_account_answer" attr="required" value="true" /></field>';
506 506
 					$fields[] = '<field name="find_account_answer" length=":250"><if test="$modify_find_account_answer" attr="required" value="true" /></field>';
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"><if test="$modify_find_account_answer" attr="required" value="true" /></field>';
506 517
 					$fields[] = '<field name="find_account_answer" length=":250"><if test="$modify_find_account_answer" attr="required" value="true" /></field>';
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   +72 added lines, -72 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};
@@ -140,14 +140,14 @@  discard block
 block discarded – undo
140 140
 	{
141 141
 		$config = $this->memberConfig;
142 142
 
143
-		if($config->redirect_url)
143
+		if ($config->redirect_url)
144 144
 		{
145 145
 			$mid = str_ireplace(Context::getDefaultUrl(), '', $config->redirect_url);
146 146
 
147 147
 			$siteModuleInfo = Context::get('site_module_info');
148 148
 
149 149
 			$oModuleModel = getModel('module');
150
-			$moduleInfo = $oModuleModel->getModuleInfoByMid($mid, (int)$siteModuleInfo->site_srl);
150
+			$moduleInfo = $oModuleModel->getModuleInfoByMid($mid, (int) $siteModuleInfo->site_srl);
151 151
 
152 152
 			$config->redirect_url = $moduleInfo->module_srl;
153 153
 			Context::set('config', $config);
@@ -173,9 +173,9 @@  discard block
 block discarded – undo
173 173
 		Context::set('editor', $editor);
174 174
 
175 175
 		$signupForm = $config->signupForm;
176
-		foreach($signupForm as $val)
176
+		foreach ($signupForm as $val)
177 177
 		{
178
-			if($val->name == 'user_id')
178
+			if ($val->name == 'user_id')
179 179
 			{
180 180
 				$userIdInfo = $val;
181 181
 				break;
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 		}
184 184
 
185 185
 		$oSecurity = new Security();
186
-		if($userIdInfo->isUse)
186
+		if ($userIdInfo->isUse)
187 187
 		{
188 188
 			// get denied ID list
189 189
 			Context::set('useUserID', 1);
@@ -274,16 +274,16 @@  discard block
 block discarded – undo
274 274
 		Context::set('editor', $editor);
275 275
 
276 276
 		$signupForm = $config->signupForm;
277
-		foreach($signupForm as $val)
277
+		foreach ($signupForm as $val)
278 278
 		{
279
-			if($val->name == 'user_id')
279
+			if ($val->name == 'user_id')
280 280
 			{
281 281
 				$userIdInfo = $val;
282 282
 				break;
283 283
 			}
284 284
 		}
285 285
 
286
-		if($userIdInfo->isUse)
286
+		if ($userIdInfo->isUse)
287 287
 		{
288 288
 			// get denied ID list
289 289
 			Context::set('useUserID', 1);
@@ -344,14 +344,14 @@  discard block
 block discarded – undo
344 344
 		$oMemberModel = getModel('member');
345 345
 
346 346
 		$memberInfo = Context::get('member_info');
347
-		if(isset($memberInfo))
347
+		if (isset($memberInfo))
348 348
 		{
349 349
 			$memberInfo->signature = $oMemberModel->getSignature($this->memberInfo->member_srl);
350 350
 		}
351 351
 		Context::set('member_info', $memberInfo);
352 352
 
353 353
 		// get an editor for the signature
354
-		if($memberInfo->member_srl)
354
+		if ($memberInfo->member_srl)
355 355
 		{
356 356
 			$oEditorModel = getModel('editor');
357 357
 			$option = new stdClass();
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
 		}
406 406
 
407 407
 		$member_config = $this->memberConfig;
408
-		if(!$this->memberConfig)
408
+		if (!$this->memberConfig)
409 409
 		{
410 410
 			$member_config = $this->memberConfig = $oMemberModel->getMemberConfig();
411 411
 		}
@@ -416,25 +416,25 @@  discard block
 block discarded – undo
416 416
 		$formTags = array();
417 417
 		global $lang;
418 418
 
419
-		foreach($member_config->signupForm as $no=>$formInfo)
419
+		foreach ($member_config->signupForm as $no=>$formInfo)
420 420
 		{
421
-			if(!$formInfo->isUse)continue;
421
+			if (!$formInfo->isUse)continue;
422 422
 
423 423
 			// 회원 본인이 아닌 경우 입력 폼 제거
424
-			if($formInfo->name == 'find_account_question' && $memberInfo['member_srl'] !== $logged_info->member_srl)
424
+			if ($formInfo->name == 'find_account_question' && $memberInfo['member_srl'] !== $logged_info->member_srl)
425 425
 			{
426 426
 				unset($member_config->signupForm[$no]);
427 427
 				continue;
428 428
 			}
429 429
 
430
-			if($formInfo->name == $member_config->identifier || $formInfo->name == 'password') continue;
430
+			if ($formInfo->name == $member_config->identifier || $formInfo->name == 'password') continue;
431 431
 
432 432
 			$formTag = new stdClass();
433 433
 			$inputTag = '';
434 434
 			$formTag->title = ($formInfo->isDefaultForm) ? $lang->{$formInfo->name} : $formInfo->title;
435
-			if($isAdmin)
435
+			if ($isAdmin)
436 436
 			{
437
-				if($formInfo->mustRequired) $formTag->title = '<em style="color:red">*</em> '.$formTag->title;
437
+				if ($formInfo->mustRequired) $formTag->title = '<em style="color:red">*</em> '.$formTag->title;
438 438
 			}
439 439
 			else
440 440
 			{
@@ -442,28 +442,28 @@  discard block
 block discarded – undo
442 442
 			}
443 443
 			$formTag->name = $formInfo->name;
444 444
 
445
-			if($formInfo->isDefaultForm)
445
+			if ($formInfo->isDefaultForm)
446 446
 			{
447
-				if($formInfo->imageType)
447
+				if ($formInfo->imageType)
448 448
 				{
449 449
 					$formTag->type = 'image';
450
-					if($formInfo->name == 'profile_image')
450
+					if ($formInfo->name == 'profile_image')
451 451
 					{
452 452
 						$target = $memberInfo['profile_image'];
453 453
 						$functionName = 'doDeleteProfileImage';
454 454
 					}
455
-					else if($formInfo->name == 'image_name')
455
+					else if ($formInfo->name == 'image_name')
456 456
 					{
457 457
 						$target = $memberInfo['image_name'];
458 458
 						$functionName = 'doDeleteImageName';
459 459
 					}
460
-					else if($formInfo->name == 'image_mark')
460
+					else if ($formInfo->name == 'image_mark')
461 461
 					{
462 462
 						$target = $memberInfo['image_mark'];
463 463
 						$functionName = 'doDeleteImageMark';
464 464
 					}
465 465
 
466
-					if($target->src)
466
+					if ($target->src)
467 467
 					{
468 468
 						$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>',
469 469
 							$formInfo->name,
@@ -486,7 +486,7 @@  discard block
 block discarded – undo
486 486
 						$lang->{$formInfo->name.'_max_height'},
487 487
 						$member_config->{$formInfo->name.'_max_height'});
488 488
 					}//end imageType
489
-					else if($formInfo->name == 'birthday')
489
+					else if ($formInfo->name == 'birthday')
490 490
 					{
491 491
 						$formTag->type = 'date';
492 492
 						$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" />',
@@ -494,16 +494,16 @@  discard block
 block discarded – undo
494 494
 							zdate($memberInfo['birthday'], 'Y-m-d', false),
495 495
 							$lang->cmd_delete);
496 496
 					}
497
-					else if($formInfo->name == 'find_account_question')
497
+					else if ($formInfo->name == 'find_account_question')
498 498
 					{
499 499
 						$disabled = (!!$memberInfo['member_srl']) ? 'disabled="disabled"' : '';
500 500
 
501 501
 						$formTag->type = 'select';
502 502
 						$inputTag = '<select name="find_account_question" id="find_account_question" style="display:block;margin:0 0 8px 0" %s>%s</select>';
503 503
 						$optionTag = array();
504
-						foreach($lang->find_account_question_items as $key=>$val)
504
+						foreach ($lang->find_account_question_items as $key=>$val)
505 505
 						{
506
-							if($key == $memberInfo['find_account_question']) $selected = 'selected="selected"';
506
+							if ($key == $memberInfo['find_account_question']) $selected = 'selected="selected"';
507 507
 							else $selected = '';
508 508
 							$optionTag[] = sprintf('<option value="%s" %s >%s</option>',
509 509
 								$key,
@@ -511,24 +511,24 @@  discard block
 block discarded – undo
511 511
 								$val);
512 512
 						}
513 513
 						$inputTag = sprintf($inputTag, $disabled, implode('', $optionTag));
514
-						$inputTag .= '<input type="text" name="find_account_answer" id="find_account_answer" title="'.Context::getLang('find_account_answer').'" value="" ' . $disabled . ' />';
514
+						$inputTag .= '<input type="text" name="find_account_answer" id="find_account_answer" title="'.Context::getLang('find_account_answer').'" value="" '.$disabled.' />';
515 515
 
516
-						if($disabled) {
517
-							$inputTag .= ' <label><input type="checkbox" name="modify_find_account_answer" value="Y" /> ' . Context::getLang('cmd_modify') . '</label>';
516
+						if ($disabled) {
517
+							$inputTag .= ' <label><input type="checkbox" name="modify_find_account_answer" value="Y" /> '.Context::getLang('cmd_modify').'</label>';
518 518
 							$inputTag .= '<script>(function($) {$(function() {$(\'[name=modify_find_account_answer]\').change(function() {var $this = $(this); if($this.prop(\'checked\')) {$(\'[name=find_account_question],[name=find_account_answer]\').attr(\'disabled\', false); } else {$(\'[name=find_account_question]\').attr(\'disabled\', true); $(\'[name=find_account_answer]\').attr(\'disabled\', true).val(\'\'); } }); }); })(jQuery);</script>';
519 519
 						}
520 520
 					}
521
-					else if($formInfo->name == 'email_address')
521
+					else if ($formInfo->name == 'email_address')
522 522
 					{
523 523
 						$formTag->type = 'email';
524 524
 						$inputTag = '<input type="email" name="email_address" id="email_address" value="'.$memberInfo['email_address'].'" />';
525 525
 					}
526
-					else if($formInfo->name == 'homepage')
526
+					else if ($formInfo->name == 'homepage')
527 527
 					{
528 528
 						$formTag->type = 'url';
529 529
 						$inputTag = '<input type="url" name="homepage" id="homepage" value="'.$memberInfo['homepage'].'" />';
530 530
 					}
531
-					else if($formInfo->name == 'blog')
531
+					else if ($formInfo->name == 'blog')
532 532
 					{
533 533
 						$formTag->type = 'url';
534 534
 						$inputTag = '<input type="url" name="blog" id="blog" value="'.$memberInfo['blog'].'" />';
@@ -549,92 +549,92 @@  discard block
 block discarded – undo
549 549
 					$extentionReplace = array();
550 550
 
551 551
 					$formTag->type = $extendForm->column_type;
552
-					if($extendForm->column_type == 'text')
552
+					if ($extendForm->column_type == 'text')
553 553
 					{
554 554
 						$template = '<input type="text" name="%column_name%" id="%column_name%" value="%value%" />';
555 555
 					}
556
-					else if($extendForm->column_type == 'homepage')
556
+					else if ($extendForm->column_type == 'homepage')
557 557
 					{
558 558
 						$template = '<input type="url" name="%column_name%" id="%column_name%" value="%value%" />';
559 559
 					}
560
-					else if($extendForm->column_type == 'email_address')
560
+					else if ($extendForm->column_type == 'email_address')
561 561
 					{
562 562
 						$template = '<input type="email" name="%column_name%" id="%column_name%" value="%value%" />';
563 563
 					}
564
-					else if($extendForm->column_type == 'tel')
564
+					else if ($extendForm->column_type == 'tel')
565 565
 					{
566 566
 						$extentionReplace = array('tel_0' => $extendForm->value[0],
567 567
 							'tel_1' => $extendForm->value[1],
568 568
 							'tel_2' => $extendForm->value[2]);
569 569
 						$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" />';
570 570
 					}
571
-					else if($extendForm->column_type == 'textarea')
571
+					else if ($extendForm->column_type == 'textarea')
572 572
 					{
573 573
 						$template = '<textarea name="%column_name%" id="%column_name%" rows="4" cols="42">%value%</textarea>';
574 574
 					}
575
-					else if($extendForm->column_type == 'checkbox')
575
+					else if ($extendForm->column_type == 'checkbox')
576 576
 					{
577 577
 						$template = '';
578
-						if($extendForm->default_value)
578
+						if ($extendForm->default_value)
579 579
 						{
580 580
 							$template = '<div style="padding-top:5px">%s</div>';
581 581
 							$__i = 0;
582 582
 							$optionTag = array();
583
-							foreach($extendForm->default_value as $v)
583
+							foreach ($extendForm->default_value as $v)
584 584
 							{
585 585
 								$checked = '';
586
-								if(is_array($extendForm->value) && in_array($v, $extendForm->value))$checked = 'checked="checked"';
586
+								if (is_array($extendForm->value) && in_array($v, $extendForm->value))$checked = 'checked="checked"';
587 587
 								$optionTag[] = '<label for="%column_name%'.$__i.'"><input type="checkbox" id="%column_name%'.$__i.'" name="%column_name%[]" value="'.$v.'" '.$checked.' /> '.$v.'</label>';
588 588
 								$__i++;
589 589
 							}
590 590
 							$template = sprintf($template, implode('', $optionTag));
591 591
 						}
592 592
 					}
593
-					else if($extendForm->column_type == 'radio')
593
+					else if ($extendForm->column_type == 'radio')
594 594
 					{
595 595
 						$template = '';
596
-						if($extendForm->default_value)
596
+						if ($extendForm->default_value)
597 597
 						{
598 598
 							$template = '<div style="padding-top:5px">%s</div>';
599 599
 							$optionTag = array();
600
-							foreach($extendForm->default_value as $v)
600
+							foreach ($extendForm->default_value as $v)
601 601
 							{
602
-								if($extendForm->value == $v)$checked = 'checked="checked"';
602
+								if ($extendForm->value == $v)$checked = 'checked="checked"';
603 603
 								else $checked = '';
604 604
 								$optionTag[] = '<label><input type="radio" name="%column_name%" value="'.$v.'" '.$checked.' /> '.$v.'</label>';
605 605
 							}
606 606
 							$template = sprintf($template, implode('', $optionTag));
607 607
 						}
608 608
 					}
609
-					else if($extendForm->column_type == 'select')
609
+					else if ($extendForm->column_type == 'select')
610 610
 					{
611 611
 						$template = '<select name="'.$formInfo->name.'" id="'.$formInfo->name.'">%s</select>';
612 612
 						$optionTag = array();
613 613
 						$optionTag[] = sprintf('<option value="">%s</option>', $lang->cmd_select);
614
-						if($extendForm->default_value)
614
+						if ($extendForm->default_value)
615 615
 						{
616
-							foreach($extendForm->default_value as $v)
616
+							foreach ($extendForm->default_value as $v)
617 617
 							{
618
-								if($v == $extendForm->value) $selected = 'selected="selected"';
618
+								if ($v == $extendForm->value) $selected = 'selected="selected"';
619 619
 								else $selected = '';
620 620
 								$optionTag[] = sprintf('<option value="%s" %s >%s</option>', $v, $selected, $v);
621 621
 							}
622 622
 						}
623 623
 						$template = sprintf($template, implode('', $optionTag));
624 624
 					}
625
-					else if($extendForm->column_type == 'kr_zip')
625
+					else if ($extendForm->column_type == 'kr_zip')
626 626
 					{
627 627
 						$krzipModel = getModel('krzip');
628
-						if($krzipModel && method_exists($krzipModel , 'getKrzipCodeSearchHtml' ))
628
+						if ($krzipModel && method_exists($krzipModel, 'getKrzipCodeSearchHtml'))
629 629
 						{
630 630
 							$template = $krzipModel->getKrzipCodeSearchHtml($extendForm->column_name, $extendForm->value);
631 631
 						}
632 632
 					}
633
-					else if($extendForm->column_type == 'jp_zip')
633
+					else if ($extendForm->column_type == 'jp_zip')
634 634
 					{
635 635
 						$template = '<input type="text" name="%column_name%" id="%column_name%" value="%value%" />';
636 636
 					}
637
-					else if($extendForm->column_type == 'date')
637
+					else if ($extendForm->column_type == 'date')
638 638
 					{
639 639
 						$extentionReplace = array('date' => zdate($extendForm->value, 'Y-m-d'), 'cmd_delete' => $lang->cmd_delete);
640 640
 						$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" />';
@@ -643,7 +643,7 @@  discard block
 block discarded – undo
643 643
 					$replace = array_merge($extentionReplace, $replace);
644 644
 					$inputTag = preg_replace_callback('@%(\w+)%@', function($n) use($replace) { return $replace[$n[1]]; }, $template);
645 645
 
646
-					if($extendForm->description)
646
+					if ($extendForm->description)
647 647
 						$inputTag .= '<p class="help-block">'.$extendForm->description.'</p>';
648 648
 				}
649 649
 				$formTag->inputTag = $inputTag;
@@ -674,12 +674,12 @@  discard block
 block discarded – undo
674 674
 	function dispMemberAdminInsertJoinForm() {
675 675
 		// Get the value of join_form
676 676
 		$member_join_form_srl = Context::get('member_join_form_srl');
677
-		if($member_join_form_srl)
677
+		if ($member_join_form_srl)
678 678
 		{
679 679
 			$oMemberModel = getModel('member');
680 680
 			$join_form = $oMemberModel->getJoinForm($member_join_form_srl);
681 681
 
682
-			if(!$join_form) Context::set('member_join_form_srl','',true);
682
+			if (!$join_form) Context::set('member_join_form_srl', '', true);
683 683
 			else
684 684
 			{
685 685
 				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', 'find_account_answer');
@@ -418,7 +421,9 @@  discard block
 block discarded – undo
418 421
 
419 422
 		foreach($member_config->signupForm as $no=>$formInfo)
420 423
 		{
421
-			if(!$formInfo->isUse)continue;
424
+			if(!$formInfo->isUse) {
425
+				continue;
426
+			}
422 427
 
423 428
 			// 회원 본인이 아닌 경우 입력 폼 제거
424 429
 			if($formInfo->name == 'find_account_question' && $memberInfo['member_srl'] !== $logged_info->member_srl)
@@ -427,18 +432,23 @@  discard block
 block discarded – undo
427 432
 				continue;
428 433
 			}
429 434
 
430
-			if($formInfo->name == $member_config->identifier || $formInfo->name == 'password') continue;
435
+			if($formInfo->name == $member_config->identifier || $formInfo->name == 'password') {
436
+				continue;
437
+			}
431 438
 
432 439
 			$formTag = new stdClass();
433 440
 			$inputTag = '';
434 441
 			$formTag->title = ($formInfo->isDefaultForm) ? $lang->{$formInfo->name} : $formInfo->title;
435 442
 			if($isAdmin)
436 443
 			{
437
-				if($formInfo->mustRequired) $formTag->title = '<em style="color:red">*</em> '.$formTag->title;
438
-			}
439
-			else
444
+				if($formInfo->mustRequired) {
445
+					$formTag->title = '<em style="color:red">*</em> '.$formTag->title;
446
+				}
447
+			} else
440 448
 			{
441
-				if ($formInfo->required && $formInfo->name != 'password') $formTag->title = '<em style="color:red">*</em> '.$formTag->title;
449
+				if ($formInfo->required && $formInfo->name != 'password') {
450
+					$formTag->title = '<em style="color:red">*</em> '.$formTag->title;
451
+				}
442 452
 			}
443 453
 			$formTag->name = $formInfo->name;
444 454
 
@@ -451,13 +461,11 @@  discard block
 block discarded – undo
451 461
 					{
452 462
 						$target = $memberInfo['profile_image'];
453 463
 						$functionName = 'doDeleteProfileImage';
454
-					}
455
-					else if($formInfo->name == 'image_name')
464
+					} else if($formInfo->name == 'image_name')
456 465
 					{
457 466
 						$target = $memberInfo['image_name'];
458 467
 						$functionName = 'doDeleteImageName';
459
-					}
460
-					else if($formInfo->name == 'image_mark')
468
+					} else if($formInfo->name == 'image_mark')
461 469
 					{
462 470
 						$target = $memberInfo['image_mark'];
463 471
 						$functionName = 'doDeleteImageMark';
@@ -473,8 +481,7 @@  discard block
 block discarded – undo
473 481
 							$functionName,
474 482
 							$memberInfo['member_srl'],
475 483
 							$lang->cmd_delete);
476
-					}
477
-					else
484
+					} else
478 485
 					{
479 486
 						$inputTag = sprintf('<input type="hidden" name="__%s_exist" value="false" />', $formInfo->name);
480 487
 					}
@@ -493,8 +500,7 @@  discard block
 block discarded – undo
493 500
 							$memberInfo['birthday'],
494 501
 							zdate($memberInfo['birthday'], 'Y-m-d', false),
495 502
 							$lang->cmd_delete);
496
-					}
497
-					else if($formInfo->name == 'find_account_question')
503
+					} else if($formInfo->name == 'find_account_question')
498 504
 					{
499 505
 						$disabled = (!!$memberInfo['member_srl']) ? 'disabled="disabled"' : '';
500 506
 
@@ -503,8 +509,11 @@  discard block
 block discarded – undo
503 509
 						$optionTag = array();
504 510
 						foreach($lang->find_account_question_items as $key=>$val)
505 511
 						{
506
-							if($key == $memberInfo['find_account_question']) $selected = 'selected="selected"';
507
-							else $selected = '';
512
+							if($key == $memberInfo['find_account_question']) {
513
+								$selected = 'selected="selected"';
514
+							} else {
515
+								$selected = '';
516
+							}
508 517
 							$optionTag[] = sprintf('<option value="%s" %s >%s</option>',
509 518
 								$key,
510 519
 								$selected,
@@ -517,23 +526,19 @@  discard block
 block discarded – undo
517 526
 							$inputTag .= ' <label><input type="checkbox" name="modify_find_account_answer" value="Y" /> ' . Context::getLang('cmd_modify') . '</label>';
518 527
 							$inputTag .= '<script>(function($) {$(function() {$(\'[name=modify_find_account_answer]\').change(function() {var $this = $(this); if($this.prop(\'checked\')) {$(\'[name=find_account_question],[name=find_account_answer]\').attr(\'disabled\', false); } else {$(\'[name=find_account_question]\').attr(\'disabled\', true); $(\'[name=find_account_answer]\').attr(\'disabled\', true).val(\'\'); } }); }); })(jQuery);</script>';
519 528
 						}
520
-					}
521
-					else if($formInfo->name == 'email_address')
529
+					} else if($formInfo->name == 'email_address')
522 530
 					{
523 531
 						$formTag->type = 'email';
524 532
 						$inputTag = '<input type="email" name="email_address" id="email_address" value="'.$memberInfo['email_address'].'" />';
525
-					}
526
-					else if($formInfo->name == 'homepage')
533
+					} else if($formInfo->name == 'homepage')
527 534
 					{
528 535
 						$formTag->type = 'url';
529 536
 						$inputTag = '<input type="url" name="homepage" id="homepage" value="'.$memberInfo['homepage'].'" />';
530
-					}
531
-					else if($formInfo->name == 'blog')
537
+					} else if($formInfo->name == 'blog')
532 538
 					{
533 539
 						$formTag->type = 'url';
534 540
 						$inputTag = '<input type="url" name="blog" id="blog" value="'.$memberInfo['blog'].'" />';
535
-					}
536
-					else
541
+					} else
537 542
 					{
538 543
 						$formTag->type = 'text';
539 544
 						$inputTag = sprintf('<input type="text" name="%s" id="%s" value="%s" />',
@@ -552,27 +557,22 @@  discard block
 block discarded – undo
552 557
 					if($extendForm->column_type == 'text')
553 558
 					{
554 559
 						$template = '<input type="text" name="%column_name%" id="%column_name%" value="%value%" />';
555
-					}
556
-					else if($extendForm->column_type == 'homepage')
560
+					} else if($extendForm->column_type == 'homepage')
557 561
 					{
558 562
 						$template = '<input type="url" name="%column_name%" id="%column_name%" value="%value%" />';
559
-					}
560
-					else if($extendForm->column_type == 'email_address')
563
+					} else if($extendForm->column_type == 'email_address')
561 564
 					{
562 565
 						$template = '<input type="email" name="%column_name%" id="%column_name%" value="%value%" />';
563
-					}
564
-					else if($extendForm->column_type == 'tel')
566
+					} else if($extendForm->column_type == 'tel')
565 567
 					{
566 568
 						$extentionReplace = array('tel_0' => $extendForm->value[0],
567 569
 							'tel_1' => $extendForm->value[1],
568 570
 							'tel_2' => $extendForm->value[2]);
569 571
 						$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" />';
570
-					}
571
-					else if($extendForm->column_type == 'textarea')
572
+					} else if($extendForm->column_type == 'textarea')
572 573
 					{
573 574
 						$template = '<textarea name="%column_name%" id="%column_name%" rows="4" cols="42">%value%</textarea>';
574
-					}
575
-					else if($extendForm->column_type == 'checkbox')
575
+					} else if($extendForm->column_type == 'checkbox')
576 576
 					{
577 577
 						$template = '';
578 578
 						if($extendForm->default_value)
@@ -583,14 +583,15 @@  discard block
 block discarded – undo
583 583
 							foreach($extendForm->default_value as $v)
584 584
 							{
585 585
 								$checked = '';
586
-								if(is_array($extendForm->value) && in_array($v, $extendForm->value))$checked = 'checked="checked"';
586
+								if(is_array($extendForm->value) && in_array($v, $extendForm->value)) {
587
+									$checked = 'checked="checked"';
588
+								}
587 589
 								$optionTag[] = '<label for="%column_name%'.$__i.'"><input type="checkbox" id="%column_name%'.$__i.'" name="%column_name%[]" value="'.$v.'" '.$checked.' /> '.$v.'</label>';
588 590
 								$__i++;
589 591
 							}
590 592
 							$template = sprintf($template, implode('', $optionTag));
591 593
 						}
592
-					}
593
-					else if($extendForm->column_type == 'radio')
594
+					} else if($extendForm->column_type == 'radio')
594 595
 					{
595 596
 						$template = '';
596 597
 						if($extendForm->default_value)
@@ -599,14 +600,16 @@  discard block
 block discarded – undo
599 600
 							$optionTag = array();
600 601
 							foreach($extendForm->default_value as $v)
601 602
 							{
602
-								if($extendForm->value == $v)$checked = 'checked="checked"';
603
-								else $checked = '';
603
+								if($extendForm->value == $v) {
604
+									$checked = 'checked="checked"';
605
+								} else {
606
+									$checked = '';
607
+								}
604 608
 								$optionTag[] = '<label><input type="radio" name="%column_name%" value="'.$v.'" '.$checked.' /> '.$v.'</label>';
605 609
 							}
606 610
 							$template = sprintf($template, implode('', $optionTag));
607 611
 						}
608
-					}
609
-					else if($extendForm->column_type == 'select')
612
+					} else if($extendForm->column_type == 'select')
610 613
 					{
611 614
 						$template = '<select name="'.$formInfo->name.'" id="'.$formInfo->name.'">%s</select>';
612 615
 						$optionTag = array();
@@ -615,26 +618,26 @@  discard block
 block discarded – undo
615 618
 						{
616 619
 							foreach($extendForm->default_value as $v)
617 620
 							{
618
-								if($v == $extendForm->value) $selected = 'selected="selected"';
619
-								else $selected = '';
621
+								if($v == $extendForm->value) {
622
+									$selected = 'selected="selected"';
623
+								} else {
624
+									$selected = '';
625
+								}
620 626
 								$optionTag[] = sprintf('<option value="%s" %s >%s</option>', $v, $selected, $v);
621 627
 							}
622 628
 						}
623 629
 						$template = sprintf($template, implode('', $optionTag));
624
-					}
625
-					else if($extendForm->column_type == 'kr_zip')
630
+					} else if($extendForm->column_type == 'kr_zip')
626 631
 					{
627 632
 						$krzipModel = getModel('krzip');
628 633
 						if($krzipModel && method_exists($krzipModel , 'getKrzipCodeSearchHtml' ))
629 634
 						{
630 635
 							$template = $krzipModel->getKrzipCodeSearchHtml($extendForm->column_name, $extendForm->value);
631 636
 						}
632
-					}
633
-					else if($extendForm->column_type == 'jp_zip')
637
+					} else if($extendForm->column_type == 'jp_zip')
634 638
 					{
635 639
 						$template = '<input type="text" name="%column_name%" id="%column_name%" value="%value%" />';
636
-					}
637
-					else if($extendForm->column_type == 'date')
640
+					} else if($extendForm->column_type == 'date')
638 641
 					{
639 642
 						$extentionReplace = array('date' => zdate($extendForm->value, 'Y-m-d'), 'cmd_delete' => $lang->cmd_delete);
640 643
 						$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" />';
@@ -643,8 +646,9 @@  discard block
 block discarded – undo
643 646
 					$replace = array_merge($extentionReplace, $replace);
644 647
 					$inputTag = preg_replace_callback('@%(\w+)%@', function($n) use($replace) { return $replace[$n[1]]; }, $template);
645 648
 
646
-					if($extendForm->description)
647
-						$inputTag .= '<p class="help-block">'.$extendForm->description.'</p>';
649
+					if($extendForm->description) {
650
+											$inputTag .= '<p class="help-block">'.$extendForm->description.'</p>';
651
+					}
648 652
 				}
649 653
 				$formTag->inputTag = $inputTag;
650 654
 				$formTags[] = $formTag;
@@ -679,8 +683,9 @@  discard block
 block discarded – undo
679 683
 			$oMemberModel = getModel('member');
680 684
 			$join_form = $oMemberModel->getJoinForm($member_join_form_srl);
681 685
 
682
-			if(!$join_form) Context::set('member_join_form_srl','',true);
683
-			else
686
+			if(!$join_form) {
687
+				Context::set('member_join_form_srl','',true);
688
+			} else
684 689
 			{
685 690
 				Context::set('join_form', $join_form);
686 691
 				$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.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.
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.
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.
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   +303 added lines, -303 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();
@@ -464,27 +464,27 @@  discard block
 block discarded – undo
464 464
 			$args->is_shortcut = $request->is_shortcut;
465 465
 			$args->url = $request->shortcut_target;
466 466
 
467
-			if(!$args->open_window) $args->open_window = 'N';
468
-			if(!$args->expand) $args->expand = 'N';
469
-			if(!$args->is_shortcut) $args->is_shortcut = 'Y';
467
+			if (!$args->open_window) $args->open_window = 'N';
468
+			if (!$args->expand) $args->expand = 'N';
469
+			if (!$args->is_shortcut) $args->is_shortcut = 'Y';
470 470
 
471
-			if($request->menu_name_key) $args->name = $request->menu_name_key;
471
+			if ($request->menu_name_key) $args->name = $request->menu_name_key;
472 472
 			else $args->name = $request->menu_name;
473 473
 		}
474 474
 		// type is module short cut
475
-		else if(is_numeric($request->shortcut_target))
475
+		else if (is_numeric($request->shortcut_target))
476 476
 		{
477 477
 			// Get original information
478 478
 			$oMenuAdminModel = getAdminModel('menu');
479 479
 			$itemInfo = $oMenuAdminModel->getMenuItemInfo($request->shortcut_target);
480
-			if(!$itemInfo->menu_item_srl)
480
+			if (!$itemInfo->menu_item_srl)
481 481
 			{
482 482
 				return new Object(-1, 'msg_invalid_request');
483 483
 			}
484 484
 			unset($itemInfo->normal_btn, $itemInfo->hover_btn, $itemInfo->active_btn);
485 485
 
486 486
 			$args = $itemInfo;
487
-			if(count($args->group_srls) == 0)
487
+			if (count($args->group_srls) == 0)
488 488
 			{
489 489
 				unset($args->group_srls);
490 490
 			}
@@ -504,13 +504,13 @@  discard block
 block discarded – undo
504 504
 			$args->url = '#';
505 505
 		}
506 506
 
507
-		if($request->menu_desc) $args->desc = $request->menu_desc;
507
+		if ($request->menu_desc) $args->desc = $request->menu_desc;
508 508
 		else $args->desc = '';
509 509
 
510 510
 		$args->menu_item_srl = getNextSequence();
511
-		$args->listorder = -1*$args->menu_item_srl;
511
+		$args->listorder = -1 * $args->menu_item_srl;
512 512
 		$output = executeQuery('menu.insertMenuItem', $args);
513
-		if(!$output->toBool()) return $output;
513
+		if (!$output->toBool()) return $output;
514 514
 
515 515
 		$oDB->commit();
516 516
 
@@ -532,46 +532,46 @@  discard block
 block discarded – undo
532 532
 		$args->expand = $request->menu_expand;
533 533
 		$args->is_shortcut = $request->is_shortcut;
534 534
 
535
-		if(!$args->open_window) $args->open_window = 'N';
536
-		if(!$args->expand) $args->expand = 'N';
537
-		if(!$args->is_shortcut) $args->is_shortcut = 'N';
535
+		if (!$args->open_window) $args->open_window = 'N';
536
+		if (!$args->expand) $args->expand = 'N';
537
+		if (!$args->is_shortcut) $args->is_shortcut = 'N';
538 538
 
539
-		if($request->menu_name_key) $args->name = $request->menu_name_key;
539
+		if ($request->menu_name_key) $args->name = $request->menu_name_key;
540 540
 		else $args->name = $request->menu_name;
541 541
 
542
-		if($request->menu_desc) $args->desc = $request->menu_desc;
542
+		if ($request->menu_desc) $args->desc = $request->menu_desc;
543 543
 		else $args->desc = '';
544 544
 
545
-		if($request->module_id && strncasecmp('http', $request->module_id, 4) === 0)
545
+		if ($request->module_id && strncasecmp('http', $request->module_id, 4) === 0)
546 546
 		{
547 547
 			return new Object(-1, 'msg_invalid_request');
548 548
 		}
549 549
 
550 550
 		// when menu copy, module already copied
551
-		if($isProc)
551
+		if ($isProc)
552 552
 		{
553 553
 			$result = $this->_insertModule($request, $args);
554
-			if(!$result->toBool())
554
+			if (!$result->toBool())
555 555
 			{
556 556
 				return new Object(-1, $result->message);
557 557
 			}
558 558
 		}
559 559
 
560 560
 		// if setting button variables, set argument button variables for db insert. but not upload in this method
561
-		if($request->normal_btn) $args->normal_btn = $request->normal_btn;
562
-		if($request->hover_btn) $args->hover_btn = $request->hover_btn;
563
-		if($request->active_btn) $args->active_btn = $request->active_btn;
561
+		if ($request->normal_btn) $args->normal_btn = $request->normal_btn;
562
+		if ($request->hover_btn) $args->hover_btn = $request->hover_btn;
563
+		if ($request->active_btn) $args->active_btn = $request->active_btn;
564 564
 
565
-		if(!$request->module_id)
565
+		if (!$request->module_id)
566 566
 		{
567 567
 			return new Object(-1, 'msg_invalid_request');
568 568
 		}
569 569
 
570 570
 		$args->url = $request->module_id;
571 571
 		$args->menu_item_srl = getNextSequence();
572
-		$args->listorder = -1*$args->menu_item_srl;
572
+		$args->listorder = -1 * $args->menu_item_srl;
573 573
 		$output = executeQuery('menu.insertMenuItem', $args);
574
-		if(!$output->toBool()) return $output;
574
+		if (!$output->toBool()) return $output;
575 575
 
576 576
 		$oDB->commit();
577 577
 
@@ -603,7 +603,7 @@  discard block
 block discarded – undo
603 603
 
604 604
 		//module create
605 605
 		$site_module_info = Context::get('site_module_info');
606
-		$cmArgs->site_srl = (int)$site_module_info->site_srl;
606
+		$cmArgs->site_srl = (int) $site_module_info->site_srl;
607 607
 		$cmArgs->browser_title = $args->name;
608 608
 		$cmArgs->menu_srl = $request->menu_srl;
609 609
 		$cmArgs->layout_srl = -1;
@@ -611,13 +611,13 @@  discard block
 block discarded – undo
611 611
 		$cmArgs->is_skin_fix = 'N';
612 612
 		$cmArgs->is_mskin_fix = 'N';
613 613
 
614
-		if(Mobile::isMobileEnabled() === true)
614
+		if (Mobile::isMobileEnabled() === true)
615 615
 		{
616 616
 			$cmArgs->use_mobile = 'Y';
617 617
 		}
618 618
 
619 619
 		// if mid is empty, auto create mid
620
-		if(!$request->module_id)
620
+		if (!$request->module_id)
621 621
 		{
622 622
 			$randomMid = $this->_makeRandomMid();
623 623
 			$request->module_id = $cmArgs->module.'_'.$randomMid;
@@ -627,7 +627,7 @@  discard block
 block discarded – undo
627 627
 		// check already created module instance
628 628
 		$oModuleModel = getModel('module');
629 629
 		$output = $oModuleModel->getModuleInfoByMid($request->module_id);
630
-		if($output->module_srl)
630
+		if ($output->module_srl)
631 631
 		{
632 632
 			return new Object(-1, 'msg_module_name_exists');
633 633
 		}
@@ -646,14 +646,14 @@  discard block
 block discarded – undo
646 646
 	{
647 647
 		$request = Context::getRequestVars();
648 648
 
649
-		if(!$request->menu_item_srl || !$request->menu_name)
649
+		if (!$request->menu_item_srl || !$request->menu_name)
650 650
 		{
651 651
 			return new Object(-1, 'msg_invalid_request');
652 652
 		}
653 653
 
654 654
 		// variables set
655
-		if($request->menu_open_window != "Y") $request->menu_open_window = "N";
656
-		if($request->menu_expand != "Y") $request->menu_expand = "N";
655
+		if ($request->menu_open_window != "Y") $request->menu_open_window = "N";
656
+		if ($request->menu_expand != "Y") $request->menu_expand = "N";
657 657
 
658 658
 		// Get original information
659 659
 		$oMenuAdminModel = getAdminModel('menu');
@@ -661,19 +661,19 @@  discard block
 block discarded – undo
661 661
 		$args = $itemInfo;
662 662
 
663 663
 		// if menu type is module, check exists module and update
664
-		if($itemInfo->is_shortcut == 'Y')
664
+		if ($itemInfo->is_shortcut == 'Y')
665 665
 		{
666 666
 			// type is url
667
-			if(strncasecmp('http', $request->shortcut_target, 4) === 0 || preg_match('/^(\.\/|\.\.\/|\/).*$/', $request->shortcut_target))
667
+			if (strncasecmp('http', $request->shortcut_target, 4) === 0 || preg_match('/^(\.\/|\.\.\/|\/).*$/', $request->shortcut_target))
668 668
 			{
669 669
 				$args->url = $request->shortcut_target;
670 670
 			}
671 671
 			// type is module short cut
672
-			else if(is_numeric($request->shortcut_target))
672
+			else if (is_numeric($request->shortcut_target))
673 673
 			{
674 674
 				// Get new original information
675 675
 				$newItemInfo = $oMenuAdminModel->getMenuItemInfo($request->shortcut_target);
676
-				if(!$newItemInfo->menu_item_srl)
676
+				if (!$newItemInfo->menu_item_srl)
677 677
 				{
678 678
 					return new Object(-1, 'msg_invalid_request');
679 679
 				}
@@ -690,10 +690,10 @@  discard block
 block discarded – undo
690 690
 		{
691 691
 			// check already created module instance
692 692
 			$oModuleModel = getModel('module');
693
-			if($request->module_id != $itemInfo->url)
693
+			if ($request->module_id != $itemInfo->url)
694 694
 			{
695 695
 				$output = $oModuleModel->getModuleInfoByMid($request->module_id);
696
-				if($output->module_srl)
696
+				if ($output->module_srl)
697 697
 				{
698 698
 					return new Object(-1, 'msg_module_name_exists');
699 699
 				}
@@ -701,13 +701,13 @@  discard block
 block discarded – undo
701 701
 
702 702
 			// if not exist module, return error
703 703
 			$moduleInfo = $oModuleModel->getModuleInfoByMid($itemInfo->url);
704
-			if(!$moduleInfo)
704
+			if (!$moduleInfo)
705 705
 			{
706 706
 				return new Object(-1, 'msg_invalid_request');
707 707
 			}
708 708
 
709 709
 			$moduleInfo->mid = $request->module_id;
710
-			if($request->browser_title)
710
+			if ($request->browser_title)
711 711
 			{
712 712
 				$moduleInfo->browser_title = $request->browser_title;
713 713
 			}
@@ -716,7 +716,7 @@  discard block
 block discarded – undo
716 716
 			$args->url = $request->module_id;
717 717
 		}
718 718
 
719
-		if($request->menu_name_key)
719
+		if ($request->menu_name_key)
720 720
 		{
721 721
 			$args->name = $request->menu_name_key;
722 722
 		}
@@ -725,7 +725,7 @@  discard block
 block discarded – undo
725 725
 			$args->name = $request->menu_name;
726 726
 		}
727 727
 
728
-		if($request->menu_desc) $args->desc = $request->menu_desc;
728
+		if ($request->menu_desc) $args->desc = $request->menu_desc;
729 729
 		else $args->desc = '';
730 730
 
731 731
 		unset($args->group_srls);
@@ -753,38 +753,38 @@  discard block
 block discarded – undo
753 753
 
754 754
 		$btnOutput = $this->_uploadButton($args);
755 755
 
756
-		if($btnOutput['normal_btn'])
756
+		if ($btnOutput['normal_btn'])
757 757
 		{
758 758
 			$this->add('normal_btn', $btnOutput['normal_btn']);
759 759
 			$item_info->normal_btn = $btnOutput['normal_btn'];
760 760
 		}
761
-		if($btnOutput['hover_btn'])
761
+		if ($btnOutput['hover_btn'])
762 762
 		{
763 763
 			$this->add('hover_btn', $btnOutput['hover_btn']);
764 764
 			$item_info->hover_btn = $btnOutput['hover_btn'];
765 765
 		}
766
-		if($btnOutput['active_btn'])
766
+		if ($btnOutput['active_btn'])
767 767
 		{
768 768
 			$this->add('active_btn', $btnOutput['active_btn']);
769 769
 			$item_info->active_btn = $btnOutput['active_btn'];
770 770
 		}
771 771
 
772 772
 		// group_srls check
773
-		if(count($item_info->group_srls) == 0)
773
+		if (count($item_info->group_srls) == 0)
774 774
 		{
775 775
 			unset($item_info->group_srls);
776 776
 		}
777 777
 
778 778
 		// Button delete check
779
-		if(!$btnOutput['normal_btn'] && $args->isNormalDelete == 'Y')
779
+		if (!$btnOutput['normal_btn'] && $args->isNormalDelete == 'Y')
780 780
 		{
781 781
 			$item_info->normal_btn = '';
782 782
 		}
783
-		if(!$btnOutput['hover_btn'] && $args->isHoverDelete == 'Y')
783
+		if (!$btnOutput['hover_btn'] && $args->isHoverDelete == 'Y')
784 784
 		{
785 785
 			$item_info->hover_btn = '';
786 786
 		}
787
-		if(!$btnOutput['active_btn'] && $args->isActiveDelete == 'Y')
787
+		if (!$btnOutput['active_btn'] && $args->isActiveDelete == 'Y')
788 788
 		{
789 789
 			$item_info->active_btn = '';
790 790
 		}
@@ -824,7 +824,7 @@  discard block
 block discarded – undo
824 824
 		$args->is_force = Context::get('is_force');
825 825
 
826 826
 		$returnObj = $this->deleteItem($args);
827
-		if(is_object($returnObj))
827
+		if (is_object($returnObj))
828 828
 		{
829 829
 			$this->setError($returnObj->error);
830 830
 			$this->setMessage($returnObj->message);
@@ -853,11 +853,11 @@  discard block
 block discarded – undo
853 853
 		$args->menu_srl = $itemInfo->menu_srl;
854 854
 
855 855
 		// Display an error that the category cannot be deleted if it has a child node	603
856
-		if($args->is_force != 'Y')
856
+		if ($args->is_force != 'Y')
857 857
 		{
858 858
 			$output = executeQuery('menu.getChildMenuCount', $args);
859
-			if(!$output->toBool()) return $output;
860
-			if($output->data->count > 0)
859
+			if (!$output->toBool()) return $output;
860
+			if ($output->data->count > 0)
861 861
 			{
862 862
 				return new Object(-1001, 'msg_cannot_delete_for_child');
863 863
 			}
@@ -869,22 +869,22 @@  discard block
 block discarded – undo
869 869
 
870 870
 		// check admin menu delete
871 871
 		$oAdmin = getClass('admin');
872
-		if($menu_title == $oAdmin->getAdminMenuName() && $itemInfo->parent_srl == 0)
872
+		if ($menu_title == $oAdmin->getAdminMenuName() && $itemInfo->parent_srl == 0)
873 873
 		{
874 874
 			return $this->stop('msg_cannot_delete_for_admin_topmenu');
875 875
 		}
876 876
 
877
-		if($itemInfo->parent_srl) $parent_srl = $itemInfo->parent_srl;
877
+		if ($itemInfo->parent_srl) $parent_srl = $itemInfo->parent_srl;
878 878
 
879 879
 		// get menu properies with child menu
880 880
 		$phpFile = sprintf("./files/cache/menu/%s.php", $args->menu_srl);
881 881
 		$originMenu = NULL;
882 882
 
883
-		if(is_readable(FileHandler::getRealPath($phpFile)))
883
+		if (is_readable(FileHandler::getRealPath($phpFile)))
884 884
 		{
885 885
 			include(FileHandler::getRealPath($phpFile));
886 886
 
887
-			if(is_array($menu->list))
887
+			if (is_array($menu->list))
888 888
 			{
889 889
 				$this->_searchMenu($menu->list, $args->menu_item_srl, $originMenu);
890 890
 			}
@@ -894,7 +894,7 @@  discard block
 block discarded – undo
894 894
 		$siteInfo = $oModuleModel->getSiteInfo($menuInfo->site_srl);
895 895
 		$isStartmenuInclude = false;
896 896
 		$this->_checkHomeMenuInOriginMenu($originMenu, $siteInfo->mid, $isStartmenuInclude);
897
-		if($isStartmenuInclude)
897
+		if ($isStartmenuInclude)
898 898
 		{
899 899
 			return new Object(-1, 'msg_cannot_delete_homemenu');
900 900
 		}
@@ -918,14 +918,14 @@  discard block
 block discarded – undo
918 918
 
919 919
 	private function _checkHomeMenuInOriginMenu($originMenu, $startMid, &$isStartmenuInclude)
920 920
 	{
921
-		if($originMenu['is_shortcut'] != 'Y' && $originMenu['url'] == $startMid)
921
+		if ($originMenu['is_shortcut'] != 'Y' && $originMenu['url'] == $startMid)
922 922
 		{
923 923
 			$isStartmenuInclude = true;
924 924
 		}
925 925
 
926
-		if(!$isStartmenuInclude && is_array($originMenu['list']))
926
+		if (!$isStartmenuInclude && is_array($originMenu['list']))
927 927
 		{
928
-			foreach($originMenu['list'] AS $key=>$value)
928
+			foreach ($originMenu['list'] AS $key=>$value)
929 929
 			{
930 930
 				$this->_checkHomeMenuInOriginMenu($value, $startMid, $isStartmenuInclude);
931 931
 			}
@@ -939,7 +939,7 @@  discard block
 block discarded – undo
939 939
 		$args->menu_srl = $menuSrl;
940 940
 		$args->menu_item_srl = $node['node_srl'];
941 941
 		$output = executeQuery("menu.deleteMenuItem", $args);
942
-		if(!$output->toBool())
942
+		if (!$output->toBool())
943 943
 		{
944 944
 			$oDB->rollback();
945 945
 			return $output;
@@ -948,12 +948,12 @@  discard block
 block discarded – undo
948 948
 		// Update the xml file and get its location
949 949
 		$xml_file = $this->makeXmlFile($args->menu_srl);
950 950
 		// Delete all of image buttons
951
-		if($node['normal_btn']) FileHandler::removeFile($node['normal_btn']);
952
-		if($node['hover_btn']) FileHandler::removeFile($node['hover_btn']);
953
-		if($node['active_btn']) FileHandler::removeFile($node['active_btn']);
951
+		if ($node['normal_btn']) FileHandler::removeFile($node['normal_btn']);
952
+		if ($node['hover_btn']) FileHandler::removeFile($node['hover_btn']);
953
+		if ($node['active_btn']) FileHandler::removeFile($node['active_btn']);
954 954
 
955 955
 		// Delete module
956
-		if($node['is_shortcut'] != 'Y' && strncasecmp('http', $node['url'], 4) !== 0)
956
+		if ($node['is_shortcut'] != 'Y' && strncasecmp('http', $node['url'], 4) !== 0)
957 957
 		{
958 958
 			$oModuleController = getController('module');
959 959
 			$oModuleModel = getModel('module');
@@ -963,12 +963,12 @@  discard block
 block discarded – undo
963 963
 			$args->site_srl = $menuInfo->site_srl;
964 964
 			$args->is_shortcut = 'Y';
965 965
 			$output = executeQuery('menu.getMenuItemByUrl', $args);
966
-			if($output->data->menu_item_srl)
966
+			if ($output->data->menu_item_srl)
967 967
 			{
968 968
 				$output->data->url = '';
969 969
 				$referenceItem = $output->data;
970 970
 				$output = $this->_updateMenuItem($referenceItem);
971
-				if(!$output->toBool())
971
+				if (!$output->toBool())
972 972
 				{
973 973
 					$oDB->rollback();
974 974
 					return $output;
@@ -976,10 +976,10 @@  discard block
 block discarded – undo
976 976
 			}
977 977
 
978 978
 			$moduleInfo = $oModuleModel->getModuleInfoByMid($node['url'], $menuInfo->site_srl);
979
-			if($moduleInfo->module_srl)
979
+			if ($moduleInfo->module_srl)
980 980
 			{
981 981
 				$output = $oModuleController->onlyDeleteModule($moduleInfo->module_srl);
982
-				if(!$output->toBool())
982
+				if (!$output->toBool())
983 983
 				{
984 984
 					$oDB->rollback();
985 985
 					return $output;
@@ -992,14 +992,14 @@  discard block
 block discarded – undo
992 992
 	private function _recursiveDeleteMenuItem(&$oDB, &$menuInfo, $node)
993 993
 	{
994 994
 		$output = $this->_deleteMenuItem($oDB, $menuInfo, $node);
995
-		if(!$output->toBool())
995
+		if (!$output->toBool())
996 996
 		{
997 997
 			return new Object(-1, $output->message);
998 998
 		}
999 999
 
1000
-		if(is_array($node['list']))
1000
+		if (is_array($node['list']))
1001 1001
 		{
1002
-			foreach($node['list'] AS $key=>$value)
1002
+			foreach ($node['list'] AS $key=>$value)
1003 1003
 			{
1004 1004
 				$this->_recursiveDeleteMenuItem($oDB, $menuInfo, $value);
1005 1005
 			}
@@ -1012,31 +1012,31 @@  discard block
 block discarded – undo
1012 1012
 	 */
1013 1013
 	function procMenuAdminMoveItem()
1014 1014
 	{
1015
-		$mode = Context::get('mode');	//move
1016
-		$parent_srl = Context::get('parent_srl');	// Parent menu item serial number
1017
-		$source_srl = Context::get('source_srl');	// Same hierarchy's menu item serial number
1018
-		$target_srl = Context::get('target_srl');	// Self menu item serial number
1015
+		$mode = Context::get('mode'); //move
1016
+		$parent_srl = Context::get('parent_srl'); // Parent menu item serial number
1017
+		$source_srl = Context::get('source_srl'); // Same hierarchy's menu item serial number
1018
+		$target_srl = Context::get('target_srl'); // Self menu item serial number
1019 1019
 
1020
-		if(!$mode || !$parent_srl || !$target_srl) return new Object(-1,'msg_invalid_request');
1020
+		if (!$mode || !$parent_srl || !$target_srl) return new Object(-1, 'msg_invalid_request');
1021 1021
 
1022 1022
 		$oMenuAdminModel = getAdminModel('menu');
1023 1023
 
1024 1024
 		// get original menu item info for cache file recreate
1025 1025
 		$originalItemInfo = $oMenuAdminModel->getMenuItemInfo($target_srl);
1026
-		if(!$originalItemInfo->menu_item_srl)
1026
+		if (!$originalItemInfo->menu_item_srl)
1027 1027
 		{
1028 1028
 			return new Object(-1, 'msg_empty_menu_item');
1029 1029
 		}
1030 1030
 
1031 1031
 		// get menu properies with child menu
1032
-		$phpFile = sprintf(_XE_PATH_ . "files/cache/menu/%s.php", $originalItemInfo->menu_srl);
1032
+		$phpFile = sprintf(_XE_PATH_."files/cache/menu/%s.php", $originalItemInfo->menu_srl);
1033 1033
 		$originMenu = NULL;
1034 1034
 
1035
-		if(is_readable(FileHandler::getRealPath($phpFile)))
1035
+		if (is_readable(FileHandler::getRealPath($phpFile)))
1036 1036
 		{
1037 1037
 			include(FileHandler::getRealPath($phpFile));
1038 1038
 
1039
-			if(is_array($menu->list))
1039
+			if (is_array($menu->list))
1040 1040
 			{
1041 1041
 				$this->_searchMenu($menu->list, $originalItemInfo->menu_item_srl, $originMenu);
1042 1042
 			}
@@ -1045,7 +1045,7 @@  discard block
 block discarded – undo
1045 1045
 		// get target menu info for move
1046 1046
 		$targetMenuItemInfo = $oMenuAdminModel->getMenuItemInfo($parent_srl);
1047 1047
 		// if move in same sitemap
1048
-		if($targetMenuItemInfo->menu_item_srl)
1048
+		if ($targetMenuItemInfo->menu_item_srl)
1049 1049
 		{
1050 1050
 			$menu_srl = $targetMenuItemInfo->menu_srl;
1051 1051
 		}
@@ -1057,20 +1057,20 @@  discard block
 block discarded – undo
1057 1057
 			$parent_srl = 0;
1058 1058
 		}
1059 1059
 
1060
-		if(!$this->homeModuleMid)
1060
+		if (!$this->homeModuleMid)
1061 1061
 		{
1062 1062
 			$oModuleModel = getModel('module');
1063 1063
 			$oMenuAdminController = getAdminController('menu');
1064 1064
 			$columnList = array('modules.mid',);
1065 1065
 			$output = $oModuleModel->getSiteInfo(0, $columnList);
1066
-			if($output->mid)
1066
+			if ($output->mid)
1067 1067
 			{
1068 1068
 				$this->homeModuleMid = $output->mid;
1069 1069
 			}
1070 1070
 		}
1071 1071
 
1072 1072
 		$this->moveMenuItem($menu_srl, $parent_srl, $source_srl, $target_srl, $mode, $originMenu['is_shortcut'], $originMenu['url']);
1073
-		if(count($originMenu['list']) > 0)
1073
+		if (count($originMenu['list']) > 0)
1074 1074
 		{
1075 1075
 			$this->_recursiveUpdateMenuItem($originMenu['list'], $menu_srl);
1076 1076
 		}
@@ -1084,9 +1084,9 @@  discard block
 block discarded – undo
1084 1084
 
1085 1085
 	private function _recursiveUpdateMenuItem($node, $menu_srl)
1086 1086
 	{
1087
-		if(is_array($node))
1087
+		if (is_array($node))
1088 1088
 		{
1089
-			foreach($node AS $key=>$node)
1089
+			foreach ($node AS $key=>$node)
1090 1090
 			{
1091 1091
 				$args = new stdClass();
1092 1092
 				$args->menu_srl = $menu_srl;
@@ -1094,11 +1094,11 @@  discard block
 block discarded – undo
1094 1094
 				$output = $this->_updateMenuItem($args);
1095 1095
 
1096 1096
 				//module's menu_srl move also
1097
-				if($node['is_shortcut'] == 'N' && !empty($node['url']))
1097
+				if ($node['is_shortcut'] == 'N' && !empty($node['url']))
1098 1098
 				{
1099 1099
 					$oModuleModel = getModel('module');
1100 1100
 					$moduleInfo = $oModuleModel->getModuleInfoByMid($node['url']);
1101
-					if($menu_srl != $moduleInfo->menu_srl)
1101
+					if ($menu_srl != $moduleInfo->menu_srl)
1102 1102
 					{
1103 1103
 						$moduleInfo->menu_srl = $menu_srl;
1104 1104
 						$oModuleController = getController('module');
@@ -1106,7 +1106,7 @@  discard block
 block discarded – undo
1106 1106
 					}
1107 1107
 				}
1108 1108
 
1109
-				if(count($node['list']) > 0)
1109
+				if (count($node['list']) > 0)
1110 1110
 				{
1111 1111
 					$this->_recursiveUpdateMenuItem($node['list'], $menu_srl);
1112 1112
 				}
@@ -1128,21 +1128,21 @@  discard block
 block discarded – undo
1128 1128
 		$menuSrl = $itemInfo->menu_srl;
1129 1129
 
1130 1130
 		// get menu properies with child menu
1131
-		$phpFile = sprintf(_XE_PATH_ . "files/cache/menu/%s.php", $menuSrl);
1131
+		$phpFile = sprintf(_XE_PATH_."files/cache/menu/%s.php", $menuSrl);
1132 1132
 		$originMenu = NULL;
1133 1133
 
1134
-		if(is_readable(FileHandler::getRealPath($phpFile)))
1134
+		if (is_readable(FileHandler::getRealPath($phpFile)))
1135 1135
 		{
1136 1136
 			include(FileHandler::getRealPath($phpFile));
1137 1137
 
1138
-			if(is_array($menu->list))
1138
+			if (is_array($menu->list))
1139 1139
 			{
1140 1140
 				$this->_searchMenu($menu->list, $menuItemSrl, $originMenu);
1141 1141
 			}
1142 1142
 		}
1143 1143
 
1144 1144
 		// copy the menu item with recursively
1145
-		if(is_array($originMenu))
1145
+		if (is_array($originMenu))
1146 1146
 		{
1147 1147
 			$this->_copyMenu($menuSrl, $parentSrl, $originMenu);
1148 1148
 		}
@@ -1158,15 +1158,15 @@  discard block
 block discarded – undo
1158 1158
 	 */
1159 1159
 	private function _searchMenu(&$menuList, $menuItemSrl, &$originMenu)
1160 1160
 	{
1161
-		if(array_key_exists($menuItemSrl, $menuList))
1161
+		if (array_key_exists($menuItemSrl, $menuList))
1162 1162
 		{
1163 1163
 			$originMenu = $menuList[$menuItemSrl];
1164 1164
 			return;
1165 1165
 		}
1166 1166
 
1167
-		foreach($menuList AS $key=>$value)
1167
+		foreach ($menuList AS $key=>$value)
1168 1168
 		{
1169
-			if(count($value['list']) > 0)
1169
+			if (count($value['list']) > 0)
1170 1170
 			{
1171 1171
 				$this->_searchMenu($value['list'], $menuItemSrl, $originMenu);
1172 1172
 			}
@@ -1181,7 +1181,7 @@  discard block
 block discarded – undo
1181 1181
 		// default argument setting
1182 1182
 		$args = new stdClass();
1183 1183
 		$args->menu_srl = $menuSrl;
1184
-		if($parentSrl == 0) $args->parent_srl = $menuSrl;
1184
+		if ($parentSrl == 0) $args->parent_srl = $menuSrl;
1185 1185
 		else $args->parent_srl = $parentSrl;
1186 1186
 		$args->menu_name_key = $originMenu['text'];
1187 1187
 		$args->menu_name = $originMenu['text'];
@@ -1194,7 +1194,7 @@  discard block
 block discarded – undo
1194 1194
 
1195 1195
 		$isModuleCopySuccess = false;
1196 1196
 		// if menu have a reference of module instance
1197
-		if($menuItemInfo->is_shortcut == 'N' && strncasecmp('http', $originMenu['url'], 4) !== 0 )
1197
+		if ($menuItemInfo->is_shortcut == 'N' && strncasecmp('http', $originMenu['url'], 4) !== 0)
1198 1198
 		{
1199 1199
 			$oModuleModel = getModel('module');
1200 1200
 			$moduleInfo = $oModuleModel->getModuleInfoByMid($originMenu['url']);
@@ -1214,22 +1214,22 @@  discard block
 block discarded – undo
1214 1214
 
1215 1215
 			$args->module_srl = $copiedModuleSrl;
1216 1216
 
1217
-			if($copiedModuleSrl)
1217
+			if ($copiedModuleSrl)
1218 1218
 			{
1219 1219
 				$isModuleCopySuccess = true;
1220 1220
 			}
1221 1221
 		}
1222 1222
 		// if menu type is shortcut
1223
-		else if($menuItemInfo->is_shortcut == 'Y')
1223
+		else if ($menuItemInfo->is_shortcut == 'Y')
1224 1224
 		{
1225 1225
 			$args->shortcut_target = $originMenu['url'];
1226 1226
 			$isModuleCopySuccess = true;
1227 1227
 		}
1228 1228
 
1229
-		if($isModuleCopySuccess)
1229
+		if ($isModuleCopySuccess)
1230 1230
 		{
1231 1231
 			// if have a group permission
1232
-			if($menuItemInfo->group_srls)
1232
+			if ($menuItemInfo->group_srls)
1233 1233
 			{
1234 1234
 				$args->group_srls = $menuItemInfo->group_srls;
1235 1235
 			}
@@ -1243,12 +1243,12 @@  discard block
 block discarded – undo
1243 1243
 
1244 1244
 			// if have a button, copy a button image also
1245 1245
 			$insertedMenuItemSrl = $this->get('menu_item_srl');
1246
-			if($menuItemInfo->normal_btn || $menuItemInfo->hover_btn || $menuItemInfo->active_btn)
1246
+			if ($menuItemInfo->normal_btn || $menuItemInfo->hover_btn || $menuItemInfo->active_btn)
1247 1247
 			{
1248 1248
 				// copy & upate
1249 1249
 				$update_item_info = $oMenuAdminModel->getMenuItemInfo($insertedMenuItemSrl);
1250
-				$copied_info = $this->_copyButton($insertedMenuItemSrl,$update_item_info->menu_srl, $menuItemInfo);
1251
-				if(count($update_item_info->group_srls) == 0)
1250
+				$copied_info = $this->_copyButton($insertedMenuItemSrl, $update_item_info->menu_srl, $menuItemInfo);
1251
+				if (count($update_item_info->group_srls) == 0)
1252 1252
 				{
1253 1253
 					unset($update_item_info->group_srls);
1254 1254
 				}
@@ -1262,7 +1262,7 @@  discard block
 block discarded – undo
1262 1262
 
1263 1263
 		// if have a child menu, copy child menu also
1264 1264
 		$childMenu = array_shift($originMenu['list']);
1265
-		if(count($childMenu) > 0)
1265
+		if (count($childMenu) > 0)
1266 1266
 		{
1267 1267
 			$this->_copyMenu($menuSrl, $insertedMenuItemSrl, $childMenu);
1268 1268
 		}
@@ -1272,10 +1272,10 @@  discard block
 block discarded – undo
1272 1272
 	{
1273 1273
 		$time = $_SERVER['REQUEST_TIME'];
1274 1274
 		$randomString = "";
1275
-		for($i=0;$i<4;$i++)
1275
+		for ($i = 0; $i < 4; $i++)
1276 1276
 		{
1277 1277
 			$case = rand(0, 1);
1278
-			if($case) $doc = rand(65, 90);
1278
+			if ($case) $doc = rand(65, 90);
1279 1279
 			else $doc = rand(97, 122);
1280 1280
 
1281 1281
 			$randomString .= chr($doc);
@@ -1299,32 +1299,32 @@  discard block
 block discarded – undo
1299 1299
 		// menu name update
1300 1300
 		$args->menu_srl = $this->menuSrl;
1301 1301
 		$output = executeQuery('menu.updateMenu', $args);
1302
-		if(!$output->toBool()) return $output;
1302
+		if (!$output->toBool()) return $output;
1303 1303
 
1304 1304
 		$this->map = array();
1305
-		if(is_array($parentKeyList))
1305
+		if (is_array($parentKeyList))
1306 1306
 		{
1307
-			foreach($parentKeyList as $no=>$srl)
1307
+			foreach ($parentKeyList as $no=>$srl)
1308 1308
 			{
1309
-				if($srl === 0) continue;
1310
-				if(!is_array($this->map[$srl]))$this->map[$srl] = array();
1309
+				if ($srl === 0) continue;
1310
+				if (!is_array($this->map[$srl]))$this->map[$srl] = array();
1311 1311
 				$this->map[$srl][] = $no;
1312 1312
 			}
1313 1313
 		}
1314 1314
 
1315 1315
 		$result = array();
1316
-		if(is_array($this->itemKeyList))
1316
+		if (is_array($this->itemKeyList))
1317 1317
 		{
1318
-			foreach($this->itemKeyList as $srl)
1318
+			foreach ($this->itemKeyList as $srl)
1319 1319
 			{
1320
-				if(!$this->checked[$srl])
1320
+				if (!$this->checked[$srl])
1321 1321
 				{
1322 1322
 					$target = new stdClass();
1323 1323
 					$this->checked[$srl] = 1;
1324 1324
 					$target->node = $srl;
1325
-					$target->child= array();
1325
+					$target->child = array();
1326 1326
 
1327
-					while(count($this->map[$srl]))
1327
+					while (count($this->map[$srl]))
1328 1328
 					{
1329 1329
 						$this->_setParent($srl, array_shift($this->map[$srl]), $target);
1330 1330
 					}
@@ -1333,13 +1333,13 @@  discard block
 block discarded – undo
1333 1333
 			}
1334 1334
 		}
1335 1335
 
1336
-		if(is_array($result))
1336
+		if (is_array($result))
1337 1337
 		{
1338 1338
 			$i = 0;
1339
-			foreach($result AS $key=>$node)
1339
+			foreach ($result AS $key=>$node)
1340 1340
 			{
1341
-				$this->moveMenuItem($this->menuSrl, 0, $i, $node->node, 'move');	//move parent node
1342
-				$this->_recursiveMoveMenuItem($node);	//move child node
1341
+				$this->moveMenuItem($this->menuSrl, 0, $i, $node->node, 'move'); //move parent node
1342
+				$this->_recursiveMoveMenuItem($node); //move child node
1343 1343
 				$i = $node->node;
1344 1344
 			}
1345 1345
 		}
@@ -1368,7 +1368,7 @@  discard block
 block discarded – undo
1368 1368
 		$child_node->child = array();
1369 1369
 		$target->child[] = $child_node;
1370 1370
 
1371
-		while(count($this->map[$child_srl]))
1371
+		while (count($this->map[$child_srl]))
1372 1372
 		{
1373 1373
 			$this->_setParent($child_srl, array_shift($this->map[$child_srl]), $child_node);
1374 1374
 		}
@@ -1383,7 +1383,7 @@  discard block
 block discarded – undo
1383 1383
 	function _recursiveMoveMenuItem($result)
1384 1384
 	{
1385 1385
 		$i = 0;
1386
-		while(count($result->child))
1386
+		while (count($result->child))
1387 1387
 		{
1388 1388
 			unset($node);
1389 1389
 			$node = array_shift($result->child);
@@ -1403,48 +1403,48 @@  discard block
 block discarded – undo
1403 1403
 	 * @param string $mode 'move' or 'insert'
1404 1404
 	 * @return void
1405 1405
 	 */
1406
-	function moveMenuItem($menu_srl, $parent_srl, $source_srl, $target_srl, $mode, $isShortcut='Y', $url=NULL)
1406
+	function moveMenuItem($menu_srl, $parent_srl, $source_srl, $target_srl, $mode, $isShortcut = 'Y', $url = NULL)
1407 1407
 	{
1408 1408
 		// Get the original menus
1409 1409
 		$oMenuAdminModel = getAdminModel('menu');
1410 1410
 
1411 1411
 		$target_item = $oMenuAdminModel->getMenuItemInfo($target_srl);
1412
-		if($target_item->menu_item_srl != $target_srl) return new Object(-1,'msg_invalid_request');
1412
+		if ($target_item->menu_item_srl != $target_srl) return new Object(-1, 'msg_invalid_request');
1413 1413
 		// Move the menu location(change the order menu appears)
1414
-		if($mode == 'move')
1414
+		if ($mode == 'move')
1415 1415
 		{
1416 1416
 			$args = new stdClass();
1417 1417
 			$args->parent_srl = $parent_srl;
1418 1418
 			$args->menu_srl = $menu_srl;
1419 1419
 
1420
-			if($source_srl)
1420
+			if ($source_srl)
1421 1421
 			{
1422 1422
 				$source_item = $oMenuAdminModel->getMenuItemInfo($source_srl);
1423
-				if($source_item->menu_item_srl != $source_srl) return new Object(-1,'msg_invalid_request');
1424
-				$args->listorder = $source_item->listorder-1;
1423
+				if ($source_item->menu_item_srl != $source_srl) return new Object(-1, 'msg_invalid_request');
1424
+				$args->listorder = $source_item->listorder - 1;
1425 1425
 			}
1426 1426
 			else
1427 1427
 			{
1428 1428
 				$output = executeQuery('menu.getMaxListorder', $args);
1429
-				if(!$output->toBool()) return $output;
1430
-				$args->listorder = (int)$output->data->listorder;
1431
-				if(!$args->listorder) $args->listorder= 0;
1429
+				if (!$output->toBool()) return $output;
1430
+				$args->listorder = (int) $output->data->listorder;
1431
+				if (!$args->listorder) $args->listorder = 0;
1432 1432
 			}
1433 1433
 			$args->parent_srl = $parent_srl;
1434 1434
 			$output = executeQuery('menu.updateMenuItemListorder', $args);
1435
-			if(!$output->toBool()) return $output;
1435
+			if (!$output->toBool()) return $output;
1436 1436
 
1437 1437
 			$args->parent_srl = $parent_srl;
1438 1438
 			$args->menu_item_srl = $target_srl;
1439 1439
 			$output = executeQuery('menu.updateMenuItemNode', $args);
1440
-			if(!$output->toBool()) return $output;
1440
+			if (!$output->toBool()) return $output;
1441 1441
 
1442 1442
 			//module's menu_srl move also
1443
-			if($isShortcut == 'N' && !empty($url))
1443
+			if ($isShortcut == 'N' && !empty($url))
1444 1444
 			{
1445 1445
 				$oModuleModel = getModel('module');
1446 1446
 				$moduleInfo = $oModuleModel->getModuleInfoByMid($url);
1447
-				if($menu_srl != $moduleInfo->menu_srl)
1447
+				if ($menu_srl != $moduleInfo->menu_srl)
1448 1448
 				{
1449 1449
 					$moduleInfo->menu_srl = $menu_srl;
1450 1450
 					$oModuleController = getController('module');
@@ -1452,13 +1452,13 @@  discard block
 block discarded – undo
1452 1452
 				}
1453 1453
 
1454 1454
 				// change home menu cache file
1455
-				if($url == $this->homeModuleMid)
1455
+				if ($url == $this->homeModuleMid)
1456 1456
 				{
1457
-					if(file_exists($this->homeMenuCacheFile))
1457
+					if (file_exists($this->homeMenuCacheFile))
1458 1458
 					{
1459 1459
 						include($this->homeMenuCacheFile);
1460 1460
 					}
1461
-					if(!$homeMenuSrl || $homeMenuSrl != $menu_srl)
1461
+					if (!$homeMenuSrl || $homeMenuSrl != $menu_srl)
1462 1462
 					{
1463 1463
 						$this->makeHomemenuCacheFile($menu_srl);
1464 1464
 					}
@@ -1466,13 +1466,13 @@  discard block
 block discarded – undo
1466 1466
 			}
1467 1467
 			// Add a child
1468 1468
 		}
1469
-		elseif($mode == 'insert')
1469
+		elseif ($mode == 'insert')
1470 1470
 		{
1471 1471
 			$args->menu_item_srl = $target_srl;
1472 1472
 			$args->parent_srl = $parent_srl;
1473
-			$args->listorder = -1*getNextSequence();
1473
+			$args->listorder = -1 * getNextSequence();
1474 1474
 			$output = executeQuery('menu.updateMenuItemNode', $args);
1475
-			if(!$output->toBool()) return $output;
1475
+			if (!$output->toBool()) return $output;
1476 1476
 		}
1477 1477
 
1478 1478
 		$xml_file = $this->makeXmlFile($menu_srl);
@@ -1497,8 +1497,8 @@  discard block
 block discarded – undo
1497 1497
 		// Re-generate the xml file
1498 1498
 		$xml_file = $this->makeXmlFile($menu_srl);
1499 1499
 		// Set return value
1500
-		$this->add('menu_title',$menu_title);
1501
-		$this->add('xml_file',$xml_file);
1500
+		$this->add('menu_title', $menu_title);
1501
+		$this->add('xml_file', $xml_file);
1502 1502
 	}
1503 1503
 
1504 1504
 	/**
@@ -1512,12 +1512,12 @@  discard block
 block discarded – undo
1512 1512
 		$target = Context::get('target');
1513 1513
 		$target_file = Context::get($target);
1514 1514
 		// Error occurs when the target is neither a uploaded file nor a valid file
1515
-		if(!$menu_srl || !$menu_item_srl)
1515
+		if (!$menu_srl || !$menu_item_srl)
1516 1516
 		{
1517 1517
 			Context::set('error_messge', Context::getLang('msg_invalid_request'));
1518 1518
 
1519 1519
 		}
1520
-		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']))
1520
+		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 1521
 		{
1522 1522
 			Context::set('error_messge', Context::getLang('msg_invalid_request'));
1523 1523
 		}
@@ -1525,13 +1525,13 @@  discard block
 block discarded – undo
1525 1525
 		// Move the file to a specific director if the uploaded file meets requirement
1526 1526
 		else
1527 1527
 		{
1528
-			$tmp_arr = explode('.',$target_file['name']);
1529
-			$ext = $tmp_arr[count($tmp_arr)-1];
1528
+			$tmp_arr = explode('.', $target_file['name']);
1529
+			$ext = $tmp_arr[count($tmp_arr) - 1];
1530 1530
 
1531 1531
 			$path = sprintf('./files/attach/menu_button/%d/', $menu_srl);
1532 1532
 			$filename = sprintf('%s%d.%s.%s', $path, $menu_item_srl, $target, $ext);
1533 1533
 
1534
-			if(!is_dir($path)) FileHandler::makeDir($path);
1534
+			if (!is_dir($path)) FileHandler::makeDir($path);
1535 1535
 
1536 1536
 			move_uploaded_file($target_file['tmp_name'], $filename);
1537 1537
 			Context::set('filename', $filename);
@@ -1564,14 +1564,14 @@  discard block
 block discarded – undo
1564 1564
 	{
1565 1565
 		$oModuleModel = getModel('module');
1566 1566
 		$installed_module_list = $oModuleModel->getModulesXmlInfo();
1567
-		if(is_array($installed_module_list))
1567
+		if (is_array($installed_module_list))
1568 1568
 		{
1569 1569
 			$currentLang = Context::getLangType();
1570 1570
 			$menuList = array();
1571
-			foreach($installed_module_list AS $key=>$value)
1571
+			foreach ($installed_module_list AS $key=>$value)
1572 1572
 			{
1573 1573
 				$info = $oModuleModel->getModuleActionXml($value->module);
1574
-				if($info->menu) $menuList[$value->module] = $info->menu;
1574
+				if ($info->menu) $menuList[$value->module] = $info->menu;
1575 1575
 				unset($info->menu);
1576 1576
 			}
1577 1577
 		}
@@ -1603,8 +1603,8 @@  discard block
 block discarded – undo
1603 1603
 		$info = $oModuleModel->getModuleActionXml($moduleName);
1604 1604
 
1605 1605
 		$url = getNotEncodedFullUrl('', 'module', 'admin', 'act', $info->menu->{$menuName}->index);
1606
-		if(empty($url)) $url = getNotEncodedFullUrl('', 'module', 'admin', 'act', $info->admin_index_act);
1607
-		if(empty($url)) $url = getNotEncodedFullUrl('', 'module', 'admin');
1606
+		if (empty($url)) $url = getNotEncodedFullUrl('', 'module', 'admin', 'act', $info->admin_index_act);
1607
+		if (empty($url)) $url = getNotEncodedFullUrl('', 'module', 'admin');
1608 1608
 		$dbInfo = Context::getDBInfo();
1609 1609
 
1610 1610
 		$args = new stdClass();
@@ -1613,7 +1613,7 @@  discard block
 block discarded – undo
1613 1613
 		$args->menu_srl = $requestArgs->menu_srl;
1614 1614
 		$args->name = sprintf('{$lang->menu_gnb_sub[\'%s\']}', $menuName);
1615 1615
 		//if now page is https...
1616
-		if(strpos($url, 'https') !== false)
1616
+		if (strpos($url, 'https') !== false)
1617 1617
 		{
1618 1618
 			$args->url = str_replace('https'.substr($dbInfo->default_url, 4), '', $url);
1619 1619
 		}
@@ -1627,23 +1627,23 @@  discard block
 block discarded – undo
1627 1627
 		$args->hover_btn = '';
1628 1628
 		$args->active_btn = '';
1629 1629
 		$args->group_srls = implode(',', array_keys($groupSrlList));
1630
-		$args->listorder = -1*$args->menu_item_srl;
1630
+		$args->listorder = -1 * $args->menu_item_srl;
1631 1631
 
1632 1632
 		// Check if already exists
1633 1633
 		$oMenuModel = getAdminModel('menu');
1634 1634
 		$item_info = $oMenuModel->getMenuItemInfo($args->menu_item_srl);
1635 1635
 		// Update if exists
1636
-		if($item_info->menu_item_srl == $args->menu_item_srl)
1636
+		if ($item_info->menu_item_srl == $args->menu_item_srl)
1637 1637
 		{
1638 1638
 			$output = $this->_updateMenuItem($args);
1639
-			if(!$output->toBool()) return $output;
1639
+			if (!$output->toBool()) return $output;
1640 1640
 		}
1641 1641
 		// Insert if not exist
1642 1642
 		else
1643 1643
 		{
1644
-			$args->listorder = -1*$args->menu_item_srl;
1644
+			$args->listorder = -1 * $args->menu_item_srl;
1645 1645
 			$output = executeQuery('menu.insertMenuItem', $args);
1646
-			if(!$output->toBool()) return $output;
1646
+			if (!$output->toBool()) return $output;
1647 1647
 		}
1648 1648
 		// Get information of the menu
1649 1649
 		$menu_info = $oMenuModel->getMenu($args->menu_srl);
@@ -1671,23 +1671,23 @@  discard block
 block discarded – undo
1671 1671
 
1672 1672
 		// Menu Exposure update
1673 1673
 		// if exposure target is only login user...
1674
-		if(!$exposure)
1674
+		if (!$exposure)
1675 1675
 		{
1676 1676
 			$args->group_srls = '';
1677 1677
 		}
1678 1678
 		else
1679 1679
 		{
1680 1680
 			$exposure = explode(',', $exposure);
1681
-			if(in_array($exposure, array('-1','-3')))
1681
+			if (in_array($exposure, array('-1', '-3')))
1682 1682
 			{
1683 1683
 				$args->group_srls = $exposure;
1684 1684
 			}
1685 1685
 
1686
-			if($exposure) $args->group_srls = implode(',', $exposure);
1686
+			if ($exposure) $args->group_srls = implode(',', $exposure);
1687 1687
 		}
1688 1688
 
1689 1689
 		$output = $this->_updateMenuItem($args);
1690
-		if(!$output->toBool())
1690
+		if (!$output->toBool())
1691 1691
 		{
1692 1692
 			return $output;
1693 1693
 		}
@@ -1701,21 +1701,21 @@  discard block
 block discarded – undo
1701 1701
 		$moduleInfo = $oModuleModel->getModuleInfoByMid($itemInfo->url, $menuInfo->site_srl);
1702 1702
 		$xml_info = $oModuleModel->getModuleActionXML($moduleInfo->module);
1703 1703
 
1704
-		if($itemInfo->is_shortcut === 'Y')
1704
+		if ($itemInfo->is_shortcut === 'Y')
1705 1705
 		{
1706 1706
 			$moduleGrnatsArgs = new stdClass;
1707 1707
 			$moduleGrnatsArgs->module_srl = $moduleInfo->module_srl;
1708 1708
 			$output = executeQueryArray('module.getModuleGrants', $moduleGrnatsArgs);
1709
-			if(!$output->data) $output->data = array();
1709
+			if (!$output->data) $output->data = array();
1710 1710
 			$moduleGrnats = new stdClass();
1711
-			foreach($output->data as $grant)
1711
+			foreach ($output->data as $grant)
1712 1712
 			{
1713 1713
 				$moduleGrnats->{$grant->name}[] = $grant->group_srl;
1714 1714
 			}
1715 1715
 		}
1716 1716
 
1717 1717
 		$grantList = $xml_info->grant;
1718
-		if(!$grantList) $grantList = new stdClass;
1718
+		if (!$grantList) $grantList = new stdClass;
1719 1719
 
1720 1720
 		$grantList->access = new stdClass();
1721 1721
 		$grantList->access->default = 'guest';
@@ -1723,14 +1723,14 @@  discard block
 block discarded – undo
1723 1723
 		$grantList->manager->default = 'manager';
1724 1724
 
1725 1725
 		$grant = new stdClass();
1726
-		foreach($grantList AS $grantName=>$grantInfo)
1726
+		foreach ($grantList AS $grantName=>$grantInfo)
1727 1727
 		{
1728
-			if($htPerm[$grantName])
1728
+			if ($htPerm[$grantName])
1729 1729
 			{
1730 1730
 				$htPerm[$grantName] = explode(',', $htPerm[$grantName]);
1731 1731
 
1732 1732
 				// users in a particular group
1733
-				if(is_array($htPerm[$grantName]))
1733
+				if (is_array($htPerm[$grantName]))
1734 1734
 				{
1735 1735
 					$grant->{$grantName} = $htPerm[$grantName];
1736 1736
 					continue;
@@ -1742,13 +1742,13 @@  discard block
 block discarded – undo
1742 1742
 					continue;
1743 1743
 				}
1744 1744
 			}
1745
-			else if($itemInfo->is_shortcut === 'Y')
1745
+			else if ($itemInfo->is_shortcut === 'Y')
1746 1746
 			{
1747
-				if(isset($moduleGrnats) && $moduleGrnats->{$grantName}) $grant->{$grantName} = $moduleGrnats->{$grantName};
1747
+				if (isset($moduleGrnats) && $moduleGrnats->{$grantName}) $grant->{$grantName} = $moduleGrnats->{$grantName};
1748 1748
 			}
1749 1749
 		}
1750 1750
 
1751
-		if(count($grant))
1751
+		if (count($grant))
1752 1752
 		{
1753 1753
 			$oModuleController = getController('module');
1754 1754
 			$oModuleController->insertModuleGrants($moduleInfo->module_srl, $grant);
@@ -1766,15 +1766,15 @@  discard block
 block discarded – undo
1766 1766
 	function makeXmlFile($menu_srl)
1767 1767
 	{
1768 1768
 		// Return if there is no information when creating the xml file
1769
-		if(!$menu_srl) return;
1769
+		if (!$menu_srl) return;
1770 1770
 		// Get menu informaton
1771 1771
 		$args = new stdClass();
1772 1772
 		$args->menu_srl = $menu_srl;
1773 1773
 		$output = executeQuery('menu.getMenu', $args);
1774
-		if(!$output->toBool() || !$output->data) return $output;
1775
-		$site_srl = (int)$output->data->site_srl;
1774
+		if (!$output->toBool() || !$output->data) return $output;
1775
+		$site_srl = (int) $output->data->site_srl;
1776 1776
 
1777
-		if($site_srl)
1777
+		if ($site_srl)
1778 1778
 		{
1779 1779
 			$oModuleModel = getModel('module');
1780 1780
 			$columnList = array('sites.domain');
@@ -1785,13 +1785,13 @@  discard block
 block discarded – undo
1785 1785
 		$args->menu_srl = $menu_srl;
1786 1786
 		$args->sort_index = 'listorder';
1787 1787
 		$output = executeQuery('menu.getMenuItems', $args);
1788
-		if(!$output->toBool()) return;
1788
+		if (!$output->toBool()) return;
1789 1789
 		// Specify the name of the cache file
1790
-		$xml_file = sprintf(_XE_PATH_ . "files/cache/menu/%s.xml.php", $menu_srl);
1791
-		$php_file = sprintf(_XE_PATH_ . "files/cache/menu/%s.php", $menu_srl);
1790
+		$xml_file = sprintf(_XE_PATH_."files/cache/menu/%s.xml.php", $menu_srl);
1791
+		$php_file = sprintf(_XE_PATH_."files/cache/menu/%s.php", $menu_srl);
1792 1792
 		// If no data found, generate an XML file without node data
1793 1793
 		$list = $output->data;
1794
-		if(!$list)
1794
+		if (!$list)
1795 1795
 		{
1796 1796
 			$xml_buff = "<root />";
1797 1797
 			FileHandler::writeFile($xml_file, $xml_buff);
@@ -1799,10 +1799,10 @@  discard block
 block discarded – undo
1799 1799
 			return $xml_file;
1800 1800
 		}
1801 1801
 		// Change to an array if only a single data is obtained
1802
-		if(!is_array($list)) $list = array($list);
1802
+		if (!is_array($list)) $list = array($list);
1803 1803
 		// Create a tree for loop
1804 1804
 		$list_count = count($list);
1805
-		for($i=0;$i<$list_count;$i++)
1805
+		for ($i = 0; $i < $list_count; $i++)
1806 1806
 		{
1807 1807
 			$node = $list[$i];
1808 1808
 			$menu_item_srl = $node->menu_item_srl;
@@ -1858,7 +1858,7 @@  discard block
 block discarded – undo
1858 1858
 		$php_buff = sprintf(
1859 1859
 			'<?php '.
1860 1860
 			'if(!defined("__XE__")) exit(); '.
1861
-			'$menu = new stdClass();' .
1861
+			'$menu = new stdClass();'.
1862 1862
 			'%s; '.
1863 1863
 			'%s; '.
1864 1864
 			'$menu->list = array(%s); '.
@@ -1887,26 +1887,26 @@  discard block
 block discarded – undo
1887 1887
 	 */
1888 1888
 	function getXmlTree($source_node, $tree, $site_srl, $domain)
1889 1889
 	{
1890
-		if(!$source_node) return;
1890
+		if (!$source_node) return;
1891 1891
 
1892 1892
 		$oMenuAdminModel = getAdminModel('menu');
1893 1893
 
1894
-		foreach($source_node as $menu_item_srl => $node)
1894
+		foreach ($source_node as $menu_item_srl => $node)
1895 1895
 		{
1896 1896
 			$child_buff = "";
1897 1897
 			// Get data of the child nodes
1898
-			if($menu_item_srl&&$tree[$menu_item_srl]) $child_buff = $this->getXmlTree($tree[$menu_item_srl], $tree, $site_srl, $domain);
1898
+			if ($menu_item_srl && $tree[$menu_item_srl]) $child_buff = $this->getXmlTree($tree[$menu_item_srl], $tree, $site_srl, $domain);
1899 1899
 			// List variables
1900 1900
 			$names = $oMenuAdminModel->getMenuItemNames($node->name, $site_srl);
1901
-			foreach($names as $key => $val)
1901
+			foreach ($names as $key => $val)
1902 1902
 			{
1903
-				$name_arr_str .= sprintf('"%s"=>\'%s\',',$key, str_replace(array('\\', '\''), array('\\\\', '\\\''), $val));
1903
+				$name_arr_str .= sprintf('"%s"=>\'%s\',', $key, str_replace(array('\\', '\''), array('\\\\', '\\\''), $val));
1904 1904
 			}
1905 1905
 			$name_str = sprintf('$_names = array(%s); print $_names[$lang_type];', $name_arr_str);
1906 1906
 
1907
-			$url = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->url);
1908
-			$desc = str_replace(array('&','"',"'"),array('&amp;','&quot;','\\\''),$node->desc);
1909
-			if(preg_match('/^([0-9a-zA-Z\_\-]+)$/', $node->url))
1907
+			$url = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $node->url);
1908
+			$desc = str_replace(array('&', '"', "'"), array('&amp;', '&quot;', '\\\''), $node->desc);
1909
+			if (preg_match('/^([0-9a-zA-Z\_\-]+)$/', $node->url))
1910 1910
 			{
1911 1911
 				$href = "getSiteUrl('$domain', '','mid','$node->url')";
1912 1912
 			}
@@ -1916,21 +1916,21 @@  discard block
 block discarded – undo
1916 1916
 			$expand = $node->expand;
1917 1917
 
1918 1918
 			$normal_btn = $node->normal_btn;
1919
-			if($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) $normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$normal_btn);
1919
+			if ($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) $normal_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $normal_btn);
1920 1920
 			else $normal_btn = '';
1921 1921
 			$hover_btn = $node->hover_btn;
1922
-			if($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) $hover_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$hover_btn);
1922
+			if ($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) $hover_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $hover_btn);
1923 1923
 			else $hover_btn = '';
1924 1924
 			$active_btn = $node->active_btn;
1925
-			if($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) $active_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$active_btn);
1925
+			if ($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) $active_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $active_btn);
1926 1926
 			else $active_btn = '';
1927 1927
 
1928 1928
 			$group_srls = $node->group_srls;
1929 1929
 
1930
-			if($normal_btn)
1930
+			if ($normal_btn)
1931 1931
 			{
1932
-				if($hover_btn) $hover_str = sprintf('onmouseover=&quot;this.src=\'%s\'&quot;', $hover_btn); else $hover_str = '';
1933
-				if($active_btn) $active_str = sprintf('onmousedown=&quot;this.src=\'%s\'&quot;', $active_btn); else $active_str = '';
1932
+				if ($hover_btn) $hover_str = sprintf('onmouseover=&quot;this.src=\'%s\'&quot;', $hover_btn); else $hover_str = '';
1933
+				if ($active_btn) $active_str = sprintf('onmousedown=&quot;this.src=\'%s\'&quot;', $active_btn); else $active_str = '';
1934 1934
 				$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);
1935 1935
 			}
1936 1936
 			else
@@ -1938,7 +1938,7 @@  discard block
 block discarded – undo
1938 1938
 				$link = '<?php print $_names[$lang_type]; ?>';
1939 1939
 			}
1940 1940
 			// If the value of node->group_srls exists
1941
-			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);
1941
+			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);
1942 1942
 			else $group_check_code = "true";
1943 1943
 			$attribute = sprintf(
1944 1944
 				'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 }?>"',
@@ -1962,8 +1962,8 @@  discard block
 block discarded – undo
1962 1962
 				$link
1963 1963
 			);
1964 1964
 
1965
-			if($child_buff) $buff .= sprintf('<node %s>%s</node>', $attribute, $child_buff);
1966
-			else $buff .=  sprintf('<node %s />', $attribute);
1965
+			if ($child_buff) $buff .= sprintf('<node %s>%s</node>', $attribute, $child_buff);
1966
+			else $buff .= sprintf('<node %s />', $attribute);
1967 1967
 		}
1968 1968
 		return $buff;
1969 1969
 	}
@@ -1982,84 +1982,84 @@  discard block
 block discarded – undo
1982 1982
 	function getPhpCacheCode($source_node, $tree, $site_srl, $domain)
1983 1983
 	{
1984 1984
 		$output = array("buff"=>"", "url_list"=>array());
1985
-		if(!$source_node) return $output;
1985
+		if (!$source_node) return $output;
1986 1986
 
1987 1987
 		$oMenuAdminModel = getAdminModel('menu');
1988 1988
 
1989
-		foreach($source_node as $menu_item_srl => $node)
1989
+		foreach ($source_node as $menu_item_srl => $node)
1990 1990
 		{
1991 1991
 			// Get data from child nodes if exist.
1992
-			if($menu_item_srl&&$tree[$menu_item_srl]) $child_output = $this->getPhpCacheCode($tree[$menu_item_srl], $tree, $site_srl, $domain);
1992
+			if ($menu_item_srl && $tree[$menu_item_srl]) $child_output = $this->getPhpCacheCode($tree[$menu_item_srl], $tree, $site_srl, $domain);
1993 1993
 			else $child_output = array("buff"=>"", "url_list"=>array());
1994 1994
 
1995 1995
 			// List variables
1996 1996
 			$names = $oMenuAdminModel->getMenuItemNames($node->name, $site_srl);
1997 1997
 			unset($name_arr_str);
1998
-			foreach($names as $key => $val)
1998
+			foreach ($names as $key => $val)
1999 1999
 			{
2000
-				if(preg_match('/\{\$lang->menu_gnb(?:_sub)?\[\'([a-zA-Z_]+)\'\]\}/', $val) === 1)
2000
+				if (preg_match('/\{\$lang->menu_gnb(?:_sub)?\[\'([a-zA-Z_]+)\'\]\}/', $val) === 1)
2001 2001
 				{
2002 2002
 					$name_arr_str .= sprintf('"%s"=>"%s",', $key, $val);
2003 2003
 				}
2004 2004
 				else
2005 2005
 				{
2006
-					$name_arr_str .= sprintf('"%s"=>\'%s\',', $key, str_replace(array('\\','\''), array('\\\\','\\\''), removeHackTag($val)));
2006
+					$name_arr_str .= sprintf('"%s"=>\'%s\',', $key, str_replace(array('\\', '\''), array('\\\\', '\\\''), removeHackTag($val)));
2007 2007
 				}
2008 2008
 			}
2009 2009
 			$name_str = sprintf('$_menu_names[%d] = array(%s); %s', $node->menu_item_srl, $name_arr_str, $child_output['name']);
2010 2010
 
2011 2011
 			// If url value is not empty in the current node, put the value into an array url_list
2012
-			if($node->url) $child_output['url_list'][] = $node->url;
2012
+			if ($node->url) $child_output['url_list'][] = $node->url;
2013 2013
 			$output['url_list'] = array_merge($output['url_list'], $child_output['url_list']);
2014 2014
 			// If node->group_srls value exists
2015
-			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);
2015
+			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);
2016 2016
 			else $group_check_code = "true";
2017 2017
 
2018 2018
 			// List variables
2019
-			$href = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->href);
2020
-			$url = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->url);
2021
-			$desc = str_replace(array('&','"',"'"),array('&amp;','&quot;','\\\''),$node->desc);
2022
-			if(preg_match('/^([0-9a-zA-Z\_\-]+)$/i', $node->url))
2019
+			$href = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $node->href);
2020
+			$url = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $node->url);
2021
+			$desc = str_replace(array('&', '"', "'"), array('&amp;', '&quot;', '\\\''), $node->desc);
2022
+			if (preg_match('/^([0-9a-zA-Z\_\-]+)$/i', $node->url))
2023 2023
 			{
2024 2024
 				$href = "getSiteUrl('$domain', '','mid','$node->url')";
2025 2025
 			}
2026 2026
 			else $href = sprintf('"%s"', $url);
2027 2027
 			$is_shortcut = $node->is_shortcut;
2028 2028
 			$open_window = $node->open_window;
2029
-			$normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->normal_btn);
2030
-			$hover_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->hover_btn);
2031
-			$active_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->active_btn);
2029
+			$normal_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $node->normal_btn);
2030
+			$hover_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $node->hover_btn);
2031
+			$active_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $node->active_btn);
2032 2032
 
2033
-			foreach($child_output['url_list'] as $key =>$val)
2033
+			foreach ($child_output['url_list'] as $key =>$val)
2034 2034
 			{
2035 2035
 				$child_output['url_list'][$key] = addslashes($val);
2036 2036
 			}
2037 2037
 
2038
-			$selected = '"'.implode('","',$child_output['url_list']).'"';
2038
+			$selected = '"'.implode('","', $child_output['url_list']).'"';
2039 2039
 			$child_buff = $child_output['buff'];
2040 2040
 			$expand = $node->expand;
2041 2041
 
2042 2042
 			$normal_btn = $node->normal_btn;
2043
-			if($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) $normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$normal_btn);
2043
+			if ($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) $normal_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $normal_btn);
2044 2044
 			else $normal_btn = '';
2045 2045
 
2046 2046
 			$hover_btn = $node->hover_btn;
2047
-			if($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) $hover_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$hover_btn);
2047
+			if ($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) $hover_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $hover_btn);
2048 2048
 			else $hover_btn = '';
2049 2049
 
2050 2050
 			$active_btn = $node->active_btn;
2051
-			if($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) $active_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$active_btn);
2051
+			if ($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) $active_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $active_btn);
2052 2052
 			else $active_btn = '';
2053 2053
 
2054 2054
 
2055 2055
 			$group_srls = $node->group_srls;
2056 2056
 
2057
-			if($normal_btn)
2057
+			if ($normal_btn)
2058 2058
 			{
2059
-				if($hover_btn) $hover_str = sprintf('onmouseover=\"this.src=\'%s\'\"', $hover_btn); else $hover_str = '';
2060
-				if($active_btn) $active_str = sprintf('onmousedown=\"this.src=\'%s\'\"', $active_btn); else $active_str = '';
2059
+				if ($hover_btn) $hover_str = sprintf('onmouseover=\"this.src=\'%s\'\"', $hover_btn); else $hover_str = '';
2060
+				if ($active_btn) $active_str = sprintf('onmousedown=\"this.src=\'%s\'\"', $active_btn); else $active_str = '';
2061 2061
 				$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);
2062
-				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);
2062
+				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);
2063 2063
 				else $link_active = $link;
2064 2064
 			}
2065 2065
 			else
@@ -2097,7 +2097,7 @@  discard block
 block discarded – undo
2097 2097
 			);
2098 2098
 
2099 2099
 			// Generate buff data
2100
-			$output['buff'] .=  sprintf('%s=>array(%s),', $node->menu_item_srl, $attribute);
2100
+			$output['buff'] .= sprintf('%s=>array(%s),', $node->menu_item_srl, $attribute);
2101 2101
 			$output['name'] .= $name_str;
2102 2102
 		}
2103 2103
 		return $output;
@@ -2111,19 +2111,19 @@  discard block
 block discarded – undo
2111 2111
 	 */
2112 2112
 	function updateMenuLayout($layout_srl, $menu_srl_list)
2113 2113
 	{
2114
-		if(!count($menu_srl_list)) return;
2114
+		if (!count($menu_srl_list)) return;
2115 2115
 		// Delete the value of menu_srls
2116
-		$args->menu_srls = implode(',',$menu_srl_list);
2116
+		$args->menu_srls = implode(',', $menu_srl_list);
2117 2117
 		$output = executeQuery('menu.deleteMenuLayout', $args);
2118
-		if(!$output->toBool()) return $output;
2118
+		if (!$output->toBool()) return $output;
2119 2119
 
2120 2120
 		$args->layout_srl = $layout_srl;
2121 2121
 		// Mapping menu_srls, layout_srl
2122
-		for($i=0;$i<count($menu_srl_list);$i++)
2122
+		for ($i = 0; $i < count($menu_srl_list); $i++)
2123 2123
 		{
2124 2124
 			$args->menu_srl = $menu_srl_list[$i];
2125 2125
 			$output = executeQuery('menu.insertMenuLayout', $args);
2126
-			if(!$output->toBool()) return $output;
2126
+			if (!$output->toBool()) return $output;
2127 2127
 		}
2128 2128
 	}
2129 2129
 
@@ -2136,47 +2136,47 @@  discard block
 block discarded – undo
2136 2136
 	{
2137 2137
 		// path setting
2138 2138
 		$path = sprintf('./files/attach/menu_button/%d/', $args->menu_srl);
2139
-		if($args->menu_normal_btn || $args->menu_hover_btn || $args->menu_active_btn && !is_dir($path))
2139
+		if ($args->menu_normal_btn || $args->menu_hover_btn || $args->menu_active_btn && !is_dir($path))
2140 2140
 		{
2141 2141
 			FileHandler::makeDir($path);
2142 2142
 		}
2143 2143
 
2144
-		if($args->isNormalDelete == 'Y' || $args->isHoverDelete == 'Y' || $args->isActiveDelete == 'Y')
2144
+		if ($args->isNormalDelete == 'Y' || $args->isHoverDelete == 'Y' || $args->isActiveDelete == 'Y')
2145 2145
 		{
2146 2146
 			$oMenuModel = getAdminModel('menu');
2147 2147
 			$itemInfo = $oMenuModel->getMenuItemInfo($args->menu_item_srl);
2148 2148
 
2149
-			if($args->isNormalDelete == 'Y' && $itemInfo->normal_btn) FileHandler::removeFile($itemInfo->normal_btn);
2150
-			if($args->isHoverDelete == 'Y' && $itemInfo->hover_btn) FileHandler::removeFile($itemInfo->hover_btn);
2151
-			if($args->isActiveDelete == 'Y' && $itemInfo->active_btn) FileHandler::removeFile($itemInfo->active_btn);
2149
+			if ($args->isNormalDelete == 'Y' && $itemInfo->normal_btn) FileHandler::removeFile($itemInfo->normal_btn);
2150
+			if ($args->isHoverDelete == 'Y' && $itemInfo->hover_btn) FileHandler::removeFile($itemInfo->hover_btn);
2151
+			if ($args->isActiveDelete == 'Y' && $itemInfo->active_btn) FileHandler::removeFile($itemInfo->active_btn);
2152 2152
 		}
2153 2153
 
2154 2154
 		$returnArray = array();
2155 2155
 		$date = date('YmdHis');
2156 2156
 		// normal button
2157
-		if($args->menu_normal_btn)
2157
+		if ($args->menu_normal_btn)
2158 2158
 		{
2159
-			$tmp_arr = explode('.',$args->menu_normal_btn['name']);
2160
-			$ext = $tmp_arr[count($tmp_arr)-1];
2159
+			$tmp_arr = explode('.', $args->menu_normal_btn['name']);
2160
+			$ext = $tmp_arr[count($tmp_arr) - 1];
2161 2161
 
2162 2162
 			$filename = sprintf('%s%d.%s.%s.%s', $path, $args->menu_item_srl, $date, 'menu_normal_btn', $ext);
2163 2163
 
2164
-			if(checkUploadedFile($args->menu_normal_btn['tmp_name']))
2164
+			if (checkUploadedFile($args->menu_normal_btn['tmp_name']))
2165 2165
 			{
2166
-				move_uploaded_file ( $args->menu_normal_btn ['tmp_name'], $filename );
2166
+				move_uploaded_file($args->menu_normal_btn ['tmp_name'], $filename);
2167 2167
 				$returnArray ['normal_btn'] = $filename;
2168 2168
 			}
2169 2169
 		}
2170 2170
 
2171 2171
 		// hover button
2172
-		if($args->menu_hover_btn)
2172
+		if ($args->menu_hover_btn)
2173 2173
 		{
2174
-			$tmp_arr = explode('.',$args->menu_hover_btn['name']);
2175
-			$ext = $tmp_arr[count($tmp_arr)-1];
2174
+			$tmp_arr = explode('.', $args->menu_hover_btn['name']);
2175
+			$ext = $tmp_arr[count($tmp_arr) - 1];
2176 2176
 
2177 2177
 			$filename = sprintf('%s%d.%s.%s.%s', $path, $args->menu_item_srl, $date, 'menu_hover_btn', $ext);
2178 2178
 
2179
-			if(checkUploadedFile($args->menu_hover_btn['tmp_name']))
2179
+			if (checkUploadedFile($args->menu_hover_btn['tmp_name']))
2180 2180
 			{
2181 2181
 				move_uploaded_file($args->menu_hover_btn['tmp_name'], $filename);
2182 2182
 				$returnArray['hover_btn'] = $filename;
@@ -2184,14 +2184,14 @@  discard block
 block discarded – undo
2184 2184
 		}
2185 2185
 
2186 2186
 		// active button
2187
-		if($args->menu_active_btn)
2187
+		if ($args->menu_active_btn)
2188 2188
 		{
2189
-			$tmp_arr = explode('.',$args->menu_active_btn['name']);
2190
-			$ext = $tmp_arr[count($tmp_arr)-1];
2189
+			$tmp_arr = explode('.', $args->menu_active_btn['name']);
2190
+			$ext = $tmp_arr[count($tmp_arr) - 1];
2191 2191
 
2192 2192
 			$filename = sprintf('%s%d.%s.%s.%s', $path, $args->menu_item_srl, $date, 'menu_active_btn', $ext);
2193 2193
 
2194
-			if(checkUploadedFile($args->menu_active_btn['tmp_name']))
2194
+			if (checkUploadedFile($args->menu_active_btn['tmp_name']))
2195 2195
 			{
2196 2196
 				move_uploaded_file($args->menu_active_btn['tmp_name'], $filename);
2197 2197
 				$returnArray['active_btn'] = $filename;
@@ -2213,7 +2213,7 @@  discard block
 block discarded – undo
2213 2213
 			"active_btn"=>"",
2214 2214
 		);
2215 2215
 		//normal_btn
2216
-		if($menuItemInfo->normal_btn)
2216
+		if ($menuItemInfo->normal_btn)
2217 2217
 		{
2218 2218
 			$originFile = FileHandler::getRealPath($menuItemInfo->normal_btn);
2219 2219
 			$targetFile = $this->_changeMenuItemSrlInButtonPath($menuItemInfo->normal_btn, $insertedMenuSrl, $insertedMenuItemSrl, 'normal');
@@ -2223,7 +2223,7 @@  discard block
 block discarded – undo
2223 2223
 		}
2224 2224
 
2225 2225
 		//hover_btn
2226
-		if($menuItemInfo->hover_btn)
2226
+		if ($menuItemInfo->hover_btn)
2227 2227
 		{
2228 2228
 			$originFile = FileHandler::getRealPath($menuItemInfo->hover_btn);
2229 2229
 			$targetFile = $this->_changeMenuItemSrlInButtonPath($menuItemInfo->hover_btn, $insertedMenuSrl, $insertedMenuItemSrl, 'hover');
@@ -2233,7 +2233,7 @@  discard block
 block discarded – undo
2233 2233
 		}
2234 2234
 
2235 2235
 		//active_btn
2236
-		if($menuItemInfo->active_btn)
2236
+		if ($menuItemInfo->active_btn)
2237 2237
 		{
2238 2238
 			$originFile = FileHandler::getRealPath($menuItemInfo->active_btn);
2239 2239
 			$targetFile = $this->_changeMenuItemSrlInButtonPath($menuItemInfo->active_btn, $insertedMenuSrl, $insertedMenuItemSrl, 'active');
@@ -2248,9 +2248,9 @@  discard block
 block discarded – undo
2248 2248
 	{
2249 2249
 		$path = sprintf('./files/attach/menu_button/%d/', $menuSrl);
2250 2250
 		$tmp_arr = explode('.', $buttonPath);
2251
-		$ext = $tmp_arr[count($tmp_arr)-1];
2251
+		$ext = $tmp_arr[count($tmp_arr) - 1];
2252 2252
 		$date = date("YmdHis");
2253
-		return sprintf('%s%d.%s.%s.%s', $path, $menuItemSrl,$date,'menu_'.$mode.'_btn', $ext);
2253
+		return sprintf('%s%d.%s.%s.%s', $path, $menuItemSrl, $date, 'menu_'.$mode.'_btn', $ext);
2254 2254
 	}
2255 2255
 
2256 2256
 	public function makeHomemenuCacheFile($menuSrl)
Please login to merge, or discard this patch.
Braces   +304 added lines, -134 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
 		}
@@ -464,12 +469,21 @@  discard block
 block discarded – undo
464 469
 			$args->is_shortcut = $request->is_shortcut;
465 470
 			$args->url = $request->shortcut_target;
466 471
 
467
-			if(!$args->open_window) $args->open_window = 'N';
468
-			if(!$args->expand) $args->expand = 'N';
469
-			if(!$args->is_shortcut) $args->is_shortcut = 'Y';
472
+			if(!$args->open_window) {
473
+				$args->open_window = 'N';
474
+			}
475
+			if(!$args->expand) {
476
+				$args->expand = 'N';
477
+			}
478
+			if(!$args->is_shortcut) {
479
+				$args->is_shortcut = 'Y';
480
+			}
470 481
 
471
-			if($request->menu_name_key) $args->name = $request->menu_name_key;
472
-			else $args->name = $request->menu_name;
482
+			if($request->menu_name_key) {
483
+				$args->name = $request->menu_name_key;
484
+			} else {
485
+				$args->name = $request->menu_name;
486
+			}
473 487
 		}
474 488
 		// type is module short cut
475 489
 		else if(is_numeric($request->shortcut_target))
@@ -504,13 +518,18 @@  discard block
 block discarded – undo
504 518
 			$args->url = '#';
505 519
 		}
506 520
 
507
-		if($request->menu_desc) $args->desc = $request->menu_desc;
508
-		else $args->desc = '';
521
+		if($request->menu_desc) {
522
+			$args->desc = $request->menu_desc;
523
+		} else {
524
+			$args->desc = '';
525
+		}
509 526
 
510 527
 		$args->menu_item_srl = getNextSequence();
511 528
 		$args->listorder = -1*$args->menu_item_srl;
512 529
 		$output = executeQuery('menu.insertMenuItem', $args);
513
-		if(!$output->toBool()) return $output;
530
+		if(!$output->toBool()) {
531
+			return $output;
532
+		}
514 533
 
515 534
 		$oDB->commit();
516 535
 
@@ -532,15 +551,27 @@  discard block
 block discarded – undo
532 551
 		$args->expand = $request->menu_expand;
533 552
 		$args->is_shortcut = $request->is_shortcut;
534 553
 
535
-		if(!$args->open_window) $args->open_window = 'N';
536
-		if(!$args->expand) $args->expand = 'N';
537
-		if(!$args->is_shortcut) $args->is_shortcut = 'N';
554
+		if(!$args->open_window) {
555
+			$args->open_window = 'N';
556
+		}
557
+		if(!$args->expand) {
558
+			$args->expand = 'N';
559
+		}
560
+		if(!$args->is_shortcut) {
561
+			$args->is_shortcut = 'N';
562
+		}
538 563
 
539
-		if($request->menu_name_key) $args->name = $request->menu_name_key;
540
-		else $args->name = $request->menu_name;
564
+		if($request->menu_name_key) {
565
+			$args->name = $request->menu_name_key;
566
+		} else {
567
+			$args->name = $request->menu_name;
568
+		}
541 569
 
542
-		if($request->menu_desc) $args->desc = $request->menu_desc;
543
-		else $args->desc = '';
570
+		if($request->menu_desc) {
571
+			$args->desc = $request->menu_desc;
572
+		} else {
573
+			$args->desc = '';
574
+		}
544 575
 
545 576
 		if($request->module_id && strncasecmp('http', $request->module_id, 4) === 0)
546 577
 		{
@@ -558,9 +589,15 @@  discard block
 block discarded – undo
558 589
 		}
559 590
 
560 591
 		// if setting button variables, set argument button variables for db insert. but not upload in this method
561
-		if($request->normal_btn) $args->normal_btn = $request->normal_btn;
562
-		if($request->hover_btn) $args->hover_btn = $request->hover_btn;
563
-		if($request->active_btn) $args->active_btn = $request->active_btn;
592
+		if($request->normal_btn) {
593
+			$args->normal_btn = $request->normal_btn;
594
+		}
595
+		if($request->hover_btn) {
596
+			$args->hover_btn = $request->hover_btn;
597
+		}
598
+		if($request->active_btn) {
599
+			$args->active_btn = $request->active_btn;
600
+		}
564 601
 
565 602
 		if(!$request->module_id)
566 603
 		{
@@ -571,7 +608,9 @@  discard block
 block discarded – undo
571 608
 		$args->menu_item_srl = getNextSequence();
572 609
 		$args->listorder = -1*$args->menu_item_srl;
573 610
 		$output = executeQuery('menu.insertMenuItem', $args);
574
-		if(!$output->toBool()) return $output;
611
+		if(!$output->toBool()) {
612
+			return $output;
613
+		}
575 614
 
576 615
 		$oDB->commit();
577 616
 
@@ -652,8 +691,12 @@  discard block
 block discarded – undo
652 691
 		}
653 692
 
654 693
 		// variables set
655
-		if($request->menu_open_window != "Y") $request->menu_open_window = "N";
656
-		if($request->menu_expand != "Y") $request->menu_expand = "N";
694
+		if($request->menu_open_window != "Y") {
695
+			$request->menu_open_window = "N";
696
+		}
697
+		if($request->menu_expand != "Y") {
698
+			$request->menu_expand = "N";
699
+		}
657 700
 
658 701
 		// Get original information
659 702
 		$oMenuAdminModel = getAdminModel('menu');
@@ -680,13 +723,11 @@  discard block
 block discarded – undo
680 723
 
681 724
 				$args->url = $newItemInfo->url;
682 725
 				$args->is_shortcut = 'Y';
683
-			}
684
-			else
726
+			} else
685 727
 			{
686 728
 				$args->url = '#';
687 729
 			}
688
-		}
689
-		else
730
+		} else
690 731
 		{
691 732
 			// check already created module instance
692 733
 			$oModuleModel = getModel('module');
@@ -719,14 +760,16 @@  discard block
 block discarded – undo
719 760
 		if($request->menu_name_key)
720 761
 		{
721 762
 			$args->name = $request->menu_name_key;
722
-		}
723
-		else
763
+		} else
724 764
 		{
725 765
 			$args->name = $request->menu_name;
726 766
 		}
727 767
 
728
-		if($request->menu_desc) $args->desc = $request->menu_desc;
729
-		else $args->desc = '';
768
+		if($request->menu_desc) {
769
+			$args->desc = $request->menu_desc;
770
+		} else {
771
+			$args->desc = '';
772
+		}
730 773
 
731 774
 		unset($args->group_srls);
732 775
 		$args->open_window = $request->menu_open_window;
@@ -828,8 +871,7 @@  discard block
 block discarded – undo
828 871
 		{
829 872
 			$this->setError($returnObj->error);
830 873
 			$this->setMessage($returnObj->message);
831
-		}
832
-		else
874
+		} else
833 875
 		{
834 876
 			$this->setMessage('success_deleted');
835 877
 		}
@@ -856,7 +898,9 @@  discard block
 block discarded – undo
856 898
 		if($args->is_force != 'Y')
857 899
 		{
858 900
 			$output = executeQuery('menu.getChildMenuCount', $args);
859
-			if(!$output->toBool()) return $output;
901
+			if(!$output->toBool()) {
902
+				return $output;
903
+			}
860 904
 			if($output->data->count > 0)
861 905
 			{
862 906
 				return new Object(-1001, 'msg_cannot_delete_for_child');
@@ -874,7 +918,9 @@  discard block
 block discarded – undo
874 918
 			return $this->stop('msg_cannot_delete_for_admin_topmenu');
875 919
 		}
876 920
 
877
-		if($itemInfo->parent_srl) $parent_srl = $itemInfo->parent_srl;
921
+		if($itemInfo->parent_srl) {
922
+			$parent_srl = $itemInfo->parent_srl;
923
+		}
878 924
 
879 925
 		// get menu properies with child menu
880 926
 		$phpFile = sprintf("./files/cache/menu/%s.php", $args->menu_srl);
@@ -948,9 +994,15 @@  discard block
 block discarded – undo
948 994
 		// Update the xml file and get its location
949 995
 		$xml_file = $this->makeXmlFile($args->menu_srl);
950 996
 		// Delete all of image buttons
951
-		if($node['normal_btn']) FileHandler::removeFile($node['normal_btn']);
952
-		if($node['hover_btn']) FileHandler::removeFile($node['hover_btn']);
953
-		if($node['active_btn']) FileHandler::removeFile($node['active_btn']);
997
+		if($node['normal_btn']) {
998
+			FileHandler::removeFile($node['normal_btn']);
999
+		}
1000
+		if($node['hover_btn']) {
1001
+			FileHandler::removeFile($node['hover_btn']);
1002
+		}
1003
+		if($node['active_btn']) {
1004
+			FileHandler::removeFile($node['active_btn']);
1005
+		}
954 1006
 
955 1007
 		// Delete module
956 1008
 		if($node['is_shortcut'] != 'Y' && strncasecmp('http', $node['url'], 4) !== 0)
@@ -1017,7 +1069,9 @@  discard block
 block discarded – undo
1017 1069
 		$source_srl = Context::get('source_srl');	// Same hierarchy's menu item serial number
1018 1070
 		$target_srl = Context::get('target_srl');	// Self menu item serial number
1019 1071
 
1020
-		if(!$mode || !$parent_srl || !$target_srl) return new Object(-1,'msg_invalid_request');
1072
+		if(!$mode || !$parent_srl || !$target_srl) {
1073
+			return new Object(-1,'msg_invalid_request');
1074
+		}
1021 1075
 
1022 1076
 		$oMenuAdminModel = getAdminModel('menu');
1023 1077
 
@@ -1181,8 +1235,11 @@  discard block
 block discarded – undo
1181 1235
 		// default argument setting
1182 1236
 		$args = new stdClass();
1183 1237
 		$args->menu_srl = $menuSrl;
1184
-		if($parentSrl == 0) $args->parent_srl = $menuSrl;
1185
-		else $args->parent_srl = $parentSrl;
1238
+		if($parentSrl == 0) {
1239
+			$args->parent_srl = $menuSrl;
1240
+		} else {
1241
+			$args->parent_srl = $parentSrl;
1242
+		}
1186 1243
 		$args->menu_name_key = $originMenu['text'];
1187 1244
 		$args->menu_name = $originMenu['text'];
1188 1245
 		$args->menu_open_window = $originMenu['open_window'];
@@ -1275,8 +1332,11 @@  discard block
 block discarded – undo
1275 1332
 		for($i=0;$i<4;$i++)
1276 1333
 		{
1277 1334
 			$case = rand(0, 1);
1278
-			if($case) $doc = rand(65, 90);
1279
-			else $doc = rand(97, 122);
1335
+			if($case) {
1336
+				$doc = rand(65, 90);
1337
+			} else {
1338
+				$doc = rand(97, 122);
1339
+			}
1280 1340
 
1281 1341
 			$randomString .= chr($doc);
1282 1342
 		}
@@ -1299,15 +1359,21 @@  discard block
 block discarded – undo
1299 1359
 		// menu name update
1300 1360
 		$args->menu_srl = $this->menuSrl;
1301 1361
 		$output = executeQuery('menu.updateMenu', $args);
1302
-		if(!$output->toBool()) return $output;
1362
+		if(!$output->toBool()) {
1363
+			return $output;
1364
+		}
1303 1365
 
1304 1366
 		$this->map = array();
1305 1367
 		if(is_array($parentKeyList))
1306 1368
 		{
1307 1369
 			foreach($parentKeyList as $no=>$srl)
1308 1370
 			{
1309
-				if($srl === 0) continue;
1310
-				if(!is_array($this->map[$srl]))$this->map[$srl] = array();
1371
+				if($srl === 0) {
1372
+					continue;
1373
+				}
1374
+				if(!is_array($this->map[$srl])) {
1375
+					$this->map[$srl] = array();
1376
+				}
1311 1377
 				$this->map[$srl][] = $no;
1312 1378
 			}
1313 1379
 		}
@@ -1409,7 +1475,9 @@  discard block
 block discarded – undo
1409 1475
 		$oMenuAdminModel = getAdminModel('menu');
1410 1476
 
1411 1477
 		$target_item = $oMenuAdminModel->getMenuItemInfo($target_srl);
1412
-		if($target_item->menu_item_srl != $target_srl) return new Object(-1,'msg_invalid_request');
1478
+		if($target_item->menu_item_srl != $target_srl) {
1479
+			return new Object(-1,'msg_invalid_request');
1480
+		}
1413 1481
 		// Move the menu location(change the order menu appears)
1414 1482
 		if($mode == 'move')
1415 1483
 		{
@@ -1420,24 +1488,33 @@  discard block
 block discarded – undo
1420 1488
 			if($source_srl)
1421 1489
 			{
1422 1490
 				$source_item = $oMenuAdminModel->getMenuItemInfo($source_srl);
1423
-				if($source_item->menu_item_srl != $source_srl) return new Object(-1,'msg_invalid_request');
1491
+				if($source_item->menu_item_srl != $source_srl) {
1492
+					return new Object(-1,'msg_invalid_request');
1493
+				}
1424 1494
 				$args->listorder = $source_item->listorder-1;
1425
-			}
1426
-			else
1495
+			} else
1427 1496
 			{
1428 1497
 				$output = executeQuery('menu.getMaxListorder', $args);
1429
-				if(!$output->toBool()) return $output;
1498
+				if(!$output->toBool()) {
1499
+					return $output;
1500
+				}
1430 1501
 				$args->listorder = (int)$output->data->listorder;
1431
-				if(!$args->listorder) $args->listorder= 0;
1502
+				if(!$args->listorder) {
1503
+					$args->listorder= 0;
1504
+				}
1432 1505
 			}
1433 1506
 			$args->parent_srl = $parent_srl;
1434 1507
 			$output = executeQuery('menu.updateMenuItemListorder', $args);
1435
-			if(!$output->toBool()) return $output;
1508
+			if(!$output->toBool()) {
1509
+				return $output;
1510
+			}
1436 1511
 
1437 1512
 			$args->parent_srl = $parent_srl;
1438 1513
 			$args->menu_item_srl = $target_srl;
1439 1514
 			$output = executeQuery('menu.updateMenuItemNode', $args);
1440
-			if(!$output->toBool()) return $output;
1515
+			if(!$output->toBool()) {
1516
+				return $output;
1517
+			}
1441 1518
 
1442 1519
 			//module's menu_srl move also
1443 1520
 			if($isShortcut == 'N' && !empty($url))
@@ -1465,14 +1542,15 @@  discard block
 block discarded – undo
1465 1542
 				}
1466 1543
 			}
1467 1544
 			// Add a child
1468
-		}
1469
-		elseif($mode == 'insert')
1545
+		} elseif($mode == 'insert')
1470 1546
 		{
1471 1547
 			$args->menu_item_srl = $target_srl;
1472 1548
 			$args->parent_srl = $parent_srl;
1473 1549
 			$args->listorder = -1*getNextSequence();
1474 1550
 			$output = executeQuery('menu.updateMenuItemNode', $args);
1475
-			if(!$output->toBool()) return $output;
1551
+			if(!$output->toBool()) {
1552
+				return $output;
1553
+			}
1476 1554
 		}
1477 1555
 
1478 1556
 		$xml_file = $this->makeXmlFile($menu_srl);
@@ -1516,8 +1594,7 @@  discard block
 block discarded – undo
1516 1594
 		{
1517 1595
 			Context::set('error_messge', Context::getLang('msg_invalid_request'));
1518 1596
 
1519
-		}
1520
-		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']))
1597
+		} 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 1598
 		{
1522 1599
 			Context::set('error_messge', Context::getLang('msg_invalid_request'));
1523 1600
 		}
@@ -1531,7 +1608,9 @@  discard block
 block discarded – undo
1531 1608
 			$path = sprintf('./files/attach/menu_button/%d/', $menu_srl);
1532 1609
 			$filename = sprintf('%s%d.%s.%s', $path, $menu_item_srl, $target, $ext);
1533 1610
 
1534
-			if(!is_dir($path)) FileHandler::makeDir($path);
1611
+			if(!is_dir($path)) {
1612
+				FileHandler::makeDir($path);
1613
+			}
1535 1614
 
1536 1615
 			move_uploaded_file($target_file['tmp_name'], $filename);
1537 1616
 			Context::set('filename', $filename);
@@ -1571,7 +1650,9 @@  discard block
 block discarded – undo
1571 1650
 			foreach($installed_module_list AS $key=>$value)
1572 1651
 			{
1573 1652
 				$info = $oModuleModel->getModuleActionXml($value->module);
1574
-				if($info->menu) $menuList[$value->module] = $info->menu;
1653
+				if($info->menu) {
1654
+					$menuList[$value->module] = $info->menu;
1655
+				}
1575 1656
 				unset($info->menu);
1576 1657
 			}
1577 1658
 		}
@@ -1603,8 +1684,12 @@  discard block
 block discarded – undo
1603 1684
 		$info = $oModuleModel->getModuleActionXml($moduleName);
1604 1685
 
1605 1686
 		$url = getNotEncodedFullUrl('', 'module', 'admin', 'act', $info->menu->{$menuName}->index);
1606
-		if(empty($url)) $url = getNotEncodedFullUrl('', 'module', 'admin', 'act', $info->admin_index_act);
1607
-		if(empty($url)) $url = getNotEncodedFullUrl('', 'module', 'admin');
1687
+		if(empty($url)) {
1688
+			$url = getNotEncodedFullUrl('', 'module', 'admin', 'act', $info->admin_index_act);
1689
+		}
1690
+		if(empty($url)) {
1691
+			$url = getNotEncodedFullUrl('', 'module', 'admin');
1692
+		}
1608 1693
 		$dbInfo = Context::getDBInfo();
1609 1694
 
1610 1695
 		$args = new stdClass();
@@ -1616,8 +1701,7 @@  discard block
 block discarded – undo
1616 1701
 		if(strpos($url, 'https') !== false)
1617 1702
 		{
1618 1703
 			$args->url = str_replace('https'.substr($dbInfo->default_url, 4), '', $url);
1619
-		}
1620
-		else
1704
+		} else
1621 1705
 		{
1622 1706
 			$args->url = str_replace($dbInfo->default_url, '', $url);
1623 1707
 		}
@@ -1636,14 +1720,18 @@  discard block
 block discarded – undo
1636 1720
 		if($item_info->menu_item_srl == $args->menu_item_srl)
1637 1721
 		{
1638 1722
 			$output = $this->_updateMenuItem($args);
1639
-			if(!$output->toBool()) return $output;
1723
+			if(!$output->toBool()) {
1724
+				return $output;
1725
+			}
1640 1726
 		}
1641 1727
 		// Insert if not exist
1642 1728
 		else
1643 1729
 		{
1644 1730
 			$args->listorder = -1*$args->menu_item_srl;
1645 1731
 			$output = executeQuery('menu.insertMenuItem', $args);
1646
-			if(!$output->toBool()) return $output;
1732
+			if(!$output->toBool()) {
1733
+				return $output;
1734
+			}
1647 1735
 		}
1648 1736
 		// Get information of the menu
1649 1737
 		$menu_info = $oMenuModel->getMenu($args->menu_srl);
@@ -1674,8 +1762,7 @@  discard block
 block discarded – undo
1674 1762
 		if(!$exposure)
1675 1763
 		{
1676 1764
 			$args->group_srls = '';
1677
-		}
1678
-		else
1765
+		} else
1679 1766
 		{
1680 1767
 			$exposure = explode(',', $exposure);
1681 1768
 			if(in_array($exposure, array('-1','-3')))
@@ -1683,7 +1770,9 @@  discard block
 block discarded – undo
1683 1770
 				$args->group_srls = $exposure;
1684 1771
 			}
1685 1772
 
1686
-			if($exposure) $args->group_srls = implode(',', $exposure);
1773
+			if($exposure) {
1774
+				$args->group_srls = implode(',', $exposure);
1775
+			}
1687 1776
 		}
1688 1777
 
1689 1778
 		$output = $this->_updateMenuItem($args);
@@ -1706,7 +1795,9 @@  discard block
 block discarded – undo
1706 1795
 			$moduleGrnatsArgs = new stdClass;
1707 1796
 			$moduleGrnatsArgs->module_srl = $moduleInfo->module_srl;
1708 1797
 			$output = executeQueryArray('module.getModuleGrants', $moduleGrnatsArgs);
1709
-			if(!$output->data) $output->data = array();
1798
+			if(!$output->data) {
1799
+				$output->data = array();
1800
+			}
1710 1801
 			$moduleGrnats = new stdClass();
1711 1802
 			foreach($output->data as $grant)
1712 1803
 			{
@@ -1715,7 +1806,9 @@  discard block
 block discarded – undo
1715 1806
 		}
1716 1807
 
1717 1808
 		$grantList = $xml_info->grant;
1718
-		if(!$grantList) $grantList = new stdClass;
1809
+		if(!$grantList) {
1810
+			$grantList = new stdClass;
1811
+		}
1719 1812
 
1720 1813
 		$grantList->access = new stdClass();
1721 1814
 		$grantList->access->default = 'guest';
@@ -1741,10 +1834,11 @@  discard block
 block discarded – undo
1741 1834
 					$grant->{$grantName}[] = $htPerm[$grantName];
1742 1835
 					continue;
1743 1836
 				}
1744
-			}
1745
-			else if($itemInfo->is_shortcut === 'Y')
1837
+			} else if($itemInfo->is_shortcut === 'Y')
1746 1838
 			{
1747
-				if(isset($moduleGrnats) && $moduleGrnats->{$grantName}) $grant->{$grantName} = $moduleGrnats->{$grantName};
1839
+				if(isset($moduleGrnats) && $moduleGrnats->{$grantName}) {
1840
+					$grant->{$grantName} = $moduleGrnats->{$grantName};
1841
+				}
1748 1842
 			}
1749 1843
 		}
1750 1844
 
@@ -1766,12 +1860,16 @@  discard block
 block discarded – undo
1766 1860
 	function makeXmlFile($menu_srl)
1767 1861
 	{
1768 1862
 		// Return if there is no information when creating the xml file
1769
-		if(!$menu_srl) return;
1863
+		if(!$menu_srl) {
1864
+			return;
1865
+		}
1770 1866
 		// Get menu informaton
1771 1867
 		$args = new stdClass();
1772 1868
 		$args->menu_srl = $menu_srl;
1773 1869
 		$output = executeQuery('menu.getMenu', $args);
1774
-		if(!$output->toBool() || !$output->data) return $output;
1870
+		if(!$output->toBool() || !$output->data) {
1871
+			return $output;
1872
+		}
1775 1873
 		$site_srl = (int)$output->data->site_srl;
1776 1874
 
1777 1875
 		if($site_srl)
@@ -1785,7 +1883,9 @@  discard block
 block discarded – undo
1785 1883
 		$args->menu_srl = $menu_srl;
1786 1884
 		$args->sort_index = 'listorder';
1787 1885
 		$output = executeQuery('menu.getMenuItems', $args);
1788
-		if(!$output->toBool()) return;
1886
+		if(!$output->toBool()) {
1887
+			return;
1888
+		}
1789 1889
 		// Specify the name of the cache file
1790 1890
 		$xml_file = sprintf(_XE_PATH_ . "files/cache/menu/%s.xml.php", $menu_srl);
1791 1891
 		$php_file = sprintf(_XE_PATH_ . "files/cache/menu/%s.php", $menu_srl);
@@ -1799,7 +1899,9 @@  discard block
 block discarded – undo
1799 1899
 			return $xml_file;
1800 1900
 		}
1801 1901
 		// Change to an array if only a single data is obtained
1802
-		if(!is_array($list)) $list = array($list);
1902
+		if(!is_array($list)) {
1903
+			$list = array($list);
1904
+		}
1803 1905
 		// Create a tree for loop
1804 1906
 		$list_count = count($list);
1805 1907
 		for($i=0;$i<$list_count;$i++)
@@ -1887,7 +1989,9 @@  discard block
 block discarded – undo
1887 1989
 	 */
1888 1990
 	function getXmlTree($source_node, $tree, $site_srl, $domain)
1889 1991
 	{
1890
-		if(!$source_node) return;
1992
+		if(!$source_node) {
1993
+			return;
1994
+		}
1891 1995
 
1892 1996
 		$oMenuAdminModel = getAdminModel('menu');
1893 1997
 
@@ -1895,7 +1999,9 @@  discard block
 block discarded – undo
1895 1999
 		{
1896 2000
 			$child_buff = "";
1897 2001
 			// Get data of the child nodes
1898
-			if($menu_item_srl&&$tree[$menu_item_srl]) $child_buff = $this->getXmlTree($tree[$menu_item_srl], $tree, $site_srl, $domain);
2002
+			if($menu_item_srl&&$tree[$menu_item_srl]) {
2003
+				$child_buff = $this->getXmlTree($tree[$menu_item_srl], $tree, $site_srl, $domain);
2004
+			}
1899 2005
 			// List variables
1900 2006
 			$names = $oMenuAdminModel->getMenuItemNames($node->name, $site_srl);
1901 2007
 			foreach($names as $key => $val)
@@ -1909,37 +2015,57 @@  discard block
 block discarded – undo
1909 2015
 			if(preg_match('/^([0-9a-zA-Z\_\-]+)$/', $node->url))
1910 2016
 			{
1911 2017
 				$href = "getSiteUrl('$domain', '','mid','$node->url')";
2018
+			} else {
2019
+				$href = sprintf('"%s"', $url);
1912 2020
 			}
1913
-			else $href = sprintf('"%s"', $url);
1914 2021
 			$is_shortcut = $node->is_shortcut;
1915 2022
 			$open_window = $node->open_window;
1916 2023
 			$expand = $node->expand;
1917 2024
 
1918 2025
 			$normal_btn = $node->normal_btn;
1919
-			if($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) $normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$normal_btn);
1920
-			else $normal_btn = '';
2026
+			if($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) {
2027
+				$normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$normal_btn);
2028
+			} else {
2029
+				$normal_btn = '';
2030
+			}
1921 2031
 			$hover_btn = $node->hover_btn;
1922
-			if($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) $hover_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$hover_btn);
1923
-			else $hover_btn = '';
2032
+			if($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) {
2033
+				$hover_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$hover_btn);
2034
+			} else {
2035
+				$hover_btn = '';
2036
+			}
1924 2037
 			$active_btn = $node->active_btn;
1925
-			if($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) $active_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$active_btn);
1926
-			else $active_btn = '';
2038
+			if($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) {
2039
+				$active_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$active_btn);
2040
+			} else {
2041
+				$active_btn = '';
2042
+			}
1927 2043
 
1928 2044
 			$group_srls = $node->group_srls;
1929 2045
 
1930 2046
 			if($normal_btn)
1931 2047
 			{
1932
-				if($hover_btn) $hover_str = sprintf('onmouseover=&quot;this.src=\'%s\'&quot;', $hover_btn); else $hover_str = '';
1933
-				if($active_btn) $active_str = sprintf('onmousedown=&quot;this.src=\'%s\'&quot;', $active_btn); else $active_str = '';
2048
+				if($hover_btn) {
2049
+					$hover_str = sprintf('onmouseover=&quot;this.src=\'%s\'&quot;', $hover_btn);
2050
+				} else {
2051
+					$hover_str = '';
2052
+				}
2053
+				if($active_btn) {
2054
+					$active_str = sprintf('onmousedown=&quot;this.src=\'%s\'&quot;', $active_btn);
2055
+				} else {
2056
+					$active_str = '';
2057
+				}
1934 2058
 				$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);
1935
-			}
1936
-			else
2059
+			} else
1937 2060
 			{
1938 2061
 				$link = '<?php print $_names[$lang_type]; ?>';
1939 2062
 			}
1940 2063
 			// If the value of node->group_srls exists
1941
-			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);
1942
-			else $group_check_code = "true";
2064
+			if($group_srls) {
2065
+				$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);
2066
+			} else {
2067
+				$group_check_code = "true";
2068
+			}
1943 2069
 			$attribute = sprintf(
1944 2070
 				'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 }?>"',
1945 2071
 				$menu_item_srl,
@@ -1962,8 +2088,11 @@  discard block
 block discarded – undo
1962 2088
 				$link
1963 2089
 			);
1964 2090
 
1965
-			if($child_buff) $buff .= sprintf('<node %s>%s</node>', $attribute, $child_buff);
1966
-			else $buff .=  sprintf('<node %s />', $attribute);
2091
+			if($child_buff) {
2092
+				$buff .= sprintf('<node %s>%s</node>', $attribute, $child_buff);
2093
+			} else {
2094
+				$buff .=  sprintf('<node %s />', $attribute);
2095
+			}
1967 2096
 		}
1968 2097
 		return $buff;
1969 2098
 	}
@@ -1982,15 +2111,20 @@  discard block
 block discarded – undo
1982 2111
 	function getPhpCacheCode($source_node, $tree, $site_srl, $domain)
1983 2112
 	{
1984 2113
 		$output = array("buff"=>"", "url_list"=>array());
1985
-		if(!$source_node) return $output;
2114
+		if(!$source_node) {
2115
+			return $output;
2116
+		}
1986 2117
 
1987 2118
 		$oMenuAdminModel = getAdminModel('menu');
1988 2119
 
1989 2120
 		foreach($source_node as $menu_item_srl => $node)
1990 2121
 		{
1991 2122
 			// Get data from child nodes if exist.
1992
-			if($menu_item_srl&&$tree[$menu_item_srl]) $child_output = $this->getPhpCacheCode($tree[$menu_item_srl], $tree, $site_srl, $domain);
1993
-			else $child_output = array("buff"=>"", "url_list"=>array());
2123
+			if($menu_item_srl&&$tree[$menu_item_srl]) {
2124
+				$child_output = $this->getPhpCacheCode($tree[$menu_item_srl], $tree, $site_srl, $domain);
2125
+			} else {
2126
+				$child_output = array("buff"=>"", "url_list"=>array());
2127
+			}
1994 2128
 
1995 2129
 			// List variables
1996 2130
 			$names = $oMenuAdminModel->getMenuItemNames($node->name, $site_srl);
@@ -2000,8 +2134,7 @@  discard block
 block discarded – undo
2000 2134
 				if(preg_match('/\{\$lang->menu_gnb(?:_sub)?\[\'([a-zA-Z_]+)\'\]\}/', $val) === 1)
2001 2135
 				{
2002 2136
 					$name_arr_str .= sprintf('"%s"=>"%s",', $key, $val);
2003
-				}
2004
-				else
2137
+				} else
2005 2138
 				{
2006 2139
 					$name_arr_str .= sprintf('"%s"=>\'%s\',', $key, str_replace(array('\\','\''), array('\\\\','\\\''), removeHackTag($val)));
2007 2140
 				}
@@ -2009,11 +2142,16 @@  discard block
 block discarded – undo
2009 2142
 			$name_str = sprintf('$_menu_names[%d] = array(%s); %s', $node->menu_item_srl, $name_arr_str, $child_output['name']);
2010 2143
 
2011 2144
 			// If url value is not empty in the current node, put the value into an array url_list
2012
-			if($node->url) $child_output['url_list'][] = $node->url;
2145
+			if($node->url) {
2146
+				$child_output['url_list'][] = $node->url;
2147
+			}
2013 2148
 			$output['url_list'] = array_merge($output['url_list'], $child_output['url_list']);
2014 2149
 			// If node->group_srls value exists
2015
-			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);
2016
-			else $group_check_code = "true";
2150
+			if($node->group_srls) {
2151
+				$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);
2152
+			} else {
2153
+				$group_check_code = "true";
2154
+			}
2017 2155
 
2018 2156
 			// List variables
2019 2157
 			$href = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->href);
@@ -2022,8 +2160,9 @@  discard block
 block discarded – undo
2022 2160
 			if(preg_match('/^([0-9a-zA-Z\_\-]+)$/i', $node->url))
2023 2161
 			{
2024 2162
 				$href = "getSiteUrl('$domain', '','mid','$node->url')";
2163
+			} else {
2164
+				$href = sprintf('"%s"', $url);
2025 2165
 			}
2026
-			else $href = sprintf('"%s"', $url);
2027 2166
 			$is_shortcut = $node->is_shortcut;
2028 2167
 			$open_window = $node->open_window;
2029 2168
 			$normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->normal_btn);
@@ -2040,29 +2179,48 @@  discard block
 block discarded – undo
2040 2179
 			$expand = $node->expand;
2041 2180
 
2042 2181
 			$normal_btn = $node->normal_btn;
2043
-			if($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) $normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$normal_btn);
2044
-			else $normal_btn = '';
2182
+			if($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) {
2183
+				$normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$normal_btn);
2184
+			} else {
2185
+				$normal_btn = '';
2186
+			}
2045 2187
 
2046 2188
 			$hover_btn = $node->hover_btn;
2047
-			if($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) $hover_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$hover_btn);
2048
-			else $hover_btn = '';
2189
+			if($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) {
2190
+				$hover_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$hover_btn);
2191
+			} else {
2192
+				$hover_btn = '';
2193
+			}
2049 2194
 
2050 2195
 			$active_btn = $node->active_btn;
2051
-			if($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) $active_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$active_btn);
2052
-			else $active_btn = '';
2196
+			if($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) {
2197
+				$active_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$active_btn);
2198
+			} else {
2199
+				$active_btn = '';
2200
+			}
2053 2201
 
2054 2202
 
2055 2203
 			$group_srls = $node->group_srls;
2056 2204
 
2057 2205
 			if($normal_btn)
2058 2206
 			{
2059
-				if($hover_btn) $hover_str = sprintf('onmouseover=\"this.src=\'%s\'\"', $hover_btn); else $hover_str = '';
2060
-				if($active_btn) $active_str = sprintf('onmousedown=\"this.src=\'%s\'\"', $active_btn); else $active_str = '';
2207
+				if($hover_btn) {
2208
+					$hover_str = sprintf('onmouseover=\"this.src=\'%s\'\"', $hover_btn);
2209
+				} else {
2210
+					$hover_str = '';
2211
+				}
2212
+				if($active_btn) {
2213
+					$active_str = sprintf('onmousedown=\"this.src=\'%s\'\"', $active_btn);
2214
+				} else {
2215
+					$active_str = '';
2216
+				}
2061 2217
 				$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);
2062
-				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);
2063
-				else $link_active = $link;
2064
-			}
2065
-			else
2218
+				if($active_btn) {
2219
+					$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);
2220
+				} else {
2221
+					$link_active = $link;
2222
+				}
2223
+			} else
2066 2224
 			{
2067 2225
 				$link_active = $link = sprintf('$_menu_names[%d][$lang_type]', $node->menu_item_srl);
2068 2226
 			}
@@ -2111,11 +2269,15 @@  discard block
 block discarded – undo
2111 2269
 	 */
2112 2270
 	function updateMenuLayout($layout_srl, $menu_srl_list)
2113 2271
 	{
2114
-		if(!count($menu_srl_list)) return;
2272
+		if(!count($menu_srl_list)) {
2273
+			return;
2274
+		}
2115 2275
 		// Delete the value of menu_srls
2116 2276
 		$args->menu_srls = implode(',',$menu_srl_list);
2117 2277
 		$output = executeQuery('menu.deleteMenuLayout', $args);
2118
-		if(!$output->toBool()) return $output;
2278
+		if(!$output->toBool()) {
2279
+			return $output;
2280
+		}
2119 2281
 
2120 2282
 		$args->layout_srl = $layout_srl;
2121 2283
 		// Mapping menu_srls, layout_srl
@@ -2123,7 +2285,9 @@  discard block
 block discarded – undo
2123 2285
 		{
2124 2286
 			$args->menu_srl = $menu_srl_list[$i];
2125 2287
 			$output = executeQuery('menu.insertMenuLayout', $args);
2126
-			if(!$output->toBool()) return $output;
2288
+			if(!$output->toBool()) {
2289
+				return $output;
2290
+			}
2127 2291
 		}
2128 2292
 	}
2129 2293
 
@@ -2146,9 +2310,15 @@  discard block
 block discarded – undo
2146 2310
 			$oMenuModel = getAdminModel('menu');
2147 2311
 			$itemInfo = $oMenuModel->getMenuItemInfo($args->menu_item_srl);
2148 2312
 
2149
-			if($args->isNormalDelete == 'Y' && $itemInfo->normal_btn) FileHandler::removeFile($itemInfo->normal_btn);
2150
-			if($args->isHoverDelete == 'Y' && $itemInfo->hover_btn) FileHandler::removeFile($itemInfo->hover_btn);
2151
-			if($args->isActiveDelete == 'Y' && $itemInfo->active_btn) FileHandler::removeFile($itemInfo->active_btn);
2313
+			if($args->isNormalDelete == 'Y' && $itemInfo->normal_btn) {
2314
+				FileHandler::removeFile($itemInfo->normal_btn);
2315
+			}
2316
+			if($args->isHoverDelete == 'Y' && $itemInfo->hover_btn) {
2317
+				FileHandler::removeFile($itemInfo->hover_btn);
2318
+			}
2319
+			if($args->isActiveDelete == 'Y' && $itemInfo->active_btn) {
2320
+				FileHandler::removeFile($itemInfo->active_btn);
2321
+			}
2152 2322
 		}
2153 2323
 
2154 2324
 		$returnArray = array();
Please login to merge, or discard this patch.
modules/menu/menu.admin.model.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -579,7 +579,7 @@
 block discarded – undo
579 579
 
580 580
 	/**
581 581
 	 * Get module's detail setup contents
582
-	 * @return void
582
+	 * @return Object|null
583 583
 	 */
584 584
 	public function getMenuAdminDetailSetup()
585 585
 	{
Please login to merge, or discard this patch.
Braces   +72 added lines, -45 removed lines patch added patch discarded remove patch
@@ -41,7 +41,9 @@  discard block
 block discarded – undo
41 41
 		// document.getDocumentList query execution
42 42
 		$output = executeQuery('menu.getMenuList', $args);
43 43
 		// Return if no result or an error occurs
44
-		if(!$output->toBool()||!count($output->data)) return $output;
44
+		if(!$output->toBool()||!count($output->data)) {
45
+			return $output;
46
+		}
45 47
 
46 48
 		return $output;
47 49
 	}
@@ -63,7 +65,9 @@  discard block
 block discarded – undo
63 65
 		$args->site_srl = $site_srl ;
64 66
 		$args->menu_srl = $menu_srl;
65 67
 		$output = executeQueryArray('menu.getMenus', $args);
66
-		if(!$output->data) return;
68
+		if(!$output->data) {
69
+			return;
70
+		}
67 71
 		$menus = $output->data;
68 72
 		return $menus;
69 73
 	}
@@ -80,7 +84,9 @@  discard block
 block discarded – undo
80 84
 		$args = new stdClass();
81 85
 		$args->menu_srl = $menu_srl;
82 86
 		$output = executeQuery('menu.getMenu', $args);
83
-		if(!$output->data) return;
87
+		if(!$output->data) {
88
+			return;
89
+		}
84 90
 
85 91
 		$menu_info = $output->data;
86 92
 		$menu_info->xml_file = sprintf('./files/cache/menu/%s.xml.php',$menu_srl);
@@ -105,10 +111,15 @@  discard block
 block discarded – undo
105 111
 		$args->title = $title;
106 112
 		$args->site_srl = $site_srl;
107 113
 		$output = executeQuery('menu.getMenuByTitle', $args);
108
-		if(!$output->data) return;
114
+		if(!$output->data) {
115
+			return;
116
+		}
109 117
 
110
-		if(is_array($output->data)) $menu_info = $output->data[0];
111
-		else $menu_info = $output->data;
118
+		if(is_array($output->data)) {
119
+			$menu_info = $output->data[0];
120
+		} else {
121
+			$menu_info = $output->data;
122
+		}
112 123
 
113 124
 		if($menu_info->menu_srl)
114 125
 		{
@@ -152,15 +163,20 @@  discard block
 block discarded – undo
152 163
 		$output = executeQuery('menu.getMenuItem', $args);
153 164
 		$node = $output->data;
154 165
 		settype($node,'object');
155
-		if($node->group_srls) $node->group_srls = explode(',',$node->group_srls);
156
-		else $node->group_srls = array();
166
+		if($node->group_srls) {
167
+			$node->group_srls = explode(',',$node->group_srls);
168
+		} else {
169
+			$node->group_srls = array();
170
+		}
157 171
 
158 172
 		$tmp_name = unserialize($node->name);
159 173
 		if($tmp_name && count($tmp_name))
160 174
 		{
161 175
 			$selected_lang = array();
162 176
 			$rand_name = $tmp_name[Context::getLangType()];
163
-			if(!$rand_name) $rand_name = array_shift($tmp_name);
177
+			if(!$rand_name) {
178
+				$rand_name = array_shift($tmp_name);
179
+			}
164 180
 			$node->name = $rand_name;
165 181
 		}
166 182
 		return $node;
@@ -178,13 +194,13 @@  discard block
 block discarded – undo
178 194
 		if(!$menuItem->url)
179 195
 		{
180 196
 			$menuItem->moduleType = null;
181
-		}
182
-		else if(strncasecmp('http', $menuItem->url, 4) !== 0)
197
+		} else if(strncasecmp('http', $menuItem->url, 4) !== 0)
183 198
 		{
184 199
 			$oModuleModel = getModel('module');
185 200
 			$moduleInfo = $oModuleModel->getModuleInfoByMid($menuItem->url, 0);
186
-			if(!$moduleInfo) $menuItem->moduleType = 'url';
187
-			else
201
+			if(!$moduleInfo) {
202
+				$menuItem->moduleType = 'url';
203
+			} else
188 204
 			{
189 205
 				if($moduleInfo->mid == $menuItem->url)
190 206
 				{
@@ -193,8 +209,9 @@  discard block
 block discarded – undo
193 209
 					$menuItem->layoutSrl = $moduleInfo->layout_srl;
194 210
 				}
195 211
 			}
212
+		} else {
213
+			$menuItem->moduleType = 'url';
196 214
 		}
197
-		else $menuItem->moduleType = 'url';
198 215
 
199 216
 		// grant setting
200 217
 		if(is_array($menuItem->group_srls) && count($menuItem->group_srls) > 0)
@@ -202,12 +219,10 @@  discard block
 block discarded – undo
202 219
 			if($menuItem->group_srls[0] == -1)
203 220
 			{
204 221
 				$menuItem->grant = 'member';
205
-			}
206
-			else if($menuItem->group_srls[0] == -3)
222
+			} else if($menuItem->group_srls[0] == -3)
207 223
 			{
208 224
 				$menuItem->grant = 'manager';
209
-			}
210
-			else
225
+			} else
211 226
 			{
212 227
 				$menuItem->grant = 'group';
213 228
 			}
@@ -228,11 +243,15 @@  discard block
 block discarded – undo
228 243
 				{
229 244
 					$tmp = $oModuleAdminModel->getLangCode(0, $value->title);
230 245
 					$groupList[$value->group_srl]->title = $tmp[Context::getLangType()];
246
+				} else {
247
+					$groupList[$value->group_srl]->title = $value->title;
231 248
 				}
232
-				else $groupList[$value->group_srl]->title = $value->title;
233 249
 
234
-				if(in_array($key, $menuItem->group_srls)) $groupList[$value->group_srl]->isChecked = true;
235
-				else $groupList[$value->group_srl]->isChecked = false;
250
+				if(in_array($key, $menuItem->group_srls)) {
251
+					$groupList[$value->group_srl]->isChecked = true;
252
+				} else {
253
+					$groupList[$value->group_srl]->isChecked = false;
254
+				}
236 255
 			}
237 256
 		}
238 257
 		$menuItem->groupList = $groupList;
@@ -305,11 +324,12 @@  discard block
 block discarded – undo
305 324
 			$item_info->parent_srl = $parent_srl;
306 325
 			$item_info->parent_menu_name = $parent_info->name;
307 326
 			// In case of modifying the existing menu or addting a new menu to the root
308
-		}
309
-		else
327
+		} else
310 328
 		{
311 329
 			// Get information of the menu if menu_item_srl exists
312
-			if($menu_item_srl) $item_info = $this->getMenuItemInfo($menu_item_srl);
330
+			if($menu_item_srl) {
331
+				$item_info = $this->getMenuItemInfo($menu_item_srl);
332
+			}
313 333
 			// Get only menu_item_srl if no values found, considering it as adding a new menu
314 334
 			if(!$item_info->menu_item_srl)
315 335
 			{
@@ -349,7 +369,9 @@  discard block
 block discarded – undo
349 369
 		foreach($_allModules as $module_name)
350 370
 		{
351 371
 			$module = $oModuleModel->getModuleInfoXml($module_name);
352
-			if(!isset($module)) continue;
372
+			if(!isset($module)) {
373
+				continue;
374
+			}
353 375
 			$defaultSkin = $oModuleModel->getModuleDefaultSkin($module_name, 'P');
354 376
 			$defaultMobileSkin = $oModuleModel->getModuleDefaultSkin($module_name, 'M');
355 377
 			$skinInfo = $oModuleModel->loadSkinInfo(ModuleHandler::getModulePath($module_name), $defaultSkin);
@@ -379,8 +401,7 @@  discard block
 block discarded – undo
379 401
 				$oModuleInfo->title = $pageTypeName['OUTSIDE'];
380 402
 				$oModuleInfo->no_skin = 'Y';
381 403
 				$allModules['OUTSIDE'] = $oModuleInfo;
382
-			}
383
-			else
404
+			} else
384 405
 			{
385 406
 				$allModules[$module_name] = $module;
386 407
 			}
@@ -414,7 +435,9 @@  discard block
 block discarded – undo
414 435
 
415 436
 		// after trigger
416 437
 		$output = ModuleHandler::triggerCall('menu.getModuleListInSitemap', 'after', $moduleList);
417
-		if(!$output->toBool()) return $output;
438
+		if(!$output->toBool()) {
439
+			return $output;
440
+		}
418 441
 
419 442
 		$localModuleList = array_unique($moduleList);
420 443
 
@@ -425,7 +448,9 @@  discard block
 block discarded – undo
425 448
 		$remoteModuleList = array();
426 449
 		foreach($remotePackageList as $package)
427 450
 		{
428
-			if(strpos($package->path, './modules/') !== 0) continue;
451
+			if(strpos($package->path, './modules/') !== 0) {
452
+				continue;
453
+			}
429 454
 
430 455
 			$pathInfo = explode('/', $package->path);
431 456
 			$remoteModuleList[] = $pathInfo[2];
@@ -464,8 +489,7 @@  discard block
 block discarded – undo
464 489
 					$oModuleInfo->title = $pageTypeName['OUTSIDE'];
465 490
 					$oModuleInfo->no_skin = 'Y';
466 491
 					$moduleInfoList['OUTSIDE'] = $oModuleInfo;
467
-				}
468
-				else
492
+				} else
469 493
 				{
470 494
 					$moduleInfoList[$value] = $moduleInfo;
471 495
 				}
@@ -497,8 +521,11 @@  discard block
 block discarded – undo
497 521
 			$isMenuFixed = false;
498 522
 			$output = $this->getMenu($menuSrl);
499 523
 			$php_file = sprintf(_XE_PATH_ . 'files/cache/menu/%s.php',$output->menu_srl);
500
-			if(file_exists($php_file)) include($php_file);
501
-			else $oMenuAdminController->makeXmlFile($menuSrl);
524
+			if(file_exists($php_file)) {
525
+				include($php_file);
526
+			} else {
527
+				$oMenuAdminController->makeXmlFile($menuSrl);
528
+			}
502 529
 
503 530
 			if(count($menu->list)>0)
504 531
 			{
@@ -518,8 +545,7 @@  discard block
 block discarded – undo
518 545
 			$menuItems->title = $output->title;
519 546
 			$menuItems->menuItems = $menu;
520 547
 			$menuList[] = $menuItems;
521
-		}
522
-		else
548
+		} else
523 549
 		{
524 550
 			$menuListFromDB = $this->getMenus($siteSrl);
525 551
 			if(is_array($menuListFromDB))
@@ -527,8 +553,9 @@  discard block
 block discarded – undo
527 553
 				$oAdmin = getClass('admin');
528 554
 				foreach($menuListFromDB AS $key=>$value)
529 555
 				{
530
-					if($value->title == $oAdmin->getAdminMenuName()) unset($output[$key]);
531
-					else
556
+					if($value->title == $oAdmin->getAdminMenuName()) {
557
+						unset($output[$key]);
558
+					} else
532 559
 					{
533 560
 						unset($menu);
534 561
 						unset($menuItems);
@@ -564,8 +591,7 @@  discard block
 block discarded – undo
564 591
 						if($value->menu_srl == $this->menuSrlWithinHome)
565 592
 						{
566 593
 							$menuList[-1] = $menuItems;
567
-						}
568
-						else
594
+						} else
569 595
 						{
570 596
 							$menuList[] = $menuItems;
571 597
 						}
@@ -639,8 +665,11 @@  discard block
 block discarded – undo
639 665
 			$args = new stdClass;
640 666
 			$args->menu_item_srl = $menu['node_srl'];
641 667
 			$args->is_shortcut = 'Y';
642
-			if($menu['menu_name_key']) $args->name = $menu['menu_name_key'];
643
-			else $args->name = $menu['menu_name'];
668
+			if($menu['menu_name_key']) {
669
+				$args->name = $menu['menu_name_key'];
670
+			} else {
671
+				$args->name = $menu['menu_name'];
672
+			}
644 673
 			$output = executeQuery('menu.updateMenuItem', $args);
645 674
 
646 675
 			$isMenuFixed = true;
@@ -661,8 +690,7 @@  discard block
 block discarded – undo
661 690
 				if($midInfo->page_type)
662 691
 				{
663 692
 					$menu['module_type'] = $midInfo->page_type;
664
-				}
665
-				else
693
+				} else
666 694
 				{
667 695
 					$menu['module_type'] = $midInfo->module;
668 696
 				}
@@ -671,8 +699,7 @@  discard block
 block discarded – undo
671 699
 			if($moduleInfo->setup_index_act)
672 700
 			{
673 701
 				$menu['setup_index_act'] = $moduleInfo->setup_index_act;
674
-			}
675
-			else if($moduleInfo->default_index_act)
702
+			} else if($moduleInfo->default_index_act)
676 703
 			{
677 704
 				$menu['setup_index_act'] = $moduleInfo->default_index_act;
678 705
 			}
Please login to merge, or discard this patch.
Spacing   +90 added lines, -90 removed lines patch added patch discarded remove patch
@@ -27,21 +27,21 @@  discard block
 block discarded – undo
27 27
 	 */
28 28
 	function getMenuList($obj)
29 29
 	{
30
-		if(!$obj->site_srl)
30
+		if (!$obj->site_srl)
31 31
 		{
32 32
 			$site_module_info = Context::get('site_module_info');
33
-			$obj->site_srl = (int)$site_module_info->site_srl;
33
+			$obj->site_srl = (int) $site_module_info->site_srl;
34 34
 		}
35 35
 		$args = new stdClass;
36 36
 		$args->site_srl = $obj->site_srl;
37 37
 		$args->sort_index = $obj->sort_index;
38
-		$args->page = $obj->page?$obj->page:1;
39
-		$args->list_count = $obj->list_count?$obj->list_count:20;
40
-		$args->page_count = $obj->page_count?$obj->page_count:10;
38
+		$args->page = $obj->page ? $obj->page : 1;
39
+		$args->list_count = $obj->list_count ? $obj->list_count : 20;
40
+		$args->page_count = $obj->page_count ? $obj->page_count : 10;
41 41
 		// document.getDocumentList query execution
42 42
 		$output = executeQuery('menu.getMenuList', $args);
43 43
 		// Return if no result or an error occurs
44
-		if(!$output->toBool()||!count($output->data)) return $output;
44
+		if (!$output->toBool() || !count($output->data)) return $output;
45 45
 
46 46
 		return $output;
47 47
 	}
@@ -53,17 +53,17 @@  discard block
 block discarded – undo
53 53
 	 */
54 54
 	function getMenus($site_srl = null)
55 55
 	{
56
-		if(!isset($site_srl))
56
+		if (!isset($site_srl))
57 57
 		{
58 58
 			$site_module_info = Context::get('site_module_info');
59
-			$site_srl = (int)$site_module_info->site_srl;
59
+			$site_srl = (int) $site_module_info->site_srl;
60 60
 		}
61 61
 		// Get information from the DB
62 62
 		$args = new stdClass();
63
-		$args->site_srl = $site_srl ;
63
+		$args->site_srl = $site_srl;
64 64
 		$args->menu_srl = $menu_srl;
65 65
 		$output = executeQueryArray('menu.getMenus', $args);
66
-		if(!$output->data) return;
66
+		if (!$output->data) return;
67 67
 		$menus = $output->data;
68 68
 		return $menus;
69 69
 	}
@@ -80,11 +80,11 @@  discard block
 block discarded – undo
80 80
 		$args = new stdClass();
81 81
 		$args->menu_srl = $menu_srl;
82 82
 		$output = executeQuery('menu.getMenu', $args);
83
-		if(!$output->data) return;
83
+		if (!$output->data) return;
84 84
 
85 85
 		$menu_info = $output->data;
86
-		$menu_info->xml_file = sprintf('./files/cache/menu/%s.xml.php',$menu_srl);
87
-		$menu_info->php_file = sprintf('./files/cache/menu/%s.php',$menu_srl);
86
+		$menu_info->xml_file = sprintf('./files/cache/menu/%s.xml.php', $menu_srl);
87
+		$menu_info->php_file = sprintf('./files/cache/menu/%s.php', $menu_srl);
88 88
 		return $menu_info;
89 89
 	}
90 90
 
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 	function getMenuByTitle($title, $site_srl = 0)
98 98
 	{
99 99
 		// Get information from the DB
100
-		if(!is_array($title))
100
+		if (!is_array($title))
101 101
 		{
102 102
 			$title = array($title);
103 103
 		}
@@ -105,15 +105,15 @@  discard block
 block discarded – undo
105 105
 		$args->title = $title;
106 106
 		$args->site_srl = $site_srl;
107 107
 		$output = executeQuery('menu.getMenuByTitle', $args);
108
-		if(!$output->data) return;
108
+		if (!$output->data) return;
109 109
 
110
-		if(is_array($output->data)) $menu_info = $output->data[0];
110
+		if (is_array($output->data)) $menu_info = $output->data[0];
111 111
 		else $menu_info = $output->data;
112 112
 
113
-		if($menu_info->menu_srl)
113
+		if ($menu_info->menu_srl)
114 114
 		{
115
-			$menu_info->xml_file = sprintf('./files/cache/menu/%s.xml.php',$menu_info->menu_srl);
116
-			$menu_info->php_file = sprintf('./files/cache/menu/%s.php',$menu_info->menu_srl);
115
+			$menu_info->xml_file = sprintf('./files/cache/menu/%s.xml.php', $menu_info->menu_srl);
116
+			$menu_info->php_file = sprintf('./files/cache/menu/%s.php', $menu_info->menu_srl);
117 117
 		}
118 118
 		return $menu_info;
119 119
 	}
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 		$args = new stdClass();
131 131
 		$args->title = $title;
132 132
 		$output = executeQueryArray('menu.getMenuByTitle', $args);
133
-		if(!$output->data)
133
+		if (!$output->data)
134 134
 		{
135 135
 			return array();
136 136
 		}
@@ -151,16 +151,16 @@  discard block
 block discarded – undo
151 151
 		$args->menu_item_srl = $menu_item_srl;
152 152
 		$output = executeQuery('menu.getMenuItem', $args);
153 153
 		$node = $output->data;
154
-		settype($node,'object');
155
-		if($node->group_srls) $node->group_srls = explode(',',$node->group_srls);
154
+		settype($node, 'object');
155
+		if ($node->group_srls) $node->group_srls = explode(',', $node->group_srls);
156 156
 		else $node->group_srls = array();
157 157
 
158 158
 		$tmp_name = unserialize($node->name);
159
-		if($tmp_name && count($tmp_name))
159
+		if ($tmp_name && count($tmp_name))
160 160
 		{
161 161
 			$selected_lang = array();
162 162
 			$rand_name = $tmp_name[Context::getLangType()];
163
-			if(!$rand_name) $rand_name = array_shift($tmp_name);
163
+			if (!$rand_name) $rand_name = array_shift($tmp_name);
164 164
 			$node->name = $rand_name;
165 165
 		}
166 166
 		return $node;
@@ -175,18 +175,18 @@  discard block
 block discarded – undo
175 175
 		$menuItemSrl = Context::get('menu_item_srl');
176 176
 		$menuItem = $this->getMenuItemInfo($menuItemSrl);
177 177
 
178
-		if(!$menuItem->url)
178
+		if (!$menuItem->url)
179 179
 		{
180 180
 			$menuItem->moduleType = null;
181 181
 		}
182
-		else if(strncasecmp('http', $menuItem->url, 4) !== 0)
182
+		else if (strncasecmp('http', $menuItem->url, 4) !== 0)
183 183
 		{
184 184
 			$oModuleModel = getModel('module');
185 185
 			$moduleInfo = $oModuleModel->getModuleInfoByMid($menuItem->url, 0);
186
-			if(!$moduleInfo) $menuItem->moduleType = 'url';
186
+			if (!$moduleInfo) $menuItem->moduleType = 'url';
187 187
 			else
188 188
 			{
189
-				if($moduleInfo->mid == $menuItem->url)
189
+				if ($moduleInfo->mid == $menuItem->url)
190 190
 				{
191 191
 					$menuItem->moduleType = $moduleInfo->module;
192 192
 					$menuItem->pageType = $moduleInfo->page_type;
@@ -197,13 +197,13 @@  discard block
 block discarded – undo
197 197
 		else $menuItem->moduleType = 'url';
198 198
 
199 199
 		// grant setting
200
-		if(is_array($menuItem->group_srls) && count($menuItem->group_srls) > 0)
200
+		if (is_array($menuItem->group_srls) && count($menuItem->group_srls) > 0)
201 201
 		{
202
-			if($menuItem->group_srls[0] == -1)
202
+			if ($menuItem->group_srls[0] == -1)
203 203
 			{
204 204
 				$menuItem->grant = 'member';
205 205
 			}
206
-			else if($menuItem->group_srls[0] == -3)
206
+			else if ($menuItem->group_srls[0] == -3)
207 207
 			{
208 208
 				$menuItem->grant = 'manager';
209 209
 			}
@@ -217,21 +217,21 @@  discard block
 block discarded – undo
217 217
 		$oMemberModel = getModel('member');
218 218
 		$oModuleAdminModel = getAdminModel('module');
219 219
 		$output = $oMemberModel->getGroups();
220
-		if(is_array($output))
220
+		if (is_array($output))
221 221
 		{
222 222
 			$groupList = array();
223
-			foreach($output AS $key=>$value)
223
+			foreach ($output AS $key=>$value)
224 224
 			{
225 225
 				$groupList[$value->group_srl] = new stdClass();
226 226
 				$groupList[$value->group_srl]->group_srl = $value->group_srl;
227
-				if(substr($value->title,0,12)=='$user_lang->')
227
+				if (substr($value->title, 0, 12) == '$user_lang->')
228 228
 				{
229 229
 					$tmp = $oModuleAdminModel->getLangCode(0, $value->title);
230 230
 					$groupList[$value->group_srl]->title = $tmp[Context::getLangType()];
231 231
 				}
232 232
 				else $groupList[$value->group_srl]->title = $value->title;
233 233
 
234
-				if(in_array($key, $menuItem->group_srls)) $groupList[$value->group_srl]->isChecked = true;
234
+				if (in_array($key, $menuItem->group_srls)) $groupList[$value->group_srl]->isChecked = true;
235 235
 				else $groupList[$value->group_srl]->isChecked = false;
236 236
 			}
237 237
 		}
@@ -269,10 +269,10 @@  discard block
 block discarded – undo
269 269
 	 */
270 270
 	function getMenuItemNames($source_name, $site_srl = null)
271 271
 	{
272
-		if(!$site_srl)
272
+		if (!$site_srl)
273 273
 		{
274 274
 			$site_module_info = Context::get('site_module_info');
275
-			$site_srl = (int)$site_module_info->site_srl;
275
+			$site_srl = (int) $site_module_info->site_srl;
276 276
 		}
277 277
 		// Get language code
278 278
 		$oModuleAdminModel = getAdminModel('module');
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
 
297 297
 		// Add a sub-menu if there is parent_srl but not menu_item_srl
298 298
 		$item_info = new stdClass;
299
-		if(!$menu_item_srl && $parent_srl)
299
+		if (!$menu_item_srl && $parent_srl)
300 300
 		{
301 301
 			// Get information of the parent menu
302 302
 			$parent_info = $this->getMenuItemInfo($parent_srl);
@@ -309,9 +309,9 @@  discard block
 block discarded – undo
309 309
 		else
310 310
 		{
311 311
 			// Get information of the menu if menu_item_srl exists
312
-			if($menu_item_srl) $item_info = $this->getMenuItemInfo($menu_item_srl);
312
+			if ($menu_item_srl) $item_info = $this->getMenuItemInfo($menu_item_srl);
313 313
 			// Get only menu_item_srl if no values found, considering it as adding a new menu
314
-			if(!$item_info->menu_item_srl)
314
+			if (!$item_info->menu_item_srl)
315 315
 			{
316 316
 				$item_info->menu_item_srl = getNextSequence();
317 317
 			}
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
 		$oTemplate = &TemplateHandler::getInstance();
328 328
 		$tpl = $oTemplate->compile($this->module_path.'tpl', 'menu_item_info');
329 329
 
330
-		$this->add('tpl', str_replace("\n"," ",$tpl));
330
+		$this->add('tpl', str_replace("\n", " ", $tpl));
331 331
 	}
332 332
 
333 333
 	/**
@@ -346,10 +346,10 @@  discard block
 block discarded – undo
346 346
 
347 347
 		Context::loadLang('modules/page/lang');
348 348
 
349
-		foreach($_allModules as $module_name)
349
+		foreach ($_allModules as $module_name)
350 350
 		{
351 351
 			$module = $oModuleModel->getModuleInfoXml($module_name);
352
-			if(!isset($module)) continue;
352
+			if (!isset($module)) continue;
353 353
 			$defaultSkin = $oModuleModel->getModuleDefaultSkin($module_name, 'P');
354 354
 			$defaultMobileSkin = $oModuleModel->getModuleDefaultSkin($module_name, 'M');
355 355
 			$skinInfo = $oModuleModel->loadSkinInfo(ModuleHandler::getModulePath($module_name), $defaultSkin);
@@ -361,10 +361,10 @@  discard block
 block discarded – undo
361 361
 			$module->defaultMobileSkin->skin = $defaultMobileSkin;
362 362
 			$module->defaultMobileSkin->title = $mobileSkinInfo->title ? $mobileSkinInfo->title : $defaultMobileSkin;
363 363
 
364
-			$module->package_srl = $oAutoinstallModel->getPackageSrlByPath('./modules/' . $module_name);
365
-			$module->url = _XE_LOCATION_SITE_ . '?mid=download&package_srl=' . $module->package_srl;
364
+			$module->package_srl = $oAutoinstallModel->getPackageSrlByPath('./modules/'.$module_name);
365
+			$module->url = _XE_LOCATION_SITE_.'?mid=download&package_srl='.$module->package_srl;
366 366
 
367
-			if($module_name == 'page')
367
+			if ($module_name == 'page')
368 368
 			{
369 369
 				$pageTypeName = Context::getLang('page_type_name');
370 370
 				$module->title = $pageTypeName['ARTICLE'];
@@ -401,11 +401,11 @@  discard block
 block discarded – undo
401 401
 		$moduleList = array('page');
402 402
 
403 403
 		$output = $oModuleModel->getModuleListByInstance($site_srl);
404
-		if(is_array($output->data))
404
+		if (is_array($output->data))
405 405
 		{
406
-			foreach($output->data as $value)
406
+			foreach ($output->data as $value)
407 407
 			{
408
-				if($value->instanceCount > 1)
408
+				if ($value->instanceCount > 1)
409 409
 				{
410 410
 					$moduleList[] = $value->module;
411 411
 				}
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
 
415 415
 		// after trigger
416 416
 		$output = ModuleHandler::triggerCall('menu.getModuleListInSitemap', 'after', $moduleList);
417
-		if(!$output->toBool()) return $output;
417
+		if (!$output->toBool()) return $output;
418 418
 
419 419
 		$localModuleList = array_unique($moduleList);
420 420
 
@@ -423,9 +423,9 @@  discard block
 block discarded – undo
423 423
 		// get have instance
424 424
 		$remotePackageList = $oAutoinstallModel->getHaveInstance(array('path'));
425 425
 		$remoteModuleList = array();
426
-		foreach($remotePackageList as $package)
426
+		foreach ($remotePackageList as $package)
427 427
 		{
428
-			if(strpos($package->path, './modules/') !== 0) continue;
428
+			if (strpos($package->path, './modules/') !== 0) continue;
429 429
 
430 430
 			$pathInfo = explode('/', $package->path);
431 431
 			$remoteModuleList[] = $pathInfo[2];
@@ -443,13 +443,13 @@  discard block
 block discarded – undo
443 443
 
444 444
 		$moduleInfoList = array();
445 445
 		Context::loadLang('modules/page/lang');
446
-		if(is_array($moduleList))
446
+		if (is_array($moduleList))
447 447
 		{
448
-			foreach($moduleList as $value)
448
+			foreach ($moduleList as $value)
449 449
 			{
450 450
 				$moduleInfo = $oModuleModel->getModuleInfoXml($value);
451 451
 
452
-				if($value == 'page')
452
+				if ($value == 'page')
453 453
 				{
454 454
 					$pageTypeName = Context::getLang('page_type_name');
455 455
 					$moduleInfo->title = $pageTypeName['ARTICLE'];
@@ -480,10 +480,10 @@  discard block
 block discarded – undo
480 480
 		$siteSrl = Context::get('site_srl');
481 481
 		$menuSrl = Context::get('menu_srl');
482 482
 
483
-		if(!isset($siteSrl))
483
+		if (!isset($siteSrl))
484 484
 		{
485 485
 			$site_module_info = Context::get('site_module_info');
486
-			$siteSrl = (int)$site_module_info->site_srl;
486
+			$siteSrl = (int) $site_module_info->site_srl;
487 487
 		}
488 488
 
489 489
 		$oModuleModel = getModel('module');
@@ -492,24 +492,24 @@  discard block
 block discarded – undo
492 492
 		$start_module = $oModuleModel->getSiteInfo(0, $columnList);
493 493
 
494 494
 		$menuList = array();
495
-		if($menuSrl)
495
+		if ($menuSrl)
496 496
 		{
497 497
 			$isMenuFixed = false;
498 498
 			$output = $this->getMenu($menuSrl);
499
-			$php_file = sprintf(_XE_PATH_ . 'files/cache/menu/%s.php',$output->menu_srl);
500
-			if(file_exists($php_file)) include($php_file);
499
+			$php_file = sprintf(_XE_PATH_.'files/cache/menu/%s.php', $output->menu_srl);
500
+			if (file_exists($php_file)) include($php_file);
501 501
 			else $oMenuAdminController->makeXmlFile($menuSrl);
502 502
 
503
-			if(count($menu->list)>0)
503
+			if (count($menu->list) > 0)
504 504
 			{
505
-				foreach($menu->list AS $key=>$value)
505
+				foreach ($menu->list AS $key=>$value)
506 506
 				{
507
-					$this->_menuInfoSetting($menu->list[$key], $start_module, $isMenuFixed, $menuSrl,$siteSrl);
507
+					$this->_menuInfoSetting($menu->list[$key], $start_module, $isMenuFixed, $menuSrl, $siteSrl);
508 508
 				}
509 509
 			}
510 510
 
511 511
 			// menu recreate
512
-			if($isMenuFixed)
512
+			if ($isMenuFixed)
513 513
 			{
514 514
 				$oMenuAdminController->makeXmlFile($menuSrl);
515 515
 			}
@@ -522,18 +522,18 @@  discard block
 block discarded – undo
522 522
 		else
523 523
 		{
524 524
 			$menuListFromDB = $this->getMenus($siteSrl);
525
-			if(is_array($menuListFromDB))
525
+			if (is_array($menuListFromDB))
526 526
 			{
527 527
 				$oAdmin = getClass('admin');
528
-				foreach($menuListFromDB AS $key=>$value)
528
+				foreach ($menuListFromDB AS $key=>$value)
529 529
 				{
530
-					if($value->title == $oAdmin->getAdminMenuName()) unset($output[$key]);
530
+					if ($value->title == $oAdmin->getAdminMenuName()) unset($output[$key]);
531 531
 					else
532 532
 					{
533 533
 						unset($menu);
534 534
 						unset($menuItems);
535
-						$value->php_file = sprintf(_XE_PATH_ . 'files/cache/menu/%s.php',$value->menu_srl);
536
-						if(!file_exists($value->php_file))
535
+						$value->php_file = sprintf(_XE_PATH_.'files/cache/menu/%s.php', $value->menu_srl);
536
+						if (!file_exists($value->php_file))
537 537
 						{
538 538
 							$oMenuAdminController->makeXmlFile($value->menu_srl);
539 539
 						}
@@ -541,16 +541,16 @@  discard block
 block discarded – undo
541 541
 						include($value->php_file);
542 542
 
543 543
 						$isMenuFixed = false;
544
-						if(count($menu->list) > 0)
544
+						if (count($menu->list) > 0)
545 545
 						{
546
-							foreach($menu->list AS $key2=>$value2)
546
+							foreach ($menu->list AS $key2=>$value2)
547 547
 							{
548
-								$this->_menuInfoSetting($menu->list[$key2], $start_module, $isMenuFixed, $value->menu_srl,$siteSrl);
548
+								$this->_menuInfoSetting($menu->list[$key2], $start_module, $isMenuFixed, $value->menu_srl, $siteSrl);
549 549
 							}
550 550
 						}
551 551
 
552 552
 						// menu recreate
553
-						if($isMenuFixed)
553
+						if ($isMenuFixed)
554 554
 						{
555 555
 							$oMenuAdminController->makeXmlFile($value->menu_srl);
556 556
 						}
@@ -561,7 +561,7 @@  discard block
 block discarded – undo
561 561
 						$menuItems->menuItems = $menu;
562 562
 
563 563
 						// If include home menu, move first
564
-						if($value->menu_srl == $this->menuSrlWithinHome)
564
+						if ($value->menu_srl == $this->menuSrlWithinHome)
565 565
 						{
566 566
 							$menuList[-1] = $menuItems;
567 567
 						}
@@ -584,7 +584,7 @@  discard block
 block discarded – undo
584 584
 	public function getMenuAdminDetailSetup()
585 585
 	{
586 586
 		$menuItemSrl = Context::get('menu_item_srl');
587
-		if(!$menuItemSrl)
587
+		if (!$menuItemSrl)
588 588
 		{
589 589
 			return new Object(-1, 'msg_invalid_request');
590 590
 		}
@@ -592,7 +592,7 @@  discard block
 block discarded – undo
592 592
 		$menuItemInfo = $this->getMenuItemInfo($menuItemSrl);
593 593
 
594 594
 		// if menu is shortcut
595
-		if($menuItemInfo->is_shortcut == 'Y')
595
+		if ($menuItemInfo->is_shortcut == 'Y')
596 596
 		{
597 597
 			return new Object(-1, 'msg_invalid_request');
598 598
 		}
@@ -604,18 +604,18 @@  discard block
 block discarded – undo
604 604
 		// get xml info
605 605
 		$moduleConfInfo = $oModuleModel->getModuleInfoXml($moduleInfo->module);
606 606
 
607
-		if($moduleConfInfo->setup_index_act)
607
+		if ($moduleConfInfo->setup_index_act)
608 608
 		{
609 609
 			$setupUrl = getNotEncodedUrl('', 'module', 'admin', 'act', $moduleConfInfo->setup_index_act, 'module_srl', $moduleInfo->module_srl, 'isLayoutDrop', '1');
610 610
 		}
611 611
 
612
-		if($moduleConfInfo->simple_setup_index_act)
612
+		if ($moduleConfInfo->simple_setup_index_act)
613 613
 		{
614 614
 			$oTargetmoduleAdminModel = getAdminModel($moduleInfo->module);
615 615
 			$advancedSetupUrl = getUrl('', 'module', 'admin', 'act', $moduleConfInfo->setup_index_act, 'module_srl', $moduleInfo->module_srl);
616 616
 			$simpleSetupHtml = $oTargetmoduleAdminModel->{$moduleConfInfo->simple_setup_index_act}($moduleInfo->module_srl, $advancedSetupUrl);
617 617
 
618
-			if($simpleSetupHtml)
618
+			if ($simpleSetupHtml)
619 619
 			{
620 620
 				$this->add('simpleSetupHtml', $simpleSetupHtml);
621 621
 			}
@@ -628,18 +628,18 @@  discard block
 block discarded – undo
628 628
 	 * @param array $menu
629 629
 	 * @return void
630 630
 	 */
631
-	private function _menuInfoSetting(&$menu, &$start_module, &$isMenuFixed, $menuSrl,$siteSrl = 0)
631
+	private function _menuInfoSetting(&$menu, &$start_module, &$isMenuFixed, $menuSrl, $siteSrl = 0)
632 632
 	{
633 633
 		$oModuleModel = getModel('module');
634 634
 		// if url is empty and is_shortcut is 'N', change to is_shortcut 'Y'
635
-		if(!$menu['url'] && $menu['is_shortcut'] == 'N')
635
+		if (!$menu['url'] && $menu['is_shortcut'] == 'N')
636 636
 		{
637 637
 			$menu['is_shortcut'] = 'Y';
638 638
 
639 639
 			$args = new stdClass;
640 640
 			$args->menu_item_srl = $menu['node_srl'];
641 641
 			$args->is_shortcut = 'Y';
642
-			if($menu['menu_name_key']) $args->name = $menu['menu_name_key'];
642
+			if ($menu['menu_name_key']) $args->name = $menu['menu_name_key'];
643 643
 			else $args->name = $menu['menu_name'];
644 644
 			$output = executeQuery('menu.updateMenuItem', $args);
645 645
 
@@ -648,17 +648,17 @@  discard block
 block discarded – undo
648 648
 
649 649
 		//if menu type is module menu
650 650
 		//if(!empty($menu['url']) && !preg_match('/^http/i', $menu['url']))
651
-		if($menu['is_shortcut'] != 'Y')
651
+		if ($menu['is_shortcut'] != 'Y')
652 652
 		{
653 653
 			unset($midInfo, $moduleInfo);
654 654
 			$midInfo = $oModuleModel->getModuleInfoByMid($menu['url'], $siteSrl);
655 655
 			$moduleInfo = $oModuleModel->getModuleInfoXml($midInfo->module);
656 656
 
657
-			if($midInfo)
657
+			if ($midInfo)
658 658
 			{
659 659
 				$menu['module_srl'] = $midInfo->module_srl;
660 660
 				$menu['module'] = $midInfo->module;
661
-				if($midInfo->page_type)
661
+				if ($midInfo->page_type)
662 662
 				{
663 663
 					$menu['module_type'] = $midInfo->page_type;
664 664
 				}
@@ -668,16 +668,16 @@  discard block
 block discarded – undo
668 668
 				}
669 669
 			}
670 670
 
671
-			if($moduleInfo->setup_index_act)
671
+			if ($moduleInfo->setup_index_act)
672 672
 			{
673 673
 				$menu['setup_index_act'] = $moduleInfo->setup_index_act;
674 674
 			}
675
-			else if($moduleInfo->default_index_act)
675
+			else if ($moduleInfo->default_index_act)
676 676
 			{
677 677
 				$menu['setup_index_act'] = $moduleInfo->default_index_act;
678 678
 			}
679 679
 
680
-			if($menu['is_shortcut'] == 'N' && $midInfo->mid == $start_module->mid)
680
+			if ($menu['is_shortcut'] == 'N' && $midInfo->mid == $start_module->mid)
681 681
 			{
682 682
 				$menu['is_start_module'] = true;
683 683
 				$this->menuSrlWithinHome = $menuSrl;
@@ -686,9 +686,9 @@  discard block
 block discarded – undo
686 686
 			$menu['layout_srl'] = $midInfo->layout_srl;
687 687
 			$menu['browser_title'] = $midInfo->browser_title;
688 688
 		}
689
-		if(count($menu['list']) > 0)
689
+		if (count($menu['list']) > 0)
690 690
 		{
691
-			foreach($menu['list'] as $key=>$value)
691
+			foreach ($menu['list'] as $key=>$value)
692 692
 			{
693 693
 				$this->_menuInfoSetting($menu['list'][$key], $start_module, $isMenuFixed, $menuSrl, $siteSrl);
694 694
 			}
Please login to merge, or discard this patch.
modules/menu/menu.mobile.php 3 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -18,6 +18,7 @@
 block discarded – undo
18 18
 
19 19
 	/**
20 20
 	 * Menu depth arrange
21
+	 * @param integer $depth
21 22
 	 * @return void
22 23
 	 */
23 24
 	function straightenMenu($menu_item, $depth)
Please login to merge, or discard this patch.
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -22,14 +22,18 @@  discard block
 block discarded – undo
22 22
 	 */
23 23
 	function straightenMenu($menu_item, $depth)
24 24
 	{
25
-		if(!$menu_item['link']) return;
25
+		if(!$menu_item['link']) {
26
+			return;
27
+		}
26 28
 		$obj = new stdClass;
27 29
 		$obj->href = $menu_item['href'];
28 30
 		$obj->depth = $depth;
29 31
 		$obj->text = $menu_item['text'];
30 32
 		$obj->open_window = $menu_item['open_window'];
31 33
 		$this->result[] = $obj;
32
-		if(!$menu_item['list']) return;
34
+		if(!$menu_item['list']) {
35
+			return;
36
+		}
33 37
 		foreach($menu_item['list'] as $item)
34 38
 		{
35 39
 			$this->straightenMenu($item, $depth+1);
@@ -58,7 +62,9 @@  discard block
 block discarded – undo
58 62
 			$menu_info->php_file = './files/cache/menu/'.$homeMenuSrl.'.php';
59 63
 		}
60 64
 
61
-		if(file_exists($menu_info->php_file)) @include($menu_info->php_file);
65
+		if(file_exists($menu_info->php_file)) {
66
+			@include($menu_info->php_file);
67
+		}
62 68
 		if(is_array($menu->list))
63 69
 		{
64 70
 			foreach($menu->list as $menu_item)
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -22,17 +22,17 @@  discard block
 block discarded – undo
22 22
 	 */
23 23
 	function straightenMenu($menu_item, $depth)
24 24
 	{
25
-		if(!$menu_item['link']) return;
25
+		if (!$menu_item['link']) return;
26 26
 		$obj = new stdClass;
27 27
 		$obj->href = $menu_item['href'];
28 28
 		$obj->depth = $depth;
29 29
 		$obj->text = $menu_item['text'];
30 30
 		$obj->open_window = $menu_item['open_window'];
31 31
 		$this->result[] = $obj;
32
-		if(!$menu_item['list']) return;
33
-		foreach($menu_item['list'] as $item)
32
+		if (!$menu_item['list']) return;
33
+		foreach ($menu_item['list'] as $item)
34 34
 		{
35
-			$this->straightenMenu($item, $depth+1);
35
+			$this->straightenMenu($item, $depth + 1);
36 36
 		}
37 37
 	}
38 38
 
@@ -43,25 +43,25 @@  discard block
 block discarded – undo
43 43
 	function dispMenuMenu()
44 44
 	{
45 45
 		$menu_srl = Context::get('menu_srl');
46
-		$oAdminModel =& getAdminModel('menu');
46
+		$oAdminModel = & getAdminModel('menu');
47 47
 		$menu_info = $oAdminModel->getMenu($menu_srl);
48 48
 
49
-		if(!$menu_srl)
49
+		if (!$menu_srl)
50 50
 		{
51 51
 			$oMenuAdminController = getAdminController('menu');
52 52
 			$homeMenuCacheFile = $oMenuAdminController->getHomeMenuCacheFile();
53 53
 
54
-			if(file_exists($homeMenuCacheFile))
54
+			if (file_exists($homeMenuCacheFile))
55 55
 			{
56 56
 				@include($homeMenuCacheFile);
57 57
 			}
58 58
 			$menu_info->php_file = './files/cache/menu/'.$homeMenuSrl.'.php';
59 59
 		}
60 60
 
61
-		if(file_exists($menu_info->php_file)) @include($menu_info->php_file);
62
-		if(is_array($menu->list))
61
+		if (file_exists($menu_info->php_file)) @include($menu_info->php_file);
62
+		if (is_array($menu->list))
63 63
 		{
64
-			foreach($menu->list as $menu_item)
64
+			foreach ($menu->list as $menu_item)
65 65
 			{
66 66
 				$this->straightenMenu($menu_item, 0);
67 67
 			}
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 
70 70
 		Context::set('menu', $this->result);	
71 71
 
72
-		$this->setTemplatePath(sprintf("%stpl/",$this->module_path));
72
+		$this->setTemplatePath(sprintf("%stpl/", $this->module_path));
73 73
 		$this->setTemplateFile('menu.html');
74 74
 	}
75 75
 }
Please login to merge, or discard this patch.
modules/module/module.admin.controller.php 3 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -260,6 +260,9 @@  discard block
 block discarded – undo
260 260
 		return $module_srl;
261 261
 	}
262 262
 
263
+	/**
264
+	 * @param boolean $isProc
265
+	 */
263 266
 	private function _returnByProc($isProc, $msg='msg_invalid_request')
264 267
 	{
265 268
 		if(!$isProc)
@@ -938,6 +941,9 @@  discard block
 block discarded – undo
938 941
 
939 942
 	}
940 943
 
944
+	/**
945
+	 * @param string $skinVars
946
+	 */
941 947
 	public function setDesignInfo($moduleSrl = 0, $mid = '', $skinType = 'P', $layoutSrl = 0, $isSkinFix = 'Y', $skinName = '', $skinVars = NULL)
942 948
 	{
943 949
 		if(!$moduleSrl && !$mid)
Please login to merge, or discard this patch.
Braces   +155 added lines, -79 removed lines patch added patch discarded remove patch
@@ -22,7 +22,9 @@  discard block
 block discarded – undo
22 22
 		$args = new stdClass();
23 23
 		$args->title = Context::get('title');
24 24
 		$output = executeQuery('module.insertModuleCategory', $args);
25
-		if(!$output->toBool()) return $output;
25
+		if(!$output->toBool()) {
26
+			return $output;
27
+		}
26 28
 
27 29
 		$this->setMessage("success_registed");
28 30
 
@@ -36,7 +38,9 @@  discard block
 block discarded – undo
36 38
 	function procModuleAdminUpdateCategory()
37 39
 	{
38 40
 		$output = $this->doUpdateModuleCategory();
39
-		if(!$output->toBool()) return $output;
41
+		if(!$output->toBool()) {
42
+			return $output;
43
+		}
40 44
 
41 45
 		$this->setMessage('success_updated');
42 46
 
@@ -50,7 +54,9 @@  discard block
 block discarded – undo
50 54
 	function procModuleAdminDeleteCategory()
51 55
 	{
52 56
 		$output = $this->doDeleteModuleCategory();
53
-		if(!$output->toBool()) return $output;
57
+		if(!$output->toBool()) {
58
+			return $output;
59
+		}
54 60
 
55 61
 		$this->setMessage('success_deleted');
56 62
 
@@ -91,8 +97,7 @@  discard block
 block discarded – undo
91 97
 			// Get information of the target module to copy
92 98
 			$module_srl = Context::get('module_srl');
93 99
 			$args = Context::getRequestVars();
94
-		}
95
-		else
100
+		} else
96 101
 		{
97 102
 			$module_srl = $args->module_srl;
98 103
 		}
@@ -107,11 +112,19 @@  discard block
 block discarded – undo
107 112
 		for($i=1;$i<=10;$i++)
108 113
 		{
109 114
 			$mid = trim($args->{"mid_".$i});
110
-			if(!$mid) continue;
111
-			if(!preg_match("/^[a-zA-Z]([a-zA-Z0-9_]*)$/i", $mid)) return new Object(-1, 'msg_limit_mid');
115
+			if(!$mid) {
116
+				continue;
117
+			}
118
+			if(!preg_match("/^[a-zA-Z]([a-zA-Z0-9_]*)$/i", $mid)) {
119
+				return new Object(-1, 'msg_limit_mid');
120
+			}
112 121
 			$browser_title = $args->{"browser_title_".$i};
113
-			if(!$mid) continue;
114
-			if($mid && !$browser_title) $browser_title = $mid;
122
+			if(!$mid) {
123
+				continue;
124
+			}
125
+			if($mid && !$browser_title) {
126
+				$browser_title = $mid;
127
+			}
115 128
 			$clones[$mid] = $browser_title;
116 129
 		}
117 130
 		if(count($clones) < 1)
@@ -131,7 +144,9 @@  discard block
 block discarded – undo
131 144
 		$grant = array();
132 145
 		if($output->data)
133 146
 		{
134
-			foreach($output->data as $val) $grant[$val->name][] = $val->group_srl;
147
+			foreach($output->data as $val) {
148
+				$grant[$val->name][] = $val->group_srl;
149
+			}
135 150
 		}
136 151
 
137 152
 		// get Extra Vars
@@ -218,11 +233,19 @@  discard block
 block discarded – undo
218 233
 			}
219 234
 
220 235
 			// Grant module permissions
221
-			if(count($grant) > 0) $oModuleController->insertModuleGrants($module_srl, $grant);
222
-			if($extra_vars) $oModuleController->insertModuleExtraVars($module_srl, $extra_vars);
236
+			if(count($grant) > 0) {
237
+				$oModuleController->insertModuleGrants($module_srl, $grant);
238
+			}
239
+			if($extra_vars) {
240
+				$oModuleController->insertModuleExtraVars($module_srl, $extra_vars);
241
+			}
223 242
 
224
-			if($moduleSkinVars) $oModuleController->insertModuleSkinVars($module_srl, $moduleSkinVars);
225
-			if($moduleMobileSkinVars) $oModuleController->insertModuleMobileSkinVars($module_srl, $moduleMobileSkinVars);
243
+			if($moduleSkinVars) {
244
+				$oModuleController->insertModuleSkinVars($module_srl, $moduleSkinVars);
245
+			}
246
+			if($moduleMobileSkinVars) {
247
+				$oModuleController->insertModuleMobileSkinVars($module_srl, $moduleMobileSkinVars);
248
+			}
226 249
 
227 250
 			$triggerObj->moduleSrlList[] = $module_srl;
228 251
 		}
@@ -235,8 +258,7 @@  discard block
 block discarded – undo
235 258
 		{
236 259
 			$message = implode('\n', $errorLog);
237 260
 			$this->setMessage($message);
238
-		}
239
-		else
261
+		} else
240 262
 		{
241 263
 			$message = $lang->success_registed;
242 264
 			$this->setMessage('success_registed');
@@ -262,9 +284,9 @@  discard block
 block discarded – undo
262 284
 
263 285
 	private function _returnByProc($isProc, $msg='msg_invalid_request')
264 286
 	{
265
-		if(!$isProc)
266
-			return;
267
-		else
287
+		if(!$isProc) {
288
+					return;
289
+		} else
268 290
 		{
269 291
 			return new Object(-1, $msg);
270 292
 		}
@@ -282,7 +304,9 @@  discard block
 block discarded – undo
282 304
 		// Get information of the module
283 305
 		$columnList = array('module_srl', 'module');
284 306
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
285
-		if(!$module_info) return new Object(-1,'msg_invalid_request');
307
+		if(!$module_info) {
308
+			return new Object(-1,'msg_invalid_request');
309
+		}
286 310
 		// Register Admin ID
287 311
 		$oModuleController->deleteAdminId($module_srl);
288 312
 		$admin_member = Context::get('admin_member');
@@ -292,7 +316,9 @@  discard block
 block discarded – undo
292 316
 			foreach($admin_members as $admin_id)
293 317
 			{
294 318
 				$admin_id = trim($admin_id);
295
-				if(!$admin_id) continue;
319
+				if(!$admin_id) {
320
+					continue;
321
+				}
296 322
 				$oModuleController->insertAdminId($module_srl, $admin_id);
297 323
 			}
298 324
 		}
@@ -318,15 +344,18 @@  discard block
 block discarded – undo
318 344
 				$grant->{$grant_name}[] = $default;
319 345
 				continue;
320 346
 				// users in a particular group
321
-			}
322
-			else
347
+			} else
323 348
 			{
324 349
 				$group_srls = Context::get($grant_name);
325 350
 				if($group_srls)
326 351
 				{
327
-					if(strpos($group_srls,'|@|')!==false) $group_srls = explode('|@|',$group_srls);
328
-					elseif(strpos($group_srls,',')!==false) $group_srls = explode(',',$group_srls);
329
-					else $group_srls = array($group_srls);
352
+					if(strpos($group_srls,'|@|')!==false) {
353
+						$group_srls = explode('|@|',$group_srls);
354
+					} elseif(strpos($group_srls,',')!==false) {
355
+						$group_srls = explode(',',$group_srls);
356
+					} else {
357
+						$group_srls = array($group_srls);
358
+					}
330 359
 					$grant->{$grant_name} = $group_srls;
331 360
 				}
332 361
 				continue;
@@ -338,7 +367,9 @@  discard block
 block discarded – undo
338 367
 		$args = new stdClass();
339 368
 		$args->module_srl = $module_srl;
340 369
 		$output = executeQuery('module.deleteModuleGrants', $args);
341
-		if(!$output->toBool()) return $output;
370
+		if(!$output->toBool()) {
371
+			return $output;
372
+		}
342 373
 		// Permissions stored in the DB
343 374
 		foreach($grant as $grant_name => $group_srls)
344 375
 		{
@@ -349,7 +380,9 @@  discard block
 block discarded – undo
349 380
 				$args->name = $grant_name;
350 381
 				$args->group_srl = $val;
351 382
 				$output = executeQuery('module.insertModuleGrant', $args);
352
-				if(!$output->toBool()) return $output;
383
+				if(!$output->toBool()) {
384
+					return $output;
385
+				}
353 386
 			}
354 387
 		}
355 388
 		$this->setMessage('success_registed');
@@ -375,19 +408,16 @@  discard block
 block discarded – undo
375 408
 				if($module_info->is_mskin_fix == 'Y')
376 409
 				{
377 410
 					$skin = $module_info->mskin;
378
-				}
379
-				else
411
+				} else
380 412
 				{
381 413
 					$skin = $oModuleModel->getModuleDefaultSkin($module_info->module, 'M');
382 414
 				}
383
-			}
384
-			else
415
+			} else
385 416
 			{
386 417
 				if($module_info->is_skin_fix == 'Y')
387 418
 				{
388 419
 					$skin = $module_info->skin;
389
-				}
390
-				else
420
+				} else
391 421
 				{
392 422
 					$skin = $oModuleModel->getModuleDefaultSkin($module_info->module, 'P');
393 423
 				}
@@ -400,8 +430,7 @@  discard block
 block discarded – undo
400 430
 			{
401 431
 				$skin_info = $oModuleModel->loadSkinInfo($module_path, $skin, 'm.skins');
402 432
 				$skin_vars = $oModuleModel->getModuleMobileSkinVars($module_srl);
403
-			}
404
-			else
433
+			} else
405 434
 			{
406 435
 				$skin_info = $oModuleModel->loadSkinInfo($module_path, $skin);
407 436
 				$skin_vars = $oModuleModel->getModuleSkinVars($module_srl);
@@ -421,7 +450,9 @@  discard block
 block discarded – undo
421 450
 			{
422 451
 				foreach($skin_info->extra_vars as $vars)
423 452
 				{
424
-					if($vars->type!='image') continue;
453
+					if($vars->type!='image') {
454
+						continue;
455
+					}
425 456
 
426 457
 					$image_obj = $obj->{$vars->name};
427 458
 					// Get a variable to delete
@@ -453,7 +484,9 @@  discard block
 block discarded – undo
453 484
 					// Upload the file to a path
454 485
 					$path = sprintf("./files/attach/images/%s/", $module_srl);
455 486
 					// Create a directory
456
-					if(!FileHandler::makeDir($path)) return false;
487
+					if(!FileHandler::makeDir($path)) {
488
+						return false;
489
+					}
457 490
 
458 491
 					$filename = $path.$image_obj['name'];
459 492
 					// Move the file
@@ -484,8 +517,7 @@  discard block
 block discarded – undo
484 517
 			if($mode === 'M')
485 518
 			{
486 519
 				$output = $oModuleController->insertModuleMobileSkinVars($module_srl, $obj);
487
-			}
488
-			else
520
+			} else
489 521
 			{
490 522
 				$output = $oModuleController->insertModuleSkinVars($module_srl, $obj);
491 523
 			}
@@ -506,10 +538,14 @@  discard block
 block discarded – undo
506 538
 	{
507 539
 		$vars = Context::getRequestVars();
508 540
 
509
-		if(!$vars->module_srls) return new Object(-1,'msg_invalid_request');
541
+		if(!$vars->module_srls) {
542
+			return new Object(-1,'msg_invalid_request');
543
+		}
510 544
 
511 545
 		$module_srls = explode(',',$vars->module_srls);
512
-		if(count($module_srls) < 1) return new Object(-1,'msg_invalid_request');
546
+		if(count($module_srls) < 1) {
547
+			return new Object(-1,'msg_invalid_request');
548
+		}
513 549
 
514 550
 		$oModuleModel = getModel('module');
515 551
 		$oModuleController= getController('module');
@@ -541,8 +577,7 @@  discard block
 block discarded – undo
541 577
 			if(Context::get('success_return_url'))
542 578
 			{
543 579
 				$this->setRedirectUrl(Context::get('success_return_url'));
544
-			}
545
-			else
580
+			} else
546 581
 			{
547 582
 				global $lang;
548 583
 				htmlHeader();
@@ -561,10 +596,14 @@  discard block
 block discarded – undo
561 596
 	function procModuleAdminModuleGrantSetup()
562 597
 	{
563 598
 		$module_srls = Context::get('module_srls');
564
-		if(!$module_srls) return new Object(-1,'msg_invalid_request');
599
+		if(!$module_srls) {
600
+			return new Object(-1,'msg_invalid_request');
601
+		}
565 602
 
566 603
 		$modules = explode(',',$module_srls);
567
-		if(count($modules) < 1) return new Object(-1,'msg_invalid_request');
604
+		if(count($modules) < 1) {
605
+			return new Object(-1,'msg_invalid_request');
606
+		}
568 607
 
569 608
 		$oModuleController = getController('module');
570 609
 		$oModuleModel = getModel('module');
@@ -592,17 +631,20 @@  discard block
 block discarded – undo
592 631
 				$grant->{$grant_name}[] = $default;
593 632
 				continue;
594 633
 				// Users in a particular group
595
-			}
596
-			else
634
+			} else
597 635
 			{
598 636
 				$group_srls = Context::get($grant_name);
599 637
 				if($group_srls)
600 638
 				{
601 639
 					if(!is_array($group_srls))
602 640
 					{
603
-						if(strpos($group_srls,'|@|')!==false) $group_srls = explode('|@|',$group_srls);
604
-						elseif(strpos($group_srls,',')!==false) $group_srls = explode(',',$group_srls);
605
-						else $group_srls = array($group_srls);
641
+						if(strpos($group_srls,'|@|')!==false) {
642
+							$group_srls = explode('|@|',$group_srls);
643
+						} elseif(strpos($group_srls,',')!==false) {
644
+							$group_srls = explode(',',$group_srls);
645
+						} else {
646
+							$group_srls = array($group_srls);
647
+						}
606 648
 					}
607 649
 					$grant->{$grant_name} = $group_srls;
608 650
 				}
@@ -617,7 +659,9 @@  discard block
 block discarded – undo
617 659
 			$args = new stdClass();
618 660
 			$args->module_srl = $module_srl;
619 661
 			$output = executeQuery('module.deleteModuleGrants', $args);
620
-			if(!$output->toBool()) continue;
662
+			if(!$output->toBool()) {
663
+				continue;
664
+			}
621 665
 			// Permissions stored in the DB
622 666
 			foreach($grant as $grant_name => $group_srls)
623 667
 			{
@@ -628,7 +672,9 @@  discard block
 block discarded – undo
628 672
 					$args->name = $grant_name;
629 673
 					$args->group_srl = $val;
630 674
 					$output = executeQuery('module.insertModuleGrant', $args);
631
-					if(!$output->toBool()) return $output;
675
+					if(!$output->toBool()) {
676
+						return $output;
677
+					}
632 678
 				}
633 679
 			}
634 680
 		}
@@ -638,8 +684,7 @@  discard block
 block discarded – undo
638 684
 			if(Context::get('success_return_url'))
639 685
 			{
640 686
 				$this->setRedirectUrl(Context::get('success_return_url'));
641
-			}
642
-			else
687
+			} else
643 688
 			{
644 689
 				global $lang;
645 690
 				htmlHeader();
@@ -665,18 +710,30 @@  discard block
 block discarded – undo
665 710
 		$args->site_srl = (int)$site_module_info->site_srl;
666 711
 		$args->name = str_replace(' ','_',Context::get('lang_code'));
667 712
 		$args->lang_name = str_replace(' ','_',Context::get('lang_name'));
668
-		if(!empty($args->lang_name)) $args->name = $args->lang_name;
713
+		if(!empty($args->lang_name)) {
714
+			$args->name = $args->lang_name;
715
+		}
669 716
 
670 717
 		// if args->name is empty, random generate for user define language
671
-		if(empty($args->name)) $args->name = 'userLang'.date('YmdHis').''.sprintf('%03d', mt_rand(0, 100));
718
+		if(empty($args->name)) {
719
+			$args->name = 'userLang'.date('YmdHis').''.sprintf('%03d', mt_rand(0, 100));
720
+		}
672 721
 
673
-		if(!$args->name) return new Object(-1,'msg_invalid_request');
722
+		if(!$args->name) {
723
+			return new Object(-1,'msg_invalid_request');
724
+		}
674 725
 		// Check whether a language code exists
675 726
 		$output = executeQueryArray('module.getLang', $args);
676
-		if(!$output->toBool()) return $output;
727
+		if(!$output->toBool()) {
728
+			return $output;
729
+		}
677 730
 		// If exists, clear the old values for updating
678
-		if($output->data) $output = executeQuery('module.deleteLang', $args);
679
-		if(!$output->toBool()) return $output;
731
+		if($output->data) {
732
+			$output = executeQuery('module.deleteLang', $args);
733
+		}
734
+		if(!$output->toBool()) {
735
+			return $output;
736
+		}
680 737
 		// Enter
681 738
 		$lang_supported = Context::get('lang_supported');
682 739
 		foreach($lang_supported as $key => $val)
@@ -693,7 +750,9 @@  discard block
 block discarded – undo
693 750
 			if($args->value)
694 751
 			{
695 752
 				$output = executeQuery('module.insertLang', $args);
696
-				if(!$output->toBool()) return $output;
753
+				if(!$output->toBool()) {
754
+					return $output;
755
+				}
697 756
 			}
698 757
 		}
699 758
 		$this->makeCacheDefinedLangCode($args->site_srl);
@@ -716,11 +775,17 @@  discard block
 block discarded – undo
716 775
 		$args->site_srl = (int)$site_module_info->site_srl;
717 776
 		$args->name = str_replace(' ','_',Context::get('name'));
718 777
 		$args->lang_name = str_replace(' ','_',Context::get('lang_name'));
719
-		if(!empty($args->lang_name)) $args->name = $args->lang_name;
720
-		if(!$args->name) return new Object(-1,'msg_invalid_request');
778
+		if(!empty($args->lang_name)) {
779
+			$args->name = $args->lang_name;
780
+		}
781
+		if(!$args->name) {
782
+			return new Object(-1,'msg_invalid_request');
783
+		}
721 784
 
722 785
 		$output = executeQuery('module.deleteLang', $args);
723
-		if(!$output->toBool()) return $output;
786
+		if(!$output->toBool()) {
787
+			return $output;
788
+		}
724 789
 		$this->makeCacheDefinedLangCode($args->site_srl);
725 790
 
726 791
 		$this->setMessage("success_deleted", 'info');
@@ -731,7 +796,9 @@  discard block
 block discarded – undo
731 796
 
732 797
 	function procModuleAdminGetList()
733 798
 	{
734
-		if(!Context::get('is_logged')) return new Object(-1, 'msg_not_permitted');
799
+		if(!Context::get('is_logged')) {
800
+			return new Object(-1, 'msg_not_permitted');
801
+		}
735 802
 
736 803
 		$oModuleController = getController('module');
737 804
 		$oModuleModel = getModel('module');
@@ -744,14 +811,20 @@  discard block
 block discarded – undo
744 811
 		$args = new stdClass;
745 812
 		$logged_info = Context::get('logged_info');
746 813
 		$site_module_info = Context::get('site_module_info');
747
-		if($site_keyword) $args->site_keyword = $site_keyword;
814
+		if($site_keyword) {
815
+			$args->site_keyword = $site_keyword;
816
+		}
748 817
 
749 818
 		if(!$site_srl)
750 819
 		{
751
-			if($logged_info->is_admin == 'Y' && !$site_keyword && !$vid) $args->site_srl = 0;
752
-			else $args->site_srl = (int)$site_module_info->site_srl;
820
+			if($logged_info->is_admin == 'Y' && !$site_keyword && !$vid) {
821
+				$args->site_srl = 0;
822
+			} else {
823
+				$args->site_srl = (int)$site_module_info->site_srl;
824
+			}
825
+		} else {
826
+			$args->site_srl = $site_srl;
753 827
 		}
754
-		else $args->site_srl = $site_srl;
755 828
 
756 829
 		$args->sort_index1 = 'sites.domain';
757 830
 
@@ -764,7 +837,9 @@  discard block
 block discarded – undo
764 837
 			foreach($output->data as $val)
765 838
 			{
766 839
 				$module = trim($val->module);
767
-				if(!$module) continue;
840
+				if(!$module) {
841
+					continue;
842
+				}
768 843
 
769 844
 				// replace user defined lang.
770 845
 				$oModuleController->replaceDefinedLangCode($val->browser_title);
@@ -800,7 +875,9 @@  discard block
 block discarded – undo
800 875
 		{
801 876
 			foreach($mid_list as $module => $val)
802 877
 			{
803
-				if(!$selected_module) $selected_module = $module;
878
+				if(!$selected_module) {
879
+					$selected_module = $module;
880
+				}
804 881
 				$xml_info = $oModuleModel->getModuleInfoXml($module);
805 882
 
806 883
 				if(!$xml_info)
@@ -823,8 +900,7 @@  discard block
 block discarded – undo
823 900
 							{
824 901
 								$mid_list[$module]->list[$key]->module_category_srl = $categoryNameList[$categorySrl];
825 902
 							}
826
-						}
827
-						else
903
+						} else
828 904
 						{
829 905
 							$mid_list[$module]->list[$key]->module_category_srl = Context::getLang('none_category');
830 906
 						}
@@ -851,13 +927,14 @@  discard block
 block discarded – undo
851 927
 		{
852 928
 			$site_module_info = Context::get('site_module_info');
853 929
 			$args->site_srl = (int)$site_module_info->site_srl;
854
-		}
855
-		else
930
+		} else
856 931
 		{
857 932
 			$args->site_srl = $site_srl;
858 933
 		}
859 934
 		$output = executeQueryArray('module.getLang', $args);
860
-		if(!$output->toBool() || !$output->data) return;
935
+		if(!$output->toBool() || !$output->data) {
936
+			return;
937
+		}
861 938
 		// Set the cache directory
862 939
 		$cache_path = _XE_PATH_.'files/cache/lang_defined/';
863 940
 		FileHandler::makeDir($cache_path);
@@ -950,8 +1027,7 @@  discard block
 block discarded – undo
950 1027
 		if($mid)
951 1028
 		{
952 1029
 			$moduleInfo = $oModuleModel->getModuleInfoByMid($mid);
953
-		}
954
-		else
1030
+		} else
955 1031
 		{
956 1032
 			$moduleInfo = $oModuleModel->getModuleInfoByModuleSrl($moduleSrl);
957 1033
 		}
Please login to merge, or discard this patch.
Spacing   +153 added lines, -153 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 		$args = new stdClass();
23 23
 		$args->title = Context::get('title');
24 24
 		$output = executeQuery('module.insertModuleCategory', $args);
25
-		if(!$output->toBool()) return $output;
25
+		if (!$output->toBool()) return $output;
26 26
 
27 27
 		$this->setMessage("success_registed");
28 28
 
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 	function procModuleAdminUpdateCategory()
37 37
 	{
38 38
 		$output = $this->doUpdateModuleCategory();
39
-		if(!$output->toBool()) return $output;
39
+		if (!$output->toBool()) return $output;
40 40
 
41 41
 		$this->setMessage('success_updated');
42 42
 
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 	function procModuleAdminDeleteCategory()
51 51
 	{
52 52
 		$output = $this->doDeleteModuleCategory();
53
-		if(!$output->toBool()) return $output;
53
+		if (!$output->toBool()) return $output;
54 54
 
55 55
 		$this->setMessage('success_deleted');
56 56
 
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 	function procModuleAdminCopyModule($args = NULL)
86 86
 	{
87 87
 		$isProc = false;
88
-		if(!$args)
88
+		if (!$args)
89 89
 		{
90 90
 			$isProc = true;
91 91
 			// Get information of the target module to copy
@@ -97,24 +97,24 @@  discard block
 block discarded – undo
97 97
 			$module_srl = $args->module_srl;
98 98
 		}
99 99
 
100
-		if(!$module_srl)
100
+		if (!$module_srl)
101 101
 		{
102 102
 			return $this->_returnByProc($isProc);
103 103
 		}
104 104
 
105 105
 		// Get module name to create and browser title
106 106
 		$clones = array();
107
-		for($i=1;$i<=10;$i++)
107
+		for ($i = 1; $i <= 10; $i++)
108 108
 		{
109 109
 			$mid = trim($args->{"mid_".$i});
110
-			if(!$mid) continue;
111
-			if(!preg_match("/^[a-zA-Z]([a-zA-Z0-9_]*)$/i", $mid)) return new Object(-1, 'msg_limit_mid');
110
+			if (!$mid) continue;
111
+			if (!preg_match("/^[a-zA-Z]([a-zA-Z0-9_]*)$/i", $mid)) return new Object(-1, 'msg_limit_mid');
112 112
 			$browser_title = $args->{"browser_title_".$i};
113
-			if(!$mid) continue;
114
-			if($mid && !$browser_title) $browser_title = $mid;
113
+			if (!$mid) continue;
114
+			if ($mid && !$browser_title) $browser_title = $mid;
115 115
 			$clones[$mid] = $browser_title;
116 116
 		}
117
-		if(count($clones) < 1)
117
+		if (count($clones) < 1)
118 118
 		{
119 119
 			return $this->_returnByProc($isProc);
120 120
 		}
@@ -129,9 +129,9 @@  discard block
 block discarded – undo
129 129
 		$module_args->module_srl = $module_srl;
130 130
 		$output = executeQueryArray('module.getModuleGrants', $module_args);
131 131
 		$grant = array();
132
-		if($output->data)
132
+		if ($output->data)
133 133
 		{
134
-			foreach($output->data as $val) $grant[$val->name][] = $val->group_srl;
134
+			foreach ($output->data as $val) $grant[$val->name][] = $val->group_srl;
135 135
 		}
136 136
 
137 137
 		// get Extra Vars
@@ -139,9 +139,9 @@  discard block
 block discarded – undo
139 139
 		$extra_args->module_srl = $module_srl;
140 140
 		$extra_output = executeQueryArray('module.getModuleExtraVars', $extra_args);
141 141
 		$extra_vars = new stdClass();
142
-		if($extra_output->toBool() && is_array($extra_output->data))
142
+		if ($extra_output->toBool() && is_array($extra_output->data))
143 143
 		{
144
-			foreach($extra_output->data as $info)
144
+			foreach ($extra_output->data as $info)
145 145
 			{
146 146
 				$extra_vars->{$info->name} = $info->value;
147 147
 			}
@@ -150,17 +150,17 @@  discard block
 block discarded – undo
150 150
 		$tmpModuleSkinVars = $oModuleModel->getModuleSkinVars($module_srl);
151 151
 		$tmpModuleMobileSkinVars = $oModuleModel->getModuleMobileSkinVars($module_srl);
152 152
 
153
-		if($tmpModuleSkinVars)
153
+		if ($tmpModuleSkinVars)
154 154
 		{
155
-			foreach($tmpModuleSkinVars as $key=>$value)
155
+			foreach ($tmpModuleSkinVars as $key=>$value)
156 156
 			{
157 157
 				$moduleSkinVars->{$key} = $value->value;
158 158
 			}
159 159
 		}
160 160
 
161
-		if($tmpModuleMobileSkinVars)
161
+		if ($tmpModuleMobileSkinVars)
162 162
 		{
163
-			foreach($tmpModuleMobileSkinVars as $key=>$value)
163
+			foreach ($tmpModuleMobileSkinVars as $key=>$value)
164 164
 			{
165 165
 				$moduleMobileSkinVars->{$key} = $value->value;
166 166
 			}
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 		$triggerObj->moduleSrlList = array();
175 175
 
176 176
 		$errorLog = array();
177
-		foreach($clones as $mid => $browser_title)
177
+		foreach ($clones as $mid => $browser_title)
178 178
 		{
179 179
 			$clone_args = new stdClass;
180 180
 			$clone_args = clone $module_info;
@@ -188,29 +188,29 @@  discard block
 block discarded – undo
188 188
 			// Create a module
189 189
 			$output = $oModuleController->insertModule($clone_args);
190 190
 
191
-			if(!$output->toBool())
191
+			if (!$output->toBool())
192 192
 			{
193
-				$errorLog[] = $mid . ' : '. $output->message;
193
+				$errorLog[] = $mid.' : '.$output->message;
194 194
 				continue;
195 195
 			}
196 196
 			$module_srl = $output->get('module_srl');
197 197
 
198
-			if($module_info->module == 'page' && $extra_vars->page_type == 'ARTICLE')
198
+			if ($module_info->module == 'page' && $extra_vars->page_type == 'ARTICLE')
199 199
 			{
200 200
 				// copy document
201 201
 				$oDocumentAdminController = getAdminController('document');
202 202
 				$copyOutput = $oDocumentAdminController->copyDocumentModule(array($extra_vars->document_srl), $module_srl, $module_info->category_srl);
203 203
 				$document_srls = $copyOutput->get('copied_srls');
204
-				if($document_srls && count($document_srls) > 0)
204
+				if ($document_srls && count($document_srls) > 0)
205 205
 				{
206 206
 					$extra_vars->document_srl = array_pop($document_srls);
207 207
 				}
208 208
 
209
-				if($extra_vars->mdocument_srl)
209
+				if ($extra_vars->mdocument_srl)
210 210
 				{
211 211
 					$copyOutput = $oDocumentAdminController->copyDocumentModule(array($extra_vars->mdocument_srl), $module_srl, $module_info->category_srl);
212 212
 					$copiedSrls = $copyOutput->get('copied_srls');
213
-					if($copiedSrls && count($copiedSrls) > 0)
213
+					if ($copiedSrls && count($copiedSrls) > 0)
214 214
 					{
215 215
 						$extra_vars->mdocument_srl = array_pop($copiedSrls);
216 216
 					}
@@ -218,11 +218,11 @@  discard block
 block discarded – undo
218 218
 			}
219 219
 
220 220
 			// Grant module permissions
221
-			if(count($grant) > 0) $oModuleController->insertModuleGrants($module_srl, $grant);
222
-			if($extra_vars) $oModuleController->insertModuleExtraVars($module_srl, $extra_vars);
221
+			if (count($grant) > 0) $oModuleController->insertModuleGrants($module_srl, $grant);
222
+			if ($extra_vars) $oModuleController->insertModuleExtraVars($module_srl, $extra_vars);
223 223
 
224
-			if($moduleSkinVars) $oModuleController->insertModuleSkinVars($module_srl, $moduleSkinVars);
225
-			if($moduleMobileSkinVars) $oModuleController->insertModuleMobileSkinVars($module_srl, $moduleMobileSkinVars);
224
+			if ($moduleSkinVars) $oModuleController->insertModuleSkinVars($module_srl, $moduleSkinVars);
225
+			if ($moduleMobileSkinVars) $oModuleController->insertModuleMobileSkinVars($module_srl, $moduleMobileSkinVars);
226 226
 
227 227
 			$triggerObj->moduleSrlList[] = $module_srl;
228 228
 		}
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 
232 232
 		$oDB->commit();
233 233
 
234
-		if(count($errorLog) > 0)
234
+		if (count($errorLog) > 0)
235 235
 		{
236 236
 			$message = implode('\n', $errorLog);
237 237
 			$this->setMessage($message);
@@ -242,9 +242,9 @@  discard block
 block discarded – undo
242 242
 			$this->setMessage('success_registed');
243 243
 		}
244 244
 
245
-		if($isProc)
245
+		if ($isProc)
246 246
 		{
247
-			if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON')))
247
+			if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON')))
248 248
 			{
249 249
 				global $lang;
250 250
 				htmlHeader();
@@ -260,9 +260,9 @@  discard block
 block discarded – undo
260 260
 		return $module_srl;
261 261
 	}
262 262
 
263
-	private function _returnByProc($isProc, $msg='msg_invalid_request')
263
+	private function _returnByProc($isProc, $msg = 'msg_invalid_request')
264 264
 	{
265
-		if(!$isProc)
265
+		if (!$isProc)
266 266
 			return;
267 267
 		else
268 268
 		{
@@ -282,17 +282,17 @@  discard block
 block discarded – undo
282 282
 		// Get information of the module
283 283
 		$columnList = array('module_srl', 'module');
284 284
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
285
-		if(!$module_info) return new Object(-1,'msg_invalid_request');
285
+		if (!$module_info) return new Object(-1, 'msg_invalid_request');
286 286
 		// Register Admin ID
287 287
 		$oModuleController->deleteAdminId($module_srl);
288 288
 		$admin_member = Context::get('admin_member');
289
-		if($admin_member)
289
+		if ($admin_member)
290 290
 		{
291
-			$admin_members = explode(',',$admin_member);
292
-			foreach($admin_members as $admin_id)
291
+			$admin_members = explode(',', $admin_member);
292
+			foreach ($admin_members as $admin_id)
293 293
 			{
294 294
 				$admin_id = trim($admin_id);
295
-				if(!$admin_id) continue;
295
+				if (!$admin_id) continue;
296 296
 				$oModuleController->insertAdminId($module_srl, $admin_id);
297 297
 			}
298 298
 		}
@@ -307,13 +307,13 @@  discard block
 block discarded – undo
307 307
 		$grant_list->manager->default = 'manager';
308 308
 
309 309
 		$grant = new stdClass();
310
-		foreach($grant_list as $grant_name => $grant_info)
310
+		foreach ($grant_list as $grant_name => $grant_info)
311 311
 		{
312 312
 			// Get the default value
313 313
 			$default = Context::get($grant_name.'_default');
314 314
 			// -1 = Log-in user only, -2 = site members only, -3 = manager only, 0 = all users
315 315
 			$grant->{$grant_name} = array();
316
-			if(strlen($default))
316
+			if (strlen($default))
317 317
 			{
318 318
 				$grant->{$grant_name}[] = $default;
319 319
 				continue;
@@ -322,10 +322,10 @@  discard block
 block discarded – undo
322 322
 			else
323 323
 			{
324 324
 				$group_srls = Context::get($grant_name);
325
-				if($group_srls)
325
+				if ($group_srls)
326 326
 				{
327
-					if(strpos($group_srls,'|@|')!==false) $group_srls = explode('|@|',$group_srls);
328
-					elseif(strpos($group_srls,',')!==false) $group_srls = explode(',',$group_srls);
327
+					if (strpos($group_srls, '|@|') !== false) $group_srls = explode('|@|', $group_srls);
328
+					elseif (strpos($group_srls, ',') !== false) $group_srls = explode(',', $group_srls);
329 329
 					else $group_srls = array($group_srls);
330 330
 					$grant->{$grant_name} = $group_srls;
331 331
 				}
@@ -338,18 +338,18 @@  discard block
 block discarded – undo
338 338
 		$args = new stdClass();
339 339
 		$args->module_srl = $module_srl;
340 340
 		$output = executeQuery('module.deleteModuleGrants', $args);
341
-		if(!$output->toBool()) return $output;
341
+		if (!$output->toBool()) return $output;
342 342
 		// Permissions stored in the DB
343
-		foreach($grant as $grant_name => $group_srls)
343
+		foreach ($grant as $grant_name => $group_srls)
344 344
 		{
345
-			foreach($group_srls as $val)
345
+			foreach ($group_srls as $val)
346 346
 			{
347 347
 				$args = new stdClass();
348 348
 				$args->module_srl = $module_srl;
349 349
 				$args->name = $grant_name;
350 350
 				$args->group_srl = $val;
351 351
 				$output = executeQuery('module.insertModuleGrant', $args);
352
-				if(!$output->toBool()) return $output;
352
+				if (!$output->toBool()) return $output;
353 353
 			}
354 354
 		}
355 355
 		$this->setMessage('success_registed');
@@ -368,11 +368,11 @@  discard block
 block discarded – undo
368 368
 		$oModuleModel = getModel('module');
369 369
 		$columnList = array('module_srl', 'module', 'skin', 'mskin', 'is_skin_fix', 'is_mskin_fix');
370 370
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
371
-		if($module_info->module_srl)
371
+		if ($module_info->module_srl)
372 372
 		{
373
-			if($mode === 'M')
373
+			if ($mode === 'M')
374 374
 			{
375
-				if($module_info->is_mskin_fix == 'Y')
375
+				if ($module_info->is_mskin_fix == 'Y')
376 376
 				{
377 377
 					$skin = $module_info->mskin;
378 378
 				}
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
 			}
384 384
 			else
385 385
 			{
386
-				if($module_info->is_skin_fix == 'Y')
386
+				if ($module_info->is_skin_fix == 'Y')
387 387
 				{
388 388
 					$skin = $module_info->skin;
389 389
 				}
@@ -394,9 +394,9 @@  discard block
 block discarded – undo
394 394
 			}
395 395
 
396 396
 			// Get skin information (to check extra_vars)
397
-			$module_path = _XE_PATH_ . 'modules/'.$module_info->module;
397
+			$module_path = _XE_PATH_.'modules/'.$module_info->module;
398 398
 
399
-			if($mode === 'M')
399
+			if ($mode === 'M')
400 400
 			{
401 401
 				$skin_info = $oModuleModel->loadSkinInfo($module_path, $skin, 'm.skins');
402 402
 				$skin_vars = $oModuleModel->getModuleMobileSkinVars($module_srl);
@@ -417,35 +417,35 @@  discard block
 block discarded – undo
417 417
 			unset($obj->module);
418 418
 			unset($obj->_mode);
419 419
 			// Separately handle if a type of extra_vars is an image in the original skin_info
420
-			if($skin_info->extra_vars)
420
+			if ($skin_info->extra_vars)
421 421
 			{
422
-				foreach($skin_info->extra_vars as $vars)
422
+				foreach ($skin_info->extra_vars as $vars)
423 423
 				{
424
-					if($vars->type!='image') continue;
424
+					if ($vars->type != 'image') continue;
425 425
 
426 426
 					$image_obj = $obj->{$vars->name};
427 427
 					// Get a variable to delete
428 428
 					$del_var = $obj->{"del_".$vars->name};
429 429
 					unset($obj->{"del_".$vars->name});
430
-					if($del_var == 'Y')
430
+					if ($del_var == 'Y')
431 431
 					{
432 432
 						FileHandler::removeFile($skin_vars[$vars->name]->value);
433 433
 						continue;
434 434
 					}
435 435
 					// Use the previous data if not uploaded
436
-					if(!$image_obj['tmp_name'])
436
+					if (!$image_obj['tmp_name'])
437 437
 					{
438 438
 						$obj->{$vars->name} = $skin_vars[$vars->name]->value;
439 439
 						continue;
440 440
 					}
441 441
 					// Ignore if the file is not successfully uploaded
442
-					if(!is_uploaded_file($image_obj['tmp_name']) || !checkUploadedFile($image_obj['tmp_name']))
442
+					if (!is_uploaded_file($image_obj['tmp_name']) || !checkUploadedFile($image_obj['tmp_name']))
443 443
 					{
444 444
 						unset($obj->{$vars->name});
445 445
 						continue;
446 446
 					}
447 447
 					// Ignore if the file is not an image
448
-					if(!preg_match("/\.(jpg|jpeg|gif|png)$/i", $image_obj['name']))
448
+					if (!preg_match("/\.(jpg|jpeg|gif|png)$/i", $image_obj['name']))
449 449
 					{
450 450
 						unset($obj->{$vars->name});
451 451
 						continue;
@@ -453,11 +453,11 @@  discard block
 block discarded – undo
453 453
 					// Upload the file to a path
454 454
 					$path = sprintf("./files/attach/images/%s/", $module_srl);
455 455
 					// Create a directory
456
-					if(!FileHandler::makeDir($path)) return false;
456
+					if (!FileHandler::makeDir($path)) return false;
457 457
 
458 458
 					$filename = $path.$image_obj['name'];
459 459
 					// Move the file
460
-					if(!move_uploaded_file($image_obj['tmp_name'], $filename))
460
+					if (!move_uploaded_file($image_obj['tmp_name'], $filename))
461 461
 					{
462 462
 						unset($obj->{$vars->name});
463 463
 						continue;
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
 			*/
482 482
 			$oModuleController = getController('module');
483 483
 
484
-			if($mode === 'M')
484
+			if ($mode === 'M')
485 485
 			{
486 486
 				$output = $oModuleController->insertModuleMobileSkinVars($module_srl, $obj);
487 487
 			}
@@ -489,7 +489,7 @@  discard block
 block discarded – undo
489 489
 			{
490 490
 				$output = $oModuleController->insertModuleSkinVars($module_srl, $obj);
491 491
 			}
492
-			if(!$output->toBool())
492
+			if (!$output->toBool())
493 493
 			{
494 494
 				return $output;
495 495
 			}
@@ -506,29 +506,29 @@  discard block
 block discarded – undo
506 506
 	{
507 507
 		$vars = Context::getRequestVars();
508 508
 
509
-		if(!$vars->module_srls) return new Object(-1,'msg_invalid_request');
509
+		if (!$vars->module_srls) return new Object(-1, 'msg_invalid_request');
510 510
 
511
-		$module_srls = explode(',',$vars->module_srls);
512
-		if(count($module_srls) < 1) return new Object(-1,'msg_invalid_request');
511
+		$module_srls = explode(',', $vars->module_srls);
512
+		if (count($module_srls) < 1) return new Object(-1, 'msg_invalid_request');
513 513
 
514 514
 		$oModuleModel = getModel('module');
515
-		$oModuleController= getController('module');
515
+		$oModuleController = getController('module');
516 516
 		$columnList = array('module_srl', 'module', 'menu_srl', 'site_srl', 'mid', 'browser_title', 'is_default', 'content', 'mcontent', 'open_rss', 'regdate');
517
-		$updateList = array('module_category_srl','layout_srl','skin','mlayout_srl','mskin','description','header_text','footer_text', 'use_mobile');
518
-		foreach($updateList as $key=>$val)
517
+		$updateList = array('module_category_srl', 'layout_srl', 'skin', 'mlayout_srl', 'mskin', 'description', 'header_text', 'footer_text', 'use_mobile');
518
+		foreach ($updateList as $key=>$val)
519 519
 		{
520
-			if(!strlen($vars->{$val}))
520
+			if (!strlen($vars->{$val}))
521 521
 			{
522 522
 				unset($updateList[$key]);
523 523
 				$columnList[] = $val;
524 524
 			}
525 525
 		}
526 526
 
527
-		foreach($module_srls as $module_srl)
527
+		foreach ($module_srls as $module_srl)
528 528
 		{
529 529
 			$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
530 530
 
531
-			foreach($updateList as $val)
531
+			foreach ($updateList as $val)
532 532
 			{
533 533
 				$module_info->{$val} = $vars->{$val};
534 534
 			}
@@ -536,9 +536,9 @@  discard block
 block discarded – undo
536 536
 		}
537 537
 
538 538
 		$this->setMessage('success_registed');
539
-		if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON')))
539
+		if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON')))
540 540
 		{
541
-			if(Context::get('success_return_url'))
541
+			if (Context::get('success_return_url'))
542 542
 			{
543 543
 				$this->setRedirectUrl(Context::get('success_return_url'));
544 544
 			}
@@ -561,10 +561,10 @@  discard block
 block discarded – undo
561 561
 	function procModuleAdminModuleGrantSetup()
562 562
 	{
563 563
 		$module_srls = Context::get('module_srls');
564
-		if(!$module_srls) return new Object(-1,'msg_invalid_request');
564
+		if (!$module_srls) return new Object(-1, 'msg_invalid_request');
565 565
 
566
-		$modules = explode(',',$module_srls);
567
-		if(count($modules) < 1) return new Object(-1,'msg_invalid_request');
566
+		$modules = explode(',', $module_srls);
567
+		if (count($modules) < 1) return new Object(-1, 'msg_invalid_request');
568 568
 
569 569
 		$oModuleController = getController('module');
570 570
 		$oModuleModel = getModel('module');
@@ -581,13 +581,13 @@  discard block
 block discarded – undo
581 581
 
582 582
 		$grant = new stdClass;
583 583
 
584
-		foreach($grant_list as $grant_name => $grant_info)
584
+		foreach ($grant_list as $grant_name => $grant_info)
585 585
 		{
586 586
 			// Get the default value
587 587
 			$default = Context::get($grant_name.'_default');
588 588
 			// -1 = Sign only, 0 = all users
589 589
 			$grant->{$grant_name} = array();
590
-			if(strlen($default))
590
+			if (strlen($default))
591 591
 			{
592 592
 				$grant->{$grant_name}[] = $default;
593 593
 				continue;
@@ -596,12 +596,12 @@  discard block
 block discarded – undo
596 596
 			else
597 597
 			{
598 598
 				$group_srls = Context::get($grant_name);
599
-				if($group_srls)
599
+				if ($group_srls)
600 600
 				{
601
-					if(!is_array($group_srls))
601
+					if (!is_array($group_srls))
602 602
 					{
603
-						if(strpos($group_srls,'|@|')!==false) $group_srls = explode('|@|',$group_srls);
604
-						elseif(strpos($group_srls,',')!==false) $group_srls = explode(',',$group_srls);
603
+						if (strpos($group_srls, '|@|') !== false) $group_srls = explode('|@|', $group_srls);
604
+						elseif (strpos($group_srls, ',') !== false) $group_srls = explode(',', $group_srls);
605 605
 						else $group_srls = array($group_srls);
606 606
 					}
607 607
 					$grant->{$grant_name} = $group_srls;
@@ -612,30 +612,30 @@  discard block
 block discarded – undo
612 612
 		}
613 613
 
614 614
 		// Stored in the DB
615
-		foreach($modules as $module_srl)
615
+		foreach ($modules as $module_srl)
616 616
 		{
617 617
 			$args = new stdClass();
618 618
 			$args->module_srl = $module_srl;
619 619
 			$output = executeQuery('module.deleteModuleGrants', $args);
620
-			if(!$output->toBool()) continue;
620
+			if (!$output->toBool()) continue;
621 621
 			// Permissions stored in the DB
622
-			foreach($grant as $grant_name => $group_srls)
622
+			foreach ($grant as $grant_name => $group_srls)
623 623
 			{
624
-				foreach($group_srls as $val)
624
+				foreach ($group_srls as $val)
625 625
 				{
626 626
 					$args = new stdClass();
627 627
 					$args->module_srl = $module_srl;
628 628
 					$args->name = $grant_name;
629 629
 					$args->group_srl = $val;
630 630
 					$output = executeQuery('module.insertModuleGrant', $args);
631
-					if(!$output->toBool()) return $output;
631
+					if (!$output->toBool()) return $output;
632 632
 				}
633 633
 			}
634 634
 		}
635 635
 		$this->setMessage('success_registed');
636
-		if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON')))
636
+		if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON')))
637 637
 		{
638
-			if(Context::get('success_return_url'))
638
+			if (Context::get('success_return_url'))
639 639
 			{
640 640
 				$this->setRedirectUrl(Context::get('success_return_url'));
641 641
 			}
@@ -662,38 +662,38 @@  discard block
 block discarded – undo
662 662
 		$target = Context::get('target');
663 663
 		$module = Context::get('module');
664 664
 		$args = new stdClass();
665
-		$args->site_srl = (int)$site_module_info->site_srl;
666
-		$args->name = str_replace(' ','_',Context::get('lang_code'));
667
-		$args->lang_name = str_replace(' ','_',Context::get('lang_name'));
668
-		if(!empty($args->lang_name)) $args->name = $args->lang_name;
665
+		$args->site_srl = (int) $site_module_info->site_srl;
666
+		$args->name = str_replace(' ', '_', Context::get('lang_code'));
667
+		$args->lang_name = str_replace(' ', '_', Context::get('lang_name'));
668
+		if (!empty($args->lang_name)) $args->name = $args->lang_name;
669 669
 
670 670
 		// if args->name is empty, random generate for user define language
671
-		if(empty($args->name)) $args->name = 'userLang'.date('YmdHis').''.sprintf('%03d', mt_rand(0, 100));
671
+		if (empty($args->name)) $args->name = 'userLang'.date('YmdHis').''.sprintf('%03d', mt_rand(0, 100));
672 672
 
673
-		if(!$args->name) return new Object(-1,'msg_invalid_request');
673
+		if (!$args->name) return new Object(-1, 'msg_invalid_request');
674 674
 		// Check whether a language code exists
675 675
 		$output = executeQueryArray('module.getLang', $args);
676
-		if(!$output->toBool()) return $output;
676
+		if (!$output->toBool()) return $output;
677 677
 		// If exists, clear the old values for updating
678
-		if($output->data) $output = executeQuery('module.deleteLang', $args);
679
-		if(!$output->toBool()) return $output;
678
+		if ($output->data) $output = executeQuery('module.deleteLang', $args);
679
+		if (!$output->toBool()) return $output;
680 680
 		// Enter
681 681
 		$lang_supported = Context::get('lang_supported');
682
-		foreach($lang_supported as $key => $val)
682
+		foreach ($lang_supported as $key => $val)
683 683
 		{
684 684
 			$args->lang_code = $key;
685 685
 			$args->value = trim(Context::get($key));
686 686
 
687 687
 			// if request method is json, strip slashes
688
-			if(Context::getRequestMethod() == 'JSON' && version_compare(PHP_VERSION, "5.4.0", "<") && get_magic_quotes_gpc())
688
+			if (Context::getRequestMethod() == 'JSON' && version_compare(PHP_VERSION, "5.4.0", "<") && get_magic_quotes_gpc())
689 689
 			{
690 690
 				$args->value = stripslashes($args->value);
691 691
 			}
692 692
 
693
-			if($args->value)
693
+			if ($args->value)
694 694
 			{
695 695
 				$output = executeQuery('module.insertLang', $args);
696
-				if(!$output->toBool()) return $output;
696
+				if (!$output->toBool()) return $output;
697 697
 			}
698 698
 		}
699 699
 		$this->makeCacheDefinedLangCode($args->site_srl);
@@ -713,14 +713,14 @@  discard block
 block discarded – undo
713 713
 		// Get language code
714 714
 		$site_module_info = Context::get('site_module_info');
715 715
 		$args = new stdClass();
716
-		$args->site_srl = (int)$site_module_info->site_srl;
717
-		$args->name = str_replace(' ','_',Context::get('name'));
718
-		$args->lang_name = str_replace(' ','_',Context::get('lang_name'));
719
-		if(!empty($args->lang_name)) $args->name = $args->lang_name;
720
-		if(!$args->name) return new Object(-1,'msg_invalid_request');
716
+		$args->site_srl = (int) $site_module_info->site_srl;
717
+		$args->name = str_replace(' ', '_', Context::get('name'));
718
+		$args->lang_name = str_replace(' ', '_', Context::get('lang_name'));
719
+		if (!empty($args->lang_name)) $args->name = $args->lang_name;
720
+		if (!$args->name) return new Object(-1, 'msg_invalid_request');
721 721
 
722 722
 		$output = executeQuery('module.deleteLang', $args);
723
-		if(!$output->toBool()) return $output;
723
+		if (!$output->toBool()) return $output;
724 724
 		$this->makeCacheDefinedLangCode($args->site_srl);
725 725
 
726 726
 		$this->setMessage("success_deleted", 'info');
@@ -731,7 +731,7 @@  discard block
 block discarded – undo
731 731
 
732 732
 	function procModuleAdminGetList()
733 733
 	{
734
-		if(!Context::get('is_logged')) return new Object(-1, 'msg_not_permitted');
734
+		if (!Context::get('is_logged')) return new Object(-1, 'msg_not_permitted');
735 735
 
736 736
 		$oModuleController = getController('module');
737 737
 		$oModuleModel = getModel('module');
@@ -744,12 +744,12 @@  discard block
 block discarded – undo
744 744
 		$args = new stdClass;
745 745
 		$logged_info = Context::get('logged_info');
746 746
 		$site_module_info = Context::get('site_module_info');
747
-		if($site_keyword) $args->site_keyword = $site_keyword;
747
+		if ($site_keyword) $args->site_keyword = $site_keyword;
748 748
 
749
-		if(!$site_srl)
749
+		if (!$site_srl)
750 750
 		{
751
-			if($logged_info->is_admin == 'Y' && !$site_keyword && !$vid) $args->site_srl = 0;
752
-			else $args->site_srl = (int)$site_module_info->site_srl;
751
+			if ($logged_info->is_admin == 'Y' && !$site_keyword && !$vid) $args->site_srl = 0;
752
+			else $args->site_srl = (int) $site_module_info->site_srl;
753 753
 		}
754 754
 		else $args->site_srl = $site_srl;
755 755
 
@@ -759,12 +759,12 @@  discard block
 block discarded – undo
759 759
 		// Get a list of modules at the site
760 760
 		$output = executeQueryArray('module.getSiteModules', $args);
761 761
 		$mid_list = array();
762
-		if(count($output->data) > 0)
762
+		if (count($output->data) > 0)
763 763
 		{
764
-			foreach($output->data as $val)
764
+			foreach ($output->data as $val)
765 765
 			{
766 766
 				$module = trim($val->module);
767
-				if(!$module) continue;
767
+				if (!$module) continue;
768 768
 
769 769
 				// replace user defined lang.
770 770
 				$oModuleController->replaceDefinedLangCode($val->browser_title);
@@ -775,7 +775,7 @@  discard block
 block discarded – undo
775 775
 				$obj->browser_title = $val->browser_title;
776 776
 				$obj->mid = $val->mid;
777 777
 				$obj->module_category_srl = $val->module_category_srl;
778
-				if($val->module_category_srl > 0)
778
+				if ($val->module_category_srl > 0)
779 779
 				{
780 780
 					$moduleCategorySrl[] = $val->module_category_srl;
781 781
 				}
@@ -787,23 +787,23 @@  discard block
 block discarded – undo
787 787
 		$moduleCategorySrl = array_unique($moduleCategorySrl);
788 788
 		$output = $oModuleModel->getModuleCategories($moduleCategorySrl);
789 789
 		$categoryNameList = array();
790
-		if(is_array($output))
790
+		if (is_array($output))
791 791
 		{
792
-			foreach($output as $value)
792
+			foreach ($output as $value)
793 793
 			{
794 794
 				$categoryNameList[$value->module_category_srl] = $value->title;
795 795
 			}
796 796
 		}
797 797
 
798 798
 		$selected_module = Context::get('selected_module');
799
-		if(count($mid_list) > 0)
799
+		if (count($mid_list) > 0)
800 800
 		{
801
-			foreach($mid_list as $module => $val)
801
+			foreach ($mid_list as $module => $val)
802 802
 			{
803
-				if(!$selected_module) $selected_module = $module;
803
+				if (!$selected_module) $selected_module = $module;
804 804
 				$xml_info = $oModuleModel->getModuleInfoXml($module);
805 805
 
806
-				if(!$xml_info)
806
+				if (!$xml_info)
807 807
 				{
808 808
 					unset($mid_list[$module]);
809 809
 					continue;
@@ -812,14 +812,14 @@  discard block
 block discarded – undo
812 812
 				$mid_list[$module]->title = $xml_info->title;
813 813
 
814 814
 				// change module category srl to title
815
-				if(is_array($val->list))
815
+				if (is_array($val->list))
816 816
 				{
817
-					foreach($val->list as $key=>$value)
817
+					foreach ($val->list as $key=>$value)
818 818
 					{
819
-						if($value->module_category_srl > 0)
819
+						if ($value->module_category_srl > 0)
820 820
 						{
821 821
 							$categorySrl = $mid_list[$module]->list[$key]->module_category_srl;
822
-							if(isset($categoryNameList[$categorySrl]))
822
+							if (isset($categoryNameList[$categorySrl]))
823 823
 							{
824 824
 								$mid_list[$module]->list[$key]->module_category_srl = $categoryNameList[$categorySrl];
825 825
 							}
@@ -847,23 +847,23 @@  discard block
 block discarded – undo
847 847
 		$args = new stdClass();
848 848
 
849 849
 		// Get the language file of the current site
850
-		if(!$site_srl)
850
+		if (!$site_srl)
851 851
 		{
852 852
 			$site_module_info = Context::get('site_module_info');
853
-			$args->site_srl = (int)$site_module_info->site_srl;
853
+			$args->site_srl = (int) $site_module_info->site_srl;
854 854
 		}
855 855
 		else
856 856
 		{
857 857
 			$args->site_srl = $site_srl;
858 858
 		}
859 859
 		$output = executeQueryArray('module.getLang', $args);
860
-		if(!$output->toBool() || !$output->data) return;
860
+		if (!$output->toBool() || !$output->data) return;
861 861
 		// Set the cache directory
862 862
 		$cache_path = _XE_PATH_.'files/cache/lang_defined/';
863 863
 		FileHandler::makeDir($cache_path);
864 864
 
865 865
 		$langMap = array();
866
-		foreach($output->data as $val)
866
+		foreach ($output->data as $val)
867 867
 		{
868 868
 			$langMap[$val->lang_code][$val->name] = $val->value;
869 869
 		}
@@ -872,27 +872,27 @@  discard block
 block discarded – undo
872 872
 		$dbInfo = Context::getDBInfo();
873 873
 		$defaultLang = $dbInfo->lang_type;
874 874
 
875
-		if(!is_array($langMap[$defaultLang]))
875
+		if (!is_array($langMap[$defaultLang]))
876 876
 		{
877 877
 			$langMap[$defaultLang] = array();
878 878
 		}
879 879
 
880
-		foreach($lang_supported as $langCode => $langName)
880
+		foreach ($lang_supported as $langCode => $langName)
881 881
 		{
882
-			if(!is_array($langMap[$langCode]))
882
+			if (!is_array($langMap[$langCode]))
883 883
 			{
884 884
 				$langMap[$langCode] = array();
885 885
 			}
886 886
 
887 887
 			$langMap[$langCode] += $langMap[$defaultLang];
888
-			foreach($lang_supported as $targetLangCode => $targetLangName)
888
+			foreach ($lang_supported as $targetLangCode => $targetLangName)
889 889
 			{
890
-				if($langCode == $targetLangCode || $langCode == $defaultLang)
890
+				if ($langCode == $targetLangCode || $langCode == $defaultLang)
891 891
 				{
892 892
 					continue;
893 893
 				}
894 894
 
895
-				if(!is_array($langMap[$targetLangCode]))
895
+				if (!is_array($langMap[$targetLangCode]))
896 896
 				{
897 897
 					$langMap[$targetLangCode] = array();
898 898
 				}
@@ -901,7 +901,7 @@  discard block
 block discarded – undo
901 901
 			}
902 902
 
903 903
 			$buff = array("<?php if(!defined('__XE__')) exit();");
904
-			foreach($langMap[$langCode] as $code => $value)
904
+			foreach ($langMap[$langCode] as $code => $value)
905 905
 			{
906 906
 				$buff[] = sprintf('$lang[\'%s\'] = \'%s\';', $code, addcslashes($value, "'"));
907 907
 			}
@@ -924,7 +924,7 @@  discard block
 block discarded – undo
924 924
 
925 925
 		$isSkinFix = Context::get('is_skin_fix');
926 926
 
927
-		if($isSkinFix)
927
+		if ($isSkinFix)
928 928
 		{
929 929
 			$isSkinFix = ($isSkinFix == 'N') ? 'N' : 'Y';
930 930
 		}
@@ -940,14 +940,14 @@  discard block
 block discarded – undo
940 940
 
941 941
 	public function setDesignInfo($moduleSrl = 0, $mid = '', $skinType = 'P', $layoutSrl = 0, $isSkinFix = 'Y', $skinName = '', $skinVars = NULL)
942 942
 	{
943
-		if(!$moduleSrl && !$mid)
943
+		if (!$moduleSrl && !$mid)
944 944
 		{
945 945
 			return $this->stop(-1, 'msg_invalid_request');
946 946
 		}
947 947
 
948 948
 		$oModuleModel = getModel('module');
949 949
 
950
-		if($mid)
950
+		if ($mid)
951 951
 		{
952 952
 			$moduleInfo = $oModuleModel->getModuleInfoByMid($mid);
953 953
 		}
@@ -956,7 +956,7 @@  discard block
 block discarded – undo
956 956
 			$moduleInfo = $oModuleModel->getModuleInfoByModuleSrl($moduleSrl);
957 957
 		}
958 958
 
959
-		if(!$moduleInfo)
959
+		if (!$moduleInfo)
960 960
 		{
961 961
 			return $this->stop(-1, 'msg_module_not_exists');
962 962
 		}
@@ -965,26 +965,26 @@  discard block
 block discarded – undo
965 965
 		$layoutTargetValue = ($skinType == 'M') ? 'mlayout_srl' : 'layout_srl';
966 966
 		$skinFixTargetValue = ($skinType == 'M') ? 'is_mskin_fix' : 'is_skin_fix';
967 967
 
968
-		if(strlen($layoutSrl))
968
+		if (strlen($layoutSrl))
969 969
 		{
970 970
 			$moduleInfo->{$layoutTargetValue} = $layoutSrl;
971 971
 		}
972 972
 
973
-		if(strlen($isSkinFix))
973
+		if (strlen($isSkinFix))
974 974
 		{
975 975
 			$moduleInfo->{$skinFixTargetValue} = $isSkinFix;
976 976
 		}
977 977
 
978
-		if($isSkinFix == 'Y')
978
+		if ($isSkinFix == 'Y')
979 979
 		{
980 980
 			$moduleInfo->{$skinTargetValue} = $skinName;
981 981
 			$skinVars = json_decode($skinVars);
982 982
 
983
-			if(is_array($skinVars))
983
+			if (is_array($skinVars))
984 984
 			{
985
-				foreach($skinVars as $key => $val)
985
+				foreach ($skinVars as $key => $val)
986 986
 				{
987
-					if(empty($val))
987
+					if (empty($val))
988 988
 					{
989 989
 						continue;
990 990
 					}
@@ -1005,7 +1005,7 @@  discard block
 block discarded – undo
1005 1005
 		$menuItemSrl = Context::get('menu_item_srl');
1006 1006
 		$useMobile = Context::get('use_mobile');
1007 1007
 
1008
-		if(!$menuItemSrl)
1008
+		if (!$menuItemSrl)
1009 1009
 		{
1010 1010
 			return $this->stop(-1, 'msg_invalid_request');
1011 1011
 		}
Please login to merge, or discard this patch.