GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Pull Request — develop (#1782)
by
unknown
10:54
created
modules/board/board.admin.view.php 2 patches
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 	function init() {
18 18
 		// check module_srl is existed or not
19 19
 		$module_srl = Context::get('module_srl');
20
-		if(!$module_srl && $this->module_srl) {
20
+		if (!$module_srl && $this->module_srl) {
21 21
 			$module_srl = $this->module_srl;
22 22
 			Context::set('module_srl', $module_srl);
23 23
 		}
@@ -26,20 +26,20 @@  discard block
 block discarded – undo
26 26
 		$oModuleModel = getModel('module');
27 27
 
28 28
 		// get the module infomation based on the module_srl
29
-		if($module_srl) {
29
+		if ($module_srl) {
30 30
 			$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
31
-			if(!$module_info) {
32
-				Context::set('module_srl','');
31
+			if (!$module_info) {
32
+				Context::set('module_srl', '');
33 33
 				$this->act = 'list';
34 34
 			} else {
35 35
 				ModuleModel::syncModuleToSite($module_info);
36 36
 				$this->module_info = $module_info;
37 37
 				$this->module_info->use_status = explode('|@|', $module_info->use_status);
38
-				Context::set('module_info',$module_info);
38
+				Context::set('module_info', $module_info);
39 39
 			}
40 40
 		}
41 41
 
42
-		if($module_info && $module_info->module != 'board') return $this->stop("msg_invalid_request");
42
+		if ($module_info && $module_info->module != 'board') return $this->stop("msg_invalid_request");
43 43
 
44 44
 		// get the module category list
45 45
 		$module_category = $oModuleModel->getModuleCategories();
@@ -50,11 +50,11 @@  discard block
 block discarded – undo
50 50
 		$security->encodeHTML('module_category..');
51 51
 
52 52
 		// setup template path (board admin panel templates is resided in the tpl folder)
53
-		$template_path = sprintf("%stpl/",$this->module_path);
53
+		$template_path = sprintf("%stpl/", $this->module_path);
54 54
 		$this->setTemplatePath($template_path);
55 55
 
56 56
 		// install order (sorting) options
57
-		foreach($this->order_target as $key) $order_target[$key] = Context::getLang($key);
57
+		foreach ($this->order_target as $key) $order_target[$key] = Context::getLang($key);
58 58
 		$order_target['list_order'] = Context::getLang('document_srl');
59 59
 		$order_target['update_order'] = Context::getLang('last_update');
60 60
 		Context::set('order_target', $order_target);
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 		$search_target = Context::get('search_target');
76 76
 		$search_keyword = Context::get('search_keyword');
77 77
 
78
-		switch ($search_target){
78
+		switch ($search_target) {
79 79
 			case 'mid':
80 80
 				$args->s_mid = $search_keyword;
81 81
 				break;
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 		// get the skins path
91 91
 		$oModuleModel = getModel('module');
92 92
 		$skin_list = $oModuleModel->getSkins($this->module_path);
93
-		Context::set('skin_list',$skin_list);
93
+		Context::set('skin_list', $skin_list);
94 94
 
95 95
 		$mskin_list = $oModuleModel->getSkins($this->module_path, "m.skins");
96 96
 		Context::set('mskin_list', $mskin_list);
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 		$layout_list = $oLayoutModel->getLayoutList();
101 101
 		Context::set('layout_list', $layout_list);
102 102
 
103
-		$mobile_layout_list = $oLayoutModel->getLayoutList(0,"M");
103
+		$mobile_layout_list = $oLayoutModel->getLayoutList(0, "M");
104 104
 		Context::set('mlayout_list', $mobile_layout_list);
105 105
 
106 106
 		$oModuleAdminModel = getAdminModel('module');
@@ -115,10 +115,10 @@  discard block
 block discarded – undo
115 115
 		Context::set('page_navigation', $output->page_navigation);
116 116
 
117 117
 		$security = new Security();
118
-		$security->encodeHTML('board_list..browser_title','board_list..mid');
119
-		$security->encodeHTML('skin_list..title','mskin_list..title');
120
-		$security->encodeHTML('layout_list..title','layout_list..layout');
121
-		$security->encodeHTML('mlayout_list..title','mlayout_list..layout');
118
+		$security->encodeHTML('board_list..browser_title', 'board_list..mid');
119
+		$security->encodeHTML('skin_list..title', 'mskin_list..title');
120
+		$security->encodeHTML('layout_list..title', 'layout_list..layout');
121
+		$security->encodeHTML('mlayout_list..title', 'mlayout_list..layout');
122 122
 
123 123
 		// 템플릿 파일 지정
124 124
 		$this->setTemplateFile('index');
@@ -135,14 +135,14 @@  discard block
 block discarded – undo
135 135
 	 * @brief display the module insert form
136 136
 	 **/
137 137
 	function dispBoardAdminInsertBoard() {
138
-		if(!in_array($this->module_info->module, array('admin', 'board','blog','guestbook'))) {
138
+		if (!in_array($this->module_info->module, array('admin', 'board', 'blog', 'guestbook'))) {
139 139
 			return $this->alertMessage('msg_invalid_request');
140 140
 		}
141 141
 
142 142
 		// get the skins list
143 143
 		$oModuleModel = getModel('module');
144 144
 		$skin_list = $oModuleModel->getSkins($this->module_path);
145
-		Context::set('skin_list',$skin_list);
145
+		Context::set('skin_list', $skin_list);
146 146
 
147 147
 		$mskin_list = $oModuleModel->getSkins($this->module_path, "m.skins");
148 148
 		Context::set('mskin_list', $mskin_list);
@@ -152,13 +152,13 @@  discard block
 block discarded – undo
152 152
 		$layout_list = $oLayoutModel->getLayoutList();
153 153
 		Context::set('layout_list', $layout_list);
154 154
 
155
-		$mobile_layout_list = $oLayoutModel->getLayoutList(0,"M");
155
+		$mobile_layout_list = $oLayoutModel->getLayoutList(0, "M");
156 156
 		Context::set('mlayout_list', $mobile_layout_list);
157 157
 
158 158
 		$security = new Security();
159
-		$security->encodeHTML('skin_list..title','mskin_list..title');
160
-		$security->encodeHTML('layout_list..title','layout_list..layout');
161
-		$security->encodeHTML('mlayout_list..title','mlayout_list..layout');
159
+		$security->encodeHTML('skin_list..title', 'mskin_list..title');
160
+		$security->encodeHTML('layout_list..title', 'layout_list..layout');
161
+		$security->encodeHTML('mlayout_list..title', 'mlayout_list..layout');
162 162
 
163 163
 		// get document status list
164 164
 		$oDocumentModel = getModel('document');
@@ -177,14 +177,14 @@  discard block
 block discarded – undo
177 177
 		// setup extra_order_target
178 178
 		$module_extra_vars = $oDocumentModel->getExtraKeys($this->module_info->module_srl);
179 179
 		$extra_order_target = array();
180
-		foreach($module_extra_vars as $oExtraItem)
180
+		foreach ($module_extra_vars as $oExtraItem)
181 181
 		{
182 182
 			$extra_order_target[$oExtraItem->eid] = $oExtraItem->name;
183 183
 		}
184 184
 		Context::set('extra_order_target', $extra_order_target);
185 185
 
186 186
 		$security = new Security();
187
-		$security->encodeHTML('extra_vars..name','list_config..name');
187
+		$security->encodeHTML('extra_vars..name', 'list_config..name');
188 188
 
189 189
 		// set the template file
190 190
 		$this->setTemplateFile('board_insert');
@@ -212,8 +212,8 @@  discard block
 block discarded – undo
212 212
 	 * @brief display the board mdoule delete page
213 213
 	 **/
214 214
 	function dispBoardAdminDeleteBoard() {
215
-		if(!Context::get('module_srl')) return $this->dispBoardAdminContent();
216
-		if(!in_array($this->module_info->module, array('admin', 'board','blog','guestbook'))) {
215
+		if (!Context::get('module_srl')) return $this->dispBoardAdminContent();
216
+		if (!in_array($this->module_info->module, array('admin', 'board', 'blog', 'guestbook'))) {
217 217
 			return $this->alertMessage('msg_invalid_request');
218 218
 		}
219 219
 
@@ -223,10 +223,10 @@  discard block
 block discarded – undo
223 223
 		$document_count = $oDocumentModel->getDocumentCount($module_info->module_srl);
224 224
 		$module_info->document_count = $document_count;
225 225
 
226
-		Context::set('module_info',$module_info);
226
+		Context::set('module_info', $module_info);
227 227
 
228 228
 		$security = new Security();
229
-		$security->encodeHTML('module_info..mid','module_info..module','module_info..document_count');
229
+		$security->encodeHTML('module_info..mid', 'module_info..module', 'module_info..document_count');
230 230
 
231 231
 		// setup the template file
232 232
 		$this->setTemplateFile('board_delete');
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
 	 * @brief board module message
296 296
 	 **/
297 297
 	function alertMessage($message) {
298
-		$script =  sprintf('<script> xAddEventListener(window,"load", function() { alert("%s"); } );</script>', Context::getLang($message));
299
-		Context::addHtmlHeader( $script );
298
+		$script = sprintf('<script> xAddEventListener(window,"load", function() { alert("%s"); } );</script>', Context::getLang($message));
299
+		Context::addHtmlHeader($script);
300 300
 	}
301 301
 }
Please login to merge, or discard this patch.
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -39,7 +39,9 @@  discard block
 block discarded – undo
39 39
 			}
40 40
 		}
41 41
 
42
-		if($module_info && $module_info->module != 'board') return $this->stop("msg_invalid_request");
42
+		if($module_info && $module_info->module != 'board') {
43
+			return $this->stop("msg_invalid_request");
44
+		}
43 45
 
44 46
 		// get the module category list
45 47
 		$module_category = $oModuleModel->getModuleCategories();
@@ -54,7 +56,9 @@  discard block
 block discarded – undo
54 56
 		$this->setTemplatePath($template_path);
55 57
 
56 58
 		// install order (sorting) options
57
-		foreach($this->order_target as $key) $order_target[$key] = Context::getLang($key);
59
+		foreach($this->order_target as $key) {
60
+			$order_target[$key] = Context::getLang($key);
61
+		}
58 62
 		$order_target['list_order'] = Context::getLang('document_srl');
59 63
 		$order_target['update_order'] = Context::getLang('last_update');
60 64
 		Context::set('order_target', $order_target);
@@ -212,7 +216,9 @@  discard block
 block discarded – undo
212 216
 	 * @brief display the board mdoule delete page
213 217
 	 **/
214 218
 	function dispBoardAdminDeleteBoard() {
215
-		if(!Context::get('module_srl')) return $this->dispBoardAdminContent();
219
+		if(!Context::get('module_srl')) {
220
+			return $this->dispBoardAdminContent();
221
+		}
216 222
 		if(!in_array($this->module_info->module, array('admin', 'board','blog','guestbook'))) {
217 223
 			return $this->alertMessage('msg_invalid_request');
218 224
 		}
Please login to merge, or discard this patch.
modules/board/board.class.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 
10 10
 class board extends ModuleObject
11 11
 {
12
-	var $search_option = array('title_content','title','content','comment','user_name','nick_name','user_id','tag'); ///< 검색 옵션
12
+	var $search_option = array('title_content', 'title', 'content', 'comment', 'user_name', 'nick_name', 'user_id', 'tag'); ///< 검색 옵션
13 13
 
14 14
 	var $order_target = array('list_order', 'update_order', 'regdate', 'voted_count', 'blamed_count', 'readed_count', 'comment_count', 'title', 'nick_name', 'user_name', 'user_id'); // 정렬 옵션
15 15
 
@@ -25,9 +25,9 @@  discard block
 block discarded – undo
25 25
 	 */
26 26
 	function board()
27 27
 	{
28
-		if(!Context::isInstalled()) return;
28
+		if (!Context::isInstalled()) return;
29 29
 
30
-		if(!Context::isExistsSSLAction('dispBoardWrite') && Context::getSslStatus() == 'optional')
30
+		if (!Context::isExistsSSLAction('dispBoardWrite') && Context::getSslStatus() == 'optional')
31 31
 		{
32 32
 			$ssl_actions = array('dispBoardWrite', 'dispBoardWriteComment', 'dispBoardReplyComment', 'dispBoardModifyComment', 'dispBoardDelete', 'dispBoardDeleteComment', 'procBoardInsertDocument', 'procBoardDeleteDocument', 'procBoardInsertComment', 'procBoardDeleteComment', 'procBoardVerificationPassword');
33 33
 			Context::addSSLActions($ssl_actions);
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 		$args = new stdClass;
51 51
 		$args->site_srl = 0;
52 52
 		$output = executeQuery('module.getSite', $args);
53
-		if(!$output->data->index_module_srl)
53
+		if (!$output->data->index_module_srl)
54 54
 		{
55 55
 			$args->mid = 'board';
56 56
 			$args->module = 'board';
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 			$args->site_srl = 0;
60 60
 			$output = $oModuleController->insertModule($args);
61 61
 
62
-			if($output->toBool())
62
+			if ($output->toBool())
63 63
 			{
64 64
 				$module_srl = $output->get('module_srl');
65 65
 
@@ -83,10 +83,10 @@  discard block
 block discarded – undo
83 83
 		$oModuleModel = getModel('module');
84 84
 
85 85
 		// 2007. 10. 17 get the member menu trigger
86
-		if(!$oModuleModel->getTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after')) return true;
86
+		if (!$oModuleModel->getTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after')) return true;
87 87
 
88 88
 		// 2011. 09. 20 when add new menu in sitemap, custom menu add
89
-		if(!$oModuleModel->getTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after')) return true;
89
+		if (!$oModuleModel->getTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after')) return true;
90 90
 		return false;
91 91
 	}
92 92
 
@@ -99,13 +99,13 @@  discard block
 block discarded – undo
99 99
 		$oModuleController = getController('module');
100 100
 
101 101
 		// 2007. 10. 17  check the member menu trigger, if it is not existed then insert
102
-		if(!$oModuleModel->getTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after'))
102
+		if (!$oModuleModel->getTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after'))
103 103
 		{
104 104
 			$oModuleController->insertTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after');
105 105
 		}
106 106
 
107 107
 		// 2011. 09. 20 when add new menu in sitemap, custom menu add
108
-		if(!$oModuleModel->getTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after'))
108
+		if (!$oModuleModel->getTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after'))
109 109
 		{
110 110
 			$oModuleController->insertTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after');
111 111
 		}
@@ -116,12 +116,12 @@  discard block
 block discarded – undo
116 116
 	function moduleUninstall()
117 117
 	{
118 118
 		$output = executeQueryArray("board.getAllBoard");
119
-		if(!$output->data) return new Object();
119
+		if (!$output->data) return new Object();
120 120
 		@set_time_limit(0);
121 121
 
122 122
 		$oModuleController = getController('module');
123 123
 
124
-		foreach($output->data as $board)
124
+		foreach ($output->data as $board)
125 125
 		{
126 126
 			$oModuleController->deleteModule($board->module_srl);
127 127
 		}
Please login to merge, or discard this patch.
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -25,7 +25,9 @@  discard block
 block discarded – undo
25 25
 	 */
26 26
 	function board()
27 27
 	{
28
-		if(!Context::isInstalled()) return;
28
+		if(!Context::isInstalled()) {
29
+			return;
30
+		}
29 31
 
30 32
 		if(!Context::isExistsSSLAction('dispBoardWrite') && Context::getSslStatus() == 'optional')
31 33
 		{
@@ -83,10 +85,14 @@  discard block
 block discarded – undo
83 85
 		$oModuleModel = getModel('module');
84 86
 
85 87
 		// 2007. 10. 17 get the member menu trigger
86
-		if(!$oModuleModel->getTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after')) return true;
88
+		if(!$oModuleModel->getTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after')) {
89
+			return true;
90
+		}
87 91
 
88 92
 		// 2011. 09. 20 when add new menu in sitemap, custom menu add
89
-		if(!$oModuleModel->getTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after')) return true;
93
+		if(!$oModuleModel->getTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after')) {
94
+			return true;
95
+		}
90 96
 		return false;
91 97
 	}
92 98
 
@@ -116,7 +122,9 @@  discard block
 block discarded – undo
116 122
 	function moduleUninstall()
117 123
 	{
118 124
 		$output = executeQueryArray("board.getAllBoard");
119
-		if(!$output->data) return new Object();
125
+		if(!$output->data) {
126
+			return new Object();
127
+		}
120 128
 		@set_time_limit(0);
121 129
 
122 130
 		$oModuleController = getController('module');
Please login to merge, or discard this patch.
modules/board/board.controller.php 2 patches
Braces   +21 added lines, -12 removed lines patch added patch discarded remove patch
@@ -36,13 +36,19 @@  discard block
 block discarded – undo
36 36
 		// setup variables
37 37
 		$obj = Context::getRequestVars();
38 38
 		$obj->module_srl = $this->module_srl;
39
-		if($obj->is_notice!='Y'||!$this->grant->manager) $obj->is_notice = 'N';
39
+		if($obj->is_notice!='Y'||!$this->grant->manager) {
40
+			$obj->is_notice = 'N';
41
+		}
40 42
 		$obj->commentStatus = $obj->comment_status;
41 43
 
42 44
 		settype($obj->title, "string");
43
-		if($obj->title == '') $obj->title = cut_str(trim(strip_tags(nl2br($obj->content))),20,'...');
45
+		if($obj->title == '') {
46
+			$obj->title = cut_str(trim(strip_tags(nl2br($obj->content))),20,'...');
47
+		}
44 48
 		//setup dpcument title tp 'Untitled'
45
-		if($obj->title == '') $obj->title = 'Untitled';
49
+		if($obj->title == '') {
50
+			$obj->title = 'Untitled';
51
+		}
46 52
 
47 53
 		// unset document style if the user is not the document manager
48 54
 		if(!$this->grant->manager)
@@ -83,8 +89,7 @@  discard block
 block discarded – undo
83 89
 			{
84 90
 				$oDocument->add('member_srl', $obj->member_srl);
85 91
 			}
86
-		}
87
-		else
92
+		} else
88 93
 		{
89 94
 			$bAnonymous = false;
90 95
 		}
@@ -148,7 +153,9 @@  discard block
 block discarded – undo
148 153
 				for($i=0;$i<count($target_mail);$i++)
149 154
 				{
150 155
 					$email_address = trim($target_mail[$i]);
151
-					if(!$email_address) continue;
156
+					if(!$email_address) {
157
+						continue;
158
+					}
152 159
 					$oMail->setReceiptor($email_address, $email_address);
153 160
 					$oMail->send();
154 161
 				}
@@ -236,7 +243,9 @@  discard block
 block discarded – undo
236 243
 		$obj = Context::getRequestVars();
237 244
 		$obj->module_srl = $this->module_srl;
238 245
 
239
-		if(!$this->module_info->use_status) $this->module_info->use_status = 'PUBLIC';
246
+		if(!$this->module_info->use_status) {
247
+			$this->module_info->use_status = 'PUBLIC';
248
+		}
240 249
 		if(!is_array($this->module_info->use_status))
241 250
 		{
242 251
 			$this->module_info->use_status = explode('|@|', $this->module_info->use_status);
@@ -245,8 +254,7 @@  discard block
 block discarded – undo
245 254
 		if(in_array('SECRET', $this->module_info->use_status))
246 255
 		{
247 256
 			$this->module_info->secret = 'Y';
248
-		}
249
-		else
257
+		} else
250 258
 		{
251 259
 			unset($obj->is_secret);
252 260
 			$this->module_info->secret = 'N';
@@ -269,8 +277,7 @@  discard block
 block discarded – undo
269 277
 			$obj->email_address = $obj->homepage = $obj->user_id = '';
270 278
 			$obj->user_name = $obj->nick_name = 'anonymous';
271 279
 			$bAnonymous = true;
272
-		}
273
-		else
280
+		} else
274 281
 		{
275 282
 			$bAnonymous = false;
276 283
 		}
@@ -370,7 +377,9 @@  discard block
 block discarded – undo
370 377
 		// generate trackback module controller object
371 378
 		$oTrackbackController = getController('trackback');
372 379
 
373
-		if(!$oTrackbackController) return;
380
+		if(!$oTrackbackController) {
381
+			return;
382
+		}
374 383
 
375 384
 		$output = $oTrackbackController->deleteTrackback($trackback_srl, $this->grant->manager);
376 385
 		if(!$output->toBool())
Please login to merge, or discard this patch.
Spacing   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -23,11 +23,11 @@  discard block
 block discarded – undo
23 23
 	function procBoardInsertDocument()
24 24
 	{
25 25
 		// check grant
26
-		if($this->module_info->module != "board")
26
+		if ($this->module_info->module != "board")
27 27
 		{
28 28
 			return new Object(-1, "msg_invalid_request");
29 29
 		}
30
-		if(!$this->grant->write_document)
30
+		if (!$this->grant->write_document)
31 31
 		{
32 32
 			return new Object(-1, 'msg_not_permitted');
33 33
 		}
@@ -36,16 +36,16 @@  discard block
 block discarded – undo
36 36
 		// setup variables
37 37
 		$obj = Context::getRequestVars();
38 38
 		$obj->module_srl = $this->module_srl;
39
-		if($obj->is_notice!='Y'||!$this->grant->manager) $obj->is_notice = 'N';
39
+		if ($obj->is_notice != 'Y' || !$this->grant->manager) $obj->is_notice = 'N';
40 40
 		$obj->commentStatus = $obj->comment_status;
41 41
 
42 42
 		settype($obj->title, "string");
43
-		if($obj->title == '') $obj->title = cut_str(trim(strip_tags(nl2br($obj->content))),20,'...');
43
+		if ($obj->title == '') $obj->title = cut_str(trim(strip_tags(nl2br($obj->content))), 20, '...');
44 44
 		//setup dpcument title tp 'Untitled'
45
-		if($obj->title == '') $obj->title = 'Untitled';
45
+		if ($obj->title == '') $obj->title = 'Untitled';
46 46
 
47 47
 		// unset document style if the user is not the document manager
48
-		if(!$this->grant->manager)
48
+		if (!$this->grant->manager)
49 49
 		{
50 50
 			unset($obj->title_color);
51 51
 			unset($obj->title_bold);
@@ -62,24 +62,24 @@  discard block
 block discarded – undo
62 62
 
63 63
 		// update the document if it is existed
64 64
 		$is_update = false;
65
-		if($oDocument->isExists() && $oDocument->document_srl == $obj->document_srl)
65
+		if ($oDocument->isExists() && $oDocument->document_srl == $obj->document_srl)
66 66
 		{
67 67
 			$is_update = true;
68 68
 		}
69 69
 
70 70
 		// if use anonymous is true
71
-		if($this->module_info->use_anonymous == 'Y')
71
+		if ($this->module_info->use_anonymous == 'Y')
72 72
 		{
73 73
 			$this->module_info->admin_mail = '';
74 74
 			$obj->notify_message = 'N';
75
-			if($is_update===false)
75
+			if ($is_update === false)
76 76
 			{
77
-				$obj->member_srl = -1*$logged_info->member_srl;
77
+				$obj->member_srl = -1 * $logged_info->member_srl;
78 78
 			}
79 79
 			$obj->email_address = $obj->homepage = $obj->user_id = '';
80 80
 			$obj->user_name = $obj->nick_name = 'anonymous';
81 81
 			$bAnonymous = true;
82
-			if($is_update===false)
82
+			if ($is_update === false)
83 83
 			{
84 84
 				$oDocument->add('member_srl', $obj->member_srl);
85 85
 			}
@@ -89,10 +89,10 @@  discard block
 block discarded – undo
89 89
 			$bAnonymous = false;
90 90
 		}
91 91
 
92
-		if($obj->is_secret == 'Y' || strtoupper($obj->status == 'SECRET'))
92
+		if ($obj->is_secret == 'Y' || strtoupper($obj->status == 'SECRET'))
93 93
 		{
94 94
 			$use_status = explode('|@|', $this->module_info->use_status);
95
-			if(!is_array($use_status) || !in_array('SECRET', $use_status))
95
+			if (!is_array($use_status) || !in_array('SECRET', $use_status))
96 96
 			{
97 97
 				unset($obj->is_secret);
98 98
 				$obj->status = 'PUBLIC';
@@ -100,24 +100,24 @@  discard block
 block discarded – undo
100 100
 		}
101 101
 
102 102
 		// update the document if it is existed
103
-		if($is_update)
103
+		if ($is_update)
104 104
 		{
105
-			if(!$oDocument->isGranted())
105
+			if (!$oDocument->isGranted())
106 106
 			{
107
-				return new Object(-1,'msg_not_permitted');
107
+				return new Object(-1, 'msg_not_permitted');
108 108
 			}
109 109
 
110
-			if($this->module_info->use_anonymous == 'Y') {
110
+			if ($this->module_info->use_anonymous == 'Y') {
111 111
 				$obj->member_srl = $oDocument->get('member_srl') * -1;
112 112
 				$oDocument->add('member_srl', $obj->member_srl);
113 113
 			}
114 114
 
115
-			if($this->module_info->protect_content=="Y" && $oDocument->get('comment_count')>0 && $this->grant->manager==false)
115
+			if ($this->module_info->protect_content == "Y" && $oDocument->get('comment_count') > 0 && $this->grant->manager == false)
116 116
 			{
117
-				return new Object(-1,'msg_protect_content');
117
+				return new Object(-1, 'msg_protect_content');
118 118
 			}
119 119
 
120
-			if(!$this->grant->manager)
120
+			if (!$this->grant->manager)
121 121
 			{
122 122
 				// notice & document style same as before if not manager
123 123
 				$obj->is_notice = $oDocument->get('is_notice');
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 			}
127 127
 			
128 128
 			// modify list_order if document status is temp
129
-			if($oDocument->get('status') == 'TEMP')
129
+			if ($oDocument->get('status') == 'TEMP')
130 130
 			{
131 131
 				$obj->last_update = $obj->regdate = date('YmdHis');
132 132
 				$obj->update_order = $obj->list_order = (getNextSequence() * -1);
@@ -142,18 +142,18 @@  discard block
 block discarded – undo
142 142
 			$obj->document_srl = $output->get('document_srl');
143 143
 
144 144
 			// send an email to admin user
145
-			if($output->toBool() && $this->module_info->admin_mail)
145
+			if ($output->toBool() && $this->module_info->admin_mail)
146 146
 			{
147 147
 				$oMail = new Mail();
148 148
 				$oMail->setTitle($obj->title);
149
-				$oMail->setContent( sprintf("From : <a href=\"%s\">%s</a><br/>\r\n%s", getFullUrl('','document_srl',$obj->document_srl), getFullUrl('','document_srl',$obj->document_srl), $obj->content));
149
+				$oMail->setContent(sprintf("From : <a href=\"%s\">%s</a><br/>\r\n%s", getFullUrl('', 'document_srl', $obj->document_srl), getFullUrl('', 'document_srl', $obj->document_srl), $obj->content));
150 150
 				$oMail->setSender($obj->user_name, $obj->email_address);
151 151
 
152
-				$target_mail = explode(',',$this->module_info->admin_mail);
153
-				for($i=0;$i<count($target_mail);$i++)
152
+				$target_mail = explode(',', $this->module_info->admin_mail);
153
+				for ($i = 0; $i < count($target_mail); $i++)
154 154
 				{
155 155
 					$email_address = trim($target_mail[$i]);
156
-					if(!$email_address) continue;
156
+					if (!$email_address) continue;
157 157
 					$oMail->setReceiptor($email_address, $email_address);
158 158
 					$oMail->send();
159 159
 				}
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 		}
162 162
 
163 163
 		// if there is an error
164
-		if(!$output->toBool())
164
+		if (!$output->toBool())
165 165
 		{
166 166
 			return $output;
167 167
 		}
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 		$document_srl = Context::get('document_srl');
184 184
 
185 185
 		// if the document is not existed
186
-		if(!$document_srl)
186
+		if (!$document_srl)
187 187
 		{
188 188
 			return $this->doError('msg_invalid_document');
189 189
 		}
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 		$oDocumentModel = &getModel('document');
192 192
 		$oDocument = $oDocumentModel->getDocument($document_srl);
193 193
 		// check protect content
194
-		if($this->module_info->protect_content=="Y" && $oDocument->get('comment_count')>0 && $this->grant->manager==false)
194
+		if ($this->module_info->protect_content == "Y" && $oDocument->get('comment_count') > 0 && $this->grant->manager == false)
195 195
 		{
196 196
 			return new Object(-1, 'msg_protect_content');
197 197
 		}
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 
202 202
 		// delete the document
203 203
 		$output = $oDocumentController->deleteDocument($document_srl, $this->grant->manager);
204
-		if(!$output->toBool())
204
+		if (!$output->toBool())
205 205
 		{
206 206
 			return $output;
207 207
 		}
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 	function procBoardInsertComment()
232 232
 	{
233 233
 		// check grant
234
-		if(!$this->grant->write_comment)
234
+		if (!$this->grant->write_comment)
235 235
 		{
236 236
 			return new Object(-1, 'msg_not_permitted');
237 237
 		}
@@ -241,13 +241,13 @@  discard block
 block discarded – undo
241 241
 		$obj = Context::getRequestVars();
242 242
 		$obj->module_srl = $this->module_srl;
243 243
 
244
-		if(!$this->module_info->use_status) $this->module_info->use_status = 'PUBLIC';
245
-		if(!is_array($this->module_info->use_status))
244
+		if (!$this->module_info->use_status) $this->module_info->use_status = 'PUBLIC';
245
+		if (!is_array($this->module_info->use_status))
246 246
 		{
247 247
 			$this->module_info->use_status = explode('|@|', $this->module_info->use_status);
248 248
 		}
249 249
 
250
-		if(in_array('SECRET', $this->module_info->use_status))
250
+		if (in_array('SECRET', $this->module_info->use_status))
251 251
 		{
252 252
 			$this->module_info->secret = 'Y';
253 253
 		}
@@ -260,17 +260,17 @@  discard block
 block discarded – undo
260 260
 		// check if the doument is existed
261 261
 		$oDocumentModel = getModel('document');
262 262
 		$oDocument = $oDocumentModel->getDocument($obj->document_srl);
263
-		if(!$oDocument->isExists())
263
+		if (!$oDocument->isExists())
264 264
 		{
265
-			return new Object(-1,'msg_not_founded');
265
+			return new Object(-1, 'msg_not_founded');
266 266
 		}
267 267
 
268 268
 		// For anonymous use, remove writer's information and notifying information
269
-		if($this->module_info->use_anonymous == 'Y')
269
+		if ($this->module_info->use_anonymous == 'Y')
270 270
 		{
271 271
 			$this->module_info->admin_mail = '';
272 272
 			$obj->notify_message = 'N';
273
-			$obj->member_srl = -1*$logged_info->member_srl;
273
+			$obj->member_srl = -1 * $logged_info->member_srl;
274 274
 			$obj->email_address = $obj->homepage = $obj->user_id = '';
275 275
 			$obj->user_name = $obj->nick_name = 'anonymous';
276 276
 			$bAnonymous = true;
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
 
289 289
 		// check the comment is existed
290 290
 		// if the comment is not existed, then generate a new sequence
291
-		if(!$obj->comment_srl)
291
+		if (!$obj->comment_srl)
292 292
 		{
293 293
 			$obj->comment_srl = getNextSequence();
294 294
 		} else {
@@ -296,14 +296,14 @@  discard block
 block discarded – undo
296 296
 		}
297 297
 
298 298
 		// if comment_srl is not existed, then insert the comment
299
-		if($comment->comment_srl != $obj->comment_srl)
299
+		if ($comment->comment_srl != $obj->comment_srl)
300 300
 		{
301 301
 
302 302
 			// parent_srl is existed
303
-			if($obj->parent_srl)
303
+			if ($obj->parent_srl)
304 304
 			{
305 305
 				$parent_comment = $oCommentModel->getComment($obj->parent_srl);
306
-				if(!$parent_comment->comment_srl)
306
+				if (!$parent_comment->comment_srl)
307 307
 				{
308 308
 					return new Object(-1, 'msg_invalid_request');
309 309
 				}
@@ -317,9 +317,9 @@  discard block
 block discarded – undo
317 317
 		// update the comment if it is not existed
318 318
 		} else {
319 319
 			// check the grant
320
-			if(!$comment->isGranted())
320
+			if (!$comment->isGranted())
321 321
 			{
322
-				return new Object(-1,'msg_not_permitted');
322
+				return new Object(-1, 'msg_not_permitted');
323 323
 			}
324 324
 
325 325
 			$obj->parent_srl = $comment->parent_srl;
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
 			$comment_srl = $obj->comment_srl;
328 328
 		}
329 329
 
330
-		if(!$output->toBool())
330
+		if (!$output->toBool())
331 331
 		{
332 332
 			return $output;
333 333
 		}
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
 	{
346 346
 		// get the comment_srl
347 347
 		$comment_srl = Context::get('comment_srl');
348
-		if(!$comment_srl)
348
+		if (!$comment_srl)
349 349
 		{
350 350
 			return $this->doError('msg_invalid_request');
351 351
 		}
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
 		$oCommentController = getController('comment');
355 355
 
356 356
 		$output = $oCommentController->deleteComment($comment_srl, $this->grant->manager);
357
-		if(!$output->toBool())
357
+		if (!$output->toBool())
358 358
 		{
359 359
 			return $output;
360 360
 		}
@@ -375,10 +375,10 @@  discard block
 block discarded – undo
375 375
 		// generate trackback module controller object
376 376
 		$oTrackbackController = getController('trackback');
377 377
 
378
-		if(!$oTrackbackController) return;
378
+		if (!$oTrackbackController) return;
379 379
 
380 380
 		$output = $oTrackbackController->deleteTrackback($trackback_srl, $this->grant->manager);
381
-		if(!$output->toBool())
381
+		if (!$output->toBool())
382 382
 		{
383 383
 			return $output;
384 384
 		}
@@ -402,18 +402,18 @@  discard block
 block discarded – undo
402 402
 		$oMemberModel = getModel('member');
403 403
 
404 404
 		// if the comment exists
405
-		if($comment_srl)
405
+		if ($comment_srl)
406 406
 		{
407 407
 			// get the comment information
408 408
 			$oCommentModel = getModel('comment');
409 409
 			$oComment = $oCommentModel->getComment($comment_srl);
410
-			if(!$oComment->isExists())
410
+			if (!$oComment->isExists())
411 411
 			{
412 412
 				return new Object(-1, 'msg_invalid_request');
413 413
 			}
414 414
 
415 415
 			// compare the comment password and the user input password
416
-			if(!$oMemberModel->isValidPassword($oComment->get('password'),$password))
416
+			if (!$oMemberModel->isValidPassword($oComment->get('password'), $password))
417 417
 			{
418 418
 				return new Object(-1, 'msg_invalid_password');
419 419
 			}
@@ -423,13 +423,13 @@  discard block
 block discarded – undo
423 423
 			 // get the document information
424 424
 			$oDocumentModel = getModel('document');
425 425
 			$oDocument = $oDocumentModel->getDocument($document_srl);
426
-			if(!$oDocument->isExists())
426
+			if (!$oDocument->isExists())
427 427
 			{
428 428
 				return new Object(-1, 'msg_invalid_request');
429 429
 			}
430 430
 
431 431
 			// compare the document password and the user input password
432
-			if(!$oMemberModel->isValidPassword($oDocument->get('password'),$password))
432
+			if (!$oMemberModel->isValidPassword($oDocument->get('password'), $password))
433 433
 			{
434 434
 				return new Object(-1, 'msg_invalid_password');
435 435
 			}
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
 		$member_srl = Context::get('target_srl');
447 447
 		$mid = Context::get('cur_mid');
448 448
 
449
-		if(!$member_srl || !$mid)
449
+		if (!$member_srl || !$mid)
450 450
 		{
451 451
 			return new Object();
452 452
 		}
@@ -458,13 +458,13 @@  discard block
 block discarded – undo
458 458
 		$columnList = array('module');
459 459
 		$cur_module_info = $oModuleModel->getModuleInfoByMid($mid, 0, $columnList);
460 460
 
461
-		if($cur_module_info->module != 'board')
461
+		if ($cur_module_info->module != 'board')
462 462
 		{
463 463
 			return new Object();
464 464
 		}
465 465
 
466 466
 		// get the member information
467
-		if($member_srl == $logged_info->member_srl)
467
+		if ($member_srl == $logged_info->member_srl)
468 468
 		{
469 469
 			$member_info = $logged_info;
470 470
 		} else {
@@ -472,13 +472,13 @@  discard block
 block discarded – undo
472 472
 			$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl);
473 473
 		}
474 474
 
475
-		if(!$member_info->user_id)
475
+		if (!$member_info->user_id)
476 476
 		{
477 477
 			return new Object();
478 478
 		}
479 479
 
480 480
 		//search
481
-		$url = getUrl('','mid',$mid,'search_target','nick_name','search_keyword',$member_info->nick_name);
481
+		$url = getUrl('', 'mid', $mid, 'search_target', 'nick_name', 'search_keyword', $member_info->nick_name);
482 482
 		$oMemberController = getController('member');
483 483
 		$oMemberController->addMemberPopupMenu($url, 'cmd_view_own_document', '');
484 484
 
Please login to merge, or discard this patch.
modules/board/board.mobile.php 2 patches
Spacing   +21 added lines, -21 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/board/board.view.php');
4
+require_once(_XE_PATH_ . 'modules/board/board.view.php');
5 5
 
6 6
 class boardMobile extends boardView
7 7
 {
@@ -10,32 +10,32 @@  discard block
 block discarded – undo
10 10
 		$oSecurity = new Security();
11 11
 		$oSecurity->encodeHTML('document_srl', 'comment_srl', 'vid', 'mid', 'page', 'category', 'search_target', 'search_keyword', 'sort_index', 'order_type', 'trackback_srl');
12 12
 
13
-		if($this->module_info->list_count) $this->list_count = $this->module_info->list_count;
14
-		if($this->module_info->mobile_list_count) $this->list_count = $this->module_info->mobile_list_count;
15
-		if($this->module_info->search_list_count) $this->search_list_count = $this->module_info->search_list_count;
16
-		if($this->module_info->mobile_search_list_count) $this->list_count = $this->module_info->mobile_search_list_count;
17
-		if($this->module_info->page_count) $this->page_count = $this->module_info->page_count;
18
-		if($this->module_info->mobile_page_count) $this->page_count = $this->module_info->mobile_page_count;
13
+		if ($this->module_info->list_count) $this->list_count = $this->module_info->list_count;
14
+		if ($this->module_info->mobile_list_count) $this->list_count = $this->module_info->mobile_list_count;
15
+		if ($this->module_info->search_list_count) $this->search_list_count = $this->module_info->search_list_count;
16
+		if ($this->module_info->mobile_search_list_count) $this->list_count = $this->module_info->mobile_search_list_count;
17
+		if ($this->module_info->page_count) $this->page_count = $this->module_info->page_count;
18
+		if ($this->module_info->mobile_page_count) $this->page_count = $this->module_info->mobile_page_count;
19 19
 		$this->except_notice = $this->module_info->except_notice == 'N' ? false : true;
20 20
 
21 21
 		// $this->_getStatusNameListecret option backward compatibility
22 22
 		$oDocumentModel = getModel('document');
23 23
 
24 24
 		$statusList = $this->_getStatusNameList($oDocumentModel);
25
-		if(isset($statusList['SECRET']))
25
+		if (isset($statusList['SECRET']))
26 26
 		{
27 27
 			$this->module_info->secret = 'Y';
28 28
 		}
29 29
 
30 30
 		// use_category <=1.5.x, hide_category >=1.7.x
31 31
 		$count_category = count($oDocumentModel->getCategoryList($this->module_info->module_srl));
32
-		if($count_category)
32
+		if ($count_category)
33 33
 		{
34
-			if($this->module_info->hide_category)
34
+			if ($this->module_info->hide_category)
35 35
 			{
36 36
 				$this->module_info->use_category = ($this->module_info->hide_category == 'Y') ? 'N' : 'Y';
37 37
 			}
38
-			else if($this->module_info->use_category)
38
+			else if ($this->module_info->use_category)
39 39
 			{
40 40
 				$this->module_info->hide_category = ($this->module_info->use_category == 'Y') ? 'N' : 'Y';
41 41
 			}
@@ -55,10 +55,10 @@  discard block
 block discarded – undo
55 55
 		 * check the consultation function, if the user is admin then swich off consultation function
56 56
 		 * if the user is not logged, then disppear write document/write comment./ view document
57 57
 		 **/
58
-		if($this->module_info->consultation == 'Y' && !$this->grant->manager)
58
+		if ($this->module_info->consultation == 'Y' && !$this->grant->manager)
59 59
 		{
60 60
 			$this->consultation = true;
61
-			if(!Context::get('is_logged')) $this->grant->list = $this->grant->write_document = $this->grant->write_comment = $this->grant->view = false;
61
+			if (!Context::get('is_logged')) $this->grant->list = $this->grant->write_document = $this->grant->write_comment = $this->grant->view = false;
62 62
 		} else {
63 63
 			$this->consultation = false;
64 64
 		}
@@ -67,14 +67,14 @@  discard block
 block discarded – undo
67 67
 		$extra_keys = $oDocumentModel->getExtraKeys($this->module_info->module_srl);
68 68
 		Context::set('extra_keys', $extra_keys);
69 69
 
70
-		$template_path = sprintf("%sm.skins/%s/",$this->module_path, $this->module_info->mskin);
71
-		if(!is_dir($template_path)||!$this->module_info->mskin)
70
+		$template_path = sprintf("%sm.skins/%s/", $this->module_path, $this->module_info->mskin);
71
+		if (!is_dir($template_path) || !$this->module_info->mskin)
72 72
 		{
73 73
 			$this->module_info->mskin = 'default';
74
-			$template_path = sprintf("%sm.skins/%s/",$this->module_path, $this->module_info->mskin);
74
+			$template_path = sprintf("%sm.skins/%s/", $this->module_path, $this->module_info->mskin);
75 75
 		}
76 76
 		$this->setTemplatePath($template_path);
77
-		Context::addJsFilter($this->module_path.'tpl/filter', 'input_password.xml');
77
+		Context::addJsFilter($this->module_path . 'tpl/filter', 'input_password.xml');
78 78
 	}
79 79
 
80 80
 	function dispBoardCategory()
@@ -87,13 +87,13 @@  discard block
 block discarded – undo
87 87
 	function getBoardCommentPage()
88 88
 	{
89 89
 		$document_srl = Context::get('document_srl');
90
-		$oDocumentModel =& getModel('document');
91
-		if(!$document_srl)
90
+		$oDocumentModel = & getModel('document');
91
+		if (!$document_srl)
92 92
 		{
93 93
 			return new Object(-1, "msg_invalid_request");
94 94
 		}
95 95
 		$oDocument = $oDocumentModel->getDocument($document_srl);
96
-		if(!$oDocument->isExists())
96
+		if (!$oDocument->isExists())
97 97
 		{
98 98
 			return new Object(-1, "msg_invalid_request");
99 99
 		}
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 	function dispBoardMessage($msg_code)
107 107
 	{
108 108
 		$msg = Context::getLang($msg_code);
109
-		$oMessageObject = &ModuleHandler::getModuleInstance('message','mobile');
109
+		$oMessageObject = &ModuleHandler::getModuleInstance('message', 'mobile');
110 110
 		$oMessageObject->setError(-1);
111 111
 		$oMessageObject->setMessage($msg);
112 112
 		$oMessageObject->dispMessage();
Please login to merge, or discard this patch.
Braces   +24 added lines, -13 removed lines patch added patch discarded remove patch
@@ -10,12 +10,24 @@  discard block
 block discarded – undo
10 10
 		$oSecurity = new Security();
11 11
 		$oSecurity->encodeHTML('document_srl', 'comment_srl', 'vid', 'mid', 'page', 'category', 'search_target', 'search_keyword', 'sort_index', 'order_type', 'trackback_srl');
12 12
 
13
-		if($this->module_info->list_count) $this->list_count = $this->module_info->list_count;
14
-		if($this->module_info->mobile_list_count) $this->list_count = $this->module_info->mobile_list_count;
15
-		if($this->module_info->search_list_count) $this->search_list_count = $this->module_info->search_list_count;
16
-		if($this->module_info->mobile_search_list_count) $this->list_count = $this->module_info->mobile_search_list_count;
17
-		if($this->module_info->page_count) $this->page_count = $this->module_info->page_count;
18
-		if($this->module_info->mobile_page_count) $this->page_count = $this->module_info->mobile_page_count;
13
+		if($this->module_info->list_count) {
14
+			$this->list_count = $this->module_info->list_count;
15
+		}
16
+		if($this->module_info->mobile_list_count) {
17
+			$this->list_count = $this->module_info->mobile_list_count;
18
+		}
19
+		if($this->module_info->search_list_count) {
20
+			$this->search_list_count = $this->module_info->search_list_count;
21
+		}
22
+		if($this->module_info->mobile_search_list_count) {
23
+			$this->list_count = $this->module_info->mobile_search_list_count;
24
+		}
25
+		if($this->module_info->page_count) {
26
+			$this->page_count = $this->module_info->page_count;
27
+		}
28
+		if($this->module_info->mobile_page_count) {
29
+			$this->page_count = $this->module_info->mobile_page_count;
30
+		}
19 31
 		$this->except_notice = $this->module_info->except_notice == 'N' ? false : true;
20 32
 
21 33
 		// $this->_getStatusNameListecret option backward compatibility
@@ -34,18 +46,15 @@  discard block
 block discarded – undo
34 46
 			if($this->module_info->hide_category)
35 47
 			{
36 48
 				$this->module_info->use_category = ($this->module_info->hide_category == 'Y') ? 'N' : 'Y';
37
-			}
38
-			else if($this->module_info->use_category)
49
+			} else if($this->module_info->use_category)
39 50
 			{
40 51
 				$this->module_info->hide_category = ($this->module_info->use_category == 'Y') ? 'N' : 'Y';
41
-			}
42
-			else
52
+			} else
43 53
 			{
44 54
 				$this->module_info->hide_category = 'N';
45 55
 				$this->module_info->use_category = 'Y';
46 56
 			}
47
-		}
48
-		else
57
+		} else
49 58
 		{
50 59
 			$this->module_info->hide_category = 'Y';
51 60
 			$this->module_info->use_category = 'N';
@@ -58,7 +67,9 @@  discard block
 block discarded – undo
58 67
 		if($this->module_info->consultation == 'Y' && !$this->grant->manager)
59 68
 		{
60 69
 			$this->consultation = true;
61
-			if(!Context::get('is_logged')) $this->grant->list = $this->grant->write_document = $this->grant->write_comment = $this->grant->view = false;
70
+			if(!Context::get('is_logged')) {
71
+				$this->grant->list = $this->grant->write_document = $this->grant->write_comment = $this->grant->view = false;
72
+			}
62 73
 		} else {
63 74
 			$this->consultation = false;
64 75
 		}
Please login to merge, or discard this patch.
modules/board/board.model.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -25,21 +25,21 @@  discard block
 block discarded – undo
25 25
 
26 26
 		// get the list config value, if it is not exitsted then setup the default value
27 27
 		$list_config = $oModuleModel->getModulePartConfig('board', $module_srl);
28
-		if(!$list_config || count($list_config) <= 0)
28
+		if (!$list_config || count($list_config) <= 0)
29 29
 		{
30
-			$list_config = array( 'no', 'title', 'nick_name','regdate','readed_count');
30
+			$list_config = array('no', 'title', 'nick_name', 'regdate', 'readed_count');
31 31
 		}
32 32
 
33 33
 		// get the extra variables
34 34
 		$inserted_extra_vars = $oDocumentModel->getExtraKeys($module_srl);
35 35
 
36
-		foreach($list_config as $key)
36
+		foreach ($list_config as $key)
37 37
 		{
38
-			if(preg_match('/^([0-9]+)$/',$key))
38
+			if (preg_match('/^([0-9]+)$/', $key))
39 39
 			{
40
-				if($inserted_extra_vars[$key])
40
+				if ($inserted_extra_vars[$key])
41 41
 				{
42
-					$output['extra_vars'.$key] = $inserted_extra_vars[$key];
42
+					$output['extra_vars' . $key] = $inserted_extra_vars[$key];
43 43
 				}
44 44
 				else
45 45
 				{
@@ -60,9 +60,9 @@  discard block
 block discarded – undo
60 60
 	function getDefaultListConfig($module_srl)
61 61
 	{
62 62
 		// add virtual srl, title, registered date, update date, nickname, ID, name, readed count, voted count etc.
63
-		$virtual_vars = array( 'no', 'title', 'regdate', 'last_update', 'last_post', 'nick_name',
63
+		$virtual_vars = array('no', 'title', 'regdate', 'last_update', 'last_post', 'nick_name',
64 64
 				'user_id', 'user_name', 'readed_count', 'voted_count', 'blamed_count', 'thumbnail', 'summary', 'comment_status');
65
-		foreach($virtual_vars as $key)
65
+		foreach ($virtual_vars as $key)
66 66
 		{
67 67
 			$extra_vars[$key] = new ExtraItem($module_srl, -1, Context::getLang($key), $key, 'N', 'N', 'N', null);
68 68
 		}
@@ -71,11 +71,11 @@  discard block
 block discarded – undo
71 71
 		$oDocumentModel = getModel('document');
72 72
 		$inserted_extra_vars = $oDocumentModel->getExtraKeys($module_srl);
73 73
 
74
-		if(count($inserted_extra_vars))
74
+		if (count($inserted_extra_vars))
75 75
 		{
76
-			foreach($inserted_extra_vars as $obj)
76
+			foreach ($inserted_extra_vars as $obj)
77 77
 			{
78
-				$extra_vars['extra_vars'.$obj->idx] = $obj;
78
+				$extra_vars['extra_vars' . $obj->idx] = $obj;
79 79
 			}
80 80
 		}
81 81
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -40,13 +40,11 @@
 block discarded – undo
40 40
 				if($inserted_extra_vars[$key])
41 41
 				{
42 42
 					$output['extra_vars'.$key] = $inserted_extra_vars[$key];
43
-				}
44
-				else
43
+				} else
45 44
 				{
46 45
 					continue;
47 46
 				}
48
-			}
49
-			else
47
+			} else
50 48
 			{
51 49
 				$output[$key] = new ExtraItem($module_srl, -1, Context::getLang($key), $key, 'N', 'N', 'N', null);
52 50
 			}
Please login to merge, or discard this patch.
modules/board/board.wap.php 2 patches
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 	function procWAP(&$oMobile)
16 16
 	{
17 17
 		// check grant
18
-		if(!$this->grant->list || $this->module_info->consultation == 'Y')
18
+		if (!$this->grant->list || $this->module_info->consultation == 'Y')
19 19
 		{
20 20
 			return $oMobile->setContent(Context::getLang('msg_not_permitted'));
21 21
 		}
@@ -25,13 +25,13 @@  discard block
 block discarded – undo
25 25
 
26 26
 		// if the doument is existed
27 27
 		$document_srl = Context::get('document_srl');
28
-		if($document_srl)
28
+		if ($document_srl)
29 29
 		{
30 30
 			$oDocument = $oDocumentModel->getDocument($document_srl);
31
-			if($oDocument->isExists())
31
+			if ($oDocument->isExists())
32 32
 			{
33 33
 				// check the grant
34
-				if(!$this->grant->view)
34
+				if (!$this->grant->view)
35 35
 				{
36 36
 					return $oMobile->setContent(Context::getLang('msg_not_permitted'));
37 37
 				}
@@ -40,48 +40,48 @@  discard block
 block discarded – undo
40 40
 				Context::setBrowserTitle($oDocument->getTitleText());
41 41
 
42 42
 				// if the act is display comment list
43
-				if($this->act=='dispBoardContentCommentList')
43
+				if ($this->act == 'dispBoardContentCommentList')
44 44
 				{
45 45
 
46 46
 					$oCommentModel = getModel('comment');
47 47
 					$output = $oCommentModel->getCommentList($oDocument->document_srl, 0, false, $oDocument->getCommentCount());
48 48
 
49 49
 					$content = '';
50
-					if(count($output->data))
50
+					if (count($output->data))
51 51
 					{
52
-						foreach($output->data as $key => $val)
52
+						foreach ($output->data as $key => $val)
53 53
 						{
54 54
 							$oComment = new commentItem();
55 55
 							$oComment->setAttribute($val);
56 56
 
57
-							if(!$oComment->isAccessible()) continue;
57
+							if (!$oComment->isAccessible()) continue;
58 58
 
59
-							$content .= "<b>".$oComment->getNickName()."</b> (".$oComment->getRegdate("Y-m-d").")<br>\r\n".$oComment->getContent(false,false)."<br>\r\n";
59
+							$content .= "<b>" . $oComment->getNickName() . "</b> (" . $oComment->getRegdate("Y-m-d") . ")<br>\r\n" . $oComment->getContent(false, false) . "<br>\r\n";
60 60
 						}
61 61
 					}
62 62
 
63 63
 					// setup mobile contents
64
-					$oMobile->setContent( $content );
64
+					$oMobile->setContent($content);
65 65
 
66 66
 					// setup upper URL
67
-					$oMobile->setUpperUrl( getUrl('act',''), Context::getLang('cmd_go_upper') );
67
+					$oMobile->setUpperUrl(getUrl('act', ''), Context::getLang('cmd_go_upper'));
68 68
 
69 69
 				// display the document if the act is not display the comment list
70 70
 				} else {
71 71
 
72 72
 					// setup contents (strip all html tags)
73
-					$content = strip_tags(str_replace('<p>','<br>&nbsp;&nbsp;&nbsp;',$oDocument->getContent(false,false,false)),'<br><b><i><u><em><small><strong><big>');
73
+					$content = strip_tags(str_replace('<p>', '<br>&nbsp;&nbsp;&nbsp;', $oDocument->getContent(false, false, false)), '<br><b><i><u><em><small><strong><big>');
74 74
 
75 75
 
76 76
 					// setup content information(include the comments link)
77
-					$content = Context::getLang('replies').' : <a href="'.getUrl('act','dispBoardContentCommentList').'">'.$oDocument->getCommentCount().'</a><br>'."\r\n".$content;
78
-					$content = '<b>'.$oDocument->getNickName().'</b> ('.$oDocument->getRegdate("Y-m-d").")<br>\r\n".$content;
77
+					$content = Context::getLang('replies') . ' : <a href="' . getUrl('act', 'dispBoardContentCommentList') . '">' . $oDocument->getCommentCount() . '</a><br>' . "\r\n" . $content;
78
+					$content = '<b>' . $oDocument->getNickName() . '</b> (' . $oDocument->getRegdate("Y-m-d") . ")<br>\r\n" . $content;
79 79
 
80 80
 					// setup mobile contents
81
-					$oMobile->setContent( $content );
81
+					$oMobile->setContent($content);
82 82
 
83 83
 					// setup upper URL
84
-					$oMobile->setUpperUrl( getUrl('document_srl',''), Context::getLang('cmd_list') );
84
+					$oMobile->setUpperUrl(getUrl('document_srl', ''), Context::getLang('cmd_list'));
85 85
 
86 86
 				}
87 87
 
@@ -92,44 +92,44 @@  discard block
 block discarded – undo
92 92
 		// board index
93 93
 		$args = new stdClass;
94 94
 		$args->module_srl = $this->module_srl;
95
-		$args->page = Context::get('page');;
95
+		$args->page = Context::get('page'); ;
96 96
 		$args->list_count = 9;
97
-		$args->sort_index = $this->module_info->order_target?$this->module_info->order_target:'list_order';
98
-		$args->order_type = $this->module_info->order_type?$this->module_info->order_type:'asc';
97
+		$args->sort_index = $this->module_info->order_target ? $this->module_info->order_target : 'list_order';
98
+		$args->order_type = $this->module_info->order_type ? $this->module_info->order_type : 'asc';
99 99
 		$output = $oDocumentModel->getDocumentList($args, $this->except_notice);
100 100
 		$document_list = $output->data;
101 101
 		$page_navigation = $output->page_navigation;
102 102
 
103 103
 		$childs = array();
104
-		if($document_list && count($document_list))
104
+		if ($document_list && count($document_list))
105 105
 		{
106
-			foreach($document_list as $key => $val)
106
+			foreach ($document_list as $key => $val)
107 107
 			{
108
-				$href = getUrl('mid',$_GET['mid'],'document_srl',$val->document_srl);
108
+				$href = getUrl('mid', $_GET['mid'], 'document_srl', $val->document_srl);
109 109
 				$obj = null;
110 110
 				$obj['href'] = $val->getPermanentUrl();
111 111
 
112 112
 				$title = htmlspecialchars($val->getTitleText());
113
-				if($val->getCommentCount()) $title .= ' ['.$val->getCommentCount().']';
114
-				$obj['link'] = $obj['text'] = '['.$val->getNickName().'] '.$title;
113
+				if ($val->getCommentCount()) $title .= ' [' . $val->getCommentCount() . ']';
114
+				$obj['link'] = $obj['text'] = '[' . $val->getNickName() . '] ' . $title;
115 115
 				$childs[] = $obj;
116 116
 			}
117 117
 			$oMobile->setChilds($childs);
118 118
 		}
119 119
 
120 120
 		$totalPage = $page_navigation->last_page;
121
-		$page = (int)Context::get('page');
122
-		if(!$page) $page = 1;
121
+		$page = (int) Context::get('page');
122
+		if (!$page) $page = 1;
123 123
 
124 124
 		// next/prevUrl specification
125
-		if($page > 1)
125
+		if ($page > 1)
126 126
 		{
127
-			$oMobile->setPrevUrl(getUrl('mid',$_GET['mid'],'page',$page-1), sprintf('%s (%d/%d)', Context::getLang('cmd_prev'), $page-1, $totalPage));
127
+			$oMobile->setPrevUrl(getUrl('mid', $_GET['mid'], 'page', $page - 1), sprintf('%s (%d/%d)', Context::getLang('cmd_prev'), $page - 1, $totalPage));
128 128
 		}
129 129
 
130
-		if($page < $totalPage)
130
+		if ($page < $totalPage)
131 131
 		{
132
-			$oMobile->setNextUrl(getUrl('mid',$_GET['mid'],'page',$page+1), sprintf('%s (%d/%d)', Context::getLang('cmd_next'), $page+1, $totalPage));
132
+			$oMobile->setNextUrl(getUrl('mid', $_GET['mid'], 'page', $page + 1), sprintf('%s (%d/%d)', Context::getLang('cmd_next'), $page + 1, $totalPage));
133 133
 		}
134 134
 
135 135
 		$oMobile->mobilePage = $page;
Please login to merge, or discard this patch.
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -54,7 +54,9 @@  discard block
 block discarded – undo
54 54
 							$oComment = new commentItem();
55 55
 							$oComment->setAttribute($val);
56 56
 
57
-							if(!$oComment->isAccessible()) continue;
57
+							if(!$oComment->isAccessible()) {
58
+								continue;
59
+							}
58 60
 
59 61
 							$content .= "<b>".$oComment->getNickName()."</b> (".$oComment->getRegdate("Y-m-d").")<br>\r\n".$oComment->getContent(false,false)."<br>\r\n";
60 62
 						}
@@ -110,7 +112,9 @@  discard block
 block discarded – undo
110 112
 				$obj['href'] = $val->getPermanentUrl();
111 113
 
112 114
 				$title = htmlspecialchars($val->getTitleText());
113
-				if($val->getCommentCount()) $title .= ' ['.$val->getCommentCount().']';
115
+				if($val->getCommentCount()) {
116
+					$title .= ' ['.$val->getCommentCount().']';
117
+				}
114 118
 				$obj['link'] = $obj['text'] = '['.$val->getNickName().'] '.$title;
115 119
 				$childs[] = $obj;
116 120
 			}
@@ -119,7 +123,9 @@  discard block
 block discarded – undo
119 123
 
120 124
 		$totalPage = $page_navigation->last_page;
121 125
 		$page = (int)Context::get('page');
122
-		if(!$page) $page = 1;
126
+		if(!$page) {
127
+			$page = 1;
128
+		}
123 129
 
124 130
 		// next/prevUrl specification
125 131
 		if($page > 1)
Please login to merge, or discard this patch.
modules/comment/comment.admin.view.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 		// get a list by using comment->getCommentList. 
53 53
 		$oCommentModel = getModel('comment');
54 54
 		$secretNameList = $oCommentModel->getSecretNameList();
55
-		$columnList = array('comment_srl', 'document_srl','module_srl','is_secret', 'status', 'content', 'comments.member_srl', 'comments.nick_name', 'comments.regdate', 'ipaddress', 'voted_count', 'blamed_count');
55
+		$columnList = array('comment_srl', 'document_srl', 'module_srl', 'is_secret', 'status', 'content', 'comments.member_srl', 'comments.nick_name', 'comments.regdate', 'ipaddress', 'voted_count', 'blamed_count');
56 56
 		$output = $oCommentModel->getTotalCommentList($args, $columnList);
57 57
 
58 58
 		// $modules = $oCommentModel->getDistinctModules();
@@ -70,20 +70,20 @@  discard block
 block discarded – undo
70 70
 		$oModuleModel = getModel('module');
71 71
 		$module_list = array();
72 72
 		$mod_srls = array();
73
-		foreach($output->data as $val)
73
+		foreach ($output->data as $val)
74 74
 		{
75 75
 			$mod_srls[] = $val->module_srl;
76 76
 		}
77 77
 		$mod_srls = array_unique($mod_srls);
78 78
 		// Module List
79 79
 		$mod_srls_count = count($mod_srls);
80
-		if($mod_srls_count)
80
+		if ($mod_srls_count)
81 81
 		{
82 82
 			$columnList = array('module_srl', 'mid', 'browser_title');
83 83
 			$module_output = $oModuleModel->getModulesInfo($mod_srls, $columnList);
84
-			if($module_output && is_array($module_output))
84
+			if ($module_output && is_array($module_output))
85 85
 			{
86
-				foreach($module_output as $module)
86
+				foreach ($module_output as $module)
87 87
 				{
88 88
 					$module_list[$module->module_srl] = $module;
89 89
 				}
@@ -114,11 +114,11 @@  discard block
 block discarded – undo
114 114
 		$declared_output = executeQuery('comment.getDeclaredList', $args);
115 115
 		$oCommentModel = getModel('comment');
116 116
 
117
-		if($declared_output->data && count($declared_output->data))
117
+		if ($declared_output->data && count($declared_output->data))
118 118
 		{
119 119
 			$comment_list = array();
120 120
 
121
-			foreach($declared_output->data as $key => $comment)
121
+			foreach ($declared_output->data as $key => $comment)
122 122
 			{
123 123
 				$comment_list[$key] = new commentItem();
124 124
 				$comment_list[$key]->setAttribute($comment);
Please login to merge, or discard this patch.
modules/comment/comment.class.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -48,55 +48,55 @@  discard block
 block discarded – undo
48 48
 		$oDB = DB::getInstance();
49 49
 		$oModuleModel = getModel('module');
50 50
 		// 2007. 10. 17 add a trigger to delete comments together with posting deleted
51
-		if(!$oModuleModel->getTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after'))
51
+		if (!$oModuleModel->getTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after'))
52 52
 		{
53 53
 			return TRUE;
54 54
 		}
55 55
 		// 2007. 10. 17 add a trigger to delete all of comments together with module deleted
56
-		if(!$oModuleModel->getTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after'))
56
+		if (!$oModuleModel->getTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after'))
57 57
 		{
58 58
 			return TRUE;
59 59
 		}
60 60
 		// 2007. 10. 23 add a column for recommendation votes or notification of the comments
61
-		if(!$oDB->isColumnExists("comments", "voted_count"))
61
+		if (!$oDB->isColumnExists("comments", "voted_count"))
62 62
 		{
63 63
 			return TRUE;
64 64
 		}
65
-		if(!$oDB->isColumnExists("comments", "notify_message"))
65
+		if (!$oDB->isColumnExists("comments", "notify_message"))
66 66
 		{
67 67
 			return TRUE;
68 68
 		}
69 69
 		// 2008. 02. 22 add comment setting when a new module added
70
-		if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before'))
70
+		if (!$oModuleModel->getTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before'))
71 71
 		{
72 72
 			return TRUE;
73 73
 		}
74 74
 		// 2008. 05. 14 add a column for blamed count
75
-		if(!$oDB->isColumnExists("comments", "blamed_count"))
75
+		if (!$oDB->isColumnExists("comments", "blamed_count"))
76 76
 		{
77 77
 			return TRUE;
78 78
 		}
79
-		if(!$oDB->isColumnExists("comment_voted_log", "point"))
79
+		if (!$oDB->isColumnExists("comment_voted_log", "point"))
80 80
 		{
81 81
 			return TRUE;
82 82
 		}
83 83
 
84
-		if(!$oDB->isIndexExists("comments", "idx_module_list_order"))
84
+		if (!$oDB->isIndexExists("comments", "idx_module_list_order"))
85 85
 		{
86 86
 			return TRUE;
87 87
 		}
88 88
 		//2012. 02. 24 add comment published status column and index
89
-		if(!$oDB->isColumnExists("comments", "status"))
89
+		if (!$oDB->isColumnExists("comments", "status"))
90 90
 		{
91 91
 			return TRUE;
92 92
 		}
93
-		if(!$oDB->isIndexExists("comments", "idx_status"))
93
+		if (!$oDB->isIndexExists("comments", "idx_status"))
94 94
 		{
95 95
 			return TRUE;
96 96
 		}
97 97
 
98 98
 		// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied 
99
-		if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after'))
99
+		if (!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after'))
100 100
 		{
101 101
 			return TRUE;
102 102
 		}
@@ -114,43 +114,43 @@  discard block
 block discarded – undo
114 114
 		$oModuleModel = getModel('module');
115 115
 		$oModuleController = getController('module');
116 116
 		// 2007. 10. 17 add a trigger to delete comments together with posting deleted
117
-		if(!$oModuleModel->getTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after'))
117
+		if (!$oModuleModel->getTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after'))
118 118
 		{
119 119
 			$oModuleController->insertTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after');
120 120
 		}
121 121
 		// 2007. 10. 17 add a trigger to delete all of comments together with module deleted
122
-		if(!$oModuleModel->getTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after'))
122
+		if (!$oModuleModel->getTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after'))
123 123
 		{
124 124
 			$oModuleController->insertTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after');
125 125
 		}
126 126
 		// 2007. 10. 23 add a column for recommendation votes or notification of the comments
127
-		if(!$oDB->isColumnExists("comments", "voted_count"))
127
+		if (!$oDB->isColumnExists("comments", "voted_count"))
128 128
 		{
129 129
 			$oDB->addColumn("comments", "voted_count", "number", "11");
130 130
 			$oDB->addIndex("comments", "idx_voted_count", array("voted_count"));
131 131
 		}
132 132
 
133
-		if(!$oDB->isColumnExists("comments", "notify_message"))
133
+		if (!$oDB->isColumnExists("comments", "notify_message"))
134 134
 		{
135 135
 			$oDB->addColumn("comments", "notify_message", "char", "1");
136 136
 		}
137 137
 		// 2008. 02. 22 add comment setting when a new module added
138
-		if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before'))
138
+		if (!$oModuleModel->getTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before'))
139 139
 		{
140 140
 			$oModuleController->insertTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before');
141 141
 		}
142 142
 		// 2008. 05. 14 add a column for blamed count
143
-		if(!$oDB->isColumnExists("comments", "blamed_count"))
143
+		if (!$oDB->isColumnExists("comments", "blamed_count"))
144 144
 		{
145 145
 			$oDB->addColumn('comments', 'blamed_count', 'number', 11, 0, TRUE);
146 146
 			$oDB->addIndex('comments', 'idx_blamed_count', array('blamed_count'));
147 147
 		}
148
-		if(!$oDB->isColumnExists("comment_voted_log", "point"))
148
+		if (!$oDB->isColumnExists("comment_voted_log", "point"))
149 149
 		{
150 150
 			$oDB->addColumn('comment_voted_log', 'point', 'number', 11, 0, TRUE);
151 151
 		}
152 152
 
153
-		if(!$oDB->isIndexExists("comments", "idx_module_list_order"))
153
+		if (!$oDB->isIndexExists("comments", "idx_module_list_order"))
154 154
 		{
155 155
 			$oDB->addIndex(
156 156
 					"comments", "idx_module_list_order", array("module_srl", "list_order"), TRUE
@@ -158,11 +158,11 @@  discard block
 block discarded – undo
158 158
 		}
159 159
 
160 160
 		//2012. 02. 24 add comment published status column and index
161
-		if(!$oDB->isColumnExists("comments", "status"))
161
+		if (!$oDB->isColumnExists("comments", "status"))
162 162
 		{
163 163
 			$oDB->addColumn("comments", "status", "number", 1, 1, TRUE);
164 164
 		}
165
-		if(!$oDB->isIndexExists("comments", "idx_status"))
165
+		if (!$oDB->isIndexExists("comments", "idx_status"))
166 166
 		{
167 167
 			$oDB->addIndex(
168 168
 					"comments", "idx_status", array("status", "comment_srl", "module_srl", "document_srl"), TRUE
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 		}
171 171
 
172 172
 		// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied 
173
-		if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after'))
173
+		if (!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after'))
174 174
 		{
175 175
 			$oModuleController->insertTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after');
176 176
 		}
Please login to merge, or discard this patch.
modules/comment/comment.item.php 2 patches
Spacing   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 	 */
50 50
 	function _loadFromDB()
51 51
 	{
52
-		if(!$this->comment_srl)
52
+		if (!$this->comment_srl)
53 53
 		{
54 54
 			return;
55 55
 		}
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 	 */
68 68
 	function setAttribute($attribute)
69 69
 	{
70
-		if(!$attribute->comment_srl)
70
+		if (!$attribute->comment_srl)
71 71
 		{
72 72
 			$this->comment_srl = NULL;
73 73
 			return;
@@ -77,9 +77,9 @@  discard block
 block discarded – undo
77 77
 		$this->adds($attribute);
78 78
 
79 79
 		// define vars on the object for backward compatibility of skins
80
-		if(count($attribute))
80
+		if (count($attribute))
81 81
 		{
82
-			foreach($attribute as $key => $val)
82
+			foreach ($attribute as $key => $val)
83 83
 			{
84 84
 				$this->{$key} = $val;
85 85
 			}
@@ -93,29 +93,29 @@  discard block
 block discarded – undo
93 93
 
94 94
 	function isGranted()
95 95
 	{
96
-		if($_SESSION['own_comment'][$this->comment_srl])
96
+		if ($_SESSION['own_comment'][$this->comment_srl])
97 97
 		{
98 98
 			return TRUE;
99 99
 		}
100 100
 
101
-		if(!Context::get('is_logged'))
101
+		if (!Context::get('is_logged'))
102 102
 		{
103 103
 			return FALSE;
104 104
 		}
105 105
 
106 106
 		$logged_info = Context::get('logged_info');
107
-		if($logged_info->is_admin == 'Y')
107
+		if ($logged_info->is_admin == 'Y')
108 108
 		{
109 109
 			return TRUE;
110 110
 		}
111 111
 
112 112
 		$grant = Context::get('grant');
113
-		if($grant->manager)
113
+		if ($grant->manager)
114 114
 		{
115 115
 			return TRUE;
116 116
 		}
117 117
 
118
-		if($this->get('member_srl') && ($this->get('member_srl') == $logged_info->member_srl || $this->get('member_srl') * -1 == $logged_info->member_srl))
118
+		if ($this->get('member_srl') && ($this->get('member_srl') == $logged_info->member_srl || $this->get('member_srl') * -1 == $logged_info->member_srl))
119 119
 		{
120 120
 			return TRUE;
121 121
 		}
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 
137 137
 	function isEditable()
138 138
 	{
139
-		if($this->isGranted() || !$this->get('member_srl'))
139
+		if ($this->isGranted() || !$this->get('member_srl'))
140 140
 		{
141 141
 			return TRUE;
142 142
 		}
@@ -150,12 +150,12 @@  discard block
 block discarded – undo
150 150
 
151 151
 	function isAccessible()
152 152
 	{
153
-		if($_SESSION['accessibled_comment'][$this->comment_srl])
153
+		if ($_SESSION['accessibled_comment'][$this->comment_srl])
154 154
 		{
155 155
 			return TRUE;
156 156
 		}
157 157
 
158
-		if($this->isGranted() || !$this->isSecret())
158
+		if ($this->isGranted() || !$this->isSecret())
159 159
 		{
160 160
 			$this->setAccessible();
161 161
 			return TRUE;
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 
164 164
 		$oDocumentModel = getModel('document');
165 165
 		$oDocument = $oDocumentModel->getDocument($this->get('document_srl'));
166
-		if($oDocument->isGranted())
166
+		if ($oDocument->isGranted())
167 167
 		{
168 168
 			$this->setAccessible();
169 169
 			return TRUE;
@@ -184,20 +184,20 @@  discard block
 block discarded – undo
184 184
 	function notify($type, $content)
185 185
 	{
186 186
 		// return if not useNotify
187
-		if(!$this->useNotify())
187
+		if (!$this->useNotify())
188 188
 		{
189 189
 			return;
190 190
 		}
191 191
 
192 192
 		// pass if the author is not logged-in user 
193
-		if(!$this->get('member_srl'))
193
+		if (!$this->get('member_srl'))
194 194
 		{
195 195
 			return;
196 196
 		}
197 197
 
198 198
 		// return if the currently logged-in user is an author of the comment.
199 199
 		$logged_info = Context::get('logged_info');
200
-		if($logged_info->member_srl == $this->get('member_srl'))
200
+		if ($logged_info->member_srl == $this->get('member_srl'))
201 201
 		{
202 202
 			return;
203 203
 		}
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 		$oDocument = $oDocumentModel->getDocument($this->get('document_srl'));
208 208
 
209 209
 		// Variables
210
-		if($type)
210
+		if ($type)
211 211
 		{
212 212
 			$title = "[" . $type . "] ";
213 213
 		}
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 
225 225
 	function getIpAddress()
226 226
 	{
227
-		if($this->isGranted())
227
+		if ($this->isGranted())
228 228
 		{
229 229
 			return $this->get('ipaddress');
230 230
 		}
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 
235 235
 	function isExistsHomepage()
236 236
 	{
237
-		if(trim($this->get('homepage')))
237
+		if (trim($this->get('homepage')))
238 238
 		{
239 239
 			return TRUE;
240 240
 		}
@@ -245,12 +245,12 @@  discard block
 block discarded – undo
245 245
 	function getHomepageUrl()
246 246
 	{
247 247
 		$url = trim($this->get('homepage'));
248
-		if(!$url)
248
+		if (!$url)
249 249
 		{
250 250
 			return;
251 251
 		}
252 252
 
253
-		if(strncasecmp('http://', $url, 7) !== 0)
253
+		if (strncasecmp('http://', $url, 7) !== 0)
254 254
 		{
255 255
 			$url = "http://" . $url;
256 256
 		}
@@ -284,14 +284,14 @@  discard block
 block discarded – undo
284 284
 	 */
285 285
 	function getContentText($strlen = 0)
286 286
 	{
287
-		if($this->isSecret() && !$this->isAccessible())
287
+		if ($this->isSecret() && !$this->isAccessible())
288 288
 		{
289 289
 			return Context::getLang('msg_is_secret');
290 290
 		}
291 291
 
292 292
 		$content = $this->get('content');
293 293
 
294
-		if($strlen)
294
+		if ($strlen)
295 295
 		{
296 296
 			return cut_str(strip_tags($content), $strlen, '...');
297 297
 		}
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
 	 */
306 306
 	function getContent($add_popup_menu = TRUE, $add_content_info = TRUE, $add_xe_content_class = TRUE)
307 307
 	{
308
-		if($this->isSecret() && !$this->isAccessible())
308
+		if ($this->isSecret() && !$this->isAccessible())
309 309
 		{
310 310
 			return Context::getLang('msg_is_secret');
311 311
 		}
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
 		stripEmbedTagForAdmin($content, $this->get('member_srl'));
315 315
 
316 316
 		// when displaying the comment on the pop-up menu
317
-		if($add_popup_menu && Context::get('is_logged'))
317
+		if ($add_popup_menu && Context::get('is_logged'))
318 318
 		{
319 319
 			$content = sprintf(
320 320
 					'%s<div class="comment_popup_menu"><a href="#popup_menu_area" class="comment_%d" onclick="return false">%s</a></div>', $content, $this->comment_srl, Context::getLang('cmd_comment_do')
@@ -322,10 +322,10 @@  discard block
 block discarded – undo
322 322
 		}
323 323
 
324 324
 		// if additional information which can access contents is set
325
-		if($add_content_info)
325
+		if ($add_content_info)
326 326
 		{
327 327
 			$memberSrl = $this->get('member_srl');
328
-			if($memberSrl < 0)
328
+			if ($memberSrl < 0)
329 329
 			{
330 330
 				$memberSrl = 0;
331 331
 			}
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
 		}
337 337
 		else
338 338
 		{
339
-			if($add_xe_content_class)
339
+			if ($add_xe_content_class)
340 340
 			{
341 341
 				$content = sprintf('<div class="xe_content">%s</div>', $content);
342 342
 			}
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
 
428 428
 	function hasUploadedFiles()
429 429
 	{
430
-		if(($this->isSecret() && !$this->isAccessible()) && !$this->isGranted())
430
+		if (($this->isSecret() && !$this->isAccessible()) && !$this->isGranted())
431 431
 		{
432 432
 			return FALSE;
433 433
 		}
@@ -436,12 +436,12 @@  discard block
 block discarded – undo
436 436
 
437 437
 	function getUploadedFiles()
438 438
 	{
439
-		if(($this->isSecret() && !$this->isAccessible()) && !$this->isGranted())
439
+		if (($this->isSecret() && !$this->isAccessible()) && !$this->isGranted())
440 440
 		{
441 441
 			return;
442 442
 		}
443 443
 
444
-		if(!$this->get('uploaded_count'))
444
+		if (!$this->get('uploaded_count'))
445 445
 		{
446 446
 			return;
447 447
 		}
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
 	function getEditor()
459 459
 	{
460 460
 		$module_srl = $this->get('module_srl');
461
-		if(!$module_srl)
461
+		if (!$module_srl)
462 462
 		{
463 463
 			$module_srl = Context::get('module_srl');
464 464
 		}
@@ -472,13 +472,13 @@  discard block
 block discarded – undo
472 472
 	 */
473 473
 	function getProfileImage()
474 474
 	{
475
-		if(!$this->isExists() || !$this->get('member_srl'))
475
+		if (!$this->isExists() || !$this->get('member_srl'))
476 476
 		{
477 477
 			return;
478 478
 		}
479 479
 		$oMemberModel = getModel('member');
480 480
 		$profile_info = $oMemberModel->getProfileImage($this->get('member_srl'));
481
-		if(!$profile_info)
481
+		if (!$profile_info)
482 482
 		{
483 483
 			return;
484 484
 		}
@@ -493,7 +493,7 @@  discard block
 block discarded – undo
493 493
 	function getSignature()
494 494
 	{
495 495
 		// pass if the posting not exists.
496
-		if(!$this->isExists() || !$this->get('member_srl'))
496
+		if (!$this->isExists() || !$this->get('member_srl'))
497 497
 		{
498 498
 			return;
499 499
 		}
@@ -503,7 +503,7 @@  discard block
 block discarded – undo
503 503
 		$signature = $oMemberModel->getSignature($this->get('member_srl'));
504 504
 
505 505
 		// check if max height of the signiture is specified on the member module
506
-		if(!isset($GLOBALS['__member_signature_max_height']))
506
+		if (!isset($GLOBALS['__member_signature_max_height']))
507 507
 		{
508 508
 			$oModuleModel = getModel('module');
509 509
 			$member_config = $oModuleModel->getModuleConfig('member');
@@ -512,7 +512,7 @@  discard block
 block discarded – undo
512 512
 
513 513
 		$max_signature_height = $GLOBALS['__member_signature_max_height'];
514 514
 
515
-		if($max_signature_height)
515
+		if ($max_signature_height)
516 516
 		{
517 517
 			$signature = sprintf('<div style="max-height:%dpx;overflow:auto;overflow-x:hidden;height:expression(this.scrollHeight > %d ? \'%dpx\': \'auto\')">%s</div>', $max_signature_height, $max_signature_height, $max_signature_height, $signature);
518 518
 		}
@@ -522,12 +522,12 @@  discard block
 block discarded – undo
522 522
 
523 523
 	function thumbnailExists($width = 80, $height = 0, $type = '')
524 524
 	{
525
-		if(!$this->comment_srl)
525
+		if (!$this->comment_srl)
526 526
 		{
527 527
 			return FALSE;
528 528
 		}
529 529
 
530
-		if(!$this->getThumbnail($width, $height, $type))
530
+		if (!$this->getThumbnail($width, $height, $type))
531 531
 		{
532 532
 			return FALSE;
533 533
 		}
@@ -538,30 +538,30 @@  discard block
 block discarded – undo
538 538
 	function getThumbnail($width = 80, $height = 0, $thumbnail_type = '')
539 539
 	{
540 540
 		// return false if no doc exists
541
-		if(!$this->comment_srl)
541
+		if (!$this->comment_srl)
542 542
 		{
543 543
 			return;
544 544
 		}
545 545
 
546
-		if($this->isSecret() && !$this->isGranted())
546
+		if ($this->isSecret() && !$this->isGranted())
547 547
 		{
548 548
 			return;
549 549
 		}
550 550
 
551 551
 		// If signiture height setting is omitted, create a square
552
-		if(!$height)
552
+		if (!$height)
553 553
 		{
554 554
 			$height = $width;
555 555
 		}
556 556
 
557 557
 		// return false if neigher attached file nor image;
558
-		if(!$this->hasUploadedFiles() && !preg_match("!<img!is", $this->get('content')))
558
+		if (!$this->hasUploadedFiles() && !preg_match("!<img!is", $this->get('content')))
559 559
 		{
560 560
 			return;
561 561
 		}
562 562
 
563 563
 		// get thumbail generation info on the doc module configuration.
564
-		if(!in_array($thumbnail_type, array('crop', 'ratio')))
564
+		if (!in_array($thumbnail_type, array('crop', 'ratio')))
565 565
 		{
566 566
 			$thumbnail_type = 'crop';
567 567
 		}
@@ -572,9 +572,9 @@  discard block
 block discarded – undo
572 572
 		$thumbnail_url = Context::getRequestUri() . $thumbnail_file;
573 573
 
574 574
 		// return false if a size of existing thumbnail file is 0. otherwise return the file path
575
-		if(file_exists($thumbnail_file))
575
+		if (file_exists($thumbnail_file))
576 576
 		{
577
-			if(filesize($thumbnail_file) < 1)
577
+			if (filesize($thumbnail_file) < 1)
578 578
 			{
579 579
 				return FALSE;
580 580
 			}
@@ -589,40 +589,40 @@  discard block
 block discarded – undo
589 589
 		$is_tmp_file = FALSE;
590 590
 
591 591
 		// find an image file among attached files
592
-		if($this->hasUploadedFiles())
592
+		if ($this->hasUploadedFiles())
593 593
 		{
594 594
 			$file_list = $this->getUploadedFiles();
595 595
 
596 596
 			$first_image = null;
597
-			foreach($file_list as $file)
597
+			foreach ($file_list as $file)
598 598
 			{
599
-				if($file->direct_download !== 'Y') continue;
599
+				if ($file->direct_download !== 'Y') continue;
600 600
 
601
-				if($file->cover_image === 'Y' && file_exists($file->uploaded_filename))
601
+				if ($file->cover_image === 'Y' && file_exists($file->uploaded_filename))
602 602
 				{
603 603
 					$source_file = $file->uploaded_filename;
604 604
 					break;
605 605
 				}
606 606
 
607
-				if($first_image) continue;
607
+				if ($first_image) continue;
608 608
 
609
-				if(preg_match("/\.(jpe?g|png|gif|bmp)$/i", $file->source_filename))
609
+				if (preg_match("/\.(jpe?g|png|gif|bmp)$/i", $file->source_filename))
610 610
 				{
611
-					if(file_exists($file->uploaded_filename))
611
+					if (file_exists($file->uploaded_filename))
612 612
 					{
613 613
 						$first_image = $file->uploaded_filename;
614 614
 					}
615 615
 				}
616 616
 			}
617 617
 
618
-			if(!$source_file && $first_image)
618
+			if (!$source_file && $first_image)
619 619
 			{
620 620
 				$source_file = $first_image;
621 621
 			}
622 622
 		}
623 623
 
624 624
 		// get an image file from the doc content if no file attached. 
625
-		if(!$source_file)
625
+		if (!$source_file)
626 626
 		{
627 627
 			$content = $this->get('content');
628 628
 			$target_src = NULL;
@@ -631,16 +631,16 @@  discard block
 block discarded – undo
631 631
 
632 632
 			$cnt = count($matches);
633 633
 
634
-			for($i = 0; $i < $cnt; $i++)
634
+			for ($i = 0; $i < $cnt; $i++)
635 635
 			{
636 636
 				$target_src = $matches[$i][2];
637
-				if(preg_match('/\/(common|modules|widgets|addons|layouts)\//i', $target_src))
637
+				if (preg_match('/\/(common|modules|widgets|addons|layouts)\//i', $target_src))
638 638
 				{
639 639
 					continue;
640 640
 				}
641 641
 				else
642 642
 				{
643
-					if(!preg_match('/^(http|https):\/\//i', $target_src))
643
+					if (!preg_match('/^(http|https):\/\//i', $target_src))
644 644
 					{
645 645
 						$target_src = Context::getRequestUri() . $target_src;
646 646
 					}
@@ -651,7 +651,7 @@  discard block
 block discarded – undo
651 651
 
652 652
 					FileHandler::getRemoteFile($target_src, $tmp_file);
653 653
 
654
-					if(!file_exists($tmp_file))
654
+					if (!file_exists($tmp_file))
655 655
 					{
656 656
 						continue;
657 657
 					}
@@ -659,7 +659,7 @@  discard block
 block discarded – undo
659 659
 					{
660 660
 						list($_w, $_h, $_t, $_a) = @getimagesize($tmp_file);
661 661
 
662
-						if($_w < $width || $_h < $height)
662
+						if ($_w < $width || $_h < $height)
663 663
 						{
664 664
 							continue;
665 665
 						}
@@ -674,13 +674,13 @@  discard block
 block discarded – undo
674 674
 
675 675
 		$output = FileHandler::createImageFile($source_file, $thumbnail_file, $width, $height, 'jpg', $thumbnail_type);
676 676
 
677
-		if($is_tmp_file)
677
+		if ($is_tmp_file)
678 678
 		{
679 679
 			FileHandler::removeFile($source_file);
680 680
 		}
681 681
 
682 682
 		// return the thumbnail path if successfully generated.
683
-		if($output)
683
+		if ($output)
684 684
 		{
685 685
 			return $thumbnail_url;
686 686
 		}
Please login to merge, or discard this patch.
Braces   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -333,8 +333,7 @@  discard block
 block discarded – undo
333 333
 					'<!--BeforeComment(%d,%d)--><div class="comment_%d_%d xe_content">%s</div><!--AfterComment(%d,%d)-->', $this->comment_srl, $memberSrl, $this->comment_srl, $memberSrl, $content, $this->comment_srl, $memberSrl
334 334
 			);
335 335
 			// xe_content class name should be specified although content access is not necessary.
336
-		}
337
-		else
336
+		} else
338 337
 		{
339 338
 			if($add_xe_content_class)
340 339
 			{
@@ -577,8 +576,7 @@  discard block
 block discarded – undo
577 576
 			if(filesize($thumbnail_file) < 1)
578 577
 			{
579 578
 				return FALSE;
580
-			}
581
-			else
579
+			} else
582 580
 			{
583 581
 				return $thumbnail_url;
584 582
 			}
@@ -596,7 +594,9 @@  discard block
 block discarded – undo
596 594
 			$first_image = null;
597 595
 			foreach($file_list as $file)
598 596
 			{
599
-				if($file->direct_download !== 'Y') continue;
597
+				if($file->direct_download !== 'Y') {
598
+					continue;
599
+				}
600 600
 
601 601
 				if($file->cover_image === 'Y' && file_exists($file->uploaded_filename))
602 602
 				{
@@ -604,7 +604,9 @@  discard block
 block discarded – undo
604 604
 					break;
605 605
 				}
606 606
 
607
-				if($first_image) continue;
607
+				if($first_image) {
608
+					continue;
609
+				}
608 610
 
609 611
 				if(preg_match("/\.(jpe?g|png|gif|bmp)$/i", $file->source_filename))
610 612
 				{
@@ -637,8 +639,7 @@  discard block
 block discarded – undo
637 639
 				if(preg_match('/\/(common|modules|widgets|addons|layouts)\//i', $target_src))
638 640
 				{
639 641
 					continue;
640
-				}
641
-				else
642
+				} else
642 643
 				{
643 644
 					if(!preg_match('/^(http|https):\/\//i', $target_src))
644 645
 					{
@@ -654,8 +655,7 @@  discard block
 block discarded – undo
654 655
 					if(!file_exists($tmp_file))
655 656
 					{
656 657
 						continue;
657
-					}
658
-					else
658
+					} else
659 659
 					{
660 660
 						list($_w, $_h, $_t, $_a) = @getimagesize($tmp_file);
661 661
 
Please login to merge, or discard this patch.