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
Pull Request — master (#1993)
by
unknown
12:46
created
modules/member/member.api.php 3 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 	/**
25 25
 	 * Arrange Contents
26 26
 	 *
27
-	 * @param array $content_list
27
+	 * @param string $content_list
28 28
 	 *
29 29
 	 * @return array
30 30
 	 */
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 	/**
42 42
 	 * Arrange Contents
43 43
 	 *
44
-	 * @param array $content_list
44
+	 * @param array $content
45 45
 	 *
46 46
 	 * @return array
47 47
 	 */
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -17,8 +17,8 @@  discard block
 block discarded – undo
17 17
 	function dispSavedDocumentList(&$oModule)
18 18
 	{
19 19
 		$document_list = $this->arrangeContentList(Context::get('document_list'));
20
-		$oModule->add('document_list',$document_list);
21
-		$oModule->add('page_navigation',Context::get('page_navigation'));
20
+		$oModule->add('document_list', $document_list);
21
+		$oModule->add('page_navigation', Context::get('page_navigation'));
22 22
 	}
23 23
 
24 24
 	/**
@@ -31,9 +31,9 @@  discard block
 block discarded – undo
31 31
 	function arrangeContentList($content_list)
32 32
 	{
33 33
 		$output = array();
34
-		if(count($content_list))
34
+		if (count($content_list))
35 35
 		{
36
-			foreach($content_list as $key => $val) $output[] = $this->arrangeContent($val);
36
+			foreach ($content_list as $key => $val) $output[] = $this->arrangeContent($val);
37 37
 		}
38 38
 		return $output;
39 39
 	}
@@ -48,9 +48,9 @@  discard block
 block discarded – undo
48 48
 	function arrangeContent($content)
49 49
 	{
50 50
 		$output = null;
51
-		if($content)
51
+		if ($content)
52 52
 		{
53
-			$output= $content->gets('document_srl','category_srl','nick_name','user_id','user_name','title','content','tags','voted_count','blamed_count','comment_count','regdate','last_update','extra_vars','status');
53
+			$output = $content->gets('document_srl', 'category_srl', 'nick_name', 'user_id', 'user_name', 'title', 'content', 'tags', 'voted_count', 'blamed_count', 'comment_count', 'regdate', 'last_update', 'extra_vars', 'status');
54 54
 		}
55 55
 		return $output;
56 56
 	}
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,9 @@
 block discarded – undo
33 33
 		$output = array();
34 34
 		if(count($content_list))
35 35
 		{
36
-			foreach($content_list as $key => $val) $output[] = $this->arrangeContent($val);
36
+			foreach($content_list as $key => $val) {
37
+				$output[] = $this->arrangeContent($val);
38
+			}
37 39
 		}
38 40
 		return $output;
39 41
 	}
Please login to merge, or discard this patch.
modules/member/member.controller.php 4 patches
Doc Comments   +21 added lines, -13 removed lines patch added patch discarded remove patch
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 	/**
188 188
 	 * Delete the post
189 189
 	 *
190
-	 * @return void|Object (void : success, Object : fail)
190
+	 * @return Object|null (void : success, Object : fail)
191 191
 	 */
192 192
 	function procMemberDeleteSavedDocument()
193 193
 	{
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 	/**
206 206
 	 * Check values when member joining
207 207
 	 *
208
-	 * @return void|Object (void : success, Object : fail)
208
+	 * @return null|Object (void : success, Object : fail)
209 209
 	 */
210 210
 	function procMemberCheckValue()
211 211
 	{
@@ -672,7 +672,7 @@  discard block
 block discarded – undo
672 672
 	/**
673 673
 	 * Add a profile image
674 674
 	 *
675
-	 * @return void|Object (void : success, Object : fail)
675
+	 * @return ModuleObject|null (void : success, Object : fail)
676 676
 	 */
677 677
 	function procMemberInsertProfileImage()
678 678
 	{
@@ -751,7 +751,7 @@  discard block
 block discarded – undo
751 751
 	/**
752 752
 	 * Add an image name
753 753
 	 *
754
-	 * @return void|Object (void : success, Object : fail)
754
+	 * @return ModuleObject|null (void : success, Object : fail)
755 755
 	 */
756 756
 	function procMemberInsertImageName()
757 757
 	{
@@ -836,7 +836,7 @@  discard block
 block discarded – undo
836 836
 	/**
837 837
 	 * Delete Image name
838 838
 	 *
839
-	 * @return void
839
+	 * @return Object
840 840
 	 */
841 841
 	function procMemberDeleteImageName($_memberSrl = 0)
842 842
 	{
@@ -860,7 +860,7 @@  discard block
 block discarded – undo
860 860
 	/**
861 861
 	 * Add an image to mark
862 862
 	 *
863
-	 * @return void|Object (void : success, Object : fail)
863
+	 * @return ModuleObject|null (void : success, Object : fail)
864 864
 	 */
865 865
 	function procMemberInsertImageMark()
866 866
 	{
@@ -1100,7 +1100,7 @@  discard block
 block discarded – undo
1100 1100
 	 * Execute finding ID/Passoword
1101 1101
 	 * When clicking the link in the verification email, a method is called to change the old password and to authenticate it
1102 1102
 	 *
1103
-	 * @return void|Object (void : success, Object : fail)
1103
+	 * @return ModuleObject|null (void : success, Object : fail)
1104 1104
 	 */
1105 1105
 	function procMemberAuthAccount()
1106 1106
 	{
@@ -1172,7 +1172,7 @@  discard block
 block discarded – undo
1172 1172
 	/**
1173 1173
 	 * Request to re-send the authentication mail
1174 1174
 	 *
1175
-	 * @return void|Object (void : success, Object : fail)
1175
+	 * @return Object|null (void : success, Object : fail)
1176 1176
 	 */
1177 1177
 	function procMemberResendAuthMail()
1178 1178
 	{
@@ -1331,6 +1331,9 @@  discard block
 block discarded – undo
1331 1331
 		$this->setRedirectUrl($returnUrl);
1332 1332
 	}
1333 1333
 
1334
+	/**
1335
+	 * @param stdClass $auth_args
1336
+	 */
1334 1337
 	function _sendAuthMail($auth_args, $member_info)
1335 1338
 	{
1336 1339
 		$oMemberModel = getModel('member');
@@ -1386,7 +1389,7 @@  discard block
 block discarded – undo
1386 1389
 	/**
1387 1390
 	 * Join a virtual site
1388 1391
 	 *
1389
-	 * @return void|Object (void : success, Object : fail)
1392
+	 * @return Object|null (void : success, Object : fail)
1390 1393
 	 */
1391 1394
 	function procMemberSiteSignUp()
1392 1395
 	{
@@ -1463,7 +1466,7 @@  discard block
 block discarded – undo
1463 1466
 	 * @param int $member_srl
1464 1467
 	 * @param string $signature
1465 1468
 	 *
1466
-	 * @return void
1469
+	 * @return boolean|null
1467 1470
 	 */
1468 1471
 	function putSignature($member_srl, $signature)
1469 1472
 	{
@@ -1865,6 +1868,8 @@  discard block
 block discarded – undo
1865 1868
 	/**
1866 1869
 	 * Logged method for providing a personalized menu
1867 1870
 	 * Login information is used in the output widget, or personalized page
1871
+	 * @param string $act
1872
+	 * @param string $str
1868 1873
 	 */
1869 1874
 	function addMemberMenu($act, $str)
1870 1875
 	{
@@ -1895,6 +1900,7 @@  discard block
 block discarded – undo
1895 1900
 
1896 1901
 	/**
1897 1902
 	 * Add users to the member table
1903
+	 * @param stdClass $args
1898 1904
 	 */
1899 1905
 	function insertMember(&$args, $password_is_hashed = false)
1900 1906
 	{
@@ -2086,6 +2092,7 @@  discard block
 block discarded – undo
2086 2092
 	 * Modify member information
2087 2093
 	 *
2088 2094
 	 * @param bool $is_admin , modified 2013-11-22
2095
+	 * @param stdClass $args
2089 2096
 	 */
2090 2097
 	function updateMember($args, $is_admin = FALSE)
2091 2098
 	{
@@ -2272,6 +2279,7 @@  discard block
 block discarded – undo
2272 2279
 
2273 2280
 	/**
2274 2281
 	 * Modify member password
2282
+	 * @param stdClass $args
2275 2283
 	 */
2276 2284
 	function updateMemberPassword($args)
2277 2285
 	{
@@ -2555,7 +2563,7 @@  discard block
 block discarded – undo
2555 2563
 	 *
2556 2564
 	 * @param array &$menu_list
2557 2565
 	 *
2558
-	 * @return object
2566
+	 * @return Object
2559 2567
 	**/
2560 2568
 	function triggerGetDocumentMenu(&$menu_list)
2561 2569
 	{
@@ -2585,7 +2593,7 @@  discard block
 block discarded – undo
2585 2593
 	 *
2586 2594
 	 * @param array &$menu_list
2587 2595
 	 *
2588
-	 * @return object
2596
+	 * @return Object
2589 2597
 	**/
2590 2598
 	function triggerGetCommentMenu(&$menu_list)
2591 2599
 	{
@@ -2613,7 +2621,7 @@  discard block
 block discarded – undo
2613 2621
 	/**
2614 2622
 	 * Spammer manage. Denied user login. And delete or trash all documents. Response Ajax string
2615 2623
 	 *
2616
-	 * @return object
2624
+	 * @return Object
2617 2625
 	**/
2618 2626
 	function procMemberSpammerManage()
2619 2627
 	{
Please login to merge, or discard this patch.
Braces   +587 added lines, -246 removed lines patch added patch discarded remove patch
@@ -41,19 +41,31 @@  discard block
 block discarded – undo
41 41
 		}
42 42
 
43 43
 		// Variables
44
-		if(!$user_id) $user_id = Context::get('user_id');
44
+		if(!$user_id) {
45
+			$user_id = Context::get('user_id');
46
+		}
45 47
 		$user_id = trim($user_id);
46 48
 
47
-		if(!$password) $password = Context::get('password');
49
+		if(!$password) {
50
+			$password = Context::get('password');
51
+		}
48 52
 		$password = trim($password);
49 53
 
50
-		if(!$keep_signed) $keep_signed = Context::get('keep_signed');
54
+		if(!$keep_signed) {
55
+			$keep_signed = Context::get('keep_signed');
56
+		}
51 57
 		// Return an error when id and password doesn't exist
52
-		if(!$user_id) return new Object(-1,'null_user_id');
53
-		if(!$password) return new Object(-1,'null_password');
58
+		if(!$user_id) {
59
+			return new Object(-1,'null_user_id');
60
+		}
61
+		if(!$password) {
62
+			return new Object(-1,'null_password');
63
+		}
54 64
 
55 65
 		$output = $this->doLogin($user_id, $password, $keep_signed=='Y'?true:false);
56
-		if (!$output->toBool()) return $output;
66
+		if (!$output->toBool()) {
67
+			return $output;
68
+		}
57 69
 
58 70
 		$oModuleModel = getModel('module');
59 71
 		$config = $oModuleModel->getModuleConfig('member');
@@ -80,8 +92,7 @@  discard block
 block discarded – undo
80 92
 		if(!$config->after_login_url)
81 93
 		{
82 94
 			$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', '');
83
-		}
84
-		else
95
+		} else
85 96
 		{
86 97
 			$returnUrl = $config->after_login_url;
87 98
 		}
@@ -98,19 +109,24 @@  discard block
 block discarded – undo
98 109
 		// Call a trigger before log-out (before)
99 110
 		$logged_info = Context::get('logged_info');
100 111
 		$trigger_output = ModuleHandler::triggerCall('member.doLogout', 'before', $logged_info);
101
-		if(!$trigger_output->toBool()) return $trigger_output;
112
+		if(!$trigger_output->toBool()) {
113
+			return $trigger_output;
114
+		}
102 115
 		// Destroy session information
103 116
 		$this->destroySessionInfo();
104 117
 		// Call a trigger after log-out (after)
105 118
 		$trigger_output = ModuleHandler::triggerCall('member.doLogout', 'after', $logged_info);
106
-		if(!$trigger_output->toBool()) return $trigger_output;
119
+		if(!$trigger_output->toBool()) {
120
+			return $trigger_output;
121
+		}
107 122
 
108 123
 		$output = new Object();
109 124
 
110 125
 		$oModuleModel = getModel('module');
111 126
 		$config = $oModuleModel->getModuleConfig('member');
112
-		if($config->after_logout_url)
113
-			$output->redirect_url = $config->after_logout_url;
127
+		if($config->after_logout_url) {
128
+					$output->redirect_url = $config->after_logout_url;
129
+		}
114 130
 
115 131
 		$this->_clearMemberCache($logged_info->member_srl);
116 132
 
@@ -125,12 +141,18 @@  discard block
 block discarded – undo
125 141
 	function procMemberScrapDocument()
126 142
 	{
127 143
 		// Check login information
128
-		if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
144
+		if(!Context::get('is_logged')) {
145
+			return new Object(-1, 'msg_not_logged');
146
+		}
129 147
 		$logged_info = Context::get('logged_info');
130 148
 
131 149
 		$document_srl = (int)Context::get('document_srl');
132
-		if(!$document_srl) $document_srl = (int)Context::get('target_srl');
133
-		if(!$document_srl) return new Object(-1,'msg_invalid_request');
150
+		if(!$document_srl) {
151
+			$document_srl = (int)Context::get('target_srl');
152
+		}
153
+		if(!$document_srl) {
154
+			return new Object(-1,'msg_invalid_request');
155
+		}
134 156
 		// Get document
135 157
 		$oDocumentModel = getModel('document');
136 158
 		$oDocument = $oDocumentModel->getDocument($document_srl);
@@ -145,10 +167,14 @@  discard block
 block discarded – undo
145 167
 		$args->title = $oDocument->get('title');
146 168
 		// Check if already scrapped
147 169
 		$output = executeQuery('member.getScrapDocument', $args);
148
-		if($output->data->count) return new Object(-1, 'msg_alreay_scrapped');
170
+		if($output->data->count) {
171
+			return new Object(-1, 'msg_alreay_scrapped');
172
+		}
149 173
 		// Insert
150 174
 		$output = executeQuery('member.addScrapDocument', $args);
151
-		if(!$output->toBool()) return $output;
175
+		if(!$output->toBool()) {
176
+			return $output;
177
+		}
152 178
 
153 179
 		$this->setError(-1);
154 180
 		$this->setMessage('success_registed');
@@ -162,11 +188,15 @@  discard block
 block discarded – undo
162 188
 	function procMemberDeleteScrap()
163 189
 	{
164 190
 		// Check login information
165
-		if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
191
+		if(!Context::get('is_logged')) {
192
+			return new Object(-1, 'msg_not_logged');
193
+		}
166 194
 		$logged_info = Context::get('logged_info');
167 195
 
168 196
 		$document_srl = (int)Context::get('document_srl');
169
-		if(!$document_srl) return new Object(-1,'msg_invalid_request');
197
+		if(!$document_srl) {
198
+			return new Object(-1,'msg_invalid_request');
199
+		}
170 200
 		// Variables
171 201
 		$args = new stdClass;
172 202
 		$args->member_srl = $logged_info->member_srl;
@@ -192,11 +222,15 @@  discard block
 block discarded – undo
192 222
 	function procMemberDeleteSavedDocument()
193 223
 	{
194 224
 		// Check login information
195
-		if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
225
+		if(!Context::get('is_logged')) {
226
+			return new Object(-1, 'msg_not_logged');
227
+		}
196 228
 		$logged_info = Context::get('logged_info');
197 229
 
198 230
 		$document_srl = (int)Context::get('document_srl');
199
-		if(!$document_srl) return new Object(-1,'msg_invalid_request');
231
+		if(!$document_srl) {
232
+			return new Object(-1,'msg_invalid_request');
233
+		}
200 234
 		// Variables
201 235
 		$oDocumentController = getController('document');
202 236
 		$oDocumentController->deleteDocument($document_srl, true);
@@ -211,7 +245,9 @@  discard block
 block discarded – undo
211 245
 	{
212 246
 		$name = Context::get('name');
213 247
 		$value = Context::get('value');
214
-		if(!$value) return;
248
+		if(!$value) {
249
+			return;
250
+		}
215 251
 
216 252
 		$oMemberModel = getModel('member');
217 253
 		// Check if logged-in
@@ -222,10 +258,14 @@  discard block
 block discarded – undo
222 258
 		{
223 259
 			case 'user_id' :
224 260
 				// Check denied ID
225
-				if($oMemberModel->isDeniedID($value)) return new Object(0,'denied_user_id');
261
+				if($oMemberModel->isDeniedID($value)) {
262
+					return new Object(0,'denied_user_id');
263
+				}
226 264
 				// Check if duplicated
227 265
 				$member_srl = $oMemberModel->getMemberSrlByUserID($value);
228
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_user_id');
266
+				if($member_srl && $logged_info->member_srl != $member_srl ) {
267
+					return new Object(0,'msg_exists_user_id');
268
+				}
229 269
 				break;
230 270
 			case 'nick_name' :
231 271
 				// Check denied ID
@@ -235,13 +275,17 @@  discard block
 block discarded – undo
235 275
 				}
236 276
 				// Check if duplicated
237 277
 				$member_srl = $oMemberModel->getMemberSrlByNickName($value);
238
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_nick_name');
278
+				if($member_srl && $logged_info->member_srl != $member_srl ) {
279
+					return new Object(0,'msg_exists_nick_name');
280
+				}
239 281
 
240 282
 				break;
241 283
 			case 'email_address' :
242 284
 				// Check if duplicated
243 285
 				$member_srl = $oMemberModel->getMemberSrlByEmailAddress($value);
244
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_email_address');
286
+				if($member_srl && $logged_info->member_srl != $member_srl ) {
287
+					return new Object(0,'msg_exists_email_address');
288
+				}
245 289
 				break;
246 290
 		}
247 291
 	}
@@ -253,17 +297,25 @@  discard block
 block discarded – undo
253 297
 	 */
254 298
 	function procMemberInsert()
255 299
 	{
256
-		if (Context::getRequestMethod () == "GET") return new Object (-1, "msg_invalid_request");
300
+		if (Context::getRequestMethod () == "GET") {
301
+			return new Object (-1, "msg_invalid_request");
302
+		}
257 303
 		$oMemberModel = &getModel ('member');
258 304
 		$config = $oMemberModel->getMemberConfig();
259 305
 
260 306
 		// call a trigger (before)
261 307
 		$trigger_output = ModuleHandler::triggerCall ('member.procMemberInsert', 'before', $config);
262
-		if(!$trigger_output->toBool ()) return $trigger_output;
308
+		if(!$trigger_output->toBool ()) {
309
+			return $trigger_output;
310
+		}
263 311
 		// Check if an administrator allows a membership
264
-		if($config->enable_join != 'Y') return $this->stop ('msg_signup_disabled');
312
+		if($config->enable_join != 'Y') {
313
+			return $this->stop ('msg_signup_disabled');
314
+		}
265 315
 		// Check if the user accept the license terms (only if terms exist)
266
-		if($config->agreement && Context::get('accept_agreement')!='Y') return $this->stop('msg_accept_agreement');
316
+		if($config->agreement && Context::get('accept_agreement')!='Y') {
317
+			return $this->stop('msg_accept_agreement');
318
+		}
267 319
 
268 320
 		// Extract the necessary information in advance
269 321
 		$getVars = array();
@@ -282,16 +334,22 @@  discard block
 block discarded – undo
282 334
 		foreach($getVars as $val)
283 335
 		{
284 336
 			$args->{$val} = Context::get($val);
285
-			if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
337
+			if($val == 'birthday') {
338
+				$args->birthday_ui = Context::get('birthday_ui');
339
+			}
286 340
 		}
287 341
 		$args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
288
-		if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
342
+		if(!$args->birthday && $args->birthday_ui) {
343
+			$args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
344
+		}
289 345
 
290 346
 		$args->find_account_answer = Context::get('find_account_answer');
291 347
 		$args->allow_mailing = Context::get('allow_mailing');
292 348
 		$args->allow_message = Context::get('allow_message');
293 349
 
294
-		if($args->password1) $args->password = $args->password1;
350
+		if($args->password1) {
351
+			$args->password = $args->password1;
352
+		}
295 353
 
296 354
 		// check password strength
297 355
 		if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
@@ -320,7 +378,9 @@  discard block
 block discarded – undo
320 378
 		unset($all_args->secret_text);
321 379
 
322 380
 		// Set the user state as "denied" when using mail authentication
323
-		if($config->enable_confirm == 'Y') $args->denied = 'Y';
381
+		if($config->enable_confirm == 'Y') {
382
+			$args->denied = 'Y';
383
+		}
324 384
 		// Add extra vars after excluding necessary information from all the requested arguments
325 385
 		$extra_vars = delObjectVars($all_args, $args);
326 386
 		$args->extra_vars = serialize($extra_vars);
@@ -335,7 +395,9 @@  discard block
 block discarded – undo
335 395
 			}
336 396
 		}
337 397
 		$output = $this->insertMember($args);
338
-		if(!$output->toBool()) return $output;
398
+		if(!$output->toBool()) {
399
+			return $output;
400
+		}
339 401
 
340 402
 		// insert ProfileImage, ImageName, ImageMark
341 403
 		$profile_image = $_FILES['profile_image'];
@@ -374,43 +436,46 @@  discard block
 block discarded – undo
374 436
 			if($config->identifier == 'email_address')
375 437
 			{
376 438
 				$output = $this->doLogin($args->email_address);
377
-			}
378
-			else
439
+			} else
379 440
 			{
380 441
 				$output = $this->doLogin($args->user_id);
381 442
 			}
382 443
 			if(!$output->toBool()) {
383
-				if($output->error == -9)
384
-					$output->error = -11;
444
+				if($output->error == -9) {
445
+									$output->error = -11;
446
+				}
385 447
 				return $this->setRedirectUrl(getUrl('', 'act', 'dispMemberLoginForm'), $output);
386 448
 			}
387 449
 		}
388 450
 
389 451
 		// Results
390 452
 		$this->add('member_srl', $args->member_srl);
391
-		if($config->redirect_url) $this->add('redirect_url', $config->redirect_url);
453
+		if($config->redirect_url) {
454
+			$this->add('redirect_url', $config->redirect_url);
455
+		}
392 456
 		if($config->enable_confirm == 'Y')
393 457
 		{
394 458
 			$msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address);
395 459
 			$this->setMessage($msg);
396 460
 			return $this->setRedirectUrl(getUrl('', 'act', 'dispMemberLoginForm'), new Object(-12, $msg));
461
+		} else {
462
+			$this->setMessage('success_registed');
397 463
 		}
398
-		else $this->setMessage('success_registed');
399 464
 		// Call a trigger (after)
400 465
 		$trigger_output = ModuleHandler::triggerCall('member.procMemberInsert', 'after', $config);
401
-		if(!$trigger_output->toBool()) return $trigger_output;
466
+		if(!$trigger_output->toBool()) {
467
+			return $trigger_output;
468
+		}
402 469
 
403 470
 		if($config->redirect_url)
404 471
 		{
405 472
 			$returnUrl = $config->redirect_url;
406
-		}
407
-		else
473
+		} else
408 474
 		{
409 475
 			if(Context::get('success_return_url'))
410 476
 			{
411 477
 				$returnUrl = Context::get('success_return_url');
412
-			}
413
-			else if($_COOKIE['XE_REDIRECT_URL'])
478
+			} else if($_COOKIE['XE_REDIRECT_URL'])
414 479
 			{
415 480
 				$returnUrl = $_COOKIE['XE_REDIRECT_URL'];
416 481
 				setcookie("XE_REDIRECT_URL", '', 1);
@@ -464,8 +529,7 @@  discard block
 block discarded – undo
464 529
 		if(Context::get('success_return_url'))
465 530
 		{
466 531
 			$redirectUrl = Context::get('success_return_url');
467
-		}
468
-		else
532
+		} else
469 533
 		{
470 534
 			$redirectUrl = getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberModifyInfo');
471 535
 		}
@@ -509,13 +573,17 @@  discard block
 block discarded – undo
509 573
 		foreach($getVars as $val)
510 574
 		{
511 575
 			$args->{$val} = Context::get($val);
512
-			if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
576
+			if($val == 'birthday') {
577
+				$args->birthday_ui = Context::get('birthday_ui');
578
+			}
513 579
 		}
514 580
 		// Login Information
515 581
 		$logged_info = Context::get('logged_info');
516 582
 		$args->member_srl = $logged_info->member_srl;
517 583
 		$args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
518
-		if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
584
+		if(!$args->birthday && $args->birthday_ui) {
585
+			$args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
586
+		}
519 587
 		// Remove some unnecessary variables from all the vars
520 588
 		$all_args = Context::getRequestVars();
521 589
 		unset($all_args->module);
@@ -549,7 +617,9 @@  discard block
 block discarded – undo
549 617
 
550 618
 		// Execute insert or update depending on the value of member_srl
551 619
 		$output = $this->updateMember($args);
552
-		if(!$output->toBool()) return $output;
620
+		if(!$output->toBool()) {
621
+			return $output;
622
+		}
553 623
 
554 624
 		$profile_image = $_FILES['profile_image'];
555 625
 		if(is_uploaded_file($profile_image['tmp_name']))
@@ -579,7 +649,9 @@  discard block
 block discarded – undo
579 649
 
580 650
 		// Call a trigger after successfully log-in (after)
581 651
 		$trigger_output = ModuleHandler::triggerCall('member.procMemberModifyInfo', 'after', $this->memberInfo);
582
-		if(!$trigger_output->toBool()) return $trigger_output;
652
+		if(!$trigger_output->toBool()) {
653
+			return $trigger_output;
654
+		}
583 655
 
584 656
 		$this->setSessionInfo();
585 657
 		// Return result
@@ -600,7 +672,9 @@  discard block
 block discarded – undo
600 672
 	 */
601 673
 	function procMemberModifyPassword()
602 674
 	{
603
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
675
+		if(!Context::get('is_logged')) {
676
+			return $this->stop('msg_not_logged');
677
+		}
604 678
 		// Extract the necessary information in advance
605 679
 		$current_password = trim(Context::get('current_password'));
606 680
 		$password = trim(Context::get('password1'));
@@ -614,17 +688,23 @@  discard block
 block discarded – undo
614 688
 
615 689
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
616 690
 		// Verify the cuttent password
617
-		if(!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) return new Object(-1, 'invalid_password');
691
+		if(!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) {
692
+			return new Object(-1, 'invalid_password');
693
+		}
618 694
 
619 695
 		// Check if a new password is as same as the previous password
620
-		if($current_password == $password) return new Object(-1, 'invalid_new_password');
696
+		if($current_password == $password) {
697
+			return new Object(-1, 'invalid_new_password');
698
+		}
621 699
 
622 700
 		// Execute insert or update depending on the value of member_srl
623 701
 		$args = new stdClass;
624 702
 		$args->member_srl = $member_srl;
625 703
 		$args->password = $password;
626 704
 		$output = $this->updateMemberPassword($args);
627
-		if(!$output->toBool()) return $output;
705
+		if(!$output->toBool()) {
706
+			return $output;
707
+		}
628 708
 
629 709
 		$this->add('member_srl', $args->member_srl);
630 710
 		$this->setMessage('success_updated');
@@ -640,7 +720,9 @@  discard block
 block discarded – undo
640 720
 	 */
641 721
 	function procMemberLeave()
642 722
 	{
643
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
723
+		if(!Context::get('is_logged')) {
724
+			return $this->stop('msg_not_logged');
725
+		}
644 726
 		// Extract the necessary information in advance
645 727
 		$password = trim(Context::get('password'));
646 728
 		// Get information of logged-in user
@@ -656,10 +738,14 @@  discard block
 block discarded – undo
656 738
 			$this->memberInfo->password = $memberInfo->password;
657 739
 		}
658 740
 		// Verify the cuttent password
659
-		if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) return new Object(-1, 'invalid_password');
741
+		if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) {
742
+			return new Object(-1, 'invalid_password');
743
+		}
660 744
 
661 745
 		$output = $this->deleteMember($member_srl);
662
-		if(!$output->toBool()) return $output;
746
+		if(!$output->toBool()) {
747
+			return $output;
748
+		}
663 749
 		// Destroy all session information
664 750
 		$this->destroySessionInfo();
665 751
 		// Return success message
@@ -678,17 +764,25 @@  discard block
 block discarded – undo
678 764
 	{
679 765
 		// Check if the file is successfully uploaded
680 766
 		$file = $_FILES['profile_image'];
681
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_profile_image');
767
+		if(!is_uploaded_file($file['tmp_name'])) {
768
+			return $this->stop('msg_not_uploaded_profile_image');
769
+		}
682 770
 		// Ignore if member_srl is invalid or doesn't exist.
683 771
 		$member_srl = Context::get('member_srl');
684
-		if(!$member_srl) return $this->stop('msg_not_uploaded_profile_image');
772
+		if(!$member_srl) {
773
+			return $this->stop('msg_not_uploaded_profile_image');
774
+		}
685 775
 
686 776
 		$logged_info = Context::get('logged_info');
687
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_profile_image');
777
+		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) {
778
+			return $this->stop('msg_not_uploaded_profile_image');
779
+		}
688 780
 		// Return if member module is set not to use an image name or the user is not an administrator ;
689 781
 		$oModuleModel = getModel('module');
690 782
 		$config = $oModuleModel->getModuleConfig('member');
691
-		if($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') return $this->stop('msg_not_uploaded_profile_image');
783
+		if($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') {
784
+			return $this->stop('msg_not_uploaded_profile_image');
785
+		}
692 786
 
693 787
 		$this->insertProfileImage($member_srl, $file['tmp_name']);
694 788
 		// Page refresh
@@ -710,26 +804,35 @@  discard block
 block discarded – undo
710 804
 	{
711 805
 
712 806
 		// Check uploaded file
713
-		if(!checkUploadedFile($target_file)) return;
807
+		if(!checkUploadedFile($target_file)) {
808
+			return;
809
+		}
714 810
 
715 811
 		$oMemberModel = getModel('member');
716 812
 		$config = $oMemberModel->getMemberConfig();
717 813
 
718 814
 		// Get an image size
719 815
 		$max_width = $config->profile_image_max_width;
720
-		if(!$max_width) $max_width = "90";
816
+		if(!$max_width) {
817
+			$max_width = "90";
818
+		}
721 819
 		$max_height = $config->profile_image_max_height;
722
-		if(!$max_height) $max_height = "90";
820
+		if(!$max_height) {
821
+			$max_height = "90";
822
+		}
723 823
 		// Get a target path to save
724 824
 		$target_path = sprintf('files/member_extra_info/profile_image/%s', getNumberingPath($member_srl));
725 825
 		FileHandler::makeDir($target_path);
726 826
 
727 827
 		// Get file information
728 828
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
729
-		if(IMAGETYPE_PNG == $type) $ext = 'png';
730
-		elseif(IMAGETYPE_JPEG == $type) $ext = 'jpg';
731
-		elseif(IMAGETYPE_GIF == $type) $ext = 'gif';
732
-		else
829
+		if(IMAGETYPE_PNG == $type) {
830
+			$ext = 'png';
831
+		} elseif(IMAGETYPE_JPEG == $type) {
832
+			$ext = 'jpg';
833
+		} elseif(IMAGETYPE_GIF == $type) {
834
+			$ext = 'gif';
835
+		} else
733 836
 		{
734 837
 			return;
735 838
 		}
@@ -741,8 +844,7 @@  discard block
 block discarded – undo
741 844
 		if(($width > $max_width || $height > $max_height ) && $type != 1)
742 845
 		{
743 846
 			FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, $ext);
744
-		}
745
-		else
847
+		} else
746 848
 		{
747 849
 			@copy($target_file, $target_filename);
748 850
 		}
@@ -757,17 +859,25 @@  discard block
 block discarded – undo
757 859
 	{
758 860
 		// Check if the file is successfully uploaded
759 861
 		$file = $_FILES['image_name'];
760
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name');
862
+		if(!is_uploaded_file($file['tmp_name'])) {
863
+			return $this->stop('msg_not_uploaded_image_name');
864
+		}
761 865
 		// Ignore if member_srl is invalid or doesn't exist.
762 866
 		$member_srl = Context::get('member_srl');
763
-		if(!$member_srl) return $this->stop('msg_not_uploaded_image_name');
867
+		if(!$member_srl) {
868
+			return $this->stop('msg_not_uploaded_image_name');
869
+		}
764 870
 
765 871
 		$logged_info = Context::get('logged_info');
766
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name');
872
+		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) {
873
+			return $this->stop('msg_not_uploaded_image_name');
874
+		}
767 875
 		// Return if member module is set not to use an image name or the user is not an administrator ;
768 876
 		$oModuleModel = getModel('module');
769 877
 		$config = $oModuleModel->getModuleConfig('member');
770
-		if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name');
878
+		if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') {
879
+			return $this->stop('msg_not_uploaded_image_name');
880
+		}
771 881
 
772 882
 		$this->insertImageName($member_srl, $file['tmp_name']);
773 883
 		// Page refresh
@@ -788,15 +898,21 @@  discard block
 block discarded – undo
788 898
 	function insertImageName($member_srl, $target_file)
789 899
 	{
790 900
 		// Check uploaded file
791
-		if(!checkUploadedFile($target_file)) return;
901
+		if(!checkUploadedFile($target_file)) {
902
+			return;
903
+		}
792 904
 
793 905
 		$oModuleModel = getModel('module');
794 906
 		$config = $oModuleModel->getModuleConfig('member');
795 907
 		// Get an image size
796 908
 		$max_width = $config->image_name_max_width;
797
-		if(!$max_width) $max_width = "90";
909
+		if(!$max_width) {
910
+			$max_width = "90";
911
+		}
798 912
 		$max_height = $config->image_name_max_height;
799
-		if(!$max_height) $max_height = "20";
913
+		if(!$max_height) {
914
+			$max_height = "20";
915
+		}
800 916
 		// Get a target path to save
801 917
 		$target_path = sprintf('files/member_extra_info/image_name/%s/', getNumberingPath($member_srl));
802 918
 		FileHandler::makeDir($target_path);
@@ -805,8 +921,11 @@  discard block
 block discarded – undo
805 921
 		// Get file information
806 922
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
807 923
 		// Convert if the image size is larger than a given size or if the format is not a gif
808
-		if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
809
-		else @copy($target_file, $target_filename);
924
+		if($width > $max_width || $height > $max_height || $type!=1) {
925
+			FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
926
+		} else {
927
+			@copy($target_file, $target_filename);
928
+		}
810 929
 	}
811 930
 
812 931
 	/**
@@ -866,17 +985,25 @@  discard block
 block discarded – undo
866 985
 	{
867 986
 		// Check if the file is successfully uploaded
868 987
 		$file = $_FILES['image_mark'];
869
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark');
988
+		if(!is_uploaded_file($file['tmp_name'])) {
989
+			return $this->stop('msg_not_uploaded_image_mark');
990
+		}
870 991
 		// Ignore if member_srl is invalid or doesn't exist.
871 992
 		$member_srl = Context::get('member_srl');
872
-		if(!$member_srl) return $this->stop('msg_not_uploaded_image_mark');
993
+		if(!$member_srl) {
994
+			return $this->stop('msg_not_uploaded_image_mark');
995
+		}
873 996
 
874 997
 		$logged_info = Context::get('logged_info');
875
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark');
998
+		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) {
999
+			return $this->stop('msg_not_uploaded_image_mark');
1000
+		}
876 1001
 		// Membership in the images mark the module using the ban was set by an administrator or return;
877 1002
 		$oModuleModel = getModel('module');
878 1003
 		$config = $oModuleModel->getModuleConfig('member');
879
-		if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark');
1004
+		if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') {
1005
+			return $this->stop('msg_not_uploaded_image_mark');
1006
+		}
880 1007
 
881 1008
 		$this->insertImageMark($member_srl, $file['tmp_name']);
882 1009
 		// Page refresh
@@ -897,15 +1024,21 @@  discard block
 block discarded – undo
897 1024
 	function insertImageMark($member_srl, $target_file)
898 1025
 	{
899 1026
 		// Check uploaded file
900
-		if(!checkUploadedFile($target_file)) return;
1027
+		if(!checkUploadedFile($target_file)) {
1028
+			return;
1029
+		}
901 1030
 
902 1031
 		$oModuleModel = getModel('module');
903 1032
 		$config = $oModuleModel->getModuleConfig('member');
904 1033
 		// Get an image size
905 1034
 		$max_width = $config->image_mark_max_width;
906
-		if(!$max_width) $max_width = "20";
1035
+		if(!$max_width) {
1036
+			$max_width = "20";
1037
+		}
907 1038
 		$max_height = $config->image_mark_max_height;
908
-		if(!$max_height) $max_height = "20";
1039
+		if(!$max_height) {
1040
+			$max_height = "20";
1041
+		}
909 1042
 
910 1043
 		$target_path = sprintf('files/member_extra_info/image_mark/%s/', getNumberingPath($member_srl));
911 1044
 		FileHandler::makeDir($target_path);
@@ -914,8 +1047,11 @@  discard block
 block discarded – undo
914 1047
 		// Get file information
915 1048
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
916 1049
 
917
-		if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
918
-		else @copy($target_file, $target_filename);
1050
+		if($width > $max_width || $height > $max_height || $type!=1) {
1051
+			FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
1052
+		} else {
1053
+			@copy($target_file, $target_filename);
1054
+		}
919 1055
 	}
920 1056
 
921 1057
 	/**
@@ -950,14 +1086,18 @@  discard block
 block discarded – undo
950 1086
 	function procMemberFindAccount()
951 1087
 	{
952 1088
 		$email_address = Context::get('email_address');
953
-		if(!$email_address) return new Object(-1, 'msg_invalid_request');
1089
+		if(!$email_address) {
1090
+			return new Object(-1, 'msg_invalid_request');
1091
+		}
954 1092
 
955 1093
 		$oMemberModel = getModel('member');
956 1094
 		$oModuleModel = getModel('module');
957 1095
 
958 1096
 		// Check if a member having the same email address exists
959 1097
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
960
-		if(!$member_srl) return new Object(-1, 'msg_email_not_exists');
1098
+		if(!$member_srl) {
1099
+			return new Object(-1, 'msg_email_not_exists');
1100
+		}
961 1101
 
962 1102
 		// Get information of the member
963 1103
 		$columnList = array('denied', 'member_srl', 'user_id', 'user_name', 'email_address', 'nick_name');
@@ -969,7 +1109,9 @@  discard block
 block discarded – undo
969 1109
 			$chk_args = new stdClass;
970 1110
 			$chk_args->member_srl = $member_info->member_srl;
971 1111
 			$output = executeQuery('member.chkAuthMail', $chk_args);
972
-			if($output->toBool() && $output->data->count != '0') return new Object(-1, 'msg_user_not_confirmed');
1112
+			if($output->toBool() && $output->data->count != '0') {
1113
+				return new Object(-1, 'msg_user_not_confirmed');
1114
+			}
973 1115
 		}
974 1116
 
975 1117
 		// Insert data into the authentication DB
@@ -982,7 +1124,9 @@  discard block
 block discarded – undo
982 1124
 		$args->is_register = 'N';
983 1125
 
984 1126
 		$output = executeQuery('member.insertAuthMail', $args);
985
-		if(!$output->toBool()) return $output;
1127
+		if(!$output->toBool()) {
1128
+			return $output;
1129
+		}
986 1130
 		// Get content of the email to send a member
987 1131
 		Context::set('auth_args', $args);
988 1132
 
@@ -999,8 +1143,7 @@  discard block
 block discarded – undo
999 1143
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1000 1144
 				}
1001 1145
 			}
1002
-		}
1003
-		else
1146
+		} else
1004 1147
 		{
1005 1148
 			$memberInfo[$lang->user_id] = $args->user_id;
1006 1149
 			$memberInfo[$lang->user_name] = $args->user_name;
@@ -1009,13 +1152,19 @@  discard block
 block discarded – undo
1009 1152
 		}
1010 1153
 		Context::set('memberInfo', $memberInfo);
1011 1154
 
1012
-		if(!$member_config->skin) $member_config->skin = "default";
1013
-		if(!$member_config->colorset) $member_config->colorset = "white";
1155
+		if(!$member_config->skin) {
1156
+			$member_config->skin = "default";
1157
+		}
1158
+		if(!$member_config->colorset) {
1159
+			$member_config->colorset = "white";
1160
+		}
1014 1161
 
1015 1162
 		Context::set('member_config', $member_config);
1016 1163
 
1017 1164
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1018
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1165
+		if(!is_dir($tpl_path)) {
1166
+			$tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1167
+		}
1019 1168
 
1020 1169
 		$find_url = getFullUrl ('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key);
1021 1170
 		Context::set('find_url', $find_url);
@@ -1057,20 +1206,28 @@  discard block
 block discarded – undo
1057 1206
 		$find_account_question = trim(Context::get('find_account_question'));
1058 1207
 		$find_account_answer = trim(Context::get('find_account_answer'));
1059 1208
 
1060
-		if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new Object(-1, 'msg_invalid_request');
1209
+		if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) {
1210
+			return new Object(-1, 'msg_invalid_request');
1211
+		}
1061 1212
 
1062 1213
 		$oModuleModel = getModel('module');
1063 1214
 		// Check if a member having the same email address exists
1064 1215
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1065
-		if(!$member_srl) return new Object(-1, 'msg_email_not_exists');
1216
+		if(!$member_srl) {
1217
+			return new Object(-1, 'msg_email_not_exists');
1218
+		}
1066 1219
 		// Get information of the member
1067 1220
 		$columnList = array('member_srl', 'find_account_question', 'find_account_answer');
1068 1221
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
1069 1222
 
1070 1223
 		// Display a message if no answer is entered
1071
-		if(!$member_info->find_account_question || !$member_info->find_account_answer) return new Object(-1, 'msg_question_not_exists');
1224
+		if(!$member_info->find_account_question || !$member_info->find_account_answer) {
1225
+			return new Object(-1, 'msg_question_not_exists');
1226
+		}
1072 1227
 
1073
-		if(trim($member_info->find_account_question) != $find_account_question || trim($member_info->find_account_answer) != $find_account_answer) return new Object(-1, 'msg_answer_not_matches');
1228
+		if(trim($member_info->find_account_question) != $find_account_question || trim($member_info->find_account_answer) != $find_account_answer) {
1229
+			return new Object(-1, 'msg_answer_not_matches');
1230
+		}
1074 1231
 
1075 1232
 		if($config->identifier == 'email_address')
1076 1233
 		{
@@ -1086,7 +1243,9 @@  discard block
 block discarded – undo
1086 1243
 		$args->password = $temp_password;
1087 1244
 		$args->change_password_date = '1';
1088 1245
 		$output = $this->updateMemberPassword($args);
1089
-		if(!$output->toBool()) return $output;
1246
+		if(!$output->toBool()) {
1247
+			return $output;
1248
+		}
1090 1249
 
1091 1250
 		$_SESSION['xe_temp_password_' . $user_id] = $temp_password;
1092 1251
 
@@ -1143,8 +1302,7 @@  discard block
 block discarded – undo
1143 1302
 		if($output->data->is_register == 'Y')
1144 1303
 		{
1145 1304
 			$args->denied = 'N';
1146
-		}
1147
-		else
1305
+		} else
1148 1306
 		{
1149 1307
 			$args->password = $oMemberModel->hashPassword($args->password);
1150 1308
 		}
@@ -1178,33 +1336,45 @@  discard block
 block discarded – undo
1178 1336
 	{
1179 1337
 		// Get an email_address
1180 1338
 		$email_address = Context::get('email_address');
1181
-		if(!$email_address) return new Object(-1, 'msg_invalid_request');
1339
+		if(!$email_address) {
1340
+			return new Object(-1, 'msg_invalid_request');
1341
+		}
1182 1342
 		// Log test by using email_address
1183 1343
 		$oMemberModel = getModel('member');
1184 1344
 
1185 1345
 		$args = new stdClass;
1186 1346
 		$args->email_address = $email_address;
1187 1347
 		$memberSrl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1188
-		if(!$memberSrl) return new Object(-1, 'msg_not_exists_member');
1348
+		if(!$memberSrl) {
1349
+			return new Object(-1, 'msg_not_exists_member');
1350
+		}
1189 1351
 
1190 1352
 		$columnList = array('member_srl', 'user_id', 'user_name', 'nick_name', 'email_address');
1191 1353
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($memberSrl, 0, $columnList);
1192 1354
 
1193 1355
 		$oModuleModel = getModel('module');
1194 1356
 		$member_config = $oModuleModel->getModuleConfig('member');
1195
-		if(!$member_config->skin) $member_config->skin = "default";
1196
-		if(!$member_config->colorset) $member_config->colorset = "white";
1357
+		if(!$member_config->skin) {
1358
+			$member_config->skin = "default";
1359
+		}
1360
+		if(!$member_config->colorset) {
1361
+			$member_config->colorset = "white";
1362
+		}
1197 1363
 
1198 1364
 		// Check if a authentication mail has been sent previously
1199 1365
 		$chk_args = new stdClass;
1200 1366
 		$chk_args->member_srl = $member_info->member_srl;
1201 1367
 		$output = executeQuery('member.chkAuthMail', $chk_args);
1202
-		if($output->toBool() && $output->data->count == '0') return new Object(-1, 'msg_invalid_request');
1368
+		if($output->toBool() && $output->data->count == '0') {
1369
+			return new Object(-1, 'msg_invalid_request');
1370
+		}
1203 1371
 
1204 1372
 		$auth_args = new stdClass;
1205 1373
 		$auth_args->member_srl = $member_info->member_srl;
1206 1374
 		$output = executeQueryArray('member.getAuthMailInfo', $auth_args);
1207
-		if(!$output->data || !$output->data[0]->auth_key)  return new Object(-1, 'msg_invalid_request');
1375
+		if(!$output->data || !$output->data[0]->auth_key) {
1376
+			return new Object(-1, 'msg_invalid_request');
1377
+		}
1208 1378
 		$auth_info = $output->data[0];
1209 1379
 
1210 1380
 		// Update the regdate of authmail entry
@@ -1225,8 +1395,7 @@  discard block
 block discarded – undo
1225 1395
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1226 1396
 				}
1227 1397
 			}
1228
-		}
1229
-		else
1398
+		} else
1230 1399
 		{
1231 1400
 			$memberInfo[$lang->user_id] = $member_info->user_id;
1232 1401
 			$memberInfo[$lang->user_name] = $member_info->user_name;
@@ -1239,7 +1408,9 @@  discard block
 block discarded – undo
1239 1408
 		Context::set('member_config', $member_config);
1240 1409
 
1241 1410
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1242
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1411
+		if(!is_dir($tpl_path)) {
1412
+			$tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1413
+		}
1243 1414
 
1244 1415
 		$auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_info->auth_key);
1245 1416
 		Context::set('auth_url', $auth_url);
@@ -1317,7 +1488,9 @@  discard block
 block discarded – undo
1317 1488
 		$auth_args->is_register = 'Y';
1318 1489
 
1319 1490
 		$output = executeQuery('member.insertAuthMail', $auth_args);
1320
-		if(!$output->toBool()) return $output;
1491
+		if(!$output->toBool()) {
1492
+			return $output;
1493
+		}
1321 1494
 
1322 1495
 		$memberInfo->email_address = $newEmail;
1323 1496
 
@@ -1351,8 +1524,7 @@  discard block
 block discarded – undo
1351 1524
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1352 1525
 				}
1353 1526
 			}
1354
-		}
1355
-		else
1527
+		} else
1356 1528
 		{
1357 1529
 			$memberInfo[$lang->user_id] = $member_info->user_id;
1358 1530
 			$memberInfo[$lang->user_name] = $member_info->user_name;
@@ -1361,13 +1533,19 @@  discard block
 block discarded – undo
1361 1533
 		}
1362 1534
 		Context::set('memberInfo', $memberInfo);
1363 1535
 
1364
-		if(!$member_config->skin) $member_config->skin = "default";
1365
-		if(!$member_config->colorset) $member_config->colorset = "white";
1536
+		if(!$member_config->skin) {
1537
+			$member_config->skin = "default";
1538
+		}
1539
+		if(!$member_config->colorset) {
1540
+			$member_config->colorset = "white";
1541
+		}
1366 1542
 
1367 1543
 		Context::set('member_config', $member_config);
1368 1544
 
1369 1545
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1370
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1546
+		if(!is_dir($tpl_path)) {
1547
+			$tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1548
+		}
1371 1549
 
1372 1550
 		$auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key);
1373 1551
 		Context::set('auth_url', $auth_url);
@@ -1392,7 +1570,9 @@  discard block
 block discarded – undo
1392 1570
 	{
1393 1571
 		$site_module_info = Context::get('site_module_info');
1394 1572
 		$logged_info = Context::get('logged_info');
1395
-		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new Object(-1,'msg_invalid_request');
1573
+		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) {
1574
+			return new Object(-1,'msg_invalid_request');
1575
+		}
1396 1576
 
1397 1577
 		$oMemberModel = getModel('member');
1398 1578
 		$columnList = array('site_srl', 'group_srl', 'title');
@@ -1411,13 +1591,17 @@  discard block
 block discarded – undo
1411 1591
 	{
1412 1592
 		$site_module_info = Context::get('site_module_info');
1413 1593
 		$logged_info = Context::get('logged_info');
1414
-		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new Object(-1,'msg_invalid_request');
1594
+		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) {
1595
+			return new Object(-1,'msg_invalid_request');
1596
+		}
1415 1597
 
1416 1598
 		$args = new stdClass;
1417 1599
 		$args->site_srl= $site_module_info->site_srl;
1418 1600
 		$args->member_srl = $logged_info->member_srl;
1419 1601
 		$output = executeQuery('member.deleteMembersGroup', $args);
1420
-		if(!$output->toBool()) return $output;
1602
+		if(!$output->toBool()) {
1603
+			return $output;
1604
+		}
1421 1605
 		$this->setMessage('success_deleted');
1422 1606
 		$this->_clearMemberCache($args->member_srl, $site_module_info->site_srl);
1423 1607
 	}
@@ -1431,17 +1615,37 @@  discard block
 block discarded – undo
1431 1615
 	 */
1432 1616
 	function setMemberConfig($args)
1433 1617
 	{
1434
-		if(!$args->skin) $args->skin = "default";
1435
-		if(!$args->colorset) $args->colorset = "white";
1436
-		if(!$args->editor_skin) $args->editor_skin= "ckeditor";
1437
-		if(!$args->editor_colorset) $args->editor_colorset = "moono";
1438
-		if($args->enable_join!='Y') $args->enable_join = 'N';
1618
+		if(!$args->skin) {
1619
+			$args->skin = "default";
1620
+		}
1621
+		if(!$args->colorset) {
1622
+			$args->colorset = "white";
1623
+		}
1624
+		if(!$args->editor_skin) {
1625
+			$args->editor_skin= "ckeditor";
1626
+		}
1627
+		if(!$args->editor_colorset) {
1628
+			$args->editor_colorset = "moono";
1629
+		}
1630
+		if($args->enable_join!='Y') {
1631
+			$args->enable_join = 'N';
1632
+		}
1439 1633
 		$args->enable_openid= 'N';
1440
-		if($args->profile_image !='Y') $args->profile_image = 'N';
1441
-		if($args->image_name!='Y') $args->image_name = 'N';
1442
-		if($args->image_mark!='Y') $args->image_mark = 'N';
1443
-		if($args->group_image_mark!='Y') $args->group_image_mark = 'N';
1444
-		if(!trim(strip_tags($args->agreement))) $args->agreement = null;
1634
+		if($args->profile_image !='Y') {
1635
+			$args->profile_image = 'N';
1636
+		}
1637
+		if($args->image_name!='Y') {
1638
+			$args->image_name = 'N';
1639
+		}
1640
+		if($args->image_mark!='Y') {
1641
+			$args->image_mark = 'N';
1642
+		}
1643
+		if($args->group_image_mark!='Y') {
1644
+			$args->group_image_mark = 'N';
1645
+		}
1646
+		if(!trim(strip_tags($args->agreement))) {
1647
+			$args->agreement = null;
1648
+		}
1445 1649
 		$args->limit_day = (int)$args->limit_day;
1446 1650
 
1447 1651
 		$agreement = trim($args->agreement);
@@ -1449,7 +1653,9 @@  discard block
 block discarded – undo
1449 1653
 
1450 1654
 		$oModuleController = getController('module');
1451 1655
 		$output = $oModuleController->insertModuleConfig('member',$args);
1452
-		if(!$output->toBool()) return $output;
1656
+		if(!$output->toBool()) {
1657
+			return $output;
1658
+		}
1453 1659
 
1454 1660
 		$agreement_file = _XE_PATH_.'files/member_extra_info/agreement.txt';
1455 1661
 		FileHandler::writeFile($agreement_file, $agreement);
@@ -1474,7 +1680,9 @@  discard block
 block discarded – undo
1474 1680
 		$path = sprintf('files/member_extra_info/signature/%s/', getNumberingPath($member_srl));
1475 1681
 		$filename = sprintf('%s%d.signature.php', $path, $member_srl);
1476 1682
 
1477
-		if(!$check_signature) return FileHandler::removeFile($filename);
1683
+		if(!$check_signature) {
1684
+			return FileHandler::removeFile($filename);
1685
+		}
1478 1686
 
1479 1687
 		$buff = sprintf('<?php if(!defined("__XE__")) exit();?>%s', $signature);
1480 1688
 		FileHandler::makeDir($path);
@@ -1508,7 +1716,9 @@  discard block
 block discarded – undo
1508 1716
 		$args = new stdClass();
1509 1717
 		$args->member_srl = $member_srl;
1510 1718
 		$args->group_srl = $group_srl;
1511
-		if($site_srl) $args->site_srl = $site_srl;
1719
+		if($site_srl) {
1720
+			$args->site_srl = $site_srl;
1721
+		}
1512 1722
 
1513 1723
 		// Add
1514 1724
 		$output = executeQuery('member.addMemberToGroup',$args);
@@ -1534,15 +1744,21 @@  discard block
 block discarded – undo
1534 1744
 		$obj->member_srl = implode(',',$args->member_srl);
1535 1745
 
1536 1746
 		$output = executeQueryArray('member.getMembersGroup', $obj);
1537
-		if($output->data) foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate;
1747
+		if($output->data) {
1748
+			foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate;
1749
+		}
1538 1750
 
1539 1751
 		$output = executeQuery('member.deleteMembersGroup', $obj);
1540
-		if(!$output->toBool()) return $output;
1752
+		if(!$output->toBool()) {
1753
+			return $output;
1754
+		}
1541 1755
 
1542 1756
 		$inserted_members = array();
1543 1757
 		foreach($args->member_srl as $key => $val)
1544 1758
 		{
1545
-			if($inserted_members[$val]) continue;
1759
+			if($inserted_members[$val]) {
1760
+				continue;
1761
+			}
1546 1762
 			$inserted_members[$val] = true;
1547 1763
 
1548 1764
 			unset($obj);
@@ -1552,7 +1768,9 @@  discard block
 block discarded – undo
1552 1768
 			$obj->site_srl = $args->site_srl;
1553 1769
 			$obj->regdate = $date[$obj->member_srl];
1554 1770
 			$output = executeQuery('member.addMemberToGroup', $obj);
1555
-			if(!$output->toBool()) return $output;
1771
+			if(!$output->toBool()) {
1772
+				return $output;
1773
+			}
1556 1774
 
1557 1775
 			$this->_clearMemberCache($obj->member_srl, $args->site_srl);
1558 1776
 		}
@@ -1614,8 +1832,7 @@  discard block
 block discarded – undo
1614 1832
 				if($config->identifier == 'user_id')
1615 1833
 				{
1616 1834
 					$member_info = $oMemberModel->getMemberInfoByUserID($user_id, $columnList);
1617
-				}
1618
-				else
1835
+				} else
1619 1836
 				{
1620 1837
 					$member_info = $oMemberModel->getMemberInfoByEmailAddress($user_id, $columnList);
1621 1838
 				}
@@ -1624,8 +1841,7 @@  discard block
 block discarded – undo
1624 1841
 					$do_auto_login = true;
1625 1842
 				}
1626 1843
 
1627
-			}
1628
-			else
1844
+			} else
1629 1845
 			{
1630 1846
 				$do_auto_login = true;
1631 1847
 			}
@@ -1634,8 +1850,7 @@  discard block
 block discarded – undo
1634 1850
 		if($do_auto_login)
1635 1851
 		{
1636 1852
 			$output = $this->doLogin($user_id);
1637
-		}
1638
-		else
1853
+		} else
1639 1854
 		{
1640 1855
 			executeQuery('member.deleteAutologin', $args);
1641 1856
 			setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365, '/');
@@ -1654,13 +1869,17 @@  discard block
 block discarded – undo
1654 1869
 	function doLogin($user_id, $password = '', $keep_signed = false)
1655 1870
 	{
1656 1871
 		$user_id = strtolower($user_id);
1657
-		if(!$user_id) return new Object(-1, 'null_user_id');
1872
+		if(!$user_id) {
1873
+			return new Object(-1, 'null_user_id');
1874
+		}
1658 1875
 		// Call a trigger before log-in (before)
1659 1876
 		$trigger_obj = new stdClass();
1660 1877
 		$trigger_obj->user_id = $user_id;
1661 1878
 		$trigger_obj->password = $password;
1662 1879
 		$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'before', $trigger_obj);
1663
-		if(!$trigger_output->toBool()) return $trigger_output;
1880
+		if(!$trigger_output->toBool()) {
1881
+			return $trigger_output;
1882
+		}
1664 1883
 		// Create a member model object
1665 1884
 		$oMemberModel = getModel('member');
1666 1885
 
@@ -1675,15 +1894,18 @@  discard block
 block discarded – undo
1675 1894
 			// Get user_id information
1676 1895
 			$this->memberInfo = $oMemberModel->getMemberInfoByEmailAddress($user_id);
1677 1896
 			// Set an invalid user if no value returned
1678
-			if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address');
1897
+			if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) {
1898
+				return $this->recordLoginError(-1, 'invalid_email_address');
1899
+			}
1679 1900
 
1680
-		}
1681
-		else
1901
+		} else
1682 1902
 		{
1683 1903
 			// Get user_id information
1684 1904
 			$this->memberInfo = $oMemberModel->getMemberInfoByUserID($user_id);
1685 1905
 			// Set an invalid user if no value returned
1686
-			if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id');
1906
+			if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) {
1907
+				return $this->recordLoginError(-1, 'invalid_user_id');
1908
+			}
1687 1909
 		}
1688 1910
 
1689 1911
 		$output = executeQuery('member.getLoginCountByIp', $args);
@@ -1695,14 +1917,18 @@  discard block
 block discarded – undo
1695 1917
 			if($term < $config->max_error_count_time)
1696 1918
 			{
1697 1919
 				$term = $config->max_error_count_time - $term;
1698
-				if($term < 60) $term = intval($term).Context::getLang('unit_sec');
1699
-				elseif(60 <= $term && $term < 3600) $term = intval($term/60).Context::getLang('unit_min');
1700
-				elseif(3600 <= $term && $term < 86400) $term = intval($term/3600).Context::getLang('unit_hour');
1701
-				else $term = intval($term/86400).Context::getLang('unit_day');
1920
+				if($term < 60) {
1921
+					$term = intval($term).Context::getLang('unit_sec');
1922
+				} elseif(60 <= $term && $term < 3600) {
1923
+					$term = intval($term/60).Context::getLang('unit_min');
1924
+				} elseif(3600 <= $term && $term < 86400) {
1925
+					$term = intval($term/3600).Context::getLang('unit_hour');
1926
+				} else {
1927
+					$term = intval($term/86400).Context::getLang('unit_day');
1928
+				}
1702 1929
 
1703 1930
 				return new Object(-1, sprintf(Context::getLang('excess_ip_access_count'),$term));
1704
-			}
1705
-			else
1931
+			} else
1706 1932
 			{
1707 1933
 				$args->ipaddress = $_SERVER['REMOTE_ADDR'];
1708 1934
 				$output = executeQuery('member.deleteLoginCountByIp', $args);
@@ -1729,7 +1955,9 @@  discard block
 block discarded – undo
1729 1955
 			return new Object(-1,'msg_user_denied');
1730 1956
 		}
1731 1957
 		// Notify if denied_date is less than the current time
1732
-		if($this->memberInfo->limit_date && substr($this->memberInfo->limit_date,0,8) >= date("Ymd")) return new Object(-9,sprintf(Context::getLang('msg_user_limited'),zdate($this->memberInfo->limit_date,"Y-m-d")));
1958
+		if($this->memberInfo->limit_date && substr($this->memberInfo->limit_date,0,8) >= date("Ymd")) {
1959
+			return new Object(-9,sprintf(Context::getLang('msg_user_limited'),zdate($this->memberInfo->limit_date,"Y-m-d")));
1960
+		}
1733 1961
 		// Update the latest login time
1734 1962
 		$args->member_srl = $this->memberInfo->member_srl;
1735 1963
 		$output = executeQuery('member.updateLastLogin', $args);
@@ -1778,7 +2006,9 @@  discard block
 block discarded – undo
1778 2006
 		}
1779 2007
 		// Call a trigger after successfully log-in (after)
1780 2008
 		$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'after', $this->memberInfo);
1781
-		if(!$trigger_output->toBool()) return $trigger_output;
2009
+		if(!$trigger_output->toBool()) {
2010
+			return $trigger_output;
2011
+		}
1782 2012
 		// When user checked to use auto-login
1783 2013
 		if($keep_signed)
1784 2014
 		{
@@ -1792,7 +2022,9 @@  discard block
 block discarded – undo
1792 2022
 			$autologin_args->member_srl = $this->memberInfo->member_srl;
1793 2023
 			executeQuery('member.deleteAutologin', $autologin_args);
1794 2024
 			$autologin_output = executeQuery('member.insertAutologin', $autologin_args);
1795
-			if($autologin_output->toBool()) setCookie('xeak',$autologin_args->autologin_key, $_SERVER['REQUEST_TIME']+31536000, '/');
2025
+			if($autologin_output->toBool()) {
2026
+				setCookie('xeak',$autologin_args->autologin_key, $_SERVER['REQUEST_TIME']+31536000, '/');
2027
+			}
1796 2028
 		}
1797 2029
 		if($this->memberInfo->is_admin == 'Y')
1798 2030
 		{
@@ -1881,7 +2113,9 @@  discard block
 block discarded – undo
1881 2113
 	function addMemberPopupMenu($url, $str, $icon = '', $target = 'self')
1882 2114
 	{
1883 2115
 		$member_popup_menu_list = Context::get('member_popup_menu_list');
1884
-		if(!is_array($member_popup_menu_list)) $member_popup_menu_list = array();
2116
+		if(!is_array($member_popup_menu_list)) {
2117
+			$member_popup_menu_list = array();
2118
+		}
1885 2119
 
1886 2120
 		$obj = new stdClass;
1887 2121
 		$obj->url = $url;
@@ -1900,35 +2134,52 @@  discard block
 block discarded – undo
1900 2134
 	{
1901 2135
 		// Call a trigger (before)
1902 2136
 		$output = ModuleHandler::triggerCall('member.insertMember', 'before', $args);
1903
-		if(!$output->toBool()) return $output;
2137
+		if(!$output->toBool()) {
2138
+			return $output;
2139
+		}
1904 2140
 		// Terms and Conditions portion of the information set up by members reaffirmed
1905 2141
 		$oModuleModel = getModel('module');
1906 2142
 		$config = $oModuleModel->getModuleConfig('member');
1907 2143
 
1908 2144
 		$logged_info = Context::get('logged_info');
1909 2145
 		// If the date of the temporary restrictions limit further information on the date of
1910
-		if($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24);
2146
+		if($config->limit_day) {
2147
+			$args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24);
2148
+		}
1911 2149
 
1912 2150
 		$args->member_srl = getNextSequence();
1913 2151
 		$args->list_order = -1 * $args->member_srl;
1914 2152
 
1915 2153
 		// Execute insert or update depending on the value of member_srl
1916
-		if(!$args->user_id) $args->user_id = 't'.$args->member_srl;
2154
+		if(!$args->user_id) {
2155
+			$args->user_id = 't'.$args->member_srl;
2156
+		}
1917 2157
 		// Enter the user's identity changed to lowercase
1918
-		else $args->user_id = strtolower($args->user_id);
1919
-		if(!$args->user_name) $args->user_name = $args->member_srl;
1920
-		if(!$args->nick_name) $args->nick_name = $args->member_srl;
2158
+		else {
2159
+			$args->user_id = strtolower($args->user_id);
2160
+		}
2161
+		if(!$args->user_name) {
2162
+			$args->user_name = $args->member_srl;
2163
+		}
2164
+		if(!$args->nick_name) {
2165
+			$args->nick_name = $args->member_srl;
2166
+		}
1921 2167
 
1922 2168
 		// Control of essential parameters
1923
-		if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
1924
-		if($args->denied!='Y') $args->denied = 'N';
2169
+		if($args->allow_mailing!='Y') {
2170
+			$args->allow_mailing = 'N';
2171
+		}
2172
+		if($args->denied!='Y') {
2173
+			$args->denied = 'N';
2174
+		}
1925 2175
 		$args->allow_message= 'Y';
1926 2176
 
1927 2177
 		if($logged_info->is_admin == 'Y')
1928 2178
 		{
1929
-			if($args->is_admin!='Y') $args->is_admin = 'N';
1930
-		}
1931
-		else
2179
+			if($args->is_admin!='Y') {
2180
+				$args->is_admin = 'N';
2181
+			}
2182
+		} else
1932 2183
 		{
1933 2184
 			unset($args->is_admin);
1934 2185
 		}
@@ -1941,8 +2192,12 @@  discard block
 block discarded – undo
1941 2192
 		$args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
1942 2193
 		$args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
1943 2194
 		$args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
1944
-		if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
1945
-		if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) $args->blog = 'http://'.$args->blog;
2195
+		if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) {
2196
+			$args->homepage = 'http://'.$args->homepage;
2197
+		}
2198
+		if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) {
2199
+			$args->blog = 'http://'.$args->blog;
2200
+		}
1946 2201
 
1947 2202
 		// Create a model object
1948 2203
 		$oMemberModel = getModel('member');
@@ -1956,8 +2211,7 @@  discard block
 block discarded – undo
1956 2211
 				return new Object(-1, $message[$config->password_strength]);
1957 2212
 			}
1958 2213
 			$args->password = $oMemberModel->hashPassword($args->password);
1959
-		}
1960
-		elseif(!$args->password)
2214
+		} elseif(!$args->password)
1961 2215
 		{
1962 2216
 			unset($args->password);
1963 2217
 		}
@@ -1998,8 +2252,12 @@  discard block
 block discarded – undo
1998 2252
 		// Insert data into the DB
1999 2253
 		$args->list_order = -1 * $args->member_srl;
2000 2254
 
2001
-		if(!$args->user_id) $args->user_id = 't'.$args->member_srl;
2002
-		if(!$args->user_name) $args->user_name = $args->member_srl;
2255
+		if(!$args->user_id) {
2256
+			$args->user_id = 't'.$args->member_srl;
2257
+		}
2258
+		if(!$args->user_name) {
2259
+			$args->user_name = $args->member_srl;
2260
+		}
2003 2261
 
2004 2262
 		$oDB = &DB::getInstance();
2005 2263
 		$oDB->begin();
@@ -2011,8 +2269,11 @@  discard block
 block discarded – undo
2011 2269
 			return $output;
2012 2270
 		}
2013 2271
 
2014
-		if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2015
-		else $group_srl_list = explode('|@|', $args->group_srl_list);
2272
+		if(is_array($args->group_srl_list)) {
2273
+			$group_srl_list = $args->group_srl_list;
2274
+		} else {
2275
+			$group_srl_list = explode('|@|', $args->group_srl_list);
2276
+		}
2016 2277
 		// If no value is entered the default group, the value of group registration
2017 2278
 		if(!$args->group_srl_list)
2018 2279
 		{
@@ -2029,8 +2290,7 @@  discard block
 block discarded – undo
2029 2290
 				}
2030 2291
 			}
2031 2292
 			// If the value is the value of the group entered the group registration
2032
-		}
2033
-		else
2293
+		} else
2034 2294
 		{
2035 2295
 			for($i=0;$i<count($group_srl_list);$i++)
2036 2296
 			{
@@ -2091,27 +2351,39 @@  discard block
 block discarded – undo
2091 2351
 	{
2092 2352
 		// Call a trigger (before)
2093 2353
 		$output = ModuleHandler::triggerCall('member.updateMember', 'before', $args);
2094
-		if(!$output->toBool()) return $output;
2354
+		if(!$output->toBool()) {
2355
+			return $output;
2356
+		}
2095 2357
 		// Create a model object
2096 2358
 		$oMemberModel = getModel('member');
2097 2359
 
2098 2360
 		$logged_info = Context::get('logged_info');
2099 2361
 		// Get what you want to modify the original information
2100
-		if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2362
+		if(!$this->memberInfo) {
2363
+			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2364
+		}
2101 2365
 		// Control of essential parameters
2102
-		if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
2103
-		if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) $args->allow_message = 'Y';
2366
+		if($args->allow_mailing!='Y') {
2367
+			$args->allow_mailing = 'N';
2368
+		}
2369
+		if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) {
2370
+			$args->allow_message = 'Y';
2371
+		}
2104 2372
 
2105 2373
 		if($logged_info->is_admin == 'Y')
2106 2374
 		{
2107
-			if($args->denied!='Y') $args->denied = 'N';
2108
-			if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N';
2109
-		}
2110
-		else
2375
+			if($args->denied!='Y') {
2376
+				$args->denied = 'N';
2377
+			}
2378
+			if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) {
2379
+				$args->is_admin = 'N';
2380
+			}
2381
+		} else
2111 2382
 		{
2112 2383
 			unset($args->is_admin);
2113
-			if($is_admin == false)
2114
-				unset($args->denied);
2384
+			if($is_admin == false) {
2385
+							unset($args->denied);
2386
+			}
2115 2387
 			if($logged_info->member_srl != $args->member_srl && $is_admin == false)
2116 2388
 			{
2117 2389
 				return $this->stop('msg_invalid_request');
@@ -2119,13 +2391,19 @@  discard block
 block discarded – undo
2119 2391
 		}
2120 2392
 
2121 2393
 		// Sanitize user ID, username, nickname, homepage, blog
2122
-		if($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2394
+		if($args->user_id) {
2395
+			$args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2396
+		}
2123 2397
 		$args->user_name = htmlspecialchars($args->user_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2124 2398
 		$args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2125 2399
 		$args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2126 2400
 		$args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2127
-		if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
2128
-		if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) $args->blog = 'http://'.$args->blog;
2401
+		if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) {
2402
+			$args->homepage = 'http://'.$args->homepage;
2403
+		}
2404
+		if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) {
2405
+			$args->blog = 'http://'.$args->blog;
2406
+		}
2129 2407
 
2130 2408
 		// check member identifier form
2131 2409
 		$config = $oMemberModel->getMemberConfig();
@@ -2142,8 +2420,7 @@  discard block
 block discarded – undo
2142 2420
 				return new Object(-1,'msg_exists_email_address');
2143 2421
 			}
2144 2422
 			$args->email_address = $orgMemberInfo->email_address;
2145
-		}
2146
-		else
2423
+		} else
2147 2424
 		{
2148 2425
 			$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
2149 2426
 			if($member_srl && $args->member_srl != $member_srl)
@@ -2197,17 +2474,26 @@  discard block
 block discarded – undo
2197 2474
 				return new Object(-1, $message[$config->password_strength]);
2198 2475
 			}
2199 2476
 			$args->password = $oMemberModel->hashPassword($args->password);
2200
-		}
2201
-		else
2477
+		} else
2202 2478
 		{
2203 2479
 			$args->password = $orgMemberInfo->password;
2204 2480
 		}
2205 2481
 		
2206
-		if(!$args->user_name) $args->user_name = $orgMemberInfo->user_name;
2207
-		if(!$args->user_id) $args->user_id = $orgMemberInfo->user_id;
2208
-		if(!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name;
2209
-		if(!$args->description) $args->description = '';
2210
-		if(!$args->birthday) $args->birthday = '';
2482
+		if(!$args->user_name) {
2483
+			$args->user_name = $orgMemberInfo->user_name;
2484
+		}
2485
+		if(!$args->user_id) {
2486
+			$args->user_id = $orgMemberInfo->user_id;
2487
+		}
2488
+		if(!$args->nick_name) {
2489
+			$args->nick_name = $orgMemberInfo->nick_name;
2490
+		}
2491
+		if(!$args->description) {
2492
+			$args->description = '';
2493
+		}
2494
+		if(!$args->birthday) {
2495
+			$args->birthday = '';
2496
+		}
2211 2497
 
2212 2498
 		$output = executeQuery('member.updateMember', $args);
2213 2499
 
@@ -2219,8 +2505,11 @@  discard block
 block discarded – undo
2219 2505
 
2220 2506
 		if($args->group_srl_list)
2221 2507
 		{
2222
-			if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2223
-			else $group_srl_list = explode('|@|', $args->group_srl_list);
2508
+			if(is_array($args->group_srl_list)) {
2509
+				$group_srl_list = $args->group_srl_list;
2510
+			} else {
2511
+				$group_srl_list = explode('|@|', $args->group_srl_list);
2512
+			}
2224 2513
 			// If the group information, group information changes
2225 2514
 			if(count($group_srl_list) > 0)
2226 2515
 			{
@@ -2263,7 +2552,9 @@  discard block
 block discarded – undo
2263 2552
 		$this->_clearMemberCache($args->member_srl, $args->site_srl);
2264 2553
 
2265 2554
 		// Save Session
2266
-		if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2555
+		if(!$this->memberInfo) {
2556
+			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2557
+		}
2267 2558
 		$logged_info = Context::get('logged_info');
2268 2559
 
2269 2560
 		$output->add('member_srl', $args->member_srl);
@@ -2289,8 +2580,7 @@  discard block
 block discarded – undo
2289 2580
 			}
2290 2581
 
2291 2582
 			$args->password = $oMemberModel->hashPassword($args->password);
2292
-		}
2293
-		else if($args->hashed_password)
2583
+		} else if($args->hashed_password)
2294 2584
 		{
2295 2585
 			$args->password = $args->hashed_password;
2296 2586
 		}
@@ -2315,7 +2605,9 @@  discard block
 block discarded – undo
2315 2605
 		$trigger_obj = new stdClass();
2316 2606
 		$trigger_obj->member_srl = $member_srl;
2317 2607
 		$output = ModuleHandler::triggerCall('member.deleteMember', 'before', $trigger_obj);
2318
-		if(!$output->toBool()) return $output;
2608
+		if(!$output->toBool()) {
2609
+			return $output;
2610
+		}
2319 2611
 		// Create a model object
2320 2612
 		$oMemberModel = getModel('member');
2321 2613
 		// Bringing the user's information
@@ -2324,9 +2616,13 @@  discard block
 block discarded – undo
2324 2616
 			$columnList = array('member_srl', 'is_admin');
2325 2617
 			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
2326 2618
 		}
2327
-		if(!$this->memberInfo) return new Object(-1, 'msg_not_exists_member');
2619
+		if(!$this->memberInfo) {
2620
+			return new Object(-1, 'msg_not_exists_member');
2621
+		}
2328 2622
 		// If managers can not be deleted
2329
-		if($this->memberInfo->is_admin == 'Y') return new Object(-1, 'msg_cannot_delete_admin');
2623
+		if($this->memberInfo->is_admin == 'Y') {
2624
+			return new Object(-1, 'msg_cannot_delete_admin');
2625
+		}
2330 2626
 
2331 2627
 		$oDB = &DB::getInstance();
2332 2628
 		$oDB->begin();
@@ -2390,7 +2686,9 @@  discard block
 block discarded – undo
2390 2686
 	 */
2391 2687
 	function destroySessionInfo()
2392 2688
 	{
2393
-		if(!$_SESSION || !is_array($_SESSION)) return;
2689
+		if(!$_SESSION || !is_array($_SESSION)) {
2690
+			return;
2691
+		}
2394 2692
 
2395 2693
 		$memberInfo = Context::get('logged_info');
2396 2694
 		$memberSrl = $memberInfo->member_srl;
@@ -2429,8 +2727,9 @@  discard block
 block discarded – undo
2429 2727
 		}
2430 2728
 		$maxLevel = 0;
2431 2729
 		$resultGroup = array_intersect($levelGroup, $groupSrlList);
2432
-		if(count($resultGroup) > 0)
2433
-			$maxLevel = max(array_flip($resultGroup));
2730
+		if(count($resultGroup) > 0) {
2731
+					$maxLevel = max(array_flip($resultGroup));
2732
+		}
2434 2733
 
2435 2734
 		if($maxLevel > 0)
2436 2735
 		{
@@ -2447,16 +2746,22 @@  discard block
 block discarded – undo
2447 2746
 
2448 2747
 	function procMemberModifyEmailAddress()
2449 2748
 	{
2450
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
2749
+		if(!Context::get('is_logged')) {
2750
+			return $this->stop('msg_not_logged');
2751
+		}
2451 2752
 
2452 2753
 		$member_info = Context::get('logged_info');
2453 2754
 		$newEmail = Context::get('email_address');
2454 2755
 
2455
-		if(!$newEmail) return $this->stop('msg_invalid_request');
2756
+		if(!$newEmail) {
2757
+			return $this->stop('msg_invalid_request');
2758
+		}
2456 2759
 
2457 2760
 		$oMemberModel = getModel('member');
2458 2761
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail);
2459
-		if($member_srl) return new Object(-1,'msg_exists_email_address');
2762
+		if($member_srl) {
2763
+			return new Object(-1,'msg_exists_email_address');
2764
+		}
2460 2765
 
2461 2766
 		if($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
2462 2767
 		{
@@ -2484,7 +2789,9 @@  discard block
 block discarded – undo
2484 2789
 		$member_config = $oModuleModel->getModuleConfig('member');
2485 2790
 
2486 2791
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
2487
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
2792
+		if(!is_dir($tpl_path)) {
2793
+			$tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
2794
+		}
2488 2795
 
2489 2796
 		global $lang;
2490 2797
 
@@ -2520,7 +2827,9 @@  discard block
 block discarded – undo
2520 2827
 	{
2521 2828
 		$member_srl = Context::get('member_srl');
2522 2829
 		$auth_key = Context::get('auth_key');
2523
-		if(!$member_srl || !$auth_key) return $this->stop('msg_invalid_request');
2830
+		if(!$member_srl || !$auth_key) {
2831
+			return $this->stop('msg_invalid_request');
2832
+		}
2524 2833
 
2525 2834
 		// Test logs for finding password by user_id and authkey
2526 2835
 		$args = new stdClass;
@@ -2529,7 +2838,9 @@  discard block
 block discarded – undo
2529 2838
 		$output = executeQuery('member.getAuthMail', $args);
2530 2839
 		if(!$output->toBool() || $output->data->auth_key != $auth_key)
2531 2840
 		{
2532
-			if(strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args);
2841
+			if(strlen($output->data->auth_key) !== strlen($auth_key)) {
2842
+				executeQuery('member.deleteAuthChangeEmailAddress', $args);
2843
+			}
2533 2844
 			return $this->stop('msg_invalid_modify_email_auth_key');
2534 2845
 		}
2535 2846
 
@@ -2538,7 +2849,9 @@  discard block
 block discarded – undo
2538 2849
 		list($args->email_id, $args->email_host) = explode('@', $newEmail);
2539 2850
 
2540 2851
 		$output = executeQuery('member.updateMemberEmailAddress', $args);
2541
-		if(!$output->toBool()) return $this->stop($output->getMessage());
2852
+		if(!$output->toBool()) {
2853
+			return $this->stop($output->getMessage());
2854
+		}
2542 2855
 
2543 2856
 		// Remove all values having the member_srl and new_password equal to 'XE_change_emaill_address' from authentication table
2544 2857
 		executeQuery('member.deleteAuthChangeEmailAddress',$args);
@@ -2559,7 +2872,9 @@  discard block
 block discarded – undo
2559 2872
 	**/
2560 2873
 	function triggerGetDocumentMenu(&$menu_list)
2561 2874
 	{
2562
-		if(!Context::get('is_logged')) return new Object();
2875
+		if(!Context::get('is_logged')) {
2876
+			return new Object();
2877
+		}
2563 2878
 
2564 2879
 		$logged_info = Context::get('logged_info');
2565 2880
 		$document_srl = Context::get('target_srl');
@@ -2570,8 +2885,12 @@  discard block
 block discarded – undo
2570 2885
 		$member_srl = $oDocument->get('member_srl');
2571 2886
 		$module_srl = $oDocument->get('module_srl');
2572 2887
 
2573
-		if(!$member_srl) return new Object();
2574
-		if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new Object();
2888
+		if(!$member_srl) {
2889
+			return new Object();
2890
+		}
2891
+		if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) {
2892
+			return new Object();
2893
+		}
2575 2894
 
2576 2895
 		$oDocumentController = getController('document');
2577 2896
 		$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
@@ -2589,7 +2908,9 @@  discard block
 block discarded – undo
2589 2908
 	**/
2590 2909
 	function triggerGetCommentMenu(&$menu_list)
2591 2910
 	{
2592
-		if(!Context::get('is_logged')) return new Object();
2911
+		if(!Context::get('is_logged')) {
2912
+			return new Object();
2913
+		}
2593 2914
 
2594 2915
 		$logged_info = Context::get('logged_info');
2595 2916
 		$comment_srl = Context::get('target_srl');
@@ -2600,8 +2921,12 @@  discard block
 block discarded – undo
2600 2921
 		$module_srl = $oComment->get('module_srl');
2601 2922
 		$member_srl = $oComment->get('member_srl');
2602 2923
 
2603
-		if(!$member_srl) return new Object();
2604
-		if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new Object();
2924
+		if(!$member_srl) {
2925
+			return new Object();
2926
+		}
2927
+		if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) {
2928
+			return new Object();
2929
+		}
2605 2930
 
2606 2931
 		$oCommentController = getController('comment');
2607 2932
 		$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
@@ -2617,7 +2942,9 @@  discard block
 block discarded – undo
2617 2942
 	**/
2618 2943
 	function procMemberSpammerManage()
2619 2944
 	{
2620
-		if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
2945
+		if(!Context::get('is_logged')) {
2946
+			return new Object(-1,'msg_not_permitted');
2947
+		}
2621 2948
 
2622 2949
 		$logged_info = Context::get('logged_info');
2623 2950
 		$member_srl = Context::get('member_srl');
@@ -2625,8 +2952,9 @@  discard block
 block discarded – undo
2625 2952
 		$cnt_loop = Context::get('cnt_loop');
2626 2953
 		$proc_type = Context::get('proc_type');
2627 2954
 		$isMoveToTrash = true;
2628
-		if($proc_type == "delete")
2629
-			$isMoveToTrash = false;
2955
+		if($proc_type == "delete") {
2956
+					$isMoveToTrash = false;
2957
+		}
2630 2958
 
2631 2959
 		// check grant
2632 2960
 		$oModuleModel = getModel('module');
@@ -2634,7 +2962,9 @@  discard block
 block discarded – undo
2634 2962
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
2635 2963
 		$grant = $oModuleModel->getGrant($module_info, $logged_info);
2636 2964
 
2637
-		if(!$grant->manager) return new Object(-1,'msg_not_permitted');
2965
+		if(!$grant->manager) {
2966
+			return new Object(-1,'msg_not_permitted');
2967
+		}
2638 2968
 
2639 2969
 		$proc_msg = "";
2640 2970
 
@@ -2643,11 +2973,13 @@  discard block
 block discarded – undo
2643 2973
 
2644 2974
 		// delete or trash destination
2645 2975
 		// proc member
2646
-		if($cnt_loop == 1)
2647
-			$this->_spammerMember($member_srl);
2976
+		if($cnt_loop == 1) {
2977
+					$this->_spammerMember($member_srl);
2978
+		}
2648 2979
 		// proc document and comment
2649
-		elseif($cnt_loop>1)
2650
-			$this->_spammerDocuments($member_srl, $isMoveToTrash);
2980
+		elseif($cnt_loop>1) {
2981
+					$this->_spammerDocuments($member_srl, $isMoveToTrash);
2982
+		}
2651 2983
 
2652 2984
 		// get destination count
2653 2985
 		$cnt_document = $oDocumentModel->getDocumentCountByMemberSrl($member_srl);
@@ -2655,13 +2987,16 @@  discard block
 block discarded – undo
2655 2987
 
2656 2988
 		$total_count = Context::get('total_count');
2657 2989
 		$remain_count = $cnt_document + $cnt_comment;
2658
-		if($cnt_loop == 1) $total_count = $remain_count;
2990
+		if($cnt_loop == 1) {
2991
+			$total_count = $remain_count;
2992
+		}
2659 2993
 
2660 2994
 		// get progress percent
2661
-		if($total_count > 0)
2662
-			$progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 );
2663
-		else
2664
-			$progress = 100;
2995
+		if($total_count > 0) {
2996
+					$progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 );
2997
+		} else {
2998
+					$progress = 100;
2999
+		}
2665 3000
 
2666 3001
 		$this->add('total_count', $total_count);
2667 3002
 		$this->add('remain_count', $remain_count);
@@ -2703,7 +3038,10 @@  discard block
 block discarded – undo
2703 3038
 		$args->nick_name = $member_info->nick_name;
2704 3039
 		$args->denied = "Y";
2705 3040
 		$args->description = trim( $member_info->description );
2706
-		if( $args->description != "" ) $args->description .= "\n";	// add new line
3041
+		if( $args->description != "" ) {
3042
+			$args->description .= "\n";
3043
+		}
3044
+		// add new line
2707 3045
 
2708 3046
 		$args->description .= Context::getLang('cmd_spammer') . "[" . date("Y-m-d H:i:s") . " from:" . $logged_info->user_id . " info:" . $spam_description . " docuemnts count:" . $total_count . "]";
2709 3047
 
@@ -2748,8 +3086,11 @@  discard block
 block discarded – undo
2748 3086
 			$documentList = $oDocumentModel->getDocumentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount);
2749 3087
 			if($documentList) {
2750 3088
 				foreach($documentList as $v) {
2751
-					if($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v);
2752
-					else $oDocumentController->deleteDocument($v->document_srl);
3089
+					if($isMoveToTrash) {
3090
+						$oDocumentController->moveDocumentToTrash($v);
3091
+					} else {
3092
+						$oDocumentController->deleteDocument($v->document_srl);
3093
+					}
2753 3094
 				}
2754 3095
 			}
2755 3096
 		}
Please login to merge, or discard this patch.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -2556,7 +2556,7 @@  discard block
 block discarded – undo
2556 2556
 	 * @param array &$menu_list
2557 2557
 	 *
2558 2558
 	 * @return object
2559
-	**/
2559
+	 **/
2560 2560
 	function triggerGetDocumentMenu(&$menu_list)
2561 2561
 	{
2562 2562
 		if(!Context::get('is_logged')) return new Object();
@@ -2586,7 +2586,7 @@  discard block
 block discarded – undo
2586 2586
 	 * @param array &$menu_list
2587 2587
 	 *
2588 2588
 	 * @return object
2589
-	**/
2589
+	 **/
2590 2590
 	function triggerGetCommentMenu(&$menu_list)
2591 2591
 	{
2592 2592
 		if(!Context::get('is_logged')) return new Object();
@@ -2614,7 +2614,7 @@  discard block
 block discarded – undo
2614 2614
 	 * Spammer manage. Denied user login. And delete or trash all documents. Response Ajax string
2615 2615
 	 *
2616 2616
 	 * @return object
2617
-	**/
2617
+	 **/
2618 2618
 	function procMemberSpammerManage()
2619 2619
 	{
2620 2620
 		if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
@@ -2680,7 +2680,7 @@  discard block
 block discarded – undo
2680 2680
 	 * @param int $member_srl
2681 2681
 	 *
2682 2682
 	 * @return object
2683
-	**/
2683
+	 **/
2684 2684
 	private function _spammerMember($member_srl) {
2685 2685
 		$logged_info = Context::get('logged_info');
2686 2686
 		$spam_description = trim( Context::get('spam_description') );
@@ -2721,7 +2721,7 @@  discard block
 block discarded – undo
2721 2721
 	 * @param bool $isMoveToTrash
2722 2722
 	 *
2723 2723
 	 * @return object
2724
-	**/
2724
+	 **/
2725 2725
 	private function _spammerDocuments($member_srl, $isMoveToTrash) {
2726 2726
 		$oDocumentController = getController('document');
2727 2727
 		$oDocumentModel = getModel('document');
Please login to merge, or discard this patch.
Spacing   +442 added lines, -442 removed lines patch added patch discarded remove patch
@@ -34,25 +34,25 @@  discard block
 block discarded – undo
34 34
 	 */
35 35
 	function procMemberLogin($user_id = null, $password = null, $keep_signed = null)
36 36
 	{
37
-		if(!$user_id && !$password && Context::getRequestMethod() == 'GET')
37
+		if (!$user_id && !$password && Context::getRequestMethod() == 'GET')
38 38
 		{
39 39
 			$this->setRedirectUrl(getNotEncodedUrl(''));
40 40
 			return new Object(-1, 'null_user_id');
41 41
 		}
42 42
 
43 43
 		// Variables
44
-		if(!$user_id) $user_id = Context::get('user_id');
44
+		if (!$user_id) $user_id = Context::get('user_id');
45 45
 		$user_id = trim($user_id);
46 46
 
47
-		if(!$password) $password = Context::get('password');
47
+		if (!$password) $password = Context::get('password');
48 48
 		$password = trim($password);
49 49
 
50
-		if(!$keep_signed) $keep_signed = Context::get('keep_signed');
50
+		if (!$keep_signed) $keep_signed = Context::get('keep_signed');
51 51
 		// Return an error when id and password doesn't exist
52
-		if(!$user_id) return new Object(-1,'null_user_id');
53
-		if(!$password) return new Object(-1,'null_password');
52
+		if (!$user_id) return new Object(-1, 'null_user_id');
53
+		if (!$password) return new Object(-1, 'null_password');
54 54
 
55
-		$output = $this->doLogin($user_id, $password, $keep_signed=='Y'?true:false);
55
+		$output = $this->doLogin($user_id, $password, $keep_signed == 'Y' ? true : false);
56 56
 		if (!$output->toBool()) return $output;
57 57
 
58 58
 		$oModuleModel = getModel('module');
@@ -62,13 +62,13 @@  discard block
 block discarded – undo
62 62
 		$limit_date = $config->change_password_date;
63 63
 
64 64
 		// Check if change_password_date is set
65
-		if($limit_date > 0)
65
+		if ($limit_date > 0)
66 66
 		{
67 67
 			$oMemberModel = getModel('member');
68
-			if($this->memberInfo->change_password_date < date ('YmdHis', strtotime ('-' . $limit_date . ' day')))
68
+			if ($this->memberInfo->change_password_date < date('YmdHis', strtotime('-'.$limit_date.' day')))
69 69
 			{
70 70
 				$msg = sprintf(Context::getLang('msg_change_password_date'), $limit_date);
71
-				return $this->setRedirectUrl(getNotEncodedUrl('','vid',Context::get('vid'),'mid',Context::get('mid'),'act','dispMemberModifyPassword'), new Object(-1, $msg));
71
+				return $this->setRedirectUrl(getNotEncodedUrl('', 'vid', Context::get('vid'), 'mid', Context::get('mid'), 'act', 'dispMemberModifyPassword'), new Object(-1, $msg));
72 72
 			}
73 73
 		}
74 74
 
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 		$args->member_srl = $this->memberInfo->member_srl;
78 78
 		executeQuery('member.deleteAuthMail', $args);
79 79
 
80
-		if(!$config->after_login_url)
80
+		if (!$config->after_login_url)
81 81
 		{
82 82
 			$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', '');
83 83
 		}
@@ -98,18 +98,18 @@  discard block
 block discarded – undo
98 98
 		// Call a trigger before log-out (before)
99 99
 		$logged_info = Context::get('logged_info');
100 100
 		$trigger_output = ModuleHandler::triggerCall('member.doLogout', 'before', $logged_info);
101
-		if(!$trigger_output->toBool()) return $trigger_output;
101
+		if (!$trigger_output->toBool()) return $trigger_output;
102 102
 		// Destroy session information
103 103
 		$this->destroySessionInfo();
104 104
 		// Call a trigger after log-out (after)
105 105
 		$trigger_output = ModuleHandler::triggerCall('member.doLogout', 'after', $logged_info);
106
-		if(!$trigger_output->toBool()) return $trigger_output;
106
+		if (!$trigger_output->toBool()) return $trigger_output;
107 107
 
108 108
 		$output = new Object();
109 109
 
110 110
 		$oModuleModel = getModel('module');
111 111
 		$config = $oModuleModel->getModuleConfig('member');
112
-		if($config->after_logout_url)
112
+		if ($config->after_logout_url)
113 113
 			$output->redirect_url = $config->after_logout_url;
114 114
 
115 115
 		$this->_clearMemberCache($logged_info->member_srl);
@@ -125,12 +125,12 @@  discard block
 block discarded – undo
125 125
 	function procMemberScrapDocument()
126 126
 	{
127 127
 		// Check login information
128
-		if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
128
+		if (!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
129 129
 		$logged_info = Context::get('logged_info');
130 130
 
131
-		$document_srl = (int)Context::get('document_srl');
132
-		if(!$document_srl) $document_srl = (int)Context::get('target_srl');
133
-		if(!$document_srl) return new Object(-1,'msg_invalid_request');
131
+		$document_srl = (int) Context::get('document_srl');
132
+		if (!$document_srl) $document_srl = (int) Context::get('target_srl');
133
+		if (!$document_srl) return new Object(-1, 'msg_invalid_request');
134 134
 		// Get document
135 135
 		$oDocumentModel = getModel('document');
136 136
 		$oDocument = $oDocumentModel->getDocument($document_srl);
@@ -145,10 +145,10 @@  discard block
 block discarded – undo
145 145
 		$args->title = $oDocument->get('title');
146 146
 		// Check if already scrapped
147 147
 		$output = executeQuery('member.getScrapDocument', $args);
148
-		if($output->data->count) return new Object(-1, 'msg_alreay_scrapped');
148
+		if ($output->data->count) return new Object(-1, 'msg_alreay_scrapped');
149 149
 		// Insert
150 150
 		$output = executeQuery('member.addScrapDocument', $args);
151
-		if(!$output->toBool()) return $output;
151
+		if (!$output->toBool()) return $output;
152 152
 
153 153
 		$this->setError(-1);
154 154
 		$this->setMessage('success_registed');
@@ -162,11 +162,11 @@  discard block
 block discarded – undo
162 162
 	function procMemberDeleteScrap()
163 163
 	{
164 164
 		// Check login information
165
-		if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
165
+		if (!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
166 166
 		$logged_info = Context::get('logged_info');
167 167
 
168
-		$document_srl = (int)Context::get('document_srl');
169
-		if(!$document_srl) return new Object(-1,'msg_invalid_request');
168
+		$document_srl = (int) Context::get('document_srl');
169
+		if (!$document_srl) return new Object(-1, 'msg_invalid_request');
170 170
 		// Variables
171 171
 		$args = new stdClass;
172 172
 		$args->member_srl = $logged_info->member_srl;
@@ -192,11 +192,11 @@  discard block
 block discarded – undo
192 192
 	function procMemberDeleteSavedDocument()
193 193
 	{
194 194
 		// Check login information
195
-		if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
195
+		if (!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
196 196
 		$logged_info = Context::get('logged_info');
197 197
 
198
-		$document_srl = (int)Context::get('document_srl');
199
-		if(!$document_srl) return new Object(-1,'msg_invalid_request');
198
+		$document_srl = (int) Context::get('document_srl');
199
+		if (!$document_srl) return new Object(-1, 'msg_invalid_request');
200 200
 		// Variables
201 201
 		$oDocumentController = getController('document');
202 202
 		$oDocumentController->deleteDocument($document_srl, true);
@@ -211,37 +211,37 @@  discard block
 block discarded – undo
211 211
 	{
212 212
 		$name = Context::get('name');
213 213
 		$value = Context::get('value');
214
-		if(!$value) return;
214
+		if (!$value) return;
215 215
 
216 216
 		$oMemberModel = getModel('member');
217 217
 		// Check if logged-in
218 218
 		$logged_info = Context::get('logged_info');
219 219
 
220 220
 
221
-		switch($name)
221
+		switch ($name)
222 222
 		{
223 223
 			case 'user_id' :
224 224
 				// Check denied ID
225
-				if($oMemberModel->isDeniedID($value)) return new Object(0,'denied_user_id');
225
+				if ($oMemberModel->isDeniedID($value)) return new Object(0, 'denied_user_id');
226 226
 				// Check if duplicated
227 227
 				$member_srl = $oMemberModel->getMemberSrlByUserID($value);
228
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_user_id');
228
+				if ($member_srl && $logged_info->member_srl != $member_srl) return new Object(0, 'msg_exists_user_id');
229 229
 				break;
230 230
 			case 'nick_name' :
231 231
 				// Check denied ID
232
-				if($oMemberModel->isDeniedNickName($value))
232
+				if ($oMemberModel->isDeniedNickName($value))
233 233
 				{
234
-					return new Object(0,'denied_nick_name');
234
+					return new Object(0, 'denied_nick_name');
235 235
 				}
236 236
 				// Check if duplicated
237 237
 				$member_srl = $oMemberModel->getMemberSrlByNickName($value);
238
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_nick_name');
238
+				if ($member_srl && $logged_info->member_srl != $member_srl) return new Object(0, 'msg_exists_nick_name');
239 239
 
240 240
 				break;
241 241
 			case 'email_address' :
242 242
 				// Check if duplicated
243 243
 				$member_srl = $oMemberModel->getMemberSrlByEmailAddress($value);
244
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_email_address');
244
+				if ($member_srl && $logged_info->member_srl != $member_srl) return new Object(0, 'msg_exists_email_address');
245 245
 				break;
246 246
 		}
247 247
 	}
@@ -253,25 +253,25 @@  discard block
 block discarded – undo
253 253
 	 */
254 254
 	function procMemberInsert()
255 255
 	{
256
-		if (Context::getRequestMethod () == "GET") return new Object (-1, "msg_invalid_request");
257
-		$oMemberModel = &getModel ('member');
256
+		if (Context::getRequestMethod() == "GET") return new Object(-1, "msg_invalid_request");
257
+		$oMemberModel = &getModel('member');
258 258
 		$config = $oMemberModel->getMemberConfig();
259 259
 
260 260
 		// call a trigger (before)
261
-		$trigger_output = ModuleHandler::triggerCall ('member.procMemberInsert', 'before', $config);
262
-		if(!$trigger_output->toBool ()) return $trigger_output;
261
+		$trigger_output = ModuleHandler::triggerCall('member.procMemberInsert', 'before', $config);
262
+		if (!$trigger_output->toBool()) return $trigger_output;
263 263
 		// Check if an administrator allows a membership
264
-		if($config->enable_join != 'Y') return $this->stop ('msg_signup_disabled');
264
+		if ($config->enable_join != 'Y') return $this->stop('msg_signup_disabled');
265 265
 		// Check if the user accept the license terms (only if terms exist)
266
-		if($config->agreement && Context::get('accept_agreement')!='Y') return $this->stop('msg_accept_agreement');
266
+		if ($config->agreement && Context::get('accept_agreement') != 'Y') return $this->stop('msg_accept_agreement');
267 267
 
268 268
 		// Extract the necessary information in advance
269 269
 		$getVars = array();
270
-		if($config->signupForm)
270
+		if ($config->signupForm)
271 271
 		{
272
-			foreach($config->signupForm as $formInfo)
272
+			foreach ($config->signupForm as $formInfo)
273 273
 			{
274
-				if($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
274
+				if ($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
275 275
 				{
276 276
 					$getVars[] = $formInfo->name;
277 277
 				}
@@ -279,22 +279,22 @@  discard block
 block discarded – undo
279 279
 		}
280 280
 
281 281
 		$args = new stdClass;
282
-		foreach($getVars as $val)
282
+		foreach ($getVars as $val)
283 283
 		{
284 284
 			$args->{$val} = Context::get($val);
285
-			if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
285
+			if ($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
286 286
 		}
287 287
 		$args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
288
-		if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
288
+		if (!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
289 289
 
290 290
 		$args->find_account_answer = Context::get('find_account_answer');
291 291
 		$args->allow_mailing = Context::get('allow_mailing');
292 292
 		$args->allow_message = Context::get('allow_message');
293 293
 
294
-		if($args->password1) $args->password = $args->password1;
294
+		if ($args->password1) $args->password = $args->password1;
295 295
 
296 296
 		// check password strength
297
-		if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
297
+		if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
298 298
 		{
299 299
 			$message = Context::getLang('about_password_strength');
300 300
 			return new Object(-1, $message[$config->password_strength]);
@@ -320,58 +320,58 @@  discard block
 block discarded – undo
320 320
 		unset($all_args->secret_text);
321 321
 
322 322
 		// Set the user state as "denied" when using mail authentication
323
-		if($config->enable_confirm == 'Y') $args->denied = 'Y';
323
+		if ($config->enable_confirm == 'Y') $args->denied = 'Y';
324 324
 		// Add extra vars after excluding necessary information from all the requested arguments
325 325
 		$extra_vars = delObjectVars($all_args, $args);
326 326
 		$args->extra_vars = serialize($extra_vars);
327 327
 
328 328
 		// remove whitespace
329 329
 		$checkInfos = array('user_id', 'user_name', 'nick_name', 'email_address');
330
-		foreach($checkInfos as $val)
330
+		foreach ($checkInfos as $val)
331 331
 		{
332
-			if(isset($args->{$val}))
332
+			if (isset($args->{$val}))
333 333
 			{
334 334
 				$args->{$val} = preg_replace('/[\pZ\pC]+/u', '', $args->{$val});
335 335
 			}
336 336
 		}
337 337
 		$output = $this->insertMember($args);
338
-		if(!$output->toBool()) return $output;
338
+		if (!$output->toBool()) return $output;
339 339
 
340 340
 		// insert ProfileImage, ImageName, ImageMark
341 341
 		$profile_image = $_FILES['profile_image'];
342
-		if(is_uploaded_file($profile_image['tmp_name']))
342
+		if (is_uploaded_file($profile_image['tmp_name']))
343 343
 		{
344 344
 			$this->insertProfileImage($args->member_srl, $profile_image['tmp_name']);
345 345
 		}
346 346
 
347 347
 		$image_mark = $_FILES['image_mark'];
348
-		if(is_uploaded_file($image_mark['tmp_name']))
348
+		if (is_uploaded_file($image_mark['tmp_name']))
349 349
 		{
350 350
 			$this->insertImageMark($args->member_srl, $image_mark['tmp_name']);
351 351
 		}
352 352
 
353 353
 		$image_name = $_FILES['image_name'];
354
-		if(is_uploaded_file($image_name['tmp_name']))
354
+		if (is_uploaded_file($image_name['tmp_name']))
355 355
 		{
356 356
 			$this->insertImageName($args->member_srl, $image_name['tmp_name']);
357 357
 		}
358 358
 
359 359
 		// If a virtual site, join the site
360 360
 		$site_module_info = Context::get('site_module_info');
361
-		if($site_module_info->site_srl > 0)
361
+		if ($site_module_info->site_srl > 0)
362 362
 		{
363 363
 			$columnList = array('site_srl', 'group_srl');
364 364
 			$default_group = $oMemberModel->getDefaultGroup($site_module_info->site_srl, $columnList);
365
-			if($default_group->group_srl)
365
+			if ($default_group->group_srl)
366 366
 			{
367 367
 				$this->addMemberToGroup($args->member_srl, $default_group->group_srl, $site_module_info->site_srl);
368 368
 			}
369 369
 
370 370
 		}
371 371
 		// Log-in
372
-		if($config->enable_confirm != 'Y')
372
+		if ($config->enable_confirm != 'Y')
373 373
 		{
374
-			if($config->identifier == 'email_address')
374
+			if ($config->identifier == 'email_address')
375 375
 			{
376 376
 				$output = $this->doLogin($args->email_address);
377 377
 			}
@@ -379,8 +379,8 @@  discard block
 block discarded – undo
379 379
 			{
380 380
 				$output = $this->doLogin($args->user_id);
381 381
 			}
382
-			if(!$output->toBool()) {
383
-				if($output->error == -9)
382
+			if (!$output->toBool()) {
383
+				if ($output->error == -9)
384 384
 					$output->error = -11;
385 385
 				return $this->setRedirectUrl(getUrl('', 'act', 'dispMemberLoginForm'), $output);
386 386
 			}
@@ -388,8 +388,8 @@  discard block
 block discarded – undo
388 388
 
389 389
 		// Results
390 390
 		$this->add('member_srl', $args->member_srl);
391
-		if($config->redirect_url) $this->add('redirect_url', $config->redirect_url);
392
-		if($config->enable_confirm == 'Y')
391
+		if ($config->redirect_url) $this->add('redirect_url', $config->redirect_url);
392
+		if ($config->enable_confirm == 'Y')
393 393
 		{
394 394
 			$msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address);
395 395
 			$this->setMessage($msg);
@@ -398,19 +398,19 @@  discard block
 block discarded – undo
398 398
 		else $this->setMessage('success_registed');
399 399
 		// Call a trigger (after)
400 400
 		$trigger_output = ModuleHandler::triggerCall('member.procMemberInsert', 'after', $config);
401
-		if(!$trigger_output->toBool()) return $trigger_output;
401
+		if (!$trigger_output->toBool()) return $trigger_output;
402 402
 
403
-		if($config->redirect_url)
403
+		if ($config->redirect_url)
404 404
 		{
405 405
 			$returnUrl = $config->redirect_url;
406 406
 		}
407 407
 		else
408 408
 		{
409
-			if(Context::get('success_return_url'))
409
+			if (Context::get('success_return_url'))
410 410
 			{
411 411
 				$returnUrl = Context::get('success_return_url');
412 412
 			}
413
-			else if($_COOKIE['XE_REDIRECT_URL'])
413
+			else if ($_COOKIE['XE_REDIRECT_URL'])
414 414
 			{
415 415
 				$returnUrl = $_COOKIE['XE_REDIRECT_URL'];
416 416
 				setcookie("XE_REDIRECT_URL", '', 1);
@@ -424,26 +424,26 @@  discard block
 block discarded – undo
424 424
 
425 425
 	function procMemberModifyInfoBefore()
426 426
 	{
427
-		if($_SESSION['rechecked_password_step'] != 'INPUT_PASSWORD')
427
+		if ($_SESSION['rechecked_password_step'] != 'INPUT_PASSWORD')
428 428
 		{
429 429
 			return $this->stop('msg_invalid_request');
430 430
 		}
431 431
 
432
-		if(!Context::get('is_logged'))
432
+		if (!Context::get('is_logged'))
433 433
 		{
434 434
 			return $this->stop('msg_not_logged');
435 435
 		}
436 436
 
437 437
 		$password = Context::get('password');
438 438
 
439
-		if(!$password)
439
+		if (!$password)
440 440
 		{
441 441
 			return $this->stop('msg_invalid_request');
442 442
 		}
443 443
 
444 444
 		$oMemberModel = getModel('member');
445 445
 
446
-		if(!$this->memberInfo->password)
446
+		if (!$this->memberInfo->password)
447 447
 		{
448 448
 			// Get information of logged-in user
449 449
 			$logged_info = Context::get('logged_info');
@@ -454,14 +454,14 @@  discard block
 block discarded – undo
454 454
 			$this->memberInfo->password = $memberInfo->password;
455 455
 		}
456 456
 		// Verify the current password
457
-		if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password))
457
+		if (!$oMemberModel->isValidPassword($this->memberInfo->password, $password))
458 458
 		{
459 459
 			return new Object(-1, 'invalid_password');
460 460
 		}
461 461
 
462 462
 		$_SESSION['rechecked_password_step'] = 'VALIDATE_PASSWORD';
463 463
 
464
-		if(Context::get('success_return_url'))
464
+		if (Context::get('success_return_url'))
465 465
 		{
466 466
 			$redirectUrl = Context::get('success_return_url');
467 467
 		}
@@ -479,26 +479,26 @@  discard block
 block discarded – undo
479 479
 	 */
480 480
 	function procMemberModifyInfo()
481 481
 	{
482
-		if(!Context::get('is_logged'))
482
+		if (!Context::get('is_logged'))
483 483
 		{
484 484
 			return $this->stop('msg_not_logged');
485 485
 		}
486 486
 
487
-		if($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
487
+		if ($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
488 488
 		{
489 489
 			return $this->stop('msg_invalid_request');
490 490
 		}
491 491
 		unset($_SESSION['rechecked_password_step']);
492 492
 
493 493
 		// Extract the necessary information in advance
494
-		$oMemberModel = &getModel ('member');
495
-		$config = $oMemberModel->getMemberConfig ();
496
-		$getVars = array('find_account_answer','allow_mailing','allow_message');
497
-		if($config->signupForm)
494
+		$oMemberModel = &getModel('member');
495
+		$config = $oMemberModel->getMemberConfig();
496
+		$getVars = array('find_account_answer', 'allow_mailing', 'allow_message');
497
+		if ($config->signupForm)
498 498
 		{
499
-			foreach($config->signupForm as $formInfo)
499
+			foreach ($config->signupForm as $formInfo)
500 500
 			{
501
-				if($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
501
+				if ($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
502 502
 				{
503 503
 					$getVars[] = $formInfo->name;
504 504
 				}
@@ -506,16 +506,16 @@  discard block
 block discarded – undo
506 506
 		}
507 507
 
508 508
 		$args = new stdClass;
509
-		foreach($getVars as $val)
509
+		foreach ($getVars as $val)
510 510
 		{
511 511
 			$args->{$val} = Context::get($val);
512
-			if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
512
+			if ($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
513 513
 		}
514 514
 		// Login Information
515 515
 		$logged_info = Context::get('logged_info');
516 516
 		$args->member_srl = $logged_info->member_srl;
517 517
 		$args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
518
-		if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
518
+		if (!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
519 519
 		// Remove some unnecessary variables from all the vars
520 520
 		$all_args = Context::getRequestVars();
521 521
 		unset($all_args->module);
@@ -539,9 +539,9 @@  discard block
 block discarded – undo
539 539
 
540 540
 		// remove whitespace
541 541
 		$checkInfos = array('user_id', 'user_name', 'nick_name', 'email_address');
542
-		foreach($checkInfos as $val)
542
+		foreach ($checkInfos as $val)
543 543
 		{
544
-			if(isset($args->{$val}))
544
+			if (isset($args->{$val}))
545 545
 			{
546 546
 				$args->{$val} = preg_replace('/[\pZ\pC]+/u', '', $args->{$val});
547 547
 			}
@@ -549,22 +549,22 @@  discard block
 block discarded – undo
549 549
 
550 550
 		// Execute insert or update depending on the value of member_srl
551 551
 		$output = $this->updateMember($args);
552
-		if(!$output->toBool()) return $output;
552
+		if (!$output->toBool()) return $output;
553 553
 
554 554
 		$profile_image = $_FILES['profile_image'];
555
-		if(is_uploaded_file($profile_image['tmp_name']))
555
+		if (is_uploaded_file($profile_image['tmp_name']))
556 556
 		{
557 557
 			$this->insertProfileImage($args->member_srl, $profile_image['tmp_name']);
558 558
 		}
559 559
 
560 560
 		$image_mark = $_FILES['image_mark'];
561
-		if(is_uploaded_file($image_mark['tmp_name']))
561
+		if (is_uploaded_file($image_mark['tmp_name']))
562 562
 		{
563 563
 			$this->insertImageMark($args->member_srl, $image_mark['tmp_name']);
564 564
 		}
565 565
 
566 566
 		$image_name = $_FILES['image_name'];
567
-		if(is_uploaded_file($image_name['tmp_name']))
567
+		if (is_uploaded_file($image_name['tmp_name']))
568 568
 		{
569 569
 			$this->insertImageName($args->member_srl, $image_name['tmp_name']);
570 570
 		}
@@ -579,7 +579,7 @@  discard block
 block discarded – undo
579 579
 
580 580
 		// Call a trigger after successfully log-in (after)
581 581
 		$trigger_output = ModuleHandler::triggerCall('member.procMemberModifyInfo', 'after', $this->memberInfo);
582
-		if(!$trigger_output->toBool()) return $trigger_output;
582
+		if (!$trigger_output->toBool()) return $trigger_output;
583 583
 
584 584
 		$this->setSessionInfo();
585 585
 		// Return result
@@ -600,7 +600,7 @@  discard block
 block discarded – undo
600 600
 	 */
601 601
 	function procMemberModifyPassword()
602 602
 	{
603
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
603
+		if (!Context::get('is_logged')) return $this->stop('msg_not_logged');
604 604
 		// Extract the necessary information in advance
605 605
 		$current_password = trim(Context::get('current_password'));
606 606
 		$password = trim(Context::get('password1'));
@@ -614,17 +614,17 @@  discard block
 block discarded – undo
614 614
 
615 615
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
616 616
 		// Verify the cuttent password
617
-		if(!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) return new Object(-1, 'invalid_password');
617
+		if (!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) return new Object(-1, 'invalid_password');
618 618
 
619 619
 		// Check if a new password is as same as the previous password
620
-		if($current_password == $password) return new Object(-1, 'invalid_new_password');
620
+		if ($current_password == $password) return new Object(-1, 'invalid_new_password');
621 621
 
622 622
 		// Execute insert or update depending on the value of member_srl
623 623
 		$args = new stdClass;
624 624
 		$args->member_srl = $member_srl;
625 625
 		$args->password = $password;
626 626
 		$output = $this->updateMemberPassword($args);
627
-		if(!$output->toBool()) return $output;
627
+		if (!$output->toBool()) return $output;
628 628
 
629 629
 		$this->add('member_srl', $args->member_srl);
630 630
 		$this->setMessage('success_updated');
@@ -640,7 +640,7 @@  discard block
 block discarded – undo
640 640
 	 */
641 641
 	function procMemberLeave()
642 642
 	{
643
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
643
+		if (!Context::get('is_logged')) return $this->stop('msg_not_logged');
644 644
 		// Extract the necessary information in advance
645 645
 		$password = trim(Context::get('password'));
646 646
 		// Get information of logged-in user
@@ -649,17 +649,17 @@  discard block
 block discarded – undo
649 649
 		// Create a member model object
650 650
 		$oMemberModel = getModel('member');
651 651
 		// Get information of member_srl
652
-		if(!$this->memberInfo->password)
652
+		if (!$this->memberInfo->password)
653 653
 		{
654 654
 			$columnList = array('member_srl', 'password');
655 655
 			$memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
656 656
 			$this->memberInfo->password = $memberInfo->password;
657 657
 		}
658 658
 		// Verify the cuttent password
659
-		if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) return new Object(-1, 'invalid_password');
659
+		if (!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) return new Object(-1, 'invalid_password');
660 660
 
661 661
 		$output = $this->deleteMember($member_srl);
662
-		if(!$output->toBool()) return $output;
662
+		if (!$output->toBool()) return $output;
663 663
 		// Destroy all session information
664 664
 		$this->destroySessionInfo();
665 665
 		// Return success message
@@ -678,17 +678,17 @@  discard block
 block discarded – undo
678 678
 	{
679 679
 		// Check if the file is successfully uploaded
680 680
 		$file = $_FILES['profile_image'];
681
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_profile_image');
681
+		if (!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_profile_image');
682 682
 		// Ignore if member_srl is invalid or doesn't exist.
683 683
 		$member_srl = Context::get('member_srl');
684
-		if(!$member_srl) return $this->stop('msg_not_uploaded_profile_image');
684
+		if (!$member_srl) return $this->stop('msg_not_uploaded_profile_image');
685 685
 
686 686
 		$logged_info = Context::get('logged_info');
687
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_profile_image');
687
+		if ($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_profile_image');
688 688
 		// Return if member module is set not to use an image name or the user is not an administrator ;
689 689
 		$oModuleModel = getModel('module');
690 690
 		$config = $oModuleModel->getModuleConfig('member');
691
-		if($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') return $this->stop('msg_not_uploaded_profile_image');
691
+		if ($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') return $this->stop('msg_not_uploaded_profile_image');
692 692
 
693 693
 		$this->insertProfileImage($member_srl, $file['tmp_name']);
694 694
 		// Page refresh
@@ -710,25 +710,25 @@  discard block
 block discarded – undo
710 710
 	{
711 711
 
712 712
 		// Check uploaded file
713
-		if(!checkUploadedFile($target_file)) return;
713
+		if (!checkUploadedFile($target_file)) return;
714 714
 
715 715
 		$oMemberModel = getModel('member');
716 716
 		$config = $oMemberModel->getMemberConfig();
717 717
 
718 718
 		// Get an image size
719 719
 		$max_width = $config->profile_image_max_width;
720
-		if(!$max_width) $max_width = "90";
720
+		if (!$max_width) $max_width = "90";
721 721
 		$max_height = $config->profile_image_max_height;
722
-		if(!$max_height) $max_height = "90";
722
+		if (!$max_height) $max_height = "90";
723 723
 		// Get a target path to save
724 724
 		$target_path = sprintf('files/member_extra_info/profile_image/%s', getNumberingPath($member_srl));
725 725
 		FileHandler::makeDir($target_path);
726 726
 
727 727
 		// Get file information
728 728
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
729
-		if(IMAGETYPE_PNG == $type) $ext = 'png';
730
-		elseif(IMAGETYPE_JPEG == $type) $ext = 'jpg';
731
-		elseif(IMAGETYPE_GIF == $type) $ext = 'gif';
729
+		if (IMAGETYPE_PNG == $type) $ext = 'png';
730
+		elseif (IMAGETYPE_JPEG == $type) $ext = 'jpg';
731
+		elseif (IMAGETYPE_GIF == $type) $ext = 'gif';
732 732
 		else
733 733
 		{
734 734
 			return;
@@ -738,7 +738,7 @@  discard block
 block discarded – undo
738 738
 
739 739
 		$target_filename = sprintf('%s%d.%s', $target_path, $member_srl, $ext);
740 740
 		// Convert if the image size is larger than a given size or if the format is not a gif
741
-		if(($width > $max_width || $height > $max_height ) && $type != 1)
741
+		if (($width > $max_width || $height > $max_height) && $type != 1)
742 742
 		{
743 743
 			FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, $ext);
744 744
 		}
@@ -757,17 +757,17 @@  discard block
 block discarded – undo
757 757
 	{
758 758
 		// Check if the file is successfully uploaded
759 759
 		$file = $_FILES['image_name'];
760
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name');
760
+		if (!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name');
761 761
 		// Ignore if member_srl is invalid or doesn't exist.
762 762
 		$member_srl = Context::get('member_srl');
763
-		if(!$member_srl) return $this->stop('msg_not_uploaded_image_name');
763
+		if (!$member_srl) return $this->stop('msg_not_uploaded_image_name');
764 764
 
765 765
 		$logged_info = Context::get('logged_info');
766
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name');
766
+		if ($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name');
767 767
 		// Return if member module is set not to use an image name or the user is not an administrator ;
768 768
 		$oModuleModel = getModel('module');
769 769
 		$config = $oModuleModel->getModuleConfig('member');
770
-		if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name');
770
+		if ($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name');
771 771
 
772 772
 		$this->insertImageName($member_srl, $file['tmp_name']);
773 773
 		// Page refresh
@@ -788,15 +788,15 @@  discard block
 block discarded – undo
788 788
 	function insertImageName($member_srl, $target_file)
789 789
 	{
790 790
 		// Check uploaded file
791
-		if(!checkUploadedFile($target_file)) return;
791
+		if (!checkUploadedFile($target_file)) return;
792 792
 
793 793
 		$oModuleModel = getModel('module');
794 794
 		$config = $oModuleModel->getModuleConfig('member');
795 795
 		// Get an image size
796 796
 		$max_width = $config->image_name_max_width;
797
-		if(!$max_width) $max_width = "90";
797
+		if (!$max_width) $max_width = "90";
798 798
 		$max_height = $config->image_name_max_height;
799
-		if(!$max_height) $max_height = "20";
799
+		if (!$max_height) $max_height = "20";
800 800
 		// Get a target path to save
801 801
 		$target_path = sprintf('files/member_extra_info/image_name/%s/', getNumberingPath($member_srl));
802 802
 		FileHandler::makeDir($target_path);
@@ -805,7 +805,7 @@  discard block
 block discarded – undo
805 805
 		// Get file information
806 806
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
807 807
 		// Convert if the image size is larger than a given size or if the format is not a gif
808
-		if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
808
+		if ($width > $max_width || $height > $max_height || $type != 1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
809 809
 		else @copy($target_file, $target_filename);
810 810
 	}
811 811
 
@@ -817,20 +817,20 @@  discard block
 block discarded – undo
817 817
 	function procMemberDeleteProfileImage($_memberSrl = 0)
818 818
 	{
819 819
 		$member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl');
820
-		if(!$member_srl)
820
+		if (!$member_srl)
821 821
 		{
822
-			return new Object(0,'success');
822
+			return new Object(0, 'success');
823 823
 		}
824 824
 
825 825
 		$logged_info = Context::get('logged_info');
826 826
 
827
-		if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
827
+		if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
828 828
 		{
829 829
 			$oMemberModel = getModel('member');
830 830
 			$profile_image = $oMemberModel->getProfileImage($member_srl);
831 831
 			FileHandler::removeFile($profile_image->file);
832 832
 		}
833
-		return new Object(0,'success');
833
+		return new Object(0, 'success');
834 834
 	}
835 835
 
836 836
 	/**
@@ -841,20 +841,20 @@  discard block
 block discarded – undo
841 841
 	function procMemberDeleteImageName($_memberSrl = 0)
842 842
 	{
843 843
 		$member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl');
844
-		if(!$member_srl)
844
+		if (!$member_srl)
845 845
 		{
846
-			return new Object(0,'success');
846
+			return new Object(0, 'success');
847 847
 		}
848 848
 
849 849
 		$logged_info = Context::get('logged_info');
850 850
 
851
-		if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
851
+		if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
852 852
 		{
853 853
 			$oMemberModel = getModel('member');
854 854
 			$image_name = $oMemberModel->getImageName($member_srl);
855 855
 			FileHandler::removeFile($image_name->file);
856 856
 		}
857
-		return new Object(0,'success');
857
+		return new Object(0, 'success');
858 858
 	}
859 859
 
860 860
 	/**
@@ -866,17 +866,17 @@  discard block
 block discarded – undo
866 866
 	{
867 867
 		// Check if the file is successfully uploaded
868 868
 		$file = $_FILES['image_mark'];
869
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark');
869
+		if (!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark');
870 870
 		// Ignore if member_srl is invalid or doesn't exist.
871 871
 		$member_srl = Context::get('member_srl');
872
-		if(!$member_srl) return $this->stop('msg_not_uploaded_image_mark');
872
+		if (!$member_srl) return $this->stop('msg_not_uploaded_image_mark');
873 873
 
874 874
 		$logged_info = Context::get('logged_info');
875
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark');
875
+		if ($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark');
876 876
 		// Membership in the images mark the module using the ban was set by an administrator or return;
877 877
 		$oModuleModel = getModel('module');
878 878
 		$config = $oModuleModel->getModuleConfig('member');
879
-		if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark');
879
+		if ($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark');
880 880
 
881 881
 		$this->insertImageMark($member_srl, $file['tmp_name']);
882 882
 		// Page refresh
@@ -897,15 +897,15 @@  discard block
 block discarded – undo
897 897
 	function insertImageMark($member_srl, $target_file)
898 898
 	{
899 899
 		// Check uploaded file
900
-		if(!checkUploadedFile($target_file)) return;
900
+		if (!checkUploadedFile($target_file)) return;
901 901
 
902 902
 		$oModuleModel = getModel('module');
903 903
 		$config = $oModuleModel->getModuleConfig('member');
904 904
 		// Get an image size
905 905
 		$max_width = $config->image_mark_max_width;
906
-		if(!$max_width) $max_width = "20";
906
+		if (!$max_width) $max_width = "20";
907 907
 		$max_height = $config->image_mark_max_height;
908
-		if(!$max_height) $max_height = "20";
908
+		if (!$max_height) $max_height = "20";
909 909
 
910 910
 		$target_path = sprintf('files/member_extra_info/image_mark/%s/', getNumberingPath($member_srl));
911 911
 		FileHandler::makeDir($target_path);
@@ -914,7 +914,7 @@  discard block
 block discarded – undo
914 914
 		// Get file information
915 915
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
916 916
 
917
-		if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
917
+		if ($width > $max_width || $height > $max_height || $type != 1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
918 918
 		else @copy($target_file, $target_filename);
919 919
 	}
920 920
 
@@ -926,20 +926,20 @@  discard block
 block discarded – undo
926 926
 	function procMemberDeleteImageMark($_memberSrl = 0)
927 927
 	{
928 928
 		$member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl');
929
-		if(!$member_srl)
929
+		if (!$member_srl)
930 930
 		{
931
-			return new Object(0,'success');
931
+			return new Object(0, 'success');
932 932
 		}
933 933
 
934 934
 		$logged_info = Context::get('logged_info');
935 935
 
936
-		if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
936
+		if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
937 937
 		{
938 938
 			$oMemberModel = getModel('member');
939 939
 			$image_mark = $oMemberModel->getImageMark($member_srl);
940 940
 			FileHandler::removeFile($image_mark->file);
941 941
 		}
942
-		return new Object(0,'success');
942
+		return new Object(0, 'success');
943 943
 	}
944 944
 
945 945
 	/**
@@ -950,26 +950,26 @@  discard block
 block discarded – undo
950 950
 	function procMemberFindAccount()
951 951
 	{
952 952
 		$email_address = Context::get('email_address');
953
-		if(!$email_address) return new Object(-1, 'msg_invalid_request');
953
+		if (!$email_address) return new Object(-1, 'msg_invalid_request');
954 954
 
955 955
 		$oMemberModel = getModel('member');
956 956
 		$oModuleModel = getModel('module');
957 957
 
958 958
 		// Check if a member having the same email address exists
959 959
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
960
-		if(!$member_srl) return new Object(-1, 'msg_email_not_exists');
960
+		if (!$member_srl) return new Object(-1, 'msg_email_not_exists');
961 961
 
962 962
 		// Get information of the member
963 963
 		$columnList = array('denied', 'member_srl', 'user_id', 'user_name', 'email_address', 'nick_name');
964 964
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
965 965
 
966 966
 		// Check if possible to find member's ID and password
967
-		if($member_info->denied == 'Y')
967
+		if ($member_info->denied == 'Y')
968 968
 		{
969 969
 			$chk_args = new stdClass;
970 970
 			$chk_args->member_srl = $member_info->member_srl;
971 971
 			$output = executeQuery('member.chkAuthMail', $chk_args);
972
-			if($output->toBool() && $output->data->count != '0') return new Object(-1, 'msg_user_not_confirmed');
972
+			if ($output->toBool() && $output->data->count != '0') return new Object(-1, 'msg_user_not_confirmed');
973 973
 		}
974 974
 
975 975
 		// Insert data into the authentication DB
@@ -982,19 +982,19 @@  discard block
 block discarded – undo
982 982
 		$args->is_register = 'N';
983 983
 
984 984
 		$output = executeQuery('member.insertAuthMail', $args);
985
-		if(!$output->toBool()) return $output;
985
+		if (!$output->toBool()) return $output;
986 986
 		// Get content of the email to send a member
987 987
 		Context::set('auth_args', $args);
988 988
 
989 989
 		$member_config = $oModuleModel->getModuleConfig('member');
990 990
 		$memberInfo = array();
991 991
 		global $lang;
992
-		if(is_array($member_config->signupForm))
992
+		if (is_array($member_config->signupForm))
993 993
 		{
994
-			$exceptForm=array('password', 'find_account_question');
995
-			foreach($member_config->signupForm as $form)
994
+			$exceptForm = array('password', 'find_account_question');
995
+			foreach ($member_config->signupForm as $form)
996 996
 			{
997
-				if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
997
+				if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
998 998
 				{
999 999
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1000 1000
 				}
@@ -1009,15 +1009,15 @@  discard block
 block discarded – undo
1009 1009
 		}
1010 1010
 		Context::set('memberInfo', $memberInfo);
1011 1011
 
1012
-		if(!$member_config->skin) $member_config->skin = "default";
1013
-		if(!$member_config->colorset) $member_config->colorset = "white";
1012
+		if (!$member_config->skin) $member_config->skin = "default";
1013
+		if (!$member_config->colorset) $member_config->colorset = "white";
1014 1014
 
1015 1015
 		Context::set('member_config', $member_config);
1016 1016
 
1017 1017
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1018
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1018
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1019 1019
 
1020
-		$find_url = getFullUrl ('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key);
1020
+		$find_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key);
1021 1021
 		Context::set('find_url', $find_url);
1022 1022
 
1023 1023
 		$oTemplate = &TemplateHandler::getInstance();
@@ -1027,19 +1027,19 @@  discard block
 block discarded – undo
1027 1027
 		$member_config = $oModuleModel->getModuleConfig('member');
1028 1028
 		// Send a mail
1029 1029
 		$oMail = new Mail();
1030
-		$oMail->setTitle( Context::getLang('msg_find_account_title') );
1030
+		$oMail->setTitle(Context::getLang('msg_find_account_title'));
1031 1031
 		$oMail->setContent($content);
1032
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
1033
-		$oMail->setReceiptor( $member_info->user_name, $member_info->email_address );
1032
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
1033
+		$oMail->setReceiptor($member_info->user_name, $member_info->email_address);
1034 1034
 		$oMail->send();
1035 1035
 		// Return message
1036 1036
 		$msg = sprintf(Context::getLang('msg_auth_mail_sent'), $member_info->email_address);
1037
-		if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON')))
1037
+		if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON')))
1038 1038
 		{
1039 1039
 			$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberFindAccount');
1040 1040
 			$this->setRedirectUrl($returnUrl);
1041 1041
 		}
1042
-		return new Object(0,$msg);
1042
+		return new Object(0, $msg);
1043 1043
 	}
1044 1044
 
1045 1045
 	/**
@@ -1057,28 +1057,28 @@  discard block
 block discarded – undo
1057 1057
 		$find_account_question = trim(Context::get('find_account_question'));
1058 1058
 		$find_account_answer = trim(Context::get('find_account_answer'));
1059 1059
 
1060
-		if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new Object(-1, 'msg_invalid_request');
1060
+		if (($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new Object(-1, 'msg_invalid_request');
1061 1061
 
1062 1062
 		$oModuleModel = getModel('module');
1063 1063
 		// Check if a member having the same email address exists
1064 1064
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1065
-		if(!$member_srl) return new Object(-1, 'msg_email_not_exists');
1065
+		if (!$member_srl) return new Object(-1, 'msg_email_not_exists');
1066 1066
 		// Get information of the member
1067 1067
 		$columnList = array('member_srl', 'find_account_question', 'find_account_answer');
1068 1068
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
1069 1069
 
1070 1070
 		// Display a message if no answer is entered
1071
-		if(!$member_info->find_account_question || !$member_info->find_account_answer) return new Object(-1, 'msg_question_not_exists');
1071
+		if (!$member_info->find_account_question || !$member_info->find_account_answer) return new Object(-1, 'msg_question_not_exists');
1072 1072
 
1073
-		if(trim($member_info->find_account_question) != $find_account_question || trim($member_info->find_account_answer) != $find_account_answer) return new Object(-1, 'msg_answer_not_matches');
1073
+		if (trim($member_info->find_account_question) != $find_account_question || trim($member_info->find_account_answer) != $find_account_answer) return new Object(-1, 'msg_answer_not_matches');
1074 1074
 
1075
-		if($config->identifier == 'email_address')
1075
+		if ($config->identifier == 'email_address')
1076 1076
 		{
1077 1077
 			$user_id = $email_address;
1078 1078
 		}
1079 1079
 
1080 1080
 		// Update to a temporary password and set change_password_date to 1
1081
-		$oPassword =  new Password();
1081
+		$oPassword = new Password();
1082 1082
 		$temp_password = $oPassword->createTemporaryPassword(8);
1083 1083
 
1084 1084
 		$args = new stdClass();
@@ -1086,11 +1086,11 @@  discard block
 block discarded – undo
1086 1086
 		$args->password = $temp_password;
1087 1087
 		$args->change_password_date = '1';
1088 1088
 		$output = $this->updateMemberPassword($args);
1089
-		if(!$output->toBool()) return $output;
1089
+		if (!$output->toBool()) return $output;
1090 1090
 
1091
-		$_SESSION['xe_temp_password_' . $user_id] = $temp_password;
1091
+		$_SESSION['xe_temp_password_'.$user_id] = $temp_password;
1092 1092
 
1093
-		$this->add('user_id',$user_id);
1093
+		$this->add('user_id', $user_id);
1094 1094
 
1095 1095
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', '');
1096 1096
 		$this->setRedirectUrl($returnUrl.'&user_id='.$user_id);
@@ -1110,7 +1110,7 @@  discard block
 block discarded – undo
1110 1110
 		$member_srl = Context::get('member_srl');
1111 1111
 		$auth_key = Context::get('auth_key');
1112 1112
 
1113
-		if(!$member_srl || !$auth_key)
1113
+		if (!$member_srl || !$auth_key)
1114 1114
 		{
1115 1115
 			return $this->stop('msg_invalid_request');
1116 1116
 		}
@@ -1121,9 +1121,9 @@  discard block
 block discarded – undo
1121 1121
 		$args->auth_key = $auth_key;
1122 1122
 		$output = executeQuery('member.getAuthMail', $args);
1123 1123
 
1124
-		if(!$output->toBool() || $output->data->auth_key != $auth_key)
1124
+		if (!$output->toBool() || $output->data->auth_key != $auth_key)
1125 1125
 		{
1126
-			if(strlen($output->data->auth_key) !== strlen($auth_key))
1126
+			if (strlen($output->data->auth_key) !== strlen($auth_key))
1127 1127
 			{
1128 1128
 				executeQuery('member.deleteAuthMail', $args);
1129 1129
 			}
@@ -1131,7 +1131,7 @@  discard block
 block discarded – undo
1131 1131
 			return $this->stop('msg_invalid_auth_key');
1132 1132
 		}
1133 1133
 
1134
-		if(ztime($output->data->regdate) < $_SERVER['REQUEST_TIME'] + zgap() - 86400)
1134
+		if (ztime($output->data->regdate) < $_SERVER['REQUEST_TIME'] + zgap() - 86400)
1135 1135
 		{
1136 1136
 			executeQuery('member.deleteAuthMail', $args);
1137 1137
 			return $this->stop('msg_invalid_auth_key');
@@ -1140,7 +1140,7 @@  discard block
 block discarded – undo
1140 1140
 		$args->password = $output->data->new_password;
1141 1141
 
1142 1142
 		// If credentials are correct, change the password to a new one
1143
-		if($output->data->is_register == 'Y')
1143
+		if ($output->data->is_register == 'Y')
1144 1144
 		{
1145 1145
 			$args->denied = 'N';
1146 1146
 		}
@@ -1153,13 +1153,13 @@  discard block
 block discarded – undo
1153 1153
 		$is_register = $output->data->is_register;
1154 1154
 
1155 1155
 		$output = executeQuery('member.updateMemberPassword', $args);
1156
-		if(!$output->toBool())
1156
+		if (!$output->toBool())
1157 1157
 		{
1158 1158
 			return $this->stop($output->getMessage());
1159 1159
 		}
1160 1160
 
1161 1161
 		// Remove all values having the member_srl from authentication table
1162
-		executeQuery('member.deleteAuthMail',$args);
1162
+		executeQuery('member.deleteAuthMail', $args);
1163 1163
 
1164 1164
 		$this->_clearMemberCache($args->member_srl);
1165 1165
 
@@ -1178,33 +1178,33 @@  discard block
 block discarded – undo
1178 1178
 	{
1179 1179
 		// Get an email_address
1180 1180
 		$email_address = Context::get('email_address');
1181
-		if(!$email_address) return new Object(-1, 'msg_invalid_request');
1181
+		if (!$email_address) return new Object(-1, 'msg_invalid_request');
1182 1182
 		// Log test by using email_address
1183 1183
 		$oMemberModel = getModel('member');
1184 1184
 
1185 1185
 		$args = new stdClass;
1186 1186
 		$args->email_address = $email_address;
1187 1187
 		$memberSrl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1188
-		if(!$memberSrl) return new Object(-1, 'msg_not_exists_member');
1188
+		if (!$memberSrl) return new Object(-1, 'msg_not_exists_member');
1189 1189
 
1190 1190
 		$columnList = array('member_srl', 'user_id', 'user_name', 'nick_name', 'email_address');
1191 1191
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($memberSrl, 0, $columnList);
1192 1192
 
1193 1193
 		$oModuleModel = getModel('module');
1194 1194
 		$member_config = $oModuleModel->getModuleConfig('member');
1195
-		if(!$member_config->skin) $member_config->skin = "default";
1196
-		if(!$member_config->colorset) $member_config->colorset = "white";
1195
+		if (!$member_config->skin) $member_config->skin = "default";
1196
+		if (!$member_config->colorset) $member_config->colorset = "white";
1197 1197
 
1198 1198
 		// Check if a authentication mail has been sent previously
1199 1199
 		$chk_args = new stdClass;
1200 1200
 		$chk_args->member_srl = $member_info->member_srl;
1201 1201
 		$output = executeQuery('member.chkAuthMail', $chk_args);
1202
-		if($output->toBool() && $output->data->count == '0') return new Object(-1, 'msg_invalid_request');
1202
+		if ($output->toBool() && $output->data->count == '0') return new Object(-1, 'msg_invalid_request');
1203 1203
 
1204 1204
 		$auth_args = new stdClass;
1205 1205
 		$auth_args->member_srl = $member_info->member_srl;
1206 1206
 		$output = executeQueryArray('member.getAuthMailInfo', $auth_args);
1207
-		if(!$output->data || !$output->data[0]->auth_key)  return new Object(-1, 'msg_invalid_request');
1207
+		if (!$output->data || !$output->data[0]->auth_key)  return new Object(-1, 'msg_invalid_request');
1208 1208
 		$auth_info = $output->data[0];
1209 1209
 
1210 1210
 		// Update the regdate of authmail entry
@@ -1215,12 +1215,12 @@  discard block
 block discarded – undo
1215 1215
 
1216 1216
 		$memberInfo = array();
1217 1217
 		global $lang;
1218
-		if(is_array($member_config->signupForm))
1218
+		if (is_array($member_config->signupForm))
1219 1219
 		{
1220
-			$exceptForm=array('password', 'find_account_question');
1221
-			foreach($member_config->signupForm as $form)
1220
+			$exceptForm = array('password', 'find_account_question');
1221
+			foreach ($member_config->signupForm as $form)
1222 1222
 			{
1223
-				if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1223
+				if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1224 1224
 				{
1225 1225
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1226 1226
 				}
@@ -1239,19 +1239,19 @@  discard block
 block discarded – undo
1239 1239
 		Context::set('member_config', $member_config);
1240 1240
 
1241 1241
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1242
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1242
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1243 1243
 
1244
-		$auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_info->auth_key);
1244
+		$auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $auth_info->auth_key);
1245 1245
 		Context::set('auth_url', $auth_url);
1246 1246
 
1247 1247
 		$oTemplate = &TemplateHandler::getInstance();
1248 1248
 		$content = $oTemplate->compile($tpl_path, 'confirm_member_account_mail');
1249 1249
 		// Send a mail
1250 1250
 		$oMail = new Mail();
1251
-		$oMail->setTitle( Context::getLang('msg_confirm_account_title') );
1251
+		$oMail->setTitle(Context::getLang('msg_confirm_account_title'));
1252 1252
 		$oMail->setContent($content);
1253
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
1254
-		$oMail->setReceiptor( $args->user_name, $args->email_address );
1253
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
1254
+		$oMail->setReceiptor($args->user_name, $args->email_address);
1255 1255
 		$oMail->send();
1256 1256
 
1257 1257
 		$msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address);
@@ -1266,23 +1266,23 @@  discard block
 block discarded – undo
1266 1266
 		$memberInfo = $_SESSION['auth_member_info'];
1267 1267
 		unset($_SESSION['auth_member_info']);
1268 1268
 
1269
-		if(!$memberInfo)
1269
+		if (!$memberInfo)
1270 1270
 		{
1271 1271
 			return $this->stop('msg_invalid_request');
1272 1272
 		}
1273 1273
 
1274 1274
 		$newEmail = Context::get('email_address');
1275 1275
 
1276
-		if(!$newEmail)
1276
+		if (!$newEmail)
1277 1277
 		{
1278 1278
 			return $this->stop('msg_invalid_request');
1279 1279
 		}
1280 1280
 
1281 1281
 		$oMemberModel = getModel('member');
1282 1282
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail);
1283
-		if($member_srl)
1283
+		if ($member_srl)
1284 1284
 		{
1285
-			return new Object(-1,'msg_exists_email_address');
1285
+			return new Object(-1, 'msg_exists_email_address');
1286 1286
 		}
1287 1287
 
1288 1288
 		// remove all key by member_srl
@@ -1290,7 +1290,7 @@  discard block
 block discarded – undo
1290 1290
 		$args->member_srl = $memberInfo->member_srl;
1291 1291
 		$output = executeQuery('member.deleteAuthMail', $args);
1292 1292
 
1293
-		if(!$output->toBool())
1293
+		if (!$output->toBool())
1294 1294
 		{
1295 1295
 			return $output;
1296 1296
 		}
@@ -1300,7 +1300,7 @@  discard block
 block discarded – undo
1300 1300
 		list($args->email_id, $args->email_host) = explode('@', $newEmail);
1301 1301
 
1302 1302
 		$output = executeQuery('member.updateMemberEmailAddress', $args);
1303
-		if(!$output->toBool())
1303
+		if (!$output->toBool())
1304 1304
 		{
1305 1305
 			return $this->stop($output->getMessage());
1306 1306
 		}
@@ -1317,7 +1317,7 @@  discard block
 block discarded – undo
1317 1317
 		$auth_args->is_register = 'Y';
1318 1318
 
1319 1319
 		$output = executeQuery('member.insertAuthMail', $auth_args);
1320
-		if(!$output->toBool()) return $output;
1320
+		if (!$output->toBool()) return $output;
1321 1321
 
1322 1322
 		$memberInfo->email_address = $newEmail;
1323 1323
 
@@ -1341,12 +1341,12 @@  discard block
 block discarded – undo
1341 1341
 		$memberInfo = array();
1342 1342
 
1343 1343
 		global $lang;
1344
-		if(is_array($member_config->signupForm))
1344
+		if (is_array($member_config->signupForm))
1345 1345
 		{
1346
-			$exceptForm=array('password', 'find_account_question');
1347
-			foreach($member_config->signupForm as $form)
1346
+			$exceptForm = array('password', 'find_account_question');
1347
+			foreach ($member_config->signupForm as $form)
1348 1348
 			{
1349
-				if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1349
+				if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1350 1350
 				{
1351 1351
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1352 1352
 				}
@@ -1361,25 +1361,25 @@  discard block
 block discarded – undo
1361 1361
 		}
1362 1362
 		Context::set('memberInfo', $memberInfo);
1363 1363
 
1364
-		if(!$member_config->skin) $member_config->skin = "default";
1365
-		if(!$member_config->colorset) $member_config->colorset = "white";
1364
+		if (!$member_config->skin) $member_config->skin = "default";
1365
+		if (!$member_config->colorset) $member_config->colorset = "white";
1366 1366
 
1367 1367
 		Context::set('member_config', $member_config);
1368 1368
 
1369 1369
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1370
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1370
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1371 1371
 
1372
-		$auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key);
1372
+		$auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $auth_args->auth_key);
1373 1373
 		Context::set('auth_url', $auth_url);
1374 1374
 
1375 1375
 		$oTemplate = &TemplateHandler::getInstance();
1376 1376
 		$content = $oTemplate->compile($tpl_path, 'confirm_member_account_mail');
1377 1377
 		// Send a mail
1378 1378
 		$oMail = new Mail();
1379
-		$oMail->setTitle( Context::getLang('msg_confirm_account_title') );
1379
+		$oMail->setTitle(Context::getLang('msg_confirm_account_title'));
1380 1380
 		$oMail->setContent($content);
1381
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
1382
-		$oMail->setReceiptor( $member_info->user_name, $member_info->email_address );
1381
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
1382
+		$oMail->setReceiptor($member_info->user_name, $member_info->email_address);
1383 1383
 		$oMail->send();
1384 1384
 	}
1385 1385
 
@@ -1392,7 +1392,7 @@  discard block
 block discarded – undo
1392 1392
 	{
1393 1393
 		$site_module_info = Context::get('site_module_info');
1394 1394
 		$logged_info = Context::get('logged_info');
1395
-		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new Object(-1,'msg_invalid_request');
1395
+		if (!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list)) return new Object(-1, 'msg_invalid_request');
1396 1396
 
1397 1397
 		$oMemberModel = getModel('member');
1398 1398
 		$columnList = array('site_srl', 'group_srl', 'title');
@@ -1411,13 +1411,13 @@  discard block
 block discarded – undo
1411 1411
 	{
1412 1412
 		$site_module_info = Context::get('site_module_info');
1413 1413
 		$logged_info = Context::get('logged_info');
1414
-		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new Object(-1,'msg_invalid_request');
1414
+		if (!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list)) return new Object(-1, 'msg_invalid_request');
1415 1415
 
1416 1416
 		$args = new stdClass;
1417
-		$args->site_srl= $site_module_info->site_srl;
1417
+		$args->site_srl = $site_module_info->site_srl;
1418 1418
 		$args->member_srl = $logged_info->member_srl;
1419 1419
 		$output = executeQuery('member.deleteMembersGroup', $args);
1420
-		if(!$output->toBool()) return $output;
1420
+		if (!$output->toBool()) return $output;
1421 1421
 		$this->setMessage('success_deleted');
1422 1422
 		$this->_clearMemberCache($args->member_srl, $site_module_info->site_srl);
1423 1423
 	}
@@ -1431,25 +1431,25 @@  discard block
 block discarded – undo
1431 1431
 	 */
1432 1432
 	function setMemberConfig($args)
1433 1433
 	{
1434
-		if(!$args->skin) $args->skin = "default";
1435
-		if(!$args->colorset) $args->colorset = "white";
1436
-		if(!$args->editor_skin) $args->editor_skin= "ckeditor";
1437
-		if(!$args->editor_colorset) $args->editor_colorset = "moono";
1438
-		if($args->enable_join!='Y') $args->enable_join = 'N';
1439
-		$args->enable_openid= 'N';
1440
-		if($args->profile_image !='Y') $args->profile_image = 'N';
1441
-		if($args->image_name!='Y') $args->image_name = 'N';
1442
-		if($args->image_mark!='Y') $args->image_mark = 'N';
1443
-		if($args->group_image_mark!='Y') $args->group_image_mark = 'N';
1444
-		if(!trim(strip_tags($args->agreement))) $args->agreement = null;
1445
-		$args->limit_day = (int)$args->limit_day;
1434
+		if (!$args->skin) $args->skin = "default";
1435
+		if (!$args->colorset) $args->colorset = "white";
1436
+		if (!$args->editor_skin) $args->editor_skin = "ckeditor";
1437
+		if (!$args->editor_colorset) $args->editor_colorset = "moono";
1438
+		if ($args->enable_join != 'Y') $args->enable_join = 'N';
1439
+		$args->enable_openid = 'N';
1440
+		if ($args->profile_image != 'Y') $args->profile_image = 'N';
1441
+		if ($args->image_name != 'Y') $args->image_name = 'N';
1442
+		if ($args->image_mark != 'Y') $args->image_mark = 'N';
1443
+		if ($args->group_image_mark != 'Y') $args->group_image_mark = 'N';
1444
+		if (!trim(strip_tags($args->agreement))) $args->agreement = null;
1445
+		$args->limit_day = (int) $args->limit_day;
1446 1446
 
1447 1447
 		$agreement = trim($args->agreement);
1448 1448
 		unset($args->agreement);
1449 1449
 
1450 1450
 		$oModuleController = getController('module');
1451
-		$output = $oModuleController->insertModuleConfig('member',$args);
1452
-		if(!$output->toBool()) return $output;
1451
+		$output = $oModuleController->insertModuleConfig('member', $args);
1452
+		if (!$output->toBool()) return $output;
1453 1453
 
1454 1454
 		$agreement_file = _XE_PATH_.'files/member_extra_info/agreement.txt';
1455 1455
 		FileHandler::writeFile($agreement_file, $agreement);
@@ -1470,11 +1470,11 @@  discard block
 block discarded – undo
1470 1470
 		$signature = trim(removeHackTag($signature));
1471 1471
 		$signature = preg_replace('/<(\/?)(embed|object|param)/is', '&lt;$1$2', $signature);
1472 1472
 
1473
-		$check_signature = trim(str_replace(array('&nbsp;',"\n","\r"),'',strip_tags($signature,'<img><object>')));
1473
+		$check_signature = trim(str_replace(array('&nbsp;', "\n", "\r"), '', strip_tags($signature, '<img><object>')));
1474 1474
 		$path = sprintf('files/member_extra_info/signature/%s/', getNumberingPath($member_srl));
1475 1475
 		$filename = sprintf('%s%d.signature.php', $path, $member_srl);
1476 1476
 
1477
-		if(!$check_signature) return FileHandler::removeFile($filename);
1477
+		if (!$check_signature) return FileHandler::removeFile($filename);
1478 1478
 
1479 1479
 		$buff = sprintf('<?php if(!defined("__XE__")) exit();?>%s', $signature);
1480 1480
 		FileHandler::makeDir($path);
@@ -1503,15 +1503,15 @@  discard block
 block discarded – undo
1503 1503
 	 *
1504 1504
 	 * @return Object
1505 1505
 	 */
1506
-	function addMemberToGroup($member_srl, $group_srl, $site_srl=0)
1506
+	function addMemberToGroup($member_srl, $group_srl, $site_srl = 0)
1507 1507
 	{
1508 1508
 		$args = new stdClass();
1509 1509
 		$args->member_srl = $member_srl;
1510 1510
 		$args->group_srl = $group_srl;
1511
-		if($site_srl) $args->site_srl = $site_srl;
1511
+		if ($site_srl) $args->site_srl = $site_srl;
1512 1512
 
1513 1513
 		// Add
1514
-		$output = executeQuery('member.addMemberToGroup',$args);
1514
+		$output = executeQuery('member.addMemberToGroup', $args);
1515 1515
 		$output2 = ModuleHandler::triggerCall('member.addMemberToGroup', 'after', $args);
1516 1516
 
1517 1517
 		$this->_clearMemberCache($member_srl, $site_srl);
@@ -1531,18 +1531,18 @@  discard block
 block discarded – undo
1531 1531
 	{
1532 1532
 		$obj = new stdClass;
1533 1533
 		$obj->site_srl = $args->site_srl;
1534
-		$obj->member_srl = implode(',',$args->member_srl);
1534
+		$obj->member_srl = implode(',', $args->member_srl);
1535 1535
 
1536 1536
 		$output = executeQueryArray('member.getMembersGroup', $obj);
1537
-		if($output->data) foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate;
1537
+		if ($output->data) foreach ($output->data as $key => $val) $date[$val->member_srl] = $val->regdate;
1538 1538
 
1539 1539
 		$output = executeQuery('member.deleteMembersGroup', $obj);
1540
-		if(!$output->toBool()) return $output;
1540
+		if (!$output->toBool()) return $output;
1541 1541
 
1542 1542
 		$inserted_members = array();
1543
-		foreach($args->member_srl as $key => $val)
1543
+		foreach ($args->member_srl as $key => $val)
1544 1544
 		{
1545
-			if($inserted_members[$val]) continue;
1545
+			if ($inserted_members[$val]) continue;
1546 1546
 			$inserted_members[$val] = true;
1547 1547
 
1548 1548
 			unset($obj);
@@ -1552,7 +1552,7 @@  discard block
 block discarded – undo
1552 1552
 			$obj->site_srl = $args->site_srl;
1553 1553
 			$obj->regdate = $date[$obj->member_srl];
1554 1554
 			$output = executeQuery('member.addMemberToGroup', $obj);
1555
-			if(!$output->toBool()) return $output;
1555
+			if (!$output->toBool()) return $output;
1556 1556
 
1557 1557
 			$this->_clearMemberCache($obj->member_srl, $args->site_srl);
1558 1558
 		}
@@ -1574,9 +1574,9 @@  discard block
 block discarded – undo
1574 1574
 		// Get information of the key
1575 1575
 		$output = executeQuery('member.getAutologin', $args);
1576 1576
 		// If no information exists, delete a cookie
1577
-		if(!$output->toBool() || !$output->data)
1577
+		if (!$output->toBool() || !$output->data)
1578 1578
 		{
1579
-			setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365, '/');
1579
+			setCookie('xeak', null, $_SERVER['REQUEST_TIME'] + 60 * 60 * 24 * 365, '/');
1580 1580
 			return;
1581 1581
 		}
1582 1582
 
@@ -1586,9 +1586,9 @@  discard block
 block discarded – undo
1586 1586
 		$user_id = ($config->identifier == 'user_id') ? $output->data->user_id : $output->data->email_address;
1587 1587
 		$password = $output->data->password;
1588 1588
 
1589
-		if(!$user_id || !$password)
1589
+		if (!$user_id || !$password)
1590 1590
 		{
1591
-			setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365, '/');
1591
+			setCookie('xeak', null, $_SERVER['REQUEST_TIME'] + 60 * 60 * 24 * 365, '/');
1592 1592
 			return;
1593 1593
 		}
1594 1594
 
@@ -1598,7 +1598,7 @@  discard block
 block discarded – undo
1598 1598
 		$check_key = strtolower($user_id).$password.$_SERVER['HTTP_USER_AGENT'];
1599 1599
 		$check_key = substr(hash_hmac('sha256', $check_key, substr($args->autologin_key, 0, 32)), 0, 32);
1600 1600
 
1601
-		if($check_key === substr($args->autologin_key, 32))
1601
+		if ($check_key === substr($args->autologin_key, 32))
1602 1602
 		{
1603 1603
 			// Check change_password_date
1604 1604
 			$oModuleModel = getModel('module');
@@ -1606,12 +1606,12 @@  discard block
 block discarded – undo
1606 1606
 			$limit_date = $member_config->change_password_date;
1607 1607
 
1608 1608
 			// Check if change_password_date is set
1609
-			if($limit_date > 0)
1609
+			if ($limit_date > 0)
1610 1610
 			{
1611 1611
 				$oMemberModel = getModel('member');
1612 1612
 				$columnList = array('member_srl', 'change_password_date');
1613 1613
 
1614
-				if($config->identifier == 'user_id')
1614
+				if ($config->identifier == 'user_id')
1615 1615
 				{
1616 1616
 					$member_info = $oMemberModel->getMemberInfoByUserID($user_id, $columnList);
1617 1617
 				}
@@ -1620,7 +1620,7 @@  discard block
 block discarded – undo
1620 1620
 					$member_info = $oMemberModel->getMemberInfoByEmailAddress($user_id, $columnList);
1621 1621
 				}
1622 1622
 
1623
-				if($member_info->change_password_date >= date('YmdHis', strtotime('-'.$limit_date.' day')) ){
1623
+				if ($member_info->change_password_date >= date('YmdHis', strtotime('-'.$limit_date.' day'))) {
1624 1624
 					$do_auto_login = true;
1625 1625
 				}
1626 1626
 
@@ -1631,14 +1631,14 @@  discard block
 block discarded – undo
1631 1631
 			}
1632 1632
 		}
1633 1633
 
1634
-		if($do_auto_login)
1634
+		if ($do_auto_login)
1635 1635
 		{
1636 1636
 			$output = $this->doLogin($user_id);
1637 1637
 		}
1638 1638
 		else
1639 1639
 		{
1640 1640
 			executeQuery('member.deleteAutologin', $args);
1641
-			setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365, '/');
1641
+			setCookie('xeak', null, $_SERVER['REQUEST_TIME'] + 60 * 60 * 24 * 365, '/');
1642 1642
 		}
1643 1643
 	}
1644 1644
 
@@ -1654,13 +1654,13 @@  discard block
 block discarded – undo
1654 1654
 	function doLogin($user_id, $password = '', $keep_signed = false)
1655 1655
 	{
1656 1656
 		$user_id = strtolower($user_id);
1657
-		if(!$user_id) return new Object(-1, 'null_user_id');
1657
+		if (!$user_id) return new Object(-1, 'null_user_id');
1658 1658
 		// Call a trigger before log-in (before)
1659 1659
 		$trigger_obj = new stdClass();
1660 1660
 		$trigger_obj->user_id = $user_id;
1661 1661
 		$trigger_obj->password = $password;
1662 1662
 		$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'before', $trigger_obj);
1663
-		if(!$trigger_output->toBool()) return $trigger_output;
1663
+		if (!$trigger_output->toBool()) return $trigger_output;
1664 1664
 		// Create a member model object
1665 1665
 		$oMemberModel = getModel('member');
1666 1666
 
@@ -1670,12 +1670,12 @@  discard block
 block discarded – undo
1670 1670
 		$args->ipaddress = $_SERVER['REMOTE_ADDR'];
1671 1671
 
1672 1672
 		// check identifier
1673
-		if($config->identifier == 'email_address')
1673
+		if ($config->identifier == 'email_address')
1674 1674
 		{
1675 1675
 			// Get user_id information
1676 1676
 			$this->memberInfo = $oMemberModel->getMemberInfoByEmailAddress($user_id);
1677 1677
 			// Set an invalid user if no value returned
1678
-			if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address');
1678
+			if (!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address');
1679 1679
 
1680 1680
 		}
1681 1681
 		else
@@ -1683,24 +1683,24 @@  discard block
 block discarded – undo
1683 1683
 			// Get user_id information
1684 1684
 			$this->memberInfo = $oMemberModel->getMemberInfoByUserID($user_id);
1685 1685
 			// Set an invalid user if no value returned
1686
-			if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id');
1686
+			if (!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id');
1687 1687
 		}
1688 1688
 
1689 1689
 		$output = executeQuery('member.getLoginCountByIp', $args);
1690 1690
 		$errorCount = $output->data->count;
1691
-		if($errorCount >= $config->max_error_count)
1691
+		if ($errorCount >= $config->max_error_count)
1692 1692
 		{
1693 1693
 			$last_update = strtotime($output->data->last_update);
1694
-			$term = intval($_SERVER['REQUEST_TIME']-$last_update);
1695
-			if($term < $config->max_error_count_time)
1694
+			$term = intval($_SERVER['REQUEST_TIME'] - $last_update);
1695
+			if ($term < $config->max_error_count_time)
1696 1696
 			{
1697 1697
 				$term = $config->max_error_count_time - $term;
1698
-				if($term < 60) $term = intval($term).Context::getLang('unit_sec');
1699
-				elseif(60 <= $term && $term < 3600) $term = intval($term/60).Context::getLang('unit_min');
1700
-				elseif(3600 <= $term && $term < 86400) $term = intval($term/3600).Context::getLang('unit_hour');
1701
-				else $term = intval($term/86400).Context::getLang('unit_day');
1698
+				if ($term < 60) $term = intval($term).Context::getLang('unit_sec');
1699
+				elseif (60 <= $term && $term < 3600) $term = intval($term / 60).Context::getLang('unit_min');
1700
+				elseif (3600 <= $term && $term < 86400) $term = intval($term / 3600).Context::getLang('unit_hour');
1701
+				else $term = intval($term / 86400).Context::getLang('unit_day');
1702 1702
 
1703
-				return new Object(-1, sprintf(Context::getLang('excess_ip_access_count'),$term));
1703
+				return new Object(-1, sprintf(Context::getLang('excess_ip_access_count'), $term));
1704 1704
 			}
1705 1705
 			else
1706 1706
 			{
@@ -1710,13 +1710,13 @@  discard block
 block discarded – undo
1710 1710
 		}
1711 1711
 
1712 1712
 		// Password Check
1713
-		if($password && !$oMemberModel->isValidPassword($this->memberInfo->password, $password, $this->memberInfo->member_srl))
1713
+		if ($password && !$oMemberModel->isValidPassword($this->memberInfo->password, $password, $this->memberInfo->member_srl))
1714 1714
 		{
1715
-			return $this->recordMemberLoginError(-1, 'invalid_password',$this->memberInfo);
1715
+			return $this->recordMemberLoginError(-1, 'invalid_password', $this->memberInfo);
1716 1716
 		}
1717 1717
 
1718 1718
 		// If denied == 'Y', notify
1719
-		if($this->memberInfo->denied == 'Y')
1719
+		if ($this->memberInfo->denied == 'Y')
1720 1720
 		{
1721 1721
 			$args->member_srl = $this->memberInfo->member_srl;
1722 1722
 			$output = executeQuery('member.chkAuthMail', $args);
@@ -1724,12 +1724,12 @@  discard block
 block discarded – undo
1724 1724
 			{
1725 1725
 				$_SESSION['auth_member_srl'] = $this->memberInfo->member_srl;
1726 1726
 				$redirectUrl = getUrl('', 'act', 'dispMemberResendAuthMail');
1727
-				return $this->setRedirectUrl($redirectUrl, new Object(-1,'msg_user_not_confirmed'));
1727
+				return $this->setRedirectUrl($redirectUrl, new Object(-1, 'msg_user_not_confirmed'));
1728 1728
 			}
1729
-			return new Object(-1,'msg_user_denied');
1729
+			return new Object(-1, 'msg_user_denied');
1730 1730
 		}
1731 1731
 		// Notify if denied_date is less than the current time
1732
-		if($this->memberInfo->limit_date && substr($this->memberInfo->limit_date,0,8) >= date("Ymd")) return new Object(-9,sprintf(Context::getLang('msg_user_limited'),zdate($this->memberInfo->limit_date,"Y-m-d")));
1732
+		if ($this->memberInfo->limit_date && substr($this->memberInfo->limit_date, 0, 8) >= date("Ymd")) return new Object(-9, sprintf(Context::getLang('msg_user_limited'), zdate($this->memberInfo->limit_date, "Y-m-d")));
1733 1733
 		// Update the latest login time
1734 1734
 		$args->member_srl = $this->memberInfo->member_srl;
1735 1735
 		$output = executeQuery('member.updateLastLogin', $args);
@@ -1739,36 +1739,36 @@  discard block
 block discarded – undo
1739 1739
 
1740 1740
 		// Check if there is recoding table.
1741 1741
 		$oDB = &DB::getInstance();
1742
-		if($oDB->isTableExists('member_count_history') && $config->enable_login_fail_report != 'N')
1742
+		if ($oDB->isTableExists('member_count_history') && $config->enable_login_fail_report != 'N')
1743 1743
 		{
1744 1744
 			// check if there is login fail records.
1745 1745
 			$output = executeQuery('member.getLoginCountHistoryByMemberSrl', $args);
1746
-			if($output->data && $output->data->content)
1746
+			if ($output->data && $output->data->content)
1747 1747
 			{
1748 1748
 				$title = Context::getLang('login_fail_report');
1749 1749
 				$message = '<ul>';
1750 1750
 				$content = unserialize($output->data->content);
1751
-				if(count($content) > $config->max_error_count)
1751
+				if (count($content) > $config->max_error_count)
1752 1752
 				{
1753
-					foreach($content as $val)
1753
+					foreach ($content as $val)
1754 1754
 					{
1755
-						$message .= '<li>'.Context::getLang('regdate').': '.date('Y-m-d h:i:sa',$val[2]).'<ul><li>'.Context::getLang('ipaddress').': '.$val[0].'</li><li>'.Context::getLang('message').': '.$val[1].'</li></ul></li>';
1755
+						$message .= '<li>'.Context::getLang('regdate').': '.date('Y-m-d h:i:sa', $val[2]).'<ul><li>'.Context::getLang('ipaddress').': '.$val[0].'</li><li>'.Context::getLang('message').': '.$val[1].'</li></ul></li>';
1756 1756
 					}
1757 1757
 					$message .= '</ul>';
1758
-					$content = sprintf(Context::getLang('login_fail_report_contents'),$message,date('Y-m-d h:i:sa'));
1758
+					$content = sprintf(Context::getLang('login_fail_report_contents'), $message, date('Y-m-d h:i:sa'));
1759 1759
 
1760 1760
 					//send message
1761 1761
 					$oCommunicationController = getController('communication');
1762 1762
 					$oCommunicationController->sendMessage($args->member_srl, $args->member_srl, $title, $content, true);
1763 1763
 
1764
-					if($this->memberInfo->email_address && $this->memberInfo->allow_mailing == 'Y')
1764
+					if ($this->memberInfo->email_address && $this->memberInfo->allow_mailing == 'Y')
1765 1765
 					{
1766 1766
 						$view_url = Context::getRequestUri();
1767
-						$content = sprintf("%s<hr /><p>From: <a href=\"%s\" target=\"_blank\">%s</a><br />To: %s(%s)</p>",$content, $view_url, $view_url, $this->memberInfo->nick_name, $this->memberInfo->email_id);
1767
+						$content = sprintf("%s<hr /><p>From: <a href=\"%s\" target=\"_blank\">%s</a><br />To: %s(%s)</p>", $content, $view_url, $view_url, $this->memberInfo->nick_name, $this->memberInfo->email_id);
1768 1768
 						$oMail = new Mail();
1769 1769
 						$oMail->setTitle($title);
1770 1770
 						$oMail->setContent($content);
1771
-						$oMail->setSender($config->webmaster_name?$config->webmaster_name:'webmaster', $config->webmaster_email);
1771
+						$oMail->setSender($config->webmaster_name ? $config->webmaster_name : 'webmaster', $config->webmaster_email);
1772 1772
 						$oMail->setReceiptor($this->memberInfo->email_id.'('.$this->memberInfo->nick_name.')', $this->memberInfo->email_address);
1773 1773
 						$oMail->send();
1774 1774
 					}
@@ -1778,9 +1778,9 @@  discard block
 block discarded – undo
1778 1778
 		}
1779 1779
 		// Call a trigger after successfully log-in (after)
1780 1780
 		$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'after', $this->memberInfo);
1781
-		if(!$trigger_output->toBool()) return $trigger_output;
1781
+		if (!$trigger_output->toBool()) return $trigger_output;
1782 1782
 		// When user checked to use auto-login
1783
-		if($keep_signed)
1783
+		if ($keep_signed)
1784 1784
 		{
1785 1785
 			// Key generate for auto login
1786 1786
 			$oPassword = new Password();
@@ -1792,12 +1792,12 @@  discard block
 block discarded – undo
1792 1792
 			$autologin_args->member_srl = $this->memberInfo->member_srl;
1793 1793
 			executeQuery('member.deleteAutologin', $autologin_args);
1794 1794
 			$autologin_output = executeQuery('member.insertAutologin', $autologin_args);
1795
-			if($autologin_output->toBool()) setCookie('xeak',$autologin_args->autologin_key, $_SERVER['REQUEST_TIME']+31536000, '/');
1795
+			if ($autologin_output->toBool()) setCookie('xeak', $autologin_args->autologin_key, $_SERVER['REQUEST_TIME'] + 31536000, '/');
1796 1796
 		}
1797
-		if($this->memberInfo->is_admin == 'Y')
1797
+		if ($this->memberInfo->is_admin == 'Y')
1798 1798
 		{
1799 1799
 			$oMemberAdminModel = getAdminModel('member');
1800
-			if(!$oMemberAdminModel->getMemberAdminIPCheck())
1800
+			if (!$oMemberAdminModel->getMemberAdminIPCheck())
1801 1801
 			{
1802 1802
 				$_SESSION['denied_admin'] = 'Y';
1803 1803
 			}
@@ -1815,18 +1815,18 @@  discard block
 block discarded – undo
1815 1815
 	{
1816 1816
 		$oMemberModel = getModel('member');
1817 1817
 		// If your information came through the current session information to extract information from the users
1818
-		if(!$this->memberInfo && $_SESSION['member_srl'] && $oMemberModel->isLogged() )
1818
+		if (!$this->memberInfo && $_SESSION['member_srl'] && $oMemberModel->isLogged())
1819 1819
 		{
1820 1820
 			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($_SESSION['member_srl']);
1821 1821
 			// If you do not destroy the session Profile
1822
-			if($this->memberInfo->member_srl != $_SESSION['member_srl'])
1822
+			if ($this->memberInfo->member_srl != $_SESSION['member_srl'])
1823 1823
 			{
1824 1824
 				$this->destroySessionInfo();
1825 1825
 				return;
1826 1826
 			}
1827 1827
 		}
1828 1828
 		// Stop using the session id is destroyed
1829
-		if($this->memberInfo->denied=='Y')
1829
+		if ($this->memberInfo->denied == 'Y')
1830 1830
 		{
1831 1831
 			$this->destroySessionInfo();
1832 1832
 			return;
@@ -1856,10 +1856,10 @@  discard block
 block discarded – undo
1856 1856
 		Context::set('logged_info', $this->memberInfo);
1857 1857
 
1858 1858
 		// Only the menu configuration of the user (such as an add-on to the menu can be changed)
1859
-		$this->addMemberMenu( 'dispMemberInfo', 'cmd_view_member_info');
1860
-		$this->addMemberMenu( 'dispMemberScrappedDocument', 'cmd_view_scrapped_document');
1861
-		$this->addMemberMenu( 'dispMemberSavedDocument', 'cmd_view_saved_document');
1862
-		$this->addMemberMenu( 'dispMemberOwnDocument', 'cmd_view_own_document');
1859
+		$this->addMemberMenu('dispMemberInfo', 'cmd_view_member_info');
1860
+		$this->addMemberMenu('dispMemberScrappedDocument', 'cmd_view_scrapped_document');
1861
+		$this->addMemberMenu('dispMemberSavedDocument', 'cmd_view_saved_document');
1862
+		$this->addMemberMenu('dispMemberOwnDocument', 'cmd_view_own_document');
1863 1863
 	}
1864 1864
 
1865 1865
 	/**
@@ -1881,7 +1881,7 @@  discard block
 block discarded – undo
1881 1881
 	function addMemberPopupMenu($url, $str, $icon = '', $target = 'self')
1882 1882
 	{
1883 1883
 		$member_popup_menu_list = Context::get('member_popup_menu_list');
1884
-		if(!is_array($member_popup_menu_list)) $member_popup_menu_list = array();
1884
+		if (!is_array($member_popup_menu_list)) $member_popup_menu_list = array();
1885 1885
 
1886 1886
 		$obj = new stdClass;
1887 1887
 		$obj->url = $url;
@@ -1900,33 +1900,33 @@  discard block
 block discarded – undo
1900 1900
 	{
1901 1901
 		// Call a trigger (before)
1902 1902
 		$output = ModuleHandler::triggerCall('member.insertMember', 'before', $args);
1903
-		if(!$output->toBool()) return $output;
1903
+		if (!$output->toBool()) return $output;
1904 1904
 		// Terms and Conditions portion of the information set up by members reaffirmed
1905 1905
 		$oModuleModel = getModel('module');
1906 1906
 		$config = $oModuleModel->getModuleConfig('member');
1907 1907
 
1908 1908
 		$logged_info = Context::get('logged_info');
1909 1909
 		// If the date of the temporary restrictions limit further information on the date of
1910
-		if($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24);
1910
+		if ($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME'] + $config->limit_day * 60 * 60 * 24);
1911 1911
 
1912 1912
 		$args->member_srl = getNextSequence();
1913 1913
 		$args->list_order = -1 * $args->member_srl;
1914 1914
 
1915 1915
 		// Execute insert or update depending on the value of member_srl
1916
-		if(!$args->user_id) $args->user_id = 't'.$args->member_srl;
1916
+		if (!$args->user_id) $args->user_id = 't'.$args->member_srl;
1917 1917
 		// Enter the user's identity changed to lowercase
1918 1918
 		else $args->user_id = strtolower($args->user_id);
1919
-		if(!$args->user_name) $args->user_name = $args->member_srl;
1920
-		if(!$args->nick_name) $args->nick_name = $args->member_srl;
1919
+		if (!$args->user_name) $args->user_name = $args->member_srl;
1920
+		if (!$args->nick_name) $args->nick_name = $args->member_srl;
1921 1921
 
1922 1922
 		// Control of essential parameters
1923
-		if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
1924
-		if($args->denied!='Y') $args->denied = 'N';
1925
-		$args->allow_message= 'Y';
1923
+		if ($args->allow_mailing != 'Y') $args->allow_mailing = 'N';
1924
+		if ($args->denied != 'Y') $args->denied = 'N';
1925
+		$args->allow_message = 'Y';
1926 1926
 
1927
-		if($logged_info->is_admin == 'Y')
1927
+		if ($logged_info->is_admin == 'Y')
1928 1928
 		{
1929
-			if($args->is_admin!='Y') $args->is_admin = 'N';
1929
+			if ($args->is_admin != 'Y') $args->is_admin = 'N';
1930 1930
 		}
1931 1931
 		else
1932 1932
 		{
@@ -1941,88 +1941,88 @@  discard block
 block discarded – undo
1941 1941
 		$args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
1942 1942
 		$args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
1943 1943
 		$args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
1944
-		if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
1945
-		if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) $args->blog = 'http://'.$args->blog;
1944
+		if ($args->homepage && !preg_match("/^[a-z]+:\/\//i", $args->homepage)) $args->homepage = 'http://'.$args->homepage;
1945
+		if ($args->blog && !preg_match("/^[a-z]+:\/\//i", $args->blog)) $args->blog = 'http://'.$args->blog;
1946 1946
 
1947 1947
 		// Create a model object
1948 1948
 		$oMemberModel = getModel('member');
1949 1949
 
1950 1950
 		// Check password strength
1951
-		if($args->password && !$password_is_hashed)
1951
+		if ($args->password && !$password_is_hashed)
1952 1952
 		{
1953
-			if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
1953
+			if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
1954 1954
 			{
1955 1955
 				$message = Context::getLang('about_password_strength');
1956 1956
 				return new Object(-1, $message[$config->password_strength]);
1957 1957
 			}
1958 1958
 			$args->password = $oMemberModel->hashPassword($args->password);
1959 1959
 		}
1960
-		elseif(!$args->password)
1960
+		elseif (!$args->password)
1961 1961
 		{
1962 1962
 			unset($args->password);
1963 1963
 		}
1964 1964
 
1965 1965
 		// Check if ID is prohibited
1966
-		if($oMemberModel->isDeniedID($args->user_id))
1966
+		if ($oMemberModel->isDeniedID($args->user_id))
1967 1967
 		{
1968
-			return new Object(-1,'denied_user_id');
1968
+			return new Object(-1, 'denied_user_id');
1969 1969
 		}
1970 1970
 
1971 1971
 		// Check if ID is duplicate
1972 1972
 		$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
1973
-		if($member_srl)
1973
+		if ($member_srl)
1974 1974
 		{
1975
-			return new Object(-1,'msg_exists_user_id');
1975
+			return new Object(-1, 'msg_exists_user_id');
1976 1976
 		}
1977 1977
 
1978 1978
 		// Check if nickname is prohibited
1979
-		if($oMemberModel->isDeniedNickName($args->nick_name))
1979
+		if ($oMemberModel->isDeniedNickName($args->nick_name))
1980 1980
 		{
1981
-			return new Object(-1,'denied_nick_name');
1981
+			return new Object(-1, 'denied_nick_name');
1982 1982
 		}
1983 1983
 
1984 1984
 		// Check if nickname is duplicate
1985 1985
 		$member_srl = $oMemberModel->getMemberSrlByNickName($args->nick_name);
1986
-		if($member_srl)
1986
+		if ($member_srl)
1987 1987
 		{
1988
-			return new Object(-1,'msg_exists_nick_name');
1988
+			return new Object(-1, 'msg_exists_nick_name');
1989 1989
 		}
1990 1990
 
1991 1991
 		// Check if email address is duplicate
1992 1992
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($args->email_address);
1993
-		if($member_srl)
1993
+		if ($member_srl)
1994 1994
 		{
1995
-			return new Object(-1,'msg_exists_email_address');
1995
+			return new Object(-1, 'msg_exists_email_address');
1996 1996
 		}
1997 1997
 
1998 1998
 		// Insert data into the DB
1999 1999
 		$args->list_order = -1 * $args->member_srl;
2000 2000
 
2001
-		if(!$args->user_id) $args->user_id = 't'.$args->member_srl;
2002
-		if(!$args->user_name) $args->user_name = $args->member_srl;
2001
+		if (!$args->user_id) $args->user_id = 't'.$args->member_srl;
2002
+		if (!$args->user_name) $args->user_name = $args->member_srl;
2003 2003
 
2004 2004
 		$oDB = &DB::getInstance();
2005 2005
 		$oDB->begin();
2006 2006
 
2007 2007
 		$output = executeQuery('member.insertMember', $args);
2008
-		if(!$output->toBool())
2008
+		if (!$output->toBool())
2009 2009
 		{
2010 2010
 			$oDB->rollback();
2011 2011
 			return $output;
2012 2012
 		}
2013 2013
 
2014
-		if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2014
+		if (is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2015 2015
 		else $group_srl_list = explode('|@|', $args->group_srl_list);
2016 2016
 		// If no value is entered the default group, the value of group registration
2017
-		if(!$args->group_srl_list)
2017
+		if (!$args->group_srl_list)
2018 2018
 		{
2019 2019
 			$columnList = array('site_srl', 'group_srl');
2020 2020
 			$default_group = $oMemberModel->getDefaultGroup(0, $columnList);
2021
-			if($default_group)
2021
+			if ($default_group)
2022 2022
 			{
2023 2023
 				// Add to the default group
2024
-				$output = $this->addMemberToGroup($args->member_srl,$default_group->group_srl);
2025
-				if(!$output->toBool())
2024
+				$output = $this->addMemberToGroup($args->member_srl, $default_group->group_srl);
2025
+				if (!$output->toBool())
2026 2026
 				{
2027 2027
 					$oDB->rollback();
2028 2028
 					return $output;
@@ -2032,11 +2032,11 @@  discard block
 block discarded – undo
2032 2032
 		}
2033 2033
 		else
2034 2034
 		{
2035
-			for($i=0;$i<count($group_srl_list);$i++)
2035
+			for ($i = 0; $i < count($group_srl_list); $i++)
2036 2036
 			{
2037
-				$output = $this->addMemberToGroup($args->member_srl,$group_srl_list[$i]);
2037
+				$output = $this->addMemberToGroup($args->member_srl, $group_srl_list[$i]);
2038 2038
 
2039
-				if(!$output->toBool())
2039
+				if (!$output->toBool())
2040 2040
 				{
2041 2041
 					$oDB->rollback();
2042 2042
 					return $output;
@@ -2046,7 +2046,7 @@  discard block
 block discarded – undo
2046 2046
 
2047 2047
 		$member_config = $oModuleModel->getModuleConfig('member');
2048 2048
 		// When using email authentication mode (when you subscribed members denied a) certified mail sent
2049
-		if($args->denied == 'Y')
2049
+		if ($args->denied == 'Y')
2050 2050
 		{
2051 2051
 			// Insert data into the authentication DB
2052 2052
 			$oPassword = new Password();
@@ -2058,7 +2058,7 @@  discard block
 block discarded – undo
2058 2058
 			$auth_args->is_register = 'Y';
2059 2059
 
2060 2060
 			$output = executeQuery('member.insertAuthMail', $auth_args);
2061
-			if(!$output->toBool())
2061
+			if (!$output->toBool())
2062 2062
 			{
2063 2063
 				$oDB->rollback();
2064 2064
 				return $output;
@@ -2066,10 +2066,10 @@  discard block
 block discarded – undo
2066 2066
 			$this->_sendAuthMail($auth_args, $args);
2067 2067
 		}
2068 2068
 		// Call a trigger (after)
2069
-		if($output->toBool())
2069
+		if ($output->toBool())
2070 2070
 		{
2071 2071
 			$trigger_output = ModuleHandler::triggerCall('member.insertMember', 'after', $args);
2072
-			if(!$trigger_output->toBool())
2072
+			if (!$trigger_output->toBool())
2073 2073
 			{
2074 2074
 				$oDB->rollback();
2075 2075
 				return $trigger_output;
@@ -2091,41 +2091,41 @@  discard block
 block discarded – undo
2091 2091
 	{
2092 2092
 		// Call a trigger (before)
2093 2093
 		$output = ModuleHandler::triggerCall('member.updateMember', 'before', $args);
2094
-		if(!$output->toBool()) return $output;
2094
+		if (!$output->toBool()) return $output;
2095 2095
 		// Create a model object
2096 2096
 		$oMemberModel = getModel('member');
2097 2097
 
2098 2098
 		$logged_info = Context::get('logged_info');
2099 2099
 		// Get what you want to modify the original information
2100
-		if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2100
+		if (!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2101 2101
 		// Control of essential parameters
2102
-		if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
2103
-		if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) $args->allow_message = 'Y';
2102
+		if ($args->allow_mailing != 'Y') $args->allow_mailing = 'N';
2103
+		if ($args->allow_message && !in_array($args->allow_message, array('Y', 'N', 'F'))) $args->allow_message = 'Y';
2104 2104
 
2105
-		if($logged_info->is_admin == 'Y')
2105
+		if ($logged_info->is_admin == 'Y')
2106 2106
 		{
2107
-			if($args->denied!='Y') $args->denied = 'N';
2108
-			if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N';
2107
+			if ($args->denied != 'Y') $args->denied = 'N';
2108
+			if ($args->is_admin != 'Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N';
2109 2109
 		}
2110 2110
 		else
2111 2111
 		{
2112 2112
 			unset($args->is_admin);
2113
-			if($is_admin == false)
2113
+			if ($is_admin == false)
2114 2114
 				unset($args->denied);
2115
-			if($logged_info->member_srl != $args->member_srl && $is_admin == false)
2115
+			if ($logged_info->member_srl != $args->member_srl && $is_admin == false)
2116 2116
 			{
2117 2117
 				return $this->stop('msg_invalid_request');
2118 2118
 			}
2119 2119
 		}
2120 2120
 
2121 2121
 		// Sanitize user ID, username, nickname, homepage, blog
2122
-		if($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2122
+		if ($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2123 2123
 		$args->user_name = htmlspecialchars($args->user_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2124 2124
 		$args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2125 2125
 		$args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2126 2126
 		$args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2127
-		if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
2128
-		if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) $args->blog = 'http://'.$args->blog;
2127
+		if ($args->homepage && !preg_match("/^[a-z]+:\/\//is", $args->homepage)) $args->homepage = 'http://'.$args->homepage;
2128
+		if ($args->blog && !preg_match("/^[a-z]+:\/\//is", $args->blog)) $args->blog = 'http://'.$args->blog;
2129 2129
 
2130 2130
 		// check member identifier form
2131 2131
 		$config = $oMemberModel->getMemberConfig();
@@ -2134,56 +2134,56 @@  discard block
 block discarded – undo
2134 2134
 		$orgMemberInfo = $output->data;
2135 2135
 
2136 2136
 		// Check if email address or user ID is duplicate
2137
-		if($config->identifier == 'email_address')
2137
+		if ($config->identifier == 'email_address')
2138 2138
 		{
2139 2139
 			$member_srl = $oMemberModel->getMemberSrlByEmailAddress($args->email_address);
2140
-			if($member_srl && $args->member_srl != $member_srl)
2140
+			if ($member_srl && $args->member_srl != $member_srl)
2141 2141
 			{
2142
-				return new Object(-1,'msg_exists_email_address');
2142
+				return new Object(-1, 'msg_exists_email_address');
2143 2143
 			}
2144 2144
 			$args->email_address = $orgMemberInfo->email_address;
2145 2145
 		}
2146 2146
 		else
2147 2147
 		{
2148 2148
 			$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
2149
-			if($member_srl && $args->member_srl != $member_srl)
2149
+			if ($member_srl && $args->member_srl != $member_srl)
2150 2150
 			{
2151
-				return new Object(-1,'msg_exists_user_id');
2151
+				return new Object(-1, 'msg_exists_user_id');
2152 2152
 			}
2153 2153
 
2154 2154
 			$args->user_id = $orgMemberInfo->user_id;
2155 2155
 		}
2156 2156
 
2157
-		if($logged_info->is_admin !== 'Y')
2157
+		if ($logged_info->is_admin !== 'Y')
2158 2158
 		{
2159 2159
 			// Check if ID is prohibited
2160
-			if($args->user_id && $oMemberModel->isDeniedID($args->user_id))
2160
+			if ($args->user_id && $oMemberModel->isDeniedID($args->user_id))
2161 2161
 			{
2162
-				return new Object(-1,'denied_user_id');
2162
+				return new Object(-1, 'denied_user_id');
2163 2163
 			}
2164 2164
 
2165 2165
 			// Check if nickname is prohibited
2166
-			if($args->nick_name && $oMemberModel->isDeniedNickName($args->nick_name))
2166
+			if ($args->nick_name && $oMemberModel->isDeniedNickName($args->nick_name))
2167 2167
 			{
2168 2168
 				return new Object(-1, 'denied_nick_name');
2169 2169
 			}
2170 2170
 		}
2171 2171
 
2172 2172
 		// Check if ID is duplicate
2173
-		if($args->user_id)
2173
+		if ($args->user_id)
2174 2174
 		{
2175 2175
 			$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
2176
-			if($member_srl && $args->member_srl != $member_srl)
2176
+			if ($member_srl && $args->member_srl != $member_srl)
2177 2177
 			{
2178
-				return new Object(-1,'msg_exists_user_id');
2178
+				return new Object(-1, 'msg_exists_user_id');
2179 2179
 			}
2180 2180
 		}
2181 2181
 
2182 2182
 		// Check if nickname is duplicate
2183 2183
 		$member_srl = $oMemberModel->getMemberSrlByNickName($args->nick_name);
2184
- 		if($member_srl && $args->member_srl != $member_srl)
2184
+ 		if ($member_srl && $args->member_srl != $member_srl)
2185 2185
  		{
2186
- 			return new Object(-1,'msg_exists_nick_name');
2186
+ 			return new Object(-1, 'msg_exists_nick_name');
2187 2187
  		}
2188 2188
 
2189 2189
 		list($args->email_id, $args->email_host) = explode('@', $args->email_address);
@@ -2192,9 +2192,9 @@  discard block
 block discarded – undo
2192 2192
 		$oDB->begin();
2193 2193
 
2194 2194
 		// Check password strength
2195
-		if($args->password)
2195
+		if ($args->password)
2196 2196
 		{
2197
-			if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2197
+			if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2198 2198
 			{
2199 2199
 				$message = Context::getLang('about_password_strength');
2200 2200
 				return new Object(-1, $message[$config->password_strength]);
@@ -2206,40 +2206,40 @@  discard block
 block discarded – undo
2206 2206
 			$args->password = $orgMemberInfo->password;
2207 2207
 		}
2208 2208
 		
2209
-		if(!$args->user_name) $args->user_name = $orgMemberInfo->user_name;
2210
-		if(!$args->user_id) $args->user_id = $orgMemberInfo->user_id;
2211
-		if(!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name;
2212
-		if(!$args->description) $args->description = '';
2213
-		if(!$args->birthday) $args->birthday = '';
2209
+		if (!$args->user_name) $args->user_name = $orgMemberInfo->user_name;
2210
+		if (!$args->user_id) $args->user_id = $orgMemberInfo->user_id;
2211
+		if (!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name;
2212
+		if (!$args->description) $args->description = '';
2213
+		if (!$args->birthday) $args->birthday = '';
2214 2214
 
2215 2215
 		$output = executeQuery('member.updateMember', $args);
2216 2216
 
2217
-		if(!$output->toBool())
2217
+		if (!$output->toBool())
2218 2218
 		{
2219 2219
 			$oDB->rollback();
2220 2220
 			return $output;
2221 2221
 		}
2222 2222
 
2223
-		if($args->group_srl_list)
2223
+		if ($args->group_srl_list)
2224 2224
 		{
2225
-			if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2225
+			if (is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2226 2226
 			else $group_srl_list = explode('|@|', $args->group_srl_list);
2227 2227
 			// If the group information, group information changes
2228
-			if(count($group_srl_list) > 0)
2228
+			if (count($group_srl_list) > 0)
2229 2229
 			{
2230 2230
 				$args->site_srl = 0;
2231 2231
 				// One of its members to delete all the group
2232 2232
 				$output = executeQuery('member.deleteMemberGroupMember', $args);
2233
-				if(!$output->toBool())
2233
+				if (!$output->toBool())
2234 2234
 				{
2235 2235
 					$oDB->rollback();
2236 2236
 					return $output;
2237 2237
 				}
2238 2238
 				// Enter one of the loop a
2239
-				for($i=0;$i<count($group_srl_list);$i++)
2239
+				for ($i = 0; $i < count($group_srl_list); $i++)
2240 2240
 				{
2241
-					$output = $this->addMemberToGroup($args->member_srl,$group_srl_list[$i]);
2242
-					if(!$output->toBool())
2241
+					$output = $this->addMemberToGroup($args->member_srl, $group_srl_list[$i]);
2242
+					if (!$output->toBool())
2243 2243
 					{
2244 2244
 						$oDB->rollback();
2245 2245
 						return $output;
@@ -2251,9 +2251,9 @@  discard block
 block discarded – undo
2251 2251
 			}
2252 2252
 		}
2253 2253
 		// Call a trigger (after)
2254
-		if($output->toBool()) {
2254
+		if ($output->toBool()) {
2255 2255
 			$trigger_output = ModuleHandler::triggerCall('member.updateMember', 'after', $args);
2256
-			if(!$trigger_output->toBool())
2256
+			if (!$trigger_output->toBool())
2257 2257
 			{
2258 2258
 				$oDB->rollback();
2259 2259
 				return $trigger_output;
@@ -2266,7 +2266,7 @@  discard block
 block discarded – undo
2266 2266
 		$this->_clearMemberCache($args->member_srl, $args->site_srl);
2267 2267
 
2268 2268
 		// Save Session
2269
-		if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2269
+		if (!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2270 2270
 		$logged_info = Context::get('logged_info');
2271 2271
 
2272 2272
 		$output->add('member_srl', $args->member_srl);
@@ -2278,14 +2278,14 @@  discard block
 block discarded – undo
2278 2278
 	 */
2279 2279
 	function updateMemberPassword($args)
2280 2280
 	{
2281
-		if($args->password)
2281
+		if ($args->password)
2282 2282
 		{
2283 2283
 
2284 2284
 			// check password strength
2285 2285
 			$oMemberModel = getModel('member');
2286 2286
 			$config = $oMemberModel->getMemberConfig();
2287 2287
 
2288
-			if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2288
+			if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2289 2289
 			{
2290 2290
 				$message = Context::getLang('about_password_strength');
2291 2291
 				return new Object(-1, $message[$config->password_strength]);
@@ -2293,13 +2293,13 @@  discard block
 block discarded – undo
2293 2293
 
2294 2294
 			$args->password = $oMemberModel->hashPassword($args->password);
2295 2295
 		}
2296
-		else if($args->hashed_password)
2296
+		else if ($args->hashed_password)
2297 2297
 		{
2298 2298
 			$args->password = $args->hashed_password;
2299 2299
 		}
2300 2300
 
2301 2301
 		$output = executeQuery('member.updateMemberPassword', $args);
2302
-		if($output->toBool())
2302
+		if ($output->toBool())
2303 2303
 		{
2304 2304
 			$result = executeQuery('member.updateChangePasswordDate', $args);
2305 2305
 		}
@@ -2318,18 +2318,18 @@  discard block
 block discarded – undo
2318 2318
 		$trigger_obj = new stdClass();
2319 2319
 		$trigger_obj->member_srl = $member_srl;
2320 2320
 		$output = ModuleHandler::triggerCall('member.deleteMember', 'before', $trigger_obj);
2321
-		if(!$output->toBool()) return $output;
2321
+		if (!$output->toBool()) return $output;
2322 2322
 		// Create a model object
2323 2323
 		$oMemberModel = getModel('member');
2324 2324
 		// Bringing the user's information
2325
-		if(!$this->memberInfo || $this->memberInfo->member_srl != $member_srl || !isset($this->memberInfo->is_admin))
2325
+		if (!$this->memberInfo || $this->memberInfo->member_srl != $member_srl || !isset($this->memberInfo->is_admin))
2326 2326
 		{
2327 2327
 			$columnList = array('member_srl', 'is_admin');
2328 2328
 			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
2329 2329
 		}
2330
-		if(!$this->memberInfo) return new Object(-1, 'msg_not_exists_member');
2330
+		if (!$this->memberInfo) return new Object(-1, 'msg_not_exists_member');
2331 2331
 		// If managers can not be deleted
2332
-		if($this->memberInfo->is_admin == 'Y') return new Object(-1, 'msg_cannot_delete_admin');
2332
+		if ($this->memberInfo->is_admin == 'Y') return new Object(-1, 'msg_cannot_delete_admin');
2333 2333
 
2334 2334
 		$oDB = &DB::getInstance();
2335 2335
 		$oDB->begin();
@@ -2338,7 +2338,7 @@  discard block
 block discarded – undo
2338 2338
 		$args->member_srl = $member_srl;
2339 2339
 		// Delete the entries in member_auth_mail
2340 2340
 		$output = executeQuery('member.deleteAuthMail', $args);
2341
-		if(!$output->toBool())
2341
+		if (!$output->toBool())
2342 2342
 		{
2343 2343
 			$oDB->rollback();
2344 2344
 			return $output;
@@ -2353,23 +2353,23 @@  discard block
 block discarded – undo
2353 2353
 		 */
2354 2354
 		// Delete the entries in member_group_member
2355 2355
 		$output = executeQuery('member.deleteMemberGroupMember', $args);
2356
-		if(!$output->toBool())
2356
+		if (!$output->toBool())
2357 2357
 		{
2358 2358
 			$oDB->rollback();
2359 2359
 			return $output;
2360 2360
 		}
2361 2361
 		// member removed from the table
2362 2362
 		$output = executeQuery('member.deleteMember', $args);
2363
-		if(!$output->toBool())
2363
+		if (!$output->toBool())
2364 2364
 		{
2365 2365
 			$oDB->rollback();
2366 2366
 			return $output;
2367 2367
 		}
2368 2368
 		// Call a trigger (after)
2369
-		if($output->toBool())
2369
+		if ($output->toBool())
2370 2370
 		{
2371 2371
 			$trigger_output = ModuleHandler::triggerCall('member.deleteMember', 'after', $trigger_obj);
2372
-			if(!$trigger_output->toBool())
2372
+			if (!$trigger_output->toBool())
2373 2373
 			{
2374 2374
 				$oDB->rollback();
2375 2375
 				return $trigger_output;
@@ -2393,23 +2393,23 @@  discard block
 block discarded – undo
2393 2393
 	 */
2394 2394
 	function destroySessionInfo()
2395 2395
 	{
2396
-		if(!$_SESSION || !is_array($_SESSION)) return;
2396
+		if (!$_SESSION || !is_array($_SESSION)) return;
2397 2397
 
2398 2398
 		$memberInfo = Context::get('logged_info');
2399 2399
 		$memberSrl = $memberInfo->member_srl;
2400 2400
 
2401
-		foreach($_SESSION as $key => $val)
2401
+		foreach ($_SESSION as $key => $val)
2402 2402
 		{
2403 2403
 			$_SESSION[$key] = '';
2404 2404
 		}
2405 2405
 
2406 2406
 		session_destroy();
2407
-		setcookie(session_name(), '', $_SERVER['REQUEST_TIME']-42000, '/');
2408
-		setcookie('sso','',$_SERVER['REQUEST_TIME']-42000, '/');
2409
-		setcookie('xeak','',$_SERVER['REQUEST_TIME']-42000, '/');
2407
+		setcookie(session_name(), '', $_SERVER['REQUEST_TIME'] - 42000, '/');
2408
+		setcookie('sso', '', $_SERVER['REQUEST_TIME'] - 42000, '/');
2409
+		setcookie('xeak', '', $_SERVER['REQUEST_TIME'] - 42000, '/');
2410 2410
 		setcookie('xe_logged', 'false', $_SERVER['REQUEST_TIME'] - 42000, '/');
2411 2411
 
2412
-		if($memberSrl || $_COOKIE['xeak'])
2412
+		if ($memberSrl || $_COOKIE['xeak'])
2413 2413
 		{
2414 2414
 			$args = new stdClass();
2415 2415
 			$args->member_srl = $memberSrl;
@@ -2425,22 +2425,22 @@  discard block
 block discarded – undo
2425 2425
 		$pointGroup = $pointModuleConfig->point_group;
2426 2426
 
2427 2427
 		$levelGroup = array();
2428
-		if(is_array($pointGroup) && count($pointGroup)>0)
2428
+		if (is_array($pointGroup) && count($pointGroup) > 0)
2429 2429
 		{
2430 2430
 			$levelGroup = array_flip($pointGroup);
2431 2431
 			ksort($levelGroup);
2432 2432
 		}
2433 2433
 		$maxLevel = 0;
2434 2434
 		$resultGroup = array_intersect($levelGroup, $groupSrlList);
2435
-		if(count($resultGroup) > 0)
2435
+		if (count($resultGroup) > 0)
2436 2436
 			$maxLevel = max(array_flip($resultGroup));
2437 2437
 
2438
-		if($maxLevel > 0)
2438
+		if ($maxLevel > 0)
2439 2439
 		{
2440 2440
 			$oPointModel = getModel('point');
2441 2441
 			$originPoint = $oPointModel->getPoint($memberSrl);
2442 2442
 
2443
-			if($pointModuleConfig->level_step[$maxLevel] > $originPoint)
2443
+			if ($pointModuleConfig->level_step[$maxLevel] > $originPoint)
2444 2444
 			{
2445 2445
 				$oPointController = getController('point');
2446 2446
 				$oPointController->setPoint($memberSrl, $pointModuleConfig->level_step[$maxLevel], 'update');
@@ -2450,18 +2450,18 @@  discard block
 block discarded – undo
2450 2450
 
2451 2451
 	function procMemberModifyEmailAddress()
2452 2452
 	{
2453
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
2453
+		if (!Context::get('is_logged')) return $this->stop('msg_not_logged');
2454 2454
 
2455 2455
 		$member_info = Context::get('logged_info');
2456 2456
 		$newEmail = Context::get('email_address');
2457 2457
 
2458
-		if(!$newEmail) return $this->stop('msg_invalid_request');
2458
+		if (!$newEmail) return $this->stop('msg_invalid_request');
2459 2459
 
2460 2460
 		$oMemberModel = getModel('member');
2461 2461
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail);
2462
-		if($member_srl) return new Object(-1,'msg_exists_email_address');
2462
+		if ($member_srl) return new Object(-1, 'msg_exists_email_address');
2463 2463
 
2464
-		if($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
2464
+		if ($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
2465 2465
 		{
2466 2466
 			return $this->stop('msg_invalid_request');
2467 2467
 		}
@@ -2477,7 +2477,7 @@  discard block
 block discarded – undo
2477 2477
 		$oDB = &DB::getInstance();
2478 2478
 		$oDB->begin();
2479 2479
 		$output = executeQuery('member.insertAuthMail', $auth_args);
2480
-		if(!$output->toBool())
2480
+		if (!$output->toBool())
2481 2481
 		{
2482 2482
 			$oDB->rollback();
2483 2483
 			return $output;
@@ -2487,7 +2487,7 @@  discard block
 block discarded – undo
2487 2487
 		$member_config = $oModuleModel->getModuleConfig('member');
2488 2488
 
2489 2489
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
2490
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
2490
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
2491 2491
 
2492 2492
 		global $lang;
2493 2493
 
@@ -2499,17 +2499,17 @@  discard block
 block discarded – undo
2499 2499
 
2500 2500
 		Context::set('newEmail', $newEmail);
2501 2501
 
2502
-		$auth_url = getFullUrl('','module','member','act','procMemberAuthEmailAddress','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key);
2502
+		$auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthEmailAddress', 'member_srl', $member_info->member_srl, 'auth_key', $auth_args->auth_key);
2503 2503
 		Context::set('auth_url', $auth_url);
2504 2504
 
2505 2505
 		$oTemplate = &TemplateHandler::getInstance();
2506 2506
 		$content = $oTemplate->compile($tpl_path, 'confirm_member_new_email');
2507 2507
 
2508 2508
 		$oMail = new Mail();
2509
-		$oMail->setTitle( Context::getLang('title_modify_email_address') );
2509
+		$oMail->setTitle(Context::getLang('title_modify_email_address'));
2510 2510
 		$oMail->setContent($content);
2511
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
2512
-		$oMail->setReceiptor( $member_info->nick_name, $newEmail );
2511
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
2512
+		$oMail->setReceiptor($member_info->nick_name, $newEmail);
2513 2513
 		$result = $oMail->send();
2514 2514
 
2515 2515
 		$msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $newEmail);
@@ -2523,16 +2523,16 @@  discard block
 block discarded – undo
2523 2523
 	{
2524 2524
 		$member_srl = Context::get('member_srl');
2525 2525
 		$auth_key = Context::get('auth_key');
2526
-		if(!$member_srl || !$auth_key) return $this->stop('msg_invalid_request');
2526
+		if (!$member_srl || !$auth_key) return $this->stop('msg_invalid_request');
2527 2527
 
2528 2528
 		// Test logs for finding password by user_id and authkey
2529 2529
 		$args = new stdClass;
2530 2530
 		$args->member_srl = $member_srl;
2531 2531
 		$args->auth_key = $auth_key;
2532 2532
 		$output = executeQuery('member.getAuthMail', $args);
2533
-		if(!$output->toBool() || $output->data->auth_key != $auth_key)
2533
+		if (!$output->toBool() || $output->data->auth_key != $auth_key)
2534 2534
 		{
2535
-			if(strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args);
2535
+			if (strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args);
2536 2536
 			return $this->stop('msg_invalid_modify_email_auth_key');
2537 2537
 		}
2538 2538
 
@@ -2541,10 +2541,10 @@  discard block
 block discarded – undo
2541 2541
 		list($args->email_id, $args->email_host) = explode('@', $newEmail);
2542 2542
 
2543 2543
 		$output = executeQuery('member.updateMemberEmailAddress', $args);
2544
-		if(!$output->toBool()) return $this->stop($output->getMessage());
2544
+		if (!$output->toBool()) return $this->stop($output->getMessage());
2545 2545
 
2546 2546
 		// Remove all values having the member_srl and new_password equal to 'XE_change_emaill_address' from authentication table
2547
-		executeQuery('member.deleteAuthChangeEmailAddress',$args);
2547
+		executeQuery('member.deleteAuthChangeEmailAddress', $args);
2548 2548
 
2549 2549
 		$this->_clearMemberCache($args->member_srl);
2550 2550
 
@@ -2562,7 +2562,7 @@  discard block
 block discarded – undo
2562 2562
 	**/
2563 2563
 	function triggerGetDocumentMenu(&$menu_list)
2564 2564
 	{
2565
-		if(!Context::get('is_logged')) return new Object();
2565
+		if (!Context::get('is_logged')) return new Object();
2566 2566
 
2567 2567
 		$logged_info = Context::get('logged_info');
2568 2568
 		$document_srl = Context::get('target_srl');
@@ -2573,12 +2573,12 @@  discard block
 block discarded – undo
2573 2573
 		$member_srl = $oDocument->get('member_srl');
2574 2574
 		$module_srl = $oDocument->get('module_srl');
2575 2575
 
2576
-		if(!$member_srl) return new Object();
2577
-		if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new Object();
2576
+		if (!$member_srl) return new Object();
2577
+		if ($oDocumentModel->grant->manager != 1 || $member_srl == $logged_info->member_srl) return new Object();
2578 2578
 
2579 2579
 		$oDocumentController = getController('document');
2580
-		$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
2581
-		$oDocumentController->addDocumentPopupMenu($url,'cmd_spammer','','popup');
2580
+		$url = getUrl('', 'module', 'member', 'act', 'dispMemberSpammer', 'member_srl', $member_srl, 'module_srl', $module_srl);
2581
+		$oDocumentController->addDocumentPopupMenu($url, 'cmd_spammer', '', 'popup');
2582 2582
 
2583 2583
 		return new Object();
2584 2584
 	}
@@ -2592,7 +2592,7 @@  discard block
 block discarded – undo
2592 2592
 	**/
2593 2593
 	function triggerGetCommentMenu(&$menu_list)
2594 2594
 	{
2595
-		if(!Context::get('is_logged')) return new Object();
2595
+		if (!Context::get('is_logged')) return new Object();
2596 2596
 
2597 2597
 		$logged_info = Context::get('logged_info');
2598 2598
 		$comment_srl = Context::get('target_srl');
@@ -2603,12 +2603,12 @@  discard block
 block discarded – undo
2603 2603
 		$module_srl = $oComment->get('module_srl');
2604 2604
 		$member_srl = $oComment->get('member_srl');
2605 2605
 
2606
-		if(!$member_srl) return new Object();
2607
-		if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new Object();
2606
+		if (!$member_srl) return new Object();
2607
+		if ($oCommentModel->grant->manager != 1 || $member_srl == $logged_info->member_srl) return new Object();
2608 2608
 
2609 2609
 		$oCommentController = getController('comment');
2610
-		$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
2611
-		$oCommentController->addCommentPopupMenu($url,'cmd_spammer','','popup');
2610
+		$url = getUrl('', 'module', 'member', 'act', 'dispMemberSpammer', 'member_srl', $member_srl, 'module_srl', $module_srl);
2611
+		$oCommentController->addCommentPopupMenu($url, 'cmd_spammer', '', 'popup');
2612 2612
 
2613 2613
 		return new Object();
2614 2614
 	}
@@ -2620,7 +2620,7 @@  discard block
 block discarded – undo
2620 2620
 	**/
2621 2621
 	function procMemberSpammerManage()
2622 2622
 	{
2623
-		if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
2623
+		if (!Context::get('is_logged')) return new Object(-1, 'msg_not_permitted');
2624 2624
 
2625 2625
 		$logged_info = Context::get('logged_info');
2626 2626
 		$member_srl = Context::get('member_srl');
@@ -2628,7 +2628,7 @@  discard block
 block discarded – undo
2628 2628
 		$cnt_loop = Context::get('cnt_loop');
2629 2629
 		$proc_type = Context::get('proc_type');
2630 2630
 		$isMoveToTrash = true;
2631
-		if($proc_type == "delete")
2631
+		if ($proc_type == "delete")
2632 2632
 			$isMoveToTrash = false;
2633 2633
 
2634 2634
 		// check grant
@@ -2637,7 +2637,7 @@  discard block
 block discarded – undo
2637 2637
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
2638 2638
 		$grant = $oModuleModel->getGrant($module_info, $logged_info);
2639 2639
 
2640
-		if(!$grant->manager) return new Object(-1,'msg_not_permitted');
2640
+		if (!$grant->manager) return new Object(-1, 'msg_not_permitted');
2641 2641
 
2642 2642
 		$proc_msg = "";
2643 2643
 
@@ -2646,10 +2646,10 @@  discard block
 block discarded – undo
2646 2646
 
2647 2647
 		// delete or trash destination
2648 2648
 		// proc member
2649
-		if($cnt_loop == 1)
2649
+		if ($cnt_loop == 1)
2650 2650
 			$this->_spammerMember($member_srl);
2651 2651
 		// proc document and comment
2652
-		elseif($cnt_loop>1)
2652
+		elseif ($cnt_loop > 1)
2653 2653
 			$this->_spammerDocuments($member_srl, $isMoveToTrash);
2654 2654
 
2655 2655
 		// get destination count
@@ -2658,11 +2658,11 @@  discard block
 block discarded – undo
2658 2658
 
2659 2659
 		$total_count = Context::get('total_count');
2660 2660
 		$remain_count = $cnt_document + $cnt_comment;
2661
-		if($cnt_loop == 1) $total_count = $remain_count;
2661
+		if ($cnt_loop == 1) $total_count = $remain_count;
2662 2662
 
2663 2663
 		// get progress percent
2664
-		if($total_count > 0)
2665
-			$progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 );
2664
+		if ($total_count > 0)
2665
+			$progress = intval((($total_count - $remain_count) / $total_count) * 100);
2666 2666
 		else
2667 2667
 			$progress = 100;
2668 2668
 
@@ -2686,7 +2686,7 @@  discard block
 block discarded – undo
2686 2686
 	**/
2687 2687
 	private function _spammerMember($member_srl) {
2688 2688
 		$logged_info = Context::get('logged_info');
2689
-		$spam_description = trim( Context::get('spam_description') );
2689
+		$spam_description = trim(Context::get('spam_description'));
2690 2690
 
2691 2691
 		$oMemberModel = getModel('member');
2692 2692
 		$columnList = array('member_srl', 'email_address', 'user_id', 'nick_name', 'description');
@@ -2705,10 +2705,10 @@  discard block
 block discarded – undo
2705 2705
 		$args->user_id = $member_info->user_id;
2706 2706
 		$args->nick_name = $member_info->nick_name;
2707 2707
 		$args->denied = "Y";
2708
-		$args->description = trim( $member_info->description );
2709
-		if( $args->description != "" ) $args->description .= "\n";	// add new line
2708
+		$args->description = trim($member_info->description);
2709
+		if ($args->description != "") $args->description .= "\n"; // add new line
2710 2710
 
2711
-		$args->description .= Context::getLang('cmd_spammer') . "[" . date("Y-m-d H:i:s") . " from:" . $logged_info->user_id . " info:" . $spam_description . " docuemnts count:" . $total_count . "]";
2711
+		$args->description .= Context::getLang('cmd_spammer')."[".date("Y-m-d H:i:s")." from:".$logged_info->user_id." info:".$spam_description." docuemnts count:".$total_count."]";
2712 2712
 
2713 2713
 		$output = $this->updateMember($args, true);
2714 2714
 
@@ -2737,21 +2737,21 @@  discard block
 block discarded – undo
2737 2737
 		// 1. proc comment, 2. proc document
2738 2738
 		$cnt_comment = $oCommentModel->getCommentCountByMemberSrl($member_srl);
2739 2739
 		$cnt_document = $oDocumentModel->getDocumentCountByMemberSrl($member_srl);
2740
-		if($cnt_comment > 0)
2740
+		if ($cnt_comment > 0)
2741 2741
 		{
2742 2742
 			$columnList = array();
2743 2743
 			$commentList = $oCommentModel->getCommentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount);
2744
-			if($commentList) {
2745
-				foreach($commentList as $v) {
2744
+			if ($commentList) {
2745
+				foreach ($commentList as $v) {
2746 2746
 					$oCommentController->deleteComment($v->comment_srl, true, $isMoveToTrash);
2747 2747
 				}
2748 2748
 			}
2749
-		} elseif($cnt_document > 0) {
2749
+		} elseif ($cnt_document > 0) {
2750 2750
 			$columnList = array();
2751 2751
 			$documentList = $oDocumentModel->getDocumentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount);
2752
-			if($documentList) {
2753
-				foreach($documentList as $v) {
2754
-					if($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v);
2752
+			if ($documentList) {
2753
+				foreach ($documentList as $v) {
2754
+					if ($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v);
2755 2755
 					else $oDocumentController->deleteDocument($v->document_srl);
2756 2756
 				}
2757 2757
 			}
@@ -2763,24 +2763,24 @@  discard block
 block discarded – undo
2763 2763
 	function _clearMemberCache($member_srl, $site_srl = 0)
2764 2764
 	{
2765 2765
 		$oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE);
2766
-		if($oCacheHandler->isSupport())
2766
+		if ($oCacheHandler->isSupport())
2767 2767
 		{
2768
-			$object_key = 'member_groups:' . getNumberingPath($member_srl) . $member_srl . '_' . $site_srl;
2768
+			$object_key = 'member_groups:'.getNumberingPath($member_srl).$member_srl.'_'.$site_srl;
2769 2769
 			$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
2770 2770
 			$oCacheHandler->delete($cache_key);
2771 2771
 
2772
-			if($site_srl !== 0)
2772
+			if ($site_srl !== 0)
2773 2773
 			{
2774
-				$object_key = 'member_groups:' . getNumberingPath($member_srl) . $member_srl . '_0';
2774
+				$object_key = 'member_groups:'.getNumberingPath($member_srl).$member_srl.'_0';
2775 2775
 				$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
2776 2776
 				$oCacheHandler->delete($cache_key);
2777 2777
 			}
2778 2778
 		}
2779 2779
 
2780 2780
 		$oCacheHandler = CacheHandler::getInstance('object');
2781
-		if($oCacheHandler->isSupport())
2781
+		if ($oCacheHandler->isSupport())
2782 2782
 		{
2783
-			$object_key = 'member_info:' . getNumberingPath($member_srl) . $member_srl;
2783
+			$object_key = 'member_info:'.getNumberingPath($member_srl).$member_srl;
2784 2784
 			$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
2785 2785
 			$oCacheHandler->delete($cache_key);
2786 2786
 		}
Please login to merge, or discard this patch.
modules/member/member.model.php 3 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -297,6 +297,7 @@
 block discarded – undo
297 297
 
298 298
 	/**
299 299
 	 * @brief Return member information with member_srl
300
+	 * @param string $member_srl
300 301
 	 */
301 302
 	function getMemberInfoByMemberSrl($member_srl, $site_srl = 0, $columnList = array())
302 303
 	{
Please login to merge, or discard this patch.
Spacing   +175 added lines, -175 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 	{
27 27
 		static $member_config;
28 28
 
29
-		if($member_config)
29
+		if ($member_config)
30 30
 		{
31 31
 			return $member_config;
32 32
 		}
@@ -35,42 +35,42 @@  discard block
 block discarded – undo
35 35
 		$oModuleModel = getModel('module');
36 36
 		$config = $oModuleModel->getModuleConfig('member');
37 37
 
38
-		if(!$config->signupForm || !is_array($config->signupForm))
38
+		if (!$config->signupForm || !is_array($config->signupForm))
39 39
 		{
40 40
 			$oMemberAdminController = getAdminController('member');
41 41
 			$identifier = ($config->identifier) ? $config->identifier : 'email_address';
42 42
 			$config->signupForm = $oMemberAdminController->createSignupForm($identifier);
43 43
 		}
44 44
 		//for multi language
45
-		foreach($config->signupForm AS $key=>$value)
45
+		foreach ($config->signupForm AS $key=>$value)
46 46
 		{
47 47
 			$config->signupForm[$key]->title = ($value->isDefaultForm) ? Context::getLang($value->name) : $value->title;
48
-			if($config->signupForm[$key]->isPublic != 'N') $config->signupForm[$key]->isPublic = 'Y';
49
-			if($value->name == 'find_account_question') $config->signupForm[$key]->isPublic = 'N';
48
+			if ($config->signupForm[$key]->isPublic != 'N') $config->signupForm[$key]->isPublic = 'Y';
49
+			if ($value->name == 'find_account_question') $config->signupForm[$key]->isPublic = 'N';
50 50
 		}
51 51
 
52 52
 		// Get terms of user
53 53
 		$config->agreement = memberModel::_getAgreement();
54 54
 
55
-		if(!$config->webmaster_name) $config->webmaster_name = 'webmaster';
56
-		if(!$config->image_name_max_width) $config->image_name_max_width = 90;
57
-		if(!$config->image_name_max_height) $config->image_name_max_height = 20;
58
-		if(!$config->image_mark_max_width) $config->image_mark_max_width = 20;
59
-		if(!$config->image_mark_max_height) $config->image_mark_max_height = 20;
60
-		if(!$config->profile_image_max_width) $config->profile_image_max_width = 90;
61
-		if(!$config->profile_image_max_height) $config->profile_image_max_height = 90;
62
-		if(!$config->skin) $config->skin = 'default';
63
-		if(!$config->colorset) $config->colorset = 'white';
64
-		if(!$config->editor_skin || $config->editor_skin == 'default') $config->editor_skin = 'ckeditor';
65
-		if(!$config->group_image_mark) $config->group_image_mark = "N";
55
+		if (!$config->webmaster_name) $config->webmaster_name = 'webmaster';
56
+		if (!$config->image_name_max_width) $config->image_name_max_width = 90;
57
+		if (!$config->image_name_max_height) $config->image_name_max_height = 20;
58
+		if (!$config->image_mark_max_width) $config->image_mark_max_width = 20;
59
+		if (!$config->image_mark_max_height) $config->image_mark_max_height = 20;
60
+		if (!$config->profile_image_max_width) $config->profile_image_max_width = 90;
61
+		if (!$config->profile_image_max_height) $config->profile_image_max_height = 90;
62
+		if (!$config->skin) $config->skin = 'default';
63
+		if (!$config->colorset) $config->colorset = 'white';
64
+		if (!$config->editor_skin || $config->editor_skin == 'default') $config->editor_skin = 'ckeditor';
65
+		if (!$config->group_image_mark) $config->group_image_mark = "N";
66 66
 
67
-		if(!$config->identifier) $config->identifier = 'user_id';
67
+		if (!$config->identifier) $config->identifier = 'user_id';
68 68
 
69
-		if(!$config->max_error_count) $config->max_error_count = 10;
70
-		if(!$config->max_error_count_time) $config->max_error_count_time = 300;
69
+		if (!$config->max_error_count) $config->max_error_count = 10;
70
+		if (!$config->max_error_count_time) $config->max_error_count_time = 300;
71 71
 
72
-		if(!$config->signature_editor_skin || $config->signature_editor_skin == 'default') $config->signature_editor_skin = 'ckeditor';
73
-		if(!$config->sel_editor_colorset) $config->sel_editor_colorset = 'moono';
72
+		if (!$config->signature_editor_skin || $config->signature_editor_skin == 'default') $config->signature_editor_skin = 'ckeditor';
73
+		if (!$config->sel_editor_colorset) $config->sel_editor_colorset = 'moono';
74 74
 
75 75
 		$member_config = $config;
76 76
 
@@ -79,24 +79,24 @@  discard block
 block discarded – undo
79 79
 
80 80
 	function _getAgreement()
81 81
 	{
82
-		$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_' . Context::get('lang_type') . '.txt';
83
-		if(is_readable($agreement_file))
82
+		$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_'.Context::get('lang_type').'.txt';
83
+		if (is_readable($agreement_file))
84 84
 		{
85 85
 			return FileHandler::readFile($agreement_file);
86 86
 		}
87 87
 
88 88
 		$db_info = Context::getDBInfo();
89
-		$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_' . $db_info->lang_type . '.txt';
90
-		if(is_readable($agreement_file))
89
+		$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_'.$db_info->lang_type.'.txt';
90
+		if (is_readable($agreement_file))
91 91
 		{
92 92
 			return FileHandler::readFile($agreement_file);
93 93
 		}
94 94
 
95 95
 		$lang_selected = Context::loadLangSelected();
96
-		foreach($lang_selected as $key => $val)
96
+		foreach ($lang_selected as $key => $val)
97 97
 		{
98
-			$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_' . $key . '.txt';
99
-			if(is_readable($agreement_file))
98
+			$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_'.$key.'.txt';
99
+			if (is_readable($agreement_file))
100 100
 			{
101 101
 				return FileHandler::readFile($agreement_file);
102 102
 			}
@@ -116,12 +116,12 @@  discard block
 block discarded – undo
116 116
 		$logged_info = Context::get('logged_info');
117 117
 		$act = Context::get('cur_act');
118 118
 		// When click user's own nickname
119
-		if($member_srl == $logged_info->member_srl) $member_info = $logged_info;
119
+		if ($member_srl == $logged_info->member_srl) $member_info = $logged_info;
120 120
 		// When click other's nickname
121 121
 		else $member_info = $this->getMemberInfoByMemberSrl($member_srl);
122 122
 
123 123
 		$member_srl = $member_info->member_srl;
124
-		if(!$member_srl) return;
124
+		if (!$member_srl) return;
125 125
 		// List variables
126 126
 		$user_id = $member_info->user_id;
127 127
 		$user_name = $member_info->user_name;
@@ -130,18 +130,18 @@  discard block
 block discarded – undo
130 130
 
131 131
 		$oMemberController = getController('member');
132 132
 		// Display member information (Don't display to non-logged user)
133
-		if($logged_info->member_srl)
133
+		if ($logged_info->member_srl)
134 134
 		{
135
-			$url = getUrl('','mid',$mid,'act','dispMemberInfo','member_srl',$member_srl);
136
-			$oMemberController->addMemberPopupMenu($url,'cmd_view_member_info',$icon_path,'self');
135
+			$url = getUrl('', 'mid', $mid, 'act', 'dispMemberInfo', 'member_srl', $member_srl);
136
+			$oMemberController->addMemberPopupMenu($url, 'cmd_view_member_info', $icon_path, 'self');
137 137
 		}
138 138
 		// When click other's nickname
139
-		if($member_srl != $logged_info->member_srl && $logged_info->member_srl)
139
+		if ($member_srl != $logged_info->member_srl && $logged_info->member_srl)
140 140
 		{
141 141
 			// Get email config
142
-			foreach($this->module_config->signupForm as $field)
142
+			foreach ($this->module_config->signupForm as $field)
143 143
 			{
144
-				if($field->name == 'email_address')
144
+				if ($field->name == 'email_address')
145 145
 				{
146 146
 					$email_config = $field;
147 147
 					break;
@@ -149,36 +149,36 @@  discard block
 block discarded – undo
149 149
 			}
150 150
 
151 151
 			// Send an email only if email address is public
152
-			if(($logged_info->is_admin == 'Y' || $email_config->isPublic == 'Y') && $member_info->email_address)
152
+			if (($logged_info->is_admin == 'Y' || $email_config->isPublic == 'Y') && $member_info->email_address)
153 153
 			{
154 154
 				$url = 'mailto:'.htmlspecialchars($member_info->email_address, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
155
-				$oMemberController->addMemberPopupMenu($url,'cmd_send_email',$icon_path);
155
+				$oMemberController->addMemberPopupMenu($url, 'cmd_send_email', $icon_path);
156 156
 			}
157 157
 		}
158 158
 		// View homepage info
159
-		if($member_info->homepage)
159
+		if ($member_info->homepage)
160 160
 			$oMemberController->addMemberPopupMenu(htmlspecialchars($member_info->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false), 'homepage', '', 'blank');
161 161
 		// View blog info
162
-		if($member_info->blog)
162
+		if ($member_info->blog)
163 163
 			$oMemberController->addMemberPopupMenu(htmlspecialchars($member_info->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false), 'blog', '', 'blank');
164 164
 		// Call a trigger (after)
165 165
 		ModuleHandler::triggerCall('member.getMemberMenu', 'after', $null);
166 166
 		// Display a menu for editting member info to a top administrator
167
-		if($logged_info->is_admin == 'Y')
167
+		if ($logged_info->is_admin == 'Y')
168 168
 		{
169
-			$url = getUrl('','module','admin','act','dispMemberAdminInsert','member_srl',$member_srl);
170
-			$oMemberController->addMemberPopupMenu($url,'cmd_manage_member_info',$icon_path,'MemberModifyInfo');
169
+			$url = getUrl('', 'module', 'admin', 'act', 'dispMemberAdminInsert', 'member_srl', $member_srl);
170
+			$oMemberController->addMemberPopupMenu($url, 'cmd_manage_member_info', $icon_path, 'MemberModifyInfo');
171 171
 
172
-			$url = getUrl('','module','admin','act','dispDocumentAdminList','search_target','member_srl','search_keyword',$member_srl);
173
-			$oMemberController->addMemberPopupMenu($url,'cmd_trace_document',$icon_path,'TraceMemberDocument');
172
+			$url = getUrl('', 'module', 'admin', 'act', 'dispDocumentAdminList', 'search_target', 'member_srl', 'search_keyword', $member_srl);
173
+			$oMemberController->addMemberPopupMenu($url, 'cmd_trace_document', $icon_path, 'TraceMemberDocument');
174 174
 
175
-			$url = getUrl('','module','admin','act','dispCommentAdminList','search_target','member_srl','search_keyword',$member_srl);
176
-			$oMemberController->addMemberPopupMenu($url,'cmd_trace_comment',$icon_path,'TraceMemberComment');
175
+			$url = getUrl('', 'module', 'admin', 'act', 'dispCommentAdminList', 'search_target', 'member_srl', 'search_keyword', $member_srl);
176
+			$oMemberController->addMemberPopupMenu($url, 'cmd_trace_comment', $icon_path, 'TraceMemberComment');
177 177
 		}
178 178
 		// Change a language of pop-up menu
179 179
 		$menus = Context::get('member_popup_menu_list');
180 180
 		$menus_count = count($menus);
181
-		for($i=0;$i<$menus_count;$i++)
181
+		for ($i = 0; $i < $menus_count; $i++)
182 182
 		{
183 183
 			$menus[$i]->str = Context::getLang($menus[$i]->str);
184 184
 		}
@@ -190,16 +190,16 @@  discard block
 block discarded – undo
190 190
 	 * @brief Check if logged-in
191 191
 	 */
192 192
 	function isLogged() {
193
-		if($_SESSION['is_logged'])
193
+		if ($_SESSION['is_logged'])
194 194
 		{
195
-			if(Mobile::isFromMobilePhone())
195
+			if (Mobile::isFromMobilePhone())
196 196
 			{
197 197
 				return true;
198 198
 			}
199
-			elseif(filter_var($_SESSION['ipaddress'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6))
199
+			elseif (filter_var($_SESSION['ipaddress'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6))
200 200
 			{
201 201
 				// IPv6: require same /48
202
-				if(strncmp(inet_pton($_SESSION['ipaddress']), inet_pton($_SERVER['REMOTE_ADDR']), 6) == 0)
202
+				if (strncmp(inet_pton($_SESSION['ipaddress']), inet_pton($_SERVER['REMOTE_ADDR']), 6) == 0)
203 203
 				{
204 204
 					return true;
205 205
 				}
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 			else
208 208
 			{
209 209
 				// IPv4: require same /24
210
-				if(ip2long($_SESSION['ipaddress']) >> 8 == ip2long($_SERVER['REMOTE_ADDR']) >> 8)
210
+				if (ip2long($_SESSION['ipaddress']) >> 8 == ip2long($_SERVER['REMOTE_ADDR']) >> 8)
211 211
 				{
212 212
 					return true;
213 213
 				}
@@ -224,23 +224,23 @@  discard block
 block discarded – undo
224 224
 	function getLoggedInfo()
225 225
 	{
226 226
 		// Return session info if session info is requested and the user is logged-in
227
-		if($this->isLogged())
227
+		if ($this->isLogged())
228 228
 		{
229 229
 			$logged_info = Context::get('logged_info');
230 230
 			// Admin/Group list defined depending on site_module_info
231 231
 			$site_module_info = Context::get('site_module_info');
232
-			if($site_module_info->site_srl)
232
+			if ($site_module_info->site_srl)
233 233
 			{
234 234
 				$logged_info->group_list = $this->getMemberGroups($logged_info->member_srl, $site_module_info->site_srl);
235 235
 				// Add is_site_admin bool variable into logged_info if site_administrator is
236 236
 				$oModuleModel = getModel('module');
237
-				if($oModuleModel->isSiteAdmin($logged_info)) $logged_info->is_site_admin = true;
237
+				if ($oModuleModel->isSiteAdmin($logged_info)) $logged_info->is_site_admin = true;
238 238
 				else $logged_info->is_site_admin = false;
239 239
 			}
240 240
 			else
241 241
 			{
242 242
 				// Register a default group if the site doesn't have a member group
243
-				if(count($logged_info->group_list) === 0)
243
+				if (count($logged_info->group_list) === 0)
244 244
 				{
245 245
 					$default_group = $this->getDefaultGroup(0);
246 246
 					$oMemberController = getController('member');
@@ -263,13 +263,13 @@  discard block
 block discarded – undo
263 263
 	 */
264 264
 	function getMemberInfoByUserID($user_id, $columnList = array())
265 265
 	{
266
-		if(!$user_id) return;
266
+		if (!$user_id) return;
267 267
 
268 268
 		$args = new stdClass;
269 269
 		$args->user_id = $user_id;
270 270
 		$output = executeQuery('member.getMemberInfo', $args);
271
-		if(!$output->toBool()) return $output;
272
-		if(!$output->data) return;
271
+		if (!$output->toBool()) return $output;
272
+		if (!$output->data) return;
273 273
 
274 274
 		$member_info = $this->arrangeMemberInfo($output->data);
275 275
 
@@ -281,12 +281,12 @@  discard block
 block discarded – undo
281 281
 	 */
282 282
 	function getMemberInfoByEmailAddress($email_address)
283 283
 	{
284
-		if(!$email_address) return;
284
+		if (!$email_address) return;
285 285
 
286 286
 		$args = new stdClass();
287 287
 		
288
-		$db_info = Context::getDBInfo ();
289
-		if($db_info->master_db['db_type'] == "cubrid")
288
+		$db_info = Context::getDBInfo();
289
+		if ($db_info->master_db['db_type'] == "cubrid")
290 290
 		{
291 291
 			$args->email_address = strtolower($email_address);
292 292
 			$output = executeQuery('member.getMemberInfoByEmailAddressForCubrid', $args);
@@ -297,8 +297,8 @@  discard block
 block discarded – undo
297 297
 			$output = executeQuery('member.getMemberInfoByEmailAddress', $args);
298 298
 		}
299 299
 		
300
-		if(!$output->toBool()) return $output;
301
-		if(!$output->data) return;
300
+		if (!$output->toBool()) return $output;
301
+		if (!$output->data) return;
302 302
 
303 303
 		$member_info = $this->arrangeMemberInfo($output->data);
304 304
 		return $member_info;
@@ -309,36 +309,36 @@  discard block
 block discarded – undo
309 309
 	 */
310 310
 	function getMemberInfoByMemberSrl($member_srl, $site_srl = 0, $columnList = array())
311 311
 	{
312
-		if(!$member_srl) return;
312
+		if (!$member_srl) return;
313 313
 
314 314
 		//columnList size zero... get full member info
315
-		if(!$GLOBALS['__member_info__'][$member_srl] || count($columnList) == 0)
315
+		if (!$GLOBALS['__member_info__'][$member_srl] || count($columnList) == 0)
316 316
 		{
317 317
 			$GLOBALS['__member_info__'][$member_srl] = false;
318 318
 
319 319
 			$oCacheHandler = CacheHandler::getInstance('object');
320
-			if($oCacheHandler->isSupport())
320
+			if ($oCacheHandler->isSupport())
321 321
 			{
322 322
 				$columnList = array();
323
-				$object_key = 'member_info:' . getNumberingPath($member_srl) . $member_srl;
323
+				$object_key = 'member_info:'.getNumberingPath($member_srl).$member_srl;
324 324
 				$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
325 325
 				$GLOBALS['__member_info__'][$member_srl] = $oCacheHandler->get($cache_key);
326 326
 			}
327 327
 
328
-			if($GLOBALS['__member_info__'][$member_srl] === false)
328
+			if ($GLOBALS['__member_info__'][$member_srl] === false)
329 329
 			{
330 330
 				$args = new stdClass();
331 331
 				$args->member_srl = $member_srl;
332 332
 				$output = executeQuery('member.getMemberInfoByMemberSrl', $args, $columnList);
333
-				if(!$output->data) 
333
+				if (!$output->data) 
334 334
 				{
335
-					if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, new stdClass);
335
+					if ($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, new stdClass);
336 336
 					return;
337 337
 				}
338 338
 				$this->arrangeMemberInfo($output->data, $site_srl);
339 339
 
340 340
 				//insert in cache
341
-				if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $GLOBALS['__member_info__'][$member_srl]);
341
+				if ($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $GLOBALS['__member_info__'][$member_srl]);
342 342
 			}
343 343
 		}
344 344
 
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
 	 */
351 351
 	function arrangeMemberInfo($info, $site_srl = 0)
352 352
 	{
353
-		if(!$GLOBALS['__member_info__'][$info->member_srl])
353
+		if (!$GLOBALS['__member_info__'][$info->member_srl])
354 354
 		{
355 355
 			$oModuleModel = getModel('module');
356 356
 			$config = $oModuleModel->getModuleConfig('member');
@@ -359,25 +359,25 @@  discard block
 block discarded – undo
359 359
 			$info->profile_image = $this->getProfileImage($info->member_srl);
360 360
 			$info->image_name = $this->getImageName($info->member_srl);
361 361
 			$info->image_mark = $this->getImageMark($info->member_srl);
362
-			if($config->group_image_mark=='Y')
362
+			if ($config->group_image_mark == 'Y')
363 363
 			{
364
-				$info->group_mark = $this->getGroupImageMark($info->member_srl,$site_srl);
364
+				$info->group_mark = $this->getGroupImageMark($info->member_srl, $site_srl);
365 365
 			}
366 366
 			$info->signature = $this->getSignature($info->member_srl);
367 367
 			$info->group_list = $this->getMemberGroups($info->member_srl, $site_srl);
368 368
 
369 369
 			$extra_vars = unserialize($info->extra_vars);
370 370
 			unset($info->extra_vars);
371
-			if($extra_vars)
371
+			if ($extra_vars)
372 372
 			{
373
-				foreach($extra_vars as $key => $val)
373
+				foreach ($extra_vars as $key => $val)
374 374
 				{
375
-					if(!is_array($val) && strpos($val, '|@|') !== FALSE) $val = explode('|@|', $val);
376
-					if(!$info->{$key}) $info->{$key} = $val;
375
+					if (!is_array($val) && strpos($val, '|@|') !== FALSE) $val = explode('|@|', $val);
376
+					if (!$info->{$key}) $info->{$key} = $val;
377 377
 				}
378 378
 			}
379 379
 
380
-			if(strlen($info->find_account_answer) == 32 && preg_match('/[a-zA-Z0-9]+/', $info->find_account_answer))
380
+			if (strlen($info->find_account_answer) == 32 && preg_match('/[a-zA-Z0-9]+/', $info->find_account_answer))
381 381
 			{
382 382
 				$info->find_account_answer = null;
383 383
 			}
@@ -389,13 +389,13 @@  discard block
 block discarded – undo
389 389
 			$info->homepage = strip_tags($info->homepage);
390 390
 			$info->blog = strip_tags($info->blog);
391 391
 
392
-			if($extra_vars)
392
+			if ($extra_vars)
393 393
 			{
394
-				foreach($extra_vars as $key => $val)
394
+				foreach ($extra_vars as $key => $val)
395 395
 				{
396
-					if(is_array($val))
396
+					if (is_array($val))
397 397
 					{
398
-						$oSecurity->encodeHTML($key . '.');
398
+						$oSecurity->encodeHTML($key.'.');
399 399
 					}
400 400
 					else
401 401
 					{
@@ -406,12 +406,12 @@  discard block
 block discarded – undo
406 406
 
407 407
 			// Check format.
408 408
 			$oValidator = new Validator();
409
-			if(!$oValidator->applyRule('url', $info->homepage))
409
+			if (!$oValidator->applyRule('url', $info->homepage))
410 410
 			{
411 411
 				$info->homepage = '';
412 412
 			}
413 413
 
414
-			if(!$oValidator->applyRule('url', $info->blog))
414
+			if (!$oValidator->applyRule('url', $info->blog))
415 415
 			{
416 416
 				$info->blog = '';
417 417
 			}
@@ -460,7 +460,7 @@  discard block
 block discarded – undo
460 460
 	 */
461 461
 	function getLoggedMemberSrl()
462 462
 	{
463
-		if(!$this->isLogged()) return;
463
+		if (!$this->isLogged()) return;
464 464
 		return $_SESSION['member_srl'];
465 465
 	}
466 466
 
@@ -469,7 +469,7 @@  discard block
 block discarded – undo
469 469
 	 */
470 470
 	function getLoggedUserID()
471 471
 	{
472
-		if(!$this->isLogged()) return;
472
+		if (!$this->isLogged()) return;
473 473
 		$logged_info = Context::get('logged_info');
474 474
 		return $logged_info->user_id;
475 475
 	}
@@ -484,16 +484,16 @@  discard block
 block discarded – undo
484 484
 		// cache controll
485 485
 		$group_list = false;
486 486
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
487
-		if($oCacheHandler->isSupport())
487
+		if ($oCacheHandler->isSupport())
488 488
 		{
489
-			$object_key = 'member_groups:' . getNumberingPath($member_srl) . $member_srl . '_'.$site_srl;
489
+			$object_key = 'member_groups:'.getNumberingPath($member_srl).$member_srl.'_'.$site_srl;
490 490
 			$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
491 491
 			$group_list = $oCacheHandler->get($cache_key);
492 492
 		}
493 493
 
494
-		if(!$member_groups[$member_srl][$site_srl] || $force_reload)
494
+		if (!$member_groups[$member_srl][$site_srl] || $force_reload)
495 495
 		{
496
-			if($group_list === false)
496
+			if ($group_list === false)
497 497
 			{
498 498
 				$args = new stdClass();
499 499
 				$args->member_srl = $member_srl;
@@ -501,11 +501,11 @@  discard block
 block discarded – undo
501 501
 				$output = executeQueryArray('member.getMemberGroups', $args);
502 502
 				$group_list = $output->data;
503 503
 				//insert in cache
504
-				if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list);
504
+				if ($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list);
505 505
 			}
506
-			if(!$group_list) return array();
506
+			if (!$group_list) return array();
507 507
 
508
-			foreach($group_list as $group)
508
+			foreach ($group_list as $group)
509 509
 			{
510 510
 				$result[$group->group_srl] = $group->title;
511 511
 			}
@@ -519,14 +519,14 @@  discard block
 block discarded – undo
519 519
 	 */
520 520
 	function getMembersGroups($member_srls, $site_srl = 0)
521 521
 	{
522
-		$args->member_srls = implode(',',$member_srls);
522
+		$args->member_srls = implode(',', $member_srls);
523 523
 		$args->site_srl = $site_srl;
524 524
 		$args->sort_index = 'list_order';
525 525
 		$output = executeQueryArray('member.getMembersGroups', $args);
526
-		if(!$output->data) return array();
526
+		if (!$output->data) return array();
527 527
 
528 528
 		$result = array();
529
-		foreach($output->data as $key=>$val)
529
+		foreach ($output->data as $key=>$val)
530 530
 		{
531 531
 			$result[$val->member_srl][] = $val->title;
532 532
 		}
@@ -540,21 +540,21 @@  discard block
 block discarded – undo
540 540
 	{
541 541
 		$default_group = false;
542 542
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
543
-		if($oCacheHandler->isSupport())
543
+		if ($oCacheHandler->isSupport())
544 544
 		{
545 545
 			$columnList = array();
546
-			$object_key = 'default_group_' . $site_srl;
546
+			$object_key = 'default_group_'.$site_srl;
547 547
 			$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
548 548
 			$default_group = $oCacheHandler->get($cache_key);
549 549
 		}
550 550
 
551
-		if($default_group === false)
551
+		if ($default_group === false)
552 552
 		{
553 553
 			$args = new stdClass();
554 554
 			$args->site_srl = $site_srl;
555 555
 			$output = executeQuery('member.getDefaultGroup', $args, $columnList);
556 556
 			$default_group = $output->data;
557
-			if($oCacheHandler->isSupport())
557
+			if ($oCacheHandler->isSupport())
558 558
 			{
559 559
 				$oCacheHandler->put($cache_key, $default_group);
560 560
 			}
@@ -588,25 +588,25 @@  discard block
 block discarded – undo
588 588
 	 */
589 589
 	function getGroups($site_srl = 0)
590 590
 	{
591
-		if(!$GLOBALS['__group_info__'][$site_srl])
591
+		if (!$GLOBALS['__group_info__'][$site_srl])
592 592
 		{
593 593
 			$result = array();
594 594
 
595
-			if(!isset($site_srl))
595
+			if (!isset($site_srl))
596 596
 			{
597 597
 				$site_srl = 0;
598 598
 			}
599 599
 
600 600
 			$group_list = false;
601 601
 			$oCacheHandler = CacheHandler::getInstance('object', null, true);
602
-			if($oCacheHandler->isSupport())
602
+			if ($oCacheHandler->isSupport())
603 603
 			{
604 604
 				$object_key = 'member_groups:site_'.$site_srl;
605 605
 				$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
606 606
 				$group_list = $oCacheHandler->get($cache_key);
607 607
 			}
608 608
 
609
-			if($group_list === false)
609
+			if ($group_list === false)
610 610
 			{
611 611
 				$args = new stdClass();
612 612
 				$args->site_srl = $site_srl;
@@ -615,16 +615,16 @@  discard block
 block discarded – undo
615 615
 				$output = executeQueryArray('member.getGroups', $args);
616 616
 				$group_list = $output->data;
617 617
 				//insert in cache
618
-				if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list);
618
+				if ($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list);
619 619
 			}
620 620
 
621
-			if(!$group_list)
621
+			if (!$group_list)
622 622
 			{
623 623
 				return array();
624 624
 			}
625 625
 
626 626
 
627
-			foreach($group_list as $val)
627
+			foreach ($group_list as $val)
628 628
 			{
629 629
 				$result[$val->group_srl] = $val;
630 630
 			}
@@ -655,7 +655,7 @@  discard block
 block discarded – undo
655 655
 		// Set to ignore if a super administrator.
656 656
 		$logged_info = Context::get('logged_info');
657 657
 
658
-		if(!$this->join_form_list)
658
+		if (!$this->join_form_list)
659 659
 		{
660 660
 			// Argument setting to sort list_order column
661 661
 			$args = new stdClass();
@@ -663,11 +663,11 @@  discard block
 block discarded – undo
663 663
 			$output = executeQuery('member.getJoinFormList', $args);
664 664
 			// NULL if output data deosn't exist
665 665
 			$join_form_list = $output->data;
666
-			if(!$join_form_list) return NULL;
666
+			if (!$join_form_list) return NULL;
667 667
 			// Need to unserialize because serialized array is inserted into DB in case of default_value
668
-			if(!is_array($join_form_list)) $join_form_list = array($join_form_list);
668
+			if (!is_array($join_form_list)) $join_form_list = array($join_form_list);
669 669
 			$join_form_count = count($join_form_list);
670
-			for($i=0;$i<$join_form_count;$i++)
670
+			for ($i = 0; $i < $join_form_count; $i++)
671 671
 			{
672 672
 				$join_form_list[$i]->column_name = strtolower($join_form_list[$i]->column_name);
673 673
 
@@ -679,10 +679,10 @@  discard block
 block discarded – undo
679 679
 				// Add language variable
680 680
 				$lang->extend_vars[$column_name] = $column_title;
681 681
 				// unserialize if the data type if checkbox, select and so on
682
-				if(in_array($column_type, array('checkbox','select','radio')))
682
+				if (in_array($column_type, array('checkbox', 'select', 'radio')))
683 683
 				{
684 684
 					$join_form_list[$i]->default_value = unserialize($default_value);
685
-					if(!$join_form_list[$i]->default_value[0]) $join_form_list[$i]->default_value = '';
685
+					if (!$join_form_list[$i]->default_value[0]) $join_form_list[$i]->default_value = '';
686 686
 				}
687 687
 				else
688 688
 				{
@@ -694,16 +694,16 @@  discard block
 block discarded – undo
694 694
 			$this->join_form_list = $list;
695 695
 		}
696 696
 		// Get object style if the filter_response is true
697
-		if($filter_response && count($this->join_form_list))
697
+		if ($filter_response && count($this->join_form_list))
698 698
 		{
699
-			foreach($this->join_form_list as $key => $val)
699
+			foreach ($this->join_form_list as $key => $val)
700 700
 			{
701
-				if($val->is_active != 'Y') continue;
701
+				if ($val->is_active != 'Y') continue;
702 702
 				unset($obj);
703 703
 				$obj->type = $val->column_type;
704 704
 				$obj->name = $val->column_name;
705 705
 				$obj->lang = $val->column_title;
706
-				if($logged_info->is_admin != 'Y') $obj->required = $val->required=='Y'?true:false;
706
+				if ($logged_info->is_admin != 'Y') $obj->required = $val->required == 'Y' ? true : false;
707 707
 				else $obj->required = false;
708 708
 				$filter_output[] = $obj;
709 709
 
@@ -730,15 +730,15 @@  discard block
 block discarded – undo
730 730
 		$args->sort_index = "list_order";
731 731
 		$output = executeQueryArray('member.getJoinFormList', $args);
732 732
 
733
-		if(!$output->toBool())
733
+		if (!$output->toBool())
734 734
 		{
735 735
 			return array();
736 736
 		}
737 737
 
738 738
 		$joinFormList = array();
739
-		foreach($output->data as $val)
739
+		foreach ($output->data as $val)
740 740
 		{
741
-			if($val->is_active != 'Y')
741
+			if ($val->is_active != 'Y')
742 742
 			{
743 743
 				continue;
744 744
 			}
@@ -755,20 +755,20 @@  discard block
 block discarded – undo
755 755
 	function getCombineJoinForm($member_info)
756 756
 	{
757 757
 		$extend_form_list = $this->getJoinFormlist();
758
-		if(!$extend_form_list) return;
758
+		if (!$extend_form_list) return;
759 759
 		// Member info is open only to an administrator and him/herself when is_private is true.
760 760
 		$logged_info = Context::get('logged_info');
761 761
 
762
-		foreach($extend_form_list as $srl => $item)
762
+		foreach ($extend_form_list as $srl => $item)
763 763
 		{
764 764
 			$column_name = $item->column_name;
765 765
 			$value = $member_info->{$column_name};
766 766
 
767 767
 			// Change values depening on the type of extend form
768
-			switch($item->column_type)
768
+			switch ($item->column_type)
769 769
 			{
770 770
 				case 'checkbox' :
771
-					if($value && !is_array($value)) $value = array($value);
771
+					if ($value && !is_array($value)) $value = array($value);
772 772
 					break;
773 773
 				case 'text' :
774 774
 				case 'homepage' :
@@ -782,7 +782,7 @@  discard block
 block discarded – undo
782 782
 
783 783
 			$extend_form_list[$srl]->value = $value;
784 784
 
785
-			if($member_info->{'open_'.$column_name}=='Y') $extend_form_list[$srl]->is_opened = true;
785
+			if ($member_info->{'open_'.$column_name} == 'Y') $extend_form_list[$srl]->is_opened = true;
786 786
 			else $extend_form_list[$srl]->is_opened = false;
787 787
 		}
788 788
 		return $extend_form_list;
@@ -796,12 +796,12 @@  discard block
 block discarded – undo
796 796
 		$args->member_join_form_srl = $member_join_form_srl;
797 797
 		$output = executeQuery('member.getJoinForm', $args);
798 798
 		$join_form = $output->data;
799
-		if(!$join_form) return NULL;
799
+		if (!$join_form) return NULL;
800 800
 
801 801
 		$column_type = $join_form->column_type;
802 802
 		$default_value = $join_form->default_value;
803 803
 
804
-		if(in_array($column_type, array('checkbox','select','radio')))
804
+		if (in_array($column_type, array('checkbox', 'select', 'radio')))
805 805
 		{
806 806
 			$join_form->default_value = unserialize($default_value);
807 807
 		}
@@ -818,7 +818,7 @@  discard block
 block discarded – undo
818 818
 	 */
819 819
 	function getDeniedIDList()
820 820
 	{
821
-		if(!$this->denied_id_list)
821
+		if (!$this->denied_id_list)
822 822
 		{
823 823
 			$args->sort_index = "list_order";
824 824
 			$args->page = Context::get('page');
@@ -834,14 +834,14 @@  discard block
 block discarded – undo
834 834
 	function getDeniedIDs()
835 835
 	{
836 836
 		$output = executeQueryArray('member.getDeniedIDs');
837
-		if(!$output->toBool()) return array();
837
+		if (!$output->toBool()) return array();
838 838
 		return $output->data;
839 839
 	}
840 840
 
841 841
 	function getDeniedNickNames()
842 842
 	{
843 843
 		$output = executeQueryArray('member.getDeniedNickNames');
844
-		if(!$output->toBool())
844
+		if (!$output->toBool())
845 845
 		{
846 846
 			return array();
847 847
 		}
@@ -857,7 +857,7 @@  discard block
 block discarded – undo
857 857
 		$args = new stdClass();
858 858
 		$args->user_id = $user_id;
859 859
 		$output = executeQuery('member.chkDeniedID', $args);
860
-		if($output->data->count) return true;
860
+		if ($output->data->count) return true;
861 861
 		return false;
862 862
 	}
863 863
 
@@ -869,8 +869,8 @@  discard block
 block discarded – undo
869 869
 		$args = new stdClass();
870 870
 		$args->nick_name = $nickName;
871 871
 		$output = executeQuery('member.chkDeniedNickName', $args);
872
-		if($output->data->count) return true;
873
-		if(!$output->toBool())
872
+		if ($output->data->count) return true;
873
+		if (!$output->toBool())
874 874
 		{
875 875
 			return true;
876 876
 		}
@@ -881,20 +881,20 @@  discard block
 block discarded – undo
881 881
 	 */
882 882
 	function getProfileImage($member_srl)
883 883
 	{
884
-		if(!isset($GLOBALS['__member_info__']['profile_image'][$member_srl]))
884
+		if (!isset($GLOBALS['__member_info__']['profile_image'][$member_srl]))
885 885
 		{
886 886
 			$GLOBALS['__member_info__']['profile_image'][$member_srl] = null;
887
-			$exts = array('gif','jpg','png');
888
-			for($i=0;$i<3;$i++)
887
+			$exts = array('gif', 'jpg', 'png');
888
+			for ($i = 0; $i < 3; $i++)
889 889
 			{
890 890
 				$image_name_file = sprintf('files/member_extra_info/profile_image/%s%d.%s', getNumberingPath($member_srl), $member_srl, $exts[$i]);
891
-				if(file_exists($image_name_file))
891
+				if (file_exists($image_name_file))
892 892
 				{
893 893
 					list($width, $height, $type, $attrs) = getimagesize($image_name_file);
894 894
 					$info = new stdClass();
895 895
 					$info->width = $width;
896 896
 					$info->height = $height;
897
-					$info->src = Context::getRequestUri().$image_name_file . '?' . date('YmdHis', filemtime($image_name_file));
897
+					$info->src = Context::getRequestUri().$image_name_file.'?'.date('YmdHis', filemtime($image_name_file));
898 898
 					$info->file = './'.$image_name_file;
899 899
 					$GLOBALS['__member_info__']['profile_image'][$member_srl] = $info;
900 900
 					break;
@@ -910,16 +910,16 @@  discard block
 block discarded – undo
910 910
 	 */
911 911
 	function getImageName($member_srl)
912 912
 	{
913
-		if(!isset($GLOBALS['__member_info__']['image_name'][$member_srl]))
913
+		if (!isset($GLOBALS['__member_info__']['image_name'][$member_srl]))
914 914
 		{
915 915
 			$image_name_file = sprintf('files/member_extra_info/image_name/%s%d.gif', getNumberingPath($member_srl), $member_srl);
916
-			if(file_exists($image_name_file))
916
+			if (file_exists($image_name_file))
917 917
 			{
918 918
 				list($width, $height, $type, $attrs) = getimagesize($image_name_file);
919 919
 				$info = new stdClass;
920 920
 				$info->width = $width;
921 921
 				$info->height = $height;
922
-				$info->src = Context::getRequestUri().$image_name_file. '?' . date('YmdHis', filemtime($image_name_file));
922
+				$info->src = Context::getRequestUri().$image_name_file.'?'.date('YmdHis', filemtime($image_name_file));
923 923
 				$info->file = './'.$image_name_file;
924 924
 				$GLOBALS['__member_info__']['image_name'][$member_srl] = $info;
925 925
 			}
@@ -933,15 +933,15 @@  discard block
 block discarded – undo
933 933
 	 */
934 934
 	function getImageMark($member_srl)
935 935
 	{
936
-		if(!isset($GLOBALS['__member_info__']['image_mark'][$member_srl]))
936
+		if (!isset($GLOBALS['__member_info__']['image_mark'][$member_srl]))
937 937
 		{
938 938
 			$image_mark_file = sprintf('files/member_extra_info/image_mark/%s%d.gif', getNumberingPath($member_srl), $member_srl);
939
-			if(file_exists($image_mark_file))
939
+			if (file_exists($image_mark_file))
940 940
 			{
941 941
 				list($width, $height, $type, $attrs) = getimagesize($image_mark_file);
942 942
 				$info->width = $width;
943 943
 				$info->height = $height;
944
-				$info->src = Context::getRequestUri().$image_mark_file . '?' . date('YmdHis', filemtime($image_mark_file));
944
+				$info->src = Context::getRequestUri().$image_mark_file.'?'.date('YmdHis', filemtime($image_mark_file));
945 945
 				$info->file = './'.$image_mark_file;
946 946
 				$GLOBALS['__member_info__']['image_mark'][$member_srl] = $info;
947 947
 			}
@@ -955,27 +955,27 @@  discard block
 block discarded – undo
955 955
 	/**
956 956
 	 * @brief Get the image mark of the group
957 957
 	 */
958
-	function getGroupImageMark($member_srl,$site_srl=0)
958
+	function getGroupImageMark($member_srl, $site_srl = 0)
959 959
 	{
960
-		if(!isset($GLOBALS['__member_info__']['group_image_mark'][$member_srl]))
960
+		if (!isset($GLOBALS['__member_info__']['group_image_mark'][$member_srl]))
961 961
 		{
962 962
 			$oModuleModel = getModel('module');
963 963
 			$config = $oModuleModel->getModuleConfig('member');
964
-			if($config->group_image_mark!='Y')
964
+			if ($config->group_image_mark != 'Y')
965 965
 			{
966 966
 				return null;
967 967
 			}
968
-			$member_group = $this->getMemberGroups($member_srl,$site_srl);
968
+			$member_group = $this->getMemberGroups($member_srl, $site_srl);
969 969
 			$groups_info = $this->getGroups($site_srl);
970
-			if(count($member_group) > 0 && is_array($member_group))
970
+			if (count($member_group) > 0 && is_array($member_group))
971 971
 			{
972 972
 				$memberGroups = array_keys($member_group);
973 973
 
974
-				foreach($groups_info as $group_srl=>$group_info)
974
+				foreach ($groups_info as $group_srl=>$group_info)
975 975
 				{
976
-					if(in_array($group_srl, $memberGroups))
976
+					if (in_array($group_srl, $memberGroups))
977 977
 					{
978
-						if($group_info->image_mark)
978
+						if ($group_info->image_mark)
979 979
 						{
980 980
 							$info = new stdClass();
981 981
 							$info->title = $group_info->title;
@@ -999,10 +999,10 @@  discard block
 block discarded – undo
999 999
 	 */
1000 1000
 	function getSignature($member_srl)
1001 1001
 	{
1002
-		if(!isset($GLOBALS['__member_info__']['signature'][$member_srl]))
1002
+		if (!isset($GLOBALS['__member_info__']['signature'][$member_srl]))
1003 1003
 		{
1004 1004
 			$filename = sprintf('files/member_extra_info/signature/%s%d.signature.php', getNumberingPath($member_srl), $member_srl);
1005
-			if(file_exists($filename))
1005
+			if (file_exists($filename))
1006 1006
 			{
1007 1007
 				$buff = FileHandler::readFile($filename);
1008 1008
 				$signature = preg_replace('/<\?.*\?>/', '', $buff);
@@ -1020,10 +1020,10 @@  discard block
 block discarded – undo
1020 1020
 	 * @param int $member_srl Set this to member_srl when comparing a member's password (optional)
1021 1021
 	 * @return bool
1022 1022
 	 */
1023
-	function isValidPassword($hashed_password, $password_text, $member_srl=null)
1023
+	function isValidPassword($hashed_password, $password_text, $member_srl = null)
1024 1024
 	{
1025 1025
 		// False if no password in entered
1026
-		if(!$password_text)
1026
+		if (!$password_text)
1027 1027
 		{
1028 1028
 			return false;
1029 1029
 		}
@@ -1032,31 +1032,31 @@  discard block
 block discarded – undo
1032 1032
 		$oPassword = new Password();
1033 1033
 		$current_algorithm = $oPassword->checkAlgorithm($hashed_password);
1034 1034
 		$match = $oPassword->checkPassword($password_text, $hashed_password, $current_algorithm);
1035
-		if(!$match)
1035
+		if (!$match)
1036 1036
 		{
1037 1037
 			return false;
1038 1038
 		}
1039 1039
 		
1040 1040
 		// Update the encryption method if necessary
1041 1041
 		$config = $this->getMemberConfig();
1042
-		if($member_srl > 0 && $config->password_hashing_auto_upgrade != 'N')
1042
+		if ($member_srl > 0 && $config->password_hashing_auto_upgrade != 'N')
1043 1043
 		{
1044 1044
 			$need_upgrade = false;
1045 1045
 			
1046
-			if(!$need_upgrade)
1046
+			if (!$need_upgrade)
1047 1047
 			{
1048 1048
 				$required_algorithm = $oPassword->getCurrentlySelectedAlgorithm();
1049
-				if($required_algorithm !== $current_algorithm) $need_upgrade = true;
1049
+				if ($required_algorithm !== $current_algorithm) $need_upgrade = true;
1050 1050
 			}
1051 1051
 			
1052
-			if(!$need_upgrade)
1052
+			if (!$need_upgrade)
1053 1053
 			{
1054 1054
 				$required_work_factor = $oPassword->getWorkFactor();
1055 1055
 				$current_work_factor = $oPassword->checkWorkFactor($hashed_password);
1056
-				if($current_work_factor !== false && $required_work_factor > $current_work_factor) $need_upgrade = true;
1056
+				if ($current_work_factor !== false && $required_work_factor > $current_work_factor) $need_upgrade = true;
1057 1057
 			}
1058 1058
 			
1059
-			if($need_upgrade === true)
1059
+			if ($need_upgrade === true)
1060 1060
 			{
1061 1061
 				$args = new stdClass();
1062 1062
 				$args->member_srl = $member_srl;
@@ -1084,27 +1084,27 @@  discard block
 block discarded – undo
1084 1084
 	function checkPasswordStrength($password, $strength)
1085 1085
 	{
1086 1086
 		$logged_info = Context::get('logged_info');
1087
-		if($logged_info->is_admin == 'Y') return true;
1087
+		if ($logged_info->is_admin == 'Y') return true;
1088 1088
 		
1089
-		if($strength == NULL)
1089
+		if ($strength == NULL)
1090 1090
 		{
1091 1091
 			$config = $this->getMemberConfig();
1092
-			$strength = $config->password_strength?$config->password_strength:'normal';
1092
+			$strength = $config->password_strength ? $config->password_strength : 'normal';
1093 1093
 		}
1094 1094
 		
1095 1095
 		$length = strlen($password);
1096 1096
 		
1097 1097
 		switch ($strength) {
1098 1098
 			case 'high':
1099
-				if($length < 8 || !preg_match('/[^a-zA-Z0-9]/', $password)) return false;
1099
+				if ($length < 8 || !preg_match('/[^a-zA-Z0-9]/', $password)) return false;
1100 1100
 				/* no break */
1101 1101
 				
1102 1102
 			case 'normal':
1103
-				if($length < 6 || !preg_match('/[a-zA-Z]/', $password) || !preg_match('/[0-9]/', $password)) return false;
1103
+				if ($length < 6 || !preg_match('/[a-zA-Z]/', $password) || !preg_match('/[0-9]/', $password)) return false;
1104 1104
 				break;
1105 1105
 				
1106 1106
 			case 'low':
1107
-				if($length < 4) return false;
1107
+				if ($length < 4) return false;
1108 1108
 				break; 
1109 1109
 		}
1110 1110
 		
@@ -1115,11 +1115,11 @@  discard block
 block discarded – undo
1115 1115
 	{
1116 1116
 		$groupSrl = 0;
1117 1117
 		$output = $this->getGroups($site_srl);
1118
-		if(is_array($output))
1118
+		if (is_array($output))
1119 1119
 		{
1120
-			foreach($output AS $key=>$value)
1120
+			foreach ($output AS $key=>$value)
1121 1121
 			{
1122
-				if($value->is_admin == 'Y')
1122
+				if ($value->is_admin == 'Y')
1123 1123
 				{
1124 1124
 					$groupSrl = $value->group_srl;
1125 1125
 					break;
Please login to merge, or discard this patch.
Braces   +202 added lines, -83 removed lines patch added patch discarded remove patch
@@ -45,32 +45,68 @@  discard block
 block discarded – undo
45 45
 		foreach($config->signupForm AS $key=>$value)
46 46
 		{
47 47
 			$config->signupForm[$key]->title = ($value->isDefaultForm) ? Context::getLang($value->name) : $value->title;
48
-			if($config->signupForm[$key]->isPublic != 'N') $config->signupForm[$key]->isPublic = 'Y';
49
-			if($value->name == 'find_account_question') $config->signupForm[$key]->isPublic = 'N';
48
+			if($config->signupForm[$key]->isPublic != 'N') {
49
+				$config->signupForm[$key]->isPublic = 'Y';
50
+			}
51
+			if($value->name == 'find_account_question') {
52
+				$config->signupForm[$key]->isPublic = 'N';
53
+			}
50 54
 		}
51 55
 
52 56
 		// Get terms of user
53 57
 		$config->agreement = memberModel::_getAgreement();
54 58
 
55
-		if(!$config->webmaster_name) $config->webmaster_name = 'webmaster';
56
-		if(!$config->image_name_max_width) $config->image_name_max_width = 90;
57
-		if(!$config->image_name_max_height) $config->image_name_max_height = 20;
58
-		if(!$config->image_mark_max_width) $config->image_mark_max_width = 20;
59
-		if(!$config->image_mark_max_height) $config->image_mark_max_height = 20;
60
-		if(!$config->profile_image_max_width) $config->profile_image_max_width = 90;
61
-		if(!$config->profile_image_max_height) $config->profile_image_max_height = 90;
62
-		if(!$config->skin) $config->skin = 'default';
63
-		if(!$config->colorset) $config->colorset = 'white';
64
-		if(!$config->editor_skin || $config->editor_skin == 'default') $config->editor_skin = 'ckeditor';
65
-		if(!$config->group_image_mark) $config->group_image_mark = "N";
59
+		if(!$config->webmaster_name) {
60
+			$config->webmaster_name = 'webmaster';
61
+		}
62
+		if(!$config->image_name_max_width) {
63
+			$config->image_name_max_width = 90;
64
+		}
65
+		if(!$config->image_name_max_height) {
66
+			$config->image_name_max_height = 20;
67
+		}
68
+		if(!$config->image_mark_max_width) {
69
+			$config->image_mark_max_width = 20;
70
+		}
71
+		if(!$config->image_mark_max_height) {
72
+			$config->image_mark_max_height = 20;
73
+		}
74
+		if(!$config->profile_image_max_width) {
75
+			$config->profile_image_max_width = 90;
76
+		}
77
+		if(!$config->profile_image_max_height) {
78
+			$config->profile_image_max_height = 90;
79
+		}
80
+		if(!$config->skin) {
81
+			$config->skin = 'default';
82
+		}
83
+		if(!$config->colorset) {
84
+			$config->colorset = 'white';
85
+		}
86
+		if(!$config->editor_skin || $config->editor_skin == 'default') {
87
+			$config->editor_skin = 'ckeditor';
88
+		}
89
+		if(!$config->group_image_mark) {
90
+			$config->group_image_mark = "N";
91
+		}
66 92
 
67
-		if(!$config->identifier) $config->identifier = 'user_id';
93
+		if(!$config->identifier) {
94
+			$config->identifier = 'user_id';
95
+		}
68 96
 
69
-		if(!$config->max_error_count) $config->max_error_count = 10;
70
-		if(!$config->max_error_count_time) $config->max_error_count_time = 300;
97
+		if(!$config->max_error_count) {
98
+			$config->max_error_count = 10;
99
+		}
100
+		if(!$config->max_error_count_time) {
101
+			$config->max_error_count_time = 300;
102
+		}
71 103
 
72
-		if(!$config->signature_editor_skin || $config->signature_editor_skin == 'default') $config->signature_editor_skin = 'ckeditor';
73
-		if(!$config->sel_editor_colorset) $config->sel_editor_colorset = 'moono';
104
+		if(!$config->signature_editor_skin || $config->signature_editor_skin == 'default') {
105
+			$config->signature_editor_skin = 'ckeditor';
106
+		}
107
+		if(!$config->sel_editor_colorset) {
108
+			$config->sel_editor_colorset = 'moono';
109
+		}
74 110
 
75 111
 		$member_config = $config;
76 112
 
@@ -116,12 +152,18 @@  discard block
 block discarded – undo
116 152
 		$logged_info = Context::get('logged_info');
117 153
 		$act = Context::get('cur_act');
118 154
 		// When click user's own nickname
119
-		if($member_srl == $logged_info->member_srl) $member_info = $logged_info;
155
+		if($member_srl == $logged_info->member_srl) {
156
+			$member_info = $logged_info;
157
+		}
120 158
 		// When click other's nickname
121
-		else $member_info = $this->getMemberInfoByMemberSrl($member_srl);
159
+		else {
160
+			$member_info = $this->getMemberInfoByMemberSrl($member_srl);
161
+		}
122 162
 
123 163
 		$member_srl = $member_info->member_srl;
124
-		if(!$member_srl) return;
164
+		if(!$member_srl) {
165
+			return;
166
+		}
125 167
 		// List variables
126 168
 		$user_id = $member_info->user_id;
127 169
 		$user_name = $member_info->user_name;
@@ -156,11 +198,13 @@  discard block
 block discarded – undo
156 198
 			}
157 199
 		}
158 200
 		// View homepage info
159
-		if($member_info->homepage)
160
-			$oMemberController->addMemberPopupMenu(htmlspecialchars($member_info->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false), 'homepage', '', 'blank');
201
+		if($member_info->homepage) {
202
+					$oMemberController->addMemberPopupMenu(htmlspecialchars($member_info->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false), 'homepage', '', 'blank');
203
+		}
161 204
 		// View blog info
162
-		if($member_info->blog)
163
-			$oMemberController->addMemberPopupMenu(htmlspecialchars($member_info->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false), 'blog', '', 'blank');
205
+		if($member_info->blog) {
206
+					$oMemberController->addMemberPopupMenu(htmlspecialchars($member_info->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false), 'blog', '', 'blank');
207
+		}
164 208
 		// Call a trigger (after)
165 209
 		ModuleHandler::triggerCall('member.getMemberMenu', 'after', $null);
166 210
 		// Display a menu for editting member info to a top administrator
@@ -195,16 +239,14 @@  discard block
 block discarded – undo
195 239
 			if(Mobile::isFromMobilePhone())
196 240
 			{
197 241
 				return true;
198
-			}
199
-			elseif(filter_var($_SESSION['ipaddress'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6))
242
+			} elseif(filter_var($_SESSION['ipaddress'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6))
200 243
 			{
201 244
 				// IPv6: require same /48
202 245
 				if(strncmp(inet_pton($_SESSION['ipaddress']), inet_pton($_SERVER['REMOTE_ADDR']), 6) == 0)
203 246
 				{
204 247
 					return true;
205 248
 				}
206
-			}
207
-			else
249
+			} else
208 250
 			{
209 251
 				// IPv4: require same /24
210 252
 				if(ip2long($_SESSION['ipaddress']) >> 8 == ip2long($_SERVER['REMOTE_ADDR']) >> 8)
@@ -234,10 +276,12 @@  discard block
 block discarded – undo
234 276
 				$logged_info->group_list = $this->getMemberGroups($logged_info->member_srl, $site_module_info->site_srl);
235 277
 				// Add is_site_admin bool variable into logged_info if site_administrator is
236 278
 				$oModuleModel = getModel('module');
237
-				if($oModuleModel->isSiteAdmin($logged_info)) $logged_info->is_site_admin = true;
238
-				else $logged_info->is_site_admin = false;
239
-			}
240
-			else
279
+				if($oModuleModel->isSiteAdmin($logged_info)) {
280
+					$logged_info->is_site_admin = true;
281
+				} else {
282
+					$logged_info->is_site_admin = false;
283
+				}
284
+			} else
241 285
 			{
242 286
 				// Register a default group if the site doesn't have a member group
243 287
 				if(count($logged_info->group_list) === 0)
@@ -263,13 +307,19 @@  discard block
 block discarded – undo
263 307
 	 */
264 308
 	function getMemberInfoByUserID($user_id, $columnList = array())
265 309
 	{
266
-		if(!$user_id) return;
310
+		if(!$user_id) {
311
+			return;
312
+		}
267 313
 
268 314
 		$args = new stdClass;
269 315
 		$args->user_id = $user_id;
270 316
 		$output = executeQuery('member.getMemberInfo', $args);
271
-		if(!$output->toBool()) return $output;
272
-		if(!$output->data) return;
317
+		if(!$output->toBool()) {
318
+			return $output;
319
+		}
320
+		if(!$output->data) {
321
+			return;
322
+		}
273 323
 
274 324
 		$member_info = $this->arrangeMemberInfo($output->data);
275 325
 
@@ -281,7 +331,9 @@  discard block
 block discarded – undo
281 331
 	 */
282 332
 	function getMemberInfoByEmailAddress($email_address)
283 333
 	{
284
-		if(!$email_address) return;
334
+		if(!$email_address) {
335
+			return;
336
+		}
285 337
 
286 338
 		$args = new stdClass();
287 339
 		
@@ -290,15 +342,18 @@  discard block
 block discarded – undo
290 342
 		{
291 343
 			$args->email_address = strtolower($email_address);
292 344
 			$output = executeQuery('member.getMemberInfoByEmailAddressForCubrid', $args);
293
-		}
294
-		else
345
+		} else
295 346
 		{
296 347
 			$args->email_address = $email_address;
297 348
 			$output = executeQuery('member.getMemberInfoByEmailAddress', $args);
298 349
 		}
299 350
 		
300
-		if(!$output->toBool()) return $output;
301
-		if(!$output->data) return;
351
+		if(!$output->toBool()) {
352
+			return $output;
353
+		}
354
+		if(!$output->data) {
355
+			return;
356
+		}
302 357
 
303 358
 		$member_info = $this->arrangeMemberInfo($output->data);
304 359
 		return $member_info;
@@ -309,7 +364,9 @@  discard block
 block discarded – undo
309 364
 	 */
310 365
 	function getMemberInfoByMemberSrl($member_srl, $site_srl = 0, $columnList = array())
311 366
 	{
312
-		if(!$member_srl) return;
367
+		if(!$member_srl) {
368
+			return;
369
+		}
313 370
 
314 371
 		//columnList size zero... get full member info
315 372
 		if(!$GLOBALS['__member_info__'][$member_srl] || count($columnList) == 0)
@@ -332,13 +389,17 @@  discard block
 block discarded – undo
332 389
 				$output = executeQuery('member.getMemberInfoByMemberSrl', $args, $columnList);
333 390
 				if(!$output->data) 
334 391
 				{
335
-					if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, new stdClass);
392
+					if($oCacheHandler->isSupport()) {
393
+						$oCacheHandler->put($cache_key, new stdClass);
394
+					}
336 395
 					return;
337 396
 				}
338 397
 				$this->arrangeMemberInfo($output->data, $site_srl);
339 398
 
340 399
 				//insert in cache
341
-				if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $GLOBALS['__member_info__'][$member_srl]);
400
+				if($oCacheHandler->isSupport()) {
401
+					$oCacheHandler->put($cache_key, $GLOBALS['__member_info__'][$member_srl]);
402
+				}
342 403
 			}
343 404
 		}
344 405
 
@@ -372,8 +433,12 @@  discard block
 block discarded – undo
372 433
 			{
373 434
 				foreach($extra_vars as $key => $val)
374 435
 				{
375
-					if(!is_array($val) && strpos($val, '|@|') !== FALSE) $val = explode('|@|', $val);
376
-					if(!$info->{$key}) $info->{$key} = $val;
436
+					if(!is_array($val) && strpos($val, '|@|') !== FALSE) {
437
+						$val = explode('|@|', $val);
438
+					}
439
+					if(!$info->{$key}) {
440
+						$info->{$key} = $val;
441
+					}
377 442
 				}
378 443
 			}
379 444
 
@@ -396,8 +461,7 @@  discard block
 block discarded – undo
396 461
 					if(is_array($val))
397 462
 					{
398 463
 						$oSecurity->encodeHTML($key . '.');
399
-					}
400
-					else
464
+					} else
401 465
 					{
402 466
 						$oSecurity->encodeHTML($key);
403 467
 					}
@@ -460,7 +524,9 @@  discard block
 block discarded – undo
460 524
 	 */
461 525
 	function getLoggedMemberSrl()
462 526
 	{
463
-		if(!$this->isLogged()) return;
527
+		if(!$this->isLogged()) {
528
+			return;
529
+		}
464 530
 		return $_SESSION['member_srl'];
465 531
 	}
466 532
 
@@ -469,7 +535,9 @@  discard block
 block discarded – undo
469 535
 	 */
470 536
 	function getLoggedUserID()
471 537
 	{
472
-		if(!$this->isLogged()) return;
538
+		if(!$this->isLogged()) {
539
+			return;
540
+		}
473 541
 		$logged_info = Context::get('logged_info');
474 542
 		return $logged_info->user_id;
475 543
 	}
@@ -501,9 +569,13 @@  discard block
 block discarded – undo
501 569
 				$output = executeQueryArray('member.getMemberGroups', $args);
502 570
 				$group_list = $output->data;
503 571
 				//insert in cache
504
-				if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list);
572
+				if($oCacheHandler->isSupport()) {
573
+					$oCacheHandler->put($cache_key, $group_list);
574
+				}
575
+			}
576
+			if(!$group_list) {
577
+				return array();
505 578
 			}
506
-			if(!$group_list) return array();
507 579
 
508 580
 			foreach($group_list as $group)
509 581
 			{
@@ -523,7 +595,9 @@  discard block
 block discarded – undo
523 595
 		$args->site_srl = $site_srl;
524 596
 		$args->sort_index = 'list_order';
525 597
 		$output = executeQueryArray('member.getMembersGroups', $args);
526
-		if(!$output->data) return array();
598
+		if(!$output->data) {
599
+			return array();
600
+		}
527 601
 
528 602
 		$result = array();
529 603
 		foreach($output->data as $key=>$val)
@@ -615,7 +689,9 @@  discard block
 block discarded – undo
615 689
 				$output = executeQueryArray('member.getGroups', $args);
616 690
 				$group_list = $output->data;
617 691
 				//insert in cache
618
-				if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list);
692
+				if($oCacheHandler->isSupport()) {
693
+					$oCacheHandler->put($cache_key, $group_list);
694
+				}
619 695
 			}
620 696
 
621 697
 			if(!$group_list)
@@ -663,9 +739,13 @@  discard block
 block discarded – undo
663 739
 			$output = executeQuery('member.getJoinFormList', $args);
664 740
 			// NULL if output data deosn't exist
665 741
 			$join_form_list = $output->data;
666
-			if(!$join_form_list) return NULL;
742
+			if(!$join_form_list) {
743
+				return NULL;
744
+			}
667 745
 			// Need to unserialize because serialized array is inserted into DB in case of default_value
668
-			if(!is_array($join_form_list)) $join_form_list = array($join_form_list);
746
+			if(!is_array($join_form_list)) {
747
+				$join_form_list = array($join_form_list);
748
+			}
669 749
 			$join_form_count = count($join_form_list);
670 750
 			for($i=0;$i<$join_form_count;$i++)
671 751
 			{
@@ -682,9 +762,10 @@  discard block
 block discarded – undo
682 762
 				if(in_array($column_type, array('checkbox','select','radio')))
683 763
 				{
684 764
 					$join_form_list[$i]->default_value = unserialize($default_value);
685
-					if(!$join_form_list[$i]->default_value[0]) $join_form_list[$i]->default_value = '';
686
-				}
687
-				else
765
+					if(!$join_form_list[$i]->default_value[0]) {
766
+						$join_form_list[$i]->default_value = '';
767
+					}
768
+				} else
688 769
 				{
689 770
 					$join_form_list[$i]->default_value = '';
690 771
 				}
@@ -698,13 +779,18 @@  discard block
 block discarded – undo
698 779
 		{
699 780
 			foreach($this->join_form_list as $key => $val)
700 781
 			{
701
-				if($val->is_active != 'Y') continue;
782
+				if($val->is_active != 'Y') {
783
+					continue;
784
+				}
702 785
 				unset($obj);
703 786
 				$obj->type = $val->column_type;
704 787
 				$obj->name = $val->column_name;
705 788
 				$obj->lang = $val->column_title;
706
-				if($logged_info->is_admin != 'Y') $obj->required = $val->required=='Y'?true:false;
707
-				else $obj->required = false;
789
+				if($logged_info->is_admin != 'Y') {
790
+					$obj->required = $val->required=='Y'?true:false;
791
+				} else {
792
+					$obj->required = false;
793
+				}
708 794
 				$filter_output[] = $obj;
709 795
 
710 796
 				unset($open_obj);
@@ -755,7 +841,9 @@  discard block
 block discarded – undo
755 841
 	function getCombineJoinForm($member_info)
756 842
 	{
757 843
 		$extend_form_list = $this->getJoinFormlist();
758
-		if(!$extend_form_list) return;
844
+		if(!$extend_form_list) {
845
+			return;
846
+		}
759 847
 		// Member info is open only to an administrator and him/herself when is_private is true.
760 848
 		$logged_info = Context::get('logged_info');
761 849
 
@@ -768,7 +856,9 @@  discard block
 block discarded – undo
768 856
 			switch($item->column_type)
769 857
 			{
770 858
 				case 'checkbox' :
771
-					if($value && !is_array($value)) $value = array($value);
859
+					if($value && !is_array($value)) {
860
+						$value = array($value);
861
+					}
772 862
 					break;
773 863
 				case 'text' :
774 864
 				case 'homepage' :
@@ -782,8 +872,11 @@  discard block
 block discarded – undo
782 872
 
783 873
 			$extend_form_list[$srl]->value = $value;
784 874
 
785
-			if($member_info->{'open_'.$column_name}=='Y') $extend_form_list[$srl]->is_opened = true;
786
-			else $extend_form_list[$srl]->is_opened = false;
875
+			if($member_info->{'open_'.$column_name}=='Y') {
876
+				$extend_form_list[$srl]->is_opened = true;
877
+			} else {
878
+				$extend_form_list[$srl]->is_opened = false;
879
+			}
787 880
 		}
788 881
 		return $extend_form_list;
789 882
 	}
@@ -796,7 +889,9 @@  discard block
 block discarded – undo
796 889
 		$args->member_join_form_srl = $member_join_form_srl;
797 890
 		$output = executeQuery('member.getJoinForm', $args);
798 891
 		$join_form = $output->data;
799
-		if(!$join_form) return NULL;
892
+		if(!$join_form) {
893
+			return NULL;
894
+		}
800 895
 
801 896
 		$column_type = $join_form->column_type;
802 897
 		$default_value = $join_form->default_value;
@@ -804,8 +899,7 @@  discard block
 block discarded – undo
804 899
 		if(in_array($column_type, array('checkbox','select','radio')))
805 900
 		{
806 901
 			$join_form->default_value = unserialize($default_value);
807
-		}
808
-		else
902
+		} else
809 903
 		{
810 904
 			$join_form->default_value = '';
811 905
 		}
@@ -834,7 +928,9 @@  discard block
 block discarded – undo
834 928
 	function getDeniedIDs()
835 929
 	{
836 930
 		$output = executeQueryArray('member.getDeniedIDs');
837
-		if(!$output->toBool()) return array();
931
+		if(!$output->toBool()) {
932
+			return array();
933
+		}
838 934
 		return $output->data;
839 935
 	}
840 936
 
@@ -857,7 +953,9 @@  discard block
 block discarded – undo
857 953
 		$args = new stdClass();
858 954
 		$args->user_id = $user_id;
859 955
 		$output = executeQuery('member.chkDeniedID', $args);
860
-		if($output->data->count) return true;
956
+		if($output->data->count) {
957
+			return true;
958
+		}
861 959
 		return false;
862 960
 	}
863 961
 
@@ -869,7 +967,9 @@  discard block
 block discarded – undo
869 967
 		$args = new stdClass();
870 968
 		$args->nick_name = $nickName;
871 969
 		$output = executeQuery('member.chkDeniedNickName', $args);
872
-		if($output->data->count) return true;
970
+		if($output->data->count) {
971
+			return true;
972
+		}
873 973
 		if(!$output->toBool())
874 974
 		{
875 975
 			return true;
@@ -922,8 +1022,9 @@  discard block
 block discarded – undo
922 1022
 				$info->src = Context::getRequestUri().$image_name_file. '?' . date('YmdHis', filemtime($image_name_file));
923 1023
 				$info->file = './'.$image_name_file;
924 1024
 				$GLOBALS['__member_info__']['image_name'][$member_srl] = $info;
1025
+			} else {
1026
+				$GLOBALS['__member_info__']['image_name'][$member_srl] = null;
925 1027
 			}
926
-			else $GLOBALS['__member_info__']['image_name'][$member_srl] = null;
927 1028
 		}
928 1029
 		return $GLOBALS['__member_info__']['image_name'][$member_srl];
929 1030
 	}
@@ -944,8 +1045,9 @@  discard block
 block discarded – undo
944 1045
 				$info->src = Context::getRequestUri().$image_mark_file . '?' . date('YmdHis', filemtime($image_mark_file));
945 1046
 				$info->file = './'.$image_mark_file;
946 1047
 				$GLOBALS['__member_info__']['image_mark'][$member_srl] = $info;
1048
+			} else {
1049
+				$GLOBALS['__member_info__']['image_mark'][$member_srl] = null;
947 1050
 			}
948
-			else $GLOBALS['__member_info__']['image_mark'][$member_srl] = null;
949 1051
 		}
950 1052
 
951 1053
 		return $GLOBALS['__member_info__']['image_mark'][$member_srl];
@@ -987,9 +1089,13 @@  discard block
 block discarded – undo
987 1089
 					}
988 1090
 				}
989 1091
 			}
990
-			if (!$info) $GLOBALS['__member_info__']['group_image_mark'][$member_srl] == 'N';
1092
+			if (!$info) {
1093
+				$GLOBALS['__member_info__']['group_image_mark'][$member_srl] == 'N';
1094
+			}
1095
+		}
1096
+		if ($GLOBALS['__member_info__']['group_image_mark'][$member_srl] == 'N') {
1097
+			return null;
991 1098
 		}
992
-		if ($GLOBALS['__member_info__']['group_image_mark'][$member_srl] == 'N') return null;
993 1099
 
994 1100
 		return $GLOBALS['__member_info__']['group_image_mark'][$member_srl];
995 1101
 	}
@@ -1007,8 +1113,9 @@  discard block
 block discarded – undo
1007 1113
 				$buff = FileHandler::readFile($filename);
1008 1114
 				$signature = preg_replace('/<\?.*\?>/', '', $buff);
1009 1115
 				$GLOBALS['__member_info__']['signature'][$member_srl] = $signature;
1116
+			} else {
1117
+				$GLOBALS['__member_info__']['signature'][$member_srl] = null;
1010 1118
 			}
1011
-			else $GLOBALS['__member_info__']['signature'][$member_srl] = null;
1012 1119
 		}
1013 1120
 		return $GLOBALS['__member_info__']['signature'][$member_srl];
1014 1121
 	}
@@ -1046,14 +1153,18 @@  discard block
 block discarded – undo
1046 1153
 			if(!$need_upgrade)
1047 1154
 			{
1048 1155
 				$required_algorithm = $oPassword->getCurrentlySelectedAlgorithm();
1049
-				if($required_algorithm !== $current_algorithm) $need_upgrade = true;
1156
+				if($required_algorithm !== $current_algorithm) {
1157
+					$need_upgrade = true;
1158
+				}
1050 1159
 			}
1051 1160
 			
1052 1161
 			if(!$need_upgrade)
1053 1162
 			{
1054 1163
 				$required_work_factor = $oPassword->getWorkFactor();
1055 1164
 				$current_work_factor = $oPassword->checkWorkFactor($hashed_password);
1056
-				if($current_work_factor !== false && $required_work_factor > $current_work_factor) $need_upgrade = true;
1165
+				if($current_work_factor !== false && $required_work_factor > $current_work_factor) {
1166
+					$need_upgrade = true;
1167
+				}
1057 1168
 			}
1058 1169
 			
1059 1170
 			if($need_upgrade === true)
@@ -1084,7 +1195,9 @@  discard block
 block discarded – undo
1084 1195
 	function checkPasswordStrength($password, $strength)
1085 1196
 	{
1086 1197
 		$logged_info = Context::get('logged_info');
1087
-		if($logged_info->is_admin == 'Y') return true;
1198
+		if($logged_info->is_admin == 'Y') {
1199
+			return true;
1200
+		}
1088 1201
 		
1089 1202
 		if($strength == NULL)
1090 1203
 		{
@@ -1096,15 +1209,21 @@  discard block
 block discarded – undo
1096 1209
 		
1097 1210
 		switch ($strength) {
1098 1211
 			case 'high':
1099
-				if($length < 8 || !preg_match('/[^a-zA-Z0-9]/', $password)) return false;
1212
+				if($length < 8 || !preg_match('/[^a-zA-Z0-9]/', $password)) {
1213
+					return false;
1214
+				}
1100 1215
 				/* no break */
1101 1216
 				
1102 1217
 			case 'normal':
1103
-				if($length < 6 || !preg_match('/[a-zA-Z]/', $password) || !preg_match('/[0-9]/', $password)) return false;
1218
+				if($length < 6 || !preg_match('/[a-zA-Z]/', $password) || !preg_match('/[0-9]/', $password)) {
1219
+					return false;
1220
+				}
1104 1221
 				break;
1105 1222
 				
1106 1223
 			case 'low':
1107
-				if($length < 4) return false;
1224
+				if($length < 4) {
1225
+					return false;
1226
+				}
1108 1227
 				break; 
1109 1228
 		}
1110 1229
 		
Please login to merge, or discard this patch.
modules/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.
Braces   +296 added lines, -128 removed lines patch added patch discarded remove patch
@@ -69,7 +69,9 @@  discard block
 block discarded – undo
69 69
 		$site_module_info = Context::get('site_module_info');
70 70
 
71 71
 		$output = $this->addMenu(Context::get('title'), (int)$site_module_info->site_srl);
72
-		if(!$output->toBool()) return $output;
72
+		if(!$output->toBool()) {
73
+			return $output;
74
+		}
73 75
 
74 76
 		$this->add('menu_srl', $output->get('menuSrl'));
75 77
 		$this->setMessage('success_registed');
@@ -148,8 +150,7 @@  discard block
 block discarded – undo
148 150
 				$moduleConfig->unlinked_menu_srl = $output->get('menuSrl');
149 151
 				$oModuleController = getController('module');
150 152
 				$oModuleController->updateModuleConfig('menu', $moduleConfig);
151
-			}
152
-			else
153
+			} else
153 154
 			{
154 155
 				return false;
155 156
 			}
@@ -186,8 +187,7 @@  discard block
 block discarded – undo
186 187
 			if($output->toBool() && $output->data)
187 188
 			{
188 189
 				$moduleInfo->menu_srl = $output->data->menu_srl;
189
-			}
190
-			else
190
+			} else
191 191
 			{
192 192
 				// create menu item.
193 193
 				$item_args->menu_srl = $menuSrl;
@@ -235,7 +235,9 @@  discard block
 block discarded – undo
235 235
 		$args->menu_srl = Context::get('menu_srl');
236 236
 
237 237
 		$output = executeQuery('menu.updateMenu', $args);
238
-		if(!$output->toBool()) return $output;
238
+		if(!$output->toBool()) {
239
+			return $output;
240
+		}
239 241
 
240 242
 		$this->setMessage('success_registed');
241 243
 
@@ -255,8 +257,9 @@  discard block
 block discarded – undo
255 257
 		$menuInfo = $oMenuAdminModel->getMenu($menu_srl);
256 258
 
257 259
 		$oAdmin = getClass('admin');
258
-		if($menuInfo->title == $oAdmin->getAdminMenuName())
259
-			return new Object(-1, 'msg_adminmenu_cannot_delete');
260
+		if($menuInfo->title == $oAdmin->getAdminMenuName()) {
261
+					return new Object(-1, 'msg_adminmenu_cannot_delete');
262
+		}
260 263
 
261 264
 		// get menu properies with child menu
262 265
 		$phpFile = sprintf("./files/cache/menu/%s.php", $menu_srl);
@@ -280,8 +283,9 @@  discard block
 block discarded – undo
280 283
 				$originMenu = $value;
281 284
 				$this->_checkHomeMenuInOriginMenu($originMenu, $siteInfo->mid, $isStartmenuInclude);
282 285
 
283
-				if($isStartmenuInclude)
284
-					break;
286
+				if($isStartmenuInclude) {
287
+									break;
288
+				}
285 289
 			}
286 290
 		}
287 291
 
@@ -366,7 +370,9 @@  discard block
 block discarded – undo
366 370
 			foreach($cache_list as $cache_file)
367 371
 			{
368 372
 				$pos = strpos($cache_file, $menu_srl.'.');
369
-				if($pos>0)FileHandler::removeFile($cache_file);
373
+				if($pos>0) {
374
+					FileHandler::removeFile($cache_file);
375
+				}
370 376
 			}
371 377
 		}
372 378
 		// Delete images of menu buttons
@@ -405,8 +411,7 @@  discard block
 block discarded – undo
405 411
 		if($request->is_shortcut == 'Y')
406 412
 		{
407 413
 			$result = $this->_insertShortcut($request);
408
-		}
409
-		else
414
+		} else
410 415
 		{
411 416
 			$result = $this->_insertMenu($request, $isProc);
412 417
 		}
@@ -465,12 +470,21 @@  discard block
 block discarded – undo
465 470
 			$args->is_shortcut = $request->is_shortcut;
466 471
 			$args->url = $request->shortcut_target;
467 472
 
468
-			if(!$args->open_window) $args->open_window = 'N';
469
-			if(!$args->expand) $args->expand = 'N';
470
-			if(!$args->is_shortcut) $args->is_shortcut = 'Y';
473
+			if(!$args->open_window) {
474
+				$args->open_window = 'N';
475
+			}
476
+			if(!$args->expand) {
477
+				$args->expand = 'N';
478
+			}
479
+			if(!$args->is_shortcut) {
480
+				$args->is_shortcut = 'Y';
481
+			}
471 482
 
472
-			if($request->menu_name_key) $args->name = $request->menu_name_key;
473
-			else $args->name = $request->menu_name;
483
+			if($request->menu_name_key) {
484
+				$args->name = $request->menu_name_key;
485
+			} else {
486
+				$args->name = $request->menu_name;
487
+			}
474 488
 		}
475 489
 		// type is module short cut
476 490
 		else if(is_numeric($request->shortcut_target))
@@ -505,13 +519,18 @@  discard block
 block discarded – undo
505 519
 			$args->url = '#';
506 520
 		}
507 521
 
508
-		if($request->menu_desc) $args->desc = $request->menu_desc;
509
-		else $args->desc = '';
522
+		if($request->menu_desc) {
523
+			$args->desc = $request->menu_desc;
524
+		} else {
525
+			$args->desc = '';
526
+		}
510 527
 
511 528
 		$args->menu_item_srl = getNextSequence();
512 529
 		$args->listorder = -1*$args->menu_item_srl;
513 530
 		$output = executeQuery('menu.insertMenuItem', $args);
514
-		if(!$output->toBool()) return $output;
531
+		if(!$output->toBool()) {
532
+			return $output;
533
+		}
515 534
 
516 535
 		$oDB->commit();
517 536
 
@@ -533,15 +552,27 @@  discard block
 block discarded – undo
533 552
 		$args->expand = $request->menu_expand;
534 553
 		$args->is_shortcut = $request->is_shortcut;
535 554
 
536
-		if(!$args->open_window) $args->open_window = 'N';
537
-		if(!$args->expand) $args->expand = 'N';
538
-		if(!$args->is_shortcut) $args->is_shortcut = 'N';
555
+		if(!$args->open_window) {
556
+			$args->open_window = 'N';
557
+		}
558
+		if(!$args->expand) {
559
+			$args->expand = 'N';
560
+		}
561
+		if(!$args->is_shortcut) {
562
+			$args->is_shortcut = 'N';
563
+		}
539 564
 
540
-		if($request->menu_name_key) $args->name = $request->menu_name_key;
541
-		else $args->name = $request->menu_name;
565
+		if($request->menu_name_key) {
566
+			$args->name = $request->menu_name_key;
567
+		} else {
568
+			$args->name = $request->menu_name;
569
+		}
542 570
 
543
-		if($request->menu_desc) $args->desc = $request->menu_desc;
544
-		else $args->desc = '';
571
+		if($request->menu_desc) {
572
+			$args->desc = $request->menu_desc;
573
+		} else {
574
+			$args->desc = '';
575
+		}
545 576
 
546 577
 		if($request->module_id && strncasecmp('http', $request->module_id, 4) === 0)
547 578
 		{
@@ -559,9 +590,15 @@  discard block
 block discarded – undo
559 590
 		}
560 591
 
561 592
 		// if setting button variables, set argument button variables for db insert. but not upload in this method
562
-		if($request->normal_btn) $args->normal_btn = $request->normal_btn;
563
-		if($request->hover_btn) $args->hover_btn = $request->hover_btn;
564
-		if($request->active_btn) $args->active_btn = $request->active_btn;
593
+		if($request->normal_btn) {
594
+			$args->normal_btn = $request->normal_btn;
595
+		}
596
+		if($request->hover_btn) {
597
+			$args->hover_btn = $request->hover_btn;
598
+		}
599
+		if($request->active_btn) {
600
+			$args->active_btn = $request->active_btn;
601
+		}
565 602
 
566 603
 		if(!$request->module_id)
567 604
 		{
@@ -572,7 +609,9 @@  discard block
 block discarded – undo
572 609
 		$args->menu_item_srl = getNextSequence();
573 610
 		$args->listorder = -1*$args->menu_item_srl;
574 611
 		$output = executeQuery('menu.insertMenuItem', $args);
575
-		if(!$output->toBool()) return $output;
612
+		if(!$output->toBool()) {
613
+			return $output;
614
+		}
576 615
 
577 616
 		$oDB->commit();
578 617
 
@@ -653,8 +692,12 @@  discard block
 block discarded – undo
653 692
 		}
654 693
 
655 694
 		// variables set
656
-		if($request->menu_open_window != "Y") $request->menu_open_window = "N";
657
-		if($request->menu_expand != "Y") $request->menu_expand = "N";
695
+		if($request->menu_open_window != "Y") {
696
+			$request->menu_open_window = "N";
697
+		}
698
+		if($request->menu_expand != "Y") {
699
+			$request->menu_expand = "N";
700
+		}
658 701
 
659 702
 		// Get original information
660 703
 		$oMenuAdminModel = getAdminModel('menu');
@@ -681,13 +724,11 @@  discard block
 block discarded – undo
681 724
 
682 725
 				$args->url = $newItemInfo->url;
683 726
 				$args->is_shortcut = 'Y';
684
-			}
685
-			else
727
+			} else
686 728
 			{
687 729
 				$args->url = '#';
688 730
 			}
689
-		}
690
-		else
731
+		} else
691 732
 		{
692 733
 			// check already created module instance
693 734
 			$oModuleModel = getModel('module');
@@ -720,14 +761,16 @@  discard block
 block discarded – undo
720 761
 		if($request->menu_name_key)
721 762
 		{
722 763
 			$args->name = $request->menu_name_key;
723
-		}
724
-		else
764
+		} else
725 765
 		{
726 766
 			$args->name = $request->menu_name;
727 767
 		}
728 768
 
729
-		if($request->menu_desc) $args->desc = $request->menu_desc;
730
-		else $args->desc = '';
769
+		if($request->menu_desc) {
770
+			$args->desc = $request->menu_desc;
771
+		} else {
772
+			$args->desc = '';
773
+		}
731 774
 
732 775
 		unset($args->group_srls);
733 776
 		$args->open_window = $request->menu_open_window;
@@ -829,8 +872,7 @@  discard block
 block discarded – undo
829 872
 		{
830 873
 			$this->setError($returnObj->error);
831 874
 			$this->setMessage($returnObj->message);
832
-		}
833
-		else
875
+		} else
834 876
 		{
835 877
 			$this->setMessage('success_deleted');
836 878
 		}
@@ -857,7 +899,9 @@  discard block
 block discarded – undo
857 899
 		if($args->is_force != 'Y')
858 900
 		{
859 901
 			$output = executeQuery('menu.getChildMenuCount', $args);
860
-			if(!$output->toBool()) return $output;
902
+			if(!$output->toBool()) {
903
+				return $output;
904
+			}
861 905
 			if($output->data->count > 0)
862 906
 			{
863 907
 				return new Object(-1001, 'msg_cannot_delete_for_child');
@@ -875,7 +919,9 @@  discard block
 block discarded – undo
875 919
 			return $this->stop('msg_cannot_delete_for_admin_topmenu');
876 920
 		}
877 921
 
878
-		if($itemInfo->parent_srl) $parent_srl = $itemInfo->parent_srl;
922
+		if($itemInfo->parent_srl) {
923
+			$parent_srl = $itemInfo->parent_srl;
924
+		}
879 925
 
880 926
 		// get menu properies with child menu
881 927
 		$phpFile = sprintf("./files/cache/menu/%s.php", $args->menu_srl);
@@ -949,9 +995,15 @@  discard block
 block discarded – undo
949 995
 		// Update the xml file and get its location
950 996
 		$xml_file = $this->makeXmlFile($args->menu_srl);
951 997
 		// Delete all of image buttons
952
-		if($node['normal_btn']) FileHandler::removeFile($node['normal_btn']);
953
-		if($node['hover_btn']) FileHandler::removeFile($node['hover_btn']);
954
-		if($node['active_btn']) FileHandler::removeFile($node['active_btn']);
998
+		if($node['normal_btn']) {
999
+			FileHandler::removeFile($node['normal_btn']);
1000
+		}
1001
+		if($node['hover_btn']) {
1002
+			FileHandler::removeFile($node['hover_btn']);
1003
+		}
1004
+		if($node['active_btn']) {
1005
+			FileHandler::removeFile($node['active_btn']);
1006
+		}
955 1007
 
956 1008
 		// Delete module
957 1009
 		if($node['is_shortcut'] != 'Y' && strncasecmp('http', $node['url'], 4) !== 0)
@@ -1018,7 +1070,9 @@  discard block
 block discarded – undo
1018 1070
 		$source_srl = Context::get('source_srl');	// Same hierarchy's menu item serial number
1019 1071
 		$target_srl = Context::get('target_srl');	// Self menu item serial number
1020 1072
 
1021
-		if(!$mode || !$parent_srl || !$target_srl) return new Object(-1,'msg_invalid_request');
1073
+		if(!$mode || !$parent_srl || !$target_srl) {
1074
+			return new Object(-1,'msg_invalid_request');
1075
+		}
1022 1076
 
1023 1077
 		$oMenuAdminModel = getAdminModel('menu');
1024 1078
 
@@ -1182,8 +1236,11 @@  discard block
 block discarded – undo
1182 1236
 		// default argument setting
1183 1237
 		$args = new stdClass();
1184 1238
 		$args->menu_srl = $menuSrl;
1185
-		if($parentSrl == 0) $args->parent_srl = $menuSrl;
1186
-		else $args->parent_srl = $parentSrl;
1239
+		if($parentSrl == 0) {
1240
+			$args->parent_srl = $menuSrl;
1241
+		} else {
1242
+			$args->parent_srl = $parentSrl;
1243
+		}
1187 1244
 		$args->menu_name_key = $originMenu['text'];
1188 1245
 		$args->menu_name = $originMenu['text'];
1189 1246
 		$args->menu_open_window = $originMenu['open_window'];
@@ -1276,8 +1333,11 @@  discard block
 block discarded – undo
1276 1333
 		for($i=0;$i<4;$i++)
1277 1334
 		{
1278 1335
 			$case = rand(0, 1);
1279
-			if($case) $doc = rand(65, 90);
1280
-			else $doc = rand(97, 122);
1336
+			if($case) {
1337
+				$doc = rand(65, 90);
1338
+			} else {
1339
+				$doc = rand(97, 122);
1340
+			}
1281 1341
 
1282 1342
 			$randomString .= chr($doc);
1283 1343
 		}
@@ -1300,15 +1360,21 @@  discard block
 block discarded – undo
1300 1360
 		// menu name update
1301 1361
 		$args->menu_srl = $this->menuSrl;
1302 1362
 		$output = executeQuery('menu.updateMenu', $args);
1303
-		if(!$output->toBool()) return $output;
1363
+		if(!$output->toBool()) {
1364
+			return $output;
1365
+		}
1304 1366
 
1305 1367
 		$this->map = array();
1306 1368
 		if(is_array($parentKeyList))
1307 1369
 		{
1308 1370
 			foreach($parentKeyList as $no=>$srl)
1309 1371
 			{
1310
-				if($srl === 0) continue;
1311
-				if(!is_array($this->map[$srl]))$this->map[$srl] = array();
1372
+				if($srl === 0) {
1373
+					continue;
1374
+				}
1375
+				if(!is_array($this->map[$srl])) {
1376
+					$this->map[$srl] = array();
1377
+				}
1312 1378
 				$this->map[$srl][] = $no;
1313 1379
 			}
1314 1380
 		}
@@ -1410,7 +1476,9 @@  discard block
 block discarded – undo
1410 1476
 		$oMenuAdminModel = getAdminModel('menu');
1411 1477
 
1412 1478
 		$target_item = $oMenuAdminModel->getMenuItemInfo($target_srl);
1413
-		if($target_item->menu_item_srl != $target_srl) return new Object(-1,'msg_invalid_request');
1479
+		if($target_item->menu_item_srl != $target_srl) {
1480
+			return new Object(-1,'msg_invalid_request');
1481
+		}
1414 1482
 		// Move the menu location(change the order menu appears)
1415 1483
 		if($mode == 'move')
1416 1484
 		{
@@ -1421,24 +1489,33 @@  discard block
 block discarded – undo
1421 1489
 			if($source_srl)
1422 1490
 			{
1423 1491
 				$source_item = $oMenuAdminModel->getMenuItemInfo($source_srl);
1424
-				if($source_item->menu_item_srl != $source_srl) return new Object(-1,'msg_invalid_request');
1492
+				if($source_item->menu_item_srl != $source_srl) {
1493
+					return new Object(-1,'msg_invalid_request');
1494
+				}
1425 1495
 				$args->listorder = $source_item->listorder-1;
1426
-			}
1427
-			else
1496
+			} else
1428 1497
 			{
1429 1498
 				$output = executeQuery('menu.getMaxListorder', $args);
1430
-				if(!$output->toBool()) return $output;
1499
+				if(!$output->toBool()) {
1500
+					return $output;
1501
+				}
1431 1502
 				$args->listorder = (int)$output->data->listorder;
1432
-				if(!$args->listorder) $args->listorder= 0;
1503
+				if(!$args->listorder) {
1504
+					$args->listorder= 0;
1505
+				}
1433 1506
 			}
1434 1507
 			$args->parent_srl = $parent_srl;
1435 1508
 			$output = executeQuery('menu.updateMenuItemListorder', $args);
1436
-			if(!$output->toBool()) return $output;
1509
+			if(!$output->toBool()) {
1510
+				return $output;
1511
+			}
1437 1512
 
1438 1513
 			$args->parent_srl = $parent_srl;
1439 1514
 			$args->menu_item_srl = $target_srl;
1440 1515
 			$output = executeQuery('menu.updateMenuItemNode', $args);
1441
-			if(!$output->toBool()) return $output;
1516
+			if(!$output->toBool()) {
1517
+				return $output;
1518
+			}
1442 1519
 
1443 1520
 			//module's menu_srl move also
1444 1521
 			if($isShortcut == 'N' && !empty($url))
@@ -1466,14 +1543,15 @@  discard block
 block discarded – undo
1466 1543
 				}
1467 1544
 			}
1468 1545
 			// Add a child
1469
-		}
1470
-		elseif($mode == 'insert')
1546
+		} elseif($mode == 'insert')
1471 1547
 		{
1472 1548
 			$args->menu_item_srl = $target_srl;
1473 1549
 			$args->parent_srl = $parent_srl;
1474 1550
 			$args->listorder = -1*getNextSequence();
1475 1551
 			$output = executeQuery('menu.updateMenuItemNode', $args);
1476
-			if(!$output->toBool()) return $output;
1552
+			if(!$output->toBool()) {
1553
+				return $output;
1554
+			}
1477 1555
 		}
1478 1556
 
1479 1557
 		$xml_file = $this->makeXmlFile($menu_srl);
@@ -1517,8 +1595,7 @@  discard block
 block discarded – undo
1517 1595
 		{
1518 1596
 			Context::set('error_messge', Context::getLang('msg_invalid_request'));
1519 1597
 
1520
-		}
1521
-		else if(!$target_file || !is_uploaded_file($target_file['tmp_name']) || !preg_match('/\.(gif|jpeg|jpg|png)$/i',$target_file['name'])  || !checkUploadedFile($target_file['tmp_name']))
1598
+		} else if(!$target_file || !is_uploaded_file($target_file['tmp_name']) || !preg_match('/\.(gif|jpeg|jpg|png)$/i',$target_file['name'])  || !checkUploadedFile($target_file['tmp_name']))
1522 1599
 		{
1523 1600
 			Context::set('error_messge', Context::getLang('msg_invalid_request'));
1524 1601
 		}
@@ -1532,7 +1609,9 @@  discard block
 block discarded – undo
1532 1609
 			$path = sprintf('./files/attach/menu_button/%d/', $menu_srl);
1533 1610
 			$filename = sprintf('%s%d.%s.%s', $path, $menu_item_srl, $target, $ext);
1534 1611
 
1535
-			if(!is_dir($path)) FileHandler::makeDir($path);
1612
+			if(!is_dir($path)) {
1613
+				FileHandler::makeDir($path);
1614
+			}
1536 1615
 
1537 1616
 			move_uploaded_file($target_file['tmp_name'], $filename);
1538 1617
 			Context::set('filename', $filename);
@@ -1572,7 +1651,9 @@  discard block
 block discarded – undo
1572 1651
 			foreach($installed_module_list AS $key=>$value)
1573 1652
 			{
1574 1653
 				$info = $oModuleModel->getModuleActionXml($value->module);
1575
-				if($info->menu) $menuList[$value->module] = $info->menu;
1654
+				if($info->menu) {
1655
+					$menuList[$value->module] = $info->menu;
1656
+				}
1576 1657
 				unset($info->menu);
1577 1658
 			}
1578 1659
 		}
@@ -1604,8 +1685,12 @@  discard block
 block discarded – undo
1604 1685
 		$info = $oModuleModel->getModuleActionXml($moduleName);
1605 1686
 
1606 1687
 		$url = getNotEncodedFullUrl('', 'module', 'admin', 'act', $info->menu->{$menuName}->index);
1607
-		if(empty($url)) $url = getNotEncodedFullUrl('', 'module', 'admin', 'act', $info->admin_index_act);
1608
-		if(empty($url)) $url = getNotEncodedFullUrl('', 'module', 'admin');
1688
+		if(empty($url)) {
1689
+			$url = getNotEncodedFullUrl('', 'module', 'admin', 'act', $info->admin_index_act);
1690
+		}
1691
+		if(empty($url)) {
1692
+			$url = getNotEncodedFullUrl('', 'module', 'admin');
1693
+		}
1609 1694
 		$dbInfo = Context::getDBInfo();
1610 1695
 
1611 1696
 		$args = new stdClass();
@@ -1617,8 +1702,7 @@  discard block
 block discarded – undo
1617 1702
 		if(strpos($url, 'https') !== false)
1618 1703
 		{
1619 1704
 			$args->url = str_replace('https'.substr($dbInfo->default_url, 4), '', $url);
1620
-		}
1621
-		else
1705
+		} else
1622 1706
 		{
1623 1707
 			$args->url = str_replace($dbInfo->default_url, '', $url);
1624 1708
 		}
@@ -1637,14 +1721,18 @@  discard block
 block discarded – undo
1637 1721
 		if($item_info->menu_item_srl == $args->menu_item_srl)
1638 1722
 		{
1639 1723
 			$output = $this->_updateMenuItem($args);
1640
-			if(!$output->toBool()) return $output;
1724
+			if(!$output->toBool()) {
1725
+				return $output;
1726
+			}
1641 1727
 		}
1642 1728
 		// Insert if not exist
1643 1729
 		else
1644 1730
 		{
1645 1731
 			$args->listorder = -1*$args->menu_item_srl;
1646 1732
 			$output = executeQuery('menu.insertMenuItem', $args);
1647
-			if(!$output->toBool()) return $output;
1733
+			if(!$output->toBool()) {
1734
+				return $output;
1735
+			}
1648 1736
 		}
1649 1737
 		// Get information of the menu
1650 1738
 		$menu_info = $oMenuModel->getMenu($args->menu_srl);
@@ -1675,8 +1763,7 @@  discard block
 block discarded – undo
1675 1763
 		if(!$exposure)
1676 1764
 		{
1677 1765
 			$args->group_srls = '';
1678
-		}
1679
-		else
1766
+		} else
1680 1767
 		{
1681 1768
 			$exposure = explode(',', $exposure);
1682 1769
 			if(in_array($exposure, array('-1','-3')))
@@ -1684,7 +1771,9 @@  discard block
 block discarded – undo
1684 1771
 				$args->group_srls = $exposure;
1685 1772
 			}
1686 1773
 
1687
-			if($exposure) $args->group_srls = implode(',', $exposure);
1774
+			if($exposure) {
1775
+				$args->group_srls = implode(',', $exposure);
1776
+			}
1688 1777
 		}
1689 1778
 
1690 1779
 		$output = $this->_updateMenuItem($args);
@@ -1704,7 +1793,9 @@  discard block
 block discarded – undo
1704 1793
 		$xml_info = $oModuleModel->getModuleActionXML($moduleInfo->module);
1705 1794
 
1706 1795
 		$grantList = $xml_info->grant;
1707
-		if(!$grantList) $grantList = new stdClass;
1796
+		if(!$grantList) {
1797
+			$grantList = new stdClass;
1798
+		}
1708 1799
 
1709 1800
 		$grantList->access = new stdClass();
1710 1801
 		$grantList->access->default = 'guest';
@@ -1754,12 +1845,16 @@  discard block
 block discarded – undo
1754 1845
 	function makeXmlFile($menu_srl)
1755 1846
 	{
1756 1847
 		// Return if there is no information when creating the xml file
1757
-		if(!$menu_srl) return;
1848
+		if(!$menu_srl) {
1849
+			return;
1850
+		}
1758 1851
 		// Get menu informaton
1759 1852
 		$args = new stdClass();
1760 1853
 		$args->menu_srl = $menu_srl;
1761 1854
 		$output = executeQuery('menu.getMenu', $args);
1762
-		if(!$output->toBool() || !$output->data) return $output;
1855
+		if(!$output->toBool() || !$output->data) {
1856
+			return $output;
1857
+		}
1763 1858
 		$site_srl = (int)$output->data->site_srl;
1764 1859
 
1765 1860
 		if($site_srl)
@@ -1773,7 +1868,9 @@  discard block
 block discarded – undo
1773 1868
 		$args->menu_srl = $menu_srl;
1774 1869
 		$args->sort_index = 'listorder';
1775 1870
 		$output = executeQuery('menu.getMenuItems', $args);
1776
-		if(!$output->toBool()) return;
1871
+		if(!$output->toBool()) {
1872
+			return;
1873
+		}
1777 1874
 		// Specify the name of the cache file
1778 1875
 		$xml_file = sprintf(_XE_PATH_ . "files/cache/menu/%s.xml.php", $menu_srl);
1779 1876
 		$php_file = sprintf(_XE_PATH_ . "files/cache/menu/%s.php", $menu_srl);
@@ -1787,7 +1884,9 @@  discard block
 block discarded – undo
1787 1884
 			return $xml_file;
1788 1885
 		}
1789 1886
 		// Change to an array if only a single data is obtained
1790
-		if(!is_array($list)) $list = array($list);
1887
+		if(!is_array($list)) {
1888
+			$list = array($list);
1889
+		}
1791 1890
 		// Create a tree for loop
1792 1891
 		$list_count = count($list);
1793 1892
 		for($i=0;$i<$list_count;$i++)
@@ -1875,7 +1974,9 @@  discard block
 block discarded – undo
1875 1974
 	 */
1876 1975
 	function getXmlTree($source_node, $tree, $site_srl, $domain)
1877 1976
 	{
1878
-		if(!$source_node) return;
1977
+		if(!$source_node) {
1978
+			return;
1979
+		}
1879 1980
 
1880 1981
 		$oMenuAdminModel = getAdminModel('menu');
1881 1982
 
@@ -1883,7 +1984,9 @@  discard block
 block discarded – undo
1883 1984
 		{
1884 1985
 			$child_buff = "";
1885 1986
 			// Get data of the child nodes
1886
-			if($menu_item_srl&&$tree[$menu_item_srl]) $child_buff = $this->getXmlTree($tree[$menu_item_srl], $tree, $site_srl, $domain);
1987
+			if($menu_item_srl&&$tree[$menu_item_srl]) {
1988
+				$child_buff = $this->getXmlTree($tree[$menu_item_srl], $tree, $site_srl, $domain);
1989
+			}
1887 1990
 			// List variables
1888 1991
 			$names = $oMenuAdminModel->getMenuItemNames($node->name, $site_srl);
1889 1992
 			foreach($names as $key => $val)
@@ -1897,37 +2000,57 @@  discard block
 block discarded – undo
1897 2000
 			if(preg_match('/^([0-9a-zA-Z\_\-]+)$/', $node->url))
1898 2001
 			{
1899 2002
 				$href = "getSiteUrl('$domain', '','mid','$node->url')";
2003
+			} else {
2004
+				$href = sprintf('"%s"', $url);
1900 2005
 			}
1901
-			else $href = sprintf('"%s"', $url);
1902 2006
 			$is_shortcut = $node->is_shortcut;
1903 2007
 			$open_window = $node->open_window;
1904 2008
 			$expand = $node->expand;
1905 2009
 
1906 2010
 			$normal_btn = $node->normal_btn;
1907
-			if($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) $normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$normal_btn);
1908
-			else $normal_btn = '';
2011
+			if($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) {
2012
+				$normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$normal_btn);
2013
+			} else {
2014
+				$normal_btn = '';
2015
+			}
1909 2016
 			$hover_btn = $node->hover_btn;
1910
-			if($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) $hover_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$hover_btn);
1911
-			else $hover_btn = '';
2017
+			if($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) {
2018
+				$hover_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$hover_btn);
2019
+			} else {
2020
+				$hover_btn = '';
2021
+			}
1912 2022
 			$active_btn = $node->active_btn;
1913
-			if($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) $active_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$active_btn);
1914
-			else $active_btn = '';
2023
+			if($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) {
2024
+				$active_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$active_btn);
2025
+			} else {
2026
+				$active_btn = '';
2027
+			}
1915 2028
 
1916 2029
 			$group_srls = $node->group_srls;
1917 2030
 
1918 2031
 			if($normal_btn)
1919 2032
 			{
1920
-				if($hover_btn) $hover_str = sprintf('onmouseover=&quot;this.src=\'%s\'&quot;', $hover_btn); else $hover_str = '';
1921
-				if($active_btn) $active_str = sprintf('onmousedown=&quot;this.src=\'%s\'&quot;', $active_btn); else $active_str = '';
2033
+				if($hover_btn) {
2034
+					$hover_str = sprintf('onmouseover=&quot;this.src=\'%s\'&quot;', $hover_btn);
2035
+				} else {
2036
+					$hover_str = '';
2037
+				}
2038
+				if($active_btn) {
2039
+					$active_str = sprintf('onmousedown=&quot;this.src=\'%s\'&quot;', $active_btn);
2040
+				} else {
2041
+					$active_str = '';
2042
+				}
1922 2043
 				$link = sprintf('&lt;img src=&quot;%s&quot; onmouseout=&quot;this.src=\'%s\'&quot; alt=&quot;<?php print htmlspecialchars($_names[$lang_type], ENT_COMPAT | ENT_HTML401, \'UTF-8\', false) ?>&quot; %s %s /&gt;', $normal_btn, $normal_btn, $hover_str, $active_str);
1923
-			}
1924
-			else
2044
+			} else
1925 2045
 			{
1926 2046
 				$link = '<?php print $_names[$lang_type]; ?>';
1927 2047
 			}
1928 2048
 			// If the value of node->group_srls exists
1929
-			if($group_srls)$group_check_code = sprintf('($is_admin==true||(is_array($group_srls)&&count(array_intersect($group_srls, array(%s))))||($is_logged&&%s))',$group_srls,$group_srls == -1?1:0);
1930
-			else $group_check_code = "true";
2049
+			if($group_srls) {
2050
+				$group_check_code = sprintf('($is_admin==true||(is_array($group_srls)&&count(array_intersect($group_srls, array(%s))))||($is_logged&&%s))',$group_srls,$group_srls == -1?1:0);
2051
+			} else {
2052
+				$group_check_code = "true";
2053
+			}
1931 2054
 			$attribute = sprintf(
1932 2055
 				'node_srl="%s" parent_srl="%s" menu_name_key=\'%s\' text="<?php if(%s) { %s }?>" url="<?php print(%s?"%s":"")?>" href="<?php print(%s?%s:"")?>" is_shortcut="%s" desc="%s" open_window="%s" expand="%s" normal_btn="%s" hover_btn="%s" active_btn="%s" link="<?php if(%s) {?>%s<?php }?>"',
1933 2056
 				$menu_item_srl,
@@ -1950,8 +2073,11 @@  discard block
 block discarded – undo
1950 2073
 				$link
1951 2074
 			);
1952 2075
 
1953
-			if($child_buff) $buff .= sprintf('<node %s>%s</node>', $attribute, $child_buff);
1954
-			else $buff .=  sprintf('<node %s />', $attribute);
2076
+			if($child_buff) {
2077
+				$buff .= sprintf('<node %s>%s</node>', $attribute, $child_buff);
2078
+			} else {
2079
+				$buff .=  sprintf('<node %s />', $attribute);
2080
+			}
1955 2081
 		}
1956 2082
 		return $buff;
1957 2083
 	}
@@ -1970,15 +2096,20 @@  discard block
 block discarded – undo
1970 2096
 	function getPhpCacheCode($source_node, $tree, $site_srl, $domain)
1971 2097
 	{
1972 2098
 		$output = array("buff"=>"", "url_list"=>array());
1973
-		if(!$source_node) return $output;
2099
+		if(!$source_node) {
2100
+			return $output;
2101
+		}
1974 2102
 
1975 2103
 		$oMenuAdminModel = getAdminModel('menu');
1976 2104
 
1977 2105
 		foreach($source_node as $menu_item_srl => $node)
1978 2106
 		{
1979 2107
 			// Get data from child nodes if exist.
1980
-			if($menu_item_srl&&$tree[$menu_item_srl]) $child_output = $this->getPhpCacheCode($tree[$menu_item_srl], $tree, $site_srl, $domain);
1981
-			else $child_output = array("buff"=>"", "url_list"=>array());
2108
+			if($menu_item_srl&&$tree[$menu_item_srl]) {
2109
+				$child_output = $this->getPhpCacheCode($tree[$menu_item_srl], $tree, $site_srl, $domain);
2110
+			} else {
2111
+				$child_output = array("buff"=>"", "url_list"=>array());
2112
+			}
1982 2113
 			// List variables
1983 2114
 			$names = $oMenuAdminModel->getMenuItemNames($node->name, $site_srl);
1984 2115
 			unset($name_arr_str);
@@ -1988,11 +2119,16 @@  discard block
 block discarded – undo
1988 2119
 			}
1989 2120
 			$name_str = sprintf('$_menu_names[%d] = array(%s); %s', $node->menu_item_srl, $name_arr_str, $child_output['name']);
1990 2121
 			// If url value is not empty in the current node, put the value into an array url_list
1991
-			if($node->url) $child_output['url_list'][] = $node->url;
2122
+			if($node->url) {
2123
+				$child_output['url_list'][] = $node->url;
2124
+			}
1992 2125
 			$output['url_list'] = array_merge($output['url_list'], $child_output['url_list']);
1993 2126
 			// If node->group_srls value exists
1994
-			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);
1995
-			else $group_check_code = "true";
2127
+			if($node->group_srls) {
2128
+				$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);
2129
+			} else {
2130
+				$group_check_code = "true";
2131
+			}
1996 2132
 			// List variables
1997 2133
 			$href = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->href);
1998 2134
 			$url = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->url);
@@ -2000,8 +2136,9 @@  discard block
 block discarded – undo
2000 2136
 			if(preg_match('/^([0-9a-zA-Z\_\-]+)$/i', $node->url))
2001 2137
 			{
2002 2138
 				$href = "getSiteUrl('$domain', '','mid','$node->url')";
2139
+			} else {
2140
+				$href = sprintf('"%s"', $url);
2003 2141
 			}
2004
-			else $href = sprintf('"%s"', $url);
2005 2142
 			$is_shortcut = $node->is_shortcut;
2006 2143
 			$open_window = $node->open_window;
2007 2144
 			$normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->normal_btn);
@@ -2018,29 +2155,48 @@  discard block
 block discarded – undo
2018 2155
 			$expand = $node->expand;
2019 2156
 
2020 2157
 			$normal_btn = $node->normal_btn;
2021
-			if($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) $normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$normal_btn);
2022
-			else $normal_btn = '';
2158
+			if($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) {
2159
+				$normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$normal_btn);
2160
+			} else {
2161
+				$normal_btn = '';
2162
+			}
2023 2163
 
2024 2164
 			$hover_btn = $node->hover_btn;
2025
-			if($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) $hover_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$hover_btn);
2026
-			else $hover_btn = '';
2165
+			if($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) {
2166
+				$hover_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$hover_btn);
2167
+			} else {
2168
+				$hover_btn = '';
2169
+			}
2027 2170
 
2028 2171
 			$active_btn = $node->active_btn;
2029
-			if($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) $active_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$active_btn);
2030
-			else $active_btn = '';
2172
+			if($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) {
2173
+				$active_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$active_btn);
2174
+			} else {
2175
+				$active_btn = '';
2176
+			}
2031 2177
 
2032 2178
 
2033 2179
 			$group_srls = $node->group_srls;
2034 2180
 
2035 2181
 			if($normal_btn)
2036 2182
 			{
2037
-				if($hover_btn) $hover_str = sprintf('onmouseover=\"this.src=\'%s\'\"', $hover_btn); else $hover_str = '';
2038
-				if($active_btn) $active_str = sprintf('onmousedown=\"this.src=\'%s\'\"', $active_btn); else $active_str = '';
2183
+				if($hover_btn) {
2184
+					$hover_str = sprintf('onmouseover=\"this.src=\'%s\'\"', $hover_btn);
2185
+				} else {
2186
+					$hover_str = '';
2187
+				}
2188
+				if($active_btn) {
2189
+					$active_str = sprintf('onmousedown=\"this.src=\'%s\'\"', $active_btn);
2190
+				} else {
2191
+					$active_str = '';
2192
+				}
2039 2193
 				$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);
2040
-				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);
2041
-				else $link_active = $link;
2042
-			}
2043
-			else
2194
+				if($active_btn) {
2195
+					$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);
2196
+				} else {
2197
+					$link_active = $link;
2198
+				}
2199
+			} else
2044 2200
 			{
2045 2201
 				$link_active = $link = sprintf('$_menu_names[%d][$lang_type]', $node->menu_item_srl);
2046 2202
 			}
@@ -2089,11 +2245,15 @@  discard block
 block discarded – undo
2089 2245
 	 */
2090 2246
 	function updateMenuLayout($layout_srl, $menu_srl_list)
2091 2247
 	{
2092
-		if(!count($menu_srl_list)) return;
2248
+		if(!count($menu_srl_list)) {
2249
+			return;
2250
+		}
2093 2251
 		// Delete the value of menu_srls
2094 2252
 		$args->menu_srls = implode(',',$menu_srl_list);
2095 2253
 		$output = executeQuery('menu.deleteMenuLayout', $args);
2096
-		if(!$output->toBool()) return $output;
2254
+		if(!$output->toBool()) {
2255
+			return $output;
2256
+		}
2097 2257
 
2098 2258
 		$args->layout_srl = $layout_srl;
2099 2259
 		// Mapping menu_srls, layout_srl
@@ -2101,7 +2261,9 @@  discard block
 block discarded – undo
2101 2261
 		{
2102 2262
 			$args->menu_srl = $menu_srl_list[$i];
2103 2263
 			$output = executeQuery('menu.insertMenuLayout', $args);
2104
-			if(!$output->toBool()) return $output;
2264
+			if(!$output->toBool()) {
2265
+				return $output;
2266
+			}
2105 2267
 		}
2106 2268
 	}
2107 2269
 
@@ -2124,9 +2286,15 @@  discard block
 block discarded – undo
2124 2286
 			$oMenuModel = getAdminModel('menu');
2125 2287
 			$itemInfo = $oMenuModel->getMenuItemInfo($args->menu_item_srl);
2126 2288
 
2127
-			if($args->isNormalDelete == 'Y' && $itemInfo->normal_btn) FileHandler::removeFile($itemInfo->normal_btn);
2128
-			if($args->isHoverDelete == 'Y' && $itemInfo->hover_btn) FileHandler::removeFile($itemInfo->hover_btn);
2129
-			if($args->isActiveDelete == 'Y' && $itemInfo->active_btn) FileHandler::removeFile($itemInfo->active_btn);
2289
+			if($args->isNormalDelete == 'Y' && $itemInfo->normal_btn) {
2290
+				FileHandler::removeFile($itemInfo->normal_btn);
2291
+			}
2292
+			if($args->isHoverDelete == 'Y' && $itemInfo->hover_btn) {
2293
+				FileHandler::removeFile($itemInfo->hover_btn);
2294
+			}
2295
+			if($args->isActiveDelete == 'Y' && $itemInfo->active_btn) {
2296
+				FileHandler::removeFile($itemInfo->active_btn);
2297
+			}
2130 2298
 		}
2131 2299
 
2132 2300
 		$returnArray = array();
Please login to merge, or discard this patch.
Spacing   +297 added lines, -297 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 	}
57 57
 
58 58
 	function __construct() {
59
-		$this->homeMenuCacheFile = _XE_PATH_ . $this->homeMenuCacheFile;
59
+		$this->homeMenuCacheFile = _XE_PATH_.$this->homeMenuCacheFile;
60 60
 	}
61 61
 
62 62
 	/**
@@ -68,8 +68,8 @@  discard block
 block discarded – undo
68 68
 		// List variables
69 69
 		$site_module_info = Context::get('site_module_info');
70 70
 
71
-		$output = $this->addMenu(Context::get('title'), (int)$site_module_info->site_srl);
72
-		if(!$output->toBool()) return $output;
71
+		$output = $this->addMenu(Context::get('title'), (int) $site_module_info->site_srl);
72
+		if (!$output->toBool()) return $output;
73 73
 
74 74
 		$this->add('menu_srl', $output->get('menuSrl'));
75 75
 		$this->setMessage('success_registed');
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 		$args->listorder = $args->menu_srl * -1;
96 96
 
97 97
 		$output = executeQuery('menu.insertMenu', $args);
98
-		if(!$output->toBool())
98
+		if (!$output->toBool())
99 99
 		{
100 100
 			return $output;
101 101
 		}
@@ -109,13 +109,13 @@  discard block
 block discarded – undo
109 109
 		$unlinked_modules = false;
110 110
 		$args = new stdClass;
111 111
 		$args->site_srl = 0;
112
-		$output = executeQueryArray('module.getNotLinkedModuleBySiteSrl',$args);
113
-		if($output->toBool() && $output->data && count($output->data) > 0)
112
+		$output = executeQueryArray('module.getNotLinkedModuleBySiteSrl', $args);
113
+		if ($output->toBool() && $output->data && count($output->data) > 0)
114 114
 		{
115 115
 			$unlinked_modules = $output->data;
116 116
 		}
117 117
 
118
-		if($unlinked_modules)
118
+		if ($unlinked_modules)
119 119
 		{
120 120
 			$unlinked_menu_srl = $this->getUnlinkedMenu();
121 121
 			$output = $this->updateLinkModule($unlinked_modules, $unlinked_menu_srl);
@@ -129,21 +129,21 @@  discard block
 block discarded – undo
129 129
 		$oModuleModel = getModel('module');
130 130
 		$moduleConfig = $oModuleModel->getModuleConfig('menu');
131 131
 
132
-		if($moduleConfig->unlinked_menu_srl)
132
+		if ($moduleConfig->unlinked_menu_srl)
133 133
 		{
134 134
 			$menuArgs = new stdClass;
135 135
 			$menuArgs->menu_srl = $moduleConfig->unlinked_menu_srl;
136 136
 			$menuOutput = executeQuery('menu.getMenu', $menuArgs);
137
-			if(!$menuOutput->data)
137
+			if (!$menuOutput->data)
138 138
 			{
139 139
 				unset($moduleConfig->unlinked_menu_srl);
140 140
 			}
141 141
 		}
142 142
 
143
-		if(!$moduleConfig->unlinked_menu_srl)
143
+		if (!$moduleConfig->unlinked_menu_srl)
144 144
 		{
145 145
 			$output = $this->addMenu('unlinked', 0);
146
-			if($output->toBool())
146
+			if ($output->toBool())
147 147
 			{
148 148
 				$moduleConfig->unlinked_menu_srl = $output->get('menuSrl');
149 149
 				$oModuleController = getController('module');
@@ -168,12 +168,12 @@  discard block
 block discarded – undo
168 168
 	 */
169 169
 	function updateLinkModule($moduleInfos, $menuSrl)
170 170
 	{
171
-		if(!$moduleInfos || !is_array($moduleInfos) || count($moduleInfos) == 0 || $menuSrl == 0)
171
+		if (!$moduleInfos || !is_array($moduleInfos) || count($moduleInfos) == 0 || $menuSrl == 0)
172 172
 		{
173 173
 			return new Object(-1, 'msg_invalid_request');
174 174
 		}
175 175
 
176
-		foreach($moduleInfos as $moduleInfo)
176
+		foreach ($moduleInfos as $moduleInfo)
177 177
 		{
178 178
 			// search menu.
179 179
 			$args = new stdClass;
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 
184 184
 			$output = executeQuery('menu.getMenuItemByUrl', $args);
185 185
 
186
-			if($output->toBool() && $output->data)
186
+			if ($output->toBool() && $output->data)
187 187
 			{
188 188
 				$moduleInfo->menu_srl = $output->data->menu_srl;
189 189
 			}
@@ -194,10 +194,10 @@  discard block
 block discarded – undo
194 194
 				$item_args->url = $moduleInfo->mid;
195 195
 				$item_args->name = $moduleInfo->mid;
196 196
 				$item_args->menu_item_srl = getNextSequence();
197
-				$item_args->listorder = -1*$item_args->menu_item_srl;
197
+				$item_args->listorder = -1 * $item_args->menu_item_srl;
198 198
 
199 199
 				$output = executeQuery('menu.insertMenuItem', $item_args);
200
-				if(!$output->toBool())
200
+				if (!$output->toBool())
201 201
 				{
202 202
 					return $output;
203 203
 				}
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 		}
211 211
 
212 212
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
213
-		if($oCacheHandler->isSupport())
213
+		if ($oCacheHandler->isSupport())
214 214
 		{
215 215
 			$oCacheHandler->invalidateGroupKey('site_and_module');
216 216
 		}
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 		$args->menu_srl = Context::get('menu_srl');
236 236
 
237 237
 		$output = executeQuery('menu.updateMenu', $args);
238
-		if(!$output->toBool()) return $output;
238
+		if (!$output->toBool()) return $output;
239 239
 
240 240
 		$this->setMessage('success_registed');
241 241
 
@@ -255,14 +255,14 @@  discard block
 block discarded – undo
255 255
 		$menuInfo = $oMenuAdminModel->getMenu($menu_srl);
256 256
 
257 257
 		$oAdmin = getClass('admin');
258
-		if($menuInfo->title == $oAdmin->getAdminMenuName())
258
+		if ($menuInfo->title == $oAdmin->getAdminMenuName())
259 259
 			return new Object(-1, 'msg_adminmenu_cannot_delete');
260 260
 
261 261
 		// get menu properies with child menu
262 262
 		$phpFile = sprintf("./files/cache/menu/%s.php", $menu_srl);
263 263
 		$originMenu = NULL;
264 264
 
265
-		if(is_readable(FileHandler::getRealPath($phpFile)))
265
+		if (is_readable(FileHandler::getRealPath($phpFile)))
266 266
 		{
267 267
 			include(FileHandler::getRealPath($phpFile));
268 268
 		}
@@ -273,25 +273,25 @@  discard block
 block discarded – undo
273 273
 
274 274
 		$isStartmenuInclude = false;
275 275
 
276
-		if(is_array($menu->list))
276
+		if (is_array($menu->list))
277 277
 		{
278
-			foreach($menu->list AS $key=>$value)
278
+			foreach ($menu->list AS $key=>$value)
279 279
 			{
280 280
 				$originMenu = $value;
281 281
 				$this->_checkHomeMenuInOriginMenu($originMenu, $siteInfo->mid, $isStartmenuInclude);
282 282
 
283
-				if($isStartmenuInclude)
283
+				if ($isStartmenuInclude)
284 284
 					break;
285 285
 			}
286 286
 		}
287 287
 
288
-		if($isStartmenuInclude)
288
+		if ($isStartmenuInclude)
289 289
 		{
290 290
 			return new Object(-1, 'msg_cannot_delete_homemenu');
291 291
 		}
292 292
 
293 293
 		$output = $this->deleteMenu($menu_srl);
294
-		if(!$output->toBool())
294
+		if (!$output->toBool())
295 295
 		{
296 296
 			return new Object(-1, $output->message);
297 297
 		}
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 
320 320
 		// Delete modules
321 321
 		$output = executeQueryArray('menu.getMenuItems', $args);
322
-		if(!$output->toBool())
322
+		if (!$output->toBool())
323 323
 		{
324 324
 			return $output;
325 325
 		}
@@ -327,15 +327,15 @@  discard block
 block discarded – undo
327 327
 		$oModuleController = getController('module');
328 328
 		$oModuleModel = getModel('module');
329 329
 
330
-		foreach($output->data as $itemInfo)
330
+		foreach ($output->data as $itemInfo)
331 331
 		{
332
-			if($itemInfo->is_shortcut != 'Y' && strncasecmp('http', $itemInfo->url, 4) !== 0)
332
+			if ($itemInfo->is_shortcut != 'Y' && strncasecmp('http', $itemInfo->url, 4) !== 0)
333 333
 			{
334 334
 				$moduleInfo = $oModuleModel->getModuleInfoByMid($itemInfo->url, $menuInfo->site_srl);
335
-				if($moduleInfo->module_srl)
335
+				if ($moduleInfo->module_srl)
336 336
 				{
337 337
 					$output = $oModuleController->onlyDeleteModule($moduleInfo->module_srl);
338
-					if(!$output->toBool())
338
+					if (!$output->toBool())
339 339
 					{
340 340
 						$oDB->rollback();
341 341
 						return $output;
@@ -346,27 +346,27 @@  discard block
 block discarded – undo
346 346
 
347 347
 		// Delete menu items
348 348
 		$output = executeQuery("menu.deleteMenuItems", $args);
349
-		if(!$output->toBool())
349
+		if (!$output->toBool())
350 350
 		{
351 351
 			$oDB->rollback();
352 352
 			return $output;
353 353
 		}
354 354
 		// Delete the menu
355 355
 		$output = executeQuery("menu.deleteMenu", $args);
356
-		if(!$output->toBool())
356
+		if (!$output->toBool())
357 357
 		{
358 358
 			$oDB->rollback();
359 359
 			return $output;
360 360
 		}
361 361
 
362 362
 		// Delete cache files
363
-		$cache_list = FileHandler::readDir("./files/cache/menu","",false,true);
364
-		if(count($cache_list))
363
+		$cache_list = FileHandler::readDir("./files/cache/menu", "", false, true);
364
+		if (count($cache_list))
365 365
 		{
366
-			foreach($cache_list as $cache_file)
366
+			foreach ($cache_list as $cache_file)
367 367
 			{
368 368
 				$pos = strpos($cache_file, $menu_srl.'.');
369
-				if($pos>0)FileHandler::removeFile($cache_file);
369
+				if ($pos > 0)FileHandler::removeFile($cache_file);
370 370
 			}
371 371
 		}
372 372
 		// Delete images of menu buttons
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
 
376 376
 		$oDB->commit();
377 377
 
378
-		return new Object(0,'success_deleted');
378
+		return new Object(0, 'success_deleted');
379 379
 	}
380 380
 
381 381
 	/**
@@ -385,24 +385,24 @@  discard block
 block discarded – undo
385 385
 	public function procMenuAdminInsertItem($request = NULL)
386 386
 	{
387 387
 		$isProc = false;
388
-		if(!$request)
388
+		if (!$request)
389 389
 		{
390 390
 			$isProc = true;
391 391
 			$request = Context::getRequestVars();
392 392
 		}
393 393
 
394
-		if(!$request->parent_srl || !$request->menu_name)
394
+		if (!$request->parent_srl || !$request->menu_name)
395 395
 		{
396 396
 			return new Object(-1, 'msg_invalid_request');
397 397
 		}
398 398
 
399 399
 		$this->_setMenuSrl($request->parent_srl, $request->menu_srl);
400
-		if(!$request->menu_srl)
400
+		if (!$request->menu_srl)
401 401
 		{
402 402
 			return new Object(-1, 'msg_invalid_request');
403 403
 		}
404 404
 
405
-		if($request->is_shortcut == 'Y')
405
+		if ($request->is_shortcut == 'Y')
406 406
 		{
407 407
 			$result = $this->_insertShortcut($request);
408 408
 		}
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
 			$result = $this->_insertMenu($request, $isProc);
412 412
 		}
413 413
 
414
-		if($result->error < 0)
414
+		if ($result->error < 0)
415 415
 		{
416 416
 			return new Object($result->error, $result->message);
417 417
 		}
@@ -419,7 +419,7 @@  discard block
 block discarded – undo
419 419
 		// recreate menu cache file
420 420
 		$this->makeXmlFile($request->menu_srl);
421 421
 
422
-		if(!$isProc)
422
+		if (!$isProc)
423 423
 		{
424 424
 			return $this->get('menu_item_srl');
425 425
 		}
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
 		$oMenuAdminModel = getAdminModel('menu');
432 432
 		$itemInfo = $oMenuAdminModel->getMenuItemInfo($parent_srl);
433 433
 		// parent_srl is parent menu item's srl
434
-		if($itemInfo->menu_srl)
434
+		if ($itemInfo->menu_srl)
435 435
 		{
436 436
 			$menu_srl = $itemInfo->menu_srl;
437 437
 		}
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
 		else
440 440
 		{
441 441
 			$output = $oMenuAdminModel->getMenu($parent_srl);
442
-			if($output->menu_srl == $parent_srl)
442
+			if ($output->menu_srl == $parent_srl)
443 443
 			{
444 444
 				$menu_srl = $output->menu_srl;
445 445
 				$parent_srl = 0;
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
 		$oDB->begin();
454 454
 
455 455
 		// type is url
456
-		if(strncasecmp('http', $request->shortcut_target, 4) === 0 || preg_match('/^(\.\/|\.\.\/|\/).*$/', $request->shortcut_target))
456
+		if (strncasecmp('http', $request->shortcut_target, 4) === 0 || preg_match('/^(\.\/|\.\.\/|\/).*$/', $request->shortcut_target))
457 457
 		{
458 458
 			// set menu variable
459 459
 			$args = new stdClass();
@@ -465,27 +465,27 @@  discard block
 block discarded – undo
465 465
 			$args->is_shortcut = $request->is_shortcut;
466 466
 			$args->url = $request->shortcut_target;
467 467
 
468
-			if(!$args->open_window) $args->open_window = 'N';
469
-			if(!$args->expand) $args->expand = 'N';
470
-			if(!$args->is_shortcut) $args->is_shortcut = 'Y';
468
+			if (!$args->open_window) $args->open_window = 'N';
469
+			if (!$args->expand) $args->expand = 'N';
470
+			if (!$args->is_shortcut) $args->is_shortcut = 'Y';
471 471
 
472
-			if($request->menu_name_key) $args->name = $request->menu_name_key;
472
+			if ($request->menu_name_key) $args->name = $request->menu_name_key;
473 473
 			else $args->name = $request->menu_name;
474 474
 		}
475 475
 		// type is module short cut
476
-		else if(is_numeric($request->shortcut_target))
476
+		else if (is_numeric($request->shortcut_target))
477 477
 		{
478 478
 			// Get original information
479 479
 			$oMenuAdminModel = getAdminModel('menu');
480 480
 			$itemInfo = $oMenuAdminModel->getMenuItemInfo($request->shortcut_target);
481
-			if(!$itemInfo->menu_item_srl)
481
+			if (!$itemInfo->menu_item_srl)
482 482
 			{
483 483
 				return new Object(-1, 'msg_invalid_request');
484 484
 			}
485 485
 			unset($itemInfo->normal_btn, $itemInfo->hover_btn, $itemInfo->active_btn);
486 486
 
487 487
 			$args = $itemInfo;
488
-			if(count($args->group_srls) == 0)
488
+			if (count($args->group_srls) == 0)
489 489
 			{
490 490
 				unset($args->group_srls);
491 491
 			}
@@ -505,13 +505,13 @@  discard block
 block discarded – undo
505 505
 			$args->url = '#';
506 506
 		}
507 507
 
508
-		if($request->menu_desc) $args->desc = $request->menu_desc;
508
+		if ($request->menu_desc) $args->desc = $request->menu_desc;
509 509
 		else $args->desc = '';
510 510
 
511 511
 		$args->menu_item_srl = getNextSequence();
512
-		$args->listorder = -1*$args->menu_item_srl;
512
+		$args->listorder = -1 * $args->menu_item_srl;
513 513
 		$output = executeQuery('menu.insertMenuItem', $args);
514
-		if(!$output->toBool()) return $output;
514
+		if (!$output->toBool()) return $output;
515 515
 
516 516
 		$oDB->commit();
517 517
 
@@ -533,46 +533,46 @@  discard block
 block discarded – undo
533 533
 		$args->expand = $request->menu_expand;
534 534
 		$args->is_shortcut = $request->is_shortcut;
535 535
 
536
-		if(!$args->open_window) $args->open_window = 'N';
537
-		if(!$args->expand) $args->expand = 'N';
538
-		if(!$args->is_shortcut) $args->is_shortcut = 'N';
536
+		if (!$args->open_window) $args->open_window = 'N';
537
+		if (!$args->expand) $args->expand = 'N';
538
+		if (!$args->is_shortcut) $args->is_shortcut = 'N';
539 539
 
540
-		if($request->menu_name_key) $args->name = $request->menu_name_key;
540
+		if ($request->menu_name_key) $args->name = $request->menu_name_key;
541 541
 		else $args->name = $request->menu_name;
542 542
 
543
-		if($request->menu_desc) $args->desc = $request->menu_desc;
543
+		if ($request->menu_desc) $args->desc = $request->menu_desc;
544 544
 		else $args->desc = '';
545 545
 
546
-		if($request->module_id && strncasecmp('http', $request->module_id, 4) === 0)
546
+		if ($request->module_id && strncasecmp('http', $request->module_id, 4) === 0)
547 547
 		{
548 548
 			return new Object(-1, 'msg_invalid_request');
549 549
 		}
550 550
 
551 551
 		// when menu copy, module already copied
552
-		if($isProc)
552
+		if ($isProc)
553 553
 		{
554 554
 			$result = $this->_insertModule($request, $args);
555
-			if(!$result->toBool())
555
+			if (!$result->toBool())
556 556
 			{
557 557
 				return new Object(-1, $result->message);
558 558
 			}
559 559
 		}
560 560
 
561 561
 		// if setting button variables, set argument button variables for db insert. but not upload in this method
562
-		if($request->normal_btn) $args->normal_btn = $request->normal_btn;
563
-		if($request->hover_btn) $args->hover_btn = $request->hover_btn;
564
-		if($request->active_btn) $args->active_btn = $request->active_btn;
562
+		if ($request->normal_btn) $args->normal_btn = $request->normal_btn;
563
+		if ($request->hover_btn) $args->hover_btn = $request->hover_btn;
564
+		if ($request->active_btn) $args->active_btn = $request->active_btn;
565 565
 
566
-		if(!$request->module_id)
566
+		if (!$request->module_id)
567 567
 		{
568 568
 			return new Object(-1, 'msg_invalid_request');
569 569
 		}
570 570
 
571 571
 		$args->url = $request->module_id;
572 572
 		$args->menu_item_srl = getNextSequence();
573
-		$args->listorder = -1*$args->menu_item_srl;
573
+		$args->listorder = -1 * $args->menu_item_srl;
574 574
 		$output = executeQuery('menu.insertMenuItem', $args);
575
-		if(!$output->toBool()) return $output;
575
+		if (!$output->toBool()) return $output;
576 576
 
577 577
 		$oDB->commit();
578 578
 
@@ -604,7 +604,7 @@  discard block
 block discarded – undo
604 604
 
605 605
 		//module create
606 606
 		$site_module_info = Context::get('site_module_info');
607
-		$cmArgs->site_srl = (int)$site_module_info->site_srl;
607
+		$cmArgs->site_srl = (int) $site_module_info->site_srl;
608 608
 		$cmArgs->browser_title = $args->name;
609 609
 		$cmArgs->menu_srl = $request->menu_srl;
610 610
 		$cmArgs->layout_srl = -1;
@@ -612,13 +612,13 @@  discard block
 block discarded – undo
612 612
 		$cmArgs->is_skin_fix = 'N';
613 613
 		$cmArgs->is_mskin_fix = 'N';
614 614
 
615
-		if(Mobile::isMobileEnabled() === true)
615
+		if (Mobile::isMobileEnabled() === true)
616 616
 		{
617 617
 			$cmArgs->use_mobile = 'Y';
618 618
 		}
619 619
 
620 620
 		// if mid is empty, auto create mid
621
-		if(!$request->module_id)
621
+		if (!$request->module_id)
622 622
 		{
623 623
 			$randomMid = $this->_makeRandomMid();
624 624
 			$request->module_id = $cmArgs->module.'_'.$randomMid;
@@ -628,7 +628,7 @@  discard block
 block discarded – undo
628 628
 		// check already created module instance
629 629
 		$oModuleModel = getModel('module');
630 630
 		$output = $oModuleModel->getModuleInfoByMid($request->module_id);
631
-		if($output->module_srl)
631
+		if ($output->module_srl)
632 632
 		{
633 633
 			return new Object(-1, 'msg_module_name_exists');
634 634
 		}
@@ -647,14 +647,14 @@  discard block
 block discarded – undo
647 647
 	{
648 648
 		$request = Context::getRequestVars();
649 649
 
650
-		if(!$request->menu_item_srl || !$request->menu_name)
650
+		if (!$request->menu_item_srl || !$request->menu_name)
651 651
 		{
652 652
 			return new Object(-1, 'msg_invalid_request');
653 653
 		}
654 654
 
655 655
 		// variables set
656
-		if($request->menu_open_window != "Y") $request->menu_open_window = "N";
657
-		if($request->menu_expand != "Y") $request->menu_expand = "N";
656
+		if ($request->menu_open_window != "Y") $request->menu_open_window = "N";
657
+		if ($request->menu_expand != "Y") $request->menu_expand = "N";
658 658
 
659 659
 		// Get original information
660 660
 		$oMenuAdminModel = getAdminModel('menu');
@@ -662,19 +662,19 @@  discard block
 block discarded – undo
662 662
 		$args = $itemInfo;
663 663
 
664 664
 		// if menu type is module, check exists module and update
665
-		if($itemInfo->is_shortcut == 'Y')
665
+		if ($itemInfo->is_shortcut == 'Y')
666 666
 		{
667 667
 			// type is url
668
-			if(strncasecmp('http', $request->shortcut_target, 4) === 0 || preg_match('/^(\.\/|\.\.\/|\/).*$/', $request->shortcut_target))
668
+			if (strncasecmp('http', $request->shortcut_target, 4) === 0 || preg_match('/^(\.\/|\.\.\/|\/).*$/', $request->shortcut_target))
669 669
 			{
670 670
 				$args->url = $request->shortcut_target;
671 671
 			}
672 672
 			// type is module short cut
673
-			else if(is_numeric($request->shortcut_target))
673
+			else if (is_numeric($request->shortcut_target))
674 674
 			{
675 675
 				// Get new original information
676 676
 				$newItemInfo = $oMenuAdminModel->getMenuItemInfo($request->shortcut_target);
677
-				if(!$newItemInfo->menu_item_srl)
677
+				if (!$newItemInfo->menu_item_srl)
678 678
 				{
679 679
 					return new Object(-1, 'msg_invalid_request');
680 680
 				}
@@ -691,10 +691,10 @@  discard block
 block discarded – undo
691 691
 		{
692 692
 			// check already created module instance
693 693
 			$oModuleModel = getModel('module');
694
-			if($request->module_id != $itemInfo->url)
694
+			if ($request->module_id != $itemInfo->url)
695 695
 			{
696 696
 				$output = $oModuleModel->getModuleInfoByMid($request->module_id);
697
-				if($output->module_srl)
697
+				if ($output->module_srl)
698 698
 				{
699 699
 					return new Object(-1, 'msg_module_name_exists');
700 700
 				}
@@ -702,13 +702,13 @@  discard block
 block discarded – undo
702 702
 
703 703
 			// if not exist module, return error
704 704
 			$moduleInfo = $oModuleModel->getModuleInfoByMid($itemInfo->url);
705
-			if(!$moduleInfo)
705
+			if (!$moduleInfo)
706 706
 			{
707 707
 				return new Object(-1, 'msg_invalid_request');
708 708
 			}
709 709
 
710 710
 			$moduleInfo->mid = $request->module_id;
711
-			if($request->browser_title)
711
+			if ($request->browser_title)
712 712
 			{
713 713
 				$moduleInfo->browser_title = $request->browser_title;
714 714
 			}
@@ -717,7 +717,7 @@  discard block
 block discarded – undo
717 717
 			$args->url = $request->module_id;
718 718
 		}
719 719
 
720
-		if($request->menu_name_key)
720
+		if ($request->menu_name_key)
721 721
 		{
722 722
 			$args->name = $request->menu_name_key;
723 723
 		}
@@ -726,7 +726,7 @@  discard block
 block discarded – undo
726 726
 			$args->name = $request->menu_name;
727 727
 		}
728 728
 
729
-		if($request->menu_desc) $args->desc = $request->menu_desc;
729
+		if ($request->menu_desc) $args->desc = $request->menu_desc;
730 730
 		else $args->desc = '';
731 731
 
732 732
 		unset($args->group_srls);
@@ -754,38 +754,38 @@  discard block
 block discarded – undo
754 754
 
755 755
 		$btnOutput = $this->_uploadButton($args);
756 756
 
757
-		if($btnOutput['normal_btn'])
757
+		if ($btnOutput['normal_btn'])
758 758
 		{
759 759
 			$this->add('normal_btn', $btnOutput['normal_btn']);
760 760
 			$item_info->normal_btn = $btnOutput['normal_btn'];
761 761
 		}
762
-		if($btnOutput['hover_btn'])
762
+		if ($btnOutput['hover_btn'])
763 763
 		{
764 764
 			$this->add('hover_btn', $btnOutput['hover_btn']);
765 765
 			$item_info->hover_btn = $btnOutput['hover_btn'];
766 766
 		}
767
-		if($btnOutput['active_btn'])
767
+		if ($btnOutput['active_btn'])
768 768
 		{
769 769
 			$this->add('active_btn', $btnOutput['active_btn']);
770 770
 			$item_info->active_btn = $btnOutput['active_btn'];
771 771
 		}
772 772
 
773 773
 		// group_srls check
774
-		if(count($item_info->group_srls) == 0)
774
+		if (count($item_info->group_srls) == 0)
775 775
 		{
776 776
 			unset($item_info->group_srls);
777 777
 		}
778 778
 
779 779
 		// Button delete check
780
-		if(!$btnOutput['normal_btn'] && $args->isNormalDelete == 'Y')
780
+		if (!$btnOutput['normal_btn'] && $args->isNormalDelete == 'Y')
781 781
 		{
782 782
 			$item_info->normal_btn = '';
783 783
 		}
784
-		if(!$btnOutput['hover_btn'] && $args->isHoverDelete == 'Y')
784
+		if (!$btnOutput['hover_btn'] && $args->isHoverDelete == 'Y')
785 785
 		{
786 786
 			$item_info->hover_btn = '';
787 787
 		}
788
-		if(!$btnOutput['active_btn'] && $args->isActiveDelete == 'Y')
788
+		if (!$btnOutput['active_btn'] && $args->isActiveDelete == 'Y')
789 789
 		{
790 790
 			$item_info->active_btn = '';
791 791
 		}
@@ -825,7 +825,7 @@  discard block
 block discarded – undo
825 825
 		$args->is_force = Context::get('is_force');
826 826
 
827 827
 		$returnObj = $this->deleteItem($args);
828
-		if(is_object($returnObj))
828
+		if (is_object($returnObj))
829 829
 		{
830 830
 			$this->setError($returnObj->error);
831 831
 			$this->setMessage($returnObj->message);
@@ -854,11 +854,11 @@  discard block
 block discarded – undo
854 854
 		$args->menu_srl = $itemInfo->menu_srl;
855 855
 
856 856
 		// Display an error that the category cannot be deleted if it has a child node	603
857
-		if($args->is_force != 'Y')
857
+		if ($args->is_force != 'Y')
858 858
 		{
859 859
 			$output = executeQuery('menu.getChildMenuCount', $args);
860
-			if(!$output->toBool()) return $output;
861
-			if($output->data->count > 0)
860
+			if (!$output->toBool()) return $output;
861
+			if ($output->data->count > 0)
862 862
 			{
863 863
 				return new Object(-1001, 'msg_cannot_delete_for_child');
864 864
 			}
@@ -870,22 +870,22 @@  discard block
 block discarded – undo
870 870
 
871 871
 		// check admin menu delete
872 872
 		$oAdmin = getClass('admin');
873
-		if($menu_title == $oAdmin->getAdminMenuName() && $itemInfo->parent_srl == 0)
873
+		if ($menu_title == $oAdmin->getAdminMenuName() && $itemInfo->parent_srl == 0)
874 874
 		{
875 875
 			return $this->stop('msg_cannot_delete_for_admin_topmenu');
876 876
 		}
877 877
 
878
-		if($itemInfo->parent_srl) $parent_srl = $itemInfo->parent_srl;
878
+		if ($itemInfo->parent_srl) $parent_srl = $itemInfo->parent_srl;
879 879
 
880 880
 		// get menu properies with child menu
881 881
 		$phpFile = sprintf("./files/cache/menu/%s.php", $args->menu_srl);
882 882
 		$originMenu = NULL;
883 883
 
884
-		if(is_readable(FileHandler::getRealPath($phpFile)))
884
+		if (is_readable(FileHandler::getRealPath($phpFile)))
885 885
 		{
886 886
 			include(FileHandler::getRealPath($phpFile));
887 887
 
888
-			if(is_array($menu->list))
888
+			if (is_array($menu->list))
889 889
 			{
890 890
 				$this->_searchMenu($menu->list, $args->menu_item_srl, $originMenu);
891 891
 			}
@@ -895,7 +895,7 @@  discard block
 block discarded – undo
895 895
 		$siteInfo = $oModuleModel->getSiteInfo($menuInfo->site_srl);
896 896
 		$isStartmenuInclude = false;
897 897
 		$this->_checkHomeMenuInOriginMenu($originMenu, $siteInfo->mid, $isStartmenuInclude);
898
-		if($isStartmenuInclude)
898
+		if ($isStartmenuInclude)
899 899
 		{
900 900
 			return new Object(-1, 'msg_cannot_delete_homemenu');
901 901
 		}
@@ -919,14 +919,14 @@  discard block
 block discarded – undo
919 919
 
920 920
 	private function _checkHomeMenuInOriginMenu($originMenu, $startMid, &$isStartmenuInclude)
921 921
 	{
922
-		if($originMenu['is_shortcut'] != 'Y' && $originMenu['url'] == $startMid)
922
+		if ($originMenu['is_shortcut'] != 'Y' && $originMenu['url'] == $startMid)
923 923
 		{
924 924
 			$isStartmenuInclude = true;
925 925
 		}
926 926
 
927
-		if(!$isStartmenuInclude && is_array($originMenu['list']))
927
+		if (!$isStartmenuInclude && is_array($originMenu['list']))
928 928
 		{
929
-			foreach($originMenu['list'] AS $key=>$value)
929
+			foreach ($originMenu['list'] AS $key=>$value)
930 930
 			{
931 931
 				$this->_checkHomeMenuInOriginMenu($value, $startMid, $isStartmenuInclude);
932 932
 			}
@@ -940,7 +940,7 @@  discard block
 block discarded – undo
940 940
 		$args->menu_srl = $menuSrl;
941 941
 		$args->menu_item_srl = $node['node_srl'];
942 942
 		$output = executeQuery("menu.deleteMenuItem", $args);
943
-		if(!$output->toBool())
943
+		if (!$output->toBool())
944 944
 		{
945 945
 			$oDB->rollback();
946 946
 			return $output;
@@ -949,12 +949,12 @@  discard block
 block discarded – undo
949 949
 		// Update the xml file and get its location
950 950
 		$xml_file = $this->makeXmlFile($args->menu_srl);
951 951
 		// Delete all of image buttons
952
-		if($node['normal_btn']) FileHandler::removeFile($node['normal_btn']);
953
-		if($node['hover_btn']) FileHandler::removeFile($node['hover_btn']);
954
-		if($node['active_btn']) FileHandler::removeFile($node['active_btn']);
952
+		if ($node['normal_btn']) FileHandler::removeFile($node['normal_btn']);
953
+		if ($node['hover_btn']) FileHandler::removeFile($node['hover_btn']);
954
+		if ($node['active_btn']) FileHandler::removeFile($node['active_btn']);
955 955
 
956 956
 		// Delete module
957
-		if($node['is_shortcut'] != 'Y' && strncasecmp('http', $node['url'], 4) !== 0)
957
+		if ($node['is_shortcut'] != 'Y' && strncasecmp('http', $node['url'], 4) !== 0)
958 958
 		{
959 959
 			$oModuleController = getController('module');
960 960
 			$oModuleModel = getModel('module');
@@ -964,12 +964,12 @@  discard block
 block discarded – undo
964 964
 			$args->site_srl = $menuInfo->site_srl;
965 965
 			$args->is_shortcut = 'Y';
966 966
 			$output = executeQuery('menu.getMenuItemByUrl', $args);
967
-			if($output->data->menu_item_srl)
967
+			if ($output->data->menu_item_srl)
968 968
 			{
969 969
 				$output->data->url = '';
970 970
 				$referenceItem = $output->data;
971 971
 				$output = $this->_updateMenuItem($referenceItem);
972
-				if(!$output->toBool())
972
+				if (!$output->toBool())
973 973
 				{
974 974
 					$oDB->rollback();
975 975
 					return $output;
@@ -977,10 +977,10 @@  discard block
 block discarded – undo
977 977
 			}
978 978
 
979 979
 			$moduleInfo = $oModuleModel->getModuleInfoByMid($node['url'], $menuInfo->site_srl);
980
-			if($moduleInfo->module_srl)
980
+			if ($moduleInfo->module_srl)
981 981
 			{
982 982
 				$output = $oModuleController->onlyDeleteModule($moduleInfo->module_srl);
983
-				if(!$output->toBool())
983
+				if (!$output->toBool())
984 984
 				{
985 985
 					$oDB->rollback();
986 986
 					return $output;
@@ -993,14 +993,14 @@  discard block
 block discarded – undo
993 993
 	private function _recursiveDeleteMenuItem(&$oDB, &$menuInfo, $node)
994 994
 	{
995 995
 		$output = $this->_deleteMenuItem($oDB, $menuInfo, $node);
996
-		if(!$output->toBool())
996
+		if (!$output->toBool())
997 997
 		{
998 998
 			return new Object(-1, $output->message);
999 999
 		}
1000 1000
 
1001
-		if(is_array($node['list']))
1001
+		if (is_array($node['list']))
1002 1002
 		{
1003
-			foreach($node['list'] AS $key=>$value)
1003
+			foreach ($node['list'] AS $key=>$value)
1004 1004
 			{
1005 1005
 				$this->_recursiveDeleteMenuItem($oDB, $menuInfo, $value);
1006 1006
 			}
@@ -1013,31 +1013,31 @@  discard block
 block discarded – undo
1013 1013
 	 */
1014 1014
 	function procMenuAdminMoveItem()
1015 1015
 	{
1016
-		$mode = Context::get('mode');	//move
1017
-		$parent_srl = Context::get('parent_srl');	// Parent menu item serial number
1018
-		$source_srl = Context::get('source_srl');	// Same hierarchy's menu item serial number
1019
-		$target_srl = Context::get('target_srl');	// Self menu item serial number
1016
+		$mode = Context::get('mode'); //move
1017
+		$parent_srl = Context::get('parent_srl'); // Parent menu item serial number
1018
+		$source_srl = Context::get('source_srl'); // Same hierarchy's menu item serial number
1019
+		$target_srl = Context::get('target_srl'); // Self menu item serial number
1020 1020
 
1021
-		if(!$mode || !$parent_srl || !$target_srl) return new Object(-1,'msg_invalid_request');
1021
+		if (!$mode || !$parent_srl || !$target_srl) return new Object(-1, 'msg_invalid_request');
1022 1022
 
1023 1023
 		$oMenuAdminModel = getAdminModel('menu');
1024 1024
 
1025 1025
 		// get original menu item info for cache file recreate
1026 1026
 		$originalItemInfo = $oMenuAdminModel->getMenuItemInfo($target_srl);
1027
-		if(!$originalItemInfo->menu_item_srl)
1027
+		if (!$originalItemInfo->menu_item_srl)
1028 1028
 		{
1029 1029
 			return new Object(-1, 'msg_empty_menu_item');
1030 1030
 		}
1031 1031
 
1032 1032
 		// get menu properies with child menu
1033
-		$phpFile = sprintf(_XE_PATH_ . "files/cache/menu/%s.php", $originalItemInfo->menu_srl);
1033
+		$phpFile = sprintf(_XE_PATH_."files/cache/menu/%s.php", $originalItemInfo->menu_srl);
1034 1034
 		$originMenu = NULL;
1035 1035
 
1036
-		if(is_readable(FileHandler::getRealPath($phpFile)))
1036
+		if (is_readable(FileHandler::getRealPath($phpFile)))
1037 1037
 		{
1038 1038
 			include(FileHandler::getRealPath($phpFile));
1039 1039
 
1040
-			if(is_array($menu->list))
1040
+			if (is_array($menu->list))
1041 1041
 			{
1042 1042
 				$this->_searchMenu($menu->list, $originalItemInfo->menu_item_srl, $originMenu);
1043 1043
 			}
@@ -1046,7 +1046,7 @@  discard block
 block discarded – undo
1046 1046
 		// get target menu info for move
1047 1047
 		$targetMenuItemInfo = $oMenuAdminModel->getMenuItemInfo($parent_srl);
1048 1048
 		// if move in same sitemap
1049
-		if($targetMenuItemInfo->menu_item_srl)
1049
+		if ($targetMenuItemInfo->menu_item_srl)
1050 1050
 		{
1051 1051
 			$menu_srl = $targetMenuItemInfo->menu_srl;
1052 1052
 		}
@@ -1058,20 +1058,20 @@  discard block
 block discarded – undo
1058 1058
 			$parent_srl = 0;
1059 1059
 		}
1060 1060
 
1061
-		if(!$this->homeModuleMid)
1061
+		if (!$this->homeModuleMid)
1062 1062
 		{
1063 1063
 			$oModuleModel = getModel('module');
1064 1064
 			$oMenuAdminController = getAdminController('menu');
1065 1065
 			$columnList = array('modules.mid',);
1066 1066
 			$output = $oModuleModel->getSiteInfo(0, $columnList);
1067
-			if($output->mid)
1067
+			if ($output->mid)
1068 1068
 			{
1069 1069
 				$this->homeModuleMid = $output->mid;
1070 1070
 			}
1071 1071
 		}
1072 1072
 
1073 1073
 		$this->moveMenuItem($menu_srl, $parent_srl, $source_srl, $target_srl, $mode, $originMenu['is_shortcut'], $originMenu['url']);
1074
-		if(count($originMenu['list']) > 0)
1074
+		if (count($originMenu['list']) > 0)
1075 1075
 		{
1076 1076
 			$this->_recursiveUpdateMenuItem($originMenu['list'], $menu_srl);
1077 1077
 		}
@@ -1085,9 +1085,9 @@  discard block
 block discarded – undo
1085 1085
 
1086 1086
 	private function _recursiveUpdateMenuItem($node, $menu_srl)
1087 1087
 	{
1088
-		if(is_array($node))
1088
+		if (is_array($node))
1089 1089
 		{
1090
-			foreach($node AS $key=>$node)
1090
+			foreach ($node AS $key=>$node)
1091 1091
 			{
1092 1092
 				$args = new stdClass();
1093 1093
 				$args->menu_srl = $menu_srl;
@@ -1095,11 +1095,11 @@  discard block
 block discarded – undo
1095 1095
 				$output = $this->_updateMenuItem($args);
1096 1096
 
1097 1097
 				//module's menu_srl move also
1098
-				if($node['is_shortcut'] == 'N' && !empty($node['url']))
1098
+				if ($node['is_shortcut'] == 'N' && !empty($node['url']))
1099 1099
 				{
1100 1100
 					$oModuleModel = getModel('module');
1101 1101
 					$moduleInfo = $oModuleModel->getModuleInfoByMid($node['url']);
1102
-					if($menu_srl != $moduleInfo->menu_srl)
1102
+					if ($menu_srl != $moduleInfo->menu_srl)
1103 1103
 					{
1104 1104
 						$moduleInfo->menu_srl = $menu_srl;
1105 1105
 						$oModuleController = getController('module');
@@ -1107,7 +1107,7 @@  discard block
 block discarded – undo
1107 1107
 					}
1108 1108
 				}
1109 1109
 
1110
-				if(count($node['list']) > 0)
1110
+				if (count($node['list']) > 0)
1111 1111
 				{
1112 1112
 					$this->_recursiveUpdateMenuItem($node['list'], $menu_srl);
1113 1113
 				}
@@ -1129,21 +1129,21 @@  discard block
 block discarded – undo
1129 1129
 		$menuSrl = $itemInfo->menu_srl;
1130 1130
 
1131 1131
 		// get menu properies with child menu
1132
-		$phpFile = sprintf(_XE_PATH_ . "files/cache/menu/%s.php", $menuSrl);
1132
+		$phpFile = sprintf(_XE_PATH_."files/cache/menu/%s.php", $menuSrl);
1133 1133
 		$originMenu = NULL;
1134 1134
 
1135
-		if(is_readable(FileHandler::getRealPath($phpFile)))
1135
+		if (is_readable(FileHandler::getRealPath($phpFile)))
1136 1136
 		{
1137 1137
 			include(FileHandler::getRealPath($phpFile));
1138 1138
 
1139
-			if(is_array($menu->list))
1139
+			if (is_array($menu->list))
1140 1140
 			{
1141 1141
 				$this->_searchMenu($menu->list, $menuItemSrl, $originMenu);
1142 1142
 			}
1143 1143
 		}
1144 1144
 
1145 1145
 		// copy the menu item with recursively
1146
-		if(is_array($originMenu))
1146
+		if (is_array($originMenu))
1147 1147
 		{
1148 1148
 			$this->_copyMenu($menuSrl, $parentSrl, $originMenu);
1149 1149
 		}
@@ -1159,15 +1159,15 @@  discard block
 block discarded – undo
1159 1159
 	 */
1160 1160
 	private function _searchMenu(&$menuList, $menuItemSrl, &$originMenu)
1161 1161
 	{
1162
-		if(array_key_exists($menuItemSrl, $menuList))
1162
+		if (array_key_exists($menuItemSrl, $menuList))
1163 1163
 		{
1164 1164
 			$originMenu = $menuList[$menuItemSrl];
1165 1165
 			return;
1166 1166
 		}
1167 1167
 
1168
-		foreach($menuList AS $key=>$value)
1168
+		foreach ($menuList AS $key=>$value)
1169 1169
 		{
1170
-			if(count($value['list']) > 0)
1170
+			if (count($value['list']) > 0)
1171 1171
 			{
1172 1172
 				$this->_searchMenu($value['list'], $menuItemSrl, $originMenu);
1173 1173
 			}
@@ -1182,7 +1182,7 @@  discard block
 block discarded – undo
1182 1182
 		// default argument setting
1183 1183
 		$args = new stdClass();
1184 1184
 		$args->menu_srl = $menuSrl;
1185
-		if($parentSrl == 0) $args->parent_srl = $menuSrl;
1185
+		if ($parentSrl == 0) $args->parent_srl = $menuSrl;
1186 1186
 		else $args->parent_srl = $parentSrl;
1187 1187
 		$args->menu_name_key = $originMenu['text'];
1188 1188
 		$args->menu_name = $originMenu['text'];
@@ -1195,7 +1195,7 @@  discard block
 block discarded – undo
1195 1195
 
1196 1196
 		$isModuleCopySuccess = false;
1197 1197
 		// if menu have a reference of module instance
1198
-		if($menuItemInfo->is_shortcut == 'N' && strncasecmp('http', $originMenu['url'], 4) !== 0 )
1198
+		if ($menuItemInfo->is_shortcut == 'N' && strncasecmp('http', $originMenu['url'], 4) !== 0)
1199 1199
 		{
1200 1200
 			$oModuleModel = getModel('module');
1201 1201
 			$moduleInfo = $oModuleModel->getModuleInfoByMid($originMenu['url']);
@@ -1215,22 +1215,22 @@  discard block
 block discarded – undo
1215 1215
 
1216 1216
 			$args->module_srl = $copiedModuleSrl;
1217 1217
 
1218
-			if($copiedModuleSrl)
1218
+			if ($copiedModuleSrl)
1219 1219
 			{
1220 1220
 				$isModuleCopySuccess = true;
1221 1221
 			}
1222 1222
 		}
1223 1223
 		// if menu type is shortcut
1224
-		else if($menuItemInfo->is_shortcut == 'Y')
1224
+		else if ($menuItemInfo->is_shortcut == 'Y')
1225 1225
 		{
1226 1226
 			$args->shortcut_target = $originMenu['url'];
1227 1227
 			$isModuleCopySuccess = true;
1228 1228
 		}
1229 1229
 
1230
-		if($isModuleCopySuccess)
1230
+		if ($isModuleCopySuccess)
1231 1231
 		{
1232 1232
 			// if have a group permission
1233
-			if($menuItemInfo->group_srls)
1233
+			if ($menuItemInfo->group_srls)
1234 1234
 			{
1235 1235
 				$args->group_srls = $menuItemInfo->group_srls;
1236 1236
 			}
@@ -1244,12 +1244,12 @@  discard block
 block discarded – undo
1244 1244
 
1245 1245
 			// if have a button, copy a button image also
1246 1246
 			$insertedMenuItemSrl = $this->get('menu_item_srl');
1247
-			if($menuItemInfo->normal_btn || $menuItemInfo->hover_btn || $menuItemInfo->active_btn)
1247
+			if ($menuItemInfo->normal_btn || $menuItemInfo->hover_btn || $menuItemInfo->active_btn)
1248 1248
 			{
1249 1249
 				// copy & upate
1250 1250
 				$update_item_info = $oMenuAdminModel->getMenuItemInfo($insertedMenuItemSrl);
1251
-				$copied_info = $this->_copyButton($insertedMenuItemSrl,$update_item_info->menu_srl, $menuItemInfo);
1252
-				if(count($update_item_info->group_srls) == 0)
1251
+				$copied_info = $this->_copyButton($insertedMenuItemSrl, $update_item_info->menu_srl, $menuItemInfo);
1252
+				if (count($update_item_info->group_srls) == 0)
1253 1253
 				{
1254 1254
 					unset($update_item_info->group_srls);
1255 1255
 				}
@@ -1263,7 +1263,7 @@  discard block
 block discarded – undo
1263 1263
 
1264 1264
 		// if have a child menu, copy child menu also
1265 1265
 		$childMenu = array_shift($originMenu['list']);
1266
-		if(count($childMenu) > 0)
1266
+		if (count($childMenu) > 0)
1267 1267
 		{
1268 1268
 			$this->_copyMenu($menuSrl, $insertedMenuItemSrl, $childMenu);
1269 1269
 		}
@@ -1273,10 +1273,10 @@  discard block
 block discarded – undo
1273 1273
 	{
1274 1274
 		$time = $_SERVER['REQUEST_TIME'];
1275 1275
 		$randomString = "";
1276
-		for($i=0;$i<4;$i++)
1276
+		for ($i = 0; $i < 4; $i++)
1277 1277
 		{
1278 1278
 			$case = rand(0, 1);
1279
-			if($case) $doc = rand(65, 90);
1279
+			if ($case) $doc = rand(65, 90);
1280 1280
 			else $doc = rand(97, 122);
1281 1281
 
1282 1282
 			$randomString .= chr($doc);
@@ -1300,32 +1300,32 @@  discard block
 block discarded – undo
1300 1300
 		// menu name update
1301 1301
 		$args->menu_srl = $this->menuSrl;
1302 1302
 		$output = executeQuery('menu.updateMenu', $args);
1303
-		if(!$output->toBool()) return $output;
1303
+		if (!$output->toBool()) return $output;
1304 1304
 
1305 1305
 		$this->map = array();
1306
-		if(is_array($parentKeyList))
1306
+		if (is_array($parentKeyList))
1307 1307
 		{
1308
-			foreach($parentKeyList as $no=>$srl)
1308
+			foreach ($parentKeyList as $no=>$srl)
1309 1309
 			{
1310
-				if($srl === 0) continue;
1311
-				if(!is_array($this->map[$srl]))$this->map[$srl] = array();
1310
+				if ($srl === 0) continue;
1311
+				if (!is_array($this->map[$srl]))$this->map[$srl] = array();
1312 1312
 				$this->map[$srl][] = $no;
1313 1313
 			}
1314 1314
 		}
1315 1315
 
1316 1316
 		$result = array();
1317
-		if(is_array($this->itemKeyList))
1317
+		if (is_array($this->itemKeyList))
1318 1318
 		{
1319
-			foreach($this->itemKeyList as $srl)
1319
+			foreach ($this->itemKeyList as $srl)
1320 1320
 			{
1321
-				if(!$this->checked[$srl])
1321
+				if (!$this->checked[$srl])
1322 1322
 				{
1323 1323
 					$target = new stdClass();
1324 1324
 					$this->checked[$srl] = 1;
1325 1325
 					$target->node = $srl;
1326
-					$target->child= array();
1326
+					$target->child = array();
1327 1327
 
1328
-					while(count($this->map[$srl]))
1328
+					while (count($this->map[$srl]))
1329 1329
 					{
1330 1330
 						$this->_setParent($srl, array_shift($this->map[$srl]), $target);
1331 1331
 					}
@@ -1334,13 +1334,13 @@  discard block
 block discarded – undo
1334 1334
 			}
1335 1335
 		}
1336 1336
 
1337
-		if(is_array($result))
1337
+		if (is_array($result))
1338 1338
 		{
1339 1339
 			$i = 0;
1340
-			foreach($result AS $key=>$node)
1340
+			foreach ($result AS $key=>$node)
1341 1341
 			{
1342
-				$this->moveMenuItem($this->menuSrl, 0, $i, $node->node, 'move');	//move parent node
1343
-				$this->_recursiveMoveMenuItem($node);	//move child node
1342
+				$this->moveMenuItem($this->menuSrl, 0, $i, $node->node, 'move'); //move parent node
1343
+				$this->_recursiveMoveMenuItem($node); //move child node
1344 1344
 				$i = $node->node;
1345 1345
 			}
1346 1346
 		}
@@ -1369,7 +1369,7 @@  discard block
 block discarded – undo
1369 1369
 		$child_node->child = array();
1370 1370
 		$target->child[] = $child_node;
1371 1371
 
1372
-		while(count($this->map[$child_srl]))
1372
+		while (count($this->map[$child_srl]))
1373 1373
 		{
1374 1374
 			$this->_setParent($child_srl, array_shift($this->map[$child_srl]), $child_node);
1375 1375
 		}
@@ -1384,7 +1384,7 @@  discard block
 block discarded – undo
1384 1384
 	function _recursiveMoveMenuItem($result)
1385 1385
 	{
1386 1386
 		$i = 0;
1387
-		while(count($result->child))
1387
+		while (count($result->child))
1388 1388
 		{
1389 1389
 			unset($node);
1390 1390
 			$node = array_shift($result->child);
@@ -1404,48 +1404,48 @@  discard block
 block discarded – undo
1404 1404
 	 * @param string $mode 'move' or 'insert'
1405 1405
 	 * @return void
1406 1406
 	 */
1407
-	function moveMenuItem($menu_srl, $parent_srl, $source_srl, $target_srl, $mode, $isShortcut='Y', $url=NULL)
1407
+	function moveMenuItem($menu_srl, $parent_srl, $source_srl, $target_srl, $mode, $isShortcut = 'Y', $url = NULL)
1408 1408
 	{
1409 1409
 		// Get the original menus
1410 1410
 		$oMenuAdminModel = getAdminModel('menu');
1411 1411
 
1412 1412
 		$target_item = $oMenuAdminModel->getMenuItemInfo($target_srl);
1413
-		if($target_item->menu_item_srl != $target_srl) return new Object(-1,'msg_invalid_request');
1413
+		if ($target_item->menu_item_srl != $target_srl) return new Object(-1, 'msg_invalid_request');
1414 1414
 		// Move the menu location(change the order menu appears)
1415
-		if($mode == 'move')
1415
+		if ($mode == 'move')
1416 1416
 		{
1417 1417
 			$args = new stdClass();
1418 1418
 			$args->parent_srl = $parent_srl;
1419 1419
 			$args->menu_srl = $menu_srl;
1420 1420
 
1421
-			if($source_srl)
1421
+			if ($source_srl)
1422 1422
 			{
1423 1423
 				$source_item = $oMenuAdminModel->getMenuItemInfo($source_srl);
1424
-				if($source_item->menu_item_srl != $source_srl) return new Object(-1,'msg_invalid_request');
1425
-				$args->listorder = $source_item->listorder-1;
1424
+				if ($source_item->menu_item_srl != $source_srl) return new Object(-1, 'msg_invalid_request');
1425
+				$args->listorder = $source_item->listorder - 1;
1426 1426
 			}
1427 1427
 			else
1428 1428
 			{
1429 1429
 				$output = executeQuery('menu.getMaxListorder', $args);
1430
-				if(!$output->toBool()) return $output;
1431
-				$args->listorder = (int)$output->data->listorder;
1432
-				if(!$args->listorder) $args->listorder= 0;
1430
+				if (!$output->toBool()) return $output;
1431
+				$args->listorder = (int) $output->data->listorder;
1432
+				if (!$args->listorder) $args->listorder = 0;
1433 1433
 			}
1434 1434
 			$args->parent_srl = $parent_srl;
1435 1435
 			$output = executeQuery('menu.updateMenuItemListorder', $args);
1436
-			if(!$output->toBool()) return $output;
1436
+			if (!$output->toBool()) return $output;
1437 1437
 
1438 1438
 			$args->parent_srl = $parent_srl;
1439 1439
 			$args->menu_item_srl = $target_srl;
1440 1440
 			$output = executeQuery('menu.updateMenuItemNode', $args);
1441
-			if(!$output->toBool()) return $output;
1441
+			if (!$output->toBool()) return $output;
1442 1442
 
1443 1443
 			//module's menu_srl move also
1444
-			if($isShortcut == 'N' && !empty($url))
1444
+			if ($isShortcut == 'N' && !empty($url))
1445 1445
 			{
1446 1446
 				$oModuleModel = getModel('module');
1447 1447
 				$moduleInfo = $oModuleModel->getModuleInfoByMid($url);
1448
-				if($menu_srl != $moduleInfo->menu_srl)
1448
+				if ($menu_srl != $moduleInfo->menu_srl)
1449 1449
 				{
1450 1450
 					$moduleInfo->menu_srl = $menu_srl;
1451 1451
 					$oModuleController = getController('module');
@@ -1453,13 +1453,13 @@  discard block
 block discarded – undo
1453 1453
 				}
1454 1454
 
1455 1455
 				// change home menu cache file
1456
-				if($url == $this->homeModuleMid)
1456
+				if ($url == $this->homeModuleMid)
1457 1457
 				{
1458
-					if(file_exists($this->homeMenuCacheFile))
1458
+					if (file_exists($this->homeMenuCacheFile))
1459 1459
 					{
1460 1460
 						include($this->homeMenuCacheFile);
1461 1461
 					}
1462
-					if(!$homeMenuSrl || $homeMenuSrl != $menu_srl)
1462
+					if (!$homeMenuSrl || $homeMenuSrl != $menu_srl)
1463 1463
 					{
1464 1464
 						$this->makeHomemenuCacheFile($menu_srl);
1465 1465
 					}
@@ -1467,13 +1467,13 @@  discard block
 block discarded – undo
1467 1467
 			}
1468 1468
 			// Add a child
1469 1469
 		}
1470
-		elseif($mode == 'insert')
1470
+		elseif ($mode == 'insert')
1471 1471
 		{
1472 1472
 			$args->menu_item_srl = $target_srl;
1473 1473
 			$args->parent_srl = $parent_srl;
1474
-			$args->listorder = -1*getNextSequence();
1474
+			$args->listorder = -1 * getNextSequence();
1475 1475
 			$output = executeQuery('menu.updateMenuItemNode', $args);
1476
-			if(!$output->toBool()) return $output;
1476
+			if (!$output->toBool()) return $output;
1477 1477
 		}
1478 1478
 
1479 1479
 		$xml_file = $this->makeXmlFile($menu_srl);
@@ -1498,8 +1498,8 @@  discard block
 block discarded – undo
1498 1498
 		// Re-generate the xml file
1499 1499
 		$xml_file = $this->makeXmlFile($menu_srl);
1500 1500
 		// Set return value
1501
-		$this->add('menu_title',$menu_title);
1502
-		$this->add('xml_file',$xml_file);
1501
+		$this->add('menu_title', $menu_title);
1502
+		$this->add('xml_file', $xml_file);
1503 1503
 	}
1504 1504
 
1505 1505
 	/**
@@ -1513,12 +1513,12 @@  discard block
 block discarded – undo
1513 1513
 		$target = Context::get('target');
1514 1514
 		$target_file = Context::get($target);
1515 1515
 		// Error occurs when the target is neither a uploaded file nor a valid file
1516
-		if(!$menu_srl || !$menu_item_srl)
1516
+		if (!$menu_srl || !$menu_item_srl)
1517 1517
 		{
1518 1518
 			Context::set('error_messge', Context::getLang('msg_invalid_request'));
1519 1519
 
1520 1520
 		}
1521
-		else if(!$target_file || !is_uploaded_file($target_file['tmp_name']) || !preg_match('/\.(gif|jpeg|jpg|png)$/i',$target_file['name'])  || !checkUploadedFile($target_file['tmp_name']))
1521
+		else if (!$target_file || !is_uploaded_file($target_file['tmp_name']) || !preg_match('/\.(gif|jpeg|jpg|png)$/i', $target_file['name']) || !checkUploadedFile($target_file['tmp_name']))
1522 1522
 		{
1523 1523
 			Context::set('error_messge', Context::getLang('msg_invalid_request'));
1524 1524
 		}
@@ -1526,13 +1526,13 @@  discard block
 block discarded – undo
1526 1526
 		// Move the file to a specific director if the uploaded file meets requirement
1527 1527
 		else
1528 1528
 		{
1529
-			$tmp_arr = explode('.',$target_file['name']);
1530
-			$ext = $tmp_arr[count($tmp_arr)-1];
1529
+			$tmp_arr = explode('.', $target_file['name']);
1530
+			$ext = $tmp_arr[count($tmp_arr) - 1];
1531 1531
 
1532 1532
 			$path = sprintf('./files/attach/menu_button/%d/', $menu_srl);
1533 1533
 			$filename = sprintf('%s%d.%s.%s', $path, $menu_item_srl, $target, $ext);
1534 1534
 
1535
-			if(!is_dir($path)) FileHandler::makeDir($path);
1535
+			if (!is_dir($path)) FileHandler::makeDir($path);
1536 1536
 
1537 1537
 			move_uploaded_file($target_file['tmp_name'], $filename);
1538 1538
 			Context::set('filename', $filename);
@@ -1565,14 +1565,14 @@  discard block
 block discarded – undo
1565 1565
 	{
1566 1566
 		$oModuleModel = getModel('module');
1567 1567
 		$installed_module_list = $oModuleModel->getModulesXmlInfo();
1568
-		if(is_array($installed_module_list))
1568
+		if (is_array($installed_module_list))
1569 1569
 		{
1570 1570
 			$currentLang = Context::getLangType();
1571 1571
 			$menuList = array();
1572
-			foreach($installed_module_list AS $key=>$value)
1572
+			foreach ($installed_module_list AS $key=>$value)
1573 1573
 			{
1574 1574
 				$info = $oModuleModel->getModuleActionXml($value->module);
1575
-				if($info->menu) $menuList[$value->module] = $info->menu;
1575
+				if ($info->menu) $menuList[$value->module] = $info->menu;
1576 1576
 				unset($info->menu);
1577 1577
 			}
1578 1578
 		}
@@ -1604,8 +1604,8 @@  discard block
 block discarded – undo
1604 1604
 		$info = $oModuleModel->getModuleActionXml($moduleName);
1605 1605
 
1606 1606
 		$url = getNotEncodedFullUrl('', 'module', 'admin', 'act', $info->menu->{$menuName}->index);
1607
-		if(empty($url)) $url = getNotEncodedFullUrl('', 'module', 'admin', 'act', $info->admin_index_act);
1608
-		if(empty($url)) $url = getNotEncodedFullUrl('', 'module', 'admin');
1607
+		if (empty($url)) $url = getNotEncodedFullUrl('', 'module', 'admin', 'act', $info->admin_index_act);
1608
+		if (empty($url)) $url = getNotEncodedFullUrl('', 'module', 'admin');
1609 1609
 		$dbInfo = Context::getDBInfo();
1610 1610
 
1611 1611
 		$args = new stdClass();
@@ -1614,7 +1614,7 @@  discard block
 block discarded – undo
1614 1614
 		$args->menu_srl = $requestArgs->menu_srl;
1615 1615
 		$args->name = sprintf('{$lang->menu_gnb_sub[\'%s\']}', $menuName);
1616 1616
 		//if now page is https...
1617
-		if(strpos($url, 'https') !== false)
1617
+		if (strpos($url, 'https') !== false)
1618 1618
 		{
1619 1619
 			$args->url = str_replace('https'.substr($dbInfo->default_url, 4), '', $url);
1620 1620
 		}
@@ -1628,23 +1628,23 @@  discard block
 block discarded – undo
1628 1628
 		$args->hover_btn = '';
1629 1629
 		$args->active_btn = '';
1630 1630
 		$args->group_srls = implode(',', array_keys($groupSrlList));
1631
-		$args->listorder = -1*$args->menu_item_srl;
1631
+		$args->listorder = -1 * $args->menu_item_srl;
1632 1632
 
1633 1633
 		// Check if already exists
1634 1634
 		$oMenuModel = getAdminModel('menu');
1635 1635
 		$item_info = $oMenuModel->getMenuItemInfo($args->menu_item_srl);
1636 1636
 		// Update if exists
1637
-		if($item_info->menu_item_srl == $args->menu_item_srl)
1637
+		if ($item_info->menu_item_srl == $args->menu_item_srl)
1638 1638
 		{
1639 1639
 			$output = $this->_updateMenuItem($args);
1640
-			if(!$output->toBool()) return $output;
1640
+			if (!$output->toBool()) return $output;
1641 1641
 		}
1642 1642
 		// Insert if not exist
1643 1643
 		else
1644 1644
 		{
1645
-			$args->listorder = -1*$args->menu_item_srl;
1645
+			$args->listorder = -1 * $args->menu_item_srl;
1646 1646
 			$output = executeQuery('menu.insertMenuItem', $args);
1647
-			if(!$output->toBool()) return $output;
1647
+			if (!$output->toBool()) return $output;
1648 1648
 		}
1649 1649
 		// Get information of the menu
1650 1650
 		$menu_info = $oMenuModel->getMenu($args->menu_srl);
@@ -1672,23 +1672,23 @@  discard block
 block discarded – undo
1672 1672
 
1673 1673
 		// Menu Exposure update
1674 1674
 		// if exposure target is only login user...
1675
-		if(!$exposure)
1675
+		if (!$exposure)
1676 1676
 		{
1677 1677
 			$args->group_srls = '';
1678 1678
 		}
1679 1679
 		else
1680 1680
 		{
1681 1681
 			$exposure = explode(',', $exposure);
1682
-			if(in_array($exposure, array('-1','-3')))
1682
+			if (in_array($exposure, array('-1', '-3')))
1683 1683
 			{
1684 1684
 				$args->group_srls = $exposure;
1685 1685
 			}
1686 1686
 
1687
-			if($exposure) $args->group_srls = implode(',', $exposure);
1687
+			if ($exposure) $args->group_srls = implode(',', $exposure);
1688 1688
 		}
1689 1689
 
1690 1690
 		$output = $this->_updateMenuItem($args);
1691
-		if(!$output->toBool())
1691
+		if (!$output->toBool())
1692 1692
 		{
1693 1693
 			return $output;
1694 1694
 		}
@@ -1704,7 +1704,7 @@  discard block
 block discarded – undo
1704 1704
 		$xml_info = $oModuleModel->getModuleActionXML($moduleInfo->module);
1705 1705
 
1706 1706
 		$grantList = $xml_info->grant;
1707
-		if(!$grantList) $grantList = new stdClass;
1707
+		if (!$grantList) $grantList = new stdClass;
1708 1708
 
1709 1709
 		$grantList->access = new stdClass();
1710 1710
 		$grantList->access->default = 'guest';
@@ -1712,9 +1712,9 @@  discard block
 block discarded – undo
1712 1712
 		$grantList->manager->default = 'manager';
1713 1713
 
1714 1714
 		$grant = new stdClass;
1715
-		foreach($grantList AS $grantName=>$grantInfo)
1715
+		foreach ($grantList AS $grantName=>$grantInfo)
1716 1716
 		{
1717
-			if(!$htPerm[$grantName])
1717
+			if (!$htPerm[$grantName])
1718 1718
 			{
1719 1719
 				continue;
1720 1720
 			}
@@ -1722,7 +1722,7 @@  discard block
 block discarded – undo
1722 1722
 			$htPerm[$grantName] = explode(',', $htPerm[$grantName]);
1723 1723
 
1724 1724
 			// users in a particular group
1725
-			if(is_array($htPerm[$grantName]))
1725
+			if (is_array($htPerm[$grantName]))
1726 1726
 			{
1727 1727
 				$grant->{$grantName} = $htPerm[$grantName];
1728 1728
 				continue;
@@ -1736,7 +1736,7 @@  discard block
 block discarded – undo
1736 1736
 			$grant->{$group_srls} = array();
1737 1737
 		}
1738 1738
 
1739
-		if(count($grant))
1739
+		if (count($grant))
1740 1740
 		{
1741 1741
 			$oModuleController = getController('module');
1742 1742
 			$oModuleController->insertModuleGrants($moduleInfo->module_srl, $grant);
@@ -1754,15 +1754,15 @@  discard block
 block discarded – undo
1754 1754
 	function makeXmlFile($menu_srl)
1755 1755
 	{
1756 1756
 		// Return if there is no information when creating the xml file
1757
-		if(!$menu_srl) return;
1757
+		if (!$menu_srl) return;
1758 1758
 		// Get menu informaton
1759 1759
 		$args = new stdClass();
1760 1760
 		$args->menu_srl = $menu_srl;
1761 1761
 		$output = executeQuery('menu.getMenu', $args);
1762
-		if(!$output->toBool() || !$output->data) return $output;
1763
-		$site_srl = (int)$output->data->site_srl;
1762
+		if (!$output->toBool() || !$output->data) return $output;
1763
+		$site_srl = (int) $output->data->site_srl;
1764 1764
 
1765
-		if($site_srl)
1765
+		if ($site_srl)
1766 1766
 		{
1767 1767
 			$oModuleModel = getModel('module');
1768 1768
 			$columnList = array('sites.domain');
@@ -1773,13 +1773,13 @@  discard block
 block discarded – undo
1773 1773
 		$args->menu_srl = $menu_srl;
1774 1774
 		$args->sort_index = 'listorder';
1775 1775
 		$output = executeQuery('menu.getMenuItems', $args);
1776
-		if(!$output->toBool()) return;
1776
+		if (!$output->toBool()) return;
1777 1777
 		// Specify the name of the cache file
1778
-		$xml_file = sprintf(_XE_PATH_ . "files/cache/menu/%s.xml.php", $menu_srl);
1779
-		$php_file = sprintf(_XE_PATH_ . "files/cache/menu/%s.php", $menu_srl);
1778
+		$xml_file = sprintf(_XE_PATH_."files/cache/menu/%s.xml.php", $menu_srl);
1779
+		$php_file = sprintf(_XE_PATH_."files/cache/menu/%s.php", $menu_srl);
1780 1780
 		// If no data found, generate an XML file without node data
1781 1781
 		$list = $output->data;
1782
-		if(!$list)
1782
+		if (!$list)
1783 1783
 		{
1784 1784
 			$xml_buff = "<root />";
1785 1785
 			FileHandler::writeFile($xml_file, $xml_buff);
@@ -1787,10 +1787,10 @@  discard block
 block discarded – undo
1787 1787
 			return $xml_file;
1788 1788
 		}
1789 1789
 		// Change to an array if only a single data is obtained
1790
-		if(!is_array($list)) $list = array($list);
1790
+		if (!is_array($list)) $list = array($list);
1791 1791
 		// Create a tree for loop
1792 1792
 		$list_count = count($list);
1793
-		for($i=0;$i<$list_count;$i++)
1793
+		for ($i = 0; $i < $list_count; $i++)
1794 1794
 		{
1795 1795
 			$node = $list[$i];
1796 1796
 			$menu_item_srl = $node->menu_item_srl;
@@ -1846,7 +1846,7 @@  discard block
 block discarded – undo
1846 1846
 		$php_buff = sprintf(
1847 1847
 			'<?php '.
1848 1848
 			'if(!defined("__XE__")) exit(); '.
1849
-			'$menu = new stdClass();' .
1849
+			'$menu = new stdClass();'.
1850 1850
 			'%s; '.
1851 1851
 			'%s; '.
1852 1852
 			'$menu->list = array(%s); '.
@@ -1875,26 +1875,26 @@  discard block
 block discarded – undo
1875 1875
 	 */
1876 1876
 	function getXmlTree($source_node, $tree, $site_srl, $domain)
1877 1877
 	{
1878
-		if(!$source_node) return;
1878
+		if (!$source_node) return;
1879 1879
 
1880 1880
 		$oMenuAdminModel = getAdminModel('menu');
1881 1881
 
1882
-		foreach($source_node as $menu_item_srl => $node)
1882
+		foreach ($source_node as $menu_item_srl => $node)
1883 1883
 		{
1884 1884
 			$child_buff = "";
1885 1885
 			// Get data of the child nodes
1886
-			if($menu_item_srl&&$tree[$menu_item_srl]) $child_buff = $this->getXmlTree($tree[$menu_item_srl], $tree, $site_srl, $domain);
1886
+			if ($menu_item_srl && $tree[$menu_item_srl]) $child_buff = $this->getXmlTree($tree[$menu_item_srl], $tree, $site_srl, $domain);
1887 1887
 			// List variables
1888 1888
 			$names = $oMenuAdminModel->getMenuItemNames($node->name, $site_srl);
1889
-			foreach($names as $key => $val)
1889
+			foreach ($names as $key => $val)
1890 1890
 			{
1891
-				$name_arr_str .= sprintf('"%s"=>\'%s\',',$key, str_replace(array('\\', '\''), array('\\\\', '\\\''), $val));
1891
+				$name_arr_str .= sprintf('"%s"=>\'%s\',', $key, str_replace(array('\\', '\''), array('\\\\', '\\\''), $val));
1892 1892
 			}
1893 1893
 			$name_str = sprintf('$_names = array(%s); print $_names[$lang_type];', $name_arr_str);
1894 1894
 
1895
-			$url = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->url);
1896
-			$desc = str_replace(array('&','"',"'"),array('&amp;','&quot;','\\\''),$node->desc);
1897
-			if(preg_match('/^([0-9a-zA-Z\_\-]+)$/', $node->url))
1895
+			$url = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $node->url);
1896
+			$desc = str_replace(array('&', '"', "'"), array('&amp;', '&quot;', '\\\''), $node->desc);
1897
+			if (preg_match('/^([0-9a-zA-Z\_\-]+)$/', $node->url))
1898 1898
 			{
1899 1899
 				$href = "getSiteUrl('$domain', '','mid','$node->url')";
1900 1900
 			}
@@ -1904,21 +1904,21 @@  discard block
 block discarded – undo
1904 1904
 			$expand = $node->expand;
1905 1905
 
1906 1906
 			$normal_btn = $node->normal_btn;
1907
-			if($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) $normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$normal_btn);
1907
+			if ($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) $normal_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $normal_btn);
1908 1908
 			else $normal_btn = '';
1909 1909
 			$hover_btn = $node->hover_btn;
1910
-			if($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) $hover_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$hover_btn);
1910
+			if ($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) $hover_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $hover_btn);
1911 1911
 			else $hover_btn = '';
1912 1912
 			$active_btn = $node->active_btn;
1913
-			if($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) $active_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$active_btn);
1913
+			if ($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) $active_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $active_btn);
1914 1914
 			else $active_btn = '';
1915 1915
 
1916 1916
 			$group_srls = $node->group_srls;
1917 1917
 
1918
-			if($normal_btn)
1918
+			if ($normal_btn)
1919 1919
 			{
1920
-				if($hover_btn) $hover_str = sprintf('onmouseover=&quot;this.src=\'%s\'&quot;', $hover_btn); else $hover_str = '';
1921
-				if($active_btn) $active_str = sprintf('onmousedown=&quot;this.src=\'%s\'&quot;', $active_btn); else $active_str = '';
1920
+				if ($hover_btn) $hover_str = sprintf('onmouseover=&quot;this.src=\'%s\'&quot;', $hover_btn); else $hover_str = '';
1921
+				if ($active_btn) $active_str = sprintf('onmousedown=&quot;this.src=\'%s\'&quot;', $active_btn); else $active_str = '';
1922 1922
 				$link = sprintf('&lt;img src=&quot;%s&quot; onmouseout=&quot;this.src=\'%s\'&quot; alt=&quot;<?php print htmlspecialchars($_names[$lang_type], ENT_COMPAT | ENT_HTML401, \'UTF-8\', false) ?>&quot; %s %s /&gt;', $normal_btn, $normal_btn, $hover_str, $active_str);
1923 1923
 			}
1924 1924
 			else
@@ -1926,7 +1926,7 @@  discard block
 block discarded – undo
1926 1926
 				$link = '<?php print $_names[$lang_type]; ?>';
1927 1927
 			}
1928 1928
 			// If the value of node->group_srls exists
1929
-			if($group_srls)$group_check_code = sprintf('($is_admin==true||(is_array($group_srls)&&count(array_intersect($group_srls, array(%s))))||($is_logged&&%s))',$group_srls,$group_srls == -1?1:0);
1929
+			if ($group_srls)$group_check_code = sprintf('($is_admin==true||(is_array($group_srls)&&count(array_intersect($group_srls, array(%s))))||($is_logged&&%s))', $group_srls, $group_srls == -1 ? 1 : 0);
1930 1930
 			else $group_check_code = "true";
1931 1931
 			$attribute = sprintf(
1932 1932
 				'node_srl="%s" parent_srl="%s" menu_name_key=\'%s\' text="<?php if(%s) { %s }?>" url="<?php print(%s?"%s":"")?>" href="<?php print(%s?%s:"")?>" is_shortcut="%s" desc="%s" open_window="%s" expand="%s" normal_btn="%s" hover_btn="%s" active_btn="%s" link="<?php if(%s) {?>%s<?php }?>"',
@@ -1950,8 +1950,8 @@  discard block
 block discarded – undo
1950 1950
 				$link
1951 1951
 			);
1952 1952
 
1953
-			if($child_buff) $buff .= sprintf('<node %s>%s</node>', $attribute, $child_buff);
1954
-			else $buff .=  sprintf('<node %s />', $attribute);
1953
+			if ($child_buff) $buff .= sprintf('<node %s>%s</node>', $attribute, $child_buff);
1954
+			else $buff .= sprintf('<node %s />', $attribute);
1955 1955
 		}
1956 1956
 		return $buff;
1957 1957
 	}
@@ -1970,74 +1970,74 @@  discard block
 block discarded – undo
1970 1970
 	function getPhpCacheCode($source_node, $tree, $site_srl, $domain)
1971 1971
 	{
1972 1972
 		$output = array("buff"=>"", "url_list"=>array());
1973
-		if(!$source_node) return $output;
1973
+		if (!$source_node) return $output;
1974 1974
 
1975 1975
 		$oMenuAdminModel = getAdminModel('menu');
1976 1976
 
1977
-		foreach($source_node as $menu_item_srl => $node)
1977
+		foreach ($source_node as $menu_item_srl => $node)
1978 1978
 		{
1979 1979
 			// Get data from child nodes if exist.
1980
-			if($menu_item_srl&&$tree[$menu_item_srl]) $child_output = $this->getPhpCacheCode($tree[$menu_item_srl], $tree, $site_srl, $domain);
1980
+			if ($menu_item_srl && $tree[$menu_item_srl]) $child_output = $this->getPhpCacheCode($tree[$menu_item_srl], $tree, $site_srl, $domain);
1981 1981
 			else $child_output = array("buff"=>"", "url_list"=>array());
1982 1982
 			// List variables
1983 1983
 			$names = $oMenuAdminModel->getMenuItemNames($node->name, $site_srl);
1984 1984
 			unset($name_arr_str);
1985
-			foreach($names as $key => $val)
1985
+			foreach ($names as $key => $val)
1986 1986
 			{
1987
-				$name_arr_str .= sprintf('"%s"=>"%s",',$key, str_replace(array('\\','"'),array('\\\\','&quot;'),$val));
1987
+				$name_arr_str .= sprintf('"%s"=>"%s",', $key, str_replace(array('\\', '"'), array('\\\\', '&quot;'), $val));
1988 1988
 			}
1989 1989
 			$name_str = sprintf('$_menu_names[%d] = array(%s); %s', $node->menu_item_srl, $name_arr_str, $child_output['name']);
1990 1990
 			// If url value is not empty in the current node, put the value into an array url_list
1991
-			if($node->url) $child_output['url_list'][] = $node->url;
1991
+			if ($node->url) $child_output['url_list'][] = $node->url;
1992 1992
 			$output['url_list'] = array_merge($output['url_list'], $child_output['url_list']);
1993 1993
 			// If node->group_srls value exists
1994
-			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);
1994
+			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);
1995 1995
 			else $group_check_code = "true";
1996 1996
 			// List variables
1997
-			$href = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->href);
1998
-			$url = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->url);
1999
-			$desc = str_replace(array('&','"',"'"),array('&amp;','&quot;','\\\''),$node->desc);
2000
-			if(preg_match('/^([0-9a-zA-Z\_\-]+)$/i', $node->url))
1997
+			$href = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $node->href);
1998
+			$url = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $node->url);
1999
+			$desc = str_replace(array('&', '"', "'"), array('&amp;', '&quot;', '\\\''), $node->desc);
2000
+			if (preg_match('/^([0-9a-zA-Z\_\-]+)$/i', $node->url))
2001 2001
 			{
2002 2002
 				$href = "getSiteUrl('$domain', '','mid','$node->url')";
2003 2003
 			}
2004 2004
 			else $href = sprintf('"%s"', $url);
2005 2005
 			$is_shortcut = $node->is_shortcut;
2006 2006
 			$open_window = $node->open_window;
2007
-			$normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->normal_btn);
2008
-			$hover_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->hover_btn);
2009
-			$active_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->active_btn);
2007
+			$normal_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $node->normal_btn);
2008
+			$hover_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $node->hover_btn);
2009
+			$active_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $node->active_btn);
2010 2010
 
2011
-			foreach($child_output['url_list'] as $key =>$val)
2011
+			foreach ($child_output['url_list'] as $key =>$val)
2012 2012
 			{
2013 2013
 				$child_output['url_list'][$key] = addslashes($val);
2014 2014
 			}
2015 2015
 
2016
-			$selected = '"'.implode('","',$child_output['url_list']).'"';
2016
+			$selected = '"'.implode('","', $child_output['url_list']).'"';
2017 2017
 			$child_buff = $child_output['buff'];
2018 2018
 			$expand = $node->expand;
2019 2019
 
2020 2020
 			$normal_btn = $node->normal_btn;
2021
-			if($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) $normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$normal_btn);
2021
+			if ($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) $normal_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $normal_btn);
2022 2022
 			else $normal_btn = '';
2023 2023
 
2024 2024
 			$hover_btn = $node->hover_btn;
2025
-			if($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) $hover_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$hover_btn);
2025
+			if ($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) $hover_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $hover_btn);
2026 2026
 			else $hover_btn = '';
2027 2027
 
2028 2028
 			$active_btn = $node->active_btn;
2029
-			if($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) $active_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$active_btn);
2029
+			if ($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) $active_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $active_btn);
2030 2030
 			else $active_btn = '';
2031 2031
 
2032 2032
 
2033 2033
 			$group_srls = $node->group_srls;
2034 2034
 
2035
-			if($normal_btn)
2035
+			if ($normal_btn)
2036 2036
 			{
2037
-				if($hover_btn) $hover_str = sprintf('onmouseover=\"this.src=\'%s\'\"', $hover_btn); else $hover_str = '';
2038
-				if($active_btn) $active_str = sprintf('onmousedown=\"this.src=\'%s\'\"', $active_btn); else $active_str = '';
2037
+				if ($hover_btn) $hover_str = sprintf('onmouseover=\"this.src=\'%s\'\"', $hover_btn); else $hover_str = '';
2038
+				if ($active_btn) $active_str = sprintf('onmousedown=\"this.src=\'%s\'\"', $active_btn); else $active_str = '';
2039 2039
 				$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);
2040
-				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);
2040
+				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);
2041 2041
 				else $link_active = $link;
2042 2042
 			}
2043 2043
 			else
@@ -2075,7 +2075,7 @@  discard block
 block discarded – undo
2075 2075
 			);
2076 2076
 
2077 2077
 			// Generate buff data
2078
-			$output['buff'] .=  sprintf('%s=>array(%s),', $node->menu_item_srl, $attribute);
2078
+			$output['buff'] .= sprintf('%s=>array(%s),', $node->menu_item_srl, $attribute);
2079 2079
 			$output['name'] .= $name_str;
2080 2080
 		}
2081 2081
 		return $output;
@@ -2089,19 +2089,19 @@  discard block
 block discarded – undo
2089 2089
 	 */
2090 2090
 	function updateMenuLayout($layout_srl, $menu_srl_list)
2091 2091
 	{
2092
-		if(!count($menu_srl_list)) return;
2092
+		if (!count($menu_srl_list)) return;
2093 2093
 		// Delete the value of menu_srls
2094
-		$args->menu_srls = implode(',',$menu_srl_list);
2094
+		$args->menu_srls = implode(',', $menu_srl_list);
2095 2095
 		$output = executeQuery('menu.deleteMenuLayout', $args);
2096
-		if(!$output->toBool()) return $output;
2096
+		if (!$output->toBool()) return $output;
2097 2097
 
2098 2098
 		$args->layout_srl = $layout_srl;
2099 2099
 		// Mapping menu_srls, layout_srl
2100
-		for($i=0;$i<count($menu_srl_list);$i++)
2100
+		for ($i = 0; $i < count($menu_srl_list); $i++)
2101 2101
 		{
2102 2102
 			$args->menu_srl = $menu_srl_list[$i];
2103 2103
 			$output = executeQuery('menu.insertMenuLayout', $args);
2104
-			if(!$output->toBool()) return $output;
2104
+			if (!$output->toBool()) return $output;
2105 2105
 		}
2106 2106
 	}
2107 2107
 
@@ -2114,47 +2114,47 @@  discard block
 block discarded – undo
2114 2114
 	{
2115 2115
 		// path setting
2116 2116
 		$path = sprintf('./files/attach/menu_button/%d/', $args->menu_srl);
2117
-		if($args->menu_normal_btn || $args->menu_hover_btn || $args->menu_active_btn && !is_dir($path))
2117
+		if ($args->menu_normal_btn || $args->menu_hover_btn || $args->menu_active_btn && !is_dir($path))
2118 2118
 		{
2119 2119
 			FileHandler::makeDir($path);
2120 2120
 		}
2121 2121
 
2122
-		if($args->isNormalDelete == 'Y' || $args->isHoverDelete == 'Y' || $args->isActiveDelete == 'Y')
2122
+		if ($args->isNormalDelete == 'Y' || $args->isHoverDelete == 'Y' || $args->isActiveDelete == 'Y')
2123 2123
 		{
2124 2124
 			$oMenuModel = getAdminModel('menu');
2125 2125
 			$itemInfo = $oMenuModel->getMenuItemInfo($args->menu_item_srl);
2126 2126
 
2127
-			if($args->isNormalDelete == 'Y' && $itemInfo->normal_btn) FileHandler::removeFile($itemInfo->normal_btn);
2128
-			if($args->isHoverDelete == 'Y' && $itemInfo->hover_btn) FileHandler::removeFile($itemInfo->hover_btn);
2129
-			if($args->isActiveDelete == 'Y' && $itemInfo->active_btn) FileHandler::removeFile($itemInfo->active_btn);
2127
+			if ($args->isNormalDelete == 'Y' && $itemInfo->normal_btn) FileHandler::removeFile($itemInfo->normal_btn);
2128
+			if ($args->isHoverDelete == 'Y' && $itemInfo->hover_btn) FileHandler::removeFile($itemInfo->hover_btn);
2129
+			if ($args->isActiveDelete == 'Y' && $itemInfo->active_btn) FileHandler::removeFile($itemInfo->active_btn);
2130 2130
 		}
2131 2131
 
2132 2132
 		$returnArray = array();
2133 2133
 		$date = date('YmdHis');
2134 2134
 		// normal button
2135
-		if($args->menu_normal_btn)
2135
+		if ($args->menu_normal_btn)
2136 2136
 		{
2137
-			$tmp_arr = explode('.',$args->menu_normal_btn['name']);
2138
-			$ext = $tmp_arr[count($tmp_arr)-1];
2137
+			$tmp_arr = explode('.', $args->menu_normal_btn['name']);
2138
+			$ext = $tmp_arr[count($tmp_arr) - 1];
2139 2139
 
2140 2140
 			$filename = sprintf('%s%d.%s.%s.%s', $path, $args->menu_item_srl, $date, 'menu_normal_btn', $ext);
2141 2141
 
2142
-			if(checkUploadedFile($args->menu_normal_btn['tmp_name']))
2142
+			if (checkUploadedFile($args->menu_normal_btn['tmp_name']))
2143 2143
 			{
2144
-				move_uploaded_file ( $args->menu_normal_btn ['tmp_name'], $filename );
2144
+				move_uploaded_file($args->menu_normal_btn ['tmp_name'], $filename);
2145 2145
 				$returnArray ['normal_btn'] = $filename;
2146 2146
 			}
2147 2147
 		}
2148 2148
 
2149 2149
 		// hover button
2150
-		if($args->menu_hover_btn)
2150
+		if ($args->menu_hover_btn)
2151 2151
 		{
2152
-			$tmp_arr = explode('.',$args->menu_hover_btn['name']);
2153
-			$ext = $tmp_arr[count($tmp_arr)-1];
2152
+			$tmp_arr = explode('.', $args->menu_hover_btn['name']);
2153
+			$ext = $tmp_arr[count($tmp_arr) - 1];
2154 2154
 
2155 2155
 			$filename = sprintf('%s%d.%s.%s.%s', $path, $args->menu_item_srl, $date, 'menu_hover_btn', $ext);
2156 2156
 
2157
-			if(checkUploadedFile($args->menu_hover_btn['tmp_name']))
2157
+			if (checkUploadedFile($args->menu_hover_btn['tmp_name']))
2158 2158
 			{
2159 2159
 				move_uploaded_file($args->menu_hover_btn['tmp_name'], $filename);
2160 2160
 				$returnArray['hover_btn'] = $filename;
@@ -2162,14 +2162,14 @@  discard block
 block discarded – undo
2162 2162
 		}
2163 2163
 
2164 2164
 		// active button
2165
-		if($args->menu_active_btn)
2165
+		if ($args->menu_active_btn)
2166 2166
 		{
2167
-			$tmp_arr = explode('.',$args->menu_active_btn['name']);
2168
-			$ext = $tmp_arr[count($tmp_arr)-1];
2167
+			$tmp_arr = explode('.', $args->menu_active_btn['name']);
2168
+			$ext = $tmp_arr[count($tmp_arr) - 1];
2169 2169
 
2170 2170
 			$filename = sprintf('%s%d.%s.%s.%s', $path, $args->menu_item_srl, $date, 'menu_active_btn', $ext);
2171 2171
 
2172
-			if(checkUploadedFile($args->menu_active_btn['tmp_name']))
2172
+			if (checkUploadedFile($args->menu_active_btn['tmp_name']))
2173 2173
 			{
2174 2174
 				move_uploaded_file($args->menu_active_btn['tmp_name'], $filename);
2175 2175
 				$returnArray['active_btn'] = $filename;
@@ -2191,7 +2191,7 @@  discard block
 block discarded – undo
2191 2191
 			"active_btn"=>"",
2192 2192
 		);
2193 2193
 		//normal_btn
2194
-		if($menuItemInfo->normal_btn)
2194
+		if ($menuItemInfo->normal_btn)
2195 2195
 		{
2196 2196
 			$originFile = FileHandler::getRealPath($menuItemInfo->normal_btn);
2197 2197
 			$targetFile = $this->_changeMenuItemSrlInButtonPath($menuItemInfo->normal_btn, $insertedMenuSrl, $insertedMenuItemSrl, 'normal');
@@ -2201,7 +2201,7 @@  discard block
 block discarded – undo
2201 2201
 		}
2202 2202
 
2203 2203
 		//hover_btn
2204
-		if($menuItemInfo->hover_btn)
2204
+		if ($menuItemInfo->hover_btn)
2205 2205
 		{
2206 2206
 			$originFile = FileHandler::getRealPath($menuItemInfo->hover_btn);
2207 2207
 			$targetFile = $this->_changeMenuItemSrlInButtonPath($menuItemInfo->hover_btn, $insertedMenuSrl, $insertedMenuItemSrl, 'hover');
@@ -2211,7 +2211,7 @@  discard block
 block discarded – undo
2211 2211
 		}
2212 2212
 
2213 2213
 		//active_btn
2214
-		if($menuItemInfo->active_btn)
2214
+		if ($menuItemInfo->active_btn)
2215 2215
 		{
2216 2216
 			$originFile = FileHandler::getRealPath($menuItemInfo->active_btn);
2217 2217
 			$targetFile = $this->_changeMenuItemSrlInButtonPath($menuItemInfo->active_btn, $insertedMenuSrl, $insertedMenuItemSrl, 'active');
@@ -2226,9 +2226,9 @@  discard block
 block discarded – undo
2226 2226
 	{
2227 2227
 		$path = sprintf('./files/attach/menu_button/%d/', $menuSrl);
2228 2228
 		$tmp_arr = explode('.', $buttonPath);
2229
-		$ext = $tmp_arr[count($tmp_arr)-1];
2229
+		$ext = $tmp_arr[count($tmp_arr) - 1];
2230 2230
 		$date = date("YmdHis");
2231
-		return sprintf('%s%d.%s.%s.%s', $path, $menuItemSrl,$date,'menu_'.$mode.'_btn', $ext);
2231
+		return sprintf('%s%d.%s.%s.%s', $path, $menuItemSrl, $date, 'menu_'.$mode.'_btn', $ext);
2232 2232
 	}
2233 2233
 
2234 2234
 	public function makeHomemenuCacheFile($menuSrl)
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.
modules/module/module.admin.model.php 3 patches
Doc Comments   +6 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,6 +56,9 @@  discard block
 block discarded – undo
56 56
 		return $output;
57 57
 	}
58 58
 
59
+	/**
60
+	 * @param string $modulePath
61
+	 */
59 62
 	function getSelectedManageHTML($grantList, $tabChoice = array(), $modulePath = NULL)
60 63
 	{
61 64
 		if($modulePath)
@@ -306,7 +309,7 @@  discard block
 block discarded – undo
306 309
 	 * Skin setting page for the module
307 310
 	 *
308 311
 	 * @param $module_srl sequence of module
309
-	 * @param $mode P or M
312
+	 * @param string $mode P or M
310 313
 	 * @return string The HTML code
311 314
 	 */
312 315
 	function _getModuleSkinHTML($module_srl, $mode)
@@ -395,6 +398,7 @@  discard block
 block discarded – undo
395 398
 	/**
396 399
 	 * @brief Get values for a particular language code
397 400
 	 * Return its corresponding value if lang_code is specified. Otherwise return $name.
401
+	 * @param string $name
398 402
 	 */
399 403
 	function getLangCode($site_srl, $name, $isFullLanguage = FALSE)
400 404
 	{
@@ -513,6 +517,7 @@  discard block
 block discarded – undo
513 517
 
514 518
 	/**
515 519
 	 * @brief Return current lang list
520
+	 * @param stdClass $args
516 521
 	 */
517 522
 	function getLangListByLangcode($args)
518 523
 	{
Please login to merge, or discard this patch.
Braces   +78 added lines, -44 removed lines patch added patch discarded remove patch
@@ -26,7 +26,9 @@  discard block
 block discarded – undo
26 26
 		$args = new stdClass;
27 27
 		$args->module_srls = Context::get('module_srls');
28 28
 		$output = executeQueryArray('module.getModulesInfo', $args);
29
-		if(!$output->toBool() || !$output->data) return new Object();
29
+		if(!$output->toBool() || !$output->data) {
30
+			return new Object();
31
+		}
30 32
 
31 33
 		foreach($output->data as $key => $val)
32 34
 		{
@@ -49,7 +51,9 @@  discard block
 block discarded – undo
49 51
 		$args->list_count = 20;
50 52
 		$args->page_count = 10;
51 53
 		$output = executeQueryArray('module.getModuleMidList', $args);
52
-		if(!$output->toBool()) return $output;
54
+		if(!$output->toBool()) {
55
+			return $output;
56
+		}
53 57
 
54 58
 		ModuleModel::syncModuleToSite($output->data);
55 59
 
@@ -96,8 +100,12 @@  discard block
 block discarded – undo
96 100
 		{
97 101
 			foreach($grantList as $key => $val)
98 102
 			{
99
-				if(!$val->default) $val->default = 'guest';
100
-				if($val->default == 'root') $val->default = 'manager';
103
+				if(!$val->default) {
104
+					$val->default = 'guest';
105
+				}
106
+				if($val->default == 'root') {
107
+					$val->default = 'manager';
108
+				}
101 109
 				$grant_list->{$key} = $val;
102 110
 			}
103 111
 		}
@@ -158,8 +166,12 @@  discard block
 block discarded – undo
158 166
 		{
159 167
 			foreach($source_grant_list as $key => $val)
160 168
 			{
161
-				if(!$val->default) $val->default = 'guest';
162
-				if($val->default == 'root') $val->default = 'manager';
169
+				if(!$val->default) {
170
+					$val->default = 'guest';
171
+				}
172
+				if($val->default == 'root') {
173
+					$val->default = 'manager';
174
+				}
163 175
 				$grant_list->{$key} = $val;
164 176
 			}
165 177
 		}
@@ -176,11 +188,15 @@  discard block
 block discarded – undo
176 188
 		{
177 189
 			foreach($output->data as $val)
178 190
 			{
179
-				if($val->group_srl == 0) $default_grant[$val->name] = 'all';
180
-				else if($val->group_srl == -1) $default_grant[$val->name] = 'member';
181
-				else if($val->group_srl == -2) $default_grant[$val->name] = 'site';
182
-				else if($val->group_srl == -3) $default_grant[$val->name] = 'manager';
183
-				else
191
+				if($val->group_srl == 0) {
192
+					$default_grant[$val->name] = 'all';
193
+				} else if($val->group_srl == -1) {
194
+					$default_grant[$val->name] = 'member';
195
+				} else if($val->group_srl == -2) {
196
+					$default_grant[$val->name] = 'site';
197
+				} else if($val->group_srl == -3) {
198
+					$default_grant[$val->name] = 'manager';
199
+				} else
184 200
 				{
185 201
 					$selected_group[$val->name][] = $val->group_srl;
186 202
 					$default_grant[$val->name] = 'group';
@@ -235,8 +251,12 @@  discard block
 block discarded – undo
235 251
 		{
236 252
 			foreach($xmlInfo->grant as $key => $val)
237 253
 			{
238
-				if(!$val->default) $val->default = 'guest';
239
-				if($val->default == 'root') $val->default = 'manager';
254
+				if(!$val->default) {
255
+					$val->default = 'guest';
256
+				}
257
+				if($val->default == 'root') {
258
+					$val->default = 'manager';
259
+				}
240 260
 				$grantList->{$key} = $val;
241 261
 			}
242 262
 		}
@@ -253,11 +273,15 @@  discard block
 block discarded – undo
253 273
 		{
254 274
 			foreach($output->data as $val)
255 275
 			{
256
-				if($val->group_srl == 0) $defaultGrant->{$val->name} = 'all';
257
-				else if($val->group_srl == -1) $defaultGrant->{$val->name} = 'member';
258
-				else if($val->group_srl == -2) $defaultGrant->{$val->name} = 'site';
259
-				else if($val->group_srl == -3) $defaultGrant->{$val->name} = 'manager';
260
-				else
276
+				if($val->group_srl == 0) {
277
+					$defaultGrant->{$val->name} = 'all';
278
+				} else if($val->group_srl == -1) {
279
+					$defaultGrant->{$val->name} = 'member';
280
+				} else if($val->group_srl == -2) {
281
+					$defaultGrant->{$val->name} = 'site';
282
+				} else if($val->group_srl == -3) {
283
+					$defaultGrant->{$val->name} = 'manager';
284
+				} else
261 285
 				{
262 286
 					$selectedGroup->{$val->name}[] = $val->group_srl;
263 287
 					$defaultGrant->{$val->name} = 'group';
@@ -315,26 +339,25 @@  discard block
 block discarded – undo
315 339
 
316 340
 		$oModuleModel = getModel('module');
317 341
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
318
-		if(!$module_info) return;
342
+		if(!$module_info) {
343
+			return;
344
+		}
319 345
 
320 346
 		if($mode === 'P')
321 347
 		{
322 348
 			if($module_info->is_skin_fix == 'N')
323 349
 			{
324 350
 				$skin = $oModuleModel->getModuleDefaultSkin($module_info->module, 'P', $module_info->site_srl);
325
-			}
326
-			else
351
+			} else
327 352
 			{
328 353
 				$skin = $module_info->skin;
329 354
 			}
330
-		}
331
-		else
355
+		} else
332 356
 		{
333 357
 			if($module_info->is_mskin_fix == 'N')
334 358
 			{
335 359
 				$skin = $oModuleModel->getModuleDefaultSkin($module_info->module, 'M', $module_info->site_srl);
336
-			}
337
-			else
360
+			} else
338 361
 			{
339 362
 				$skin = $module_info->mskin;
340 363
 			}
@@ -347,8 +370,7 @@  discard block
 block discarded – undo
347 370
 		{
348 371
 			$skin_info = $oModuleModel->loadSkinInfo($module_path, $skin);
349 372
 			$skin_vars = $oModuleModel->getModuleSkinVars($module_srl);
350
-		}
351
-		else
373
+		} else
352 374
 		{
353 375
 			$skin_info = $oModuleModel->loadSkinInfo($module_path, $skin, 'm.skins');
354 376
 			$skin_vars = $oModuleModel->getModuleMobileSkinVars($module_srl);
@@ -364,8 +386,9 @@  discard block
 block discarded – undo
364 386
 				if($skin_vars[$name]) 
365 387
 				{
366 388
 					$value = $skin_vars[$name]->value;
389
+				} else {
390
+					$value = '';
367 391
 				}
368
-				else $value = '';
369 392
 				if($type=="checkbox")
370 393
 				{
371 394
 					$value = $value?unserialize($value):array();
@@ -401,8 +424,7 @@  discard block
 block discarded – undo
401 424
 		if($isFullLanguage)
402 425
 		{
403 426
 			$lang_supported = Context::loadLangSupported();
404
-		}
405
-		else
427
+		} else
406 428
 		{
407 429
 			$lang_supported = Context::get('lang_supported');
408 430
 		}
@@ -420,19 +442,21 @@  discard block
 block discarded – undo
420 442
 					$selected_lang[$val->lang_code] = $val->value;
421 443
 				}
422 444
 			}
423
-		}
424
-		else
445
+		} else
425 446
 		{
426 447
 			$tmp = unserialize($name);
427 448
 			if($tmp)
428 449
 			{
429 450
 				$selected_lang = array();
430 451
 				$rand_name = $tmp[Context::getLangType()];
431
-				if(!$rand_name) $rand_name = array_shift($tmp);
452
+				if(!$rand_name) {
453
+					$rand_name = array_shift($tmp);
454
+				}
432 455
 				if(is_array($lang_supported))
433 456
 				{
434
-					foreach($lang_supported as $key => $val)
435
-						$selected_lang[$key] = $tmp[$key]?$tmp[$key]:$rand_name;
457
+					foreach($lang_supported as $key => $val) {
458
+											$selected_lang[$key] = $tmp[$key]?$tmp[$key]:$rand_name;
459
+					}
436 460
 				}
437 461
 			}
438 462
 		}
@@ -440,8 +464,9 @@  discard block
 block discarded – undo
440 464
 		$output = array();
441 465
 		if(is_array($lang_supported))
442 466
 		{
443
-			foreach($lang_supported as $key => $val)
444
-				$output[$key] = $selected_lang[$key]?$selected_lang[$key]:$name;
467
+			foreach($lang_supported as $key => $val) {
468
+							$output[$key] = $selected_lang[$key]?$selected_lang[$key]:$name;
469
+			}
445 470
 		}
446 471
 		return $output;
447 472
 	}
@@ -452,7 +477,9 @@  discard block
 block discarded – undo
452 477
 	function getModuleAdminLangCode()
453 478
 	{
454 479
 		$name = Context::get('name');
455
-		if(!$name) return new Object(-1,'msg_invalid_request');
480
+		if(!$name) {
481
+			return new Object(-1,'msg_invalid_request');
482
+		}
456 483
 		$site_module_info = Context::get('site_module_info');
457 484
 		$this->add('name', $name);
458 485
 		$output = $this->getLangCode($site_module_info->site_srl, '$user_lang->'.$name);
@@ -465,7 +492,9 @@  discard block
 block discarded – undo
465 492
 	function getModuleAdminLangListByName()
466 493
 	{
467 494
 		$args = Context::getRequestVars();
468
-		if(!$args->site_srl) $args->site_srl = 0;
495
+		if(!$args->site_srl) {
496
+			$args->site_srl = 0;
497
+		}
469 498
 
470 499
 		$columnList = array('lang_code', 'name', 'value');
471 500
 
@@ -473,7 +502,9 @@  discard block
 block discarded – undo
473 502
 
474 503
 		$args->langName = preg_replace('/^\$user_lang->/', '', $args->lang_name);
475 504
 		$output = executeQueryArray('module.getLangListByName', $args, $columnList);
476
-		if($output->toBool()) $langList = $output->data;
505
+		if($output->toBool()) {
506
+			$langList = $output->data;
507
+		}
477 508
 
478 509
 		$this->add('lang_list', $langList);
479 510
 		$this->add('lang_name', $args->langName);
@@ -485,7 +516,9 @@  discard block
 block discarded – undo
485 516
 	function getModuleAdminLangListByValue()
486 517
 	{
487 518
 		$args = Context::getRequestVars();
488
-		if(!$args->site_srl) $args->site_srl = 0;
519
+		if(!$args->site_srl) {
520
+			$args->site_srl = 0;
521
+		}
489 522
 
490 523
 		$langList = array();
491 524
 
@@ -517,7 +550,9 @@  discard block
 block discarded – undo
517 550
 	function getLangListByLangcode($args)
518 551
 	{
519 552
 		$output = executeQueryArray('module.getLangListByLangcode', $args);
520
-		if(!$output->toBool()) return array();
553
+		if(!$output->toBool()) {
554
+			return array();
555
+		}
521 556
 
522 557
 		return $output;
523 558
 	}
@@ -592,8 +627,7 @@  discard block
 block discarded – undo
592 627
 		if(Context::get('search_module_srl'))
593 628
 		{
594 629
 			$module_srl = Context::get('search_module_srl');
595
-		}
596
-		else
630
+		} else
597 631
 		{
598 632
 			$module_srl = Context::get('module_srl');
599 633
 		}
Please login to merge, or discard this patch.
Spacing   +84 added lines, -84 removed lines patch added patch discarded remove patch
@@ -26,16 +26,16 @@  discard block
 block discarded – undo
26 26
 		$args = new stdClass;
27 27
 		$args->module_srls = Context::get('module_srls');
28 28
 		$output = executeQueryArray('module.getModulesInfo', $args);
29
-		if(!$output->toBool() || !$output->data) return new Object();
29
+		if (!$output->toBool() || !$output->data) return new Object();
30 30
 
31
-		foreach($output->data as $key => $val)
31
+		foreach ($output->data as $key => $val)
32 32
 		{
33 33
 			$info_xml = $oModuleModel->getModuleInfoXml($val->module);
34 34
 			$oModuleController->replaceDefinedLangCode($val->browser_title);
35
-			$list[$val->module_srl] = array('module_srl'=>$val->module_srl,'mid'=>$val->mid,'browser_title'=>$val->browser_title, 'module_name' => $info_xml->title);
35
+			$list[$val->module_srl] = array('module_srl'=>$val->module_srl, 'mid'=>$val->mid, 'browser_title'=>$val->browser_title, 'module_name' => $info_xml->title);
36 36
 		}
37
-		$modules = explode(',',$args->module_srls);
38
-		for($i=0;$i<count($modules);$i++)
37
+		$modules = explode(',', $args->module_srls);
38
+		for ($i = 0; $i < count($modules); $i++)
39 39
 		{
40 40
 			$module_list[$modules[$i]] = $list[$modules[$i]];
41 41
 		}
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 		$args->list_count = 20;
50 50
 		$args->page_count = 10;
51 51
 		$output = executeQueryArray('module.getModuleMidList', $args);
52
-		if(!$output->toBool()) return $output;
52
+		if (!$output->toBool()) return $output;
53 53
 
54 54
 		ModuleModel::syncModuleToSite($output->data);
55 55
 
@@ -58,12 +58,12 @@  discard block
 block discarded – undo
58 58
 
59 59
 	function getSelectedManageHTML($grantList, $tabChoice = array(), $modulePath = NULL)
60 60
 	{
61
-		if($modulePath)
61
+		if ($modulePath)
62 62
 		{
63 63
 			// get the skins path
64 64
 			$oModuleModel = getModel('module');
65 65
 			$skin_list = $oModuleModel->getSkins($modulePath);
66
-			Context::set('skin_list',$skin_list);
66
+			Context::set('skin_list', $skin_list);
67 67
 
68 68
 			$mskin_list = $oModuleModel->getSkins($modulePath, "m.skins");
69 69
 			Context::set('mskin_list', $mskin_list);
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 		$layout_list = $oLayoutModel->getLayoutList();
75 75
 		Context::set('layout_list', $layout_list);
76 76
 
77
-		$mobile_layout_list = $oLayoutModel->getLayoutList(0,"M");
77
+		$mobile_layout_list = $oLayoutModel->getLayoutList(0, "M");
78 78
 		Context::set('mlayout_list', $mobile_layout_list);
79 79
 
80 80
 		$security = new Security();
@@ -83,21 +83,21 @@  discard block
 block discarded – undo
83 83
 		$security->encodeHTML('skin_list..title');
84 84
 		$security->encodeHTML('mskin_list..title');
85 85
 
86
-		$grant_list =new stdClass();
86
+		$grant_list = new stdClass();
87 87
 		// Grant virtual permission for access and manager
88
-		if(!$grantList)
88
+		if (!$grantList)
89 89
 		{
90
-			$grantList =new stdClass();
90
+			$grantList = new stdClass();
91 91
 		}
92 92
 		$grantList->access = new stdClass();
93 93
 		$grantList->access->title = Context::getLang('grant_access');
94 94
 		$grantList->access->default = 'guest';
95
-		if(count($grantList))
95
+		if (count($grantList))
96 96
 		{
97
-			foreach($grantList as $key => $val)
97
+			foreach ($grantList as $key => $val)
98 98
 			{
99
-				if(!$val->default) $val->default = 'guest';
100
-				if($val->default == 'root') $val->default = 'manager';
99
+				if (!$val->default) $val->default = 'guest';
100
+				if ($val->default == 'root') $val->default = 'manager';
101 101
 				$grant_list->{$key} = $val;
102 102
 			}
103 103
 		}
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 		$output = ModuleHandler::triggerCall('module.dispAdditionSetup', 'after', $content);
120 120
 		Context::set('setup_content', $content);
121 121
 
122
-		if(count($tabChoice) == 0)
122
+		if (count($tabChoice) == 0)
123 123
 		{
124 124
 			$tabChoice = array('tab1'=>1, 'tab2'=>1, 'tab3'=>1);
125 125
 		}
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 	 */
137 137
 	function getModuleGrantHTML($module_srl, $source_grant_list)
138 138
 	{
139
-		if(!$module_srl)
139
+		if (!$module_srl)
140 140
 		{
141 141
 			return;
142 142
 		}
@@ -154,12 +154,12 @@  discard block
 block discarded – undo
154 154
 		$grant_list->access = new stdClass();
155 155
 		$grant_list->access->title = Context::getLang('grant_access');
156 156
 		$grant_list->access->default = 'guest';
157
-		if(count($source_grant_list))
157
+		if (count($source_grant_list))
158 158
 		{
159
-			foreach($source_grant_list as $key => $val)
159
+			foreach ($source_grant_list as $key => $val)
160 160
 			{
161
-				if(!$val->default) $val->default = 'guest';
162
-				if($val->default == 'root') $val->default = 'manager';
161
+				if (!$val->default) $val->default = 'guest';
162
+				if ($val->default == 'root') $val->default = 'manager';
163 163
 				$grant_list->{$key} = $val;
164 164
 			}
165 165
 		}
@@ -172,14 +172,14 @@  discard block
 block discarded – undo
172 172
 		$args = new stdClass();
173 173
 		$args->module_srl = $module_srl;
174 174
 		$output = executeQueryArray('module.getModuleGrants', $args);
175
-		if($output->data)
175
+		if ($output->data)
176 176
 		{
177
-			foreach($output->data as $val)
177
+			foreach ($output->data as $val)
178 178
 			{
179
-				if($val->group_srl == 0) $default_grant[$val->name] = 'all';
180
-				else if($val->group_srl == -1) $default_grant[$val->name] = 'member';
181
-				else if($val->group_srl == -2) $default_grant[$val->name] = 'site';
182
-				else if($val->group_srl == -3) $default_grant[$val->name] = 'manager';
179
+				if ($val->group_srl == 0) $default_grant[$val->name] = 'all';
180
+				else if ($val->group_srl == -1) $default_grant[$val->name] = 'member';
181
+				else if ($val->group_srl == -2) $default_grant[$val->name] = 'site';
182
+				else if ($val->group_srl == -3) $default_grant[$val->name] = 'manager';
183 183
 				else
184 184
 				{
185 185
 					$selected_group[$val->name][] = $val->group_srl;
@@ -213,12 +213,12 @@  discard block
 block discarded – undo
213 213
 	{
214 214
 		$targetModule = Context::get('target_module');
215 215
 		$moduleSrl = Context::get('module_srl');
216
-		if(!$targetModule || !$moduleSrl)
216
+		if (!$targetModule || !$moduleSrl)
217 217
 		{
218 218
 			return new Object(-1, 'msg_invalid_request');
219 219
 		}
220 220
 
221
-		if($targetModule == '_SHORTCUT')
221
+		if ($targetModule == '_SHORTCUT')
222 222
 		{
223 223
 			return new Object(0);
224 224
 		}
@@ -231,12 +231,12 @@  discard block
 block discarded – undo
231 231
 		$grantList->access = new stdClass();
232 232
 		$grantList->access->title = Context::getLang('grant_access');
233 233
 		$grantList->access->default = 'guest';
234
-		if(count($xmlInfo->grant))
234
+		if (count($xmlInfo->grant))
235 235
 		{
236
-			foreach($xmlInfo->grant as $key => $val)
236
+			foreach ($xmlInfo->grant as $key => $val)
237 237
 			{
238
-				if(!$val->default) $val->default = 'guest';
239
-				if($val->default == 'root') $val->default = 'manager';
238
+				if (!$val->default) $val->default = 'guest';
239
+				if ($val->default == 'root') $val->default = 'manager';
240 240
 				$grantList->{$key} = $val;
241 241
 			}
242 242
 		}
@@ -249,14 +249,14 @@  discard block
 block discarded – undo
249 249
 		$args = new stdClass();
250 250
 		$args->module_srl = $moduleSrl;
251 251
 		$output = executeQueryArray('module.getModuleGrants', $args);
252
-		if($output->data)
252
+		if ($output->data)
253 253
 		{
254
-			foreach($output->data as $val)
254
+			foreach ($output->data as $val)
255 255
 			{
256
-				if($val->group_srl == 0) $defaultGrant->{$val->name} = 'all';
257
-				else if($val->group_srl == -1) $defaultGrant->{$val->name} = 'member';
258
-				else if($val->group_srl == -2) $defaultGrant->{$val->name} = 'site';
259
-				else if($val->group_srl == -3) $defaultGrant->{$val->name} = 'manager';
256
+				if ($val->group_srl == 0) $defaultGrant->{$val->name} = 'all';
257
+				else if ($val->group_srl == -1) $defaultGrant->{$val->name} = 'member';
258
+				else if ($val->group_srl == -2) $defaultGrant->{$val->name} = 'site';
259
+				else if ($val->group_srl == -3) $defaultGrant->{$val->name} = 'manager';
260 260
 				else
261 261
 				{
262 262
 					$selectedGroup->{$val->name}[] = $val->group_srl;
@@ -265,15 +265,15 @@  discard block
 block discarded – undo
265 265
 			}
266 266
 		}
267 267
 
268
-		if(is_object($grantList))
268
+		if (is_object($grantList))
269 269
 		{
270
-			foreach($grantList AS $key=>$value)
270
+			foreach ($grantList AS $key=>$value)
271 271
 			{
272
-				if(isset($defaultGrant->{$key}))
272
+				if (isset($defaultGrant->{$key}))
273 273
 				{
274 274
 					$grantList->{$key}->grant = $defaultGrant->{$key};
275 275
 				}
276
-				if(isset($selectedGroup->{$key}))
276
+				if (isset($selectedGroup->{$key}))
277 277
 				{
278 278
 					$grantList->{$key}->group_srls = $selectedGroup->{$key};
279 279
 				}
@@ -315,11 +315,11 @@  discard block
 block discarded – undo
315 315
 
316 316
 		$oModuleModel = getModel('module');
317 317
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
318
-		if(!$module_info) return;
318
+		if (!$module_info) return;
319 319
 
320
-		if($mode === 'P')
320
+		if ($mode === 'P')
321 321
 		{
322
-			if($module_info->is_skin_fix == 'N')
322
+			if ($module_info->is_skin_fix == 'N')
323 323
 			{
324 324
 				$skin = $oModuleModel->getModuleDefaultSkin($module_info->module, 'P', $module_info->site_srl);
325 325
 			}
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
 		}
331 331
 		else
332 332
 		{
333
-			if($module_info->is_mskin_fix == 'N')
333
+			if ($module_info->is_mskin_fix == 'N')
334 334
 			{
335 335
 				$skin = $oModuleModel->getModuleDefaultSkin($module_info->module, 'M', $module_info->site_srl);
336 336
 			}
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
 		$module_path = './modules/'.$module_info->module;
344 344
 
345 345
 		// Get XML information of the skin and skin sinformation set in DB
346
-		if($mode === 'P')
346
+		if ($mode === 'P')
347 347
 		{
348 348
 			$skin_info = $oModuleModel->loadSkinInfo($module_path, $skin);
349 349
 			$skin_vars = $oModuleModel->getModuleSkinVars($module_srl);
@@ -354,25 +354,25 @@  discard block
 block discarded – undo
354 354
 			$skin_vars = $oModuleModel->getModuleMobileSkinVars($module_srl);
355 355
 		}
356 356
 
357
-		if(count($skin_info->extra_vars)) 
357
+		if (count($skin_info->extra_vars)) 
358 358
 		{
359
-			foreach($skin_info->extra_vars as $key => $val) 
359
+			foreach ($skin_info->extra_vars as $key => $val) 
360 360
 			{
361 361
 				$group = $val->group;
362 362
 				$name = $val->name;
363 363
 				$type = $val->type;
364
-				if($skin_vars[$name]) 
364
+				if ($skin_vars[$name]) 
365 365
 				{
366 366
 					$value = $skin_vars[$name]->value;
367 367
 				}
368 368
 				else $value = '';
369
-				if($type=="checkbox")
369
+				if ($type == "checkbox")
370 370
 				{
371
-					$value = $value?unserialize($value):array();
371
+					$value = $value ? unserialize($value) : array();
372 372
 				}
373 373
 
374 374
 				$value = empty($value) ? $val->default : $value;
375
-				$skin_info->extra_vars[$key]->value= $value;
375
+				$skin_info->extra_vars[$key]->value = $value;
376 376
 			}
377 377
 		}
378 378
 
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
 	 */
399 399
 	function getLangCode($site_srl, $name, $isFullLanguage = FALSE)
400 400
 	{
401
-		if($isFullLanguage)
401
+		if ($isFullLanguage)
402 402
 		{
403 403
 			$lang_supported = Context::loadLangSupported();
404 404
 		}
@@ -407,15 +407,15 @@  discard block
 block discarded – undo
407 407
 			$lang_supported = Context::get('lang_supported');
408 408
 		}
409 409
 
410
-		if(substr($name,0,12)=='$user_lang->')
410
+		if (substr($name, 0, 12) == '$user_lang->')
411 411
 		{
412 412
 			$args = new stdClass();
413
-			$args->site_srl = (int)$site_srl;
414
-			$args->name = substr($name,12);
413
+			$args->site_srl = (int) $site_srl;
414
+			$args->name = substr($name, 12);
415 415
 			$output = executeQueryArray('module.getLang', $args);
416
-			if($output->data)
416
+			if ($output->data)
417 417
 			{
418
-				foreach($output->data as $key => $val)
418
+				foreach ($output->data as $key => $val)
419 419
 				{
420 420
 					$selected_lang[$val->lang_code] = $val->value;
421 421
 				}
@@ -424,24 +424,24 @@  discard block
 block discarded – undo
424 424
 		else
425 425
 		{
426 426
 			$tmp = unserialize($name);
427
-			if($tmp)
427
+			if ($tmp)
428 428
 			{
429 429
 				$selected_lang = array();
430 430
 				$rand_name = $tmp[Context::getLangType()];
431
-				if(!$rand_name) $rand_name = array_shift($tmp);
432
-				if(is_array($lang_supported))
431
+				if (!$rand_name) $rand_name = array_shift($tmp);
432
+				if (is_array($lang_supported))
433 433
 				{
434
-					foreach($lang_supported as $key => $val)
435
-						$selected_lang[$key] = $tmp[$key]?$tmp[$key]:$rand_name;
434
+					foreach ($lang_supported as $key => $val)
435
+						$selected_lang[$key] = $tmp[$key] ? $tmp[$key] : $rand_name;
436 436
 				}
437 437
 			}
438 438
 		}
439 439
 
440 440
 		$output = array();
441
-		if(is_array($lang_supported))
441
+		if (is_array($lang_supported))
442 442
 		{
443
-			foreach($lang_supported as $key => $val)
444
-				$output[$key] = $selected_lang[$key]?$selected_lang[$key]:$name;
443
+			foreach ($lang_supported as $key => $val)
444
+				$output[$key] = $selected_lang[$key] ? $selected_lang[$key] : $name;
445 445
 		}
446 446
 		return $output;
447 447
 	}
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
 	function getModuleAdminLangCode()
453 453
 	{
454 454
 		$name = Context::get('name');
455
-		if(!$name) return new Object(-1,'msg_invalid_request');
455
+		if (!$name) return new Object(-1, 'msg_invalid_request');
456 456
 		$site_module_info = Context::get('site_module_info');
457 457
 		$this->add('name', $name);
458 458
 		$output = $this->getLangCode($site_module_info->site_srl, '$user_lang->'.$name);
@@ -465,7 +465,7 @@  discard block
 block discarded – undo
465 465
 	function getModuleAdminLangListByName()
466 466
 	{
467 467
 		$args = Context::getRequestVars();
468
-		if(!$args->site_srl) $args->site_srl = 0;
468
+		if (!$args->site_srl) $args->site_srl = 0;
469 469
 
470 470
 		$columnList = array('lang_code', 'name', 'value');
471 471
 
@@ -473,7 +473,7 @@  discard block
 block discarded – undo
473 473
 
474 474
 		$args->langName = preg_replace('/^\$user_lang->/', '', $args->lang_name);
475 475
 		$output = executeQueryArray('module.getLangListByName', $args, $columnList);
476
-		if($output->toBool()) $langList = $output->data;
476
+		if ($output->toBool()) $langList = $output->data;
477 477
 
478 478
 		$this->add('lang_list', $langList);
479 479
 		$this->add('lang_name', $args->langName);
@@ -485,23 +485,23 @@  discard block
 block discarded – undo
485 485
 	function getModuleAdminLangListByValue()
486 486
 	{
487 487
 		$args = Context::getRequestVars();
488
-		if(!$args->site_srl) $args->site_srl = 0;
488
+		if (!$args->site_srl) $args->site_srl = 0;
489 489
 
490 490
 		$langList = array();
491 491
 
492 492
 		// search value
493 493
 		$output = executeQueryArray('module.getLangNameByValue', $args);
494
-		if($output->toBool() && is_array($output->data))
494
+		if ($output->toBool() && is_array($output->data))
495 495
 		{
496 496
 			unset($args->value);
497 497
 
498
-			foreach($output->data as $data)
498
+			foreach ($output->data as $data)
499 499
 			{
500 500
 				$args->langName = $data->name;
501 501
 				$columnList = array('lang_code', 'name', 'value');
502 502
 				$outputByName = executeQueryArray('module.getLangListByName', $args, $columnList);
503 503
 
504
-				if($outputByName->toBool())
504
+				if ($outputByName->toBool())
505 505
 				{
506 506
 					$langList = array_merge($langList, $outputByName->data);
507 507
 				}
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
 	function getLangListByLangcode($args)
518 518
 	{
519 519
 		$output = executeQueryArray('module.getLangListByLangcode', $args);
520
-		if(!$output->toBool()) return array();
520
+		if (!$output->toBool()) return array();
521 521
 
522 522
 		return $output;
523 523
 	}
@@ -528,7 +528,7 @@  discard block
 block discarded – undo
528 528
 	function getModuleAdminMultilingualHtml()
529 529
 	{
530 530
 		$oTemplate = TemplateHandler::getInstance();
531
-		$tpl = $oTemplate->compile(_XE_PATH_ . 'modules/module/tpl', 'multilingual_v17.html');
531
+		$tpl = $oTemplate->compile(_XE_PATH_.'modules/module/tpl', 'multilingual_v17.html');
532 532
 
533 533
 		$this->add('html', $tpl);
534 534
 	}
@@ -540,7 +540,7 @@  discard block
 block discarded – undo
540 540
 	{
541 541
 		$site_module_info = Context::get('site_module_info');
542 542
 		$args = new stdClass();
543
-		$args->site_srl = (int)$site_module_info->site_srl;
543
+		$args->site_srl = (int) $site_module_info->site_srl;
544 544
 		$args->langCode = Context::get('lang_code');
545 545
 		$args->page = Context::get('page');
546 546
 		$args->sort_index = 'name';
@@ -550,7 +550,7 @@  discard block
 block discarded – undo
550 550
 		$args->list_count = Context::get('list_count');
551 551
 		$args->page_count = 5;
552 552
 
553
-		if(!$args->langCode)
553
+		if (!$args->langCode)
554 554
 		{
555 555
 			$args->langCode = Context::get('lang_type');
556 556
 		}
@@ -567,7 +567,7 @@  discard block
 block discarded – undo
567 567
 		$oSecurity->encodeHTML('lang_code_list..');
568 568
 
569 569
 		$oTemplate = TemplateHandler::getInstance();
570
-		$tpl = $oTemplate->compile(_XE_PATH_ . 'modules/module/tpl', 'multilingual_v17_list.html');
570
+		$tpl = $oTemplate->compile(_XE_PATH_.'modules/module/tpl', 'multilingual_v17_list.html');
571 571
 
572 572
 		$this->add('html', $tpl);
573 573
 	}
@@ -577,9 +577,9 @@  discard block
 block discarded – undo
577 577
 	 */
578 578
 	function getModuleAdminModuleSearcherHtml()
579 579
 	{
580
-		Context::loadLang(_XE_PATH_ . 'modules/admin/lang');
580
+		Context::loadLang(_XE_PATH_.'modules/admin/lang');
581 581
 		$oTemplate = TemplateHandler::getInstance();
582
-		$tpl = $oTemplate->compile(_XE_PATH_ . 'modules/module/tpl', 'module_searcher_v17.html');
582
+		$tpl = $oTemplate->compile(_XE_PATH_.'modules/module/tpl', 'module_searcher_v17.html');
583 583
 
584 584
 		$this->add('html', $tpl);
585 585
 	}
@@ -589,7 +589,7 @@  discard block
 block discarded – undo
589 589
 	 */
590 590
 	function getModuleAdminModuleInfo()
591 591
 	{
592
-		if(Context::get('search_module_srl'))
592
+		if (Context::get('search_module_srl'))
593 593
 		{
594 594
 			$module_srl = Context::get('search_module_srl');
595 595
 		}
Please login to merge, or discard this patch.
modules/module/module.controller.php 3 patches
Doc Comments   +7 added lines patch added patch discarded remove patch
@@ -933,6 +933,7 @@  discard block
 block discarded – undo
933 933
 
934 934
 	/**
935 935
 	 * @brief Insert skin vars to a module
936
+	 * @param string $mode
936 937
 	 */
937 938
 	function _insertModuleSkinVars($module_srl, $obj, $mode)
938 939
 	{
@@ -1006,6 +1007,7 @@  discard block
 block discarded – undo
1006 1007
 
1007 1008
 	/**
1008 1009
 	 * @brief Remove skin vars of a module
1010
+	 * @param string $mode
1009 1011
 	 */
1010 1012
 	function _deleteModuleSkinVars($module_srl, $mode)
1011 1013
 	{
@@ -1242,6 +1244,7 @@  discard block
 block discarded – undo
1242 1244
 
1243 1245
 	/**
1244 1246
 	 * @brief Update a file into the file box
1247
+	 * @param stdClass $vars
1245 1248
 	 */
1246 1249
 	function updateModuleFileBox($vars)
1247 1250
 	{
@@ -1283,6 +1286,7 @@  discard block
 block discarded – undo
1283 1286
 
1284 1287
 	/**
1285 1288
 	 * @brief Add a file into the file box
1289
+	 * @param stdClass $vars
1286 1290
 	 */
1287 1291
 	function insertModuleFileBox($vars)
1288 1292
 	{
@@ -1336,6 +1340,9 @@  discard block
 block discarded – undo
1336 1340
 		if(!$output->toBool()) return $output;
1337 1341
 	}
1338 1342
 
1343
+	/**
1344
+	 * @param stdClass $vars
1345
+	 */
1339 1346
 	function deleteModuleFileBox($vars)
1340 1347
 	{
1341 1348
 		// delete real file
Please login to merge, or discard this patch.
Braces   +217 added lines, -101 removed lines patch added patch discarded remove patch
@@ -150,9 +150,15 @@  discard block
 block discarded – undo
150 150
 	 */
151 151
 	function insertModuleExtend($parent_module, $extend_module, $type, $kind='')
152 152
 	{
153
-		if($kind != 'admin') $kind = '';
154
-		if(!in_array($type,array('model','controller','view','api','mobile'))) return false;
155
-		if(in_array($parent_module, array('module','addon','widget','layout'))) return false;
153
+		if($kind != 'admin') {
154
+			$kind = '';
155
+		}
156
+		if(!in_array($type,array('model','controller','view','api','mobile'))) {
157
+			return false;
158
+		}
159
+		if(in_array($parent_module, array('module','addon','widget','layout'))) {
160
+			return false;
161
+		}
156 162
 
157 163
 		$cache_file = './files/config/module_extend.php';
158 164
 		FileHandler::removeFile($cache_file);
@@ -164,7 +170,9 @@  discard block
 block discarded – undo
164 170
 		$args->kind = $kind;
165 171
 
166 172
 		$output = executeQuery('module.getModuleExtendCount', $args);
167
-		if($output->data->count>0) return false;
173
+		if($output->data->count>0) {
174
+			return false;
175
+		}
168 176
 
169 177
 		$output = executeQuery('module.insertModuleExtend', $args);
170 178
 		return $output;
@@ -199,7 +207,9 @@  discard block
 block discarded – undo
199 207
 		$oModuleModel = getModel('module');
200 208
 		$origin_config = $oModuleModel->getModuleConfig($module, $site_srl);
201 209
 
202
-		if(!$origin_config) $origin_config = new stdClass;
210
+		if(!$origin_config) {
211
+			$origin_config = new stdClass;
212
+		}
203 213
 
204 214
 		foreach($config as $key => $val)
205 215
 		{
@@ -221,7 +231,9 @@  discard block
 block discarded – undo
221 231
 		$args->site_srl = $site_srl;
222 232
 
223 233
 		$output = executeQuery('module.deleteModuleConfig', $args);
224
-		if(!$output->toBool()) return $output;
234
+		if(!$output->toBool()) {
235
+			return $output;
236
+		}
225 237
 
226 238
 		$output = executeQuery('module.insertModuleConfig', $args);
227 239
 
@@ -246,7 +258,9 @@  discard block
 block discarded – undo
246 258
 		$args->config = serialize($config);
247 259
 
248 260
 		$output = executeQuery('module.deleteModulePartConfig', $args);
249
-		if(!$output->toBool()) return $output;
261
+		if(!$output->toBool()) {
262
+			return $output;
263
+		}
250 264
 
251 265
 		$output = executeQuery('module.insertModulePartConfig', $args);
252 266
 
@@ -268,9 +282,10 @@  discard block
 block discarded – undo
268 282
 		if(isSiteID($domain))
269 283
 		{
270 284
 			$oModuleModel = getModel('module');
271
-			if($oModuleModel->isIDExists($domain, 0)) return new Object(-1,'msg_already_registed_vid');
272
-		}
273
-		else
285
+			if($oModuleModel->isIDExists($domain, 0)) {
286
+				return new Object(-1,'msg_already_registed_vid');
287
+			}
288
+		} else
274 289
 		{
275 290
 			$domain = strtolower($domain);
276 291
 		}
@@ -284,10 +299,14 @@  discard block
 block discarded – undo
284 299
 		$columnList = array('modules.site_srl');
285 300
 		$oModuleModel = getModel('module');
286 301
 		$output = $oModuleModel->getSiteInfoByDomain($args->domain, $columnList);
287
-		if($output) return new Object(-1,'msg_already_registed_vid');
302
+		if($output) {
303
+			return new Object(-1,'msg_already_registed_vid');
304
+		}
288 305
 
289 306
 		$output = executeQuery('module.insertSite', $args);
290
-		if(!$output->toBool()) return $output;
307
+		if(!$output->toBool()) {
308
+			return $output;
309
+		}
291 310
 
292 311
 		$output->add('site_srl', $args->site_srl);
293 312
 		return $output;
@@ -310,8 +329,12 @@  discard block
 block discarded – undo
310 329
 		if($site_info->domain != $args->domain)
311 330
 		{
312 331
 			$info = $oModuleModel->getSiteInfoByDomain($args->domain, $columnList);
313
-			if($info->site_srl && $info->site_srl != $args->site_srl) return new Object(-1,'msg_already_registed_domain');
314
-			if(isSiteID($args->domain) && $oModuleModel->isIDExists($args->domain)) return new Object(-1,'msg_already_registed_vid');
332
+			if($info->site_srl && $info->site_srl != $args->site_srl) {
333
+				return new Object(-1,'msg_already_registed_domain');
334
+			}
335
+			if(isSiteID($args->domain) && $oModuleModel->isIDExists($args->domain)) {
336
+				return new Object(-1,'msg_already_registed_vid');
337
+			}
315 338
 
316 339
 			if($args->domain && !isSiteID($args->domain))
317 340
 			{
@@ -320,8 +343,11 @@  discard block
 block discarded – undo
320 343
 		}
321 344
 		$output = executeQuery('module.updateSite', $args);
322 345
 		//clear cache for default mid
323
-		if($args->site_srl == 0) $vid='';
324
-		else $vid=$args->domain;
346
+		if($args->site_srl == 0) {
347
+			$vid='';
348
+		} else {
349
+			$vid=$args->domain;
350
+		}
325 351
 
326 352
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($args->index_module_srl);
327 353
 		$mid = $module_info->mid;
@@ -345,7 +371,9 @@  discard block
 block discarded – undo
345 371
 		unset($args->act);
346 372
 		unset($args->page);
347 373
 		// Test mid value
348
-		if(!preg_match("/^[a-z][a-z0-9_]+$/i", $args->mid)) return new Object(-1, 'msg_limit_mid');
374
+		if(!preg_match("/^[a-z][a-z0-9_]+$/i", $args->mid)) {
375
+			return new Object(-1, 'msg_limit_mid');
376
+		}
349 377
 		// Test variables (separate basic vars and other vars in modules)
350 378
 		$extra_vars = clone($args);
351 379
 		unset($extra_vars->module_srl);
@@ -382,18 +410,23 @@  discard block
 block discarded – undo
382 410
 		if(isset($args->isMenuCreate))
383 411
 		{
384 412
 			$isMenuCreate = $args->isMenuCreate;
385
-		}
386
-		else
413
+		} else
387 414
 		{
388 415
 			$isMenuCreate = TRUE;
389 416
 		}
390 417
 
391 418
 		$output = $this->arrangeModuleInfo($args, $extra_vars);
392
-		if(!$output->toBool()) return $output;
419
+		if(!$output->toBool()) {
420
+			return $output;
421
+		}
393 422
 		// Check whether the module name already exists
394
-		if(!$args->site_srl) $args->site_srl = 0;
423
+		if(!$args->site_srl) {
424
+			$args->site_srl = 0;
425
+		}
395 426
 		$oModuleModel = getModel('module');
396
-		if($oModuleModel->isIDExists($args->mid, $args->site_srl)) return new Object(-1, 'msg_module_name_exists');
427
+		if($oModuleModel->isIDExists($args->mid, $args->site_srl)) {
428
+			return new Object(-1, 'msg_module_name_exists');
429
+		}
397 430
 
398 431
 		// begin transaction
399 432
 		$oDB = &DB::getInstance();
@@ -404,20 +437,20 @@  discard block
 block discarded – undo
404 437
 		$skin_vars = new stdClass();
405 438
 		$skin_vars->colorset = $skin_info->colorset[0]->name;
406 439
 		// Arrange variables and then execute a query
407
-		if(!$args->module_srl) $args->module_srl = getNextSequence();
440
+		if(!$args->module_srl) {
441
+			$args->module_srl = getNextSequence();
442
+		}
408 443
 
409 444
 		// default value
410 445
 		if($args->skin == '/USE_DEFAULT/')
411 446
 		{
412 447
 			$args->is_skin_fix = 'N';
413
-		}
414
-		else
448
+		} else
415 449
 		{
416 450
 			if(isset($args->is_skin_fix))
417 451
 			{
418 452
 				$args->is_skin_fix = ($args->is_skin_fix != 'Y') ? 'N' : 'Y';
419
-			}
420
-			else
453
+			} else
421 454
 			{
422 455
 				$args->is_skin_fix = 'Y';
423 456
 			}
@@ -426,14 +459,12 @@  discard block
 block discarded – undo
426 459
 		if($args->mskin == '/USE_DEFAULT/')
427 460
 		{
428 461
 			$args->is_mskin_fix = 'N';
429
-		}
430
-		else
462
+		} else
431 463
 		{
432 464
 			if(isset($args->is_mskin_fix))
433 465
 			{
434 466
 				$args->is_mskin_fix = ($args->is_mskin_fix != 'Y') ? 'N' : 'Y';
435
-			}
436
-			else
467
+			} else
437 468
 			{
438 469
 				$args->is_mskin_fix = 'Y';
439 470
 			}
@@ -508,7 +539,9 @@  discard block
 block discarded – undo
508 539
 	function updateModule($args)
509 540
 	{
510 541
 		$output = $this->arrangeModuleInfo($args, $extra_vars);
511
-		if(!$output->toBool()) return $output;
542
+		if(!$output->toBool()) {
543
+			return $output;
544
+		}
512 545
 		// begin transaction
513 546
 		$oDB = &DB::getInstance();
514 547
 		$oDB->begin();
@@ -519,8 +552,12 @@  discard block
 block discarded – undo
519 552
 
520 553
 		if(!$args->site_srl || !$args->browser_title)
521 554
 		{
522
-			if(!$args->site_srl) $args->site_srl = (int)$module_info->site_srl;
523
-			if(!$args->browser_title) $args->browser_title = $module_info->browser_title;
555
+			if(!$args->site_srl) {
556
+				$args->site_srl = (int)$module_info->site_srl;
557
+			}
558
+			if(!$args->browser_title) {
559
+				$args->browser_title = $module_info->browser_title;
560
+			}
524 561
 		}
525 562
 
526 563
 		$args->browser_title = strip_tags($args->browser_title);
@@ -536,14 +573,12 @@  discard block
 block discarded – undo
536 573
 		if($args->skin == '/USE_DEFAULT/')
537 574
 		{
538 575
 			$args->is_skin_fix = 'N';
539
-		}
540
-		else
576
+		} else
541 577
 		{
542 578
 			if(isset($args->is_skin_fix))
543 579
 			{
544 580
 				$args->is_skin_fix = ($args->is_skin_fix != 'Y') ? 'N' : 'Y';
545
-			}
546
-			else
581
+			} else
547 582
 			{
548 583
 				$args->is_skin_fix = 'Y';
549 584
 			}
@@ -552,14 +587,12 @@  discard block
 block discarded – undo
552 587
 		if($args->mskin == '/USE_DEFAULT/')
553 588
 		{
554 589
 			$args->is_mskin_fix = 'N';
555
-		}
556
-		else
590
+		} else
557 591
 		{
558 592
 			if(isset($args->is_mskin_fix))
559 593
 			{
560 594
 				$args->is_mskin_fix = ($args->is_mskin_fix != 'Y') ? 'N' : 'Y';
561
-			}
562
-			else
595
+			} else
563 596
 			{
564 597
 				$args->is_mskin_fix = 'Y';
565 598
 			}
@@ -624,7 +657,9 @@  discard block
 block discarded – undo
624 657
 		$args->site_srl = $site_srl;
625 658
 		$args->layout_srl = $layout_srl;
626 659
 		$output = executeQuery('module.updateModuleSite', $args);
627
-		if(!$output->toBool()) return $output;
660
+		if(!$output->toBool()) {
661
+			return $output;
662
+		}
628 663
 
629 664
 		//remove from cache
630 665
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
@@ -643,7 +678,9 @@  discard block
 block discarded – undo
643 678
 	 */
644 679
 	function deleteModule($module_srl, $site_srl = 0)
645 680
 	{
646
-		if(!$module_srl) return new Object(-1,'msg_invalid_request');
681
+		if(!$module_srl) {
682
+			return new Object(-1,'msg_invalid_request');
683
+		}
647 684
 
648 685
 		$site_module_info = Context::get('site_module_info');
649 686
 
@@ -653,8 +690,11 @@  discard block
 block discarded – undo
653 690
 		$args = new stdClass();
654 691
 		$args->url = $output->mid;
655 692
 		$args->is_shortcut = 'N';
656
-		if(!$site_srl) $args->site_srl = $site_module_info->site_srl;
657
-		else $args->site_srl = $site_srl;
693
+		if(!$site_srl) {
694
+			$args->site_srl = $site_module_info->site_srl;
695
+		} else {
696
+			$args->site_srl = $site_srl;
697
+		}
658 698
 
659 699
 		unset($output);
660 700
 
@@ -687,8 +727,7 @@  discard block
 block discarded – undo
687 727
 			if($output->isSuccess)
688 728
 			{
689 729
 				return new Object(0, 'success_deleted');
690
-			}
691
-			else
730
+			} else
692 731
 			{
693 732
 				return new Object($output->error, $output->message);
694 733
 			}
@@ -706,19 +745,25 @@  discard block
 block discarded – undo
706 745
 	 */
707 746
 	public function onlyDeleteModule($module_srl)
708 747
 	{
709
-		if(!$module_srl) return new Object(-1,'msg_invalid_request');
748
+		if(!$module_srl) {
749
+			return new Object(-1,'msg_invalid_request');
750
+		}
710 751
 
711 752
 		// check start module
712 753
 		$oModuleModel = getModel('module');
713 754
 		$columnList = array('sites.index_module_srl');
714 755
 		$start_module = $oModuleModel->getSiteInfo(0, $columnList);
715
-		if($module_srl == $start_module->index_module_srl) return new Object(-1, 'msg_cannot_delete_startmodule');
756
+		if($module_srl == $start_module->index_module_srl) {
757
+			return new Object(-1, 'msg_cannot_delete_startmodule');
758
+		}
716 759
 
717 760
 		// Call a trigger (before)
718 761
 		$trigger_obj = new stdClass();
719 762
 		$trigger_obj->module_srl = $module_srl;
720 763
 		$output = ModuleHandler::triggerCall('module.deleteModule', 'before', $trigger_obj);
721
-		if(!$output->toBool()) return $output;
764
+		if(!$output->toBool()) {
765
+			return $output;
766
+		}
722 767
 
723 768
 		// begin transaction
724 769
 		$oDB = &DB::getInstance();
@@ -779,7 +824,9 @@  discard block
 block discarded – undo
779 824
 	function clearDefaultModule()
780 825
 	{
781 826
 		$output = executeQuery('module.clearDefaultModule');
782
-		if(!$output->toBool()) return $output;
827
+		if(!$output->toBool()) {
828
+			return $output;
829
+		}
783 830
 
784 831
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
785 832
 		if($oCacheHandler->isSupport())
@@ -811,7 +858,9 @@  discard block
 block discarded – undo
811 858
 	 */
812 859
 	function updateModuleLayout($layout_srl, $menu_srl_list)
813 860
 	{
814
-		if(!count($menu_srl_list)) return;
861
+		if(!count($menu_srl_list)) {
862
+			return;
863
+		}
815 864
 
816 865
 		$args = new stdClass;
817 866
 		$args->layout_srl = $layout_srl;
@@ -838,28 +887,37 @@  discard block
 block discarded – undo
838 887
 
839 888
 		$output = executeQuery('module.deleteSiteAdmin', $args);
840 889
 
841
-		if(!$output->toBool()) return $output;
890
+		if(!$output->toBool()) {
891
+			return $output;
892
+		}
842 893
 		// Get user id of an administrator
843
-		if(!is_array($arr_admins) || !count($arr_admins)) return new Object();
894
+		if(!is_array($arr_admins) || !count($arr_admins)) {
895
+			return new Object();
896
+		}
844 897
 		foreach($arr_admins as $key => $user_id)
845 898
 		{
846
-			if(!trim($user_id)) continue;
899
+			if(!trim($user_id)) {
900
+				continue;
901
+			}
847 902
 			$admins[] = trim($user_id);
848 903
 		}
849
-		if(!count($admins)) return new Object();
904
+		if(!count($admins)) {
905
+			return new Object();
906
+		}
850 907
 
851 908
 		$oMemberModel = getModel('member');
852 909
 		$member_config = $oMemberModel->getMemberConfig();
853 910
 		if($member_config->identifier == 'email_address')
854 911
 		{
855 912
 			$args->email_address = '\''.implode('\',\'',$admins).'\'';
856
-		}
857
-		else
913
+		} else
858 914
 		{
859 915
 			$args->user_ids = '\''.implode('\',\'',$admins).'\'';
860 916
 		}
861 917
 		$output = executeQueryArray('module.getAdminSrls', $args);
862
-		if(!$output->toBool()||!$output->data) return $output;
918
+		if(!$output->toBool()||!$output->data) {
919
+			return $output;
920
+		}
863 921
 
864 922
 		foreach($output->data as $key => $val)
865 923
 		{
@@ -868,7 +926,9 @@  discard block
 block discarded – undo
868 926
 			$args->site_srl = $site_srl;
869 927
 			$args->member_srl = $val->member_srl;
870 928
 			$output = executeQueryArray('module.insertSiteAdmin', $args);
871
-			if(!$output->toBool()) return $output;
929
+			if(!$output->toBool()) {
930
+				return $output;
931
+			}
872 932
 		}
873 933
 		return new Object();
874 934
 	}
@@ -881,12 +941,15 @@  discard block
 block discarded – undo
881 941
 		$oMemberModel = getModel('member');
882 942
 		$member_config = $oMemberModel->getMemberConfig();
883 943
 
884
-		if($member_config->identifier == 'email_address')
885
-			$member_info = $oMemberModel->getMemberInfoByEmailAddress($admin_id);
886
-		else
887
-			$member_info = $oMemberModel->getMemberInfoByUserID($admin_id);
944
+		if($member_config->identifier == 'email_address') {
945
+					$member_info = $oMemberModel->getMemberInfoByEmailAddress($admin_id);
946
+		} else {
947
+					$member_info = $oMemberModel->getMemberInfoByUserID($admin_id);
948
+		}
888 949
 
889
-		if(!$member_info->member_srl) return;
950
+		if(!$member_info->member_srl) {
951
+			return;
952
+		}
890 953
 		$args = new stdClass();
891 954
 		$args->module_srl = $module_srl;
892 955
 		$args->member_srl = $member_info->member_srl;
@@ -905,7 +968,9 @@  discard block
 block discarded – undo
905 968
 		{
906 969
 			$oMemberModel = getModel('member');
907 970
 			$member_info = $oMemberModel->getMemberInfoByUserID($admin_id);
908
-			if($member_info->member_srl) $args->member_srl = $member_info->member_srl;
971
+			if($member_info->member_srl) {
972
+				$args->member_srl = $member_info->member_srl;
973
+			}
909 974
 		}
910 975
 		return executeQuery('module.deleteAdminId', $args);
911 976
 	}
@@ -949,7 +1014,9 @@  discard block
 block discarded – undo
949 1014
 		}
950 1015
 
951 1016
 		getDestroyXeVars($obj);
952
-		if(!$obj || !count($obj)) return new Object();
1017
+		if(!$obj || !count($obj)) {
1018
+			return new Object();
1019
+		}
953 1020
 
954 1021
 		$args = new stdClass;
955 1022
 		$args->module_srl = $module_srl;
@@ -959,18 +1026,23 @@  discard block
 block discarded – undo
959 1026
 			// it often saved menu item(stdClass) on the skin info column
960 1027
 			// When updating the module on XE core 1.2.0 later versions, it occurs an error
961 1028
 			// fixed the error
962
-			if (is_object($val)) continue;
963
-			if (is_array($val)) $val = serialize($val);
1029
+			if (is_object($val)) {
1030
+				continue;
1031
+			}
1032
+			if (is_array($val)) {
1033
+				$val = serialize($val);
1034
+			}
964 1035
 
965 1036
 			$args->name = trim($key);
966 1037
 			$args->value = trim($val);
967
-			if(!$args->name || !$args->value) continue;
1038
+			if(!$args->name || !$args->value) {
1039
+				continue;
1040
+			}
968 1041
 
969 1042
 			if($mode === 'P')
970 1043
 			{
971 1044
 				$output = executeQuery('module.insertModuleSkinVars', $args);
972
-			}
973
-			else
1045
+			} else
974 1046
 			{
975 1047
 				$output = executeQuery('module.insertModuleMobileSkinVars', $args);
976 1048
 			}
@@ -1017,8 +1089,7 @@  discard block
 block discarded – undo
1017 1089
 		{
1018 1090
 			$object_key = 'module_skin_vars:'.$module_srl;
1019 1091
 			$query = 'module.deleteModuleSkinVars';
1020
-		}
1021
-		else
1092
+		} else
1022 1093
 		{
1023 1094
 			$object_key = 'module_mobile_skin_vars:'.$module_srl;
1024 1095
 			$query = 'module.deleteModuleMobileSkinVars';
@@ -1042,17 +1113,23 @@  discard block
 block discarded – undo
1042 1113
 	{
1043 1114
 		$this->deleteModuleExtraVars($module_srl);
1044 1115
 		getDestroyXeVars($obj);
1045
-		if(!$obj || !count($obj)) return;
1116
+		if(!$obj || !count($obj)) {
1117
+			return;
1118
+		}
1046 1119
 
1047 1120
 		foreach($obj as $key => $val)
1048 1121
 		{
1049
-			if(is_object($val) || is_array($val)) continue;
1122
+			if(is_object($val) || is_array($val)) {
1123
+				continue;
1124
+			}
1050 1125
 
1051 1126
 			$args = new stdClass();
1052 1127
 			$args->module_srl = $module_srl;
1053 1128
 			$args->name = trim($key);
1054 1129
 			$args->value = trim($val);
1055
-			if(!$args->name || !$args->value) continue;
1130
+			if(!$args->name || !$args->value) {
1131
+				continue;
1132
+			}
1056 1133
 			$output = executeQuery('module.insertModuleExtraVars', $args);
1057 1134
 		}
1058 1135
 
@@ -1092,11 +1169,15 @@  discard block
 block discarded – undo
1092 1169
 	function insertModuleGrants($module_srl, $obj)
1093 1170
 	{
1094 1171
 		$this->deleteModuleGrants($module_srl);
1095
-		if(!$obj || !count($obj)) return;
1172
+		if(!$obj || !count($obj)) {
1173
+			return;
1174
+		}
1096 1175
 
1097 1176
 		foreach($obj as $name => $val)
1098 1177
 		{
1099
-			if(!$val || !count($val)) continue;
1178
+			if(!$val || !count($val)) {
1179
+				continue;
1180
+			}
1100 1181
 
1101 1182
 			foreach($val as $group_srl)
1102 1183
 			{
@@ -1104,7 +1185,9 @@  discard block
 block discarded – undo
1104 1185
 				$args->module_srl = $module_srl;
1105 1186
 				$args->name = $name;
1106 1187
 				$args->group_srl = trim($group_srl);
1107
-				if(!$args->name || !$args->group_srl) continue;
1188
+				if(!$args->name || !$args->group_srl) {
1189
+					continue;
1190
+				}
1108 1191
 				executeQuery('module.insertModuleGrant', $args);
1109 1192
 			}
1110 1193
 		}
@@ -1164,7 +1247,9 @@  discard block
 block discarded – undo
1164 1247
 				require_once($cache_file);
1165 1248
 			}
1166 1249
 		}
1167
-		if(!Context::get($matches[1]) && $lang[$matches[1]]) return $lang[$matches[1]];
1250
+		if(!Context::get($matches[1]) && $lang[$matches[1]]) {
1251
+			return $lang[$matches[1]];
1252
+		}
1168 1253
 
1169 1254
 		return str_replace('$user_lang->','',$matches[0]);
1170 1255
 	}
@@ -1176,10 +1261,14 @@  discard block
 block discarded – undo
1176 1261
 	function procModuleFileBoxAdd()
1177 1262
 	{
1178 1263
 		$ajax = Context::get('ajax');
1179
-		if ($ajax) Context::setRequestMethod('JSON');
1264
+		if ($ajax) {
1265
+			Context::setRequestMethod('JSON');
1266
+		}
1180 1267
 
1181 1268
 		$logged_info = Context::get('logged_info');
1182
-		if($logged_info->is_admin !='Y' && !$logged_info->is_site_admin) return new Object(-1, 'msg_not_permitted');
1269
+		if($logged_info->is_admin !='Y' && !$logged_info->is_site_admin) {
1270
+			return new Object(-1, 'msg_not_permitted');
1271
+		}
1183 1272
 
1184 1273
 		$vars = Context::gets('addfile','filter');
1185 1274
 		$attributeNames = Context::get('attribute_name');
@@ -1203,9 +1292,14 @@  discard block
 block discarded – undo
1203 1292
 
1204 1293
 		$ext = strtolower(substr(strrchr($vars->addfile['name'],'.'),1));
1205 1294
 		$vars->ext = $ext;
1206
-		if($vars->filter) $filter = explode(',',$vars->filter);
1207
-		else $filter = array('jpg','jpeg','gif','png');
1208
-		if(!in_array($ext,$filter)) return new Object(-1, 'msg_error_occured');
1295
+		if($vars->filter) {
1296
+			$filter = explode(',',$vars->filter);
1297
+		} else {
1298
+			$filter = array('jpg','jpeg','gif','png');
1299
+		}
1300
+		if(!in_array($ext,$filter)) {
1301
+			return new Object(-1, 'msg_error_occured');
1302
+		}
1209 1303
 
1210 1304
 		$vars->member_srl = $logged_info->member_srl;
1211 1305
 
@@ -1218,10 +1312,16 @@  discard block
 block discarded – undo
1218 1312
 		// insert
1219 1313
 		else
1220 1314
 		{
1221
-			if(!Context::isUploaded()) return new Object(-1, 'msg_error_occured');
1315
+			if(!Context::isUploaded()) {
1316
+				return new Object(-1, 'msg_error_occured');
1317
+			}
1222 1318
 			$addfile = Context::get('addfile');
1223
-			if(!is_uploaded_file($addfile['tmp_name'])) return new Object(-1, 'msg_error_occured');
1224
-			if($vars->addfile['error'] != 0) return new Object(-1, 'msg_error_occured');
1319
+			if(!is_uploaded_file($addfile['tmp_name'])) {
1320
+				return new Object(-1, 'msg_error_occured');
1321
+			}
1322
+			if($vars->addfile['error'] != 0) {
1323
+				return new Object(-1, 'msg_error_occured');
1324
+			}
1225 1325
 			$output = $this->insertModuleFileBox($vars);
1226 1326
 		}
1227 1327
 
@@ -1232,11 +1332,13 @@  discard block
 block discarded – undo
1232 1332
 			$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispModuleAdminFileBox');
1233 1333
 			$this->setRedirectUrl($returnUrl);
1234 1334
 			return;
1235
-		}
1236
-		else
1335
+		} else
1237 1336
 		{
1238
-			if($output) $this->add('save_filename', $output->get('save_filename'));
1239
-			else $this->add('save_filename', '');
1337
+			if($output) {
1338
+				$this->add('save_filename', $output->get('save_filename'));
1339
+			} else {
1340
+				$this->add('save_filename', '');
1341
+			}
1240 1342
 		}
1241 1343
 	}
1242 1344
 
@@ -1260,7 +1362,9 @@  discard block
 block discarded – undo
1260 1362
 			$tmp = $vars->addfile['tmp_name'];
1261 1363
 
1262 1364
 			// Check uploaded file
1263
-			if(!checkUploadedFile($tmp)) return false;
1365
+			if(!checkUploadedFile($tmp)) {
1366
+				return false;
1367
+			}
1264 1368
 
1265 1369
 			if(!@move_uploaded_file($tmp, $save_filename))
1266 1370
 			{
@@ -1297,7 +1401,9 @@  discard block
 block discarded – undo
1297 1401
 		$tmp = $vars->addfile['tmp_name'];
1298 1402
 
1299 1403
 		// Check uploaded file
1300
-		if(!checkUploadedFile($tmp)) return false;
1404
+		if(!checkUploadedFile($tmp)) {
1405
+			return false;
1406
+		}
1301 1407
 
1302 1408
 		// upload
1303 1409
 		if(!@move_uploaded_file($tmp, $save_filename))
@@ -1326,14 +1432,20 @@  discard block
 block discarded – undo
1326 1432
 	function procModuleFileBoxDelete()
1327 1433
 	{
1328 1434
 		$logged_info = Context::get('logged_info');
1329
-		if($logged_info->is_admin !='Y' && !$logged_info->is_site_admin) return new Object(-1, 'msg_not_permitted');
1435
+		if($logged_info->is_admin !='Y' && !$logged_info->is_site_admin) {
1436
+			return new Object(-1, 'msg_not_permitted');
1437
+		}
1330 1438
 
1331 1439
 		$module_filebox_srl = Context::get('module_filebox_srl');
1332
-		if(!$module_filebox_srl) return new Object(-1, 'msg_invalid_request');
1440
+		if(!$module_filebox_srl) {
1441
+			return new Object(-1, 'msg_invalid_request');
1442
+		}
1333 1443
 		$vars = new stdClass();
1334 1444
 		$vars->module_filebox_srl = $module_filebox_srl;
1335 1445
 		$output = $this->deleteModuleFileBox($vars);
1336
-		if(!$output->toBool()) return $output;
1446
+		if(!$output->toBool()) {
1447
+			return $output;
1448
+		}
1337 1449
 	}
1338 1450
 
1339 1451
 	function deleteModuleFileBox($vars)
@@ -1356,9 +1468,13 @@  discard block
 block discarded – undo
1356 1468
 		$this->unlockTimeoutPassed();
1357 1469
 		$args = new stdClass;
1358 1470
 		$args->lock_name = $lock_name;
1359
-		if(!$timeout) $timeout = 60;
1471
+		if(!$timeout) {
1472
+			$timeout = 60;
1473
+		}
1360 1474
 		$args->deadline = date("YmdHis", $_SERVER['REQUEST_TIME'] + $timeout);
1361
-		if($member_srl) $args->member_srl = $member_srl;
1475
+		if($member_srl) {
1476
+			$args->member_srl = $member_srl;
1477
+		}
1362 1478
 		$output = executeQuery('module.insertLock', $args);
1363 1479
 		if($output->toBool())
1364 1480
 		{
Please login to merge, or discard this patch.
Spacing   +160 added lines, -160 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 		$output = executeQuery('module.insertActionForward', $args);
30 30
 
31 31
 		$oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE);
32
-		if($oCacheHandler->isSupport())
32
+		if ($oCacheHandler->isSupport())
33 33
 		{
34 34
 			$cache_key = 'action_forward';
35 35
 			$oCacheHandler->delete($cache_key);
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 		$output = executeQuery('module.deleteActionForward', $args);
52 52
 
53 53
 		$oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE);
54
-		if($oCacheHandler->isSupport())
54
+		if ($oCacheHandler->isSupport())
55 55
 		{
56 56
 			$cache_key = 'action_forward';
57 57
 			$oCacheHandler->delete($cache_key);
@@ -75,12 +75,12 @@  discard block
 block discarded – undo
75 75
 		$args->called_position = $called_position;
76 76
 
77 77
 		$output = executeQuery('module.insertTrigger', $args);
78
-		if($output->toBool())
78
+		if ($output->toBool())
79 79
 		{
80 80
 			//remove from cache
81 81
 			$GLOBALS['__triggers__'] = NULL;
82 82
 			$oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE);
83
-			if($oCacheHandler->isSupport())
83
+			if ($oCacheHandler->isSupport())
84 84
 			{
85 85
 				$cache_key = 'triggers';
86 86
 				$oCacheHandler->delete($cache_key);
@@ -104,12 +104,12 @@  discard block
 block discarded – undo
104 104
 		$args->called_position = $called_position;
105 105
 
106 106
 		$output = executeQuery('module.deleteTrigger', $args);
107
-		if($output->toBool())
107
+		if ($output->toBool())
108 108
 		{
109 109
 			//remove from cache
110 110
 			$GLOBALS['__triggers__'] = NULL;
111 111
 			$oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE);
112
-			if($oCacheHandler->isSupport())
112
+			if ($oCacheHandler->isSupport())
113 113
 			{
114 114
 				$cache_key = 'triggers';
115 115
 				$oCacheHandler->delete($cache_key);
@@ -129,12 +129,12 @@  discard block
 block discarded – undo
129 129
 		$args->module = $module;
130 130
 
131 131
 		$output = executeQuery('module.deleteModuleTriggers', $args);
132
-		if($output->toBool())
132
+		if ($output->toBool())
133 133
 		{
134 134
 			//remove from cache
135 135
 			$GLOBALS['__triggers__'] = NULL;
136 136
 			$oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE);
137
-			if($oCacheHandler->isSupport())
137
+			if ($oCacheHandler->isSupport())
138 138
 			{
139 139
 				$cache_key = 'triggers';
140 140
 				$oCacheHandler->delete($cache_key);
@@ -148,11 +148,11 @@  discard block
 block discarded – undo
148 148
 	 * @brief Add module extend
149 149
 	 *
150 150
 	 */
151
-	function insertModuleExtend($parent_module, $extend_module, $type, $kind='')
151
+	function insertModuleExtend($parent_module, $extend_module, $type, $kind = '')
152 152
 	{
153
-		if($kind != 'admin') $kind = '';
154
-		if(!in_array($type,array('model','controller','view','api','mobile'))) return false;
155
-		if(in_array($parent_module, array('module','addon','widget','layout'))) return false;
153
+		if ($kind != 'admin') $kind = '';
154
+		if (!in_array($type, array('model', 'controller', 'view', 'api', 'mobile'))) return false;
155
+		if (in_array($parent_module, array('module', 'addon', 'widget', 'layout'))) return false;
156 156
 
157 157
 		$cache_file = './files/config/module_extend.php';
158 158
 		FileHandler::removeFile($cache_file);
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 		$args->kind = $kind;
165 165
 
166 166
 		$output = executeQuery('module.getModuleExtendCount', $args);
167
-		if($output->data->count>0) return false;
167
+		if ($output->data->count > 0) return false;
168 168
 
169 169
 		$output = executeQuery('module.insertModuleExtend', $args);
170 170
 		return $output;
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 	 * @brief Delete module extend
175 175
 	 *
176 176
 	 */
177
-	function deleteModuleExtend($parent_module, $extend_module, $type, $kind='')
177
+	function deleteModuleExtend($parent_module, $extend_module, $type, $kind = '')
178 178
 	{
179 179
 		$cache_file = './files/config/module_extend.php';
180 180
 		FileHandler::removeFile($cache_file);
@@ -199,9 +199,9 @@  discard block
 block discarded – undo
199 199
 		$oModuleModel = getModel('module');
200 200
 		$origin_config = $oModuleModel->getModuleConfig($module, $site_srl);
201 201
 
202
-		if(!$origin_config) $origin_config = new stdClass;
202
+		if (!$origin_config) $origin_config = new stdClass;
203 203
 
204
-		foreach($config as $key => $val)
204
+		foreach ($config as $key => $val)
205 205
 		{
206 206
 			$origin_config->{$key} = $val;
207 207
 		}
@@ -215,19 +215,19 @@  discard block
 block discarded – undo
215 215
 	 */
216 216
 	function insertModuleConfig($module, $config, $site_srl = 0)
217 217
 	{
218
-		$args =new stdClass();
218
+		$args = new stdClass();
219 219
 		$args->module = $module;
220 220
 		$args->config = serialize($config);
221 221
 		$args->site_srl = $site_srl;
222 222
 
223 223
 		$output = executeQuery('module.deleteModuleConfig', $args);
224
-		if(!$output->toBool()) return $output;
224
+		if (!$output->toBool()) return $output;
225 225
 
226 226
 		$output = executeQuery('module.insertModuleConfig', $args);
227 227
 
228 228
 		//remove from cache
229 229
 		$oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE);
230
-		if($oCacheHandler->isSupport())
230
+		if ($oCacheHandler->isSupport())
231 231
 		{
232 232
 			$oCacheHandler->invalidateGroupKey('site_and_module');
233 233
 		}
@@ -246,13 +246,13 @@  discard block
 block discarded – undo
246 246
 		$args->config = serialize($config);
247 247
 
248 248
 		$output = executeQuery('module.deleteModulePartConfig', $args);
249
-		if(!$output->toBool()) return $output;
249
+		if (!$output->toBool()) return $output;
250 250
 
251 251
 		$output = executeQuery('module.insertModulePartConfig', $args);
252 252
 
253 253
 		//remove from cache
254 254
 		$oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE);
255
-		if($oCacheHandler->isSupport())
255
+		if ($oCacheHandler->isSupport())
256 256
 		{
257 257
 			$oCacheHandler->invalidateGroupKey('site_and_module');
258 258
 		}
@@ -265,10 +265,10 @@  discard block
 block discarded – undo
265 265
 	 */
266 266
 	function insertSite($domain, $index_module_srl)
267 267
 	{
268
-		if(isSiteID($domain))
268
+		if (isSiteID($domain))
269 269
 		{
270 270
 			$oModuleModel = getModel('module');
271
-			if($oModuleModel->isIDExists($domain, 0)) return new Object(-1,'msg_already_registed_vid');
271
+			if ($oModuleModel->isIDExists($domain, 0)) return new Object(-1, 'msg_already_registed_vid');
272 272
 		}
273 273
 		else
274 274
 		{
@@ -284,10 +284,10 @@  discard block
 block discarded – undo
284 284
 		$columnList = array('modules.site_srl');
285 285
 		$oModuleModel = getModel('module');
286 286
 		$output = $oModuleModel->getSiteInfoByDomain($args->domain, $columnList);
287
-		if($output) return new Object(-1,'msg_already_registed_vid');
287
+		if ($output) return new Object(-1, 'msg_already_registed_vid');
288 288
 
289 289
 		$output = executeQuery('module.insertSite', $args);
290
-		if(!$output->toBool()) return $output;
290
+		if (!$output->toBool()) return $output;
291 291
 
292 292
 		$output->add('site_srl', $args->site_srl);
293 293
 		return $output;
@@ -302,32 +302,32 @@  discard block
 block discarded – undo
302 302
 		$columnList = array('sites.site_srl', 'sites.domain');
303 303
 		$site_info = $oModuleModel->getSiteInfo($args->site_srl, $columnList);
304 304
 
305
-		if(!$args->domain && $site_info->site_srl == $args->site_srl)
305
+		if (!$args->domain && $site_info->site_srl == $args->site_srl)
306 306
 		{
307 307
 			$args->domain = $site_info->domain;
308 308
 		}
309 309
 
310
-		if($site_info->domain != $args->domain)
310
+		if ($site_info->domain != $args->domain)
311 311
 		{
312 312
 			$info = $oModuleModel->getSiteInfoByDomain($args->domain, $columnList);
313
-			if($info->site_srl && $info->site_srl != $args->site_srl) return new Object(-1,'msg_already_registed_domain');
314
-			if(isSiteID($args->domain) && $oModuleModel->isIDExists($args->domain)) return new Object(-1,'msg_already_registed_vid');
313
+			if ($info->site_srl && $info->site_srl != $args->site_srl) return new Object(-1, 'msg_already_registed_domain');
314
+			if (isSiteID($args->domain) && $oModuleModel->isIDExists($args->domain)) return new Object(-1, 'msg_already_registed_vid');
315 315
 
316
-			if($args->domain && !isSiteID($args->domain))
316
+			if ($args->domain && !isSiteID($args->domain))
317 317
 			{
318 318
 				$args->domain = (strlen($args->domain) >= 1 && substr_compare($args->domain, '/', -1) === 0) ? substr($args->domain, 0, -1) : $args->domain;
319 319
 			}
320 320
 		}
321 321
 		$output = executeQuery('module.updateSite', $args);
322 322
 		//clear cache for default mid
323
-		if($args->site_srl == 0) $vid='';
324
-		else $vid=$args->domain;
323
+		if ($args->site_srl == 0) $vid = '';
324
+		else $vid = $args->domain;
325 325
 
326 326
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($args->index_module_srl);
327 327
 		$mid = $module_info->mid;
328 328
 
329 329
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
330
-		if($oCacheHandler->isSupport())
330
+		if ($oCacheHandler->isSupport())
331 331
 		{
332 332
 			$oCacheHandler->invalidateGroupKey('site_and_module');
333 333
 		}
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
 		unset($args->act);
346 346
 		unset($args->page);
347 347
 		// Test mid value
348
-		if(!preg_match("/^[a-z][a-z0-9_]+$/i", $args->mid)) return new Object(-1, 'msg_limit_mid');
348
+		if (!preg_match("/^[a-z][a-z0-9_]+$/i", $args->mid)) return new Object(-1, 'msg_limit_mid');
349 349
 		// Test variables (separate basic vars and other vars in modules)
350 350
 		$extra_vars = clone($args);
351 351
 		unset($extra_vars->module_srl);
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
 	 */
380 380
 	function insertModule($args)
381 381
 	{
382
-		if(isset($args->isMenuCreate))
382
+		if (isset($args->isMenuCreate))
383 383
 		{
384 384
 			$isMenuCreate = $args->isMenuCreate;
385 385
 		}
@@ -389,11 +389,11 @@  discard block
 block discarded – undo
389 389
 		}
390 390
 
391 391
 		$output = $this->arrangeModuleInfo($args, $extra_vars);
392
-		if(!$output->toBool()) return $output;
392
+		if (!$output->toBool()) return $output;
393 393
 		// Check whether the module name already exists
394
-		if(!$args->site_srl) $args->site_srl = 0;
394
+		if (!$args->site_srl) $args->site_srl = 0;
395 395
 		$oModuleModel = getModel('module');
396
-		if($oModuleModel->isIDExists($args->mid, $args->site_srl)) return new Object(-1, 'msg_module_name_exists');
396
+		if ($oModuleModel->isIDExists($args->mid, $args->site_srl)) return new Object(-1, 'msg_module_name_exists');
397 397
 
398 398
 		// begin transaction
399 399
 		$oDB = &DB::getInstance();
@@ -404,16 +404,16 @@  discard block
 block discarded – undo
404 404
 		$skin_vars = new stdClass();
405 405
 		$skin_vars->colorset = $skin_info->colorset[0]->name;
406 406
 		// Arrange variables and then execute a query
407
-		if(!$args->module_srl) $args->module_srl = getNextSequence();
407
+		if (!$args->module_srl) $args->module_srl = getNextSequence();
408 408
 
409 409
 		// default value
410
-		if($args->skin == '/USE_DEFAULT/')
410
+		if ($args->skin == '/USE_DEFAULT/')
411 411
 		{
412 412
 			$args->is_skin_fix = 'N';
413 413
 		}
414 414
 		else
415 415
 		{
416
-			if(isset($args->is_skin_fix))
416
+			if (isset($args->is_skin_fix))
417 417
 			{
418 418
 				$args->is_skin_fix = ($args->is_skin_fix != 'Y') ? 'N' : 'Y';
419 419
 			}
@@ -423,13 +423,13 @@  discard block
 block discarded – undo
423 423
 			}
424 424
 		}
425 425
 
426
-		if($args->mskin == '/USE_DEFAULT/')
426
+		if ($args->mskin == '/USE_DEFAULT/')
427 427
 		{
428 428
 			$args->is_mskin_fix = 'N';
429 429
 		}
430 430
 		else
431 431
 		{
432
-			if(isset($args->is_mskin_fix))
432
+			if (isset($args->is_mskin_fix))
433 433
 			{
434 434
 				$args->is_mskin_fix = ($args->is_mskin_fix != 'Y') ? 'N' : 'Y';
435 435
 			}
@@ -443,14 +443,14 @@  discard block
 block discarded – undo
443 443
 
444 444
 		$args->browser_title = strip_tags($args->browser_title);
445 445
 
446
-		if($isMenuCreate == TRUE)
446
+		if ($isMenuCreate == TRUE)
447 447
 		{
448 448
 			$menuArgs = new stdClass;
449 449
 			$menuArgs->menu_srl = $args->menu_srl;
450 450
 			$menuOutput = executeQuery('menu.getMenu', $menuArgs);
451 451
 
452 452
 			// if menu is not created, create menu also. and does not supported that in virtual site.
453
-			if(!$menuOutput->data && !$args->site_srl)
453
+			if (!$menuOutput->data && !$args->site_srl)
454 454
 			{
455 455
 				$oMenuAdminModel = getAdminModel('menu');
456 456
 
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
 				$menuArgs->listorder = $args->menu_item_srl * -1;
469 469
 
470 470
 				$menuItemOutput = executeQuery('menu.insertMenuItem', $menuArgs);
471
-				if(!$menuItemOutput->toBool())
471
+				if (!$menuItemOutput->toBool())
472 472
 				{
473 473
 					$oDB->rollback();
474 474
 					return $menuItemOutput;
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
 		// Insert a module
482 482
 		$args->menu_srl = $menuArgs->menu_srl;
483 483
 		$output = executeQuery('module.insertModule', $args);
484
-		if(!$output->toBool())
484
+		if (!$output->toBool())
485 485
 		{
486 486
 			$oDB->rollback();
487 487
 			return $output;
@@ -493,12 +493,12 @@  discard block
 block discarded – undo
493 493
 		$oDB->commit();
494 494
 
495 495
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
496
-		if($oCacheHandler->isSupport())
496
+		if ($oCacheHandler->isSupport())
497 497
 		{
498 498
 			$oCacheHandler->invalidateGroupKey('site_and_module');
499 499
 		}
500 500
 
501
-		$output->add('module_srl',$args->module_srl);
501
+		$output->add('module_srl', $args->module_srl);
502 502
 		return $output;
503 503
 	}
504 504
 
@@ -508,7 +508,7 @@  discard block
 block discarded – undo
508 508
 	function updateModule($args)
509 509
 	{
510 510
 		$output = $this->arrangeModuleInfo($args, $extra_vars);
511
-		if(!$output->toBool()) return $output;
511
+		if (!$output->toBool()) return $output;
512 512
 		// begin transaction
513 513
 		$oDB = &DB::getInstance();
514 514
 		$oDB->begin();
@@ -517,29 +517,29 @@  discard block
 block discarded – undo
517 517
 		$columnList = array('module_srl', 'site_srl', 'browser_title', 'mid');
518 518
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($args->module_srl);
519 519
 
520
-		if(!$args->site_srl || !$args->browser_title)
520
+		if (!$args->site_srl || !$args->browser_title)
521 521
 		{
522
-			if(!$args->site_srl) $args->site_srl = (int)$module_info->site_srl;
523
-			if(!$args->browser_title) $args->browser_title = $module_info->browser_title;
522
+			if (!$args->site_srl) $args->site_srl = (int) $module_info->site_srl;
523
+			if (!$args->browser_title) $args->browser_title = $module_info->browser_title;
524 524
 		}
525 525
 
526 526
 		$args->browser_title = strip_tags($args->browser_title);
527 527
 
528 528
 		$output = executeQuery('module.isExistsModuleName', $args);
529
-		if(!$output->toBool() || $output->data->count)
529
+		if (!$output->toBool() || $output->data->count)
530 530
 		{
531 531
 			$oDB->rollback();
532 532
 			return new Object(-1, 'msg_module_name_exists');
533 533
 		}
534 534
 
535 535
 		// default value
536
-		if($args->skin == '/USE_DEFAULT/')
536
+		if ($args->skin == '/USE_DEFAULT/')
537 537
 		{
538 538
 			$args->is_skin_fix = 'N';
539 539
 		}
540 540
 		else
541 541
 		{
542
-			if(isset($args->is_skin_fix))
542
+			if (isset($args->is_skin_fix))
543 543
 			{
544 544
 				$args->is_skin_fix = ($args->is_skin_fix != 'Y') ? 'N' : 'Y';
545 545
 			}
@@ -549,13 +549,13 @@  discard block
 block discarded – undo
549 549
 			}
550 550
 		}
551 551
 
552
-		if($args->mskin == '/USE_DEFAULT/')
552
+		if ($args->mskin == '/USE_DEFAULT/')
553 553
 		{
554 554
 			$args->is_mskin_fix = 'N';
555 555
 		}
556 556
 		else
557 557
 		{
558
-			if(isset($args->is_mskin_fix))
558
+			if (isset($args->is_mskin_fix))
559 559
 			{
560 560
 				$args->is_mskin_fix = ($args->is_mskin_fix != 'Y') ? 'N' : 'Y';
561 561
 			}
@@ -565,7 +565,7 @@  discard block
 block discarded – undo
565 565
 			}
566 566
 		}
567 567
 		$output = executeQuery('module.updateModule', $args);
568
-		if(!$output->toBool())
568
+		if (!$output->toBool())
569 569
 		{
570 570
 			$oDB->rollback();
571 571
 			return $output;
@@ -575,15 +575,15 @@  discard block
 block discarded – undo
575 575
 		$menuArgs->url = $module_info->mid;
576 576
 		$menuArgs->site_srl = $module_info->site_srl;
577 577
 		$menuOutput = executeQueryArray('menu.getMenuItemByUrl', $menuArgs);
578
-		if($menuOutput->data && count($menuOutput->data))
578
+		if ($menuOutput->data && count($menuOutput->data))
579 579
 		{
580 580
 			$oMenuAdminController = getAdminController('menu');
581
-			foreach($menuOutput->data as $itemInfo)
581
+			foreach ($menuOutput->data as $itemInfo)
582 582
 			{
583 583
 				$itemInfo->url = $args->mid;
584 584
 
585 585
 				$updateMenuItemOutput = $oMenuAdminController->updateMenuItem($itemInfo);
586
-				if(!$updateMenuItemOutput->toBool())
586
+				if (!$updateMenuItemOutput->toBool())
587 587
 				{
588 588
 					$oDB->rollback();
589 589
 					return $updateMenuItemOutput;
@@ -592,7 +592,7 @@  discard block
 block discarded – undo
592 592
 		}
593 593
 
594 594
 		// if mid changed, change mid of success_return_url to new mid
595
-		if($module_info->mid != $args->mid && Context::get('success_return_url'))
595
+		if ($module_info->mid != $args->mid && Context::get('success_return_url'))
596 596
 		{
597 597
 			changeValueInUrl('mid', $args->mid, $module_info->mid);
598 598
 		}
@@ -602,11 +602,11 @@  discard block
 block discarded – undo
602 602
 
603 603
 		$oDB->commit();
604 604
 
605
-		$output->add('module_srl',$args->module_srl);
605
+		$output->add('module_srl', $args->module_srl);
606 606
 
607 607
 		//remove from cache
608 608
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
609
-		if($oCacheHandler->isSupport())
609
+		if ($oCacheHandler->isSupport())
610 610
 		{
611 611
 			$oCacheHandler->invalidateGroupKey('site_and_module');
612 612
 		}
@@ -624,11 +624,11 @@  discard block
 block discarded – undo
624 624
 		$args->site_srl = $site_srl;
625 625
 		$args->layout_srl = $layout_srl;
626 626
 		$output = executeQuery('module.updateModuleSite', $args);
627
-		if(!$output->toBool()) return $output;
627
+		if (!$output->toBool()) return $output;
628 628
 
629 629
 		//remove from cache
630 630
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
631
-		if($oCacheHandler->isSupport())
631
+		if ($oCacheHandler->isSupport())
632 632
 		{
633 633
 			$oCacheHandler->invalidateGroupKey('site_and_module');
634 634
 		}
@@ -643,7 +643,7 @@  discard block
 block discarded – undo
643 643
 	 */
644 644
 	function deleteModule($module_srl, $site_srl = 0)
645 645
 	{
646
-		if(!$module_srl) return new Object(-1,'msg_invalid_request');
646
+		if (!$module_srl) return new Object(-1, 'msg_invalid_request');
647 647
 
648 648
 		$site_module_info = Context::get('site_module_info');
649 649
 
@@ -653,7 +653,7 @@  discard block
 block discarded – undo
653 653
 		$args = new stdClass();
654 654
 		$args->url = $output->mid;
655 655
 		$args->is_shortcut = 'N';
656
-		if(!$site_srl) $args->site_srl = $site_module_info->site_srl;
656
+		if (!$site_srl) $args->site_srl = $site_module_info->site_srl;
657 657
 		else $args->site_srl = $site_srl;
658 658
 
659 659
 		unset($output);
@@ -662,9 +662,9 @@  discard block
 block discarded – undo
662 662
 		$menuOutput = $oMenuAdminModel->getMenuList($args);
663 663
 
664 664
 		// get menu_srl by site_srl
665
-		if(is_array($menuOutput->data))
665
+		if (is_array($menuOutput->data))
666 666
 		{
667
-			foreach($menuOutput->data AS $key=>$value)
667
+			foreach ($menuOutput->data AS $key=>$value)
668 668
 			{
669 669
 				$args->menu_srl = $value->menu_srl;
670 670
 				break;
@@ -673,7 +673,7 @@  discard block
 block discarded – undo
673 673
 
674 674
 		$output = executeQuery('menu.getMenuItemByUrl', $args);
675 675
 		// menu delete
676
-		if($output->data)
676
+		if ($output->data)
677 677
 		{
678 678
 			unset($args);
679 679
 			$args = new stdClass;
@@ -684,7 +684,7 @@  discard block
 block discarded – undo
684 684
 			$oMenuAdminController = getAdminController('menu');
685 685
 			$output = $oMenuAdminController->deleteItem($args);
686 686
 
687
-			if($output->isSuccess)
687
+			if ($output->isSuccess)
688 688
 			{
689 689
 				return new Object(0, 'success_deleted');
690 690
 			}
@@ -706,19 +706,19 @@  discard block
 block discarded – undo
706 706
 	 */
707 707
 	public function onlyDeleteModule($module_srl)
708 708
 	{
709
-		if(!$module_srl) return new Object(-1,'msg_invalid_request');
709
+		if (!$module_srl) return new Object(-1, 'msg_invalid_request');
710 710
 
711 711
 		// check start module
712 712
 		$oModuleModel = getModel('module');
713 713
 		$columnList = array('sites.index_module_srl');
714 714
 		$start_module = $oModuleModel->getSiteInfo(0, $columnList);
715
-		if($module_srl == $start_module->index_module_srl) return new Object(-1, 'msg_cannot_delete_startmodule');
715
+		if ($module_srl == $start_module->index_module_srl) return new Object(-1, 'msg_cannot_delete_startmodule');
716 716
 
717 717
 		// Call a trigger (before)
718 718
 		$trigger_obj = new stdClass();
719 719
 		$trigger_obj->module_srl = $module_srl;
720 720
 		$output = ModuleHandler::triggerCall('module.deleteModule', 'before', $trigger_obj);
721
-		if(!$output->toBool()) return $output;
721
+		if (!$output->toBool()) return $output;
722 722
 
723 723
 		// begin transaction
724 724
 		$oDB = &DB::getInstance();
@@ -728,7 +728,7 @@  discard block
 block discarded – undo
728 728
 		$args->module_srl = $module_srl;
729 729
 		// Delete module information from the DB
730 730
 		$output = executeQuery('module.deleteModule', $args);
731
-		if(!$output->toBool())
731
+		if (!$output->toBool())
732 732
 		{
733 733
 			$oDB->rollback();
734 734
 			return $output;
@@ -742,10 +742,10 @@  discard block
 block discarded – undo
742 742
 		// Remove the module manager
743 743
 		$this->deleteAdminId($module_srl);
744 744
 		// Call a trigger (after)
745
-		if($output->toBool())
745
+		if ($output->toBool())
746 746
 		{
747 747
 			$trigger_output = ModuleHandler::triggerCall('module.deleteModule', 'after', $trigger_obj);
748
-			if(!$trigger_output->toBool())
748
+			if (!$trigger_output->toBool())
749 749
 			{
750 750
 				$oDB->rollback();
751 751
 				return $trigger_output;
@@ -757,7 +757,7 @@  discard block
 block discarded – undo
757 757
 
758 758
 		//remove from cache
759 759
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
760
-		if($oCacheHandler->isSupport())
760
+		if ($oCacheHandler->isSupport())
761 761
 		{
762 762
 			$oCacheHandler->invalidateGroupKey('site_and_module');
763 763
 		}
@@ -779,10 +779,10 @@  discard block
 block discarded – undo
779 779
 	function clearDefaultModule()
780 780
 	{
781 781
 		$output = executeQuery('module.clearDefaultModule');
782
-		if(!$output->toBool()) return $output;
782
+		if (!$output->toBool()) return $output;
783 783
 
784 784
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
785
-		if($oCacheHandler->isSupport())
785
+		if ($oCacheHandler->isSupport())
786 786
 		{
787 787
 			$oCacheHandler->invalidateGroupKey('site_and_module');
788 788
 		}
@@ -798,7 +798,7 @@  discard block
 block discarded – undo
798 798
 		$output = executeQuery('module.updateModuleMenu', $args);
799 799
 
800 800
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
801
-		if($oCacheHandler->isSupport())
801
+		if ($oCacheHandler->isSupport())
802 802
 		{
803 803
 			$oCacheHandler->invalidateGroupKey('site_and_module');
804 804
 		}
@@ -811,15 +811,15 @@  discard block
 block discarded – undo
811 811
 	 */
812 812
 	function updateModuleLayout($layout_srl, $menu_srl_list)
813 813
 	{
814
-		if(!count($menu_srl_list)) return;
814
+		if (!count($menu_srl_list)) return;
815 815
 
816 816
 		$args = new stdClass;
817 817
 		$args->layout_srl = $layout_srl;
818
-		$args->menu_srls = implode(',',$menu_srl_list);
818
+		$args->menu_srls = implode(',', $menu_srl_list);
819 819
 		$output = executeQuery('module.updateModuleLayout', $args);
820 820
 
821 821
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
822
-		if($oCacheHandler->isSupport())
822
+		if ($oCacheHandler->isSupport())
823 823
 		{
824 824
 			$oCacheHandler->invalidateGroupKey('site_and_module');
825 825
 		}
@@ -838,37 +838,37 @@  discard block
 block discarded – undo
838 838
 
839 839
 		$output = executeQuery('module.deleteSiteAdmin', $args);
840 840
 
841
-		if(!$output->toBool()) return $output;
841
+		if (!$output->toBool()) return $output;
842 842
 		// Get user id of an administrator
843
-		if(!is_array($arr_admins) || !count($arr_admins)) return new Object();
844
-		foreach($arr_admins as $key => $user_id)
843
+		if (!is_array($arr_admins) || !count($arr_admins)) return new Object();
844
+		foreach ($arr_admins as $key => $user_id)
845 845
 		{
846
-			if(!trim($user_id)) continue;
846
+			if (!trim($user_id)) continue;
847 847
 			$admins[] = trim($user_id);
848 848
 		}
849
-		if(!count($admins)) return new Object();
849
+		if (!count($admins)) return new Object();
850 850
 
851 851
 		$oMemberModel = getModel('member');
852 852
 		$member_config = $oMemberModel->getMemberConfig();
853
-		if($member_config->identifier == 'email_address')
853
+		if ($member_config->identifier == 'email_address')
854 854
 		{
855
-			$args->email_address = '\''.implode('\',\'',$admins).'\'';
855
+			$args->email_address = '\''.implode('\',\'', $admins).'\'';
856 856
 		}
857 857
 		else
858 858
 		{
859
-			$args->user_ids = '\''.implode('\',\'',$admins).'\'';
859
+			$args->user_ids = '\''.implode('\',\'', $admins).'\'';
860 860
 		}
861 861
 		$output = executeQueryArray('module.getAdminSrls', $args);
862
-		if(!$output->toBool()||!$output->data) return $output;
862
+		if (!$output->toBool() || !$output->data) return $output;
863 863
 
864
-		foreach($output->data as $key => $val)
864
+		foreach ($output->data as $key => $val)
865 865
 		{
866 866
 			unset($args);
867 867
 			$args = new stdClass;
868 868
 			$args->site_srl = $site_srl;
869 869
 			$args->member_srl = $val->member_srl;
870 870
 			$output = executeQueryArray('module.insertSiteAdmin', $args);
871
-			if(!$output->toBool()) return $output;
871
+			if (!$output->toBool()) return $output;
872 872
 		}
873 873
 		return new Object();
874 874
 	}
@@ -881,12 +881,12 @@  discard block
 block discarded – undo
881 881
 		$oMemberModel = getModel('member');
882 882
 		$member_config = $oMemberModel->getMemberConfig();
883 883
 
884
-		if($member_config->identifier == 'email_address')
884
+		if ($member_config->identifier == 'email_address')
885 885
 			$member_info = $oMemberModel->getMemberInfoByEmailAddress($admin_id);
886 886
 		else
887 887
 			$member_info = $oMemberModel->getMemberInfoByUserID($admin_id);
888 888
 
889
-		if(!$member_info->member_srl) return;
889
+		if (!$member_info->member_srl) return;
890 890
 		$args = new stdClass();
891 891
 		$args->module_srl = $module_srl;
892 892
 		$args->member_srl = $member_info->member_srl;
@@ -901,11 +901,11 @@  discard block
 block discarded – undo
901 901
 		$args = new stdClass();
902 902
 		$args->module_srl = $module_srl;
903 903
 
904
-		if($admin_id)
904
+		if ($admin_id)
905 905
 		{
906 906
 			$oMemberModel = getModel('member');
907 907
 			$member_info = $oMemberModel->getMemberInfoByUserID($admin_id);
908
-			if($member_info->member_srl) $args->member_srl = $member_info->member_srl;
908
+			if ($member_info->member_srl) $args->member_srl = $member_info->member_srl;
909 909
 		}
910 910
 		return executeQuery('module.deleteAdminId', $args);
911 911
 	}
@@ -942,18 +942,18 @@  discard block
 block discarded – undo
942 942
 		$oDB->begin();
943 943
 
944 944
 		$output = $this->_deleteModuleSkinVars($module_srl, $mode);
945
-		if(!$output->toBool())
945
+		if (!$output->toBool())
946 946
 		{
947 947
 			$oDB->rollback();
948 948
 			return $output;
949 949
 		}
950 950
 
951 951
 		getDestroyXeVars($obj);
952
-		if(!$obj || !count($obj)) return new Object();
952
+		if (!$obj || !count($obj)) return new Object();
953 953
 
954 954
 		$args = new stdClass;
955 955
 		$args->module_srl = $module_srl;
956
-		foreach($obj as $key => $val)
956
+		foreach ($obj as $key => $val)
957 957
 		{
958 958
 			// #17927989 For an old board which used the old blog module
959 959
 			// it often saved menu item(stdClass) on the skin info column
@@ -964,9 +964,9 @@  discard block
 block discarded – undo
964 964
 
965 965
 			$args->name = trim($key);
966 966
 			$args->value = trim($val);
967
-			if(!$args->name || !$args->value) continue;
967
+			if (!$args->name || !$args->value) continue;
968 968
 
969
-			if($mode === 'P')
969
+			if ($mode === 'P')
970 970
 			{
971 971
 				$output = executeQuery('module.insertModuleSkinVars', $args);
972 972
 			}
@@ -974,7 +974,7 @@  discard block
 block discarded – undo
974 974
 			{
975 975
 				$output = executeQuery('module.insertModuleMobileSkinVars', $args);
976 976
 			}
977
-			if(!$output->toBool())
977
+			if (!$output->toBool())
978 978
 			{
979 979
 				return $output;
980 980
 				$oDB->rollback();
@@ -1013,7 +1013,7 @@  discard block
 block discarded – undo
1013 1013
 		$args->module_srl = $module_srl;
1014 1014
 		$mode = $mode === 'P' ? 'P' : 'M';
1015 1015
 
1016
-		if($mode === 'P')
1016
+		if ($mode === 'P')
1017 1017
 		{
1018 1018
 			$object_key = 'module_skin_vars:'.$module_srl;
1019 1019
 			$query = 'module.deleteModuleSkinVars';
@@ -1027,7 +1027,7 @@  discard block
 block discarded – undo
1027 1027
 		//remove from cache
1028 1028
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
1029 1029
 		$cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
1030
-		if($oCacheHandler->isSupport())
1030
+		if ($oCacheHandler->isSupport())
1031 1031
 		{
1032 1032
 			$oCacheHandler->delete($cache_key);
1033 1033
 		}
@@ -1042,22 +1042,22 @@  discard block
 block discarded – undo
1042 1042
 	{
1043 1043
 		$this->deleteModuleExtraVars($module_srl);
1044 1044
 		getDestroyXeVars($obj);
1045
-		if(!$obj || !count($obj)) return;
1045
+		if (!$obj || !count($obj)) return;
1046 1046
 
1047
-		foreach($obj as $key => $val)
1047
+		foreach ($obj as $key => $val)
1048 1048
 		{
1049
-			if(is_object($val) || is_array($val)) continue;
1049
+			if (is_object($val) || is_array($val)) continue;
1050 1050
 
1051 1051
 			$args = new stdClass();
1052 1052
 			$args->module_srl = $module_srl;
1053 1053
 			$args->name = trim($key);
1054 1054
 			$args->value = trim($val);
1055
-			if(!$args->name || !$args->value) continue;
1055
+			if (!$args->name || !$args->value) continue;
1056 1056
 			$output = executeQuery('module.insertModuleExtraVars', $args);
1057 1057
 		}
1058 1058
 
1059 1059
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
1060
-		if($oCacheHandler->isSupport())
1060
+		if ($oCacheHandler->isSupport())
1061 1061
 		{
1062 1062
 			$object_key = 'module_extra_vars:'.$module_srl;
1063 1063
 			$cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
@@ -1076,7 +1076,7 @@  discard block
 block discarded – undo
1076 1076
 
1077 1077
 		//remove from cache
1078 1078
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
1079
-		if($oCacheHandler->isSupport())
1079
+		if ($oCacheHandler->isSupport())
1080 1080
 		{
1081 1081
 			$object_key = 'module_extra_vars:'.$module_srl;
1082 1082
 			$cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
@@ -1092,19 +1092,19 @@  discard block
 block discarded – undo
1092 1092
 	function insertModuleGrants($module_srl, $obj)
1093 1093
 	{
1094 1094
 		$this->deleteModuleGrants($module_srl);
1095
-		if(!$obj || !count($obj)) return;
1095
+		if (!$obj || !count($obj)) return;
1096 1096
 
1097
-		foreach($obj as $name => $val)
1097
+		foreach ($obj as $name => $val)
1098 1098
 		{
1099
-			if(!$val || !count($val)) continue;
1099
+			if (!$val || !count($val)) continue;
1100 1100
 
1101
-			foreach($val as $group_srl)
1101
+			foreach ($val as $group_srl)
1102 1102
 			{
1103 1103
 				$args = new stdClass();
1104 1104
 				$args->module_srl = $module_srl;
1105 1105
 				$args->name = $name;
1106 1106
 				$args->group_srl = trim($group_srl);
1107
-				if(!$args->name || !$args->group_srl) continue;
1107
+				if (!$args->name || !$args->group_srl) continue;
1108 1108
 				executeQuery('module.insertModuleGrant', $args);
1109 1109
 			}
1110 1110
 		}
@@ -1125,9 +1125,9 @@  discard block
 block discarded – undo
1125 1125
 	 */
1126 1126
 	function replaceDefinedLangCode(&$output, $isReplaceLangCode = true)
1127 1127
 	{
1128
-		if($isReplaceLangCode)
1128
+		if ($isReplaceLangCode)
1129 1129
 		{
1130
-			$output = preg_replace_callback('!\$user_lang->([a-z0-9\_]+)!is', array($this,'_replaceLangCode'), $output);
1130
+			$output = preg_replace_callback('!\$user_lang->([a-z0-9\_]+)!is', array($this, '_replaceLangCode'), $output);
1131 1131
 		}
1132 1132
 	}
1133 1133
 
@@ -1135,27 +1135,27 @@  discard block
 block discarded – undo
1135 1135
 	{
1136 1136
 		static $lang = null;
1137 1137
 
1138
-		if(is_null($lang))
1138
+		if (is_null($lang))
1139 1139
 		{
1140 1140
 			$site_module_info = Context::get('site_module_info');
1141
-			if(!$site_module_info)
1141
+			if (!$site_module_info)
1142 1142
 			{
1143 1143
 				$oModuleModel = getModel('module');
1144 1144
 				$site_module_info = $oModuleModel->getDefaultMid();
1145 1145
 				Context::set('site_module_info', $site_module_info);
1146 1146
 			}
1147 1147
 			$cache_file = sprintf('%sfiles/cache/lang_defined/%d.%s.php', _XE_PATH_, $site_module_info->site_srl, Context::getLangType());
1148
-			if(!file_exists($cache_file))
1148
+			if (!file_exists($cache_file))
1149 1149
 			{
1150 1150
 				$oModuleAdminController = getAdminController('module');
1151 1151
 				$oModuleAdminController->makeCacheDefinedLangCode($site_module_info->site_srl);
1152 1152
 			}
1153 1153
 
1154
-			if(file_exists($cache_file))
1154
+			if (file_exists($cache_file))
1155 1155
 			{
1156
-				$moduleAdminControllerMtime = filemtime(_XE_PATH_ . 'modules/module/module.admin.controller.php');
1156
+				$moduleAdminControllerMtime = filemtime(_XE_PATH_.'modules/module/module.admin.controller.php');
1157 1157
 				$cacheFileMtime = filemtime($cache_file);
1158
-				if($cacheFileMtime < $moduleAdminControllerMtime)
1158
+				if ($cacheFileMtime < $moduleAdminControllerMtime)
1159 1159
 				{
1160 1160
 					$oModuleAdminController = getAdminController('module');
1161 1161
 					$oModuleAdminController->makeCacheDefinedLangCode($site_module_info->site_srl);
@@ -1164,9 +1164,9 @@  discard block
 block discarded – undo
1164 1164
 				require_once($cache_file);
1165 1165
 			}
1166 1166
 		}
1167
-		if(!Context::get($matches[1]) && $lang[$matches[1]]) return $lang[$matches[1]];
1167
+		if (!Context::get($matches[1]) && $lang[$matches[1]]) return $lang[$matches[1]];
1168 1168
 
1169
-		return str_replace('$user_lang->','',$matches[0]);
1169
+		return str_replace('$user_lang->', '', $matches[0]);
1170 1170
 	}
1171 1171
 
1172 1172
 
@@ -1179,17 +1179,17 @@  discard block
 block discarded – undo
1179 1179
 		if ($ajax) Context::setRequestMethod('JSON');
1180 1180
 
1181 1181
 		$logged_info = Context::get('logged_info');
1182
-		if($logged_info->is_admin !='Y' && !$logged_info->is_site_admin) return new Object(-1, 'msg_not_permitted');
1182
+		if ($logged_info->is_admin != 'Y' && !$logged_info->is_site_admin) return new Object(-1, 'msg_not_permitted');
1183 1183
 
1184
-		$vars = Context::gets('addfile','filter');
1184
+		$vars = Context::gets('addfile', 'filter');
1185 1185
 		$attributeNames = Context::get('attribute_name');
1186 1186
 		$attributeValues = Context::get('attribute_value');
1187
-		if(is_array($attributeNames) && is_array($attributeValues) && count($attributeNames) == count($attributeValues))
1187
+		if (is_array($attributeNames) && is_array($attributeValues) && count($attributeNames) == count($attributeValues))
1188 1188
 		{
1189 1189
 			$attributes = array();
1190
-			foreach($attributeNames as $no => $name)
1190
+			foreach ($attributeNames as $no => $name)
1191 1191
 			{
1192
-				if(empty($name))
1192
+				if (empty($name))
1193 1193
 				{
1194 1194
 					continue;
1195 1195
 				}
@@ -1201,16 +1201,16 @@  discard block
 block discarded – undo
1201 1201
 		$vars->comment = $attributes;
1202 1202
 		$module_filebox_srl = Context::get('module_filebox_srl');
1203 1203
 
1204
-		$ext = strtolower(substr(strrchr($vars->addfile['name'],'.'),1));
1204
+		$ext = strtolower(substr(strrchr($vars->addfile['name'], '.'), 1));
1205 1205
 		$vars->ext = $ext;
1206
-		if($vars->filter) $filter = explode(',',$vars->filter);
1207
-		else $filter = array('jpg','jpeg','gif','png');
1208
-		if(!in_array($ext,$filter)) return new Object(-1, 'msg_error_occured');
1206
+		if ($vars->filter) $filter = explode(',', $vars->filter);
1207
+		else $filter = array('jpg', 'jpeg', 'gif', 'png');
1208
+		if (!in_array($ext, $filter)) return new Object(-1, 'msg_error_occured');
1209 1209
 
1210 1210
 		$vars->member_srl = $logged_info->member_srl;
1211 1211
 
1212 1212
 		// update
1213
-		if($module_filebox_srl > 0)
1213
+		if ($module_filebox_srl > 0)
1214 1214
 		{
1215 1215
 			$vars->module_filebox_srl = $module_filebox_srl;
1216 1216
 			$output = $this->updateModuleFileBox($vars);
@@ -1218,10 +1218,10 @@  discard block
 block discarded – undo
1218 1218
 		// insert
1219 1219
 		else
1220 1220
 		{
1221
-			if(!Context::isUploaded()) return new Object(-1, 'msg_error_occured');
1221
+			if (!Context::isUploaded()) return new Object(-1, 'msg_error_occured');
1222 1222
 			$addfile = Context::get('addfile');
1223
-			if(!is_uploaded_file($addfile['tmp_name'])) return new Object(-1, 'msg_error_occured');
1224
-			if($vars->addfile['error'] != 0) return new Object(-1, 'msg_error_occured');
1223
+			if (!is_uploaded_file($addfile['tmp_name'])) return new Object(-1, 'msg_error_occured');
1224
+			if ($vars->addfile['error'] != 0) return new Object(-1, 'msg_error_occured');
1225 1225
 			$output = $this->insertModuleFileBox($vars);
1226 1226
 		}
1227 1227
 
@@ -1235,7 +1235,7 @@  discard block
 block discarded – undo
1235 1235
 		}
1236 1236
 		else
1237 1237
 		{
1238
-			if($output) $this->add('save_filename', $output->get('save_filename'));
1238
+			if ($output) $this->add('save_filename', $output->get('save_filename'));
1239 1239
 			else $this->add('save_filename', '');
1240 1240
 		}
1241 1241
 	}
@@ -1247,7 +1247,7 @@  discard block
 block discarded – undo
1247 1247
 	{
1248 1248
 		$args = new stdClass;
1249 1249
 		// have file
1250
-		if($vars->addfile['tmp_name'] && is_uploaded_file($vars->addfile['tmp_name']))
1250
+		if ($vars->addfile['tmp_name'] && is_uploaded_file($vars->addfile['tmp_name']))
1251 1251
 		{
1252 1252
 			$oModuleModel = getModel('module');
1253 1253
 			$output = $oModuleModel->getModuleFileBox($vars->module_filebox_srl);
@@ -1256,18 +1256,18 @@  discard block
 block discarded – undo
1256 1256
 			$path = $oModuleModel->getModuleFileBoxPath($vars->module_filebox_srl);
1257 1257
 			FileHandler::makeDir($path);
1258 1258
 
1259
-			$save_filename = sprintf('%s%s.%s',$path, $vars->module_filebox_srl, $ext);
1259
+			$save_filename = sprintf('%s%s.%s', $path, $vars->module_filebox_srl, $ext);
1260 1260
 			$tmp = $vars->addfile['tmp_name'];
1261 1261
 
1262 1262
 			// Check uploaded file
1263
-			if(!checkUploadedFile($tmp)) return false;
1263
+			if (!checkUploadedFile($tmp)) return false;
1264 1264
 
1265
-			if(!@move_uploaded_file($tmp, $save_filename))
1265
+			if (!@move_uploaded_file($tmp, $save_filename))
1266 1266
 			{
1267 1267
 				return false;
1268 1268
 			}
1269 1269
 
1270
-			$args->fileextension = strtolower(substr(strrchr($vars->addfile['name'],'.'),1));
1270
+			$args->fileextension = strtolower(substr(strrchr($vars->addfile['name'], '.'), 1));
1271 1271
 			$args->filename = $save_filename;
1272 1272
 			$args->filesize = $vars->addfile['size'];
1273 1273
 		}
@@ -1293,14 +1293,14 @@  discard block
 block discarded – undo
1293 1293
 		$oModuleModel = getModel('module');
1294 1294
 		$path = $oModuleModel->getModuleFileBoxPath($vars->module_filebox_srl);
1295 1295
 		FileHandler::makeDir($path);
1296
-		$save_filename = sprintf('%s%s.%s',$path, $vars->module_filebox_srl, $vars->ext);
1296
+		$save_filename = sprintf('%s%s.%s', $path, $vars->module_filebox_srl, $vars->ext);
1297 1297
 		$tmp = $vars->addfile['tmp_name'];
1298 1298
 
1299 1299
 		// Check uploaded file
1300
-		if(!checkUploadedFile($tmp)) return false;
1300
+		if (!checkUploadedFile($tmp)) return false;
1301 1301
 
1302 1302
 		// upload
1303
-		if(!@move_uploaded_file($tmp, $save_filename))
1303
+		if (!@move_uploaded_file($tmp, $save_filename))
1304 1304
 		{
1305 1305
 			return false;
1306 1306
 		}
@@ -1311,7 +1311,7 @@  discard block
 block discarded – undo
1311 1311
 		$args->member_srl = $vars->member_srl;
1312 1312
 		$args->comment = $vars->comment;
1313 1313
 		$args->filename = $save_filename;
1314
-		$args->fileextension = strtolower(substr(strrchr($vars->addfile['name'],'.'),1));
1314
+		$args->fileextension = strtolower(substr(strrchr($vars->addfile['name'], '.'), 1));
1315 1315
 		$args->filesize = $vars->addfile['size'];
1316 1316
 
1317 1317
 		$output = executeQuery('module.insertModuleFileBox', $args);
@@ -1326,14 +1326,14 @@  discard block
 block discarded – undo
1326 1326
 	function procModuleFileBoxDelete()
1327 1327
 	{
1328 1328
 		$logged_info = Context::get('logged_info');
1329
-		if($logged_info->is_admin !='Y' && !$logged_info->is_site_admin) return new Object(-1, 'msg_not_permitted');
1329
+		if ($logged_info->is_admin != 'Y' && !$logged_info->is_site_admin) return new Object(-1, 'msg_not_permitted');
1330 1330
 
1331 1331
 		$module_filebox_srl = Context::get('module_filebox_srl');
1332
-		if(!$module_filebox_srl) return new Object(-1, 'msg_invalid_request');
1332
+		if (!$module_filebox_srl) return new Object(-1, 'msg_invalid_request');
1333 1333
 		$vars = new stdClass();
1334 1334
 		$vars->module_filebox_srl = $module_filebox_srl;
1335 1335
 		$output = $this->deleteModuleFileBox($vars);
1336
-		if(!$output->toBool()) return $output;
1336
+		if (!$output->toBool()) return $output;
1337 1337
 	}
1338 1338
 
1339 1339
 	function deleteModuleFileBox($vars)
@@ -1356,11 +1356,11 @@  discard block
 block discarded – undo
1356 1356
 		$this->unlockTimeoutPassed();
1357 1357
 		$args = new stdClass;
1358 1358
 		$args->lock_name = $lock_name;
1359
-		if(!$timeout) $timeout = 60;
1359
+		if (!$timeout) $timeout = 60;
1360 1360
 		$args->deadline = date("YmdHis", $_SERVER['REQUEST_TIME'] + $timeout);
1361
-		if($member_srl) $args->member_srl = $member_srl;
1361
+		if ($member_srl) $args->member_srl = $member_srl;
1362 1362
 		$output = executeQuery('module.insertLock', $args);
1363
-		if($output->toBool())
1363
+		if ($output->toBool())
1364 1364
 		{
1365 1365
 			$output->add('lock_name', $lock_name);
1366 1366
 			$output->add('deadline', $args->deadline);
@@ -1389,7 +1389,7 @@  discard block
 block discarded – undo
1389 1389
 		$output = executeQuery('module.updateModuleInSites', $args);
1390 1390
 
1391 1391
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
1392
-		if($oCacheHandler->isSupport())
1392
+		if ($oCacheHandler->isSupport())
1393 1393
 		{
1394 1394
 			$oCacheHandler->invalidateGroupKey('site_and_module');
1395 1395
 		}
Please login to merge, or discard this patch.
modules/module/module.model.php 3 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -1035,6 +1035,7 @@  discard block
 block discarded – undo
1035 1035
 	/**
1036 1036
 	 * @brief Get a list of skins for the module
1037 1037
 	 * Return file analysis of skin and skin.xml
1038
+	 * @param string $path
1038 1039
 	 */
1039 1040
 	function getSkins($path, $dir = 'skins')
1040 1041
 	{
@@ -1359,6 +1360,8 @@  discard block
 block discarded – undo
1359 1360
 	/**
1360 1361
 	 * @brief Return module configurations
1361 1362
 	 * Global configuration is used to manage board, member and others
1363
+	 * @param string $module
1364
+	 * @return string
1362 1365
 	 */
1363 1366
 	function getModuleConfig($module, $site_srl = 0)
1364 1367
 	{
Please login to merge, or discard this patch.
Braces   +457 added lines, -203 removed lines patch added patch discarded remove patch
@@ -19,26 +19,34 @@  discard block
 block discarded – undo
19 19
 	 */
20 20
 	function isIDExists($id, $site_srl = 0)
21 21
 	{
22
-		if(!preg_match('/^[a-z]{1}([a-z0-9_]+)$/i',$id)) return true;
22
+		if(!preg_match('/^[a-z]{1}([a-z0-9_]+)$/i',$id)) {
23
+			return true;
24
+		}
23 25
 		// directory and rss/atom/api reserved checking, etc.
24 26
 		$dirs = FileHandler::readDir(_XE_PATH_);
25 27
 		$dirs[] = 'rss';
26 28
 		$dirs[] = 'atom';
27 29
 		$dirs[] = 'api';
28
-		if(in_array($id, $dirs)) return true;
30
+		if(in_array($id, $dirs)) {
31
+			return true;
32
+		}
29 33
 		// mid test
30 34
 		$args = new stdClass();
31 35
 		$args->mid = $id;
32 36
 		$args->site_srl = $site_srl;
33 37
 		$output = executeQuery('module.isExistsModuleName', $args);
34
-		if($output->data->count) return true;
38
+		if($output->data->count) {
39
+			return true;
40
+		}
35 41
 		// vid test (check mid != vid if site_srl=0, which means it is not a virtual site)
36 42
 		if(!$site_srl)
37 43
 		{
38 44
 			$site_args = new stdClass();
39 45
 			$site_args->domain = $id;
40 46
 			$output = executeQuery('module.isExistsSiteDomain', $site_args);
41
-			if($output->data->count) return true;
47
+			if($output->data->count) {
48
+				return true;
49
+			}
42 50
 		}
43 51
 
44 52
 		return false;
@@ -82,10 +90,14 @@  discard block
 block discarded – undo
82 90
 	function getDefaultMid()
83 91
 	{
84 92
 		$default_url = Context::getDefaultUrl();
85
-		if($default_url && substr_compare($default_url, '/', -1) === 0) $default_url = substr($default_url, 0, -1);
93
+		if($default_url && substr_compare($default_url, '/', -1) === 0) {
94
+			$default_url = substr($default_url, 0, -1);
95
+		}
86 96
 
87 97
 		$request_url = Context::getRequestUri();
88
-		if($request_url && substr_compare($request_url, '/', -1) === 0) $request_url = substr($request_url, 0, -1);
98
+		if($request_url && substr_compare($request_url, '/', -1) === 0) {
99
+			$request_url = substr($request_url, 0, -1);
100
+		}
89 101
 
90 102
 		$default_url_parse = parse_url($default_url);
91 103
 		$request_url_parse = parse_url($request_url);
@@ -100,14 +112,18 @@  discard block
 block discarded – undo
100 112
 			$url_info = parse_url($request_url);
101 113
 			$hostname = $url_info['host'];
102 114
 			$path = $url_info['path'];
103
-			if(strlen($path) >= 1 && substr_compare($path, '/', -1) === 0) $path = substr($path, 0, -1);
115
+			if(strlen($path) >= 1 && substr_compare($path, '/', -1) === 0) {
116
+				$path = substr($path, 0, -1);
117
+			}
104 118
 
105 119
 			$domain = sprintf('%s%s%s', $hostname, $url_info['port']&&$url_info['port']!=80?':'.$url_info['port']:'',$path);
106 120
 		}
107 121
 
108 122
 		if($domain === '')
109 123
 		{
110
-			if(!$vid) $vid = $mid;
124
+			if(!$vid) {
125
+				$vid = $mid;
126
+			}
111 127
 			if($vid)
112 128
 			{
113 129
 				$domain = $vid;
@@ -133,13 +149,17 @@  discard block
 block discarded – undo
133 149
 				$output = executeQuery('module.getSiteInfoByDomain', $args);
134 150
 				$site_info = $output->data;
135 151
 
136
-				if($oCacheHandler->isSupport()) $oCacheHandler->put($domain_cache_key, $site_info);
152
+				if($oCacheHandler->isSupport()) {
153
+					$oCacheHandler->put($domain_cache_key, $site_info);
154
+				}
137 155
 			}
138 156
 
139 157
 			if($site_info && $vid)
140 158
 			{
141 159
 				Context::set('vid', $site_info->domain, true);
142
-				if(strtolower($mid)==strtolower($site_info->domain)) Context::set('mid', $site_info->mid,true);
160
+				if(strtolower($mid)==strtolower($site_info->domain)) {
161
+					Context::set('mid', $site_info->mid,true);
162
+				}
143 163
 			}
144 164
 			if(!$site_info || !$site_info->domain) { $domain = ''; unset($site_info); }
145 165
 		}
@@ -165,8 +185,12 @@  discard block
 block discarded – undo
165 185
 				{
166 186
 					// Create a table if sites table doesn't exist
167 187
 					$oDB = &DB::getInstance();
168
-					if(!$oDB->isTableExists('sites')) $oDB->createTableByXmlFile(_XE_PATH_.'modules/module/schemas/sites.xml');
169
-					if(!$oDB->isTableExists('sites')) return;
188
+					if(!$oDB->isTableExists('sites')) {
189
+						$oDB->createTableByXmlFile(_XE_PATH_.'modules/module/schemas/sites.xml');
190
+					}
191
+					if(!$oDB->isTableExists('sites')) {
192
+						return;
193
+					}
170 194
 
171 195
 					// Get mid, language
172 196
 					$mid_output = $oDB->executeQuery('module.getDefaultMidInfo', $args);
@@ -184,21 +208,28 @@  discard block
 block discarded – undo
184 208
 					if($output->data && !$output->data->index_module_srl)
185 209
 					{
186 210
 						$output = executeQuery('module.updateSite', $site_args);
187
-					}
188
-					else
211
+					} else
189 212
 					{
190 213
 						$output = executeQuery('module.insertSite', $site_args);
191
-						if(!$output->toBool()) return $output;
214
+						if(!$output->toBool()) {
215
+							return $output;
216
+						}
192 217
 					}
193 218
 					$output = executeQuery('module.getSiteInfo', $args);
194 219
 				}
195 220
 				$site_info = $output->data;
196
-				if($oCacheHandler->isSupport()) $oCacheHandler->put($default_site_cache_key, $site_info);
221
+				if($oCacheHandler->isSupport()) {
222
+					$oCacheHandler->put($default_site_cache_key, $site_info);
223
+				}
197 224
 			}
198 225
 		}
199 226
 
200
-		if(!$site_info->module_srl) return $site_info;
201
-		if(is_array($site_info) && $site_info->data[0]) $site_info = $site_info[0];
227
+		if(!$site_info->module_srl) {
228
+			return $site_info;
229
+		}
230
+		if(is_array($site_info) && $site_info->data[0]) {
231
+			$site_info = $site_info[0];
232
+		}
202 233
 		return $this->addModuleExtraVars($site_info);
203 234
 	}
204 235
 
@@ -248,7 +279,9 @@  discard block
 block discarded – undo
248 279
 		}
249 280
 
250 281
 		$this->applyDefaultSkin($module_info);
251
-		if(!$module_info->module_srl && $module_info->data[0]) $module_info = $module_info->data[0];
282
+		if(!$module_info->module_srl && $module_info->data[0]) {
283
+			$module_info = $module_info->data[0];
284
+		}
252 285
 		return $this->addModuleExtraVars($module_info);
253 286
 	}
254 287
 
@@ -340,8 +373,7 @@  discard block
 block discarded – undo
340 373
 				$object_key = 'mid_info:' . $output->data->module_srl;
341 374
 				$module_info_cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
342 375
 				$oCacheHandler->put($module_info_cache_key, $moduleInfo);
343
-			}
344
-			else
376
+			} else
345 377
 			{
346 378
 				$mid_info->designSettings = $moduleInfo->designSettings;
347 379
 				$moduleInfo = $mid_info;
@@ -382,11 +414,15 @@  discard block
 block discarded – undo
382 414
 			$args = new stdClass();
383 415
 			$args->module_srl = $module_srl;
384 416
 			$output = executeQuery('module.getMidInfo', $args);
385
-			if(!$output->toBool()) return;
417
+			if(!$output->toBool()) {
418
+				return;
419
+			}
386 420
 
387 421
 			$mid_info = $output->data;
388 422
 			$this->applyDefaultSkin($mid_info);
389
-			if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $mid_info);
423
+			if($oCacheHandler->isSupport()) {
424
+				$oCacheHandler->put($cache_key, $mid_info);
425
+			}
390 426
 		}
391 427
 
392 428
 		if($mid_info && count($columnList))
@@ -399,11 +435,14 @@  discard block
 block discarded – undo
399 435
 					$module_info->$key = $item;
400 436
 				}
401 437
 			}
438
+		} else {
439
+			$module_info = $mid_info;
402 440
 		}
403
-		else $module_info = $mid_info;
404 441
 
405 442
 		$oModuleController = getController('module');
406
-		if(isset($module_info->browser_title)) $oModuleController->replaceDefinedLangCode($module_info->browser_title);
443
+		if(isset($module_info->browser_title)) {
444
+			$oModuleController->replaceDefinedLangCode($module_info->browser_title);
445
+		}
407 446
 
408 447
 		$this->applyDefaultSkin($module_info);
409 448
 		return $this->addModuleExtraVars($module_info);
@@ -451,11 +490,15 @@  discard block
 block discarded – undo
451 490
 	 */
452 491
 	function getModulesInfo($module_srls, $columnList = array())
453 492
 	{
454
-		if(is_array($module_srls)) $module_srls = implode(',',$module_srls);
493
+		if(is_array($module_srls)) {
494
+			$module_srls = implode(',',$module_srls);
495
+		}
455 496
 		$args = new stdClass();
456 497
 		$args->module_srls = $module_srls;
457 498
 		$output = executeQueryArray('module.getModulesInfo', $args, $columnList);
458
-		if(!$output->toBool()) return;
499
+		if(!$output->toBool()) {
500
+			return;
501
+		}
459 502
 		return $this->addModuleExtraVars($output->data);
460 503
 	}
461 504
 
@@ -465,31 +508,44 @@  discard block
 block discarded – undo
465 508
 	function addModuleExtraVars($module_info)
466 509
 	{
467 510
 		// Process although one or more module informaion is requested
468
-		if(!is_array($module_info)) $target_module_info = array($module_info);
469
-		else $target_module_info = $module_info;
511
+		if(!is_array($module_info)) {
512
+			$target_module_info = array($module_info);
513
+		} else {
514
+			$target_module_info = $module_info;
515
+		}
470 516
 		// Get module_srl
471 517
 		$module_srls = array();
472 518
 		foreach($target_module_info as $key => $val)
473 519
 		{
474 520
 			$module_srl = $val->module_srl;
475
-			if(!$module_srl) continue;
521
+			if(!$module_srl) {
522
+				continue;
523
+			}
476 524
 			$module_srls[] = $val->module_srl;
477 525
 		}
478 526
 		// Extract extra information of the module and skin
479 527
 		$extra_vars = $this->getModuleExtraVars($module_srls);
480
-		if(!count($module_srls) || !count($extra_vars)) return $module_info;
528
+		if(!count($module_srls) || !count($extra_vars)) {
529
+			return $module_info;
530
+		}
481 531
 
482 532
 		foreach($target_module_info as $key => $val)
483 533
 		{
484
-			if(!$extra_vars[$val->module_srl] || !count($extra_vars[$val->module_srl])) continue;
534
+			if(!$extra_vars[$val->module_srl] || !count($extra_vars[$val->module_srl])) {
535
+				continue;
536
+			}
485 537
 			foreach($extra_vars[$val->module_srl] as $k => $v)
486 538
 			{
487
-				if($target_module_info[$key]->{$k}) continue;
539
+				if($target_module_info[$key]->{$k}) {
540
+					continue;
541
+				}
488 542
 				$target_module_info[$key]->{$k} = $v;
489 543
 			}
490 544
 		}
491 545
 
492
-		if(is_array($module_info)) return $target_module_info;
546
+		if(is_array($module_info)) {
547
+			return $target_module_info;
548
+		}
493 549
 		return $target_module_info[0];
494 550
 	}
495 551
 
@@ -518,7 +574,9 @@  discard block
 block discarded – undo
518 574
 			}
519 575
 
520 576
 			$output = executeQuery('module.getMidList', $args, $columnList);
521
-			if(!$output->toBool()) return $output;
577
+			if(!$output->toBool()) {
578
+				return $output;
579
+			}
522 580
 			$list = $output->data;
523 581
 
524 582
 			if($oCacheHandler->isSupport() && count($args) === 1 && isset($args->site_srl))
@@ -526,9 +584,13 @@  discard block
 block discarded – undo
526 584
 				$oCacheHandler->put($cache_key, $list);
527 585
 			}
528 586
 		}
529
-		if(!$list) return;
587
+		if(!$list) {
588
+			return;
589
+		}
530 590
 
531
-		if(!is_array($list)) $list = array($list);
591
+		if(!is_array($list)) {
592
+			$list = array($list);
593
+		}
532 594
 
533 595
 		foreach($list as $val)
534 596
 		{
@@ -544,10 +606,14 @@  discard block
 block discarded – undo
544 606
 	function getModuleSrlList($args = null, $columnList = array())
545 607
 	{
546 608
 		$output = executeQueryArray('module.getMidList', $args, $columnList);
547
-		if(!$output->toBool()) return $output;
609
+		if(!$output->toBool()) {
610
+			return $output;
611
+		}
548 612
 
549 613
 		$list = $output->data;
550
-		if(!$list) return;
614
+		if(!$list) {
615
+			return;
616
+		}
551 617
 
552 618
 		return $list;
553 619
 	}
@@ -557,20 +623,32 @@  discard block
 block discarded – undo
557 623
 	 */
558 624
 	function getModuleSrlByMid($mid)
559 625
 	{
560
-		if($mid && !is_array($mid)) $mid = explode(',',$mid);
561
-		if(is_array($mid)) $mid = "'".implode("','",$mid)."'";
626
+		if($mid && !is_array($mid)) {
627
+			$mid = explode(',',$mid);
628
+		}
629
+		if(is_array($mid)) {
630
+			$mid = "'".implode("','",$mid)."'";
631
+		}
562 632
 
563 633
 		$site_module_info = Context::get('site_module_info');
564 634
 
565 635
 		$args = new stdClass;
566 636
 		$args->mid = $mid;
567
-		if($site_module_info) $args->site_srl = $site_module_info->site_srl;
637
+		if($site_module_info) {
638
+			$args->site_srl = $site_module_info->site_srl;
639
+		}
568 640
 		$output = executeQuery('module.getModuleSrlByMid', $args);
569
-		if(!$output->toBool()) return $output;
641
+		if(!$output->toBool()) {
642
+			return $output;
643
+		}
570 644
 
571 645
 		$list = $output->data;
572
-		if(!$list) return;
573
-		if(!is_array($list)) $list = array($list);
646
+		if(!$list) {
647
+			return;
648
+		}
649
+		if(!is_array($list)) {
650
+			$list = array($list);
651
+		}
574 652
 
575 653
 		foreach($list as $key => $val)
576 654
 		{
@@ -599,8 +677,12 @@  discard block
 block discarded – undo
599 677
 		{
600 678
 			$args = new stdClass();
601 679
 			$output = executeQueryArray('module.getActionForward',$args);
602
-			if(!$output->toBool()) return new stdClass;
603
-			if(!$output->data) $output->data = array();
680
+			if(!$output->toBool()) {
681
+				return new stdClass;
682
+			}
683
+			if(!$output->data) {
684
+				$output->data = array();
685
+			}
604 686
 
605 687
 			$action_forward = array();
606 688
 			foreach($output->data as $item)
@@ -617,8 +699,7 @@  discard block
 block discarded – undo
617 699
 		if($action_forward[$act])
618 700
 		{
619 701
 			return $action_forward[$act];
620
-		}
621
-		else
702
+		} else
622 703
 		{
623 704
 			return new stdClass();
624 705
 		}
@@ -726,8 +807,7 @@  discard block
 block discarded – undo
726 807
 			if(file_exists($cache_file))
727 808
 			{
728 809
 				$GLOBALS['__MODULE_EXTEND__'] = include($cache_file);
729
-			}
730
-			else
810
+			} else
731 811
 			{
732 812
 				$GLOBALS['__MODULE_EXTEND__'] = array();
733 813
 			}
@@ -743,16 +823,22 @@  discard block
 block discarded – undo
743 823
 	{
744 824
 		// Get a path of the requested module. Return if not exists.
745 825
 		$module_path = ModuleHandler::getModulePath($module);
746
-		if(!$module_path) return;
826
+		if(!$module_path) {
827
+			return;
828
+		}
747 829
 		// Read the xml file for module skin information
748 830
 		$xml_file = sprintf("%s/conf/info.xml", $module_path);
749
-		if(!file_exists($xml_file)) return;
831
+		if(!file_exists($xml_file)) {
832
+			return;
833
+		}
750 834
 
751 835
 		$oXmlParser = new XmlParser();
752 836
 		$tmp_xml_obj = $oXmlParser->loadXmlFile($xml_file);
753 837
 		$xml_obj = $tmp_xml_obj->module;
754 838
 
755
-		if(!$xml_obj) return;
839
+		if(!$xml_obj) {
840
+			return;
841
+		}
756 842
 
757 843
 		// Module Information
758 844
 		$module_info = new stdClass();
@@ -764,14 +850,19 @@  discard block
 block discarded – undo
764 850
 			$module_info->version = $xml_obj->version->body;
765 851
 			$module_info->homepage = $xml_obj->link->body;
766 852
 			$module_info->category = $xml_obj->category->body;
767
-			if(!$module_info->category) $module_info->category = 'service';
853
+			if(!$module_info->category) {
854
+				$module_info->category = 'service';
855
+			}
768 856
 			sscanf($xml_obj->date->body, '%d-%d-%d', $date_obj->y, $date_obj->m, $date_obj->d);
769 857
 			$module_info->date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d);
770 858
 			$module_info->license = $xml_obj->license->body;
771 859
 			$module_info->license_link = $xml_obj->license->attrs->link;
772 860
 
773
-			if(!is_array($xml_obj->author)) $author_list[] = $xml_obj->author;
774
-			else $author_list = $xml_obj->author;
861
+			if(!is_array($xml_obj->author)) {
862
+				$author_list[] = $xml_obj->author;
863
+			} else {
864
+				$author_list = $xml_obj->author;
865
+			}
775 866
 
776 867
 			foreach($author_list as $author)
777 868
 			{
@@ -781,15 +872,16 @@  discard block
 block discarded – undo
781 872
 				$author_obj->homepage = $author->attrs->link;
782 873
 				$module_info->author[] = $author_obj;
783 874
 			}
784
-		}
785
-		else
875
+		} else
786 876
 		{
787 877
 			// module format 0.1
788 878
 			$module_info->title = $xml_obj->title->body;
789 879
 			$module_info->description = $xml_obj->author->description->body;
790 880
 			$module_info->version = $xml_obj->attrs->version;
791 881
 			$module_info->category = $xml_obj->attrs->category;
792
-			if(!$module_info->category) $module_info->category = 'service';
882
+			if(!$module_info->category) {
883
+				$module_info->category = 'service';
884
+			}
793 885
 			sscanf($xml_obj->author->attrs->date, '%d. %d. %d', $date_obj->y, $date_obj->m, $date_obj->d);
794 886
 			$module_info->date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d);
795 887
 			$author_obj = new stdClass();
@@ -818,11 +910,15 @@  discard block
 block discarded – undo
818 910
 	{
819 911
 		// Get a path of the requested module. Return if not exists.
820 912
 		$class_path = ModuleHandler::getModulePath($module);
821
-		if(!$class_path) return;
913
+		if(!$class_path) {
914
+			return;
915
+		}
822 916
 
823 917
 		// Check if module.xml exists in the path. Return if not exist
824 918
 		$xml_file = sprintf("%sconf/module.xml", $class_path);
825
-		if(!file_exists($xml_file)) return;
919
+		if(!file_exists($xml_file)) {
920
+			return;
921
+		}
826 922
 
827 923
 		// Check if cached file exists
828 924
 		$cache_file = sprintf(_XE_PATH_ . "files/cache/module_info/%s.%s.%s.php", $module, Context::getLangType(), __XE_VERSION__);
@@ -841,7 +937,10 @@  discard block
 block discarded – undo
841 937
 
842 938
 			$xml_obj = XmlParser::loadXmlFile($xml_file); // /< Read xml file and convert it to xml object
843 939
 
844
-			if(!count($xml_obj->module)) return; // /< Error occurs if module tag doesn't included in the xml
940
+			if(!count($xml_obj->module)) {
941
+				return;
942
+			}
943
+			// /< Error occurs if module tag doesn't included in the xml
845 944
 
846 945
 			$grants = $xml_obj->module->grants->grant; // /< Permission information
847 946
 			$permissions = $xml_obj->module->permissions->permission; // /<  Acting permission
@@ -853,8 +952,11 @@  discard block
 block discarded – undo
853 952
 			// Arrange permission information
854 953
 			if($grants)
855 954
 			{
856
-				if(is_array($grants)) $grant_list = $grants;
857
-				else $grant_list[] = $grants;
955
+				if(is_array($grants)) {
956
+					$grant_list = $grants;
957
+				} else {
958
+					$grant_list[] = $grants;
959
+				}
858 960
 
859 961
 				$info->grant = new stdClass();
860 962
 				$buff[] = '$info->grant = new stdClass;';
@@ -876,8 +978,11 @@  discard block
 block discarded – undo
876 978
 			// Permissions to grant
877 979
 			if($permissions)
878 980
 			{
879
-				if(is_array($permissions)) $permission_list = $permissions;
880
-				else $permission_list[] = $permissions;
981
+				if(is_array($permissions)) {
982
+					$permission_list = $permissions;
983
+				} else {
984
+					$permission_list[] = $permissions;
985
+				}
881 986
 
882 987
 				$buff[] = '$info->permission = new stdClass;';
883 988
 
@@ -895,8 +1000,11 @@  discard block
 block discarded – undo
895 1000
 			// for admin menus
896 1001
 			if($menus)
897 1002
 			{
898
-				if(is_array($menus)) $menu_list = $menus;
899
-				else $menu_list[] = $menus;
1003
+				if(is_array($menus)) {
1004
+					$menu_list = $menus;
1005
+				} else {
1006
+					$menu_list[] = $menus;
1007
+				}
900 1008
 
901 1009
 				$buff[] = '$info->menu = new stdClass;';
902 1010
 				$info->menu = new stdClass();
@@ -920,8 +1028,11 @@  discard block
 block discarded – undo
920 1028
 			// actions
921 1029
 			if($actions)
922 1030
 			{
923
-				if(is_array($actions)) $action_list = $actions;
924
-				else $action_list[] = $actions;
1031
+				if(is_array($actions)) {
1032
+					$action_list = $actions;
1033
+				} else {
1034
+					$action_list[] = $actions;
1035
+				}
925 1036
 
926 1037
 				$buff[] = '$info->action = new stdClass;';
927 1038
 				$info->action = new stdClass();
@@ -1007,7 +1118,9 @@  discard block
 block discarded – undo
1007 1118
 			return $info;
1008 1119
 		}
1009 1120
 
1010
-		if(file_exists($cache_file)) return include($cache_file);
1121
+		if(file_exists($cache_file)) {
1122
+			return include($cache_file);
1123
+		}
1011 1124
 	}
1012 1125
 
1013 1126
 	/**
@@ -1045,7 +1158,9 @@  discard block
 block discarded – undo
1045 1158
 
1046 1159
 		$skin_path = sprintf("%s/%s/", $path, $dir);
1047 1160
 		$list = FileHandler::readDir($skin_path);
1048
-		if(!count($list)) return;
1161
+		if(!count($list)) {
1162
+			return;
1163
+		}
1049 1164
 
1050 1165
 		natcasesort($list);
1051 1166
 
@@ -1099,8 +1214,7 @@  discard block
 block discarded – undo
1099 1214
 			if($dir == 'skins')
1100 1215
 			{
1101 1216
 				$type = 'P';
1102
-			}
1103
-			else
1217
+			} else
1104 1218
 			{
1105 1219
 				$type = 'M';
1106 1220
 			}
@@ -1128,14 +1242,20 @@  discard block
 block discarded – undo
1128 1242
 	function loadSkinInfo($path, $skin, $dir = 'skins')
1129 1243
 	{
1130 1244
 		// Read xml file having skin information
1131
-		if(substr($path,-1)!='/') $path .= '/';
1245
+		if(substr($path,-1)!='/') {
1246
+			$path .= '/';
1247
+		}
1132 1248
 		$skin_xml_file = sprintf("%s%s/%s/skin.xml", $path, $dir, $skin);
1133
-		if(!file_exists($skin_xml_file)) return;
1249
+		if(!file_exists($skin_xml_file)) {
1250
+			return;
1251
+		}
1134 1252
 		// Create XmlParser object
1135 1253
 		$oXmlParser = new XmlParser();
1136 1254
 		$_xml_obj = $oXmlParser->loadXmlFile($skin_xml_file);
1137 1255
 		// Return if no skin information is
1138
-		if(!$_xml_obj->skin) return;
1256
+		if(!$_xml_obj->skin) {
1257
+			return;
1258
+		}
1139 1259
 		$xml_obj = $_xml_obj->skin;
1140 1260
 		// Skin Name
1141 1261
 		$skin_info = new stdClass();
@@ -1152,8 +1272,11 @@  discard block
 block discarded – undo
1152 1272
 			$skin_info->license_link = $xml_obj->license->attrs->link;
1153 1273
 			$skin_info->description = $xml_obj->description->body;
1154 1274
 
1155
-			if(!is_array($xml_obj->author)) $author_list[] = $xml_obj->author;
1156
-			else $author_list = $xml_obj->author;
1275
+			if(!is_array($xml_obj->author)) {
1276
+				$author_list[] = $xml_obj->author;
1277
+			} else {
1278
+				$author_list = $xml_obj->author;
1279
+			}
1157 1280
 
1158 1281
 			foreach($author_list as $author)
1159 1282
 			{
@@ -1167,8 +1290,12 @@  discard block
 block discarded – undo
1167 1290
 			if($xml_obj->extra_vars)
1168 1291
 			{
1169 1292
 				$extra_var_groups = $xml_obj->extra_vars->group;
1170
-				if(!$extra_var_groups) $extra_var_groups = $xml_obj->extra_vars;
1171
-				if(!is_array($extra_var_groups)) $extra_var_groups = array($extra_var_groups);
1293
+				if(!$extra_var_groups) {
1294
+					$extra_var_groups = $xml_obj->extra_vars;
1295
+				}
1296
+				if(!is_array($extra_var_groups)) {
1297
+					$extra_var_groups = array($extra_var_groups);
1298
+				}
1172 1299
 
1173 1300
 				foreach($extra_var_groups as $group)
1174 1301
 				{
@@ -1177,7 +1304,9 @@  discard block
 block discarded – undo
1177 1304
 					{
1178 1305
 						continue;
1179 1306
 					}
1180
-					if(!is_array($group->var)) $extra_vars = array($group->var);
1307
+					if(!is_array($group->var)) {
1308
+						$extra_vars = array($group->var);
1309
+					}
1181 1310
 
1182 1311
 					foreach($extra_vars as $key => $val)
1183 1312
 					{
@@ -1204,8 +1333,7 @@  discard block
 block discarded – undo
1204 1333
 								$obj->options[$i]->title = $val->options[$i]->title->body;
1205 1334
 								$obj->options[$i]->value = $val->options[$i]->attrs->value;
1206 1335
 							}
1207
-						}
1208
-						else
1336
+						} else
1209 1337
 						{
1210 1338
 							$obj->options[0] = new stdClass();
1211 1339
 							$obj->options[0]->title = $val->options->title->body;
@@ -1216,8 +1344,7 @@  discard block
 block discarded – undo
1216 1344
 					}
1217 1345
 				}
1218 1346
 			}
1219
-		}
1220
-		else
1347
+		} else
1221 1348
 		{
1222 1349
 			// skin format v0.1
1223 1350
 			sscanf($xml_obj->maker->attrs->date, '%d-%d-%d', $date_obj->y, $date_obj->m, $date_obj->d);
@@ -1235,8 +1362,12 @@  discard block
 block discarded – undo
1235 1362
 			$skin_info->author[0]->homepage = $xml_obj->maker->attrs->link;
1236 1363
 			// Variables used in the skin
1237 1364
 			$extra_var_groups = $xml_obj->extra_vars->group;
1238
-			if(!$extra_var_groups) $extra_var_groups = $xml_obj->extra_vars;
1239
-			if(!is_array($extra_var_groups)) $extra_var_groups = array($extra_var_groups);
1365
+			if(!$extra_var_groups) {
1366
+				$extra_var_groups = $xml_obj->extra_vars;
1367
+			}
1368
+			if(!is_array($extra_var_groups)) {
1369
+				$extra_var_groups = array($extra_var_groups);
1370
+			}
1240 1371
 
1241 1372
 			foreach($extra_var_groups as $group)
1242 1373
 			{
@@ -1244,7 +1375,9 @@  discard block
 block discarded – undo
1244 1375
 
1245 1376
 				if($extra_vars)
1246 1377
 				{
1247
-					if(!is_array($extra_vars)) $extra_vars = array($extra_vars);
1378
+					if(!is_array($extra_vars)) {
1379
+						$extra_vars = array($extra_vars);
1380
+					}
1248 1381
 
1249 1382
 					foreach($extra_vars as $var)
1250 1383
 					{
@@ -1266,8 +1399,7 @@  discard block
 block discarded – undo
1266 1399
 								$options[$i]->title = $var->default[$i]->body;
1267 1400
 								$options[$i]->value = $var->default[$i]->body;
1268 1401
 							}
1269
-						}
1270
-						else
1402
+						} else
1271 1403
 						{
1272 1404
 							$options[0]->title = $var->default->body;
1273 1405
 							$options[0]->value = $var->default->body;
@@ -1297,7 +1429,9 @@  discard block
 block discarded – undo
1297 1429
 		$colorset = $xml_obj->colorset->color;
1298 1430
 		if($colorset)
1299 1431
 		{
1300
-			if(!is_array($colorset)) $colorset = array($colorset);
1432
+			if(!is_array($colorset)) {
1433
+				$colorset = array($colorset);
1434
+			}
1301 1435
 
1302 1436
 			foreach($colorset as $color)
1303 1437
 			{
@@ -1307,9 +1441,12 @@  discard block
 block discarded – undo
1307 1441
 				if($screenshot)
1308 1442
 				{
1309 1443
 					$screenshot = sprintf("%s%s/%s/%s", $path, $dir, $skin, $screenshot);
1310
-					if(!file_exists($screenshot)) $screenshot = "";
1444
+					if(!file_exists($screenshot)) {
1445
+						$screenshot = "";
1446
+					}
1447
+				} else {
1448
+					$screenshot = "";
1311 1449
 				}
1312
-				else $screenshot = "";
1313 1450
 
1314 1451
 				$obj = new stdClass();
1315 1452
 				$obj->name = $name;
@@ -1322,7 +1459,9 @@  discard block
 block discarded – undo
1322 1459
 		if($xml_obj->menus->menu)
1323 1460
 		{
1324 1461
 			$menus = $xml_obj->menus->menu;
1325
-			if(!is_array($menus)) $menus = array($menus);
1462
+			if(!is_array($menus)) {
1463
+				$menus = array($menus);
1464
+			}
1326 1465
 
1327 1466
 			$menu_count = count($menus);
1328 1467
 			$skin_info->menu_count = $menu_count;
@@ -1331,7 +1470,9 @@  discard block
 block discarded – undo
1331 1470
 				unset($obj);
1332 1471
 
1333 1472
 				$obj->name = $menus[$i]->attrs->name;
1334
-				if($menus[$i]->attrs->default == "true") $obj->default = true;
1473
+				if($menus[$i]->attrs->default == "true") {
1474
+					$obj->default = true;
1475
+				}
1335 1476
 				$obj->title = $menus[$i]->title->body;
1336 1477
 				$obj->maxdepth = $menus[$i]->maxdepth->body;
1337 1478
 
@@ -1351,7 +1492,9 @@  discard block
 block discarded – undo
1351 1492
 	{
1352 1493
 		$args = new stdClass;
1353 1494
 		$args->site_srl = $site_srl;
1354
-		if(!is_null($module)) $args->module = $module;
1495
+		if(!is_null($module)) {
1496
+			$args->module = $module;
1497
+		}
1355 1498
 		$output = executeQuery('module.getModuleCount', $args);
1356 1499
 		return $output->data->count;
1357 1500
 	}
@@ -1380,8 +1523,11 @@  discard block
 block discarded – undo
1380 1523
 				$args->module = $module;
1381 1524
 				$args->site_srl = $site_srl;
1382 1525
 				$output = executeQuery('module.getModuleConfig', $args);
1383
-				if($output->data->config) $config = unserialize($output->data->config);
1384
-				else $config = null;
1526
+				if($output->data->config) {
1527
+					$config = unserialize($output->data->config);
1528
+				} else {
1529
+					$config = null;
1530
+				}
1385 1531
 
1386 1532
 				//insert in cache
1387 1533
 				if($oCacheHandler->isSupport())
@@ -1420,8 +1566,11 @@  discard block
 block discarded – undo
1420 1566
 				$args->module = $module;
1421 1567
 				$args->module_srl = $module_srl;
1422 1568
 				$output = executeQuery('module.getModulePartConfig', $args);
1423
-				if($output->data->config) $config = unserialize($output->data->config);
1424
-				else $config = null;
1569
+				if($output->data->config) {
1570
+					$config = unserialize($output->data->config);
1571
+				} else {
1572
+					$config = null;
1573
+				}
1425 1574
 
1426 1575
 				//insert in cache
1427 1576
 				if($oCacheHandler->isSupport())
@@ -1443,9 +1592,13 @@  discard block
 block discarded – undo
1443 1592
 	{
1444 1593
 		$args = new stdClass();
1445 1594
 		$args->module = $module;
1446
-		if($site_srl) $args->site_srl = $site_srl;
1595
+		if($site_srl) {
1596
+			$args->site_srl = $site_srl;
1597
+		}
1447 1598
 		$output = executeQueryArray('module.getModulePartConfigs', $args);
1448
-		if(!$output->toBool() || !$output->data) return array();
1599
+		if(!$output->toBool() || !$output->data) {
1600
+			return array();
1601
+		}
1449 1602
 
1450 1603
 		foreach($output->data as $key => $val)
1451 1604
 		{
@@ -1463,10 +1616,16 @@  discard block
 block discarded – undo
1463 1616
 		$args->moduleCategorySrl = $moduleCategorySrl;
1464 1617
 		// Get data from the DB
1465 1618
 		$output = executeQuery('module.getModuleCategories', $args);
1466
-		if(!$output->toBool()) return $output;
1619
+		if(!$output->toBool()) {
1620
+			return $output;
1621
+		}
1467 1622
 		$list = $output->data;
1468
-		if(!$list) return;
1469
-		if(!is_array($list)) $list = array($list);
1623
+		if(!$list) {
1624
+			return;
1625
+		}
1626
+		if(!is_array($list)) {
1627
+			$list = array($list);
1628
+		}
1470 1629
 
1471 1630
 		foreach($list as $val)
1472 1631
 		{
@@ -1484,7 +1643,9 @@  discard block
 block discarded – undo
1484 1643
 		$args = new stdClass;
1485 1644
 		$args->module_category_srl = $module_category_srl;
1486 1645
 		$output = executeQuery('module.getModuleCategory', $args);
1487
-		if(!$output->toBool()) return $output;
1646
+		if(!$output->toBool()) {
1647
+			return $output;
1648
+		}
1488 1649
 		return $output->data;
1489 1650
 	}
1490 1651
 
@@ -1496,7 +1657,9 @@  discard block
 block discarded – undo
1496 1657
 		// Get a list of downloaded and installed modules
1497 1658
 		$searched_list = FileHandler::readDir('./modules');
1498 1659
 		$searched_count = count($searched_list);
1499
-		if(!$searched_count) return;
1660
+		if(!$searched_count) {
1661
+			return;
1662
+		}
1500 1663
 		sort($searched_list);
1501 1664
 
1502 1665
 		for($i=0;$i<$searched_count;$i++)
@@ -1509,7 +1672,9 @@  discard block
 block discarded – undo
1509 1672
 			$info = $this->getModuleInfoXml($module_name);
1510 1673
 			unset($obj);
1511 1674
 
1512
-			if(!isset($info)) continue;
1675
+			if(!isset($info)) {
1676
+				continue;
1677
+			}
1513 1678
 			$info->module = $module_name;
1514 1679
 			$info->created_table_count = $created_table_count;
1515 1680
 			$info->table_count = $table_count;
@@ -1535,11 +1700,16 @@  discard block
 block discarded – undo
1535 1700
 			for($j=0;$j<count($tmp_files);$j++)
1536 1701
 			{
1537 1702
 				list($table_name) = explode(".",$tmp_files[$j]);
1538
-				if($oDB->isTableExists($table_name)) $created_table_count ++;
1703
+				if($oDB->isTableExists($table_name)) {
1704
+					$created_table_count ++;
1705
+				}
1539 1706
 			}
1540 1707
 			// Check if DB is installed
1541
-			if($table_count > $created_table_count) return true;
1542
-			else return false;
1708
+			if($table_count > $created_table_count) {
1709
+				return true;
1710
+			} else {
1711
+				return false;
1712
+			}
1543 1713
 		}
1544 1714
 		return false;
1545 1715
 	}
@@ -1567,7 +1737,9 @@  discard block
 block discarded – undo
1567 1737
 		sort($searched_list);
1568 1738
 
1569 1739
 		$searched_count = count($searched_list);
1570
-		if(!$searched_count) return;
1740
+		if(!$searched_count) {
1741
+			return;
1742
+		}
1571 1743
 
1572 1744
 		for($i=0;$i<$searched_count;$i++)
1573 1745
 		{
@@ -1575,7 +1747,9 @@  discard block
 block discarded – undo
1575 1747
 			$module_name = $searched_list[$i];
1576 1748
 
1577 1749
 			$path = ModuleHandler::getModulePath($module_name);
1578
-			if(!is_dir(FileHandler::getRealPath($path))) continue;
1750
+			if(!is_dir(FileHandler::getRealPath($path))) {
1751
+				continue;
1752
+			}
1579 1753
 
1580 1754
 			// Get the number of xml files to create a table in schemas
1581 1755
 			$tmp_files = FileHandler::readDir($path.'schemas', '/(\.xml)$/');
@@ -1585,13 +1759,17 @@  discard block
 block discarded – undo
1585 1759
 			for($j=0;$j<$table_count;$j++)
1586 1760
 			{
1587 1761
 				list($table_name) = explode('.',$tmp_files[$j]);
1588
-				if($oDB->isTableExists($table_name)) $created_table_count ++;
1762
+				if($oDB->isTableExists($table_name)) {
1763
+					$created_table_count ++;
1764
+				}
1589 1765
 			}
1590 1766
 			// Get information of the module
1591 1767
 			$info = NULL;
1592 1768
 			$info = $this->getModuleInfoXml($module_name);
1593 1769
 
1594
-			if(!$info) continue;
1770
+			if(!$info) {
1771
+				continue;
1772
+			}
1595 1773
 
1596 1774
 			$info->module = $module_name;
1597 1775
 			$info->category = $info->category;
@@ -1600,16 +1778,18 @@  discard block
 block discarded – undo
1600 1778
 			$info->path = $path;
1601 1779
 			$info->admin_index_act = $info->admin_index_act;
1602 1780
 			// Check if DB is installed
1603
-			if($table_count > $created_table_count) $info->need_install = true;
1604
-			else $info->need_install = false;
1781
+			if($table_count > $created_table_count) {
1782
+				$info->need_install = true;
1783
+			} else {
1784
+				$info->need_install = false;
1785
+			}
1605 1786
 			// Check if it is upgraded to module.class.php on each module
1606 1787
 			$oDummy = null;
1607 1788
 			$oDummy = getModule($module_name, 'class');
1608 1789
 			if($oDummy && method_exists($oDummy, "checkUpdate"))
1609 1790
 			{
1610 1791
 				$info->need_update = $oDummy->checkUpdate();
1611
-			}
1612
-			else
1792
+			} else
1613 1793
 			{
1614 1794
 				continue;
1615 1795
 			}
@@ -1626,7 +1806,9 @@  discard block
 block discarded – undo
1626 1806
 	 */
1627 1807
 	function syncModuleToSite(&$data)
1628 1808
 	{
1629
-		if(!$data) return;
1809
+		if(!$data) {
1810
+			return;
1811
+		}
1630 1812
 
1631 1813
 		if(is_array($data))
1632 1814
 		{
@@ -1634,9 +1816,10 @@  discard block
 block discarded – undo
1634 1816
 			{
1635 1817
 				$module_srls[] = $val->module_srl;
1636 1818
 			}
1637
-			if(!count($module_srls)) return;
1638
-		}
1639
-		else
1819
+			if(!count($module_srls)) {
1820
+				return;
1821
+			}
1822
+		} else
1640 1823
 		{
1641 1824
 			$module_srls[] = $data->module_srl;
1642 1825
 		}
@@ -1644,7 +1827,9 @@  discard block
 block discarded – undo
1644 1827
 		$args = new stdClass();
1645 1828
 		$args->module_srls = implode(',',$module_srls);
1646 1829
 		$output = executeQueryArray('module.getModuleSites', $args);
1647
-		if(!$output->data) return array();
1830
+		if(!$output->data) {
1831
+			return array();
1832
+		}
1648 1833
 		foreach($output->data as $key => $val)
1649 1834
 		{
1650 1835
 			$modules[$val->module_srl] = $val;
@@ -1656,8 +1841,7 @@  discard block
 block discarded – undo
1656 1841
 			{
1657 1842
 				$data[$key]->domain = $modules[$val->module_srl]->domain;
1658 1843
 			}
1659
-		}
1660
-		else
1844
+		} else
1661 1845
 		{
1662 1846
 			$data->domain = $modules[$data->module_srl]->domain;
1663 1847
 		}
@@ -1668,24 +1852,31 @@  discard block
 block discarded – undo
1668 1852
 	 */
1669 1853
 	function isSiteAdmin($member_info, $site_srl = null)
1670 1854
 	{
1671
-		if(!$member_info->member_srl) return false;
1672
-		if($member_info->is_admin == 'Y') return true;
1855
+		if(!$member_info->member_srl) {
1856
+			return false;
1857
+		}
1858
+		if($member_info->is_admin == 'Y') {
1859
+			return true;
1860
+		}
1673 1861
 
1674 1862
 		$args = new stdClass();
1675 1863
 		if(!isset($site_srl))
1676 1864
 		{
1677 1865
 			$site_module_info = Context::get('site_module_info');
1678
-			if(!$site_module_info) return;
1866
+			if(!$site_module_info) {
1867
+				return;
1868
+			}
1679 1869
 			$args->site_srl = $site_module_info->site_srl;
1680
-		}
1681
-		else
1870
+		} else
1682 1871
 		{
1683 1872
 			$args->site_srl = $site_srl;
1684 1873
 		}
1685 1874
 
1686 1875
 		$args->member_srl = $member_info->member_srl;
1687 1876
 		$output = executeQuery('module.isSiteAdmin', $args);
1688
-		if($output->data->member_srl == $args->member_srl) return true;
1877
+		if($output->data->member_srl == $args->member_srl) {
1878
+			return true;
1879
+		}
1689 1880
 		return false;
1690 1881
 	}
1691 1882
 
@@ -1708,7 +1899,9 @@  discard block
 block discarded – undo
1708 1899
 		$obj = new stdClass();
1709 1900
 		$obj->module_srl = $module_srl;
1710 1901
 		$output = executeQueryArray('module.getAdminID', $obj);
1711
-		if(!$output->toBool() || !$output->data) return;
1902
+		if(!$output->toBool() || !$output->data) {
1903
+			return;
1904
+		}
1712 1905
 
1713 1906
 		return $output->data;
1714 1907
 	}
@@ -1721,7 +1914,9 @@  discard block
 block discarded – undo
1721 1914
 	{
1722 1915
 		$extra_vars = array();
1723 1916
 		$get_module_srls = array();
1724
-		if(!is_array($list_module_srl)) $list_module_srl = array($list_module_srl);
1917
+		if(!is_array($list_module_srl)) {
1918
+			$list_module_srl = array($list_module_srl);
1919
+		}
1725 1920
 
1726 1921
 		$vars = false;
1727 1922
 		// cache controll
@@ -1737,14 +1932,12 @@  discard block
 block discarded – undo
1737 1932
 				if($vars)
1738 1933
 				{
1739 1934
 					$extra_vars[$module_srl] = $vars;
1740
-				}
1741
-				else
1935
+				} else
1742 1936
 				{
1743 1937
 					$get_module_srls[] = $module_srl;
1744 1938
 				}
1745 1939
 			}
1746
-		}
1747
-		else
1940
+		} else
1748 1941
 		{
1749 1942
 			$get_module_srls = $list_module_srl;
1750 1943
 		}
@@ -1769,7 +1962,9 @@  discard block
 block discarded – undo
1769 1962
 			}
1770 1963
 			foreach($output->data as $key => $val)
1771 1964
 			{
1772
-				if(in_array($val->name, array('mid','module')) || $val->value == 'Array') continue;
1965
+				if(in_array($val->name, array('mid','module')) || $val->value == 'Array') {
1966
+					continue;
1967
+				}
1773 1968
 
1774 1969
 				if(!isset($extra_vars[$val->module_srl]))
1775 1970
 				{
@@ -1808,7 +2003,9 @@  discard block
 block discarded – undo
1808 2003
 			$args = new stdClass();
1809 2004
 			$args->module_srl = $module_srl;
1810 2005
 			$output = executeQueryArray('module.getModuleSkinVars',$args);
1811
-			if(!$output->toBool()) return;
2006
+			if(!$output->toBool()) {
2007
+				return;
2008
+			}
1812 2009
 
1813 2010
 			$skin_vars = array();
1814 2011
 			foreach($output->data as $vars)
@@ -1816,7 +2013,9 @@  discard block
 block discarded – undo
1816 2013
 				$skin_vars[$vars->name] = $vars;
1817 2014
 			}
1818 2015
 
1819
-			if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $skin_vars);
2016
+			if($oCacheHandler->isSupport()) {
2017
+				$oCacheHandler->put($cache_key, $skin_vars);
2018
+			}
1820 2019
 		}
1821 2020
 
1822 2021
 		return $skin_vars;
@@ -1828,7 +2027,9 @@  discard block
 block discarded – undo
1828 2027
 	function getModuleDefaultSkin($module_name, $skin_type = 'P', $site_srl = 0, $updateCache = true)
1829 2028
 	{
1830 2029
 		$target = ($skin_type == 'M') ? 'mskin' : 'skin';
1831
-		if(!$site_srl) $site_srl = 0;
2030
+		if(!$site_srl) {
2031
+			$site_srl = 0;
2032
+		}
1832 2033
 
1833 2034
 		$designInfoFile = sprintf(_XE_PATH_.'files/site_design/design_%s.php', $site_srl);
1834 2035
 		if(is_readable($designInfoFile))
@@ -1845,19 +2046,16 @@  discard block
 block discarded – undo
1845 2046
 			if(is_dir($moduleSkinPath.'default'))
1846 2047
 			{
1847 2048
 				$skinName = 'default';
1848
-			}
1849
-			else if(is_dir($moduleSkinPath.'xe_default'))
2049
+			} else if(is_dir($moduleSkinPath.'xe_default'))
1850 2050
 			{
1851 2051
 				$skinName = 'xe_default';
1852
-			}
1853
-			else
2052
+			} else
1854 2053
 			{
1855 2054
 				$skins = FileHandler::readDir($moduleSkinPath);
1856 2055
 				if(count($skins) > 0)
1857 2056
 				{
1858 2057
 					$skinName = $skins[0];
1859
-				}
1860
-				else
2058
+				} else
1861 2059
 				{
1862 2060
 					$skinName = NULL;
1863 2061
 				}
@@ -1865,7 +2063,9 @@  discard block
 block discarded – undo
1865 2063
 
1866 2064
 			if($updateCache && $skinName)
1867 2065
 			{
1868
-				if(!isset($designInfo->module->{$module_name})) $designInfo->module->{$module_name} = new stdClass();
2066
+				if(!isset($designInfo->module->{$module_name})) {
2067
+					$designInfo->module->{$module_name} = new stdClass();
2068
+				}
1869 2069
 				$designInfo->module->{$module_name}->{$target} = $skinName;
1870 2070
 
1871 2071
 				$oAdminController = getAdminController('admin');
@@ -1881,23 +2081,28 @@  discard block
 block discarded – undo
1881 2081
 	 */
1882 2082
 	function syncSkinInfoToModuleInfo(&$module_info)
1883 2083
 	{
1884
-		if(!$module_info->module_srl) return;
2084
+		if(!$module_info->module_srl) {
2085
+			return;
2086
+		}
1885 2087
 
1886 2088
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
1887 2089
 		if(Mobile::isFromMobilePhone())
1888 2090
 		{
1889 2091
 			$skin_vars = $this->getModuleMobileSkinVars($module_info->module_srl);
1890
-		}
1891
-		else
2092
+		} else
1892 2093
 		{
1893 2094
 			$skin_vars = $this->getModuleSkinVars($module_info->module_srl);
1894 2095
 		}
1895 2096
 
1896
-		if(!$skin_vars) return;
2097
+		if(!$skin_vars) {
2098
+			return;
2099
+		}
1897 2100
 
1898 2101
 		foreach($skin_vars as $name => $val)
1899 2102
 		{
1900
-			if(isset($module_info->{$name})) continue;
2103
+			if(isset($module_info->{$name})) {
2104
+				continue;
2105
+			}
1901 2106
 			$module_info->{$name} = $val->value;
1902 2107
 		}
1903 2108
 	}
@@ -1923,7 +2128,9 @@  discard block
 block discarded – undo
1923 2128
 			$args = new stdClass();
1924 2129
 			$args->module_srl = $module_srl;
1925 2130
 			$output = executeQueryArray('module.getModuleMobileSkinVars',$args);
1926
-			if(!$output->toBool() || !$output->data) return;
2131
+			if(!$output->toBool() || !$output->data) {
2132
+				return;
2133
+			}
1927 2134
 
1928 2135
 			$skin_vars = array();
1929 2136
 			foreach($output->data as $vars)
@@ -1931,7 +2138,9 @@  discard block
 block discarded – undo
1931 2138
 				$skin_vars[$vars->name] = $vars;
1932 2139
 			}
1933 2140
 
1934
-			if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $skin_vars);
2141
+			if($oCacheHandler->isSupport()) {
2142
+				$oCacheHandler->put($cache_key, $skin_vars);
2143
+			}
1935 2144
 		}
1936 2145
 
1937 2146
 		return $skin_vars;
@@ -1943,7 +2152,9 @@  discard block
 block discarded – undo
1943 2152
 	 */
1944 2153
 	function syncMobileSkinInfoToModuleInfo(&$module_info)
1945 2154
 	{
1946
-		if(!$module_info->module_srl) return;
2155
+		if(!$module_info->module_srl) {
2156
+			return;
2157
+		}
1947 2158
 		$skin_vars = false;
1948 2159
 		// cache controll
1949 2160
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
@@ -1958,17 +2169,25 @@  discard block
 block discarded – undo
1958 2169
 			$args = new stdClass;
1959 2170
 			$args->module_srl = $module_info->module_srl;
1960 2171
 			$output = executeQueryArray('module.getModuleMobileSkinVars',$args);
1961
-			if(!$output->toBool()) return;
2172
+			if(!$output->toBool()) {
2173
+				return;
2174
+			}
1962 2175
 			$skin_vars = $output->data;
1963 2176
 
1964 2177
 			//insert in cache
1965
-			if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $skin_vars);
2178
+			if($oCacheHandler->isSupport()) {
2179
+				$oCacheHandler->put($cache_key, $skin_vars);
2180
+			}
2181
+		}
2182
+		if(!$skin_vars) {
2183
+			return;
1966 2184
 		}
1967
-		if(!$skin_vars) return;
1968 2185
 
1969 2186
 		foreach($output->data as $val)
1970 2187
 		{
1971
-			if(isset($module_info->{$val->name})) continue;
2188
+			if(isset($module_info->{$val->name})) {
2189
+				continue;
2190
+			}
1972 2191
 			$module_info->{$val->name} = $val->value;
1973 2192
 		}
1974 2193
 	}
@@ -1990,10 +2209,12 @@  discard block
 block discarded – undo
1990 2209
 		$grant_info = $xml_info->grant;
1991 2210
 		if($member_info->member_srl)
1992 2211
 		{
1993
-			if(is_array($member_info->group_list)) $group_list = array_keys($member_info->group_list);
1994
-			else $group_list = array();
1995
-		}
1996
-		else
2212
+			if(is_array($member_info->group_list)) {
2213
+				$group_list = array_keys($member_info->group_list);
2214
+			} else {
2215
+				$group_list = array();
2216
+			}
2217
+		} else
1997 2218
 		{
1998 2219
 			$group_list = array();
1999 2220
 		}
@@ -2007,8 +2228,7 @@  discard block
 block discarded – undo
2007 2228
 			}
2008 2229
 
2009 2230
 			$grant->is_admin = $grant->manager = ($member_info->is_admin == 'Y') ? true : false;
2010
-		}
2011
-		else
2231
+		} else
2012 2232
 		{
2013 2233
 			// If module_srl exists
2014 2234
 			// Get a type of granted permission
@@ -2021,7 +2241,9 @@  discard block
 block discarded – undo
2021 2241
 				$args->module_srl = $module_srl;
2022 2242
 				$args->member_srl = $member_info->member_srl;
2023 2243
 				$output = executeQuery('module.getModuleAdmin',$args);
2024
-				if($output->data && $output->data->member_srl == $member_info->member_srl) $grant->manager = true;
2244
+				if($output->data && $output->data->member_srl == $member_info->member_srl) {
2245
+					$grant->manager = true;
2246
+				}
2025 2247
 			}
2026 2248
 			// If not an administrator, get information from the DB and grant manager privilege.
2027 2249
 			if(!$grant->manager)
@@ -2031,8 +2253,7 @@  discard block
 block discarded – undo
2031 2253
 				if($module_info->module == 'planet')
2032 2254
 				{
2033 2255
 					$output = executeQueryArray('module.getPlanetGrants', $args);
2034
-				}
2035
-				else
2256
+				} else
2036 2257
 				{
2037 2258
 					$args = new stdClass;
2038 2259
 					$args->module_srl = $module_srl;
@@ -2047,37 +2268,44 @@  discard block
 block discarded – undo
2047 2268
 					foreach($output->data as $val)
2048 2269
 					{
2049 2270
 						$grant_exists[$val->name] = true;
2050
-						if($granted[$val->name]) continue;
2271
+						if($granted[$val->name]) {
2272
+							continue;
2273
+						}
2051 2274
 						// Log-in member only
2052 2275
 						if($val->group_srl == -1)
2053 2276
 						{
2054 2277
 							$granted[$val->name] = true;
2055
-							if($member_info->member_srl) $grant->{$val->name} = true;
2278
+							if($member_info->member_srl) {
2279
+								$grant->{$val->name} = true;
2280
+							}
2056 2281
 							// Site-joined member only
2057
-						}
2058
-						elseif($val->group_srl == -2)
2282
+						} elseif($val->group_srl == -2)
2059 2283
 						{
2060 2284
 							$granted[$val->name] = true;
2061 2285
 							// Do not grant any permission for non-logged member
2062
-							if(!$member_info->member_srl) $grant->{$val->name} = false;
2286
+							if(!$member_info->member_srl) {
2287
+								$grant->{$val->name} = false;
2288
+							}
2063 2289
 							// Log-in member
2064 2290
 							else
2065 2291
 							{
2066 2292
 								$site_module_info = Context::get('site_module_info');
2067 2293
 								// Permission granted if no information of the currently connected site exists
2068
-								if(!$site_module_info->site_srl) $grant->{$val->name} = true;
2294
+								if(!$site_module_info->site_srl) {
2295
+									$grant->{$val->name} = true;
2296
+								}
2069 2297
 								// Permission is not granted if information of the currently connected site exists
2070
-								elseif(count($group_list)) $grant->{$val->name} = true;
2298
+								elseif(count($group_list)) {
2299
+									$grant->{$val->name} = true;
2300
+								}
2071 2301
 							}
2072 2302
 							// All of non-logged members
2073
-						}
2074
-						elseif($val->group_srl == 0)
2303
+						} elseif($val->group_srl == 0)
2075 2304
 						{
2076 2305
 							$granted[$val->name] = true;
2077 2306
 							$grant->{$val->name} = true;
2078 2307
 							// If a target is a group
2079
-						}
2080
-						else
2308
+						} else
2081 2309
 						{
2082 2310
 							if($group_list && count($group_list) && in_array($val->group_srl, $group_list))
2083 2311
 							{
@@ -2088,30 +2316,43 @@  discard block
 block discarded – undo
2088 2316
 					}
2089 2317
 				}
2090 2318
 				// Separate processing for the virtual group access
2091
-				if(!$grant_exists['access']) $grant->access = true;
2319
+				if(!$grant_exists['access']) {
2320
+					$grant->access = true;
2321
+				}
2092 2322
 				if(count($grant_info))
2093 2323
 				{
2094 2324
 					foreach($grant_info as  $grant_name => $grant_item)
2095 2325
 					{
2096
-						if($grant_exists[$grant_name]) continue;
2326
+						if($grant_exists[$grant_name]) {
2327
+							continue;
2328
+						}
2097 2329
 						switch($grant_item->default)
2098 2330
 						{
2099 2331
 							case 'guest' :
2100 2332
 								$grant->{$grant_name} = true;
2101 2333
 								break;
2102 2334
 							case 'member' :
2103
-								if($member_info->member_srl) $grant->{$grant_name} = true;
2104
-								else $grant->{$grant_name} = false;
2335
+								if($member_info->member_srl) {
2336
+									$grant->{$grant_name} = true;
2337
+								} else {
2338
+									$grant->{$grant_name} = false;
2339
+								}
2105 2340
 								break;
2106 2341
 							case 'site' :
2107 2342
 								$site_module_info = Context::get('site_module_info');
2108
-								if($member_info->member_srl && (($site_module_info->site_srl && count($group_list)) || !$site_module_info->site_srl)) $grant->{$grant_name} = true;
2109
-								else $grant->{$grant_name} = false;
2343
+								if($member_info->member_srl && (($site_module_info->site_srl && count($group_list)) || !$site_module_info->site_srl)) {
2344
+									$grant->{$grant_name} = true;
2345
+								} else {
2346
+									$grant->{$grant_name} = false;
2347
+								}
2110 2348
 								break;
2111 2349
 							case 'manager' :
2112 2350
 							case 'root' :
2113
-								if($member_info->is_admin == 'Y') $grant->{$grant_name} = true;
2114
-								else $grant->{$grant_name} = false;
2351
+								if($member_info->is_admin == 'Y') {
2352
+									$grant->{$grant_name} = true;
2353
+								} else {
2354
+									$grant->{$grant_name} = false;
2355
+								}
2115 2356
 								break;
2116 2357
 						}
2117 2358
 					}
@@ -2187,16 +2428,22 @@  discard block
 block discarded – undo
2187 2428
 	function getFileBoxListHtml()
2188 2429
 	{
2189 2430
 		$logged_info = Context::get('logged_info');
2190
-		if($logged_info->is_admin !='Y' && !$logged_info->is_site_admin) return new Object(-1, 'msg_not_permitted');
2431
+		if($logged_info->is_admin !='Y' && !$logged_info->is_site_admin) {
2432
+			return new Object(-1, 'msg_not_permitted');
2433
+		}
2191 2434
 		$link = parse_url($_SERVER["HTTP_REFERER"]);
2192 2435
 		$link_params = explode('&',$link['query']);
2193 2436
 		foreach ($link_params as $param)
2194 2437
 		{
2195 2438
 			$param = explode("=",$param);
2196
-			if($param[0] == 'selected_widget') $selected_widget = $param[1];
2439
+			if($param[0] == 'selected_widget') {
2440
+				$selected_widget = $param[1];
2441
+			}
2197 2442
 		}
2198 2443
 		$oWidgetModel = getModel('widget');
2199
-		if($selected_widget) $widget_info = $oWidgetModel->getWidgetInfo($selected_widget);
2444
+		if($selected_widget) {
2445
+			$widget_info = $oWidgetModel->getWidgetInfo($selected_widget);
2446
+		}
2200 2447
 		Context::set('allow_multiple', $widget_info->extra_var->images->allow_multiple);
2201 2448
 
2202 2449
 		$oModuleModel = getModel('module');
@@ -2204,7 +2451,9 @@  discard block
 block discarded – undo
2204 2451
 		Context::set('filebox_list', $output->data);
2205 2452
 
2206 2453
 		$page = Context::get('page');
2207
-		if (!$page) $page = 1;
2454
+		if (!$page) {
2455
+			$page = 1;
2456
+		}
2208 2457
 		Context::set('page', $page);
2209 2458
 		Context::set('page_navigation', $output->page_navigation);
2210 2459
 
@@ -2234,25 +2483,28 @@  discard block
 block discarded – undo
2234 2483
 			$rulsetFile = str_replace('@', '', $ruleset);
2235 2484
 			$xml_file = sprintf('./files/ruleset/%s.xml', $rulsetFile);
2236 2485
 			return FileHandler::getRealPath($xml_file);
2237
-		}
2238
-		else if (strpos($ruleset, '#') !== false)
2486
+		} else if (strpos($ruleset, '#') !== false)
2239 2487
 		{
2240 2488
 			$rulsetFile = str_replace('#', '', $ruleset).'.'.$mid;
2241 2489
 			$xml_file = sprintf('./files/ruleset/%s.xml', $rulsetFile);
2242
-			if(is_readable($xml_file))
2243
-				return FileHandler::getRealPath($xml_file);
2244
-			else{
2490
+			if(is_readable($xml_file)) {
2491
+							return FileHandler::getRealPath($xml_file);
2492
+			} else{
2245 2493
 				$ruleset = str_replace('#', '', $ruleset);
2246 2494
 			}
2247 2495
 
2248 2496
 		}
2249 2497
 		// Get a path of the requested module. Return if not exists.
2250 2498
 		$class_path = ModuleHandler::getModulePath($module);
2251
-		if(!$class_path) return;
2499
+		if(!$class_path) {
2500
+			return;
2501
+		}
2252 2502
 
2253 2503
 		// Check if module.xml exists in the path. Return if not exist
2254 2504
 		$xml_file = sprintf("%sruleset/%s.xml", $class_path, $ruleset);
2255
-		if(!file_exists($xml_file)) return;
2505
+		if(!file_exists($xml_file)) {
2506
+			return;
2507
+		}
2256 2508
 
2257 2509
 		return $xml_file;
2258 2510
 	}
@@ -2302,7 +2554,9 @@  discard block
 block discarded – undo
2302 2554
 	function getLangByLangcode()
2303 2555
 	{
2304 2556
 		$langCode = Context::get('langCode');
2305
-		if (!$langCode) return;
2557
+		if (!$langCode) {
2558
+			return;
2559
+		}
2306 2560
 
2307 2561
 		$oModuleController = getController('module');
2308 2562
 		$oModuleController->replaceDefinedLangCode($langCode);
Please login to merge, or discard this patch.
Spacing   +363 added lines, -363 removed lines patch added patch discarded remove patch
@@ -19,26 +19,26 @@  discard block
 block discarded – undo
19 19
 	 */
20 20
 	function isIDExists($id, $site_srl = 0)
21 21
 	{
22
-		if(!preg_match('/^[a-z]{1}([a-z0-9_]+)$/i',$id)) return true;
22
+		if (!preg_match('/^[a-z]{1}([a-z0-9_]+)$/i', $id)) return true;
23 23
 		// directory and rss/atom/api reserved checking, etc.
24 24
 		$dirs = FileHandler::readDir(_XE_PATH_);
25 25
 		$dirs[] = 'rss';
26 26
 		$dirs[] = 'atom';
27 27
 		$dirs[] = 'api';
28
-		if(in_array($id, $dirs)) return true;
28
+		if (in_array($id, $dirs)) return true;
29 29
 		// mid test
30 30
 		$args = new stdClass();
31 31
 		$args->mid = $id;
32 32
 		$args->site_srl = $site_srl;
33 33
 		$output = executeQuery('module.isExistsModuleName', $args);
34
-		if($output->data->count) return true;
34
+		if ($output->data->count) return true;
35 35
 		// vid test (check mid != vid if site_srl=0, which means it is not a virtual site)
36
-		if(!$site_srl)
36
+		if (!$site_srl)
37 37
 		{
38 38
 			$site_args = new stdClass();
39 39
 			$site_args->domain = $id;
40 40
 			$output = executeQuery('module.isExistsSiteDomain', $site_args);
41
-			if($output->data->count) return true;
41
+			if ($output->data->count) return true;
42 42
 		}
43 43
 
44 44
 		return false;
@@ -82,10 +82,10 @@  discard block
 block discarded – undo
82 82
 	function getDefaultMid()
83 83
 	{
84 84
 		$default_url = Context::getDefaultUrl();
85
-		if($default_url && substr_compare($default_url, '/', -1) === 0) $default_url = substr($default_url, 0, -1);
85
+		if ($default_url && substr_compare($default_url, '/', -1) === 0) $default_url = substr($default_url, 0, -1);
86 86
 
87 87
 		$request_url = Context::getRequestUri();
88
-		if($request_url && substr_compare($request_url, '/', -1) === 0) $request_url = substr($request_url, 0, -1);
88
+		if ($request_url && substr_compare($request_url, '/', -1) === 0) $request_url = substr($request_url, 0, -1);
89 89
 
90 90
 		$default_url_parse = parse_url($default_url);
91 91
 		$request_url_parse = parse_url($request_url);
@@ -95,20 +95,20 @@  discard block
 block discarded – undo
95 95
 		// Set up
96 96
 		$domain = '';
97 97
 		$site_info = NULL;
98
-		if($default_url && $default_url_parse['host'] != $request_url_parse['host'])
98
+		if ($default_url && $default_url_parse['host'] != $request_url_parse['host'])
99 99
 		{
100 100
 			$url_info = parse_url($request_url);
101 101
 			$hostname = $url_info['host'];
102 102
 			$path = $url_info['path'];
103
-			if(strlen($path) >= 1 && substr_compare($path, '/', -1) === 0) $path = substr($path, 0, -1);
103
+			if (strlen($path) >= 1 && substr_compare($path, '/', -1) === 0) $path = substr($path, 0, -1);
104 104
 
105
-			$domain = sprintf('%s%s%s', $hostname, $url_info['port']&&$url_info['port']!=80?':'.$url_info['port']:'',$path);
105
+			$domain = sprintf('%s%s%s', $hostname, $url_info['port'] && $url_info['port'] != 80 ? ':'.$url_info['port'] : '', $path);
106 106
 		}
107 107
 
108
-		if($domain === '')
108
+		if ($domain === '')
109 109
 		{
110
-			if(!$vid) $vid = $mid;
111
-			if($vid)
110
+			if (!$vid) $vid = $mid;
111
+			if ($vid)
112 112
 			{
113 113
 				$domain = $vid;
114 114
 			}
@@ -116,89 +116,89 @@  discard block
 block discarded – undo
116 116
 
117 117
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
118 118
 		// If domain is set, look for subsite
119
-		if($domain !== '')
119
+		if ($domain !== '')
120 120
 		{
121 121
 			$site_info = false;
122
-			if($oCacheHandler->isSupport())
122
+			if ($oCacheHandler->isSupport())
123 123
 			{
124
-				$object_key = 'site_info:' . md5($domain);
124
+				$object_key = 'site_info:'.md5($domain);
125 125
 				$domain_cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
126 126
 				$site_info = $oCacheHandler->get($domain_cache_key);
127 127
 			}
128 128
 
129
-			if($site_info === false)
129
+			if ($site_info === false)
130 130
 			{
131 131
 				$args = new stdClass();
132 132
 				$args->domain = $domain;
133 133
 				$output = executeQuery('module.getSiteInfoByDomain', $args);
134 134
 				$site_info = $output->data;
135 135
 
136
-				if($oCacheHandler->isSupport()) $oCacheHandler->put($domain_cache_key, $site_info);
136
+				if ($oCacheHandler->isSupport()) $oCacheHandler->put($domain_cache_key, $site_info);
137 137
 			}
138 138
 
139
-			if($site_info && $vid)
139
+			if ($site_info && $vid)
140 140
 			{
141 141
 				Context::set('vid', $site_info->domain, true);
142
-				if(strtolower($mid)==strtolower($site_info->domain)) Context::set('mid', $site_info->mid,true);
142
+				if (strtolower($mid) == strtolower($site_info->domain)) Context::set('mid', $site_info->mid, true);
143 143
 			}
144
-			if(!$site_info || !$site_info->domain) { $domain = ''; unset($site_info); }
144
+			if (!$site_info || !$site_info->domain) { $domain = ''; unset($site_info); }
145 145
 		}
146 146
 
147 147
 		// If no virtual website was found, get default website
148
-		if($domain === '')
148
+		if ($domain === '')
149 149
 		{
150 150
 			$site_info = false;
151
-			if($oCacheHandler->isSupport())
151
+			if ($oCacheHandler->isSupport())
152 152
 			{
153 153
 				$object_key = 'default_site';
154 154
 				$default_site_cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
155 155
 				$site_info = $oCacheHandler->get($default_site_cache_key);
156 156
 			}
157 157
 
158
-			if($site_info === false)
158
+			if ($site_info === false)
159 159
 			{
160 160
 				$args = new stdClass();
161 161
 				$args->site_srl = 0;
162 162
 				$output = executeQuery('module.getSiteInfo', $args);
163 163
 				// Update the related informaion if there is no default site info
164
-				if(!$output->data)
164
+				if (!$output->data)
165 165
 				{
166 166
 					// Create a table if sites table doesn't exist
167 167
 					$oDB = &DB::getInstance();
168
-					if(!$oDB->isTableExists('sites')) $oDB->createTableByXmlFile(_XE_PATH_.'modules/module/schemas/sites.xml');
169
-					if(!$oDB->isTableExists('sites')) return;
168
+					if (!$oDB->isTableExists('sites')) $oDB->createTableByXmlFile(_XE_PATH_.'modules/module/schemas/sites.xml');
169
+					if (!$oDB->isTableExists('sites')) return;
170 170
 
171 171
 					// Get mid, language
172 172
 					$mid_output = $oDB->executeQuery('module.getDefaultMidInfo', $args);
173 173
 					$db_info = Context::getDBInfo();
174 174
 					$domain = Context::getDefaultUrl();
175 175
 					$url_info = parse_url($domain);
176
-					$domain = $url_info['host'].( (!empty($url_info['port'])&&$url_info['port']!=80)?':'.$url_info['port']:'').$url_info['path'];
176
+					$domain = $url_info['host'].((!empty($url_info['port']) && $url_info['port'] != 80) ? ':'.$url_info['port'] : '').$url_info['path'];
177 177
 
178 178
 					$site_args = new stdClass;
179 179
 					$site_args->site_srl = 0;
180
-					$site_args->index_module_srl  = $mid_output->data->module_srl;
180
+					$site_args->index_module_srl = $mid_output->data->module_srl;
181 181
 					$site_args->domain = $domain;
182 182
 					$site_args->default_language = $db_info->lang_type;
183 183
 
184
-					if($output->data && !$output->data->index_module_srl)
184
+					if ($output->data && !$output->data->index_module_srl)
185 185
 					{
186 186
 						$output = executeQuery('module.updateSite', $site_args);
187 187
 					}
188 188
 					else
189 189
 					{
190 190
 						$output = executeQuery('module.insertSite', $site_args);
191
-						if(!$output->toBool()) return $output;
191
+						if (!$output->toBool()) return $output;
192 192
 					}
193 193
 					$output = executeQuery('module.getSiteInfo', $args);
194 194
 				}
195 195
 				$site_info = $output->data;
196
-				if($oCacheHandler->isSupport()) $oCacheHandler->put($default_site_cache_key, $site_info);
196
+				if ($oCacheHandler->isSupport()) $oCacheHandler->put($default_site_cache_key, $site_info);
197 197
 			}
198 198
 		}
199 199
 
200
-		if(!$site_info->module_srl) return $site_info;
201
-		if(is_array($site_info) && $site_info->data[0]) $site_info = $site_info[0];
200
+		if (!$site_info->module_srl) return $site_info;
201
+		if (is_array($site_info) && $site_info->data[0]) $site_info = $site_info[0];
202 202
 		return $this->addModuleExtraVars($site_info);
203 203
 	}
204 204
 
@@ -207,48 +207,48 @@  discard block
 block discarded – undo
207 207
 	 */
208 208
 	function getModuleInfoByMid($mid, $site_srl = 0, $columnList = array())
209 209
 	{
210
-		if(!$mid || ($mid && !preg_match("/^[a-z][a-z0-9_]+$/i", $mid)))
210
+		if (!$mid || ($mid && !preg_match("/^[a-z][a-z0-9_]+$/i", $mid)))
211 211
 		{
212 212
 			return;
213 213
 		}
214 214
 
215 215
 		$args = new stdClass();
216 216
 		$args->mid = $mid;
217
-		$args->site_srl = (int)$site_srl;
217
+		$args->site_srl = (int) $site_srl;
218 218
 
219 219
 		$module_srl = false;
220 220
 		$module_info = false;
221 221
 
222 222
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
223
-		if($oCacheHandler->isSupport())
223
+		if ($oCacheHandler->isSupport())
224 224
 		{
225 225
 			$object_key = 'module_srl:'.$mid.'_'.$site_srl;
226 226
 			$module_srl_cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
227 227
 			$module_srl = $oCacheHandler->get($module_srl_cache_key);
228
-			if($module_srl)
228
+			if ($module_srl)
229 229
 			{
230
-				$object_key = 'mid_info:' . $module_srl;
230
+				$object_key = 'mid_info:'.$module_srl;
231 231
 				$module_info_cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
232 232
 				$module_info = $oCacheHandler->get($module_info_cache_key);
233 233
 			}
234 234
 		}
235 235
 
236
-		if($module_info === false)
236
+		if ($module_info === false)
237 237
 		{
238 238
 			$output = executeQuery('module.getMidInfo', $args);
239 239
 			$module_info = $output->data;
240
-			if($oCacheHandler->isSupport())
240
+			if ($oCacheHandler->isSupport())
241 241
 			{
242 242
 				$oCacheHandler->put($module_srl_cache_key, $module_info->module_srl);
243 243
 
244
-				$object_key = 'mid_info:' . $module_info->module_srl;
244
+				$object_key = 'mid_info:'.$module_info->module_srl;
245 245
 				$module_info_cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
246 246
 				$oCacheHandler->put($module_info_cache_key, $module_info);
247 247
 			}
248 248
 		}
249 249
 
250 250
 		$this->applyDefaultSkin($module_info);
251
-		if(!$module_info->module_srl && $module_info->data[0]) $module_info = $module_info->data[0];
251
+		if (!$module_info->module_srl && $module_info->data[0]) $module_info = $module_info->data[0];
252 252
 		return $this->addModuleExtraVars($module_info);
253 253
 	}
254 254
 
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
 		$menuItemSrl = Context::get('menu_item_srl');
265 265
 		$menuItemSrl = (!$menuItemSrl) ? $menu_item_srl : $menuItemSrl;
266 266
 
267
-		if(!$menuItemSrl)
267
+		if (!$menuItemSrl)
268 268
 		{
269 269
 			$this->stop(-1, 'msg_invalid_request');
270 270
 			return;
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
 		$args = new stdClass();
274 274
 		$args->menu_item_srl = $menuItemSrl;
275 275
 		$output = executeQuery('module.getModuleInfoByMenuItemSrl', $args);
276
-		if(!$output->toBool())
276
+		if (!$output->toBool())
277 277
 		{
278 278
 			return $output;
279 279
 		}
@@ -297,12 +297,12 @@  discard block
 block discarded – undo
297 297
 		$layoutInfoMobile = $layoutSrlMobile ? $oLayoutModel->getLayoutRawData($layoutSrlMobile, array('title')) : NULL;
298 298
 		$skinInfoPc = $this->loadSkinInfo(Modulehandler::getModulePath($moduleInfo->module), $skinNamePc);
299 299
 		$skinInfoMobile = $this->loadSkinInfo(Modulehandler::getModulePath($moduleInfo->module), $skinNameMobile, 'm.skins');
300
-		if(!$skinInfoPc)
300
+		if (!$skinInfoPc)
301 301
 		{
302 302
 			$skinInfoPc = new stdClass();
303 303
 			$skinInfoPc->title = $skinNamePc;
304 304
 		}
305
-		if(!$skinInfoMobile)
305
+		if (!$skinInfoMobile)
306 306
 		{
307 307
 			$skinInfoMobile = new stdClass();
308 308
 			$skinInfoMobile->title = $skinNameMobile;
@@ -321,23 +321,23 @@  discard block
 block discarded – undo
321 321
 		$mid_info = false;
322 322
 
323 323
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
324
-		if($oCacheHandler->isSupport())
324
+		if ($oCacheHandler->isSupport())
325 325
 		{
326 326
 			$object_key = 'module_srl:'.$mid.'_'.$site_srl;
327 327
 			$module_srl_cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
328 328
 			$module_srl = $oCacheHandler->get($module_srl_cache_key);
329
-			if($module_srl)
329
+			if ($module_srl)
330 330
 			{
331
-				$object_key = 'mid_info:' . $module_srl;
331
+				$object_key = 'mid_info:'.$module_srl;
332 332
 				$module_info_cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
333 333
 				$mid_info = $oCacheHandler->get($module_info_cache_key);
334 334
 			}
335 335
 
336
-			if($mid_info === false)
336
+			if ($mid_info === false)
337 337
 			{
338 338
 				$oCacheHandler->put($module_srl_cache_key, $output->data->module_srl);
339 339
 
340
-				$object_key = 'mid_info:' . $output->data->module_srl;
340
+				$object_key = 'mid_info:'.$output->data->module_srl;
341 341
 				$module_info_cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
342 342
 				$oCacheHandler->put($module_info_cache_key, $moduleInfo);
343 343
 			}
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
 
351 351
 		$moduleInfo = $this->addModuleExtraVars($moduleInfo);
352 352
 
353
-		if($moduleInfo->module == 'page' && $moduleInfo->page_type != 'ARTICLE')
353
+		if ($moduleInfo->module == 'page' && $moduleInfo->page_type != 'ARTICLE')
354 354
 		{
355 355
 			unset($moduleInfo->skin);
356 356
 			unset($moduleInfo->mskin);
@@ -369,32 +369,32 @@  discard block
 block discarded – undo
369 369
 		$mid_info = false;
370 370
 
371 371
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
372
-		if($oCacheHandler->isSupport())
372
+		if ($oCacheHandler->isSupport())
373 373
 		{
374
-			$object_key = 'mid_info:' . $module_srl;
374
+			$object_key = 'mid_info:'.$module_srl;
375 375
 			$cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
376 376
 			$mid_info = $oCacheHandler->get($cache_key);
377 377
 		}
378 378
 
379
-		if($mid_info === false)
379
+		if ($mid_info === false)
380 380
 		{
381 381
 			// Get data
382 382
 			$args = new stdClass();
383 383
 			$args->module_srl = $module_srl;
384 384
 			$output = executeQuery('module.getMidInfo', $args);
385
-			if(!$output->toBool()) return;
385
+			if (!$output->toBool()) return;
386 386
 
387 387
 			$mid_info = $output->data;
388 388
 			$this->applyDefaultSkin($mid_info);
389
-			if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $mid_info);
389
+			if ($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $mid_info);
390 390
 		}
391 391
 
392
-		if($mid_info && count($columnList))
392
+		if ($mid_info && count($columnList))
393 393
 		{
394 394
 			$module_info = new stdClass();
395
-			foreach($mid_info as $key => $item)
395
+			foreach ($mid_info as $key => $item)
396 396
 			{
397
-				if(in_array($key, $columnList))
397
+				if (in_array($key, $columnList))
398 398
 				{
399 399
 					$module_info->$key = $item;
400 400
 				}
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
 		else $module_info = $mid_info;
404 404
 
405 405
 		$oModuleController = getController('module');
406
-		if(isset($module_info->browser_title)) $oModuleController->replaceDefinedLangCode($module_info->browser_title);
406
+		if (isset($module_info->browser_title)) $oModuleController->replaceDefinedLangCode($module_info->browser_title);
407 407
 
408 408
 		$this->applyDefaultSkin($module_info);
409 409
 		return $this->addModuleExtraVars($module_info);
@@ -416,12 +416,12 @@  discard block
 block discarded – undo
416 416
 	 */
417 417
 	private function applyDefaultSkin(&$moduleInfo)
418 418
 	{
419
-		if($moduleInfo->is_skin_fix == 'N')
419
+		if ($moduleInfo->is_skin_fix == 'N')
420 420
 		{
421 421
 			$moduleInfo->skin = '/USE_DEFAULT/';
422 422
 		}
423 423
 
424
-		if($moduleInfo->is_mskin_fix == 'N')
424
+		if ($moduleInfo->is_mskin_fix == 'N')
425 425
 		{
426 426
 			$moduleInfo->mskin = '/USE_DEFAULT/';
427 427
 		}
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
 		$count = count($output->data);
440 440
 
441 441
 		$modules = array();
442
-		for($i=0;$i<$count;$i++)
442
+		for ($i = 0; $i < $count; $i++)
443 443
 		{
444 444
 			$modules[] = $output->data[$i];
445 445
 		}
@@ -451,11 +451,11 @@  discard block
 block discarded – undo
451 451
 	 */
452 452
 	function getModulesInfo($module_srls, $columnList = array())
453 453
 	{
454
-		if(is_array($module_srls)) $module_srls = implode(',',$module_srls);
454
+		if (is_array($module_srls)) $module_srls = implode(',', $module_srls);
455 455
 		$args = new stdClass();
456 456
 		$args->module_srls = $module_srls;
457 457
 		$output = executeQueryArray('module.getModulesInfo', $args, $columnList);
458
-		if(!$output->toBool()) return;
458
+		if (!$output->toBool()) return;
459 459
 		return $this->addModuleExtraVars($output->data);
460 460
 	}
461 461
 
@@ -465,31 +465,31 @@  discard block
 block discarded – undo
465 465
 	function addModuleExtraVars($module_info)
466 466
 	{
467 467
 		// Process although one or more module informaion is requested
468
-		if(!is_array($module_info)) $target_module_info = array($module_info);
468
+		if (!is_array($module_info)) $target_module_info = array($module_info);
469 469
 		else $target_module_info = $module_info;
470 470
 		// Get module_srl
471 471
 		$module_srls = array();
472
-		foreach($target_module_info as $key => $val)
472
+		foreach ($target_module_info as $key => $val)
473 473
 		{
474 474
 			$module_srl = $val->module_srl;
475
-			if(!$module_srl) continue;
475
+			if (!$module_srl) continue;
476 476
 			$module_srls[] = $val->module_srl;
477 477
 		}
478 478
 		// Extract extra information of the module and skin
479 479
 		$extra_vars = $this->getModuleExtraVars($module_srls);
480
-		if(!count($module_srls) || !count($extra_vars)) return $module_info;
480
+		if (!count($module_srls) || !count($extra_vars)) return $module_info;
481 481
 
482
-		foreach($target_module_info as $key => $val)
482
+		foreach ($target_module_info as $key => $val)
483 483
 		{
484
-			if(!$extra_vars[$val->module_srl] || !count($extra_vars[$val->module_srl])) continue;
485
-			foreach($extra_vars[$val->module_srl] as $k => $v)
484
+			if (!$extra_vars[$val->module_srl] || !count($extra_vars[$val->module_srl])) continue;
485
+			foreach ($extra_vars[$val->module_srl] as $k => $v)
486 486
 			{
487
-				if($target_module_info[$key]->{$k}) continue;
487
+				if ($target_module_info[$key]->{$k}) continue;
488 488
 				$target_module_info[$key]->{$k} = $v;
489 489
 			}
490 490
 		}
491 491
 
492
-		if(is_array($module_info)) return $target_module_info;
492
+		if (is_array($module_info)) return $target_module_info;
493 493
 		return $target_module_info[0];
494 494
 	}
495 495
 
@@ -500,37 +500,37 @@  discard block
 block discarded – undo
500 500
 	{
501 501
 		$list = false;
502 502
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
503
-		if($oCacheHandler->isSupport())
503
+		if ($oCacheHandler->isSupport())
504 504
 		{
505
-			if(count($args) === 1 && isset($args->site_srl))
505
+			if (count($args) === 1 && isset($args->site_srl))
506 506
 			{
507
-				$object_key = 'module:mid_list_' . $args->site_srl;
507
+				$object_key = 'module:mid_list_'.$args->site_srl;
508 508
 				$cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
509 509
 				$list = $oCacheHandler->get($cache_key);
510 510
 			}
511 511
 		}
512 512
 
513
-		if($list === false)
513
+		if ($list === false)
514 514
 		{
515
-			if($oCacheHandler->isSupport() && count($args) === 1 && isset($args->site_srl))
515
+			if ($oCacheHandler->isSupport() && count($args) === 1 && isset($args->site_srl))
516 516
 			{
517 517
 				$columnList = array();
518 518
 			}
519 519
 
520 520
 			$output = executeQuery('module.getMidList', $args, $columnList);
521
-			if(!$output->toBool()) return $output;
521
+			if (!$output->toBool()) return $output;
522 522
 			$list = $output->data;
523 523
 
524
-			if($oCacheHandler->isSupport() && count($args) === 1 && isset($args->site_srl))
524
+			if ($oCacheHandler->isSupport() && count($args) === 1 && isset($args->site_srl))
525 525
 			{
526 526
 				$oCacheHandler->put($cache_key, $list);
527 527
 			}
528 528
 		}
529
-		if(!$list) return;
529
+		if (!$list) return;
530 530
 
531
-		if(!is_array($list)) $list = array($list);
531
+		if (!is_array($list)) $list = array($list);
532 532
 
533
-		foreach($list as $val)
533
+		foreach ($list as $val)
534 534
 		{
535 535
 			$mid_list[$val->mid] = $val;
536 536
 		}
@@ -544,10 +544,10 @@  discard block
 block discarded – undo
544 544
 	function getModuleSrlList($args = null, $columnList = array())
545 545
 	{
546 546
 		$output = executeQueryArray('module.getMidList', $args, $columnList);
547
-		if(!$output->toBool()) return $output;
547
+		if (!$output->toBool()) return $output;
548 548
 
549 549
 		$list = $output->data;
550
-		if(!$list) return;
550
+		if (!$list) return;
551 551
 
552 552
 		return $list;
553 553
 	}
@@ -557,22 +557,22 @@  discard block
 block discarded – undo
557 557
 	 */
558 558
 	function getModuleSrlByMid($mid)
559 559
 	{
560
-		if($mid && !is_array($mid)) $mid = explode(',',$mid);
561
-		if(is_array($mid)) $mid = "'".implode("','",$mid)."'";
560
+		if ($mid && !is_array($mid)) $mid = explode(',', $mid);
561
+		if (is_array($mid)) $mid = "'".implode("','", $mid)."'";
562 562
 
563 563
 		$site_module_info = Context::get('site_module_info');
564 564
 
565 565
 		$args = new stdClass;
566 566
 		$args->mid = $mid;
567
-		if($site_module_info) $args->site_srl = $site_module_info->site_srl;
567
+		if ($site_module_info) $args->site_srl = $site_module_info->site_srl;
568 568
 		$output = executeQuery('module.getModuleSrlByMid', $args);
569
-		if(!$output->toBool()) return $output;
569
+		if (!$output->toBool()) return $output;
570 570
 
571 571
 		$list = $output->data;
572
-		if(!$list) return;
573
-		if(!is_array($list)) $list = array($list);
572
+		if (!$list) return;
573
+		if (!is_array($list)) $list = array($list);
574 574
 
575
-		foreach($list as $key => $val)
575
+		foreach ($list as $key => $val)
576 576
 		{
577 577
 			$module_srl_list[] = $val->module_srl;
578 578
 		}
@@ -588,33 +588,33 @@  discard block
 block discarded – undo
588 588
 		$action_forward = false;
589 589
 		// cache controll
590 590
 		$oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE);
591
-		if($oCacheHandler->isSupport())
591
+		if ($oCacheHandler->isSupport())
592 592
 		{
593 593
 			$cache_key = 'action_forward';
594 594
 			$action_forward = $oCacheHandler->get($cache_key);
595 595
 		}
596 596
 
597 597
 		// retrieve and caching all registered action_forward
598
-		if($action_forward === false)
598
+		if ($action_forward === false)
599 599
 		{
600 600
 			$args = new stdClass();
601
-			$output = executeQueryArray('module.getActionForward',$args);
602
-			if(!$output->toBool()) return new stdClass;
603
-			if(!$output->data) $output->data = array();
601
+			$output = executeQueryArray('module.getActionForward', $args);
602
+			if (!$output->toBool()) return new stdClass;
603
+			if (!$output->data) $output->data = array();
604 604
 
605 605
 			$action_forward = array();
606
-			foreach($output->data as $item)
606
+			foreach ($output->data as $item)
607 607
 			{
608 608
 				$action_forward[$item->act] = $item;
609 609
 			}
610 610
 
611
-			if($oCacheHandler->isSupport())
611
+			if ($oCacheHandler->isSupport())
612 612
 			{
613 613
 				$oCacheHandler->put($cache_key, $action_forward);
614 614
 			}
615 615
 		}
616 616
 
617
-		if($action_forward[$act])
617
+		if ($action_forward[$act])
618 618
 		{
619 619
 			return $action_forward[$act];
620 620
 		}
@@ -629,25 +629,25 @@  discard block
 block discarded – undo
629 629
 	 */
630 630
 	function getTriggers($trigger_name, $called_position)
631 631
 	{
632
-		if(is_null($GLOBALS['__triggers__']))
632
+		if (is_null($GLOBALS['__triggers__']))
633 633
 		{
634 634
 			$triggers = FALSE;
635 635
 			$oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE);
636
-			if($oCacheHandler->isSupport())
636
+			if ($oCacheHandler->isSupport())
637 637
 			{
638 638
 				$cache_key = 'triggers';
639 639
 				$triggers = $oCacheHandler->get($cache_key);
640 640
 			}
641
-			if($triggers === FALSE)
641
+			if ($triggers === FALSE)
642 642
 			{
643 643
 				$output = executeQueryArray('module.getTriggers');
644 644
 				$triggers = $output->data;
645
-				if($output->toBool() && $oCacheHandler->isSupport())
645
+				if ($output->toBool() && $oCacheHandler->isSupport())
646 646
 				{
647 647
 					$oCacheHandler->put($cache_key, $triggers);
648 648
 				}
649 649
 			}
650
-			foreach($triggers as $item)
650
+			foreach ($triggers as $item)
651 651
 			{
652 652
 				$GLOBALS['__triggers__'][$item->trigger_name][$item->called_position][] = $item;
653 653
 			}
@@ -663,11 +663,11 @@  discard block
 block discarded – undo
663 663
 	{
664 664
 		$triggers = $this->getTriggers($trigger_name, $called_position);
665 665
 
666
-		if($triggers && is_array($triggers))
666
+		if ($triggers && is_array($triggers))
667 667
 		{
668
-			foreach($triggers as $item)
668
+			foreach ($triggers as $item)
669 669
 			{
670
-				if($item->module == $module && $item->type == $type && $item->called_method == $called_method)
670
+				if ($item->module == $module && $item->type == $type && $item->called_method == $called_method)
671 671
 				{
672 672
 					return $item;
673 673
 				}
@@ -680,12 +680,12 @@  discard block
 block discarded – undo
680 680
 	/**
681 681
 	 * @brief Get module extend
682 682
 	 */
683
-	function getModuleExtend($parent_module, $type, $kind='')
683
+	function getModuleExtend($parent_module, $type, $kind = '')
684 684
 	{
685 685
 		$key = $parent_module.'.'.$kind.'.'.$type;
686 686
 
687 687
 		$module_extend_info = $this->loadModuleExtends();
688
-		if(array_key_exists($key, $module_extend_info))
688
+		if (array_key_exists($key, $module_extend_info))
689 689
 		{
690 690
 			return $module_extend_info[$key];
691 691
 		}
@@ -701,29 +701,29 @@  discard block
 block discarded – undo
701 701
 		$cache_file = './files/config/module_extend.php';
702 702
 		$cache_file = FileHandler::getRealPath($cache_file);
703 703
 
704
-		if(!isset($GLOBALS['__MODULE_EXTEND__']))
704
+		if (!isset($GLOBALS['__MODULE_EXTEND__']))
705 705
 		{
706 706
 			// check pre install
707
-			if(file_exists(FileHandler::getRealPath('./files')) && !file_exists($cache_file))
707
+			if (file_exists(FileHandler::getRealPath('./files')) && !file_exists($cache_file))
708 708
 			{
709 709
 				$arr = array();
710 710
 				$output = executeQueryArray('module.getModuleExtend');
711
-				if($output->data)
711
+				if ($output->data)
712 712
 				{
713
-					foreach($output->data as $v)
713
+					foreach ($output->data as $v)
714 714
 					{
715 715
 						$arr[] = sprintf("'%s.%s.%s' => '%s'", $v->parent_module, $v->kind, $v->type, $v->extend_module);
716 716
 					}
717 717
 				}
718 718
 
719 719
 				$str = '<?PHP return array(%s); ?>';
720
-				$str = sprintf($str, join(',',$arr));
720
+				$str = sprintf($str, join(',', $arr));
721 721
 
722 722
 				FileHandler::writeFile($cache_file, $str);
723 723
 			}
724 724
 
725 725
 
726
-			if(file_exists($cache_file))
726
+			if (file_exists($cache_file))
727 727
 			{
728 728
 				$GLOBALS['__MODULE_EXTEND__'] = include($cache_file);
729 729
 			}
@@ -743,20 +743,20 @@  discard block
 block discarded – undo
743 743
 	{
744 744
 		// Get a path of the requested module. Return if not exists.
745 745
 		$module_path = ModuleHandler::getModulePath($module);
746
-		if(!$module_path) return;
746
+		if (!$module_path) return;
747 747
 		// Read the xml file for module skin information
748 748
 		$xml_file = sprintf("%s/conf/info.xml", $module_path);
749
-		if(!file_exists($xml_file)) return;
749
+		if (!file_exists($xml_file)) return;
750 750
 
751 751
 		$oXmlParser = new XmlParser();
752 752
 		$tmp_xml_obj = $oXmlParser->loadXmlFile($xml_file);
753 753
 		$xml_obj = $tmp_xml_obj->module;
754 754
 
755
-		if(!$xml_obj) return;
755
+		if (!$xml_obj) return;
756 756
 
757 757
 		// Module Information
758 758
 		$module_info = new stdClass();
759
-		if($xml_obj->version && $xml_obj->attrs->version == '0.2')
759
+		if ($xml_obj->version && $xml_obj->attrs->version == '0.2')
760 760
 		{
761 761
 			// module format 0.2
762 762
 			$module_info->title = $xml_obj->title->body;
@@ -764,16 +764,16 @@  discard block
 block discarded – undo
764 764
 			$module_info->version = $xml_obj->version->body;
765 765
 			$module_info->homepage = $xml_obj->link->body;
766 766
 			$module_info->category = $xml_obj->category->body;
767
-			if(!$module_info->category) $module_info->category = 'service';
767
+			if (!$module_info->category) $module_info->category = 'service';
768 768
 			sscanf($xml_obj->date->body, '%d-%d-%d', $date_obj->y, $date_obj->m, $date_obj->d);
769 769
 			$module_info->date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d);
770 770
 			$module_info->license = $xml_obj->license->body;
771 771
 			$module_info->license_link = $xml_obj->license->attrs->link;
772 772
 
773
-			if(!is_array($xml_obj->author)) $author_list[] = $xml_obj->author;
773
+			if (!is_array($xml_obj->author)) $author_list[] = $xml_obj->author;
774 774
 			else $author_list = $xml_obj->author;
775 775
 
776
-			foreach($author_list as $author)
776
+			foreach ($author_list as $author)
777 777
 			{
778 778
 				$author_obj = new stdClass();
779 779
 				$author_obj->name = $author->name->body;
@@ -789,7 +789,7 @@  discard block
 block discarded – undo
789 789
 			$module_info->description = $xml_obj->author->description->body;
790 790
 			$module_info->version = $xml_obj->attrs->version;
791 791
 			$module_info->category = $xml_obj->attrs->category;
792
-			if(!$module_info->category) $module_info->category = 'service';
792
+			if (!$module_info->category) $module_info->category = 'service';
793 793
 			sscanf($xml_obj->author->attrs->date, '%d. %d. %d', $date_obj->y, $date_obj->m, $date_obj->d);
794 794
 			$module_info->date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d);
795 795
 			$author_obj = new stdClass();
@@ -818,17 +818,17 @@  discard block
 block discarded – undo
818 818
 	{
819 819
 		// Get a path of the requested module. Return if not exists.
820 820
 		$class_path = ModuleHandler::getModulePath($module);
821
-		if(!$class_path) return;
821
+		if (!$class_path) return;
822 822
 
823 823
 		// Check if module.xml exists in the path. Return if not exist
824 824
 		$xml_file = sprintf("%sconf/module.xml", $class_path);
825
-		if(!file_exists($xml_file)) return;
825
+		if (!file_exists($xml_file)) return;
826 826
 
827 827
 		// Check if cached file exists
828
-		$cache_file = sprintf(_XE_PATH_ . "files/cache/module_info/%s.%s.%s.php", $module, Context::getLangType(), __XE_VERSION__);
828
+		$cache_file = sprintf(_XE_PATH_."files/cache/module_info/%s.%s.%s.php", $module, Context::getLangType(), __XE_VERSION__);
829 829
 
830 830
 		// Update if no cache file exists or it is older than xml file
831
-		if(!file_exists($cache_file) || filemtime($cache_file) < filemtime($xml_file) || $re_cache)
831
+		if (!file_exists($cache_file) || filemtime($cache_file) < filemtime($xml_file) || $re_cache)
832 832
 		{
833 833
 			$info = new stdClass();
834 834
 			$buff = array(); // /< Set buff variable to use in the cache file
@@ -841,7 +841,7 @@  discard block
 block discarded – undo
841 841
 
842 842
 			$xml_obj = XmlParser::loadXmlFile($xml_file); // /< Read xml file and convert it to xml object
843 843
 
844
-			if(!count($xml_obj->module)) return; // /< Error occurs if module tag doesn't included in the xml
844
+			if (!count($xml_obj->module)) return; // /< Error occurs if module tag doesn't included in the xml
845 845
 
846 846
 			$grants = $xml_obj->module->grants->grant; // /< Permission information
847 847
 			$permissions = $xml_obj->module->permissions->permission; // /<  Acting permission
@@ -851,17 +851,17 @@  discard block
 block discarded – undo
851 851
 			$default_index = $admin_index = '';
852 852
 
853 853
 			// Arrange permission information
854
-			if($grants)
854
+			if ($grants)
855 855
 			{
856
-				if(is_array($grants)) $grant_list = $grants;
856
+				if (is_array($grants)) $grant_list = $grants;
857 857
 				else $grant_list[] = $grants;
858 858
 
859 859
 				$info->grant = new stdClass();
860 860
 				$buff[] = '$info->grant = new stdClass;';
861
-				foreach($grant_list as $grant)
861
+				foreach ($grant_list as $grant)
862 862
 				{
863 863
 					$name = $grant->attrs->name;
864
-					$default = $grant->attrs->default?$grant->attrs->default:'guest';
864
+					$default = $grant->attrs->default ? $grant->attrs->default : 'guest';
865 865
 					$title = $grant->title->body;
866 866
 
867 867
 					$info->grant->{$name} = new stdClass();
@@ -874,15 +874,15 @@  discard block
 block discarded – undo
874 874
 				}
875 875
 			}
876 876
 			// Permissions to grant
877
-			if($permissions)
877
+			if ($permissions)
878 878
 			{
879
-				if(is_array($permissions)) $permission_list = $permissions;
879
+				if (is_array($permissions)) $permission_list = $permissions;
880 880
 				else $permission_list[] = $permissions;
881 881
 
882 882
 				$buff[] = '$info->permission = new stdClass;';
883 883
 
884 884
 				$info->permission = new stdClass();
885
-				foreach($permission_list as $permission)
885
+				foreach ($permission_list as $permission)
886 886
 				{
887 887
 					$action = $permission->attrs->action;
888 888
 					$target = $permission->attrs->target;
@@ -893,14 +893,14 @@  discard block
 block discarded – undo
893 893
 				}
894 894
 			}
895 895
 			// for admin menus
896
-			if($menus)
896
+			if ($menus)
897 897
 			{
898
-				if(is_array($menus)) $menu_list = $menus;
898
+				if (is_array($menus)) $menu_list = $menus;
899 899
 				else $menu_list[] = $menus;
900 900
 
901 901
 				$buff[] = '$info->menu = new stdClass;';
902 902
 				$info->menu = new stdClass();
903
-				foreach($menu_list as $menu)
903
+				foreach ($menu_list as $menu)
904 904
 				{
905 905
 					$menu_name = $menu->attrs->name;
906 906
 					$menu_title = is_array($menu->title) ? $menu->title[0]->body : $menu->title->body;
@@ -918,22 +918,22 @@  discard block
 block discarded – undo
918 918
 			}
919 919
 
920 920
 			// actions
921
-			if($actions)
921
+			if ($actions)
922 922
 			{
923
-				if(is_array($actions)) $action_list = $actions;
923
+				if (is_array($actions)) $action_list = $actions;
924 924
 				else $action_list[] = $actions;
925 925
 
926 926
 				$buff[] = '$info->action = new stdClass;';
927 927
 				$info->action = new stdClass();
928
-				foreach($action_list as $action)
928
+				foreach ($action_list as $action)
929 929
 				{
930 930
 					$name = $action->attrs->name;
931 931
 
932 932
 					$type = $action->attrs->type;
933
-					$grant = $action->attrs->grant?$action->attrs->grant:'guest';
934
-					$standalone = $action->attrs->standalone=='false'?'false':'true';
935
-					$ruleset = $action->attrs->ruleset?$action->attrs->ruleset:'';
936
-					$method = $action->attrs->method?$action->attrs->method:'';
933
+					$grant = $action->attrs->grant ? $action->attrs->grant : 'guest';
934
+					$standalone = $action->attrs->standalone == 'false' ? 'false' : 'true';
935
+					$ruleset = $action->attrs->ruleset ? $action->attrs->ruleset : '';
936
+					$method = $action->attrs->method ? $action->attrs->method : '';
937 937
 
938 938
 					$index = $action->attrs->index;
939 939
 					$admin_index = $action->attrs->admin_index;
@@ -947,14 +947,14 @@  discard block
 block discarded – undo
947 947
 					$info->action->{$name}->standalone = $standalone;
948 948
 					$info->action->{$name}->ruleset = $ruleset;
949 949
 					$info->action->{$name}->method = $method;
950
-					if($action->attrs->menu_name)
950
+					if ($action->attrs->menu_name)
951 951
 					{
952
-						if($menu_index == 'true')
952
+						if ($menu_index == 'true')
953 953
 						{
954 954
 							$info->menu->{$action->attrs->menu_name}->index = $name;
955 955
 							$buff[] = sprintf('$info->menu->%s->index=\'%s\';', $action->attrs->menu_name, $name);
956 956
 						}
957
-						if(is_array($info->menu->{$action->attrs->menu_name}->acts))
957
+						if (is_array($info->menu->{$action->attrs->menu_name}->acts))
958 958
 						{
959 959
 							$info->menu->{$action->attrs->menu_name}->acts[] = $name;
960 960
 							$currentKey = array_search($name, $info->menu->{$action->attrs->menu_name}->acts);
@@ -971,22 +971,22 @@  discard block
 block discarded – undo
971 971
 					$buff[] = sprintf('$info->action->%s->ruleset=\'%s\';', $name, $ruleset);
972 972
 					$buff[] = sprintf('$info->action->%s->method=\'%s\';', $name, $method);
973 973
 
974
-					if($index=='true')
974
+					if ($index == 'true')
975 975
 					{
976 976
 						$default_index_act = $name;
977 977
 						$info->default_index_act = $name;
978 978
 					}
979
-					if($admin_index=='true')
979
+					if ($admin_index == 'true')
980 980
 					{
981 981
 						$admin_index_act = $name;
982 982
 						$info->admin_index_act = $name;
983 983
 					}
984
-					if($setup_index=='true')
984
+					if ($setup_index == 'true')
985 985
 					{
986 986
 						$setup_index_act = $name;
987 987
 						$info->setup_index_act = $name;
988 988
 					}
989
-					if($simple_setup_index=='true')
989
+					if ($simple_setup_index == 'true')
990 990
 					{
991 991
 						$simple_setup_index_act = $name;
992 992
 						$info->simple_setup_index_act = $name;
@@ -1007,7 +1007,7 @@  discard block
 block discarded – undo
1007 1007
 			return $info;
1008 1008
 		}
1009 1009
 
1010
-		if(file_exists($cache_file)) return include($cache_file);
1010
+		if (file_exists($cache_file)) return include($cache_file);
1011 1011
 	}
1012 1012
 
1013 1013
 	/**
@@ -1018,7 +1018,7 @@  discard block
 block discarded – undo
1018 1018
 	{
1019 1019
 		$module = Context::get('module_type');
1020 1020
 
1021
-		if($module == 'ARTICLE')
1021
+		if ($module == 'ARTICLE')
1022 1022
 		{
1023 1023
 			$module = 'page';
1024 1024
 		}
@@ -1038,26 +1038,26 @@  discard block
 block discarded – undo
1038 1038
 	 */
1039 1039
 	function getSkins($path, $dir = 'skins')
1040 1040
 	{
1041
-		if(substr($path, -1) == '/')
1041
+		if (substr($path, -1) == '/')
1042 1042
 		{
1043 1043
 			$path = substr($path, 0, -1);
1044 1044
 		}
1045 1045
 
1046 1046
 		$skin_path = sprintf("%s/%s/", $path, $dir);
1047 1047
 		$list = FileHandler::readDir($skin_path);
1048
-		if(!count($list)) return;
1048
+		if (!count($list)) return;
1049 1049
 
1050 1050
 		natcasesort($list);
1051 1051
 
1052
-		foreach($list as $skin_name)
1052
+		foreach ($list as $skin_name)
1053 1053
 		{
1054
-			if(!is_dir($skin_path . $skin_name))
1054
+			if (!is_dir($skin_path.$skin_name))
1055 1055
 			{
1056 1056
 				continue;
1057 1057
 			}
1058 1058
 			unset($skin_info);
1059 1059
 			$skin_info = $this->loadSkinInfo($path, $skin_name, $dir);
1060
-			if(!$skin_info)
1060
+			if (!$skin_info)
1061 1061
 			{
1062 1062
 				$skin_info = new stdClass();
1063 1063
 				$skin_info->title = $skin_name;
@@ -1070,15 +1070,15 @@  discard block
 block discarded – undo
1070 1070
 		$tmpPath = trim($tmpPath);
1071 1071
 		$module = array_pop(explode(' ', $tmpPath));
1072 1072
 
1073
-		if($dir == 'skins')
1073
+		if ($dir == 'skins')
1074 1074
 		{
1075 1075
 			$oAdminModel = getAdminModel('admin');
1076 1076
 			$themesInfo = $oAdminModel->getThemeList();
1077 1077
 
1078
-			foreach($themesInfo as $themeName => $info)
1078
+			foreach ($themesInfo as $themeName => $info)
1079 1079
 			{
1080 1080
 				$skinInfos = $info->skin_infos;
1081
-				if(isset($skinInfos[$module]) && $skinInfos[$module]->is_theme)
1081
+				if (isset($skinInfos[$module]) && $skinInfos[$module]->is_theme)
1082 1082
 				{
1083 1083
 					$themeSkinInfo = $GLOBALS['__ThemeModuleSkin__'][$module]['skins'][$skinInfos[$module]->name];
1084 1084
 					$skin_list[$skinInfos[$module]->name] = $themeSkinInfo;
@@ -1090,13 +1090,13 @@  discard block
 block discarded – undo
1090 1090
 		$oMenuAdminModel = getAdminModel('menu');
1091 1091
 		$installedMenuTypes = $oMenuAdminModel->getModuleListInSitemap($siteInfo->site_srl);
1092 1092
 		$moduleName = $module;
1093
-		if($moduleName === 'page')
1093
+		if ($moduleName === 'page')
1094 1094
 		{
1095 1095
 			$moduleName = 'ARTICLE';
1096 1096
 		}
1097
-		if(array_key_exists($moduleName, $installedMenuTypes))
1097
+		if (array_key_exists($moduleName, $installedMenuTypes))
1098 1098
 		{
1099
-			if($dir == 'skins')
1099
+			if ($dir == 'skins')
1100 1100
 			{
1101 1101
 				$type = 'P';
1102 1102
 			}
@@ -1106,12 +1106,12 @@  discard block
 block discarded – undo
1106 1106
 			}
1107 1107
 			$defaultSkinName = $this->getModuleDefaultSkin($module, $type, $site_info->site_srl);
1108 1108
 
1109
-			if(isset($defaultSkinName))
1109
+			if (isset($defaultSkinName))
1110 1110
 			{
1111 1111
 				$defaultSkinInfo = $this->loadSkinInfo($path, $defaultSkinName, $dir);
1112 1112
 
1113 1113
 				$useDefault = new stdClass();
1114
-				$useDefault->title = Context::getLang('use_site_default_skin') . ' (' . $defaultSkinInfo->title . ')';
1114
+				$useDefault->title = Context::getLang('use_site_default_skin').' ('.$defaultSkinInfo->title.')';
1115 1115
 
1116 1116
 				$useDefaultList['/USE_DEFAULT/'] = $useDefault;
1117 1117
 
@@ -1128,20 +1128,20 @@  discard block
 block discarded – undo
1128 1128
 	function loadSkinInfo($path, $skin, $dir = 'skins')
1129 1129
 	{
1130 1130
 		// Read xml file having skin information
1131
-		if(substr($path,-1)!='/') $path .= '/';
1131
+		if (substr($path, -1) != '/') $path .= '/';
1132 1132
 		$skin_xml_file = sprintf("%s%s/%s/skin.xml", $path, $dir, $skin);
1133
-		if(!file_exists($skin_xml_file)) return;
1133
+		if (!file_exists($skin_xml_file)) return;
1134 1134
 		// Create XmlParser object
1135 1135
 		$oXmlParser = new XmlParser();
1136 1136
 		$_xml_obj = $oXmlParser->loadXmlFile($skin_xml_file);
1137 1137
 		// Return if no skin information is
1138
-		if(!$_xml_obj->skin) return;
1138
+		if (!$_xml_obj->skin) return;
1139 1139
 		$xml_obj = $_xml_obj->skin;
1140 1140
 		// Skin Name
1141 1141
 		$skin_info = new stdClass();
1142 1142
 		$skin_info->title = $xml_obj->title->body;
1143 1143
 		// Author information
1144
-		if($xml_obj->version && $xml_obj->attrs->version == '0.2')
1144
+		if ($xml_obj->version && $xml_obj->attrs->version == '0.2')
1145 1145
 		{
1146 1146
 			// skin format v0.2
1147 1147
 			sscanf($xml_obj->date->body, '%d-%d-%d', $date_obj->y, $date_obj->m, $date_obj->d);
@@ -1152,10 +1152,10 @@  discard block
 block discarded – undo
1152 1152
 			$skin_info->license_link = $xml_obj->license->attrs->link;
1153 1153
 			$skin_info->description = $xml_obj->description->body;
1154 1154
 
1155
-			if(!is_array($xml_obj->author)) $author_list[] = $xml_obj->author;
1155
+			if (!is_array($xml_obj->author)) $author_list[] = $xml_obj->author;
1156 1156
 			else $author_list = $xml_obj->author;
1157 1157
 
1158
-			foreach($author_list as $author)
1158
+			foreach ($author_list as $author)
1159 1159
 			{
1160 1160
 				$author_obj = new stdClass();
1161 1161
 				$author_obj->name = $author->name->body;
@@ -1164,25 +1164,25 @@  discard block
 block discarded – undo
1164 1164
 				$skin_info->author[] = $author_obj;
1165 1165
 			}
1166 1166
 			// List extra vars
1167
-			if($xml_obj->extra_vars)
1167
+			if ($xml_obj->extra_vars)
1168 1168
 			{
1169 1169
 				$extra_var_groups = $xml_obj->extra_vars->group;
1170
-				if(!$extra_var_groups) $extra_var_groups = $xml_obj->extra_vars;
1171
-				if(!is_array($extra_var_groups)) $extra_var_groups = array($extra_var_groups);
1170
+				if (!$extra_var_groups) $extra_var_groups = $xml_obj->extra_vars;
1171
+				if (!is_array($extra_var_groups)) $extra_var_groups = array($extra_var_groups);
1172 1172
 
1173
-				foreach($extra_var_groups as $group)
1173
+				foreach ($extra_var_groups as $group)
1174 1174
 				{
1175 1175
 					$extra_vars = $group->var;
1176
-					if(!$extra_vars)
1176
+					if (!$extra_vars)
1177 1177
 					{
1178 1178
 						continue;
1179 1179
 					}
1180
-					if(!is_array($group->var)) $extra_vars = array($group->var);
1180
+					if (!is_array($group->var)) $extra_vars = array($group->var);
1181 1181
 
1182
-					foreach($extra_vars as $key => $val)
1182
+					foreach ($extra_vars as $key => $val)
1183 1183
 					{
1184 1184
 						$obj = new stdClass();
1185
-						if(!$val->attrs->type) { $val->attrs->type = 'text'; }
1185
+						if (!$val->attrs->type) { $val->attrs->type = 'text'; }
1186 1186
 
1187 1187
 						$obj->group = $group->title->body;
1188 1188
 						$obj->name = $val->attrs->name;
@@ -1191,14 +1191,14 @@  discard block
 block discarded – undo
1191 1191
 						$obj->description = $val->description->body;
1192 1192
 						$obj->value = $extra_vals->{$obj->name};
1193 1193
 						$obj->default = $val->attrs->default;
1194
-						if(strpos($obj->value, '|@|') != false) { $obj->value = explode('|@|', $obj->value); }
1195
-						if($obj->type == 'mid_list' && !is_array($obj->value)) { $obj->value = array($obj->value); }
1194
+						if (strpos($obj->value, '|@|') != false) { $obj->value = explode('|@|', $obj->value); }
1195
+						if ($obj->type == 'mid_list' && !is_array($obj->value)) { $obj->value = array($obj->value); }
1196 1196
 						// Get an option list from 'select'type
1197
-						if(is_array($val->options))
1197
+						if (is_array($val->options))
1198 1198
 						{
1199 1199
 							$option_count = count($val->options);
1200 1200
 
1201
-							for($i = 0; $i < $option_count; $i++)
1201
+							for ($i = 0; $i < $option_count; $i++)
1202 1202
 							{
1203 1203
 								$obj->options[$i] = new stdClass();
1204 1204
 								$obj->options[$i]->title = $val->options[$i]->title->body;
@@ -1235,18 +1235,18 @@  discard block
 block discarded – undo
1235 1235
 			$skin_info->author[0]->homepage = $xml_obj->maker->attrs->link;
1236 1236
 			// Variables used in the skin
1237 1237
 			$extra_var_groups = $xml_obj->extra_vars->group;
1238
-			if(!$extra_var_groups) $extra_var_groups = $xml_obj->extra_vars;
1239
-			if(!is_array($extra_var_groups)) $extra_var_groups = array($extra_var_groups);
1238
+			if (!$extra_var_groups) $extra_var_groups = $xml_obj->extra_vars;
1239
+			if (!is_array($extra_var_groups)) $extra_var_groups = array($extra_var_groups);
1240 1240
 
1241
-			foreach($extra_var_groups as $group)
1241
+			foreach ($extra_var_groups as $group)
1242 1242
 			{
1243 1243
 				$extra_vars = $group->var;
1244 1244
 
1245
-				if($extra_vars)
1245
+				if ($extra_vars)
1246 1246
 				{
1247
-					if(!is_array($extra_vars)) $extra_vars = array($extra_vars);
1247
+					if (!is_array($extra_vars)) $extra_vars = array($extra_vars);
1248 1248
 
1249
-					foreach($extra_vars as $var)
1249
+					foreach ($extra_vars as $var)
1250 1250
 					{
1251 1251
 						unset($obj);
1252 1252
 						unset($options);
@@ -1257,11 +1257,11 @@  discard block
 block discarded – undo
1257 1257
 						$title = $var->title->body;
1258 1258
 						$description = $var->description->body;
1259 1259
 						// Get an option list from 'select'type.
1260
-						if(is_array($var->default))
1260
+						if (is_array($var->default))
1261 1261
 						{
1262 1262
 							$option_count = count($var->default);
1263 1263
 
1264
-							for($i = 0; $i < $option_count; $i++)
1264
+							for ($i = 0; $i < $option_count; $i++)
1265 1265
 							{
1266 1266
 								$options[$i]->title = $var->default[$i]->body;
1267 1267
 								$options[$i]->value = $var->default[$i]->body;
@@ -1295,19 +1295,19 @@  discard block
 block discarded – undo
1295 1295
 
1296 1296
 		// colorset
1297 1297
 		$colorset = $xml_obj->colorset->color;
1298
-		if($colorset)
1298
+		if ($colorset)
1299 1299
 		{
1300
-			if(!is_array($colorset)) $colorset = array($colorset);
1300
+			if (!is_array($colorset)) $colorset = array($colorset);
1301 1301
 
1302
-			foreach($colorset as $color)
1302
+			foreach ($colorset as $color)
1303 1303
 			{
1304 1304
 				$name = $color->attrs->name;
1305 1305
 				$title = $color->title->body;
1306 1306
 				$screenshot = $color->attrs->src;
1307
-				if($screenshot)
1307
+				if ($screenshot)
1308 1308
 				{
1309 1309
 					$screenshot = sprintf("%s%s/%s/%s", $path, $dir, $skin, $screenshot);
1310
-					if(!file_exists($screenshot)) $screenshot = "";
1310
+					if (!file_exists($screenshot)) $screenshot = "";
1311 1311
 				}
1312 1312
 				else $screenshot = "";
1313 1313
 
@@ -1319,19 +1319,19 @@  discard block
 block discarded – undo
1319 1319
 			}
1320 1320
 		}
1321 1321
 		// Menu type (settings for layout)
1322
-		if($xml_obj->menus->menu)
1322
+		if ($xml_obj->menus->menu)
1323 1323
 		{
1324 1324
 			$menus = $xml_obj->menus->menu;
1325
-			if(!is_array($menus)) $menus = array($menus);
1325
+			if (!is_array($menus)) $menus = array($menus);
1326 1326
 
1327 1327
 			$menu_count = count($menus);
1328 1328
 			$skin_info->menu_count = $menu_count;
1329
-			for($i=0;$i<$menu_count;$i++)
1329
+			for ($i = 0; $i < $menu_count; $i++)
1330 1330
 			{
1331 1331
 				unset($obj);
1332 1332
 
1333 1333
 				$obj->name = $menus[$i]->attrs->name;
1334
-				if($menus[$i]->attrs->default == "true") $obj->default = true;
1334
+				if ($menus[$i]->attrs->default == "true") $obj->default = true;
1335 1335
 				$obj->title = $menus[$i]->title->body;
1336 1336
 				$obj->maxdepth = $menus[$i]->maxdepth->body;
1337 1337
 
@@ -1340,7 +1340,7 @@  discard block
 block discarded – undo
1340 1340
 		}
1341 1341
 
1342 1342
 		$thumbnail = sprintf("%s%s/%s/thumbnail.png", $path, $dir, $skin);
1343
-		$skin_info->thumbnail = (file_exists($thumbnail))?$thumbnail:null;
1343
+		$skin_info->thumbnail = (file_exists($thumbnail)) ? $thumbnail : null;
1344 1344
 		return $skin_info;
1345 1345
 	}
1346 1346
 
@@ -1351,7 +1351,7 @@  discard block
 block discarded – undo
1351 1351
 	{
1352 1352
 		$args = new stdClass;
1353 1353
 		$args->site_srl = $site_srl;
1354
-		if(!is_null($module)) $args->module = $module;
1354
+		if (!is_null($module)) $args->module = $module;
1355 1355
 		$output = executeQuery('module.getModuleCount', $args);
1356 1356
 		return $output->data->count;
1357 1357
 	}
@@ -1365,26 +1365,26 @@  discard block
 block discarded – undo
1365 1365
 		$config = false;
1366 1366
 		// cache controll
1367 1367
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
1368
-		if($oCacheHandler->isSupport())
1368
+		if ($oCacheHandler->isSupport())
1369 1369
 		{
1370
-			$object_key = 'module_config:' . $module . '_' . $site_srl;
1370
+			$object_key = 'module_config:'.$module.'_'.$site_srl;
1371 1371
 			$cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
1372 1372
 			$config = $oCacheHandler->get($cache_key);
1373 1373
 		}
1374 1374
 
1375
-		if($config === false)
1375
+		if ($config === false)
1376 1376
 		{
1377
-			if(!$GLOBALS['__ModuleConfig__'][$site_srl][$module])
1377
+			if (!$GLOBALS['__ModuleConfig__'][$site_srl][$module])
1378 1378
 			{
1379 1379
 				$args = new stdClass();
1380 1380
 				$args->module = $module;
1381 1381
 				$args->site_srl = $site_srl;
1382 1382
 				$output = executeQuery('module.getModuleConfig', $args);
1383
-				if($output->data->config) $config = unserialize($output->data->config);
1383
+				if ($output->data->config) $config = unserialize($output->data->config);
1384 1384
 				else $config = null;
1385 1385
 
1386 1386
 				//insert in cache
1387
-				if($oCacheHandler->isSupport())
1387
+				if ($oCacheHandler->isSupport())
1388 1388
 				{
1389 1389
 					$oCacheHandler->put($cache_key, $config);
1390 1390
 				}
@@ -1405,26 +1405,26 @@  discard block
 block discarded – undo
1405 1405
 		$config = false;
1406 1406
 		// cache controll
1407 1407
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
1408
-		if($oCacheHandler->isSupport())
1408
+		if ($oCacheHandler->isSupport())
1409 1409
 		{
1410 1410
 			$object_key = 'module_part_config:'.$module.'_'.$module_srl;
1411 1411
 			$cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
1412 1412
 			$config = $oCacheHandler->get($cache_key);
1413 1413
 		}
1414 1414
 
1415
-		if($config === false)
1415
+		if ($config === false)
1416 1416
 		{
1417
-			if(!isset($GLOBALS['__ModulePartConfig__'][$module][$module_srl]))
1417
+			if (!isset($GLOBALS['__ModulePartConfig__'][$module][$module_srl]))
1418 1418
 			{
1419 1419
 				$args = new stdClass();
1420 1420
 				$args->module = $module;
1421 1421
 				$args->module_srl = $module_srl;
1422 1422
 				$output = executeQuery('module.getModulePartConfig', $args);
1423
-				if($output->data->config) $config = unserialize($output->data->config);
1423
+				if ($output->data->config) $config = unserialize($output->data->config);
1424 1424
 				else $config = null;
1425 1425
 
1426 1426
 				//insert in cache
1427
-				if($oCacheHandler->isSupport())
1427
+				if ($oCacheHandler->isSupport())
1428 1428
 				{
1429 1429
 					$oCacheHandler->put($cache_key, $config);
1430 1430
 				}
@@ -1443,11 +1443,11 @@  discard block
 block discarded – undo
1443 1443
 	{
1444 1444
 		$args = new stdClass();
1445 1445
 		$args->module = $module;
1446
-		if($site_srl) $args->site_srl = $site_srl;
1446
+		if ($site_srl) $args->site_srl = $site_srl;
1447 1447
 		$output = executeQueryArray('module.getModulePartConfigs', $args);
1448
-		if(!$output->toBool() || !$output->data) return array();
1448
+		if (!$output->toBool() || !$output->data) return array();
1449 1449
 
1450
-		foreach($output->data as $key => $val)
1450
+		foreach ($output->data as $key => $val)
1451 1451
 		{
1452 1452
 			$result[$val->module_srl] = unserialize($val->config);
1453 1453
 		}
@@ -1463,12 +1463,12 @@  discard block
 block discarded – undo
1463 1463
 		$args->moduleCategorySrl = $moduleCategorySrl;
1464 1464
 		// Get data from the DB
1465 1465
 		$output = executeQuery('module.getModuleCategories', $args);
1466
-		if(!$output->toBool()) return $output;
1466
+		if (!$output->toBool()) return $output;
1467 1467
 		$list = $output->data;
1468
-		if(!$list) return;
1469
-		if(!is_array($list)) $list = array($list);
1468
+		if (!$list) return;
1469
+		if (!is_array($list)) $list = array($list);
1470 1470
 
1471
-		foreach($list as $val)
1471
+		foreach ($list as $val)
1472 1472
 		{
1473 1473
 			$category_list[$val->module_category_srl] = $val;
1474 1474
 		}
@@ -1484,7 +1484,7 @@  discard block
 block discarded – undo
1484 1484
 		$args = new stdClass;
1485 1485
 		$args->module_category_srl = $module_category_srl;
1486 1486
 		$output = executeQuery('module.getModuleCategory', $args);
1487
-		if(!$output->toBool()) return $output;
1487
+		if (!$output->toBool()) return $output;
1488 1488
 		return $output->data;
1489 1489
 	}
1490 1490
 
@@ -1496,10 +1496,10 @@  discard block
 block discarded – undo
1496 1496
 		// Get a list of downloaded and installed modules
1497 1497
 		$searched_list = FileHandler::readDir('./modules');
1498 1498
 		$searched_count = count($searched_list);
1499
-		if(!$searched_count) return;
1499
+		if (!$searched_count) return;
1500 1500
 		sort($searched_list);
1501 1501
 
1502
-		for($i=0;$i<$searched_count;$i++)
1502
+		for ($i = 0; $i < $searched_count; $i++)
1503 1503
 		{
1504 1504
 			// Module name
1505 1505
 			$module_name = $searched_list[$i];
@@ -1509,7 +1509,7 @@  discard block
 block discarded – undo
1509 1509
 			$info = $this->getModuleInfoXml($module_name);
1510 1510
 			unset($obj);
1511 1511
 
1512
-			if(!isset($info)) continue;
1512
+			if (!isset($info)) continue;
1513 1513
 			$info->module = $module_name;
1514 1514
 			$info->created_table_count = $created_table_count;
1515 1515
 			$info->table_count = $table_count;
@@ -1526,19 +1526,19 @@  discard block
 block discarded – undo
1526 1526
 		$info = null;
1527 1527
 
1528 1528
 		$moduledir = ModuleHandler::getModulePath($module_name);
1529
-		if(file_exists(FileHandler::getRealPath($moduledir."schemas")))
1529
+		if (file_exists(FileHandler::getRealPath($moduledir."schemas")))
1530 1530
 		{
1531 1531
 			$tmp_files = FileHandler::readDir($moduledir."schemas", '/(\.xml)$/');
1532 1532
 			$table_count = count($tmp_files);
1533 1533
 			// Check if the table is created
1534 1534
 			$created_table_count = 0;
1535
-			for($j=0;$j<count($tmp_files);$j++)
1535
+			for ($j = 0; $j < count($tmp_files); $j++)
1536 1536
 			{
1537
-				list($table_name) = explode(".",$tmp_files[$j]);
1538
-				if($oDB->isTableExists($table_name)) $created_table_count ++;
1537
+				list($table_name) = explode(".", $tmp_files[$j]);
1538
+				if ($oDB->isTableExists($table_name)) $created_table_count++;
1539 1539
 			}
1540 1540
 			// Check if DB is installed
1541
-			if($table_count > $created_table_count) return true;
1541
+			if ($table_count > $created_table_count) return true;
1542 1542
 			else return false;
1543 1543
 		}
1544 1544
 		return false;
@@ -1548,7 +1548,7 @@  discard block
 block discarded – undo
1548 1548
 	{
1549 1549
 		// Check if it is upgraded to module.class.php on each module
1550 1550
 		$oDummy = getModule($module_name, 'class');
1551
-		if($oDummy && method_exists($oDummy, "checkUpdate"))
1551
+		if ($oDummy && method_exists($oDummy, "checkUpdate"))
1552 1552
 		{
1553 1553
 			return $oDummy->checkUpdate();
1554 1554
 		}
@@ -1567,31 +1567,31 @@  discard block
 block discarded – undo
1567 1567
 		sort($searched_list);
1568 1568
 
1569 1569
 		$searched_count = count($searched_list);
1570
-		if(!$searched_count) return;
1570
+		if (!$searched_count) return;
1571 1571
 
1572
-		for($i=0;$i<$searched_count;$i++)
1572
+		for ($i = 0; $i < $searched_count; $i++)
1573 1573
 		{
1574 1574
 			// module name
1575 1575
 			$module_name = $searched_list[$i];
1576 1576
 
1577 1577
 			$path = ModuleHandler::getModulePath($module_name);
1578
-			if(!is_dir(FileHandler::getRealPath($path))) continue;
1578
+			if (!is_dir(FileHandler::getRealPath($path))) continue;
1579 1579
 
1580 1580
 			// Get the number of xml files to create a table in schemas
1581 1581
 			$tmp_files = FileHandler::readDir($path.'schemas', '/(\.xml)$/');
1582 1582
 			$table_count = count($tmp_files);
1583 1583
 			// Check if the table is created
1584 1584
 			$created_table_count = 0;
1585
-			for($j=0;$j<$table_count;$j++)
1585
+			for ($j = 0; $j < $table_count; $j++)
1586 1586
 			{
1587
-				list($table_name) = explode('.',$tmp_files[$j]);
1588
-				if($oDB->isTableExists($table_name)) $created_table_count ++;
1587
+				list($table_name) = explode('.', $tmp_files[$j]);
1588
+				if ($oDB->isTableExists($table_name)) $created_table_count++;
1589 1589
 			}
1590 1590
 			// Get information of the module
1591 1591
 			$info = NULL;
1592 1592
 			$info = $this->getModuleInfoXml($module_name);
1593 1593
 
1594
-			if(!$info) continue;
1594
+			if (!$info) continue;
1595 1595
 
1596 1596
 			$info->module = $module_name;
1597 1597
 			$info->category = $info->category;
@@ -1600,12 +1600,12 @@  discard block
 block discarded – undo
1600 1600
 			$info->path = $path;
1601 1601
 			$info->admin_index_act = $info->admin_index_act;
1602 1602
 			// Check if DB is installed
1603
-			if($table_count > $created_table_count) $info->need_install = true;
1603
+			if ($table_count > $created_table_count) $info->need_install = true;
1604 1604
 			else $info->need_install = false;
1605 1605
 			// Check if it is upgraded to module.class.php on each module
1606 1606
 			$oDummy = null;
1607 1607
 			$oDummy = getModule($module_name, 'class');
1608
-			if($oDummy && method_exists($oDummy, "checkUpdate"))
1608
+			if ($oDummy && method_exists($oDummy, "checkUpdate"))
1609 1609
 			{
1610 1610
 				$info->need_update = $oDummy->checkUpdate();
1611 1611
 			}
@@ -1626,15 +1626,15 @@  discard block
 block discarded – undo
1626 1626
 	 */
1627 1627
 	function syncModuleToSite(&$data)
1628 1628
 	{
1629
-		if(!$data) return;
1629
+		if (!$data) return;
1630 1630
 
1631
-		if(is_array($data))
1631
+		if (is_array($data))
1632 1632
 		{
1633
-			foreach($data as $key => $val)
1633
+			foreach ($data as $key => $val)
1634 1634
 			{
1635 1635
 				$module_srls[] = $val->module_srl;
1636 1636
 			}
1637
-			if(!count($module_srls)) return;
1637
+			if (!count($module_srls)) return;
1638 1638
 		}
1639 1639
 		else
1640 1640
 		{
@@ -1642,17 +1642,17 @@  discard block
 block discarded – undo
1642 1642
 		}
1643 1643
 
1644 1644
 		$args = new stdClass();
1645
-		$args->module_srls = implode(',',$module_srls);
1645
+		$args->module_srls = implode(',', $module_srls);
1646 1646
 		$output = executeQueryArray('module.getModuleSites', $args);
1647
-		if(!$output->data) return array();
1648
-		foreach($output->data as $key => $val)
1647
+		if (!$output->data) return array();
1648
+		foreach ($output->data as $key => $val)
1649 1649
 		{
1650 1650
 			$modules[$val->module_srl] = $val;
1651 1651
 		}
1652 1652
 
1653
-		if(is_array($data))
1653
+		if (is_array($data))
1654 1654
 		{
1655
-			foreach($data as $key => $val)
1655
+			foreach ($data as $key => $val)
1656 1656
 			{
1657 1657
 				$data[$key]->domain = $modules[$val->module_srl]->domain;
1658 1658
 			}
@@ -1668,14 +1668,14 @@  discard block
 block discarded – undo
1668 1668
 	 */
1669 1669
 	function isSiteAdmin($member_info, $site_srl = null)
1670 1670
 	{
1671
-		if(!$member_info->member_srl) return false;
1672
-		if($member_info->is_admin == 'Y') return true;
1671
+		if (!$member_info->member_srl) return false;
1672
+		if ($member_info->is_admin == 'Y') return true;
1673 1673
 
1674 1674
 		$args = new stdClass();
1675
-		if(!isset($site_srl))
1675
+		if (!isset($site_srl))
1676 1676
 		{
1677 1677
 			$site_module_info = Context::get('site_module_info');
1678
-			if(!$site_module_info) return;
1678
+			if (!$site_module_info) return;
1679 1679
 			$args->site_srl = $site_module_info->site_srl;
1680 1680
 		}
1681 1681
 		else
@@ -1685,7 +1685,7 @@  discard block
 block discarded – undo
1685 1685
 
1686 1686
 		$args->member_srl = $member_info->member_srl;
1687 1687
 		$output = executeQuery('module.isSiteAdmin', $args);
1688
-		if($output->data->member_srl == $args->member_srl) return true;
1688
+		if ($output->data->member_srl == $args->member_srl) return true;
1689 1689
 		return false;
1690 1690
 	}
1691 1691
 
@@ -1708,7 +1708,7 @@  discard block
 block discarded – undo
1708 1708
 		$obj = new stdClass();
1709 1709
 		$obj->module_srl = $module_srl;
1710 1710
 		$output = executeQueryArray('module.getAdminID', $obj);
1711
-		if(!$output->toBool() || !$output->data) return;
1711
+		if (!$output->toBool() || !$output->data) return;
1712 1712
 
1713 1713
 		return $output->data;
1714 1714
 	}
@@ -1721,20 +1721,20 @@  discard block
 block discarded – undo
1721 1721
 	{
1722 1722
 		$extra_vars = array();
1723 1723
 		$get_module_srls = array();
1724
-		if(!is_array($list_module_srl)) $list_module_srl = array($list_module_srl);
1724
+		if (!is_array($list_module_srl)) $list_module_srl = array($list_module_srl);
1725 1725
 
1726 1726
 		$vars = false;
1727 1727
 		// cache controll
1728 1728
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
1729
-		if($oCacheHandler->isSupport())
1729
+		if ($oCacheHandler->isSupport())
1730 1730
 		{
1731
-			foreach($list_module_srl as $module_srl)
1731
+			foreach ($list_module_srl as $module_srl)
1732 1732
 			{
1733 1733
 				$object_key = 'module_extra_vars:'.$module_srl;
1734 1734
 				$cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
1735 1735
 				$vars = $oCacheHandler->get($cache_key);
1736 1736
 
1737
-				if($vars)
1737
+				if ($vars)
1738 1738
 				{
1739 1739
 					$extra_vars[$module_srl] = $vars;
1740 1740
 				}
@@ -1749,35 +1749,35 @@  discard block
 block discarded – undo
1749 1749
 			$get_module_srls = $list_module_srl;
1750 1750
 		}
1751 1751
 
1752
-		if(count($get_module_srls) > 0)
1752
+		if (count($get_module_srls) > 0)
1753 1753
 		{
1754 1754
 			$args = new stdClass();
1755 1755
 			$args->module_srl = implode(',', $get_module_srls);
1756 1756
 			$output = executeQueryArray('module.getModuleExtraVars', $args);
1757 1757
 
1758
-			if(!$output->toBool())
1758
+			if (!$output->toBool())
1759 1759
 			{
1760 1760
 				return;
1761 1761
 			}
1762 1762
 
1763
-			if(!$output->data)
1763
+			if (!$output->data)
1764 1764
 			{
1765
-				foreach($get_module_srls as $module_srl)
1765
+				foreach ($get_module_srls as $module_srl)
1766 1766
 				{
1767 1767
 					$extra_vars[$module_srl] = new stdClass;
1768 1768
 				}
1769 1769
 			}
1770
-			foreach($output->data as $key => $val)
1770
+			foreach ($output->data as $key => $val)
1771 1771
 			{
1772
-				if(in_array($val->name, array('mid','module')) || $val->value == 'Array') continue;
1772
+				if (in_array($val->name, array('mid', 'module')) || $val->value == 'Array') continue;
1773 1773
 
1774
-				if(!isset($extra_vars[$val->module_srl]))
1774
+				if (!isset($extra_vars[$val->module_srl]))
1775 1775
 				{
1776 1776
 					$extra_vars[$val->module_srl] = new stdClass();
1777 1777
 				}
1778 1778
 				$extra_vars[$val->module_srl]->{$val->name} = $val->value;
1779 1779
 
1780
-				if($oCacheHandler->isSupport())
1780
+				if ($oCacheHandler->isSupport())
1781 1781
 				{
1782 1782
 					$object_key = 'module_extra_vars:'.$val->module_srl;
1783 1783
 					$cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
@@ -1796,27 +1796,27 @@  discard block
 block discarded – undo
1796 1796
 	{
1797 1797
 		$skin_vars = false;
1798 1798
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
1799
-		if($oCacheHandler->isSupport())
1799
+		if ($oCacheHandler->isSupport())
1800 1800
 		{
1801 1801
 			$object_key = 'module_skin_vars:'.$module_srl;
1802 1802
 			$cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
1803 1803
 			$skin_vars = $oCacheHandler->get($cache_key);
1804 1804
 		}
1805 1805
 
1806
-		if($skin_vars === false)
1806
+		if ($skin_vars === false)
1807 1807
 		{
1808 1808
 			$args = new stdClass();
1809 1809
 			$args->module_srl = $module_srl;
1810
-			$output = executeQueryArray('module.getModuleSkinVars',$args);
1811
-			if(!$output->toBool()) return;
1810
+			$output = executeQueryArray('module.getModuleSkinVars', $args);
1811
+			if (!$output->toBool()) return;
1812 1812
 
1813 1813
 			$skin_vars = array();
1814
-			foreach($output->data as $vars)
1814
+			foreach ($output->data as $vars)
1815 1815
 			{
1816 1816
 				$skin_vars[$vars->name] = $vars;
1817 1817
 			}
1818 1818
 
1819
-			if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $skin_vars);
1819
+			if ($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $skin_vars);
1820 1820
 		}
1821 1821
 
1822 1822
 		return $skin_vars;
@@ -1828,32 +1828,32 @@  discard block
 block discarded – undo
1828 1828
 	function getModuleDefaultSkin($module_name, $skin_type = 'P', $site_srl = 0, $updateCache = true)
1829 1829
 	{
1830 1830
 		$target = ($skin_type == 'M') ? 'mskin' : 'skin';
1831
-		if(!$site_srl) $site_srl = 0;
1831
+		if (!$site_srl) $site_srl = 0;
1832 1832
 
1833 1833
 		$designInfoFile = sprintf(_XE_PATH_.'files/site_design/design_%s.php', $site_srl);
1834
-		if(is_readable($designInfoFile))
1834
+		if (is_readable($designInfoFile))
1835 1835
 		{
1836 1836
 			include($designInfoFile);
1837 1837
 
1838 1838
 			$skinName = $designInfo->module->{$module_name}->{$target};
1839 1839
 		}
1840
-		if(!$skinName)
1840
+		if (!$skinName)
1841 1841
 		{
1842 1842
 			$dir = ($skin_type == 'M') ? 'm.skins/' : 'skins/';
1843 1843
 			$moduleSkinPath = ModuleHandler::getModulePath($module_name).$dir;
1844 1844
 
1845
-			if(is_dir($moduleSkinPath.'default'))
1845
+			if (is_dir($moduleSkinPath.'default'))
1846 1846
 			{
1847 1847
 				$skinName = 'default';
1848 1848
 			}
1849
-			else if(is_dir($moduleSkinPath.'xe_default'))
1849
+			else if (is_dir($moduleSkinPath.'xe_default'))
1850 1850
 			{
1851 1851
 				$skinName = 'xe_default';
1852 1852
 			}
1853 1853
 			else
1854 1854
 			{
1855 1855
 				$skins = FileHandler::readDir($moduleSkinPath);
1856
-				if(count($skins) > 0)
1856
+				if (count($skins) > 0)
1857 1857
 				{
1858 1858
 					$skinName = $skins[0];
1859 1859
 				}
@@ -1863,9 +1863,9 @@  discard block
 block discarded – undo
1863 1863
 				}
1864 1864
 			}
1865 1865
 
1866
-			if($updateCache && $skinName)
1866
+			if ($updateCache && $skinName)
1867 1867
 			{
1868
-				if(!isset($designInfo->module->{$module_name})) $designInfo->module->{$module_name} = new stdClass();
1868
+				if (!isset($designInfo->module->{$module_name})) $designInfo->module->{$module_name} = new stdClass();
1869 1869
 				$designInfo->module->{$module_name}->{$target} = $skinName;
1870 1870
 
1871 1871
 				$oAdminController = getAdminController('admin');
@@ -1881,10 +1881,10 @@  discard block
 block discarded – undo
1881 1881
 	 */
1882 1882
 	function syncSkinInfoToModuleInfo(&$module_info)
1883 1883
 	{
1884
-		if(!$module_info->module_srl) return;
1884
+		if (!$module_info->module_srl) return;
1885 1885
 
1886 1886
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
1887
-		if(Mobile::isFromMobilePhone())
1887
+		if (Mobile::isFromMobilePhone())
1888 1888
 		{
1889 1889
 			$skin_vars = $this->getModuleMobileSkinVars($module_info->module_srl);
1890 1890
 		}
@@ -1893,11 +1893,11 @@  discard block
 block discarded – undo
1893 1893
 			$skin_vars = $this->getModuleSkinVars($module_info->module_srl);
1894 1894
 		}
1895 1895
 
1896
-		if(!$skin_vars) return;
1896
+		if (!$skin_vars) return;
1897 1897
 
1898
-		foreach($skin_vars as $name => $val)
1898
+		foreach ($skin_vars as $name => $val)
1899 1899
 		{
1900
-			if(isset($module_info->{$name})) continue;
1900
+			if (isset($module_info->{$name})) continue;
1901 1901
 			$module_info->{$name} = $val->value;
1902 1902
 		}
1903 1903
 	}
@@ -1911,27 +1911,27 @@  discard block
 block discarded – undo
1911 1911
 	{
1912 1912
 		$skin_vars = false;
1913 1913
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
1914
-		if($oCacheHandler->isSupport())
1914
+		if ($oCacheHandler->isSupport())
1915 1915
 		{
1916 1916
 			$object_key = 'module_mobile_skin_vars:'.$module_srl;
1917 1917
 			$cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
1918 1918
 			$skin_vars = $oCacheHandler->get($cache_key);
1919 1919
 		}
1920 1920
 
1921
-		if($skin_vars === false)
1921
+		if ($skin_vars === false)
1922 1922
 		{
1923 1923
 			$args = new stdClass();
1924 1924
 			$args->module_srl = $module_srl;
1925
-			$output = executeQueryArray('module.getModuleMobileSkinVars',$args);
1926
-			if(!$output->toBool() || !$output->data) return;
1925
+			$output = executeQueryArray('module.getModuleMobileSkinVars', $args);
1926
+			if (!$output->toBool() || !$output->data) return;
1927 1927
 
1928 1928
 			$skin_vars = array();
1929
-			foreach($output->data as $vars)
1929
+			foreach ($output->data as $vars)
1930 1930
 			{
1931 1931
 				$skin_vars[$vars->name] = $vars;
1932 1932
 			}
1933 1933
 
1934
-			if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $skin_vars);
1934
+			if ($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $skin_vars);
1935 1935
 		}
1936 1936
 
1937 1937
 		return $skin_vars;
@@ -1943,32 +1943,32 @@  discard block
 block discarded – undo
1943 1943
 	 */
1944 1944
 	function syncMobileSkinInfoToModuleInfo(&$module_info)
1945 1945
 	{
1946
-		if(!$module_info->module_srl) return;
1946
+		if (!$module_info->module_srl) return;
1947 1947
 		$skin_vars = false;
1948 1948
 		// cache controll
1949 1949
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
1950
-		if($oCacheHandler->isSupport())
1950
+		if ($oCacheHandler->isSupport())
1951 1951
 		{
1952 1952
 			$object_key = 'module_mobile_skin_vars:'.$module_info->module_srl;
1953 1953
 			$cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
1954 1954
 			$skin_vars = $oCacheHandler->get($cache_key);
1955 1955
 		}
1956
-		if($skin_vars === false)
1956
+		if ($skin_vars === false)
1957 1957
 		{
1958 1958
 			$args = new stdClass;
1959 1959
 			$args->module_srl = $module_info->module_srl;
1960
-			$output = executeQueryArray('module.getModuleMobileSkinVars',$args);
1961
-			if(!$output->toBool()) return;
1960
+			$output = executeQueryArray('module.getModuleMobileSkinVars', $args);
1961
+			if (!$output->toBool()) return;
1962 1962
 			$skin_vars = $output->data;
1963 1963
 
1964 1964
 			//insert in cache
1965
-			if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $skin_vars);
1965
+			if ($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $skin_vars);
1966 1966
 		}
1967
-		if(!$skin_vars) return;
1967
+		if (!$skin_vars) return;
1968 1968
 
1969
-		foreach($output->data as $val)
1969
+		foreach ($output->data as $val)
1970 1970
 		{
1971
-			if(isset($module_info->{$val->name})) continue;
1971
+			if (isset($module_info->{$val->name})) continue;
1972 1972
 			$module_info->{$val->name} = $val->value;
1973 1973
 		}
1974 1974
 	}
@@ -1980,7 +1980,7 @@  discard block
 block discarded – undo
1980 1980
 	{
1981 1981
 		$grant = new stdClass();
1982 1982
 
1983
-		if(!$xml_info)
1983
+		if (!$xml_info)
1984 1984
 		{
1985 1985
 			$module = $module_info->module;
1986 1986
 			$xml_info = $this->getModuleActionXml($module);
@@ -1988,9 +1988,9 @@  discard block
 block discarded – undo
1988 1988
 		// Set variables to grant group permission
1989 1989
 		$module_srl = $module_info->module_srl;
1990 1990
 		$grant_info = $xml_info->grant;
1991
-		if($member_info->member_srl)
1991
+		if ($member_info->member_srl)
1992 1992
 		{
1993
-			if(is_array($member_info->group_list)) $group_list = array_keys($member_info->group_list);
1993
+			if (is_array($member_info->group_list)) $group_list = array_keys($member_info->group_list);
1994 1994
 			else $group_list = array();
1995 1995
 		}
1996 1996
 		else
@@ -1998,10 +1998,10 @@  discard block
 block discarded – undo
1998 1998
 			$group_list = array();
1999 1999
 		}
2000 2000
 		// If module_srl doesn't exist(if unable to set permissions)
2001
-		if(!$module_srl)
2001
+		if (!$module_srl)
2002 2002
 		{
2003 2003
 			$grant->access = true;
2004
-			if($this->isSiteAdmin($member_info, $module_info->site_srl))
2004
+			if ($this->isSiteAdmin($member_info, $module_info->site_srl))
2005 2005
 			{
2006 2006
 				$grant->access = $grant->manager = $grant->is_site_admin = true;
2007 2007
 			}
@@ -2012,23 +2012,23 @@  discard block
 block discarded – undo
2012 2012
 		{
2013 2013
 			// If module_srl exists
2014 2014
 			// Get a type of granted permission
2015
-			$grant->access = $grant->manager = $grant->is_site_admin = ($member_info->is_admin=='Y'||$this->isSiteAdmin($member_info, $module_info->site_srl))?true:false;
2015
+			$grant->access = $grant->manager = $grant->is_site_admin = ($member_info->is_admin == 'Y' || $this->isSiteAdmin($member_info, $module_info->site_srl)) ? true : false;
2016 2016
 			$grant->is_admin = ($member_info->is_admin == 'Y') ? true : false;
2017 2017
 			// If a just logged-in member is, check if the member is a module administrator
2018
-			if(!$grant->manager && $member_info->member_srl)
2018
+			if (!$grant->manager && $member_info->member_srl)
2019 2019
 			{
2020 2020
 				$args = new stdClass();
2021 2021
 				$args->module_srl = $module_srl;
2022 2022
 				$args->member_srl = $member_info->member_srl;
2023
-				$output = executeQuery('module.getModuleAdmin',$args);
2024
-				if($output->data && $output->data->member_srl == $member_info->member_srl) $grant->manager = true;
2023
+				$output = executeQuery('module.getModuleAdmin', $args);
2024
+				if ($output->data && $output->data->member_srl == $member_info->member_srl) $grant->manager = true;
2025 2025
 			}
2026 2026
 			// If not an administrator, get information from the DB and grant manager privilege.
2027
-			if(!$grant->manager)
2027
+			if (!$grant->manager)
2028 2028
 			{
2029 2029
 				$args = new stdClass();
2030 2030
 				// If planet, get permission settings from the planet home
2031
-				if($module_info->module == 'planet')
2031
+				if ($module_info->module == 'planet')
2032 2032
 				{
2033 2033
 					$output = executeQueryArray('module.getPlanetGrants', $args);
2034 2034
 				}
@@ -2041,37 +2041,37 @@  discard block
 block discarded – undo
2041 2041
 
2042 2042
 				$grant_exists = $granted = array();
2043 2043
 
2044
-				if($output->data)
2044
+				if ($output->data)
2045 2045
 				{
2046 2046
 					// Arrange names and groups who has privileges
2047
-					foreach($output->data as $val)
2047
+					foreach ($output->data as $val)
2048 2048
 					{
2049 2049
 						$grant_exists[$val->name] = true;
2050
-						if($granted[$val->name]) continue;
2050
+						if ($granted[$val->name]) continue;
2051 2051
 						// Log-in member only
2052
-						if($val->group_srl == -1)
2052
+						if ($val->group_srl == -1)
2053 2053
 						{
2054 2054
 							$granted[$val->name] = true;
2055
-							if($member_info->member_srl) $grant->{$val->name} = true;
2055
+							if ($member_info->member_srl) $grant->{$val->name} = true;
2056 2056
 							// Site-joined member only
2057 2057
 						}
2058
-						elseif($val->group_srl == -2)
2058
+						elseif ($val->group_srl == -2)
2059 2059
 						{
2060 2060
 							$granted[$val->name] = true;
2061 2061
 							// Do not grant any permission for non-logged member
2062
-							if(!$member_info->member_srl) $grant->{$val->name} = false;
2062
+							if (!$member_info->member_srl) $grant->{$val->name} = false;
2063 2063
 							// Log-in member
2064 2064
 							else
2065 2065
 							{
2066 2066
 								$site_module_info = Context::get('site_module_info');
2067 2067
 								// Permission granted if no information of the currently connected site exists
2068
-								if(!$site_module_info->site_srl) $grant->{$val->name} = true;
2068
+								if (!$site_module_info->site_srl) $grant->{$val->name} = true;
2069 2069
 								// Permission is not granted if information of the currently connected site exists
2070
-								elseif(count($group_list)) $grant->{$val->name} = true;
2070
+								elseif (count($group_list)) $grant->{$val->name} = true;
2071 2071
 							}
2072 2072
 							// All of non-logged members
2073 2073
 						}
2074
-						elseif($val->group_srl == 0)
2074
+						elseif ($val->group_srl == 0)
2075 2075
 						{
2076 2076
 							$granted[$val->name] = true;
2077 2077
 							$grant->{$val->name} = true;
@@ -2079,7 +2079,7 @@  discard block
 block discarded – undo
2079 2079
 						}
2080 2080
 						else
2081 2081
 						{
2082
-							if($group_list && count($group_list) && in_array($val->group_srl, $group_list))
2082
+							if ($group_list && count($group_list) && in_array($val->group_srl, $group_list))
2083 2083
 							{
2084 2084
 								$grant->{$val->name} = true;
2085 2085
 								$granted[$val->name] = true;
@@ -2088,29 +2088,29 @@  discard block
 block discarded – undo
2088 2088
 					}
2089 2089
 				}
2090 2090
 				// Separate processing for the virtual group access
2091
-				if(!$grant_exists['access']) $grant->access = true;
2092
-				if(count($grant_info))
2091
+				if (!$grant_exists['access']) $grant->access = true;
2092
+				if (count($grant_info))
2093 2093
 				{
2094
-					foreach($grant_info as  $grant_name => $grant_item)
2094
+					foreach ($grant_info as  $grant_name => $grant_item)
2095 2095
 					{
2096
-						if($grant_exists[$grant_name]) continue;
2097
-						switch($grant_item->default)
2096
+						if ($grant_exists[$grant_name]) continue;
2097
+						switch ($grant_item->default)
2098 2098
 						{
2099 2099
 							case 'guest' :
2100 2100
 								$grant->{$grant_name} = true;
2101 2101
 								break;
2102 2102
 							case 'member' :
2103
-								if($member_info->member_srl) $grant->{$grant_name} = true;
2103
+								if ($member_info->member_srl) $grant->{$grant_name} = true;
2104 2104
 								else $grant->{$grant_name} = false;
2105 2105
 								break;
2106 2106
 							case 'site' :
2107 2107
 								$site_module_info = Context::get('site_module_info');
2108
-								if($member_info->member_srl && (($site_module_info->site_srl && count($group_list)) || !$site_module_info->site_srl)) $grant->{$grant_name} = true;
2108
+								if ($member_info->member_srl && (($site_module_info->site_srl && count($group_list)) || !$site_module_info->site_srl)) $grant->{$grant_name} = true;
2109 2109
 								else $grant->{$grant_name} = false;
2110 2110
 								break;
2111 2111
 							case 'manager' :
2112 2112
 							case 'root' :
2113
-								if($member_info->is_admin == 'Y') $grant->{$grant_name} = true;
2113
+								if ($member_info->is_admin == 'Y') $grant->{$grant_name} = true;
2114 2114
 								else $grant->{$grant_name} = false;
2115 2115
 								break;
2116 2116
 						}
@@ -2118,12 +2118,12 @@  discard block
 block discarded – undo
2118 2118
 				}
2119 2119
 			}
2120 2120
 			// Set true to grant all privileges if an administrator is
2121
-			if($grant->manager)
2121
+			if ($grant->manager)
2122 2122
 			{
2123 2123
 				$grant->access = true;
2124
-				if(count($grant_info))
2124
+				if (count($grant_info))
2125 2125
 				{
2126
-					foreach($grant_info as $key => $val)
2126
+					foreach ($grant_info as $key => $val)
2127 2127
 					{
2128 2128
 						$grant->{$key} = true;
2129 2129
 					}
@@ -2155,27 +2155,27 @@  discard block
 block discarded – undo
2155 2155
 
2156 2156
 	function unserializeAttributes($module_filebox_list)
2157 2157
 	{
2158
-		if(is_array($module_filebox_list->data))
2158
+		if (is_array($module_filebox_list->data))
2159 2159
 		{
2160
-			foreach($module_filebox_list->data as &$item)
2160
+			foreach ($module_filebox_list->data as &$item)
2161 2161
 			{
2162
-				if(empty($item->comment))
2162
+				if (empty($item->comment))
2163 2163
 				{
2164 2164
 					continue;
2165 2165
 				}
2166 2166
 
2167 2167
 				$attributes = explode(';', $item->comment);
2168
-				foreach($attributes as $attribute)
2168
+				foreach ($attributes as $attribute)
2169 2169
 				{
2170 2170
 					$values = explode(':', $attribute);
2171
-					if((count($values) % 2) ==1)
2171
+					if ((count($values) % 2) == 1)
2172 2172
 					{
2173
-						for($i=2;$i<count($values);$i++)
2173
+						for ($i = 2; $i < count($values); $i++)
2174 2174
 						{
2175
-							$values[1].=":".$values[$i];
2175
+							$values[1] .= ":".$values[$i];
2176 2176
 						}
2177 2177
 					}
2178
-					$atts[$values[0]]=$values[1];
2178
+					$atts[$values[0]] = $values[1];
2179 2179
 				}
2180 2180
 				$item->attributes = $atts;
2181 2181
 				unset($atts);
@@ -2187,16 +2187,16 @@  discard block
 block discarded – undo
2187 2187
 	function getFileBoxListHtml()
2188 2188
 	{
2189 2189
 		$logged_info = Context::get('logged_info');
2190
-		if($logged_info->is_admin !='Y' && !$logged_info->is_site_admin) return new Object(-1, 'msg_not_permitted');
2190
+		if ($logged_info->is_admin != 'Y' && !$logged_info->is_site_admin) return new Object(-1, 'msg_not_permitted');
2191 2191
 		$link = parse_url($_SERVER["HTTP_REFERER"]);
2192
-		$link_params = explode('&',$link['query']);
2192
+		$link_params = explode('&', $link['query']);
2193 2193
 		foreach ($link_params as $param)
2194 2194
 		{
2195
-			$param = explode("=",$param);
2196
-			if($param[0] == 'selected_widget') $selected_widget = $param[1];
2195
+			$param = explode("=", $param);
2196
+			if ($param[0] == 'selected_widget') $selected_widget = $param[1];
2197 2197
 		}
2198 2198
 		$oWidgetModel = getModel('widget');
2199
-		if($selected_widget) $widget_info = $oWidgetModel->getWidgetInfo($selected_widget);
2199
+		if ($selected_widget) $widget_info = $oWidgetModel->getWidgetInfo($selected_widget);
2200 2200
 		Context::set('allow_multiple', $widget_info->extra_var->images->allow_multiple);
2201 2201
 
2202 2202
 		$oModuleModel = getModel('module');
@@ -2212,24 +2212,24 @@  discard block
 block discarded – undo
2212 2212
 		$security->encodeHTML('filebox_list..comment', 'filebox_list..attributes.');
2213 2213
 
2214 2214
 		$oTemplate = &TemplateHandler::getInstance();
2215
-		$html = $oTemplate->compile(_XE_PATH_ . 'modules/module/tpl/', 'filebox_list_html');
2215
+		$html = $oTemplate->compile(_XE_PATH_.'modules/module/tpl/', 'filebox_list_html');
2216 2216
 
2217 2217
 		$this->add('html', $html);
2218 2218
 	}
2219 2219
 
2220 2220
 	function getModuleFileBoxPath($module_filebox_srl)
2221 2221
 	{
2222
-		return sprintf("./files/attach/filebox/%s",getNumberingPath($module_filebox_srl,3));
2222
+		return sprintf("./files/attach/filebox/%s", getNumberingPath($module_filebox_srl, 3));
2223 2223
 	}
2224 2224
 
2225 2225
 	/**
2226 2226
 	 * @brief Return ruleset cache file path
2227 2227
 	 * @param module, act
2228 2228
 	 */
2229
-	function getValidatorFilePath($module, $ruleset, $mid=null)
2229
+	function getValidatorFilePath($module, $ruleset, $mid = null)
2230 2230
 	{
2231 2231
 		// load dynamic ruleset xml file
2232
-		if(strpos($ruleset, '@') !== false)
2232
+		if (strpos($ruleset, '@') !== false)
2233 2233
 		{
2234 2234
 			$rulsetFile = str_replace('@', '', $ruleset);
2235 2235
 			$xml_file = sprintf('./files/ruleset/%s.xml', $rulsetFile);
@@ -2239,20 +2239,20 @@  discard block
 block discarded – undo
2239 2239
 		{
2240 2240
 			$rulsetFile = str_replace('#', '', $ruleset).'.'.$mid;
2241 2241
 			$xml_file = sprintf('./files/ruleset/%s.xml', $rulsetFile);
2242
-			if(is_readable($xml_file))
2242
+			if (is_readable($xml_file))
2243 2243
 				return FileHandler::getRealPath($xml_file);
2244
-			else{
2244
+			else {
2245 2245
 				$ruleset = str_replace('#', '', $ruleset);
2246 2246
 			}
2247 2247
 
2248 2248
 		}
2249 2249
 		// Get a path of the requested module. Return if not exists.
2250 2250
 		$class_path = ModuleHandler::getModulePath($module);
2251
-		if(!$class_path) return;
2251
+		if (!$class_path) return;
2252 2252
 
2253 2253
 		// Check if module.xml exists in the path. Return if not exist
2254 2254
 		$xml_file = sprintf("%sruleset/%s.xml", $class_path, $ruleset);
2255
-		if(!file_exists($xml_file)) return;
2255
+		if (!file_exists($xml_file)) return;
2256 2256
 
2257 2257
 		return $xml_file;
2258 2258
 	}
@@ -2264,7 +2264,7 @@  discard block
 block discarded – undo
2264 2264
 		$requestVars = Context::getRequestVars();
2265 2265
 
2266 2266
 		$args = new stdClass;
2267
-		$args->site_srl = (int)$requestVars->site_srl;
2267
+		$args->site_srl = (int) $requestVars->site_srl;
2268 2268
 		$args->page = 1; // /< Page
2269 2269
 		$args->list_count = 100; // /< the number of posts to display on a single page
2270 2270
 		$args->page_count = 5; // /< the number of pages that appear in the page navigation
@@ -2276,9 +2276,9 @@  discard block
 block discarded – undo
2276 2276
 
2277 2277
 		$list = array();
2278 2278
 
2279
-		if($output->toBool())
2279
+		if ($output->toBool())
2280 2280
 		{
2281
-			foreach((array)$output->data as $code_info)
2281
+			foreach ((array) $output->data as $code_info)
2282 2282
 			{
2283 2283
 				unset($codeInfo);
2284 2284
 				$codeInfo = array('name'=>'$user_lang->'.$code_info->name, 'value'=>$code_info->value);
Please login to merge, or discard this patch.