GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 78ace2...4b54c6 )
by gyeong-won
09:15
created
modules/board/board.admin.model.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
 
22 22
 	/**
23 23
 	 * Get the board module admin simple setting page
24
-	 * @return void
24
+	 * @return null|string
25 25
 	 */
26 26
 	public function getBoardAdminSimpleSetup($moduleSrl, $setupUrl)
27 27
 	{
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 	 */
26 26
 	public function getBoardAdminSimpleSetup($moduleSrl, $setupUrl)
27 27
 	{
28
-		if(!$moduleSrl)
28
+		if (!$moduleSrl)
29 29
 		{
30 30
 			return;
31 31
 		}
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 		$oModuleModel = getModel('module');
36 36
 		$moduleInfo = $oModuleModel->getModuleInfoByModuleSrl($moduleSrl);
37 37
 		$moduleInfo->use_status = explode('|@|', $moduleInfo->use_status);
38
-		if($moduleInfo)
38
+		if ($moduleInfo)
39 39
 		{
40 40
 			Context::set('module_info', $moduleInfo);
41 41
 		}
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 		Context::set('document_status_list', $documentStatusList);
47 47
 
48 48
 		// set order target list
49
-		foreach($this->order_target AS $key)
49
+		foreach ($this->order_target AS $key)
50 50
 		{
51 51
 			$order_target[$key] = Context::getLang($key);
52 52
 		}
Please login to merge, or discard this patch.
modules/board/board.api.php 3 patches
Doc Comments   +9 added lines patch added patch discarded remove patch
@@ -87,6 +87,9 @@  discard block
 block discarded – undo
87 87
 		$oModule->add('comment_list',$this->arrangeComment(Context::get('comment_list')));
88 88
 	}
89 89
 
90
+	/**
91
+	 * @param string $content_list
92
+	 */
90 93
 	function arrangeContentList($content_list) {
91 94
 		$output = array();
92 95
 		if(count($content_list)) {
@@ -120,6 +123,9 @@  discard block
 block discarded – undo
120 123
 		return $output;
121 124
 	}
122 125
 
126
+	/**
127
+	 * @param string $comment_list
128
+	 */
123 129
 	function arrangeComment($comment_list) {
124 130
 		$output = array();
125 131
 		if(count($comment_list) > 0 ) {
@@ -133,6 +139,9 @@  discard block
 block discarded – undo
133 139
 	}
134 140
 
135 141
 
142
+	/**
143
+	 * @param string $file_list
144
+	 */
136 145
 	function arrangeFile($file_list) {
137 146
 		$output = array();
138 147
 		if(count($file_list) > 0) {
Please login to merge, or discard this patch.
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 	 * @brief notice list
19 19
 	 **/
20 20
 	function dispBoardNoticeList(&$oModule) {
21
-		 $oModule->add('notice_list',$this->arrangeContentList(Context::get('notice_list')));
21
+		 $oModule->add('notice_list', $this->arrangeContentList(Context::get('notice_list')));
22 22
 	}
23 23
 
24 24
 
@@ -29,11 +29,11 @@  discard block
 block discarded – undo
29 29
 		$api_type = Context::get('api_type');
30 30
 		$document_list = $this->arrangeContentList(Context::get('document_list'));
31 31
 
32
-		if($api_type =='summary')
32
+		if ($api_type == 'summary')
33 33
 		{
34 34
 			$content_cut_size = Context::get('content_cut_size');
35
-			$content_cut_size = $content_cut_size?$content_cut_size:50;
36
-			foreach($document_list as $k=>$v)
35
+			$content_cut_size = $content_cut_size ? $content_cut_size : 50;
36
+			foreach ($document_list as $k=>$v)
37 37
 			{
38 38
 				$oDocument = new documentItem();
39 39
 				$oDocument->setAttribute($v, false);
@@ -42,8 +42,8 @@  discard block
 block discarded – undo
42 42
 			}
43 43
 		}
44 44
 
45
-		$oModule->add('document_list',$document_list);
46
-		$oModule->add('page_navigation',Context::get('page_navigation'));
45
+		$oModule->add('document_list', $document_list);
46
+		$oModule->add('page_navigation', Context::get('page_navigation'));
47 47
 	}
48 48
 
49 49
 
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 	 * @brief category list
52 52
 	 **/
53 53
 	function dispBoardCategoryList(&$oModule) {
54
-		$oModule->add('category_list',Context::get('category_list'));
54
+		$oModule->add('category_list', Context::get('category_list'));
55 55
 	}
56 56
 
57 57
 	/**
@@ -60,11 +60,11 @@  discard block
 block discarded – undo
60 60
 	function dispBoardContentView(&$oModule) {
61 61
 		$oDocument = Context::get('oDocument');
62 62
 		$extra_vars = $oDocument->getExtraVars();
63
-		if($oDocument->isGranted())
63
+		if ($oDocument->isGranted())
64 64
 		{
65
-			$oDocument->add('extra_vars',$this->arrangeExtraVars($extra_vars));
65
+			$oDocument->add('extra_vars', $this->arrangeExtraVars($extra_vars));
66 66
 		}
67
-		$oModule->add('oDocument',$this->arrangeContent($oDocument));
67
+		$oModule->add('oDocument', $this->arrangeContent($oDocument));
68 68
 	}
69 69
 
70 70
 
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 	 **/
74 74
 	function dispBoardContentFileList(&$oModule) {
75 75
 		$oDocument = Context::get('oDocument');
76
-		if($oDocument->isAccessible())
76
+		if ($oDocument->isAccessible())
77 77
 		{
78 78
 			$oModule->add('file_list', $this->arrangeFile(Context::get('file_list')));
79 79
 		}
@@ -88,20 +88,20 @@  discard block
 block discarded – undo
88 88
 	 * @brief tag list
89 89
 	 **/
90 90
 	function dispBoardTagList(&$oModule) {
91
-		$oModule->add('tag_list',Context::get('tag_list'));
91
+		$oModule->add('tag_list', Context::get('tag_list'));
92 92
 	}
93 93
 
94 94
 	/**
95 95
 	 * @brief comments list
96 96
 	 **/
97 97
 	function dispBoardContentCommentList(&$oModule) {
98
-		$oModule->add('comment_list',$this->arrangeComment(Context::get('comment_list')));
98
+		$oModule->add('comment_list', $this->arrangeComment(Context::get('comment_list')));
99 99
 	}
100 100
 
101 101
 	function arrangeContentList($content_list) {
102 102
 		$output = array();
103
-		if(count($content_list)) {
104
-			foreach($content_list as $key => $val) $output[] = $this->arrangeContent($val);
103
+		if (count($content_list)) {
104
+			foreach ($content_list as $key => $val) $output[] = $this->arrangeContent($val);
105 105
 		}
106 106
 		return $output;
107 107
 	}
@@ -110,16 +110,16 @@  discard block
 block discarded – undo
110 110
 	function arrangeContent($content) {
111 111
 		$oBoardView = getView('board');
112 112
 		$output = new stdClass;
113
-		if($content){
114
-			$output = $content->gets('document_srl','category_srl','member_srl','nick_name','title','content','tags','readed_count','voted_count','blamed_count','comment_count','regdate','last_update','extra_vars','status');
113
+		if ($content) {
114
+			$output = $content->gets('document_srl', 'category_srl', 'member_srl', 'nick_name', 'title', 'content', 'tags', 'readed_count', 'voted_count', 'blamed_count', 'comment_count', 'regdate', 'last_update', 'extra_vars', 'status');
115 115
 
116
-			if(!$oBoardView->grant->view)
116
+			if (!$oBoardView->grant->view)
117 117
 			{
118 118
 				unset($output->content);
119 119
 				unset($output->tags);
120 120
 				unset($output->extra_vars);
121 121
 			}
122
-			if(!$content->isAccessible())
122
+			if (!$content->isAccessible())
123 123
 			{
124 124
 				$output->content = Context::getLang('msg_is_secret');
125 125
 			}
@@ -137,11 +137,11 @@  discard block
 block discarded – undo
137 137
 
138 138
 	function arrangeComment($comment_list) {
139 139
 		$output = array();
140
-		if(count($comment_list) > 0 ) {
141
-			foreach($comment_list as $key => $val){
140
+		if (count($comment_list) > 0) {
141
+			foreach ($comment_list as $key => $val) {
142 142
 				$item = null;
143
-				$item = $val->gets('comment_srl','parent_srl','depth','nick_name','content','is_secret','voted_count','blamed_count','regdate','last_update');
144
-				if(!$val->isAccessible())
143
+				$item = $val->gets('comment_srl', 'parent_srl', 'depth', 'nick_name', 'content', 'is_secret', 'voted_count', 'blamed_count', 'regdate', 'last_update');
144
+				if (!$val->isAccessible())
145 145
 				{
146 146
 					$item->content = Context::getLang('msg_is_secret');
147 147
 				}
@@ -154,8 +154,8 @@  discard block
 block discarded – undo
154 154
 
155 155
 	function arrangeFile($file_list) {
156 156
 		$output = array();
157
-		if(count($file_list) > 0) {
158
-			foreach($file_list as $key => $val){
157
+		if (count($file_list) > 0) {
158
+			foreach ($file_list as $key => $val) {
159 159
 				$item = new stdClass;
160 160
 				$item->download_count = $val->download_count;
161 161
 				$item->source_filename = $val->source_filename;
@@ -169,8 +169,8 @@  discard block
 block discarded – undo
169 169
 
170 170
 	function arrangeExtraVars($list) {
171 171
 		$output = array();
172
-		if(count($list)) {
173
-			foreach($list as $key => $val){
172
+		if (count($list)) {
173
+			foreach ($list as $key => $val) {
174 174
 				$item = new stdClass;
175 175
 				$item->name = $val->name;
176 176
 				$item->type = $val->type;
Please login to merge, or discard this patch.
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -76,8 +76,7 @@  discard block
 block discarded – undo
76 76
 		if($oDocument->isAccessible())
77 77
 		{
78 78
 			$oModule->add('file_list', $this->arrangeFile(Context::get('file_list')));
79
-		}
80
-		else
79
+		} else
81 80
 		{
82 81
 			$oModule->add('file_list', array());
83 82
 		}
@@ -101,7 +100,9 @@  discard block
 block discarded – undo
101 100
 	function arrangeContentList($content_list) {
102 101
 		$output = array();
103 102
 		if(count($content_list)) {
104
-			foreach($content_list as $key => $val) $output[] = $this->arrangeContent($val);
103
+			foreach($content_list as $key => $val) {
104
+				$output[] = $this->arrangeContent($val);
105
+			}
105 106
 		}
106 107
 		return $output;
107 108
 	}
Please login to merge, or discard this patch.
modules/board/board.view.php 3 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -747,6 +747,9 @@
 block discarded – undo
747 747
 		$this->setTemplateFile('write_form');
748 748
 	}
749 749
 
750
+	/**
751
+	 * @param ModuleObject $oDocumentModel
752
+	 */
750 753
 	function _getStatusNameList(&$oDocumentModel)
751 754
 	{
752 755
 		$resultList = array();
Please login to merge, or discard this patch.
Braces   +62 added lines, -38 removed lines patch added patch discarded remove patch
@@ -53,18 +53,15 @@  discard block
 block discarded – undo
53 53
 			if($this->module_info->hide_category)
54 54
 			{
55 55
 				$this->module_info->use_category = ($this->module_info->hide_category == 'Y') ? 'N' : 'Y';
56
-			}
57
-			else if($this->module_info->use_category)
56
+			} else if($this->module_info->use_category)
58 57
 			{
59 58
 				$this->module_info->hide_category = ($this->module_info->use_category == 'Y') ? 'N' : 'Y';
60
-			}
61
-			else
59
+			} else
62 60
 			{
63 61
 				$this->module_info->hide_category = 'N';
64 62
 				$this->module_info->use_category = 'Y';
65 63
 			}
66
-		}
67
-		else
64
+		} else
68 65
 		{
69 66
 			$this->module_info->hide_category = 'Y';
70 67
 			$this->module_info->use_category = 'N';
@@ -84,8 +81,7 @@  discard block
 block discarded – undo
84 81
 				$this->grant->write_comment = FALSE;
85 82
 				$this->grant->view = FALSE;
86 83
 			}
87
-		}
88
-		else
84
+		} else
89 85
 		{
90 86
 			$this->consultation = FALSE;
91 87
 		}
@@ -160,13 +156,17 @@  discard block
 block discarded – undo
160 156
 		 * add extra vaiables to the search options
161 157
 		 **/
162 158
 		// use search options on the template (the search options key has been declared, based on the language selected)
163
-		foreach($this->search_option as $opt) $search_option[$opt] = Context::getLang($opt);
159
+		foreach($this->search_option as $opt) {
160
+			$search_option[$opt] = Context::getLang($opt);
161
+		}
164 162
 		$extra_keys = Context::get('extra_keys');
165 163
 		if($extra_keys)
166 164
 		{
167 165
 			foreach($extra_keys as $key => $val)
168 166
 			{
169
-				if($val->search == 'Y') $search_option['extra_vars'.$val->idx] = $val->name;
167
+				if($val->search == 'Y') {
168
+					$search_option['extra_vars'.$val->idx] = $val->name;
169
+				}
170 170
 			}
171 171
 		}
172 172
 		// remove a search option that is not public in member config
@@ -175,8 +175,9 @@  discard block
 block discarded – undo
175 175
 		{
176 176
 			if(in_array($signupFormElement->title, $search_option))
177 177
 			{
178
-				if($signupFormElement->isPublic == 'N')
179
-					unset($search_option[$signupFormElement->name]);
178
+				if($signupFormElement->isPublic == 'N') {
179
+									unset($search_option[$signupFormElement->name]);
180
+				}
180 181
 			}
181 182
 		}
182 183
 		Context::set('search_option', $search_option);
@@ -194,7 +195,9 @@  discard block
 block discarded – undo
194 195
 		// list config, columnList setting
195 196
 		$oBoardModel = getModel('board');
196 197
 		$this->listConfig = $oBoardModel->getListConfig($this->module_info->module_srl);
197
-		if(!$this->listConfig) $this->listConfig = array();
198
+		if(!$this->listConfig) {
199
+			$this->listConfig = array();
200
+		}
198 201
 		$this->_makeListColumnList();
199 202
 
200 203
 		// display the notice list
@@ -265,7 +268,9 @@  discard block
 block discarded – undo
265 268
 				}
266 269
 
267 270
 				// check the manage grant
268
-				if($this->grant->manager) $oDocument->setGrant();
271
+				if($this->grant->manager) {
272
+					$oDocument->setGrant();
273
+				}
269 274
 
270 275
 				// if the consultation function is enabled, and the document is not a notice
271 276
 				if($this->consultation && !$oDocument->isNotice())
@@ -286,8 +291,7 @@  discard block
 block discarded – undo
286 291
 					}
287 292
 				}
288 293
 
289
-			}
290
-			else
294
+			} else
291 295
 			{
292 296
 				// if the document is not existed, then alert a warning message
293 297
 				Context::set('document_srl','',true);
@@ -297,8 +301,7 @@  discard block
 block discarded – undo
297 301
 		/**
298 302
 		 * if the document is not existed, get an empty document
299 303
 		 **/
300
-		}
301
-		else
304
+		} else
302 305
 		{
303 306
 			$oDocument = $oDocumentModel->getDocument(0);
304 307
 		}
@@ -313,8 +316,7 @@  discard block
 block discarded – undo
313 316
 				$oDocument = $oDocumentModel->getDocument(0);
314 317
 				Context::set('document_srl','',true);
315 318
 				$this->alertMessage('msg_not_permitted');
316
-			}
317
-			else
319
+			} else
318 320
 			{
319 321
 				// add the document title to the browser
320 322
 				Context::addBrowserTitle($oDocument->getTitleText());
@@ -368,13 +370,16 @@  discard block
 block discarded – undo
368 370
 		$downloadGrantCount = 0;
369 371
 		if(is_array($file_module_config->download_grant))
370 372
 		{
371
-			foreach($file_module_config->download_grant AS $value)
372
-				if($value) $downloadGrantCount++;
373
+			foreach($file_module_config->download_grant AS $value) {
374
+							if($value) $downloadGrantCount++;
375
+			}
373 376
 		}
374 377
 
375 378
 		if(is_array($file_module_config->download_grant) && $downloadGrantCount>0)
376 379
 		{
377
-			if(!Context::get('is_logged')) return $this->stop('msg_not_permitted_download');
380
+			if(!Context::get('is_logged')) {
381
+				return $this->stop('msg_not_permitted_download');
382
+			}
378 383
 			$logged_info = Context::get('logged_info');
379 384
 			if($logged_info->is_admin != 'Y')
380 385
 			{
@@ -397,7 +402,9 @@  discard block
 block discarded – undo
397 402
 							break;
398 403
 						}
399 404
 					}
400
-					if(!$is_permitted) return $this->stop('msg_not_permitted_download');
405
+					if(!$is_permitted) {
406
+						return $this->stop('msg_not_permitted_download');
407
+					}
401 408
 				}
402 409
 			}
403 410
 		}
@@ -560,7 +567,9 @@  discard block
 block discarded – undo
560 567
 				'allow_trackback', 'notify_message', 'status', 'comment_status');
561 568
 		$this->columnList = array_intersect($configColumList, $tableColumnList);
562 569
 
563
-		if(in_array('summary', $configColumList)) array_push($this->columnList, 'content');
570
+		if(in_array('summary', $configColumList)) {
571
+			array_push($this->columnList, 'content');
572
+		}
564 573
 
565 574
 		// default column list add
566 575
 		$defaultColumn = array('document_srl', 'module_srl', 'category_srl', 'lang_code', 'member_srl', 'last_update', 'comment_count', 'trackback_count', 'uploaded_count', 'status', 'regdate', 'title_bold', 'title_color');
@@ -654,8 +663,7 @@  discard block
 block discarded – undo
654 663
 			{
655 664
 				$logged_info = Context::get('logged_info');
656 665
 				$group_srls = array_keys($logged_info->group_list);
657
-			}
658
-			else
666
+			} else
659 667
 			{
660 668
 				$group_srls = array();
661 669
 			}
@@ -672,10 +680,14 @@  discard block
 block discarded – undo
672 680
 					{
673 681
 						$category_group_srls = explode(',',$category->group_srls);
674 682
 						$is_granted = FALSE;
675
-						if(count(array_intersect($group_srls, $category_group_srls))) $is_granted = TRUE;
683
+						if(count(array_intersect($group_srls, $category_group_srls))) {
684
+							$is_granted = TRUE;
685
+						}
676 686
 
677 687
 					}
678
-					if($is_granted) $category_list[$category_srl] = $category;
688
+					if($is_granted) {
689
+						$category_list[$category_srl] = $category;
690
+					}
679 691
 				}
680 692
 			}
681 693
 			Context::set('category_list', $category_list);
@@ -686,7 +698,9 @@  discard block
 block discarded – undo
686 698
 		$oDocument = $oDocumentModel->getDocument(0, $this->grant->manager);
687 699
 		$oDocument->setDocument($document_srl);
688 700
 
689
-		if($oDocument->get('module_srl') == $oDocument->get('member_srl')) $savedDoc = TRUE;
701
+		if($oDocument->get('module_srl') == $oDocument->get('member_srl')) {
702
+			$savedDoc = TRUE;
703
+		}
690 704
 		$oDocument->add('module_srl', $this->module_srl);
691 705
 
692 706
 		if($oDocument->isExists() && $this->module_info->protect_content=="Y" && $oDocument->get('comment_count')>0 && $this->grant->manager==false)
@@ -712,17 +726,20 @@  discard block
 block discarded – undo
712 726
 				if( !$logged_info )
713 727
 				{
714 728
 					return $this->dispBoardMessage('msg_not_permitted');
715
-				}
716
-				else if (($oPointModel->getPoint($logged_info->member_srl) + $pointForInsert )< 0 )
729
+				} else if (($oPointModel->getPoint($logged_info->member_srl) + $pointForInsert )< 0 )
717 730
 				{
718 731
 					return $this->dispBoardMessage('msg_not_enough_point');
719 732
 				}
720 733
 			}
721 734
 		}
722
-		if(!$oDocument->get('status')) $oDocument->add('status', $oDocumentModel->getDefaultStatus());
735
+		if(!$oDocument->get('status')) {
736
+			$oDocument->add('status', $oDocumentModel->getDefaultStatus());
737
+		}
723 738
 
724 739
 		$statusList = $this->_getStatusNameList($oDocumentModel);
725
-		if(count($statusList) > 0) Context::set('status_list', $statusList);
740
+		if(count($statusList) > 0) {
741
+			Context::set('status_list', $statusList);
742
+		}
726 743
 
727 744
 		// get Document status config value
728 745
 		Context::set('document_srl',$document_srl);
@@ -733,13 +750,18 @@  discard block
 block discarded – undo
733 750
 		$oDocumentController->addXmlJsFilter($this->module_info->module_srl);
734 751
 
735 752
 		// if the document exists, then setup extra variabels on context
736
-		if($oDocument->isExists() && !$savedDoc) Context::set('extra_keys', $oDocument->getExtraVars());
753
+		if($oDocument->isExists() && !$savedDoc) {
754
+			Context::set('extra_keys', $oDocument->getExtraVars());
755
+		}
737 756
 
738 757
 		/**
739 758
 		 * add JS filters
740 759
 		 **/
741
-		if(Context::get('logged_info')->is_admin=='Y') Context::addJsFilter($this->module_path.'tpl/filter', 'insert_admin.xml');
742
-		else Context::addJsFilter($this->module_path.'tpl/filter', 'insert.xml');
760
+		if(Context::get('logged_info')->is_admin=='Y') {
761
+			Context::addJsFilter($this->module_path.'tpl/filter', 'insert_admin.xml');
762
+		} else {
763
+			Context::addJsFilter($this->module_path.'tpl/filter', 'insert.xml');
764
+		}
743 765
 
744 766
 		$oSecurity = new Security();
745 767
 		$oSecurity->encodeHTML('category_list.text', 'category_list.title');
@@ -1054,7 +1076,9 @@  discard block
 block discarded – undo
1054 1076
 	function dispBoardMessage($msg_code)
1055 1077
 	{
1056 1078
 		$msg = Context::getLang($msg_code);
1057
-		if(!$msg) $msg = $msg_code;
1079
+		if(!$msg) {
1080
+			$msg = $msg_code;
1081
+		}
1058 1082
 		Context::set('message', $msg);
1059 1083
 		$this->setTemplateFile('message');
1060 1084
 	}
Please login to merge, or discard this patch.
Spacing   +150 added lines, -150 removed lines patch added patch discarded remove patch
@@ -23,15 +23,15 @@  discard block
 block discarded – undo
23 23
 		/**
24 24
 		 * setup the module general information
25 25
 		 **/
26
-		if($this->module_info->list_count)
26
+		if ($this->module_info->list_count)
27 27
 		{
28 28
 			$this->list_count = $this->module_info->list_count;
29 29
 		}
30
-		if($this->module_info->search_list_count)
30
+		if ($this->module_info->search_list_count)
31 31
 		{
32 32
 			$this->search_list_count = $this->module_info->search_list_count;
33 33
 		}
34
-		if($this->module_info->page_count)
34
+		if ($this->module_info->page_count)
35 35
 		{
36 36
 			$this->page_count = $this->module_info->page_count;
37 37
 		}
@@ -41,20 +41,20 @@  discard block
 block discarded – undo
41 41
 		$oDocumentModel = getModel('document');
42 42
 
43 43
 		$statusList = $this->_getStatusNameList($oDocumentModel);
44
-		if(isset($statusList['SECRET']))
44
+		if (isset($statusList['SECRET']))
45 45
 		{
46 46
 			$this->module_info->secret = 'Y';
47 47
 		}
48 48
 
49 49
 		// use_category <=1.5.x, hide_category >=1.7.x
50 50
 		$count_category = count($oDocumentModel->getCategoryList($this->module_info->module_srl));
51
-		if($count_category)
51
+		if ($count_category)
52 52
 		{
53
-			if($this->module_info->hide_category)
53
+			if ($this->module_info->hide_category)
54 54
 			{
55 55
 				$this->module_info->use_category = ($this->module_info->hide_category == 'Y') ? 'N' : 'Y';
56 56
 			}
57
-			else if($this->module_info->use_category)
57
+			else if ($this->module_info->use_category)
58 58
 			{
59 59
 				$this->module_info->hide_category = ($this->module_info->use_category == 'Y') ? 'N' : 'Y';
60 60
 			}
@@ -74,10 +74,10 @@  discard block
 block discarded – undo
74 74
 		 * check the consultation function, if the user is admin then swich off consultation function
75 75
 		 * if the user is not logged, then disppear write document/write comment./ view document
76 76
 		 **/
77
-		if($this->module_info->consultation == 'Y' && !$this->grant->manager && !$this->grant->consultation_read)
77
+		if ($this->module_info->consultation == 'Y' && !$this->grant->manager && !$this->grant->consultation_read)
78 78
 		{
79 79
 			$this->consultation = TRUE;
80
-			if(!Context::get('is_logged'))
80
+			if (!Context::get('is_logged'))
81 81
 			{
82 82
 				$this->grant->list = FALSE;
83 83
 				$this->grant->write_document = FALSE;
@@ -94,11 +94,11 @@  discard block
 block discarded – undo
94 94
 		 * setup the template path based on the skin
95 95
 		 * the default skin is default
96 96
 		 **/
97
-		$template_path = sprintf("%sskins/%s/",$this->module_path, $this->module_info->skin);
98
-		if(!is_dir($template_path)||!$this->module_info->skin)
97
+		$template_path = sprintf("%sskins/%s/", $this->module_path, $this->module_info->skin);
98
+		if (!is_dir($template_path) || !$this->module_info->skin)
99 99
 		{
100 100
 			$this->module_info->skin = 'default';
101
-			$template_path = sprintf("%sskins/%s/",$this->module_path, $this->module_info->skin);
101
+			$template_path = sprintf("%sskins/%s/", $this->module_path, $this->module_info->skin);
102 102
 		}
103 103
 		$this->setTemplatePath($template_path);
104 104
 
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 		 **/
115 115
 		if (is_array($extra_keys))
116 116
 		{
117
-			foreach($extra_keys as $val)
117
+			foreach ($extra_keys as $val)
118 118
 			{
119 119
 				$this->order_target[] = $val->eid;
120 120
 			}
@@ -127,9 +127,9 @@  discard block
 block discarded – undo
127 127
 
128 128
 		// remove [document_srl]_cpage from get_vars
129 129
 		$args = Context::getRequestVars();
130
-		foreach($args as $name => $value)
130
+		foreach ($args as $name => $value)
131 131
 		{
132
-			if(preg_match('/[0-9]+_cpage/', $name))
132
+			if (preg_match('/[0-9]+_cpage/', $name))
133 133
 			{
134 134
 				Context::set($name, '', TRUE);
135 135
 				Context::set($name, $value);
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 		/**
146 146
 		 * check the access grant (all the grant has been set by the module object)
147 147
 		 **/
148
-		if(!$this->grant->access || !$this->grant->list)
148
+		if (!$this->grant->access || !$this->grant->list)
149 149
 		{
150 150
 			return $this->dispBoardMessage('msg_not_permitted');
151 151
 		}
@@ -160,22 +160,22 @@  discard block
 block discarded – undo
160 160
 		 * add extra vaiables to the search options
161 161
 		 **/
162 162
 		// use search options on the template (the search options key has been declared, based on the language selected)
163
-		foreach($this->search_option as $opt) $search_option[$opt] = Context::getLang($opt);
163
+		foreach ($this->search_option as $opt) $search_option[$opt] = Context::getLang($opt);
164 164
 		$extra_keys = Context::get('extra_keys');
165
-		if($extra_keys)
165
+		if ($extra_keys)
166 166
 		{
167
-			foreach($extra_keys as $key => $val)
167
+			foreach ($extra_keys as $key => $val)
168 168
 			{
169
-				if($val->search == 'Y') $search_option['extra_vars'.$val->idx] = $val->name;
169
+				if ($val->search == 'Y') $search_option['extra_vars'.$val->idx] = $val->name;
170 170
 			}
171 171
 		}
172 172
 		// remove a search option that is not public in member config
173 173
 		$memberConfig = getModel('module')->getModuleConfig('member');
174
-		foreach($memberConfig->signupForm as $signupFormElement)
174
+		foreach ($memberConfig->signupForm as $signupFormElement)
175 175
 		{
176
-			if(in_array($signupFormElement->title, $search_option))
176
+			if (in_array($signupFormElement->title, $search_option))
177 177
 			{
178
-				if($signupFormElement->isPublic == 'N')
178
+				if ($signupFormElement->isPublic == 'N')
179 179
 					unset($search_option[$signupFormElement->name]);
180 180
 			}
181 181
 		}
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 
184 184
 		$oDocumentModel = getModel('document');
185 185
 		$statusNameList = $this->_getStatusNameList($oDocumentModel);
186
-		if(count($statusNameList) > 0)
186
+		if (count($statusNameList) > 0)
187 187
 		{
188 188
 			Context::set('status_list', $statusNameList);
189 189
 		}
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
 		// list config, columnList setting
195 195
 		$oBoardModel = getModel('board');
196 196
 		$this->listConfig = $oBoardModel->getListConfig($this->module_info->module_srl);
197
-		if(!$this->listConfig) $this->listConfig = array();
197
+		if (!$this->listConfig) $this->listConfig = array();
198 198
 		$this->_makeListColumnList();
199 199
 
200 200
 		// display the notice list
@@ -218,12 +218,12 @@  discard block
 block discarded – undo
218 218
 	/**
219 219
 	 * @brief display the category list
220 220
 	 **/
221
-	function dispBoardCategoryList(){
221
+	function dispBoardCategoryList() {
222 222
 		// check if the use_category option is enabled
223
-		if($this->module_info->use_category=='Y')
223
+		if ($this->module_info->use_category == 'Y')
224 224
 		{
225 225
 			// check the grant
226
-			if(!$this->grant->list)
226
+			if (!$this->grant->list)
227 227
 			{
228 228
 				Context::set('category_list', array());
229 229
 				return;
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 	/**
241 241
 	 * @brief display the board conent view
242 242
 	 **/
243
-	function dispBoardContentView(){
243
+	function dispBoardContentView() {
244 244
 		// get the variable value
245 245
 		$document_srl = Context::get('document_srl');
246 246
 		$page = Context::get('page');
@@ -251,36 +251,36 @@  discard block
 block discarded – undo
251 251
 		/**
252 252
 		 * if the document exists, then get the document information
253 253
 		 **/
254
-		if($document_srl)
254
+		if ($document_srl)
255 255
 		{
256 256
 			$oDocument = $oDocumentModel->getDocument($document_srl, false, true);
257 257
 
258 258
 			// if the document is existed
259
-			if($oDocument->isExists())
259
+			if ($oDocument->isExists())
260 260
 			{
261 261
 				// if the module srl is not consistent
262
-				if($oDocument->get('module_srl')!=$this->module_info->module_srl )
262
+				if ($oDocument->get('module_srl') != $this->module_info->module_srl)
263 263
 				{
264 264
 					return $this->stop('msg_invalid_request');
265 265
 				}
266 266
 
267 267
 				// check the manage grant
268
-				if($this->grant->manager) $oDocument->setGrant();
268
+				if ($this->grant->manager) $oDocument->setGrant();
269 269
 
270 270
 				// if the consultation function is enabled, and the document is not a notice
271
-				if($this->consultation && !$oDocument->isNotice())
271
+				if ($this->consultation && !$oDocument->isNotice())
272 272
 				{
273 273
 					$logged_info = Context::get('logged_info');
274
-					if($oDocument->get('member_srl')!=$logged_info->member_srl)
274
+					if ($oDocument->get('member_srl') != $logged_info->member_srl)
275 275
 					{
276 276
 						$oDocument = $oDocumentModel->getDocument(0);
277 277
 					}
278 278
 				}
279 279
 
280 280
 				// if the document is TEMP saved, check Grant
281
-				if($oDocument->getStatus() == 'TEMP')
281
+				if ($oDocument->getStatus() == 'TEMP')
282 282
 				{
283
-					if(!$oDocument->isGranted())
283
+					if (!$oDocument->isGranted())
284 284
 					{
285 285
 						$oDocument = $oDocumentModel->getDocument(0);
286 286
 					}
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
 			else
291 291
 			{
292 292
 				// if the document is not existed, then alert a warning message
293
-				Context::set('document_srl','',true);
293
+				Context::set('document_srl', '', true);
294 294
 				$this->alertMessage('msg_not_founded');
295 295
 			}
296 296
 
@@ -306,12 +306,12 @@  discard block
 block discarded – undo
306 306
 		/**
307 307
 		 *check the document view grant
308 308
 		 **/
309
-		if($oDocument->isExists())
309
+		if ($oDocument->isExists())
310 310
 		{
311
-			if(!$this->grant->view && !$oDocument->isGranted())
311
+			if (!$this->grant->view && !$oDocument->isGranted())
312 312
 			{
313 313
 				$oDocument = $oDocumentModel->getDocument(0);
314
-				Context::set('document_srl','',true);
314
+				Context::set('document_srl', '', true);
315 315
 				$this->alertMessage('msg_not_permitted');
316 316
 			}
317 317
 			else
@@ -320,15 +320,15 @@  discard block
 block discarded – undo
320 320
 				Context::addBrowserTitle($oDocument->getTitleText());
321 321
 
322 322
 				// update the document view count (if the document is not secret)
323
-				if(!$oDocument->isSecret() || $oDocument->isGranted())
323
+				if (!$oDocument->isSecret() || $oDocument->isGranted())
324 324
 				{
325 325
 					$oDocument->updateReadedCount();
326 326
 				}
327 327
 
328 328
 				// disappear the document if it is secret
329
-				if($oDocument->isSecret() && !$oDocument->isGranted())
329
+				if ($oDocument->isSecret() && !$oDocument->isGranted())
330 330
 				{
331
-					$oDocument->add('content',Context::getLang('thisissecret'));
331
+					$oDocument->add('content', Context::getLang('thisissecret'));
332 332
 				}
333 333
 			}
334 334
 		}
@@ -348,11 +348,11 @@  discard block
 block discarded – undo
348 348
 	/**
349 349
 	 * @brief  display the document file list (can be used by API)
350 350
 	 **/
351
-	function dispBoardContentFileList(){
351
+	function dispBoardContentFileList() {
352 352
 		/**
353 353
 		 * check the access grant (all the grant has been set by the module object)
354 354
 		 **/
355
-		if(!$this->grant->access)
355
+		if (!$this->grant->access)
356 356
 		{
357 357
 			return $this->dispBoardMessage('msg_not_permitted');
358 358
 		}
@@ -363,41 +363,41 @@  discard block
 block discarded – undo
363 363
 		// Check if a permission for file download is granted
364 364
 		// Get configurations (using module model object)
365 365
 		$oModuleModel = getModel('module');
366
-		$file_module_config = $oModuleModel->getModulePartConfig('file',$this->module_srl);
366
+		$file_module_config = $oModuleModel->getModulePartConfig('file', $this->module_srl);
367 367
 		
368 368
 		$downloadGrantCount = 0;
369
-		if(is_array($file_module_config->download_grant))
369
+		if (is_array($file_module_config->download_grant))
370 370
 		{
371
-			foreach($file_module_config->download_grant AS $value)
372
-				if($value) $downloadGrantCount++;
371
+			foreach ($file_module_config->download_grant AS $value)
372
+				if ($value) $downloadGrantCount++;
373 373
 		}
374 374
 
375
-		if(is_array($file_module_config->download_grant) && $downloadGrantCount>0)
375
+		if (is_array($file_module_config->download_grant) && $downloadGrantCount > 0)
376 376
 		{
377
-			if(!Context::get('is_logged')) return $this->stop('msg_not_permitted_download');
377
+			if (!Context::get('is_logged')) return $this->stop('msg_not_permitted_download');
378 378
 			$logged_info = Context::get('logged_info');
379
-			if($logged_info->is_admin != 'Y')
379
+			if ($logged_info->is_admin != 'Y')
380 380
 			{
381
-				$oModuleModel =& getModel('module');
381
+				$oModuleModel = & getModel('module');
382 382
 				$columnList = array('module_srl', 'site_srl');
383 383
 				$module_info = $oModuleModel->getModuleInfoByModuleSrl($this->module_srl, $columnList);
384 384
 
385
-				if(!$oModuleModel->isSiteAdmin($logged_info, $module_info->site_srl))
385
+				if (!$oModuleModel->isSiteAdmin($logged_info, $module_info->site_srl))
386 386
 				{
387
-					$oMemberModel =& getModel('member');
387
+					$oMemberModel = & getModel('member');
388 388
 					$member_groups = $oMemberModel->getMemberGroups($logged_info->member_srl, $module_info->site_srl);
389 389
 
390 390
 					$is_permitted = false;
391
-					for($i=0;$i<count($file_module_config->download_grant);$i++)
391
+					for ($i = 0; $i < count($file_module_config->download_grant); $i++)
392 392
 					{
393 393
 						$group_srl = $file_module_config->download_grant[$i];
394
-						if($member_groups[$group_srl])
394
+						if ($member_groups[$group_srl])
395 395
 						{
396 396
 							$is_permitted = true;
397 397
 							break;
398 398
 						}
399 399
 					}
400
-					if(!$is_permitted) return $this->stop('msg_not_permitted_download');
400
+					if (!$is_permitted) return $this->stop('msg_not_permitted_download');
401 401
 				}
402 402
 			}
403 403
 		}
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
 		$document_srl = Context::get('document_srl');
407 407
 		$oDocument = $oDocumentModel->getDocument($document_srl);
408 408
 		Context::set('oDocument', $oDocument);
409
-		Context::set('file_list',$oDocument->getUploadedFiles());
409
+		Context::set('file_list', $oDocument->getUploadedFiles());
410 410
 
411 411
 		$oSecurity = new Security();
412 412
 		$oSecurity->encodeHTML('file_list..source_filename');
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
 	/**
416 416
 	 * @brief display the document comment list (can be used by API)
417 417
 	 **/
418
-	function dispBoardContentCommentList(){
418
+	function dispBoardContentCommentList() {
419 419
 		// check document view grant
420 420
 		$this->dispBoardContentView();
421 421
 
@@ -425,26 +425,26 @@  discard block
 block discarded – undo
425 425
 		$comment_list = $oDocument->getComments();
426 426
 
427 427
 		// setup the comment list
428
-		if(is_array($comment_list))
428
+		if (is_array($comment_list))
429 429
 		{
430
-			foreach($comment_list as $key => $val)
430
+			foreach ($comment_list as $key => $val)
431 431
 			{
432
-				if(!$val->isAccessible())
432
+				if (!$val->isAccessible())
433 433
 				{
434
-					$val->add('content',Context::getLang('thisissecret'));
434
+					$val->add('content', Context::getLang('thisissecret'));
435 435
 				}
436 436
 			}
437 437
 		}
438
-		Context::set('comment_list',$comment_list);
438
+		Context::set('comment_list', $comment_list);
439 439
 
440 440
 	}
441 441
 
442 442
 	/**
443 443
 	 * @brief display notice list (can be used by API)
444 444
 	 **/
445
-	function dispBoardNoticeList(){
445
+	function dispBoardNoticeList() {
446 446
 		// check the grant
447
-		if(!$this->grant->list)
447
+		if (!$this->grant->list)
448 448
 		{
449 449
 			Context::set('notice_list', array());
450 450
 			return;
@@ -460,15 +460,15 @@  discard block
 block discarded – undo
460 460
 	/**
461 461
 	 * @brief display board content list
462 462
 	 **/
463
-	function dispBoardContentList(){
463
+	function dispBoardContentList() {
464 464
 		// check the grant
465
-		if(!$this->grant->list)
465
+		if (!$this->grant->list)
466 466
 		{
467 467
 			Context::set('document_list', array());
468 468
 			Context::set('total_count', 0);
469 469
 			Context::set('total_page', 1);
470 470
 			Context::set('page', 1);
471
-			Context::set('page_navigation', new PageHandler(0,0,1,10));
471
+			Context::set('page_navigation', new PageHandler(0, 0, 1, 10));
472 472
 			return;
473 473
 		}
474 474
 
@@ -486,17 +486,17 @@  discard block
 block discarded – undo
486 486
 		$args->search_keyword = Context::get('search_keyword');
487 487
 
488 488
 		$search_option = Context::get('search_option');
489
-		if($search_option==FALSE)
489
+		if ($search_option == FALSE)
490 490
 		{
491 491
 			$search_option = $this->search_option;
492 492
 		}
493
-		if(isset($search_option[$args->search_target])==FALSE)
493
+		if (isset($search_option[$args->search_target]) == FALSE)
494 494
 		{
495 495
 			$args->search_target = '';
496 496
 		}
497 497
 
498 498
 		// if the category is enabled, then get the category
499
-		if($this->module_info->use_category=='Y')
499
+		if ($this->module_info->use_category == 'Y')
500 500
 		{
501 501
 			$args->category_srl = Context::get('category');
502 502
 		}
@@ -504,21 +504,21 @@  discard block
 block discarded – undo
504 504
 		// setup the sort index and order index
505 505
 		$args->sort_index = Context::get('sort_index');
506 506
 		$args->order_type = Context::get('order_type');
507
-		if(!in_array($args->sort_index, $this->order_target))
507
+		if (!in_array($args->sort_index, $this->order_target))
508 508
 		{
509
-			$args->sort_index = $this->module_info->order_target?$this->module_info->order_target:'list_order';
509
+			$args->sort_index = $this->module_info->order_target ? $this->module_info->order_target : 'list_order';
510 510
 		}
511
-		if(!in_array($args->order_type, array('asc','desc')))
511
+		if (!in_array($args->order_type, array('asc', 'desc')))
512 512
 		{
513
-			$args->order_type = $this->module_info->order_type?$this->module_info->order_type:'asc';
513
+			$args->order_type = $this->module_info->order_type ? $this->module_info->order_type : 'asc';
514 514
 		}
515 515
 
516 516
 		// set the current page of documents
517 517
 		$document_srl = Context::get('document_srl');
518
-		if(!$args->page && $document_srl)
518
+		if (!$args->page && $document_srl)
519 519
 		{
520 520
 			$oDocument = $oDocumentModel->getDocument($document_srl);
521
-			if($oDocument->isExists() && !$oDocument->isNotice())
521
+			if ($oDocument->isExists() && !$oDocument->isNotice())
522 522
 			{
523 523
 				$page = $oDocumentModel->getDocumentPage($oDocument, $args);
524 524
 				Context::set('page', $page);
@@ -527,13 +527,13 @@  discard block
 block discarded – undo
527 527
 		}
528 528
 
529 529
 		// setup the list count to be serach list count, if the category or search keyword has been set
530
-		if($args->category_srl || $args->search_keyword)
530
+		if ($args->category_srl || $args->search_keyword)
531 531
 		{
532 532
 			$args->list_count = $this->search_list_count;
533 533
 		}
534 534
 
535 535
 		// if the consultation function is enabled,  the get the logged user information
536
-		if($this->consultation)
536
+		if ($this->consultation)
537 537
 		{
538 538
 			$logged_info = Context::get('logged_info');
539 539
 			$args->member_srl = $logged_info->member_srl;
@@ -561,18 +561,18 @@  discard block
 block discarded – undo
561 561
 				'allow_trackback', 'notify_message', 'status', 'comment_status');
562 562
 		$this->columnList = array_intersect($configColumList, $tableColumnList);
563 563
 
564
-		if(in_array('summary', $configColumList)) array_push($this->columnList, 'content');
564
+		if (in_array('summary', $configColumList)) array_push($this->columnList, 'content');
565 565
 
566 566
 		// default column list add
567 567
 		$defaultColumn = array('document_srl', 'module_srl', 'category_srl', 'lang_code', 'member_srl', 'last_update', 'comment_count', 'trackback_count', 'uploaded_count', 'status', 'regdate', 'title_bold', 'title_color');
568 568
 
569 569
 		//TODO guestbook, blog style supports legacy codes.
570
-		if($this->module_info->skin == 'xe_guestbook' || $this->module_info->default_style == 'blog')
570
+		if ($this->module_info->skin == 'xe_guestbook' || $this->module_info->default_style == 'blog')
571 571
 		{
572 572
 			$defaultColumn = $tableColumnList;
573 573
 		}
574 574
 
575
-		if (in_array('last_post', $configColumList)){
575
+		if (in_array('last_post', $configColumList)) {
576 576
 			array_push($this->columnList, 'last_updater');
577 577
 		}
578 578
 
@@ -584,9 +584,9 @@  discard block
 block discarded – undo
584 584
 		$this->columnList = array_unique(array_merge($this->columnList, $defaultColumn));
585 585
 
586 586
 		// add table name
587
-		foreach($this->columnList as $no => $value)
587
+		foreach ($this->columnList as $no => $value)
588 588
 		{
589
-			$this->columnList[$no] = 'documents.' . $value;
589
+			$this->columnList[$no] = 'documents.'.$value;
590 590
 		}
591 591
 	}
592 592
 
@@ -596,7 +596,7 @@  discard block
 block discarded – undo
596 596
 	function dispBoardTagList()
597 597
 	{
598 598
 		// check if there is not grant fot view list, then alert an warning message
599
-		if(!$this->grant->list)
599
+		if (!$this->grant->list)
600 600
 		{
601 601
 			return $this->dispBoardMessage('msg_not_permitted');
602 602
 		}
@@ -610,14 +610,14 @@  discard block
 block discarded – undo
610 610
 		$output = $oTagModel->getTagList($obj);
611 611
 
612 612
 		// automatically order
613
-		if(count($output->data))
613
+		if (count($output->data))
614 614
 		{
615 615
 			$numbers = array_keys($output->data);
616 616
 			shuffle($numbers);
617 617
 
618
-			if(count($output->data))
618
+			if (count($output->data))
619 619
 			{
620
-				foreach($numbers as $k => $v)
620
+				foreach ($numbers as $k => $v)
621 621
 				{
622 622
 					$tag_list[] = $output->data[$v];
623 623
 				}
@@ -638,7 +638,7 @@  discard block
 block discarded – undo
638 638
 	function dispBoardWrite()
639 639
 	{
640 640
 		// check grant
641
-		if(!$this->grant->write_document)
641
+		if (!$this->grant->write_document)
642 642
 		{
643 643
 			return $this->dispBoardMessage('msg_not_permitted');
644 644
 		}
@@ -648,10 +648,10 @@  discard block
 block discarded – undo
648 648
 		/**
649 649
 		 * check if the category option is enabled not not
650 650
 		 **/
651
-		if($this->module_info->use_category=='Y')
651
+		if ($this->module_info->use_category == 'Y')
652 652
 		{
653 653
 			// get the user group information
654
-			if(Context::get('is_logged'))
654
+			if (Context::get('is_logged'))
655 655
 			{
656 656
 				$logged_info = Context::get('logged_info');
657 657
 				$group_srls = array_keys($logged_info->group_list);
@@ -664,19 +664,19 @@  discard block
 block discarded – undo
664 664
 
665 665
 			// check the grant after obtained the category list
666 666
 			$normal_category_list = $oDocumentModel->getCategoryList($this->module_srl);
667
-			if(count($normal_category_list))
667
+			if (count($normal_category_list))
668 668
 			{
669
-				foreach($normal_category_list as $category_srl => $category)
669
+				foreach ($normal_category_list as $category_srl => $category)
670 670
 				{
671 671
 					$is_granted = TRUE;
672
-					if($category->group_srls)
672
+					if ($category->group_srls)
673 673
 					{
674
-						$category_group_srls = explode(',',$category->group_srls);
674
+						$category_group_srls = explode(',', $category->group_srls);
675 675
 						$is_granted = FALSE;
676
-						if(count(array_intersect($group_srls, $category_group_srls))) $is_granted = TRUE;
676
+						if (count(array_intersect($group_srls, $category_group_srls))) $is_granted = TRUE;
677 677
 
678 678
 					}
679
-					if($is_granted) $category_list[$category_srl] = $category;
679
+					if ($is_granted) $category_list[$category_srl] = $category;
680 680
 				}
681 681
 			}
682 682
 			Context::set('category_list', $category_list);
@@ -687,46 +687,46 @@  discard block
 block discarded – undo
687 687
 		$oDocument = $oDocumentModel->getDocument(0, $this->grant->manager);
688 688
 		$oDocument->setDocument($document_srl);
689 689
 
690
-		if($oDocument->get('module_srl') == $oDocument->get('member_srl')) $savedDoc = TRUE;
690
+		if ($oDocument->get('module_srl') == $oDocument->get('member_srl')) $savedDoc = TRUE;
691 691
 		$oDocument->add('module_srl', $this->module_srl);
692 692
 
693
-		if($oDocument->isExists() && $this->module_info->protect_content=="Y" && $oDocument->get('comment_count')>0 && $this->grant->manager==false)
693
+		if ($oDocument->isExists() && $this->module_info->protect_content == "Y" && $oDocument->get('comment_count') > 0 && $this->grant->manager == false)
694 694
 		{
695 695
 			return new Object(-1, 'msg_protect_content');
696 696
 		}
697 697
 
698 698
 		// if the document is not granted, then back to the password input form
699 699
 		$oModuleModel = getModel('module');
700
-		if($oDocument->isExists()&&!$oDocument->isGranted())
700
+		if ($oDocument->isExists() && !$oDocument->isGranted())
701 701
 		{
702 702
 			return $this->setTemplateFile('input_password_form');
703 703
 		}
704 704
 
705
-		if(!$oDocument->isExists())
705
+		if (!$oDocument->isExists())
706 706
 		{
707
-			$point_config = $oModuleModel->getModulePartConfig('point',$this->module_srl);
707
+			$point_config = $oModuleModel->getModulePartConfig('point', $this->module_srl);
708 708
 			$logged_info = Context::get('logged_info');
709 709
 			$oPointModel = getModel('point');
710 710
 			$pointForInsert = $point_config["insert_document"];
711
-			if($pointForInsert < 0)
711
+			if ($pointForInsert < 0)
712 712
 			{
713
-				if( !$logged_info )
713
+				if (!$logged_info)
714 714
 				{
715 715
 					return $this->dispBoardMessage('msg_not_permitted');
716 716
 				}
717
-				else if (($oPointModel->getPoint($logged_info->member_srl) + $pointForInsert )< 0 )
717
+				else if (($oPointModel->getPoint($logged_info->member_srl) + $pointForInsert) < 0)
718 718
 				{
719 719
 					return $this->dispBoardMessage('msg_not_enough_point');
720 720
 				}
721 721
 			}
722 722
 		}
723
-		if(!$oDocument->get('status')) $oDocument->add('status', $oDocumentModel->getDefaultStatus());
723
+		if (!$oDocument->get('status')) $oDocument->add('status', $oDocumentModel->getDefaultStatus());
724 724
 
725 725
 		$statusList = $this->_getStatusNameList($oDocumentModel);
726
-		if(count($statusList) > 0) Context::set('status_list', $statusList);
726
+		if (count($statusList) > 0) Context::set('status_list', $statusList);
727 727
 
728 728
 		// get Document status config value
729
-		Context::set('document_srl',$document_srl);
729
+		Context::set('document_srl', $document_srl);
730 730
 		Context::set('oDocument', $oDocument);
731 731
 
732 732
 		// apply xml_js_filter on header
@@ -734,12 +734,12 @@  discard block
 block discarded – undo
734 734
 		$oDocumentController->addXmlJsFilter($this->module_info->module_srl);
735 735
 
736 736
 		// if the document exists, then setup extra variabels on context
737
-		if($oDocument->isExists() && !$savedDoc) Context::set('extra_keys', $oDocument->getExtraVars());
737
+		if ($oDocument->isExists() && !$savedDoc) Context::set('extra_keys', $oDocument->getExtraVars());
738 738
 
739 739
 		/**
740 740
 		 * add JS filters
741 741
 		 **/
742
-		if(Context::get('logged_info')->is_admin=='Y') Context::addJsFilter($this->module_path.'tpl/filter', 'insert_admin.xml');
742
+		if (Context::get('logged_info')->is_admin == 'Y') Context::addJsFilter($this->module_path.'tpl/filter', 'insert_admin.xml');
743 743
 		else Context::addJsFilter($this->module_path.'tpl/filter', 'insert.xml');
744 744
 
745 745
 		$oSecurity = new Security();
@@ -751,14 +751,14 @@  discard block
 block discarded – undo
751 751
 	function _getStatusNameList(&$oDocumentModel)
752 752
 	{
753 753
 		$resultList = array();
754
-		if(!empty($this->module_info->use_status))
754
+		if (!empty($this->module_info->use_status))
755 755
 		{
756 756
 			$statusNameList = $oDocumentModel->getStatusNameList();
757 757
 			$statusList = explode('|@|', $this->module_info->use_status);
758 758
 
759
-			if(is_array($statusList))
759
+			if (is_array($statusList))
760 760
 			{
761
-				foreach($statusList as $key => $value)
761
+				foreach ($statusList as $key => $value)
762 762
 				{
763 763
 					$resultList[$value] = $statusNameList[$value];
764 764
 				}
@@ -773,7 +773,7 @@  discard block
 block discarded – undo
773 773
 	function dispBoardDelete()
774 774
 	{
775 775
 		// check grant
776
-		if(!$this->grant->write_document)
776
+		if (!$this->grant->write_document)
777 777
 		{
778 778
 			return $this->dispBoardMessage('msg_not_permitted');
779 779
 		}
@@ -782,30 +782,30 @@  discard block
 block discarded – undo
782 782
 		$document_srl = Context::get('document_srl');
783 783
 
784 784
 		// if document exists, get the document information
785
-		if($document_srl)
785
+		if ($document_srl)
786 786
 		{
787 787
 			$oDocumentModel = getModel('document');
788 788
 			$oDocument = $oDocumentModel->getDocument($document_srl);
789 789
 		}
790 790
 
791 791
 		// if the document is not existed, then back to the board content page
792
-		if(!$oDocument || !$oDocument->isExists())
792
+		if (!$oDocument || !$oDocument->isExists())
793 793
 		{
794 794
 			return $this->dispBoardContent();
795 795
 		}
796 796
 
797 797
 		// if the document is not granted, then back to the password input form
798
-		if(!$oDocument->isGranted())
798
+		if (!$oDocument->isGranted())
799 799
 		{
800 800
 			return $this->setTemplateFile('input_password_form');
801 801
 		}
802 802
 
803
-		if($this->module_info->protect_content=="Y" && $oDocument->get('comment_count')>0 && $this->grant->manager==false)
803
+		if ($this->module_info->protect_content == "Y" && $oDocument->get('comment_count') > 0 && $this->grant->manager == false)
804 804
 		{
805 805
 			return $this->dispBoardMessage('msg_protect_content');
806 806
 		}
807 807
 
808
-		Context::set('oDocument',$oDocument);
808
+		Context::set('oDocument', $oDocument);
809 809
 
810 810
 		/**
811 811
 		 * add JS filters
@@ -823,7 +823,7 @@  discard block
 block discarded – undo
823 823
 		$document_srl = Context::get('document_srl');
824 824
 
825 825
 		// check grant
826
-		if(!$this->grant->write_comment)
826
+		if (!$this->grant->write_comment)
827 827
 		{
828 828
 			return $this->dispBoardMessage('msg_not_permitted');
829 829
 		}
@@ -831,13 +831,13 @@  discard block
 block discarded – undo
831 831
 		// get the document information
832 832
 		$oDocumentModel = getModel('document');
833 833
 		$oDocument = $oDocumentModel->getDocument($document_srl);
834
-		if(!$oDocument->isExists())
834
+		if (!$oDocument->isExists())
835 835
 		{
836 836
 			return $this->dispBoardMessage('msg_invalid_request');
837 837
 		}
838 838
 
839 839
 		// Check allow comment
840
-		if(!$oDocument->allowComment())
840
+		if (!$oDocument->allowComment())
841 841
 		{
842 842
 			return $this->dispBoardMessage('msg_not_allow_comment');
843 843
 		}
@@ -849,9 +849,9 @@  discard block
 block discarded – undo
849 849
 		$oComment->add('module_srl', $this->module_srl);
850 850
 
851 851
 		// setup document variables on context
852
-		Context::set('oDocument',$oDocument);
853
-		Context::set('oSourceComment',$oSourceComment);
854
-		Context::set('oComment',$oComment);
852
+		Context::set('oDocument', $oDocument);
853
+		Context::set('oSourceComment', $oSourceComment);
854
+		Context::set('oComment', $oComment);
855 855
 
856 856
 		/**
857 857
 		 * add JS filter
@@ -867,7 +867,7 @@  discard block
 block discarded – undo
867 867
 	function dispBoardReplyComment()
868 868
 	{
869 869
 		// check grant
870
-		if(!$this->grant->write_comment)
870
+		if (!$this->grant->write_comment)
871 871
 		{
872 872
 			return $this->dispBoardMessage('msg_not_permitted');
873 873
 		}
@@ -876,7 +876,7 @@  discard block
 block discarded – undo
876 876
 		$parent_srl = Context::get('comment_srl');
877 877
 
878 878
 		// if the parent comment is not existed
879
-		if(!$parent_srl)
879
+		if (!$parent_srl)
880 880
 		{
881 881
 			return new Object(-1, 'msg_invalid_request');
882 882
 		}
@@ -886,11 +886,11 @@  discard block
 block discarded – undo
886 886
 		$oSourceComment = $oCommentModel->getComment($parent_srl, $this->grant->manager);
887 887
 
888 888
 		// if the comment is not existed, opoup an error message
889
-		if(!$oSourceComment->isExists())
889
+		if (!$oSourceComment->isExists())
890 890
 		{
891 891
 			return $this->dispBoardMessage('msg_invalid_request');
892 892
 		}
893
-		if(Context::get('document_srl') && $oSourceComment->get('document_srl') != Context::get('document_srl'))
893
+		if (Context::get('document_srl') && $oSourceComment->get('document_srl') != Context::get('document_srl'))
894 894
 		{
895 895
 			return $this->dispBoardMessage('msg_invalid_request');
896 896
 		}
@@ -898,7 +898,7 @@  discard block
 block discarded – undo
898 898
 		// Check allow comment
899 899
 		$oDocumentModel = getModel('document');
900 900
 		$oDocument = $oDocumentModel->getDocument($oSourceComment->get('document_srl'));
901
-		if(!$oDocument->allowComment())
901
+		if (!$oDocument->allowComment())
902 902
 		{
903 903
 			return $this->dispBoardMessage('msg_not_allow_comment');
904 904
 		}
@@ -909,9 +909,9 @@  discard block
 block discarded – undo
909 909
 		$oComment->add('document_srl', $oSourceComment->get('document_srl'));
910 910
 
911 911
 		// setup comment variables
912
-		Context::set('oSourceComment',$oSourceComment);
913
-		Context::set('oComment',$oComment);
914
-		Context::set('module_srl',$this->module_info->module_srl);
912
+		Context::set('oSourceComment', $oSourceComment);
913
+		Context::set('oComment', $oComment);
914
+		Context::set('module_srl', $this->module_info->module_srl);
915 915
 
916 916
 		/**
917 917
 		 * add JS filters
@@ -927,7 +927,7 @@  discard block
 block discarded – undo
927 927
 	function dispBoardModifyComment()
928 928
 	{
929 929
 		// check grant
930
-		if(!$this->grant->write_comment)
930
+		if (!$this->grant->write_comment)
931 931
 		{
932 932
 			return $this->dispBoardMessage('msg_not_permitted');
933 933
 		}
@@ -937,7 +937,7 @@  discard block
 block discarded – undo
937 937
 		$comment_srl = Context::get('comment_srl');
938 938
 
939 939
 		// if the comment is not existed
940
-		if(!$comment_srl)
940
+		if (!$comment_srl)
941 941
 		{
942 942
 			return new Object(-1, 'msg_invalid_request');
943 943
 		}
@@ -947,13 +947,13 @@  discard block
 block discarded – undo
947 947
 		$oComment = $oCommentModel->getComment($comment_srl, $this->grant->manager);
948 948
 
949 949
 		// if the comment is not exited, alert an error message
950
-		if(!$oComment->isExists())
950
+		if (!$oComment->isExists())
951 951
 		{
952 952
 			return $this->dispBoardMessage('msg_invalid_request');
953 953
 		}
954 954
 
955 955
 		// if the comment is not granted, then back to the password input form
956
-		if(!$oComment->isGranted())
956
+		if (!$oComment->isGranted())
957 957
 		{
958 958
 			return $this->setTemplateFile('input_password_form');
959 959
 		}
@@ -976,7 +976,7 @@  discard block
 block discarded – undo
976 976
 	function dispBoardDeleteComment()
977 977
 	{
978 978
 		// check grant
979
-		if(!$this->grant->write_comment)
979
+		if (!$this->grant->write_comment)
980 980
 		{
981 981
 			return $this->dispBoardMessage('msg_not_permitted');
982 982
 		}
@@ -985,25 +985,25 @@  discard block
 block discarded – undo
985 985
 		$comment_srl = Context::get('comment_srl');
986 986
 
987 987
 		// if the comment exists, then get the comment information
988
-		if($comment_srl)
988
+		if ($comment_srl)
989 989
 		{
990 990
 			$oCommentModel = getModel('comment');
991 991
 			$oComment = $oCommentModel->getComment($comment_srl, $this->grant->manager);
992 992
 		}
993 993
 
994 994
 		// if the comment is not existed, then back to the board content page
995
-		if(!$oComment->isExists() )
995
+		if (!$oComment->isExists())
996 996
 		{
997 997
 			return $this->dispBoardContent();
998 998
 		}
999 999
 
1000 1000
 		// if the comment is not granted, then back to the password input form
1001
-		if(!$oComment->isGranted())
1001
+		if (!$oComment->isGranted())
1002 1002
 		{
1003 1003
 			return $this->setTemplateFile('input_password_form');
1004 1004
 		}
1005 1005
 
1006
-		Context::set('oComment',$oComment);
1006
+		Context::set('oComment', $oComment);
1007 1007
 
1008 1008
 		/**
1009 1009
 		 * add JS filters
@@ -1020,7 +1020,7 @@  discard block
 block discarded – undo
1020 1020
 	{
1021 1021
 		$oTrackbackModel = getModel('trackback');
1022 1022
 
1023
-		if(!$oTrackbackModel)
1023
+		if (!$oTrackbackModel)
1024 1024
 		{
1025 1025
 			return;
1026 1026
 		}
@@ -1034,7 +1034,7 @@  discard block
 block discarded – undo
1034 1034
 		$trackback = $output->data;
1035 1035
 
1036 1036
 		// if no trackback, then display the board content
1037
-		if(!$trackback)
1037
+		if (!$trackback)
1038 1038
 		{
1039 1039
 			return $this->dispBoardContent();
1040 1040
 		}
@@ -1055,7 +1055,7 @@  discard block
 block discarded – undo
1055 1055
 	function dispBoardMessage($msg_code)
1056 1056
 	{
1057 1057
 		$msg = Context::getLang($msg_code);
1058
-		if(!$msg) $msg = $msg_code;
1058
+		if (!$msg) $msg = $msg_code;
1059 1059
 		Context::set('message', $msg);
1060 1060
 		$this->setTemplateFile('message');
1061 1061
 	}
@@ -1066,8 +1066,8 @@  discard block
 block discarded – undo
1066 1066
 	 **/
1067 1067
 	function alertMessage($message)
1068 1068
 	{
1069
-		$script =  sprintf('<script> jQuery(function(){ alert("%s"); } );</script>', Context::getLang($message));
1070
-		Context::addHtmlFooter( $script );
1069
+		$script = sprintf('<script> jQuery(function(){ alert("%s"); } );</script>', Context::getLang($message));
1070
+		Context::addHtmlFooter($script);
1071 1071
 	}
1072 1072
 
1073 1073
 }
Please login to merge, or discard this patch.
modules/comment/comment.admin.controller.php 4 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -279,6 +279,9 @@  discard block
 block discarded – undo
279 279
 		$this->setRedirectUrl($returnUrl);
280 280
 	}
281 281
 
282
+	/**
283
+	 * @param string $message_content
284
+	 */
282 285
 	private function _sendMessageForComment($message_content, $comment_srl_list)
283 286
 	{
284 287
 		$oCommunicationController = getController('communication');
@@ -308,6 +311,9 @@  discard block
 block discarded – undo
308 311
 
309 312
 	/**
310 313
 	 * comment move to trash
314
+	 * @param ModuleObject $oCommentController
315
+	 * @param DB $oDB
316
+	 * @param string $message_content
311 317
 	 * @return void|object
312 318
 	 */
313 319
 	function _moveCommentToTrash($commentSrlList, &$oCommentController, &$oDB, $message_content = NULL)
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -133,8 +133,8 @@  discard block
 block discarded – undo
133 133
 
134 134
 					//mail to author of thread - START
135 135
 					/**
136
-				 	 * @todo Removed code send email to document author.
137
-					*/
136
+					 * @todo Removed code send email to document author.
137
+					 */
138 138
 					/*
139 139
 					if($document_author_email != $comment->email_address && $logged_info->email_address != $document_author_email)
140 140
 					{
@@ -341,10 +341,10 @@  discard block
 block discarded – undo
341 341
 	}
342 342
 
343 343
 	/**
344
-	  * @fn procCommentAdminMoveToTrash
345
-	  * @brief move a comment to trash
346
-	  * @see commentModel::getCommentMenu
347
-	  */
344
+	 * @fn procCommentAdminMoveToTrash
345
+	 * @brief move a comment to trash
346
+	 * @see commentModel::getCommentMenu
347
+	 */
348 348
 	function procCommentAdminMoveToTrash()
349 349
 	{
350 350
 		$oDB = DB::getInstance();
Please login to merge, or discard this patch.
Braces   +9 added lines, -13 removed lines patch added patch discarded remove patch
@@ -32,8 +32,7 @@  discard block
 block discarded – undo
32 32
 		if(!is_array($cart))
33 33
 		{
34 34
 			$comment_srl_list = explode('|@|', $cart);
35
-		}
36
-		else
35
+		} else
37 36
 		{
38 37
 			$comment_srl_list = $cart;
39 38
 		}
@@ -61,8 +60,7 @@  discard block
 block discarded – undo
61 60
 		if(!is_array($cart))
62 61
 		{
63 62
 			$comment_srl_list = explode('|@|', $cart);
64
-		}
65
-		else
63
+		} else
66 64
 		{
67 65
 			$comment_srl_list = $cart;
68 66
 		}
@@ -74,8 +72,7 @@  discard block
 block discarded – undo
74 72
 		if(!$output->toBool())
75 73
 		{
76 74
 			return $output;
77
-		}
78
-		else
75
+		} else
79 76
 		{
80 77
 			//update comment count for document
81 78
 			$updated_documents_arr = array();
@@ -202,8 +199,7 @@  discard block
 block discarded – undo
202 199
 		if(!is_array($cart))
203 200
 		{
204 201
 			$comment_srl_list = explode('|@|', $cart);
205
-		}
206
-		else
202
+		} else
207 203
 		{
208 204
 			$comment_srl_list = $cart;
209 205
 		}
@@ -262,8 +258,7 @@  discard block
 block discarded – undo
262 258
 		if($isTrash == 'true')
263 259
 		{
264 260
 			$msgCode = 'success_trashed';
265
-		}
266
-		else
261
+		} else
267 262
 		{
268 263
 			$msgCode = 'success_deleted';
269 264
 		}
@@ -355,7 +350,9 @@  discard block
 block discarded – undo
355 350
 		$oCommentController = getController('comment');
356 351
 		$oComment = $oCommentModel->getComment($comment_srl, false);
357 352
 
358
-		if(!$oComment->isGranted()) return $this->stop('msg_not_permitted');
353
+		if(!$oComment->isGranted()) {
354
+			return $this->stop('msg_not_permitted');
355
+		}
359 356
 
360 357
 		$message_content = "";
361 358
 		$this->_moveCommentToTrash(array($comment_srl), $oCommentController, $oDB, $message_content);
@@ -410,8 +407,7 @@  discard block
 block discarded – undo
410 407
 				if($_SESSION['comment_management'][$key])
411 408
 				{
412 409
 					unset($_SESSION['comment_management'][$key]);
413
-				}
414
-				else
410
+				} else
415 411
 				{
416 412
 					$_SESSION['comment_management'][$key] = TRUE;
417 413
 				}
Please login to merge, or discard this patch.
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	{
30 30
 		// Error display if none is selected
31 31
 		$cart = Context::get('cart');
32
-		if(!is_array($cart))
32
+		if (!is_array($cart))
33 33
 		{
34 34
 			$comment_srl_list = explode('|@|', $cart);
35 35
 		}
@@ -54,11 +54,11 @@  discard block
 block discarded – undo
54 54
 
55 55
 		// Error display if none is selected
56 56
 		$cart = Context::get('cart');
57
-		if(!$cart)
57
+		if (!$cart)
58 58
 		{
59 59
 			return $this->stop('msg_cart_is_null');
60 60
 		}
61
-		if(!is_array($cart))
61
+		if (!is_array($cart))
62 62
 		{
63 63
 			$comment_srl_list = explode('|@|', $cart);
64 64
 		}
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 		$args->status = $will_publish;
72 72
 		$args->comment_srls_list = $comment_srl_list;
73 73
 		$output = executeQuery('comment.updatePublishedStatus', $args);
74
-		if(!$output->toBool())
74
+		if (!$output->toBool())
75 75
 		{
76 76
 			return $output;
77 77
 		}
@@ -90,16 +90,16 @@  discard block
 block discarded – undo
90 90
 			//$oMemberModule = getModel("member");
91 91
 			//$logged_info = $oMemberModule->getMemberInfoByMemberSrl($logged_member_srl);
92 92
 			$new_status = ($will_publish) ? "published" : "unpublished";
93
-			foreach($comment_srl_list as $comment_srl)
93
+			foreach ($comment_srl_list as $comment_srl)
94 94
 			{
95 95
 				// check if comment already exists
96 96
 				$comment = $oCommentModel->getComment($comment_srl);
97
-				if($comment->comment_srl != $comment_srl)
97
+				if ($comment->comment_srl != $comment_srl)
98 98
 				{
99 99
 					return new Object(-1, 'msg_invalid_request');
100 100
 				}
101 101
 				$document_srl = $comment->document_srl;
102
-				if(!in_array($document_srl, $updated_documents_arr))
102
+				if (!in_array($document_srl, $updated_documents_arr))
103 103
 				{
104 104
 					$updated_documents_arr[] = $document_srl;
105 105
 					// update the number of comments
@@ -117,13 +117,13 @@  discard block
 block discarded – undo
117 117
 					// send email to comment's author, all admins and thread(document) subscribers - START
118 118
 					// -------------------------------------------------------
119 119
 					$oMail = new Mail();
120
-					$mail_title = "[XE - " . $module_info->mid . "] comment(s) status changed to " . $new_status . " on document: \"" . $oDocument->getTitleText() . "\"";
120
+					$mail_title = "[XE - ".$module_info->mid."] comment(s) status changed to ".$new_status." on document: \"".$oDocument->getTitleText()."\"";
121 121
 					$oMail->setTitle($mail_title);
122 122
 					$mail_content = "
123
-						The comment #" . $comment_srl . " on document \"" . $oDocument->getTitleText() . "\" has been " . $new_status . " by admin of <strong><i>" . strtoupper($module_info->mid) . "</i></strong> module.
123
+						The comment #" . $comment_srl." on document \"".$oDocument->getTitleText()."\" has been ".$new_status." by admin of <strong><i>".strtoupper($module_info->mid)."</i></strong> module.
124 124
 						<br />
125 125
 						<br />Comment content:
126
-						" . $comment->content . "
126
+						" . $comment->content."
127 127
 						<br />
128 128
 						";
129 129
 					$oMail->setContent($mail_content);
@@ -145,17 +145,17 @@  discard block
 block discarded – undo
145 145
 					*/
146 146
 					//mail to author of thread - STOP
147 147
 					//mail to all emails set for administrators - START
148
-					if($module_info->admin_mail)
148
+					if ($module_info->admin_mail)
149 149
 					{
150 150
 						$target_mail = explode(',', $module_info->admin_mail);
151
-						for($i = 0; $i < count($target_mail); $i++)
151
+						for ($i = 0; $i < count($target_mail); $i++)
152 152
 						{
153 153
 							$email_address = trim($target_mail[$i]);
154
-							if(!$email_address)
154
+							if (!$email_address)
155 155
 							{
156 156
 								continue;
157 157
 							}
158
-							if($author_email != $email_address)
158
+							if ($author_email != $email_address)
159 159
 							{
160 160
 								$oMail->setReceiptor($email_address, $email_address);
161 161
 								$oMail->send();
@@ -173,12 +173,12 @@  discard block
 block discarded – undo
173 173
 
174 174
 		// for message send - start
175 175
 		$message_content = Context::get('message_content');
176
-		if($message_content)
176
+		if ($message_content)
177 177
 		{
178 178
 			$message_content = nl2br($message_content);
179 179
 		}
180 180
 
181
-		if($message_content)
181
+		if ($message_content)
182 182
 		{
183 183
 			$this->_sendMessageForComment($message_content, $comment_srl_list);
184 184
 		}
@@ -195,11 +195,11 @@  discard block
 block discarded – undo
195 195
 
196 196
 		// Error display if none is selected
197 197
 		$cart = Context::get('cart');
198
-		if(!$cart)
198
+		if (!$cart)
199 199
 		{
200 200
 			return $this->stop('msg_cart_is_null');
201 201
 		}
202
-		if(!is_array($cart))
202
+		if (!is_array($cart))
203 203
 		{
204 204
 			$comment_srl_list = explode('|@|', $cart);
205 205
 		}
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 			$comment_srl_list = $cart;
209 209
 		}
210 210
 		$comment_count = count($comment_srl_list);
211
-		if(!$comment_count)
211
+		if (!$comment_count)
212 212
 		{
213 213
 			return $this->stop('msg_cart_is_null');
214 214
 		}
@@ -220,34 +220,34 @@  discard block
 block discarded – undo
220 220
 
221 221
 		// for message send - start
222 222
 		$message_content = Context::get('message_content');
223
-		if($message_content)
223
+		if ($message_content)
224 224
 		{
225 225
 			$message_content = nl2br($message_content);
226 226
 		}
227 227
 
228
-		if($message_content)
228
+		if ($message_content)
229 229
 		{
230 230
 			$this->_sendMessageForComment($message_content, $comment_srl_list);
231 231
 		}
232 232
 		// for message send - end
233 233
 		// comment into trash
234
-		if($isTrash == 'true')
234
+		if ($isTrash == 'true')
235 235
 		{
236 236
 			$this->_moveCommentToTrash($comment_srl_list, $oCommentController, $oDB, $message_content);
237 237
 		}
238 238
 
239 239
 		$deleted_count = 0;
240 240
 		// Delete the comment posting
241
-		for($i = 0; $i < $comment_count; $i++)
241
+		for ($i = 0; $i < $comment_count; $i++)
242 242
 		{
243 243
 			$comment_srl = trim($comment_srl_list[$i]);
244
-			if(!$comment_srl)
244
+			if (!$comment_srl)
245 245
 			{
246 246
 				continue;
247 247
 			}
248 248
 
249 249
 			$output = $oCommentController->deleteComment($comment_srl, TRUE, $isTrash);
250
-			if(!$output->toBool())
250
+			if (!$output->toBool())
251 251
 			{
252 252
 				$oDB->rollback();
253 253
 				return $output;
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
 		$oDB->commit();
260 260
 
261 261
 		$msgCode = '';
262
-		if($isTrash == 'true')
262
+		if ($isTrash == 'true')
263 263
 		{
264 264
 			$msgCode = 'success_trashed';
265 265
 		}
@@ -290,12 +290,12 @@  discard block
 block discarded – undo
290 290
 		$sender_member_srl = $logged_info->member_srl;
291 291
 
292 292
 		$comment_count = count($comment_srl_list);
293
-		for($i = 0; $i < $comment_count; $i++)
293
+		for ($i = 0; $i < $comment_count; $i++)
294 294
 		{
295 295
 			$comment_srl = $comment_srl_list[$i];
296 296
 			$oComment = $oCommentModel->getComment($comment_srl, TRUE);
297 297
 
298
-			if(!$oComment->get('member_srl') || $oComment->get('member_srl') == $sender_member_srl)
298
+			if (!$oComment->get('member_srl') || $oComment->get('member_srl') == $sender_member_srl)
299 299
 			{
300 300
 				continue;
301 301
 			}
@@ -312,16 +312,16 @@  discard block
 block discarded – undo
312 312
 	 */
313 313
 	function _moveCommentToTrash($commentSrlList, &$oCommentController, &$oDB, $message_content = NULL)
314 314
 	{
315
-		require_once(_XE_PATH_ . 'modules/trash/model/TrashVO.php');
315
+		require_once(_XE_PATH_.'modules/trash/model/TrashVO.php');
316 316
 
317
-		if(is_array($commentSrlList))
317
+		if (is_array($commentSrlList))
318 318
 		{
319 319
 			$logged_info = Context::get('logged_info');
320 320
 			$oCommentModel = getModel('comment');
321 321
 			$commentItemList = $oCommentModel->getComments($commentSrlList);
322 322
 			$oTrashAdminController = getAdminController('trash');
323 323
 
324
-			foreach($commentItemList AS $key => $oComment)
324
+			foreach ($commentItemList AS $key => $oComment)
325 325
 			{
326 326
 				$oTrashVO = new TrashVO();
327 327
 				$oTrashVO->setTrashSrl(getNextSequence());
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
 				$oTrashVO->setDescription($message_content);
332 332
 
333 333
 				$output = $oTrashAdminController->insertTrash($oTrashVO);
334
-				if(!$output->toBool())
334
+				if (!$output->toBool())
335 335
 				{
336 336
 					$oDB->rollback();
337 337
 					return $output;
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
 		$oCommentController = getController('comment');
356 356
 		$oComment = $oCommentModel->getComment($comment_srl, false);
357 357
 
358
-		if(!$oComment->isGranted()) return $this->stop('msg_not_permitted');
358
+		if (!$oComment->isGranted()) return $this->stop('msg_not_permitted');
359 359
 
360 360
 		$message_content = "";
361 361
 		$this->_moveCommentToTrash(array($comment_srl), $oCommentController, $oDB, $message_content);
@@ -377,12 +377,12 @@  discard block
 block discarded – undo
377 377
 	{
378 378
 		$comment_srl = trim(Context::get('comment_srl'));
379 379
 
380
-		if($comment_srl)
380
+		if ($comment_srl)
381 381
 		{
382 382
 			$args = new stdClass();
383 383
 			$args->comment_srl = $comment_srl;
384 384
 			$output = executeQuery('comment.deleteDeclaredComments', $args);
385
-			if(!$output->toBool())
385
+			if (!$output->toBool())
386 386
 			{
387 387
 				return $output;
388 388
 			}
@@ -403,11 +403,11 @@  discard block
 block discarded – undo
403 403
 
404 404
 		$output = $oCommentModel->getComments($commentSrlList);
405 405
 
406
-		if(is_array($output))
406
+		if (is_array($output))
407 407
 		{
408
-			foreach($output AS $key => $value)
408
+			foreach ($output AS $key => $value)
409 409
 			{
410
-				if($_SESSION['comment_management'][$key])
410
+				if ($_SESSION['comment_management'][$key])
411 411
 				{
412 412
 					unset($_SESSION['comment_management'][$key]);
413 413
 				}
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
 		$args = new stdClass();
429 429
 		$args->module_srl = $module_srl;
430 430
 		$output = executeQuery('comment.deleteModuleComments', $args);
431
-		if(!$output->toBool())
431
+		if (!$output->toBool())
432 432
 		{
433 433
 			return $output;
434 434
 		}
@@ -437,7 +437,7 @@  discard block
 block discarded – undo
437 437
 
438 438
 		//remove from cache
439 439
 		$oCacheHandler = CacheHandler::getInstance('object');
440
-		if($oCacheHandler->isSupport())
440
+		if ($oCacheHandler->isSupport())
441 441
 		{
442 442
 			// Invalidate newest comments. Per document cache is invalidated inside document admin controller.
443 443
 			$oCacheHandler->invalidateGroupKey('newestCommentsList');
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
 	 */
453 453
 	function restoreTrash($originObject)
454 454
 	{
455
-		if(is_array($originObject))
455
+		if (is_array($originObject))
456 456
 		{
457 457
 			$originObject = (object) $originObject;
458 458
 		}
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
 	function emptyTrash($originObject)
486 486
 	{
487 487
 		$originObject = unserialize($originObject);
488
-		if(is_array($originObject))
488
+		if (is_array($originObject))
489 489
 		{
490 490
 			$originObject = (object) $originObject;
491 491
 		}
Please login to merge, or discard this patch.
modules/comment/comment.controller.php 4 patches
Doc Comments   +3 added lines, -4 removed lines patch added patch discarded remove patch
@@ -160,7 +160,6 @@  discard block
 block discarded – undo
160 160
 
161 161
 	/**
162 162
 	 * Check if module is using comment validation system
163
-	 * @param int $document_srl
164 163
 	 * @param int $module_srl
165 164
 	 * @return bool
166 165
 	 */
@@ -1151,7 +1150,7 @@  discard block
 block discarded – undo
1151 1150
 
1152 1151
 	/**
1153 1152
 	 * Report a blamed comment
1154
-	 * @param $comment_srl
1153
+	 * @param string $comment_srl
1155 1154
 	 * @return void
1156 1155
 	 */
1157 1156
 	function declaredComment($comment_srl)
@@ -1356,7 +1355,7 @@  discard block
 block discarded – undo
1356 1355
 	/**
1357 1356
 	 * Comment module config setting
1358 1357
 	 * @param int $srl
1359
-	 * @param object $comment_config
1358
+	 * @param stdClass $comment_config
1360 1359
 	 * @return Object
1361 1360
 	 */
1362 1361
 	function setCommentModuleConfig($srl, $comment_config)
@@ -1368,7 +1367,7 @@  discard block
 block discarded – undo
1368 1367
 
1369 1368
 	/**
1370 1369
 	 * Get comment all list
1371
-	 * @return void
1370
+	 * @return Object|null
1372 1371
 	 */
1373 1372
 	function procCommentGetList()
1374 1373
 	{
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -581,7 +581,7 @@
 block discarded – undo
581 581
 				//mail to author of thread - START
582 582
 				/**
583 583
 				 * @todo Removed code send email to document author.
584
-				*/
584
+				 */
585 585
 				/*
586 586
 				if($document_author_email != $obj->email_address && $logged_info->email_address != $document_author_email)
587 587
 				{
Please login to merge, or discard this patch.
Braces   +22 added lines, -44 removed lines patch added patch discarded remove patch
@@ -211,14 +211,12 @@  discard block
 block discarded – undo
211 211
 				if($logged_info->is_admin == 'Y')
212 212
 				{
213 213
 					$is_admin = TRUE;
214
-				}
215
-				else
214
+				} else
216 215
 				{
217 216
 					$is_admin = FALSE;
218 217
 				}
219 218
 			}
220
-		}
221
-		else
219
+		} else
222 220
 		{
223 221
 			$is_admin = FALSE;
224 222
 		}
@@ -226,14 +224,12 @@  discard block
 block discarded – undo
226 224
 		if(!$using_validation)
227 225
 		{
228 226
 			$obj->status = 1;
229
-		}
230
-		else
227
+		} else
231 228
 		{
232 229
 			if($is_admin)
233 230
 			{
234 231
 				$obj->status = 1;
235
-			}
236
-			else
232
+			} else
237 233
 			{
238 234
 				$obj->status = 0;
239 235
 			}
@@ -310,8 +306,7 @@  discard block
 block discarded – undo
310 306
 		if(!$obj->comment_srl)
311 307
 		{
312 308
 			$obj->comment_srl = getNextSequence();
313
-		}
314
-		elseif(!$is_admin && !$manual_inserted && !checkUserSequence($obj->comment_srl)) 
309
+		} elseif(!$is_admin && !$manual_inserted && !checkUserSequence($obj->comment_srl)) 
315 310
 		{
316 311
 			return new Object(-1, 'msg_not_permitted');
317 312
 		}
@@ -369,8 +364,7 @@  discard block
 block discarded – undo
369 364
 			$list_args->head = $list_args->arrange = $obj->comment_srl;
370 365
 			$list_args->depth = 0;
371 366
 			// If parent comment exists, get information of the parent comment
372
-		}
373
-		else
367
+		} else
374 368
 		{
375 369
 			// get information of the parent comment posting
376 370
 			$parent_args = new stdClass();
@@ -393,8 +387,7 @@  discard block
 block discarded – undo
393 387
 			{
394 388
 				$list_args->arrange = $obj->comment_srl;
395 389
 				// if the depth of comments is greater than 2, execute update.
396
-			}
397
-			else
390
+			} else
398 391
 			{
399 392
 				// get the top listed comment among those in lower depth and same head with parent's.
400 393
 				$p_args = new stdClass();
@@ -407,8 +400,7 @@  discard block
 block discarded – undo
407 400
 				{
408 401
 					$list_args->arrange = $output->data->arrange;
409 402
 					$output = executeQuery('comment.updateCommentListArrange', $list_args);
410
-				}
411
-				else
403
+				} else
412 404
 				{
413 405
 					$list_args->arrange = $obj->comment_srl;
414 406
 				}
@@ -442,8 +434,7 @@  discard block
 block discarded – undo
442 434
 		if(!$using_validation)
443 435
 		{
444 436
 			$output = $oDocumentController->updateCommentCount($document_srl, $comment_count, $obj->nick_name, TRUE);
445
-		}
446
-		else
437
+		} else
447 438
 		{
448 439
 			if($is_admin)
449 440
 			{
@@ -511,8 +502,7 @@  discard block
 block discarded – undo
511 502
 		if(isset($obj->member_srl) && !is_null($obj->member_srl))
512 503
 		{
513 504
 			$member_info = $oMemberModel->getMemberInfoByMemberSrl($obj->member_srl);
514
-		}
515
-		else
505
+		} else
516 506
 		{
517 507
 			$member_info = new stdClass();
518 508
 			$member_info->is_admin = "N";
@@ -558,8 +548,7 @@  discard block
 block discarded – undo
558 548
 					<br /><a href=\"" . getFullUrl('', 'module', 'admin', 'act', 'dispCommentAdminList', 'search_target', 'module', 'search_keyword', $obj->module_srl) . "\">" . getFullUrl('', 'module', 'admin', 'act', 'dispCommentAdminList', 'search_target', 'module', 'search_keyword', $obj->module_srl) . "</a>
559 549
 					";
560 550
 				$oMail->setContent($mail_content);
561
-			}
562
-			else
551
+			} else
563 552
 			{
564 553
 				$mail_content = "
565 554
 					Author: " . $member_info->nick_name . "
@@ -832,8 +821,7 @@  discard block
 block discarded – undo
832 821
 			if(!$deleteAllComment)
833 822
 			{
834 823
 				return new Object(-1, 'fail_to_delete_have_children');
835
-			}
836
-			else
824
+			} else
837 825
 			{
838 826
 				foreach($childs as $val)
839 827
 				{
@@ -897,8 +885,7 @@  discard block
 block discarded – undo
897 885
 		{
898 886
 			$this->_deleteDeclaredComments($args);
899 887
 			$this->_deleteVotedComments($args);
900
-		} 
901
-		else 
888
+		} else 
902 889
 		{
903 890
 			$args = new stdClass();
904 891
 			$args->upload_target_srl = $comment_srl;
@@ -941,8 +928,7 @@  discard block
 block discarded – undo
941 928
 		{
942 929
 			$oDocument = new documentItem();
943 930
 			$oDocument->setAttribute($obj);
944
-		}
945
-		else
931
+		} else
946 932
 		{
947 933
 			$oDocument = $oDocumentModel->getDocument($document_srl);
948 934
 		}
@@ -1035,8 +1021,7 @@  discard block
 block discarded – undo
1035 1021
 		{
1036 1022
 			$failed_voted = 'failed_voted';
1037 1023
 			$success_message = 'success_voted';
1038
-		}
1039
-		else
1024
+		} else
1040 1025
 		{
1041 1026
 			$failed_voted = 'failed_blamed';
1042 1027
 			$success_message = 'success_blamed';
@@ -1079,8 +1064,7 @@  discard block
 block discarded – undo
1079 1064
 		if($member_srl)
1080 1065
 		{
1081 1066
 			$args->member_srl = $member_srl;
1082
-		}
1083
-		else
1067
+		} else
1084 1068
 		{
1085 1069
 			$args->ipaddress = $_SERVER['REMOTE_ADDR'];
1086 1070
 		}
@@ -1104,8 +1088,7 @@  discard block
 block discarded – undo
1104 1088
 		{
1105 1089
 			$args->blamed_count = $oComment->get('blamed_count') + $point;
1106 1090
 			$output = executeQuery('comment.updateBlamedCount', $args);
1107
-		}
1108
-		else
1091
+		} else
1109 1092
 		{
1110 1093
 			$args->voted_count = $oComment->get('voted_count') + $point;
1111 1094
 			$output = executeQuery('comment.updateVotedCount', $args);
@@ -1140,8 +1123,7 @@  discard block
 block discarded – undo
1140 1123
 		if($point > 0)
1141 1124
 		{
1142 1125
 			$output->add('voted_count', $obj->after_point);
1143
-		}
1144
-		else
1126
+		} else
1145 1127
 		{
1146 1128
 			$output->add('blamed_count', $obj->after_point);
1147 1129
 		}
@@ -1213,8 +1195,7 @@  discard block
 block discarded – undo
1213 1195
 		if($member_srl)
1214 1196
 		{
1215 1197
 			$args->member_srl = $member_srl;
1216
-		}
1217
-		else
1198
+		} else
1218 1199
 		{
1219 1200
 			$args->ipaddress = $_SERVER['REMOTE_ADDR'];
1220 1201
 		}
@@ -1236,8 +1217,7 @@  discard block
 block discarded – undo
1236 1217
 		if($output->data->declared_count > 0)
1237 1218
 		{
1238 1219
 			$output = executeQuery('comment.updateDeclaredComment', $args);
1239
-		}
1240
-		else
1220
+		} else
1241 1221
 		{
1242 1222
 			$output = executeQuery('comment.insertDeclaredComment', $args);
1243 1223
 		}
@@ -1304,8 +1284,7 @@  discard block
 block discarded – undo
1304 1284
 		if(preg_match('/^([0-9,]+)$/', $module_srl))
1305 1285
 		{
1306 1286
 			$module_srl = explode(',', $module_srl);
1307
-		}
1308
-		else
1287
+		} else
1309 1288
 		{
1310 1289
 			$module_srl = array($module_srl);
1311 1290
 		}
@@ -1395,8 +1374,7 @@  discard block
 block discarded – undo
1395 1374
 					$value->content = strip_tags($value->content);
1396 1375
 				}
1397 1376
 			}
1398
-		}
1399
-		else
1377
+		} else
1400 1378
 		{
1401 1379
 			global $lang;
1402 1380
 			$commentList = array();
Please login to merge, or discard this patch.
Spacing   +153 added lines, -153 removed lines patch added patch discarded remove patch
@@ -27,13 +27,13 @@  discard block
 block discarded – undo
27 27
 	 */
28 28
 	function procCommentVoteUp()
29 29
 	{
30
-		if(!Context::get('is_logged'))
30
+		if (!Context::get('is_logged'))
31 31
 		{
32 32
 			return new Object(-1, 'msg_invalid_request');
33 33
 		}
34 34
 
35 35
 		$comment_srl = Context::get('target_srl');
36
-		if(!$comment_srl)
36
+		if (!$comment_srl)
37 37
 		{
38 38
 			return new Object(-1, 'msg_invalid_request');
39 39
 		}
@@ -41,14 +41,14 @@  discard block
 block discarded – undo
41 41
 		$oCommentModel = getModel('comment');
42 42
 		$oComment = $oCommentModel->getComment($comment_srl, FALSE, FALSE);
43 43
 		$module_srl = $oComment->get('module_srl');
44
-		if(!$module_srl)
44
+		if (!$module_srl)
45 45
 		{
46 46
 			return new Object(-1, 'msg_invalid_request');
47 47
 		}
48 48
 
49 49
 		$oModuleModel = getModel('module');
50 50
 		$comment_config = $oModuleModel->getModulePartConfig('comment', $module_srl);
51
-		if($comment_config->use_vote_up == 'N')
51
+		if ($comment_config->use_vote_up == 'N')
52 52
 		{
53 53
 			return new Object(-1, 'msg_invalid_request');
54 54
 		}
@@ -65,13 +65,13 @@  discard block
 block discarded – undo
65 65
 	 */
66 66
 	function procCommentVoteDown()
67 67
 	{
68
-		if(!Context::get('is_logged'))
68
+		if (!Context::get('is_logged'))
69 69
 		{
70 70
 			return new Object(-1, 'msg_invalid_request');
71 71
 		}
72 72
 
73 73
 		$comment_srl = Context::get('target_srl');
74
-		if(!$comment_srl)
74
+		if (!$comment_srl)
75 75
 		{
76 76
 			return new Object(-1, 'msg_invalid_request');
77 77
 		}
@@ -79,14 +79,14 @@  discard block
 block discarded – undo
79 79
 		$oCommentModel = getModel('comment');
80 80
 		$oComment = $oCommentModel->getComment($comment_srl, FALSE, FALSE);
81 81
 		$module_srl = $oComment->get('module_srl');
82
-		if(!$module_srl)
82
+		if (!$module_srl)
83 83
 		{
84 84
 			return new Object(-1, 'msg_invalid_request');
85 85
 		}
86 86
 
87 87
 		$oModuleModel = getModel('module');
88 88
 		$comment_config = $oModuleModel->getModulePartConfig('comment', $module_srl);
89
-		if($comment_config->use_vote_down == 'N')
89
+		if ($comment_config->use_vote_down == 'N')
90 90
 		{
91 91
 			return new Object(-1, 'msg_invalid_request');
92 92
 		}
@@ -103,13 +103,13 @@  discard block
 block discarded – undo
103 103
 	 */
104 104
 	function procCommentDeclare()
105 105
 	{
106
-		if(!Context::get('is_logged'))
106
+		if (!Context::get('is_logged'))
107 107
 		{
108 108
 			return new Object(-1, 'msg_invalid_request');
109 109
 		}
110 110
 
111 111
 		$comment_srl = Context::get('target_srl');
112
-		if(!$comment_srl)
112
+		if (!$comment_srl)
113 113
 		{
114 114
 			return new Object(-1, 'msg_invalid_request');
115 115
 		}
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 	function triggerDeleteDocumentComments(&$obj)
125 125
 	{
126 126
 		$document_srl = $obj->document_srl;
127
-		if(!$document_srl)
127
+		if (!$document_srl)
128 128
 		{
129 129
 			return new Object();
130 130
 		}
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 	function triggerDeleteModuleComments(&$obj)
140 140
 	{
141 141
 		$module_srl = $obj->module_srl;
142
-		if(!$module_srl)
142
+		if (!$module_srl)
143 143
 		{
144 144
 			return new Object();
145 145
 		}
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 	 */
167 167
 	function isModuleUsingPublishValidation($module_srl = NULL)
168 168
 	{
169
-		if($module_srl == NULL)
169
+		if ($module_srl == NULL)
170 170
 		{
171 171
 			return FALSE;
172 172
 		}
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
176 176
 		$module_part_config = $oModuleModel->getModulePartConfig('comment', $module_info->module_srl);
177 177
 		$use_validation = FALSE;
178
-		if(isset($module_part_config->use_comment_validation) && $module_part_config->use_comment_validation == "Y")
178
+		if (isset($module_part_config->use_comment_validation) && $module_part_config->use_comment_validation == "Y")
179 179
 		{
180 180
 			$use_validation = TRUE;
181 181
 		}
@@ -190,12 +190,12 @@  discard block
 block discarded – undo
190 190
 	 */
191 191
 	function insertComment($obj, $manual_inserted = FALSE)
192 192
 	{
193
-		if(!$manual_inserted && !checkCSRF())
193
+		if (!$manual_inserted && !checkCSRF())
194 194
 		{
195 195
 			return new Object(-1, 'msg_invalid_request');
196 196
 		}
197 197
 
198
-		if(!is_object($obj))
198
+		if (!is_object($obj))
199 199
 		{
200 200
 			$obj = new stdClass();
201 201
 		}
@@ -203,12 +203,12 @@  discard block
 block discarded – undo
203 203
 		// check if comment's module is using comment validation and set the publish status to 0 (false)
204 204
 		// for inserting query, otherwise default is 1 (true - means comment is published)
205 205
 		$using_validation = $this->isModuleUsingPublishValidation($obj->module_srl);
206
-		if(!$manual_inserted)
206
+		if (!$manual_inserted)
207 207
 		{
208
-			if(Context::get('is_logged'))
208
+			if (Context::get('is_logged'))
209 209
 			{
210 210
 				$logged_info = Context::get('logged_info');
211
-				if($logged_info->is_admin == 'Y')
211
+				if ($logged_info->is_admin == 'Y')
212 212
 				{
213 213
 					$is_admin = TRUE;
214 214
 				}
@@ -223,13 +223,13 @@  discard block
 block discarded – undo
223 223
 			$is_admin = FALSE;
224 224
 		}
225 225
 
226
-		if(!$using_validation)
226
+		if (!$using_validation)
227 227
 		{
228 228
 			$obj->status = 1;
229 229
 		}
230 230
 		else
231 231
 		{
232
-			if($is_admin)
232
+			if ($is_admin)
233 233
 			{
234 234
 				$obj->status = 1;
235 235
 			}
@@ -242,14 +242,14 @@  discard block
 block discarded – undo
242 242
 
243 243
 		// call a trigger (before)
244 244
 		$output = ModuleHandler::triggerCall('comment.insertComment', 'before', $obj);
245
-		if(!$output->toBool())
245
+		if (!$output->toBool())
246 246
 		{
247 247
 			return $output;
248 248
 		}
249 249
 
250 250
 		// check if a posting of the corresponding document_srl exists
251 251
 		$document_srl = $obj->document_srl;
252
-		if(!$document_srl)
252
+		if (!$document_srl)
253 253
 		{
254 254
 			return new Object(-1, 'msg_invalid_document');
255 255
 		}
@@ -258,36 +258,36 @@  discard block
 block discarded – undo
258 258
 		$oDocumentModel = getModel('document');
259 259
 
260 260
 		// even for manual_inserted if password exists, hash it.
261
-		if($obj->password)
261
+		if ($obj->password)
262 262
 		{
263 263
 			$obj->password = getModel('member')->hashPassword($obj->password);
264 264
 		}
265 265
 
266 266
 		// get the original posting
267
-		if(!$manual_inserted)
267
+		if (!$manual_inserted)
268 268
 		{
269 269
 			$oDocument = $oDocumentModel->getDocument($document_srl);
270 270
 
271
-			if($document_srl != $oDocument->document_srl)
271
+			if ($document_srl != $oDocument->document_srl)
272 272
 			{
273 273
 				return new Object(-1, 'msg_invalid_document');
274 274
 			}
275
-			if($oDocument->isLocked())
275
+			if ($oDocument->isLocked())
276 276
 			{
277 277
 				return new Object(-1, 'msg_invalid_request');
278 278
 			}
279 279
 
280
-			if($obj->homepage)
280
+			if ($obj->homepage)
281 281
 			{
282 282
 				$obj->homepage = removeHackTag($obj->homepage);
283
-				if(!preg_match('/^[a-z]+:\/\//i',$obj->homepage))
283
+				if (!preg_match('/^[a-z]+:\/\//i', $obj->homepage))
284 284
 				{
285 285
 					$obj->homepage = 'http://'.$obj->homepage;
286 286
 				}
287 287
 			}
288 288
 
289 289
 			// input the member's information if logged-in
290
-			if(Context::get('is_logged'))
290
+			if (Context::get('is_logged'))
291 291
 			{
292 292
 				$logged_info = Context::get('logged_info');
293 293
 				$obj->member_srl = $logged_info->member_srl;
@@ -302,16 +302,16 @@  discard block
 block discarded – undo
302 302
 		}
303 303
 
304 304
 		// error display if neither of log-in info and user name exist.
305
-		if(!$logged_info->member_srl && !$obj->nick_name)
305
+		if (!$logged_info->member_srl && !$obj->nick_name)
306 306
 		{
307 307
 			return new Object(-1, 'msg_invalid_request');
308 308
 		}
309 309
 
310
-		if(!$obj->comment_srl)
310
+		if (!$obj->comment_srl)
311 311
 		{
312 312
 			$obj->comment_srl = getNextSequence();
313 313
 		}
314
-		elseif(!$is_admin && !$manual_inserted && !checkUserSequence($obj->comment_srl)) 
314
+		elseif (!$is_admin && !$manual_inserted && !checkUserSequence($obj->comment_srl)) 
315 315
 		{
316 316
 			return new Object(-1, 'msg_not_permitted');
317 317
 		}
@@ -322,32 +322,32 @@  discard block
 block discarded – undo
322 322
 		// remove XE's own tags from the contents
323 323
 		$obj->content = preg_replace('!<\!--(Before|After)(Document|Comment)\(([0-9]+),([0-9]+)\)-->!is', '', $obj->content);
324 324
 
325
-		if(Mobile::isFromMobilePhone() && $obj->use_editor != 'Y')
325
+		if (Mobile::isFromMobilePhone() && $obj->use_editor != 'Y')
326 326
 		{
327
-			if($obj->use_html != 'Y')
327
+			if ($obj->use_html != 'Y')
328 328
 			{
329 329
 				$obj->content = htmlspecialchars($obj->content, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
330 330
 			}
331 331
 			$obj->content = nl2br($obj->content);
332 332
 		}
333 333
 
334
-		if(!$obj->regdate)
334
+		if (!$obj->regdate)
335 335
 		{
336 336
 			$obj->regdate = date("YmdHis");
337 337
 		}
338 338
 
339 339
 		// remove iframe and script if not a top administrator on the session.
340
-		if($logged_info->is_admin != 'Y')
340
+		if ($logged_info->is_admin != 'Y')
341 341
 		{
342 342
 			$obj->content = removeHackTag($obj->content);
343 343
 		}
344 344
 
345
-		if(!$obj->notify_message)
345
+		if (!$obj->notify_message)
346 346
 		{
347 347
 			$obj->notify_message = 'N';
348 348
 		}
349 349
 
350
-		if(!$obj->is_secret)
350
+		if (!$obj->is_secret)
351 351
 		{
352 352
 			$obj->is_secret = 'N';
353 353
 		}
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
 		$list_args->regdate = $obj->regdate;
365 365
 
366 366
 		// If parent comment doesn't exist, set data directly
367
-		if(!$obj->parent_srl)
367
+		if (!$obj->parent_srl)
368 368
 		{
369 369
 			$list_args->head = $list_args->arrange = $obj->comment_srl;
370 370
 			$list_args->depth = 0;
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
 			$parent_output = executeQuery('comment.getCommentListItem', $parent_args);
379 379
 
380 380
 			// return if no parent comment exists
381
-			if(!$parent_output->toBool() || !$parent_output->data)
381
+			if (!$parent_output->toBool() || !$parent_output->data)
382 382
 			{
383 383
 				return;
384 384
 			}
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
 			$list_args->depth = $parent->depth + 1;
390 390
 
391 391
 			// if the depth of comments is less than 2, execute insert.
392
-			if($list_args->depth < 2)
392
+			if ($list_args->depth < 2)
393 393
 			{
394 394
 				$list_args->arrange = $obj->comment_srl;
395 395
 				// if the depth of comments is greater than 2, execute update.
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
 				$p_args->depth = $parent->depth;
404 404
 				$output = executeQuery('comment.getCommentParentNextSibling', $p_args);
405 405
 
406
-				if($output->data->arrange)
406
+				if ($output->data->arrange)
407 407
 				{
408 408
 					$list_args->arrange = $output->data->arrange;
409 409
 					$output = executeQuery('comment.updateCommentListArrange', $list_args);
@@ -416,14 +416,14 @@  discard block
 block discarded – undo
416 416
 		}
417 417
 
418 418
 		$output = executeQuery('comment.insertCommentList', $list_args);
419
-		if(!$output->toBool())
419
+		if (!$output->toBool())
420 420
 		{
421 421
 			return $output;
422 422
 		}
423 423
 
424 424
 		// insert comment
425 425
 		$output = executeQuery('comment.insertComment', $obj);
426
-		if(!$output->toBool())
426
+		if (!$output->toBool())
427 427
 		{
428 428
 			$oDB->rollback();
429 429
 			return $output;
@@ -439,29 +439,29 @@  discard block
 block discarded – undo
439 439
 		$oDocumentController = getController('document');
440 440
 
441 441
 		// Update the number of comments in the post
442
-		if(!$using_validation)
442
+		if (!$using_validation)
443 443
 		{
444 444
 			$output = $oDocumentController->updateCommentCount($document_srl, $comment_count, $obj->nick_name, TRUE);
445 445
 		}
446 446
 		else
447 447
 		{
448
-			if($is_admin)
448
+			if ($is_admin)
449 449
 			{
450 450
 				$output = $oDocumentController->updateCommentCount($document_srl, $comment_count, $obj->nick_name, TRUE);
451 451
 			}
452 452
 		}
453 453
 
454 454
 		// grant autority of the comment
455
-		if(!$manual_inserted)
455
+		if (!$manual_inserted)
456 456
 		{
457 457
 			$this->addGrant($obj->comment_srl);
458 458
 		}
459 459
 
460 460
 		// call a trigger(after)
461
-		if($output->toBool())
461
+		if ($output->toBool())
462 462
 		{
463 463
 			$trigger_output = ModuleHandler::triggerCall('comment.insertComment', 'after', $obj);
464
-			if(!$trigger_output->toBool())
464
+			if (!$trigger_output->toBool())
465 465
 			{
466 466
 				$oDB->rollback();
467 467
 				return $trigger_output;
@@ -471,16 +471,16 @@  discard block
 block discarded – undo
471 471
 		// commit
472 472
 		$oDB->commit();
473 473
 
474
-		if(!$manual_inserted)
474
+		if (!$manual_inserted)
475 475
 		{
476 476
 			// send a message if notify_message option in enabled in the original article
477 477
 			$oDocument->notify(Context::getLang('comment'), $obj->content);
478 478
 
479 479
 			// send a message if notify_message option in enabled in the original comment
480
-			if($obj->parent_srl)
480
+			if ($obj->parent_srl)
481 481
 			{
482 482
 				$oParent = $oCommentModel->getComment($obj->parent_srl);
483
-				if($oParent->get('member_srl') != $oDocument->get('member_srl'))
483
+				if ($oParent->get('member_srl') != $oDocument->get('member_srl'))
484 484
 				{
485 485
 					$oParent->notify(Context::getLang('comment'), $obj->content);
486 486
 				}
@@ -508,7 +508,7 @@  discard block
 block discarded – undo
508 508
 		$oDocument = $oDocumentModel->getDocument($obj->document_srl);
509 509
 
510 510
 		$oMemberModel = getModel("member");
511
-		if(isset($obj->member_srl) && !is_null($obj->member_srl))
511
+		if (isset($obj->member_srl) && !is_null($obj->member_srl))
512 512
 		{
513 513
 			$member_info = $oMemberModel->getMemberInfoByMemberSrl($obj->member_srl);
514 514
 		}
@@ -528,47 +528,47 @@  discard block
 block discarded – undo
528 528
 		$module_info = $oModuleModel->getModuleInfoByDocumentSrl($obj->document_srl);
529 529
 
530 530
 		// If there is no problem to register comment then send an email to all admin were set in module admin panel
531
-		if($module_info->admin_mail && $member_info->is_admin != 'Y')
531
+		if ($module_info->admin_mail && $member_info->is_admin != 'Y')
532 532
 		{
533 533
 			$oMail = new Mail();
534 534
 			$oMail->setSender($obj->email_address, $obj->email_address);
535
-			$mail_title = "[XE - " . Context::get('mid') . "] A new comment was posted on document: \"" . $oDocument->getTitleText() . "\"";
535
+			$mail_title = "[XE - ".Context::get('mid')."] A new comment was posted on document: \"".$oDocument->getTitleText()."\"";
536 536
 			$oMail->setTitle($mail_title);
537
-			$url_comment = getFullUrl('','document_srl',$obj->document_srl).'#comment_'.$obj->comment_srl;
538
-			if($using_validation)
537
+			$url_comment = getFullUrl('', 'document_srl', $obj->document_srl).'#comment_'.$obj->comment_srl;
538
+			if ($using_validation)
539 539
 			{
540 540
 				$url_approve = getFullUrl('', 'module', 'admin', 'act', 'procCommentAdminChangePublishedStatusChecked', 'cart[]', $obj->comment_srl, 'will_publish', '1', 'search_target', 'is_published', 'search_keyword', 'N');
541 541
 				$url_trash = getFullUrl('', 'module', 'admin', 'act', 'procCommentAdminDeleteChecked', 'cart[]', $obj->comment_srl, 'search_target', 'is_trash', 'search_keyword', 'true');
542 542
 				$mail_content = "
543
-					A new comment on the document \"" . $oDocument->getTitleText() . "\" is waiting for your approval.
543
+					A new comment on the document \"" . $oDocument->getTitleText()."\" is waiting for your approval.
544 544
 					<br />
545 545
 					<br />
546
-					Author: " . $member_info->nick_name . "
547
-					<br />Author e-mail: " . $member_info->email_address . "
548
-					<br />From : <a href=\"" . $url_comment . "\">" . $url_comment . "</a>
546
+					Author: " . $member_info->nick_name."
547
+					<br />Author e-mail: " . $member_info->email_address."
548
+					<br />From : <a href=\"" . $url_comment."\">".$url_comment."</a>
549 549
 					<br />Comment:
550
-					<br />\"" . $obj->content . "\"
550
+					<br />\"" . $obj->content."\"
551 551
 					<br />Document:
552
-					<br />\"" . $oDocument->getContentText(). "\"
552
+					<br />\"" . $oDocument->getContentText()."\"
553 553
 					<br />
554 554
 					<br />
555
-					Approve it: <a href=\"" . $url_approve . "\">" . $url_approve . "</a>
556
-					<br />Trash it: <a href=\"" . $url_trash . "\">" . $url_trash . "</a>
557
-					<br />Currently " . $nr_comments_not_approved . " comments on \"" . Context::get('mid') . "\" module are waiting for approval. Please visit the moderation panel:
558
-					<br /><a href=\"" . getFullUrl('', 'module', 'admin', 'act', 'dispCommentAdminList', 'search_target', 'module', 'search_keyword', $obj->module_srl) . "\">" . getFullUrl('', 'module', 'admin', 'act', 'dispCommentAdminList', 'search_target', 'module', 'search_keyword', $obj->module_srl) . "</a>
555
+					Approve it: <a href=\"" . $url_approve."\">".$url_approve."</a>
556
+					<br />Trash it: <a href=\"" . $url_trash."\">".$url_trash."</a>
557
+					<br />Currently " . $nr_comments_not_approved." comments on \"".Context::get('mid')."\" module are waiting for approval. Please visit the moderation panel:
558
+					<br /><a href=\"" . getFullUrl('', 'module', 'admin', 'act', 'dispCommentAdminList', 'search_target', 'module', 'search_keyword', $obj->module_srl)."\">".getFullUrl('', 'module', 'admin', 'act', 'dispCommentAdminList', 'search_target', 'module', 'search_keyword', $obj->module_srl)."</a>
559 559
 					";
560 560
 				$oMail->setContent($mail_content);
561 561
 			}
562 562
 			else
563 563
 			{
564 564
 				$mail_content = "
565
-					Author: " . $member_info->nick_name . "
566
-					<br />Author e-mail: " . $member_info->email_address . "
567
-					<br />From : <a href=\"" . $url_comment . "\">" . $url_comment . "</a>
565
+					Author: " . $member_info->nick_name."
566
+					<br />Author e-mail: " . $member_info->email_address."
567
+					<br />From : <a href=\"" . $url_comment."\">".$url_comment."</a>
568 568
 					<br />Comment:
569
-					<br />\"" . $obj->content . "\"
569
+					<br />\"" . $obj->content."\"
570 570
 					<br />Document:
571
-					<br />\"" . $oDocument->getContentText(). "\"
571
+					<br />\"" . $oDocument->getContentText()."\"
572 572
 					";
573 573
 				$oMail->setContent($mail_content);
574 574
 
@@ -597,10 +597,10 @@  discard block
 block discarded – undo
597 597
 			$target_mail = explode(',', $admins_emails);
598 598
 
599 599
 			// send email to all admins - START
600
-			for($i = 0; $i < count($target_mail); $i++)
600
+			for ($i = 0; $i < count($target_mail); $i++)
601 601
 			{
602 602
 				$email_address = trim($target_mail[$i]);
603
-				if(!$email_address)
603
+				if (!$email_address)
604 604
 				{
605 605
 					continue;
606 606
 				}
@@ -646,12 +646,12 @@  discard block
 block discarded – undo
646 646
 	 */
647 647
 	function updateComment($obj, $is_admin = FALSE, $manual_updated = FALSE)
648 648
 	{
649
-		if(!$manual_updated && !checkCSRF())
649
+		if (!$manual_updated && !checkCSRF())
650 650
 		{
651 651
 			return new Object(-1, 'msg_invalid_request');
652 652
 		}
653 653
 
654
-		if(!is_object($obj))
654
+		if (!is_object($obj))
655 655
 		{
656 656
 			$obj = new stdClass();
657 657
 		}
@@ -660,7 +660,7 @@  discard block
 block discarded – undo
660 660
 
661 661
 		// call a trigger (before)
662 662
 		$output = ModuleHandler::triggerCall('comment.updateComment', 'before', $obj);
663
-		if(!$output->toBool())
663
+		if (!$output->toBool())
664 664
 		{
665 665
 			return $output;
666 666
 		}
@@ -670,7 +670,7 @@  discard block
 block discarded – undo
670 670
 
671 671
 		// get the original data
672 672
 		$source_obj = $oCommentModel->getComment($obj->comment_srl);
673
-		if(!$source_obj->getMemberSrl())
673
+		if (!$source_obj->getMemberSrl())
674 674
 		{
675 675
 			$obj->member_srl = $source_obj->get('member_srl');
676 676
 			$obj->user_name = $source_obj->get('user_name');
@@ -680,30 +680,30 @@  discard block
 block discarded – undo
680 680
 		}
681 681
 
682 682
 		// check if permission is granted
683
-		if(!$is_admin && !$source_obj->isGranted())
683
+		if (!$is_admin && !$source_obj->isGranted())
684 684
 		{
685 685
 			return new Object(-1, 'msg_not_permitted');
686 686
 		}
687 687
 
688
-		if($obj->password)
688
+		if ($obj->password)
689 689
 		{
690 690
 			$obj->password = getModel('member')->hashPassword($obj->password);
691 691
 		}
692 692
 
693
-		if($obj->homepage) 
693
+		if ($obj->homepage) 
694 694
 		{
695 695
 			$obj->homepage = removeHackTag($obj->homepage);
696
-			if(!preg_match('/^[a-z]+:\/\//i',$obj->homepage))
696
+			if (!preg_match('/^[a-z]+:\/\//i', $obj->homepage))
697 697
 			{
698 698
 				$obj->homepage = 'http://'.$obj->homepage;
699 699
 			}
700 700
 		}
701 701
 
702 702
 		// set modifier's information if logged-in and posting author and modifier are matched.
703
-		if(Context::get('is_logged'))
703
+		if (Context::get('is_logged'))
704 704
 		{
705 705
 			$logged_info = Context::get('logged_info');
706
-			if($source_obj->member_srl == $logged_info->member_srl)
706
+			if ($source_obj->member_srl == $logged_info->member_srl)
707 707
 			{
708 708
 				$obj->member_srl = $logged_info->member_srl;
709 709
 				$obj->user_name = $logged_info->user_name;
@@ -714,7 +714,7 @@  discard block
 block discarded – undo
714 714
 		}
715 715
 
716 716
 		// if nick_name of the logged-in author doesn't exist
717
-		if($source_obj->get('member_srl') && !$obj->nick_name)
717
+		if ($source_obj->get('member_srl') && !$obj->nick_name)
718 718
 		{
719 719
 			$obj->member_srl = $source_obj->get('member_srl');
720 720
 			$obj->user_name = $source_obj->get('user_name');
@@ -723,7 +723,7 @@  discard block
 block discarded – undo
723 723
 			$obj->homepage = $source_obj->get('homepage');
724 724
 		}
725 725
 
726
-		if(!$obj->content)
726
+		if (!$obj->content)
727 727
 		{
728 728
 			$obj->content = $source_obj->get('content');
729 729
 		}
@@ -731,9 +731,9 @@  discard block
 block discarded – undo
731 731
 		// remove XE's wn tags from contents
732 732
 		$obj->content = preg_replace('!<\!--(Before|After)(Document|Comment)\(([0-9]+),([0-9]+)\)-->!is', '', $obj->content);
733 733
 
734
-		if(Mobile::isFromMobilePhone() && $obj->use_editor != 'Y')
734
+		if (Mobile::isFromMobilePhone() && $obj->use_editor != 'Y')
735 735
 		{
736
-			if($obj->use_html != 'Y')
736
+			if ($obj->use_html != 'Y')
737 737
 			{
738 738
 				$obj->content = htmlspecialchars($obj->content, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
739 739
 			}
@@ -741,7 +741,7 @@  discard block
 block discarded – undo
741 741
 		}
742 742
 
743 743
 		// remove iframe and script if not a top administrator on the session
744
-		if($logged_info->is_admin != 'Y')
744
+		if ($logged_info->is_admin != 'Y')
745 745
 		{
746 746
 			$obj->content = removeHackTag($obj->content);
747 747
 		}
@@ -752,17 +752,17 @@  discard block
 block discarded – undo
752 752
 
753 753
 		// Update
754 754
 		$output = executeQuery('comment.updateComment', $obj);
755
-		if(!$output->toBool())
755
+		if (!$output->toBool())
756 756
 		{
757 757
 			$oDB->rollback();
758 758
 			return $output;
759 759
 		}
760 760
 
761 761
 		// call a trigger (after)
762
-		if($output->toBool())
762
+		if ($output->toBool())
763 763
 		{
764 764
 			$trigger_output = ModuleHandler::triggerCall('comment.updateComment', 'after', $obj);
765
-			if(!$trigger_output->toBool())
765
+			if (!$trigger_output->toBool())
766 766
 			{
767 767
 				$oDB->rollback();
768 768
 				return $trigger_output;
@@ -791,7 +791,7 @@  discard block
 block discarded – undo
791 791
 
792 792
 		// check if comment already exists
793 793
 		$comment = $oCommentModel->getComment($comment_srl);
794
-		if($comment->comment_srl != $comment_srl)
794
+		if ($comment->comment_srl != $comment_srl)
795 795
 		{
796 796
 			return new Object(-1, 'msg_invalid_request');
797 797
 		}
@@ -800,28 +800,28 @@  discard block
 block discarded – undo
800 800
 
801 801
 		// call a trigger (before)
802 802
 		$output = ModuleHandler::triggerCall('comment.deleteComment', 'before', $comment);
803
-		if(!$output->toBool())
803
+		if (!$output->toBool())
804 804
 		{
805 805
 			return $output;
806 806
 		}
807 807
 
808 808
 		// check if permission is granted
809
-		if(!$is_admin && !$comment->isGranted())
809
+		if (!$is_admin && !$comment->isGranted())
810 810
 		{
811 811
 			return new Object(-1, 'msg_not_permitted');
812 812
 		}
813 813
 
814 814
 		// check if child comment exists on the comment
815 815
 		$childs = $oCommentModel->getChildComments($comment_srl);
816
-		if(count($childs) > 0)
816
+		if (count($childs) > 0)
817 817
 		{
818 818
 			$deleteAllComment = TRUE;
819
-			if(!$is_admin)
819
+			if (!$is_admin)
820 820
 			{
821 821
 				$logged_info = Context::get('logged_info');
822
-				foreach($childs as $val)
822
+				foreach ($childs as $val)
823 823
 				{
824
-					if($val->member_srl != $logged_info->member_srl)
824
+					if ($val->member_srl != $logged_info->member_srl)
825 825
 					{
826 826
 						$deleteAllComment = FALSE;
827 827
 						break;
@@ -829,16 +829,16 @@  discard block
 block discarded – undo
829 829
 				}
830 830
 			}
831 831
 
832
-			if(!$deleteAllComment)
832
+			if (!$deleteAllComment)
833 833
 			{
834 834
 				return new Object(-1, 'fail_to_delete_have_children');
835 835
 			}
836 836
 			else
837 837
 			{
838
-				foreach($childs as $val)
838
+				foreach ($childs as $val)
839 839
 				{
840 840
 					$output = $this->deleteComment($val->comment_srl, $is_admin, $isMoveToTrash);
841
-					if(!$output->toBool())
841
+					if (!$output->toBool())
842 842
 					{
843 843
 						return $output;
844 844
 					}
@@ -854,7 +854,7 @@  discard block
 block discarded – undo
854 854
 		$args = new stdClass();
855 855
 		$args->comment_srl = $comment_srl;
856 856
 		$output = executeQuery('comment.deleteComment', $args);
857
-		if(!$output->toBool())
857
+		if (!$output->toBool())
858 858
 		{
859 859
 			$oDB->rollback();
860 860
 			return $output;
@@ -866,14 +866,14 @@  discard block
 block discarded – undo
866 866
 		$comment_count = $oCommentModel->getCommentCount($document_srl);
867 867
 
868 868
 		// only document is exists
869
-		if(isset($comment_count))
869
+		if (isset($comment_count))
870 870
 		{
871 871
 			// create the controller object of the document
872 872
 			$oDocumentController = getController('document');
873 873
 
874 874
 			// update comment count of the article posting
875 875
 			$output = $oDocumentController->updateCommentCount($document_srl, $comment_count, NULL, FALSE);
876
-			if(!$output->toBool())
876
+			if (!$output->toBool())
877 877
 			{
878 878
 				$oDB->rollback();
879 879
 				return $output;
@@ -881,11 +881,11 @@  discard block
 block discarded – undo
881 881
 		}
882 882
 
883 883
 		// call a trigger (after)
884
-		if($output->toBool())
884
+		if ($output->toBool())
885 885
 		{
886 886
 			$comment->isMoveToTrash = $isMoveToTrash;
887 887
 			$trigger_output = ModuleHandler::triggerCall('comment.deleteComment', 'after', $comment);
888
-			if(!$trigger_output->toBool())
888
+			if (!$trigger_output->toBool())
889 889
 			{
890 890
 				$oDB->rollback();
891 891
 				return $trigger_output;
@@ -893,7 +893,7 @@  discard block
 block discarded – undo
893 893
 			unset($comment->isMoveToTrash);
894 894
 		}
895 895
 
896
-		if(!$isMoveToTrash)
896
+		if (!$isMoveToTrash)
897 897
 		{
898 898
 			$this->_deleteDeclaredComments($args);
899 899
 			$this->_deleteVotedComments($args);
@@ -937,7 +937,7 @@  discard block
 block discarded – undo
937 937
 		$oCommentModel = getModel('comment');
938 938
 
939 939
 		// check if permission is granted
940
-		if(is_object($obj))
940
+		if (is_object($obj))
941 941
 		{
942 942
 			$oDocument = new documentItem();
943 943
 			$oDocument->setAttribute($obj);
@@ -947,7 +947,7 @@  discard block
 block discarded – undo
947 947
 			$oDocument = $oDocumentModel->getDocument($document_srl);
948 948
 		}
949 949
 
950
-		if(!$oDocument->isExists() || !$oDocument->isGranted())
950
+		if (!$oDocument->isExists() || !$oDocument->isGranted())
951 951
 		{
952 952
 			return new Object(-1, 'msg_not_permitted');
953 953
 		}
@@ -956,23 +956,23 @@  discard block
 block discarded – undo
956 956
 		$args = new stdClass();
957 957
 		$args->document_srl = $document_srl;
958 958
 		$comments = executeQueryArray('comment.getAllComments', $args);
959
-		if($comments->data)
959
+		if ($comments->data)
960 960
 		{
961 961
 			$commentSrlList = array();
962
-			foreach($comments->data as $comment)
962
+			foreach ($comments->data as $comment)
963 963
 			{
964 964
 				$commentSrlList[] = $comment->comment_srl;
965 965
 
966 966
 				// call a trigger (before)
967 967
 				$output = ModuleHandler::triggerCall('comment.deleteComment', 'before', $comment);
968
-				if(!$output->toBool())
968
+				if (!$output->toBool())
969 969
 				{
970 970
 					continue;
971 971
 				}
972 972
 
973 973
 				// call a trigger (after)
974 974
 				$output = ModuleHandler::triggerCall('comment.deleteComment', 'after', $comment);
975
-				if(!$output->toBool())
975
+				if (!$output->toBool())
976 976
 				{
977 977
 					continue;
978 978
 				}
@@ -982,7 +982,7 @@  discard block
 block discarded – undo
982 982
 		// delete the comment
983 983
 		$args->document_srl = $document_srl;
984 984
 		$output = executeQuery('comment.deleteComments', $args);
985
-		if(!$output->toBool())
985
+		if (!$output->toBool())
986 986
 		{
987 987
 			return $output;
988 988
 		}
@@ -991,7 +991,7 @@  discard block
 block discarded – undo
991 991
 		$output = executeQuery('comment.deleteCommentsList', $args);
992 992
 
993 993
 		//delete declared, declared_log, voted_log
994
-		if(is_array($commentSrlList) && count($commentSrlList) > 0)
994
+		if (is_array($commentSrlList) && count($commentSrlList) > 0)
995 995
 		{
996 996
 			$args = new stdClass();
997 997
 			$args->comment_srl = join(',', $commentSrlList);
@@ -1031,7 +1031,7 @@  discard block
 block discarded – undo
1031 1031
 	 */
1032 1032
 	function updateVotedCount($comment_srl, $point = 1)
1033 1033
 	{
1034
-		if($point > 0)
1034
+		if ($point > 0)
1035 1035
 		{
1036 1036
 			$failed_voted = 'failed_voted';
1037 1037
 			$success_message = 'success_voted';
@@ -1043,7 +1043,7 @@  discard block
 block discarded – undo
1043 1043
 		}
1044 1044
 
1045 1045
 		// invalid vote if vote info exists in the session info.
1046
-		if($_SESSION['voted_comment'][$comment_srl])
1046
+		if ($_SESSION['voted_comment'][$comment_srl])
1047 1047
 		{
1048 1048
 			return new Object(-1, $failed_voted);
1049 1049
 		}
@@ -1052,21 +1052,21 @@  discard block
 block discarded – undo
1052 1052
 		$oComment = $oCommentModel->getComment($comment_srl, FALSE, FALSE);
1053 1053
 
1054 1054
 		// invalid vote if both ip addresses between author's and the current user are same.
1055
-		if($oComment->get('ipaddress') == $_SERVER['REMOTE_ADDR'])
1055
+		if ($oComment->get('ipaddress') == $_SERVER['REMOTE_ADDR'])
1056 1056
 		{
1057 1057
 			$_SESSION['voted_comment'][$comment_srl] = TRUE;
1058 1058
 			return new Object(-1, $failed_voted);
1059 1059
 		}
1060 1060
 
1061 1061
 		// if the comment author is a member
1062
-		if($oComment->get('member_srl'))
1062
+		if ($oComment->get('member_srl'))
1063 1063
 		{
1064 1064
 			// create the member model object
1065 1065
 			$oMemberModel = getModel('member');
1066 1066
 			$member_srl = $oMemberModel->getLoggedMemberSrl();
1067 1067
 
1068 1068
 			// session registered if the author information matches to the current logged-in user's.
1069
-			if($member_srl && $member_srl == abs($oComment->get('member_srl')))
1069
+			if ($member_srl && $member_srl == abs($oComment->get('member_srl')))
1070 1070
 			{
1071 1071
 				$_SESSION['voted_comment'][$comment_srl] = TRUE;
1072 1072
 				return new Object(-1, $failed_voted);
@@ -1076,7 +1076,7 @@  discard block
 block discarded – undo
1076 1076
 		$args = new stdClass();
1077 1077
 
1078 1078
 		// If logged-in, use the member_srl. otherwise use the ipaddress.
1079
-		if($member_srl)
1079
+		if ($member_srl)
1080 1080
 		{
1081 1081
 			$args->member_srl = $member_srl;
1082 1082
 		}
@@ -1089,7 +1089,7 @@  discard block
 block discarded – undo
1089 1089
 		$output = executeQuery('comment.getCommentVotedLogInfo', $args);
1090 1090
 
1091 1091
 		// session registered if log info contains recommendation vote log.
1092
-		if($output->data->count)
1092
+		if ($output->data->count)
1093 1093
 		{
1094 1094
 			$_SESSION['voted_comment'][$comment_srl] = TRUE;
1095 1095
 			return new Object(-1, $failed_voted);
@@ -1100,7 +1100,7 @@  discard block
 block discarded – undo
1100 1100
 		$oDB->begin();
1101 1101
 
1102 1102
 		// update the number of votes
1103
-		if($point < 0)
1103
+		if ($point < 0)
1104 1104
 		{
1105 1105
 			$args->blamed_count = $oComment->get('blamed_count') + $point;
1106 1106
 			$output = executeQuery('comment.updateBlamedCount', $args);
@@ -1124,7 +1124,7 @@  discard block
 block discarded – undo
1124 1124
 		$obj->before_point = ($point < 0) ? $oComment->get('blamed_count') : $oComment->get('voted_count');
1125 1125
 		$obj->after_point = ($point < 0) ? $args->blamed_count : $args->voted_count;
1126 1126
 		$trigger_output = ModuleHandler::triggerCall('comment.updateVotedCount', 'after', $obj);
1127
-		if(!$trigger_output->toBool())
1127
+		if (!$trigger_output->toBool())
1128 1128
 		{
1129 1129
 			$oDB->rollback();
1130 1130
 			return $trigger_output;
@@ -1137,7 +1137,7 @@  discard block
 block discarded – undo
1137 1137
 
1138 1138
 		// Return the result
1139 1139
 		$output = new Object(0, $success_message);
1140
-		if($point > 0)
1140
+		if ($point > 0)
1141 1141
 		{
1142 1142
 			$output->add('voted_count', $obj->after_point);
1143 1143
 		}
@@ -1157,7 +1157,7 @@  discard block
 block discarded – undo
1157 1157
 	function declaredComment($comment_srl)
1158 1158
 	{
1159 1159
 		// Fail if session information already has a reported document
1160
-		if($_SESSION['declared_comment'][$comment_srl])
1160
+		if ($_SESSION['declared_comment'][$comment_srl])
1161 1161
 		{
1162 1162
 			return new Object(-1, 'failed_declared');
1163 1163
 		}
@@ -1166,7 +1166,7 @@  discard block
 block discarded – undo
1166 1166
 		$args = new stdClass();
1167 1167
 		$args->comment_srl = $comment_srl;
1168 1168
 		$output = executeQuery('comment.getDeclaredComment', $args);
1169
-		if(!$output->toBool())
1169
+		if (!$output->toBool())
1170 1170
 		{
1171 1171
 			return $output;
1172 1172
 		}
@@ -1178,7 +1178,7 @@  discard block
 block discarded – undo
1178 1178
 
1179 1179
 		// Call a trigger (before)
1180 1180
 		$trigger_output = ModuleHandler::triggerCall('comment.declaredComment', 'before', $trigger_obj);
1181
-		if(!$trigger_output->toBool())
1181
+		if (!$trigger_output->toBool())
1182 1182
 		{
1183 1183
 			return $trigger_output;
1184 1184
 		}
@@ -1188,21 +1188,21 @@  discard block
 block discarded – undo
1188 1188
 		$oComment = $oCommentModel->getComment($comment_srl, FALSE, FALSE);
1189 1189
 
1190 1190
 		// failed if both ip addresses between author's and the current user are same.
1191
-		if($oComment->get('ipaddress') == $_SERVER['REMOTE_ADDR'])
1191
+		if ($oComment->get('ipaddress') == $_SERVER['REMOTE_ADDR'])
1192 1192
 		{
1193 1193
 			$_SESSION['declared_comment'][$comment_srl] = TRUE;
1194 1194
 			return new Object(-1, 'failed_declared');
1195 1195
 		}
1196 1196
 
1197 1197
 		// if the comment author is a member
1198
-		if($oComment->get('member_srl'))
1198
+		if ($oComment->get('member_srl'))
1199 1199
 		{
1200 1200
 			// create the member model object
1201 1201
 			$oMemberModel = getModel('member');
1202 1202
 			$member_srl = $oMemberModel->getLoggedMemberSrl();
1203 1203
 
1204 1204
 			// session registered if the author information matches to the current logged-in user's.
1205
-			if($member_srl && $member_srl == abs($oComment->get('member_srl')))
1205
+			if ($member_srl && $member_srl == abs($oComment->get('member_srl')))
1206 1206
 			{
1207 1207
 				$_SESSION['declared_comment'][$comment_srl] = TRUE;
1208 1208
 				return new Object(-1, 'failed_declared');
@@ -1210,7 +1210,7 @@  discard block
 block discarded – undo
1210 1210
 		}
1211 1211
 
1212 1212
 		// If logged-in, use the member_srl. otherwise use the ipaddress.
1213
-		if($member_srl)
1213
+		if ($member_srl)
1214 1214
 		{
1215 1215
 			$args->member_srl = $member_srl;
1216 1216
 		}
@@ -1222,7 +1222,7 @@  discard block
 block discarded – undo
1222 1222
 		$log_output = executeQuery('comment.getCommentDeclaredLogInfo', $args);
1223 1223
 
1224 1224
 		// session registered if log info contains report log.
1225
-		if($log_output->data->count)
1225
+		if ($log_output->data->count)
1226 1226
 		{
1227 1227
 			$_SESSION['declared_comment'][$comment_srl] = TRUE;
1228 1228
 			return new Object(-1, 'failed_declared');
@@ -1233,7 +1233,7 @@  discard block
 block discarded – undo
1233 1233
 		$oDB->begin();
1234 1234
 
1235 1235
 		// execute insert
1236
-		if($output->data->declared_count > 0)
1236
+		if ($output->data->declared_count > 0)
1237 1237
 		{
1238 1238
 			$output = executeQuery('comment.updateDeclaredComment', $args);
1239 1239
 		}
@@ -1242,7 +1242,7 @@  discard block
 block discarded – undo
1242 1242
 			$output = executeQuery('comment.insertDeclaredComment', $args);
1243 1243
 		}
1244 1244
 
1245
-		if(!$output->toBool())
1245
+		if (!$output->toBool())
1246 1246
 		{
1247 1247
 			$oDB->rollback();
1248 1248
 			return $output;
@@ -1254,7 +1254,7 @@  discard block
 block discarded – undo
1254 1254
 		// Call a trigger (after)
1255 1255
 		$trigger_obj->declared_count = $declared_count + 1;
1256 1256
 		$trigger_output = ModuleHandler::triggerCall('comment.declaredComment', 'after', $trigger_obj);
1257
-		if(!$trigger_output->toBool())
1257
+		if (!$trigger_output->toBool())
1258 1258
 		{
1259 1259
 			$oDB->rollback();
1260 1260
 			return $trigger_output;
@@ -1279,7 +1279,7 @@  discard block
 block discarded – undo
1279 1279
 	function addCommentPopupMenu($url, $str, $icon = '', $target = 'self')
1280 1280
 	{
1281 1281
 		$comment_popup_menu_list = Context::get('comment_popup_menu_list');
1282
-		if(!is_array($comment_popup_menu_list))
1282
+		if (!is_array($comment_popup_menu_list))
1283 1283
 		{
1284 1284
 			$comment_popup_menu_list = array();
1285 1285
 		}
@@ -1301,7 +1301,7 @@  discard block
 block discarded – undo
1301 1301
 	function procCommentInsertModuleConfig()
1302 1302
 	{
1303 1303
 		$module_srl = Context::get('target_module_srl');
1304
-		if(preg_match('/^([0-9,]+)$/', $module_srl))
1304
+		if (preg_match('/^([0-9,]+)$/', $module_srl))
1305 1305
 		{
1306 1306
 			$module_srl = explode(',', $module_srl);
1307 1307
 		}
@@ -1312,33 +1312,33 @@  discard block
 block discarded – undo
1312 1312
 
1313 1313
 		$comment_config = new stdClass();
1314 1314
 		$comment_config->comment_count = (int) Context::get('comment_count');
1315
-		if(!$comment_config->comment_count)
1315
+		if (!$comment_config->comment_count)
1316 1316
 		{
1317 1317
 			$comment_config->comment_count = 50;
1318 1318
 		}
1319 1319
 
1320 1320
 		$comment_config->use_vote_up = Context::get('use_vote_up');
1321
-		if(!$comment_config->use_vote_up)
1321
+		if (!$comment_config->use_vote_up)
1322 1322
 		{
1323 1323
 			$comment_config->use_vote_up = 'Y';
1324 1324
 		}
1325 1325
 
1326 1326
 		$comment_config->use_vote_down = Context::get('use_vote_down');
1327
-		if(!$comment_config->use_vote_down)
1327
+		if (!$comment_config->use_vote_down)
1328 1328
 		{
1329 1329
 			$comment_config->use_vote_down = 'Y';
1330 1330
 		}
1331 1331
 
1332 1332
 		$comment_config->use_comment_validation = Context::get('use_comment_validation');
1333
-		if(!$comment_config->use_comment_validation)
1333
+		if (!$comment_config->use_comment_validation)
1334 1334
 		{
1335 1335
 			$comment_config->use_comment_validation = 'N';
1336 1336
 		}
1337 1337
 
1338
-		for($i = 0; $i < count($module_srl); $i++)
1338
+		for ($i = 0; $i < count($module_srl); $i++)
1339 1339
 		{
1340 1340
 			$srl = trim($module_srl[$i]);
1341
-			if(!$srl)
1341
+			if (!$srl)
1342 1342
 			{
1343 1343
 				continue;
1344 1344
 			}
@@ -1372,25 +1372,25 @@  discard block
 block discarded – undo
1372 1372
 	 */
1373 1373
 	function procCommentGetList()
1374 1374
 	{
1375
-		if(!Context::get('is_logged'))
1375
+		if (!Context::get('is_logged'))
1376 1376
 		{
1377 1377
 			return new Object(-1, 'msg_not_permitted');
1378 1378
 		}
1379 1379
 
1380 1380
 		$commentSrls = Context::get('comment_srls');
1381
-		if($commentSrls)
1381
+		if ($commentSrls)
1382 1382
 		{
1383 1383
 			$commentSrlList = explode(',', $commentSrls);
1384 1384
 		}
1385 1385
 
1386
-		if(count($commentSrlList) > 0)
1386
+		if (count($commentSrlList) > 0)
1387 1387
 		{
1388 1388
 			$oCommentModel = getModel('comment');
1389 1389
 			$commentList = $oCommentModel->getComments($commentSrlList);
1390 1390
 
1391
-			if(is_array($commentList))
1391
+			if (is_array($commentList))
1392 1392
 			{
1393
-				foreach($commentList as $value)
1393
+				foreach ($commentList as $value)
1394 1394
 				{
1395 1395
 					$value->content = strip_tags($value->content);
1396 1396
 				}
@@ -1415,9 +1415,9 @@  discard block
 block discarded – undo
1415 1415
 		$commentConfig = $oModuleModel->getModulePartConfig('comment', $obj->originModuleSrl);
1416 1416
 
1417 1417
 		$oModuleController = getController('module');
1418
-		if(is_array($obj->moduleSrlList))
1418
+		if (is_array($obj->moduleSrlList))
1419 1419
 		{
1420
-			foreach($obj->moduleSrlList as $moduleSrl)
1420
+			foreach ($obj->moduleSrlList as $moduleSrl)
1421 1421
 			{
1422 1422
 				$oModuleController->insertModulePartConfig('comment', $moduleSrl, $commentConfig);
1423 1423
 			}
Please login to merge, or discard this patch.
modules/comment/comment.view.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
 	/**
25 25
 	 * Add a form fot comment setting on the additional setting of module
26 26
 	 * @param string $obj
27
-	 * @return string
27
+	 * @return Object
28 28
 	 */
29 29
 	function triggerDispCommentAdditionSetup(&$obj)
30 30
 	{
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -31,12 +31,12 @@  discard block
 block discarded – undo
31 31
 		$current_module_srl = Context::get('module_srl');
32 32
 		$current_module_srls = Context::get('module_srls');
33 33
 
34
-		if(!$current_module_srl && !$current_module_srls)
34
+		if (!$current_module_srl && !$current_module_srls)
35 35
 		{
36 36
 			// get information of the selected module
37 37
 			$current_module_info = Context::get('current_module_info');
38 38
 			$current_module_srl = $current_module_info->module_srl;
39
-			if(!$current_module_srl)
39
+			if (!$current_module_srl)
40 40
 			{
41 41
 				return new Object();
42 42
 			}
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 
55 55
 		// Set a template file
56 56
 		$oTemplate = TemplateHandler::getInstance();
57
-		$tpl = $oTemplate->compile($this->module_path . 'tpl', 'comment_module_config');
57
+		$tpl = $oTemplate->compile($this->module_path.'tpl', 'comment_module_config');
58 58
 		$obj .= $tpl;
59 59
 
60 60
 		return new Object();
Please login to merge, or discard this patch.
modules/communication/communication.mobile.php 3 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 
35 35
 	/**
36 36
 	 * Display message box
37
-	 * @return void|Object (void : success, Object : fail)
37
+	 * @return ModuleObject|null (void : success, Object : fail)
38 38
 	 */
39 39
 	function dispCommunicationMessages()
40 40
 	{
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 
131 131
 	/**
132 132
 	 * Display message sending
133
-	 * @return void|Object (void : success, Object : fail)
133
+	 * @return ModuleObject|null (void : success, Object : fail)
134 134
 	 */
135 135
 	function dispCommunicationSendMessage()
136 136
 	{
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -96,8 +96,7 @@
 block discarded – undo
96 96
 				stripEmbedTagForAdmin($message->content, $message->sender_srl);
97 97
 				Context::set('message', $message);
98 98
 			}
99
-		}
100
-		else
99
+		} else
101 100
 		{
102 101
 			$templateFile = 'messages';
103 102
 		}
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 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/communication/communication.view.php');
4
+require_once(_XE_PATH_.'modules/communication/communication.view.php');
5 5
 
6 6
 /**
7 7
  * @class  communicationMobile
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
 		$oLayoutModel = getModel('layout');
27 27
 		$layout_info = $oLayoutModel->getLayout($this->communication_config->mlayout_srl);
28
-		if($layout_info)
28
+		if ($layout_info)
29 29
 		{
30 30
 			$this->module_info->mlayout_srl = $this->communication_config->mlayout_srl;
31 31
 			$this->setLayoutPath($layout_info->path);
@@ -39,13 +39,13 @@  discard block
 block discarded – undo
39 39
 	function dispCommunicationMessages()
40 40
 	{
41 41
 		// Error appears if not logged-in
42
-		if(!Context::get('is_logged'))
42
+		if (!Context::get('is_logged'))
43 43
 		{
44 44
 			return $this->stop('msg_not_logged');
45 45
 		}
46 46
 
47 47
 		$logged_info = Context::get('logged_info');
48
-		if(!array_key_exists('dispCommunicationMessages', $logged_info->menu_list))
48
+		if (!array_key_exists('dispCommunicationMessages', $logged_info->menu_list))
49 49
 		{
50 50
 			return $this->stop('msg_invalid_request');
51 51
 		}
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 		// Set the variables
54 54
 		$message_srl = Context::get('message_srl');
55 55
 		$message_type = Context::get('message_type');
56
-		if(!in_array($message_type, array('R', 'S', 'T')))
56
+		if (!in_array($message_type, array('R', 'S', 'T')))
57 57
 		{
58 58
 			$message_type = 'R';
59 59
 			Context::set('message_type', $message_type);
@@ -61,37 +61,37 @@  discard block
 block discarded – undo
61 61
 		$oCommunicationModel = getModel('communication');
62 62
 
63 63
 		// extract contents if message_srl exists
64
-		if($message_srl)
64
+		if ($message_srl)
65 65
 		{
66 66
 			$templateFile = 'read_message';
67 67
 			$columnList = array('message_srl', 'sender_srl', 'receiver_srl', 'message_type', 'title', 'content', 'readed', 'regdate');
68 68
 			$message = $oCommunicationModel->getSelectedMessage($message_srl, $columnList);
69 69
 
70
-			switch($message->message_type)
70
+			switch ($message->message_type)
71 71
 			{
72 72
 				case 'R':
73
-					if($message->receiver_srl != $logged_info->member_srl)
73
+					if ($message->receiver_srl != $logged_info->member_srl)
74 74
 					{
75 75
 						return $this->stop('msg_invalid_request');
76 76
 					}
77 77
 					break;
78 78
 
79 79
 				case 'S':
80
-					if($message->sender_srl != $logged_info->member_srl)
80
+					if ($message->sender_srl != $logged_info->member_srl)
81 81
 					{
82 82
 						return $this->stop('msg_invalid_request');
83 83
 					}
84 84
 					break;
85 85
 
86 86
 				case 'T':
87
-					if($message->receiver_srl != $logged_info->member_srl && $message->sender_srl != $logged_info->member_srl)
87
+					if ($message->receiver_srl != $logged_info->member_srl && $message->sender_srl != $logged_info->member_srl)
88 88
 					{
89 89
 						return $this->stop('msg_invalid_request');
90 90
 					}
91 91
 					break;
92 92
 			}
93 93
 
94
-			if($message->message_srl == $message_srl && ($message->receiver_srl == $logged_info->member_srl || $message->sender_srl == $logged_info->member_srl))
94
+			if ($message->message_srl == $message_srl && ($message->receiver_srl == $logged_info->member_srl || $message->sender_srl == $logged_info->member_srl))
95 95
 			{
96 96
 				stripEmbedTagForAdmin($message->content, $message->sender_srl);
97 97
 				Context::set('message', $message);
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 		$oMemberModel = getModel('member');
139 139
 
140 140
 		// Error appears if not logged-in
141
-		if(!Context::get('is_logged'))
141
+		if (!Context::get('is_logged'))
142 142
 		{
143 143
 			return $this->stop('msg_not_logged');
144 144
 		}
@@ -148,32 +148,32 @@  discard block
 block discarded – undo
148 148
 		// get receipient's information
149 149
 		// check inalid request
150 150
 		$receiver_srl = Context::get('receiver_srl');
151
-		if(!$receiver_srl)
151
+		if (!$receiver_srl)
152 152
 		{
153 153
 			return $this->stop('msg_invalid_request');
154 154
 		}
155 155
 
156 156
 		// check receiver and sender are same
157
-		if($logged_info->member_srl == $receiver_srl)
157
+		if ($logged_info->member_srl == $receiver_srl)
158 158
 		{
159 159
 			return $this->stop('msg_cannot_send_to_yourself');
160 160
 		}
161 161
 
162 162
 		// get message_srl of the original message if it is a reply
163 163
 		$message_srl = Context::get('message_srl');
164
-		if($message_srl)
164
+		if ($message_srl)
165 165
 		{
166 166
 			$source_message = $oCommunicationModel->getSelectedMessage($message_srl);
167
-			if($source_message->message_srl == $message_srl && $source_message->sender_srl == $receiver_srl)
167
+			if ($source_message->message_srl == $message_srl && $source_message->sender_srl == $receiver_srl)
168 168
 			{
169
-				$source_message->title = "[re] " . $source_message->title;
170
-				$source_message->content = "\r\n<br />\r\n<br /><div style=\"padding-left:5px; border-left:5px solid #DDDDDD;\">" . trim($source_message->content) . "</div>";
169
+				$source_message->title = "[re] ".$source_message->title;
170
+				$source_message->content = "\r\n<br />\r\n<br /><div style=\"padding-left:5px; border-left:5px solid #DDDDDD;\">".trim($source_message->content)."</div>";
171 171
 				Context::set('source_message', $source_message);
172 172
 			}
173 173
 		}
174 174
 
175 175
 		$receiver_info = $oMemberModel->getMemberInfoByMemberSrl($receiver_srl);
176
-		if(!$receiver_info)
176
+		if (!$receiver_info)
177 177
 		{
178 178
 			return $this->stop('msg_invalid_request');
179 179
 		}
Please login to merge, or discard this patch.
modules/communication/communication.model.php 4 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -101,7 +101,6 @@
 block discarded – undo
101 101
 
102 102
 	/**
103 103
 	  * @brief check member's grant
104
-	  * @param object $member_info
105 104
 	  * @param array $arrGrant
106 105
 	  * @return boolean
107 106
 	  */
Please login to merge, or discard this patch.
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -61,11 +61,11 @@  discard block
 block discarded – undo
61 61
 	}
62 62
 
63 63
 	/**
64
-	  * @brief get grant array for insert to database. table module_config's config field 
65
-	  * @param string $default
66
-	  * @param array $group
67
-	  * @return array
68
-	  */
64
+	 * @brief get grant array for insert to database. table module_config's config field 
65
+	 * @param string $default
66
+	 * @param array $group
67
+	 * @return array
68
+	 */
69 69
 	function getGrantArray($default, $group)
70 70
 	{
71 71
 		$grant = array();
@@ -100,11 +100,11 @@  discard block
 block discarded – undo
100 100
 	}
101 101
 
102 102
 	/**
103
-	  * @brief check member's grant
104
-	  * @param object $member_info
105
-	  * @param array $arrGrant
106
-	  * @return boolean
107
-	  */
103
+	 * @brief check member's grant
104
+	 * @param object $member_info
105
+	 * @param array $arrGrant
106
+	 * @return boolean
107
+	 */
108 108
 	function checkGrant($arrGrant)
109 109
 	{
110 110
 		if(!$arrGrant)
Please login to merge, or discard this patch.
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -27,32 +27,32 @@  discard block
 block discarded – undo
27 27
 		$oModuleModel = getModel('module');
28 28
 		$communication_config = $oModuleModel->getModuleConfig('communication');
29 29
 
30
-		if(!is_object($communication_config))
30
+		if (!is_object($communication_config))
31 31
 		{
32 32
 			$communication_config = new stdClass();
33 33
 		}
34 34
 
35
-		if(!$communication_config->skin)
35
+		if (!$communication_config->skin)
36 36
 		{
37 37
 			$communication_config->skin = 'default';
38 38
 		}
39 39
 
40
-		if(!$communication_config->colorset)
40
+		if (!$communication_config->colorset)
41 41
 		{
42 42
 			$communication_config->colorset = 'white';
43 43
 		}
44 44
 
45
-		if(!$communication_config->editor_skin)
45
+		if (!$communication_config->editor_skin)
46 46
 		{
47 47
 			$communication_config->editor_skin = 'ckeditor';
48 48
 		}
49 49
 
50
-		if(!$communication_config->mskin)
50
+		if (!$communication_config->mskin)
51 51
 		{
52 52
 			$communication_config->mskin = 'default';
53 53
 		}
54 54
 		
55
-		if(!$communication_config->grant_write)
55
+		if (!$communication_config->grant_write)
56 56
 		{
57 57
 			$communication_config->grant_write = array('default_grant'=>'member');
58 58
 		}
@@ -69,9 +69,9 @@  discard block
 block discarded – undo
69 69
 	function getGrantArray($default, $group)
70 70
 	{
71 71
 		$grant = array();
72
-		if($default!="")
72
+		if ($default != "")
73 73
 		{
74
-			switch($default)
74
+			switch ($default)
75 75
 			{
76 76
 				case "-2":
77 77
 					$grant = array("default_grant"=>"site");
@@ -84,13 +84,13 @@  discard block
 block discarded – undo
84 84
 					break;
85 85
 			}
86 86
 		} 
87
-		else if(is_array($group)) 
87
+		else if (is_array($group)) 
88 88
 		{
89 89
 			$oMemberModel = getModel('member');
90 90
 			$group_list = $oMemberModel->getGroups($this->site_srl);
91 91
 
92 92
 			$group_grant = array();
93
-			foreach($group as $group_srl)
93
+			foreach ($group as $group_srl)
94 94
 			{
95 95
 				$group_grant[$group_srl] = $group_list[$group_srl]->title;
96 96
 			}
@@ -107,37 +107,37 @@  discard block
 block discarded – undo
107 107
 	  */
108 108
 	function checkGrant($arrGrant)
109 109
 	{
110
-		if(!$arrGrant)
110
+		if (!$arrGrant)
111 111
 			return false;
112 112
 
113 113
 		$logged_info = Context::get('logged_info');
114
-		if(!$logged_info)
114
+		if (!$logged_info)
115 115
 			return false;
116 116
 
117
-		if($logged_info->is_admin == "Y")
117
+		if ($logged_info->is_admin == "Y")
118 118
 			return true;
119 119
 
120
-		if($arrGrant['default_grant'])
120
+		if ($arrGrant['default_grant'])
121 121
 		{
122
-			if($arrGrant['default_grant'] == "member" && $logged_info)
122
+			if ($arrGrant['default_grant'] == "member" && $logged_info)
123 123
 				return true;
124 124
 
125
-			if($arrGrant['default_grant'] == "site" && $this->site_srl == $logged_info->site_srl)
125
+			if ($arrGrant['default_grant'] == "site" && $this->site_srl == $logged_info->site_srl)
126 126
 				return true;
127 127
 
128
-			if($arrGrant['default_grant'] == "manager" && $logged_info->is_admin == "Y")
128
+			if ($arrGrant['default_grant'] == "manager" && $logged_info->is_admin == "Y")
129 129
 				return true;
130 130
 		}
131 131
 
132
-		if($arrGrant['group_grant'])
132
+		if ($arrGrant['group_grant'])
133 133
 		{
134 134
 			$group_grant = $arrGrant['group_grant'];
135
-			if(!is_array($group_grant))
135
+			if (!is_array($group_grant))
136 136
 				return false;
137 137
 
138
-			foreach($logged_info->group_list as $group_srl=>$title)
138
+			foreach ($logged_info->group_list as $group_srl=>$title)
139 139
 			{
140
-				if(isset($group_grant[$group_srl])&&$group_grant[$group_srl]==$title)
140
+				if (isset($group_grant[$group_srl]) && $group_grant[$group_srl] == $title)
141 141
 					return true;
142 142
 			}
143 143
 
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 		$output = executeQuery('communication.getMessage', $args, $columnList);
163 163
 
164 164
 		$message = $output->data;
165
-		if(!$message)
165
+		if (!$message)
166 166
 		{
167 167
 			return;
168 168
 		}
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 		// get recipient's information if it is a sent message
171 171
 		$oMemberModel = getModel('member');
172 172
 
173
-		if($message->sender_srl == $logged_info->member_srl && $message->message_type == 'S')
173
+		if ($message->sender_srl == $logged_info->member_srl && $message->message_type == 'S')
174 174
 		{
175 175
 			$member_info = $oMemberModel->getMemberInfoByMemberSrl($message->receiver_srl);
176 176
 		}
@@ -180,22 +180,22 @@  discard block
 block discarded – undo
180 180
 			$member_info = $oMemberModel->getMemberInfoByMemberSrl($message->sender_srl);
181 181
 		}
182 182
 
183
-		if($member_info)
183
+		if ($member_info)
184 184
 		{
185
-			foreach($member_info as $key => $val)
185
+			foreach ($member_info as $key => $val)
186 186
 			{
187
-				if($key === 'title') continue;
188
-				if($key === 'content') continue;
189
-				if($key === 'sender_srl') continue;
190
-				if($key === 'password') continue;
191
-				if($key === 'regdate') continue;
187
+				if ($key === 'title') continue;
188
+				if ($key === 'content') continue;
189
+				if ($key === 'sender_srl') continue;
190
+				if ($key === 'password') continue;
191
+				if ($key === 'regdate') continue;
192 192
 
193 193
 				$message->{$key} = $val;
194 194
 			}
195 195
 		}
196 196
 
197 197
 		// change the status if is a received and not yet read message
198
-		if($message->message_type == 'R' && $message->readed != 'Y')
198
+		if ($message->message_type == 'R' && $message->readed != 'Y')
199 199
 		{
200 200
 			$oCommunicationController = getController('communication');
201 201
 			$oCommunicationController->setMessageReaded($message_srl);
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 		$args->readed = 'N';
219 219
 
220 220
 		$output = executeQuery('communication.getNewMessage', $args, $columnList);
221
-		if(!count($output->data))
221
+		if (!count($output->data))
222 222
 		{
223 223
 			return;
224 224
 		}
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
 		$logged_info = Context::get('logged_info');
243 243
 		$args = new stdClass();
244 244
 
245
-		switch($message_type)
245
+		switch ($message_type)
246 246
 		{
247 247
 			case 'R' :
248 248
 				$args->member_srl = $logged_info->member_srl;
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
 		$output = executeQueryArray('communication.getFriendGroups', $args);
348 348
 
349 349
 		$group_list = $output->data;
350
-		if(!$group_list)
350
+		if (!$group_list)
351 351
 		{
352 352
 			return;
353 353
 		}
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
 
371 371
 		$output = executeQuery('communication.isAddedFriend', $args);
372 372
 
373
-		if($output->data->count)
373
+		if ($output->data->count)
374 374
 		{
375 375
 			return TRUE;
376 376
 		}
Please login to merge, or discard this patch.
Braces   +40 added lines, -23 removed lines patch added patch discarded remove patch
@@ -83,8 +83,7 @@  discard block
 block discarded – undo
83 83
 					$grant = array("default_grant"=>"member");
84 84
 					break;
85 85
 			}
86
-		} 
87
-		else if(is_array($group)) 
86
+		} else if(is_array($group)) 
88 87
 		{
89 88
 			$oMemberModel = getModel('member');
90 89
 			$group_list = $oMemberModel->getGroups($this->site_srl);
@@ -107,38 +106,46 @@  discard block
 block discarded – undo
107 106
 	  */
108 107
 	function checkGrant($arrGrant)
109 108
 	{
110
-		if(!$arrGrant)
111
-			return false;
109
+		if(!$arrGrant) {
110
+					return false;
111
+		}
112 112
 
113 113
 		$logged_info = Context::get('logged_info');
114
-		if(!$logged_info)
115
-			return false;
114
+		if(!$logged_info) {
115
+					return false;
116
+		}
116 117
 
117
-		if($logged_info->is_admin == "Y")
118
-			return true;
118
+		if($logged_info->is_admin == "Y") {
119
+					return true;
120
+		}
119 121
 
120 122
 		if($arrGrant['default_grant'])
121 123
 		{
122
-			if($arrGrant['default_grant'] == "member" && $logged_info)
123
-				return true;
124
+			if($arrGrant['default_grant'] == "member" && $logged_info) {
125
+							return true;
126
+			}
124 127
 
125
-			if($arrGrant['default_grant'] == "site" && $this->site_srl == $logged_info->site_srl)
126
-				return true;
128
+			if($arrGrant['default_grant'] == "site" && $this->site_srl == $logged_info->site_srl) {
129
+							return true;
130
+			}
127 131
 
128
-			if($arrGrant['default_grant'] == "manager" && $logged_info->is_admin == "Y")
129
-				return true;
132
+			if($arrGrant['default_grant'] == "manager" && $logged_info->is_admin == "Y") {
133
+							return true;
134
+			}
130 135
 		}
131 136
 
132 137
 		if($arrGrant['group_grant'])
133 138
 		{
134 139
 			$group_grant = $arrGrant['group_grant'];
135
-			if(!is_array($group_grant))
136
-				return false;
140
+			if(!is_array($group_grant)) {
141
+							return false;
142
+			}
137 143
 
138 144
 			foreach($logged_info->group_list as $group_srl=>$title)
139 145
 			{
140
-				if(isset($group_grant[$group_srl])&&$group_grant[$group_srl]==$title)
141
-					return true;
146
+				if(isset($group_grant[$group_srl])&&$group_grant[$group_srl]==$title) {
147
+									return true;
148
+				}
142 149
 			}
143 150
 
144 151
 		}
@@ -184,11 +191,21 @@  discard block
 block discarded – undo
184 191
 		{
185 192
 			foreach($member_info as $key => $val)
186 193
 			{
187
-				if($key === 'title') continue;
188
-				if($key === 'content') continue;
189
-				if($key === 'sender_srl') continue;
190
-				if($key === 'password') continue;
191
-				if($key === 'regdate') continue;
194
+				if($key === 'title') {
195
+					continue;
196
+				}
197
+				if($key === 'content') {
198
+					continue;
199
+				}
200
+				if($key === 'sender_srl') {
201
+					continue;
202
+				}
203
+				if($key === 'password') {
204
+					continue;
205
+				}
206
+				if($key === 'regdate') {
207
+					continue;
208
+				}
192 209
 
193 210
 				$message->{$key} = $val;
194 211
 			}
Please login to merge, or discard this patch.
modules/communication/communication.view.php 3 patches
Doc Comments   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 
47 47
 	/**
48 48
 	 * Display message box
49
-	 * @return void|Object (void : success, Object : fail)
49
+	 * @return ModuleObject|null (void : success, Object : fail)
50 50
 	 */
51 51
 	function dispCommunicationMessages()
52 52
 	{
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 
132 132
 	/**
133 133
 	 * display a new message
134
-	 * @return void|Object (void : success, Object : fail)
134
+	 * @return ModuleObject|null (void : success, Object : fail)
135 135
 	 */
136 136
 	function dispCommunicationNewMessage()
137 137
 	{
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 
168 168
 	/**
169 169
 	 * Display message sending
170
-	 * @return void|Object (void : success, Object : fail)
170
+	 * @return ModuleObject|null (void : success, Object : fail)
171 171
 	 */
172 172
 	function dispCommunicationSendMessage()
173 173
 	{
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
 
243 243
 	/**
244 244
 	 * display a list of friends
245
-	 * @return void|Object (void : success, Object : fail)
245
+	 * @return ModuleObject|null (void : success, Object : fail)
246 246
 	 */
247 247
 	function dispCommunicationFriend()
248 248
 	{
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
 
299 299
 	/**
300 300
 	 * display Add a friend
301
-	 * @return void|Object (void : success, Object : fail)
301
+	 * @return ModuleObject|null (void : success, Object : fail)
302 302
 	 */
303 303
 	function dispCommunicationAddFriend()
304 304
 	{
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
 
341 341
 	/**
342 342
 	 * display add a group of friends
343
-	 * @return void|Object (void : success, Object : fail)
343
+	 * @return ModuleObject|null (void : success, Object : fail)
344 344
 	 */
345 345
 	function dispCommunicationAddFriendGroup()
346 346
 	{
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,8 +27,7 @@
 block discarded – undo
27 27
 		if(count($config_parse) > 1)
28 28
 		{
29 29
 			$tpl_path = sprintf('./themes/%s/modules/communication/', $config_parse[0]);
30
-		}
31
-		else
30
+		} else
32 31
 		{
33 32
 			$tpl_path = sprintf('%sskins/%s', $this->module_path, $skin);
34 33
 		}
Please login to merge, or discard this patch.
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 
25 25
 		$config_parse = explode('|@|', $skin);
26 26
 
27
-		if(count($config_parse) > 1)
27
+		if (count($config_parse) > 1)
28 28
 		{
29 29
 			$tpl_path = sprintf('./themes/%s/modules/communication/', $config_parse[0]);
30 30
 		}
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 
38 38
 		$oLayoutModel = getModel('layout');
39 39
 		$layout_info = $oLayoutModel->getLayout($this->communication_config->layout_srl);
40
-		if($layout_info)
40
+		if ($layout_info)
41 41
 		{
42 42
 			$this->module_info->layout_srl = $this->communication_config->layout_srl;
43 43
 			$this->setLayoutPath($layout_info->path);
@@ -51,14 +51,14 @@  discard block
 block discarded – undo
51 51
 	function dispCommunicationMessages()
52 52
 	{
53 53
 		// Error appears if not logged-in
54
-		if(!Context::get('is_logged'))
54
+		if (!Context::get('is_logged'))
55 55
 		{
56 56
 			return $this->stop('msg_not_logged');
57 57
 		}
58 58
 
59 59
 		$logged_info = Context::get('logged_info');
60 60
 
61
-		if(!array_key_exists('dispCommunicationMessages', $logged_info->menu_list))
61
+		if (!array_key_exists('dispCommunicationMessages', $logged_info->menu_list))
62 62
 		{
63 63
 			return $this->stop('msg_invalid_request');
64 64
 		}
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 		$message_srl = Context::get('message_srl');
68 68
 		$message_type = Context::get('message_type');
69 69
 
70
-		if(!in_array($message_type, array('R', 'S', 'T')))
70
+		if (!in_array($message_type, array('R', 'S', 'T')))
71 71
 		{
72 72
 			$message_type = 'R';
73 73
 			Context::set('message_type', $message_type);
@@ -76,36 +76,36 @@  discard block
 block discarded – undo
76 76
 		$oCommunicationModel = getModel('communication');
77 77
 
78 78
 		// extract contents if message_srl exists
79
-		if($message_srl)
79
+		if ($message_srl)
80 80
 		{
81 81
 			$columnList = array('message_srl', 'sender_srl', 'receiver_srl', 'message_type', 'title', 'content', 'readed', 'regdate');
82 82
 			$message = $oCommunicationModel->getSelectedMessage($message_srl, $columnList);
83 83
 
84
-			switch($message->message_type)
84
+			switch ($message->message_type)
85 85
 			{
86 86
 				case 'R':
87
-					if($message->receiver_srl != $logged_info->member_srl)
87
+					if ($message->receiver_srl != $logged_info->member_srl)
88 88
 					{
89 89
 						return $this->stop('msg_invalid_request');
90 90
 					}
91 91
 					break;
92 92
 
93 93
 				case 'S':
94
-					if($message->sender_srl != $logged_info->member_srl)
94
+					if ($message->sender_srl != $logged_info->member_srl)
95 95
 					{
96 96
 						return $this->stop('msg_invalid_request');
97 97
 					}
98 98
 					break;
99 99
 
100 100
 				case 'T':
101
-					if($message->receiver_srl != $logged_info->member_srl && $message->sender_srl != $logged_info->member_srl)
101
+					if ($message->receiver_srl != $logged_info->member_srl && $message->sender_srl != $logged_info->member_srl)
102 102
 					{
103 103
 						return $this->stop('msg_invalid_request');
104 104
 					}
105 105
 					break;
106 106
 			}
107 107
 
108
-			if($message->message_srl == $message_srl && ($message->receiver_srl == $logged_info->member_srl || $message->sender_srl == $logged_info->member_srl))
108
+			if ($message->message_srl == $message_srl && ($message->receiver_srl == $logged_info->member_srl || $message->sender_srl == $logged_info->member_srl))
109 109
 			{
110 110
 				stripEmbedTagForAdmin($message->content, $message->sender_srl);
111 111
 				Context::set('message', $message);
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 		$this->setLayoutFile('popup_layout');
140 140
 
141 141
 		// Error appears if not logged-in
142
-		if(!Context::get('is_logged'))
142
+		if (!Context::get('is_logged'))
143 143
 		{
144 144
 			return $this->stop('msg_not_logged');
145 145
 		}
@@ -151,14 +151,14 @@  discard block
 block discarded – undo
151 151
 		// get a new message
152 152
 		$columnList = array('message_srl', 'member_srl', 'nick_name', 'title', 'content', 'sender_srl');
153 153
 		$message = $oCommunicationModel->getNewMessage($columnList);
154
-		if($message)
154
+		if ($message)
155 155
 		{
156 156
 			stripEmbedTagForAdmin($message->content, $message->sender_srl);
157 157
 			Context::set('message', $message);
158 158
 		}
159 159
 
160 160
 		// Delete a flag
161
-		$flag_path = './files/communication_extra_info/new_message_flags/' . getNumberingPath($logged_info->member_srl);
161
+		$flag_path = './files/communication_extra_info/new_message_flags/'.getNumberingPath($logged_info->member_srl);
162 162
 		$flag_file = sprintf('%s%s', $flag_path, $logged_info->member_srl);
163 163
 		FileHandler::removeFile($flag_file);
164 164
 
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 		$oMemberModel = getModel('member');
179 179
 
180 180
 		// Error appears if not logged-in
181
-		if(!Context::get('is_logged'))
181
+		if (!Context::get('is_logged'))
182 182
 		{
183 183
 			return $this->stop('msg_not_logged');
184 184
 		}
@@ -188,32 +188,32 @@  discard block
 block discarded – undo
188 188
 		// get receipient's information
189 189
 		// check inalid request
190 190
 		$receiver_srl = Context::get('receiver_srl');
191
-		if(!$receiver_srl)
191
+		if (!$receiver_srl)
192 192
 		{
193 193
 			return $this->stop('msg_invalid_request');
194 194
 		}
195 195
 
196 196
 		// check receiver and sender are same
197
-		if($logged_info->member_srl == $receiver_srl)
197
+		if ($logged_info->member_srl == $receiver_srl)
198 198
 		{
199 199
 			return $this->stop('msg_cannot_send_to_yourself');
200 200
 		}
201 201
 
202 202
 		// get message_srl of the original message if it is a reply
203 203
 		$message_srl = Context::get('message_srl');
204
-		if($message_srl)
204
+		if ($message_srl)
205 205
 		{
206 206
 			$source_message = $oCommunicationModel->getSelectedMessage($message_srl);
207
-			if($source_message->message_srl == $message_srl && $source_message->sender_srl == $receiver_srl)
207
+			if ($source_message->message_srl == $message_srl && $source_message->sender_srl == $receiver_srl)
208 208
 			{
209
-				$source_message->title = "[re] " . $source_message->title;
210
-				$source_message->content = "\r\n<br />\r\n<br /><div style=\"padding-left:5px; border-left:5px solid #DDDDDD;\">" . trim($source_message->content) . "</div>";
209
+				$source_message->title = "[re] ".$source_message->title;
210
+				$source_message->content = "\r\n<br />\r\n<br /><div style=\"padding-left:5px; border-left:5px solid #DDDDDD;\">".trim($source_message->content)."</div>";
211 211
 				Context::set('source_message', $source_message);
212 212
 			}
213 213
 		}
214 214
 
215 215
 		$receiver_info = $oMemberModel->getMemberInfoByMemberSrl($receiver_srl);
216
-		if(!$receiver_info)
216
+		if (!$receiver_info)
217 217
 		{
218 218
 			return $this->stop('msg_invalid_request');
219 219
 		}
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
 	function dispCommunicationFriend()
248 248
 	{
249 249
 		// Error appears if not logged-in
250
-		if(!Context::get('is_logged'))
250
+		if (!Context::get('is_logged'))
251 251
 		{
252 252
 			return $this->stop('msg_not_logged');
253 253
 		}
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 		$tmp_group_list = $oCommunicationModel->getFriendGroups();
259 259
 		$group_count = count($tmp_group_list);
260 260
 
261
-		for($i = 0; $i < $group_count; $i++)
261
+		for ($i = 0; $i < $group_count; $i++)
262 262
 		{
263 263
 			$friend_group_list[$tmp_group_list[$i]->friend_group_srl] = $tmp_group_list[$i];
264 264
 		}
@@ -272,13 +272,13 @@  discard block
 block discarded – undo
272 272
 		$output = $oCommunicationModel->getFriends($friend_group_srl, $columnList);
273 273
 		$friend_count = count($output->data);
274 274
 
275
-		if($friend_count)
275
+		if ($friend_count)
276 276
 		{
277
-			foreach($output->data as $key => $val)
277
+			foreach ($output->data as $key => $val)
278 278
 			{
279 279
 				$group_srl = $val->friend_group_srl;
280 280
 				$group_title = $friend_group_list[$group_srl]->title;
281
-				if(!$group_title)
281
+				if (!$group_title)
282 282
 				{
283 283
 					$group_title = Context::get('default_friend_group');
284 284
 				}
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
 		$this->setLayoutFile("popup_layout");
307 307
 
308 308
 		// error appears if not logged-in
309
-		if(!Context::get('is_logged'))
309
+		if (!Context::get('is_logged'))
310 310
 		{
311 311
 			return $this->stop('msg_not_logged');
312 312
 		}
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
 		$logged_info = Context::get('logged_info');
315 315
 		$target_srl = Context::get('target_srl');
316 316
 
317
-		if(!$target_srl)
317
+		if (!$target_srl)
318 318
 		{
319 319
 			return $this->stop('msg_invalid_request');
320 320
 		}
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
 		$oCommunicationModel = getModel('communication');
325 325
 		$communication_info = $oMemberModel->getMemberInfoByMemberSrl($target_srl);
326 326
 
327
-		if($communication_info->member_srl != $target_srl)
327
+		if ($communication_info->member_srl != $target_srl)
328 328
 		{
329 329
 			return $this->stop('msg_invalid_request');
330 330
 		}
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
 		$this->setLayoutFile("popup_layout");
349 349
 
350 350
 		// error apprears if not logged-in
351
-		if(!Context::get('is_logged'))
351
+		if (!Context::get('is_logged'))
352 352
 		{
353 353
 			return $this->stop('msg_not_logged');
354 354
 		}
@@ -357,11 +357,11 @@  discard block
 block discarded – undo
357 357
 
358 358
 		// change to edit mode when getting the group_srl
359 359
 		$friend_group_srl = Context::get('friend_group_srl');
360
-		if($friend_group_srl)
360
+		if ($friend_group_srl)
361 361
 		{
362 362
 			$oCommunicationModel = getModel('communication');
363 363
 			$friend_group = $oCommunicationModel->getFriendGroupInfo($friend_group_srl);
364
-			if($friend_group->friend_group_srl == $friend_group_srl)
364
+			if ($friend_group->friend_group_srl == $friend_group_srl)
365 365
 			{
366 366
 				Context::set('friend_group', $friend_group);
367 367
 			}
Please login to merge, or discard this patch.