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 ( 2d3f88...cfd273 )
by gyeong-won
07:52
created
widgets/content/content.class.php 2 patches
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.
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('','mid', $args->mid_lists[$attribute->module_srl], '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('', 'mid', $args->mid_lists[$attribute->module_srl], '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, '', 'mid', $args->mid_lists[$module_srl],'document_srl',$document_srl) );
285
+				$content_item->setLink(getSiteUrl($domain, '', 'mid', $args->mid_lists[$module_srl], '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 target="_blank" rel="noopener" href=', $item->description);
505
+				$item->description = preg_replace('!<a href=!is', '<a target="_blank" rel="noopener" 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 target="_blank" rel="noopener" href=', $item->description);
544
+				$item->description = preg_replace('!<a href=!is', '<a target="_blank" rel="noopener" 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 target="_blank" rel="noopener" href=', $item->description);
616
+				$item->description = preg_replace('!<a href=!is', '<a target="_blank" rel="noopener" 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.
modules/file/file.model.php 3 patches
Braces   +82 added lines, -31 removed lines patch added patch discarded remove patch
@@ -29,7 +29,9 @@  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
 		{
@@ -68,26 +70,32 @@  discard block
 block discarded – undo
68 70
 			}
69 71
 
70 72
 			$tmp_files = $this->getFiles($upload_target_srl);
71
-			if(!$tmp_files) $tmp_files = array();
73
+			if(!$tmp_files) {
74
+				$tmp_files = array();
75
+			}
72 76
 
73 77
 			foreach($tmp_files as $file_info)
74 78
 			{
75
-				if(!$file_info->file_srl) continue;
79
+				if(!$file_info->file_srl) {
80
+					continue;
81
+				}
76 82
 
77 83
 				$obj = new stdClass;
78 84
 				$obj->file_srl = $file_info->file_srl;
79 85
 				$obj->source_filename = $file_info->source_filename;
80 86
 				$obj->file_size = $file_info->file_size;
81 87
 				$obj->disp_file_size = FileHandler::filesize($file_info->file_size);
82
-				if($file_info->direct_download=='N') $obj->download_url = $this->getDownloadUrl($file_info->file_srl, $file_info->sid, $file_info->module_srl);
83
-				else $obj->download_url = str_replace('./', '', $file_info->uploaded_filename);
88
+				if($file_info->direct_download=='N') {
89
+					$obj->download_url = $this->getDownloadUrl($file_info->file_srl, $file_info->sid, $file_info->module_srl);
90
+				} else {
91
+					$obj->download_url = str_replace('./', '', $file_info->uploaded_filename);
92
+				}
84 93
 				$obj->direct_download = $file_info->direct_download;
85 94
 				$obj->cover_image = ($file_info->cover_image === 'Y') ? true : false;
86 95
 				$files[] = $obj;
87 96
 				$attached_size += $file_info->file_size;
88 97
 			}
89
-		}
90
-		else
98
+		} else
91 99
 		{
92 100
 			$upload_target_srl = 0;
93 101
 			$attached_size = 0;
@@ -155,8 +163,12 @@  discard block
 block discarded – undo
155 163
 
156 164
 		$file_module_config = $oModuleModel->getModuleConfig('file');
157 165
 
158
-		if($module_srl) $file_config = $oModuleModel->getModulePartConfig('file',$module_srl);
159
-		if(!$file_config) $file_config = $file_module_config;
166
+		if($module_srl) {
167
+			$file_config = $oModuleModel->getModulePartConfig('file',$module_srl);
168
+		}
169
+		if(!$file_config) {
170
+			$file_config = $file_module_config;
171
+		}
160 172
 
161 173
 		$config = new stdClass();
162 174
 
@@ -171,25 +183,53 @@  discard block
 block discarded – undo
171 183
 			$config->allow_outlink_format = $file_config->allow_outlink_format;
172 184
 		}
173 185
 		// Property for all files comes first than each property
174
-		if(!$config->allowed_filesize) $config->allowed_filesize = $file_module_config->allowed_filesize;
175
-		if(!$config->allowed_attach_size) $config->allowed_attach_size = $file_module_config->allowed_attach_size;
176
-		if(!$config->allowed_filetypes) $config->allowed_filetypes = $file_module_config->allowed_filetypes;
177
-		if(!$config->allow_outlink) $config->allow_outlink = $file_module_config->allow_outlink;
178
-		if(!$config->allow_outlink_site) $config->allow_outlink_site = $file_module_config->allow_outlink_site;
179
-		if(!$config->allow_outlink_format) $config->allow_outlink_format = $file_module_config->allow_outlink_format;
180
-		if(!$config->download_grant) $config->download_grant = $file_module_config->download_grant;
186
+		if(!$config->allowed_filesize) {
187
+			$config->allowed_filesize = $file_module_config->allowed_filesize;
188
+		}
189
+		if(!$config->allowed_attach_size) {
190
+			$config->allowed_attach_size = $file_module_config->allowed_attach_size;
191
+		}
192
+		if(!$config->allowed_filetypes) {
193
+			$config->allowed_filetypes = $file_module_config->allowed_filetypes;
194
+		}
195
+		if(!$config->allow_outlink) {
196
+			$config->allow_outlink = $file_module_config->allow_outlink;
197
+		}
198
+		if(!$config->allow_outlink_site) {
199
+			$config->allow_outlink_site = $file_module_config->allow_outlink_site;
200
+		}
201
+		if(!$config->allow_outlink_format) {
202
+			$config->allow_outlink_format = $file_module_config->allow_outlink_format;
203
+		}
204
+		if(!$config->download_grant) {
205
+			$config->download_grant = $file_module_config->download_grant;
206
+		}
181 207
 		// Default setting if not exists
182
-		if(!$config->allowed_filesize) $config->allowed_filesize = '2';
183
-		if(!$config->allowed_attach_size) $config->allowed_attach_size = '3';
184
-		if(!$config->allowed_filetypes) $config->allowed_filetypes = '*.*';
185
-		if(!$config->allow_outlink) $config->allow_outlink = 'Y';
186
-		if(!$config->download_grant) $config->download_grant = array();
208
+		if(!$config->allowed_filesize) {
209
+			$config->allowed_filesize = '2';
210
+		}
211
+		if(!$config->allowed_attach_size) {
212
+			$config->allowed_attach_size = '3';
213
+		}
214
+		if(!$config->allowed_filetypes) {
215
+			$config->allowed_filetypes = '*.*';
216
+		}
217
+		if(!$config->allow_outlink) {
218
+			$config->allow_outlink = 'Y';
219
+		}
220
+		if(!$config->download_grant) {
221
+			$config->download_grant = array();
222
+		}
187 223
 
188 224
 		$size = ini_get('upload_max_filesize');
189 225
 		$unit = strtolower($size[strlen($size) - 1]);
190 226
 		$size = (float)$size;
191
-		if($unit == 'g') $size *= 1024;
192
-		if($unit == 'k') $size /= 1024;
227
+		if($unit == 'g') {
228
+			$size *= 1024;
229
+		}
230
+		if($unit == 'k') {
231
+			$size /= 1024;
232
+		}
193 233
 
194 234
 		if($config->allowed_filesize > $size) 
195 235
 		{	
@@ -215,7 +255,9 @@  discard block
 block discarded – undo
215 255
 		$args = new stdClass();
216 256
 		$args->file_srl = $file_srl;
217 257
 		$output = executeQueryArray('file.getFile', $args, $columnList);
218
-		if(!$output->toBool()) return $output;
258
+		if(!$output->toBool()) {
259
+			return $output;
260
+		}
219 261
 
220 262
 		// old version compatibility
221 263
 		if(count($output->data) == 1)
@@ -224,8 +266,7 @@  discard block
 block discarded – undo
224 266
 			$file->download_url = $this->getDownloadUrl($file->file_srl, $file->sid, $file->module_srl);
225 267
 
226 268
 			return $file;
227
-		}
228
-		else
269
+		} else
229 270
 		{
230 271
 			$fileList = array();
231 272
 
@@ -255,13 +296,19 @@  discard block
 block discarded – undo
255 296
 		$args = new stdClass();
256 297
 		$args->upload_target_srl = $upload_target_srl;
257 298
 		$args->sort_index = $sortIndex;
258
-		if($ckValid) $args->isvalid = 'Y';
299
+		if($ckValid) {
300
+			$args->isvalid = 'Y';
301
+		}
259 302
 		$output = executeQueryArray('file.getFiles', $args, $columnList);
260
-		if(!$output->data) return;
303
+		if(!$output->data) {
304
+			return;
305
+		}
261 306
 
262 307
 		$file_list = $output->data;
263 308
 
264
-		if($file_list && !is_array($file_list)) $file_list = array($file_list);
309
+		if($file_list && !is_array($file_list)) {
310
+			$file_list = array($file_list);
311
+		}
265 312
 
266 313
 		foreach ($file_list as &$file)
267 314
 		{
@@ -346,7 +393,9 @@  discard block
 block discarded – undo
346 393
 	 */
347 394
 	function getFileGrant($file_info, $member_info)
348 395
 	{
349
-		if(!$file_info) return null;
396
+		if(!$file_info) {
397
+			return null;
398
+		}
350 399
 
351 400
 		if($_SESSION['__XE_UPLOADING_FILES_INFO__'][$file_info->file_srl])
352 401
 		{
@@ -359,7 +408,9 @@  discard block
 block discarded – undo
359 408
 
360 409
 		$oDocumentModel = getModel('document');
361 410
 		$oDocument = $oDocumentModel->getDocument($file_info->upload_target_srl);
362
-		if($oDocument->isExists()) $document_grant = $oDocument->isGranted();
411
+		if($oDocument->isExists()) {
412
+			$document_grant = $oDocument->isGranted();
413
+		}
363 414
 
364 415
 		$file_grant->is_deletable = ($document_grant || $member_info->is_admin == 'Y' || $member_info->member_srl == $file_info->member_srl || $grant->manager);
365 416
 
Please login to merge, or discard this patch.
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 	 * It is used when a file list of the upload_target_srl is requested for creating/updating a document.
21 21
 	 * Attempt to replace with sever-side session if upload_target_srl is not yet determined
22 22
 	 *
23
-	 * @return void
23
+	 * @return BaseObject|null
24 24
 	 */
25 25
 	function getFileList()
26 26
 	{
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 	 * Get file configurations
147 147
 	 *
148 148
 	 * @param int $module_srl If set this, returns specific module's configuration. Otherwise returns global configuration.
149
-	 * @return object Returns configuration.
149
+	 * @return stdClass Returns configuration.
150 150
 	 */
151 151
 	function getFileConfig($module_srl = null)
152 152
 	{
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 	/**
277 277
 	 * Return configurations of the attachement (it automatically checks if an administrator is)
278 278
 	 *
279
-	 * @return object Returns a file configuration of current module. If user is admin, returns PHP's max file size and allow all file types.
279
+	 * @return stdClass Returns a file configuration of current module. If user is admin, returns PHP's max file size and allow all file types.
280 280
 	 */
281 281
 	function getUploadConfig()
282 282
 	{
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
 	 * Return file configuration of the module
331 331
 	 *
332 332
 	 * @param int $module_srl The sequence of module to get configuration
333
-	 * @return object
333
+	 * @return stdClass
334 334
 	 */
335 335
 	function getFileModuleConfig($module_srl)
336 336
 	{
Please login to merge, or discard this patch.
Spacing   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -29,9 +29,9 @@  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
 			$oDocumentModel = getModel('document');
37 37
 			$oCommentModel = getModel('comment');
@@ -40,10 +40,10 @@  discard block
 block discarded – undo
40 40
 			$oDocument = $oDocumentModel->getDocument($upload_target_srl);
41 41
 
42 42
 			// comment 권한 확인
43
-			if(!$oDocument->isExists())
43
+			if (!$oDocument->isExists())
44 44
 			{
45 45
 				$oComment = $oCommentModel->getComment($upload_target_srl);
46
-				if($oComment->isExists() && $oComment->isSecret() && !$oComment->isGranted())
46
+				if ($oComment->isExists() && $oComment->isSecret() && !$oComment->isGranted())
47 47
 				{
48 48
 					return new BaseObject(-1, 'msg_not_permitted');
49 49
 				}
@@ -52,34 +52,34 @@  discard block
 block discarded – undo
52 52
 			}
53 53
 
54 54
 			// document 권한 확인
55
-			if($oDocument->isExists() && $oDocument->isSecret() && !$oDocument->isGranted())
55
+			if ($oDocument->isExists() && $oDocument->isSecret() && !$oDocument->isGranted())
56 56
 			{
57 57
 				return new BaseObject(-1, 'msg_not_permitted');
58 58
 			}
59 59
 
60 60
 			// 모듈 권한 확인
61
-			if($oDocument->isExists())
61
+			if ($oDocument->isExists())
62 62
 			{
63 63
 				$grant = $oModuleModel->getGrant($oModuleModel->getModuleInfoByModuleSrl($oDocument->get('module_srl')), $logged_info);
64
-				if(!$grant->access)
64
+				if (!$grant->access)
65 65
 				{
66 66
 					return new BaseObject(-1, 'msg_not_permitted');
67 67
 				}
68 68
 			}
69 69
 
70 70
 			$tmp_files = $this->getFiles($upload_target_srl);
71
-			if(!$tmp_files) $tmp_files = array();
71
+			if (!$tmp_files) $tmp_files = array();
72 72
 
73
-			foreach($tmp_files as $file_info)
73
+			foreach ($tmp_files as $file_info)
74 74
 			{
75
-				if(!$file_info->file_srl) continue;
75
+				if (!$file_info->file_srl) continue;
76 76
 
77 77
 				$obj = new stdClass;
78 78
 				$obj->file_srl = $file_info->file_srl;
79 79
 				$obj->source_filename = $file_info->source_filename;
80 80
 				$obj->file_size = $file_info->file_size;
81 81
 				$obj->disp_file_size = FileHandler::filesize($file_info->file_size);
82
-				if($file_info->direct_download=='N') $obj->download_url = $this->getDownloadUrl($file_info->file_srl, $file_info->sid, $file_info->module_srl);
82
+				if ($file_info->direct_download == 'N') $obj->download_url = $this->getDownloadUrl($file_info->file_srl, $file_info->sid, $file_info->module_srl);
83 83
 				else $obj->download_url = str_replace('./', '', $file_info->uploaded_filename);
84 84
 				$obj->direct_download = $file_info->direct_download;
85 85
 				$obj->cover_image = ($file_info->cover_image === 'Y') ? true : false;
@@ -99,17 +99,17 @@  discard block
 block discarded – undo
99 99
 		//$config = $oModuleModel->getModuleInfoByMid($mid);	//perhaps config varialbles not used
100 100
 
101 101
 		$file_config = $this->getUploadConfig();
102
-		$left_size = $file_config->allowed_attach_size*1024*1024 - $attached_size;
102
+		$left_size = $file_config->allowed_attach_size * 1024 * 1024 - $attached_size;
103 103
 		// Settings of required information
104 104
 		$attached_size = FileHandler::filesize($attached_size);
105
-		$allowed_attach_size = FileHandler::filesize($file_config->allowed_attach_size*1024*1024);
106
-		$allowed_filesize = FileHandler::filesize($file_config->allowed_filesize*1024*1024);
105
+		$allowed_attach_size = FileHandler::filesize($file_config->allowed_attach_size * 1024 * 1024);
106
+		$allowed_filesize = FileHandler::filesize($file_config->allowed_filesize * 1024 * 1024);
107 107
 		$allowed_filetypes = $file_config->allowed_filetypes;
108
-		$this->add("files",$files);
109
-		$this->add("editor_sequence",$editor_sequence);
110
-		$this->add("upload_target_srl",$upload_target_srl);
111
-		$this->add("upload_status",$upload_status);
112
-		$this->add("left_size",$left_size);
108
+		$this->add("files", $files);
109
+		$this->add("editor_sequence", $editor_sequence);
110
+		$this->add("upload_target_srl", $upload_target_srl);
111
+		$this->add("upload_status", $upload_status);
112
+		$this->add("left_size", $left_size);
113 113
 		$this->add('attached_size', $attached_size);
114 114
 		$this->add('allowed_attach_size', $allowed_attach_size);
115 115
 		$this->add('allowed_filesize', $allowed_filesize);
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 		$args = new stdClass();
128 128
 		$args->upload_target_srl = $upload_target_srl;
129 129
 		$output = executeQuery('file.getFilesCount', $args);
130
-		return (int)$output->data->count;
130
+		return (int) $output->data->count;
131 131
 	}
132 132
 
133 133
 	/**
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 	 * @param string $sid
138 138
 	 * @return string Returns a url
139 139
 	 */
140
-	function getDownloadUrl($file_srl, $sid, $module_srl="")
140
+	function getDownloadUrl($file_srl, $sid, $module_srl = "")
141 141
 	{
142 142
 		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);
143 143
 	}
@@ -155,12 +155,12 @@  discard block
 block discarded – undo
155 155
 
156 156
 		$file_module_config = $oModuleModel->getModuleConfig('file');
157 157
 
158
-		if($module_srl) $file_config = $oModuleModel->getModulePartConfig('file',$module_srl);
159
-		if(!$file_config) $file_config = $file_module_config;
158
+		if ($module_srl) $file_config = $oModuleModel->getModulePartConfig('file', $module_srl);
159
+		if (!$file_config) $file_config = $file_module_config;
160 160
 
161 161
 		$config = new stdClass();
162 162
 
163
-		if($file_config)
163
+		if ($file_config)
164 164
 		{
165 165
 			$config->allowed_filesize = $file_config->allowed_filesize;
166 166
 			$config->allowed_attach_size = $file_config->allowed_attach_size;
@@ -171,31 +171,31 @@  discard block
 block discarded – undo
171 171
 			$config->allow_outlink_format = $file_config->allow_outlink_format;
172 172
 		}
173 173
 		// Property for all files comes first than each property
174
-		if(!$config->allowed_filesize) $config->allowed_filesize = $file_module_config->allowed_filesize;
175
-		if(!$config->allowed_attach_size) $config->allowed_attach_size = $file_module_config->allowed_attach_size;
176
-		if(!$config->allowed_filetypes) $config->allowed_filetypes = $file_module_config->allowed_filetypes;
177
-		if(!$config->allow_outlink) $config->allow_outlink = $file_module_config->allow_outlink;
178
-		if(!$config->allow_outlink_site) $config->allow_outlink_site = $file_module_config->allow_outlink_site;
179
-		if(!$config->allow_outlink_format) $config->allow_outlink_format = $file_module_config->allow_outlink_format;
180
-		if(!$config->download_grant) $config->download_grant = $file_module_config->download_grant;
174
+		if (!$config->allowed_filesize) $config->allowed_filesize = $file_module_config->allowed_filesize;
175
+		if (!$config->allowed_attach_size) $config->allowed_attach_size = $file_module_config->allowed_attach_size;
176
+		if (!$config->allowed_filetypes) $config->allowed_filetypes = $file_module_config->allowed_filetypes;
177
+		if (!$config->allow_outlink) $config->allow_outlink = $file_module_config->allow_outlink;
178
+		if (!$config->allow_outlink_site) $config->allow_outlink_site = $file_module_config->allow_outlink_site;
179
+		if (!$config->allow_outlink_format) $config->allow_outlink_format = $file_module_config->allow_outlink_format;
180
+		if (!$config->download_grant) $config->download_grant = $file_module_config->download_grant;
181 181
 		// Default setting if not exists
182
-		if(!$config->allowed_filesize) $config->allowed_filesize = '2';
183
-		if(!$config->allowed_attach_size) $config->allowed_attach_size = '3';
184
-		if(!$config->allowed_filetypes) $config->allowed_filetypes = '*.*';
185
-		if(!$config->allow_outlink) $config->allow_outlink = 'Y';
186
-		if(!$config->download_grant) $config->download_grant = array();
182
+		if (!$config->allowed_filesize) $config->allowed_filesize = '2';
183
+		if (!$config->allowed_attach_size) $config->allowed_attach_size = '3';
184
+		if (!$config->allowed_filetypes) $config->allowed_filetypes = '*.*';
185
+		if (!$config->allow_outlink) $config->allow_outlink = 'Y';
186
+		if (!$config->download_grant) $config->download_grant = array();
187 187
 
188 188
 		$size = ini_get('upload_max_filesize');
189 189
 		$unit = strtolower($size[strlen($size) - 1]);
190
-		$size = (float)$size;
191
-		if($unit == 'g') $size *= 1024;
192
-		if($unit == 'k') $size /= 1024;
190
+		$size = (float) $size;
191
+		if ($unit == 'g') $size *= 1024;
192
+		if ($unit == 'k') $size /= 1024;
193 193
 
194
-		if($config->allowed_filesize > $size) 
194
+		if ($config->allowed_filesize > $size) 
195 195
 		{	
196 196
 			$config->allowed_filesize = $size;
197 197
 		}
198
-		if($config->allowed_attach_size > $size) 
198
+		if ($config->allowed_attach_size > $size) 
199 199
 		{
200 200
 			$config->allowed_attach_size = $size;
201 201
 		}
@@ -215,10 +215,10 @@  discard block
 block discarded – undo
215 215
 		$args = new stdClass();
216 216
 		$args->file_srl = $file_srl;
217 217
 		$output = executeQueryArray('file.getFile', $args, $columnList);
218
-		if(!$output->toBool()) return $output;
218
+		if (!$output->toBool()) return $output;
219 219
 
220 220
 		// old version compatibility
221
-		if(count($output->data) == 1)
221
+		if (count($output->data) == 1)
222 222
 		{
223 223
 			$file = $output->data[0];
224 224
 			$file->download_url = $this->getDownloadUrl($file->file_srl, $file->sid, $file->module_srl);
@@ -229,9 +229,9 @@  discard block
 block discarded – undo
229 229
 		{
230 230
 			$fileList = array();
231 231
 
232
-			if(is_array($output->data))
232
+			if (is_array($output->data))
233 233
 			{
234
-				foreach($output->data as $key=>$value)
234
+				foreach ($output->data as $key=>$value)
235 235
 				{
236 236
 					$file = $value;
237 237
 					$file->download_url = $this->getDownloadUrl($file->file_srl, $file->sid, $file->module_srl);
@@ -255,13 +255,13 @@  discard block
 block discarded – undo
255 255
 		$args = new stdClass();
256 256
 		$args->upload_target_srl = $upload_target_srl;
257 257
 		$args->sort_index = $sortIndex;
258
-		if($ckValid) $args->isvalid = 'Y';
258
+		if ($ckValid) $args->isvalid = 'Y';
259 259
 		$output = executeQueryArray('file.getFiles', $args, $columnList);
260
-		if(!$output->data) return;
260
+		if (!$output->data) return;
261 261
 
262 262
 		$file_list = $output->data;
263 263
 
264
-		if($file_list && !is_array($file_list)) $file_list = array($file_list);
264
+		if ($file_list && !is_array($file_list)) $file_list = array($file_list);
265 265
 
266 266
 		foreach ($file_list as &$file)
267 267
 		{
@@ -284,14 +284,14 @@  discard block
 block discarded – undo
284 284
 
285 285
 		$module_srl = Context::get('module_srl');
286 286
 		// Get the current module if module_srl doesn't exist
287
-		if(!$module_srl)
287
+		if (!$module_srl)
288 288
 		{
289 289
 			$current_module_info = Context::get('current_module_info');
290 290
 			$module_srl = $current_module_info->module_srl;
291 291
 		}
292 292
 		$file_config = $this->getFileConfig($module_srl);
293 293
 
294
-		if($logged_info->is_admin == 'Y')
294
+		if ($logged_info->is_admin == 'Y')
295 295
 		{
296 296
 			$iniPostMaxSize = FileHandler::returnbytes(ini_get('post_max_size'));
297 297
 			$iniUploadMaxSize = FileHandler::returnbytes(ini_get('upload_max_filesize'));
@@ -317,9 +317,9 @@  discard block
 block discarded – undo
317 317
 			'%s : %s/ %s<br /> %s : %s (%s : %s)',
318 318
 			Context::getLang('allowed_attach_size'),
319 319
 			FileHandler::filesize($attached_size),
320
-			FileHandler::filesize($file_config->allowed_attach_size*1024*1024),
320
+			FileHandler::filesize($file_config->allowed_attach_size * 1024 * 1024),
321 321
 			Context::getLang('allowed_filesize'),
322
-			FileHandler::filesize($file_config->allowed_filesize*1024*1024),
322
+			FileHandler::filesize($file_config->allowed_filesize * 1024 * 1024),
323 323
 			Context::getLang('allowed_filetypes'),
324 324
 			$file_config->allowed_filetypes
325 325
 		);
@@ -346,9 +346,9 @@  discard block
 block discarded – undo
346 346
 	 */
347 347
 	function getFileGrant($file_info, $member_info)
348 348
 	{
349
-		if(!$file_info) return null;
349
+		if (!$file_info) return null;
350 350
 
351
-		if($_SESSION['__XE_UPLOADING_FILES_INFO__'][$file_info->file_srl])
351
+		if ($_SESSION['__XE_UPLOADING_FILES_INFO__'][$file_info->file_srl])
352 352
 		{
353 353
 			$file_grant->is_deletable = true;
354 354
 			return $file_grant;
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
 
360 360
 		$oDocumentModel = getModel('document');
361 361
 		$oDocument = $oDocumentModel->getDocument($file_info->upload_target_srl);
362
-		if($oDocument->isExists()) $document_grant = $oDocument->isGranted();
362
+		if ($oDocument->isExists()) $document_grant = $oDocument->isGranted();
363 363
 
364 364
 		$file_grant->is_deletable = ($document_grant || $member_info->is_admin == 'Y' || $member_info->member_srl == $file_info->member_srl || $grant->manager);
365 365
 
Please login to merge, or discard this patch.
modules/board/board.controller.php 2 patches
Braces   +47 added lines, -24 removed lines patch added patch discarded remove patch
@@ -36,26 +36,39 @@  discard block
 block discarded – undo
36 36
 		// setup variables
37 37
 		$obj = Context::getRequestVars();
38 38
 		$obj->module_srl = $this->module_srl;
39
-		if($obj->is_notice!='Y'||!$this->grant->manager) $obj->is_notice = 'N';
39
+		if($obj->is_notice!='Y'||!$this->grant->manager) {
40
+			$obj->is_notice = 'N';
41
+		}
40 42
 		$obj->commentStatus = $obj->comment_status;
41 43
 
42 44
 		$oModuleModel = getModel('module');
43 45
 		$module_config = $oModuleModel->getModuleInfoByModuleSrl($obj->module_srl);
44 46
 		if($module_config->mobile_use_editor === 'Y')
45 47
 		{
46
-			if(!isset($obj->use_editor)) $obj->use_editor = 'Y';
47
-			if(!isset($obj->use_html)) $obj->use_html = 'Y';
48
-		}
49
-		else
48
+			if(!isset($obj->use_editor)) {
49
+				$obj->use_editor = 'Y';
50
+			}
51
+			if(!isset($obj->use_html)) {
52
+				$obj->use_html = 'Y';
53
+			}
54
+		} else
50 55
 		{
51
-			if(!isset($obj->use_editor)) $obj->use_editor = 'N';
52
-			if(!isset($obj->use_html)) $obj->use_html = 'N';
56
+			if(!isset($obj->use_editor)) {
57
+				$obj->use_editor = 'N';
58
+			}
59
+			if(!isset($obj->use_html)) {
60
+				$obj->use_html = 'N';
61
+			}
53 62
 		}
54 63
 
55 64
 		settype($obj->title, "string");
56
-		if($obj->title == '') $obj->title = cut_str(trim(strip_tags(nl2br($obj->content))),20,'...');
65
+		if($obj->title == '') {
66
+			$obj->title = cut_str(trim(strip_tags(nl2br($obj->content))),20,'...');
67
+		}
57 68
 		//setup dpcument title tp 'Untitled'
58
-		if($obj->title == '') $obj->title = 'Untitled';
69
+		if($obj->title == '') {
70
+			$obj->title = 'Untitled';
71
+		}
59 72
 
60 73
 		// unset document style if the user is not the document manager
61 74
 		if(!$this->grant->manager)
@@ -96,8 +109,7 @@  discard block
 block discarded – undo
96 109
 			{
97 110
 				$oDocument->add('member_srl', $obj->member_srl);
98 111
 			}
99
-		}
100
-		else
112
+		} else
101 113
 		{
102 114
 			$bAnonymous = false;
103 115
 		}
@@ -169,7 +181,9 @@  discard block
 block discarded – undo
169 181
 				for($i=0;$i<count($target_mail);$i++)
170 182
 				{
171 183
 					$email_address = trim($target_mail[$i]);
172
-					if(!$email_address) continue;
184
+					if(!$email_address) {
185
+						continue;
186
+					}
173 187
 					$oMail->setReceiptor($email_address, $email_address);
174 188
 					$oMail->send();
175 189
 				}
@@ -263,7 +277,9 @@  discard block
 block discarded – undo
263 277
 		$obj = Context::getRequestVars();
264 278
 		$obj->module_srl = $this->module_srl;
265 279
 
266
-		if(!$this->module_info->use_status) $this->module_info->use_status = 'PUBLIC';
280
+		if(!$this->module_info->use_status) {
281
+			$this->module_info->use_status = 'PUBLIC';
282
+		}
267 283
 		if(!is_array($this->module_info->use_status))
268 284
 		{
269 285
 			$this->module_info->use_status = explode('|@|', $this->module_info->use_status);
@@ -272,8 +288,7 @@  discard block
 block discarded – undo
272 288
 		if(in_array('SECRET', $this->module_info->use_status))
273 289
 		{
274 290
 			$this->module_info->secret = 'Y';
275
-		}
276
-		else
291
+		} else
277 292
 		{
278 293
 			unset($obj->is_secret);
279 294
 			$this->module_info->secret = 'N';
@@ -283,13 +298,20 @@  discard block
 block discarded – undo
283 298
 		$module_config = $oModuleModel->getModuleInfoByModuleSrl($obj->module_srl);
284 299
 		if($module_config->mobile_use_editor === 'Y')
285 300
 		{
286
-			if(!isset($obj->use_editor)) $obj->use_editor = 'Y';
287
-			if(!isset($obj->use_html)) $obj->use_html = 'Y';
288
-		}
289
-		else
301
+			if(!isset($obj->use_editor)) {
302
+				$obj->use_editor = 'Y';
303
+			}
304
+			if(!isset($obj->use_html)) {
305
+				$obj->use_html = 'Y';
306
+			}
307
+		} else
290 308
 		{
291
-			if(!isset($obj->use_editor)) $obj->use_editor = 'N';
292
-			if(!isset($obj->use_html)) $obj->use_html = 'N';
309
+			if(!isset($obj->use_editor)) {
310
+				$obj->use_editor = 'N';
311
+			}
312
+			if(!isset($obj->use_html)) {
313
+				$obj->use_html = 'N';
314
+			}
293 315
 		}
294 316
 
295 317
 		// check if the doument is existed
@@ -309,8 +331,7 @@  discard block
 block discarded – undo
309 331
 			$obj->email_address = $obj->homepage = $obj->user_id = '';
310 332
 			$obj->user_name = $obj->nick_name = 'anonymous';
311 333
 			$bAnonymous = true;
312
-		}
313
-		else
334
+		} else
314 335
 		{
315 336
 			$bAnonymous = false;
316 337
 		}
@@ -416,7 +437,9 @@  discard block
 block discarded – undo
416 437
 		// generate trackback module controller object
417 438
 		$oTrackbackController = getController('trackback');
418 439
 
419
-		if(!$oTrackbackController) return;
440
+		if(!$oTrackbackController) {
441
+			return;
442
+		}
420 443
 
421 444
 		$output = $oTrackbackController->deleteTrackback($trackback_srl, $this->grant->manager);
422 445
 		if(!$output->toBool())
Please login to merge, or discard this patch.
Spacing   +74 added lines, -74 removed lines patch added patch discarded remove patch
@@ -23,11 +23,11 @@  discard block
 block discarded – undo
23 23
 	function procBoardInsertDocument()
24 24
 	{
25 25
 		// check grant
26
-		if($this->module_info->module != "board")
26
+		if ($this->module_info->module != "board")
27 27
 		{
28 28
 			return new BaseObject(-1, "msg_invalid_request");
29 29
 		}
30
-		if(!$this->grant->write_document)
30
+		if (!$this->grant->write_document)
31 31
 		{
32 32
 			return new BaseObject(-1, 'msg_not_permitted');
33 33
 		}
@@ -36,29 +36,29 @@  discard block
 block discarded – undo
36 36
 		// setup variables
37 37
 		$obj = Context::getRequestVars();
38 38
 		$obj->module_srl = $this->module_srl;
39
-		if($obj->is_notice!='Y'||!$this->grant->manager) $obj->is_notice = 'N';
39
+		if ($obj->is_notice != 'Y' || !$this->grant->manager) $obj->is_notice = 'N';
40 40
 		$obj->commentStatus = $obj->comment_status;
41 41
 
42 42
 		$oModuleModel = getModel('module');
43 43
 		$module_config = $oModuleModel->getModuleInfoByModuleSrl($obj->module_srl);
44
-		if($module_config->mobile_use_editor === 'Y')
44
+		if ($module_config->mobile_use_editor === 'Y')
45 45
 		{
46
-			if(!isset($obj->use_editor)) $obj->use_editor = 'Y';
47
-			if(!isset($obj->use_html)) $obj->use_html = 'Y';
46
+			if (!isset($obj->use_editor)) $obj->use_editor = 'Y';
47
+			if (!isset($obj->use_html)) $obj->use_html = 'Y';
48 48
 		}
49 49
 		else
50 50
 		{
51
-			if(!isset($obj->use_editor)) $obj->use_editor = 'N';
52
-			if(!isset($obj->use_html)) $obj->use_html = 'N';
51
+			if (!isset($obj->use_editor)) $obj->use_editor = 'N';
52
+			if (!isset($obj->use_html)) $obj->use_html = 'N';
53 53
 		}
54 54
 
55 55
 		settype($obj->title, "string");
56
-		if($obj->title == '') $obj->title = cut_str(trim(strip_tags(nl2br($obj->content))),20,'...');
56
+		if ($obj->title == '') $obj->title = cut_str(trim(strip_tags(nl2br($obj->content))), 20, '...');
57 57
 		//setup dpcument title tp 'Untitled'
58
-		if($obj->title == '') $obj->title = 'Untitled';
58
+		if ($obj->title == '') $obj->title = 'Untitled';
59 59
 
60 60
 		// unset document style if the user is not the document manager
61
-		if(!$this->grant->manager)
61
+		if (!$this->grant->manager)
62 62
 		{
63 63
 			unset($obj->title_color);
64 64
 			unset($obj->title_bold);
@@ -75,24 +75,24 @@  discard block
 block discarded – undo
75 75
 
76 76
 		// update the document if it is existed
77 77
 		$is_update = false;
78
-		if($oDocument->isExists() && $oDocument->document_srl == $obj->document_srl)
78
+		if ($oDocument->isExists() && $oDocument->document_srl == $obj->document_srl)
79 79
 		{
80 80
 			$is_update = true;
81 81
 		}
82 82
 
83 83
 		// if use anonymous is true
84
-		if($this->module_info->use_anonymous == 'Y')
84
+		if ($this->module_info->use_anonymous == 'Y')
85 85
 		{
86 86
 			$this->module_info->admin_mail = '';
87 87
 			$obj->notify_message = 'N';
88
-			if($is_update===false)
88
+			if ($is_update === false)
89 89
 			{
90
-				$obj->member_srl = -1*$logged_info->member_srl;
90
+				$obj->member_srl = -1 * $logged_info->member_srl;
91 91
 			}
92 92
 			$obj->email_address = $obj->homepage = $obj->user_id = '';
93 93
 			$obj->user_name = $obj->nick_name = 'anonymous';
94 94
 			$bAnonymous = true;
95
-			if($is_update===false)
95
+			if ($is_update === false)
96 96
 			{
97 97
 				$oDocument->add('member_srl', $obj->member_srl);
98 98
 			}
@@ -102,10 +102,10 @@  discard block
 block discarded – undo
102 102
 			$bAnonymous = false;
103 103
 		}
104 104
 
105
-		if($obj->is_secret == 'Y' || strtoupper($obj->status == 'SECRET'))
105
+		if ($obj->is_secret == 'Y' || strtoupper($obj->status == 'SECRET'))
106 106
 		{
107 107
 			$use_status = explode('|@|', $this->module_info->use_status);
108
-			if(!is_array($use_status) || !in_array('SECRET', $use_status))
108
+			if (!is_array($use_status) || !in_array('SECRET', $use_status))
109 109
 			{
110 110
 				unset($obj->is_secret);
111 111
 				$obj->status = 'PUBLIC';
@@ -113,24 +113,24 @@  discard block
 block discarded – undo
113 113
 		}
114 114
 
115 115
 		// update the document if it is existed
116
-		if($is_update)
116
+		if ($is_update)
117 117
 		{
118
-			if(!$oDocument->isGranted())
118
+			if (!$oDocument->isGranted())
119 119
 			{
120
-				return new BaseObject(-1,'msg_not_permitted');
120
+				return new BaseObject(-1, 'msg_not_permitted');
121 121
 			}
122 122
 
123
-			if($this->module_info->use_anonymous == 'Y') {
123
+			if ($this->module_info->use_anonymous == 'Y') {
124 124
 				$obj->member_srl = abs($oDocument->get('member_srl')) * -1;
125 125
 				$oDocument->add('member_srl', $obj->member_srl);
126 126
 			}
127 127
 
128
-			if($this->module_info->protect_content=="Y" && $oDocument->get('comment_count')>0 && $this->grant->manager==false)
128
+			if ($this->module_info->protect_content == "Y" && $oDocument->get('comment_count') > 0 && $this->grant->manager == false)
129 129
 			{
130
-				return new BaseObject(-1,'msg_protect_content');
130
+				return new BaseObject(-1, 'msg_protect_content');
131 131
 			}
132 132
 
133
-			if(!$this->grant->manager)
133
+			if (!$this->grant->manager)
134 134
 			{
135 135
 				// notice & document style same as before if not manager
136 136
 				$obj->is_notice = $oDocument->get('is_notice');
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 			}
140 140
 			
141 141
 			// modify list_order if document status is temp
142
-			if($oDocument->get('status') == 'TEMP')
142
+			if ($oDocument->get('status') == 'TEMP')
143 143
 			{
144 144
 				$obj->last_update = $obj->regdate = date('YmdHis');
145 145
 				$obj->update_order = $obj->list_order = (getNextSequence() * -1);
@@ -155,21 +155,21 @@  discard block
 block discarded – undo
155 155
 			$obj->document_srl = $output->get('document_srl');
156 156
 
157 157
 			// send an email to admin user
158
-			if($output->toBool() && $this->module_info->admin_mail)
158
+			if ($output->toBool() && $this->module_info->admin_mail)
159 159
 			{
160 160
 				$oModuleModel = getModel('module');
161 161
 				$member_config = $oModuleModel->getModuleConfig('member');
162 162
 				
163 163
 				$oMail = new Mail();
164 164
 				$oMail->setTitle($obj->title);
165
-				$oMail->setContent( sprintf("From : <a href=\"%s\">%s</a><br/>\r\n%s", getFullUrl('','document_srl',$obj->document_srl), getFullUrl('','document_srl',$obj->document_srl), $obj->content));
165
+				$oMail->setContent(sprintf("From : <a href=\"%s\">%s</a><br/>\r\n%s", getFullUrl('', 'document_srl', $obj->document_srl), getFullUrl('', 'document_srl', $obj->document_srl), $obj->content));
166 166
 				$oMail->setSender($obj->user_name ? $obj->user_name : 'anonymous', $obj->email_address ? $obj->email_address : $member_config->webmaster_email);
167 167
 
168
-				$target_mail = explode(',',$this->module_info->admin_mail);
169
-				for($i=0;$i<count($target_mail);$i++)
168
+				$target_mail = explode(',', $this->module_info->admin_mail);
169
+				for ($i = 0; $i < count($target_mail); $i++)
170 170
 				{
171 171
 					$email_address = trim($target_mail[$i]);
172
-					if(!$email_address) continue;
172
+					if (!$email_address) continue;
173 173
 					$oMail->setReceiptor($email_address, $email_address);
174 174
 					$oMail->send();
175 175
 				}
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 		}
178 178
 
179 179
 		// if there is an error
180
-		if(!$output->toBool())
180
+		if (!$output->toBool())
181 181
 		{
182 182
 			return $output;
183 183
 		}
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 		$this->add('document_srl', $output->get('document_srl'));
188 188
 
189 189
 		// alert a message
190
-		if(Context::get('xeVirtualRequestMethod') !== 'xml')
190
+		if (Context::get('xeVirtualRequestMethod') !== 'xml')
191 191
 		{
192 192
 			$this->setMessage($msg_code);
193 193
 		}
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 		$document_srl = Context::get('document_srl');
203 203
 
204 204
 		// if the document is not existed
205
-		if(!$document_srl)
205
+		if (!$document_srl)
206 206
 		{
207 207
 			return $this->doError('msg_invalid_document');
208 208
 		}
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 		$oDocumentModel = &getModel('document');
211 211
 		$oDocument = $oDocumentModel->getDocument($document_srl);
212 212
 		// check protect content
213
-		if($this->module_info->protect_content=="Y" && $oDocument->get('comment_count')>0 && $this->grant->manager==false)
213
+		if ($this->module_info->protect_content == "Y" && $oDocument->get('comment_count') > 0 && $this->grant->manager == false)
214 214
 		{
215 215
 			return new BaseObject(-1, 'msg_protect_content');
216 216
 		}
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 
221 221
 		// delete the document
222 222
 		$output = $oDocumentController->deleteDocument($document_srl, $this->grant->manager);
223
-		if(!$output->toBool())
223
+		if (!$output->toBool())
224 224
 		{
225 225
 			return $output;
226 226
 		}
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 		$this->setRedirectUrl(getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', '', 'page', Context::get('page'), 'document_srl', ''));
230 230
 		$this->add('mid', Context::get('mid'));
231 231
 		$this->add('page', Context::get('page'));
232
-		if(Context::get('xeVirtualRequestMethod') !== 'xml')
232
+		if (Context::get('xeVirtualRequestMethod') !== 'xml')
233 233
 		{
234 234
 			$this->setMessage('success_deleted');
235 235
 		}
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 	function procBoardInsertComment()
254 254
 	{
255 255
 		// check grant
256
-		if(!$this->grant->write_comment)
256
+		if (!$this->grant->write_comment)
257 257
 		{
258 258
 			return new BaseObject(-1, 'msg_not_permitted');
259 259
 		}
@@ -263,13 +263,13 @@  discard block
 block discarded – undo
263 263
 		$obj = Context::getRequestVars();
264 264
 		$obj->module_srl = $this->module_srl;
265 265
 
266
-		if(!$this->module_info->use_status) $this->module_info->use_status = 'PUBLIC';
267
-		if(!is_array($this->module_info->use_status))
266
+		if (!$this->module_info->use_status) $this->module_info->use_status = 'PUBLIC';
267
+		if (!is_array($this->module_info->use_status))
268 268
 		{
269 269
 			$this->module_info->use_status = explode('|@|', $this->module_info->use_status);
270 270
 		}
271 271
 
272
-		if(in_array('SECRET', $this->module_info->use_status))
272
+		if (in_array('SECRET', $this->module_info->use_status))
273 273
 		{
274 274
 			$this->module_info->secret = 'Y';
275 275
 		}
@@ -281,31 +281,31 @@  discard block
 block discarded – undo
281 281
 
282 282
 		$oModuleModel = getModel('module');
283 283
 		$module_config = $oModuleModel->getModuleInfoByModuleSrl($obj->module_srl);
284
-		if($module_config->mobile_use_editor === 'Y')
284
+		if ($module_config->mobile_use_editor === 'Y')
285 285
 		{
286
-			if(!isset($obj->use_editor)) $obj->use_editor = 'Y';
287
-			if(!isset($obj->use_html)) $obj->use_html = 'Y';
286
+			if (!isset($obj->use_editor)) $obj->use_editor = 'Y';
287
+			if (!isset($obj->use_html)) $obj->use_html = 'Y';
288 288
 		}
289 289
 		else
290 290
 		{
291
-			if(!isset($obj->use_editor)) $obj->use_editor = 'N';
292
-			if(!isset($obj->use_html)) $obj->use_html = 'N';
291
+			if (!isset($obj->use_editor)) $obj->use_editor = 'N';
292
+			if (!isset($obj->use_html)) $obj->use_html = 'N';
293 293
 		}
294 294
 
295 295
 		// check if the doument is existed
296 296
 		$oDocumentModel = getModel('document');
297 297
 		$oDocument = $oDocumentModel->getDocument($obj->document_srl);
298
-		if(!$oDocument->isExists())
298
+		if (!$oDocument->isExists())
299 299
 		{
300
-			return new BaseObject(-1,'msg_not_founded');
300
+			return new BaseObject(-1, 'msg_not_founded');
301 301
 		}
302 302
 
303 303
 		// For anonymous use, remove writer's information and notifying information
304
-		if($this->module_info->use_anonymous == 'Y')
304
+		if ($this->module_info->use_anonymous == 'Y')
305 305
 		{
306 306
 			$this->module_info->admin_mail = '';
307 307
 			$obj->notify_message = 'N';
308
-			$obj->member_srl = -1*$logged_info->member_srl;
308
+			$obj->member_srl = -1 * $logged_info->member_srl;
309 309
 			$obj->email_address = $obj->homepage = $obj->user_id = '';
310 310
 			$obj->user_name = $obj->nick_name = 'anonymous';
311 311
 			$bAnonymous = true;
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
 
324 324
 		// check the comment is existed
325 325
 		// if the comment is not existed, then generate a new sequence
326
-		if(!$obj->comment_srl)
326
+		if (!$obj->comment_srl)
327 327
 		{
328 328
 			$obj->comment_srl = getNextSequence();
329 329
 		} else {
@@ -331,14 +331,14 @@  discard block
 block discarded – undo
331 331
 		}
332 332
 
333 333
 		// if comment_srl is not existed, then insert the comment
334
-		if($comment->comment_srl != $obj->comment_srl)
334
+		if ($comment->comment_srl != $obj->comment_srl)
335 335
 		{
336 336
 
337 337
 			// parent_srl is existed
338
-			if($obj->parent_srl)
338
+			if ($obj->parent_srl)
339 339
 			{
340 340
 				$parent_comment = $oCommentModel->getComment($obj->parent_srl);
341
-				if(!$parent_comment->comment_srl)
341
+				if (!$parent_comment->comment_srl)
342 342
 				{
343 343
 					return new BaseObject(-1, 'msg_invalid_request');
344 344
 				}
@@ -352,9 +352,9 @@  discard block
 block discarded – undo
352 352
 		// update the comment if it is not existed
353 353
 		} else {
354 354
 			// check the grant
355
-			if(!$comment->isGranted())
355
+			if (!$comment->isGranted())
356 356
 			{
357
-				return new BaseObject(-1,'msg_not_permitted');
357
+				return new BaseObject(-1, 'msg_not_permitted');
358 358
 			}
359 359
 
360 360
 			$obj->parent_srl = $comment->parent_srl;
@@ -362,12 +362,12 @@  discard block
 block discarded – undo
362 362
 			$comment_srl = $obj->comment_srl;
363 363
 		}
364 364
 
365
-		if(!$output->toBool())
365
+		if (!$output->toBool())
366 366
 		{
367 367
 			return $output;
368 368
 		}
369 369
 
370
-		if(Context::get('xeVirtualRequestMethod') !== 'xml')
370
+		if (Context::get('xeVirtualRequestMethod') !== 'xml')
371 371
 		{
372 372
 			$this->setMessage('success_registed');
373 373
 		}
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
 	{
384 384
 		// get the comment_srl
385 385
 		$comment_srl = Context::get('comment_srl');
386
-		if(!$comment_srl)
386
+		if (!$comment_srl)
387 387
 		{
388 388
 			return $this->doError('msg_invalid_request');
389 389
 		}
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
 		$oCommentController = getController('comment');
393 393
 
394 394
 		$output = $oCommentController->deleteComment($comment_srl, $this->grant->manager);
395
-		if(!$output->toBool())
395
+		if (!$output->toBool())
396 396
 		{
397 397
 			return $output;
398 398
 		}
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
 		$this->add('mid', Context::get('mid'));
401 401
 		$this->add('page', Context::get('page'));
402 402
 		$this->add('document_srl', $output->get('document_srl'));
403
-		if(Context::get('xeVirtualRequestMethod') !== 'xml')
403
+		if (Context::get('xeVirtualRequestMethod') !== 'xml')
404 404
 		{
405 405
 			$this->setMessage('success_deleted');
406 406
 		}
@@ -416,10 +416,10 @@  discard block
 block discarded – undo
416 416
 		// generate trackback module controller object
417 417
 		$oTrackbackController = getController('trackback');
418 418
 
419
-		if(!$oTrackbackController) return;
419
+		if (!$oTrackbackController) return;
420 420
 
421 421
 		$output = $oTrackbackController->deleteTrackback($trackback_srl, $this->grant->manager);
422
-		if(!$output->toBool())
422
+		if (!$output->toBool())
423 423
 		{
424 424
 			return $output;
425 425
 		}
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
 		$this->add('mid', Context::get('mid'));
428 428
 		$this->add('page', Context::get('page'));
429 429
 		$this->add('document_srl', $output->get('document_srl'));
430
-		if(Context::get('xeVirtualRequestMethod') !== 'xml')
430
+		if (Context::get('xeVirtualRequestMethod') !== 'xml')
431 431
 		{
432 432
 			$this->setMessage('success_deleted');
433 433
 		}
@@ -446,18 +446,18 @@  discard block
 block discarded – undo
446 446
 		$oMemberModel = getModel('member');
447 447
 
448 448
 		// if the comment exists
449
-		if($comment_srl)
449
+		if ($comment_srl)
450 450
 		{
451 451
 			// get the comment information
452 452
 			$oCommentModel = getModel('comment');
453 453
 			$oComment = $oCommentModel->getComment($comment_srl);
454
-			if(!$oComment->isExists())
454
+			if (!$oComment->isExists())
455 455
 			{
456 456
 				return new BaseObject(-1, 'msg_invalid_request');
457 457
 			}
458 458
 
459 459
 			// compare the comment password and the user input password
460
-			if(!$oMemberModel->isValidPassword($oComment->get('password'),$password))
460
+			if (!$oMemberModel->isValidPassword($oComment->get('password'), $password))
461 461
 			{
462 462
 				return new BaseObject(-1, 'msg_invalid_password');
463 463
 			}
@@ -467,13 +467,13 @@  discard block
 block discarded – undo
467 467
 			 // get the document information
468 468
 			$oDocumentModel = getModel('document');
469 469
 			$oDocument = $oDocumentModel->getDocument($document_srl);
470
-			if(!$oDocument->isExists())
470
+			if (!$oDocument->isExists())
471 471
 			{
472 472
 				return new BaseObject(-1, 'msg_invalid_request');
473 473
 			}
474 474
 
475 475
 			// compare the document password and the user input password
476
-			if(!$oMemberModel->isValidPassword($oDocument->get('password'),$password))
476
+			if (!$oMemberModel->isValidPassword($oDocument->get('password'), $password))
477 477
 			{
478 478
 				return new BaseObject(-1, 'msg_invalid_password');
479 479
 			}
@@ -490,7 +490,7 @@  discard block
 block discarded – undo
490 490
 		$member_srl = Context::get('target_srl');
491 491
 		$mid = Context::get('cur_mid');
492 492
 
493
-		if(!$member_srl || !$mid)
493
+		if (!$member_srl || !$mid)
494 494
 		{
495 495
 			return new BaseObject();
496 496
 		}
@@ -502,13 +502,13 @@  discard block
 block discarded – undo
502 502
 		$columnList = array('module');
503 503
 		$cur_module_info = $oModuleModel->getModuleInfoByMid($mid, 0, $columnList);
504 504
 
505
-		if($cur_module_info->module != 'board')
505
+		if ($cur_module_info->module != 'board')
506 506
 		{
507 507
 			return new BaseObject();
508 508
 		}
509 509
 
510 510
 		// get the member information
511
-		if($member_srl == $logged_info->member_srl)
511
+		if ($member_srl == $logged_info->member_srl)
512 512
 		{
513 513
 			$member_info = $logged_info;
514 514
 		} else {
@@ -516,13 +516,13 @@  discard block
 block discarded – undo
516 516
 			$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl);
517 517
 		}
518 518
 
519
-		if(!$member_info->user_id)
519
+		if (!$member_info->user_id)
520 520
 		{
521 521
 			return new BaseObject();
522 522
 		}
523 523
 
524 524
 		//search
525
-		$url = getUrl('','mid',$mid,'search_target','nick_name','search_keyword',$member_info->nick_name);
525
+		$url = getUrl('', 'mid', $mid, 'search_target', 'nick_name', 'search_keyword', $member_info->nick_name);
526 526
 		$oMemberController = getController('member');
527 527
 		$oMemberController->addMemberPopupMenu($url, 'cmd_view_own_document', '');
528 528
 
Please login to merge, or discard this patch.
modules/admin/admin.admin.model.php 4 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -956,10 +956,10 @@
 block discarded – undo
956 956
 
957 957
 		$file_exsit = FileHandler::readFile(_XE_PATH_ . 'files/attach/xeicon/' . $virtual_site . $iconname);
958 958
 		if(!$file_exsit && $default === true)
959
-        {
960
-            $icon_url = './modules/admin/tpl/img/' . $default_icon_name;
961
-        }
962
-        elseif($file_exsit)
959
+		{
960
+			$icon_url = './modules/admin/tpl/img/' . $default_icon_name;
961
+		}
962
+		elseif($file_exsit)
963 963
 		{
964 964
 			$default_url = Context::getDefaultUrl();
965 965
 			if($default_url && substr_compare($default_url, '/', -1) === 0) $default_url = substr($default_url, 0, -1);
Please login to merge, or discard this patch.
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -867,6 +867,7 @@  discard block
 block discarded – undo
867 867
 	 * Returns a list of all sites that contain modules
868 868
 	 * For each site domain and site_srl are retrieved
869 869
 	 *
870
+	 * @param string $domain
870 871
 	 * @return array
871 872
 	 */
872 873
 	function getAllSitesThatHaveModules($domain = NULL)
@@ -945,6 +946,11 @@  discard block
 block discarded – undo
945 946
 		return $this->iconUrlCheck('mobicon.png', 'mobiconSample.png', $default);
946 947
 	}
947 948
 
949
+	/**
950
+	 * @param string $iconname
951
+	 * @param string $default_icon_name
952
+	 * @param boolean $default
953
+	 */
948 954
 	function iconUrlCheck($iconname, $default_icon_name, $default)
949 955
 	{
950 956
 		$site_info = Context::get('site_module_info');
Please login to merge, or discard this patch.
Spacing   +141 added lines, -141 removed lines patch added patch discarded remove patch
@@ -30,18 +30,18 @@  discard block
 block discarded – undo
30 30
 	{
31 31
 		$ftp_info = Context::getRequestVars();
32 32
 
33
-		if(!$ftp_info->ftp_host)
33
+		if (!$ftp_info->ftp_host)
34 34
 		{
35 35
 			$ftp_info->ftp_host = "127.0.0.1";
36 36
 		}
37 37
 
38
-		if(!$ftp_info->ftp_port || !is_numeric($ftp_info->ftp_port))
38
+		if (!$ftp_info->ftp_port || !is_numeric($ftp_info->ftp_port))
39 39
 		{
40 40
 			$ftp_info->ftp_port = '22';
41 41
 		}
42 42
 
43 43
 		$connection = ssh2_connect($ftp_info->ftp_host, $ftp_info->ftp_port);
44
-		if(!ssh2_auth_password($connection, $ftp_info->ftp_user, $ftp_info->ftp_password))
44
+		if (!ssh2_auth_password($connection, $ftp_info->ftp_user, $ftp_info->ftp_password))
45 45
 		{
46 46
 			return new BaseObject(-1, 'msg_ftp_invalid_auth_info');
47 47
 		}
@@ -58,29 +58,29 @@  discard block
 block discarded – undo
58 58
 		$path_candidate = array();
59 59
 
60 60
 		$temp = '';
61
-		foreach($path_info as $path)
61
+		foreach ($path_info as $path)
62 62
 		{
63
-			$temp = '/' . $path . $temp;
63
+			$temp = '/'.$path.$temp;
64 64
 			$path_candidate[] = $temp;
65 65
 		}
66 66
 
67 67
 		// try
68
-		foreach($path_candidate as $path)
68
+		foreach ($path_candidate as $path)
69 69
 		{
70 70
 			// upload check file
71
-			if(!@ssh2_scp_send($connection, FileHandler::getRealPath('./files/cache/ftp_check'), $path . 'ftp_check.html'))
71
+			if (!@ssh2_scp_send($connection, FileHandler::getRealPath('./files/cache/ftp_check'), $path.'ftp_check.html'))
72 72
 			{
73 73
 				continue;
74 74
 			}
75 75
 
76 76
 			// get check file
77
-			$result = FileHandler::getRemoteResource(getNotencodedFullUrl() . 'ftp_check.html');
77
+			$result = FileHandler::getRemoteResource(getNotencodedFullUrl().'ftp_check.html');
78 78
 
79 79
 			// delete temp check file
80
-			@ssh2_sftp_unlink($sftp, $path . 'ftp_check.html');
80
+			@ssh2_sftp_unlink($sftp, $path.'ftp_check.html');
81 81
 
82 82
 			// found
83
-			if($result == $pin)
83
+			if ($result == $pin)
84 84
 			{
85 85
 				$found_path = $path;
86 86
 				break;
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 
90 90
 		FileHandler::removeFile('./files/cache/ftp_check', $pin);
91 91
 
92
-		if($found_path)
92
+		if ($found_path)
93 93
 		{
94 94
 			$this->add('found_path', $found_path);
95 95
 		}
@@ -99,24 +99,24 @@  discard block
 block discarded – undo
99 99
 	{
100 100
 		$ftp_info = Context::getRequestVars();
101 101
 
102
-		if(!$ftp_info->ftp_host)
102
+		if (!$ftp_info->ftp_host)
103 103
 		{
104 104
 			$ftp_info->ftp_host = "127.0.0.1";
105 105
 		}
106 106
 
107
-		if(!$ftp_info->ftp_port || !is_numeric($ftp_info->ftp_port))
107
+		if (!$ftp_info->ftp_port || !is_numeric($ftp_info->ftp_port))
108 108
 		{
109 109
 			$ftp_info->ftp_port = '22';
110 110
 		}
111 111
 
112 112
 		$connection = ftp_connect($ftp_info->ftp_host, $ftp_info->ftp_port);
113
-		if(!$connection)
113
+		if (!$connection)
114 114
 		{
115 115
 			return new BaseObject(-1, sprintf(Context::getLang('msg_ftp_not_connected'), 'host'));
116 116
 		}
117 117
 
118 118
 		$login_result = @ftp_login($connection, $ftp_info->ftp_user, $ftp_info->ftp_password);
119
-		if(!$login_result)
119
+		if (!$login_result)
120 120
 		{
121 121
 			ftp_close($connection);
122 122
 			return new BaseObject(-1, 'msg_ftp_invalid_auth_info');
@@ -133,29 +133,29 @@  discard block
 block discarded – undo
133 133
 		$path_candidate = array();
134 134
 
135 135
 		$temp = '';
136
-		foreach($path_info as $path)
136
+		foreach ($path_info as $path)
137 137
 		{
138
-			$temp = '/' . $path . $temp;
138
+			$temp = '/'.$path.$temp;
139 139
 			$path_candidate[] = $temp;
140 140
 		}
141 141
 
142 142
 		// try
143
-		foreach($path_candidate as $path)
143
+		foreach ($path_candidate as $path)
144 144
 		{
145 145
 			// upload check file
146
-			if(!ftp_put($connection, $path . 'ftp_check.html', FileHandler::getRealPath('./files/cache/ftp_check'), FTP_BINARY))
146
+			if (!ftp_put($connection, $path.'ftp_check.html', FileHandler::getRealPath('./files/cache/ftp_check'), FTP_BINARY))
147 147
 			{
148 148
 				continue;
149 149
 			}
150 150
 
151 151
 			// get check file
152
-			$result = FileHandler::getRemoteResource(getNotencodedFullUrl() . 'ftp_check.html');
152
+			$result = FileHandler::getRemoteResource(getNotencodedFullUrl().'ftp_check.html');
153 153
 
154 154
 			// delete temp check file
155
-			ftp_delete($connection, $path . 'ftp_check.html');
155
+			ftp_delete($connection, $path.'ftp_check.html');
156 156
 
157 157
 			// found
158
-			if($result == $pin)
158
+			if ($result == $pin)
159 159
 			{
160 160
 				$found_path = $path;
161 161
 				break;
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 
165 165
 		FileHandler::removeFile('./files/cache/ftp_check', $pin);
166 166
 
167
-		if($found_path)
167
+		if ($found_path)
168 168
 		{
169 169
 			$this->add('found_path', $found_path);
170 170
 		}
@@ -175,39 +175,39 @@  discard block
 block discarded – undo
175 175
 	 */
176 176
 	function getAdminFTPPath()
177 177
 	{
178
-		Context::loadLang(_XE_PATH_ . 'modules/autoinstall/lang');
178
+		Context::loadLang(_XE_PATH_.'modules/autoinstall/lang');
179 179
 		@set_time_limit(5);
180
-		require_once(_XE_PATH_ . 'libs/ftp.class.php');
180
+		require_once(_XE_PATH_.'libs/ftp.class.php');
181 181
 
182 182
 		$ftp_info = Context::getRequestVars();
183 183
 
184
-		if(!$ftp_info->ftp_user || !$ftp_info->ftp_password)
184
+		if (!$ftp_info->ftp_user || !$ftp_info->ftp_password)
185 185
 		{
186 186
 			return new BaseObject(1, 'msg_ftp_invalid_auth_info');
187 187
 		}
188 188
 
189
-		if(!$ftp_info->ftp_host)
189
+		if (!$ftp_info->ftp_host)
190 190
 		{
191 191
 			$ftp_info->ftp_host = '127.0.0.1';
192 192
 		}
193 193
 
194
-		if(!$ftp_info->ftp_port || !is_numeric($ftp_info->ftp_port))
194
+		if (!$ftp_info->ftp_port || !is_numeric($ftp_info->ftp_port))
195 195
 		{
196 196
 			$ftp_info->ftp_port = '21';
197 197
 		}
198 198
 
199
-		if($ftp_info->sftp == 'Y')
199
+		if ($ftp_info->sftp == 'Y')
200 200
 		{
201
-			if(!function_exists('ssh2_sftp'))
201
+			if (!function_exists('ssh2_sftp'))
202 202
 			{
203 203
 				return new BaseObject(-1, 'disable_sftp_support');
204 204
 			}
205 205
 			return $this->getSFTPPath();
206 206
 		}
207 207
 
208
-		if($ftp_info->ftp_pasv == 'N')
208
+		if ($ftp_info->ftp_pasv == 'N')
209 209
 		{
210
-			if(function_exists('ftp_connect'))
210
+			if (function_exists('ftp_connect'))
211 211
 			{
212 212
 				return $this->getFTPPath();
213 213
 			}
@@ -215,12 +215,12 @@  discard block
 block discarded – undo
215 215
 		}
216 216
 
217 217
 		$oFTP = new ftp();
218
-		if(!$oFTP->ftp_connect($ftp_info->ftp_host, $ftp_info->ftp_port))
218
+		if (!$oFTP->ftp_connect($ftp_info->ftp_host, $ftp_info->ftp_port))
219 219
 		{
220 220
 			return new BaseObject(1, sprintf(Context::getLang('msg_ftp_not_connected'), 'host'));
221 221
 		}
222 222
 
223
-		if(!$oFTP->ftp_login($ftp_info->ftp_user, $ftp_info->ftp_password))
223
+		if (!$oFTP->ftp_login($ftp_info->ftp_user, $ftp_info->ftp_password))
224 224
 		{
225 225
 			return new BaseObject(1, 'msg_ftp_invalid_auth_info');
226 226
 		}
@@ -236,29 +236,29 @@  discard block
 block discarded – undo
236 236
 		$path_candidate = array();
237 237
 
238 238
 		$temp = '';
239
-		foreach($path_info as $path)
239
+		foreach ($path_info as $path)
240 240
 		{
241
-			$temp = '/' . $path . $temp;
241
+			$temp = '/'.$path.$temp;
242 242
 			$path_candidate[] = $temp;
243 243
 		}
244 244
 
245 245
 		// try
246
-		foreach($path_candidate as $path)
246
+		foreach ($path_candidate as $path)
247 247
 		{
248 248
 			// upload check file
249
-			if(!$oFTP->ftp_put($path . 'ftp_check.html', FileHandler::getRealPath('./files/cache/ftp_check')))
249
+			if (!$oFTP->ftp_put($path.'ftp_check.html', FileHandler::getRealPath('./files/cache/ftp_check')))
250 250
 			{
251 251
 				continue;
252 252
 			}
253 253
 
254 254
 			// get check file
255
-			$result = FileHandler::getRemoteResource(getNotencodedFullUrl() . 'ftp_check.html');
255
+			$result = FileHandler::getRemoteResource(getNotencodedFullUrl().'ftp_check.html');
256 256
 
257 257
 			// delete temp check file
258
-			$oFTP->ftp_delete($path . 'ftp_check.html');
258
+			$oFTP->ftp_delete($path.'ftp_check.html');
259 259
 
260 260
 			// found
261
-			if($result == $pin)
261
+			if ($result == $pin)
262 262
 			{
263 263
 				$found_path = $path;
264 264
 				break;
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
 
268 268
 		FileHandler::removeFile('./files/cache/ftp_check', $pin);
269 269
 
270
-		if($found_path)
270
+		if ($found_path)
271 271
 		{
272 272
 			$this->add('found_path', $found_path);
273 273
 		}
@@ -280,27 +280,27 @@  discard block
 block discarded – undo
280 280
 	function getSFTPList()
281 281
 	{
282 282
 		$ftp_info = Context::getRequestVars();
283
-		if(!$ftp_info->ftp_host)
283
+		if (!$ftp_info->ftp_host)
284 284
 		{
285 285
 			$ftp_info->ftp_host = "127.0.0.1";
286 286
 		}
287 287
 		$connection = ssh2_connect($ftp_info->ftp_host, $ftp_info->ftp_port);
288
-		if(!ssh2_auth_password($connection, $ftp_info->ftp_user, $ftp_info->ftp_password))
288
+		if (!ssh2_auth_password($connection, $ftp_info->ftp_user, $ftp_info->ftp_password))
289 289
 		{
290 290
 			return new BaseObject(-1, 'msg_ftp_invalid_auth_info');
291 291
 		}
292 292
 
293 293
 		$sftp = ssh2_sftp($connection);
294
-		$curpwd = "ssh2.sftp://$sftp" . $this->pwd;
294
+		$curpwd = "ssh2.sftp://$sftp".$this->pwd;
295 295
 		$dh = @opendir($curpwd);
296
-		if(!$dh)
296
+		if (!$dh)
297 297
 		{
298 298
 			return new BaseObject(-1, 'msg_ftp_invalid_path');
299 299
 		}
300 300
 		$list = array();
301
-		while(($file = readdir($dh)) !== FALSE)
301
+		while (($file = readdir($dh)) !== FALSE)
302 302
 		{
303
-			if(is_dir($curpwd . $file))
303
+			if (is_dir($curpwd.$file))
304 304
 			{
305 305
 				$file .= "/";
306 306
 			}
@@ -320,32 +320,32 @@  discard block
 block discarded – undo
320 320
 	 */
321 321
 	function getAdminFTPList()
322 322
 	{
323
-		Context::loadLang(_XE_PATH_ . 'modules/autoinstall/lang');
323
+		Context::loadLang(_XE_PATH_.'modules/autoinstall/lang');
324 324
 		@set_time_limit(5);
325 325
 
326
-		require_once(_XE_PATH_ . 'libs/ftp.class.php');
326
+		require_once(_XE_PATH_.'libs/ftp.class.php');
327 327
 
328 328
 		$ftp_info = Context::getRequestVars();
329
-		if(!$ftp_info->ftp_user || !$ftp_info->ftp_password)
329
+		if (!$ftp_info->ftp_user || !$ftp_info->ftp_password)
330 330
 		{
331 331
 			return new BaseObject(-1, 'msg_ftp_invalid_auth_info');
332 332
 		}
333 333
 
334 334
 		$this->pwd = $ftp_info->ftp_root_path;
335 335
 
336
-		if(!$ftp_info->ftp_host)
336
+		if (!$ftp_info->ftp_host)
337 337
 		{
338 338
 			$ftp_info->ftp_host = "127.0.0.1";
339 339
 		}
340 340
 
341
-		if(!$ftp_info->ftp_port || !is_numeric($ftp_info->ftp_port))
341
+		if (!$ftp_info->ftp_port || !is_numeric($ftp_info->ftp_port))
342 342
 		{
343 343
 			$ftp_info->ftp_port = "21";
344 344
 		}
345 345
 
346
-		if($ftp_info->sftp == 'Y')
346
+		if ($ftp_info->sftp == 'Y')
347 347
 		{
348
-			if(!function_exists('ssh2_sftp'))
348
+			if (!function_exists('ssh2_sftp'))
349 349
 			{
350 350
 				return new BaseObject(-1, 'disable_sftp_support');
351 351
 			}
@@ -353,9 +353,9 @@  discard block
 block discarded – undo
353 353
 		}
354 354
 
355 355
 		$oFtp = new ftp();
356
-		if($oFtp->ftp_connect($ftp_info->ftp_host, $ftp_info->ftp_port))
356
+		if ($oFtp->ftp_connect($ftp_info->ftp_host, $ftp_info->ftp_port))
357 357
 		{
358
-			if($oFtp->ftp_login($ftp_info->ftp_user, $ftp_info->ftp_password))
358
+			if ($oFtp->ftp_login($ftp_info->ftp_user, $ftp_info->ftp_password))
359 359
 			{
360 360
 				$_list = $oFtp->ftp_rawlist($this->pwd);
361 361
 				$oFtp->ftp_quit();
@@ -367,17 +367,17 @@  discard block
 block discarded – undo
367 367
 		}
368 368
 		$list = array();
369 369
 
370
-		if($_list)
370
+		if ($_list)
371 371
 		{
372
-			foreach($_list as $k => $v)
372
+			foreach ($_list as $k => $v)
373 373
 			{
374 374
 				$src = new stdClass();
375 375
 				$src->data = $v;
376 376
 				$res = Context::convertEncoding($src);
377 377
 				$v = $res->data;
378
-				if(strpos($v, 'd') === 0 || strpos($v, '<DIR>'))
378
+				if (strpos($v, 'd') === 0 || strpos($v, '<DIR>'))
379 379
 				{
380
-					$list[] = substr(strrchr($v, ' '), 1) . '/';
380
+					$list[] = substr(strrchr($v, ' '), 1).'/';
381 381
 				}
382 382
 			}
383 383
 		}
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
 			, 'module' => array('addon', 'admin', 'autoinstall', 'comment', 'communication', 'counter', 'document', 'editor', 'file', 'importer', 'install', 'integration_search', 'layout', 'member', 'menu', 'message', 'module', 'opage', 'page', 'point', 'poll', 'rss', 'session', 'spamfilter', 'tag', 'trackback', 'trash', 'widget')
401 401
 			, 'addon' => array('autolink', 'blogapi', 'captcha', 'counter', 'member_communication', 'member_extra_info', 'mobile', 'openid_delegation_id', 'point_level_icon', 'resize_image')
402 402
 			, 'layout' => array('default')
403
-			, 'widget' => array('content', 'language_select', 'login_info','mcontent')
403
+			, 'widget' => array('content', 'language_select', 'login_info', 'mcontent')
404 404
 			, 'widgetstyle' => array(),
405 405
 		);
406 406
 		$info = array();
@@ -420,86 +420,86 @@  discard block
 block discarded – undo
420 420
 		$info['use_ssl'] = $db_info->use_ssl;
421 421
 		
422 422
 		$info['phpext'] = '';
423
-		foreach(get_loaded_extensions() as $ext)
423
+		foreach (get_loaded_extensions() as $ext)
424 424
 		{
425 425
 			$ext = strtolower($ext);
426
-			if(in_array($ext, $skip['ext']))
426
+			if (in_array($ext, $skip['ext']))
427 427
 			{
428 428
 				continue;
429 429
 			}
430
-			$info['phpext'] .= '|' . $ext;
430
+			$info['phpext'] .= '|'.$ext;
431 431
 		}
432 432
 		$info['phpext'] = substr($info['phpext'], 1);
433 433
 
434 434
 		$info['module'] = '';
435 435
 		$oModuleModel = getModel('module');
436 436
 		$module_list = $oModuleModel->getModuleList();
437
-		if($module_list) foreach($module_list as $module)
437
+		if ($module_list) foreach ($module_list as $module)
438 438
 		{
439
-			if(in_array($module->module, $skip['module']))
439
+			if (in_array($module->module, $skip['module']))
440 440
 			{
441 441
 				continue;
442 442
 			}
443
-			$info['module'] .= '|' . $module->module;
443
+			$info['module'] .= '|'.$module->module;
444 444
 		}
445 445
 		$info['module'] = substr($info['module'], 1);
446 446
 
447 447
 		$info['addon'] = '';
448 448
 		$oAddonAdminModel = getAdminModel('addon');
449 449
 		$addon_list = $oAddonAdminModel->getAddonList();
450
-		if($addon_list) foreach($addon_list as $addon)
450
+		if ($addon_list) foreach ($addon_list as $addon)
451 451
 		{
452
-			if(in_array($addon->addon, $skip['addon']))
452
+			if (in_array($addon->addon, $skip['addon']))
453 453
 			{
454 454
 				continue;
455 455
 			}
456
-			$info['addon'] .= '|' . $addon->addon;
456
+			$info['addon'] .= '|'.$addon->addon;
457 457
 		}
458 458
 		$info['addon'] = substr($info['addon'], 1);
459 459
 
460 460
 		$info['layout'] = "";
461 461
 		$oLayoutModel = getModel('layout');
462 462
 		$layout_list = $oLayoutModel->getDownloadedLayoutList();
463
-		if($layout_list) foreach($layout_list as $layout)
463
+		if ($layout_list) foreach ($layout_list as $layout)
464 464
 		{
465
-			if(in_array($layout->layout, $skip['layout']))
465
+			if (in_array($layout->layout, $skip['layout']))
466 466
 			{
467 467
 				continue;
468 468
 			}
469
-			$info['layout'] .= '|' . $layout->layout;
469
+			$info['layout'] .= '|'.$layout->layout;
470 470
 		}
471 471
 		$info['layout'] = substr($info['layout'], 1);
472 472
 
473 473
 		$info['widget'] = "";
474 474
 		$oWidgetModel = getModel('widget');
475 475
 		$widget_list = $oWidgetModel->getDownloadedWidgetList();
476
-		if($widget_list) foreach($widget_list as $widget)
476
+		if ($widget_list) foreach ($widget_list as $widget)
477 477
 		{
478
-			if(in_array($widget->widget, $skip['widget']))
478
+			if (in_array($widget->widget, $skip['widget']))
479 479
 			{
480 480
 				continue;
481 481
 			}
482
-			$info['widget'] .= '|' . $widget->widget;
482
+			$info['widget'] .= '|'.$widget->widget;
483 483
 		}
484 484
 		$info['widget'] = substr($info['widget'], 1);
485 485
 
486 486
 		$info['widgetstyle'] = "";
487 487
 		$oWidgetModel = getModel('widget');
488 488
 		$widgetstyle_list = $oWidgetModel->getDownloadedWidgetStyleList();
489
-		if($widgetstyle_list) foreach($widgetstyle_list as $widgetstyle)
489
+		if ($widgetstyle_list) foreach ($widgetstyle_list as $widgetstyle)
490 490
 		{
491
-			if(in_array($widgetstyle->widgetStyle, $skip['widgetstyle']))
491
+			if (in_array($widgetstyle->widgetStyle, $skip['widgetstyle']))
492 492
 			{
493 493
 				continue;
494 494
 			}
495
-			$info['widgetstyle'] .= '|' . $widgetstyle->widgetStyle;
495
+			$info['widgetstyle'] .= '|'.$widgetstyle->widgetStyle;
496 496
 		}
497 497
 		$info['widgetstyle'] = substr($info['widgetstyle'], 1);
498 498
 
499 499
 		$param = '';
500
-		foreach($info as $k => $v)
500
+		foreach ($info as $k => $v)
501 501
 		{
502
-			if($v)
502
+			if ($v)
503 503
 			{
504 504
 				$param .= sprintf('&%s=%s', $k, urlencode($v));
505 505
 			}
@@ -515,13 +515,13 @@  discard block
 block discarded – undo
515 515
 	 */
516 516
 	function getThemeList()
517 517
 	{
518
-		$path = _XE_PATH_ . 'themes';
518
+		$path = _XE_PATH_.'themes';
519 519
 		$list = FileHandler::readDir($path);
520 520
 
521 521
 		$theme_info = array();
522
-		if(count($list) > 0)
522
+		if (count($list) > 0)
523 523
 		{
524
-			foreach($list as $val)
524
+			foreach ($list as $val)
525 525
 			{
526 526
 				$theme_info[$val] = $this->getThemeInfo($val);
527 527
 			}
@@ -538,20 +538,20 @@  discard block
 block discarded – undo
538 538
 	 */
539 539
 	function getThemeInfo($theme_name, $layout_list = NULL)
540 540
 	{
541
-		if($GLOBALS['__ThemeInfo__'][$theme_name])
541
+		if ($GLOBALS['__ThemeInfo__'][$theme_name])
542 542
 		{
543 543
 			return $GLOBALS['__ThemeInfo__'][$theme_name];
544 544
 		}
545 545
 
546
-		$info_file = _XE_PATH_ . 'themes/' . $theme_name . '/conf/info.xml';
547
-		if(!file_exists($info_file))
546
+		$info_file = _XE_PATH_.'themes/'.$theme_name.'/conf/info.xml';
547
+		if (!file_exists($info_file))
548 548
 		{
549 549
 			return;
550 550
 		}
551 551
 
552 552
 		$oXmlParser = new XmlParser();
553 553
 		$_xml_obj = $oXmlParser->loadXmlFile($info_file);
554
-		if(!$_xml_obj->theme)
554
+		if (!$_xml_obj->theme)
555 555
 		{
556 556
 			return;
557 557
 		}
@@ -562,16 +562,16 @@  discard block
 block discarded – undo
562 562
 		$theme_info = new stdClass();
563 563
 		$theme_info->name = $theme_name;
564 564
 		$theme_info->title = $xml_obj->title->body;
565
-		$thumbnail = './themes/' . $theme_name . '/thumbnail.png';
565
+		$thumbnail = './themes/'.$theme_name.'/thumbnail.png';
566 566
 		$theme_info->thumbnail = (FileHandler::exists($thumbnail)) ? $thumbnail : NULL;
567 567
 		$theme_info->version = $xml_obj->version->body;
568 568
 		$date_obj = new stdClass();
569 569
 		sscanf($xml_obj->date->body, '%d-%d-%d', $date_obj->y, $date_obj->m, $date_obj->d);
570 570
 		$theme_info->date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d);
571 571
 		$theme_info->description = $xml_obj->description->body;
572
-		$theme_info->path = './themes/' . $theme_name . '/';
572
+		$theme_info->path = './themes/'.$theme_name.'/';
573 573
 
574
-		if(!is_array($xml_obj->publisher))
574
+		if (!is_array($xml_obj->publisher))
575 575
 		{
576 576
 			$publisher_list = array();
577 577
 			$publisher_list[] = $xml_obj->publisher;
@@ -582,7 +582,7 @@  discard block
 block discarded – undo
582 582
 		}
583 583
 
584 584
 		$theme_info->publisher = array();
585
-		foreach($publisher_list as $publisher)
585
+		foreach ($publisher_list as $publisher)
586 586
 		{
587 587
 			$publisher_obj = new stdClass();
588 588
 			$publisher_obj->name = $publisher->name->body;
@@ -595,10 +595,10 @@  discard block
 block discarded – undo
595 595
 		$layout_path = $layout->directory->attrs->path;
596 596
 		$layout_parse = explode('/', $layout_path);
597 597
 		$layout_info = new stdClass();
598
-		switch($layout_parse[1])
598
+		switch ($layout_parse[1])
599 599
 		{
600 600
 			case 'themes' :
601
-					$layout_info->name = $theme_name . '|@|' . $layout_parse[count($layout_parse) - 1];
601
+					$layout_info->name = $theme_name.'|@|'.$layout_parse[count($layout_parse) - 1];
602 602
 					break;
603 603
 
604 604
 			case 'layouts' :
@@ -615,11 +615,11 @@  discard block
 block discarded – undo
615 615
 		$oLayoutModel = getModel('layout');
616 616
 		$layout_info_list = array();
617 617
 		$layout_list = $oLayoutModel->getLayoutList($site_info->site_srl);
618
-		if($layout_list)
618
+		if ($layout_list)
619 619
 		{
620
-			foreach($layout_list as $val)
620
+			foreach ($layout_list as $val)
621 621
 			{
622
-				if($val->layout == $layout_info->name)
622
+				if ($val->layout == $layout_info->name)
623 623
 				{
624 624
 					$is_new_layout = FALSE;
625 625
 					$layout_info->layout_srl = $val->layout_srl;
@@ -628,7 +628,7 @@  discard block
 block discarded – undo
628 628
 			}
629 629
 		}
630 630
 
631
-		if($is_new_layout)
631
+		if ($is_new_layout)
632 632
 		{
633 633
 			$site_module_info = Context::get('site_module_info');
634 634
 			$args = new stdClass();
@@ -646,7 +646,7 @@  discard block
 block discarded – undo
646 646
 		$theme_info->layout_info = $layout_info;
647 647
 
648 648
 		$skin_infos = $xml_obj->skininfos;
649
-		if(is_array($skin_infos->skininfo))
649
+		if (is_array($skin_infos->skininfo))
650 650
 		{
651 651
 			$skin_list = $skin_infos->skininfo;
652 652
 		}
@@ -657,17 +657,17 @@  discard block
 block discarded – undo
657 657
 
658 658
 		$oModuleModel = getModel('module');
659 659
 		$skins = array();
660
-		foreach($skin_list as $val)
660
+		foreach ($skin_list as $val)
661 661
 		{
662 662
 			$skin_info = new stdClass();
663 663
 			unset($skin_parse);
664 664
 			$skin_parse = explode('/', $val->directory->attrs->path);
665
-			switch($skin_parse[1])
665
+			switch ($skin_parse[1])
666 666
 			{
667 667
 				case 'themes' :
668 668
 						$is_theme = TRUE;
669 669
 						$module_name = $skin_parse[count($skin_parse) - 1];
670
-						$skin_info->name = $theme_name . '|@|' . $module_name;
670
+						$skin_info->name = $theme_name.'|@|'.$module_name;
671 671
 						break;
672 672
 
673 673
 				case 'modules' :
@@ -681,9 +681,9 @@  discard block
 block discarded – undo
681 681
 			$skin_info->is_theme = $is_theme;
682 682
 			$skins[$module_name] = $skin_info;
683 683
 
684
-			if($is_theme)
684
+			if ($is_theme)
685 685
 			{
686
-				if(!$GLOBALS['__ThemeModuleSkin__'][$module_name])
686
+				if (!$GLOBALS['__ThemeModuleSkin__'][$module_name])
687 687
 				{
688 688
 					$GLOBALS['__ThemeModuleSkin__'][$module_name] = array();
689 689
 					$GLOBALS['__ThemeModuleSkin__'][$module_name]['skins'] = array();
@@ -705,7 +705,7 @@  discard block
 block discarded – undo
705 705
 	 */
706 706
 	function getModulesSkinList()
707 707
 	{
708
-		if($GLOBALS['__ThemeModuleSkin__']['__IS_PARSE__'])
708
+		if ($GLOBALS['__ThemeModuleSkin__']['__IS_PARSE__'])
709 709
 		{
710 710
 			return $GLOBALS['__ThemeModuleSkin__'];
711 711
 		}
@@ -713,7 +713,7 @@  discard block
 block discarded – undo
713 713
 		sort($searched_list);
714 714
 
715 715
 		$searched_count = count($searched_list);
716
-		if(!$searched_count)
716
+		if (!$searched_count)
717 717
 		{
718 718
 			return;
719 719
 		}
@@ -721,13 +721,13 @@  discard block
 block discarded – undo
721 721
 		$exceptionModule = array('editor', 'poll', 'homepage', 'textyle');
722 722
 
723 723
 		$oModuleModel = getModel('module');
724
-		foreach($searched_list as $val)
724
+		foreach ($searched_list as $val)
725 725
 		{
726
-			$skin_list = $oModuleModel->getSkins(_XE_PATH_ . 'modules/' . $val);
726
+			$skin_list = $oModuleModel->getSkins(_XE_PATH_.'modules/'.$val);
727 727
 
728
-			if(is_array($skin_list) && count($skin_list) > 0 && !in_array($val, $exceptionModule))
728
+			if (is_array($skin_list) && count($skin_list) > 0 && !in_array($val, $exceptionModule))
729 729
 			{
730
-				if(!$GLOBALS['__ThemeModuleSkin__'][$val])
730
+				if (!$GLOBALS['__ThemeModuleSkin__'][$val])
731 731
 				{
732 732
 					$GLOBALS['__ThemeModuleSkin__'][$val] = array();
733 733
 					$moduleInfo = $oModuleModel->getModuleInfoXml($val);
@@ -751,23 +751,23 @@  discard block
 block discarded – undo
751 751
 		static $lang = false;
752 752
 
753 753
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
754
-		if($lang === false && $oCacheHandler->isSupport())
754
+		if ($lang === false && $oCacheHandler->isSupport())
755 755
 		{
756
-			$cache_key = 'admin_menu_langs:' . Context::getLangType();
756
+			$cache_key = 'admin_menu_langs:'.Context::getLangType();
757 757
 			$lang = $oCacheHandler->get($cache_key);
758 758
 
759
-			if($lang === false)
759
+			if ($lang === false)
760 760
 			{
761 761
 				$lang = array();
762 762
 				$oModuleModel = getModel('module');
763 763
 				$installed_module_list = $oModuleModel->getModulesXmlInfo();
764 764
 
765
-				foreach($installed_module_list as $key => $value)
765
+				foreach ($installed_module_list as $key => $value)
766 766
 				{
767 767
 					$moduleActionInfo = $oModuleModel->getModuleActionXml($value->module);
768
-					if(is_object($moduleActionInfo->menu))
768
+					if (is_object($moduleActionInfo->menu))
769 769
 					{
770
-						foreach($moduleActionInfo->menu as $key2 => $value2)
770
+						foreach ($moduleActionInfo->menu as $key2 => $value2)
771 771
 						{
772 772
 							$lang[$key2] = $value2->title;
773 773
 						}
@@ -792,19 +792,19 @@  discard block
 block discarded – undo
792 792
 		$args = new stdClass();
793 793
 		$args->site_srl = $siteSrl;
794 794
 		$output = executeQueryArray('admin.getFavoriteList', $args);
795
-		if(!$output->toBool())
795
+		if (!$output->toBool())
796 796
 		{
797 797
 			return $output;
798 798
 		}
799
-		if(!$output->data)
799
+		if (!$output->data)
800 800
 		{
801 801
 			return new BaseObject();
802 802
 		}
803 803
 
804
-		if($isGetModuleInfo && is_array($output->data))
804
+		if ($isGetModuleInfo && is_array($output->data))
805 805
 		{
806 806
 			$oModuleModel = getModel('module');
807
-			foreach($output->data AS $key => $value)
807
+			foreach ($output->data AS $key => $value)
808 808
 			{
809 809
 				$moduleInfo = $oModuleModel->getModuleInfoXml($value->module);
810 810
 				$output->data[$key]->admin_index_act = $moduleInfo->admin_index_act;
@@ -829,13 +829,13 @@  discard block
 block discarded – undo
829 829
 		$args->site_srl = $siteSrl;
830 830
 		$args->module = $module;
831 831
 		$output = executeQuery('admin.getFavorite', $args);
832
-		if(!$output->toBool())
832
+		if (!$output->toBool())
833 833
 		{
834 834
 			return $output;
835 835
 		}
836 836
 
837 837
 		$returnObject = new BaseObject();
838
-		if($output->data)
838
+		if ($output->data)
839 839
 		{
840 840
 			$returnObject->add('result', TRUE);
841 841
 			$returnObject->add('favoriteSrl', $output->data->admin_favorite_srl);
@@ -854,7 +854,7 @@  discard block
 block discarded – undo
854 854
 	 */
855 855
 	function getSiteAllList()
856 856
 	{
857
-		if(Context::get('domain'))
857
+		if (Context::get('domain'))
858 858
 		{
859 859
 			$domain = Context::get('domain');
860 860
 		}
@@ -871,7 +871,7 @@  discard block
 block discarded – undo
871 871
 	function getAllSitesThatHaveModules($domain = NULL)
872 872
 	{
873 873
 		$args = new stdClass();
874
-		if($domain)
874
+		if ($domain)
875 875
 		{
876 876
 			$args->domain = $domain;
877 877
 		}
@@ -879,31 +879,31 @@  discard block
 block discarded – undo
879 879
 
880 880
 		$siteList = array();
881 881
 		$output = executeQueryArray('admin.getSiteAllList', $args, $columnList);
882
-		if($output->toBool())
882
+		if ($output->toBool())
883 883
 		{
884 884
 			$siteList = $output->data;
885 885
 		}
886 886
 
887 887
 		$oModuleModel = getModel('module');
888
-		foreach($siteList as $key => $value)
888
+		foreach ($siteList as $key => $value)
889 889
 		{
890 890
 			$args->site_srl = $value->site_srl;
891 891
 			$list = $oModuleModel->getModuleSrlList($args);
892 892
 
893
-			if(!is_array($list))
893
+			if (!is_array($list))
894 894
 			{
895 895
 				$list = array($list);
896 896
 			}
897 897
 
898
-			foreach($list as $k => $v)
898
+			foreach ($list as $k => $v)
899 899
 			{
900
-				if(!is_dir(_XE_PATH_ . 'modules/' . $v->module))
900
+				if (!is_dir(_XE_PATH_.'modules/'.$v->module))
901 901
 				{
902 902
 					unset($list[$k]);
903 903
 				}
904 904
 			}
905 905
 
906
-			if(!count($list))
906
+			if (!count($list))
907 907
 			{
908 908
 				unset($siteList[$key]);
909 909
 			}
@@ -920,13 +920,13 @@  discard block
 block discarded – undo
920 920
 	{
921 921
 		$args = new stdClass();
922 922
 
923
-		if($date)
923
+		if ($date)
924 924
 		{
925 925
 			$args->regDate = date('Ymd', strtotime($date));
926 926
 		}
927 927
 
928 928
 		$output = executeQuery('admin.getSiteCountByDate', $args);
929
-		if(!$output->toBool())
929
+		if (!$output->toBool())
930 930
 		{
931 931
 			return 0;
932 932
 		}
@@ -948,21 +948,21 @@  discard block
 block discarded – undo
948 948
 	{
949 949
 		$site_info = Context::get('site_module_info');
950 950
 		$virtual_site = '';
951
-		if($site_info->site_srl) 
951
+		if ($site_info->site_srl) 
952 952
 		{
953
-			$virtual_site = $site_info->site_srl . '/';
953
+			$virtual_site = $site_info->site_srl.'/';
954 954
 		}
955 955
 
956
-		$file_exsit = FileHandler::readFile(_XE_PATH_ . 'files/attach/xeicon/' . $virtual_site . $iconname);
957
-		if(!$file_exsit && $default === true)
956
+		$file_exsit = FileHandler::readFile(_XE_PATH_.'files/attach/xeicon/'.$virtual_site.$iconname);
957
+		if (!$file_exsit && $default === true)
958 958
         {
959
-            $icon_url = './modules/admin/tpl/img/' . $default_icon_name;
959
+            $icon_url = './modules/admin/tpl/img/'.$default_icon_name;
960 960
         }
961
-        elseif($file_exsit)
961
+        elseif ($file_exsit)
962 962
 		{
963 963
 			$default_url = Context::getDefaultUrl();
964
-			if($default_url && substr_compare($default_url, '/', -1) === 0) $default_url = substr($default_url, 0, -1);
965
-			$icon_url = $default_url . '/files/attach/xeicon/' . $virtual_site . $iconname;
964
+			if ($default_url && substr_compare($default_url, '/', -1) === 0) $default_url = substr($default_url, 0, -1);
965
+			$icon_url = $default_url.'/files/attach/xeicon/'.$virtual_site.$iconname;
966 966
 		}
967 967
 		return $icon_url;
968 968
 	}
Please login to merge, or discard this patch.
Braces   +25 added lines, -20 removed lines patch added patch discarded remove patch
@@ -303,8 +303,7 @@  discard block
 block discarded – undo
303 303
 			if(is_dir($curpwd . $file))
304 304
 			{
305 305
 				$file .= "/";
306
-			}
307
-			else
306
+			} else
308 307
 			{
309 308
 				continue;
310 309
 			}
@@ -359,8 +358,7 @@  discard block
 block discarded – undo
359 358
 			{
360 359
 				$_list = $oFtp->ftp_rawlist($this->pwd);
361 360
 				$oFtp->ftp_quit();
362
-			}
363
-			else
361
+			} else
364 362
 			{
365 363
 				return new BaseObject(-1, 'msg_ftp_invalid_auth_info');
366 364
 			}
@@ -380,8 +378,7 @@  discard block
 block discarded – undo
380 378
 					$list[] = substr(strrchr($v, ' '), 1) . '/';
381 379
 				}
382 380
 			}
383
-		}
384
-		else
381
+		} else
385 382
 		{
386 383
 			return new BaseObject(-1, 'msg_ftp_no_directory');
387 384
 		}
@@ -434,11 +431,13 @@  discard block
 block discarded – undo
434 431
 		$info['module'] = '';
435 432
 		$oModuleModel = getModel('module');
436 433
 		$module_list = $oModuleModel->getModuleList();
437
-		if($module_list) foreach($module_list as $module)
434
+		if($module_list) {
435
+			foreach($module_list as $module)
438 436
 		{
439 437
 			if(in_array($module->module, $skip['module']))
440 438
 			{
441 439
 				continue;
440
+		}
442 441
 			}
443 442
 			$info['module'] .= '|' . $module->module;
444 443
 		}
@@ -447,11 +446,13 @@  discard block
 block discarded – undo
447 446
 		$info['addon'] = '';
448 447
 		$oAddonAdminModel = getAdminModel('addon');
449 448
 		$addon_list = $oAddonAdminModel->getAddonList();
450
-		if($addon_list) foreach($addon_list as $addon)
449
+		if($addon_list) {
450
+			foreach($addon_list as $addon)
451 451
 		{
452 452
 			if(in_array($addon->addon, $skip['addon']))
453 453
 			{
454 454
 				continue;
455
+		}
455 456
 			}
456 457
 			$info['addon'] .= '|' . $addon->addon;
457 458
 		}
@@ -460,11 +461,13 @@  discard block
 block discarded – undo
460 461
 		$info['layout'] = "";
461 462
 		$oLayoutModel = getModel('layout');
462 463
 		$layout_list = $oLayoutModel->getDownloadedLayoutList();
463
-		if($layout_list) foreach($layout_list as $layout)
464
+		if($layout_list) {
465
+			foreach($layout_list as $layout)
464 466
 		{
465 467
 			if(in_array($layout->layout, $skip['layout']))
466 468
 			{
467 469
 				continue;
470
+		}
468 471
 			}
469 472
 			$info['layout'] .= '|' . $layout->layout;
470 473
 		}
@@ -473,11 +476,13 @@  discard block
 block discarded – undo
473 476
 		$info['widget'] = "";
474 477
 		$oWidgetModel = getModel('widget');
475 478
 		$widget_list = $oWidgetModel->getDownloadedWidgetList();
476
-		if($widget_list) foreach($widget_list as $widget)
479
+		if($widget_list) {
480
+			foreach($widget_list as $widget)
477 481
 		{
478 482
 			if(in_array($widget->widget, $skip['widget']))
479 483
 			{
480 484
 				continue;
485
+		}
481 486
 			}
482 487
 			$info['widget'] .= '|' . $widget->widget;
483 488
 		}
@@ -486,11 +491,13 @@  discard block
 block discarded – undo
486 491
 		$info['widgetstyle'] = "";
487 492
 		$oWidgetModel = getModel('widget');
488 493
 		$widgetstyle_list = $oWidgetModel->getDownloadedWidgetStyleList();
489
-		if($widgetstyle_list) foreach($widgetstyle_list as $widgetstyle)
494
+		if($widgetstyle_list) {
495
+			foreach($widgetstyle_list as $widgetstyle)
490 496
 		{
491 497
 			if(in_array($widgetstyle->widgetStyle, $skip['widgetstyle']))
492 498
 			{
493 499
 				continue;
500
+		}
494 501
 			}
495 502
 			$info['widgetstyle'] .= '|' . $widgetstyle->widgetStyle;
496 503
 		}
@@ -575,8 +582,7 @@  discard block
 block discarded – undo
575 582
 		{
576 583
 			$publisher_list = array();
577 584
 			$publisher_list[] = $xml_obj->publisher;
578
-		}
579
-		else
585
+		} else
580 586
 		{
581 587
 			$publisher_list = $xml_obj->publisher;
582 588
 		}
@@ -649,8 +655,7 @@  discard block
 block discarded – undo
649 655
 		if(is_array($skin_infos->skininfo))
650 656
 		{
651 657
 			$skin_list = $skin_infos->skininfo;
652
-		}
653
-		else
658
+		} else
654 659
 		{
655 660
 			$skin_list = array($skin_infos->skininfo);
656 661
 		}
@@ -839,8 +844,7 @@  discard block
 block discarded – undo
839 844
 		{
840 845
 			$returnObject->add('result', TRUE);
841 846
 			$returnObject->add('favoriteSrl', $output->data->admin_favorite_srl);
842
-		}
843
-		else
847
+		} else
844 848
 		{
845 849
 			$returnObject->add('result', FALSE);
846 850
 		}
@@ -957,11 +961,12 @@  discard block
 block discarded – undo
957 961
 		if(!$file_exsit && $default === true)
958 962
         {
959 963
             $icon_url = './modules/admin/tpl/img/' . $default_icon_name;
960
-        }
961
-        elseif($file_exsit)
964
+        } elseif($file_exsit)
962 965
 		{
963 966
 			$default_url = Context::getDefaultUrl();
964
-			if($default_url && substr_compare($default_url, '/', -1) === 0) $default_url = substr($default_url, 0, -1);
967
+			if($default_url && substr_compare($default_url, '/', -1) === 0) {
968
+				$default_url = substr($default_url, 0, -1);
969
+			}
965 970
 			$icon_url = $default_url . '/files/attach/xeicon/' . $virtual_site . $iconname;
966 971
 		}
967 972
 		return $icon_url;
Please login to merge, or discard this patch.
modules/widget/widget.class.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -30,10 +30,10 @@  discard block
 block discarded – undo
30 30
 		$oModuleModel = getModel('module');
31 31
 		$oModuleController = getController('module');
32 32
 		$version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated'));
33
-		if($oModuleModel->needUpdate($version_update_id))
33
+		if ($oModuleModel->needUpdate($version_update_id))
34 34
 		{
35 35
 			// widget compile display.after trigger for further (04/14/2009)
36
-			if(!$oModuleModel->getTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before')) return true;
36
+			if (!$oModuleModel->getTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before')) return true;
37 37
 
38 38
 			$oModuleController->insertUpdatedLog($version_update_id);
39 39
 		}
@@ -49,10 +49,10 @@  discard block
 block discarded – undo
49 49
 		$oModuleModel = getModel('module');
50 50
 		$oModuleController = getController('module');
51 51
 		$version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated'));
52
-		if($oModuleModel->needUpdate($version_update_id))
52
+		if ($oModuleModel->needUpdate($version_update_id))
53 53
 		{
54 54
 			// widget compile display.after trigger for further (04/14/2009)
55
-			if(!$oModuleModel->getTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before'))
55
+			if (!$oModuleModel->getTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before'))
56 56
 			{
57 57
 				$oModuleController->insertTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before');
58 58
 			}
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,9 @@
 block discarded – undo
33 33
 		if($oModuleModel->needUpdate($version_update_id))
34 34
 		{
35 35
 			// widget compile display.after trigger for further (04/14/2009)
36
-			if(!$oModuleModel->getTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before')) return true;
36
+			if(!$oModuleModel->getTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before')) {
37
+				return true;
38
+			}
37 39
 
38 40
 			$oModuleController->insertUpdatedLog($version_update_id);
39 41
 		}
Please login to merge, or discard this patch.
modules/message/message.class.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -23,17 +23,17 @@  discard block
 block discarded – undo
23 23
 		$oModuleModel = getModel('module');
24 24
 		$oModuleController = getController('module');
25 25
 		$version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated'));
26
-		if($oModuleModel->needUpdate($version_update_id))
26
+		if ($oModuleModel->needUpdate($version_update_id))
27 27
 		{
28 28
 			$config = $oModuleModel->getModuleConfig('message');
29 29
 
30
-			if($config->skin)
30
+			if ($config->skin)
31 31
 			{
32 32
 				$config_parse = explode('.', $config->skin);
33 33
 				if (count($config_parse) > 1)
34 34
 				{
35 35
 					$template_path = sprintf('./themes/%s/modules/message/', $config_parse[0]);
36
-					if(is_dir($template_path)) return true;
36
+					if (is_dir($template_path)) return true;
37 37
 				}
38 38
 			}
39 39
 
@@ -51,17 +51,17 @@  discard block
 block discarded – undo
51 51
 		$oModuleModel = getModel('module');
52 52
 		$oModuleController = getController('module');
53 53
 		$version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated'));
54
-		if($oModuleModel->needUpdate($version_update_id))
54
+		if ($oModuleModel->needUpdate($version_update_id))
55 55
 		{
56 56
 			$config = $oModuleModel->getModuleConfig('message');
57 57
 
58
-			if($config->skin)
58
+			if ($config->skin)
59 59
 			{
60 60
 				$config_parse = explode('.', $config->skin);
61 61
 				if (count($config_parse) > 1)
62 62
 				{
63 63
 					$template_path = sprintf('./themes/%s/modules/message/', $config_parse[0]);
64
-					if(is_dir($template_path))
64
+					if (is_dir($template_path))
65 65
 					{
66 66
 						$config->skin = implode('|@|', $config_parse);
67 67
 						$oModuleController = getController('module');
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,9 @@
 block discarded – undo
33 33
 				if (count($config_parse) > 1)
34 34
 				{
35 35
 					$template_path = sprintf('./themes/%s/modules/message/', $config_parse[0]);
36
-					if(is_dir($template_path)) return true;
36
+					if(is_dir($template_path)) {
37
+						return true;
38
+					}
37 39
 				}
38 40
 			}
39 41
 
Please login to merge, or discard this patch.
modules/comment/comment.class.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /* Copyright (C) NAVER <http://www.navercorp.com> */
3 3
 
4
-require_once(_XE_PATH_ . 'modules/comment/comment.item.php');
4
+require_once(_XE_PATH_.'modules/comment/comment.item.php');
5 5
 
6 6
 /**
7 7
  * comment
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 		// 2008. 02. 22 add comment setting when a new module added
37 37
 		$oModuleController->insertTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before');
38 38
 
39
-		if(!is_dir('./files/cache/tmp'))
39
+		if (!is_dir('./files/cache/tmp'))
40 40
 		{
41 41
 			FileHandler::makeDir('./files/cache/tmp');
42 42
 		}
@@ -54,63 +54,63 @@  discard block
 block discarded – undo
54 54
 		$oModuleModel = getModel('module');
55 55
 		$oModuleController = getController('module');
56 56
 		$version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated'));
57
-		if($oModuleModel->needUpdate($version_update_id))
57
+		if ($oModuleModel->needUpdate($version_update_id))
58 58
 		{
59 59
 			// 2007. 10. 17 add a trigger to delete comments together with posting deleted
60
-			if(!$oModuleModel->getTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after'))
60
+			if (!$oModuleModel->getTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after'))
61 61
 			{
62 62
 				return TRUE;
63 63
 			}
64 64
 			// 2007. 10. 17 add a trigger to delete all of comments together with module deleted
65
-			if(!$oModuleModel->getTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after'))
65
+			if (!$oModuleModel->getTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after'))
66 66
 			{
67 67
 				return TRUE;
68 68
 			}
69 69
 			// 2007. 10. 23 add a column for recommendation votes or notification of the comments
70
-			if(!$oDB->isColumnExists("comments", "voted_count"))
70
+			if (!$oDB->isColumnExists("comments", "voted_count"))
71 71
 			{
72 72
 				return TRUE;
73 73
 			}
74
-			if(!$oDB->isColumnExists("comments", "notify_message"))
74
+			if (!$oDB->isColumnExists("comments", "notify_message"))
75 75
 			{
76 76
 				return TRUE;
77 77
 			}
78 78
 			// 2008. 02. 22 add comment setting when a new module added
79
-			if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before'))
79
+			if (!$oModuleModel->getTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before'))
80 80
 			{
81 81
 				return TRUE;
82 82
 			}
83 83
 			// 2008. 05. 14 add a column for blamed count
84
-			if(!$oDB->isColumnExists("comments", "blamed_count"))
84
+			if (!$oDB->isColumnExists("comments", "blamed_count"))
85 85
 			{
86 86
 				return TRUE;
87 87
 			}
88
-			if(!$oDB->isColumnExists("comment_voted_log", "point"))
88
+			if (!$oDB->isColumnExists("comment_voted_log", "point"))
89 89
 			{
90 90
 				return TRUE;
91 91
 			}
92 92
 
93
-			if(!$oDB->isIndexExists("comments", "idx_module_list_order"))
93
+			if (!$oDB->isIndexExists("comments", "idx_module_list_order"))
94 94
 			{
95 95
 				return TRUE;
96 96
 			}
97 97
 			//2012. 02. 24 add comment published status column and index
98
-			if(!$oDB->isColumnExists("comments", "status"))
98
+			if (!$oDB->isColumnExists("comments", "status"))
99 99
 			{
100 100
 				return TRUE;
101 101
 			}
102
-			if(!$oDB->isIndexExists("comments", "idx_status"))
102
+			if (!$oDB->isIndexExists("comments", "idx_status"))
103 103
 			{
104 104
 				return TRUE;
105 105
 			}
106 106
 
107 107
 			// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied 
108
-			if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after'))
108
+			if (!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after'))
109 109
 			{
110 110
 				return TRUE;
111 111
 			}
112 112
 
113
-			if(!$oDB->isIndexExists("comments", "idx_parent_srl"))
113
+			if (!$oDB->isIndexExists("comments", "idx_parent_srl"))
114 114
 			{
115 115
 				return TRUE;
116 116
 			}
@@ -131,46 +131,46 @@  discard block
 block discarded – undo
131 131
 		$oModuleModel = getModel('module');
132 132
 		$oModuleController = getController('module');
133 133
 		$version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated'));
134
-		if($oModuleModel->needUpdate($version_update_id))
134
+		if ($oModuleModel->needUpdate($version_update_id))
135 135
 		{
136 136
 			// 2007. 10. 17 add a trigger to delete comments together with posting deleted
137
-			if(!$oModuleModel->getTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after'))
137
+			if (!$oModuleModel->getTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after'))
138 138
 			{
139 139
 				$oModuleController->insertTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after');
140 140
 			}
141 141
 			// 2007. 10. 17 add a trigger to delete all of comments together with module deleted
142
-			if(!$oModuleModel->getTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after'))
142
+			if (!$oModuleModel->getTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after'))
143 143
 			{
144 144
 				$oModuleController->insertTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after');
145 145
 			}
146 146
 			// 2007. 10. 23 add a column for recommendation votes or notification of the comments
147
-			if(!$oDB->isColumnExists("comments", "voted_count"))
147
+			if (!$oDB->isColumnExists("comments", "voted_count"))
148 148
 			{
149 149
 				$oDB->addColumn("comments", "voted_count", "number", "11");
150 150
 				$oDB->addIndex("comments", "idx_voted_count", array("voted_count"));
151 151
 			}
152 152
 
153
-			if(!$oDB->isColumnExists("comments", "notify_message"))
153
+			if (!$oDB->isColumnExists("comments", "notify_message"))
154 154
 			{
155 155
 				$oDB->addColumn("comments", "notify_message", "char", "1");
156 156
 			}
157 157
 			// 2008. 02. 22 add comment setting when a new module added
158
-			if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before'))
158
+			if (!$oModuleModel->getTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before'))
159 159
 			{
160 160
 				$oModuleController->insertTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before');
161 161
 			}
162 162
 			// 2008. 05. 14 add a column for blamed count
163
-			if(!$oDB->isColumnExists("comments", "blamed_count"))
163
+			if (!$oDB->isColumnExists("comments", "blamed_count"))
164 164
 			{
165 165
 				$oDB->addColumn('comments', 'blamed_count', 'number', 11, 0, TRUE);
166 166
 				$oDB->addIndex('comments', 'idx_blamed_count', array('blamed_count'));
167 167
 			}
168
-			if(!$oDB->isColumnExists("comment_voted_log", "point"))
168
+			if (!$oDB->isColumnExists("comment_voted_log", "point"))
169 169
 			{
170 170
 				$oDB->addColumn('comment_voted_log', 'point', 'number', 11, 0, TRUE);
171 171
 			}
172 172
 
173
-			if(!$oDB->isIndexExists("comments", "idx_module_list_order"))
173
+			if (!$oDB->isIndexExists("comments", "idx_module_list_order"))
174 174
 			{
175 175
 				$oDB->addIndex(
176 176
 						"comments", "idx_module_list_order", array("module_srl", "list_order"), TRUE
@@ -178,11 +178,11 @@  discard block
 block discarded – undo
178 178
 			}
179 179
 
180 180
 			//2012. 02. 24 add comment published status column and index
181
-			if(!$oDB->isColumnExists("comments", "status"))
181
+			if (!$oDB->isColumnExists("comments", "status"))
182 182
 			{
183 183
 				$oDB->addColumn("comments", "status", "number", 1, 1, TRUE);
184 184
 			}
185
-			if(!$oDB->isIndexExists("comments", "idx_status"))
185
+			if (!$oDB->isIndexExists("comments", "idx_status"))
186 186
 			{
187 187
 				$oDB->addIndex(
188 188
 						"comments", "idx_status", array("status", "comment_srl", "module_srl", "document_srl"), TRUE
@@ -190,12 +190,12 @@  discard block
 block discarded – undo
190 190
 			}
191 191
 
192 192
 			// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied 
193
-			if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after'))
193
+			if (!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after'))
194 194
 			{
195 195
 				$oModuleController->insertTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after');
196 196
 			}
197 197
 
198
-			if(!$oDB->isIndexExists("comments", "idx_parent_srl"))
198
+			if (!$oDB->isIndexExists("comments", "idx_parent_srl"))
199 199
 			{
200 200
 				$oDB->addIndex('comments', 'idx_parent_srl', array('parent_srl'));
201 201
 			}
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 	 */
213 213
 	function recompileCache()
214 214
 	{
215
-		if(!is_dir('./files/cache/tmp'))
215
+		if (!is_dir('./files/cache/tmp'))
216 216
 		{
217 217
 			FileHandler::makeDir('./files/cache/tmp');
218 218
 		}
Please login to merge, or discard this patch.
modules/member/member.admin.view.php 3 patches
Spacing   +72 added lines, -72 removed lines patch added patch discarded remove patch
@@ -43,16 +43,16 @@  discard block
 block discarded – undo
43 43
 
44 44
 		// if member_srl exists, set memberInfo
45 45
 		$member_srl = Context::get('member_srl');
46
-		if($member_srl) 
46
+		if ($member_srl) 
47 47
 		{
48 48
 			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl);
49
-			if(!$this->memberInfo)
49
+			if (!$this->memberInfo)
50 50
 			{
51
-				Context::set('member_srl','');
51
+				Context::set('member_srl', '');
52 52
 			}
53 53
 			else
54 54
 			{
55
-				Context::set('member_info',$this->memberInfo);
55
+				Context::set('member_info', $this->memberInfo);
56 56
 			}
57 57
 		}
58 58
 
@@ -79,30 +79,30 @@  discard block
 block discarded – undo
79 79
 
80 80
 		$filter = Context::get('filter_type');
81 81
 		global $lang;
82
-		switch($filter)
82
+		switch ($filter)
83 83
 		{
84
-			case 'super_admin' : Context::set('filter_type_title', $lang->cmd_show_super_admin_member);break;
85
-			case 'site_admin' : Context::set('filter_type_title', $lang->cmd_show_site_admin_member);break;
86
-			default : Context::set('filter_type_title', $lang->cmd_show_all_member);break;
84
+			case 'super_admin' : Context::set('filter_type_title', $lang->cmd_show_super_admin_member); break;
85
+			case 'site_admin' : Context::set('filter_type_title', $lang->cmd_show_site_admin_member); break;
86
+			default : Context::set('filter_type_title', $lang->cmd_show_all_member); break;
87 87
 		}
88 88
 		// retrieve list of groups for each member
89
-		if($output->data)
89
+		if ($output->data)
90 90
 		{
91
-			foreach($output->data as $key => $member)
91
+			foreach ($output->data as $key => $member)
92 92
 			{
93
-				$output->data[$key]->group_list = $oMemberModel->getMemberGroups($member->member_srl,0);
93
+				$output->data[$key]->group_list = $oMemberModel->getMemberGroups($member->member_srl, 0);
94 94
 			}
95 95
 		}
96 96
 		$config = $this->memberConfig;
97 97
 		$memberIdentifiers = array('user_id'=>'user_id', 'user_name'=>'user_name', 'nick_name'=>'nick_name');
98 98
 		$usedIdentifiers = array();	
99 99
 
100
-		if(is_array($config->signupForm))
100
+		if (is_array($config->signupForm))
101 101
 		{
102
-			foreach($config->signupForm as $signupItem)
102
+			foreach ($config->signupForm as $signupItem)
103 103
 			{
104
-				if(!count($memberIdentifiers)) break;
105
-				if(in_array($signupItem->name, $memberIdentifiers) && ($signupItem->required || $signupItem->isUse))
104
+				if (!count($memberIdentifiers)) break;
105
+				if (in_array($signupItem->name, $memberIdentifiers) && ($signupItem->required || $signupItem->isUse))
106 106
 				{
107 107
 					unset($memberIdentifiers[$signupItem->name]);
108 108
 					$usedIdentifiers[$signupItem->name] = $lang->{$signupItem->name};
@@ -140,14 +140,14 @@  discard block
 block discarded – undo
140 140
 	{
141 141
 		$config = $this->memberConfig;
142 142
 
143
-		if($config->redirect_url)
143
+		if ($config->redirect_url)
144 144
 		{
145 145
 			$mid = str_ireplace(Context::getDefaultUrl(), '', $config->redirect_url);
146 146
 
147 147
 			$siteModuleInfo = Context::get('site_module_info');
148 148
 
149 149
 			$oModuleModel = getModel('module');
150
-			$moduleInfo = $oModuleModel->getModuleInfoByMid($mid, (int)$siteModuleInfo->site_srl);
150
+			$moduleInfo = $oModuleModel->getModuleInfoByMid($mid, (int) $siteModuleInfo->site_srl);
151 151
 
152 152
 			$config->redirect_url = $moduleInfo->module_srl;
153 153
 			Context::set('config', $config);
@@ -173,9 +173,9 @@  discard block
 block discarded – undo
173 173
 		Context::set('editor', $editor);
174 174
 
175 175
 		$signupForm = $config->signupForm;
176
-		foreach($signupForm as $val)
176
+		foreach ($signupForm as $val)
177 177
 		{
178
-			if($val->name == 'user_id')
178
+			if ($val->name == 'user_id')
179 179
 			{
180 180
 				$userIdInfo = $val;
181 181
 				break;
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 		}
184 184
 
185 185
 		$oSecurity = new Security();
186
-		if($userIdInfo->isUse)
186
+		if ($userIdInfo->isUse)
187 187
 		{
188 188
 			// get denied ID list
189 189
 			Context::set('useUserID', 1);
@@ -274,16 +274,16 @@  discard block
 block discarded – undo
274 274
 		Context::set('editor', $editor);
275 275
 
276 276
 		$signupForm = $config->signupForm;
277
-		foreach($signupForm as $val)
277
+		foreach ($signupForm as $val)
278 278
 		{
279
-			if($val->name == 'user_id')
279
+			if ($val->name == 'user_id')
280 280
 			{
281 281
 				$userIdInfo = $val;
282 282
 				break;
283 283
 			}
284 284
 		}
285 285
 
286
-		if($userIdInfo->isUse)
286
+		if ($userIdInfo->isUse)
287 287
 		{
288 288
 			// get denied ID list
289 289
 			Context::set('useUserID', 1);
@@ -344,14 +344,14 @@  discard block
 block discarded – undo
344 344
 		$oMemberModel = getModel('member');
345 345
 
346 346
 		$memberInfo = Context::get('member_info');
347
-		if(isset($memberInfo))
347
+		if (isset($memberInfo))
348 348
 		{
349 349
 			$memberInfo->signature = $oMemberModel->getSignature($this->memberInfo->member_srl);
350 350
 		}
351 351
 		Context::set('member_info', $memberInfo);
352 352
 
353 353
 		// get an editor for the signature
354
-		if($memberInfo->member_srl)
354
+		if ($memberInfo->member_srl)
355 355
 		{
356 356
 			$oEditorModel = getModel('editor');
357 357
 			$option = new stdClass();
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
 		}
406 406
 
407 407
 		$member_config = $this->memberConfig;
408
-		if(!$this->memberConfig)
408
+		if (!$this->memberConfig)
409 409
 		{
410 410
 			$member_config = $this->memberConfig = $oMemberModel->getMemberConfig();
411 411
 		}
@@ -416,25 +416,25 @@  discard block
 block discarded – undo
416 416
 		$formTags = array();
417 417
 		global $lang;
418 418
 
419
-		foreach($member_config->signupForm as $no=>$formInfo)
419
+		foreach ($member_config->signupForm as $no=>$formInfo)
420 420
 		{
421
-			if(!$formInfo->isUse)continue;
421
+			if (!$formInfo->isUse)continue;
422 422
 
423 423
 			// 회원 본인이 아닌 경우 입력 폼 제거
424
-			if($formInfo->name == 'find_account_question' && $memberInfo['member_srl'] !== $logged_info->member_srl)
424
+			if ($formInfo->name == 'find_account_question' && $memberInfo['member_srl'] !== $logged_info->member_srl)
425 425
 			{
426 426
 				unset($member_config->signupForm[$no]);
427 427
 				continue;
428 428
 			}
429 429
 
430
-			if($formInfo->name == $member_config->identifier || $formInfo->name == 'password') continue;
430
+			if ($formInfo->name == $member_config->identifier || $formInfo->name == 'password') continue;
431 431
 
432 432
 			$formTag = new stdClass();
433 433
 			$inputTag = '';
434 434
 			$formTag->title = ($formInfo->isDefaultForm) ? $lang->{$formInfo->name} : $formInfo->title;
435
-			if($isAdmin)
435
+			if ($isAdmin)
436 436
 			{
437
-				if($formInfo->mustRequired) $formTag->title = '<em style="color:red">*</em> '.$formTag->title;
437
+				if ($formInfo->mustRequired) $formTag->title = '<em style="color:red">*</em> '.$formTag->title;
438 438
 			}
439 439
 			else
440 440
 			{
@@ -442,28 +442,28 @@  discard block
 block discarded – undo
442 442
 			}
443 443
 			$formTag->name = $formInfo->name;
444 444
 
445
-			if($formInfo->isDefaultForm)
445
+			if ($formInfo->isDefaultForm)
446 446
 			{
447
-				if($formInfo->imageType)
447
+				if ($formInfo->imageType)
448 448
 				{
449 449
 					$formTag->type = 'image';
450
-					if($formInfo->name == 'profile_image')
450
+					if ($formInfo->name == 'profile_image')
451 451
 					{
452 452
 						$target = $memberInfo['profile_image'];
453 453
 						$functionName = 'doDeleteProfileImage';
454 454
 					}
455
-					else if($formInfo->name == 'image_name')
455
+					else if ($formInfo->name == 'image_name')
456 456
 					{
457 457
 						$target = $memberInfo['image_name'];
458 458
 						$functionName = 'doDeleteImageName';
459 459
 					}
460
-					else if($formInfo->name == 'image_mark')
460
+					else if ($formInfo->name == 'image_mark')
461 461
 					{
462 462
 						$target = $memberInfo['image_mark'];
463 463
 						$functionName = 'doDeleteImageMark';
464 464
 					}
465 465
 
466
-					if($target->src)
466
+					if ($target->src)
467 467
 					{
468 468
 						$inputTag = sprintf('<input type="hidden" name="__%s_exist" value="true" /><span id="%s"><img src="%s" alt="%s" /> <button type="button" onclick="%s(%d);return false;">%s</button></span>',
469 469
 							$formInfo->name,
@@ -486,7 +486,7 @@  discard block
 block discarded – undo
486 486
 						$lang->{$formInfo->name.'_max_height'},
487 487
 						$member_config->{$formInfo->name.'_max_height'});
488 488
 					}//end imageType
489
-					else if($formInfo->name == 'birthday')
489
+					else if ($formInfo->name == 'birthday')
490 490
 					{
491 491
 						$formTag->type = 'date';
492 492
 						$inputTag = sprintf('<input type="hidden" name="birthday" id="date_birthday" value="%s" /><input type="text" placeholder="YYYY-MM-DD" name="birthday_ui" class="inputDate" id="birthday" value="%s" readonly="readonly" /> <input type="button" value="%s" class="btn dateRemover" />',
@@ -494,16 +494,16 @@  discard block
 block discarded – undo
494 494
 							zdate($memberInfo['birthday'], 'Y-m-d', false),
495 495
 							$lang->cmd_delete);
496 496
 					}
497
-					else if($formInfo->name == 'find_account_question')
497
+					else if ($formInfo->name == 'find_account_question')
498 498
 					{
499 499
 						$disabled = (!!$memberInfo['member_srl']) ? 'disabled="disabled"' : '';
500 500
 
501 501
 						$formTag->type = 'select';
502 502
 						$inputTag = '<select name="find_account_question" id="find_account_question" style="display:block;margin:0 0 8px 0" %s>%s</select>';
503 503
 						$optionTag = array();
504
-						foreach($lang->find_account_question_items as $key=>$val)
504
+						foreach ($lang->find_account_question_items as $key=>$val)
505 505
 						{
506
-							if($key == $memberInfo['find_account_question']) $selected = 'selected="selected"';
506
+							if ($key == $memberInfo['find_account_question']) $selected = 'selected="selected"';
507 507
 							else $selected = '';
508 508
 							$optionTag[] = sprintf('<option value="%s" %s >%s</option>',
509 509
 								$key,
@@ -511,24 +511,24 @@  discard block
 block discarded – undo
511 511
 								$val);
512 512
 						}
513 513
 						$inputTag = sprintf($inputTag, $disabled, implode('', $optionTag));
514
-						$inputTag .= '<input type="text" name="find_account_answer" id="find_account_answer" title="'.Context::getLang('find_account_answer').'" value="" ' . $disabled . ' />';
514
+						$inputTag .= '<input type="text" name="find_account_answer" id="find_account_answer" title="'.Context::getLang('find_account_answer').'" value="" '.$disabled.' />';
515 515
 
516
-						if($disabled) {
517
-							$inputTag .= ' <label><input type="checkbox" name="modify_find_account_answer" value="Y" /> ' . Context::getLang('cmd_modify') . '</label>';
516
+						if ($disabled) {
517
+							$inputTag .= ' <label><input type="checkbox" name="modify_find_account_answer" value="Y" /> '.Context::getLang('cmd_modify').'</label>';
518 518
 							$inputTag .= '<script>(function($) {$(function() {$(\'[name=modify_find_account_answer]\').change(function() {var $this = $(this); if($this.prop(\'checked\')) {$(\'[name=find_account_question],[name=find_account_answer]\').attr(\'disabled\', false); } else {$(\'[name=find_account_question]\').attr(\'disabled\', true); $(\'[name=find_account_answer]\').attr(\'disabled\', true).val(\'\'); } }); }); })(jQuery);</script>';
519 519
 						}
520 520
 					}
521
-					else if($formInfo->name == 'email_address')
521
+					else if ($formInfo->name == 'email_address')
522 522
 					{
523 523
 						$formTag->type = 'email';
524 524
 						$inputTag = '<input type="email" name="email_address" id="email_address" value="'.$memberInfo['email_address'].'" />';
525 525
 					}
526
-					else if($formInfo->name == 'homepage')
526
+					else if ($formInfo->name == 'homepage')
527 527
 					{
528 528
 						$formTag->type = 'url';
529 529
 						$inputTag = '<input type="url" name="homepage" id="homepage" value="'.$memberInfo['homepage'].'" />';
530 530
 					}
531
-					else if($formInfo->name == 'blog')
531
+					else if ($formInfo->name == 'blog')
532 532
 					{
533 533
 						$formTag->type = 'url';
534 534
 						$inputTag = '<input type="url" name="blog" id="blog" value="'.$memberInfo['blog'].'" />';
@@ -549,92 +549,92 @@  discard block
 block discarded – undo
549 549
 					$extentionReplace = array();
550 550
 
551 551
 					$formTag->type = $extendForm->column_type;
552
-					if($extendForm->column_type == 'text')
552
+					if ($extendForm->column_type == 'text')
553 553
 					{
554 554
 						$template = '<input type="text" name="%column_name%" id="%column_name%" value="%value%" />';
555 555
 					}
556
-					else if($extendForm->column_type == 'homepage')
556
+					else if ($extendForm->column_type == 'homepage')
557 557
 					{
558 558
 						$template = '<input type="url" name="%column_name%" id="%column_name%" value="%value%" />';
559 559
 					}
560
-					else if($extendForm->column_type == 'email_address')
560
+					else if ($extendForm->column_type == 'email_address')
561 561
 					{
562 562
 						$template = '<input type="email" name="%column_name%" id="%column_name%" value="%value%" />';
563 563
 					}
564
-					else if($extendForm->column_type == 'tel')
564
+					else if ($extendForm->column_type == 'tel')
565 565
 					{
566 566
 						$extentionReplace = array('tel_0' => $extendForm->value[0],
567 567
 							'tel_1' => $extendForm->value[1],
568 568
 							'tel_2' => $extendForm->value[2]);
569 569
 						$template = '<input type="tel" name="%column_name%[]" id="%column_name%" value="%tel_0%" size="4" maxlength="4" style="width:30px" title="First Number" /> - <input type="tel" name="%column_name%[]" value="%tel_1%" size="4" maxlength="4" style="width:35px" title="Second Number" /> - <input type="tel" name="%column_name%[]" value="%tel_2%" size="4" maxlength="4" style="width:35px" title="Third Number" />';
570 570
 					}
571
-					else if($extendForm->column_type == 'textarea')
571
+					else if ($extendForm->column_type == 'textarea')
572 572
 					{
573 573
 						$template = '<textarea name="%column_name%" id="%column_name%" rows="4" cols="42">%value%</textarea>';
574 574
 					}
575
-					else if($extendForm->column_type == 'checkbox')
575
+					else if ($extendForm->column_type == 'checkbox')
576 576
 					{
577 577
 						$template = '';
578
-						if($extendForm->default_value)
578
+						if ($extendForm->default_value)
579 579
 						{
580 580
 							$template = '<div style="padding-top:5px">%s</div>';
581 581
 							$__i = 0;
582 582
 							$optionTag = array();
583
-							foreach($extendForm->default_value as $v)
583
+							foreach ($extendForm->default_value as $v)
584 584
 							{
585 585
 								$checked = '';
586
-								if(is_array($extendForm->value) && in_array($v, $extendForm->value))$checked = 'checked="checked"';
586
+								if (is_array($extendForm->value) && in_array($v, $extendForm->value))$checked = 'checked="checked"';
587 587
 								$optionTag[] = '<label for="%column_name%'.$__i.'"><input type="checkbox" id="%column_name%'.$__i.'" name="%column_name%[]" value="'.$v.'" '.$checked.' /> '.$v.'</label>';
588 588
 								$__i++;
589 589
 							}
590 590
 							$template = sprintf($template, implode('', $optionTag));
591 591
 						}
592 592
 					}
593
-					else if($extendForm->column_type == 'radio')
593
+					else if ($extendForm->column_type == 'radio')
594 594
 					{
595 595
 						$template = '';
596
-						if($extendForm->default_value)
596
+						if ($extendForm->default_value)
597 597
 						{
598 598
 							$template = '<div style="padding-top:5px">%s</div>';
599 599
 							$optionTag = array();
600
-							foreach($extendForm->default_value as $v)
600
+							foreach ($extendForm->default_value as $v)
601 601
 							{
602
-								if($extendForm->value == $v)$checked = 'checked="checked"';
602
+								if ($extendForm->value == $v)$checked = 'checked="checked"';
603 603
 								else $checked = '';
604 604
 								$optionTag[] = '<label><input type="radio" name="%column_name%" value="'.$v.'" '.$checked.' /> '.$v.'</label>';
605 605
 							}
606 606
 							$template = sprintf($template, implode('', $optionTag));
607 607
 						}
608 608
 					}
609
-					else if($extendForm->column_type == 'select')
609
+					else if ($extendForm->column_type == 'select')
610 610
 					{
611 611
 						$template = '<select name="'.$formInfo->name.'" id="'.$formInfo->name.'">%s</select>';
612 612
 						$optionTag = array();
613 613
 						$optionTag[] = sprintf('<option value="">%s</option>', $lang->cmd_select);
614
-						if($extendForm->default_value)
614
+						if ($extendForm->default_value)
615 615
 						{
616
-							foreach($extendForm->default_value as $v)
616
+							foreach ($extendForm->default_value as $v)
617 617
 							{
618
-								if($v == $extendForm->value) $selected = 'selected="selected"';
618
+								if ($v == $extendForm->value) $selected = 'selected="selected"';
619 619
 								else $selected = '';
620 620
 								$optionTag[] = sprintf('<option value="%s" %s >%s</option>', $v, $selected, $v);
621 621
 							}
622 622
 						}
623 623
 						$template = sprintf($template, implode('', $optionTag));
624 624
 					}
625
-					else if($extendForm->column_type == 'kr_zip')
625
+					else if ($extendForm->column_type == 'kr_zip')
626 626
 					{
627 627
 						$krzipModel = getModel('krzip');
628
-						if($krzipModel && method_exists($krzipModel , 'getKrzipCodeSearchHtml' ))
628
+						if ($krzipModel && method_exists($krzipModel, 'getKrzipCodeSearchHtml'))
629 629
 						{
630 630
 							$template = $krzipModel->getKrzipCodeSearchHtml($extendForm->column_name, $extendForm->value);
631 631
 						}
632 632
 					}
633
-					else if($extendForm->column_type == 'jp_zip')
633
+					else if ($extendForm->column_type == 'jp_zip')
634 634
 					{
635 635
 						$template = '<input type="text" name="%column_name%" id="%column_name%" value="%value%" />';
636 636
 					}
637
-					else if($extendForm->column_type == 'date')
637
+					else if ($extendForm->column_type == 'date')
638 638
 					{
639 639
 						$extentionReplace = array('date' => zdate($extendForm->value, 'Y-m-d'), 'cmd_delete' => $lang->cmd_delete);
640 640
 						$template = '<input type="hidden" name="%column_name%" id="date_%column_name%" value="%value%" /><input type="text" placeholder="YYYY-MM-DD" class="inputDate" value="%date%" readonly="readonly" /> <input type="button" value="%cmd_delete%" class="btn dateRemover" />';
@@ -643,7 +643,7 @@  discard block
 block discarded – undo
643 643
 					$replace = array_merge($extentionReplace, $replace);
644 644
 					$inputTag = preg_replace_callback('@%(\w+)%@', function($n) use($replace) { return $replace[$n[1]]; }, $template);
645 645
 
646
-					if($extendForm->description)
646
+					if ($extendForm->description)
647 647
 						$inputTag .= '<p class="help-block">'.$extendForm->description.'</p>';
648 648
 				}
649 649
 				$formTag->inputTag = $inputTag;
@@ -674,12 +674,12 @@  discard block
 block discarded – undo
674 674
 	function dispMemberAdminInsertJoinForm() {
675 675
 		// Get the value of join_form
676 676
 		$member_join_form_srl = Context::get('member_join_form_srl');
677
-		if($member_join_form_srl)
677
+		if ($member_join_form_srl)
678 678
 		{
679 679
 			$oMemberModel = getModel('member');
680 680
 			$join_form = $oMemberModel->getJoinForm($member_join_form_srl);
681 681
 
682
-			if(!$join_form) Context::set('member_join_form_srl','',true);
682
+			if (!$join_form) Context::set('member_join_form_srl', '', true);
683 683
 			else
684 684
 			{
685 685
 				Context::set('join_form', $join_form);
Please login to merge, or discard this patch.
Braces   +62 added lines, -57 removed lines patch added patch discarded remove patch
@@ -49,8 +49,7 @@  discard block
 block discarded – undo
49 49
 			if(!$this->memberInfo)
50 50
 			{
51 51
 				Context::set('member_srl','');
52
-			}
53
-			else
52
+			} else
54 53
 			{
55 54
 				Context::set('member_info',$this->memberInfo);
56 55
 			}
@@ -101,7 +100,9 @@  discard block
 block discarded – undo
101 100
 		{
102 101
 			foreach($config->signupForm as $signupItem)
103 102
 			{
104
-				if(!count($memberIdentifiers)) break;
103
+				if(!count($memberIdentifiers)) {
104
+					break;
105
+				}
105 106
 				if(in_array($signupItem->name, $memberIdentifiers) && ($signupItem->required || $signupItem->isUse))
106 107
 				{
107 108
 					unset($memberIdentifiers[$signupItem->name]);
@@ -316,7 +317,9 @@  discard block
 block discarded – undo
316 317
 		$extendForm = $oMemberModel->getCombineJoinForm($this->memberInfo);
317 318
 		Context::set('extend_form_list', $extendForm);
318 319
 		$memberInfo = get_object_vars(Context::get('member_info'));
319
-		if (!is_array($memberInfo['group_list'])) $memberInfo['group_list'] = array();
320
+		if (!is_array($memberInfo['group_list'])) {
321
+			$memberInfo['group_list'] = array();
322
+		}
320 323
 		Context::set('memberInfo', $memberInfo);
321 324
 
322 325
 		$disableColumns = array('password', 'find_account_question', 'find_account_answer');
@@ -418,7 +421,9 @@  discard block
 block discarded – undo
418 421
 
419 422
 		foreach($member_config->signupForm as $no=>$formInfo)
420 423
 		{
421
-			if(!$formInfo->isUse)continue;
424
+			if(!$formInfo->isUse) {
425
+				continue;
426
+			}
422 427
 
423 428
 			// 회원 본인이 아닌 경우 입력 폼 제거
424 429
 			if($formInfo->name == 'find_account_question' && $memberInfo['member_srl'] !== $logged_info->member_srl)
@@ -427,18 +432,23 @@  discard block
 block discarded – undo
427 432
 				continue;
428 433
 			}
429 434
 
430
-			if($formInfo->name == $member_config->identifier || $formInfo->name == 'password') continue;
435
+			if($formInfo->name == $member_config->identifier || $formInfo->name == 'password') {
436
+				continue;
437
+			}
431 438
 
432 439
 			$formTag = new stdClass();
433 440
 			$inputTag = '';
434 441
 			$formTag->title = ($formInfo->isDefaultForm) ? $lang->{$formInfo->name} : $formInfo->title;
435 442
 			if($isAdmin)
436 443
 			{
437
-				if($formInfo->mustRequired) $formTag->title = '<em style="color:red">*</em> '.$formTag->title;
438
-			}
439
-			else
444
+				if($formInfo->mustRequired) {
445
+					$formTag->title = '<em style="color:red">*</em> '.$formTag->title;
446
+				}
447
+			} else
440 448
 			{
441
-				if ($formInfo->required && $formInfo->name != 'password') $formTag->title = '<em style="color:red">*</em> '.$formTag->title;
449
+				if ($formInfo->required && $formInfo->name != 'password') {
450
+					$formTag->title = '<em style="color:red">*</em> '.$formTag->title;
451
+				}
442 452
 			}
443 453
 			$formTag->name = $formInfo->name;
444 454
 
@@ -451,13 +461,11 @@  discard block
 block discarded – undo
451 461
 					{
452 462
 						$target = $memberInfo['profile_image'];
453 463
 						$functionName = 'doDeleteProfileImage';
454
-					}
455
-					else if($formInfo->name == 'image_name')
464
+					} else if($formInfo->name == 'image_name')
456 465
 					{
457 466
 						$target = $memberInfo['image_name'];
458 467
 						$functionName = 'doDeleteImageName';
459
-					}
460
-					else if($formInfo->name == 'image_mark')
468
+					} else if($formInfo->name == 'image_mark')
461 469
 					{
462 470
 						$target = $memberInfo['image_mark'];
463 471
 						$functionName = 'doDeleteImageMark';
@@ -473,8 +481,7 @@  discard block
 block discarded – undo
473 481
 							$functionName,
474 482
 							$memberInfo['member_srl'],
475 483
 							$lang->cmd_delete);
476
-					}
477
-					else
484
+					} else
478 485
 					{
479 486
 						$inputTag = sprintf('<input type="hidden" name="__%s_exist" value="false" />', $formInfo->name);
480 487
 					}
@@ -493,8 +500,7 @@  discard block
 block discarded – undo
493 500
 							$memberInfo['birthday'],
494 501
 							zdate($memberInfo['birthday'], 'Y-m-d', false),
495 502
 							$lang->cmd_delete);
496
-					}
497
-					else if($formInfo->name == 'find_account_question')
503
+					} else if($formInfo->name == 'find_account_question')
498 504
 					{
499 505
 						$disabled = (!!$memberInfo['member_srl']) ? 'disabled="disabled"' : '';
500 506
 
@@ -503,8 +509,11 @@  discard block
 block discarded – undo
503 509
 						$optionTag = array();
504 510
 						foreach($lang->find_account_question_items as $key=>$val)
505 511
 						{
506
-							if($key == $memberInfo['find_account_question']) $selected = 'selected="selected"';
507
-							else $selected = '';
512
+							if($key == $memberInfo['find_account_question']) {
513
+								$selected = 'selected="selected"';
514
+							} else {
515
+								$selected = '';
516
+							}
508 517
 							$optionTag[] = sprintf('<option value="%s" %s >%s</option>',
509 518
 								$key,
510 519
 								$selected,
@@ -517,23 +526,19 @@  discard block
 block discarded – undo
517 526
 							$inputTag .= ' <label><input type="checkbox" name="modify_find_account_answer" value="Y" /> ' . Context::getLang('cmd_modify') . '</label>';
518 527
 							$inputTag .= '<script>(function($) {$(function() {$(\'[name=modify_find_account_answer]\').change(function() {var $this = $(this); if($this.prop(\'checked\')) {$(\'[name=find_account_question],[name=find_account_answer]\').attr(\'disabled\', false); } else {$(\'[name=find_account_question]\').attr(\'disabled\', true); $(\'[name=find_account_answer]\').attr(\'disabled\', true).val(\'\'); } }); }); })(jQuery);</script>';
519 528
 						}
520
-					}
521
-					else if($formInfo->name == 'email_address')
529
+					} else if($formInfo->name == 'email_address')
522 530
 					{
523 531
 						$formTag->type = 'email';
524 532
 						$inputTag = '<input type="email" name="email_address" id="email_address" value="'.$memberInfo['email_address'].'" />';
525
-					}
526
-					else if($formInfo->name == 'homepage')
533
+					} else if($formInfo->name == 'homepage')
527 534
 					{
528 535
 						$formTag->type = 'url';
529 536
 						$inputTag = '<input type="url" name="homepage" id="homepage" value="'.$memberInfo['homepage'].'" />';
530
-					}
531
-					else if($formInfo->name == 'blog')
537
+					} else if($formInfo->name == 'blog')
532 538
 					{
533 539
 						$formTag->type = 'url';
534 540
 						$inputTag = '<input type="url" name="blog" id="blog" value="'.$memberInfo['blog'].'" />';
535
-					}
536
-					else
541
+					} else
537 542
 					{
538 543
 						$formTag->type = 'text';
539 544
 						$inputTag = sprintf('<input type="text" name="%s" id="%s" value="%s" />',
@@ -552,27 +557,22 @@  discard block
 block discarded – undo
552 557
 					if($extendForm->column_type == 'text')
553 558
 					{
554 559
 						$template = '<input type="text" name="%column_name%" id="%column_name%" value="%value%" />';
555
-					}
556
-					else if($extendForm->column_type == 'homepage')
560
+					} else if($extendForm->column_type == 'homepage')
557 561
 					{
558 562
 						$template = '<input type="url" name="%column_name%" id="%column_name%" value="%value%" />';
559
-					}
560
-					else if($extendForm->column_type == 'email_address')
563
+					} else if($extendForm->column_type == 'email_address')
561 564
 					{
562 565
 						$template = '<input type="email" name="%column_name%" id="%column_name%" value="%value%" />';
563
-					}
564
-					else if($extendForm->column_type == 'tel')
566
+					} else if($extendForm->column_type == 'tel')
565 567
 					{
566 568
 						$extentionReplace = array('tel_0' => $extendForm->value[0],
567 569
 							'tel_1' => $extendForm->value[1],
568 570
 							'tel_2' => $extendForm->value[2]);
569 571
 						$template = '<input type="tel" name="%column_name%[]" id="%column_name%" value="%tel_0%" size="4" maxlength="4" style="width:30px" title="First Number" /> - <input type="tel" name="%column_name%[]" value="%tel_1%" size="4" maxlength="4" style="width:35px" title="Second Number" /> - <input type="tel" name="%column_name%[]" value="%tel_2%" size="4" maxlength="4" style="width:35px" title="Third Number" />';
570
-					}
571
-					else if($extendForm->column_type == 'textarea')
572
+					} else if($extendForm->column_type == 'textarea')
572 573
 					{
573 574
 						$template = '<textarea name="%column_name%" id="%column_name%" rows="4" cols="42">%value%</textarea>';
574
-					}
575
-					else if($extendForm->column_type == 'checkbox')
575
+					} else if($extendForm->column_type == 'checkbox')
576 576
 					{
577 577
 						$template = '';
578 578
 						if($extendForm->default_value)
@@ -583,14 +583,15 @@  discard block
 block discarded – undo
583 583
 							foreach($extendForm->default_value as $v)
584 584
 							{
585 585
 								$checked = '';
586
-								if(is_array($extendForm->value) && in_array($v, $extendForm->value))$checked = 'checked="checked"';
586
+								if(is_array($extendForm->value) && in_array($v, $extendForm->value)) {
587
+									$checked = 'checked="checked"';
588
+								}
587 589
 								$optionTag[] = '<label for="%column_name%'.$__i.'"><input type="checkbox" id="%column_name%'.$__i.'" name="%column_name%[]" value="'.$v.'" '.$checked.' /> '.$v.'</label>';
588 590
 								$__i++;
589 591
 							}
590 592
 							$template = sprintf($template, implode('', $optionTag));
591 593
 						}
592
-					}
593
-					else if($extendForm->column_type == 'radio')
594
+					} else if($extendForm->column_type == 'radio')
594 595
 					{
595 596
 						$template = '';
596 597
 						if($extendForm->default_value)
@@ -599,14 +600,16 @@  discard block
 block discarded – undo
599 600
 							$optionTag = array();
600 601
 							foreach($extendForm->default_value as $v)
601 602
 							{
602
-								if($extendForm->value == $v)$checked = 'checked="checked"';
603
-								else $checked = '';
603
+								if($extendForm->value == $v) {
604
+									$checked = 'checked="checked"';
605
+								} else {
606
+									$checked = '';
607
+								}
604 608
 								$optionTag[] = '<label><input type="radio" name="%column_name%" value="'.$v.'" '.$checked.' /> '.$v.'</label>';
605 609
 							}
606 610
 							$template = sprintf($template, implode('', $optionTag));
607 611
 						}
608
-					}
609
-					else if($extendForm->column_type == 'select')
612
+					} else if($extendForm->column_type == 'select')
610 613
 					{
611 614
 						$template = '<select name="'.$formInfo->name.'" id="'.$formInfo->name.'">%s</select>';
612 615
 						$optionTag = array();
@@ -615,26 +618,26 @@  discard block
 block discarded – undo
615 618
 						{
616 619
 							foreach($extendForm->default_value as $v)
617 620
 							{
618
-								if($v == $extendForm->value) $selected = 'selected="selected"';
619
-								else $selected = '';
621
+								if($v == $extendForm->value) {
622
+									$selected = 'selected="selected"';
623
+								} else {
624
+									$selected = '';
625
+								}
620 626
 								$optionTag[] = sprintf('<option value="%s" %s >%s</option>', $v, $selected, $v);
621 627
 							}
622 628
 						}
623 629
 						$template = sprintf($template, implode('', $optionTag));
624
-					}
625
-					else if($extendForm->column_type == 'kr_zip')
630
+					} else if($extendForm->column_type == 'kr_zip')
626 631
 					{
627 632
 						$krzipModel = getModel('krzip');
628 633
 						if($krzipModel && method_exists($krzipModel , 'getKrzipCodeSearchHtml' ))
629 634
 						{
630 635
 							$template = $krzipModel->getKrzipCodeSearchHtml($extendForm->column_name, $extendForm->value);
631 636
 						}
632
-					}
633
-					else if($extendForm->column_type == 'jp_zip')
637
+					} else if($extendForm->column_type == 'jp_zip')
634 638
 					{
635 639
 						$template = '<input type="text" name="%column_name%" id="%column_name%" value="%value%" />';
636
-					}
637
-					else if($extendForm->column_type == 'date')
640
+					} else if($extendForm->column_type == 'date')
638 641
 					{
639 642
 						$extentionReplace = array('date' => zdate($extendForm->value, 'Y-m-d'), 'cmd_delete' => $lang->cmd_delete);
640 643
 						$template = '<input type="hidden" name="%column_name%" id="date_%column_name%" value="%value%" /><input type="text" placeholder="YYYY-MM-DD" class="inputDate" value="%date%" readonly="readonly" /> <input type="button" value="%cmd_delete%" class="btn dateRemover" />';
@@ -643,8 +646,9 @@  discard block
 block discarded – undo
643 646
 					$replace = array_merge($extentionReplace, $replace);
644 647
 					$inputTag = preg_replace_callback('@%(\w+)%@', function($n) use($replace) { return $replace[$n[1]]; }, $template);
645 648
 
646
-					if($extendForm->description)
647
-						$inputTag .= '<p class="help-block">'.$extendForm->description.'</p>';
649
+					if($extendForm->description) {
650
+											$inputTag .= '<p class="help-block">'.$extendForm->description.'</p>';
651
+					}
648 652
 				}
649 653
 				$formTag->inputTag = $inputTag;
650 654
 				$formTags[] = $formTag;
@@ -679,8 +683,9 @@  discard block
 block discarded – undo
679 683
 			$oMemberModel = getModel('member');
680 684
 			$join_form = $oMemberModel->getJoinForm($member_join_form_srl);
681 685
 
682
-			if(!$join_form) Context::set('member_join_form_srl','',true);
683
-			else
686
+			if(!$join_form) {
687
+				Context::set('member_join_form_srl','',true);
688
+			} else
684 689
 			{
685 690
 				Context::set('join_form', $join_form);
686 691
 				$security = new Security();
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -386,7 +386,7 @@
 block discarded – undo
386 386
 	/**
387 387
 	 * Get tags by the member info type 
388 388
 	 *
389
-	 * @param object $memberInfo
389
+	 * @param string $memberInfo
390 390
 	 * @param boolean $isAdmin (true : admin, false : not admin)
391 391
 	 *
392 392
 	 * @return array
Please login to merge, or discard this patch.
modules/communication/communication.class.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -29,17 +29,17 @@  discard block
 block discarded – undo
29 29
 		$oModuleModel = getModel('module');
30 30
 		$oModuleController = getController('module');
31 31
 		$version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated'));
32
-		if($oModuleModel->needUpdate($version_update_id))
32
+		if ($oModuleModel->needUpdate($version_update_id))
33 33
 		{
34 34
 			$config = $oModuleModel->getModuleConfig('message');
35 35
 
36
-			if($config->skin)
36
+			if ($config->skin)
37 37
 			{
38 38
 				$config_parse = explode('.', $config->skin);
39
-				if(count($config_parse) > 1)
39
+				if (count($config_parse) > 1)
40 40
 				{
41 41
 					$template_path = sprintf('./themes/%s/modules/communication/', $config_parse[0]);
42
-					if(is_dir($template_path))
42
+					if (is_dir($template_path))
43 43
 					{
44 44
 						return TRUE;
45 45
 					}
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 			$oModuleController->insertUpdatedLog($version_update_id);
50 50
 		}
51 51
 
52
-		if(!is_dir("./files/member_extra_info/new_message_flags"))
52
+		if (!is_dir("./files/member_extra_info/new_message_flags"))
53 53
 		{
54 54
 			return TRUE;
55 55
 		}
@@ -66,21 +66,21 @@  discard block
 block discarded – undo
66 66
 		$oModuleModel = getModel('module');
67 67
 		$oModuleController = getController('module');
68 68
 		$version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated'));
69
-		if($oModuleModel->needUpdate($version_update_id))
69
+		if ($oModuleModel->needUpdate($version_update_id))
70 70
 		{
71 71
 			$config = $oModuleModel->getModuleConfig('message');
72
-			if(!is_object($config))
72
+			if (!is_object($config))
73 73
 			{
74 74
 				$config = new stdClass();
75 75
 			}
76 76
 
77
-			if($config->skin)
77
+			if ($config->skin)
78 78
 			{
79 79
 				$config_parse = explode('.', $config->skin);
80
-				if(count($config_parse) > 1)
80
+				if (count($config_parse) > 1)
81 81
 				{
82 82
 					$template_path = sprintf('./themes/%s/modules/communication/', $config_parse[0]);
83
-					if(is_dir($template_path))
83
+					if (is_dir($template_path))
84 84
 					{
85 85
 						$config->skin = implode('|@|', $config_parse);
86 86
 						$oModuleController = getController('module');
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 			$oModuleController->insertUpdatedLog($version_update_id);
93 93
 		}
94 94
 
95
-		if(!is_dir("./files/member_extra_info/new_message_flags"))
95
+		if (!is_dir("./files/member_extra_info/new_message_flags"))
96 96
 		{
97 97
 			FileHandler::makeDir('./files/member_extra_info/new_message_flags');
98 98
 		}
Please login to merge, or discard this patch.