GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — develop ( bbffbd...3684b6 )
by gyeong-won
08:41
created
widgets/content/content.class.php 2 patches
Spacing   +167 added lines, -167 removed lines patch added patch discarded remove patch
@@ -18,48 +18,48 @@  discard block
 block discarded – undo
18 18
 	function proc($args)
19 19
 	{
20 20
 		// Targets to sort
21
-		if(!in_array($args->order_target, array('regdate','update_order'))) $args->order_target = 'regdate';
21
+		if (!in_array($args->order_target, array('regdate', 'update_order'))) $args->order_target = 'regdate';
22 22
 		// Sort order
23
-		if(!in_array($args->order_type, array('asc','desc'))) $args->order_type = 'asc';
23
+		if (!in_array($args->order_type, array('asc', 'desc'))) $args->order_type = 'asc';
24 24
 		// Pages
25
-		$args->page_count = (int)$args->page_count;
26
-		if(!$args->page_count) $args->page_count = 1;
25
+		$args->page_count = (int) $args->page_count;
26
+		if (!$args->page_count) $args->page_count = 1;
27 27
 		// The number of displayed lists
28
-		$args->list_count = (int)$args->list_count;
29
-		if(!$args->list_count) $args->list_count = 5;
28
+		$args->list_count = (int) $args->list_count;
29
+		if (!$args->list_count) $args->list_count = 5;
30 30
 		// The number of thumbnail columns
31
-		$args->cols_list_count = (int)$args->cols_list_count;
32
-		if(!$args->cols_list_count) $args->cols_list_count = 5;
31
+		$args->cols_list_count = (int) $args->cols_list_count;
32
+		if (!$args->cols_list_count) $args->cols_list_count = 5;
33 33
 		// Cut the length of the title
34
-		if(!$args->subject_cut_size) $args->subject_cut_size = 0;
34
+		if (!$args->subject_cut_size) $args->subject_cut_size = 0;
35 35
 		// Cut the length of contents
36
-		if(!$args->content_cut_size) $args->content_cut_size = 100;
36
+		if (!$args->content_cut_size) $args->content_cut_size = 100;
37 37
 		// Cut the length of nickname
38
-		if(!$args->nickname_cut_size) $args->nickname_cut_size = 0;
38
+		if (!$args->nickname_cut_size) $args->nickname_cut_size = 0;
39 39
 		// Display time of the latest post
40
-		if(!$args->duration_new) $args->duration_new = 12;
40
+		if (!$args->duration_new) $args->duration_new = 12;
41 41
 		// How to create thumbnails
42
-		if(!$args->thumbnail_type) $args->thumbnail_type = 'crop';
42
+		if (!$args->thumbnail_type) $args->thumbnail_type = 'crop';
43 43
 		// Horizontal size of thumbnails
44
-		if(!$args->thumbnail_width) $args->thumbnail_width = 100;
44
+		if (!$args->thumbnail_width) $args->thumbnail_width = 100;
45 45
 		// Vertical size of thumbnails
46
-		if(!$args->thumbnail_height) $args->thumbnail_height = 75;
46
+		if (!$args->thumbnail_height) $args->thumbnail_height = 75;
47 47
 		// Viewing options
48
-		$args->option_view_arr = explode(',',$args->option_view);
48
+		$args->option_view_arr = explode(',', $args->option_view);
49 49
 		// markup options
50
-		if(!$args->markup_type) $args->markup_type = 'table';
50
+		if (!$args->markup_type) $args->markup_type = 'table';
51 51
 		// Set variables used internally
52 52
 		$oModuleModel = getModel('module');
53 53
 		$module_srls = $args->modules_info = $args->module_srls_info = $args->mid_lists = array();
54 54
 		$site_module_info = Context::get('site_module_info');
55 55
 		// List URLs if a type is RSS
56
-		if($args->content_type == 'rss')
56
+		if ($args->content_type == 'rss')
57 57
 		{
58 58
 			$args->rss_urls = array();
59
-			$rss_urls = array_unique(array($args->rss_url0,$args->rss_url1,$args->rss_url2,$args->rss_url3,$args->rss_url4));
60
-			for($i=0,$c=count($rss_urls);$i<$c;$i++)
59
+			$rss_urls = array_unique(array($args->rss_url0, $args->rss_url1, $args->rss_url2, $args->rss_url3, $args->rss_url4));
60
+			for ($i = 0, $c = count($rss_urls); $i < $c; $i++)
61 61
 			{
62
-				if($rss_urls[$i]) $args->rss_urls[] = $rss_urls[$i];
62
+				if ($rss_urls[$i]) $args->rss_urls[] = $rss_urls[$i];
63 63
 			}
64 64
 			// Get module information after listing module_srls if the module is not RSS
65 65
 		}
@@ -67,13 +67,13 @@  discard block
 block discarded – undo
67 67
 		{
68 68
 			$obj = new stdClass();
69 69
 			// Apply to all modules in the site if a target module is not specified
70
-			if(!$args->module_srls)
70
+			if (!$args->module_srls)
71 71
 			{
72
-				$obj->site_srl = (int)$site_module_info->site_srl;
72
+				$obj->site_srl = (int) $site_module_info->site_srl;
73 73
 				$output = executeQueryArray('widgets.content.getMids', $obj);
74
-				if($output->data)
74
+				if ($output->data)
75 75
 				{
76
-					foreach($output->data as $key => $val)
76
+					foreach ($output->data as $key => $val)
77 77
 					{
78 78
 						$args->modules_info[$val->mid] = $val;
79 79
 						$args->module_srls_info[$val->module_srl] = $val;
@@ -89,35 +89,35 @@  discard block
 block discarded – undo
89 89
 			{
90 90
 				$obj->module_srls = $args->module_srls;
91 91
 				$output = executeQueryArray('widgets.content.getMids', $obj);
92
-				if($output->data)
92
+				if ($output->data)
93 93
 				{
94
-					foreach($output->data as $key => $val)
94
+					foreach ($output->data as $key => $val)
95 95
 					{
96 96
 						$args->modules_info[$val->mid] = $val;
97 97
 						$args->module_srls_info[$val->module_srl] = $val;
98 98
 						$module_srls[] = $val->module_srl;
99 99
 					}
100
-					$idx = explode(',',$args->module_srls);
101
-					for($i=0,$c=count($idx);$i<$c;$i++)
100
+					$idx = explode(',', $args->module_srls);
101
+					for ($i = 0, $c = count($idx); $i < $c; $i++)
102 102
 					{
103 103
 						$srl = $idx[$i];
104
-						if(!$args->module_srls_info[$srl]) continue;
104
+						if (!$args->module_srls_info[$srl]) continue;
105 105
 						$args->mid_lists[$srl] = $args->module_srls_info[$srl]->mid;
106 106
 					}
107 107
 				}
108 108
 			}
109 109
 			// Exit if no module is found
110
-			if(!count($args->modules_info)) return Context::get('msg_not_founded');
111
-			$args->module_srl = implode(',',$module_srls);
110
+			if (!count($args->modules_info)) return Context::get('msg_not_founded');
111
+			$args->module_srl = implode(',', $module_srls);
112 112
 		}
113 113
 
114 114
 		/**
115 115
 		 * Method is separately made because content extraction, articles, comments, trackbacks, RSS and other elements exist
116 116
 		 */
117 117
 		// tab type
118
-		if($args->tab_type == 'none' || $args->tab_type == '')
118
+		if ($args->tab_type == 'none' || $args->tab_type == '')
119 119
 		{
120
-			switch($args->content_type)
120
+			switch ($args->content_type)
121 121
 			{
122 122
 				case 'comment':
123 123
 					$content_items = $this->_getCommentItems($args);
@@ -141,17 +141,17 @@  discard block
 block discarded – undo
141 141
 		{
142 142
 			$content_items = array();
143 143
 
144
-			switch($args->content_type)
144
+			switch ($args->content_type)
145 145
 			{
146 146
 				case 'comment':
147
-					foreach($args->mid_lists as $module_srl => $mid)
147
+					foreach ($args->mid_lists as $module_srl => $mid)
148 148
 					{
149 149
 						$args->module_srl = $module_srl;
150 150
 						$content_items[$module_srl] = $this->_getCommentItems($args);
151 151
 					}
152 152
 					break;
153 153
 				case 'image':
154
-					foreach($args->mid_lists as $module_srl => $mid)
154
+					foreach ($args->mid_lists as $module_srl => $mid)
155 155
 					{
156 156
 						$args->module_srl = $module_srl;
157 157
 						$content_items[$module_srl] = $this->_getImageItems($args);
@@ -161,14 +161,14 @@  discard block
 block discarded – undo
161 161
 					$content_items = $this->getRssItems($args);
162 162
 					break;
163 163
 				case 'trackback':
164
-					foreach($args->mid_lists as $module_srl => $mid)
164
+					foreach ($args->mid_lists as $module_srl => $mid)
165 165
 					{
166 166
 						$args->module_srl = $module_srl;
167 167
 						$content_items[$module_srl] = $this->_getTrackbackItems($args);
168 168
 					}
169 169
 					break;
170 170
 				default:
171
-					foreach($args->mid_lists as $module_srl => $mid)
171
+					foreach ($args->mid_lists as $module_srl => $mid)
172 172
 					{
173 173
 						$args->module_srl = $module_srl;
174 174
 						$content_items[$module_srl] = $this->_getDocumentItems($args);
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 			}
178 178
 		}
179 179
 
180
-		$output = $this->_compile($args,$content_items);
180
+		$output = $this->_compile($args, $content_items);
181 181
 		return $output;
182 182
 	}
183 183
 
@@ -197,14 +197,14 @@  discard block
 block discarded – undo
197 197
 
198 198
 		$content_items = array();
199 199
 
200
-		if(!count($output)) return;
200
+		if (!count($output)) return;
201 201
 
202
-		foreach($output as $key => $oComment)
202
+		foreach ($output as $key => $oComment)
203 203
 		{
204 204
 			$attribute = $oComment->getObjectVars();
205 205
 			$title = $oComment->getSummary($args->content_cut_size);
206
-			$thumbnail = $oComment->getThumbnail($args->thumbnail_width,$args->thumbnail_height,$args->thumbnail_type);
207
-			$url = sprintf("%s#comment_%s",getUrl('','document_srl',$oComment->get('document_srl')),$oComment->get('comment_srl'));
206
+			$thumbnail = $oComment->getThumbnail($args->thumbnail_width, $args->thumbnail_height, $args->thumbnail_type);
207
+			$url = sprintf("%s#comment_%s", getUrl('', 'document_srl', $oComment->get('document_srl')), $oComment->get('comment_srl'));
208 208
 
209 209
 			$attribute->mid = $args->mid_lists[$attribute->module_srl];
210 210
 			$browser_title = $args->module_srls_info[$attribute->module_srl]->browser_title;
@@ -229,10 +229,10 @@  discard block
 block discarded – undo
229 229
 		// Get categories
230 230
 		$obj = new stdClass();
231 231
 		$obj->module_srl = $args->module_srl;
232
-		$output = executeQueryArray('widgets.content.getCategories',$obj);
233
-		if($output->toBool() && $output->data)
232
+		$output = executeQueryArray('widgets.content.getCategories', $obj);
233
+		if ($output->toBool() && $output->data)
234 234
 		{
235
-			foreach($output->data as $key => $val)
235
+			foreach ($output->data as $key => $val)
236 236
 			{
237 237
 				$category_lists[$val->module_srl][$val->category_srl] = $val;
238 238
 			}
@@ -241,24 +241,24 @@  discard block
 block discarded – undo
241 241
 		$obj->module_srl = $args->module_srl;
242 242
 		$obj->category_srl = $args->category_srl;
243 243
 		$obj->sort_index = $args->order_target;
244
-		if($args->order_target == 'list_order' || $args->order_target == 'update_order')
244
+		if ($args->order_target == 'list_order' || $args->order_target == 'update_order')
245 245
 		{
246
-			$obj->order_type = $args->order_type=="desc"?"asc":"desc";
246
+			$obj->order_type = $args->order_type == "desc" ? "asc" : "desc";
247 247
 		}
248 248
 		else
249 249
 		{
250
-			$obj->order_type = $args->order_type=="desc"?"desc":"asc";
250
+			$obj->order_type = $args->order_type == "desc" ? "desc" : "asc";
251 251
 		}
252 252
 		$obj->list_count = $args->list_count * $args->page_count;
253 253
 		$obj->statusList = array('PUBLIC');
254 254
 		$output = executeQueryArray('widgets.content.getNewestDocuments', $obj);
255
-		if(!$output->toBool() || !$output->data) return;
255
+		if (!$output->toBool() || !$output->data) return;
256 256
 		// If the result exists, make each document as an object
257 257
 		$content_items = array();
258 258
 		$first_thumbnail_idx = -1;
259
-		if(count($output->data))
259
+		if (count($output->data))
260 260
 		{
261
-			foreach($output->data as $key => $attribute)
261
+			foreach ($output->data as $key => $attribute)
262 262
 			{
263 263
 				$oDocument = new documentItem();
264 264
 				$oDocument->setAttribute($attribute, false);
@@ -267,26 +267,26 @@  discard block
 block discarded – undo
267 267
 			}
268 268
 			$oDocumentModel->setToAllDocumentExtraVars();
269 269
 
270
-			for($i=0,$c=count($document_srls);$i<$c;$i++)
270
+			for ($i = 0, $c = count($document_srls); $i < $c; $i++)
271 271
 			{
272 272
 				$oDocument = $GLOBALS['XE_DOCUMENT_LIST'][$document_srls[$i]];
273 273
 				$document_srl = $oDocument->document_srl;
274 274
 				$module_srl = $oDocument->get('module_srl');
275 275
 				$category_srl = $oDocument->get('category_srl');
276
-				$thumbnail = $oDocument->getThumbnail($args->thumbnail_width,$args->thumbnail_height,$args->thumbnail_type);
276
+				$thumbnail = $oDocument->getThumbnail($args->thumbnail_width, $args->thumbnail_height, $args->thumbnail_type);
277 277
 
278
-				$content_item = new contentItem( $args->module_srls_info[$module_srl]->browser_title );
278
+				$content_item = new contentItem($args->module_srls_info[$module_srl]->browser_title);
279 279
 				$content_item->adds($oDocument->getObjectVars());
280 280
 				$content_item->add('original_content', $oDocument->get('content'));
281 281
 				$content_item->setTitle($oDocument->getTitleText());
282
-				$content_item->setCategory( $category_lists[$module_srl][$category_srl]->title );
283
-				$content_item->setDomain( $args->module_srls_info[$module_srl]->domain );
282
+				$content_item->setCategory($category_lists[$module_srl][$category_srl]->title);
283
+				$content_item->setDomain($args->module_srls_info[$module_srl]->domain);
284 284
 				$content_item->setContent($oDocument->getSummary($args->content_cut_size));
285
-				$content_item->setLink( getSiteUrl($domain,'','document_srl',$document_srl) );
285
+				$content_item->setLink(getSiteUrl($domain, '', 'document_srl', $document_srl));
286 286
 				$content_item->setThumbnail($thumbnail);
287 287
 				$content_item->setExtraImages($oDocument->printExtraImages($args->duration_new * 60 * 60));
288 288
 				$content_item->add('mid', $args->mid_lists[$module_srl]);
289
-				if($first_thumbnail_idx==-1 && $thumbnail) $first_thumbnail_idx = $i;
289
+				if ($first_thumbnail_idx == -1 && $thumbnail) $first_thumbnail_idx = $i;
290 290
 				$content_items[] = $content_item;
291 291
 			}
292 292
 
@@ -307,10 +307,10 @@  discard block
 block discarded – undo
307 307
 		$obj->direct_download = 'Y';
308 308
 		$obj->isvalid = 'Y';
309 309
 		// Get categories
310
-		$output = executeQueryArray('widgets.content.getCategories',$obj);
311
-		if($output->toBool() && $output->data)
310
+		$output = executeQueryArray('widgets.content.getCategories', $obj);
311
+		if ($output->toBool() && $output->data)
312 312
 		{
313
-			foreach($output->data as $key => $val)
313
+			foreach ($output->data as $key => $val)
314 314
 			{
315 315
 				$category_lists[$val->module_srl][$val->category_srl] = $val;
316 316
 			}
@@ -319,25 +319,25 @@  discard block
 block discarded – undo
319 319
 		$obj->list_count = $args->list_count * $args->page_count;
320 320
 		$files_output = executeQueryArray("file.getOneFileInDocument", $obj);
321 321
 		$files_count = count($files_output->data);
322
-		if(!$files_count) return;
322
+		if (!$files_count) return;
323 323
 
324 324
 		$content_items = array();
325 325
 
326
-		for($i=0;$i<$files_count;$i++) $document_srl_list[] = $files_output->data[$i]->document_srl;
326
+		for ($i = 0; $i < $files_count; $i++) $document_srl_list[] = $files_output->data[$i]->document_srl;
327 327
 
328 328
 		$tmp_document_list = $oDocumentModel->getDocuments($document_srl_list);
329 329
 
330
-		if(!count($tmp_document_list)) return;
330
+		if (!count($tmp_document_list)) return;
331 331
 
332
-		foreach($tmp_document_list as $oDocument)
332
+		foreach ($tmp_document_list as $oDocument)
333 333
 		{
334 334
 			$attribute = $oDocument->getObjectVars();
335 335
 			$browser_title = $args->module_srls_info[$attribute->module_srl]->browser_title;
336 336
 			$domain = $args->module_srls_info[$attribute->module_srl]->domain;
337 337
 			$category = $category_lists[$attribute->module_srl]->text;
338 338
 			$content = $oDocument->getSummary($args->content_cut_size);
339
-			$url = sprintf("%s#%s",$oDocument->getPermanentUrl() ,$oDocument->getCommentCount());
340
-			$thumbnail = $oDocument->getThumbnail($args->thumbnail_width,$args->thumbnail_height,$args->thumbnail_type);
339
+			$url = sprintf("%s#%s", $oDocument->getPermanentUrl(), $oDocument->getCommentCount());
340
+			$thumbnail = $oDocument->getThumbnail($args->thumbnail_width, $args->thumbnail_height, $args->thumbnail_type);
341 341
 			$extra_images = $oDocument->printExtraImages($args->duration_new);
342 342
 
343 343
 			$content_item = new contentItem($browser_title);
@@ -360,11 +360,11 @@  discard block
 block discarded – undo
360 360
 		$content_items = array();
361 361
 		$args->mid_lists = array();
362 362
 
363
-		foreach($args->rss_urls as $key => $rss)
363
+		foreach ($args->rss_urls as $key => $rss)
364 364
 		{
365 365
 			$args->rss_url = $rss;
366 366
 			$content_item = $this->_getRssItems($args);
367
-			if(count($content_item) > 0)
367
+			if (count($content_item) > 0)
368 368
 			{
369 369
 				$browser_title = $content_item[0]->getBrowserTitle();
370 370
 				$args->mid_lists[] = $browser_title;
@@ -372,37 +372,37 @@  discard block
 block discarded – undo
372 372
 			}
373 373
 		}
374 374
 		// If it is not a tab type
375
-		if($args->tab_type == 'none' || $args->tab_type == '')
375
+		if ($args->tab_type == 'none' || $args->tab_type == '')
376 376
 		{
377 377
 			$items = array();
378
-			foreach($content_items as $key => $val)
378
+			foreach ($content_items as $key => $val)
379 379
 			{
380
-				foreach($val as $k => $v)
380
+				foreach ($val as $k => $v)
381 381
 				{
382 382
 					$date = $v->get('regdate');
383
-					$i=0;
384
-					while(array_key_exists(sprintf('%s%02d',$date,$i), $items)) $i++;
385
-					$items[sprintf('%s%02d',$date,$i)] = $v;
383
+					$i = 0;
384
+					while (array_key_exists(sprintf('%s%02d', $date, $i), $items)) $i++;
385
+					$items[sprintf('%s%02d', $date, $i)] = $v;
386 386
 				}
387 387
 			}
388
-			if($args->order_type =='asc') ksort($items);
388
+			if ($args->order_type == 'asc') ksort($items);
389 389
 			else krsort($items);
390
-			$content_items = array_slice(array_values($items),0,$args->list_count*$args->page_count);
390
+			$content_items = array_slice(array_values($items), 0, $args->list_count * $args->page_count);
391 391
 			// Tab Type
392 392
 		}
393 393
 		else
394 394
 		{
395
-			foreach($content_items as $key=> $content_item_list)
395
+			foreach ($content_items as $key=> $content_item_list)
396 396
 			{
397 397
 				$items = array();
398
-				foreach($content_item_list as $k => $content_item)
398
+				foreach ($content_item_list as $k => $content_item)
399 399
 				{
400 400
 					$date = $content_item->get('regdate');
401
-					$i=0;
402
-					while(array_key_exists(sprintf('%s%02d',$date,$i), $items)) $i++;
403
-					$items[sprintf('%s%02d',$date,$i)] = $content_item;
401
+					$i = 0;
402
+					while (array_key_exists(sprintf('%s%02d', $date, $i), $items)) $i++;
403
+					$items[sprintf('%s%02d', $date, $i)] = $content_item;
404 404
 				}
405
-				if($args->order_type =='asc') ksort($items);
405
+				if ($args->order_type == 'asc') ksort($items);
406 406
 				else krsort($items);
407 407
 
408 408
 				$content_items[$key] = array_values($items);
@@ -413,19 +413,19 @@  discard block
 block discarded – undo
413 413
 
414 414
 	function _getRssBody($value)
415 415
 	{
416
-		if(!$value || is_string($value)) return $value;
417
-		if(is_object($value)) $value = get_object_vars($value);
416
+		if (!$value || is_string($value)) return $value;
417
+		if (is_object($value)) $value = get_object_vars($value);
418 418
 		$body = null;
419
-		if(!count($value)) return;
420
-		foreach($value as $key => $val)
419
+		if (!count($value)) return;
420
+		foreach ($value as $key => $val)
421 421
 		{
422
-			if($key == 'body')
422
+			if ($key == 'body')
423 423
 			{
424 424
 				$body = $val;
425 425
 				continue;
426 426
 			}
427
-			if(is_object($val)||is_array($val)) $body = $this->_getRssBody($val);
428
-			if($body !== null) return $body;
427
+			if (is_object($val) || is_array($val)) $body = $this->_getRssBody($val);
428
+			if ($body !== null) return $body;
429 429
 		}
430 430
 		return $body;
431 431
 	}
@@ -436,17 +436,17 @@  discard block
 block discarded – undo
436 436
 		// Replace tags such as </p> , </div> , </li> and others to a whitespace
437 437
 		$content = str_replace(array('</p>', '</div>', '</li>'), ' ', $content);
438 438
 		// Remove Tag
439
-		$content = preg_replace('!<([^>]*?)>!is','', $content);
439
+		$content = preg_replace('!<([^>]*?)>!is', '', $content);
440 440
 		// Replace tags to <, >, " and whitespace
441
-		$content = str_replace(array('&lt;','&gt;','&quot;','&nbsp;'), array('<','>','"',' '), $content);
441
+		$content = str_replace(array('&lt;', '&gt;', '&quot;', '&nbsp;'), array('<', '>', '"', ' '), $content);
442 442
 		// Delete  a series of whitespaces
443 443
 		$content = preg_replace('/ ( +)/is', ' ', $content);
444 444
 		// Truncate string
445 445
 		$content = trim(cut_str($content, $str_size, $tail));
446 446
 		// Replace back <, >, " to the original tags
447
-		$content = str_replace(array('<','>','"'),array('&lt;','&gt;','&quot;'), $content);
447
+		$content = str_replace(array('<', '>', '"'), array('&lt;', '&gt;', '&quot;'), $content);
448 448
 		// Fixed to a newline bug for consecutive sets of English letters
449
-		$content = preg_replace('/([a-z0-9\+:\/\.\~,\|\!\@\#\$\%\^\&\*\(\)\_]){20}/is',"$0-",$content);
449
+		$content = preg_replace('/([a-z0-9\+:\/\.\~,\|\!\@\#\$\%\^\&\*\(\)\_]){20}/is', "$0-", $content);
450 450
 		return $content; 
451 451
 	}
452 452
 
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
 	 */
457 457
 	function requestFeedContents($rss_url)
458 458
 	{
459
-		$rss_url = str_replace('&amp;','&',Context::convertEncodingStr($rss_url));
459
+		$rss_url = str_replace('&amp;', '&', Context::convertEncodingStr($rss_url));
460 460
 		return FileHandler::getRemoteResource($rss_url, null, 3, 'GET', 'application/xml');
461 461
 	}
462 462
 
@@ -468,51 +468,51 @@  discard block
 block discarded – undo
468 468
 		$buff = $this->requestFeedContents($args->rss_url);
469 469
 
470 470
 		$encoding = preg_match("/<\?xml.*encoding=\"(.+)\".*\?>/i", $buff, $matches);
471
-		if($encoding && stripos($matches[1], "UTF-8") === FALSE) $buff = Context::convertEncodingStr($buff);
471
+		if ($encoding && stripos($matches[1], "UTF-8") === FALSE) $buff = Context::convertEncodingStr($buff);
472 472
 
473 473
 		$buff = preg_replace("/<\?xml.*\?>/i", "", $buff);
474 474
 
475 475
 		$oXmlParser = new XmlParser();
476 476
 		$xml_doc = $oXmlParser->parse($buff);
477
-		if($xml_doc->rss)
477
+		if ($xml_doc->rss)
478 478
 		{
479 479
 			$rss->title = $xml_doc->rss->channel->title->body;
480 480
 			$rss->link = $xml_doc->rss->channel->link->body;
481 481
 
482 482
 			$items = $xml_doc->rss->channel->item;
483 483
 
484
-			if(!$items) return;
485
-			if($items && !is_array($items)) $items = array($items);
484
+			if (!$items) return;
485
+			if ($items && !is_array($items)) $items = array($items);
486 486
 
487 487
 			$content_items = array();
488 488
 
489 489
 			foreach ($items as $key => $value)
490 490
 			{
491
-				if($key >= $args->list_count * $args->page_count) break;
491
+				if ($key >= $args->list_count * $args->page_count) break;
492 492
 				unset($item);
493 493
 
494
-				foreach($value as $key2 => $value2)
494
+				foreach ($value as $key2 => $value2)
495 495
 				{
496
-					if(is_array($value2)) $value2 = array_shift($value2);
496
+					if (is_array($value2)) $value2 = array_shift($value2);
497 497
 					$item->{$key2} = $this->_getRssBody($value2);
498 498
 				}
499 499
 
500 500
 				$content_item = new contentItem($rss->title);
501 501
 				$content_item->setContentsLink($rss->link);
502 502
 				$content_item->setTitle($item->title);
503
-				$content_item->setNickName(max($item->author,$item->{'dc:creator'}));
503
+				$content_item->setNickName(max($item->author, $item->{'dc:creator'}));
504 504
 				//$content_item->setCategory($item->category);
505
-				$item->description = preg_replace('!<a href=!is','<a onclick="window.open(this.href);return false" href=', $item->description);
505
+				$item->description = preg_replace('!<a href=!is', '<a onclick="window.open(this.href);return false" href=', $item->description);
506 506
 				$content_item->setContent($this->_getSummary($item->description, $args->content_cut_size));
507 507
 				$content_item->setThumbnail($this->_getRssThumbnail($item->description));
508 508
 				$content_item->setLink($item->link);
509
-				$date = date('YmdHis', strtotime(max($item->pubdate,$item->pubDate,$item->{'dc:date'})));
509
+				$date = date('YmdHis', strtotime(max($item->pubdate, $item->pubDate, $item->{'dc:date'})));
510 510
 				$content_item->setRegdate($date);
511 511
 
512 512
 				$content_items[] = $content_item;
513 513
 			}
514 514
 		}
515
-		else if($xml_doc->{'rdf:rdf'})
515
+		else if ($xml_doc->{'rdf:rdf'})
516 516
 		{
517 517
 			// rss1.0 supported (XE's XML is case-insensitive because XML parser converts all to small letters. Fixed by misol
518 518
 			$rss->title = $xml_doc->{'rdf:rdf'}->channel->title->body;
@@ -520,102 +520,102 @@  discard block
 block discarded – undo
520 520
 
521 521
 			$items = $xml_doc->{'rdf:rdf'}->item;
522 522
 
523
-			if(!$items) return;
524
-			if($items && !is_array($items)) $items = array($items);
523
+			if (!$items) return;
524
+			if ($items && !is_array($items)) $items = array($items);
525 525
 
526 526
 			$content_items = array();
527 527
 
528 528
 			foreach ($items as $key => $value)
529 529
 			{
530
-				if($key >= $args->list_count * $args->page_count) break;
530
+				if ($key >= $args->list_count * $args->page_count) break;
531 531
 				unset($item);
532 532
 
533
-				foreach($value as $key2 => $value2)
533
+				foreach ($value as $key2 => $value2)
534 534
 				{
535
-					if(is_array($value2)) $value2 = array_shift($value2);
535
+					if (is_array($value2)) $value2 = array_shift($value2);
536 536
 					$item->{$key2} = $this->_getRssBody($value2);
537 537
 				}
538 538
 
539 539
 				$content_item = new contentItem($rss->title);
540 540
 				$content_item->setContentsLink($rss->link);
541 541
 				$content_item->setTitle($item->title);
542
-				$content_item->setNickName(max($item->author,$item->{'dc:creator'}));
542
+				$content_item->setNickName(max($item->author, $item->{'dc:creator'}));
543 543
 				//$content_item->setCategory($item->category);
544
-				$item->description = preg_replace('!<a href=!is','<a onclick="window.open(this.href);return false" href=', $item->description);
544
+				$item->description = preg_replace('!<a href=!is', '<a onclick="window.open(this.href);return false" href=', $item->description);
545 545
 				$content_item->setContent($this->_getSummary($item->description, $args->content_cut_size));
546 546
 				$content_item->setThumbnail($this->_getRssThumbnail($item->description));
547 547
 				$content_item->setLink($item->link);
548
-				$date = date('YmdHis', strtotime(max($item->pubdate,$item->pubDate,$item->{'dc:date'})));
548
+				$date = date('YmdHis', strtotime(max($item->pubdate, $item->pubDate, $item->{'dc:date'})));
549 549
 				$content_item->setRegdate($date);
550 550
 
551 551
 				$content_items[] = $content_item;
552 552
 			}
553 553
 		}
554
-		else if($xml_doc->feed && $xml_doc->feed->attrs->xmlns == 'http://www.w3.org/2005/Atom')
554
+		else if ($xml_doc->feed && $xml_doc->feed->attrs->xmlns == 'http://www.w3.org/2005/Atom')
555 555
 		{
556 556
 			// Atom 1.0 spec supported by misol
557 557
 			$rss->title = $xml_doc->feed->title->body;
558 558
 			$links = $xml_doc->feed->link;
559
-			if(is_array($links))
559
+			if (is_array($links))
560 560
 			{
561 561
 				foreach ($links as $value)
562 562
 				{
563
-					if($value->attrs->rel == 'alternate')
563
+					if ($value->attrs->rel == 'alternate')
564 564
 					{
565 565
 						$rss->link = $value->attrs->href;
566 566
 						break;
567 567
 					}
568 568
 				}
569 569
 			}
570
-			else if($links->attrs->rel == 'alternate') $rss->link = $links->attrs->href;
570
+			else if ($links->attrs->rel == 'alternate') $rss->link = $links->attrs->href;
571 571
 
572 572
 			$items = $xml_doc->feed->entry;
573 573
 
574
-			if(!$items) return;
575
-			if($items && !is_array($items)) $items = array($items);
574
+			if (!$items) return;
575
+			if ($items && !is_array($items)) $items = array($items);
576 576
 
577 577
 			$content_items = array();
578 578
 
579 579
 			foreach ($items as $key => $value)
580 580
 			{
581
-				if($key >= $args->list_count * $args->page_count) break;
581
+				if ($key >= $args->list_count * $args->page_count) break;
582 582
 				unset($item);
583 583
 
584
-				foreach($value as $key2 => $value2)
584
+				foreach ($value as $key2 => $value2)
585 585
 				{
586
-					if(is_array($value2)) $value2 = array_shift($value2);
586
+					if (is_array($value2)) $value2 = array_shift($value2);
587 587
 					$item->{$key2} = $this->_getRssBody($value2);
588 588
 				}
589 589
 
590 590
 				$content_item = new contentItem($rss->title);
591 591
 				$links = $value->link;
592
-				if(is_array($links))
592
+				if (is_array($links))
593 593
 				{
594 594
 					foreach ($links as $val)
595 595
 					{
596
-						if($val->attrs->rel == 'alternate')
596
+						if ($val->attrs->rel == 'alternate')
597 597
 						{
598 598
 							$item->link = $val->attrs->href;
599 599
 							break;
600 600
 						}
601 601
 					}
602 602
 				}
603
-				else if($links->attrs->rel == 'alternate') $item->link = $links->attrs->href;
603
+				else if ($links->attrs->rel == 'alternate') $item->link = $links->attrs->href;
604 604
 
605 605
 				$content_item->setContentsLink($rss->link);
606
-				if($item->title)
606
+				if ($item->title)
607 607
 				{
608
-					if(stripos($value->title->attrs->type, "html") === FALSE) $item->title = $value->title->body;
608
+					if (stripos($value->title->attrs->type, "html") === FALSE) $item->title = $value->title->body;
609 609
 				}
610 610
 				$content_item->setTitle($item->title);
611
-				$content_item->setNickName(max($item->author,$item->{'dc:creator'}));
611
+				$content_item->setNickName(max($item->author, $item->{'dc:creator'}));
612 612
 				$content_item->setAuthorSite($value->author->uri->body);
613 613
 
614 614
 				//$content_item->setCategory($item->category);
615 615
 				$item->description = ($item->content) ? $item->content : $item->description = $item->summary;
616
-				$item->description = preg_replace('!<a href=!is','<a onclick="window.open(this.href);return false" href=', $item->description);
616
+				$item->description = preg_replace('!<a href=!is', '<a onclick="window.open(this.href);return false" href=', $item->description);
617 617
 
618
-				if(($item->content && stripos($value->content->attrs->type, "html") === FALSE) || (!$item->content && stripos($value->summary->attrs->type, "html") === FALSE))
618
+				if (($item->content && stripos($value->content->attrs->type, "html") === FALSE) || (!$item->content && stripos($value->summary->attrs->type, "html") === FALSE))
619 619
 				{
620 620
 					$item->description = htmlspecialchars($item->description, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
621 621
 
@@ -624,7 +624,7 @@  discard block
 block discarded – undo
624 624
 				$content_item->setContent($this->_getSummary($item->description, $args->content_cut_size));
625 625
 				$content_item->setThumbnail($this->_getRssThumbnail($item->description));
626 626
 				$content_item->setLink($item->link);
627
-				$date = date('YmdHis', strtotime(max($item->published,$item->updated,$item->{'dc:date'})));
627
+				$date = date('YmdHis', strtotime(max($item->published, $item->updated, $item->{'dc:date'})));
628 628
 				$content_item->setRegdate($date);
629 629
 
630 630
 				$content_items[] = $content_item;
@@ -637,15 +637,15 @@  discard block
 block discarded – undo
637 637
 	{
638 638
 		@preg_match('@<img[^>]+src\s*=\s*(?:"(.+)"|\'(.+)\'|([^\s>(?:/>)]+))@', $content, $matches);
639 639
 
640
-		if($matches[1])
640
+		if ($matches[1])
641 641
 		{
642 642
 			return $matches[1];
643 643
 		}
644
-		elseif($matches[2])
644
+		elseif ($matches[2])
645 645
 		{
646 646
 			return $matches[2];
647 647
 		}
648
-		elseif($matches[3])
648
+		elseif ($matches[3])
649 649
 		{
650 650
 			return $matches[3];
651 651
 		}
@@ -658,17 +658,17 @@  discard block
 block discarded – undo
658 658
 	function _getTrackbackItems($args)
659 659
 	{
660 660
 		$oTrackbackModel = getModel('trackback');
661
-		if(!$oTrackbackModel)
661
+		if (!$oTrackbackModel)
662 662
 		{
663 663
 			return;
664 664
 		}
665 665
 
666 666
 		$obj = new stdClass;
667 667
 		// Get categories
668
-		$output = executeQueryArray('widgets.content.getCategories',$obj);
669
-		if($output->toBool() && $output->data)
668
+		$output = executeQueryArray('widgets.content.getCategories', $obj);
669
+		if ($output->toBool() && $output->data)
670 670
 		{
671
-			foreach($output->data as $key => $val)
671
+			foreach ($output->data as $key => $val)
672 672
 			{
673 673
 				$category_lists[$val->module_srl][$val->category_srl] = $val;
674 674
 			}
@@ -681,14 +681,14 @@  discard block
 block discarded – undo
681 681
 		// Get model object from the trackback module and execute getTrackbackList() method
682 682
 		$output = $oTrackbackModel->getNewestTrackbackList($obj);
683 683
 		// If an error occurs, just ignore it.
684
-		if(!$output->toBool() || !$output->data) return;
684
+		if (!$output->toBool() || !$output->data) return;
685 685
 		// If the result exists, make each document as an object
686 686
 		$content_items = array();
687
-		foreach($output->data as $key => $item)
687
+		foreach ($output->data as $key => $item)
688 688
 		{
689 689
 			$domain = $args->module_srls_info[$item->module_srl]->domain;
690 690
 			$category = $category_lists[$item->module_srl]->text;
691
-			$url = getSiteUrl($domain,'','document_srl',$item->document_srl);
691
+			$url = getSiteUrl($domain, '', 'document_srl', $item->document_srl);
692 692
 			$browser_title = $args->module_srls_info[$item->module_srl]->browser_title;
693 693
 
694 694
 			$content_item = new contentItem($browser_title);
@@ -696,8 +696,8 @@  discard block
 block discarded – undo
696 696
 			$content_item->setTitle($item->title);
697 697
 			$content_item->setCategory($category);
698 698
 			$content_item->setNickName($item->blog_name);
699
-			$content_item->setContent($item->excerpt);  ///<<
700
-			$content_item->setDomain($domain);  ///<<
699
+			$content_item->setContent($item->excerpt); ///<<
700
+			$content_item->setDomain($domain); ///<<
701 701
 			$content_item->setLink($url);
702 702
 			$content_item->add('mid', $args->mid_lists[$item->module_srl]);
703 703
 			$content_item->setRegdate($item->regdate);
@@ -706,7 +706,7 @@  discard block
 block discarded – undo
706 706
 		return $content_items;
707 707
 	}
708 708
 
709
-	function _compile($args,$content_items)
709
+	function _compile($args, $content_items)
710 710
 	{
711 711
 		$oTemplate = &TemplateHandler::getInstance();
712 712
 		// Set variables for widget
@@ -720,7 +720,7 @@  discard block
 block discarded – undo
720 720
 		$widget_info->nickname_cut_size = $args->nickname_cut_size;
721 721
 		$widget_info->new_window = $args->new_window;
722 722
 
723
-		$widget_info->duration_new = $args->duration_new * 60*60;
723
+		$widget_info->duration_new = $args->duration_new * 60 * 60;
724 724
 		$widget_info->thumbnail_type = $args->thumbnail_type;
725 725
 		$widget_info->thumbnail_width = $args->thumbnail_width;
726 726
 		$widget_info->thumbnail_height = $args->thumbnail_height;
@@ -738,12 +738,12 @@  discard block
 block discarded – undo
738 738
 
739 739
 		$widget_info->markup_type = $args->markup_type;
740 740
 		// If it is a tab type, list up tab items and change key value(module_srl) to index 
741
-		if($args->tab_type != 'none' && $args->tab_type)
741
+		if ($args->tab_type != 'none' && $args->tab_type)
742 742
 		{
743 743
 			$tab = array();
744
-			foreach($args->mid_lists as $module_srl => $mid)
744
+			foreach ($args->mid_lists as $module_srl => $mid)
745 745
 			{
746
-				if(!is_array($content_items[$module_srl]) || !count($content_items[$module_srl])) continue;
746
+				if (!is_array($content_items[$module_srl]) || !count($content_items[$module_srl])) continue;
747 747
 
748 748
 				unset($tab_item);
749 749
 				$tab_item = new stdClass();
@@ -751,7 +751,7 @@  discard block
 block discarded – undo
751 751
 				$tab_item->content_items = $content_items[$module_srl];
752 752
 				$tab_item->domain = $content_items[$module_srl][0]->getDomain();
753 753
 				$tab_item->url = $content_items[$module_srl][0]->getContentsLink();
754
-				if(!$tab_item->url) $tab_item->url = getSiteUrl($tab_item->domain, '','mid',$mid);
754
+				if (!$tab_item->url) $tab_item->url = getSiteUrl($tab_item->domain, '', 'mid', $mid);
755 755
 				$tab[] = $tab_item;
756 756
 			}
757 757
 			$widget_info->tab = $tab;
@@ -779,7 +779,7 @@  discard block
 block discarded – undo
779 779
 	var $contents_link = null;
780 780
 	var $domain = null;
781 781
 
782
-	function contentItem($browser_title='')
782
+	function contentItem($browser_title = '')
783 783
 	{
784 784
 		$this->browser_title = $browser_title;
785 785
 	}
@@ -789,22 +789,22 @@  discard block
 block discarded – undo
789 789
 	}
790 790
 	function setFirstThumbnailIdx($first_thumbnail_idx)
791 791
 	{
792
-		if(is_null($this->first_thumbnail) && $first_thumbnail_idx>-1)
792
+		if (is_null($this->first_thumbnail) && $first_thumbnail_idx > -1)
793 793
 		{
794 794
 			$this->has_first_thumbnail_idx = true;
795
-			$this->first_thumbnail_idx= $first_thumbnail_idx;
795
+			$this->first_thumbnail_idx = $first_thumbnail_idx;
796 796
 		}
797 797
 	}
798 798
 	function setExtraImages($extra_images)
799 799
 	{
800
-		$this->add('extra_images',$extra_images);
800
+		$this->add('extra_images', $extra_images);
801 801
 	}
802 802
 	function setDomain($domain)
803 803
 	{
804 804
 		static $default_domain = null;
805
-		if(!$domain)
805
+		if (!$domain)
806 806
 		{
807
-			if(is_null($default_domain)) $default_domain = Context::getDefaultUrl();
807
+			if (is_null($default_domain)) $default_domain = Context::getDefaultUrl();
808 808
 			$domain = $default_domain;
809 809
 		}
810 810
 		$this->domain = $domain;
@@ -868,17 +868,17 @@  discard block
 block discarded – undo
868 868
 	{
869 869
 		return $this->get('module_srl');
870 870
 	}
871
-	function getTitle($cut_size = 0, $tail='...')
871
+	function getTitle($cut_size = 0, $tail = '...')
872 872
 	{
873 873
 		$title = htmlspecialchars($this->get('title'), ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
874 874
 
875
-		if($cut_size) $title = cut_str($title, $cut_size, $tail);
875
+		if ($cut_size) $title = cut_str($title, $cut_size, $tail);
876 876
 
877 877
 		$attrs = array();
878
-		if($this->get('title_bold') == 'Y') $attrs[] = 'font-weight:bold';
879
-		if($this->get('title_color') && $this->get('title_color') != 'N') $attrs[] = 'color:#'.$this->get('title_color');
878
+		if ($this->get('title_bold') == 'Y') $attrs[] = 'font-weight:bold';
879
+		if ($this->get('title_color') && $this->get('title_color') != 'N') $attrs[] = 'color:#'.$this->get('title_color');
880 880
 
881
-		if(count($attrs)) $title = sprintf("<span style=\"%s\">%s</span>", implode(';', $attrs), $title);
881
+		if (count($attrs)) $title = sprintf("<span style=\"%s\">%s</span>", implode(';', $attrs), $title);
882 882
 
883 883
 		return $title;
884 884
 	}
@@ -890,9 +890,9 @@  discard block
 block discarded – undo
890 890
 	{
891 891
 		return $this->get('category');
892 892
 	}
893
-	function getNickName($cut_size = 0, $tail='...')
893
+	function getNickName($cut_size = 0, $tail = '...')
894 894
 	{
895
-		if($cut_size) $nick_name = cut_str($this->get('nick_name'), $cut_size, $tail);
895
+		if ($cut_size) $nick_name = cut_str($this->get('nick_name'), $cut_size, $tail);
896 896
 		else $nick_name = $this->get('nick_name');
897 897
 
898 898
 		return $nick_name;
@@ -904,12 +904,12 @@  discard block
 block discarded – undo
904 904
 	function getCommentCount()
905 905
 	{
906 906
 		$comment_count = $this->get('comment_count');
907
-		return $comment_count>0 ? $comment_count : '';
907
+		return $comment_count > 0 ? $comment_count : '';
908 908
 	}
909 909
 	function getTrackbackCount()
910 910
 	{
911 911
 		$trackback_count = $this->get('trackback_count');
912
-		return $trackback_count>0 ? $trackback_count : '';
912
+		return $trackback_count > 0 ? $trackback_count : '';
913 913
 	}
914 914
 	function getRegdate($format = 'Y.m.d H:i:s')
915 915
 	{
Please login to merge, or discard this patch.
Braces   +183 added lines, -81 removed lines patch added patch discarded remove patch
@@ -18,36 +18,62 @@  discard block
 block discarded – undo
18 18
 	function proc($args)
19 19
 	{
20 20
 		// Targets to sort
21
-		if(!in_array($args->order_target, array('regdate','update_order'))) $args->order_target = 'regdate';
21
+		if(!in_array($args->order_target, array('regdate','update_order'))) {
22
+			$args->order_target = 'regdate';
23
+		}
22 24
 		// Sort order
23
-		if(!in_array($args->order_type, array('asc','desc'))) $args->order_type = 'asc';
25
+		if(!in_array($args->order_type, array('asc','desc'))) {
26
+			$args->order_type = 'asc';
27
+		}
24 28
 		// Pages
25 29
 		$args->page_count = (int)$args->page_count;
26
-		if(!$args->page_count) $args->page_count = 1;
30
+		if(!$args->page_count) {
31
+			$args->page_count = 1;
32
+		}
27 33
 		// The number of displayed lists
28 34
 		$args->list_count = (int)$args->list_count;
29
-		if(!$args->list_count) $args->list_count = 5;
35
+		if(!$args->list_count) {
36
+			$args->list_count = 5;
37
+		}
30 38
 		// The number of thumbnail columns
31 39
 		$args->cols_list_count = (int)$args->cols_list_count;
32
-		if(!$args->cols_list_count) $args->cols_list_count = 5;
40
+		if(!$args->cols_list_count) {
41
+			$args->cols_list_count = 5;
42
+		}
33 43
 		// Cut the length of the title
34
-		if(!$args->subject_cut_size) $args->subject_cut_size = 0;
44
+		if(!$args->subject_cut_size) {
45
+			$args->subject_cut_size = 0;
46
+		}
35 47
 		// Cut the length of contents
36
-		if(!$args->content_cut_size) $args->content_cut_size = 100;
48
+		if(!$args->content_cut_size) {
49
+			$args->content_cut_size = 100;
50
+		}
37 51
 		// Cut the length of nickname
38
-		if(!$args->nickname_cut_size) $args->nickname_cut_size = 0;
52
+		if(!$args->nickname_cut_size) {
53
+			$args->nickname_cut_size = 0;
54
+		}
39 55
 		// Display time of the latest post
40
-		if(!$args->duration_new) $args->duration_new = 12;
56
+		if(!$args->duration_new) {
57
+			$args->duration_new = 12;
58
+		}
41 59
 		// How to create thumbnails
42
-		if(!$args->thumbnail_type) $args->thumbnail_type = 'crop';
60
+		if(!$args->thumbnail_type) {
61
+			$args->thumbnail_type = 'crop';
62
+		}
43 63
 		// Horizontal size of thumbnails
44
-		if(!$args->thumbnail_width) $args->thumbnail_width = 100;
64
+		if(!$args->thumbnail_width) {
65
+			$args->thumbnail_width = 100;
66
+		}
45 67
 		// Vertical size of thumbnails
46
-		if(!$args->thumbnail_height) $args->thumbnail_height = 75;
68
+		if(!$args->thumbnail_height) {
69
+			$args->thumbnail_height = 75;
70
+		}
47 71
 		// Viewing options
48 72
 		$args->option_view_arr = explode(',',$args->option_view);
49 73
 		// markup options
50
-		if(!$args->markup_type) $args->markup_type = 'table';
74
+		if(!$args->markup_type) {
75
+			$args->markup_type = 'table';
76
+		}
51 77
 		// Set variables used internally
52 78
 		$oModuleModel = getModel('module');
53 79
 		$module_srls = $args->modules_info = $args->module_srls_info = $args->mid_lists = array();
@@ -59,11 +85,12 @@  discard block
 block discarded – undo
59 85
 			$rss_urls = array_unique(array($args->rss_url0,$args->rss_url1,$args->rss_url2,$args->rss_url3,$args->rss_url4));
60 86
 			for($i=0,$c=count($rss_urls);$i<$c;$i++)
61 87
 			{
62
-				if($rss_urls[$i]) $args->rss_urls[] = $rss_urls[$i];
88
+				if($rss_urls[$i]) {
89
+					$args->rss_urls[] = $rss_urls[$i];
90
+				}
63 91
 			}
64 92
 			// Get module information after listing module_srls if the module is not RSS
65
-		}
66
-		else
93
+		} else
67 94
 		{
68 95
 			$obj = new stdClass();
69 96
 			// Apply to all modules in the site if a target module is not specified
@@ -84,8 +111,7 @@  discard block
 block discarded – undo
84 111
 
85 112
 				$args->modules_info = $oModuleModel->getMidList($obj);
86 113
 				// Apply to the module only if a target module is specified
87
-			}
88
-			else
114
+			} else
89 115
 			{
90 116
 				$obj->module_srls = $args->module_srls;
91 117
 				$output = executeQueryArray('widgets.content.getMids', $obj);
@@ -101,13 +127,17 @@  discard block
 block discarded – undo
101 127
 					for($i=0,$c=count($idx);$i<$c;$i++)
102 128
 					{
103 129
 						$srl = $idx[$i];
104
-						if(!$args->module_srls_info[$srl]) continue;
130
+						if(!$args->module_srls_info[$srl]) {
131
+							continue;
132
+						}
105 133
 						$args->mid_lists[$srl] = $args->module_srls_info[$srl]->mid;
106 134
 					}
107 135
 				}
108 136
 			}
109 137
 			// Exit if no module is found
110
-			if(!count($args->modules_info)) return Context::get('msg_not_founded');
138
+			if(!count($args->modules_info)) {
139
+				return Context::get('msg_not_founded');
140
+			}
111 141
 			$args->module_srl = implode(',',$module_srls);
112 142
 		}
113 143
 
@@ -136,8 +166,7 @@  discard block
 block discarded – undo
136 166
 					break;
137 167
 			}
138 168
 			// If not a tab type
139
-		}
140
-		else
169
+		} else
141 170
 		{
142 171
 			$content_items = array();
143 172
 
@@ -197,7 +226,9 @@  discard block
 block discarded – undo
197 226
 
198 227
 		$content_items = array();
199 228
 
200
-		if(!count($output)) return;
229
+		if(!count($output)) {
230
+			return;
231
+		}
201 232
 
202 233
 		foreach($output as $key => $oComment)
203 234
 		{
@@ -244,15 +275,16 @@  discard block
 block discarded – undo
244 275
 		if($args->order_target == 'list_order' || $args->order_target == 'update_order')
245 276
 		{
246 277
 			$obj->order_type = $args->order_type=="desc"?"asc":"desc";
247
-		}
248
-		else
278
+		} else
249 279
 		{
250 280
 			$obj->order_type = $args->order_type=="desc"?"desc":"asc";
251 281
 		}
252 282
 		$obj->list_count = $args->list_count * $args->page_count;
253 283
 		$obj->statusList = array('PUBLIC');
254 284
 		$output = executeQueryArray('widgets.content.getNewestDocuments', $obj);
255
-		if(!$output->toBool() || !$output->data) return;
285
+		if(!$output->toBool() || !$output->data) {
286
+			return;
287
+		}
256 288
 		// If the result exists, make each document as an object
257 289
 		$content_items = array();
258 290
 		$first_thumbnail_idx = -1;
@@ -286,7 +318,9 @@  discard block
 block discarded – undo
286 318
 				$content_item->setThumbnail($thumbnail);
287 319
 				$content_item->setExtraImages($oDocument->printExtraImages($args->duration_new * 60 * 60));
288 320
 				$content_item->add('mid', $args->mid_lists[$module_srl]);
289
-				if($first_thumbnail_idx==-1 && $thumbnail) $first_thumbnail_idx = $i;
321
+				if($first_thumbnail_idx==-1 && $thumbnail) {
322
+					$first_thumbnail_idx = $i;
323
+				}
290 324
 				$content_items[] = $content_item;
291 325
 			}
292 326
 
@@ -319,15 +353,21 @@  discard block
 block discarded – undo
319 353
 		$obj->list_count = $args->list_count * $args->page_count;
320 354
 		$files_output = executeQueryArray("file.getOneFileInDocument", $obj);
321 355
 		$files_count = count($files_output->data);
322
-		if(!$files_count) return;
356
+		if(!$files_count) {
357
+			return;
358
+		}
323 359
 
324 360
 		$content_items = array();
325 361
 
326
-		for($i=0;$i<$files_count;$i++) $document_srl_list[] = $files_output->data[$i]->document_srl;
362
+		for($i=0;$i<$files_count;$i++) {
363
+			$document_srl_list[] = $files_output->data[$i]->document_srl;
364
+		}
327 365
 
328 366
 		$tmp_document_list = $oDocumentModel->getDocuments($document_srl_list);
329 367
 
330
-		if(!count($tmp_document_list)) return;
368
+		if(!count($tmp_document_list)) {
369
+			return;
370
+		}
331 371
 
332 372
 		foreach($tmp_document_list as $oDocument)
333 373
 		{
@@ -381,16 +421,20 @@  discard block
 block discarded – undo
381 421
 				{
382 422
 					$date = $v->get('regdate');
383 423
 					$i=0;
384
-					while(array_key_exists(sprintf('%s%02d',$date,$i), $items)) $i++;
424
+					while(array_key_exists(sprintf('%s%02d',$date,$i), $items)) {
425
+						$i++;
426
+					}
385 427
 					$items[sprintf('%s%02d',$date,$i)] = $v;
386 428
 				}
387 429
 			}
388
-			if($args->order_type =='asc') ksort($items);
389
-			else krsort($items);
430
+			if($args->order_type =='asc') {
431
+				ksort($items);
432
+			} else {
433
+				krsort($items);
434
+			}
390 435
 			$content_items = array_slice(array_values($items),0,$args->list_count*$args->page_count);
391 436
 			// Tab Type
392
-		}
393
-		else
437
+		} else
394 438
 		{
395 439
 			foreach($content_items as $key=> $content_item_list)
396 440
 			{
@@ -399,11 +443,16 @@  discard block
 block discarded – undo
399 443
 				{
400 444
 					$date = $content_item->get('regdate');
401 445
 					$i=0;
402
-					while(array_key_exists(sprintf('%s%02d',$date,$i), $items)) $i++;
446
+					while(array_key_exists(sprintf('%s%02d',$date,$i), $items)) {
447
+						$i++;
448
+					}
403 449
 					$items[sprintf('%s%02d',$date,$i)] = $content_item;
404 450
 				}
405
-				if($args->order_type =='asc') ksort($items);
406
-				else krsort($items);
451
+				if($args->order_type =='asc') {
452
+					ksort($items);
453
+				} else {
454
+					krsort($items);
455
+				}
407 456
 
408 457
 				$content_items[$key] = array_values($items);
409 458
 			}
@@ -413,10 +462,16 @@  discard block
 block discarded – undo
413 462
 
414 463
 	function _getRssBody($value)
415 464
 	{
416
-		if(!$value || is_string($value)) return $value;
417
-		if(is_object($value)) $value = get_object_vars($value);
465
+		if(!$value || is_string($value)) {
466
+			return $value;
467
+		}
468
+		if(is_object($value)) {
469
+			$value = get_object_vars($value);
470
+		}
418 471
 		$body = null;
419
-		if(!count($value)) return;
472
+		if(!count($value)) {
473
+			return;
474
+		}
420 475
 		foreach($value as $key => $val)
421 476
 		{
422 477
 			if($key == 'body')
@@ -424,8 +479,12 @@  discard block
 block discarded – undo
424 479
 				$body = $val;
425 480
 				continue;
426 481
 			}
427
-			if(is_object($val)||is_array($val)) $body = $this->_getRssBody($val);
428
-			if($body !== null) return $body;
482
+			if(is_object($val)||is_array($val)) {
483
+				$body = $this->_getRssBody($val);
484
+			}
485
+			if($body !== null) {
486
+				return $body;
487
+			}
429 488
 		}
430 489
 		return $body;
431 490
 	}
@@ -468,7 +527,9 @@  discard block
 block discarded – undo
468 527
 		$buff = $this->requestFeedContents($args->rss_url);
469 528
 
470 529
 		$encoding = preg_match("/<\?xml.*encoding=\"(.+)\".*\?>/i", $buff, $matches);
471
-		if($encoding && stripos($matches[1], "UTF-8") === FALSE) $buff = Context::convertEncodingStr($buff);
530
+		if($encoding && stripos($matches[1], "UTF-8") === FALSE) {
531
+			$buff = Context::convertEncodingStr($buff);
532
+		}
472 533
 
473 534
 		$buff = preg_replace("/<\?xml.*\?>/i", "", $buff);
474 535
 
@@ -481,19 +542,27 @@  discard block
 block discarded – undo
481 542
 
482 543
 			$items = $xml_doc->rss->channel->item;
483 544
 
484
-			if(!$items) return;
485
-			if($items && !is_array($items)) $items = array($items);
545
+			if(!$items) {
546
+				return;
547
+			}
548
+			if($items && !is_array($items)) {
549
+				$items = array($items);
550
+			}
486 551
 
487 552
 			$content_items = array();
488 553
 
489 554
 			foreach ($items as $key => $value)
490 555
 			{
491
-				if($key >= $args->list_count * $args->page_count) break;
556
+				if($key >= $args->list_count * $args->page_count) {
557
+					break;
558
+				}
492 559
 				unset($item);
493 560
 
494 561
 				foreach($value as $key2 => $value2)
495 562
 				{
496
-					if(is_array($value2)) $value2 = array_shift($value2);
563
+					if(is_array($value2)) {
564
+						$value2 = array_shift($value2);
565
+					}
497 566
 					$item->{$key2} = $this->_getRssBody($value2);
498 567
 				}
499 568
 
@@ -511,8 +580,7 @@  discard block
 block discarded – undo
511 580
 
512 581
 				$content_items[] = $content_item;
513 582
 			}
514
-		}
515
-		else if($xml_doc->{'rdf:rdf'})
583
+		} else if($xml_doc->{'rdf:rdf'})
516 584
 		{
517 585
 			// rss1.0 supported (XE's XML is case-insensitive because XML parser converts all to small letters. Fixed by misol
518 586
 			$rss->title = $xml_doc->{'rdf:rdf'}->channel->title->body;
@@ -520,19 +588,27 @@  discard block
 block discarded – undo
520 588
 
521 589
 			$items = $xml_doc->{'rdf:rdf'}->item;
522 590
 
523
-			if(!$items) return;
524
-			if($items && !is_array($items)) $items = array($items);
591
+			if(!$items) {
592
+				return;
593
+			}
594
+			if($items && !is_array($items)) {
595
+				$items = array($items);
596
+			}
525 597
 
526 598
 			$content_items = array();
527 599
 
528 600
 			foreach ($items as $key => $value)
529 601
 			{
530
-				if($key >= $args->list_count * $args->page_count) break;
602
+				if($key >= $args->list_count * $args->page_count) {
603
+					break;
604
+				}
531 605
 				unset($item);
532 606
 
533 607
 				foreach($value as $key2 => $value2)
534 608
 				{
535
-					if(is_array($value2)) $value2 = array_shift($value2);
609
+					if(is_array($value2)) {
610
+						$value2 = array_shift($value2);
611
+					}
536 612
 					$item->{$key2} = $this->_getRssBody($value2);
537 613
 				}
538 614
 
@@ -550,8 +626,7 @@  discard block
 block discarded – undo
550 626
 
551 627
 				$content_items[] = $content_item;
552 628
 			}
553
-		}
554
-		else if($xml_doc->feed && $xml_doc->feed->attrs->xmlns == 'http://www.w3.org/2005/Atom')
629
+		} else if($xml_doc->feed && $xml_doc->feed->attrs->xmlns == 'http://www.w3.org/2005/Atom')
555 630
 		{
556 631
 			// Atom 1.0 spec supported by misol
557 632
 			$rss->title = $xml_doc->feed->title->body;
@@ -566,24 +641,33 @@  discard block
 block discarded – undo
566 641
 						break;
567 642
 					}
568 643
 				}
644
+			} else if($links->attrs->rel == 'alternate') {
645
+				$rss->link = $links->attrs->href;
569 646
 			}
570
-			else if($links->attrs->rel == 'alternate') $rss->link = $links->attrs->href;
571 647
 
572 648
 			$items = $xml_doc->feed->entry;
573 649
 
574
-			if(!$items) return;
575
-			if($items && !is_array($items)) $items = array($items);
650
+			if(!$items) {
651
+				return;
652
+			}
653
+			if($items && !is_array($items)) {
654
+				$items = array($items);
655
+			}
576 656
 
577 657
 			$content_items = array();
578 658
 
579 659
 			foreach ($items as $key => $value)
580 660
 			{
581
-				if($key >= $args->list_count * $args->page_count) break;
661
+				if($key >= $args->list_count * $args->page_count) {
662
+					break;
663
+				}
582 664
 				unset($item);
583 665
 
584 666
 				foreach($value as $key2 => $value2)
585 667
 				{
586
-					if(is_array($value2)) $value2 = array_shift($value2);
668
+					if(is_array($value2)) {
669
+						$value2 = array_shift($value2);
670
+					}
587 671
 					$item->{$key2} = $this->_getRssBody($value2);
588 672
 				}
589 673
 
@@ -599,13 +683,16 @@  discard block
 block discarded – undo
599 683
 							break;
600 684
 						}
601 685
 					}
686
+				} else if($links->attrs->rel == 'alternate') {
687
+					$item->link = $links->attrs->href;
602 688
 				}
603
-				else if($links->attrs->rel == 'alternate') $item->link = $links->attrs->href;
604 689
 
605 690
 				$content_item->setContentsLink($rss->link);
606 691
 				if($item->title)
607 692
 				{
608
-					if(stripos($value->title->attrs->type, "html") === FALSE) $item->title = $value->title->body;
693
+					if(stripos($value->title->attrs->type, "html") === FALSE) {
694
+						$item->title = $value->title->body;
695
+					}
609 696
 				}
610 697
 				$content_item->setTitle($item->title);
611 698
 				$content_item->setNickName(max($item->author,$item->{'dc:creator'}));
@@ -640,16 +727,13 @@  discard block
 block discarded – undo
640 727
 		if($matches[1])
641 728
 		{
642 729
 			return $matches[1];
643
-		}
644
-		elseif($matches[2])
730
+		} elseif($matches[2])
645 731
 		{
646 732
 			return $matches[2];
647
-		}
648
-		elseif($matches[3])
733
+		} elseif($matches[3])
649 734
 		{
650 735
 			return $matches[3];
651
-		}
652
-		else
736
+		} else
653 737
 		{
654 738
 			return NULL;
655 739
 		}
@@ -681,7 +765,9 @@  discard block
 block discarded – undo
681 765
 		// Get model object from the trackback module and execute getTrackbackList() method
682 766
 		$output = $oTrackbackModel->getNewestTrackbackList($obj);
683 767
 		// If an error occurs, just ignore it.
684
-		if(!$output->toBool() || !$output->data) return;
768
+		if(!$output->toBool() || !$output->data) {
769
+			return;
770
+		}
685 771
 		// If the result exists, make each document as an object
686 772
 		$content_items = array();
687 773
 		foreach($output->data as $key => $item)
@@ -743,7 +829,9 @@  discard block
 block discarded – undo
743 829
 			$tab = array();
744 830
 			foreach($args->mid_lists as $module_srl => $mid)
745 831
 			{
746
-				if(!is_array($content_items[$module_srl]) || !count($content_items[$module_srl])) continue;
832
+				if(!is_array($content_items[$module_srl]) || !count($content_items[$module_srl])) {
833
+					continue;
834
+				}
747 835
 
748 836
 				unset($tab_item);
749 837
 				$tab_item = new stdClass();
@@ -751,12 +839,13 @@  discard block
 block discarded – undo
751 839
 				$tab_item->content_items = $content_items[$module_srl];
752 840
 				$tab_item->domain = $content_items[$module_srl][0]->getDomain();
753 841
 				$tab_item->url = $content_items[$module_srl][0]->getContentsLink();
754
-				if(!$tab_item->url) $tab_item->url = getSiteUrl($tab_item->domain, '','mid',$mid);
842
+				if(!$tab_item->url) {
843
+					$tab_item->url = getSiteUrl($tab_item->domain, '','mid',$mid);
844
+				}
755 845
 				$tab[] = $tab_item;
756 846
 			}
757 847
 			$widget_info->tab = $tab;
758
-		}
759
-		else
848
+		} else
760 849
 		{
761 850
 			$widget_info->content_items = $content_items;
762 851
 		}
@@ -804,7 +893,9 @@  discard block
 block discarded – undo
804 893
 		static $default_domain = null;
805 894
 		if(!$domain)
806 895
 		{
807
-			if(is_null($default_domain)) $default_domain = Context::getDefaultUrl();
896
+			if(is_null($default_domain)) {
897
+				$default_domain = Context::getDefaultUrl();
898
+			}
808 899
 			$domain = $default_domain;
809 900
 		}
810 901
 		$this->domain = $domain;
@@ -872,13 +963,21 @@  discard block
 block discarded – undo
872 963
 	{
873 964
 		$title = htmlspecialchars($this->get('title'), ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
874 965
 
875
-		if($cut_size) $title = cut_str($title, $cut_size, $tail);
966
+		if($cut_size) {
967
+			$title = cut_str($title, $cut_size, $tail);
968
+		}
876 969
 
877 970
 		$attrs = array();
878
-		if($this->get('title_bold') == 'Y') $attrs[] = 'font-weight:bold';
879
-		if($this->get('title_color') && $this->get('title_color') != 'N') $attrs[] = 'color:#'.$this->get('title_color');
971
+		if($this->get('title_bold') == 'Y') {
972
+			$attrs[] = 'font-weight:bold';
973
+		}
974
+		if($this->get('title_color') && $this->get('title_color') != 'N') {
975
+			$attrs[] = 'color:#'.$this->get('title_color');
976
+		}
880 977
 
881
-		if(count($attrs)) $title = sprintf("<span style=\"%s\">%s</span>", implode(';', $attrs), $title);
978
+		if(count($attrs)) {
979
+			$title = sprintf("<span style=\"%s\">%s</span>", implode(';', $attrs), $title);
980
+		}
882 981
 
883 982
 		return $title;
884 983
 	}
@@ -892,8 +991,11 @@  discard block
 block discarded – undo
892 991
 	}
893 992
 	function getNickName($cut_size = 0, $tail='...')
894 993
 	{
895
-		if($cut_size) $nick_name = cut_str($this->get('nick_name'), $cut_size, $tail);
896
-		else $nick_name = $this->get('nick_name');
994
+		if($cut_size) {
995
+			$nick_name = cut_str($this->get('nick_name'), $cut_size, $tail);
996
+		} else {
997
+			$nick_name = $this->get('nick_name');
998
+		}
897 999
 
898 1000
 		return $nick_name;
899 1001
 	}
Please login to merge, or discard this patch.
classes/display/HTMLDisplayHandler.php 1 patch
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -18,9 +18,9 @@  discard block
 block discarded – undo
18 18
 
19 19
 		$template_path = $oModule->getTemplatePath();
20 20
 
21
-		if(!is_dir($template_path))
21
+		if (!is_dir($template_path))
22 22
 		{
23
-			if($oModule->module_info->module == $oModule->module)
23
+			if ($oModule->module_info->module == $oModule->module)
24 24
 			{
25 25
 				$skin = $oModule->origin_module_info->skin;
26 26
 			}
@@ -29,17 +29,17 @@  discard block
 block discarded – undo
29 29
 				$skin = $oModule->module_config->skin;
30 30
 			}
31 31
 
32
-			if(Context::get('module') != 'admin' && strpos(Context::get('act'), 'Admin') === false)
32
+			if (Context::get('module') != 'admin' && strpos(Context::get('act'), 'Admin') === false)
33 33
 			{
34
-				if($skin && is_string($skin))
34
+				if ($skin && is_string($skin))
35 35
 				{
36 36
 					$theme_skin = explode('|@|', $skin);
37 37
 					$template_path = $oModule->getTemplatePath();
38
-					if(count($theme_skin) == 2)
38
+					if (count($theme_skin) == 2)
39 39
 					{
40 40
 						$theme_path = sprintf('./themes/%s', $theme_skin[0]);
41 41
 						// FIXME $theme_path $theme_path $theme_path ??
42
-						if(substr($theme_path, 0, strlen($theme_path)) != $theme_path)
42
+						if (substr($theme_path, 0, strlen($theme_path)) != $theme_path)
43 43
 						{
44 44
 							$template_path = sprintf('%s/modules/%s/', $theme_path, $theme_skin[1]);
45 45
 						}
@@ -65,16 +65,16 @@  discard block
 block discarded – undo
65 65
 		$oSecurity->encodeHTML('is_keyword', 'search_keyword', 'search_target', 'order_target', 'order_type');
66 66
 
67 67
 		// add .x div for adminitration pages
68
-		if(Context::getResponseMethod() == 'HTML')
68
+		if (Context::getResponseMethod() == 'HTML')
69 69
 		{
70
-			if(Context::get('module') != 'admin' && strpos(Context::get('act'), 'Admin') > 0 && Context::get('act') != 'dispPageAdminContentModify' && Context::get('act') != 'dispPageAdminMobileContentModify')
70
+			if (Context::get('module') != 'admin' && strpos(Context::get('act'), 'Admin') > 0 && Context::get('act') != 'dispPageAdminContentModify' && Context::get('act') != 'dispPageAdminMobileContentModify')
71 71
 			{
72
-				$output = '<div class="x">' . $output . '</div>';
72
+				$output = '<div class="x">'.$output.'</div>';
73 73
 			}
74 74
 
75
-			if(Context::get('layout') != 'none')
75
+			if (Context::get('layout') != 'none')
76 76
 			{
77
-				if(__DEBUG__ == 3)
77
+				if (__DEBUG__ == 3)
78 78
 				{
79 79
 					$start = getMicroTime();
80 80
 				}
@@ -92,11 +92,11 @@  discard block
 block discarded – undo
92 92
 				$layout_srl = $layout_info->layout_srl;
93 93
 
94 94
 				// compile if connected to the layout
95
-				if($layout_srl > 0)
95
+				if ($layout_srl > 0)
96 96
 				{
97 97
 
98 98
 					// handle separately if the layout is faceoff
99
-					if($layout_info && $layout_info->type == 'faceoff')
99
+					if ($layout_info && $layout_info->type == 'faceoff')
100 100
 					{
101 101
 						$oLayoutModel->doActivateFaceOff($layout_info);
102 102
 						Context::set('layout_info', $layout_info);
@@ -105,16 +105,16 @@  discard block
 block discarded – undo
105 105
 					// search if the changes CSS exists in the admin layout edit window
106 106
 					$edited_layout_css = $oLayoutModel->getUserLayoutCss($layout_srl);
107 107
 
108
-					if(FileHandler::exists($edited_layout_css))
108
+					if (FileHandler::exists($edited_layout_css))
109 109
 					{
110 110
 						Context::loadFile(array($edited_layout_css, 'all', '', 100));
111 111
 					}
112 112
 				}
113
-				if(!$layout_path)
113
+				if (!$layout_path)
114 114
 				{
115 115
 					$layout_path = './common/tpl';
116 116
 				}
117
-				if(!$layout_file)
117
+				if (!$layout_file)
118 118
 				{
119 119
 					$layout_file = 'default_layout';
120 120
 				}
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 
123 123
 				// if popup_layout, remove admin bar.
124 124
 				$realLayoutPath = FileHandler::getRealPath($layout_path);
125
-				if(substr_compare($realLayoutPath, '/', -1) !== 0)
125
+				if (substr_compare($realLayoutPath, '/', -1) !== 0)
126 126
 				{
127 127
 					$realLayoutPath .= '/';
128 128
 				}
@@ -130,12 +130,12 @@  discard block
 block discarded – undo
130 130
 				$pathInfo = pathinfo($layout_file);
131 131
 				$onlyLayoutFile = $pathInfo['filename'];
132 132
 
133
-				if(__DEBUG__ == 3)
133
+				if (__DEBUG__ == 3)
134 134
 				{
135 135
 					$GLOBALS['__layout_compile_elapsed__'] = getMicroTime() - $start;
136 136
 				}
137 137
 
138
-				if(stripos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== FALSE && (Context::get('_use_ssl') == 'optional' || Context::get('_use_ssl') == 'always'))
138
+				if (stripos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== FALSE && (Context::get('_use_ssl') == 'optional' || Context::get('_use_ssl') == 'always'))
139 139
 				{
140 140
 					Context::addHtmlFooter('<iframe id="xeTmpIframe" name="xeTmpIframe" style="width:1px;height:1px;position:absolute;top:-2px;left:-2px;"></iframe>');
141 141
 				}
@@ -151,12 +151,12 @@  discard block
 block discarded – undo
151 151
 	 */
152 152
 	function prepareToPrint(&$output)
153 153
 	{
154
-		if(Context::getResponseMethod() != 'HTML')
154
+		if (Context::getResponseMethod() != 'HTML')
155 155
 		{
156 156
 			return;
157 157
 		}
158 158
 
159
-		if(__DEBUG__ == 3)
159
+		if (__DEBUG__ == 3)
160 160
 		{
161 161
 			$start = getMicroTime();
162 162
 		}
@@ -174,20 +174,20 @@  discard block
 block discarded – undo
174 174
 		$output = preg_replace_callback('/<!--(#)?Meta:([a-z0-9\_\-\/\.\@\:]+)-->/is', array($this, '_transMeta'), $output);
175 175
 
176 176
 		// handles a relative path generated by using the rewrite module
177
-		if(Context::isAllowRewrite())
177
+		if (Context::isAllowRewrite())
178 178
 		{
179 179
 			$url = parse_url(Context::getRequestUri());
180 180
 			$real_path = $url['path'];
181 181
 
182 182
 			$pattern = '/src=("|\'){1}(\.\/)?(files\/attach|files\/cache|files\/faceOff|files\/member_extra_info|modules|common|widgets|widgetstyle|layouts|addons)\/([^"\']+)\.(jpg|jpeg|png|gif)("|\'){1}/s';
183
-			$output = preg_replace($pattern, 'src=$1' . $real_path . '$3/$4.$5$6', $output);
183
+			$output = preg_replace($pattern, 'src=$1'.$real_path.'$3/$4.$5$6', $output);
184 184
 
185 185
 			$pattern = '/href=("|\'){1}(\?[^"\']+)/s';
186
-			$output = preg_replace($pattern, 'href=$1' . $real_path . '$2', $output);
186
+			$output = preg_replace($pattern, 'href=$1'.$real_path.'$2', $output);
187 187
 
188
-			if(Context::get('vid'))
188
+			if (Context::get('vid'))
189 189
 			{
190
-				$pattern = '/\/' . Context::get('vid') . '\?([^=]+)=/is';
190
+				$pattern = '/\/'.Context::get('vid').'\?([^=]+)=/is';
191 191
 				$output = preg_replace($pattern, '/?$1=', $output);
192 192
 			}
193 193
 		}
@@ -195,18 +195,18 @@  discard block
 block discarded – undo
195 195
 		// prevent the 2nd request due to url(none) of the background-image
196 196
 		$output = preg_replace('/url\((["\']?)none(["\']?)\)/is', 'none', $output);
197 197
 
198
-		if(is_array(Context::get('INPUT_ERROR')))
198
+		if (is_array(Context::get('INPUT_ERROR')))
199 199
 		{
200 200
 			$INPUT_ERROR = Context::get('INPUT_ERROR');
201 201
 			$keys = array_keys($INPUT_ERROR);
202
-			$keys = '(' . implode('|', $keys) . ')';
202
+			$keys = '('.implode('|', $keys).')';
203 203
 
204
-			$output = preg_replace_callback('@(<input)([^>]*?)\sname="' . $keys . '"([^>]*?)/?>@is', array(&$this, '_preserveValue'), $output);
205
-			$output = preg_replace_callback('@<select[^>]*\sname="' . $keys . '".+</select>@isU', array(&$this, '_preserveSelectValue'), $output);
206
-			$output = preg_replace_callback('@<textarea[^>]*\sname="' . $keys . '".+</textarea>@isU', array(&$this, '_preserveTextAreaValue'), $output);
204
+			$output = preg_replace_callback('@(<input)([^>]*?)\sname="'.$keys.'"([^>]*?)/?>@is', array(&$this, '_preserveValue'), $output);
205
+			$output = preg_replace_callback('@<select[^>]*\sname="'.$keys.'".+</select>@isU', array(&$this, '_preserveSelectValue'), $output);
206
+			$output = preg_replace_callback('@<textarea[^>]*\sname="'.$keys.'".+</textarea>@isU', array(&$this, '_preserveTextAreaValue'), $output);
207 207
 		}
208 208
 
209
-		if(__DEBUG__ == 3)
209
+		if (__DEBUG__ == 3)
210 210
 		{
211 211
 			$GLOBALS['__trans_content_elapsed__'] = getMicroTime() - $start;
212 212
 		}
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 		// convert the final layout
225 225
 		Context::set('content', $output);
226 226
 		$oTemplate = TemplateHandler::getInstance();
227
-		if(Mobile::isFromMobilePhone())
227
+		if (Mobile::isFromMobilePhone())
228 228
 		{
229 229
 			$this->_loadMobileJSCSS();
230 230
 			$output = $oTemplate->compile('./common/tpl', 'mobile_layout');
@@ -249,16 +249,16 @@  discard block
 block discarded – undo
249 249
 	{
250 250
 		$INPUT_ERROR = Context::get('INPUT_ERROR');
251 251
 
252
-		$str = $match[1] . $match[2] . ' name="' . $match[3] . '"' . $match[4];
252
+		$str = $match[1].$match[2].' name="'.$match[3].'"'.$match[4];
253 253
 
254 254
 		// get type
255 255
 		$type = 'text';
256
-		if(preg_match('/\stype="([a-z]+)"/i', $str, $m))
256
+		if (preg_match('/\stype="([a-z]+)"/i', $str, $m))
257 257
 		{
258 258
 			$type = strtolower($m[1]);
259 259
 		}
260 260
 
261
-		switch($type)
261
+		switch ($type)
262 262
 		{
263 263
 			case 'text':
264 264
 			case 'hidden':
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 			case 'number':
277 277
 			case 'range':
278 278
 			case 'color':
279
-				$str = preg_replace('@\svalue="[^"]*?"@', ' ', $str) . ' value="' . htmlspecialchars($INPUT_ERROR[$match[3]], ENT_COMPAT | ENT_HTML401, 'UTF-8', false) . '"';
279
+				$str = preg_replace('@\svalue="[^"]*?"@', ' ', $str).' value="'.htmlspecialchars($INPUT_ERROR[$match[3]], ENT_COMPAT | ENT_HTML401, 'UTF-8', false).'"';
280 280
 				break;
281 281
 			case 'password':
282 282
 				$str = preg_replace('@\svalue="[^"]*?"@', ' ', $str);
@@ -284,14 +284,14 @@  discard block
 block discarded – undo
284 284
 			case 'radio':
285 285
 			case 'checkbox':
286 286
 				$str = preg_replace('@\schecked(="[^"]*?")?@', ' ', $str);
287
-				if(@preg_match('@\s(?i:value)="' . $INPUT_ERROR[$match[3]] . '"@', $str))
287
+				if (@preg_match('@\s(?i:value)="'.$INPUT_ERROR[$match[3]].'"@', $str))
288 288
 				{
289 289
 					$str .= ' checked="checked"';
290 290
 				}
291 291
 				break;
292 292
 		}
293 293
 
294
-		return $str . ' />';
294
+		return $str.' />';
295 295
 	}
296 296
 
297 297
 	/**
@@ -308,14 +308,14 @@  discard block
 block discarded – undo
308 308
 		preg_match_all('@<option[^>]*\svalue="([^"]*)".+</option>@isU', $matches[0], $m);
309 309
 
310 310
 		$key = array_search($INPUT_ERROR[$matches[1]], $m[1]);
311
-		if($key === FALSE)
311
+		if ($key === FALSE)
312 312
 		{
313 313
 			return $matches[0];
314 314
 		}
315 315
 
316 316
 		$m[0][$key] = preg_replace('@(\svalue=".*?")@is', '$1 selected="selected"', $m[0][$key]);
317 317
 
318
-		return $mm[0] . implode('', $m[0]) . '</select>';
318
+		return $mm[0].implode('', $m[0]).'</select>';
319 319
 	}
320 320
 
321 321
 	/**
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
 	{
328 328
 		$INPUT_ERROR = Context::get('INPUT_ERROR');
329 329
 		preg_match('@<textarea.*?>@is', $matches[0], $mm);
330
-		return $mm[0] . $INPUT_ERROR[$matches[1]] . '</textarea>';
330
+		return $mm[0].$INPUT_ERROR[$matches[1]].'</textarea>';
331 331
 	}
332 332
 
333 333
 	/**
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
 	 */
339 339
 	function _moveStyleToHeader($matches)
340 340
 	{
341
-		if(isset($matches[1]) && stristr($matches[1], 'scoped'))
341
+		if (isset($matches[1]) && stristr($matches[1], 'scoped'))
342 342
 		{
343 343
 			return $matches[0];
344 344
 		}
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
 	 */
375 375
 	function _transMeta($matches)
376 376
 	{
377
-		if($matches[1])
377
+		if ($matches[1])
378 378
 		{
379 379
 			return '';
380 380
 		}
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
 		$lang_type = Context::getLangType();
392 392
 
393 393
 		// add common JS/CSS files
394
-		if(__DEBUG__ || !__XE_VERSION_STABLE__)
394
+		if (__DEBUG__ || !__XE_VERSION_STABLE__)
395 395
 		{
396 396
 			$oContext->loadFile(array('./common/js/jquery-1.x.js', 'head', 'lt IE 9', -111000), true);
397 397
 			$oContext->loadFile(array('./common/js/jquery.js', 'head', 'gte IE 9', -110000), true);
@@ -413,9 +413,9 @@  discard block
 block discarded – undo
413 413
 		}
414 414
 
415 415
 		// for admin page, add admin css
416
-		if(Context::get('module') == 'admin' || strpos(Context::get('act'), 'Admin') > 0)
416
+		if (Context::get('module') == 'admin' || strpos(Context::get('act'), 'Admin') > 0)
417 417
 		{
418
-			if(__DEBUG__ || !__XE_VERSION_STABLE__)
418
+			if (__DEBUG__ || !__XE_VERSION_STABLE__)
419 419
 			{
420 420
 				$oContext->loadFile(array('./modules/admin/tpl/css/admin.css', '', '', 10), true);
421 421
 				$oContext->loadFile(array("./modules/admin/tpl/css/admin_{$lang_type}.css", '', '', 10), true);
@@ -447,7 +447,7 @@  discard block
 block discarded – undo
447 447
 		$lang_type = Context::getLangType();
448 448
 
449 449
 		// add common JS/CSS files
450
-		if(__DEBUG__ || !__XE_VERSION_STABLE__)
450
+		if (__DEBUG__ || !__XE_VERSION_STABLE__)
451 451
 		{
452 452
 			$oContext->loadFile(array('./common/js/jquery.js', 'head', '', -110000), true);
453 453
 			$oContext->loadFile(array('./common/js/modernizr.js', 'head', '', -100000), true);
Please login to merge, or discard this patch.
modules/member/member.controller.php 2 patches
Spacing   +444 added lines, -444 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,18 +125,18 @@  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
 
135 135
 		// Get document
136 136
 		$oDocumentModel = getModel('document');
137 137
 		$oDocument = $oDocumentModel->getDocument($document_srl);
138 138
 
139
-		if($oDocument->isSecret() && !$oDocument->isGranted())
139
+		if ($oDocument->isSecret() && !$oDocument->isGranted())
140 140
 		{
141 141
 			return new Object(-1, 'msg_is_secret');
142 142
 		}
@@ -153,11 +153,11 @@  discard block
 block discarded – undo
153 153
 
154 154
 		// Check if already scrapped
155 155
 		$output = executeQuery('member.getScrapDocument', $args);
156
-		if($output->data->count) return new Object(-1, 'msg_alreay_scrapped');
156
+		if ($output->data->count) return new Object(-1, 'msg_alreay_scrapped');
157 157
 
158 158
 		// Insert
159 159
 		$output = executeQuery('member.addScrapDocument', $args);
160
-		if(!$output->toBool()) return $output;
160
+		if (!$output->toBool()) return $output;
161 161
 
162 162
 		$this->setError(-1);
163 163
 		$this->setMessage('success_registed');
@@ -171,11 +171,11 @@  discard block
 block discarded – undo
171 171
 	function procMemberDeleteScrap()
172 172
 	{
173 173
 		// Check login information
174
-		if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
174
+		if (!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
175 175
 		$logged_info = Context::get('logged_info');
176 176
 
177
-		$document_srl = (int)Context::get('document_srl');
178
-		if(!$document_srl) return new Object(-1,'msg_invalid_request');
177
+		$document_srl = (int) Context::get('document_srl');
178
+		if (!$document_srl) return new Object(-1, 'msg_invalid_request');
179 179
 		// Variables
180 180
 		$args = new stdClass;
181 181
 		$args->member_srl = $logged_info->member_srl;
@@ -201,23 +201,23 @@  discard block
 block discarded – undo
201 201
 	function procMemberDeleteSavedDocument()
202 202
 	{
203 203
 		// Check login information
204
-		if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
204
+		if (!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
205 205
 		$logged_info = Context::get('logged_info');
206 206
 
207
-		$document_srl = (int)Context::get('document_srl');
208
-		if(!$document_srl) return new Object(-1,'msg_invalid_request');
207
+		$document_srl = (int) Context::get('document_srl');
208
+		if (!$document_srl) return new Object(-1, 'msg_invalid_request');
209 209
 
210 210
 		$oDocumentModel = getModel('document');
211 211
 		$oDocument = $oDocumentModel->getDocument($document_srl);
212 212
 		if ($oDocument->get('member_srl') != $logged_info->member_srl)
213 213
 		{
214
-			return new Object(-1,'msg_invalid_request');
214
+			return new Object(-1, 'msg_invalid_request');
215 215
 		}
216 216
 
217 217
 		$configStatusList = $oDocumentModel->getStatusList();
218 218
 		if ($oDocument->get('status') != $configStatusList['temp'])
219 219
 		{
220
-			return new Object(-1,'msg_invalid_request');
220
+			return new Object(-1, 'msg_invalid_request');
221 221
 		}
222 222
 
223 223
 		$oDocumentController = getController('document');
@@ -233,37 +233,37 @@  discard block
 block discarded – undo
233 233
 	{
234 234
 		$name = Context::get('name');
235 235
 		$value = Context::get('value');
236
-		if(!$value) return;
236
+		if (!$value) return;
237 237
 
238 238
 		$oMemberModel = getModel('member');
239 239
 		// Check if logged-in
240 240
 		$logged_info = Context::get('logged_info');
241 241
 
242 242
 
243
-		switch($name)
243
+		switch ($name)
244 244
 		{
245 245
 			case 'user_id' :
246 246
 				// Check denied ID
247
-				if($oMemberModel->isDeniedID($value)) return new Object(0,'denied_user_id');
247
+				if ($oMemberModel->isDeniedID($value)) return new Object(0, 'denied_user_id');
248 248
 				// Check if duplicated
249 249
 				$member_srl = $oMemberModel->getMemberSrlByUserID($value);
250
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_user_id');
250
+				if ($member_srl && $logged_info->member_srl != $member_srl) return new Object(0, 'msg_exists_user_id');
251 251
 				break;
252 252
 			case 'nick_name' :
253 253
 				// Check denied ID
254
-				if($oMemberModel->isDeniedNickName($value))
254
+				if ($oMemberModel->isDeniedNickName($value))
255 255
 				{
256
-					return new Object(0,'denied_nick_name');
256
+					return new Object(0, 'denied_nick_name');
257 257
 				}
258 258
 				// Check if duplicated
259 259
 				$member_srl = $oMemberModel->getMemberSrlByNickName($value);
260
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_nick_name');
260
+				if ($member_srl && $logged_info->member_srl != $member_srl) return new Object(0, 'msg_exists_nick_name');
261 261
 
262 262
 				break;
263 263
 			case 'email_address' :
264 264
 				// Check if duplicated
265 265
 				$member_srl = $oMemberModel->getMemberSrlByEmailAddress($value);
266
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_email_address');
266
+				if ($member_srl && $logged_info->member_srl != $member_srl) return new Object(0, 'msg_exists_email_address');
267 267
 				break;
268 268
 		}
269 269
 	}
@@ -275,25 +275,25 @@  discard block
 block discarded – undo
275 275
 	 */
276 276
 	function procMemberInsert()
277 277
 	{
278
-		if (Context::getRequestMethod () == "GET") return new Object (-1, "msg_invalid_request");
279
-		$oMemberModel = &getModel ('member');
278
+		if (Context::getRequestMethod() == "GET") return new Object(-1, "msg_invalid_request");
279
+		$oMemberModel = &getModel('member');
280 280
 		$config = $oMemberModel->getMemberConfig();
281 281
 
282 282
 		// call a trigger (before)
283
-		$trigger_output = ModuleHandler::triggerCall ('member.procMemberInsert', 'before', $config);
284
-		if(!$trigger_output->toBool ()) return $trigger_output;
283
+		$trigger_output = ModuleHandler::triggerCall('member.procMemberInsert', 'before', $config);
284
+		if (!$trigger_output->toBool()) return $trigger_output;
285 285
 		// Check if an administrator allows a membership
286
-		if($config->enable_join != 'Y') return $this->stop ('msg_signup_disabled');
286
+		if ($config->enable_join != 'Y') return $this->stop('msg_signup_disabled');
287 287
 		// Check if the user accept the license terms (only if terms exist)
288
-		if($config->agreement && Context::get('accept_agreement')!='Y') return $this->stop('msg_accept_agreement');
288
+		if ($config->agreement && Context::get('accept_agreement') != 'Y') return $this->stop('msg_accept_agreement');
289 289
 
290 290
 		// Extract the necessary information in advance
291 291
 		$getVars = array();
292
-		if($config->signupForm)
292
+		if ($config->signupForm)
293 293
 		{
294
-			foreach($config->signupForm as $formInfo)
294
+			foreach ($config->signupForm as $formInfo)
295 295
 			{
296
-				if($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
296
+				if ($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
297 297
 				{
298 298
 					$getVars[] = $formInfo->name;
299 299
 				}
@@ -301,22 +301,22 @@  discard block
 block discarded – undo
301 301
 		}
302 302
 
303 303
 		$args = new stdClass;
304
-		foreach($getVars as $val)
304
+		foreach ($getVars as $val)
305 305
 		{
306 306
 			$args->{$val} = Context::get($val);
307
-			if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
307
+			if ($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
308 308
 		}
309 309
 		$args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
310
-		if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
310
+		if (!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
311 311
 
312 312
 		$args->find_account_answer = Context::get('find_account_answer');
313 313
 		$args->allow_mailing = Context::get('allow_mailing');
314 314
 		$args->allow_message = Context::get('allow_message');
315 315
 
316
-		if($args->password1) $args->password = $args->password1;
316
+		if ($args->password1) $args->password = $args->password1;
317 317
 
318 318
 		// check password strength
319
-		if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
319
+		if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
320 320
 		{
321 321
 			$message = Context::getLang('about_password_strength');
322 322
 			return new Object(-1, $message[$config->password_strength]);
@@ -342,58 +342,58 @@  discard block
 block discarded – undo
342 342
 		unset($all_args->secret_text);
343 343
 
344 344
 		// Set the user state as "denied" when using mail authentication
345
-		if($config->enable_confirm == 'Y') $args->denied = 'Y';
345
+		if ($config->enable_confirm == 'Y') $args->denied = 'Y';
346 346
 		// Add extra vars after excluding necessary information from all the requested arguments
347 347
 		$extra_vars = delObjectVars($all_args, $args);
348 348
 		$args->extra_vars = serialize($extra_vars);
349 349
 
350 350
 		// remove whitespace
351 351
 		$checkInfos = array('user_id', 'user_name', 'nick_name', 'email_address');
352
-		foreach($checkInfos as $val)
352
+		foreach ($checkInfos as $val)
353 353
 		{
354
-			if(isset($args->{$val}))
354
+			if (isset($args->{$val}))
355 355
 			{
356 356
 				$args->{$val} = preg_replace('/[\pZ\pC]+/u', '', $args->{$val});
357 357
 			}
358 358
 		}
359 359
 		$output = $this->insertMember($args);
360
-		if(!$output->toBool()) return $output;
360
+		if (!$output->toBool()) return $output;
361 361
 
362 362
 		// insert ProfileImage, ImageName, ImageMark
363 363
 		$profile_image = $_FILES['profile_image'];
364
-		if(is_uploaded_file($profile_image['tmp_name']))
364
+		if (is_uploaded_file($profile_image['tmp_name']))
365 365
 		{
366 366
 			$this->insertProfileImage($args->member_srl, $profile_image['tmp_name']);
367 367
 		}
368 368
 
369 369
 		$image_mark = $_FILES['image_mark'];
370
-		if(is_uploaded_file($image_mark['tmp_name']))
370
+		if (is_uploaded_file($image_mark['tmp_name']))
371 371
 		{
372 372
 			$this->insertImageMark($args->member_srl, $image_mark['tmp_name']);
373 373
 		}
374 374
 
375 375
 		$image_name = $_FILES['image_name'];
376
-		if(is_uploaded_file($image_name['tmp_name']))
376
+		if (is_uploaded_file($image_name['tmp_name']))
377 377
 		{
378 378
 			$this->insertImageName($args->member_srl, $image_name['tmp_name']);
379 379
 		}
380 380
 
381 381
 		// If a virtual site, join the site
382 382
 		$site_module_info = Context::get('site_module_info');
383
-		if($site_module_info->site_srl > 0)
383
+		if ($site_module_info->site_srl > 0)
384 384
 		{
385 385
 			$columnList = array('site_srl', 'group_srl');
386 386
 			$default_group = $oMemberModel->getDefaultGroup($site_module_info->site_srl, $columnList);
387
-			if($default_group->group_srl)
387
+			if ($default_group->group_srl)
388 388
 			{
389 389
 				$this->addMemberToGroup($args->member_srl, $default_group->group_srl, $site_module_info->site_srl);
390 390
 			}
391 391
 
392 392
 		}
393 393
 		// Log-in
394
-		if($config->enable_confirm != 'Y')
394
+		if ($config->enable_confirm != 'Y')
395 395
 		{
396
-			if($config->identifier == 'email_address')
396
+			if ($config->identifier == 'email_address')
397 397
 			{
398 398
 				$output = $this->doLogin($args->email_address);
399 399
 			}
@@ -401,8 +401,8 @@  discard block
 block discarded – undo
401 401
 			{
402 402
 				$output = $this->doLogin($args->user_id);
403 403
 			}
404
-			if(!$output->toBool()) {
405
-				if($output->error == -9)
404
+			if (!$output->toBool()) {
405
+				if ($output->error == -9)
406 406
 					$output->error = -11;
407 407
 				return $this->setRedirectUrl(getUrl('', 'act', 'dispMemberLoginForm'), $output);
408 408
 			}
@@ -410,8 +410,8 @@  discard block
 block discarded – undo
410 410
 
411 411
 		// Results
412 412
 		$this->add('member_srl', $args->member_srl);
413
-		if($config->redirect_url) $this->add('redirect_url', $config->redirect_url);
414
-		if($config->enable_confirm == 'Y')
413
+		if ($config->redirect_url) $this->add('redirect_url', $config->redirect_url);
414
+		if ($config->enable_confirm == 'Y')
415 415
 		{
416 416
 			$msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address);
417 417
 			$this->setMessage($msg);
@@ -420,19 +420,19 @@  discard block
 block discarded – undo
420 420
 		else $this->setMessage('success_registed');
421 421
 		// Call a trigger (after)
422 422
 		$trigger_output = ModuleHandler::triggerCall('member.procMemberInsert', 'after', $config);
423
-		if(!$trigger_output->toBool()) return $trigger_output;
423
+		if (!$trigger_output->toBool()) return $trigger_output;
424 424
 
425
-		if($config->redirect_url)
425
+		if ($config->redirect_url)
426 426
 		{
427 427
 			$returnUrl = $config->redirect_url;
428 428
 		}
429 429
 		else
430 430
 		{
431
-			if(Context::get('success_return_url'))
431
+			if (Context::get('success_return_url'))
432 432
 			{
433 433
 				$returnUrl = Context::get('success_return_url');
434 434
 			}
435
-			else if($_COOKIE['XE_REDIRECT_URL'])
435
+			else if ($_COOKIE['XE_REDIRECT_URL'])
436 436
 			{
437 437
 				$returnUrl = $_COOKIE['XE_REDIRECT_URL'];
438 438
 				setcookie("XE_REDIRECT_URL", '', 1);
@@ -446,26 +446,26 @@  discard block
 block discarded – undo
446 446
 
447 447
 	function procMemberModifyInfoBefore()
448 448
 	{
449
-		if($_SESSION['rechecked_password_step'] != 'INPUT_PASSWORD')
449
+		if ($_SESSION['rechecked_password_step'] != 'INPUT_PASSWORD')
450 450
 		{
451 451
 			return $this->stop('msg_invalid_request');
452 452
 		}
453 453
 
454
-		if(!Context::get('is_logged'))
454
+		if (!Context::get('is_logged'))
455 455
 		{
456 456
 			return $this->stop('msg_not_logged');
457 457
 		}
458 458
 
459 459
 		$password = Context::get('password');
460 460
 
461
-		if(!$password)
461
+		if (!$password)
462 462
 		{
463 463
 			return $this->stop('msg_invalid_request');
464 464
 		}
465 465
 
466 466
 		$oMemberModel = getModel('member');
467 467
 
468
-		if(!$this->memberInfo->password)
468
+		if (!$this->memberInfo->password)
469 469
 		{
470 470
 			// Get information of logged-in user
471 471
 			$logged_info = Context::get('logged_info');
@@ -476,14 +476,14 @@  discard block
 block discarded – undo
476 476
 			$this->memberInfo->password = $memberInfo->password;
477 477
 		}
478 478
 		// Verify the current password
479
-		if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password))
479
+		if (!$oMemberModel->isValidPassword($this->memberInfo->password, $password))
480 480
 		{
481 481
 			return new Object(-1, 'invalid_password');
482 482
 		}
483 483
 
484 484
 		$_SESSION['rechecked_password_step'] = 'VALIDATE_PASSWORD';
485 485
 
486
-		if(Context::get('success_return_url'))
486
+		if (Context::get('success_return_url'))
487 487
 		{
488 488
 			$redirectUrl = Context::get('success_return_url');
489 489
 		}
@@ -501,12 +501,12 @@  discard block
 block discarded – undo
501 501
 	 */
502 502
 	function procMemberModifyInfo()
503 503
 	{
504
-		if(!Context::get('is_logged'))
504
+		if (!Context::get('is_logged'))
505 505
 		{
506 506
 			return $this->stop('msg_not_logged');
507 507
 		}
508 508
 
509
-		if($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
509
+		if ($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
510 510
 		{
511 511
 			return $this->stop('msg_invalid_request');
512 512
 		}
@@ -514,13 +514,13 @@  discard block
 block discarded – undo
514 514
 
515 515
 		// Extract the necessary information in advance
516 516
 		$oMemberModel = getModel('member');
517
-		$config = $oMemberModel->getMemberConfig ();
518
-		$getVars = array('find_account_answer','allow_mailing','allow_message');
519
-		if($config->signupForm)
517
+		$config = $oMemberModel->getMemberConfig();
518
+		$getVars = array('find_account_answer', 'allow_mailing', 'allow_message');
519
+		if ($config->signupForm)
520 520
 		{
521
-			foreach($config->signupForm as $formInfo)
521
+			foreach ($config->signupForm as $formInfo)
522 522
 			{
523
-				if($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
523
+				if ($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
524 524
 				{
525 525
 					$getVars[] = $formInfo->name;
526 526
 				}
@@ -528,16 +528,16 @@  discard block
 block discarded – undo
528 528
 		}
529 529
 
530 530
 		$args = new stdClass;
531
-		foreach($getVars as $val)
531
+		foreach ($getVars as $val)
532 532
 		{
533 533
 			$args->{$val} = Context::get($val);
534
-			if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
534
+			if ($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
535 535
 		}
536 536
 		// Login Information
537 537
 		$logged_info = Context::get('logged_info');
538 538
 		$args->member_srl = $logged_info->member_srl;
539 539
 		$args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
540
-		if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
540
+		if (!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
541 541
 		// Remove some unnecessary variables from all the vars
542 542
 		$all_args = Context::getRequestVars();
543 543
 		unset($all_args->module);
@@ -561,9 +561,9 @@  discard block
 block discarded – undo
561 561
 
562 562
 		// remove whitespace
563 563
 		$checkInfos = array('user_id', 'user_name', 'nick_name', 'email_address');
564
-		foreach($checkInfos as $val)
564
+		foreach ($checkInfos as $val)
565 565
 		{
566
-			if(isset($args->{$val}))
566
+			if (isset($args->{$val}))
567 567
 			{
568 568
 				$args->{$val} = preg_replace('/[\pZ\pC]+/u', '', $args->{$val});
569 569
 			}
@@ -571,22 +571,22 @@  discard block
 block discarded – undo
571 571
 
572 572
 		// Execute insert or update depending on the value of member_srl
573 573
 		$output = $this->updateMember($args);
574
-		if(!$output->toBool()) return $output;
574
+		if (!$output->toBool()) return $output;
575 575
 
576 576
 		$profile_image = $_FILES['profile_image'];
577
-		if(is_uploaded_file($profile_image['tmp_name']))
577
+		if (is_uploaded_file($profile_image['tmp_name']))
578 578
 		{
579 579
 			$this->insertProfileImage($args->member_srl, $profile_image['tmp_name']);
580 580
 		}
581 581
 
582 582
 		$image_mark = $_FILES['image_mark'];
583
-		if(is_uploaded_file($image_mark['tmp_name']))
583
+		if (is_uploaded_file($image_mark['tmp_name']))
584 584
 		{
585 585
 			$this->insertImageMark($args->member_srl, $image_mark['tmp_name']);
586 586
 		}
587 587
 
588 588
 		$image_name = $_FILES['image_name'];
589
-		if(is_uploaded_file($image_name['tmp_name']))
589
+		if (is_uploaded_file($image_name['tmp_name']))
590 590
 		{
591 591
 			$this->insertImageName($args->member_srl, $image_name['tmp_name']);
592 592
 		}
@@ -601,7 +601,7 @@  discard block
 block discarded – undo
601 601
 
602 602
 		// Call a trigger after successfully log-in (after)
603 603
 		$trigger_output = ModuleHandler::triggerCall('member.procMemberModifyInfo', 'after', $this->memberInfo);
604
-		if(!$trigger_output->toBool()) return $trigger_output;
604
+		if (!$trigger_output->toBool()) return $trigger_output;
605 605
 
606 606
 		$this->setSessionInfo();
607 607
 		// Return result
@@ -622,7 +622,7 @@  discard block
 block discarded – undo
622 622
 	 */
623 623
 	function procMemberModifyPassword()
624 624
 	{
625
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
625
+		if (!Context::get('is_logged')) return $this->stop('msg_not_logged');
626 626
 		// Extract the necessary information in advance
627 627
 		$current_password = trim(Context::get('current_password'));
628 628
 		$password = trim(Context::get('password1'));
@@ -636,17 +636,17 @@  discard block
 block discarded – undo
636 636
 
637 637
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
638 638
 		// Verify the cuttent password
639
-		if(!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) return new Object(-1, 'invalid_password');
639
+		if (!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) return new Object(-1, 'invalid_password');
640 640
 
641 641
 		// Check if a new password is as same as the previous password
642
-		if($current_password == $password) return new Object(-1, 'invalid_new_password');
642
+		if ($current_password == $password) return new Object(-1, 'invalid_new_password');
643 643
 
644 644
 		// Execute insert or update depending on the value of member_srl
645 645
 		$args = new stdClass;
646 646
 		$args->member_srl = $member_srl;
647 647
 		$args->password = $password;
648 648
 		$output = $this->updateMemberPassword($args);
649
-		if(!$output->toBool()) return $output;
649
+		if (!$output->toBool()) return $output;
650 650
 
651 651
 		$this->add('member_srl', $args->member_srl);
652 652
 		$this->setMessage('success_updated');
@@ -662,7 +662,7 @@  discard block
 block discarded – undo
662 662
 	 */
663 663
 	function procMemberLeave()
664 664
 	{
665
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
665
+		if (!Context::get('is_logged')) return $this->stop('msg_not_logged');
666 666
 		// Extract the necessary information in advance
667 667
 		$password = trim(Context::get('password'));
668 668
 		// Get information of logged-in user
@@ -671,17 +671,17 @@  discard block
 block discarded – undo
671 671
 		// Create a member model object
672 672
 		$oMemberModel = getModel('member');
673 673
 		// Get information of member_srl
674
-		if(!$this->memberInfo->password)
674
+		if (!$this->memberInfo->password)
675 675
 		{
676 676
 			$columnList = array('member_srl', 'password');
677 677
 			$memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
678 678
 			$this->memberInfo->password = $memberInfo->password;
679 679
 		}
680 680
 		// Verify the cuttent password
681
-		if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) return new Object(-1, 'invalid_password');
681
+		if (!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) return new Object(-1, 'invalid_password');
682 682
 
683 683
 		$output = $this->deleteMember($member_srl);
684
-		if(!$output->toBool()) return $output;
684
+		if (!$output->toBool()) return $output;
685 685
 		// Destroy all session information
686 686
 		$this->destroySessionInfo();
687 687
 		// Return success message
@@ -700,17 +700,17 @@  discard block
 block discarded – undo
700 700
 	{
701 701
 		// Check if the file is successfully uploaded
702 702
 		$file = $_FILES['profile_image'];
703
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_profile_image');
703
+		if (!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_profile_image');
704 704
 		// Ignore if member_srl is invalid or doesn't exist.
705 705
 		$member_srl = Context::get('member_srl');
706
-		if(!$member_srl) return $this->stop('msg_not_uploaded_profile_image');
706
+		if (!$member_srl) return $this->stop('msg_not_uploaded_profile_image');
707 707
 
708 708
 		$logged_info = Context::get('logged_info');
709
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_profile_image');
709
+		if ($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_profile_image');
710 710
 		// Return if member module is set not to use an image name or the user is not an administrator ;
711 711
 		$oModuleModel = getModel('module');
712 712
 		$config = $oModuleModel->getModuleConfig('member');
713
-		if($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') return $this->stop('msg_not_uploaded_profile_image');
713
+		if ($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') return $this->stop('msg_not_uploaded_profile_image');
714 714
 
715 715
 		$this->insertProfileImage($member_srl, $file['tmp_name']);
716 716
 		// Page refresh
@@ -732,25 +732,25 @@  discard block
 block discarded – undo
732 732
 	{
733 733
 
734 734
 		// Check uploaded file
735
-		if(!checkUploadedFile($target_file)) return;
735
+		if (!checkUploadedFile($target_file)) return;
736 736
 
737 737
 		$oMemberModel = getModel('member');
738 738
 		$config = $oMemberModel->getMemberConfig();
739 739
 
740 740
 		// Get an image size
741 741
 		$max_width = $config->profile_image_max_width;
742
-		if(!$max_width) $max_width = "90";
742
+		if (!$max_width) $max_width = "90";
743 743
 		$max_height = $config->profile_image_max_height;
744
-		if(!$max_height) $max_height = "90";
744
+		if (!$max_height) $max_height = "90";
745 745
 		// Get a target path to save
746 746
 		$target_path = sprintf('files/member_extra_info/profile_image/%s', getNumberingPath($member_srl));
747 747
 		FileHandler::makeDir($target_path);
748 748
 
749 749
 		// Get file information
750 750
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
751
-		if(IMAGETYPE_PNG == $type) $ext = 'png';
752
-		elseif(IMAGETYPE_JPEG == $type) $ext = 'jpg';
753
-		elseif(IMAGETYPE_GIF == $type) $ext = 'gif';
751
+		if (IMAGETYPE_PNG == $type) $ext = 'png';
752
+		elseif (IMAGETYPE_JPEG == $type) $ext = 'jpg';
753
+		elseif (IMAGETYPE_GIF == $type) $ext = 'gif';
754 754
 		else
755 755
 		{
756 756
 			return;
@@ -760,7 +760,7 @@  discard block
 block discarded – undo
760 760
 
761 761
 		$target_filename = sprintf('%s%d.%s', $target_path, $member_srl, $ext);
762 762
 		// Convert if the image size is larger than a given size or if the format is not a gif
763
-		if(($width > $max_width || $height > $max_height ) && $type != 1)
763
+		if (($width > $max_width || $height > $max_height) && $type != 1)
764 764
 		{
765 765
 			FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, $ext);
766 766
 		}
@@ -779,17 +779,17 @@  discard block
 block discarded – undo
779 779
 	{
780 780
 		// Check if the file is successfully uploaded
781 781
 		$file = $_FILES['image_name'];
782
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name');
782
+		if (!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name');
783 783
 		// Ignore if member_srl is invalid or doesn't exist.
784 784
 		$member_srl = Context::get('member_srl');
785
-		if(!$member_srl) return $this->stop('msg_not_uploaded_image_name');
785
+		if (!$member_srl) return $this->stop('msg_not_uploaded_image_name');
786 786
 
787 787
 		$logged_info = Context::get('logged_info');
788
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name');
788
+		if ($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name');
789 789
 		// Return if member module is set not to use an image name or the user is not an administrator ;
790 790
 		$oModuleModel = getModel('module');
791 791
 		$config = $oModuleModel->getModuleConfig('member');
792
-		if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name');
792
+		if ($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name');
793 793
 
794 794
 		$this->insertImageName($member_srl, $file['tmp_name']);
795 795
 		// Page refresh
@@ -810,15 +810,15 @@  discard block
 block discarded – undo
810 810
 	function insertImageName($member_srl, $target_file)
811 811
 	{
812 812
 		// Check uploaded file
813
-		if(!checkUploadedFile($target_file)) return;
813
+		if (!checkUploadedFile($target_file)) return;
814 814
 
815 815
 		$oModuleModel = getModel('module');
816 816
 		$config = $oModuleModel->getModuleConfig('member');
817 817
 		// Get an image size
818 818
 		$max_width = $config->image_name_max_width;
819
-		if(!$max_width) $max_width = "90";
819
+		if (!$max_width) $max_width = "90";
820 820
 		$max_height = $config->image_name_max_height;
821
-		if(!$max_height) $max_height = "20";
821
+		if (!$max_height) $max_height = "20";
822 822
 		// Get a target path to save
823 823
 		$target_path = sprintf('files/member_extra_info/image_name/%s/', getNumberingPath($member_srl));
824 824
 		FileHandler::makeDir($target_path);
@@ -827,7 +827,7 @@  discard block
 block discarded – undo
827 827
 		// Get file information
828 828
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
829 829
 		// Convert if the image size is larger than a given size or if the format is not a gif
830
-		if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
830
+		if ($width > $max_width || $height > $max_height || $type != 1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
831 831
 		else @copy($target_file, $target_filename);
832 832
 	}
833 833
 
@@ -839,20 +839,20 @@  discard block
 block discarded – undo
839 839
 	function procMemberDeleteProfileImage($_memberSrl = 0)
840 840
 	{
841 841
 		$member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl');
842
-		if(!$member_srl)
842
+		if (!$member_srl)
843 843
 		{
844
-			return new Object(0,'success');
844
+			return new Object(0, 'success');
845 845
 		}
846 846
 
847 847
 		$logged_info = Context::get('logged_info');
848 848
 
849
-		if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
849
+		if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
850 850
 		{
851 851
 			$oMemberModel = getModel('member');
852 852
 			$profile_image = $oMemberModel->getProfileImage($member_srl);
853 853
 			FileHandler::removeFile($profile_image->file);
854 854
 		}
855
-		return new Object(0,'success');
855
+		return new Object(0, 'success');
856 856
 	}
857 857
 
858 858
 	/**
@@ -863,20 +863,20 @@  discard block
 block discarded – undo
863 863
 	function procMemberDeleteImageName($_memberSrl = 0)
864 864
 	{
865 865
 		$member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl');
866
-		if(!$member_srl)
866
+		if (!$member_srl)
867 867
 		{
868
-			return new Object(0,'success');
868
+			return new Object(0, 'success');
869 869
 		}
870 870
 
871 871
 		$logged_info = Context::get('logged_info');
872 872
 
873
-		if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
873
+		if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
874 874
 		{
875 875
 			$oMemberModel = getModel('member');
876 876
 			$image_name = $oMemberModel->getImageName($member_srl);
877 877
 			FileHandler::removeFile($image_name->file);
878 878
 		}
879
-		return new Object(0,'success');
879
+		return new Object(0, 'success');
880 880
 	}
881 881
 
882 882
 	/**
@@ -888,17 +888,17 @@  discard block
 block discarded – undo
888 888
 	{
889 889
 		// Check if the file is successfully uploaded
890 890
 		$file = $_FILES['image_mark'];
891
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark');
891
+		if (!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark');
892 892
 		// Ignore if member_srl is invalid or doesn't exist.
893 893
 		$member_srl = Context::get('member_srl');
894
-		if(!$member_srl) return $this->stop('msg_not_uploaded_image_mark');
894
+		if (!$member_srl) return $this->stop('msg_not_uploaded_image_mark');
895 895
 
896 896
 		$logged_info = Context::get('logged_info');
897
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark');
897
+		if ($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark');
898 898
 		// Membership in the images mark the module using the ban was set by an administrator or return;
899 899
 		$oModuleModel = getModel('module');
900 900
 		$config = $oModuleModel->getModuleConfig('member');
901
-		if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark');
901
+		if ($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark');
902 902
 
903 903
 		$this->insertImageMark($member_srl, $file['tmp_name']);
904 904
 		// Page refresh
@@ -919,15 +919,15 @@  discard block
 block discarded – undo
919 919
 	function insertImageMark($member_srl, $target_file)
920 920
 	{
921 921
 		// Check uploaded file
922
-		if(!checkUploadedFile($target_file)) return;
922
+		if (!checkUploadedFile($target_file)) return;
923 923
 
924 924
 		$oModuleModel = getModel('module');
925 925
 		$config = $oModuleModel->getModuleConfig('member');
926 926
 		// Get an image size
927 927
 		$max_width = $config->image_mark_max_width;
928
-		if(!$max_width) $max_width = "20";
928
+		if (!$max_width) $max_width = "20";
929 929
 		$max_height = $config->image_mark_max_height;
930
-		if(!$max_height) $max_height = "20";
930
+		if (!$max_height) $max_height = "20";
931 931
 
932 932
 		$target_path = sprintf('files/member_extra_info/image_mark/%s/', getNumberingPath($member_srl));
933 933
 		FileHandler::makeDir($target_path);
@@ -936,7 +936,7 @@  discard block
 block discarded – undo
936 936
 		// Get file information
937 937
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
938 938
 
939
-		if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
939
+		if ($width > $max_width || $height > $max_height || $type != 1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
940 940
 		else @copy($target_file, $target_filename);
941 941
 	}
942 942
 
@@ -948,20 +948,20 @@  discard block
 block discarded – undo
948 948
 	function procMemberDeleteImageMark($_memberSrl = 0)
949 949
 	{
950 950
 		$member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl');
951
-		if(!$member_srl)
951
+		if (!$member_srl)
952 952
 		{
953
-			return new Object(0,'success');
953
+			return new Object(0, 'success');
954 954
 		}
955 955
 
956 956
 		$logged_info = Context::get('logged_info');
957 957
 
958
-		if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
958
+		if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
959 959
 		{
960 960
 			$oMemberModel = getModel('member');
961 961
 			$image_mark = $oMemberModel->getImageMark($member_srl);
962 962
 			FileHandler::removeFile($image_mark->file);
963 963
 		}
964
-		return new Object(0,'success');
964
+		return new Object(0, 'success');
965 965
 	}
966 966
 
967 967
 	/**
@@ -972,26 +972,26 @@  discard block
 block discarded – undo
972 972
 	function procMemberFindAccount()
973 973
 	{
974 974
 		$email_address = Context::get('email_address');
975
-		if(!$email_address) return new Object(-1, 'msg_invalid_request');
975
+		if (!$email_address) return new Object(-1, 'msg_invalid_request');
976 976
 
977 977
 		$oMemberModel = getModel('member');
978 978
 		$oModuleModel = getModel('module');
979 979
 
980 980
 		// Check if a member having the same email address exists
981 981
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
982
-		if(!$member_srl) return new Object(-1, 'msg_email_not_exists');
982
+		if (!$member_srl) return new Object(-1, 'msg_email_not_exists');
983 983
 
984 984
 		// Get information of the member
985 985
 		$columnList = array('denied', 'member_srl', 'user_id', 'user_name', 'email_address', 'nick_name');
986 986
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
987 987
 
988 988
 		// Check if possible to find member's ID and password
989
-		if($member_info->denied == 'Y')
989
+		if ($member_info->denied == 'Y')
990 990
 		{
991 991
 			$chk_args = new stdClass;
992 992
 			$chk_args->member_srl = $member_info->member_srl;
993 993
 			$output = executeQuery('member.chkAuthMail', $chk_args);
994
-			if($output->toBool() && $output->data->count != '0') return new Object(-1, 'msg_user_not_confirmed');
994
+			if ($output->toBool() && $output->data->count != '0') return new Object(-1, 'msg_user_not_confirmed');
995 995
 		}
996 996
 
997 997
 		// Insert data into the authentication DB
@@ -1004,19 +1004,19 @@  discard block
 block discarded – undo
1004 1004
 		$args->is_register = 'N';
1005 1005
 
1006 1006
 		$output = executeQuery('member.insertAuthMail', $args);
1007
-		if(!$output->toBool()) return $output;
1007
+		if (!$output->toBool()) return $output;
1008 1008
 		// Get content of the email to send a member
1009 1009
 		Context::set('auth_args', $args);
1010 1010
 
1011 1011
 		$member_config = $oModuleModel->getModuleConfig('member');
1012 1012
 		$memberInfo = array();
1013 1013
 		global $lang;
1014
-		if(is_array($member_config->signupForm))
1014
+		if (is_array($member_config->signupForm))
1015 1015
 		{
1016
-			$exceptForm=array('password', 'find_account_question');
1017
-			foreach($member_config->signupForm as $form)
1016
+			$exceptForm = array('password', 'find_account_question');
1017
+			foreach ($member_config->signupForm as $form)
1018 1018
 			{
1019
-				if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1019
+				if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1020 1020
 				{
1021 1021
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1022 1022
 				}
@@ -1031,15 +1031,15 @@  discard block
 block discarded – undo
1031 1031
 		}
1032 1032
 		Context::set('memberInfo', $memberInfo);
1033 1033
 
1034
-		if(!$member_config->skin) $member_config->skin = "default";
1035
-		if(!$member_config->colorset) $member_config->colorset = "white";
1034
+		if (!$member_config->skin) $member_config->skin = "default";
1035
+		if (!$member_config->colorset) $member_config->colorset = "white";
1036 1036
 
1037 1037
 		Context::set('member_config', $member_config);
1038 1038
 
1039 1039
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1040
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1040
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1041 1041
 
1042
-		$find_url = getFullUrl ('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key);
1042
+		$find_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key);
1043 1043
 		Context::set('find_url', $find_url);
1044 1044
 
1045 1045
 		$oTemplate = &TemplateHandler::getInstance();
@@ -1049,19 +1049,19 @@  discard block
 block discarded – undo
1049 1049
 		$member_config = $oModuleModel->getModuleConfig('member');
1050 1050
 		// Send a mail
1051 1051
 		$oMail = new Mail();
1052
-		$oMail->setTitle( Context::getLang('msg_find_account_title') );
1052
+		$oMail->setTitle(Context::getLang('msg_find_account_title'));
1053 1053
 		$oMail->setContent($content);
1054
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
1055
-		$oMail->setReceiptor( $member_info->user_name, $member_info->email_address );
1054
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
1055
+		$oMail->setReceiptor($member_info->user_name, $member_info->email_address);
1056 1056
 		$oMail->send();
1057 1057
 		// Return message
1058 1058
 		$msg = sprintf(Context::getLang('msg_auth_mail_sent'), $member_info->email_address);
1059
-		if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON')))
1059
+		if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON')))
1060 1060
 		{
1061 1061
 			$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberFindAccount');
1062 1062
 			$this->setRedirectUrl($returnUrl);
1063 1063
 		}
1064
-		return new Object(0,$msg);
1064
+		return new Object(0, $msg);
1065 1065
 	}
1066 1066
 
1067 1067
 	/**
@@ -1079,28 +1079,28 @@  discard block
 block discarded – undo
1079 1079
 		$find_account_question = trim(Context::get('find_account_question'));
1080 1080
 		$find_account_answer = trim(Context::get('find_account_answer'));
1081 1081
 
1082
-		if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new Object(-1, 'msg_invalid_request');
1082
+		if (($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new Object(-1, 'msg_invalid_request');
1083 1083
 
1084 1084
 		$oModuleModel = getModel('module');
1085 1085
 		// Check if a member having the same email address exists
1086 1086
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1087
-		if(!$member_srl) return new Object(-1, 'msg_email_not_exists');
1087
+		if (!$member_srl) return new Object(-1, 'msg_email_not_exists');
1088 1088
 		// Get information of the member
1089 1089
 		$columnList = array('member_srl', 'find_account_question', 'find_account_answer');
1090 1090
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
1091 1091
 
1092 1092
 		// Display a message if no answer is entered
1093
-		if(!$member_info->find_account_question || !$member_info->find_account_answer) return new Object(-1, 'msg_question_not_exists');
1093
+		if (!$member_info->find_account_question || !$member_info->find_account_answer) return new Object(-1, 'msg_question_not_exists');
1094 1094
 
1095
-		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');
1095
+		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');
1096 1096
 
1097
-		if($config->identifier == 'email_address')
1097
+		if ($config->identifier == 'email_address')
1098 1098
 		{
1099 1099
 			$user_id = $email_address;
1100 1100
 		}
1101 1101
 
1102 1102
 		// Update to a temporary password and set change_password_date to 1
1103
-		$oPassword =  new Password();
1103
+		$oPassword = new Password();
1104 1104
 		$temp_password = $oPassword->createTemporaryPassword(8);
1105 1105
 
1106 1106
 		$args = new stdClass();
@@ -1108,11 +1108,11 @@  discard block
 block discarded – undo
1108 1108
 		$args->password = $temp_password;
1109 1109
 		$args->change_password_date = '1';
1110 1110
 		$output = $this->updateMemberPassword($args);
1111
-		if(!$output->toBool()) return $output;
1111
+		if (!$output->toBool()) return $output;
1112 1112
 
1113
-		$_SESSION['xe_temp_password_' . $user_id] = $temp_password;
1113
+		$_SESSION['xe_temp_password_'.$user_id] = $temp_password;
1114 1114
 
1115
-		$this->add('user_id',$user_id);
1115
+		$this->add('user_id', $user_id);
1116 1116
 
1117 1117
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', '');
1118 1118
 		$this->setRedirectUrl($returnUrl.'&user_id='.$user_id);
@@ -1132,7 +1132,7 @@  discard block
 block discarded – undo
1132 1132
 		$member_srl = Context::get('member_srl');
1133 1133
 		$auth_key = Context::get('auth_key');
1134 1134
 
1135
-		if(!$member_srl || !$auth_key)
1135
+		if (!$member_srl || !$auth_key)
1136 1136
 		{
1137 1137
 			return $this->stop('msg_invalid_request');
1138 1138
 		}
@@ -1143,9 +1143,9 @@  discard block
 block discarded – undo
1143 1143
 		$args->auth_key = $auth_key;
1144 1144
 		$output = executeQuery('member.getAuthMail', $args);
1145 1145
 
1146
-		if(!$output->toBool() || $output->data->auth_key != $auth_key)
1146
+		if (!$output->toBool() || $output->data->auth_key != $auth_key)
1147 1147
 		{
1148
-			if(strlen($output->data->auth_key) !== strlen($auth_key))
1148
+			if (strlen($output->data->auth_key) !== strlen($auth_key))
1149 1149
 			{
1150 1150
 				executeQuery('member.deleteAuthMail', $args);
1151 1151
 			}
@@ -1153,7 +1153,7 @@  discard block
 block discarded – undo
1153 1153
 			return $this->stop('msg_invalid_auth_key');
1154 1154
 		}
1155 1155
 
1156
-		if(ztime($output->data->regdate) < $_SERVER['REQUEST_TIME'] + zgap() - 86400)
1156
+		if (ztime($output->data->regdate) < $_SERVER['REQUEST_TIME'] + zgap() - 86400)
1157 1157
 		{
1158 1158
 			executeQuery('member.deleteAuthMail', $args);
1159 1159
 			return $this->stop('msg_invalid_auth_key');
@@ -1162,7 +1162,7 @@  discard block
 block discarded – undo
1162 1162
 		$args->password = $output->data->new_password;
1163 1163
 
1164 1164
 		// If credentials are correct, change the password to a new one
1165
-		if($output->data->is_register == 'Y')
1165
+		if ($output->data->is_register == 'Y')
1166 1166
 		{
1167 1167
 			$args->denied = 'N';
1168 1168
 		}
@@ -1175,13 +1175,13 @@  discard block
 block discarded – undo
1175 1175
 		$is_register = $output->data->is_register;
1176 1176
 
1177 1177
 		$output = executeQuery('member.updateMemberPassword', $args);
1178
-		if(!$output->toBool())
1178
+		if (!$output->toBool())
1179 1179
 		{
1180 1180
 			return $this->stop($output->getMessage());
1181 1181
 		}
1182 1182
 
1183 1183
 		// Remove all values having the member_srl from authentication table
1184
-		executeQuery('member.deleteAuthMail',$args);
1184
+		executeQuery('member.deleteAuthMail', $args);
1185 1185
 
1186 1186
 		$this->_clearMemberCache($args->member_srl);
1187 1187
 
@@ -1200,33 +1200,33 @@  discard block
 block discarded – undo
1200 1200
 	{
1201 1201
 		// Get an email_address
1202 1202
 		$email_address = Context::get('email_address');
1203
-		if(!$email_address) return new Object(-1, 'msg_invalid_request');
1203
+		if (!$email_address) return new Object(-1, 'msg_invalid_request');
1204 1204
 		// Log test by using email_address
1205 1205
 		$oMemberModel = getModel('member');
1206 1206
 
1207 1207
 		$args = new stdClass;
1208 1208
 		$args->email_address = $email_address;
1209 1209
 		$memberSrl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1210
-		if(!$memberSrl) return new Object(-1, 'msg_not_exists_member');
1210
+		if (!$memberSrl) return new Object(-1, 'msg_not_exists_member');
1211 1211
 
1212 1212
 		$columnList = array('member_srl', 'user_id', 'user_name', 'nick_name', 'email_address');
1213 1213
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($memberSrl, 0, $columnList);
1214 1214
 
1215 1215
 		$oModuleModel = getModel('module');
1216 1216
 		$member_config = $oModuleModel->getModuleConfig('member');
1217
-		if(!$member_config->skin) $member_config->skin = "default";
1218
-		if(!$member_config->colorset) $member_config->colorset = "white";
1217
+		if (!$member_config->skin) $member_config->skin = "default";
1218
+		if (!$member_config->colorset) $member_config->colorset = "white";
1219 1219
 
1220 1220
 		// Check if a authentication mail has been sent previously
1221 1221
 		$chk_args = new stdClass;
1222 1222
 		$chk_args->member_srl = $member_info->member_srl;
1223 1223
 		$output = executeQuery('member.chkAuthMail', $chk_args);
1224
-		if($output->toBool() && $output->data->count == '0') return new Object(-1, 'msg_invalid_request');
1224
+		if ($output->toBool() && $output->data->count == '0') return new Object(-1, 'msg_invalid_request');
1225 1225
 
1226 1226
 		$auth_args = new stdClass;
1227 1227
 		$auth_args->member_srl = $member_info->member_srl;
1228 1228
 		$output = executeQueryArray('member.getAuthMailInfo', $auth_args);
1229
-		if(!$output->data || !$output->data[0]->auth_key)  return new Object(-1, 'msg_invalid_request');
1229
+		if (!$output->data || !$output->data[0]->auth_key)  return new Object(-1, 'msg_invalid_request');
1230 1230
 		$auth_info = $output->data[0];
1231 1231
 
1232 1232
 		// Update the regdate of authmail entry
@@ -1237,12 +1237,12 @@  discard block
 block discarded – undo
1237 1237
 
1238 1238
 		$memberInfo = array();
1239 1239
 		global $lang;
1240
-		if(is_array($member_config->signupForm))
1240
+		if (is_array($member_config->signupForm))
1241 1241
 		{
1242
-			$exceptForm=array('password', 'find_account_question');
1243
-			foreach($member_config->signupForm as $form)
1242
+			$exceptForm = array('password', 'find_account_question');
1243
+			foreach ($member_config->signupForm as $form)
1244 1244
 			{
1245
-				if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1245
+				if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1246 1246
 				{
1247 1247
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1248 1248
 				}
@@ -1261,19 +1261,19 @@  discard block
 block discarded – undo
1261 1261
 		Context::set('member_config', $member_config);
1262 1262
 
1263 1263
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1264
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1264
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1265 1265
 
1266
-		$auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_info->auth_key);
1266
+		$auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $auth_info->auth_key);
1267 1267
 		Context::set('auth_url', $auth_url);
1268 1268
 
1269 1269
 		$oTemplate = &TemplateHandler::getInstance();
1270 1270
 		$content = $oTemplate->compile($tpl_path, 'confirm_member_account_mail');
1271 1271
 		// Send a mail
1272 1272
 		$oMail = new Mail();
1273
-		$oMail->setTitle( Context::getLang('msg_confirm_account_title') );
1273
+		$oMail->setTitle(Context::getLang('msg_confirm_account_title'));
1274 1274
 		$oMail->setContent($content);
1275
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
1276
-		$oMail->setReceiptor( $args->user_name, $args->email_address );
1275
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
1276
+		$oMail->setReceiptor($args->user_name, $args->email_address);
1277 1277
 		$oMail->send();
1278 1278
 
1279 1279
 		$msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address);
@@ -1288,23 +1288,23 @@  discard block
 block discarded – undo
1288 1288
 		$memberInfo = $_SESSION['auth_member_info'];
1289 1289
 		unset($_SESSION['auth_member_info']);
1290 1290
 
1291
-		if(!$memberInfo)
1291
+		if (!$memberInfo)
1292 1292
 		{
1293 1293
 			return $this->stop('msg_invalid_request');
1294 1294
 		}
1295 1295
 
1296 1296
 		$newEmail = Context::get('email_address');
1297 1297
 
1298
-		if(!$newEmail)
1298
+		if (!$newEmail)
1299 1299
 		{
1300 1300
 			return $this->stop('msg_invalid_request');
1301 1301
 		}
1302 1302
 
1303 1303
 		$oMemberModel = getModel('member');
1304 1304
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail);
1305
-		if($member_srl)
1305
+		if ($member_srl)
1306 1306
 		{
1307
-			return new Object(-1,'msg_exists_email_address');
1307
+			return new Object(-1, 'msg_exists_email_address');
1308 1308
 		}
1309 1309
 
1310 1310
 		// remove all key by member_srl
@@ -1312,7 +1312,7 @@  discard block
 block discarded – undo
1312 1312
 		$args->member_srl = $memberInfo->member_srl;
1313 1313
 		$output = executeQuery('member.deleteAuthMail', $args);
1314 1314
 
1315
-		if(!$output->toBool())
1315
+		if (!$output->toBool())
1316 1316
 		{
1317 1317
 			return $output;
1318 1318
 		}
@@ -1322,7 +1322,7 @@  discard block
 block discarded – undo
1322 1322
 		list($args->email_id, $args->email_host) = explode('@', $newEmail);
1323 1323
 
1324 1324
 		$output = executeQuery('member.updateMemberEmailAddress', $args);
1325
-		if(!$output->toBool())
1325
+		if (!$output->toBool())
1326 1326
 		{
1327 1327
 			return $this->stop($output->getMessage());
1328 1328
 		}
@@ -1339,7 +1339,7 @@  discard block
 block discarded – undo
1339 1339
 		$auth_args->is_register = 'Y';
1340 1340
 
1341 1341
 		$output = executeQuery('member.insertAuthMail', $auth_args);
1342
-		if(!$output->toBool()) return $output;
1342
+		if (!$output->toBool()) return $output;
1343 1343
 
1344 1344
 		$memberInfo->email_address = $newEmail;
1345 1345
 
@@ -1363,12 +1363,12 @@  discard block
 block discarded – undo
1363 1363
 		$memberInfo = array();
1364 1364
 
1365 1365
 		global $lang;
1366
-		if(is_array($member_config->signupForm))
1366
+		if (is_array($member_config->signupForm))
1367 1367
 		{
1368
-			$exceptForm=array('password', 'find_account_question');
1369
-			foreach($member_config->signupForm as $form)
1368
+			$exceptForm = array('password', 'find_account_question');
1369
+			foreach ($member_config->signupForm as $form)
1370 1370
 			{
1371
-				if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1371
+				if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1372 1372
 				{
1373 1373
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1374 1374
 				}
@@ -1383,25 +1383,25 @@  discard block
 block discarded – undo
1383 1383
 		}
1384 1384
 		Context::set('memberInfo', $memberInfo);
1385 1385
 
1386
-		if(!$member_config->skin) $member_config->skin = "default";
1387
-		if(!$member_config->colorset) $member_config->colorset = "white";
1386
+		if (!$member_config->skin) $member_config->skin = "default";
1387
+		if (!$member_config->colorset) $member_config->colorset = "white";
1388 1388
 
1389 1389
 		Context::set('member_config', $member_config);
1390 1390
 
1391 1391
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1392
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1392
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1393 1393
 
1394
-		$auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key);
1394
+		$auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $auth_args->auth_key);
1395 1395
 		Context::set('auth_url', $auth_url);
1396 1396
 
1397 1397
 		$oTemplate = &TemplateHandler::getInstance();
1398 1398
 		$content = $oTemplate->compile($tpl_path, 'confirm_member_account_mail');
1399 1399
 		// Send a mail
1400 1400
 		$oMail = new Mail();
1401
-		$oMail->setTitle( Context::getLang('msg_confirm_account_title') );
1401
+		$oMail->setTitle(Context::getLang('msg_confirm_account_title'));
1402 1402
 		$oMail->setContent($content);
1403
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
1404
-		$oMail->setReceiptor( $member_info->user_name, $member_info->email_address );
1403
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
1404
+		$oMail->setReceiptor($member_info->user_name, $member_info->email_address);
1405 1405
 		$oMail->send();
1406 1406
 	}
1407 1407
 
@@ -1414,7 +1414,7 @@  discard block
 block discarded – undo
1414 1414
 	{
1415 1415
 		$site_module_info = Context::get('site_module_info');
1416 1416
 		$logged_info = Context::get('logged_info');
1417
-		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new Object(-1,'msg_invalid_request');
1417
+		if (!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list)) return new Object(-1, 'msg_invalid_request');
1418 1418
 
1419 1419
 		$oMemberModel = getModel('member');
1420 1420
 		$columnList = array('site_srl', 'group_srl', 'title');
@@ -1433,13 +1433,13 @@  discard block
 block discarded – undo
1433 1433
 	{
1434 1434
 		$site_module_info = Context::get('site_module_info');
1435 1435
 		$logged_info = Context::get('logged_info');
1436
-		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new Object(-1,'msg_invalid_request');
1436
+		if (!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list)) return new Object(-1, 'msg_invalid_request');
1437 1437
 
1438 1438
 		$args = new stdClass;
1439
-		$args->site_srl= $site_module_info->site_srl;
1439
+		$args->site_srl = $site_module_info->site_srl;
1440 1440
 		$args->member_srl = $logged_info->member_srl;
1441 1441
 		$output = executeQuery('member.deleteMembersGroup', $args);
1442
-		if(!$output->toBool()) return $output;
1442
+		if (!$output->toBool()) return $output;
1443 1443
 		$this->setMessage('success_deleted');
1444 1444
 		$this->_clearMemberCache($args->member_srl, $site_module_info->site_srl);
1445 1445
 	}
@@ -1453,25 +1453,25 @@  discard block
 block discarded – undo
1453 1453
 	 */
1454 1454
 	function setMemberConfig($args)
1455 1455
 	{
1456
-		if(!$args->skin) $args->skin = "default";
1457
-		if(!$args->colorset) $args->colorset = "white";
1458
-		if(!$args->editor_skin) $args->editor_skin= "ckeditor";
1459
-		if(!$args->editor_colorset) $args->editor_colorset = "moono";
1460
-		if($args->enable_join!='Y') $args->enable_join = 'N';
1461
-		$args->enable_openid= 'N';
1462
-		if($args->profile_image !='Y') $args->profile_image = 'N';
1463
-		if($args->image_name!='Y') $args->image_name = 'N';
1464
-		if($args->image_mark!='Y') $args->image_mark = 'N';
1465
-		if($args->group_image_mark!='Y') $args->group_image_mark = 'N';
1466
-		if(!trim(strip_tags($args->agreement))) $args->agreement = null;
1467
-		$args->limit_day = (int)$args->limit_day;
1456
+		if (!$args->skin) $args->skin = "default";
1457
+		if (!$args->colorset) $args->colorset = "white";
1458
+		if (!$args->editor_skin) $args->editor_skin = "ckeditor";
1459
+		if (!$args->editor_colorset) $args->editor_colorset = "moono";
1460
+		if ($args->enable_join != 'Y') $args->enable_join = 'N';
1461
+		$args->enable_openid = 'N';
1462
+		if ($args->profile_image != 'Y') $args->profile_image = 'N';
1463
+		if ($args->image_name != 'Y') $args->image_name = 'N';
1464
+		if ($args->image_mark != 'Y') $args->image_mark = 'N';
1465
+		if ($args->group_image_mark != 'Y') $args->group_image_mark = 'N';
1466
+		if (!trim(strip_tags($args->agreement))) $args->agreement = null;
1467
+		$args->limit_day = (int) $args->limit_day;
1468 1468
 
1469 1469
 		$agreement = trim($args->agreement);
1470 1470
 		unset($args->agreement);
1471 1471
 
1472 1472
 		$oModuleController = getController('module');
1473
-		$output = $oModuleController->insertModuleConfig('member',$args);
1474
-		if(!$output->toBool()) return $output;
1473
+		$output = $oModuleController->insertModuleConfig('member', $args);
1474
+		if (!$output->toBool()) return $output;
1475 1475
 
1476 1476
 		$agreement_file = _XE_PATH_.'files/member_extra_info/agreement.txt';
1477 1477
 		FileHandler::writeFile($agreement_file, $agreement);
@@ -1492,11 +1492,11 @@  discard block
 block discarded – undo
1492 1492
 		$signature = trim(removeHackTag($signature));
1493 1493
 		$signature = preg_replace('/<(\/?)(embed|object|param)/is', '&lt;$1$2', $signature);
1494 1494
 
1495
-		$check_signature = trim(str_replace(array('&nbsp;',"\n","\r"), '', strip_tags($signature, '<img><object>')));
1495
+		$check_signature = trim(str_replace(array('&nbsp;', "\n", "\r"), '', strip_tags($signature, '<img><object>')));
1496 1496
 		$path = sprintf('files/member_extra_info/signature/%s/', getNumberingPath($member_srl));
1497 1497
 		$filename = sprintf('%s%d.signature.php', $path, $member_srl);
1498 1498
 
1499
-		if(!$check_signature) return FileHandler::removeFile($filename);
1499
+		if (!$check_signature) return FileHandler::removeFile($filename);
1500 1500
 
1501 1501
 		$buff = sprintf('<?php if(!defined("__XE__")) exit();?>%s', $signature);
1502 1502
 		FileHandler::makeDir($path);
@@ -1525,15 +1525,15 @@  discard block
 block discarded – undo
1525 1525
 	 *
1526 1526
 	 * @return Object
1527 1527
 	 */
1528
-	function addMemberToGroup($member_srl, $group_srl, $site_srl=0)
1528
+	function addMemberToGroup($member_srl, $group_srl, $site_srl = 0)
1529 1529
 	{
1530 1530
 		$args = new stdClass();
1531 1531
 		$args->member_srl = $member_srl;
1532 1532
 		$args->group_srl = $group_srl;
1533
-		if($site_srl) $args->site_srl = $site_srl;
1533
+		if ($site_srl) $args->site_srl = $site_srl;
1534 1534
 
1535 1535
 		// Add
1536
-		$output = executeQuery('member.addMemberToGroup',$args);
1536
+		$output = executeQuery('member.addMemberToGroup', $args);
1537 1537
 		$output2 = ModuleHandler::triggerCall('member.addMemberToGroup', 'after', $args);
1538 1538
 
1539 1539
 		$this->_clearMemberCache($member_srl, $site_srl);
@@ -1553,18 +1553,18 @@  discard block
 block discarded – undo
1553 1553
 	{
1554 1554
 		$obj = new stdClass;
1555 1555
 		$obj->site_srl = $args->site_srl;
1556
-		$obj->member_srl = implode(',',$args->member_srl);
1556
+		$obj->member_srl = implode(',', $args->member_srl);
1557 1557
 
1558 1558
 		$output = executeQueryArray('member.getMembersGroup', $obj);
1559
-		if($output->data) foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate;
1559
+		if ($output->data) foreach ($output->data as $key => $val) $date[$val->member_srl] = $val->regdate;
1560 1560
 
1561 1561
 		$output = executeQuery('member.deleteMembersGroup', $obj);
1562
-		if(!$output->toBool()) return $output;
1562
+		if (!$output->toBool()) return $output;
1563 1563
 
1564 1564
 		$inserted_members = array();
1565
-		foreach($args->member_srl as $key => $val)
1565
+		foreach ($args->member_srl as $key => $val)
1566 1566
 		{
1567
-			if($inserted_members[$val]) continue;
1567
+			if ($inserted_members[$val]) continue;
1568 1568
 			$inserted_members[$val] = true;
1569 1569
 
1570 1570
 			unset($obj);
@@ -1574,7 +1574,7 @@  discard block
 block discarded – undo
1574 1574
 			$obj->site_srl = $args->site_srl;
1575 1575
 			$obj->regdate = $date[$obj->member_srl];
1576 1576
 			$output = executeQuery('member.addMemberToGroup', $obj);
1577
-			if(!$output->toBool()) return $output;
1577
+			if (!$output->toBool()) return $output;
1578 1578
 
1579 1579
 			$this->_clearMemberCache($obj->member_srl, $args->site_srl);
1580 1580
 		}
@@ -1596,9 +1596,9 @@  discard block
 block discarded – undo
1596 1596
 		// Get information of the key
1597 1597
 		$output = executeQuery('member.getAutologin', $args);
1598 1598
 		// If no information exists, delete a cookie
1599
-		if(!$output->toBool() || !$output->data)
1599
+		if (!$output->toBool() || !$output->data)
1600 1600
 		{
1601
-			setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365);
1601
+			setCookie('xeak', null, $_SERVER['REQUEST_TIME'] + 60 * 60 * 24 * 365);
1602 1602
 			return;
1603 1603
 		}
1604 1604
 
@@ -1608,9 +1608,9 @@  discard block
 block discarded – undo
1608 1608
 		$user_id = ($config->identifier == 'user_id') ? $output->data->user_id : $output->data->email_address;
1609 1609
 		$password = $output->data->password;
1610 1610
 
1611
-		if(!$user_id || !$password)
1611
+		if (!$user_id || !$password)
1612 1612
 		{
1613
-			setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365);
1613
+			setCookie('xeak', null, $_SERVER['REQUEST_TIME'] + 60 * 60 * 24 * 365);
1614 1614
 			return;
1615 1615
 		}
1616 1616
 
@@ -1620,7 +1620,7 @@  discard block
 block discarded – undo
1620 1620
 		$check_key = strtolower($user_id).$password.$_SERVER['HTTP_USER_AGENT'];
1621 1621
 		$check_key = substr(hash_hmac('sha256', $check_key, substr($args->autologin_key, 0, 32)), 0, 32);
1622 1622
 
1623
-		if($check_key === substr($args->autologin_key, 32))
1623
+		if ($check_key === substr($args->autologin_key, 32))
1624 1624
 		{
1625 1625
 			// Check change_password_date
1626 1626
 			$oModuleModel = getModel('module');
@@ -1628,12 +1628,12 @@  discard block
 block discarded – undo
1628 1628
 			$limit_date = $member_config->change_password_date;
1629 1629
 
1630 1630
 			// Check if change_password_date is set
1631
-			if($limit_date > 0)
1631
+			if ($limit_date > 0)
1632 1632
 			{
1633 1633
 				$oMemberModel = getModel('member');
1634 1634
 				$columnList = array('member_srl', 'change_password_date');
1635 1635
 
1636
-				if($config->identifier == 'user_id')
1636
+				if ($config->identifier == 'user_id')
1637 1637
 				{
1638 1638
 					$member_info = $oMemberModel->getMemberInfoByUserID($user_id, $columnList);
1639 1639
 				}
@@ -1642,7 +1642,7 @@  discard block
 block discarded – undo
1642 1642
 					$member_info = $oMemberModel->getMemberInfoByEmailAddress($user_id, $columnList);
1643 1643
 				}
1644 1644
 
1645
-				if($member_info->change_password_date >= date('YmdHis', strtotime('-'.$limit_date.' day')) ){
1645
+				if ($member_info->change_password_date >= date('YmdHis', strtotime('-'.$limit_date.' day'))) {
1646 1646
 					$do_auto_login = true;
1647 1647
 				}
1648 1648
 
@@ -1653,14 +1653,14 @@  discard block
 block discarded – undo
1653 1653
 			}
1654 1654
 		}
1655 1655
 
1656
-		if($do_auto_login)
1656
+		if ($do_auto_login)
1657 1657
 		{
1658 1658
 			$output = $this->doLogin($user_id);
1659 1659
 		}
1660 1660
 		else
1661 1661
 		{
1662 1662
 			executeQuery('member.deleteAutologin', $args);
1663
-			setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365);
1663
+			setCookie('xeak', null, $_SERVER['REQUEST_TIME'] + 60 * 60 * 24 * 365);
1664 1664
 		}
1665 1665
 	}
1666 1666
 
@@ -1676,13 +1676,13 @@  discard block
 block discarded – undo
1676 1676
 	function doLogin($user_id, $password = '', $keep_signed = false)
1677 1677
 	{
1678 1678
 		$user_id = strtolower($user_id);
1679
-		if(!$user_id) return new Object(-1, 'null_user_id');
1679
+		if (!$user_id) return new Object(-1, 'null_user_id');
1680 1680
 		// Call a trigger before log-in (before)
1681 1681
 		$trigger_obj = new stdClass();
1682 1682
 		$trigger_obj->user_id = $user_id;
1683 1683
 		$trigger_obj->password = $password;
1684 1684
 		$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'before', $trigger_obj);
1685
-		if(!$trigger_output->toBool()) return $trigger_output;
1685
+		if (!$trigger_output->toBool()) return $trigger_output;
1686 1686
 		// Create a member model object
1687 1687
 		$oMemberModel = getModel('member');
1688 1688
 
@@ -1692,12 +1692,12 @@  discard block
 block discarded – undo
1692 1692
 		$args->ipaddress = $_SERVER['REMOTE_ADDR'];
1693 1693
 
1694 1694
 		// check identifier
1695
-		if($config->identifier == 'email_address')
1695
+		if ($config->identifier == 'email_address')
1696 1696
 		{
1697 1697
 			// Get user_id information
1698 1698
 			$this->memberInfo = $oMemberModel->getMemberInfoByEmailAddress($user_id);
1699 1699
 			// Set an invalid user if no value returned
1700
-			if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address');
1700
+			if (!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address');
1701 1701
 
1702 1702
 		}
1703 1703
 		else
@@ -1705,24 +1705,24 @@  discard block
 block discarded – undo
1705 1705
 			// Get user_id information
1706 1706
 			$this->memberInfo = $oMemberModel->getMemberInfoByUserID($user_id);
1707 1707
 			// Set an invalid user if no value returned
1708
-			if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id');
1708
+			if (!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id');
1709 1709
 		}
1710 1710
 
1711 1711
 		$output = executeQuery('member.getLoginCountByIp', $args);
1712 1712
 		$errorCount = $output->data->count;
1713
-		if($errorCount >= $config->max_error_count)
1713
+		if ($errorCount >= $config->max_error_count)
1714 1714
 		{
1715 1715
 			$last_update = strtotime($output->data->last_update);
1716
-			$term = intval($_SERVER['REQUEST_TIME']-$last_update);
1717
-			if($term < $config->max_error_count_time)
1716
+			$term = intval($_SERVER['REQUEST_TIME'] - $last_update);
1717
+			if ($term < $config->max_error_count_time)
1718 1718
 			{
1719 1719
 				$term = $config->max_error_count_time - $term;
1720
-				if($term < 60) $term = intval($term).Context::getLang('unit_sec');
1721
-				elseif(60 <= $term && $term < 3600) $term = intval($term/60).Context::getLang('unit_min');
1722
-				elseif(3600 <= $term && $term < 86400) $term = intval($term/3600).Context::getLang('unit_hour');
1723
-				else $term = intval($term/86400).Context::getLang('unit_day');
1720
+				if ($term < 60) $term = intval($term).Context::getLang('unit_sec');
1721
+				elseif (60 <= $term && $term < 3600) $term = intval($term / 60).Context::getLang('unit_min');
1722
+				elseif (3600 <= $term && $term < 86400) $term = intval($term / 3600).Context::getLang('unit_hour');
1723
+				else $term = intval($term / 86400).Context::getLang('unit_day');
1724 1724
 
1725
-				return new Object(-1, sprintf(Context::getLang('excess_ip_access_count'),$term));
1725
+				return new Object(-1, sprintf(Context::getLang('excess_ip_access_count'), $term));
1726 1726
 			}
1727 1727
 			else
1728 1728
 			{
@@ -1732,13 +1732,13 @@  discard block
 block discarded – undo
1732 1732
 		}
1733 1733
 
1734 1734
 		// Password Check
1735
-		if($password && !$oMemberModel->isValidPassword($this->memberInfo->password, $password, $this->memberInfo->member_srl))
1735
+		if ($password && !$oMemberModel->isValidPassword($this->memberInfo->password, $password, $this->memberInfo->member_srl))
1736 1736
 		{
1737
-			return $this->recordMemberLoginError(-1, 'invalid_password',$this->memberInfo);
1737
+			return $this->recordMemberLoginError(-1, 'invalid_password', $this->memberInfo);
1738 1738
 		}
1739 1739
 
1740 1740
 		// If denied == 'Y', notify
1741
-		if($this->memberInfo->denied == 'Y')
1741
+		if ($this->memberInfo->denied == 'Y')
1742 1742
 		{
1743 1743
 			$args->member_srl = $this->memberInfo->member_srl;
1744 1744
 			$output = executeQuery('member.chkAuthMail', $args);
@@ -1746,12 +1746,12 @@  discard block
 block discarded – undo
1746 1746
 			{
1747 1747
 				$_SESSION['auth_member_srl'] = $this->memberInfo->member_srl;
1748 1748
 				$redirectUrl = getUrl('', 'act', 'dispMemberResendAuthMail');
1749
-				return $this->setRedirectUrl($redirectUrl, new Object(-1,'msg_user_not_confirmed'));
1749
+				return $this->setRedirectUrl($redirectUrl, new Object(-1, 'msg_user_not_confirmed'));
1750 1750
 			}
1751
-			return new Object(-1,'msg_user_denied');
1751
+			return new Object(-1, 'msg_user_denied');
1752 1752
 		}
1753 1753
 		// Notify if denied_date is less than the current time
1754
-		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")));
1754
+		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")));
1755 1755
 		// Update the latest login time
1756 1756
 		$args->member_srl = $this->memberInfo->member_srl;
1757 1757
 		$output = executeQuery('member.updateLastLogin', $args);
@@ -1761,36 +1761,36 @@  discard block
 block discarded – undo
1761 1761
 
1762 1762
 		// Check if there is recoding table.
1763 1763
 		$oDB = &DB::getInstance();
1764
-		if($oDB->isTableExists('member_count_history') && $config->enable_login_fail_report != 'N')
1764
+		if ($oDB->isTableExists('member_count_history') && $config->enable_login_fail_report != 'N')
1765 1765
 		{
1766 1766
 			// check if there is login fail records.
1767 1767
 			$output = executeQuery('member.getLoginCountHistoryByMemberSrl', $args);
1768
-			if($output->data && $output->data->content)
1768
+			if ($output->data && $output->data->content)
1769 1769
 			{
1770 1770
 				$title = Context::getLang('login_fail_report');
1771 1771
 				$message = '<ul>';
1772 1772
 				$content = unserialize($output->data->content);
1773
-				if(count($content) > $config->max_error_count)
1773
+				if (count($content) > $config->max_error_count)
1774 1774
 				{
1775
-					foreach($content as $val)
1775
+					foreach ($content as $val)
1776 1776
 					{
1777
-						$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>';
1777
+						$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>';
1778 1778
 					}
1779 1779
 					$message .= '</ul>';
1780
-					$content = sprintf(Context::getLang('login_fail_report_contents'),$message,date('Y-m-d h:i:sa'));
1780
+					$content = sprintf(Context::getLang('login_fail_report_contents'), $message, date('Y-m-d h:i:sa'));
1781 1781
 
1782 1782
 					//send message
1783 1783
 					$oCommunicationController = getController('communication');
1784 1784
 					$oCommunicationController->sendMessage($args->member_srl, $args->member_srl, $title, $content, true);
1785 1785
 
1786
-					if($this->memberInfo->email_address && $this->memberInfo->allow_mailing == 'Y')
1786
+					if ($this->memberInfo->email_address && $this->memberInfo->allow_mailing == 'Y')
1787 1787
 					{
1788 1788
 						$view_url = Context::getRequestUri();
1789
-						$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);
1789
+						$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);
1790 1790
 						$oMail = new Mail();
1791 1791
 						$oMail->setTitle($title);
1792 1792
 						$oMail->setContent($content);
1793
-						$oMail->setSender($config->webmaster_name?$config->webmaster_name:'webmaster', $config->webmaster_email);
1793
+						$oMail->setSender($config->webmaster_name ? $config->webmaster_name : 'webmaster', $config->webmaster_email);
1794 1794
 						$oMail->setReceiptor($this->memberInfo->email_id.'('.$this->memberInfo->nick_name.')', $this->memberInfo->email_address);
1795 1795
 						$oMail->send();
1796 1796
 					}
@@ -1800,9 +1800,9 @@  discard block
 block discarded – undo
1800 1800
 		}
1801 1801
 		// Call a trigger after successfully log-in (after)
1802 1802
 		$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'after', $this->memberInfo);
1803
-		if(!$trigger_output->toBool()) return $trigger_output;
1803
+		if (!$trigger_output->toBool()) return $trigger_output;
1804 1804
 		// When user checked to use auto-login
1805
-		if($keep_signed)
1805
+		if ($keep_signed)
1806 1806
 		{
1807 1807
 			// Key generate for auto login
1808 1808
 			$oPassword = new Password();
@@ -1814,12 +1814,12 @@  discard block
 block discarded – undo
1814 1814
 			$autologin_args->member_srl = $this->memberInfo->member_srl;
1815 1815
 			executeQuery('member.deleteAutologin', $autologin_args);
1816 1816
 			$autologin_output = executeQuery('member.insertAutologin', $autologin_args);
1817
-			if($autologin_output->toBool()) setCookie('xeak',$autologin_args->autologin_key, $_SERVER['REQUEST_TIME']+31536000);
1817
+			if ($autologin_output->toBool()) setCookie('xeak', $autologin_args->autologin_key, $_SERVER['REQUEST_TIME'] + 31536000);
1818 1818
 		}
1819
-		if($this->memberInfo->is_admin == 'Y')
1819
+		if ($this->memberInfo->is_admin == 'Y')
1820 1820
 		{
1821 1821
 			$oMemberAdminModel = getAdminModel('member');
1822
-			if(!$oMemberAdminModel->getMemberAdminIPCheck())
1822
+			if (!$oMemberAdminModel->getMemberAdminIPCheck())
1823 1823
 			{
1824 1824
 				$_SESSION['denied_admin'] = 'Y';
1825 1825
 			}
@@ -1837,18 +1837,18 @@  discard block
 block discarded – undo
1837 1837
 	{
1838 1838
 		$oMemberModel = getModel('member');
1839 1839
 		// If your information came through the current session information to extract information from the users
1840
-		if(!$this->memberInfo && $_SESSION['member_srl'] && $oMemberModel->isLogged() )
1840
+		if (!$this->memberInfo && $_SESSION['member_srl'] && $oMemberModel->isLogged())
1841 1841
 		{
1842 1842
 			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($_SESSION['member_srl']);
1843 1843
 			// If you do not destroy the session Profile
1844
-			if($this->memberInfo->member_srl != $_SESSION['member_srl'])
1844
+			if ($this->memberInfo->member_srl != $_SESSION['member_srl'])
1845 1845
 			{
1846 1846
 				$this->destroySessionInfo();
1847 1847
 				return;
1848 1848
 			}
1849 1849
 		}
1850 1850
 		// Stop using the session id is destroyed
1851
-		if($this->memberInfo->denied=='Y')
1851
+		if ($this->memberInfo->denied == 'Y')
1852 1852
 		{
1853 1853
 			$this->destroySessionInfo();
1854 1854
 			return;
@@ -1878,10 +1878,10 @@  discard block
 block discarded – undo
1878 1878
 		Context::set('logged_info', $this->memberInfo);
1879 1879
 
1880 1880
 		// Only the menu configuration of the user (such as an add-on to the menu can be changed)
1881
-		$this->addMemberMenu( 'dispMemberInfo', 'cmd_view_member_info');
1882
-		$this->addMemberMenu( 'dispMemberScrappedDocument', 'cmd_view_scrapped_document');
1883
-		$this->addMemberMenu( 'dispMemberSavedDocument', 'cmd_view_saved_document');
1884
-		$this->addMemberMenu( 'dispMemberOwnDocument', 'cmd_view_own_document');
1881
+		$this->addMemberMenu('dispMemberInfo', 'cmd_view_member_info');
1882
+		$this->addMemberMenu('dispMemberScrappedDocument', 'cmd_view_scrapped_document');
1883
+		$this->addMemberMenu('dispMemberSavedDocument', 'cmd_view_saved_document');
1884
+		$this->addMemberMenu('dispMemberOwnDocument', 'cmd_view_own_document');
1885 1885
 	}
1886 1886
 
1887 1887
 	/**
@@ -1903,7 +1903,7 @@  discard block
 block discarded – undo
1903 1903
 	function addMemberPopupMenu($url, $str, $icon = '', $target = 'self')
1904 1904
 	{
1905 1905
 		$member_popup_menu_list = Context::get('member_popup_menu_list');
1906
-		if(!is_array($member_popup_menu_list)) $member_popup_menu_list = array();
1906
+		if (!is_array($member_popup_menu_list)) $member_popup_menu_list = array();
1907 1907
 
1908 1908
 		$obj = new stdClass;
1909 1909
 		$obj->url = $url;
@@ -1922,33 +1922,33 @@  discard block
 block discarded – undo
1922 1922
 	{
1923 1923
 		// Call a trigger (before)
1924 1924
 		$output = ModuleHandler::triggerCall('member.insertMember', 'before', $args);
1925
-		if(!$output->toBool()) return $output;
1925
+		if (!$output->toBool()) return $output;
1926 1926
 		// Terms and Conditions portion of the information set up by members reaffirmed
1927 1927
 		$oModuleModel = getModel('module');
1928 1928
 		$config = $oModuleModel->getModuleConfig('member');
1929 1929
 
1930 1930
 		$logged_info = Context::get('logged_info');
1931 1931
 		// If the date of the temporary restrictions limit further information on the date of
1932
-		if($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24);
1932
+		if ($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME'] + $config->limit_day * 60 * 60 * 24);
1933 1933
 
1934 1934
 		$args->member_srl = getNextSequence();
1935 1935
 		$args->list_order = -1 * $args->member_srl;
1936 1936
 
1937 1937
 		// Execute insert or update depending on the value of member_srl
1938
-		if(!$args->user_id) $args->user_id = 't'.$args->member_srl;
1938
+		if (!$args->user_id) $args->user_id = 't'.$args->member_srl;
1939 1939
 		// Enter the user's identity changed to lowercase
1940 1940
 		else $args->user_id = strtolower($args->user_id);
1941
-		if(!$args->user_name) $args->user_name = $args->member_srl;
1942
-		if(!$args->nick_name) $args->nick_name = $args->member_srl;
1941
+		if (!$args->user_name) $args->user_name = $args->member_srl;
1942
+		if (!$args->nick_name) $args->nick_name = $args->member_srl;
1943 1943
 
1944 1944
 		// Control of essential parameters
1945
-		if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
1946
-		if($args->denied!='Y') $args->denied = 'N';
1947
-		if(!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y','N','F')))) $args->allow_message = 'Y';
1945
+		if ($args->allow_mailing != 'Y') $args->allow_mailing = 'N';
1946
+		if ($args->denied != 'Y') $args->denied = 'N';
1947
+		if (!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y', 'N', 'F')))) $args->allow_message = 'Y';
1948 1948
 
1949
-		if($logged_info->is_admin == 'Y')
1949
+		if ($logged_info->is_admin == 'Y')
1950 1950
 		{
1951
-			if($args->is_admin!='Y') $args->is_admin = 'N';
1951
+			if ($args->is_admin != 'Y') $args->is_admin = 'N';
1952 1952
 		}
1953 1953
 		else
1954 1954
 		{
@@ -1963,88 +1963,88 @@  discard block
 block discarded – undo
1963 1963
 		$args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
1964 1964
 		$args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
1965 1965
 		$args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
1966
-		if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
1967
-		if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) $args->blog = 'http://'.$args->blog;
1966
+		if ($args->homepage && !preg_match("/^[a-z]+:\/\//i", $args->homepage)) $args->homepage = 'http://'.$args->homepage;
1967
+		if ($args->blog && !preg_match("/^[a-z]+:\/\//i", $args->blog)) $args->blog = 'http://'.$args->blog;
1968 1968
 
1969 1969
 		// Create a model object
1970 1970
 		$oMemberModel = getModel('member');
1971 1971
 
1972 1972
 		// Check password strength
1973
-		if($args->password && !$password_is_hashed)
1973
+		if ($args->password && !$password_is_hashed)
1974 1974
 		{
1975
-			if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
1975
+			if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
1976 1976
 			{
1977 1977
 				$message = Context::getLang('about_password_strength');
1978 1978
 				return new Object(-1, $message[$config->password_strength]);
1979 1979
 			}
1980 1980
 			$args->password = $oMemberModel->hashPassword($args->password);
1981 1981
 		}
1982
-		elseif(!$args->password)
1982
+		elseif (!$args->password)
1983 1983
 		{
1984 1984
 			unset($args->password);
1985 1985
 		}
1986 1986
 
1987 1987
 		// Check if ID is prohibited
1988
-		if($oMemberModel->isDeniedID($args->user_id))
1988
+		if ($oMemberModel->isDeniedID($args->user_id))
1989 1989
 		{
1990
-			return new Object(-1,'denied_user_id');
1990
+			return new Object(-1, 'denied_user_id');
1991 1991
 		}
1992 1992
 
1993 1993
 		// Check if ID is duplicate
1994 1994
 		$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
1995
-		if($member_srl)
1995
+		if ($member_srl)
1996 1996
 		{
1997
-			return new Object(-1,'msg_exists_user_id');
1997
+			return new Object(-1, 'msg_exists_user_id');
1998 1998
 		}
1999 1999
 
2000 2000
 		// Check if nickname is prohibited
2001
-		if($oMemberModel->isDeniedNickName($args->nick_name))
2001
+		if ($oMemberModel->isDeniedNickName($args->nick_name))
2002 2002
 		{
2003
-			return new Object(-1,'denied_nick_name');
2003
+			return new Object(-1, 'denied_nick_name');
2004 2004
 		}
2005 2005
 
2006 2006
 		// Check if nickname is duplicate
2007 2007
 		$member_srl = $oMemberModel->getMemberSrlByNickName($args->nick_name);
2008
-		if($member_srl)
2008
+		if ($member_srl)
2009 2009
 		{
2010
-			return new Object(-1,'msg_exists_nick_name');
2010
+			return new Object(-1, 'msg_exists_nick_name');
2011 2011
 		}
2012 2012
 
2013 2013
 		// Check if email address is duplicate
2014 2014
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($args->email_address);
2015
-		if($member_srl)
2015
+		if ($member_srl)
2016 2016
 		{
2017
-			return new Object(-1,'msg_exists_email_address');
2017
+			return new Object(-1, 'msg_exists_email_address');
2018 2018
 		}
2019 2019
 
2020 2020
 		// Insert data into the DB
2021 2021
 		$args->list_order = -1 * $args->member_srl;
2022 2022
 
2023
-		if(!$args->user_id) $args->user_id = 't'.$args->member_srl;
2024
-		if(!$args->user_name) $args->user_name = $args->member_srl;
2023
+		if (!$args->user_id) $args->user_id = 't'.$args->member_srl;
2024
+		if (!$args->user_name) $args->user_name = $args->member_srl;
2025 2025
 
2026 2026
 		$oDB = &DB::getInstance();
2027 2027
 		$oDB->begin();
2028 2028
 
2029 2029
 		$output = executeQuery('member.insertMember', $args);
2030
-		if(!$output->toBool())
2030
+		if (!$output->toBool())
2031 2031
 		{
2032 2032
 			$oDB->rollback();
2033 2033
 			return $output;
2034 2034
 		}
2035 2035
 
2036
-		if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2036
+		if (is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2037 2037
 		else $group_srl_list = explode('|@|', $args->group_srl_list);
2038 2038
 		// If no value is entered the default group, the value of group registration
2039
-		if(!$args->group_srl_list)
2039
+		if (!$args->group_srl_list)
2040 2040
 		{
2041 2041
 			$columnList = array('site_srl', 'group_srl');
2042 2042
 			$default_group = $oMemberModel->getDefaultGroup(0, $columnList);
2043
-			if($default_group)
2043
+			if ($default_group)
2044 2044
 			{
2045 2045
 				// Add to the default group
2046
-				$output = $this->addMemberToGroup($args->member_srl,$default_group->group_srl);
2047
-				if(!$output->toBool())
2046
+				$output = $this->addMemberToGroup($args->member_srl, $default_group->group_srl);
2047
+				if (!$output->toBool())
2048 2048
 				{
2049 2049
 					$oDB->rollback();
2050 2050
 					return $output;
@@ -2054,11 +2054,11 @@  discard block
 block discarded – undo
2054 2054
 		}
2055 2055
 		else
2056 2056
 		{
2057
-			for($i=0;$i<count($group_srl_list);$i++)
2057
+			for ($i = 0; $i < count($group_srl_list); $i++)
2058 2058
 			{
2059
-				$output = $this->addMemberToGroup($args->member_srl,$group_srl_list[$i]);
2059
+				$output = $this->addMemberToGroup($args->member_srl, $group_srl_list[$i]);
2060 2060
 
2061
-				if(!$output->toBool())
2061
+				if (!$output->toBool())
2062 2062
 				{
2063 2063
 					$oDB->rollback();
2064 2064
 					return $output;
@@ -2068,7 +2068,7 @@  discard block
 block discarded – undo
2068 2068
 
2069 2069
 		$member_config = $oModuleModel->getModuleConfig('member');
2070 2070
 		// When using email authentication mode (when you subscribed members denied a) certified mail sent
2071
-		if($args->denied == 'Y')
2071
+		if ($args->denied == 'Y')
2072 2072
 		{
2073 2073
 			// Insert data into the authentication DB
2074 2074
 			$oPassword = new Password();
@@ -2080,7 +2080,7 @@  discard block
 block discarded – undo
2080 2080
 			$auth_args->is_register = 'Y';
2081 2081
 
2082 2082
 			$output = executeQuery('member.insertAuthMail', $auth_args);
2083
-			if(!$output->toBool())
2083
+			if (!$output->toBool())
2084 2084
 			{
2085 2085
 				$oDB->rollback();
2086 2086
 				return $output;
@@ -2088,10 +2088,10 @@  discard block
 block discarded – undo
2088 2088
 			$this->_sendAuthMail($auth_args, $args);
2089 2089
 		}
2090 2090
 		// Call a trigger (after)
2091
-		if($output->toBool())
2091
+		if ($output->toBool())
2092 2092
 		{
2093 2093
 			$trigger_output = ModuleHandler::triggerCall('member.insertMember', 'after', $args);
2094
-			if(!$trigger_output->toBool())
2094
+			if (!$trigger_output->toBool())
2095 2095
 			{
2096 2096
 				$oDB->rollback();
2097 2097
 				return $trigger_output;
@@ -2113,41 +2113,41 @@  discard block
 block discarded – undo
2113 2113
 	{
2114 2114
 		// Call a trigger (before)
2115 2115
 		$output = ModuleHandler::triggerCall('member.updateMember', 'before', $args);
2116
-		if(!$output->toBool()) return $output;
2116
+		if (!$output->toBool()) return $output;
2117 2117
 		// Create a model object
2118 2118
 		$oMemberModel = getModel('member');
2119 2119
 
2120 2120
 		$logged_info = Context::get('logged_info');
2121 2121
 		// Get what you want to modify the original information
2122
-		if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2122
+		if (!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2123 2123
 		// Control of essential parameters
2124
-		if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
2125
-		if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) $args->allow_message = 'Y';
2124
+		if ($args->allow_mailing != 'Y') $args->allow_mailing = 'N';
2125
+		if ($args->allow_message && !in_array($args->allow_message, array('Y', 'N', 'F'))) $args->allow_message = 'Y';
2126 2126
 
2127
-		if($logged_info->is_admin == 'Y')
2127
+		if ($logged_info->is_admin == 'Y')
2128 2128
 		{
2129
-			if($args->denied!='Y') $args->denied = 'N';
2130
-			if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N';
2129
+			if ($args->denied != 'Y') $args->denied = 'N';
2130
+			if ($args->is_admin != 'Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N';
2131 2131
 		}
2132 2132
 		else
2133 2133
 		{
2134 2134
 			unset($args->is_admin);
2135
-			if($is_admin == false)
2135
+			if ($is_admin == false)
2136 2136
 				unset($args->denied);
2137
-			if($logged_info->member_srl != $args->member_srl && $is_admin == false)
2137
+			if ($logged_info->member_srl != $args->member_srl && $is_admin == false)
2138 2138
 			{
2139 2139
 				return $this->stop('msg_invalid_request');
2140 2140
 			}
2141 2141
 		}
2142 2142
 
2143 2143
 		// Sanitize user ID, username, nickname, homepage, blog
2144
-		if($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2144
+		if ($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2145 2145
 		$args->user_name = htmlspecialchars($args->user_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2146 2146
 		$args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2147 2147
 		$args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2148 2148
 		$args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2149
-		if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
2150
-		if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) $args->blog = 'http://'.$args->blog;
2149
+		if ($args->homepage && !preg_match("/^[a-z]+:\/\//is", $args->homepage)) $args->homepage = 'http://'.$args->homepage;
2150
+		if ($args->blog && !preg_match("/^[a-z]+:\/\//is", $args->blog)) $args->blog = 'http://'.$args->blog;
2151 2151
 
2152 2152
 		// check member identifier form
2153 2153
 		$config = $oMemberModel->getMemberConfig();
@@ -2156,56 +2156,56 @@  discard block
 block discarded – undo
2156 2156
 		$orgMemberInfo = $output->data;
2157 2157
 
2158 2158
 		// Check if email address or user ID is duplicate
2159
-		if($config->identifier == 'email_address')
2159
+		if ($config->identifier == 'email_address')
2160 2160
 		{
2161 2161
 			$member_srl = $oMemberModel->getMemberSrlByEmailAddress($args->email_address);
2162
-			if($member_srl && $args->member_srl != $member_srl)
2162
+			if ($member_srl && $args->member_srl != $member_srl)
2163 2163
 			{
2164
-				return new Object(-1,'msg_exists_email_address');
2164
+				return new Object(-1, 'msg_exists_email_address');
2165 2165
 			}
2166 2166
 			$args->email_address = $orgMemberInfo->email_address;
2167 2167
 		}
2168 2168
 		else
2169 2169
 		{
2170 2170
 			$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
2171
-			if($member_srl && $args->member_srl != $member_srl)
2171
+			if ($member_srl && $args->member_srl != $member_srl)
2172 2172
 			{
2173
-				return new Object(-1,'msg_exists_user_id');
2173
+				return new Object(-1, 'msg_exists_user_id');
2174 2174
 			}
2175 2175
 
2176 2176
 			$args->user_id = $orgMemberInfo->user_id;
2177 2177
 		}
2178 2178
 
2179
-		if($logged_info->is_admin !== 'Y')
2179
+		if ($logged_info->is_admin !== 'Y')
2180 2180
 		{
2181 2181
 			// Check if ID is prohibited
2182
-			if($args->user_id && $oMemberModel->isDeniedID($args->user_id))
2182
+			if ($args->user_id && $oMemberModel->isDeniedID($args->user_id))
2183 2183
 			{
2184
-				return new Object(-1,'denied_user_id');
2184
+				return new Object(-1, 'denied_user_id');
2185 2185
 			}
2186 2186
 
2187 2187
 			// Check if nickname is prohibited
2188
-			if($args->nick_name && $oMemberModel->isDeniedNickName($args->nick_name))
2188
+			if ($args->nick_name && $oMemberModel->isDeniedNickName($args->nick_name))
2189 2189
 			{
2190 2190
 				return new Object(-1, 'denied_nick_name');
2191 2191
 			}
2192 2192
 		}
2193 2193
 
2194 2194
 		// Check if ID is duplicate
2195
-		if($args->user_id)
2195
+		if ($args->user_id)
2196 2196
 		{
2197 2197
 			$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
2198
-			if($member_srl && $args->member_srl != $member_srl)
2198
+			if ($member_srl && $args->member_srl != $member_srl)
2199 2199
 			{
2200
-				return new Object(-1,'msg_exists_user_id');
2200
+				return new Object(-1, 'msg_exists_user_id');
2201 2201
 			}
2202 2202
 		}
2203 2203
 
2204 2204
 		// Check if nickname is duplicate
2205 2205
 		$member_srl = $oMemberModel->getMemberSrlByNickName($args->nick_name);
2206
- 		if($member_srl && $args->member_srl != $member_srl)
2206
+ 		if ($member_srl && $args->member_srl != $member_srl)
2207 2207
  		{
2208
- 			return new Object(-1,'msg_exists_nick_name');
2208
+ 			return new Object(-1, 'msg_exists_nick_name');
2209 2209
  		}
2210 2210
 
2211 2211
 		list($args->email_id, $args->email_host) = explode('@', $args->email_address);
@@ -2214,9 +2214,9 @@  discard block
 block discarded – undo
2214 2214
 		$oDB->begin();
2215 2215
 
2216 2216
 		// Check password strength
2217
-		if($args->password)
2217
+		if ($args->password)
2218 2218
 		{
2219
-			if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2219
+			if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2220 2220
 			{
2221 2221
 				$message = Context::getLang('about_password_strength');
2222 2222
 				return new Object(-1, $message[$config->password_strength]);
@@ -2228,40 +2228,40 @@  discard block
 block discarded – undo
2228 2228
 			$args->password = $orgMemberInfo->password;
2229 2229
 		}
2230 2230
 
2231
-		if(!$args->user_name) $args->user_name = $orgMemberInfo->user_name;
2232
-		if(!$args->user_id) $args->user_id = $orgMemberInfo->user_id;
2233
-		if(!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name;
2234
-		if(!$args->description) $args->description = $orgMemberInfo->description;
2235
-		if(!$args->birthday) $args->birthday = '';
2231
+		if (!$args->user_name) $args->user_name = $orgMemberInfo->user_name;
2232
+		if (!$args->user_id) $args->user_id = $orgMemberInfo->user_id;
2233
+		if (!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name;
2234
+		if (!$args->description) $args->description = $orgMemberInfo->description;
2235
+		if (!$args->birthday) $args->birthday = '';
2236 2236
 
2237 2237
 		$output = executeQuery('member.updateMember', $args);
2238 2238
 
2239
-		if(!$output->toBool())
2239
+		if (!$output->toBool())
2240 2240
 		{
2241 2241
 			$oDB->rollback();
2242 2242
 			return $output;
2243 2243
 		}
2244 2244
 
2245
-		if($args->group_srl_list)
2245
+		if ($args->group_srl_list)
2246 2246
 		{
2247
-			if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2247
+			if (is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2248 2248
 			else $group_srl_list = explode('|@|', $args->group_srl_list);
2249 2249
 			// If the group information, group information changes
2250
-			if(count($group_srl_list) > 0)
2250
+			if (count($group_srl_list) > 0)
2251 2251
 			{
2252 2252
 				$args->site_srl = 0;
2253 2253
 				// One of its members to delete all the group
2254 2254
 				$output = executeQuery('member.deleteMemberGroupMember', $args);
2255
-				if(!$output->toBool())
2255
+				if (!$output->toBool())
2256 2256
 				{
2257 2257
 					$oDB->rollback();
2258 2258
 					return $output;
2259 2259
 				}
2260 2260
 				// Enter one of the loop a
2261
-				for($i=0;$i<count($group_srl_list);$i++)
2261
+				for ($i = 0; $i < count($group_srl_list); $i++)
2262 2262
 				{
2263
-					$output = $this->addMemberToGroup($args->member_srl,$group_srl_list[$i]);
2264
-					if(!$output->toBool())
2263
+					$output = $this->addMemberToGroup($args->member_srl, $group_srl_list[$i]);
2264
+					if (!$output->toBool())
2265 2265
 					{
2266 2266
 						$oDB->rollback();
2267 2267
 						return $output;
@@ -2273,9 +2273,9 @@  discard block
 block discarded – undo
2273 2273
 			}
2274 2274
 		}
2275 2275
 		// Call a trigger (after)
2276
-		if($output->toBool()) {
2276
+		if ($output->toBool()) {
2277 2277
 			$trigger_output = ModuleHandler::triggerCall('member.updateMember', 'after', $args);
2278
-			if(!$trigger_output->toBool())
2278
+			if (!$trigger_output->toBool())
2279 2279
 			{
2280 2280
 				$oDB->rollback();
2281 2281
 				return $trigger_output;
@@ -2288,7 +2288,7 @@  discard block
 block discarded – undo
2288 2288
 		$this->_clearMemberCache($args->member_srl, $args->site_srl);
2289 2289
 
2290 2290
 		// Save Session
2291
-		if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2291
+		if (!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2292 2292
 		$logged_info = Context::get('logged_info');
2293 2293
 
2294 2294
 		$output->add('member_srl', $args->member_srl);
@@ -2300,14 +2300,14 @@  discard block
 block discarded – undo
2300 2300
 	 */
2301 2301
 	function updateMemberPassword($args)
2302 2302
 	{
2303
-		if($args->password)
2303
+		if ($args->password)
2304 2304
 		{
2305 2305
 
2306 2306
 			// check password strength
2307 2307
 			$oMemberModel = getModel('member');
2308 2308
 			$config = $oMemberModel->getMemberConfig();
2309 2309
 
2310
-			if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2310
+			if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2311 2311
 			{
2312 2312
 				$message = Context::getLang('about_password_strength');
2313 2313
 				return new Object(-1, $message[$config->password_strength]);
@@ -2315,13 +2315,13 @@  discard block
 block discarded – undo
2315 2315
 
2316 2316
 			$args->password = $oMemberModel->hashPassword($args->password);
2317 2317
 		}
2318
-		else if($args->hashed_password)
2318
+		else if ($args->hashed_password)
2319 2319
 		{
2320 2320
 			$args->password = $args->hashed_password;
2321 2321
 		}
2322 2322
 
2323 2323
 		$output = executeQuery('member.updateMemberPassword', $args);
2324
-		if($output->toBool())
2324
+		if ($output->toBool())
2325 2325
 		{
2326 2326
 			$result = executeQuery('member.updateChangePasswordDate', $args);
2327 2327
 		}
@@ -2340,18 +2340,18 @@  discard block
 block discarded – undo
2340 2340
 		$trigger_obj = new stdClass();
2341 2341
 		$trigger_obj->member_srl = $member_srl;
2342 2342
 		$output = ModuleHandler::triggerCall('member.deleteMember', 'before', $trigger_obj);
2343
-		if(!$output->toBool()) return $output;
2343
+		if (!$output->toBool()) return $output;
2344 2344
 		// Create a model object
2345 2345
 		$oMemberModel = getModel('member');
2346 2346
 		// Bringing the user's information
2347
-		if(!$this->memberInfo || $this->memberInfo->member_srl != $member_srl || !isset($this->memberInfo->is_admin))
2347
+		if (!$this->memberInfo || $this->memberInfo->member_srl != $member_srl || !isset($this->memberInfo->is_admin))
2348 2348
 		{
2349 2349
 			$columnList = array('member_srl', 'is_admin');
2350 2350
 			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
2351 2351
 		}
2352
-		if(!$this->memberInfo) return new Object(-1, 'msg_not_exists_member');
2352
+		if (!$this->memberInfo) return new Object(-1, 'msg_not_exists_member');
2353 2353
 		// If managers can not be deleted
2354
-		if($this->memberInfo->is_admin == 'Y') return new Object(-1, 'msg_cannot_delete_admin');
2354
+		if ($this->memberInfo->is_admin == 'Y') return new Object(-1, 'msg_cannot_delete_admin');
2355 2355
 
2356 2356
 		$oDB = &DB::getInstance();
2357 2357
 		$oDB->begin();
@@ -2360,7 +2360,7 @@  discard block
 block discarded – undo
2360 2360
 		$args->member_srl = $member_srl;
2361 2361
 		// Delete the entries in member_auth_mail
2362 2362
 		$output = executeQuery('member.deleteAuthMail', $args);
2363
-		if(!$output->toBool())
2363
+		if (!$output->toBool())
2364 2364
 		{
2365 2365
 			$oDB->rollback();
2366 2366
 			return $output;
@@ -2375,23 +2375,23 @@  discard block
 block discarded – undo
2375 2375
 		 */
2376 2376
 		// Delete the entries in member_group_member
2377 2377
 		$output = executeQuery('member.deleteMemberGroupMember', $args);
2378
-		if(!$output->toBool())
2378
+		if (!$output->toBool())
2379 2379
 		{
2380 2380
 			$oDB->rollback();
2381 2381
 			return $output;
2382 2382
 		}
2383 2383
 		// member removed from the table
2384 2384
 		$output = executeQuery('member.deleteMember', $args);
2385
-		if(!$output->toBool())
2385
+		if (!$output->toBool())
2386 2386
 		{
2387 2387
 			$oDB->rollback();
2388 2388
 			return $output;
2389 2389
 		}
2390 2390
 		// Call a trigger (after)
2391
-		if($output->toBool())
2391
+		if ($output->toBool())
2392 2392
 		{
2393 2393
 			$trigger_output = ModuleHandler::triggerCall('member.deleteMember', 'after', $trigger_obj);
2394
-			if(!$trigger_output->toBool())
2394
+			if (!$trigger_output->toBool())
2395 2395
 			{
2396 2396
 				$oDB->rollback();
2397 2397
 				return $trigger_output;
@@ -2415,23 +2415,23 @@  discard block
 block discarded – undo
2415 2415
 	 */
2416 2416
 	function destroySessionInfo()
2417 2417
 	{
2418
-		if(!$_SESSION || !is_array($_SESSION)) return;
2418
+		if (!$_SESSION || !is_array($_SESSION)) return;
2419 2419
 
2420 2420
 		$memberInfo = Context::get('logged_info');
2421 2421
 		$memberSrl = $memberInfo->member_srl;
2422 2422
 
2423
-		foreach($_SESSION as $key => $val)
2423
+		foreach ($_SESSION as $key => $val)
2424 2424
 		{
2425 2425
 			$_SESSION[$key] = '';
2426 2426
 		}
2427 2427
 
2428 2428
 		session_destroy();
2429
-		setcookie(session_name(), '', $_SERVER['REQUEST_TIME']-42000);
2430
-		setcookie('sso','',$_SERVER['REQUEST_TIME']-42000);
2431
-		setcookie('xeak','',$_SERVER['REQUEST_TIME']-42000);
2429
+		setcookie(session_name(), '', $_SERVER['REQUEST_TIME'] - 42000);
2430
+		setcookie('sso', '', $_SERVER['REQUEST_TIME'] - 42000);
2431
+		setcookie('xeak', '', $_SERVER['REQUEST_TIME'] - 42000);
2432 2432
 		setcookie('xe_logged', 'false', $_SERVER['REQUEST_TIME'] - 42000);
2433 2433
 
2434
-		if($memberSrl || $_COOKIE['xeak'])
2434
+		if ($memberSrl || $_COOKIE['xeak'])
2435 2435
 		{
2436 2436
 			$args = new stdClass();
2437 2437
 			$args->member_srl = $memberSrl;
@@ -2447,22 +2447,22 @@  discard block
 block discarded – undo
2447 2447
 		$pointGroup = $pointModuleConfig->point_group;
2448 2448
 
2449 2449
 		$levelGroup = array();
2450
-		if(is_array($pointGroup) && count($pointGroup)>0)
2450
+		if (is_array($pointGroup) && count($pointGroup) > 0)
2451 2451
 		{
2452 2452
 			$levelGroup = array_flip($pointGroup);
2453 2453
 			ksort($levelGroup);
2454 2454
 		}
2455 2455
 		$maxLevel = 0;
2456 2456
 		$resultGroup = array_intersect($levelGroup, $groupSrlList);
2457
-		if(count($resultGroup) > 0)
2457
+		if (count($resultGroup) > 0)
2458 2458
 			$maxLevel = max(array_flip($resultGroup));
2459 2459
 
2460
-		if($maxLevel > 0)
2460
+		if ($maxLevel > 0)
2461 2461
 		{
2462 2462
 			$oPointModel = getModel('point');
2463 2463
 			$originPoint = $oPointModel->getPoint($memberSrl);
2464 2464
 
2465
-			if($pointModuleConfig->level_step[$maxLevel] > $originPoint)
2465
+			if ($pointModuleConfig->level_step[$maxLevel] > $originPoint)
2466 2466
 			{
2467 2467
 				$oPointController = getController('point');
2468 2468
 				$oPointController->setPoint($memberSrl, $pointModuleConfig->level_step[$maxLevel], 'update');
@@ -2472,18 +2472,18 @@  discard block
 block discarded – undo
2472 2472
 
2473 2473
 	function procMemberModifyEmailAddress()
2474 2474
 	{
2475
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
2475
+		if (!Context::get('is_logged')) return $this->stop('msg_not_logged');
2476 2476
 
2477 2477
 		$member_info = Context::get('logged_info');
2478 2478
 		$newEmail = Context::get('email_address');
2479 2479
 
2480
-		if(!$newEmail) return $this->stop('msg_invalid_request');
2480
+		if (!$newEmail) return $this->stop('msg_invalid_request');
2481 2481
 
2482 2482
 		$oMemberModel = getModel('member');
2483 2483
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail);
2484
-		if($member_srl) return new Object(-1,'msg_exists_email_address');
2484
+		if ($member_srl) return new Object(-1, 'msg_exists_email_address');
2485 2485
 
2486
-		if($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
2486
+		if ($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
2487 2487
 		{
2488 2488
 			return $this->stop('msg_invalid_request');
2489 2489
 		}
@@ -2499,7 +2499,7 @@  discard block
 block discarded – undo
2499 2499
 		$oDB = &DB::getInstance();
2500 2500
 		$oDB->begin();
2501 2501
 		$output = executeQuery('member.insertAuthMail', $auth_args);
2502
-		if(!$output->toBool())
2502
+		if (!$output->toBool())
2503 2503
 		{
2504 2504
 			$oDB->rollback();
2505 2505
 			return $output;
@@ -2509,7 +2509,7 @@  discard block
 block discarded – undo
2509 2509
 		$member_config = $oModuleModel->getModuleConfig('member');
2510 2510
 
2511 2511
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
2512
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
2512
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
2513 2513
 
2514 2514
 		global $lang;
2515 2515
 
@@ -2521,17 +2521,17 @@  discard block
 block discarded – undo
2521 2521
 
2522 2522
 		Context::set('newEmail', $newEmail);
2523 2523
 
2524
-		$auth_url = getFullUrl('','module','member','act','procMemberAuthEmailAddress','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key);
2524
+		$auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthEmailAddress', 'member_srl', $member_info->member_srl, 'auth_key', $auth_args->auth_key);
2525 2525
 		Context::set('auth_url', $auth_url);
2526 2526
 
2527 2527
 		$oTemplate = &TemplateHandler::getInstance();
2528 2528
 		$content = $oTemplate->compile($tpl_path, 'confirm_member_new_email');
2529 2529
 
2530 2530
 		$oMail = new Mail();
2531
-		$oMail->setTitle( Context::getLang('title_modify_email_address') );
2531
+		$oMail->setTitle(Context::getLang('title_modify_email_address'));
2532 2532
 		$oMail->setContent($content);
2533
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
2534
-		$oMail->setReceiptor( $member_info->nick_name, $newEmail );
2533
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
2534
+		$oMail->setReceiptor($member_info->nick_name, $newEmail);
2535 2535
 		$result = $oMail->send();
2536 2536
 
2537 2537
 		$msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $newEmail);
@@ -2545,16 +2545,16 @@  discard block
 block discarded – undo
2545 2545
 	{
2546 2546
 		$member_srl = Context::get('member_srl');
2547 2547
 		$auth_key = Context::get('auth_key');
2548
-		if(!$member_srl || !$auth_key) return $this->stop('msg_invalid_request');
2548
+		if (!$member_srl || !$auth_key) return $this->stop('msg_invalid_request');
2549 2549
 
2550 2550
 		// Test logs for finding password by user_id and authkey
2551 2551
 		$args = new stdClass;
2552 2552
 		$args->member_srl = $member_srl;
2553 2553
 		$args->auth_key = $auth_key;
2554 2554
 		$output = executeQuery('member.getAuthMail', $args);
2555
-		if(!$output->toBool() || $output->data->auth_key != $auth_key)
2555
+		if (!$output->toBool() || $output->data->auth_key != $auth_key)
2556 2556
 		{
2557
-			if(strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args);
2557
+			if (strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args);
2558 2558
 			return $this->stop('msg_invalid_modify_email_auth_key');
2559 2559
 		}
2560 2560
 
@@ -2563,10 +2563,10 @@  discard block
 block discarded – undo
2563 2563
 		list($args->email_id, $args->email_host) = explode('@', $newEmail);
2564 2564
 
2565 2565
 		$output = executeQuery('member.updateMemberEmailAddress', $args);
2566
-		if(!$output->toBool()) return $this->stop($output->getMessage());
2566
+		if (!$output->toBool()) return $this->stop($output->getMessage());
2567 2567
 
2568 2568
 		// Remove all values having the member_srl and new_password equal to 'XE_change_emaill_address' from authentication table
2569
-		executeQuery('member.deleteAuthChangeEmailAddress',$args);
2569
+		executeQuery('member.deleteAuthChangeEmailAddress', $args);
2570 2570
 
2571 2571
 		$this->_clearMemberCache($args->member_srl);
2572 2572
 
@@ -2584,7 +2584,7 @@  discard block
 block discarded – undo
2584 2584
 	**/
2585 2585
 	function triggerGetDocumentMenu(&$menu_list)
2586 2586
 	{
2587
-		if(!Context::get('is_logged')) return new Object();
2587
+		if (!Context::get('is_logged')) return new Object();
2588 2588
 
2589 2589
 		$logged_info = Context::get('logged_info');
2590 2590
 		$document_srl = Context::get('target_srl');
@@ -2595,12 +2595,12 @@  discard block
 block discarded – undo
2595 2595
 		$member_srl = $oDocument->get('member_srl');
2596 2596
 		$module_srl = $oDocument->get('module_srl');
2597 2597
 
2598
-		if(!$member_srl) return new Object();
2599
-		if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new Object();
2598
+		if (!$member_srl) return new Object();
2599
+		if ($oDocumentModel->grant->manager != 1 || $member_srl == $logged_info->member_srl) return new Object();
2600 2600
 
2601 2601
 		$oDocumentController = getController('document');
2602
-		$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
2603
-		$oDocumentController->addDocumentPopupMenu($url,'cmd_spammer','','popup');
2602
+		$url = getUrl('', 'module', 'member', 'act', 'dispMemberSpammer', 'member_srl', $member_srl, 'module_srl', $module_srl);
2603
+		$oDocumentController->addDocumentPopupMenu($url, 'cmd_spammer', '', 'popup');
2604 2604
 
2605 2605
 		return new Object();
2606 2606
 	}
@@ -2614,7 +2614,7 @@  discard block
 block discarded – undo
2614 2614
 	**/
2615 2615
 	function triggerGetCommentMenu(&$menu_list)
2616 2616
 	{
2617
-		if(!Context::get('is_logged')) return new Object();
2617
+		if (!Context::get('is_logged')) return new Object();
2618 2618
 
2619 2619
 		$logged_info = Context::get('logged_info');
2620 2620
 		$comment_srl = Context::get('target_srl');
@@ -2625,12 +2625,12 @@  discard block
 block discarded – undo
2625 2625
 		$module_srl = $oComment->get('module_srl');
2626 2626
 		$member_srl = $oComment->get('member_srl');
2627 2627
 
2628
-		if(!$member_srl) return new Object();
2629
-		if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new Object();
2628
+		if (!$member_srl) return new Object();
2629
+		if ($oCommentModel->grant->manager != 1 || $member_srl == $logged_info->member_srl) return new Object();
2630 2630
 
2631 2631
 		$oCommentController = getController('comment');
2632
-		$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
2633
-		$oCommentController->addCommentPopupMenu($url,'cmd_spammer','','popup');
2632
+		$url = getUrl('', 'module', 'member', 'act', 'dispMemberSpammer', 'member_srl', $member_srl, 'module_srl', $module_srl);
2633
+		$oCommentController->addCommentPopupMenu($url, 'cmd_spammer', '', 'popup');
2634 2634
 
2635 2635
 		return new Object();
2636 2636
 	}
@@ -2642,7 +2642,7 @@  discard block
 block discarded – undo
2642 2642
 	**/
2643 2643
 	function procMemberSpammerManage()
2644 2644
 	{
2645
-		if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
2645
+		if (!Context::get('is_logged')) return new Object(-1, 'msg_not_permitted');
2646 2646
 
2647 2647
 		$logged_info = Context::get('logged_info');
2648 2648
 		$member_srl = Context::get('member_srl');
@@ -2650,7 +2650,7 @@  discard block
 block discarded – undo
2650 2650
 		$cnt_loop = Context::get('cnt_loop');
2651 2651
 		$proc_type = Context::get('proc_type');
2652 2652
 		$isMoveToTrash = true;
2653
-		if($proc_type == "delete")
2653
+		if ($proc_type == "delete")
2654 2654
 			$isMoveToTrash = false;
2655 2655
 
2656 2656
 		// check grant
@@ -2659,7 +2659,7 @@  discard block
 block discarded – undo
2659 2659
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
2660 2660
 		$grant = $oModuleModel->getGrant($module_info, $logged_info);
2661 2661
 
2662
-		if(!$grant->manager) return new Object(-1,'msg_not_permitted');
2662
+		if (!$grant->manager) return new Object(-1, 'msg_not_permitted');
2663 2663
 
2664 2664
 		$proc_msg = "";
2665 2665
 
@@ -2668,10 +2668,10 @@  discard block
 block discarded – undo
2668 2668
 
2669 2669
 		// delete or trash destination
2670 2670
 		// proc member
2671
-		if($cnt_loop == 1)
2671
+		if ($cnt_loop == 1)
2672 2672
 			$this->_spammerMember($member_srl);
2673 2673
 		// proc document and comment
2674
-		elseif($cnt_loop>1)
2674
+		elseif ($cnt_loop > 1)
2675 2675
 			$this->_spammerDocuments($member_srl, $isMoveToTrash);
2676 2676
 
2677 2677
 		// get destination count
@@ -2680,11 +2680,11 @@  discard block
 block discarded – undo
2680 2680
 
2681 2681
 		$total_count = Context::get('total_count');
2682 2682
 		$remain_count = $cnt_document + $cnt_comment;
2683
-		if($cnt_loop == 1) $total_count = $remain_count;
2683
+		if ($cnt_loop == 1) $total_count = $remain_count;
2684 2684
 
2685 2685
 		// get progress percent
2686
-		if($total_count > 0)
2687
-			$progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 );
2686
+		if ($total_count > 0)
2687
+			$progress = intval((($total_count - $remain_count) / $total_count) * 100);
2688 2688
 		else
2689 2689
 			$progress = 100;
2690 2690
 
@@ -2708,7 +2708,7 @@  discard block
 block discarded – undo
2708 2708
 	**/
2709 2709
 	private function _spammerMember($member_srl) {
2710 2710
 		$logged_info = Context::get('logged_info');
2711
-		$spam_description = trim( Context::get('spam_description') );
2711
+		$spam_description = trim(Context::get('spam_description'));
2712 2712
 
2713 2713
 		$oMemberModel = getModel('member');
2714 2714
 		$columnList = array('member_srl', 'email_address', 'user_id', 'nick_name', 'description');
@@ -2727,10 +2727,10 @@  discard block
 block discarded – undo
2727 2727
 		$args->user_id = $member_info->user_id;
2728 2728
 		$args->nick_name = $member_info->nick_name;
2729 2729
 		$args->denied = "Y";
2730
-		$args->description = trim( $member_info->description );
2731
-		if( $args->description != "" ) $args->description .= "\n";	// add new line
2730
+		$args->description = trim($member_info->description);
2731
+		if ($args->description != "") $args->description .= "\n"; // add new line
2732 2732
 
2733
-		$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 . "]";
2733
+		$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."]";
2734 2734
 
2735 2735
 		$output = $this->updateMember($args, true);
2736 2736
 
@@ -2759,21 +2759,21 @@  discard block
 block discarded – undo
2759 2759
 		// 1. proc comment, 2. proc document
2760 2760
 		$cnt_comment = $oCommentModel->getCommentCountByMemberSrl($member_srl);
2761 2761
 		$cnt_document = $oDocumentModel->getDocumentCountByMemberSrl($member_srl);
2762
-		if($cnt_comment > 0)
2762
+		if ($cnt_comment > 0)
2763 2763
 		{
2764 2764
 			$columnList = array();
2765 2765
 			$commentList = $oCommentModel->getCommentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount);
2766
-			if($commentList) {
2767
-				foreach($commentList as $v) {
2766
+			if ($commentList) {
2767
+				foreach ($commentList as $v) {
2768 2768
 					$oCommentController->deleteComment($v->comment_srl, true, $isMoveToTrash);
2769 2769
 				}
2770 2770
 			}
2771
-		} elseif($cnt_document > 0) {
2771
+		} elseif ($cnt_document > 0) {
2772 2772
 			$columnList = array();
2773 2773
 			$documentList = $oDocumentModel->getDocumentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount);
2774
-			if($documentList) {
2775
-				foreach($documentList as $v) {
2776
-					if($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v);
2774
+			if ($documentList) {
2775
+				foreach ($documentList as $v) {
2776
+					if ($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v);
2777 2777
 					else $oDocumentController->deleteDocument($v->document_srl);
2778 2778
 				}
2779 2779
 			}
@@ -2785,24 +2785,24 @@  discard block
 block discarded – undo
2785 2785
 	function _clearMemberCache($member_srl, $site_srl = 0)
2786 2786
 	{
2787 2787
 		$oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE);
2788
-		if($oCacheHandler->isSupport())
2788
+		if ($oCacheHandler->isSupport())
2789 2789
 		{
2790
-			$object_key = 'member_groups:' . getNumberingPath($member_srl) . $member_srl . '_' . $site_srl;
2790
+			$object_key = 'member_groups:'.getNumberingPath($member_srl).$member_srl.'_'.$site_srl;
2791 2791
 			$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
2792 2792
 			$oCacheHandler->delete($cache_key);
2793 2793
 
2794
-			if($site_srl !== 0)
2794
+			if ($site_srl !== 0)
2795 2795
 			{
2796
-				$object_key = 'member_groups:' . getNumberingPath($member_srl) . $member_srl . '_0';
2796
+				$object_key = 'member_groups:'.getNumberingPath($member_srl).$member_srl.'_0';
2797 2797
 				$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
2798 2798
 				$oCacheHandler->delete($cache_key);
2799 2799
 			}
2800 2800
 		}
2801 2801
 
2802 2802
 		$oCacheHandler = CacheHandler::getInstance('object');
2803
-		if($oCacheHandler->isSupport())
2803
+		if ($oCacheHandler->isSupport())
2804 2804
 		{
2805
-			$object_key = 'member_info:' . getNumberingPath($member_srl) . $member_srl;
2805
+			$object_key = 'member_info:'.getNumberingPath($member_srl).$member_srl;
2806 2806
 			$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
2807 2807
 			$oCacheHandler->delete($cache_key);
2808 2808
 		}
Please login to merge, or discard this patch.
Braces   +590 added lines, -247 removed lines patch added patch discarded remove patch
@@ -41,19 +41,31 @@  discard block
 block discarded – undo
41 41
 		}
42 42
 
43 43
 		// Variables
44
-		if(!$user_id) $user_id = Context::get('user_id');
44
+		if(!$user_id) {
45
+			$user_id = Context::get('user_id');
46
+		}
45 47
 		$user_id = trim($user_id);
46 48
 
47
-		if(!$password) $password = Context::get('password');
49
+		if(!$password) {
50
+			$password = Context::get('password');
51
+		}
48 52
 		$password = trim($password);
49 53
 
50
-		if(!$keep_signed) $keep_signed = Context::get('keep_signed');
54
+		if(!$keep_signed) {
55
+			$keep_signed = Context::get('keep_signed');
56
+		}
51 57
 		// Return an error when id and password doesn't exist
52
-		if(!$user_id) return new Object(-1,'null_user_id');
53
-		if(!$password) return new Object(-1,'null_password');
58
+		if(!$user_id) {
59
+			return new Object(-1,'null_user_id');
60
+		}
61
+		if(!$password) {
62
+			return new Object(-1,'null_password');
63
+		}
54 64
 
55 65
 		$output = $this->doLogin($user_id, $password, $keep_signed=='Y'?true:false);
56
-		if (!$output->toBool()) return $output;
66
+		if (!$output->toBool()) {
67
+			return $output;
68
+		}
57 69
 
58 70
 		$oModuleModel = getModel('module');
59 71
 		$config = $oModuleModel->getModuleConfig('member');
@@ -80,8 +92,7 @@  discard block
 block discarded – undo
80 92
 		if(!$config->after_login_url)
81 93
 		{
82 94
 			$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', '');
83
-		}
84
-		else
95
+		} else
85 96
 		{
86 97
 			$returnUrl = $config->after_login_url;
87 98
 		}
@@ -98,19 +109,24 @@  discard block
 block discarded – undo
98 109
 		// Call a trigger before log-out (before)
99 110
 		$logged_info = Context::get('logged_info');
100 111
 		$trigger_output = ModuleHandler::triggerCall('member.doLogout', 'before', $logged_info);
101
-		if(!$trigger_output->toBool()) return $trigger_output;
112
+		if(!$trigger_output->toBool()) {
113
+			return $trigger_output;
114
+		}
102 115
 		// Destroy session information
103 116
 		$this->destroySessionInfo();
104 117
 		// Call a trigger after log-out (after)
105 118
 		$trigger_output = ModuleHandler::triggerCall('member.doLogout', 'after', $logged_info);
106
-		if(!$trigger_output->toBool()) return $trigger_output;
119
+		if(!$trigger_output->toBool()) {
120
+			return $trigger_output;
121
+		}
107 122
 
108 123
 		$output = new Object();
109 124
 
110 125
 		$oModuleModel = getModel('module');
111 126
 		$config = $oModuleModel->getModuleConfig('member');
112
-		if($config->after_logout_url)
113
-			$output->redirect_url = $config->after_logout_url;
127
+		if($config->after_logout_url) {
128
+					$output->redirect_url = $config->after_logout_url;
129
+		}
114 130
 
115 131
 		$this->_clearMemberCache($logged_info->member_srl);
116 132
 
@@ -125,12 +141,18 @@  discard block
 block discarded – undo
125 141
 	function procMemberScrapDocument()
126 142
 	{
127 143
 		// Check login information
128
-		if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
144
+		if(!Context::get('is_logged')) {
145
+			return new Object(-1, 'msg_not_logged');
146
+		}
129 147
 		$logged_info = Context::get('logged_info');
130 148
 
131 149
 		$document_srl = (int)Context::get('document_srl');
132
-		if(!$document_srl) $document_srl = (int)Context::get('target_srl');
133
-		if(!$document_srl) return new Object(-1,'msg_invalid_request');
150
+		if(!$document_srl) {
151
+			$document_srl = (int)Context::get('target_srl');
152
+		}
153
+		if(!$document_srl) {
154
+			return new Object(-1,'msg_invalid_request');
155
+		}
134 156
 
135 157
 		// Get document
136 158
 		$oDocumentModel = getModel('document');
@@ -153,11 +175,15 @@  discard block
 block discarded – undo
153 175
 
154 176
 		// Check if already scrapped
155 177
 		$output = executeQuery('member.getScrapDocument', $args);
156
-		if($output->data->count) return new Object(-1, 'msg_alreay_scrapped');
178
+		if($output->data->count) {
179
+			return new Object(-1, 'msg_alreay_scrapped');
180
+		}
157 181
 
158 182
 		// Insert
159 183
 		$output = executeQuery('member.addScrapDocument', $args);
160
-		if(!$output->toBool()) return $output;
184
+		if(!$output->toBool()) {
185
+			return $output;
186
+		}
161 187
 
162 188
 		$this->setError(-1);
163 189
 		$this->setMessage('success_registed');
@@ -171,11 +197,15 @@  discard block
 block discarded – undo
171 197
 	function procMemberDeleteScrap()
172 198
 	{
173 199
 		// Check login information
174
-		if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
200
+		if(!Context::get('is_logged')) {
201
+			return new Object(-1, 'msg_not_logged');
202
+		}
175 203
 		$logged_info = Context::get('logged_info');
176 204
 
177 205
 		$document_srl = (int)Context::get('document_srl');
178
-		if(!$document_srl) return new Object(-1,'msg_invalid_request');
206
+		if(!$document_srl) {
207
+			return new Object(-1,'msg_invalid_request');
208
+		}
179 209
 		// Variables
180 210
 		$args = new stdClass;
181 211
 		$args->member_srl = $logged_info->member_srl;
@@ -201,11 +231,15 @@  discard block
 block discarded – undo
201 231
 	function procMemberDeleteSavedDocument()
202 232
 	{
203 233
 		// Check login information
204
-		if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
234
+		if(!Context::get('is_logged')) {
235
+			return new Object(-1, 'msg_not_logged');
236
+		}
205 237
 		$logged_info = Context::get('logged_info');
206 238
 
207 239
 		$document_srl = (int)Context::get('document_srl');
208
-		if(!$document_srl) return new Object(-1,'msg_invalid_request');
240
+		if(!$document_srl) {
241
+			return new Object(-1,'msg_invalid_request');
242
+		}
209 243
 
210 244
 		$oDocumentModel = getModel('document');
211 245
 		$oDocument = $oDocumentModel->getDocument($document_srl);
@@ -233,7 +267,9 @@  discard block
 block discarded – undo
233 267
 	{
234 268
 		$name = Context::get('name');
235 269
 		$value = Context::get('value');
236
-		if(!$value) return;
270
+		if(!$value) {
271
+			return;
272
+		}
237 273
 
238 274
 		$oMemberModel = getModel('member');
239 275
 		// Check if logged-in
@@ -244,10 +280,14 @@  discard block
 block discarded – undo
244 280
 		{
245 281
 			case 'user_id' :
246 282
 				// Check denied ID
247
-				if($oMemberModel->isDeniedID($value)) return new Object(0,'denied_user_id');
283
+				if($oMemberModel->isDeniedID($value)) {
284
+					return new Object(0,'denied_user_id');
285
+				}
248 286
 				// Check if duplicated
249 287
 				$member_srl = $oMemberModel->getMemberSrlByUserID($value);
250
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_user_id');
288
+				if($member_srl && $logged_info->member_srl != $member_srl ) {
289
+					return new Object(0,'msg_exists_user_id');
290
+				}
251 291
 				break;
252 292
 			case 'nick_name' :
253 293
 				// Check denied ID
@@ -257,13 +297,17 @@  discard block
 block discarded – undo
257 297
 				}
258 298
 				// Check if duplicated
259 299
 				$member_srl = $oMemberModel->getMemberSrlByNickName($value);
260
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_nick_name');
300
+				if($member_srl && $logged_info->member_srl != $member_srl ) {
301
+					return new Object(0,'msg_exists_nick_name');
302
+				}
261 303
 
262 304
 				break;
263 305
 			case 'email_address' :
264 306
 				// Check if duplicated
265 307
 				$member_srl = $oMemberModel->getMemberSrlByEmailAddress($value);
266
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_email_address');
308
+				if($member_srl && $logged_info->member_srl != $member_srl ) {
309
+					return new Object(0,'msg_exists_email_address');
310
+				}
267 311
 				break;
268 312
 		}
269 313
 	}
@@ -275,17 +319,25 @@  discard block
 block discarded – undo
275 319
 	 */
276 320
 	function procMemberInsert()
277 321
 	{
278
-		if (Context::getRequestMethod () == "GET") return new Object (-1, "msg_invalid_request");
322
+		if (Context::getRequestMethod () == "GET") {
323
+			return new Object (-1, "msg_invalid_request");
324
+		}
279 325
 		$oMemberModel = &getModel ('member');
280 326
 		$config = $oMemberModel->getMemberConfig();
281 327
 
282 328
 		// call a trigger (before)
283 329
 		$trigger_output = ModuleHandler::triggerCall ('member.procMemberInsert', 'before', $config);
284
-		if(!$trigger_output->toBool ()) return $trigger_output;
330
+		if(!$trigger_output->toBool ()) {
331
+			return $trigger_output;
332
+		}
285 333
 		// Check if an administrator allows a membership
286
-		if($config->enable_join != 'Y') return $this->stop ('msg_signup_disabled');
334
+		if($config->enable_join != 'Y') {
335
+			return $this->stop ('msg_signup_disabled');
336
+		}
287 337
 		// Check if the user accept the license terms (only if terms exist)
288
-		if($config->agreement && Context::get('accept_agreement')!='Y') return $this->stop('msg_accept_agreement');
338
+		if($config->agreement && Context::get('accept_agreement')!='Y') {
339
+			return $this->stop('msg_accept_agreement');
340
+		}
289 341
 
290 342
 		// Extract the necessary information in advance
291 343
 		$getVars = array();
@@ -304,16 +356,22 @@  discard block
 block discarded – undo
304 356
 		foreach($getVars as $val)
305 357
 		{
306 358
 			$args->{$val} = Context::get($val);
307
-			if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
359
+			if($val == 'birthday') {
360
+				$args->birthday_ui = Context::get('birthday_ui');
361
+			}
308 362
 		}
309 363
 		$args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
310
-		if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
364
+		if(!$args->birthday && $args->birthday_ui) {
365
+			$args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
366
+		}
311 367
 
312 368
 		$args->find_account_answer = Context::get('find_account_answer');
313 369
 		$args->allow_mailing = Context::get('allow_mailing');
314 370
 		$args->allow_message = Context::get('allow_message');
315 371
 
316
-		if($args->password1) $args->password = $args->password1;
372
+		if($args->password1) {
373
+			$args->password = $args->password1;
374
+		}
317 375
 
318 376
 		// check password strength
319 377
 		if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
@@ -342,7 +400,9 @@  discard block
 block discarded – undo
342 400
 		unset($all_args->secret_text);
343 401
 
344 402
 		// Set the user state as "denied" when using mail authentication
345
-		if($config->enable_confirm == 'Y') $args->denied = 'Y';
403
+		if($config->enable_confirm == 'Y') {
404
+			$args->denied = 'Y';
405
+		}
346 406
 		// Add extra vars after excluding necessary information from all the requested arguments
347 407
 		$extra_vars = delObjectVars($all_args, $args);
348 408
 		$args->extra_vars = serialize($extra_vars);
@@ -357,7 +417,9 @@  discard block
 block discarded – undo
357 417
 			}
358 418
 		}
359 419
 		$output = $this->insertMember($args);
360
-		if(!$output->toBool()) return $output;
420
+		if(!$output->toBool()) {
421
+			return $output;
422
+		}
361 423
 
362 424
 		// insert ProfileImage, ImageName, ImageMark
363 425
 		$profile_image = $_FILES['profile_image'];
@@ -396,43 +458,46 @@  discard block
 block discarded – undo
396 458
 			if($config->identifier == 'email_address')
397 459
 			{
398 460
 				$output = $this->doLogin($args->email_address);
399
-			}
400
-			else
461
+			} else
401 462
 			{
402 463
 				$output = $this->doLogin($args->user_id);
403 464
 			}
404 465
 			if(!$output->toBool()) {
405
-				if($output->error == -9)
406
-					$output->error = -11;
466
+				if($output->error == -9) {
467
+									$output->error = -11;
468
+				}
407 469
 				return $this->setRedirectUrl(getUrl('', 'act', 'dispMemberLoginForm'), $output);
408 470
 			}
409 471
 		}
410 472
 
411 473
 		// Results
412 474
 		$this->add('member_srl', $args->member_srl);
413
-		if($config->redirect_url) $this->add('redirect_url', $config->redirect_url);
475
+		if($config->redirect_url) {
476
+			$this->add('redirect_url', $config->redirect_url);
477
+		}
414 478
 		if($config->enable_confirm == 'Y')
415 479
 		{
416 480
 			$msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address);
417 481
 			$this->setMessage($msg);
418 482
 			return $this->setRedirectUrl(getUrl('', 'act', 'dispMemberLoginForm'), new Object(-12, $msg));
483
+		} else {
484
+			$this->setMessage('success_registed');
419 485
 		}
420
-		else $this->setMessage('success_registed');
421 486
 		// Call a trigger (after)
422 487
 		$trigger_output = ModuleHandler::triggerCall('member.procMemberInsert', 'after', $config);
423
-		if(!$trigger_output->toBool()) return $trigger_output;
488
+		if(!$trigger_output->toBool()) {
489
+			return $trigger_output;
490
+		}
424 491
 
425 492
 		if($config->redirect_url)
426 493
 		{
427 494
 			$returnUrl = $config->redirect_url;
428
-		}
429
-		else
495
+		} else
430 496
 		{
431 497
 			if(Context::get('success_return_url'))
432 498
 			{
433 499
 				$returnUrl = Context::get('success_return_url');
434
-			}
435
-			else if($_COOKIE['XE_REDIRECT_URL'])
500
+			} else if($_COOKIE['XE_REDIRECT_URL'])
436 501
 			{
437 502
 				$returnUrl = $_COOKIE['XE_REDIRECT_URL'];
438 503
 				setcookie("XE_REDIRECT_URL", '', 1);
@@ -486,8 +551,7 @@  discard block
 block discarded – undo
486 551
 		if(Context::get('success_return_url'))
487 552
 		{
488 553
 			$redirectUrl = Context::get('success_return_url');
489
-		}
490
-		else
554
+		} else
491 555
 		{
492 556
 			$redirectUrl = getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberModifyInfo');
493 557
 		}
@@ -531,13 +595,17 @@  discard block
 block discarded – undo
531 595
 		foreach($getVars as $val)
532 596
 		{
533 597
 			$args->{$val} = Context::get($val);
534
-			if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
598
+			if($val == 'birthday') {
599
+				$args->birthday_ui = Context::get('birthday_ui');
600
+			}
535 601
 		}
536 602
 		// Login Information
537 603
 		$logged_info = Context::get('logged_info');
538 604
 		$args->member_srl = $logged_info->member_srl;
539 605
 		$args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
540
-		if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
606
+		if(!$args->birthday && $args->birthday_ui) {
607
+			$args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
608
+		}
541 609
 		// Remove some unnecessary variables from all the vars
542 610
 		$all_args = Context::getRequestVars();
543 611
 		unset($all_args->module);
@@ -571,7 +639,9 @@  discard block
 block discarded – undo
571 639
 
572 640
 		// Execute insert or update depending on the value of member_srl
573 641
 		$output = $this->updateMember($args);
574
-		if(!$output->toBool()) return $output;
642
+		if(!$output->toBool()) {
643
+			return $output;
644
+		}
575 645
 
576 646
 		$profile_image = $_FILES['profile_image'];
577 647
 		if(is_uploaded_file($profile_image['tmp_name']))
@@ -601,7 +671,9 @@  discard block
 block discarded – undo
601 671
 
602 672
 		// Call a trigger after successfully log-in (after)
603 673
 		$trigger_output = ModuleHandler::triggerCall('member.procMemberModifyInfo', 'after', $this->memberInfo);
604
-		if(!$trigger_output->toBool()) return $trigger_output;
674
+		if(!$trigger_output->toBool()) {
675
+			return $trigger_output;
676
+		}
605 677
 
606 678
 		$this->setSessionInfo();
607 679
 		// Return result
@@ -622,7 +694,9 @@  discard block
 block discarded – undo
622 694
 	 */
623 695
 	function procMemberModifyPassword()
624 696
 	{
625
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
697
+		if(!Context::get('is_logged')) {
698
+			return $this->stop('msg_not_logged');
699
+		}
626 700
 		// Extract the necessary information in advance
627 701
 		$current_password = trim(Context::get('current_password'));
628 702
 		$password = trim(Context::get('password1'));
@@ -636,17 +710,23 @@  discard block
 block discarded – undo
636 710
 
637 711
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
638 712
 		// Verify the cuttent password
639
-		if(!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) return new Object(-1, 'invalid_password');
713
+		if(!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) {
714
+			return new Object(-1, 'invalid_password');
715
+		}
640 716
 
641 717
 		// Check if a new password is as same as the previous password
642
-		if($current_password == $password) return new Object(-1, 'invalid_new_password');
718
+		if($current_password == $password) {
719
+			return new Object(-1, 'invalid_new_password');
720
+		}
643 721
 
644 722
 		// Execute insert or update depending on the value of member_srl
645 723
 		$args = new stdClass;
646 724
 		$args->member_srl = $member_srl;
647 725
 		$args->password = $password;
648 726
 		$output = $this->updateMemberPassword($args);
649
-		if(!$output->toBool()) return $output;
727
+		if(!$output->toBool()) {
728
+			return $output;
729
+		}
650 730
 
651 731
 		$this->add('member_srl', $args->member_srl);
652 732
 		$this->setMessage('success_updated');
@@ -662,7 +742,9 @@  discard block
 block discarded – undo
662 742
 	 */
663 743
 	function procMemberLeave()
664 744
 	{
665
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
745
+		if(!Context::get('is_logged')) {
746
+			return $this->stop('msg_not_logged');
747
+		}
666 748
 		// Extract the necessary information in advance
667 749
 		$password = trim(Context::get('password'));
668 750
 		// Get information of logged-in user
@@ -678,10 +760,14 @@  discard block
 block discarded – undo
678 760
 			$this->memberInfo->password = $memberInfo->password;
679 761
 		}
680 762
 		// Verify the cuttent password
681
-		if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) return new Object(-1, 'invalid_password');
763
+		if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) {
764
+			return new Object(-1, 'invalid_password');
765
+		}
682 766
 
683 767
 		$output = $this->deleteMember($member_srl);
684
-		if(!$output->toBool()) return $output;
768
+		if(!$output->toBool()) {
769
+			return $output;
770
+		}
685 771
 		// Destroy all session information
686 772
 		$this->destroySessionInfo();
687 773
 		// Return success message
@@ -700,17 +786,25 @@  discard block
 block discarded – undo
700 786
 	{
701 787
 		// Check if the file is successfully uploaded
702 788
 		$file = $_FILES['profile_image'];
703
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_profile_image');
789
+		if(!is_uploaded_file($file['tmp_name'])) {
790
+			return $this->stop('msg_not_uploaded_profile_image');
791
+		}
704 792
 		// Ignore if member_srl is invalid or doesn't exist.
705 793
 		$member_srl = Context::get('member_srl');
706
-		if(!$member_srl) return $this->stop('msg_not_uploaded_profile_image');
794
+		if(!$member_srl) {
795
+			return $this->stop('msg_not_uploaded_profile_image');
796
+		}
707 797
 
708 798
 		$logged_info = Context::get('logged_info');
709
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_profile_image');
799
+		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) {
800
+			return $this->stop('msg_not_uploaded_profile_image');
801
+		}
710 802
 		// Return if member module is set not to use an image name or the user is not an administrator ;
711 803
 		$oModuleModel = getModel('module');
712 804
 		$config = $oModuleModel->getModuleConfig('member');
713
-		if($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') return $this->stop('msg_not_uploaded_profile_image');
805
+		if($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') {
806
+			return $this->stop('msg_not_uploaded_profile_image');
807
+		}
714 808
 
715 809
 		$this->insertProfileImage($member_srl, $file['tmp_name']);
716 810
 		// Page refresh
@@ -732,26 +826,35 @@  discard block
 block discarded – undo
732 826
 	{
733 827
 
734 828
 		// Check uploaded file
735
-		if(!checkUploadedFile($target_file)) return;
829
+		if(!checkUploadedFile($target_file)) {
830
+			return;
831
+		}
736 832
 
737 833
 		$oMemberModel = getModel('member');
738 834
 		$config = $oMemberModel->getMemberConfig();
739 835
 
740 836
 		// Get an image size
741 837
 		$max_width = $config->profile_image_max_width;
742
-		if(!$max_width) $max_width = "90";
838
+		if(!$max_width) {
839
+			$max_width = "90";
840
+		}
743 841
 		$max_height = $config->profile_image_max_height;
744
-		if(!$max_height) $max_height = "90";
842
+		if(!$max_height) {
843
+			$max_height = "90";
844
+		}
745 845
 		// Get a target path to save
746 846
 		$target_path = sprintf('files/member_extra_info/profile_image/%s', getNumberingPath($member_srl));
747 847
 		FileHandler::makeDir($target_path);
748 848
 
749 849
 		// Get file information
750 850
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
751
-		if(IMAGETYPE_PNG == $type) $ext = 'png';
752
-		elseif(IMAGETYPE_JPEG == $type) $ext = 'jpg';
753
-		elseif(IMAGETYPE_GIF == $type) $ext = 'gif';
754
-		else
851
+		if(IMAGETYPE_PNG == $type) {
852
+			$ext = 'png';
853
+		} elseif(IMAGETYPE_JPEG == $type) {
854
+			$ext = 'jpg';
855
+		} elseif(IMAGETYPE_GIF == $type) {
856
+			$ext = 'gif';
857
+		} else
755 858
 		{
756 859
 			return;
757 860
 		}
@@ -763,8 +866,7 @@  discard block
 block discarded – undo
763 866
 		if(($width > $max_width || $height > $max_height ) && $type != 1)
764 867
 		{
765 868
 			FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, $ext);
766
-		}
767
-		else
869
+		} else
768 870
 		{
769 871
 			@copy($target_file, $target_filename);
770 872
 		}
@@ -779,17 +881,25 @@  discard block
 block discarded – undo
779 881
 	{
780 882
 		// Check if the file is successfully uploaded
781 883
 		$file = $_FILES['image_name'];
782
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name');
884
+		if(!is_uploaded_file($file['tmp_name'])) {
885
+			return $this->stop('msg_not_uploaded_image_name');
886
+		}
783 887
 		// Ignore if member_srl is invalid or doesn't exist.
784 888
 		$member_srl = Context::get('member_srl');
785
-		if(!$member_srl) return $this->stop('msg_not_uploaded_image_name');
889
+		if(!$member_srl) {
890
+			return $this->stop('msg_not_uploaded_image_name');
891
+		}
786 892
 
787 893
 		$logged_info = Context::get('logged_info');
788
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name');
894
+		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) {
895
+			return $this->stop('msg_not_uploaded_image_name');
896
+		}
789 897
 		// Return if member module is set not to use an image name or the user is not an administrator ;
790 898
 		$oModuleModel = getModel('module');
791 899
 		$config = $oModuleModel->getModuleConfig('member');
792
-		if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name');
900
+		if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') {
901
+			return $this->stop('msg_not_uploaded_image_name');
902
+		}
793 903
 
794 904
 		$this->insertImageName($member_srl, $file['tmp_name']);
795 905
 		// Page refresh
@@ -810,15 +920,21 @@  discard block
 block discarded – undo
810 920
 	function insertImageName($member_srl, $target_file)
811 921
 	{
812 922
 		// Check uploaded file
813
-		if(!checkUploadedFile($target_file)) return;
923
+		if(!checkUploadedFile($target_file)) {
924
+			return;
925
+		}
814 926
 
815 927
 		$oModuleModel = getModel('module');
816 928
 		$config = $oModuleModel->getModuleConfig('member');
817 929
 		// Get an image size
818 930
 		$max_width = $config->image_name_max_width;
819
-		if(!$max_width) $max_width = "90";
931
+		if(!$max_width) {
932
+			$max_width = "90";
933
+		}
820 934
 		$max_height = $config->image_name_max_height;
821
-		if(!$max_height) $max_height = "20";
935
+		if(!$max_height) {
936
+			$max_height = "20";
937
+		}
822 938
 		// Get a target path to save
823 939
 		$target_path = sprintf('files/member_extra_info/image_name/%s/', getNumberingPath($member_srl));
824 940
 		FileHandler::makeDir($target_path);
@@ -827,8 +943,11 @@  discard block
 block discarded – undo
827 943
 		// Get file information
828 944
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
829 945
 		// Convert if the image size is larger than a given size or if the format is not a gif
830
-		if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
831
-		else @copy($target_file, $target_filename);
946
+		if($width > $max_width || $height > $max_height || $type!=1) {
947
+			FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
948
+		} else {
949
+			@copy($target_file, $target_filename);
950
+		}
832 951
 	}
833 952
 
834 953
 	/**
@@ -888,17 +1007,25 @@  discard block
 block discarded – undo
888 1007
 	{
889 1008
 		// Check if the file is successfully uploaded
890 1009
 		$file = $_FILES['image_mark'];
891
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark');
1010
+		if(!is_uploaded_file($file['tmp_name'])) {
1011
+			return $this->stop('msg_not_uploaded_image_mark');
1012
+		}
892 1013
 		// Ignore if member_srl is invalid or doesn't exist.
893 1014
 		$member_srl = Context::get('member_srl');
894
-		if(!$member_srl) return $this->stop('msg_not_uploaded_image_mark');
1015
+		if(!$member_srl) {
1016
+			return $this->stop('msg_not_uploaded_image_mark');
1017
+		}
895 1018
 
896 1019
 		$logged_info = Context::get('logged_info');
897
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark');
1020
+		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) {
1021
+			return $this->stop('msg_not_uploaded_image_mark');
1022
+		}
898 1023
 		// Membership in the images mark the module using the ban was set by an administrator or return;
899 1024
 		$oModuleModel = getModel('module');
900 1025
 		$config = $oModuleModel->getModuleConfig('member');
901
-		if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark');
1026
+		if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') {
1027
+			return $this->stop('msg_not_uploaded_image_mark');
1028
+		}
902 1029
 
903 1030
 		$this->insertImageMark($member_srl, $file['tmp_name']);
904 1031
 		// Page refresh
@@ -919,15 +1046,21 @@  discard block
 block discarded – undo
919 1046
 	function insertImageMark($member_srl, $target_file)
920 1047
 	{
921 1048
 		// Check uploaded file
922
-		if(!checkUploadedFile($target_file)) return;
1049
+		if(!checkUploadedFile($target_file)) {
1050
+			return;
1051
+		}
923 1052
 
924 1053
 		$oModuleModel = getModel('module');
925 1054
 		$config = $oModuleModel->getModuleConfig('member');
926 1055
 		// Get an image size
927 1056
 		$max_width = $config->image_mark_max_width;
928
-		if(!$max_width) $max_width = "20";
1057
+		if(!$max_width) {
1058
+			$max_width = "20";
1059
+		}
929 1060
 		$max_height = $config->image_mark_max_height;
930
-		if(!$max_height) $max_height = "20";
1061
+		if(!$max_height) {
1062
+			$max_height = "20";
1063
+		}
931 1064
 
932 1065
 		$target_path = sprintf('files/member_extra_info/image_mark/%s/', getNumberingPath($member_srl));
933 1066
 		FileHandler::makeDir($target_path);
@@ -936,8 +1069,11 @@  discard block
 block discarded – undo
936 1069
 		// Get file information
937 1070
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
938 1071
 
939
-		if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
940
-		else @copy($target_file, $target_filename);
1072
+		if($width > $max_width || $height > $max_height || $type!=1) {
1073
+			FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
1074
+		} else {
1075
+			@copy($target_file, $target_filename);
1076
+		}
941 1077
 	}
942 1078
 
943 1079
 	/**
@@ -972,14 +1108,18 @@  discard block
 block discarded – undo
972 1108
 	function procMemberFindAccount()
973 1109
 	{
974 1110
 		$email_address = Context::get('email_address');
975
-		if(!$email_address) return new Object(-1, 'msg_invalid_request');
1111
+		if(!$email_address) {
1112
+			return new Object(-1, 'msg_invalid_request');
1113
+		}
976 1114
 
977 1115
 		$oMemberModel = getModel('member');
978 1116
 		$oModuleModel = getModel('module');
979 1117
 
980 1118
 		// Check if a member having the same email address exists
981 1119
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
982
-		if(!$member_srl) return new Object(-1, 'msg_email_not_exists');
1120
+		if(!$member_srl) {
1121
+			return new Object(-1, 'msg_email_not_exists');
1122
+		}
983 1123
 
984 1124
 		// Get information of the member
985 1125
 		$columnList = array('denied', 'member_srl', 'user_id', 'user_name', 'email_address', 'nick_name');
@@ -991,7 +1131,9 @@  discard block
 block discarded – undo
991 1131
 			$chk_args = new stdClass;
992 1132
 			$chk_args->member_srl = $member_info->member_srl;
993 1133
 			$output = executeQuery('member.chkAuthMail', $chk_args);
994
-			if($output->toBool() && $output->data->count != '0') return new Object(-1, 'msg_user_not_confirmed');
1134
+			if($output->toBool() && $output->data->count != '0') {
1135
+				return new Object(-1, 'msg_user_not_confirmed');
1136
+			}
995 1137
 		}
996 1138
 
997 1139
 		// Insert data into the authentication DB
@@ -1004,7 +1146,9 @@  discard block
 block discarded – undo
1004 1146
 		$args->is_register = 'N';
1005 1147
 
1006 1148
 		$output = executeQuery('member.insertAuthMail', $args);
1007
-		if(!$output->toBool()) return $output;
1149
+		if(!$output->toBool()) {
1150
+			return $output;
1151
+		}
1008 1152
 		// Get content of the email to send a member
1009 1153
 		Context::set('auth_args', $args);
1010 1154
 
@@ -1021,8 +1165,7 @@  discard block
 block discarded – undo
1021 1165
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1022 1166
 				}
1023 1167
 			}
1024
-		}
1025
-		else
1168
+		} else
1026 1169
 		{
1027 1170
 			$memberInfo[$lang->user_id] = $args->user_id;
1028 1171
 			$memberInfo[$lang->user_name] = $args->user_name;
@@ -1031,13 +1174,19 @@  discard block
 block discarded – undo
1031 1174
 		}
1032 1175
 		Context::set('memberInfo', $memberInfo);
1033 1176
 
1034
-		if(!$member_config->skin) $member_config->skin = "default";
1035
-		if(!$member_config->colorset) $member_config->colorset = "white";
1177
+		if(!$member_config->skin) {
1178
+			$member_config->skin = "default";
1179
+		}
1180
+		if(!$member_config->colorset) {
1181
+			$member_config->colorset = "white";
1182
+		}
1036 1183
 
1037 1184
 		Context::set('member_config', $member_config);
1038 1185
 
1039 1186
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1040
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1187
+		if(!is_dir($tpl_path)) {
1188
+			$tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1189
+		}
1041 1190
 
1042 1191
 		$find_url = getFullUrl ('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key);
1043 1192
 		Context::set('find_url', $find_url);
@@ -1079,20 +1228,28 @@  discard block
 block discarded – undo
1079 1228
 		$find_account_question = trim(Context::get('find_account_question'));
1080 1229
 		$find_account_answer = trim(Context::get('find_account_answer'));
1081 1230
 
1082
-		if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new Object(-1, 'msg_invalid_request');
1231
+		if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) {
1232
+			return new Object(-1, 'msg_invalid_request');
1233
+		}
1083 1234
 
1084 1235
 		$oModuleModel = getModel('module');
1085 1236
 		// Check if a member having the same email address exists
1086 1237
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1087
-		if(!$member_srl) return new Object(-1, 'msg_email_not_exists');
1238
+		if(!$member_srl) {
1239
+			return new Object(-1, 'msg_email_not_exists');
1240
+		}
1088 1241
 		// Get information of the member
1089 1242
 		$columnList = array('member_srl', 'find_account_question', 'find_account_answer');
1090 1243
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
1091 1244
 
1092 1245
 		// Display a message if no answer is entered
1093
-		if(!$member_info->find_account_question || !$member_info->find_account_answer) return new Object(-1, 'msg_question_not_exists');
1246
+		if(!$member_info->find_account_question || !$member_info->find_account_answer) {
1247
+			return new Object(-1, 'msg_question_not_exists');
1248
+		}
1094 1249
 
1095
-		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');
1250
+		if(trim($member_info->find_account_question) != $find_account_question || trim($member_info->find_account_answer) != $find_account_answer) {
1251
+			return new Object(-1, 'msg_answer_not_matches');
1252
+		}
1096 1253
 
1097 1254
 		if($config->identifier == 'email_address')
1098 1255
 		{
@@ -1108,7 +1265,9 @@  discard block
 block discarded – undo
1108 1265
 		$args->password = $temp_password;
1109 1266
 		$args->change_password_date = '1';
1110 1267
 		$output = $this->updateMemberPassword($args);
1111
-		if(!$output->toBool()) return $output;
1268
+		if(!$output->toBool()) {
1269
+			return $output;
1270
+		}
1112 1271
 
1113 1272
 		$_SESSION['xe_temp_password_' . $user_id] = $temp_password;
1114 1273
 
@@ -1165,8 +1324,7 @@  discard block
 block discarded – undo
1165 1324
 		if($output->data->is_register == 'Y')
1166 1325
 		{
1167 1326
 			$args->denied = 'N';
1168
-		}
1169
-		else
1327
+		} else
1170 1328
 		{
1171 1329
 			$args->password = $oMemberModel->hashPassword($args->password);
1172 1330
 		}
@@ -1200,33 +1358,45 @@  discard block
 block discarded – undo
1200 1358
 	{
1201 1359
 		// Get an email_address
1202 1360
 		$email_address = Context::get('email_address');
1203
-		if(!$email_address) return new Object(-1, 'msg_invalid_request');
1361
+		if(!$email_address) {
1362
+			return new Object(-1, 'msg_invalid_request');
1363
+		}
1204 1364
 		// Log test by using email_address
1205 1365
 		$oMemberModel = getModel('member');
1206 1366
 
1207 1367
 		$args = new stdClass;
1208 1368
 		$args->email_address = $email_address;
1209 1369
 		$memberSrl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1210
-		if(!$memberSrl) return new Object(-1, 'msg_not_exists_member');
1370
+		if(!$memberSrl) {
1371
+			return new Object(-1, 'msg_not_exists_member');
1372
+		}
1211 1373
 
1212 1374
 		$columnList = array('member_srl', 'user_id', 'user_name', 'nick_name', 'email_address');
1213 1375
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($memberSrl, 0, $columnList);
1214 1376
 
1215 1377
 		$oModuleModel = getModel('module');
1216 1378
 		$member_config = $oModuleModel->getModuleConfig('member');
1217
-		if(!$member_config->skin) $member_config->skin = "default";
1218
-		if(!$member_config->colorset) $member_config->colorset = "white";
1379
+		if(!$member_config->skin) {
1380
+			$member_config->skin = "default";
1381
+		}
1382
+		if(!$member_config->colorset) {
1383
+			$member_config->colorset = "white";
1384
+		}
1219 1385
 
1220 1386
 		// Check if a authentication mail has been sent previously
1221 1387
 		$chk_args = new stdClass;
1222 1388
 		$chk_args->member_srl = $member_info->member_srl;
1223 1389
 		$output = executeQuery('member.chkAuthMail', $chk_args);
1224
-		if($output->toBool() && $output->data->count == '0') return new Object(-1, 'msg_invalid_request');
1390
+		if($output->toBool() && $output->data->count == '0') {
1391
+			return new Object(-1, 'msg_invalid_request');
1392
+		}
1225 1393
 
1226 1394
 		$auth_args = new stdClass;
1227 1395
 		$auth_args->member_srl = $member_info->member_srl;
1228 1396
 		$output = executeQueryArray('member.getAuthMailInfo', $auth_args);
1229
-		if(!$output->data || !$output->data[0]->auth_key)  return new Object(-1, 'msg_invalid_request');
1397
+		if(!$output->data || !$output->data[0]->auth_key) {
1398
+			return new Object(-1, 'msg_invalid_request');
1399
+		}
1230 1400
 		$auth_info = $output->data[0];
1231 1401
 
1232 1402
 		// Update the regdate of authmail entry
@@ -1247,8 +1417,7 @@  discard block
 block discarded – undo
1247 1417
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1248 1418
 				}
1249 1419
 			}
1250
-		}
1251
-		else
1420
+		} else
1252 1421
 		{
1253 1422
 			$memberInfo[$lang->user_id] = $member_info->user_id;
1254 1423
 			$memberInfo[$lang->user_name] = $member_info->user_name;
@@ -1261,7 +1430,9 @@  discard block
 block discarded – undo
1261 1430
 		Context::set('member_config', $member_config);
1262 1431
 
1263 1432
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1264
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1433
+		if(!is_dir($tpl_path)) {
1434
+			$tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1435
+		}
1265 1436
 
1266 1437
 		$auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_info->auth_key);
1267 1438
 		Context::set('auth_url', $auth_url);
@@ -1339,7 +1510,9 @@  discard block
 block discarded – undo
1339 1510
 		$auth_args->is_register = 'Y';
1340 1511
 
1341 1512
 		$output = executeQuery('member.insertAuthMail', $auth_args);
1342
-		if(!$output->toBool()) return $output;
1513
+		if(!$output->toBool()) {
1514
+			return $output;
1515
+		}
1343 1516
 
1344 1517
 		$memberInfo->email_address = $newEmail;
1345 1518
 
@@ -1373,8 +1546,7 @@  discard block
 block discarded – undo
1373 1546
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1374 1547
 				}
1375 1548
 			}
1376
-		}
1377
-		else
1549
+		} else
1378 1550
 		{
1379 1551
 			$memberInfo[$lang->user_id] = $member_info->user_id;
1380 1552
 			$memberInfo[$lang->user_name] = $member_info->user_name;
@@ -1383,13 +1555,19 @@  discard block
 block discarded – undo
1383 1555
 		}
1384 1556
 		Context::set('memberInfo', $memberInfo);
1385 1557
 
1386
-		if(!$member_config->skin) $member_config->skin = "default";
1387
-		if(!$member_config->colorset) $member_config->colorset = "white";
1558
+		if(!$member_config->skin) {
1559
+			$member_config->skin = "default";
1560
+		}
1561
+		if(!$member_config->colorset) {
1562
+			$member_config->colorset = "white";
1563
+		}
1388 1564
 
1389 1565
 		Context::set('member_config', $member_config);
1390 1566
 
1391 1567
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1392
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1568
+		if(!is_dir($tpl_path)) {
1569
+			$tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1570
+		}
1393 1571
 
1394 1572
 		$auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key);
1395 1573
 		Context::set('auth_url', $auth_url);
@@ -1414,7 +1592,9 @@  discard block
 block discarded – undo
1414 1592
 	{
1415 1593
 		$site_module_info = Context::get('site_module_info');
1416 1594
 		$logged_info = Context::get('logged_info');
1417
-		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new Object(-1,'msg_invalid_request');
1595
+		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) {
1596
+			return new Object(-1,'msg_invalid_request');
1597
+		}
1418 1598
 
1419 1599
 		$oMemberModel = getModel('member');
1420 1600
 		$columnList = array('site_srl', 'group_srl', 'title');
@@ -1433,13 +1613,17 @@  discard block
 block discarded – undo
1433 1613
 	{
1434 1614
 		$site_module_info = Context::get('site_module_info');
1435 1615
 		$logged_info = Context::get('logged_info');
1436
-		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new Object(-1,'msg_invalid_request');
1616
+		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) {
1617
+			return new Object(-1,'msg_invalid_request');
1618
+		}
1437 1619
 
1438 1620
 		$args = new stdClass;
1439 1621
 		$args->site_srl= $site_module_info->site_srl;
1440 1622
 		$args->member_srl = $logged_info->member_srl;
1441 1623
 		$output = executeQuery('member.deleteMembersGroup', $args);
1442
-		if(!$output->toBool()) return $output;
1624
+		if(!$output->toBool()) {
1625
+			return $output;
1626
+		}
1443 1627
 		$this->setMessage('success_deleted');
1444 1628
 		$this->_clearMemberCache($args->member_srl, $site_module_info->site_srl);
1445 1629
 	}
@@ -1453,17 +1637,37 @@  discard block
 block discarded – undo
1453 1637
 	 */
1454 1638
 	function setMemberConfig($args)
1455 1639
 	{
1456
-		if(!$args->skin) $args->skin = "default";
1457
-		if(!$args->colorset) $args->colorset = "white";
1458
-		if(!$args->editor_skin) $args->editor_skin= "ckeditor";
1459
-		if(!$args->editor_colorset) $args->editor_colorset = "moono";
1460
-		if($args->enable_join!='Y') $args->enable_join = 'N';
1640
+		if(!$args->skin) {
1641
+			$args->skin = "default";
1642
+		}
1643
+		if(!$args->colorset) {
1644
+			$args->colorset = "white";
1645
+		}
1646
+		if(!$args->editor_skin) {
1647
+			$args->editor_skin= "ckeditor";
1648
+		}
1649
+		if(!$args->editor_colorset) {
1650
+			$args->editor_colorset = "moono";
1651
+		}
1652
+		if($args->enable_join!='Y') {
1653
+			$args->enable_join = 'N';
1654
+		}
1461 1655
 		$args->enable_openid= 'N';
1462
-		if($args->profile_image !='Y') $args->profile_image = 'N';
1463
-		if($args->image_name!='Y') $args->image_name = 'N';
1464
-		if($args->image_mark!='Y') $args->image_mark = 'N';
1465
-		if($args->group_image_mark!='Y') $args->group_image_mark = 'N';
1466
-		if(!trim(strip_tags($args->agreement))) $args->agreement = null;
1656
+		if($args->profile_image !='Y') {
1657
+			$args->profile_image = 'N';
1658
+		}
1659
+		if($args->image_name!='Y') {
1660
+			$args->image_name = 'N';
1661
+		}
1662
+		if($args->image_mark!='Y') {
1663
+			$args->image_mark = 'N';
1664
+		}
1665
+		if($args->group_image_mark!='Y') {
1666
+			$args->group_image_mark = 'N';
1667
+		}
1668
+		if(!trim(strip_tags($args->agreement))) {
1669
+			$args->agreement = null;
1670
+		}
1467 1671
 		$args->limit_day = (int)$args->limit_day;
1468 1672
 
1469 1673
 		$agreement = trim($args->agreement);
@@ -1471,7 +1675,9 @@  discard block
 block discarded – undo
1471 1675
 
1472 1676
 		$oModuleController = getController('module');
1473 1677
 		$output = $oModuleController->insertModuleConfig('member',$args);
1474
-		if(!$output->toBool()) return $output;
1678
+		if(!$output->toBool()) {
1679
+			return $output;
1680
+		}
1475 1681
 
1476 1682
 		$agreement_file = _XE_PATH_.'files/member_extra_info/agreement.txt';
1477 1683
 		FileHandler::writeFile($agreement_file, $agreement);
@@ -1496,7 +1702,9 @@  discard block
 block discarded – undo
1496 1702
 		$path = sprintf('files/member_extra_info/signature/%s/', getNumberingPath($member_srl));
1497 1703
 		$filename = sprintf('%s%d.signature.php', $path, $member_srl);
1498 1704
 
1499
-		if(!$check_signature) return FileHandler::removeFile($filename);
1705
+		if(!$check_signature) {
1706
+			return FileHandler::removeFile($filename);
1707
+		}
1500 1708
 
1501 1709
 		$buff = sprintf('<?php if(!defined("__XE__")) exit();?>%s', $signature);
1502 1710
 		FileHandler::makeDir($path);
@@ -1530,7 +1738,9 @@  discard block
 block discarded – undo
1530 1738
 		$args = new stdClass();
1531 1739
 		$args->member_srl = $member_srl;
1532 1740
 		$args->group_srl = $group_srl;
1533
-		if($site_srl) $args->site_srl = $site_srl;
1741
+		if($site_srl) {
1742
+			$args->site_srl = $site_srl;
1743
+		}
1534 1744
 
1535 1745
 		// Add
1536 1746
 		$output = executeQuery('member.addMemberToGroup',$args);
@@ -1556,15 +1766,21 @@  discard block
 block discarded – undo
1556 1766
 		$obj->member_srl = implode(',',$args->member_srl);
1557 1767
 
1558 1768
 		$output = executeQueryArray('member.getMembersGroup', $obj);
1559
-		if($output->data) foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate;
1769
+		if($output->data) {
1770
+			foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate;
1771
+		}
1560 1772
 
1561 1773
 		$output = executeQuery('member.deleteMembersGroup', $obj);
1562
-		if(!$output->toBool()) return $output;
1774
+		if(!$output->toBool()) {
1775
+			return $output;
1776
+		}
1563 1777
 
1564 1778
 		$inserted_members = array();
1565 1779
 		foreach($args->member_srl as $key => $val)
1566 1780
 		{
1567
-			if($inserted_members[$val]) continue;
1781
+			if($inserted_members[$val]) {
1782
+				continue;
1783
+			}
1568 1784
 			$inserted_members[$val] = true;
1569 1785
 
1570 1786
 			unset($obj);
@@ -1574,7 +1790,9 @@  discard block
 block discarded – undo
1574 1790
 			$obj->site_srl = $args->site_srl;
1575 1791
 			$obj->regdate = $date[$obj->member_srl];
1576 1792
 			$output = executeQuery('member.addMemberToGroup', $obj);
1577
-			if(!$output->toBool()) return $output;
1793
+			if(!$output->toBool()) {
1794
+				return $output;
1795
+			}
1578 1796
 
1579 1797
 			$this->_clearMemberCache($obj->member_srl, $args->site_srl);
1580 1798
 		}
@@ -1636,8 +1854,7 @@  discard block
 block discarded – undo
1636 1854
 				if($config->identifier == 'user_id')
1637 1855
 				{
1638 1856
 					$member_info = $oMemberModel->getMemberInfoByUserID($user_id, $columnList);
1639
-				}
1640
-				else
1857
+				} else
1641 1858
 				{
1642 1859
 					$member_info = $oMemberModel->getMemberInfoByEmailAddress($user_id, $columnList);
1643 1860
 				}
@@ -1646,8 +1863,7 @@  discard block
 block discarded – undo
1646 1863
 					$do_auto_login = true;
1647 1864
 				}
1648 1865
 
1649
-			}
1650
-			else
1866
+			} else
1651 1867
 			{
1652 1868
 				$do_auto_login = true;
1653 1869
 			}
@@ -1656,8 +1872,7 @@  discard block
 block discarded – undo
1656 1872
 		if($do_auto_login)
1657 1873
 		{
1658 1874
 			$output = $this->doLogin($user_id);
1659
-		}
1660
-		else
1875
+		} else
1661 1876
 		{
1662 1877
 			executeQuery('member.deleteAutologin', $args);
1663 1878
 			setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365);
@@ -1676,13 +1891,17 @@  discard block
 block discarded – undo
1676 1891
 	function doLogin($user_id, $password = '', $keep_signed = false)
1677 1892
 	{
1678 1893
 		$user_id = strtolower($user_id);
1679
-		if(!$user_id) return new Object(-1, 'null_user_id');
1894
+		if(!$user_id) {
1895
+			return new Object(-1, 'null_user_id');
1896
+		}
1680 1897
 		// Call a trigger before log-in (before)
1681 1898
 		$trigger_obj = new stdClass();
1682 1899
 		$trigger_obj->user_id = $user_id;
1683 1900
 		$trigger_obj->password = $password;
1684 1901
 		$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'before', $trigger_obj);
1685
-		if(!$trigger_output->toBool()) return $trigger_output;
1902
+		if(!$trigger_output->toBool()) {
1903
+			return $trigger_output;
1904
+		}
1686 1905
 		// Create a member model object
1687 1906
 		$oMemberModel = getModel('member');
1688 1907
 
@@ -1697,15 +1916,18 @@  discard block
 block discarded – undo
1697 1916
 			// Get user_id information
1698 1917
 			$this->memberInfo = $oMemberModel->getMemberInfoByEmailAddress($user_id);
1699 1918
 			// Set an invalid user if no value returned
1700
-			if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address');
1919
+			if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) {
1920
+				return $this->recordLoginError(-1, 'invalid_email_address');
1921
+			}
1701 1922
 
1702
-		}
1703
-		else
1923
+		} else
1704 1924
 		{
1705 1925
 			// Get user_id information
1706 1926
 			$this->memberInfo = $oMemberModel->getMemberInfoByUserID($user_id);
1707 1927
 			// Set an invalid user if no value returned
1708
-			if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id');
1928
+			if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) {
1929
+				return $this->recordLoginError(-1, 'invalid_user_id');
1930
+			}
1709 1931
 		}
1710 1932
 
1711 1933
 		$output = executeQuery('member.getLoginCountByIp', $args);
@@ -1717,14 +1939,18 @@  discard block
 block discarded – undo
1717 1939
 			if($term < $config->max_error_count_time)
1718 1940
 			{
1719 1941
 				$term = $config->max_error_count_time - $term;
1720
-				if($term < 60) $term = intval($term).Context::getLang('unit_sec');
1721
-				elseif(60 <= $term && $term < 3600) $term = intval($term/60).Context::getLang('unit_min');
1722
-				elseif(3600 <= $term && $term < 86400) $term = intval($term/3600).Context::getLang('unit_hour');
1723
-				else $term = intval($term/86400).Context::getLang('unit_day');
1942
+				if($term < 60) {
1943
+					$term = intval($term).Context::getLang('unit_sec');
1944
+				} elseif(60 <= $term && $term < 3600) {
1945
+					$term = intval($term/60).Context::getLang('unit_min');
1946
+				} elseif(3600 <= $term && $term < 86400) {
1947
+					$term = intval($term/3600).Context::getLang('unit_hour');
1948
+				} else {
1949
+					$term = intval($term/86400).Context::getLang('unit_day');
1950
+				}
1724 1951
 
1725 1952
 				return new Object(-1, sprintf(Context::getLang('excess_ip_access_count'),$term));
1726
-			}
1727
-			else
1953
+			} else
1728 1954
 			{
1729 1955
 				$args->ipaddress = $_SERVER['REMOTE_ADDR'];
1730 1956
 				$output = executeQuery('member.deleteLoginCountByIp', $args);
@@ -1751,7 +1977,9 @@  discard block
 block discarded – undo
1751 1977
 			return new Object(-1,'msg_user_denied');
1752 1978
 		}
1753 1979
 		// Notify if denied_date is less than the current time
1754
-		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")));
1980
+		if($this->memberInfo->limit_date && substr($this->memberInfo->limit_date,0,8) >= date("Ymd")) {
1981
+			return new Object(-9,sprintf(Context::getLang('msg_user_limited'),zdate($this->memberInfo->limit_date,"Y-m-d")));
1982
+		}
1755 1983
 		// Update the latest login time
1756 1984
 		$args->member_srl = $this->memberInfo->member_srl;
1757 1985
 		$output = executeQuery('member.updateLastLogin', $args);
@@ -1800,7 +2028,9 @@  discard block
 block discarded – undo
1800 2028
 		}
1801 2029
 		// Call a trigger after successfully log-in (after)
1802 2030
 		$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'after', $this->memberInfo);
1803
-		if(!$trigger_output->toBool()) return $trigger_output;
2031
+		if(!$trigger_output->toBool()) {
2032
+			return $trigger_output;
2033
+		}
1804 2034
 		// When user checked to use auto-login
1805 2035
 		if($keep_signed)
1806 2036
 		{
@@ -1814,7 +2044,9 @@  discard block
 block discarded – undo
1814 2044
 			$autologin_args->member_srl = $this->memberInfo->member_srl;
1815 2045
 			executeQuery('member.deleteAutologin', $autologin_args);
1816 2046
 			$autologin_output = executeQuery('member.insertAutologin', $autologin_args);
1817
-			if($autologin_output->toBool()) setCookie('xeak',$autologin_args->autologin_key, $_SERVER['REQUEST_TIME']+31536000);
2047
+			if($autologin_output->toBool()) {
2048
+				setCookie('xeak',$autologin_args->autologin_key, $_SERVER['REQUEST_TIME']+31536000);
2049
+			}
1818 2050
 		}
1819 2051
 		if($this->memberInfo->is_admin == 'Y')
1820 2052
 		{
@@ -1903,7 +2135,9 @@  discard block
 block discarded – undo
1903 2135
 	function addMemberPopupMenu($url, $str, $icon = '', $target = 'self')
1904 2136
 	{
1905 2137
 		$member_popup_menu_list = Context::get('member_popup_menu_list');
1906
-		if(!is_array($member_popup_menu_list)) $member_popup_menu_list = array();
2138
+		if(!is_array($member_popup_menu_list)) {
2139
+			$member_popup_menu_list = array();
2140
+		}
1907 2141
 
1908 2142
 		$obj = new stdClass;
1909 2143
 		$obj->url = $url;
@@ -1922,35 +2156,54 @@  discard block
 block discarded – undo
1922 2156
 	{
1923 2157
 		// Call a trigger (before)
1924 2158
 		$output = ModuleHandler::triggerCall('member.insertMember', 'before', $args);
1925
-		if(!$output->toBool()) return $output;
2159
+		if(!$output->toBool()) {
2160
+			return $output;
2161
+		}
1926 2162
 		// Terms and Conditions portion of the information set up by members reaffirmed
1927 2163
 		$oModuleModel = getModel('module');
1928 2164
 		$config = $oModuleModel->getModuleConfig('member');
1929 2165
 
1930 2166
 		$logged_info = Context::get('logged_info');
1931 2167
 		// If the date of the temporary restrictions limit further information on the date of
1932
-		if($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24);
2168
+		if($config->limit_day) {
2169
+			$args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24);
2170
+		}
1933 2171
 
1934 2172
 		$args->member_srl = getNextSequence();
1935 2173
 		$args->list_order = -1 * $args->member_srl;
1936 2174
 
1937 2175
 		// Execute insert or update depending on the value of member_srl
1938
-		if(!$args->user_id) $args->user_id = 't'.$args->member_srl;
2176
+		if(!$args->user_id) {
2177
+			$args->user_id = 't'.$args->member_srl;
2178
+		}
1939 2179
 		// Enter the user's identity changed to lowercase
1940
-		else $args->user_id = strtolower($args->user_id);
1941
-		if(!$args->user_name) $args->user_name = $args->member_srl;
1942
-		if(!$args->nick_name) $args->nick_name = $args->member_srl;
2180
+		else {
2181
+			$args->user_id = strtolower($args->user_id);
2182
+		}
2183
+		if(!$args->user_name) {
2184
+			$args->user_name = $args->member_srl;
2185
+		}
2186
+		if(!$args->nick_name) {
2187
+			$args->nick_name = $args->member_srl;
2188
+		}
1943 2189
 
1944 2190
 		// Control of essential parameters
1945
-		if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
1946
-		if($args->denied!='Y') $args->denied = 'N';
1947
-		if(!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y','N','F')))) $args->allow_message = 'Y';
2191
+		if($args->allow_mailing!='Y') {
2192
+			$args->allow_mailing = 'N';
2193
+		}
2194
+		if($args->denied!='Y') {
2195
+			$args->denied = 'N';
2196
+		}
2197
+		if(!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y','N','F')))) {
2198
+			$args->allow_message = 'Y';
2199
+		}
1948 2200
 
1949 2201
 		if($logged_info->is_admin == 'Y')
1950 2202
 		{
1951
-			if($args->is_admin!='Y') $args->is_admin = 'N';
1952
-		}
1953
-		else
2203
+			if($args->is_admin!='Y') {
2204
+				$args->is_admin = 'N';
2205
+			}
2206
+		} else
1954 2207
 		{
1955 2208
 			unset($args->is_admin);
1956 2209
 		}
@@ -1963,8 +2216,12 @@  discard block
 block discarded – undo
1963 2216
 		$args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
1964 2217
 		$args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
1965 2218
 		$args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
1966
-		if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
1967
-		if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) $args->blog = 'http://'.$args->blog;
2219
+		if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) {
2220
+			$args->homepage = 'http://'.$args->homepage;
2221
+		}
2222
+		if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) {
2223
+			$args->blog = 'http://'.$args->blog;
2224
+		}
1968 2225
 
1969 2226
 		// Create a model object
1970 2227
 		$oMemberModel = getModel('member');
@@ -1978,8 +2235,7 @@  discard block
 block discarded – undo
1978 2235
 				return new Object(-1, $message[$config->password_strength]);
1979 2236
 			}
1980 2237
 			$args->password = $oMemberModel->hashPassword($args->password);
1981
-		}
1982
-		elseif(!$args->password)
2238
+		} elseif(!$args->password)
1983 2239
 		{
1984 2240
 			unset($args->password);
1985 2241
 		}
@@ -2020,8 +2276,12 @@  discard block
 block discarded – undo
2020 2276
 		// Insert data into the DB
2021 2277
 		$args->list_order = -1 * $args->member_srl;
2022 2278
 
2023
-		if(!$args->user_id) $args->user_id = 't'.$args->member_srl;
2024
-		if(!$args->user_name) $args->user_name = $args->member_srl;
2279
+		if(!$args->user_id) {
2280
+			$args->user_id = 't'.$args->member_srl;
2281
+		}
2282
+		if(!$args->user_name) {
2283
+			$args->user_name = $args->member_srl;
2284
+		}
2025 2285
 
2026 2286
 		$oDB = &DB::getInstance();
2027 2287
 		$oDB->begin();
@@ -2033,8 +2293,11 @@  discard block
 block discarded – undo
2033 2293
 			return $output;
2034 2294
 		}
2035 2295
 
2036
-		if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2037
-		else $group_srl_list = explode('|@|', $args->group_srl_list);
2296
+		if(is_array($args->group_srl_list)) {
2297
+			$group_srl_list = $args->group_srl_list;
2298
+		} else {
2299
+			$group_srl_list = explode('|@|', $args->group_srl_list);
2300
+		}
2038 2301
 		// If no value is entered the default group, the value of group registration
2039 2302
 		if(!$args->group_srl_list)
2040 2303
 		{
@@ -2051,8 +2314,7 @@  discard block
 block discarded – undo
2051 2314
 				}
2052 2315
 			}
2053 2316
 			// If the value is the value of the group entered the group registration
2054
-		}
2055
-		else
2317
+		} else
2056 2318
 		{
2057 2319
 			for($i=0;$i<count($group_srl_list);$i++)
2058 2320
 			{
@@ -2113,27 +2375,39 @@  discard block
 block discarded – undo
2113 2375
 	{
2114 2376
 		// Call a trigger (before)
2115 2377
 		$output = ModuleHandler::triggerCall('member.updateMember', 'before', $args);
2116
-		if(!$output->toBool()) return $output;
2378
+		if(!$output->toBool()) {
2379
+			return $output;
2380
+		}
2117 2381
 		// Create a model object
2118 2382
 		$oMemberModel = getModel('member');
2119 2383
 
2120 2384
 		$logged_info = Context::get('logged_info');
2121 2385
 		// Get what you want to modify the original information
2122
-		if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2386
+		if(!$this->memberInfo) {
2387
+			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2388
+		}
2123 2389
 		// Control of essential parameters
2124
-		if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
2125
-		if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) $args->allow_message = 'Y';
2390
+		if($args->allow_mailing!='Y') {
2391
+			$args->allow_mailing = 'N';
2392
+		}
2393
+		if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) {
2394
+			$args->allow_message = 'Y';
2395
+		}
2126 2396
 
2127 2397
 		if($logged_info->is_admin == 'Y')
2128 2398
 		{
2129
-			if($args->denied!='Y') $args->denied = 'N';
2130
-			if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N';
2131
-		}
2132
-		else
2399
+			if($args->denied!='Y') {
2400
+				$args->denied = 'N';
2401
+			}
2402
+			if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) {
2403
+				$args->is_admin = 'N';
2404
+			}
2405
+		} else
2133 2406
 		{
2134 2407
 			unset($args->is_admin);
2135
-			if($is_admin == false)
2136
-				unset($args->denied);
2408
+			if($is_admin == false) {
2409
+							unset($args->denied);
2410
+			}
2137 2411
 			if($logged_info->member_srl != $args->member_srl && $is_admin == false)
2138 2412
 			{
2139 2413
 				return $this->stop('msg_invalid_request');
@@ -2141,13 +2415,19 @@  discard block
 block discarded – undo
2141 2415
 		}
2142 2416
 
2143 2417
 		// Sanitize user ID, username, nickname, homepage, blog
2144
-		if($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2418
+		if($args->user_id) {
2419
+			$args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2420
+		}
2145 2421
 		$args->user_name = htmlspecialchars($args->user_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2146 2422
 		$args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2147 2423
 		$args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2148 2424
 		$args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2149
-		if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
2150
-		if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) $args->blog = 'http://'.$args->blog;
2425
+		if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) {
2426
+			$args->homepage = 'http://'.$args->homepage;
2427
+		}
2428
+		if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) {
2429
+			$args->blog = 'http://'.$args->blog;
2430
+		}
2151 2431
 
2152 2432
 		// check member identifier form
2153 2433
 		$config = $oMemberModel->getMemberConfig();
@@ -2164,8 +2444,7 @@  discard block
 block discarded – undo
2164 2444
 				return new Object(-1,'msg_exists_email_address');
2165 2445
 			}
2166 2446
 			$args->email_address = $orgMemberInfo->email_address;
2167
-		}
2168
-		else
2447
+		} else
2169 2448
 		{
2170 2449
 			$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
2171 2450
 			if($member_srl && $args->member_srl != $member_srl)
@@ -2222,17 +2501,26 @@  discard block
 block discarded – undo
2222 2501
 				return new Object(-1, $message[$config->password_strength]);
2223 2502
 			}
2224 2503
 			$args->password = $oMemberModel->hashPassword($args->password);
2225
-		}
2226
-		else
2504
+		} else
2227 2505
 		{
2228 2506
 			$args->password = $orgMemberInfo->password;
2229 2507
 		}
2230 2508
 
2231
-		if(!$args->user_name) $args->user_name = $orgMemberInfo->user_name;
2232
-		if(!$args->user_id) $args->user_id = $orgMemberInfo->user_id;
2233
-		if(!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name;
2234
-		if(!$args->description) $args->description = $orgMemberInfo->description;
2235
-		if(!$args->birthday) $args->birthday = '';
2509
+		if(!$args->user_name) {
2510
+			$args->user_name = $orgMemberInfo->user_name;
2511
+		}
2512
+		if(!$args->user_id) {
2513
+			$args->user_id = $orgMemberInfo->user_id;
2514
+		}
2515
+		if(!$args->nick_name) {
2516
+			$args->nick_name = $orgMemberInfo->nick_name;
2517
+		}
2518
+		if(!$args->description) {
2519
+			$args->description = $orgMemberInfo->description;
2520
+		}
2521
+		if(!$args->birthday) {
2522
+			$args->birthday = '';
2523
+		}
2236 2524
 
2237 2525
 		$output = executeQuery('member.updateMember', $args);
2238 2526
 
@@ -2244,8 +2532,11 @@  discard block
 block discarded – undo
2244 2532
 
2245 2533
 		if($args->group_srl_list)
2246 2534
 		{
2247
-			if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2248
-			else $group_srl_list = explode('|@|', $args->group_srl_list);
2535
+			if(is_array($args->group_srl_list)) {
2536
+				$group_srl_list = $args->group_srl_list;
2537
+			} else {
2538
+				$group_srl_list = explode('|@|', $args->group_srl_list);
2539
+			}
2249 2540
 			// If the group information, group information changes
2250 2541
 			if(count($group_srl_list) > 0)
2251 2542
 			{
@@ -2288,7 +2579,9 @@  discard block
 block discarded – undo
2288 2579
 		$this->_clearMemberCache($args->member_srl, $args->site_srl);
2289 2580
 
2290 2581
 		// Save Session
2291
-		if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2582
+		if(!$this->memberInfo) {
2583
+			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2584
+		}
2292 2585
 		$logged_info = Context::get('logged_info');
2293 2586
 
2294 2587
 		$output->add('member_srl', $args->member_srl);
@@ -2314,8 +2607,7 @@  discard block
 block discarded – undo
2314 2607
 			}
2315 2608
 
2316 2609
 			$args->password = $oMemberModel->hashPassword($args->password);
2317
-		}
2318
-		else if($args->hashed_password)
2610
+		} else if($args->hashed_password)
2319 2611
 		{
2320 2612
 			$args->password = $args->hashed_password;
2321 2613
 		}
@@ -2340,7 +2632,9 @@  discard block
 block discarded – undo
2340 2632
 		$trigger_obj = new stdClass();
2341 2633
 		$trigger_obj->member_srl = $member_srl;
2342 2634
 		$output = ModuleHandler::triggerCall('member.deleteMember', 'before', $trigger_obj);
2343
-		if(!$output->toBool()) return $output;
2635
+		if(!$output->toBool()) {
2636
+			return $output;
2637
+		}
2344 2638
 		// Create a model object
2345 2639
 		$oMemberModel = getModel('member');
2346 2640
 		// Bringing the user's information
@@ -2349,9 +2643,13 @@  discard block
 block discarded – undo
2349 2643
 			$columnList = array('member_srl', 'is_admin');
2350 2644
 			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
2351 2645
 		}
2352
-		if(!$this->memberInfo) return new Object(-1, 'msg_not_exists_member');
2646
+		if(!$this->memberInfo) {
2647
+			return new Object(-1, 'msg_not_exists_member');
2648
+		}
2353 2649
 		// If managers can not be deleted
2354
-		if($this->memberInfo->is_admin == 'Y') return new Object(-1, 'msg_cannot_delete_admin');
2650
+		if($this->memberInfo->is_admin == 'Y') {
2651
+			return new Object(-1, 'msg_cannot_delete_admin');
2652
+		}
2355 2653
 
2356 2654
 		$oDB = &DB::getInstance();
2357 2655
 		$oDB->begin();
@@ -2415,7 +2713,9 @@  discard block
 block discarded – undo
2415 2713
 	 */
2416 2714
 	function destroySessionInfo()
2417 2715
 	{
2418
-		if(!$_SESSION || !is_array($_SESSION)) return;
2716
+		if(!$_SESSION || !is_array($_SESSION)) {
2717
+			return;
2718
+		}
2419 2719
 
2420 2720
 		$memberInfo = Context::get('logged_info');
2421 2721
 		$memberSrl = $memberInfo->member_srl;
@@ -2454,8 +2754,9 @@  discard block
 block discarded – undo
2454 2754
 		}
2455 2755
 		$maxLevel = 0;
2456 2756
 		$resultGroup = array_intersect($levelGroup, $groupSrlList);
2457
-		if(count($resultGroup) > 0)
2458
-			$maxLevel = max(array_flip($resultGroup));
2757
+		if(count($resultGroup) > 0) {
2758
+					$maxLevel = max(array_flip($resultGroup));
2759
+		}
2459 2760
 
2460 2761
 		if($maxLevel > 0)
2461 2762
 		{
@@ -2472,16 +2773,22 @@  discard block
 block discarded – undo
2472 2773
 
2473 2774
 	function procMemberModifyEmailAddress()
2474 2775
 	{
2475
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
2776
+		if(!Context::get('is_logged')) {
2777
+			return $this->stop('msg_not_logged');
2778
+		}
2476 2779
 
2477 2780
 		$member_info = Context::get('logged_info');
2478 2781
 		$newEmail = Context::get('email_address');
2479 2782
 
2480
-		if(!$newEmail) return $this->stop('msg_invalid_request');
2783
+		if(!$newEmail) {
2784
+			return $this->stop('msg_invalid_request');
2785
+		}
2481 2786
 
2482 2787
 		$oMemberModel = getModel('member');
2483 2788
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail);
2484
-		if($member_srl) return new Object(-1,'msg_exists_email_address');
2789
+		if($member_srl) {
2790
+			return new Object(-1,'msg_exists_email_address');
2791
+		}
2485 2792
 
2486 2793
 		if($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
2487 2794
 		{
@@ -2509,7 +2816,9 @@  discard block
 block discarded – undo
2509 2816
 		$member_config = $oModuleModel->getModuleConfig('member');
2510 2817
 
2511 2818
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
2512
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
2819
+		if(!is_dir($tpl_path)) {
2820
+			$tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
2821
+		}
2513 2822
 
2514 2823
 		global $lang;
2515 2824
 
@@ -2545,7 +2854,9 @@  discard block
 block discarded – undo
2545 2854
 	{
2546 2855
 		$member_srl = Context::get('member_srl');
2547 2856
 		$auth_key = Context::get('auth_key');
2548
-		if(!$member_srl || !$auth_key) return $this->stop('msg_invalid_request');
2857
+		if(!$member_srl || !$auth_key) {
2858
+			return $this->stop('msg_invalid_request');
2859
+		}
2549 2860
 
2550 2861
 		// Test logs for finding password by user_id and authkey
2551 2862
 		$args = new stdClass;
@@ -2554,7 +2865,9 @@  discard block
 block discarded – undo
2554 2865
 		$output = executeQuery('member.getAuthMail', $args);
2555 2866
 		if(!$output->toBool() || $output->data->auth_key != $auth_key)
2556 2867
 		{
2557
-			if(strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args);
2868
+			if(strlen($output->data->auth_key) !== strlen($auth_key)) {
2869
+				executeQuery('member.deleteAuthChangeEmailAddress', $args);
2870
+			}
2558 2871
 			return $this->stop('msg_invalid_modify_email_auth_key');
2559 2872
 		}
2560 2873
 
@@ -2563,7 +2876,9 @@  discard block
 block discarded – undo
2563 2876
 		list($args->email_id, $args->email_host) = explode('@', $newEmail);
2564 2877
 
2565 2878
 		$output = executeQuery('member.updateMemberEmailAddress', $args);
2566
-		if(!$output->toBool()) return $this->stop($output->getMessage());
2879
+		if(!$output->toBool()) {
2880
+			return $this->stop($output->getMessage());
2881
+		}
2567 2882
 
2568 2883
 		// Remove all values having the member_srl and new_password equal to 'XE_change_emaill_address' from authentication table
2569 2884
 		executeQuery('member.deleteAuthChangeEmailAddress',$args);
@@ -2584,7 +2899,9 @@  discard block
 block discarded – undo
2584 2899
 	**/
2585 2900
 	function triggerGetDocumentMenu(&$menu_list)
2586 2901
 	{
2587
-		if(!Context::get('is_logged')) return new Object();
2902
+		if(!Context::get('is_logged')) {
2903
+			return new Object();
2904
+		}
2588 2905
 
2589 2906
 		$logged_info = Context::get('logged_info');
2590 2907
 		$document_srl = Context::get('target_srl');
@@ -2595,8 +2912,12 @@  discard block
 block discarded – undo
2595 2912
 		$member_srl = $oDocument->get('member_srl');
2596 2913
 		$module_srl = $oDocument->get('module_srl');
2597 2914
 
2598
-		if(!$member_srl) return new Object();
2599
-		if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new Object();
2915
+		if(!$member_srl) {
2916
+			return new Object();
2917
+		}
2918
+		if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) {
2919
+			return new Object();
2920
+		}
2600 2921
 
2601 2922
 		$oDocumentController = getController('document');
2602 2923
 		$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
@@ -2614,7 +2935,9 @@  discard block
 block discarded – undo
2614 2935
 	**/
2615 2936
 	function triggerGetCommentMenu(&$menu_list)
2616 2937
 	{
2617
-		if(!Context::get('is_logged')) return new Object();
2938
+		if(!Context::get('is_logged')) {
2939
+			return new Object();
2940
+		}
2618 2941
 
2619 2942
 		$logged_info = Context::get('logged_info');
2620 2943
 		$comment_srl = Context::get('target_srl');
@@ -2625,8 +2948,12 @@  discard block
 block discarded – undo
2625 2948
 		$module_srl = $oComment->get('module_srl');
2626 2949
 		$member_srl = $oComment->get('member_srl');
2627 2950
 
2628
-		if(!$member_srl) return new Object();
2629
-		if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new Object();
2951
+		if(!$member_srl) {
2952
+			return new Object();
2953
+		}
2954
+		if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) {
2955
+			return new Object();
2956
+		}
2630 2957
 
2631 2958
 		$oCommentController = getController('comment');
2632 2959
 		$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
@@ -2642,7 +2969,9 @@  discard block
 block discarded – undo
2642 2969
 	**/
2643 2970
 	function procMemberSpammerManage()
2644 2971
 	{
2645
-		if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
2972
+		if(!Context::get('is_logged')) {
2973
+			return new Object(-1,'msg_not_permitted');
2974
+		}
2646 2975
 
2647 2976
 		$logged_info = Context::get('logged_info');
2648 2977
 		$member_srl = Context::get('member_srl');
@@ -2650,8 +2979,9 @@  discard block
 block discarded – undo
2650 2979
 		$cnt_loop = Context::get('cnt_loop');
2651 2980
 		$proc_type = Context::get('proc_type');
2652 2981
 		$isMoveToTrash = true;
2653
-		if($proc_type == "delete")
2654
-			$isMoveToTrash = false;
2982
+		if($proc_type == "delete") {
2983
+					$isMoveToTrash = false;
2984
+		}
2655 2985
 
2656 2986
 		// check grant
2657 2987
 		$oModuleModel = getModel('module');
@@ -2659,7 +2989,9 @@  discard block
 block discarded – undo
2659 2989
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
2660 2990
 		$grant = $oModuleModel->getGrant($module_info, $logged_info);
2661 2991
 
2662
-		if(!$grant->manager) return new Object(-1,'msg_not_permitted');
2992
+		if(!$grant->manager) {
2993
+			return new Object(-1,'msg_not_permitted');
2994
+		}
2663 2995
 
2664 2996
 		$proc_msg = "";
2665 2997
 
@@ -2668,11 +3000,13 @@  discard block
 block discarded – undo
2668 3000
 
2669 3001
 		// delete or trash destination
2670 3002
 		// proc member
2671
-		if($cnt_loop == 1)
2672
-			$this->_spammerMember($member_srl);
3003
+		if($cnt_loop == 1) {
3004
+					$this->_spammerMember($member_srl);
3005
+		}
2673 3006
 		// proc document and comment
2674
-		elseif($cnt_loop>1)
2675
-			$this->_spammerDocuments($member_srl, $isMoveToTrash);
3007
+		elseif($cnt_loop>1) {
3008
+					$this->_spammerDocuments($member_srl, $isMoveToTrash);
3009
+		}
2676 3010
 
2677 3011
 		// get destination count
2678 3012
 		$cnt_document = $oDocumentModel->getDocumentCountByMemberSrl($member_srl);
@@ -2680,13 +3014,16 @@  discard block
 block discarded – undo
2680 3014
 
2681 3015
 		$total_count = Context::get('total_count');
2682 3016
 		$remain_count = $cnt_document + $cnt_comment;
2683
-		if($cnt_loop == 1) $total_count = $remain_count;
3017
+		if($cnt_loop == 1) {
3018
+			$total_count = $remain_count;
3019
+		}
2684 3020
 
2685 3021
 		// get progress percent
2686
-		if($total_count > 0)
2687
-			$progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 );
2688
-		else
2689
-			$progress = 100;
3022
+		if($total_count > 0) {
3023
+					$progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 );
3024
+		} else {
3025
+					$progress = 100;
3026
+		}
2690 3027
 
2691 3028
 		$this->add('total_count', $total_count);
2692 3029
 		$this->add('remain_count', $remain_count);
@@ -2728,7 +3065,10 @@  discard block
 block discarded – undo
2728 3065
 		$args->nick_name = $member_info->nick_name;
2729 3066
 		$args->denied = "Y";
2730 3067
 		$args->description = trim( $member_info->description );
2731
-		if( $args->description != "" ) $args->description .= "\n";	// add new line
3068
+		if( $args->description != "" ) {
3069
+			$args->description .= "\n";
3070
+		}
3071
+		// add new line
2732 3072
 
2733 3073
 		$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 . "]";
2734 3074
 
@@ -2773,8 +3113,11 @@  discard block
 block discarded – undo
2773 3113
 			$documentList = $oDocumentModel->getDocumentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount);
2774 3114
 			if($documentList) {
2775 3115
 				foreach($documentList as $v) {
2776
-					if($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v);
2777
-					else $oDocumentController->deleteDocument($v->document_srl);
3116
+					if($isMoveToTrash) {
3117
+						$oDocumentController->moveDocumentToTrash($v);
3118
+					} else {
3119
+						$oDocumentController->deleteDocument($v->document_srl);
3120
+					}
2778 3121
 				}
2779 3122
 			}
2780 3123
 		}
Please login to merge, or discard this patch.
modules/file/file.model.php 2 patches
Spacing   +53 added lines, -53 removed lines patch added patch discarded remove patch
@@ -29,23 +29,23 @@  discard block
 block discarded – undo
29 29
 		$mid = Context::get('mid');
30 30
 		$editor_sequence = Context::get('editor_sequence');
31 31
 		$upload_target_srl = Context::get('upload_target_srl');
32
-		if(!$upload_target_srl) $upload_target_srl = $_SESSION['upload_info'][$editor_sequence]->upload_target_srl;
32
+		if (!$upload_target_srl) $upload_target_srl = $_SESSION['upload_info'][$editor_sequence]->upload_target_srl;
33 33
 
34
-		if($upload_target_srl)
34
+		if ($upload_target_srl)
35 35
 		{
36 36
 			$tmp_files = $this->getFiles($upload_target_srl);
37
-			if($tmp_files instanceof Object && !$tmp_files->toBool()) return $tmp_files;
37
+			if ($tmp_files instanceof Object && !$tmp_files->toBool()) return $tmp_files;
38 38
 
39
-			foreach($tmp_files as $file_info)
39
+			foreach ($tmp_files as $file_info)
40 40
 			{
41
-				if(!$file_info->file_srl) continue;
41
+				if (!$file_info->file_srl) continue;
42 42
 
43 43
 				$obj = new stdClass;
44 44
 				$obj->file_srl = $file_info->file_srl;
45 45
 				$obj->source_filename = $file_info->source_filename;
46 46
 				$obj->file_size = $file_info->file_size;
47 47
 				$obj->disp_file_size = FileHandler::filesize($file_info->file_size);
48
-				if($file_info->direct_download=='N') $obj->download_url = $this->getDownloadUrl($file_info->file_srl, $file_info->sid, $file_info->module_srl);
48
+				if ($file_info->direct_download == 'N') $obj->download_url = $this->getDownloadUrl($file_info->file_srl, $file_info->sid, $file_info->module_srl);
49 49
 				else $obj->download_url = str_replace('./', '', $file_info->uploaded_filename);
50 50
 				$obj->direct_download = $file_info->direct_download;
51 51
 				$obj->cover_image = ($file_info->cover_image === 'Y') ? true : false;
@@ -65,17 +65,17 @@  discard block
 block discarded – undo
65 65
 		//$config = $oModuleModel->getModuleInfoByMid($mid);	//perhaps config varialbles not used
66 66
 
67 67
 		$file_config = $this->getUploadConfig();
68
-		$left_size = $file_config->allowed_attach_size*1024*1024 - $attached_size;
68
+		$left_size = $file_config->allowed_attach_size * 1024 * 1024 - $attached_size;
69 69
 		// Settings of required information
70 70
 		$attached_size = FileHandler::filesize($attached_size);
71
-		$allowed_attach_size = FileHandler::filesize($file_config->allowed_attach_size*1024*1024);
72
-		$allowed_filesize = FileHandler::filesize($file_config->allowed_filesize*1024*1024);
71
+		$allowed_attach_size = FileHandler::filesize($file_config->allowed_attach_size * 1024 * 1024);
72
+		$allowed_filesize = FileHandler::filesize($file_config->allowed_filesize * 1024 * 1024);
73 73
 		$allowed_filetypes = $file_config->allowed_filetypes;
74
-		$this->add("files",$files);
75
-		$this->add("editor_sequence",$editor_sequence);
76
-		$this->add("upload_target_srl",$upload_target_srl);
77
-		$this->add("upload_status",$upload_status);
78
-		$this->add("left_size",$left_size);
74
+		$this->add("files", $files);
75
+		$this->add("editor_sequence", $editor_sequence);
76
+		$this->add("upload_target_srl", $upload_target_srl);
77
+		$this->add("upload_status", $upload_status);
78
+		$this->add("left_size", $left_size);
79 79
 		$this->add('attached_size', $attached_size);
80 80
 		$this->add('allowed_attach_size', $allowed_attach_size);
81 81
 		$this->add('allowed_filesize', $allowed_filesize);
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 		$args = new stdClass();
94 94
 		$args->upload_target_srl = $upload_target_srl;
95 95
 		$output = executeQuery('file.getFilesCount', $args);
96
-		return (int)$output->data->count;
96
+		return (int) $output->data->count;
97 97
 	}
98 98
 
99 99
 	/**
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 	 * @param string $sid
104 104
 	 * @return string Returns a url
105 105
 	 */
106
-	function getDownloadUrl($file_srl, $sid, $module_srl="")
106
+	function getDownloadUrl($file_srl, $sid, $module_srl = "")
107 107
 	{
108 108
 		return sprintf('?module=%s&amp;act=%s&amp;file_srl=%s&amp;sid=%s&amp;module_srl=%s', 'file', 'procFileDownload', $file_srl, $sid, $module_srl);
109 109
 	}
@@ -121,12 +121,12 @@  discard block
 block discarded – undo
121 121
 
122 122
 		$file_module_config = $oModuleModel->getModuleConfig('file');
123 123
 
124
-		if($module_srl) $file_config = $oModuleModel->getModulePartConfig('file',$module_srl);
125
-		if(!$file_config) $file_config = $file_module_config;
124
+		if ($module_srl) $file_config = $oModuleModel->getModulePartConfig('file', $module_srl);
125
+		if (!$file_config) $file_config = $file_module_config;
126 126
 
127 127
 		$config = new stdClass();
128 128
 
129
-		if($file_config)
129
+		if ($file_config)
130 130
 		{
131 131
 			$config->allowed_filesize = $file_config->allowed_filesize;
132 132
 			$config->allowed_attach_size = $file_config->allowed_attach_size;
@@ -137,31 +137,31 @@  discard block
 block discarded – undo
137 137
 			$config->allow_outlink_format = $file_config->allow_outlink_format;
138 138
 		}
139 139
 		// Property for all files comes first than each property
140
-		if(!$config->allowed_filesize) $config->allowed_filesize = $file_module_config->allowed_filesize;
141
-		if(!$config->allowed_attach_size) $config->allowed_attach_size = $file_module_config->allowed_attach_size;
142
-		if(!$config->allowed_filetypes) $config->allowed_filetypes = $file_module_config->allowed_filetypes;
143
-		if(!$config->allow_outlink) $config->allow_outlink = $file_module_config->allow_outlink;
144
-		if(!$config->allow_outlink_site) $config->allow_outlink_site = $file_module_config->allow_outlink_site;
145
-		if(!$config->allow_outlink_format) $config->allow_outlink_format = $file_module_config->allow_outlink_format;
146
-		if(!$config->download_grant) $config->download_grant = $file_module_config->download_grant;
140
+		if (!$config->allowed_filesize) $config->allowed_filesize = $file_module_config->allowed_filesize;
141
+		if (!$config->allowed_attach_size) $config->allowed_attach_size = $file_module_config->allowed_attach_size;
142
+		if (!$config->allowed_filetypes) $config->allowed_filetypes = $file_module_config->allowed_filetypes;
143
+		if (!$config->allow_outlink) $config->allow_outlink = $file_module_config->allow_outlink;
144
+		if (!$config->allow_outlink_site) $config->allow_outlink_site = $file_module_config->allow_outlink_site;
145
+		if (!$config->allow_outlink_format) $config->allow_outlink_format = $file_module_config->allow_outlink_format;
146
+		if (!$config->download_grant) $config->download_grant = $file_module_config->download_grant;
147 147
 		// Default setting if not exists
148
-		if(!$config->allowed_filesize) $config->allowed_filesize = '2';
149
-		if(!$config->allowed_attach_size) $config->allowed_attach_size = '3';
150
-		if(!$config->allowed_filetypes) $config->allowed_filetypes = '*.*';
151
-		if(!$config->allow_outlink) $config->allow_outlink = 'Y';
152
-		if(!$config->download_grant) $config->download_grant = array();
148
+		if (!$config->allowed_filesize) $config->allowed_filesize = '2';
149
+		if (!$config->allowed_attach_size) $config->allowed_attach_size = '3';
150
+		if (!$config->allowed_filetypes) $config->allowed_filetypes = '*.*';
151
+		if (!$config->allow_outlink) $config->allow_outlink = 'Y';
152
+		if (!$config->download_grant) $config->download_grant = array();
153 153
 
154 154
 		$size = ini_get('upload_max_filesize');
155 155
 		$unit = strtolower($size[strlen($size) - 1]);
156
-		$size = (float)$size;
157
-		if($unit == 'g') $size *= 1024;
158
-		if($unit == 'k') $size /= 1024;
156
+		$size = (float) $size;
157
+		if ($unit == 'g') $size *= 1024;
158
+		if ($unit == 'k') $size /= 1024;
159 159
 
160
-		if($config->allowed_filesize > $size) 
160
+		if ($config->allowed_filesize > $size) 
161 161
 		{	
162 162
 			$config->allowed_filesize = $size;
163 163
 		}
164
-		if($config->allowed_attach_size > $size) 
164
+		if ($config->allowed_attach_size > $size) 
165 165
 		{
166 166
 			$config->allowed_attach_size = $size;
167 167
 		}
@@ -181,10 +181,10 @@  discard block
 block discarded – undo
181 181
 		$args = new stdClass();
182 182
 		$args->file_srl = $file_srl;
183 183
 		$output = executeQueryArray('file.getFile', $args, $columnList);
184
-		if(!$output->toBool()) return $output;
184
+		if (!$output->toBool()) return $output;
185 185
 
186 186
 		// old version compatibility
187
-		if(count($output->data) == 1)
187
+		if (count($output->data) == 1)
188 188
 		{
189 189
 			$file = $output->data[0];
190 190
 			$file->download_url = $this->getDownloadUrl($file->file_srl, $file->sid, $file->module_srl);
@@ -195,9 +195,9 @@  discard block
 block discarded – undo
195 195
 		{
196 196
 			$fileList = array();
197 197
 
198
-			if(is_array($output->data))
198
+			if (is_array($output->data))
199 199
 			{
200
-				foreach($output->data as $key=>$value)
200
+				foreach ($output->data as $key=>$value)
201 201
 				{
202 202
 					$file = $value;
203 203
 					$file->download_url = $this->getDownloadUrl($file->file_srl, $file->sid, $file->module_srl);
@@ -221,11 +221,11 @@  discard block
 block discarded – undo
221 221
 		$oDocumentModel = getModel('document');
222 222
 		$oCommentModel = getModel('document');
223 223
 		$targetItem = $oDocumentModel->getDocument($upload_target_srl);
224
-		if(!$targetItem->isExists())
224
+		if (!$targetItem->isExists())
225 225
 		{
226 226
 			$targetItem = $oCommentModel->getDocument($upload_target_srl);
227 227
 		}
228
-		if($targetItem->isExists() && $targetItem->isSecret() && !$targetItem->isGranted())
228
+		if ($targetItem->isExists() && $targetItem->isSecret() && !$targetItem->isGranted())
229 229
 		{
230 230
 			return $this->stop('msg_invalid_request');
231 231
 		}
@@ -233,16 +233,16 @@  discard block
 block discarded – undo
233 233
 		$args = new stdClass();
234 234
 		$args->upload_target_srl = $upload_target_srl;
235 235
 		$args->sort_index = $sortIndex;
236
-		if($ckValid) $args->isvalid = 'Y';
236
+		if ($ckValid) $args->isvalid = 'Y';
237 237
 		$output = executeQuery('file.getFiles', $args, $columnList);
238
-		if(!$output->data) return;
238
+		if (!$output->data) return;
239 239
 
240 240
 		$file_list = $output->data;
241 241
 
242
-		if($file_list && !is_array($file_list)) $file_list = array($file_list);
242
+		if ($file_list && !is_array($file_list)) $file_list = array($file_list);
243 243
 
244 244
 		$file_count = count($file_list);
245
-		for($i=0;$i<$file_count;$i++)
245
+		for ($i = 0; $i < $file_count; $i++)
246 246
 		{
247 247
 			$file = $file_list[$i];
248 248
 			$file->source_filename = stripslashes($file->source_filename);
@@ -265,14 +265,14 @@  discard block
 block discarded – undo
265 265
 
266 266
 		$module_srl = Context::get('module_srl');
267 267
 		// Get the current module if module_srl doesn't exist
268
-		if(!$module_srl)
268
+		if (!$module_srl)
269 269
 		{
270 270
 			$current_module_info = Context::get('current_module_info');
271 271
 			$module_srl = $current_module_info->module_srl;
272 272
 		}
273 273
 		$file_config = $this->getFileConfig($module_srl);
274 274
 
275
-		if($logged_info->is_admin == 'Y')
275
+		if ($logged_info->is_admin == 'Y')
276 276
 		{
277 277
 			$iniPostMaxSize = FileHandler::returnbytes(ini_get('post_max_size'));
278 278
 			$iniUploadMaxSize = FileHandler::returnbytes(ini_get('upload_max_filesize'));
@@ -298,9 +298,9 @@  discard block
 block discarded – undo
298 298
 			'%s : %s/ %s<br /> %s : %s (%s : %s)',
299 299
 			Context::getLang('allowed_attach_size'),
300 300
 			FileHandler::filesize($attached_size),
301
-			FileHandler::filesize($file_config->allowed_attach_size*1024*1024),
301
+			FileHandler::filesize($file_config->allowed_attach_size * 1024 * 1024),
302 302
 			Context::getLang('allowed_filesize'),
303
-			FileHandler::filesize($file_config->allowed_filesize*1024*1024),
303
+			FileHandler::filesize($file_config->allowed_filesize * 1024 * 1024),
304 304
 			Context::getLang('allowed_filetypes'),
305 305
 			$file_config->allowed_filetypes
306 306
 		);
@@ -327,9 +327,9 @@  discard block
 block discarded – undo
327 327
 	 */
328 328
 	function getFileGrant($file_info, $member_info)
329 329
 	{
330
-		if(!$file_info) return null;
330
+		if (!$file_info) return null;
331 331
 
332
-		if($_SESSION['__XE_UPLOADING_FILES_INFO__'][$file_info->file_srl])
332
+		if ($_SESSION['__XE_UPLOADING_FILES_INFO__'][$file_info->file_srl])
333 333
 		{
334 334
 			$file_grant->is_deletable = true;
335 335
 			return $file_grant;
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
 
341 341
 		$oDocumentModel = getModel('document');
342 342
 		$oDocument = $oDocumentModel->getDocument($file_info->upload_target_srl);
343
-		if($oDocument->isExists()) $document_grant = $oDocument->isGranted();
343
+		if ($oDocument->isExists()) $document_grant = $oDocument->isGranted();
344 344
 
345 345
 		$file_grant->is_deletable = ($document_grant || $member_info->is_admin == 'Y' || $member_info->member_srl == $file_info->member_srl || $grant->manager);
346 346
 
Please login to merge, or discard this patch.
Braces   +82 added lines, -31 removed lines patch added patch discarded remove patch
@@ -29,31 +29,39 @@  discard block
 block discarded – undo
29 29
 		$mid = Context::get('mid');
30 30
 		$editor_sequence = Context::get('editor_sequence');
31 31
 		$upload_target_srl = Context::get('upload_target_srl');
32
-		if(!$upload_target_srl) $upload_target_srl = $_SESSION['upload_info'][$editor_sequence]->upload_target_srl;
32
+		if(!$upload_target_srl) {
33
+			$upload_target_srl = $_SESSION['upload_info'][$editor_sequence]->upload_target_srl;
34
+		}
33 35
 
34 36
 		if($upload_target_srl)
35 37
 		{
36 38
 			$tmp_files = $this->getFiles($upload_target_srl);
37
-			if($tmp_files instanceof Object && !$tmp_files->toBool()) return $tmp_files;
39
+			if($tmp_files instanceof Object && !$tmp_files->toBool()) {
40
+				return $tmp_files;
41
+			}
38 42
 
39 43
 			foreach($tmp_files as $file_info)
40 44
 			{
41
-				if(!$file_info->file_srl) continue;
45
+				if(!$file_info->file_srl) {
46
+					continue;
47
+				}
42 48
 
43 49
 				$obj = new stdClass;
44 50
 				$obj->file_srl = $file_info->file_srl;
45 51
 				$obj->source_filename = $file_info->source_filename;
46 52
 				$obj->file_size = $file_info->file_size;
47 53
 				$obj->disp_file_size = FileHandler::filesize($file_info->file_size);
48
-				if($file_info->direct_download=='N') $obj->download_url = $this->getDownloadUrl($file_info->file_srl, $file_info->sid, $file_info->module_srl);
49
-				else $obj->download_url = str_replace('./', '', $file_info->uploaded_filename);
54
+				if($file_info->direct_download=='N') {
55
+					$obj->download_url = $this->getDownloadUrl($file_info->file_srl, $file_info->sid, $file_info->module_srl);
56
+				} else {
57
+					$obj->download_url = str_replace('./', '', $file_info->uploaded_filename);
58
+				}
50 59
 				$obj->direct_download = $file_info->direct_download;
51 60
 				$obj->cover_image = ($file_info->cover_image === 'Y') ? true : false;
52 61
 				$files[] = $obj;
53 62
 				$attached_size += $file_info->file_size;
54 63
 			}
55
-		}
56
-		else
64
+		} else
57 65
 		{
58 66
 			$upload_target_srl = 0;
59 67
 			$attached_size = 0;
@@ -121,8 +129,12 @@  discard block
 block discarded – undo
121 129
 
122 130
 		$file_module_config = $oModuleModel->getModuleConfig('file');
123 131
 
124
-		if($module_srl) $file_config = $oModuleModel->getModulePartConfig('file',$module_srl);
125
-		if(!$file_config) $file_config = $file_module_config;
132
+		if($module_srl) {
133
+			$file_config = $oModuleModel->getModulePartConfig('file',$module_srl);
134
+		}
135
+		if(!$file_config) {
136
+			$file_config = $file_module_config;
137
+		}
126 138
 
127 139
 		$config = new stdClass();
128 140
 
@@ -137,25 +149,53 @@  discard block
 block discarded – undo
137 149
 			$config->allow_outlink_format = $file_config->allow_outlink_format;
138 150
 		}
139 151
 		// Property for all files comes first than each property
140
-		if(!$config->allowed_filesize) $config->allowed_filesize = $file_module_config->allowed_filesize;
141
-		if(!$config->allowed_attach_size) $config->allowed_attach_size = $file_module_config->allowed_attach_size;
142
-		if(!$config->allowed_filetypes) $config->allowed_filetypes = $file_module_config->allowed_filetypes;
143
-		if(!$config->allow_outlink) $config->allow_outlink = $file_module_config->allow_outlink;
144
-		if(!$config->allow_outlink_site) $config->allow_outlink_site = $file_module_config->allow_outlink_site;
145
-		if(!$config->allow_outlink_format) $config->allow_outlink_format = $file_module_config->allow_outlink_format;
146
-		if(!$config->download_grant) $config->download_grant = $file_module_config->download_grant;
152
+		if(!$config->allowed_filesize) {
153
+			$config->allowed_filesize = $file_module_config->allowed_filesize;
154
+		}
155
+		if(!$config->allowed_attach_size) {
156
+			$config->allowed_attach_size = $file_module_config->allowed_attach_size;
157
+		}
158
+		if(!$config->allowed_filetypes) {
159
+			$config->allowed_filetypes = $file_module_config->allowed_filetypes;
160
+		}
161
+		if(!$config->allow_outlink) {
162
+			$config->allow_outlink = $file_module_config->allow_outlink;
163
+		}
164
+		if(!$config->allow_outlink_site) {
165
+			$config->allow_outlink_site = $file_module_config->allow_outlink_site;
166
+		}
167
+		if(!$config->allow_outlink_format) {
168
+			$config->allow_outlink_format = $file_module_config->allow_outlink_format;
169
+		}
170
+		if(!$config->download_grant) {
171
+			$config->download_grant = $file_module_config->download_grant;
172
+		}
147 173
 		// Default setting if not exists
148
-		if(!$config->allowed_filesize) $config->allowed_filesize = '2';
149
-		if(!$config->allowed_attach_size) $config->allowed_attach_size = '3';
150
-		if(!$config->allowed_filetypes) $config->allowed_filetypes = '*.*';
151
-		if(!$config->allow_outlink) $config->allow_outlink = 'Y';
152
-		if(!$config->download_grant) $config->download_grant = array();
174
+		if(!$config->allowed_filesize) {
175
+			$config->allowed_filesize = '2';
176
+		}
177
+		if(!$config->allowed_attach_size) {
178
+			$config->allowed_attach_size = '3';
179
+		}
180
+		if(!$config->allowed_filetypes) {
181
+			$config->allowed_filetypes = '*.*';
182
+		}
183
+		if(!$config->allow_outlink) {
184
+			$config->allow_outlink = 'Y';
185
+		}
186
+		if(!$config->download_grant) {
187
+			$config->download_grant = array();
188
+		}
153 189
 
154 190
 		$size = ini_get('upload_max_filesize');
155 191
 		$unit = strtolower($size[strlen($size) - 1]);
156 192
 		$size = (float)$size;
157
-		if($unit == 'g') $size *= 1024;
158
-		if($unit == 'k') $size /= 1024;
193
+		if($unit == 'g') {
194
+			$size *= 1024;
195
+		}
196
+		if($unit == 'k') {
197
+			$size /= 1024;
198
+		}
159 199
 
160 200
 		if($config->allowed_filesize > $size) 
161 201
 		{	
@@ -181,7 +221,9 @@  discard block
 block discarded – undo
181 221
 		$args = new stdClass();
182 222
 		$args->file_srl = $file_srl;
183 223
 		$output = executeQueryArray('file.getFile', $args, $columnList);
184
-		if(!$output->toBool()) return $output;
224
+		if(!$output->toBool()) {
225
+			return $output;
226
+		}
185 227
 
186 228
 		// old version compatibility
187 229
 		if(count($output->data) == 1)
@@ -190,8 +232,7 @@  discard block
 block discarded – undo
190 232
 			$file->download_url = $this->getDownloadUrl($file->file_srl, $file->sid, $file->module_srl);
191 233
 
192 234
 			return $file;
193
-		}
194
-		else
235
+		} else
195 236
 		{
196 237
 			$fileList = array();
197 238
 
@@ -233,13 +274,19 @@  discard block
 block discarded – undo
233 274
 		$args = new stdClass();
234 275
 		$args->upload_target_srl = $upload_target_srl;
235 276
 		$args->sort_index = $sortIndex;
236
-		if($ckValid) $args->isvalid = 'Y';
277
+		if($ckValid) {
278
+			$args->isvalid = 'Y';
279
+		}
237 280
 		$output = executeQuery('file.getFiles', $args, $columnList);
238
-		if(!$output->data) return;
281
+		if(!$output->data) {
282
+			return;
283
+		}
239 284
 
240 285
 		$file_list = $output->data;
241 286
 
242
-		if($file_list && !is_array($file_list)) $file_list = array($file_list);
287
+		if($file_list && !is_array($file_list)) {
288
+			$file_list = array($file_list);
289
+		}
243 290
 
244 291
 		$file_count = count($file_list);
245 292
 		for($i=0;$i<$file_count;$i++)
@@ -327,7 +374,9 @@  discard block
 block discarded – undo
327 374
 	 */
328 375
 	function getFileGrant($file_info, $member_info)
329 376
 	{
330
-		if(!$file_info) return null;
377
+		if(!$file_info) {
378
+			return null;
379
+		}
331 380
 
332 381
 		if($_SESSION['__XE_UPLOADING_FILES_INFO__'][$file_info->file_srl])
333 382
 		{
@@ -340,7 +389,9 @@  discard block
 block discarded – undo
340 389
 
341 390
 		$oDocumentModel = getModel('document');
342 391
 		$oDocument = $oDocumentModel->getDocument($file_info->upload_target_srl);
343
-		if($oDocument->isExists()) $document_grant = $oDocument->isGranted();
392
+		if($oDocument->isExists()) {
393
+			$document_grant = $oDocument->isGranted();
394
+		}
344 395
 
345 396
 		$file_grant->is_deletable = ($document_grant || $member_info->is_admin == 'Y' || $member_info->member_srl == $file_info->member_srl || $grant->manager);
346 397
 
Please login to merge, or discard this patch.
modules/module/module.view.php 2 patches
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -25,14 +25,14 @@  discard block
 block discarded – undo
25 25
 		$skin = Context::get('skin');
26 26
 		// Get modules/skin information
27 27
 		$module_path = sprintf("./modules/%s/", $selected_module);
28
-		if(!is_dir($module_path)) $this->stop("msg_invalid_request");
28
+		if (!is_dir($module_path)) $this->stop("msg_invalid_request");
29 29
 
30 30
 		$skin_info_xml = sprintf("%sskins/%s/skin.xml", $module_path, $skin);
31
-		if(!file_exists($skin_info_xml)) $this->stop("msg_invalid_request");
31
+		if (!file_exists($skin_info_xml)) $this->stop("msg_invalid_request");
32 32
 
33 33
 		$oModuleModel = getModel('module');
34 34
 		$skin_info = $oModuleModel->loadSkinInfo($module_path, $skin);
35
-		Context::set('skin_info',$skin_info);
35
+		Context::set('skin_info', $skin_info);
36 36
 
37 37
 		$this->setLayoutFile("popup_layout");
38 38
 		$this->setTemplateFile("skin_info");
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 	 */
44 44
 	function dispModuleSelectList()
45 45
 	{
46
-		if(!Context::get('is_logged')) return new Object(-1, 'msg_not_permitted');
46
+		if (!Context::get('is_logged')) return new Object(-1, 'msg_not_permitted');
47 47
 
48 48
 		$oModuleModel = getModel('module');
49 49
 		$logged_info = Context::get('logged_info');
@@ -57,17 +57,17 @@  discard block
 block discarded – undo
57 57
 
58 58
 		$args = new stdClass();
59 59
 		$module_category_exists = false;
60
-		if($logged_info->is_admin == 'Y' && $site_keyword)
60
+		if ($logged_info->is_admin == 'Y' && $site_keyword)
61 61
 		{
62 62
 			$args->site_keyword = $site_keyword;
63 63
 		}
64 64
 		else
65 65
 		{
66
-			$args->site_srl = (int)$site_module_info->site_srl;
66
+			$args->site_srl = (int) $site_module_info->site_srl;
67 67
 			Context::set('site_keyword', null);
68 68
 		}
69 69
 
70
-		if($logged_info->is_admin == 'Y')
70
+		if ($logged_info->is_admin == 'Y')
71 71
 		{
72 72
 			$module_category_exists = true;
73 73
 		}
@@ -75,14 +75,14 @@  discard block
 block discarded – undo
75 75
 		// Get a list of modules at the site
76 76
 		$mid_list = array();
77 77
 		$output = executeQueryArray('module.getSiteModules', $args);
78
-		if(!$output->data) $output->data = array();
78
+		if (!$output->data) $output->data = array();
79 79
 
80
-		foreach($output->data as $key => $val)
80
+		foreach ($output->data as $key => $val)
81 81
 		{
82 82
 			$module = trim($val->module);
83
-			if(!$module) continue;
83
+			if (!$module) continue;
84 84
 
85
-			if(!$oModuleModel->getGrant($val, $logged_info)->access)
85
+			if (!$oModuleModel->getGrant($val, $logged_info)->access)
86 86
 			{
87 87
 				continue;
88 88
 			}
@@ -93,8 +93,8 @@  discard block
 block discarded – undo
93 93
 			$obj->browser_title = $val->browser_title;
94 94
 			$mid_list[$module]->list[$category][$val->mid] = $obj;
95 95
 
96
-			if(!$selected_module) $selected_module = $module;
97
-			if(!$mid_list[$module]->title)
96
+			if (!$selected_module) $selected_module = $module;
97
+			if (!$mid_list[$module]->title)
98 98
 			{
99 99
 				$xml_info = $oModuleModel->getModuleInfoXml($module);
100 100
 				$mid_list[$module]->title = $xml_info->title;
@@ -117,15 +117,15 @@  discard block
 block discarded – undo
117 117
 	function dispModuleFileBox()
118 118
 	{
119 119
 		$logged_info = Context::get('logged_info');
120
-		if($logged_info->is_admin !='Y' && !$logged_info->is_site_admin) return new Object(-1, 'msg_not_permitted');
120
+		if ($logged_info->is_admin != 'Y' && !$logged_info->is_site_admin) return new Object(-1, 'msg_not_permitted');
121 121
 
122 122
 		$input_name = Context::get('input');
123
-		if(!preg_match('/^[a-z0-9_]+$/i', $input_name))
123
+		if (!preg_match('/^[a-z0-9_]+$/i', $input_name))
124 124
 		{
125 125
 			return new Object(-1, 'msg_invalid_request');
126 126
 		}
127 127
 
128
-		if(!$input_name) return new Object(-1, 'msg_not_permitted');
128
+		if (!$input_name) return new Object(-1, 'msg_not_permitted');
129 129
 
130 130
 		$addscript = sprintf('<script>//<![CDATA[
131 131
 				var selected_filebox_input_name = "%s";
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 		Context::set('filebox_list', $output->data);
138 138
 
139 139
 		$filter = Context::get('filter');
140
-		if($filter) Context::set('arrfilter',explode(',',$filter));
140
+		if ($filter) Context::set('arrfilter', explode(',', $filter));
141 141
 
142 142
 		Context::set('page_navigation', $output->page_navigation);
143 143
 		$this->setLayoutFile('popup_layout');
@@ -148,10 +148,10 @@  discard block
 block discarded – undo
148 148
 	function dispModuleFileBoxAdd()
149 149
 	{
150 150
 		$logged_info = Context::get('logged_info');
151
-		if($logged_info->is_admin !='Y' && !$logged_info->is_site_admin) return new Object(-1, 'msg_not_permitted');
151
+		if ($logged_info->is_admin != 'Y' && !$logged_info->is_site_admin) return new Object(-1, 'msg_not_permitted');
152 152
 
153 153
 		$filter = Context::get('filter');
154
-		if($filter) Context::set('arrfilter',explode(',',$filter));
154
+		if ($filter) Context::set('arrfilter', explode(',', $filter));
155 155
 
156 156
 		$this->setLayoutFile('popup_layout');
157 157
 		$this->setTemplateFile('filebox_add');
Please login to merge, or discard this patch.
Braces   +34 added lines, -13 removed lines patch added patch discarded remove patch
@@ -25,10 +25,14 @@  discard block
 block discarded – undo
25 25
 		$skin = Context::get('skin');
26 26
 		// Get modules/skin information
27 27
 		$module_path = sprintf("./modules/%s/", $selected_module);
28
-		if(!is_dir($module_path)) $this->stop("msg_invalid_request");
28
+		if(!is_dir($module_path)) {
29
+			$this->stop("msg_invalid_request");
30
+		}
29 31
 
30 32
 		$skin_info_xml = sprintf("%sskins/%s/skin.xml", $module_path, $skin);
31
-		if(!file_exists($skin_info_xml)) $this->stop("msg_invalid_request");
33
+		if(!file_exists($skin_info_xml)) {
34
+			$this->stop("msg_invalid_request");
35
+		}
32 36
 
33 37
 		$oModuleModel = getModel('module');
34 38
 		$skin_info = $oModuleModel->loadSkinInfo($module_path, $skin);
@@ -43,7 +47,9 @@  discard block
 block discarded – undo
43 47
 	 */
44 48
 	function dispModuleSelectList()
45 49
 	{
46
-		if(!Context::get('is_logged')) return new Object(-1, 'msg_not_permitted');
50
+		if(!Context::get('is_logged')) {
51
+			return new Object(-1, 'msg_not_permitted');
52
+		}
47 53
 
48 54
 		$oModuleModel = getModel('module');
49 55
 		$logged_info = Context::get('logged_info');
@@ -60,8 +66,7 @@  discard block
 block discarded – undo
60 66
 		if($logged_info->is_admin == 'Y' && $site_keyword)
61 67
 		{
62 68
 			$args->site_keyword = $site_keyword;
63
-		}
64
-		else
69
+		} else
65 70
 		{
66 71
 			$args->site_srl = (int)$site_module_info->site_srl;
67 72
 			Context::set('site_keyword', null);
@@ -75,12 +80,16 @@  discard block
 block discarded – undo
75 80
 		// Get a list of modules at the site
76 81
 		$mid_list = array();
77 82
 		$output = executeQueryArray('module.getSiteModules', $args);
78
-		if(!$output->data) $output->data = array();
83
+		if(!$output->data) {
84
+			$output->data = array();
85
+		}
79 86
 
80 87
 		foreach($output->data as $key => $val)
81 88
 		{
82 89
 			$module = trim($val->module);
83
-			if(!$module) continue;
90
+			if(!$module) {
91
+				continue;
92
+			}
84 93
 
85 94
 			if(!$oModuleModel->getGrant($val, $logged_info)->access)
86 95
 			{
@@ -93,7 +102,9 @@  discard block
 block discarded – undo
93 102
 			$obj->browser_title = $val->browser_title;
94 103
 			$mid_list[$module]->list[$category][$val->mid] = $obj;
95 104
 
96
-			if(!$selected_module) $selected_module = $module;
105
+			if(!$selected_module) {
106
+				$selected_module = $module;
107
+			}
97 108
 			if(!$mid_list[$module]->title)
98 109
 			{
99 110
 				$xml_info = $oModuleModel->getModuleInfoXml($module);
@@ -117,7 +128,9 @@  discard block
 block discarded – undo
117 128
 	function dispModuleFileBox()
118 129
 	{
119 130
 		$logged_info = Context::get('logged_info');
120
-		if($logged_info->is_admin !='Y' && !$logged_info->is_site_admin) return new Object(-1, 'msg_not_permitted');
131
+		if($logged_info->is_admin !='Y' && !$logged_info->is_site_admin) {
132
+			return new Object(-1, 'msg_not_permitted');
133
+		}
121 134
 
122 135
 		$input_name = Context::get('input');
123 136
 		if(!preg_match('/^[a-z0-9_]+$/i', $input_name))
@@ -125,7 +138,9 @@  discard block
 block discarded – undo
125 138
 			return new Object(-1, 'msg_invalid_request');
126 139
 		}
127 140
 
128
-		if(!$input_name) return new Object(-1, 'msg_not_permitted');
141
+		if(!$input_name) {
142
+			return new Object(-1, 'msg_not_permitted');
143
+		}
129 144
 
130 145
 		$addscript = sprintf('<script>//<![CDATA[
131 146
 				var selected_filebox_input_name = "%s";
@@ -137,7 +152,9 @@  discard block
 block discarded – undo
137 152
 		Context::set('filebox_list', $output->data);
138 153
 
139 154
 		$filter = Context::get('filter');
140
-		if($filter) Context::set('arrfilter',explode(',',$filter));
155
+		if($filter) {
156
+			Context::set('arrfilter',explode(',',$filter));
157
+		}
141 158
 
142 159
 		Context::set('page_navigation', $output->page_navigation);
143 160
 		$this->setLayoutFile('popup_layout');
@@ -148,10 +165,14 @@  discard block
 block discarded – undo
148 165
 	function dispModuleFileBoxAdd()
149 166
 	{
150 167
 		$logged_info = Context::get('logged_info');
151
-		if($logged_info->is_admin !='Y' && !$logged_info->is_site_admin) return new Object(-1, 'msg_not_permitted');
168
+		if($logged_info->is_admin !='Y' && !$logged_info->is_site_admin) {
169
+			return new Object(-1, 'msg_not_permitted');
170
+		}
152 171
 
153 172
 		$filter = Context::get('filter');
154
-		if($filter) Context::set('arrfilter',explode(',',$filter));
173
+		if($filter) {
174
+			Context::set('arrfilter',explode(',',$filter));
175
+		}
155 176
 
156 177
 		$this->setLayoutFile('popup_layout');
157 178
 		$this->setTemplateFile('filebox_add');
Please login to merge, or discard this patch.
modules/menu/menu.admin.controller.php 2 patches
Spacing   +303 added lines, -303 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 	}
57 57
 
58 58
 	function __construct() {
59
-		$this->homeMenuCacheFile = _XE_PATH_ . $this->homeMenuCacheFile;
59
+		$this->homeMenuCacheFile = _XE_PATH_.$this->homeMenuCacheFile;
60 60
 	}
61 61
 
62 62
 	/**
@@ -68,8 +68,8 @@  discard block
 block discarded – undo
68 68
 		// List variables
69 69
 		$site_module_info = Context::get('site_module_info');
70 70
 
71
-		$output = $this->addMenu(Context::get('title'), (int)$site_module_info->site_srl);
72
-		if(!$output->toBool()) return $output;
71
+		$output = $this->addMenu(Context::get('title'), (int) $site_module_info->site_srl);
72
+		if (!$output->toBool()) return $output;
73 73
 
74 74
 		$this->add('menu_srl', $output->get('menuSrl'));
75 75
 		$this->setMessage('success_registed');
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 		$args->listorder = $args->menu_srl * -1;
96 96
 
97 97
 		$output = executeQuery('menu.insertMenu', $args);
98
-		if(!$output->toBool())
98
+		if (!$output->toBool())
99 99
 		{
100 100
 			return $output;
101 101
 		}
@@ -109,13 +109,13 @@  discard block
 block discarded – undo
109 109
 		$unlinked_modules = false;
110 110
 		$args = new stdClass;
111 111
 		$args->site_srl = 0;
112
-		$output = executeQueryArray('module.getNotLinkedModuleBySiteSrl',$args);
113
-		if($output->toBool() && $output->data && count($output->data) > 0)
112
+		$output = executeQueryArray('module.getNotLinkedModuleBySiteSrl', $args);
113
+		if ($output->toBool() && $output->data && count($output->data) > 0)
114 114
 		{
115 115
 			$unlinked_modules = $output->data;
116 116
 		}
117 117
 
118
-		if($unlinked_modules)
118
+		if ($unlinked_modules)
119 119
 		{
120 120
 			$unlinked_menu_srl = $this->getUnlinkedMenu();
121 121
 			$output = $this->updateLinkModule($unlinked_modules, $unlinked_menu_srl);
@@ -129,21 +129,21 @@  discard block
 block discarded – undo
129 129
 		$oModuleModel = getModel('module');
130 130
 		$moduleConfig = $oModuleModel->getModuleConfig('menu');
131 131
 
132
-		if($moduleConfig->unlinked_menu_srl)
132
+		if ($moduleConfig->unlinked_menu_srl)
133 133
 		{
134 134
 			$menuArgs = new stdClass;
135 135
 			$menuArgs->menu_srl = $moduleConfig->unlinked_menu_srl;
136 136
 			$menuOutput = executeQuery('menu.getMenu', $menuArgs);
137
-			if(!$menuOutput->data)
137
+			if (!$menuOutput->data)
138 138
 			{
139 139
 				unset($moduleConfig->unlinked_menu_srl);
140 140
 			}
141 141
 		}
142 142
 
143
-		if(!$moduleConfig->unlinked_menu_srl)
143
+		if (!$moduleConfig->unlinked_menu_srl)
144 144
 		{
145 145
 			$output = $this->addMenu('unlinked', 0);
146
-			if($output->toBool())
146
+			if ($output->toBool())
147 147
 			{
148 148
 				$moduleConfig->unlinked_menu_srl = $output->get('menuSrl');
149 149
 				$oModuleController = getController('module');
@@ -168,12 +168,12 @@  discard block
 block discarded – undo
168 168
 	 */
169 169
 	function updateLinkModule($moduleInfos, $menuSrl)
170 170
 	{
171
-		if(!$moduleInfos || !is_array($moduleInfos) || count($moduleInfos) == 0 || $menuSrl == 0)
171
+		if (!$moduleInfos || !is_array($moduleInfos) || count($moduleInfos) == 0 || $menuSrl == 0)
172 172
 		{
173 173
 			return new Object(-1, 'msg_invalid_request');
174 174
 		}
175 175
 
176
-		foreach($moduleInfos as $moduleInfo)
176
+		foreach ($moduleInfos as $moduleInfo)
177 177
 		{
178 178
 			// search menu.
179 179
 			$args = new stdClass;
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 
184 184
 			$output = executeQuery('menu.getMenuItemByUrl', $args);
185 185
 
186
-			if($output->toBool() && $output->data)
186
+			if ($output->toBool() && $output->data)
187 187
 			{
188 188
 				$moduleInfo->menu_srl = $output->data->menu_srl;
189 189
 			}
@@ -194,10 +194,10 @@  discard block
 block discarded – undo
194 194
 				$item_args->url = $moduleInfo->mid;
195 195
 				$item_args->name = $moduleInfo->mid;
196 196
 				$item_args->menu_item_srl = getNextSequence();
197
-				$item_args->listorder = -1*$item_args->menu_item_srl;
197
+				$item_args->listorder = -1 * $item_args->menu_item_srl;
198 198
 
199 199
 				$output = executeQuery('menu.insertMenuItem', $item_args);
200
-				if(!$output->toBool())
200
+				if (!$output->toBool())
201 201
 				{
202 202
 					return $output;
203 203
 				}
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 		}
211 211
 
212 212
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
213
-		if($oCacheHandler->isSupport())
213
+		if ($oCacheHandler->isSupport())
214 214
 		{
215 215
 			$oCacheHandler->invalidateGroupKey('site_and_module');
216 216
 		}
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 		$args->menu_srl = Context::get('menu_srl');
236 236
 
237 237
 		$output = executeQuery('menu.updateMenu', $args);
238
-		if(!$output->toBool()) return $output;
238
+		if (!$output->toBool()) return $output;
239 239
 
240 240
 		$this->setMessage('success_registed');
241 241
 
@@ -255,14 +255,14 @@  discard block
 block discarded – undo
255 255
 		$menuInfo = $oMenuAdminModel->getMenu($menu_srl);
256 256
 
257 257
 		$oAdmin = getClass('admin');
258
-		if($menuInfo->title == $oAdmin->getAdminMenuName())
258
+		if ($menuInfo->title == $oAdmin->getAdminMenuName())
259 259
 			return new Object(-1, 'msg_adminmenu_cannot_delete');
260 260
 
261 261
 		// get menu properies with child menu
262 262
 		$phpFile = sprintf("./files/cache/menu/%s.php", $menu_srl);
263 263
 		$originMenu = NULL;
264 264
 
265
-		if(is_readable(FileHandler::getRealPath($phpFile)))
265
+		if (is_readable(FileHandler::getRealPath($phpFile)))
266 266
 		{
267 267
 			include(FileHandler::getRealPath($phpFile));
268 268
 		}
@@ -273,25 +273,25 @@  discard block
 block discarded – undo
273 273
 
274 274
 		$isStartmenuInclude = false;
275 275
 
276
-		if(is_array($menu->list))
276
+		if (is_array($menu->list))
277 277
 		{
278
-			foreach($menu->list AS $key=>$value)
278
+			foreach ($menu->list AS $key=>$value)
279 279
 			{
280 280
 				$originMenu = $value;
281 281
 				$this->_checkHomeMenuInOriginMenu($originMenu, $siteInfo->mid, $isStartmenuInclude);
282 282
 
283
-				if($isStartmenuInclude)
283
+				if ($isStartmenuInclude)
284 284
 					break;
285 285
 			}
286 286
 		}
287 287
 
288
-		if($isStartmenuInclude)
288
+		if ($isStartmenuInclude)
289 289
 		{
290 290
 			return new Object(-1, 'msg_cannot_delete_homemenu');
291 291
 		}
292 292
 
293 293
 		$output = $this->deleteMenu($menu_srl);
294
-		if(!$output->toBool())
294
+		if (!$output->toBool())
295 295
 		{
296 296
 			return new Object(-1, $output->message);
297 297
 		}
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 
320 320
 		// Delete modules
321 321
 		$output = executeQueryArray('menu.getMenuItems', $args);
322
-		if(!$output->toBool())
322
+		if (!$output->toBool())
323 323
 		{
324 324
 			return $output;
325 325
 		}
@@ -327,15 +327,15 @@  discard block
 block discarded – undo
327 327
 		$oModuleController = getController('module');
328 328
 		$oModuleModel = getModel('module');
329 329
 
330
-		foreach($output->data as $itemInfo)
330
+		foreach ($output->data as $itemInfo)
331 331
 		{
332
-			if($itemInfo->is_shortcut != 'Y' && strncasecmp('http', $itemInfo->url, 4) !== 0)
332
+			if ($itemInfo->is_shortcut != 'Y' && strncasecmp('http', $itemInfo->url, 4) !== 0)
333 333
 			{
334 334
 				$moduleInfo = $oModuleModel->getModuleInfoByMid($itemInfo->url, $menuInfo->site_srl);
335
-				if($moduleInfo->module_srl)
335
+				if ($moduleInfo->module_srl)
336 336
 				{
337 337
 					$output = $oModuleController->onlyDeleteModule($moduleInfo->module_srl);
338
-					if(!$output->toBool())
338
+					if (!$output->toBool())
339 339
 					{
340 340
 						$oDB->rollback();
341 341
 						return $output;
@@ -346,27 +346,27 @@  discard block
 block discarded – undo
346 346
 
347 347
 		// Delete menu items
348 348
 		$output = executeQuery("menu.deleteMenuItems", $args);
349
-		if(!$output->toBool())
349
+		if (!$output->toBool())
350 350
 		{
351 351
 			$oDB->rollback();
352 352
 			return $output;
353 353
 		}
354 354
 		// Delete the menu
355 355
 		$output = executeQuery("menu.deleteMenu", $args);
356
-		if(!$output->toBool())
356
+		if (!$output->toBool())
357 357
 		{
358 358
 			$oDB->rollback();
359 359
 			return $output;
360 360
 		}
361 361
 
362 362
 		// Delete cache files
363
-		$cache_list = FileHandler::readDir("./files/cache/menu","",false,true);
364
-		if(count($cache_list))
363
+		$cache_list = FileHandler::readDir("./files/cache/menu", "", false, true);
364
+		if (count($cache_list))
365 365
 		{
366
-			foreach($cache_list as $cache_file)
366
+			foreach ($cache_list as $cache_file)
367 367
 			{
368 368
 				$pos = strpos($cache_file, $menu_srl.'.');
369
-				if($pos>0)FileHandler::removeFile($cache_file);
369
+				if ($pos > 0)FileHandler::removeFile($cache_file);
370 370
 			}
371 371
 		}
372 372
 		// Delete images of menu buttons
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
 
376 376
 		$oDB->commit();
377 377
 
378
-		return new Object(0,'success_deleted');
378
+		return new Object(0, 'success_deleted');
379 379
 	}
380 380
 
381 381
 	/**
@@ -385,24 +385,24 @@  discard block
 block discarded – undo
385 385
 	public function procMenuAdminInsertItem($request = NULL)
386 386
 	{
387 387
 		$isProc = false;
388
-		if(!$request)
388
+		if (!$request)
389 389
 		{
390 390
 			$isProc = true;
391 391
 			$request = Context::getRequestVars();
392 392
 		}
393 393
 
394
-		if(!$request->parent_srl || !$request->menu_name)
394
+		if (!$request->parent_srl || !$request->menu_name)
395 395
 		{
396 396
 			return new Object(-1, 'msg_invalid_request');
397 397
 		}
398 398
 
399 399
 		$this->_setMenuSrl($request->parent_srl, $request->menu_srl);
400
-		if(!$request->menu_srl)
400
+		if (!$request->menu_srl)
401 401
 		{
402 402
 			return new Object(-1, 'msg_invalid_request');
403 403
 		}
404 404
 
405
-		if($request->is_shortcut == 'Y')
405
+		if ($request->is_shortcut == 'Y')
406 406
 		{
407 407
 			$result = $this->_insertShortcut($request);
408 408
 		}
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
 			$result = $this->_insertMenu($request, $isProc);
412 412
 		}
413 413
 
414
-		if($result->error < 0)
414
+		if ($result->error < 0)
415 415
 		{
416 416
 			return new Object($result->error, $result->message);
417 417
 		}
@@ -419,7 +419,7 @@  discard block
 block discarded – undo
419 419
 		// recreate menu cache file
420 420
 		$this->makeXmlFile($request->menu_srl);
421 421
 
422
-		if(!$isProc)
422
+		if (!$isProc)
423 423
 		{
424 424
 			return $this->get('menu_item_srl');
425 425
 		}
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
 		$oMenuAdminModel = getAdminModel('menu');
432 432
 		$itemInfo = $oMenuAdminModel->getMenuItemInfo($parent_srl);
433 433
 		// parent_srl is parent menu item's srl
434
-		if($itemInfo->menu_srl)
434
+		if ($itemInfo->menu_srl)
435 435
 		{
436 436
 			$menu_srl = $itemInfo->menu_srl;
437 437
 		}
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
 		else
440 440
 		{
441 441
 			$output = $oMenuAdminModel->getMenu($parent_srl);
442
-			if($output->menu_srl == $parent_srl)
442
+			if ($output->menu_srl == $parent_srl)
443 443
 			{
444 444
 				$menu_srl = $output->menu_srl;
445 445
 				$parent_srl = 0;
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
 		$oDB->begin();
454 454
 
455 455
 		// type is url
456
-		if(strncasecmp('http', $request->shortcut_target, 4) === 0 || preg_match('/^(\.\/|\.\.\/|\/).*$/', $request->shortcut_target))
456
+		if (strncasecmp('http', $request->shortcut_target, 4) === 0 || preg_match('/^(\.\/|\.\.\/|\/).*$/', $request->shortcut_target))
457 457
 		{
458 458
 			// set menu variable
459 459
 			$args = new stdClass();
@@ -464,27 +464,27 @@  discard block
 block discarded – undo
464 464
 			$args->is_shortcut = $request->is_shortcut;
465 465
 			$args->url = $request->shortcut_target;
466 466
 
467
-			if(!$args->open_window) $args->open_window = 'N';
468
-			if(!$args->expand) $args->expand = 'N';
469
-			if(!$args->is_shortcut) $args->is_shortcut = 'Y';
467
+			if (!$args->open_window) $args->open_window = 'N';
468
+			if (!$args->expand) $args->expand = 'N';
469
+			if (!$args->is_shortcut) $args->is_shortcut = 'Y';
470 470
 
471
-			if($request->menu_name_key) $args->name = $request->menu_name_key;
471
+			if ($request->menu_name_key) $args->name = $request->menu_name_key;
472 472
 			else $args->name = $request->menu_name;
473 473
 		}
474 474
 		// type is module short cut
475
-		else if(is_numeric($request->shortcut_target))
475
+		else if (is_numeric($request->shortcut_target))
476 476
 		{
477 477
 			// Get original information
478 478
 			$oMenuAdminModel = getAdminModel('menu');
479 479
 			$itemInfo = $oMenuAdminModel->getMenuItemInfo($request->shortcut_target);
480
-			if(!$itemInfo->menu_item_srl)
480
+			if (!$itemInfo->menu_item_srl)
481 481
 			{
482 482
 				return new Object(-1, 'msg_invalid_request');
483 483
 			}
484 484
 			unset($itemInfo->normal_btn, $itemInfo->hover_btn, $itemInfo->active_btn);
485 485
 
486 486
 			$args = $itemInfo;
487
-			if(count($args->group_srls) == 0)
487
+			if (count($args->group_srls) == 0)
488 488
 			{
489 489
 				unset($args->group_srls);
490 490
 			}
@@ -504,13 +504,13 @@  discard block
 block discarded – undo
504 504
 			$args->url = '#';
505 505
 		}
506 506
 
507
-		if($request->menu_desc) $args->desc = $request->menu_desc;
507
+		if ($request->menu_desc) $args->desc = $request->menu_desc;
508 508
 		else $args->desc = '';
509 509
 
510 510
 		$args->menu_item_srl = getNextSequence();
511
-		$args->listorder = -1*$args->menu_item_srl;
511
+		$args->listorder = -1 * $args->menu_item_srl;
512 512
 		$output = executeQuery('menu.insertMenuItem', $args);
513
-		if(!$output->toBool()) return $output;
513
+		if (!$output->toBool()) return $output;
514 514
 
515 515
 		$oDB->commit();
516 516
 
@@ -532,46 +532,46 @@  discard block
 block discarded – undo
532 532
 		$args->expand = $request->menu_expand;
533 533
 		$args->is_shortcut = $request->is_shortcut;
534 534
 
535
-		if(!$args->open_window) $args->open_window = 'N';
536
-		if(!$args->expand) $args->expand = 'N';
537
-		if(!$args->is_shortcut) $args->is_shortcut = 'N';
535
+		if (!$args->open_window) $args->open_window = 'N';
536
+		if (!$args->expand) $args->expand = 'N';
537
+		if (!$args->is_shortcut) $args->is_shortcut = 'N';
538 538
 
539
-		if($request->menu_name_key) $args->name = $request->menu_name_key;
539
+		if ($request->menu_name_key) $args->name = $request->menu_name_key;
540 540
 		else $args->name = $request->menu_name;
541 541
 
542
-		if($request->menu_desc) $args->desc = $request->menu_desc;
542
+		if ($request->menu_desc) $args->desc = $request->menu_desc;
543 543
 		else $args->desc = '';
544 544
 
545
-		if($request->module_id && strncasecmp('http', $request->module_id, 4) === 0)
545
+		if ($request->module_id && strncasecmp('http', $request->module_id, 4) === 0)
546 546
 		{
547 547
 			return new Object(-1, 'msg_invalid_request');
548 548
 		}
549 549
 
550 550
 		// when menu copy, module already copied
551
-		if($isProc)
551
+		if ($isProc)
552 552
 		{
553 553
 			$result = $this->_insertModule($request, $args);
554
-			if(!$result->toBool())
554
+			if (!$result->toBool())
555 555
 			{
556 556
 				return new Object(-1, $result->message);
557 557
 			}
558 558
 		}
559 559
 
560 560
 		// if setting button variables, set argument button variables for db insert. but not upload in this method
561
-		if($request->normal_btn) $args->normal_btn = $request->normal_btn;
562
-		if($request->hover_btn) $args->hover_btn = $request->hover_btn;
563
-		if($request->active_btn) $args->active_btn = $request->active_btn;
561
+		if ($request->normal_btn) $args->normal_btn = $request->normal_btn;
562
+		if ($request->hover_btn) $args->hover_btn = $request->hover_btn;
563
+		if ($request->active_btn) $args->active_btn = $request->active_btn;
564 564
 
565
-		if(!$request->module_id)
565
+		if (!$request->module_id)
566 566
 		{
567 567
 			return new Object(-1, 'msg_invalid_request');
568 568
 		}
569 569
 
570 570
 		$args->url = $request->module_id;
571 571
 		$args->menu_item_srl = getNextSequence();
572
-		$args->listorder = -1*$args->menu_item_srl;
572
+		$args->listorder = -1 * $args->menu_item_srl;
573 573
 		$output = executeQuery('menu.insertMenuItem', $args);
574
-		if(!$output->toBool()) return $output;
574
+		if (!$output->toBool()) return $output;
575 575
 
576 576
 		$oDB->commit();
577 577
 
@@ -603,7 +603,7 @@  discard block
 block discarded – undo
603 603
 
604 604
 		//module create
605 605
 		$site_module_info = Context::get('site_module_info');
606
-		$cmArgs->site_srl = (int)$site_module_info->site_srl;
606
+		$cmArgs->site_srl = (int) $site_module_info->site_srl;
607 607
 		$cmArgs->browser_title = $args->name;
608 608
 		$cmArgs->menu_srl = $request->menu_srl;
609 609
 		$cmArgs->layout_srl = -1;
@@ -611,13 +611,13 @@  discard block
 block discarded – undo
611 611
 		$cmArgs->is_skin_fix = 'N';
612 612
 		$cmArgs->is_mskin_fix = 'N';
613 613
 
614
-		if(Mobile::isMobileEnabled() === true)
614
+		if (Mobile::isMobileEnabled() === true)
615 615
 		{
616 616
 			$cmArgs->use_mobile = 'Y';
617 617
 		}
618 618
 
619 619
 		// if mid is empty, auto create mid
620
-		if(!$request->module_id)
620
+		if (!$request->module_id)
621 621
 		{
622 622
 			$randomMid = $this->_makeRandomMid();
623 623
 			$request->module_id = $cmArgs->module.'_'.$randomMid;
@@ -627,7 +627,7 @@  discard block
 block discarded – undo
627 627
 		// check already created module instance
628 628
 		$oModuleModel = getModel('module');
629 629
 		$output = $oModuleModel->getModuleInfoByMid($request->module_id);
630
-		if($output->module_srl)
630
+		if ($output->module_srl)
631 631
 		{
632 632
 			return new Object(-1, 'msg_module_name_exists');
633 633
 		}
@@ -646,14 +646,14 @@  discard block
 block discarded – undo
646 646
 	{
647 647
 		$request = Context::getRequestVars();
648 648
 
649
-		if(!$request->menu_item_srl || !$request->menu_name)
649
+		if (!$request->menu_item_srl || !$request->menu_name)
650 650
 		{
651 651
 			return new Object(-1, 'msg_invalid_request');
652 652
 		}
653 653
 
654 654
 		// variables set
655
-		if($request->menu_open_window != "Y") $request->menu_open_window = "N";
656
-		if($request->menu_expand != "Y") $request->menu_expand = "N";
655
+		if ($request->menu_open_window != "Y") $request->menu_open_window = "N";
656
+		if ($request->menu_expand != "Y") $request->menu_expand = "N";
657 657
 
658 658
 		// Get original information
659 659
 		$oMenuAdminModel = getAdminModel('menu');
@@ -661,19 +661,19 @@  discard block
 block discarded – undo
661 661
 		$args = $itemInfo;
662 662
 
663 663
 		// if menu type is module, check exists module and update
664
-		if($itemInfo->is_shortcut == 'Y')
664
+		if ($itemInfo->is_shortcut == 'Y')
665 665
 		{
666 666
 			// type is url
667
-			if(strncasecmp('http', $request->shortcut_target, 4) === 0 || preg_match('/^(\.\/|\.\.\/|\/).*$/', $request->shortcut_target))
667
+			if (strncasecmp('http', $request->shortcut_target, 4) === 0 || preg_match('/^(\.\/|\.\.\/|\/).*$/', $request->shortcut_target))
668 668
 			{
669 669
 				$args->url = $request->shortcut_target;
670 670
 			}
671 671
 			// type is module short cut
672
-			else if(is_numeric($request->shortcut_target))
672
+			else if (is_numeric($request->shortcut_target))
673 673
 			{
674 674
 				// Get new original information
675 675
 				$newItemInfo = $oMenuAdminModel->getMenuItemInfo($request->shortcut_target);
676
-				if(!$newItemInfo->menu_item_srl)
676
+				if (!$newItemInfo->menu_item_srl)
677 677
 				{
678 678
 					return new Object(-1, 'msg_invalid_request');
679 679
 				}
@@ -690,10 +690,10 @@  discard block
 block discarded – undo
690 690
 		{
691 691
 			// check already created module instance
692 692
 			$oModuleModel = getModel('module');
693
-			if($request->module_id != $itemInfo->url)
693
+			if ($request->module_id != $itemInfo->url)
694 694
 			{
695 695
 				$output = $oModuleModel->getModuleInfoByMid($request->module_id);
696
-				if($output->module_srl)
696
+				if ($output->module_srl)
697 697
 				{
698 698
 					return new Object(-1, 'msg_module_name_exists');
699 699
 				}
@@ -701,13 +701,13 @@  discard block
 block discarded – undo
701 701
 
702 702
 			// if not exist module, return error
703 703
 			$moduleInfo = $oModuleModel->getModuleInfoByMid($itemInfo->url);
704
-			if(!$moduleInfo)
704
+			if (!$moduleInfo)
705 705
 			{
706 706
 				return new Object(-1, 'msg_invalid_request');
707 707
 			}
708 708
 
709 709
 			$moduleInfo->mid = $request->module_id;
710
-			if($request->browser_title)
710
+			if ($request->browser_title)
711 711
 			{
712 712
 				$moduleInfo->browser_title = $request->browser_title;
713 713
 			}
@@ -716,7 +716,7 @@  discard block
 block discarded – undo
716 716
 			$args->url = $request->module_id;
717 717
 		}
718 718
 
719
-		if($request->menu_name_key)
719
+		if ($request->menu_name_key)
720 720
 		{
721 721
 			$args->name = $request->menu_name_key;
722 722
 		}
@@ -725,7 +725,7 @@  discard block
 block discarded – undo
725 725
 			$args->name = $request->menu_name;
726 726
 		}
727 727
 
728
-		if($request->menu_desc) $args->desc = $request->menu_desc;
728
+		if ($request->menu_desc) $args->desc = $request->menu_desc;
729 729
 		else $args->desc = '';
730 730
 
731 731
 		unset($args->group_srls);
@@ -753,38 +753,38 @@  discard block
 block discarded – undo
753 753
 
754 754
 		$btnOutput = $this->_uploadButton($args);
755 755
 
756
-		if($btnOutput['normal_btn'])
756
+		if ($btnOutput['normal_btn'])
757 757
 		{
758 758
 			$this->add('normal_btn', $btnOutput['normal_btn']);
759 759
 			$item_info->normal_btn = $btnOutput['normal_btn'];
760 760
 		}
761
-		if($btnOutput['hover_btn'])
761
+		if ($btnOutput['hover_btn'])
762 762
 		{
763 763
 			$this->add('hover_btn', $btnOutput['hover_btn']);
764 764
 			$item_info->hover_btn = $btnOutput['hover_btn'];
765 765
 		}
766
-		if($btnOutput['active_btn'])
766
+		if ($btnOutput['active_btn'])
767 767
 		{
768 768
 			$this->add('active_btn', $btnOutput['active_btn']);
769 769
 			$item_info->active_btn = $btnOutput['active_btn'];
770 770
 		}
771 771
 
772 772
 		// group_srls check
773
-		if(count($item_info->group_srls) == 0)
773
+		if (count($item_info->group_srls) == 0)
774 774
 		{
775 775
 			unset($item_info->group_srls);
776 776
 		}
777 777
 
778 778
 		// Button delete check
779
-		if(!$btnOutput['normal_btn'] && $args->isNormalDelete == 'Y')
779
+		if (!$btnOutput['normal_btn'] && $args->isNormalDelete == 'Y')
780 780
 		{
781 781
 			$item_info->normal_btn = '';
782 782
 		}
783
-		if(!$btnOutput['hover_btn'] && $args->isHoverDelete == 'Y')
783
+		if (!$btnOutput['hover_btn'] && $args->isHoverDelete == 'Y')
784 784
 		{
785 785
 			$item_info->hover_btn = '';
786 786
 		}
787
-		if(!$btnOutput['active_btn'] && $args->isActiveDelete == 'Y')
787
+		if (!$btnOutput['active_btn'] && $args->isActiveDelete == 'Y')
788 788
 		{
789 789
 			$item_info->active_btn = '';
790 790
 		}
@@ -824,7 +824,7 @@  discard block
 block discarded – undo
824 824
 		$args->is_force = Context::get('is_force');
825 825
 
826 826
 		$returnObj = $this->deleteItem($args);
827
-		if(is_object($returnObj))
827
+		if (is_object($returnObj))
828 828
 		{
829 829
 			$this->setError($returnObj->error);
830 830
 			$this->setMessage($returnObj->message);
@@ -853,11 +853,11 @@  discard block
 block discarded – undo
853 853
 		$args->menu_srl = $itemInfo->menu_srl;
854 854
 
855 855
 		// Display an error that the category cannot be deleted if it has a child node	603
856
-		if($args->is_force != 'Y')
856
+		if ($args->is_force != 'Y')
857 857
 		{
858 858
 			$output = executeQuery('menu.getChildMenuCount', $args);
859
-			if(!$output->toBool()) return $output;
860
-			if($output->data->count > 0)
859
+			if (!$output->toBool()) return $output;
860
+			if ($output->data->count > 0)
861 861
 			{
862 862
 				return new Object(-1001, 'msg_cannot_delete_for_child');
863 863
 			}
@@ -869,22 +869,22 @@  discard block
 block discarded – undo
869 869
 
870 870
 		// check admin menu delete
871 871
 		$oAdmin = getClass('admin');
872
-		if($menu_title == $oAdmin->getAdminMenuName() && $itemInfo->parent_srl == 0)
872
+		if ($menu_title == $oAdmin->getAdminMenuName() && $itemInfo->parent_srl == 0)
873 873
 		{
874 874
 			return $this->stop('msg_cannot_delete_for_admin_topmenu');
875 875
 		}
876 876
 
877
-		if($itemInfo->parent_srl) $parent_srl = $itemInfo->parent_srl;
877
+		if ($itemInfo->parent_srl) $parent_srl = $itemInfo->parent_srl;
878 878
 
879 879
 		// get menu properies with child menu
880 880
 		$phpFile = sprintf("./files/cache/menu/%s.php", $args->menu_srl);
881 881
 		$originMenu = NULL;
882 882
 
883
-		if(is_readable(FileHandler::getRealPath($phpFile)))
883
+		if (is_readable(FileHandler::getRealPath($phpFile)))
884 884
 		{
885 885
 			include(FileHandler::getRealPath($phpFile));
886 886
 
887
-			if(is_array($menu->list))
887
+			if (is_array($menu->list))
888 888
 			{
889 889
 				$this->_searchMenu($menu->list, $args->menu_item_srl, $originMenu);
890 890
 			}
@@ -894,7 +894,7 @@  discard block
 block discarded – undo
894 894
 		$siteInfo = $oModuleModel->getSiteInfo($menuInfo->site_srl);
895 895
 		$isStartmenuInclude = false;
896 896
 		$this->_checkHomeMenuInOriginMenu($originMenu, $siteInfo->mid, $isStartmenuInclude);
897
-		if($isStartmenuInclude)
897
+		if ($isStartmenuInclude)
898 898
 		{
899 899
 			return new Object(-1, 'msg_cannot_delete_homemenu');
900 900
 		}
@@ -918,14 +918,14 @@  discard block
 block discarded – undo
918 918
 
919 919
 	private function _checkHomeMenuInOriginMenu($originMenu, $startMid, &$isStartmenuInclude)
920 920
 	{
921
-		if($originMenu['is_shortcut'] != 'Y' && $originMenu['url'] == $startMid)
921
+		if ($originMenu['is_shortcut'] != 'Y' && $originMenu['url'] == $startMid)
922 922
 		{
923 923
 			$isStartmenuInclude = true;
924 924
 		}
925 925
 
926
-		if(!$isStartmenuInclude && is_array($originMenu['list']))
926
+		if (!$isStartmenuInclude && is_array($originMenu['list']))
927 927
 		{
928
-			foreach($originMenu['list'] AS $key=>$value)
928
+			foreach ($originMenu['list'] AS $key=>$value)
929 929
 			{
930 930
 				$this->_checkHomeMenuInOriginMenu($value, $startMid, $isStartmenuInclude);
931 931
 			}
@@ -939,7 +939,7 @@  discard block
 block discarded – undo
939 939
 		$args->menu_srl = $menuSrl;
940 940
 		$args->menu_item_srl = $node['node_srl'];
941 941
 		$output = executeQuery("menu.deleteMenuItem", $args);
942
-		if(!$output->toBool())
942
+		if (!$output->toBool())
943 943
 		{
944 944
 			$oDB->rollback();
945 945
 			return $output;
@@ -948,12 +948,12 @@  discard block
 block discarded – undo
948 948
 		// Update the xml file and get its location
949 949
 		$xml_file = $this->makeXmlFile($args->menu_srl);
950 950
 		// Delete all of image buttons
951
-		if($node['normal_btn']) FileHandler::removeFile($node['normal_btn']);
952
-		if($node['hover_btn']) FileHandler::removeFile($node['hover_btn']);
953
-		if($node['active_btn']) FileHandler::removeFile($node['active_btn']);
951
+		if ($node['normal_btn']) FileHandler::removeFile($node['normal_btn']);
952
+		if ($node['hover_btn']) FileHandler::removeFile($node['hover_btn']);
953
+		if ($node['active_btn']) FileHandler::removeFile($node['active_btn']);
954 954
 
955 955
 		// Delete module
956
-		if($node['is_shortcut'] != 'Y' && strncasecmp('http', $node['url'], 4) !== 0)
956
+		if ($node['is_shortcut'] != 'Y' && strncasecmp('http', $node['url'], 4) !== 0)
957 957
 		{
958 958
 			$oModuleController = getController('module');
959 959
 			$oModuleModel = getModel('module');
@@ -963,12 +963,12 @@  discard block
 block discarded – undo
963 963
 			$args->site_srl = $menuInfo->site_srl;
964 964
 			$args->is_shortcut = 'Y';
965 965
 			$output = executeQuery('menu.getMenuItemByUrl', $args);
966
-			if($output->data->menu_item_srl)
966
+			if ($output->data->menu_item_srl)
967 967
 			{
968 968
 				$output->data->url = '';
969 969
 				$referenceItem = $output->data;
970 970
 				$output = $this->_updateMenuItem($referenceItem);
971
-				if(!$output->toBool())
971
+				if (!$output->toBool())
972 972
 				{
973 973
 					$oDB->rollback();
974 974
 					return $output;
@@ -976,10 +976,10 @@  discard block
 block discarded – undo
976 976
 			}
977 977
 
978 978
 			$moduleInfo = $oModuleModel->getModuleInfoByMid($node['url'], $menuInfo->site_srl);
979
-			if($moduleInfo->module_srl)
979
+			if ($moduleInfo->module_srl)
980 980
 			{
981 981
 				$output = $oModuleController->onlyDeleteModule($moduleInfo->module_srl);
982
-				if(!$output->toBool())
982
+				if (!$output->toBool())
983 983
 				{
984 984
 					$oDB->rollback();
985 985
 					return $output;
@@ -992,14 +992,14 @@  discard block
 block discarded – undo
992 992
 	private function _recursiveDeleteMenuItem(&$oDB, &$menuInfo, $node)
993 993
 	{
994 994
 		$output = $this->_deleteMenuItem($oDB, $menuInfo, $node);
995
-		if(!$output->toBool())
995
+		if (!$output->toBool())
996 996
 		{
997 997
 			return new Object(-1, $output->message);
998 998
 		}
999 999
 
1000
-		if(is_array($node['list']))
1000
+		if (is_array($node['list']))
1001 1001
 		{
1002
-			foreach($node['list'] AS $key=>$value)
1002
+			foreach ($node['list'] AS $key=>$value)
1003 1003
 			{
1004 1004
 				$this->_recursiveDeleteMenuItem($oDB, $menuInfo, $value);
1005 1005
 			}
@@ -1012,31 +1012,31 @@  discard block
 block discarded – undo
1012 1012
 	 */
1013 1013
 	function procMenuAdminMoveItem()
1014 1014
 	{
1015
-		$mode = Context::get('mode');	//move
1016
-		$parent_srl = Context::get('parent_srl');	// Parent menu item serial number
1017
-		$source_srl = Context::get('source_srl');	// Same hierarchy's menu item serial number
1018
-		$target_srl = Context::get('target_srl');	// Self menu item serial number
1015
+		$mode = Context::get('mode'); //move
1016
+		$parent_srl = Context::get('parent_srl'); // Parent menu item serial number
1017
+		$source_srl = Context::get('source_srl'); // Same hierarchy's menu item serial number
1018
+		$target_srl = Context::get('target_srl'); // Self menu item serial number
1019 1019
 
1020
-		if(!$mode || !$parent_srl || !$target_srl) return new Object(-1,'msg_invalid_request');
1020
+		if (!$mode || !$parent_srl || !$target_srl) return new Object(-1, 'msg_invalid_request');
1021 1021
 
1022 1022
 		$oMenuAdminModel = getAdminModel('menu');
1023 1023
 
1024 1024
 		// get original menu item info for cache file recreate
1025 1025
 		$originalItemInfo = $oMenuAdminModel->getMenuItemInfo($target_srl);
1026
-		if(!$originalItemInfo->menu_item_srl)
1026
+		if (!$originalItemInfo->menu_item_srl)
1027 1027
 		{
1028 1028
 			return new Object(-1, 'msg_empty_menu_item');
1029 1029
 		}
1030 1030
 
1031 1031
 		// get menu properies with child menu
1032
-		$phpFile = sprintf(_XE_PATH_ . "files/cache/menu/%s.php", $originalItemInfo->menu_srl);
1032
+		$phpFile = sprintf(_XE_PATH_."files/cache/menu/%s.php", $originalItemInfo->menu_srl);
1033 1033
 		$originMenu = NULL;
1034 1034
 
1035
-		if(is_readable(FileHandler::getRealPath($phpFile)))
1035
+		if (is_readable(FileHandler::getRealPath($phpFile)))
1036 1036
 		{
1037 1037
 			include(FileHandler::getRealPath($phpFile));
1038 1038
 
1039
-			if(is_array($menu->list))
1039
+			if (is_array($menu->list))
1040 1040
 			{
1041 1041
 				$this->_searchMenu($menu->list, $originalItemInfo->menu_item_srl, $originMenu);
1042 1042
 			}
@@ -1045,7 +1045,7 @@  discard block
 block discarded – undo
1045 1045
 		// get target menu info for move
1046 1046
 		$targetMenuItemInfo = $oMenuAdminModel->getMenuItemInfo($parent_srl);
1047 1047
 		// if move in same sitemap
1048
-		if($targetMenuItemInfo->menu_item_srl)
1048
+		if ($targetMenuItemInfo->menu_item_srl)
1049 1049
 		{
1050 1050
 			$menu_srl = $targetMenuItemInfo->menu_srl;
1051 1051
 		}
@@ -1057,20 +1057,20 @@  discard block
 block discarded – undo
1057 1057
 			$parent_srl = 0;
1058 1058
 		}
1059 1059
 
1060
-		if(!$this->homeModuleMid)
1060
+		if (!$this->homeModuleMid)
1061 1061
 		{
1062 1062
 			$oModuleModel = getModel('module');
1063 1063
 			$oMenuAdminController = getAdminController('menu');
1064 1064
 			$columnList = array('modules.mid',);
1065 1065
 			$output = $oModuleModel->getSiteInfo(0, $columnList);
1066
-			if($output->mid)
1066
+			if ($output->mid)
1067 1067
 			{
1068 1068
 				$this->homeModuleMid = $output->mid;
1069 1069
 			}
1070 1070
 		}
1071 1071
 
1072 1072
 		$this->moveMenuItem($menu_srl, $parent_srl, $source_srl, $target_srl, $mode, $originMenu['is_shortcut'], $originMenu['url']);
1073
-		if(count($originMenu['list']) > 0)
1073
+		if (count($originMenu['list']) > 0)
1074 1074
 		{
1075 1075
 			$this->_recursiveUpdateMenuItem($originMenu['list'], $menu_srl);
1076 1076
 		}
@@ -1084,9 +1084,9 @@  discard block
 block discarded – undo
1084 1084
 
1085 1085
 	private function _recursiveUpdateMenuItem($node, $menu_srl)
1086 1086
 	{
1087
-		if(is_array($node))
1087
+		if (is_array($node))
1088 1088
 		{
1089
-			foreach($node AS $key=>$node)
1089
+			foreach ($node AS $key=>$node)
1090 1090
 			{
1091 1091
 				$args = new stdClass();
1092 1092
 				$args->menu_srl = $menu_srl;
@@ -1094,11 +1094,11 @@  discard block
 block discarded – undo
1094 1094
 				$output = $this->_updateMenuItem($args);
1095 1095
 
1096 1096
 				//module's menu_srl move also
1097
-				if($node['is_shortcut'] == 'N' && !empty($node['url']))
1097
+				if ($node['is_shortcut'] == 'N' && !empty($node['url']))
1098 1098
 				{
1099 1099
 					$oModuleModel = getModel('module');
1100 1100
 					$moduleInfo = $oModuleModel->getModuleInfoByMid($node['url']);
1101
-					if($menu_srl != $moduleInfo->menu_srl)
1101
+					if ($menu_srl != $moduleInfo->menu_srl)
1102 1102
 					{
1103 1103
 						$moduleInfo->menu_srl = $menu_srl;
1104 1104
 						$oModuleController = getController('module');
@@ -1106,7 +1106,7 @@  discard block
 block discarded – undo
1106 1106
 					}
1107 1107
 				}
1108 1108
 
1109
-				if(count($node['list']) > 0)
1109
+				if (count($node['list']) > 0)
1110 1110
 				{
1111 1111
 					$this->_recursiveUpdateMenuItem($node['list'], $menu_srl);
1112 1112
 				}
@@ -1128,21 +1128,21 @@  discard block
 block discarded – undo
1128 1128
 		$menuSrl = $itemInfo->menu_srl;
1129 1129
 
1130 1130
 		// get menu properies with child menu
1131
-		$phpFile = sprintf(_XE_PATH_ . "files/cache/menu/%s.php", $menuSrl);
1131
+		$phpFile = sprintf(_XE_PATH_."files/cache/menu/%s.php", $menuSrl);
1132 1132
 		$originMenu = NULL;
1133 1133
 
1134
-		if(is_readable(FileHandler::getRealPath($phpFile)))
1134
+		if (is_readable(FileHandler::getRealPath($phpFile)))
1135 1135
 		{
1136 1136
 			include(FileHandler::getRealPath($phpFile));
1137 1137
 
1138
-			if(is_array($menu->list))
1138
+			if (is_array($menu->list))
1139 1139
 			{
1140 1140
 				$this->_searchMenu($menu->list, $menuItemSrl, $originMenu);
1141 1141
 			}
1142 1142
 		}
1143 1143
 
1144 1144
 		// copy the menu item with recursively
1145
-		if(is_array($originMenu))
1145
+		if (is_array($originMenu))
1146 1146
 		{
1147 1147
 			$this->_copyMenu($menuSrl, $parentSrl, $originMenu);
1148 1148
 		}
@@ -1158,15 +1158,15 @@  discard block
 block discarded – undo
1158 1158
 	 */
1159 1159
 	private function _searchMenu(&$menuList, $menuItemSrl, &$originMenu)
1160 1160
 	{
1161
-		if(array_key_exists($menuItemSrl, $menuList))
1161
+		if (array_key_exists($menuItemSrl, $menuList))
1162 1162
 		{
1163 1163
 			$originMenu = $menuList[$menuItemSrl];
1164 1164
 			return;
1165 1165
 		}
1166 1166
 
1167
-		foreach($menuList AS $key=>$value)
1167
+		foreach ($menuList AS $key=>$value)
1168 1168
 		{
1169
-			if(count($value['list']) > 0)
1169
+			if (count($value['list']) > 0)
1170 1170
 			{
1171 1171
 				$this->_searchMenu($value['list'], $menuItemSrl, $originMenu);
1172 1172
 			}
@@ -1181,7 +1181,7 @@  discard block
 block discarded – undo
1181 1181
 		// default argument setting
1182 1182
 		$args = new stdClass();
1183 1183
 		$args->menu_srl = $menuSrl;
1184
-		if($parentSrl == 0) $args->parent_srl = $menuSrl;
1184
+		if ($parentSrl == 0) $args->parent_srl = $menuSrl;
1185 1185
 		else $args->parent_srl = $parentSrl;
1186 1186
 		$args->menu_name_key = $originMenu['text'];
1187 1187
 		$args->menu_name = $originMenu['text'];
@@ -1194,7 +1194,7 @@  discard block
 block discarded – undo
1194 1194
 
1195 1195
 		$isModuleCopySuccess = false;
1196 1196
 		// if menu have a reference of module instance
1197
-		if($menuItemInfo->is_shortcut == 'N' && strncasecmp('http', $originMenu['url'], 4) !== 0 )
1197
+		if ($menuItemInfo->is_shortcut == 'N' && strncasecmp('http', $originMenu['url'], 4) !== 0)
1198 1198
 		{
1199 1199
 			$oModuleModel = getModel('module');
1200 1200
 			$moduleInfo = $oModuleModel->getModuleInfoByMid($originMenu['url']);
@@ -1214,22 +1214,22 @@  discard block
 block discarded – undo
1214 1214
 
1215 1215
 			$args->module_srl = $copiedModuleSrl;
1216 1216
 
1217
-			if($copiedModuleSrl)
1217
+			if ($copiedModuleSrl)
1218 1218
 			{
1219 1219
 				$isModuleCopySuccess = true;
1220 1220
 			}
1221 1221
 		}
1222 1222
 		// if menu type is shortcut
1223
-		else if($menuItemInfo->is_shortcut == 'Y')
1223
+		else if ($menuItemInfo->is_shortcut == 'Y')
1224 1224
 		{
1225 1225
 			$args->shortcut_target = $originMenu['url'];
1226 1226
 			$isModuleCopySuccess = true;
1227 1227
 		}
1228 1228
 
1229
-		if($isModuleCopySuccess)
1229
+		if ($isModuleCopySuccess)
1230 1230
 		{
1231 1231
 			// if have a group permission
1232
-			if($menuItemInfo->group_srls)
1232
+			if ($menuItemInfo->group_srls)
1233 1233
 			{
1234 1234
 				$args->group_srls = $menuItemInfo->group_srls;
1235 1235
 			}
@@ -1243,12 +1243,12 @@  discard block
 block discarded – undo
1243 1243
 
1244 1244
 			// if have a button, copy a button image also
1245 1245
 			$insertedMenuItemSrl = $this->get('menu_item_srl');
1246
-			if($menuItemInfo->normal_btn || $menuItemInfo->hover_btn || $menuItemInfo->active_btn)
1246
+			if ($menuItemInfo->normal_btn || $menuItemInfo->hover_btn || $menuItemInfo->active_btn)
1247 1247
 			{
1248 1248
 				// copy & upate
1249 1249
 				$update_item_info = $oMenuAdminModel->getMenuItemInfo($insertedMenuItemSrl);
1250
-				$copied_info = $this->_copyButton($insertedMenuItemSrl,$update_item_info->menu_srl, $menuItemInfo);
1251
-				if(count($update_item_info->group_srls) == 0)
1250
+				$copied_info = $this->_copyButton($insertedMenuItemSrl, $update_item_info->menu_srl, $menuItemInfo);
1251
+				if (count($update_item_info->group_srls) == 0)
1252 1252
 				{
1253 1253
 					unset($update_item_info->group_srls);
1254 1254
 				}
@@ -1262,7 +1262,7 @@  discard block
 block discarded – undo
1262 1262
 
1263 1263
 		// if have a child menu, copy child menu also
1264 1264
 		$childMenu = array_shift($originMenu['list']);
1265
-		if(count($childMenu) > 0)
1265
+		if (count($childMenu) > 0)
1266 1266
 		{
1267 1267
 			$this->_copyMenu($menuSrl, $insertedMenuItemSrl, $childMenu);
1268 1268
 		}
@@ -1272,10 +1272,10 @@  discard block
 block discarded – undo
1272 1272
 	{
1273 1273
 		$time = $_SERVER['REQUEST_TIME'];
1274 1274
 		$randomString = "";
1275
-		for($i=0;$i<4;$i++)
1275
+		for ($i = 0; $i < 4; $i++)
1276 1276
 		{
1277 1277
 			$case = rand(0, 1);
1278
-			if($case) $doc = rand(65, 90);
1278
+			if ($case) $doc = rand(65, 90);
1279 1279
 			else $doc = rand(97, 122);
1280 1280
 
1281 1281
 			$randomString .= chr($doc);
@@ -1299,32 +1299,32 @@  discard block
 block discarded – undo
1299 1299
 		// menu name update
1300 1300
 		$args->menu_srl = $this->menuSrl;
1301 1301
 		$output = executeQuery('menu.updateMenu', $args);
1302
-		if(!$output->toBool()) return $output;
1302
+		if (!$output->toBool()) return $output;
1303 1303
 
1304 1304
 		$this->map = array();
1305
-		if(is_array($parentKeyList))
1305
+		if (is_array($parentKeyList))
1306 1306
 		{
1307
-			foreach($parentKeyList as $no=>$srl)
1307
+			foreach ($parentKeyList as $no=>$srl)
1308 1308
 			{
1309
-				if($srl === 0) continue;
1310
-				if(!is_array($this->map[$srl]))$this->map[$srl] = array();
1309
+				if ($srl === 0) continue;
1310
+				if (!is_array($this->map[$srl]))$this->map[$srl] = array();
1311 1311
 				$this->map[$srl][] = $no;
1312 1312
 			}
1313 1313
 		}
1314 1314
 
1315 1315
 		$result = array();
1316
-		if(is_array($this->itemKeyList))
1316
+		if (is_array($this->itemKeyList))
1317 1317
 		{
1318
-			foreach($this->itemKeyList as $srl)
1318
+			foreach ($this->itemKeyList as $srl)
1319 1319
 			{
1320
-				if(!$this->checked[$srl])
1320
+				if (!$this->checked[$srl])
1321 1321
 				{
1322 1322
 					$target = new stdClass();
1323 1323
 					$this->checked[$srl] = 1;
1324 1324
 					$target->node = $srl;
1325
-					$target->child= array();
1325
+					$target->child = array();
1326 1326
 
1327
-					while(count($this->map[$srl]))
1327
+					while (count($this->map[$srl]))
1328 1328
 					{
1329 1329
 						$this->_setParent($srl, array_shift($this->map[$srl]), $target);
1330 1330
 					}
@@ -1333,13 +1333,13 @@  discard block
 block discarded – undo
1333 1333
 			}
1334 1334
 		}
1335 1335
 
1336
-		if(is_array($result))
1336
+		if (is_array($result))
1337 1337
 		{
1338 1338
 			$i = 0;
1339
-			foreach($result AS $key=>$node)
1339
+			foreach ($result AS $key=>$node)
1340 1340
 			{
1341
-				$this->moveMenuItem($this->menuSrl, 0, $i, $node->node, 'move');	//move parent node
1342
-				$this->_recursiveMoveMenuItem($node);	//move child node
1341
+				$this->moveMenuItem($this->menuSrl, 0, $i, $node->node, 'move'); //move parent node
1342
+				$this->_recursiveMoveMenuItem($node); //move child node
1343 1343
 				$i = $node->node;
1344 1344
 			}
1345 1345
 		}
@@ -1368,7 +1368,7 @@  discard block
 block discarded – undo
1368 1368
 		$child_node->child = array();
1369 1369
 		$target->child[] = $child_node;
1370 1370
 
1371
-		while(count($this->map[$child_srl]))
1371
+		while (count($this->map[$child_srl]))
1372 1372
 		{
1373 1373
 			$this->_setParent($child_srl, array_shift($this->map[$child_srl]), $child_node);
1374 1374
 		}
@@ -1383,7 +1383,7 @@  discard block
 block discarded – undo
1383 1383
 	function _recursiveMoveMenuItem($result)
1384 1384
 	{
1385 1385
 		$i = 0;
1386
-		while(count($result->child))
1386
+		while (count($result->child))
1387 1387
 		{
1388 1388
 			unset($node);
1389 1389
 			$node = array_shift($result->child);
@@ -1403,48 +1403,48 @@  discard block
 block discarded – undo
1403 1403
 	 * @param string $mode 'move' or 'insert'
1404 1404
 	 * @return void
1405 1405
 	 */
1406
-	function moveMenuItem($menu_srl, $parent_srl, $source_srl, $target_srl, $mode, $isShortcut='Y', $url=NULL)
1406
+	function moveMenuItem($menu_srl, $parent_srl, $source_srl, $target_srl, $mode, $isShortcut = 'Y', $url = NULL)
1407 1407
 	{
1408 1408
 		// Get the original menus
1409 1409
 		$oMenuAdminModel = getAdminModel('menu');
1410 1410
 
1411 1411
 		$target_item = $oMenuAdminModel->getMenuItemInfo($target_srl);
1412
-		if($target_item->menu_item_srl != $target_srl) return new Object(-1,'msg_invalid_request');
1412
+		if ($target_item->menu_item_srl != $target_srl) return new Object(-1, 'msg_invalid_request');
1413 1413
 		// Move the menu location(change the order menu appears)
1414
-		if($mode == 'move')
1414
+		if ($mode == 'move')
1415 1415
 		{
1416 1416
 			$args = new stdClass();
1417 1417
 			$args->parent_srl = $parent_srl;
1418 1418
 			$args->menu_srl = $menu_srl;
1419 1419
 
1420
-			if($source_srl)
1420
+			if ($source_srl)
1421 1421
 			{
1422 1422
 				$source_item = $oMenuAdminModel->getMenuItemInfo($source_srl);
1423
-				if($source_item->menu_item_srl != $source_srl) return new Object(-1,'msg_invalid_request');
1424
-				$args->listorder = $source_item->listorder-1;
1423
+				if ($source_item->menu_item_srl != $source_srl) return new Object(-1, 'msg_invalid_request');
1424
+				$args->listorder = $source_item->listorder - 1;
1425 1425
 			}
1426 1426
 			else
1427 1427
 			{
1428 1428
 				$output = executeQuery('menu.getMaxListorder', $args);
1429
-				if(!$output->toBool()) return $output;
1430
-				$args->listorder = (int)$output->data->listorder;
1431
-				if(!$args->listorder) $args->listorder= 0;
1429
+				if (!$output->toBool()) return $output;
1430
+				$args->listorder = (int) $output->data->listorder;
1431
+				if (!$args->listorder) $args->listorder = 0;
1432 1432
 			}
1433 1433
 			$args->parent_srl = $parent_srl;
1434 1434
 			$output = executeQuery('menu.updateMenuItemListorder', $args);
1435
-			if(!$output->toBool()) return $output;
1435
+			if (!$output->toBool()) return $output;
1436 1436
 
1437 1437
 			$args->parent_srl = $parent_srl;
1438 1438
 			$args->menu_item_srl = $target_srl;
1439 1439
 			$output = executeQuery('menu.updateMenuItemNode', $args);
1440
-			if(!$output->toBool()) return $output;
1440
+			if (!$output->toBool()) return $output;
1441 1441
 
1442 1442
 			//module's menu_srl move also
1443
-			if($isShortcut == 'N' && !empty($url))
1443
+			if ($isShortcut == 'N' && !empty($url))
1444 1444
 			{
1445 1445
 				$oModuleModel = getModel('module');
1446 1446
 				$moduleInfo = $oModuleModel->getModuleInfoByMid($url);
1447
-				if($menu_srl != $moduleInfo->menu_srl)
1447
+				if ($menu_srl != $moduleInfo->menu_srl)
1448 1448
 				{
1449 1449
 					$moduleInfo->menu_srl = $menu_srl;
1450 1450
 					$oModuleController = getController('module');
@@ -1452,13 +1452,13 @@  discard block
 block discarded – undo
1452 1452
 				}
1453 1453
 
1454 1454
 				// change home menu cache file
1455
-				if($url == $this->homeModuleMid)
1455
+				if ($url == $this->homeModuleMid)
1456 1456
 				{
1457
-					if(file_exists($this->homeMenuCacheFile))
1457
+					if (file_exists($this->homeMenuCacheFile))
1458 1458
 					{
1459 1459
 						include($this->homeMenuCacheFile);
1460 1460
 					}
1461
-					if(!$homeMenuSrl || $homeMenuSrl != $menu_srl)
1461
+					if (!$homeMenuSrl || $homeMenuSrl != $menu_srl)
1462 1462
 					{
1463 1463
 						$this->makeHomemenuCacheFile($menu_srl);
1464 1464
 					}
@@ -1466,13 +1466,13 @@  discard block
 block discarded – undo
1466 1466
 			}
1467 1467
 			// Add a child
1468 1468
 		}
1469
-		elseif($mode == 'insert')
1469
+		elseif ($mode == 'insert')
1470 1470
 		{
1471 1471
 			$args->menu_item_srl = $target_srl;
1472 1472
 			$args->parent_srl = $parent_srl;
1473
-			$args->listorder = -1*getNextSequence();
1473
+			$args->listorder = -1 * getNextSequence();
1474 1474
 			$output = executeQuery('menu.updateMenuItemNode', $args);
1475
-			if(!$output->toBool()) return $output;
1475
+			if (!$output->toBool()) return $output;
1476 1476
 		}
1477 1477
 
1478 1478
 		$xml_file = $this->makeXmlFile($menu_srl);
@@ -1497,8 +1497,8 @@  discard block
 block discarded – undo
1497 1497
 		// Re-generate the xml file
1498 1498
 		$xml_file = $this->makeXmlFile($menu_srl);
1499 1499
 		// Set return value
1500
-		$this->add('menu_title',$menu_title);
1501
-		$this->add('xml_file',$xml_file);
1500
+		$this->add('menu_title', $menu_title);
1501
+		$this->add('xml_file', $xml_file);
1502 1502
 	}
1503 1503
 
1504 1504
 	/**
@@ -1512,12 +1512,12 @@  discard block
 block discarded – undo
1512 1512
 		$target = Context::get('target');
1513 1513
 		$target_file = Context::get($target);
1514 1514
 		// Error occurs when the target is neither a uploaded file nor a valid file
1515
-		if(!$menu_srl || !$menu_item_srl)
1515
+		if (!$menu_srl || !$menu_item_srl)
1516 1516
 		{
1517 1517
 			Context::set('error_messge', Context::getLang('msg_invalid_request'));
1518 1518
 
1519 1519
 		}
1520
-		else if(!$target_file || !is_uploaded_file($target_file['tmp_name']) || !preg_match('/\.(gif|jpeg|jpg|png)$/i',$target_file['name'])  || !checkUploadedFile($target_file['tmp_name']))
1520
+		else if (!$target_file || !is_uploaded_file($target_file['tmp_name']) || !preg_match('/\.(gif|jpeg|jpg|png)$/i', $target_file['name']) || !checkUploadedFile($target_file['tmp_name']))
1521 1521
 		{
1522 1522
 			Context::set('error_messge', Context::getLang('msg_invalid_request'));
1523 1523
 		}
@@ -1525,13 +1525,13 @@  discard block
 block discarded – undo
1525 1525
 		// Move the file to a specific director if the uploaded file meets requirement
1526 1526
 		else
1527 1527
 		{
1528
-			$tmp_arr = explode('.',$target_file['name']);
1529
-			$ext = $tmp_arr[count($tmp_arr)-1];
1528
+			$tmp_arr = explode('.', $target_file['name']);
1529
+			$ext = $tmp_arr[count($tmp_arr) - 1];
1530 1530
 
1531 1531
 			$path = sprintf('./files/attach/menu_button/%d/', $menu_srl);
1532 1532
 			$filename = sprintf('%s%d.%s.%s', $path, $menu_item_srl, $target, $ext);
1533 1533
 
1534
-			if(!is_dir($path)) FileHandler::makeDir($path);
1534
+			if (!is_dir($path)) FileHandler::makeDir($path);
1535 1535
 
1536 1536
 			move_uploaded_file($target_file['tmp_name'], $filename);
1537 1537
 			Context::set('filename', $filename);
@@ -1564,14 +1564,14 @@  discard block
 block discarded – undo
1564 1564
 	{
1565 1565
 		$oModuleModel = getModel('module');
1566 1566
 		$installed_module_list = $oModuleModel->getModulesXmlInfo();
1567
-		if(is_array($installed_module_list))
1567
+		if (is_array($installed_module_list))
1568 1568
 		{
1569 1569
 			$currentLang = Context::getLangType();
1570 1570
 			$menuList = array();
1571
-			foreach($installed_module_list AS $key=>$value)
1571
+			foreach ($installed_module_list AS $key=>$value)
1572 1572
 			{
1573 1573
 				$info = $oModuleModel->getModuleActionXml($value->module);
1574
-				if($info->menu) $menuList[$value->module] = $info->menu;
1574
+				if ($info->menu) $menuList[$value->module] = $info->menu;
1575 1575
 				unset($info->menu);
1576 1576
 			}
1577 1577
 		}
@@ -1603,8 +1603,8 @@  discard block
 block discarded – undo
1603 1603
 		$info = $oModuleModel->getModuleActionXml($moduleName);
1604 1604
 
1605 1605
 		$url = getNotEncodedFullUrl('', 'module', 'admin', 'act', $info->menu->{$menuName}->index);
1606
-		if(empty($url)) $url = getNotEncodedFullUrl('', 'module', 'admin', 'act', $info->admin_index_act);
1607
-		if(empty($url)) $url = getNotEncodedFullUrl('', 'module', 'admin');
1606
+		if (empty($url)) $url = getNotEncodedFullUrl('', 'module', 'admin', 'act', $info->admin_index_act);
1607
+		if (empty($url)) $url = getNotEncodedFullUrl('', 'module', 'admin');
1608 1608
 		$dbInfo = Context::getDBInfo();
1609 1609
 
1610 1610
 		$args = new stdClass();
@@ -1613,7 +1613,7 @@  discard block
 block discarded – undo
1613 1613
 		$args->menu_srl = $requestArgs->menu_srl;
1614 1614
 		$args->name = sprintf('{$lang->menu_gnb_sub[\'%s\']}', $menuName);
1615 1615
 		//if now page is https...
1616
-		if(strpos($url, 'https') !== false)
1616
+		if (strpos($url, 'https') !== false)
1617 1617
 		{
1618 1618
 			$args->url = str_replace('https'.substr($dbInfo->default_url, 4), '', $url);
1619 1619
 		}
@@ -1627,23 +1627,23 @@  discard block
 block discarded – undo
1627 1627
 		$args->hover_btn = '';
1628 1628
 		$args->active_btn = '';
1629 1629
 		$args->group_srls = implode(',', array_keys($groupSrlList));
1630
-		$args->listorder = -1*$args->menu_item_srl;
1630
+		$args->listorder = -1 * $args->menu_item_srl;
1631 1631
 
1632 1632
 		// Check if already exists
1633 1633
 		$oMenuModel = getAdminModel('menu');
1634 1634
 		$item_info = $oMenuModel->getMenuItemInfo($args->menu_item_srl);
1635 1635
 		// Update if exists
1636
-		if($item_info->menu_item_srl == $args->menu_item_srl)
1636
+		if ($item_info->menu_item_srl == $args->menu_item_srl)
1637 1637
 		{
1638 1638
 			$output = $this->_updateMenuItem($args);
1639
-			if(!$output->toBool()) return $output;
1639
+			if (!$output->toBool()) return $output;
1640 1640
 		}
1641 1641
 		// Insert if not exist
1642 1642
 		else
1643 1643
 		{
1644
-			$args->listorder = -1*$args->menu_item_srl;
1644
+			$args->listorder = -1 * $args->menu_item_srl;
1645 1645
 			$output = executeQuery('menu.insertMenuItem', $args);
1646
-			if(!$output->toBool()) return $output;
1646
+			if (!$output->toBool()) return $output;
1647 1647
 		}
1648 1648
 		// Get information of the menu
1649 1649
 		$menu_info = $oMenuModel->getMenu($args->menu_srl);
@@ -1671,23 +1671,23 @@  discard block
 block discarded – undo
1671 1671
 
1672 1672
 		// Menu Exposure update
1673 1673
 		// if exposure target is only login user...
1674
-		if(!$exposure)
1674
+		if (!$exposure)
1675 1675
 		{
1676 1676
 			$args->group_srls = '';
1677 1677
 		}
1678 1678
 		else
1679 1679
 		{
1680 1680
 			$exposure = explode(',', $exposure);
1681
-			if(in_array($exposure, array('-1','-3')))
1681
+			if (in_array($exposure, array('-1', '-3')))
1682 1682
 			{
1683 1683
 				$args->group_srls = $exposure;
1684 1684
 			}
1685 1685
 
1686
-			if($exposure) $args->group_srls = implode(',', $exposure);
1686
+			if ($exposure) $args->group_srls = implode(',', $exposure);
1687 1687
 		}
1688 1688
 
1689 1689
 		$output = $this->_updateMenuItem($args);
1690
-		if(!$output->toBool())
1690
+		if (!$output->toBool())
1691 1691
 		{
1692 1692
 			return $output;
1693 1693
 		}
@@ -1701,21 +1701,21 @@  discard block
 block discarded – undo
1701 1701
 		$moduleInfo = $oModuleModel->getModuleInfoByMid($itemInfo->url, $menuInfo->site_srl);
1702 1702
 		$xml_info = $oModuleModel->getModuleActionXML($moduleInfo->module);
1703 1703
 
1704
-		if($itemInfo->is_shortcut === 'Y')
1704
+		if ($itemInfo->is_shortcut === 'Y')
1705 1705
 		{
1706 1706
 			$moduleGrnatsArgs = new stdClass;
1707 1707
 			$moduleGrnatsArgs->module_srl = $moduleInfo->module_srl;
1708 1708
 			$output = executeQueryArray('module.getModuleGrants', $moduleGrnatsArgs);
1709
-			if(!$output->data) $output->data = array();
1709
+			if (!$output->data) $output->data = array();
1710 1710
 			$moduleGrnats = new stdClass();
1711
-			foreach($output->data as $grant)
1711
+			foreach ($output->data as $grant)
1712 1712
 			{
1713 1713
 				$moduleGrnats->{$grant->name}[] = $grant->group_srl;
1714 1714
 			}
1715 1715
 		}
1716 1716
 
1717 1717
 		$grantList = $xml_info->grant;
1718
-		if(!$grantList) $grantList = new stdClass;
1718
+		if (!$grantList) $grantList = new stdClass;
1719 1719
 
1720 1720
 		$grantList->access = new stdClass();
1721 1721
 		$grantList->access->default = 'guest';
@@ -1723,14 +1723,14 @@  discard block
 block discarded – undo
1723 1723
 		$grantList->manager->default = 'manager';
1724 1724
 
1725 1725
 		$grant = new stdClass();
1726
-		foreach($grantList AS $grantName=>$grantInfo)
1726
+		foreach ($grantList AS $grantName=>$grantInfo)
1727 1727
 		{
1728
-			if($htPerm[$grantName])
1728
+			if ($htPerm[$grantName])
1729 1729
 			{
1730 1730
 				$htPerm[$grantName] = explode(',', $htPerm[$grantName]);
1731 1731
 
1732 1732
 				// users in a particular group
1733
-				if(is_array($htPerm[$grantName]))
1733
+				if (is_array($htPerm[$grantName]))
1734 1734
 				{
1735 1735
 					$grant->{$grantName} = $htPerm[$grantName];
1736 1736
 					continue;
@@ -1742,13 +1742,13 @@  discard block
 block discarded – undo
1742 1742
 					continue;
1743 1743
 				}
1744 1744
 			}
1745
-			else if($itemInfo->is_shortcut === 'Y')
1745
+			else if ($itemInfo->is_shortcut === 'Y')
1746 1746
 			{
1747
-				if(isset($moduleGrnats) && $moduleGrnats->{$grantName}) $grant->{$grantName} = $moduleGrnats->{$grantName};
1747
+				if (isset($moduleGrnats) && $moduleGrnats->{$grantName}) $grant->{$grantName} = $moduleGrnats->{$grantName};
1748 1748
 			}
1749 1749
 		}
1750 1750
 
1751
-		if(count($grant))
1751
+		if (count($grant))
1752 1752
 		{
1753 1753
 			$oModuleController = getController('module');
1754 1754
 			$oModuleController->insertModuleGrants($moduleInfo->module_srl, $grant);
@@ -1766,15 +1766,15 @@  discard block
 block discarded – undo
1766 1766
 	function makeXmlFile($menu_srl)
1767 1767
 	{
1768 1768
 		// Return if there is no information when creating the xml file
1769
-		if(!$menu_srl) return;
1769
+		if (!$menu_srl) return;
1770 1770
 		// Get menu informaton
1771 1771
 		$args = new stdClass();
1772 1772
 		$args->menu_srl = $menu_srl;
1773 1773
 		$output = executeQuery('menu.getMenu', $args);
1774
-		if(!$output->toBool() || !$output->data) return $output;
1775
-		$site_srl = (int)$output->data->site_srl;
1774
+		if (!$output->toBool() || !$output->data) return $output;
1775
+		$site_srl = (int) $output->data->site_srl;
1776 1776
 
1777
-		if($site_srl)
1777
+		if ($site_srl)
1778 1778
 		{
1779 1779
 			$oModuleModel = getModel('module');
1780 1780
 			$columnList = array('sites.domain');
@@ -1785,13 +1785,13 @@  discard block
 block discarded – undo
1785 1785
 		$args->menu_srl = $menu_srl;
1786 1786
 		$args->sort_index = 'listorder';
1787 1787
 		$output = executeQuery('menu.getMenuItems', $args);
1788
-		if(!$output->toBool()) return;
1788
+		if (!$output->toBool()) return;
1789 1789
 		// Specify the name of the cache file
1790
-		$xml_file = sprintf(_XE_PATH_ . "files/cache/menu/%s.xml.php", $menu_srl);
1791
-		$php_file = sprintf(_XE_PATH_ . "files/cache/menu/%s.php", $menu_srl);
1790
+		$xml_file = sprintf(_XE_PATH_."files/cache/menu/%s.xml.php", $menu_srl);
1791
+		$php_file = sprintf(_XE_PATH_."files/cache/menu/%s.php", $menu_srl);
1792 1792
 		// If no data found, generate an XML file without node data
1793 1793
 		$list = $output->data;
1794
-		if(!$list)
1794
+		if (!$list)
1795 1795
 		{
1796 1796
 			$xml_buff = "<root />";
1797 1797
 			FileHandler::writeFile($xml_file, $xml_buff);
@@ -1799,10 +1799,10 @@  discard block
 block discarded – undo
1799 1799
 			return $xml_file;
1800 1800
 		}
1801 1801
 		// Change to an array if only a single data is obtained
1802
-		if(!is_array($list)) $list = array($list);
1802
+		if (!is_array($list)) $list = array($list);
1803 1803
 		// Create a tree for loop
1804 1804
 		$list_count = count($list);
1805
-		for($i=0;$i<$list_count;$i++)
1805
+		for ($i = 0; $i < $list_count; $i++)
1806 1806
 		{
1807 1807
 			$node = $list[$i];
1808 1808
 			$menu_item_srl = $node->menu_item_srl;
@@ -1858,7 +1858,7 @@  discard block
 block discarded – undo
1858 1858
 		$php_buff = sprintf(
1859 1859
 			'<?php '.
1860 1860
 			'if(!defined("__XE__")) exit(); '.
1861
-			'$menu = new stdClass();' .
1861
+			'$menu = new stdClass();'.
1862 1862
 			'%s; '.
1863 1863
 			'%s; '.
1864 1864
 			'$menu->list = array(%s); '.
@@ -1887,26 +1887,26 @@  discard block
 block discarded – undo
1887 1887
 	 */
1888 1888
 	function getXmlTree($source_node, $tree, $site_srl, $domain)
1889 1889
 	{
1890
-		if(!$source_node) return;
1890
+		if (!$source_node) return;
1891 1891
 
1892 1892
 		$oMenuAdminModel = getAdminModel('menu');
1893 1893
 
1894
-		foreach($source_node as $menu_item_srl => $node)
1894
+		foreach ($source_node as $menu_item_srl => $node)
1895 1895
 		{
1896 1896
 			$child_buff = "";
1897 1897
 			// Get data of the child nodes
1898
-			if($menu_item_srl&&$tree[$menu_item_srl]) $child_buff = $this->getXmlTree($tree[$menu_item_srl], $tree, $site_srl, $domain);
1898
+			if ($menu_item_srl && $tree[$menu_item_srl]) $child_buff = $this->getXmlTree($tree[$menu_item_srl], $tree, $site_srl, $domain);
1899 1899
 			// List variables
1900 1900
 			$names = $oMenuAdminModel->getMenuItemNames($node->name, $site_srl);
1901
-			foreach($names as $key => $val)
1901
+			foreach ($names as $key => $val)
1902 1902
 			{
1903
-				$name_arr_str .= sprintf('"%s"=>\'%s\',',$key, str_replace(array('\\', '\''), array('\\\\', '\\\''), $val));
1903
+				$name_arr_str .= sprintf('"%s"=>\'%s\',', $key, str_replace(array('\\', '\''), array('\\\\', '\\\''), $val));
1904 1904
 			}
1905 1905
 			$name_str = sprintf('$_names = array(%s); print $_names[$lang_type];', $name_arr_str);
1906 1906
 
1907
-			$url = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->url);
1908
-			$desc = str_replace(array('&','"',"'"),array('&amp;','&quot;','\\\''),$node->desc);
1909
-			if(preg_match('/^([0-9a-zA-Z\_\-]+)$/', $node->url))
1907
+			$url = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $node->url);
1908
+			$desc = str_replace(array('&', '"', "'"), array('&amp;', '&quot;', '\\\''), $node->desc);
1909
+			if (preg_match('/^([0-9a-zA-Z\_\-]+)$/', $node->url))
1910 1910
 			{
1911 1911
 				$href = "getSiteUrl('$domain', '','mid','$node->url')";
1912 1912
 			}
@@ -1916,21 +1916,21 @@  discard block
 block discarded – undo
1916 1916
 			$expand = $node->expand;
1917 1917
 
1918 1918
 			$normal_btn = $node->normal_btn;
1919
-			if($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) $normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$normal_btn);
1919
+			if ($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) $normal_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $normal_btn);
1920 1920
 			else $normal_btn = '';
1921 1921
 			$hover_btn = $node->hover_btn;
1922
-			if($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) $hover_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$hover_btn);
1922
+			if ($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) $hover_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $hover_btn);
1923 1923
 			else $hover_btn = '';
1924 1924
 			$active_btn = $node->active_btn;
1925
-			if($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) $active_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$active_btn);
1925
+			if ($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) $active_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $active_btn);
1926 1926
 			else $active_btn = '';
1927 1927
 
1928 1928
 			$group_srls = $node->group_srls;
1929 1929
 
1930
-			if($normal_btn)
1930
+			if ($normal_btn)
1931 1931
 			{
1932
-				if($hover_btn) $hover_str = sprintf('onmouseover=&quot;this.src=\'%s\'&quot;', $hover_btn); else $hover_str = '';
1933
-				if($active_btn) $active_str = sprintf('onmousedown=&quot;this.src=\'%s\'&quot;', $active_btn); else $active_str = '';
1932
+				if ($hover_btn) $hover_str = sprintf('onmouseover=&quot;this.src=\'%s\'&quot;', $hover_btn); else $hover_str = '';
1933
+				if ($active_btn) $active_str = sprintf('onmousedown=&quot;this.src=\'%s\'&quot;', $active_btn); else $active_str = '';
1934 1934
 				$link = sprintf('&lt;img src=&quot;%s&quot; onmouseout=&quot;this.src=\'%s\'&quot; alt=&quot;<?php print htmlspecialchars($_names[$lang_type], ENT_COMPAT | ENT_HTML401, \'UTF-8\', false) ?>&quot; %s %s /&gt;', $normal_btn, $normal_btn, $hover_str, $active_str);
1935 1935
 			}
1936 1936
 			else
@@ -1938,7 +1938,7 @@  discard block
 block discarded – undo
1938 1938
 				$link = '<?php print $_names[$lang_type]; ?>';
1939 1939
 			}
1940 1940
 			// If the value of node->group_srls exists
1941
-			if($group_srls)$group_check_code = sprintf('($is_admin==true||(is_array($group_srls)&&count(array_intersect($group_srls, array(%s))))||($is_logged&&%s))',$group_srls,$group_srls == -1?1:0);
1941
+			if ($group_srls)$group_check_code = sprintf('($is_admin==true||(is_array($group_srls)&&count(array_intersect($group_srls, array(%s))))||($is_logged&&%s))', $group_srls, $group_srls == -1 ? 1 : 0);
1942 1942
 			else $group_check_code = "true";
1943 1943
 			$attribute = sprintf(
1944 1944
 				'node_srl="%s" parent_srl="%s" menu_name_key=\'%s\' text="<?php if(%s) { %s }?>" url="<?php print(%s?"%s":"")?>" href="<?php print(%s?%s:"")?>" is_shortcut="%s" desc="%s" open_window="%s" expand="%s" normal_btn="%s" hover_btn="%s" active_btn="%s" link="<?php if(%s) {?>%s<?php }?>"',
@@ -1962,8 +1962,8 @@  discard block
 block discarded – undo
1962 1962
 				$link
1963 1963
 			);
1964 1964
 
1965
-			if($child_buff) $buff .= sprintf('<node %s>%s</node>', $attribute, $child_buff);
1966
-			else $buff .=  sprintf('<node %s />', $attribute);
1965
+			if ($child_buff) $buff .= sprintf('<node %s>%s</node>', $attribute, $child_buff);
1966
+			else $buff .= sprintf('<node %s />', $attribute);
1967 1967
 		}
1968 1968
 		return $buff;
1969 1969
 	}
@@ -1982,84 +1982,84 @@  discard block
 block discarded – undo
1982 1982
 	function getPhpCacheCode($source_node, $tree, $site_srl, $domain)
1983 1983
 	{
1984 1984
 		$output = array("buff"=>"", "url_list"=>array());
1985
-		if(!$source_node) return $output;
1985
+		if (!$source_node) return $output;
1986 1986
 
1987 1987
 		$oMenuAdminModel = getAdminModel('menu');
1988 1988
 
1989
-		foreach($source_node as $menu_item_srl => $node)
1989
+		foreach ($source_node as $menu_item_srl => $node)
1990 1990
 		{
1991 1991
 			// Get data from child nodes if exist.
1992
-			if($menu_item_srl&&$tree[$menu_item_srl]) $child_output = $this->getPhpCacheCode($tree[$menu_item_srl], $tree, $site_srl, $domain);
1992
+			if ($menu_item_srl && $tree[$menu_item_srl]) $child_output = $this->getPhpCacheCode($tree[$menu_item_srl], $tree, $site_srl, $domain);
1993 1993
 			else $child_output = array("buff"=>"", "url_list"=>array());
1994 1994
 
1995 1995
 			// List variables
1996 1996
 			$names = $oMenuAdminModel->getMenuItemNames($node->name, $site_srl);
1997 1997
 			unset($name_arr_str);
1998
-			foreach($names as $key => $val)
1998
+			foreach ($names as $key => $val)
1999 1999
 			{
2000
-				if(preg_match('/\{\$lang->menu_gnb(?:_sub)?\[\'([a-zA-Z_]+)\'\]\}/', $val) === 1)
2000
+				if (preg_match('/\{\$lang->menu_gnb(?:_sub)?\[\'([a-zA-Z_]+)\'\]\}/', $val) === 1)
2001 2001
 				{
2002 2002
 					$name_arr_str .= sprintf('"%s"=>"%s",', $key, $val);
2003 2003
 				}
2004 2004
 				else
2005 2005
 				{
2006
-					$name_arr_str .= sprintf('"%s"=>\'%s\',', $key, str_replace(array('\\','\''), array('\\\\','\\\''), removeHackTag($val)));
2006
+					$name_arr_str .= sprintf('"%s"=>\'%s\',', $key, str_replace(array('\\', '\''), array('\\\\', '\\\''), removeHackTag($val)));
2007 2007
 				}
2008 2008
 			}
2009 2009
 			$name_str = sprintf('$_menu_names[%d] = array(%s); %s', $node->menu_item_srl, $name_arr_str, $child_output['name']);
2010 2010
 
2011 2011
 			// If url value is not empty in the current node, put the value into an array url_list
2012
-			if($node->url) $child_output['url_list'][] = $node->url;
2012
+			if ($node->url) $child_output['url_list'][] = $node->url;
2013 2013
 			$output['url_list'] = array_merge($output['url_list'], $child_output['url_list']);
2014 2014
 			// If node->group_srls value exists
2015
-			if($node->group_srls)$group_check_code = sprintf('($is_admin==true||(is_array($group_srls)&&count(array_intersect($group_srls, array(%s))))||($is_logged && %s))',$node->group_srls,$node->group_srls == -1?1:0);
2015
+			if ($node->group_srls)$group_check_code = sprintf('($is_admin==true||(is_array($group_srls)&&count(array_intersect($group_srls, array(%s))))||($is_logged && %s))', $node->group_srls, $node->group_srls == -1 ? 1 : 0);
2016 2016
 			else $group_check_code = "true";
2017 2017
 
2018 2018
 			// List variables
2019
-			$href = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->href);
2020
-			$url = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->url);
2021
-			$desc = str_replace(array('&','"',"'"),array('&amp;','&quot;','\\\''),$node->desc);
2022
-			if(preg_match('/^([0-9a-zA-Z\_\-]+)$/i', $node->url))
2019
+			$href = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $node->href);
2020
+			$url = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $node->url);
2021
+			$desc = str_replace(array('&', '"', "'"), array('&amp;', '&quot;', '\\\''), $node->desc);
2022
+			if (preg_match('/^([0-9a-zA-Z\_\-]+)$/i', $node->url))
2023 2023
 			{
2024 2024
 				$href = "getSiteUrl('$domain', '','mid','$node->url')";
2025 2025
 			}
2026 2026
 			else $href = sprintf('"%s"', $url);
2027 2027
 			$is_shortcut = $node->is_shortcut;
2028 2028
 			$open_window = $node->open_window;
2029
-			$normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->normal_btn);
2030
-			$hover_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->hover_btn);
2031
-			$active_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->active_btn);
2029
+			$normal_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $node->normal_btn);
2030
+			$hover_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $node->hover_btn);
2031
+			$active_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $node->active_btn);
2032 2032
 
2033
-			foreach($child_output['url_list'] as $key =>$val)
2033
+			foreach ($child_output['url_list'] as $key =>$val)
2034 2034
 			{
2035 2035
 				$child_output['url_list'][$key] = addslashes($val);
2036 2036
 			}
2037 2037
 
2038
-			$selected = '"'.implode('","',$child_output['url_list']).'"';
2038
+			$selected = '"'.implode('","', $child_output['url_list']).'"';
2039 2039
 			$child_buff = $child_output['buff'];
2040 2040
 			$expand = $node->expand;
2041 2041
 
2042 2042
 			$normal_btn = $node->normal_btn;
2043
-			if($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) $normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$normal_btn);
2043
+			if ($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) $normal_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $normal_btn);
2044 2044
 			else $normal_btn = '';
2045 2045
 
2046 2046
 			$hover_btn = $node->hover_btn;
2047
-			if($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) $hover_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$hover_btn);
2047
+			if ($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) $hover_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $hover_btn);
2048 2048
 			else $hover_btn = '';
2049 2049
 
2050 2050
 			$active_btn = $node->active_btn;
2051
-			if($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) $active_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$active_btn);
2051
+			if ($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) $active_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $active_btn);
2052 2052
 			else $active_btn = '';
2053 2053
 
2054 2054
 
2055 2055
 			$group_srls = $node->group_srls;
2056 2056
 
2057
-			if($normal_btn)
2057
+			if ($normal_btn)
2058 2058
 			{
2059
-				if($hover_btn) $hover_str = sprintf('onmouseover=\"this.src=\'%s\'\"', $hover_btn); else $hover_str = '';
2060
-				if($active_btn) $active_str = sprintf('onmousedown=\"this.src=\'%s\'\"', $active_btn); else $active_str = '';
2059
+				if ($hover_btn) $hover_str = sprintf('onmouseover=\"this.src=\'%s\'\"', $hover_btn); else $hover_str = '';
2060
+				if ($active_btn) $active_str = sprintf('onmousedown=\"this.src=\'%s\'\"', $active_btn); else $active_str = '';
2061 2061
 				$link = sprintf('"<img src=\"%s\" onmouseout=\"this.src=\'%s\'\" alt=\"".$_menu_names[%d][$lang_type]."\" %s %s />"', $normal_btn, $normal_btn, $node->menu_item_srl, $hover_str, $active_str);
2062
-				if($active_btn) $link_active = sprintf('"<img src=\"%s\" onmouseout=\"this.src=\'%s\'\" alt=\"".$_menu_names[%d][$lang_type]."\" %s />"', $active_btn, $active_btn, $node->menu_item_srl, $hover_str);
2062
+				if ($active_btn) $link_active = sprintf('"<img src=\"%s\" onmouseout=\"this.src=\'%s\'\" alt=\"".$_menu_names[%d][$lang_type]."\" %s />"', $active_btn, $active_btn, $node->menu_item_srl, $hover_str);
2063 2063
 				else $link_active = $link;
2064 2064
 			}
2065 2065
 			else
@@ -2097,7 +2097,7 @@  discard block
 block discarded – undo
2097 2097
 			);
2098 2098
 
2099 2099
 			// Generate buff data
2100
-			$output['buff'] .=  sprintf('%s=>array(%s),', $node->menu_item_srl, $attribute);
2100
+			$output['buff'] .= sprintf('%s=>array(%s),', $node->menu_item_srl, $attribute);
2101 2101
 			$output['name'] .= $name_str;
2102 2102
 		}
2103 2103
 		return $output;
@@ -2111,19 +2111,19 @@  discard block
 block discarded – undo
2111 2111
 	 */
2112 2112
 	function updateMenuLayout($layout_srl, $menu_srl_list)
2113 2113
 	{
2114
-		if(!count($menu_srl_list)) return;
2114
+		if (!count($menu_srl_list)) return;
2115 2115
 		// Delete the value of menu_srls
2116
-		$args->menu_srls = implode(',',$menu_srl_list);
2116
+		$args->menu_srls = implode(',', $menu_srl_list);
2117 2117
 		$output = executeQuery('menu.deleteMenuLayout', $args);
2118
-		if(!$output->toBool()) return $output;
2118
+		if (!$output->toBool()) return $output;
2119 2119
 
2120 2120
 		$args->layout_srl = $layout_srl;
2121 2121
 		// Mapping menu_srls, layout_srl
2122
-		for($i=0;$i<count($menu_srl_list);$i++)
2122
+		for ($i = 0; $i < count($menu_srl_list); $i++)
2123 2123
 		{
2124 2124
 			$args->menu_srl = $menu_srl_list[$i];
2125 2125
 			$output = executeQuery('menu.insertMenuLayout', $args);
2126
-			if(!$output->toBool()) return $output;
2126
+			if (!$output->toBool()) return $output;
2127 2127
 		}
2128 2128
 	}
2129 2129
 
@@ -2136,47 +2136,47 @@  discard block
 block discarded – undo
2136 2136
 	{
2137 2137
 		// path setting
2138 2138
 		$path = sprintf('./files/attach/menu_button/%d/', $args->menu_srl);
2139
-		if($args->menu_normal_btn || $args->menu_hover_btn || $args->menu_active_btn && !is_dir($path))
2139
+		if ($args->menu_normal_btn || $args->menu_hover_btn || $args->menu_active_btn && !is_dir($path))
2140 2140
 		{
2141 2141
 			FileHandler::makeDir($path);
2142 2142
 		}
2143 2143
 
2144
-		if($args->isNormalDelete == 'Y' || $args->isHoverDelete == 'Y' || $args->isActiveDelete == 'Y')
2144
+		if ($args->isNormalDelete == 'Y' || $args->isHoverDelete == 'Y' || $args->isActiveDelete == 'Y')
2145 2145
 		{
2146 2146
 			$oMenuModel = getAdminModel('menu');
2147 2147
 			$itemInfo = $oMenuModel->getMenuItemInfo($args->menu_item_srl);
2148 2148
 
2149
-			if($args->isNormalDelete == 'Y' && $itemInfo->normal_btn) FileHandler::removeFile($itemInfo->normal_btn);
2150
-			if($args->isHoverDelete == 'Y' && $itemInfo->hover_btn) FileHandler::removeFile($itemInfo->hover_btn);
2151
-			if($args->isActiveDelete == 'Y' && $itemInfo->active_btn) FileHandler::removeFile($itemInfo->active_btn);
2149
+			if ($args->isNormalDelete == 'Y' && $itemInfo->normal_btn) FileHandler::removeFile($itemInfo->normal_btn);
2150
+			if ($args->isHoverDelete == 'Y' && $itemInfo->hover_btn) FileHandler::removeFile($itemInfo->hover_btn);
2151
+			if ($args->isActiveDelete == 'Y' && $itemInfo->active_btn) FileHandler::removeFile($itemInfo->active_btn);
2152 2152
 		}
2153 2153
 
2154 2154
 		$returnArray = array();
2155 2155
 		$date = date('YmdHis');
2156 2156
 		// normal button
2157
-		if($args->menu_normal_btn)
2157
+		if ($args->menu_normal_btn)
2158 2158
 		{
2159
-			$tmp_arr = explode('.',$args->menu_normal_btn['name']);
2160
-			$ext = $tmp_arr[count($tmp_arr)-1];
2159
+			$tmp_arr = explode('.', $args->menu_normal_btn['name']);
2160
+			$ext = $tmp_arr[count($tmp_arr) - 1];
2161 2161
 
2162 2162
 			$filename = sprintf('%s%d.%s.%s.%s', $path, $args->menu_item_srl, $date, 'menu_normal_btn', $ext);
2163 2163
 
2164
-			if(checkUploadedFile($args->menu_normal_btn['tmp_name']))
2164
+			if (checkUploadedFile($args->menu_normal_btn['tmp_name']))
2165 2165
 			{
2166
-				move_uploaded_file ( $args->menu_normal_btn ['tmp_name'], $filename );
2166
+				move_uploaded_file($args->menu_normal_btn ['tmp_name'], $filename);
2167 2167
 				$returnArray ['normal_btn'] = $filename;
2168 2168
 			}
2169 2169
 		}
2170 2170
 
2171 2171
 		// hover button
2172
-		if($args->menu_hover_btn)
2172
+		if ($args->menu_hover_btn)
2173 2173
 		{
2174
-			$tmp_arr = explode('.',$args->menu_hover_btn['name']);
2175
-			$ext = $tmp_arr[count($tmp_arr)-1];
2174
+			$tmp_arr = explode('.', $args->menu_hover_btn['name']);
2175
+			$ext = $tmp_arr[count($tmp_arr) - 1];
2176 2176
 
2177 2177
 			$filename = sprintf('%s%d.%s.%s.%s', $path, $args->menu_item_srl, $date, 'menu_hover_btn', $ext);
2178 2178
 
2179
-			if(checkUploadedFile($args->menu_hover_btn['tmp_name']))
2179
+			if (checkUploadedFile($args->menu_hover_btn['tmp_name']))
2180 2180
 			{
2181 2181
 				move_uploaded_file($args->menu_hover_btn['tmp_name'], $filename);
2182 2182
 				$returnArray['hover_btn'] = $filename;
@@ -2184,14 +2184,14 @@  discard block
 block discarded – undo
2184 2184
 		}
2185 2185
 
2186 2186
 		// active button
2187
-		if($args->menu_active_btn)
2187
+		if ($args->menu_active_btn)
2188 2188
 		{
2189
-			$tmp_arr = explode('.',$args->menu_active_btn['name']);
2190
-			$ext = $tmp_arr[count($tmp_arr)-1];
2189
+			$tmp_arr = explode('.', $args->menu_active_btn['name']);
2190
+			$ext = $tmp_arr[count($tmp_arr) - 1];
2191 2191
 
2192 2192
 			$filename = sprintf('%s%d.%s.%s.%s', $path, $args->menu_item_srl, $date, 'menu_active_btn', $ext);
2193 2193
 
2194
-			if(checkUploadedFile($args->menu_active_btn['tmp_name']))
2194
+			if (checkUploadedFile($args->menu_active_btn['tmp_name']))
2195 2195
 			{
2196 2196
 				move_uploaded_file($args->menu_active_btn['tmp_name'], $filename);
2197 2197
 				$returnArray['active_btn'] = $filename;
@@ -2213,7 +2213,7 @@  discard block
 block discarded – undo
2213 2213
 			"active_btn"=>"",
2214 2214
 		);
2215 2215
 		//normal_btn
2216
-		if($menuItemInfo->normal_btn)
2216
+		if ($menuItemInfo->normal_btn)
2217 2217
 		{
2218 2218
 			$originFile = FileHandler::getRealPath($menuItemInfo->normal_btn);
2219 2219
 			$targetFile = $this->_changeMenuItemSrlInButtonPath($menuItemInfo->normal_btn, $insertedMenuSrl, $insertedMenuItemSrl, 'normal');
@@ -2223,7 +2223,7 @@  discard block
 block discarded – undo
2223 2223
 		}
2224 2224
 
2225 2225
 		//hover_btn
2226
-		if($menuItemInfo->hover_btn)
2226
+		if ($menuItemInfo->hover_btn)
2227 2227
 		{
2228 2228
 			$originFile = FileHandler::getRealPath($menuItemInfo->hover_btn);
2229 2229
 			$targetFile = $this->_changeMenuItemSrlInButtonPath($menuItemInfo->hover_btn, $insertedMenuSrl, $insertedMenuItemSrl, 'hover');
@@ -2233,7 +2233,7 @@  discard block
 block discarded – undo
2233 2233
 		}
2234 2234
 
2235 2235
 		//active_btn
2236
-		if($menuItemInfo->active_btn)
2236
+		if ($menuItemInfo->active_btn)
2237 2237
 		{
2238 2238
 			$originFile = FileHandler::getRealPath($menuItemInfo->active_btn);
2239 2239
 			$targetFile = $this->_changeMenuItemSrlInButtonPath($menuItemInfo->active_btn, $insertedMenuSrl, $insertedMenuItemSrl, 'active');
@@ -2248,9 +2248,9 @@  discard block
 block discarded – undo
2248 2248
 	{
2249 2249
 		$path = sprintf('./files/attach/menu_button/%d/', $menuSrl);
2250 2250
 		$tmp_arr = explode('.', $buttonPath);
2251
-		$ext = $tmp_arr[count($tmp_arr)-1];
2251
+		$ext = $tmp_arr[count($tmp_arr) - 1];
2252 2252
 		$date = date("YmdHis");
2253
-		return sprintf('%s%d.%s.%s.%s', $path, $menuItemSrl,$date,'menu_'.$mode.'_btn', $ext);
2253
+		return sprintf('%s%d.%s.%s.%s', $path, $menuItemSrl, $date, 'menu_'.$mode.'_btn', $ext);
2254 2254
 	}
2255 2255
 
2256 2256
 	public function makeHomemenuCacheFile($menuSrl)
Please login to merge, or discard this patch.
Braces   +304 added lines, -134 removed lines patch added patch discarded remove patch
@@ -69,7 +69,9 @@  discard block
 block discarded – undo
69 69
 		$site_module_info = Context::get('site_module_info');
70 70
 
71 71
 		$output = $this->addMenu(Context::get('title'), (int)$site_module_info->site_srl);
72
-		if(!$output->toBool()) return $output;
72
+		if(!$output->toBool()) {
73
+			return $output;
74
+		}
73 75
 
74 76
 		$this->add('menu_srl', $output->get('menuSrl'));
75 77
 		$this->setMessage('success_registed');
@@ -148,8 +150,7 @@  discard block
 block discarded – undo
148 150
 				$moduleConfig->unlinked_menu_srl = $output->get('menuSrl');
149 151
 				$oModuleController = getController('module');
150 152
 				$oModuleController->updateModuleConfig('menu', $moduleConfig);
151
-			}
152
-			else
153
+			} else
153 154
 			{
154 155
 				return false;
155 156
 			}
@@ -186,8 +187,7 @@  discard block
 block discarded – undo
186 187
 			if($output->toBool() && $output->data)
187 188
 			{
188 189
 				$moduleInfo->menu_srl = $output->data->menu_srl;
189
-			}
190
-			else
190
+			} else
191 191
 			{
192 192
 				// create menu item.
193 193
 				$item_args->menu_srl = $menuSrl;
@@ -235,7 +235,9 @@  discard block
 block discarded – undo
235 235
 		$args->menu_srl = Context::get('menu_srl');
236 236
 
237 237
 		$output = executeQuery('menu.updateMenu', $args);
238
-		if(!$output->toBool()) return $output;
238
+		if(!$output->toBool()) {
239
+			return $output;
240
+		}
239 241
 
240 242
 		$this->setMessage('success_registed');
241 243
 
@@ -255,8 +257,9 @@  discard block
 block discarded – undo
255 257
 		$menuInfo = $oMenuAdminModel->getMenu($menu_srl);
256 258
 
257 259
 		$oAdmin = getClass('admin');
258
-		if($menuInfo->title == $oAdmin->getAdminMenuName())
259
-			return new Object(-1, 'msg_adminmenu_cannot_delete');
260
+		if($menuInfo->title == $oAdmin->getAdminMenuName()) {
261
+					return new Object(-1, 'msg_adminmenu_cannot_delete');
262
+		}
260 263
 
261 264
 		// get menu properies with child menu
262 265
 		$phpFile = sprintf("./files/cache/menu/%s.php", $menu_srl);
@@ -280,8 +283,9 @@  discard block
 block discarded – undo
280 283
 				$originMenu = $value;
281 284
 				$this->_checkHomeMenuInOriginMenu($originMenu, $siteInfo->mid, $isStartmenuInclude);
282 285
 
283
-				if($isStartmenuInclude)
284
-					break;
286
+				if($isStartmenuInclude) {
287
+									break;
288
+				}
285 289
 			}
286 290
 		}
287 291
 
@@ -366,7 +370,9 @@  discard block
 block discarded – undo
366 370
 			foreach($cache_list as $cache_file)
367 371
 			{
368 372
 				$pos = strpos($cache_file, $menu_srl.'.');
369
-				if($pos>0)FileHandler::removeFile($cache_file);
373
+				if($pos>0) {
374
+					FileHandler::removeFile($cache_file);
375
+				}
370 376
 			}
371 377
 		}
372 378
 		// Delete images of menu buttons
@@ -405,8 +411,7 @@  discard block
 block discarded – undo
405 411
 		if($request->is_shortcut == 'Y')
406 412
 		{
407 413
 			$result = $this->_insertShortcut($request);
408
-		}
409
-		else
414
+		} else
410 415
 		{
411 416
 			$result = $this->_insertMenu($request, $isProc);
412 417
 		}
@@ -464,12 +469,21 @@  discard block
 block discarded – undo
464 469
 			$args->is_shortcut = $request->is_shortcut;
465 470
 			$args->url = $request->shortcut_target;
466 471
 
467
-			if(!$args->open_window) $args->open_window = 'N';
468
-			if(!$args->expand) $args->expand = 'N';
469
-			if(!$args->is_shortcut) $args->is_shortcut = 'Y';
472
+			if(!$args->open_window) {
473
+				$args->open_window = 'N';
474
+			}
475
+			if(!$args->expand) {
476
+				$args->expand = 'N';
477
+			}
478
+			if(!$args->is_shortcut) {
479
+				$args->is_shortcut = 'Y';
480
+			}
470 481
 
471
-			if($request->menu_name_key) $args->name = $request->menu_name_key;
472
-			else $args->name = $request->menu_name;
482
+			if($request->menu_name_key) {
483
+				$args->name = $request->menu_name_key;
484
+			} else {
485
+				$args->name = $request->menu_name;
486
+			}
473 487
 		}
474 488
 		// type is module short cut
475 489
 		else if(is_numeric($request->shortcut_target))
@@ -504,13 +518,18 @@  discard block
 block discarded – undo
504 518
 			$args->url = '#';
505 519
 		}
506 520
 
507
-		if($request->menu_desc) $args->desc = $request->menu_desc;
508
-		else $args->desc = '';
521
+		if($request->menu_desc) {
522
+			$args->desc = $request->menu_desc;
523
+		} else {
524
+			$args->desc = '';
525
+		}
509 526
 
510 527
 		$args->menu_item_srl = getNextSequence();
511 528
 		$args->listorder = -1*$args->menu_item_srl;
512 529
 		$output = executeQuery('menu.insertMenuItem', $args);
513
-		if(!$output->toBool()) return $output;
530
+		if(!$output->toBool()) {
531
+			return $output;
532
+		}
514 533
 
515 534
 		$oDB->commit();
516 535
 
@@ -532,15 +551,27 @@  discard block
 block discarded – undo
532 551
 		$args->expand = $request->menu_expand;
533 552
 		$args->is_shortcut = $request->is_shortcut;
534 553
 
535
-		if(!$args->open_window) $args->open_window = 'N';
536
-		if(!$args->expand) $args->expand = 'N';
537
-		if(!$args->is_shortcut) $args->is_shortcut = 'N';
554
+		if(!$args->open_window) {
555
+			$args->open_window = 'N';
556
+		}
557
+		if(!$args->expand) {
558
+			$args->expand = 'N';
559
+		}
560
+		if(!$args->is_shortcut) {
561
+			$args->is_shortcut = 'N';
562
+		}
538 563
 
539
-		if($request->menu_name_key) $args->name = $request->menu_name_key;
540
-		else $args->name = $request->menu_name;
564
+		if($request->menu_name_key) {
565
+			$args->name = $request->menu_name_key;
566
+		} else {
567
+			$args->name = $request->menu_name;
568
+		}
541 569
 
542
-		if($request->menu_desc) $args->desc = $request->menu_desc;
543
-		else $args->desc = '';
570
+		if($request->menu_desc) {
571
+			$args->desc = $request->menu_desc;
572
+		} else {
573
+			$args->desc = '';
574
+		}
544 575
 
545 576
 		if($request->module_id && strncasecmp('http', $request->module_id, 4) === 0)
546 577
 		{
@@ -558,9 +589,15 @@  discard block
 block discarded – undo
558 589
 		}
559 590
 
560 591
 		// if setting button variables, set argument button variables for db insert. but not upload in this method
561
-		if($request->normal_btn) $args->normal_btn = $request->normal_btn;
562
-		if($request->hover_btn) $args->hover_btn = $request->hover_btn;
563
-		if($request->active_btn) $args->active_btn = $request->active_btn;
592
+		if($request->normal_btn) {
593
+			$args->normal_btn = $request->normal_btn;
594
+		}
595
+		if($request->hover_btn) {
596
+			$args->hover_btn = $request->hover_btn;
597
+		}
598
+		if($request->active_btn) {
599
+			$args->active_btn = $request->active_btn;
600
+		}
564 601
 
565 602
 		if(!$request->module_id)
566 603
 		{
@@ -571,7 +608,9 @@  discard block
 block discarded – undo
571 608
 		$args->menu_item_srl = getNextSequence();
572 609
 		$args->listorder = -1*$args->menu_item_srl;
573 610
 		$output = executeQuery('menu.insertMenuItem', $args);
574
-		if(!$output->toBool()) return $output;
611
+		if(!$output->toBool()) {
612
+			return $output;
613
+		}
575 614
 
576 615
 		$oDB->commit();
577 616
 
@@ -652,8 +691,12 @@  discard block
 block discarded – undo
652 691
 		}
653 692
 
654 693
 		// variables set
655
-		if($request->menu_open_window != "Y") $request->menu_open_window = "N";
656
-		if($request->menu_expand != "Y") $request->menu_expand = "N";
694
+		if($request->menu_open_window != "Y") {
695
+			$request->menu_open_window = "N";
696
+		}
697
+		if($request->menu_expand != "Y") {
698
+			$request->menu_expand = "N";
699
+		}
657 700
 
658 701
 		// Get original information
659 702
 		$oMenuAdminModel = getAdminModel('menu');
@@ -680,13 +723,11 @@  discard block
 block discarded – undo
680 723
 
681 724
 				$args->url = $newItemInfo->url;
682 725
 				$args->is_shortcut = 'Y';
683
-			}
684
-			else
726
+			} else
685 727
 			{
686 728
 				$args->url = '#';
687 729
 			}
688
-		}
689
-		else
730
+		} else
690 731
 		{
691 732
 			// check already created module instance
692 733
 			$oModuleModel = getModel('module');
@@ -719,14 +760,16 @@  discard block
 block discarded – undo
719 760
 		if($request->menu_name_key)
720 761
 		{
721 762
 			$args->name = $request->menu_name_key;
722
-		}
723
-		else
763
+		} else
724 764
 		{
725 765
 			$args->name = $request->menu_name;
726 766
 		}
727 767
 
728
-		if($request->menu_desc) $args->desc = $request->menu_desc;
729
-		else $args->desc = '';
768
+		if($request->menu_desc) {
769
+			$args->desc = $request->menu_desc;
770
+		} else {
771
+			$args->desc = '';
772
+		}
730 773
 
731 774
 		unset($args->group_srls);
732 775
 		$args->open_window = $request->menu_open_window;
@@ -828,8 +871,7 @@  discard block
 block discarded – undo
828 871
 		{
829 872
 			$this->setError($returnObj->error);
830 873
 			$this->setMessage($returnObj->message);
831
-		}
832
-		else
874
+		} else
833 875
 		{
834 876
 			$this->setMessage('success_deleted');
835 877
 		}
@@ -856,7 +898,9 @@  discard block
 block discarded – undo
856 898
 		if($args->is_force != 'Y')
857 899
 		{
858 900
 			$output = executeQuery('menu.getChildMenuCount', $args);
859
-			if(!$output->toBool()) return $output;
901
+			if(!$output->toBool()) {
902
+				return $output;
903
+			}
860 904
 			if($output->data->count > 0)
861 905
 			{
862 906
 				return new Object(-1001, 'msg_cannot_delete_for_child');
@@ -874,7 +918,9 @@  discard block
 block discarded – undo
874 918
 			return $this->stop('msg_cannot_delete_for_admin_topmenu');
875 919
 		}
876 920
 
877
-		if($itemInfo->parent_srl) $parent_srl = $itemInfo->parent_srl;
921
+		if($itemInfo->parent_srl) {
922
+			$parent_srl = $itemInfo->parent_srl;
923
+		}
878 924
 
879 925
 		// get menu properies with child menu
880 926
 		$phpFile = sprintf("./files/cache/menu/%s.php", $args->menu_srl);
@@ -948,9 +994,15 @@  discard block
 block discarded – undo
948 994
 		// Update the xml file and get its location
949 995
 		$xml_file = $this->makeXmlFile($args->menu_srl);
950 996
 		// Delete all of image buttons
951
-		if($node['normal_btn']) FileHandler::removeFile($node['normal_btn']);
952
-		if($node['hover_btn']) FileHandler::removeFile($node['hover_btn']);
953
-		if($node['active_btn']) FileHandler::removeFile($node['active_btn']);
997
+		if($node['normal_btn']) {
998
+			FileHandler::removeFile($node['normal_btn']);
999
+		}
1000
+		if($node['hover_btn']) {
1001
+			FileHandler::removeFile($node['hover_btn']);
1002
+		}
1003
+		if($node['active_btn']) {
1004
+			FileHandler::removeFile($node['active_btn']);
1005
+		}
954 1006
 
955 1007
 		// Delete module
956 1008
 		if($node['is_shortcut'] != 'Y' && strncasecmp('http', $node['url'], 4) !== 0)
@@ -1017,7 +1069,9 @@  discard block
 block discarded – undo
1017 1069
 		$source_srl = Context::get('source_srl');	// Same hierarchy's menu item serial number
1018 1070
 		$target_srl = Context::get('target_srl');	// Self menu item serial number
1019 1071
 
1020
-		if(!$mode || !$parent_srl || !$target_srl) return new Object(-1,'msg_invalid_request');
1072
+		if(!$mode || !$parent_srl || !$target_srl) {
1073
+			return new Object(-1,'msg_invalid_request');
1074
+		}
1021 1075
 
1022 1076
 		$oMenuAdminModel = getAdminModel('menu');
1023 1077
 
@@ -1181,8 +1235,11 @@  discard block
 block discarded – undo
1181 1235
 		// default argument setting
1182 1236
 		$args = new stdClass();
1183 1237
 		$args->menu_srl = $menuSrl;
1184
-		if($parentSrl == 0) $args->parent_srl = $menuSrl;
1185
-		else $args->parent_srl = $parentSrl;
1238
+		if($parentSrl == 0) {
1239
+			$args->parent_srl = $menuSrl;
1240
+		} else {
1241
+			$args->parent_srl = $parentSrl;
1242
+		}
1186 1243
 		$args->menu_name_key = $originMenu['text'];
1187 1244
 		$args->menu_name = $originMenu['text'];
1188 1245
 		$args->menu_open_window = $originMenu['open_window'];
@@ -1275,8 +1332,11 @@  discard block
 block discarded – undo
1275 1332
 		for($i=0;$i<4;$i++)
1276 1333
 		{
1277 1334
 			$case = rand(0, 1);
1278
-			if($case) $doc = rand(65, 90);
1279
-			else $doc = rand(97, 122);
1335
+			if($case) {
1336
+				$doc = rand(65, 90);
1337
+			} else {
1338
+				$doc = rand(97, 122);
1339
+			}
1280 1340
 
1281 1341
 			$randomString .= chr($doc);
1282 1342
 		}
@@ -1299,15 +1359,21 @@  discard block
 block discarded – undo
1299 1359
 		// menu name update
1300 1360
 		$args->menu_srl = $this->menuSrl;
1301 1361
 		$output = executeQuery('menu.updateMenu', $args);
1302
-		if(!$output->toBool()) return $output;
1362
+		if(!$output->toBool()) {
1363
+			return $output;
1364
+		}
1303 1365
 
1304 1366
 		$this->map = array();
1305 1367
 		if(is_array($parentKeyList))
1306 1368
 		{
1307 1369
 			foreach($parentKeyList as $no=>$srl)
1308 1370
 			{
1309
-				if($srl === 0) continue;
1310
-				if(!is_array($this->map[$srl]))$this->map[$srl] = array();
1371
+				if($srl === 0) {
1372
+					continue;
1373
+				}
1374
+				if(!is_array($this->map[$srl])) {
1375
+					$this->map[$srl] = array();
1376
+				}
1311 1377
 				$this->map[$srl][] = $no;
1312 1378
 			}
1313 1379
 		}
@@ -1409,7 +1475,9 @@  discard block
 block discarded – undo
1409 1475
 		$oMenuAdminModel = getAdminModel('menu');
1410 1476
 
1411 1477
 		$target_item = $oMenuAdminModel->getMenuItemInfo($target_srl);
1412
-		if($target_item->menu_item_srl != $target_srl) return new Object(-1,'msg_invalid_request');
1478
+		if($target_item->menu_item_srl != $target_srl) {
1479
+			return new Object(-1,'msg_invalid_request');
1480
+		}
1413 1481
 		// Move the menu location(change the order menu appears)
1414 1482
 		if($mode == 'move')
1415 1483
 		{
@@ -1420,24 +1488,33 @@  discard block
 block discarded – undo
1420 1488
 			if($source_srl)
1421 1489
 			{
1422 1490
 				$source_item = $oMenuAdminModel->getMenuItemInfo($source_srl);
1423
-				if($source_item->menu_item_srl != $source_srl) return new Object(-1,'msg_invalid_request');
1491
+				if($source_item->menu_item_srl != $source_srl) {
1492
+					return new Object(-1,'msg_invalid_request');
1493
+				}
1424 1494
 				$args->listorder = $source_item->listorder-1;
1425
-			}
1426
-			else
1495
+			} else
1427 1496
 			{
1428 1497
 				$output = executeQuery('menu.getMaxListorder', $args);
1429
-				if(!$output->toBool()) return $output;
1498
+				if(!$output->toBool()) {
1499
+					return $output;
1500
+				}
1430 1501
 				$args->listorder = (int)$output->data->listorder;
1431
-				if(!$args->listorder) $args->listorder= 0;
1502
+				if(!$args->listorder) {
1503
+					$args->listorder= 0;
1504
+				}
1432 1505
 			}
1433 1506
 			$args->parent_srl = $parent_srl;
1434 1507
 			$output = executeQuery('menu.updateMenuItemListorder', $args);
1435
-			if(!$output->toBool()) return $output;
1508
+			if(!$output->toBool()) {
1509
+				return $output;
1510
+			}
1436 1511
 
1437 1512
 			$args->parent_srl = $parent_srl;
1438 1513
 			$args->menu_item_srl = $target_srl;
1439 1514
 			$output = executeQuery('menu.updateMenuItemNode', $args);
1440
-			if(!$output->toBool()) return $output;
1515
+			if(!$output->toBool()) {
1516
+				return $output;
1517
+			}
1441 1518
 
1442 1519
 			//module's menu_srl move also
1443 1520
 			if($isShortcut == 'N' && !empty($url))
@@ -1465,14 +1542,15 @@  discard block
 block discarded – undo
1465 1542
 				}
1466 1543
 			}
1467 1544
 			// Add a child
1468
-		}
1469
-		elseif($mode == 'insert')
1545
+		} elseif($mode == 'insert')
1470 1546
 		{
1471 1547
 			$args->menu_item_srl = $target_srl;
1472 1548
 			$args->parent_srl = $parent_srl;
1473 1549
 			$args->listorder = -1*getNextSequence();
1474 1550
 			$output = executeQuery('menu.updateMenuItemNode', $args);
1475
-			if(!$output->toBool()) return $output;
1551
+			if(!$output->toBool()) {
1552
+				return $output;
1553
+			}
1476 1554
 		}
1477 1555
 
1478 1556
 		$xml_file = $this->makeXmlFile($menu_srl);
@@ -1516,8 +1594,7 @@  discard block
 block discarded – undo
1516 1594
 		{
1517 1595
 			Context::set('error_messge', Context::getLang('msg_invalid_request'));
1518 1596
 
1519
-		}
1520
-		else if(!$target_file || !is_uploaded_file($target_file['tmp_name']) || !preg_match('/\.(gif|jpeg|jpg|png)$/i',$target_file['name'])  || !checkUploadedFile($target_file['tmp_name']))
1597
+		} else if(!$target_file || !is_uploaded_file($target_file['tmp_name']) || !preg_match('/\.(gif|jpeg|jpg|png)$/i',$target_file['name'])  || !checkUploadedFile($target_file['tmp_name']))
1521 1598
 		{
1522 1599
 			Context::set('error_messge', Context::getLang('msg_invalid_request'));
1523 1600
 		}
@@ -1531,7 +1608,9 @@  discard block
 block discarded – undo
1531 1608
 			$path = sprintf('./files/attach/menu_button/%d/', $menu_srl);
1532 1609
 			$filename = sprintf('%s%d.%s.%s', $path, $menu_item_srl, $target, $ext);
1533 1610
 
1534
-			if(!is_dir($path)) FileHandler::makeDir($path);
1611
+			if(!is_dir($path)) {
1612
+				FileHandler::makeDir($path);
1613
+			}
1535 1614
 
1536 1615
 			move_uploaded_file($target_file['tmp_name'], $filename);
1537 1616
 			Context::set('filename', $filename);
@@ -1571,7 +1650,9 @@  discard block
 block discarded – undo
1571 1650
 			foreach($installed_module_list AS $key=>$value)
1572 1651
 			{
1573 1652
 				$info = $oModuleModel->getModuleActionXml($value->module);
1574
-				if($info->menu) $menuList[$value->module] = $info->menu;
1653
+				if($info->menu) {
1654
+					$menuList[$value->module] = $info->menu;
1655
+				}
1575 1656
 				unset($info->menu);
1576 1657
 			}
1577 1658
 		}
@@ -1603,8 +1684,12 @@  discard block
 block discarded – undo
1603 1684
 		$info = $oModuleModel->getModuleActionXml($moduleName);
1604 1685
 
1605 1686
 		$url = getNotEncodedFullUrl('', 'module', 'admin', 'act', $info->menu->{$menuName}->index);
1606
-		if(empty($url)) $url = getNotEncodedFullUrl('', 'module', 'admin', 'act', $info->admin_index_act);
1607
-		if(empty($url)) $url = getNotEncodedFullUrl('', 'module', 'admin');
1687
+		if(empty($url)) {
1688
+			$url = getNotEncodedFullUrl('', 'module', 'admin', 'act', $info->admin_index_act);
1689
+		}
1690
+		if(empty($url)) {
1691
+			$url = getNotEncodedFullUrl('', 'module', 'admin');
1692
+		}
1608 1693
 		$dbInfo = Context::getDBInfo();
1609 1694
 
1610 1695
 		$args = new stdClass();
@@ -1616,8 +1701,7 @@  discard block
 block discarded – undo
1616 1701
 		if(strpos($url, 'https') !== false)
1617 1702
 		{
1618 1703
 			$args->url = str_replace('https'.substr($dbInfo->default_url, 4), '', $url);
1619
-		}
1620
-		else
1704
+		} else
1621 1705
 		{
1622 1706
 			$args->url = str_replace($dbInfo->default_url, '', $url);
1623 1707
 		}
@@ -1636,14 +1720,18 @@  discard block
 block discarded – undo
1636 1720
 		if($item_info->menu_item_srl == $args->menu_item_srl)
1637 1721
 		{
1638 1722
 			$output = $this->_updateMenuItem($args);
1639
-			if(!$output->toBool()) return $output;
1723
+			if(!$output->toBool()) {
1724
+				return $output;
1725
+			}
1640 1726
 		}
1641 1727
 		// Insert if not exist
1642 1728
 		else
1643 1729
 		{
1644 1730
 			$args->listorder = -1*$args->menu_item_srl;
1645 1731
 			$output = executeQuery('menu.insertMenuItem', $args);
1646
-			if(!$output->toBool()) return $output;
1732
+			if(!$output->toBool()) {
1733
+				return $output;
1734
+			}
1647 1735
 		}
1648 1736
 		// Get information of the menu
1649 1737
 		$menu_info = $oMenuModel->getMenu($args->menu_srl);
@@ -1674,8 +1762,7 @@  discard block
 block discarded – undo
1674 1762
 		if(!$exposure)
1675 1763
 		{
1676 1764
 			$args->group_srls = '';
1677
-		}
1678
-		else
1765
+		} else
1679 1766
 		{
1680 1767
 			$exposure = explode(',', $exposure);
1681 1768
 			if(in_array($exposure, array('-1','-3')))
@@ -1683,7 +1770,9 @@  discard block
 block discarded – undo
1683 1770
 				$args->group_srls = $exposure;
1684 1771
 			}
1685 1772
 
1686
-			if($exposure) $args->group_srls = implode(',', $exposure);
1773
+			if($exposure) {
1774
+				$args->group_srls = implode(',', $exposure);
1775
+			}
1687 1776
 		}
1688 1777
 
1689 1778
 		$output = $this->_updateMenuItem($args);
@@ -1706,7 +1795,9 @@  discard block
 block discarded – undo
1706 1795
 			$moduleGrnatsArgs = new stdClass;
1707 1796
 			$moduleGrnatsArgs->module_srl = $moduleInfo->module_srl;
1708 1797
 			$output = executeQueryArray('module.getModuleGrants', $moduleGrnatsArgs);
1709
-			if(!$output->data) $output->data = array();
1798
+			if(!$output->data) {
1799
+				$output->data = array();
1800
+			}
1710 1801
 			$moduleGrnats = new stdClass();
1711 1802
 			foreach($output->data as $grant)
1712 1803
 			{
@@ -1715,7 +1806,9 @@  discard block
 block discarded – undo
1715 1806
 		}
1716 1807
 
1717 1808
 		$grantList = $xml_info->grant;
1718
-		if(!$grantList) $grantList = new stdClass;
1809
+		if(!$grantList) {
1810
+			$grantList = new stdClass;
1811
+		}
1719 1812
 
1720 1813
 		$grantList->access = new stdClass();
1721 1814
 		$grantList->access->default = 'guest';
@@ -1741,10 +1834,11 @@  discard block
 block discarded – undo
1741 1834
 					$grant->{$grantName}[] = $htPerm[$grantName];
1742 1835
 					continue;
1743 1836
 				}
1744
-			}
1745
-			else if($itemInfo->is_shortcut === 'Y')
1837
+			} else if($itemInfo->is_shortcut === 'Y')
1746 1838
 			{
1747
-				if(isset($moduleGrnats) && $moduleGrnats->{$grantName}) $grant->{$grantName} = $moduleGrnats->{$grantName};
1839
+				if(isset($moduleGrnats) && $moduleGrnats->{$grantName}) {
1840
+					$grant->{$grantName} = $moduleGrnats->{$grantName};
1841
+				}
1748 1842
 			}
1749 1843
 		}
1750 1844
 
@@ -1766,12 +1860,16 @@  discard block
 block discarded – undo
1766 1860
 	function makeXmlFile($menu_srl)
1767 1861
 	{
1768 1862
 		// Return if there is no information when creating the xml file
1769
-		if(!$menu_srl) return;
1863
+		if(!$menu_srl) {
1864
+			return;
1865
+		}
1770 1866
 		// Get menu informaton
1771 1867
 		$args = new stdClass();
1772 1868
 		$args->menu_srl = $menu_srl;
1773 1869
 		$output = executeQuery('menu.getMenu', $args);
1774
-		if(!$output->toBool() || !$output->data) return $output;
1870
+		if(!$output->toBool() || !$output->data) {
1871
+			return $output;
1872
+		}
1775 1873
 		$site_srl = (int)$output->data->site_srl;
1776 1874
 
1777 1875
 		if($site_srl)
@@ -1785,7 +1883,9 @@  discard block
 block discarded – undo
1785 1883
 		$args->menu_srl = $menu_srl;
1786 1884
 		$args->sort_index = 'listorder';
1787 1885
 		$output = executeQuery('menu.getMenuItems', $args);
1788
-		if(!$output->toBool()) return;
1886
+		if(!$output->toBool()) {
1887
+			return;
1888
+		}
1789 1889
 		// Specify the name of the cache file
1790 1890
 		$xml_file = sprintf(_XE_PATH_ . "files/cache/menu/%s.xml.php", $menu_srl);
1791 1891
 		$php_file = sprintf(_XE_PATH_ . "files/cache/menu/%s.php", $menu_srl);
@@ -1799,7 +1899,9 @@  discard block
 block discarded – undo
1799 1899
 			return $xml_file;
1800 1900
 		}
1801 1901
 		// Change to an array if only a single data is obtained
1802
-		if(!is_array($list)) $list = array($list);
1902
+		if(!is_array($list)) {
1903
+			$list = array($list);
1904
+		}
1803 1905
 		// Create a tree for loop
1804 1906
 		$list_count = count($list);
1805 1907
 		for($i=0;$i<$list_count;$i++)
@@ -1887,7 +1989,9 @@  discard block
 block discarded – undo
1887 1989
 	 */
1888 1990
 	function getXmlTree($source_node, $tree, $site_srl, $domain)
1889 1991
 	{
1890
-		if(!$source_node) return;
1992
+		if(!$source_node) {
1993
+			return;
1994
+		}
1891 1995
 
1892 1996
 		$oMenuAdminModel = getAdminModel('menu');
1893 1997
 
@@ -1895,7 +1999,9 @@  discard block
 block discarded – undo
1895 1999
 		{
1896 2000
 			$child_buff = "";
1897 2001
 			// Get data of the child nodes
1898
-			if($menu_item_srl&&$tree[$menu_item_srl]) $child_buff = $this->getXmlTree($tree[$menu_item_srl], $tree, $site_srl, $domain);
2002
+			if($menu_item_srl&&$tree[$menu_item_srl]) {
2003
+				$child_buff = $this->getXmlTree($tree[$menu_item_srl], $tree, $site_srl, $domain);
2004
+			}
1899 2005
 			// List variables
1900 2006
 			$names = $oMenuAdminModel->getMenuItemNames($node->name, $site_srl);
1901 2007
 			foreach($names as $key => $val)
@@ -1909,37 +2015,57 @@  discard block
 block discarded – undo
1909 2015
 			if(preg_match('/^([0-9a-zA-Z\_\-]+)$/', $node->url))
1910 2016
 			{
1911 2017
 				$href = "getSiteUrl('$domain', '','mid','$node->url')";
2018
+			} else {
2019
+				$href = sprintf('"%s"', $url);
1912 2020
 			}
1913
-			else $href = sprintf('"%s"', $url);
1914 2021
 			$is_shortcut = $node->is_shortcut;
1915 2022
 			$open_window = $node->open_window;
1916 2023
 			$expand = $node->expand;
1917 2024
 
1918 2025
 			$normal_btn = $node->normal_btn;
1919
-			if($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) $normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$normal_btn);
1920
-			else $normal_btn = '';
2026
+			if($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) {
2027
+				$normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$normal_btn);
2028
+			} else {
2029
+				$normal_btn = '';
2030
+			}
1921 2031
 			$hover_btn = $node->hover_btn;
1922
-			if($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) $hover_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$hover_btn);
1923
-			else $hover_btn = '';
2032
+			if($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) {
2033
+				$hover_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$hover_btn);
2034
+			} else {
2035
+				$hover_btn = '';
2036
+			}
1924 2037
 			$active_btn = $node->active_btn;
1925
-			if($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) $active_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$active_btn);
1926
-			else $active_btn = '';
2038
+			if($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) {
2039
+				$active_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$active_btn);
2040
+			} else {
2041
+				$active_btn = '';
2042
+			}
1927 2043
 
1928 2044
 			$group_srls = $node->group_srls;
1929 2045
 
1930 2046
 			if($normal_btn)
1931 2047
 			{
1932
-				if($hover_btn) $hover_str = sprintf('onmouseover=&quot;this.src=\'%s\'&quot;', $hover_btn); else $hover_str = '';
1933
-				if($active_btn) $active_str = sprintf('onmousedown=&quot;this.src=\'%s\'&quot;', $active_btn); else $active_str = '';
2048
+				if($hover_btn) {
2049
+					$hover_str = sprintf('onmouseover=&quot;this.src=\'%s\'&quot;', $hover_btn);
2050
+				} else {
2051
+					$hover_str = '';
2052
+				}
2053
+				if($active_btn) {
2054
+					$active_str = sprintf('onmousedown=&quot;this.src=\'%s\'&quot;', $active_btn);
2055
+				} else {
2056
+					$active_str = '';
2057
+				}
1934 2058
 				$link = sprintf('&lt;img src=&quot;%s&quot; onmouseout=&quot;this.src=\'%s\'&quot; alt=&quot;<?php print htmlspecialchars($_names[$lang_type], ENT_COMPAT | ENT_HTML401, \'UTF-8\', false) ?>&quot; %s %s /&gt;', $normal_btn, $normal_btn, $hover_str, $active_str);
1935
-			}
1936
-			else
2059
+			} else
1937 2060
 			{
1938 2061
 				$link = '<?php print $_names[$lang_type]; ?>';
1939 2062
 			}
1940 2063
 			// If the value of node->group_srls exists
1941
-			if($group_srls)$group_check_code = sprintf('($is_admin==true||(is_array($group_srls)&&count(array_intersect($group_srls, array(%s))))||($is_logged&&%s))',$group_srls,$group_srls == -1?1:0);
1942
-			else $group_check_code = "true";
2064
+			if($group_srls) {
2065
+				$group_check_code = sprintf('($is_admin==true||(is_array($group_srls)&&count(array_intersect($group_srls, array(%s))))||($is_logged&&%s))',$group_srls,$group_srls == -1?1:0);
2066
+			} else {
2067
+				$group_check_code = "true";
2068
+			}
1943 2069
 			$attribute = sprintf(
1944 2070
 				'node_srl="%s" parent_srl="%s" menu_name_key=\'%s\' text="<?php if(%s) { %s }?>" url="<?php print(%s?"%s":"")?>" href="<?php print(%s?%s:"")?>" is_shortcut="%s" desc="%s" open_window="%s" expand="%s" normal_btn="%s" hover_btn="%s" active_btn="%s" link="<?php if(%s) {?>%s<?php }?>"',
1945 2071
 				$menu_item_srl,
@@ -1962,8 +2088,11 @@  discard block
 block discarded – undo
1962 2088
 				$link
1963 2089
 			);
1964 2090
 
1965
-			if($child_buff) $buff .= sprintf('<node %s>%s</node>', $attribute, $child_buff);
1966
-			else $buff .=  sprintf('<node %s />', $attribute);
2091
+			if($child_buff) {
2092
+				$buff .= sprintf('<node %s>%s</node>', $attribute, $child_buff);
2093
+			} else {
2094
+				$buff .=  sprintf('<node %s />', $attribute);
2095
+			}
1967 2096
 		}
1968 2097
 		return $buff;
1969 2098
 	}
@@ -1982,15 +2111,20 @@  discard block
 block discarded – undo
1982 2111
 	function getPhpCacheCode($source_node, $tree, $site_srl, $domain)
1983 2112
 	{
1984 2113
 		$output = array("buff"=>"", "url_list"=>array());
1985
-		if(!$source_node) return $output;
2114
+		if(!$source_node) {
2115
+			return $output;
2116
+		}
1986 2117
 
1987 2118
 		$oMenuAdminModel = getAdminModel('menu');
1988 2119
 
1989 2120
 		foreach($source_node as $menu_item_srl => $node)
1990 2121
 		{
1991 2122
 			// Get data from child nodes if exist.
1992
-			if($menu_item_srl&&$tree[$menu_item_srl]) $child_output = $this->getPhpCacheCode($tree[$menu_item_srl], $tree, $site_srl, $domain);
1993
-			else $child_output = array("buff"=>"", "url_list"=>array());
2123
+			if($menu_item_srl&&$tree[$menu_item_srl]) {
2124
+				$child_output = $this->getPhpCacheCode($tree[$menu_item_srl], $tree, $site_srl, $domain);
2125
+			} else {
2126
+				$child_output = array("buff"=>"", "url_list"=>array());
2127
+			}
1994 2128
 
1995 2129
 			// List variables
1996 2130
 			$names = $oMenuAdminModel->getMenuItemNames($node->name, $site_srl);
@@ -2000,8 +2134,7 @@  discard block
 block discarded – undo
2000 2134
 				if(preg_match('/\{\$lang->menu_gnb(?:_sub)?\[\'([a-zA-Z_]+)\'\]\}/', $val) === 1)
2001 2135
 				{
2002 2136
 					$name_arr_str .= sprintf('"%s"=>"%s",', $key, $val);
2003
-				}
2004
-				else
2137
+				} else
2005 2138
 				{
2006 2139
 					$name_arr_str .= sprintf('"%s"=>\'%s\',', $key, str_replace(array('\\','\''), array('\\\\','\\\''), removeHackTag($val)));
2007 2140
 				}
@@ -2009,11 +2142,16 @@  discard block
 block discarded – undo
2009 2142
 			$name_str = sprintf('$_menu_names[%d] = array(%s); %s', $node->menu_item_srl, $name_arr_str, $child_output['name']);
2010 2143
 
2011 2144
 			// If url value is not empty in the current node, put the value into an array url_list
2012
-			if($node->url) $child_output['url_list'][] = $node->url;
2145
+			if($node->url) {
2146
+				$child_output['url_list'][] = $node->url;
2147
+			}
2013 2148
 			$output['url_list'] = array_merge($output['url_list'], $child_output['url_list']);
2014 2149
 			// If node->group_srls value exists
2015
-			if($node->group_srls)$group_check_code = sprintf('($is_admin==true||(is_array($group_srls)&&count(array_intersect($group_srls, array(%s))))||($is_logged && %s))',$node->group_srls,$node->group_srls == -1?1:0);
2016
-			else $group_check_code = "true";
2150
+			if($node->group_srls) {
2151
+				$group_check_code = sprintf('($is_admin==true||(is_array($group_srls)&&count(array_intersect($group_srls, array(%s))))||($is_logged && %s))',$node->group_srls,$node->group_srls == -1?1:0);
2152
+			} else {
2153
+				$group_check_code = "true";
2154
+			}
2017 2155
 
2018 2156
 			// List variables
2019 2157
 			$href = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->href);
@@ -2022,8 +2160,9 @@  discard block
 block discarded – undo
2022 2160
 			if(preg_match('/^([0-9a-zA-Z\_\-]+)$/i', $node->url))
2023 2161
 			{
2024 2162
 				$href = "getSiteUrl('$domain', '','mid','$node->url')";
2163
+			} else {
2164
+				$href = sprintf('"%s"', $url);
2025 2165
 			}
2026
-			else $href = sprintf('"%s"', $url);
2027 2166
 			$is_shortcut = $node->is_shortcut;
2028 2167
 			$open_window = $node->open_window;
2029 2168
 			$normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->normal_btn);
@@ -2040,29 +2179,48 @@  discard block
 block discarded – undo
2040 2179
 			$expand = $node->expand;
2041 2180
 
2042 2181
 			$normal_btn = $node->normal_btn;
2043
-			if($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) $normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$normal_btn);
2044
-			else $normal_btn = '';
2182
+			if($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) {
2183
+				$normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$normal_btn);
2184
+			} else {
2185
+				$normal_btn = '';
2186
+			}
2045 2187
 
2046 2188
 			$hover_btn = $node->hover_btn;
2047
-			if($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) $hover_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$hover_btn);
2048
-			else $hover_btn = '';
2189
+			if($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) {
2190
+				$hover_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$hover_btn);
2191
+			} else {
2192
+				$hover_btn = '';
2193
+			}
2049 2194
 
2050 2195
 			$active_btn = $node->active_btn;
2051
-			if($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) $active_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$active_btn);
2052
-			else $active_btn = '';
2196
+			if($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) {
2197
+				$active_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$active_btn);
2198
+			} else {
2199
+				$active_btn = '';
2200
+			}
2053 2201
 
2054 2202
 
2055 2203
 			$group_srls = $node->group_srls;
2056 2204
 
2057 2205
 			if($normal_btn)
2058 2206
 			{
2059
-				if($hover_btn) $hover_str = sprintf('onmouseover=\"this.src=\'%s\'\"', $hover_btn); else $hover_str = '';
2060
-				if($active_btn) $active_str = sprintf('onmousedown=\"this.src=\'%s\'\"', $active_btn); else $active_str = '';
2207
+				if($hover_btn) {
2208
+					$hover_str = sprintf('onmouseover=\"this.src=\'%s\'\"', $hover_btn);
2209
+				} else {
2210
+					$hover_str = '';
2211
+				}
2212
+				if($active_btn) {
2213
+					$active_str = sprintf('onmousedown=\"this.src=\'%s\'\"', $active_btn);
2214
+				} else {
2215
+					$active_str = '';
2216
+				}
2061 2217
 				$link = sprintf('"<img src=\"%s\" onmouseout=\"this.src=\'%s\'\" alt=\"".$_menu_names[%d][$lang_type]."\" %s %s />"', $normal_btn, $normal_btn, $node->menu_item_srl, $hover_str, $active_str);
2062
-				if($active_btn) $link_active = sprintf('"<img src=\"%s\" onmouseout=\"this.src=\'%s\'\" alt=\"".$_menu_names[%d][$lang_type]."\" %s />"', $active_btn, $active_btn, $node->menu_item_srl, $hover_str);
2063
-				else $link_active = $link;
2064
-			}
2065
-			else
2218
+				if($active_btn) {
2219
+					$link_active = sprintf('"<img src=\"%s\" onmouseout=\"this.src=\'%s\'\" alt=\"".$_menu_names[%d][$lang_type]."\" %s />"', $active_btn, $active_btn, $node->menu_item_srl, $hover_str);
2220
+				} else {
2221
+					$link_active = $link;
2222
+				}
2223
+			} else
2066 2224
 			{
2067 2225
 				$link_active = $link = sprintf('$_menu_names[%d][$lang_type]', $node->menu_item_srl);
2068 2226
 			}
@@ -2111,11 +2269,15 @@  discard block
 block discarded – undo
2111 2269
 	 */
2112 2270
 	function updateMenuLayout($layout_srl, $menu_srl_list)
2113 2271
 	{
2114
-		if(!count($menu_srl_list)) return;
2272
+		if(!count($menu_srl_list)) {
2273
+			return;
2274
+		}
2115 2275
 		// Delete the value of menu_srls
2116 2276
 		$args->menu_srls = implode(',',$menu_srl_list);
2117 2277
 		$output = executeQuery('menu.deleteMenuLayout', $args);
2118
-		if(!$output->toBool()) return $output;
2278
+		if(!$output->toBool()) {
2279
+			return $output;
2280
+		}
2119 2281
 
2120 2282
 		$args->layout_srl = $layout_srl;
2121 2283
 		// Mapping menu_srls, layout_srl
@@ -2123,7 +2285,9 @@  discard block
 block discarded – undo
2123 2285
 		{
2124 2286
 			$args->menu_srl = $menu_srl_list[$i];
2125 2287
 			$output = executeQuery('menu.insertMenuLayout', $args);
2126
-			if(!$output->toBool()) return $output;
2288
+			if(!$output->toBool()) {
2289
+				return $output;
2290
+			}
2127 2291
 		}
2128 2292
 	}
2129 2293
 
@@ -2146,9 +2310,15 @@  discard block
 block discarded – undo
2146 2310
 			$oMenuModel = getAdminModel('menu');
2147 2311
 			$itemInfo = $oMenuModel->getMenuItemInfo($args->menu_item_srl);
2148 2312
 
2149
-			if($args->isNormalDelete == 'Y' && $itemInfo->normal_btn) FileHandler::removeFile($itemInfo->normal_btn);
2150
-			if($args->isHoverDelete == 'Y' && $itemInfo->hover_btn) FileHandler::removeFile($itemInfo->hover_btn);
2151
-			if($args->isActiveDelete == 'Y' && $itemInfo->active_btn) FileHandler::removeFile($itemInfo->active_btn);
2313
+			if($args->isNormalDelete == 'Y' && $itemInfo->normal_btn) {
2314
+				FileHandler::removeFile($itemInfo->normal_btn);
2315
+			}
2316
+			if($args->isHoverDelete == 'Y' && $itemInfo->hover_btn) {
2317
+				FileHandler::removeFile($itemInfo->hover_btn);
2318
+			}
2319
+			if($args->isActiveDelete == 'Y' && $itemInfo->active_btn) {
2320
+				FileHandler::removeFile($itemInfo->active_btn);
2321
+			}
2152 2322
 		}
2153 2323
 
2154 2324
 		$returnArray = array();
Please login to merge, or discard this patch.