GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Pull Request — master (#1831)
by
unknown
32:29 queued 13s
created
modules/board/board.view.php 1 patch
Spacing   +160 added lines, -160 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
 			}
@@ -122,14 +122,14 @@  discard block
 block discarded – undo
122 122
 		/**
123 123
 		 * load javascript, JS filters
124 124
 		 **/
125
-		Context::addJsFilter($this->module_path.'tpl/filter', 'input_password.xml');
126
-		Context::addJsFile($this->module_path.'tpl/js/board.js');
125
+		Context::addJsFilter($this->module_path . 'tpl/filter', 'input_password.xml');
126
+		Context::addJsFile($this->module_path . 'tpl/js/board.js');
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
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 		/**
207 207
 		 * add javascript filters
208 208
 		 **/
209
-		Context::addJsFilter($this->module_path.'tpl/filter', 'search.xml');
209
+		Context::addJsFilter($this->module_path . 'tpl/filter', 'search.xml');
210 210
 
211 211
 		$oSecurity = new Security();
212 212
 		$oSecurity->encodeHTML('search_option.');
@@ -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
 		}
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
 		/**
341 341
 		 * add javascript filters
342 342
 		 **/
343
-		Context::addJsFilter($this->module_path.'tpl/filter', 'insert_comment.xml');
343
+		Context::addJsFilter($this->module_path . 'tpl/filter', 'insert_comment.xml');
344 344
 
345 345
 //            return new Object();
346 346
 	}
@@ -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
 		}
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
 		$oDocumentModel = getModel('document');
406 406
 		$document_srl = Context::get('document_srl');
407 407
 		$oDocument = $oDocumentModel->getDocument($document_srl);
408
-		Context::set('file_list',$oDocument->getUploadedFiles());
408
+		Context::set('file_list', $oDocument->getUploadedFiles());
409 409
 
410 410
 		$oSecurity = new Security();
411 411
 		$oSecurity->encodeHTML('file_list..source_filename');
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
 	/**
415 415
 	 * @brief display the document comment list (can be used by API)
416 416
 	 **/
417
-	function dispBoardContentCommentList(){
417
+	function dispBoardContentCommentList() {
418 418
 		// check document view grant
419 419
 		$this->dispBoardContentView();
420 420
 
@@ -424,26 +424,26 @@  discard block
 block discarded – undo
424 424
 		$comment_list = $oDocument->getComments();
425 425
 
426 426
 		// setup the comment list
427
-		if(is_array($comment_list))
427
+		if (is_array($comment_list))
428 428
 		{
429
-			foreach($comment_list as $key => $val)
429
+			foreach ($comment_list as $key => $val)
430 430
 			{
431
-				if(!$val->isAccessible())
431
+				if (!$val->isAccessible())
432 432
 				{
433
-					$val->add('content',Context::getLang('thisissecret'));
433
+					$val->add('content', Context::getLang('thisissecret'));
434 434
 				}
435 435
 			}
436 436
 		}
437
-		Context::set('comment_list',$comment_list);
437
+		Context::set('comment_list', $comment_list);
438 438
 
439 439
 	}
440 440
 
441 441
 	/**
442 442
 	 * @brief display notice list (can be used by API)
443 443
 	 **/
444
-	function dispBoardNoticeList(){
444
+	function dispBoardNoticeList() {
445 445
 		// check the grant
446
-		if(!$this->grant->list)
446
+		if (!$this->grant->list)
447 447
 		{
448 448
 			Context::set('notice_list', array());
449 449
 			return;
@@ -459,15 +459,15 @@  discard block
 block discarded – undo
459 459
 	/**
460 460
 	 * @brief display board content list
461 461
 	 **/
462
-	function dispBoardContentList(){
462
+	function dispBoardContentList() {
463 463
 		// check the grant
464
-		if(!$this->grant->list)
464
+		if (!$this->grant->list)
465 465
 		{
466 466
 			Context::set('document_list', array());
467 467
 			Context::set('total_count', 0);
468 468
 			Context::set('total_page', 1);
469 469
 			Context::set('page', 1);
470
-			Context::set('page_navigation', new PageHandler(0,0,1,10));
470
+			Context::set('page_navigation', new PageHandler(0, 0, 1, 10));
471 471
 			return;
472 472
 		}
473 473
 
@@ -485,17 +485,17 @@  discard block
 block discarded – undo
485 485
 		$args->search_keyword = Context::get('search_keyword');
486 486
 
487 487
 		$search_option = Context::get('search_option');
488
-		if($search_option==FALSE)
488
+		if ($search_option == FALSE)
489 489
 		{
490 490
 			$search_option = $this->search_option;
491 491
 		}
492
-		if(isset($search_option[$args->search_target])==FALSE)
492
+		if (isset($search_option[$args->search_target]) == FALSE)
493 493
 		{
494 494
 			$args->search_target = '';
495 495
 		}
496 496
 
497 497
 		// if the category is enabled, then get the category
498
-		if($this->module_info->use_category=='Y')
498
+		if ($this->module_info->use_category == 'Y')
499 499
 		{
500 500
 			$args->category_srl = Context::get('category');
501 501
 		}
@@ -503,21 +503,21 @@  discard block
 block discarded – undo
503 503
 		// setup the sort index and order index
504 504
 		$args->sort_index = Context::get('sort_index');
505 505
 		$args->order_type = Context::get('order_type');
506
-		if(!in_array($args->sort_index, $this->order_target))
506
+		if (!in_array($args->sort_index, $this->order_target))
507 507
 		{
508
-			$args->sort_index = $this->module_info->order_target?$this->module_info->order_target:'list_order';
508
+			$args->sort_index = $this->module_info->order_target ? $this->module_info->order_target : 'list_order';
509 509
 		}
510
-		if(!in_array($args->order_type, array('asc','desc')))
510
+		if (!in_array($args->order_type, array('asc', 'desc')))
511 511
 		{
512
-			$args->order_type = $this->module_info->order_type?$this->module_info->order_type:'asc';
512
+			$args->order_type = $this->module_info->order_type ? $this->module_info->order_type : 'asc';
513 513
 		}
514 514
 
515 515
 		// set the current page of documents
516 516
 		$document_srl = Context::get('document_srl');
517
-		if(!$args->page && $document_srl)
517
+		if (!$args->page && $document_srl)
518 518
 		{
519 519
 			$oDocument = $oDocumentModel->getDocument($document_srl);
520
-			if($oDocument->isExists() && !$oDocument->isNotice())
520
+			if ($oDocument->isExists() && !$oDocument->isNotice())
521 521
 			{
522 522
 				$page = $oDocumentModel->getDocumentPage($oDocument, $args);
523 523
 				Context::set('page', $page);
@@ -526,13 +526,13 @@  discard block
 block discarded – undo
526 526
 		}
527 527
 
528 528
 		// setup the list count to be serach list count, if the category or search keyword has been set
529
-		if($args->category_srl || $args->search_keyword)
529
+		if ($args->category_srl || $args->search_keyword)
530 530
 		{
531 531
 			$args->list_count = $this->search_list_count;
532 532
 		}
533 533
 
534 534
 		// if the consultation function is enabled,  the get the logged user information
535
-		if($this->consultation)
535
+		if ($this->consultation)
536 536
 		{
537 537
 			$logged_info = Context::get('logged_info');
538 538
 			$args->member_srl = $logged_info->member_srl;
@@ -560,18 +560,18 @@  discard block
 block discarded – undo
560 560
 				'allow_trackback', 'notify_message', 'status', 'comment_status');
561 561
 		$this->columnList = array_intersect($configColumList, $tableColumnList);
562 562
 
563
-		if(in_array('summary', $configColumList)) array_push($this->columnList, 'content');
563
+		if (in_array('summary', $configColumList)) array_push($this->columnList, 'content');
564 564
 
565 565
 		// default column list add
566 566
 		$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');
567 567
 
568 568
 		//TODO guestbook, blog style supports legacy codes.
569
-		if($this->module_info->skin == 'xe_guestbook' || $this->module_info->default_style == 'blog')
569
+		if ($this->module_info->skin == 'xe_guestbook' || $this->module_info->default_style == 'blog')
570 570
 		{
571 571
 			$defaultColumn = $tableColumnList;
572 572
 		}
573 573
 
574
-		if (in_array('last_post', $configColumList)){
574
+		if (in_array('last_post', $configColumList)) {
575 575
 			array_push($this->columnList, 'last_updater');
576 576
 		}
577 577
 
@@ -583,7 +583,7 @@  discard block
 block discarded – undo
583 583
 		$this->columnList = array_unique(array_merge($this->columnList, $defaultColumn));
584 584
 
585 585
 		// add table name
586
-		foreach($this->columnList as $no => $value)
586
+		foreach ($this->columnList as $no => $value)
587 587
 		{
588 588
 			$this->columnList[$no] = 'documents.' . $value;
589 589
 		}
@@ -595,7 +595,7 @@  discard block
 block discarded – undo
595 595
 	function dispBoardTagList()
596 596
 	{
597 597
 		// check if there is not grant fot view list, then alert an warning message
598
-		if(!$this->grant->list)
598
+		if (!$this->grant->list)
599 599
 		{
600 600
 			return $this->dispBoardMessage('msg_not_permitted');
601 601
 		}
@@ -609,14 +609,14 @@  discard block
 block discarded – undo
609 609
 		$output = $oTagModel->getTagList($obj);
610 610
 
611 611
 		// automatically order
612
-		if(count($output->data))
612
+		if (count($output->data))
613 613
 		{
614 614
 			$numbers = array_keys($output->data);
615 615
 			shuffle($numbers);
616 616
 
617
-			if(count($output->data))
617
+			if (count($output->data))
618 618
 			{
619
-				foreach($numbers as $k => $v)
619
+				foreach ($numbers as $k => $v)
620 620
 				{
621 621
 					$tag_list[] = $output->data[$v];
622 622
 				}
@@ -637,7 +637,7 @@  discard block
 block discarded – undo
637 637
 	function dispBoardWrite()
638 638
 	{
639 639
 		// check grant
640
-		if(!$this->grant->write_document)
640
+		if (!$this->grant->write_document)
641 641
 		{
642 642
 			return $this->dispBoardMessage('msg_not_permitted');
643 643
 		}
@@ -647,10 +647,10 @@  discard block
 block discarded – undo
647 647
 		/**
648 648
 		 * check if the category option is enabled not not
649 649
 		 **/
650
-		if($this->module_info->use_category=='Y')
650
+		if ($this->module_info->use_category == 'Y')
651 651
 		{
652 652
 			// get the user group information
653
-			if(Context::get('is_logged'))
653
+			if (Context::get('is_logged'))
654 654
 			{
655 655
 				$logged_info = Context::get('logged_info');
656 656
 				$group_srls = array_keys($logged_info->group_list);
@@ -663,19 +663,19 @@  discard block
 block discarded – undo
663 663
 
664 664
 			// check the grant after obtained the category list
665 665
 			$normal_category_list = $oDocumentModel->getCategoryList($this->module_srl);
666
-			if(count($normal_category_list))
666
+			if (count($normal_category_list))
667 667
 			{
668
-				foreach($normal_category_list as $category_srl => $category)
668
+				foreach ($normal_category_list as $category_srl => $category)
669 669
 				{
670 670
 					$is_granted = TRUE;
671
-					if($category->group_srls)
671
+					if ($category->group_srls)
672 672
 					{
673
-						$category_group_srls = explode(',',$category->group_srls);
673
+						$category_group_srls = explode(',', $category->group_srls);
674 674
 						$is_granted = FALSE;
675
-						if(count(array_intersect($group_srls, $category_group_srls))) $is_granted = TRUE;
675
+						if (count(array_intersect($group_srls, $category_group_srls))) $is_granted = TRUE;
676 676
 
677 677
 					}
678
-					if($is_granted) $category_list[$category_srl] = $category;
678
+					if ($is_granted) $category_list[$category_srl] = $category;
679 679
 				}
680 680
 			}
681 681
 			Context::set('category_list', $category_list);
@@ -686,46 +686,46 @@  discard block
 block discarded – undo
686 686
 		$oDocument = $oDocumentModel->getDocument(0, $this->grant->manager);
687 687
 		$oDocument->setDocument($document_srl);
688 688
 
689
-		if($oDocument->get('module_srl') == $oDocument->get('member_srl')) $savedDoc = TRUE;
689
+		if ($oDocument->get('module_srl') == $oDocument->get('member_srl')) $savedDoc = TRUE;
690 690
 		$oDocument->add('module_srl', $this->module_srl);
691 691
 
692
-		if($oDocument->isExists() && $this->module_info->protect_content=="Y" && $oDocument->get('comment_count')>0 && $this->grant->manager==false)
692
+		if ($oDocument->isExists() && $this->module_info->protect_content == "Y" && $oDocument->get('comment_count') > 0 && $this->grant->manager == false)
693 693
 		{
694 694
 			return new Object(-1, 'msg_protect_content');
695 695
 		}
696 696
 
697 697
 		// if the document is not granted, then back to the password input form
698 698
 		$oModuleModel = getModel('module');
699
-		if($oDocument->isExists()&&!$oDocument->isGranted())
699
+		if ($oDocument->isExists() && !$oDocument->isGranted())
700 700
 		{
701 701
 			return $this->setTemplateFile('input_password_form');
702 702
 		}
703 703
 
704
-		if(!$oDocument->isExists())
704
+		if (!$oDocument->isExists())
705 705
 		{
706
-			$point_config = $oModuleModel->getModulePartConfig('point',$this->module_srl);
706
+			$point_config = $oModuleModel->getModulePartConfig('point', $this->module_srl);
707 707
 			$logged_info = Context::get('logged_info');
708 708
 			$oPointModel = getModel('point');
709 709
 			$pointForInsert = $point_config["insert_document"];
710
-			if($pointForInsert < 0)
710
+			if ($pointForInsert < 0)
711 711
 			{
712
-				if( !$logged_info )
712
+				if (!$logged_info)
713 713
 				{
714 714
 					return $this->dispBoardMessage('msg_not_permitted');
715 715
 				}
716
-				else if (($oPointModel->getPoint($logged_info->member_srl) + $pointForInsert )< 0 )
716
+				else if (($oPointModel->getPoint($logged_info->member_srl) + $pointForInsert) < 0)
717 717
 				{
718 718
 					return $this->dispBoardMessage('msg_not_enough_point');
719 719
 				}
720 720
 			}
721 721
 		}
722
-		if(!$oDocument->get('status')) $oDocument->add('status', $oDocumentModel->getDefaultStatus());
722
+		if (!$oDocument->get('status')) $oDocument->add('status', $oDocumentModel->getDefaultStatus());
723 723
 
724 724
 		$statusList = $this->_getStatusNameList($oDocumentModel);
725
-		if(count($statusList) > 0) Context::set('status_list', $statusList);
725
+		if (count($statusList) > 0) Context::set('status_list', $statusList);
726 726
 
727 727
 		// get Document status config value
728
-		Context::set('document_srl',$document_srl);
728
+		Context::set('document_srl', $document_srl);
729 729
 		Context::set('oDocument', $oDocument);
730 730
 
731 731
 		// apply xml_js_filter on header
@@ -733,13 +733,13 @@  discard block
 block discarded – undo
733 733
 		$oDocumentController->addXmlJsFilter($this->module_info->module_srl);
734 734
 
735 735
 		// if the document exists, then setup extra variabels on context
736
-		if($oDocument->isExists() && !$savedDoc) Context::set('extra_keys', $oDocument->getExtraVars());
736
+		if ($oDocument->isExists() && !$savedDoc) Context::set('extra_keys', $oDocument->getExtraVars());
737 737
 
738 738
 		/**
739 739
 		 * add JS filters
740 740
 		 **/
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');
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');
743 743
 
744 744
 		$oSecurity = new Security();
745 745
 		$oSecurity->encodeHTML('category_list.text', 'category_list.title');
@@ -750,14 +750,14 @@  discard block
 block discarded – undo
750 750
 	function _getStatusNameList(&$oDocumentModel)
751 751
 	{
752 752
 		$resultList = array();
753
-		if(!empty($this->module_info->use_status))
753
+		if (!empty($this->module_info->use_status))
754 754
 		{
755 755
 			$statusNameList = $oDocumentModel->getStatusNameList();
756 756
 			$statusList = explode('|@|', $this->module_info->use_status);
757 757
 
758
-			if(is_array($statusList))
758
+			if (is_array($statusList))
759 759
 			{
760
-				foreach($statusList as $key => $value)
760
+				foreach ($statusList as $key => $value)
761 761
 				{
762 762
 					$resultList[$value] = $statusNameList[$value];
763 763
 				}
@@ -772,7 +772,7 @@  discard block
 block discarded – undo
772 772
 	function dispBoardDelete()
773 773
 	{
774 774
 		// check grant
775
-		if(!$this->grant->write_document)
775
+		if (!$this->grant->write_document)
776 776
 		{
777 777
 			return $this->dispBoardMessage('msg_not_permitted');
778 778
 		}
@@ -781,35 +781,35 @@  discard block
 block discarded – undo
781 781
 		$document_srl = Context::get('document_srl');
782 782
 
783 783
 		// if document exists, get the document information
784
-		if($document_srl)
784
+		if ($document_srl)
785 785
 		{
786 786
 			$oDocumentModel = getModel('document');
787 787
 			$oDocument = $oDocumentModel->getDocument($document_srl);
788 788
 		}
789 789
 
790 790
 		// if the document is not existed, then back to the board content page
791
-		if(!$oDocument->isExists())
791
+		if (!$oDocument->isExists())
792 792
 		{
793 793
 			return $this->dispBoardContent();
794 794
 		}
795 795
 
796 796
 		// if the document is not granted, then back to the password input form
797
-		if(!$oDocument->isGranted())
797
+		if (!$oDocument->isGranted())
798 798
 		{
799 799
 			return $this->setTemplateFile('input_password_form');
800 800
 		}
801 801
 
802
-		if($this->module_info->protect_content=="Y" && $oDocument->get('comment_count')>0 && $this->grant->manager==false)
802
+		if ($this->module_info->protect_content == "Y" && $oDocument->get('comment_count') > 0 && $this->grant->manager == false)
803 803
 		{
804 804
 			return $this->dispBoardMessage('msg_protect_content');
805 805
 		}
806 806
 
807
-		Context::set('oDocument',$oDocument);
807
+		Context::set('oDocument', $oDocument);
808 808
 
809 809
 		/**
810 810
 		 * add JS filters
811 811
 		 **/
812
-		Context::addJsFilter($this->module_path.'tpl/filter', 'delete_document.xml');
812
+		Context::addJsFilter($this->module_path . 'tpl/filter', 'delete_document.xml');
813 813
 
814 814
 		$this->setTemplateFile('delete_form');
815 815
 	}
@@ -822,7 +822,7 @@  discard block
 block discarded – undo
822 822
 		$document_srl = Context::get('document_srl');
823 823
 
824 824
 		// check grant
825
-		if(!$this->grant->write_comment)
825
+		if (!$this->grant->write_comment)
826 826
 		{
827 827
 			return $this->dispBoardMessage('msg_not_permitted');
828 828
 		}
@@ -830,13 +830,13 @@  discard block
 block discarded – undo
830 830
 		// get the document information
831 831
 		$oDocumentModel = getModel('document');
832 832
 		$oDocument = $oDocumentModel->getDocument($document_srl);
833
-		if(!$oDocument->isExists())
833
+		if (!$oDocument->isExists())
834 834
 		{
835 835
 			return $this->dispBoardMessage('msg_invalid_request');
836 836
 		}
837 837
 
838 838
 		// Check allow comment
839
-		if(!$oDocument->allowComment())
839
+		if (!$oDocument->allowComment())
840 840
 		{
841 841
 			return $this->dispBoardMessage('msg_not_allow_comment');
842 842
 		}
@@ -848,14 +848,14 @@  discard block
 block discarded – undo
848 848
 		$oComment->add('module_srl', $this->module_srl);
849 849
 
850 850
 		// setup document variables on context
851
-		Context::set('oDocument',$oDocument);
852
-		Context::set('oSourceComment',$oSourceComment);
853
-		Context::set('oComment',$oComment);
851
+		Context::set('oDocument', $oDocument);
852
+		Context::set('oSourceComment', $oSourceComment);
853
+		Context::set('oComment', $oComment);
854 854
 
855 855
 		/**
856 856
 		 * add JS filter
857 857
 		 **/
858
-		Context::addJsFilter($this->module_path.'tpl/filter', 'insert_comment.xml');
858
+		Context::addJsFilter($this->module_path . 'tpl/filter', 'insert_comment.xml');
859 859
 
860 860
 		$this->setTemplateFile('comment_form');
861 861
 	}
@@ -866,7 +866,7 @@  discard block
 block discarded – undo
866 866
 	function dispBoardReplyComment()
867 867
 	{
868 868
 		// check grant
869
-		if(!$this->grant->write_comment)
869
+		if (!$this->grant->write_comment)
870 870
 		{
871 871
 			return $this->dispBoardMessage('msg_not_permitted');
872 872
 		}
@@ -875,7 +875,7 @@  discard block
 block discarded – undo
875 875
 		$parent_srl = Context::get('comment_srl');
876 876
 
877 877
 		// if the parent comment is not existed
878
-		if(!$parent_srl)
878
+		if (!$parent_srl)
879 879
 		{
880 880
 			return new Object(-1, 'msg_invalid_request');
881 881
 		}
@@ -885,11 +885,11 @@  discard block
 block discarded – undo
885 885
 		$oSourceComment = $oCommentModel->getComment($parent_srl, $this->grant->manager);
886 886
 
887 887
 		// if the comment is not existed, opoup an error message
888
-		if(!$oSourceComment->isExists())
888
+		if (!$oSourceComment->isExists())
889 889
 		{
890 890
 			return $this->dispBoardMessage('msg_invalid_request');
891 891
 		}
892
-		if(Context::get('document_srl') && $oSourceComment->get('document_srl') != Context::get('document_srl'))
892
+		if (Context::get('document_srl') && $oSourceComment->get('document_srl') != Context::get('document_srl'))
893 893
 		{
894 894
 			return $this->dispBoardMessage('msg_invalid_request');
895 895
 		}
@@ -897,7 +897,7 @@  discard block
 block discarded – undo
897 897
 		// Check allow comment
898 898
 		$oDocumentModel = getModel('document');
899 899
 		$oDocument = $oDocumentModel->getDocument($oSourceComment->get('document_srl'));
900
-		if(!$oDocument->allowComment())
900
+		if (!$oDocument->allowComment())
901 901
 		{
902 902
 			return $this->dispBoardMessage('msg_not_allow_comment');
903 903
 		}
@@ -908,14 +908,14 @@  discard block
 block discarded – undo
908 908
 		$oComment->add('document_srl', $oSourceComment->get('document_srl'));
909 909
 
910 910
 		// setup comment variables
911
-		Context::set('oSourceComment',$oSourceComment);
912
-		Context::set('oComment',$oComment);
913
-		Context::set('module_srl',$this->module_info->module_srl);
911
+		Context::set('oSourceComment', $oSourceComment);
912
+		Context::set('oComment', $oComment);
913
+		Context::set('module_srl', $this->module_info->module_srl);
914 914
 
915 915
 		/**
916 916
 		 * add JS filters
917 917
 		 **/
918
-		Context::addJsFilter($this->module_path.'tpl/filter', 'insert_comment.xml');
918
+		Context::addJsFilter($this->module_path . 'tpl/filter', 'insert_comment.xml');
919 919
 
920 920
 		$this->setTemplateFile('comment_form');
921 921
 	}
@@ -926,7 +926,7 @@  discard block
 block discarded – undo
926 926
 	function dispBoardModifyComment()
927 927
 	{
928 928
 		// check grant
929
-		if(!$this->grant->write_comment)
929
+		if (!$this->grant->write_comment)
930 930
 		{
931 931
 			return $this->dispBoardMessage('msg_not_permitted');
932 932
 		}
@@ -936,7 +936,7 @@  discard block
 block discarded – undo
936 936
 		$comment_srl = Context::get('comment_srl');
937 937
 
938 938
 		// if the comment is not existed
939
-		if(!$comment_srl)
939
+		if (!$comment_srl)
940 940
 		{
941 941
 			return new Object(-1, 'msg_invalid_request');
942 942
 		}
@@ -946,13 +946,13 @@  discard block
 block discarded – undo
946 946
 		$oComment = $oCommentModel->getComment($comment_srl, $this->grant->manager);
947 947
 
948 948
 		// if the comment is not exited, alert an error message
949
-		if(!$oComment->isExists())
949
+		if (!$oComment->isExists())
950 950
 		{
951 951
 			return $this->dispBoardMessage('msg_invalid_request');
952 952
 		}
953 953
 
954 954
 		// if the comment is not granted, then back to the password input form
955
-		if(!$oComment->isGranted())
955
+		if (!$oComment->isGranted())
956 956
 		{
957 957
 			return $this->setTemplateFile('input_password_form');
958 958
 		}
@@ -964,7 +964,7 @@  discard block
 block discarded – undo
964 964
 		/**
965 965
 		 * add JS fitlers
966 966
 		 **/
967
-		Context::addJsFilter($this->module_path.'tpl/filter', 'insert_comment.xml');
967
+		Context::addJsFilter($this->module_path . 'tpl/filter', 'insert_comment.xml');
968 968
 
969 969
 		$this->setTemplateFile('comment_form');
970 970
 	}
@@ -975,7 +975,7 @@  discard block
 block discarded – undo
975 975
 	function dispBoardDeleteComment()
976 976
 	{
977 977
 		// check grant
978
-		if(!$this->grant->write_comment)
978
+		if (!$this->grant->write_comment)
979 979
 		{
980 980
 			return $this->dispBoardMessage('msg_not_permitted');
981 981
 		}
@@ -984,30 +984,30 @@  discard block
 block discarded – undo
984 984
 		$comment_srl = Context::get('comment_srl');
985 985
 
986 986
 		// if the comment exists, then get the comment information
987
-		if($comment_srl)
987
+		if ($comment_srl)
988 988
 		{
989 989
 			$oCommentModel = getModel('comment');
990 990
 			$oComment = $oCommentModel->getComment($comment_srl, $this->grant->manager);
991 991
 		}
992 992
 
993 993
 		// if the comment is not existed, then back to the board content page
994
-		if(!$oComment->isExists() )
994
+		if (!$oComment->isExists())
995 995
 		{
996 996
 			return $this->dispBoardContent();
997 997
 		}
998 998
 
999 999
 		// if the comment is not granted, then back to the password input form
1000
-		if(!$oComment->isGranted())
1000
+		if (!$oComment->isGranted())
1001 1001
 		{
1002 1002
 			return $this->setTemplateFile('input_password_form');
1003 1003
 		}
1004 1004
 
1005
-		Context::set('oComment',$oComment);
1005
+		Context::set('oComment', $oComment);
1006 1006
 
1007 1007
 		/**
1008 1008
 		 * add JS filters
1009 1009
 		 **/
1010
-		Context::addJsFilter($this->module_path.'tpl/filter', 'delete_comment.xml');
1010
+		Context::addJsFilter($this->module_path . 'tpl/filter', 'delete_comment.xml');
1011 1011
 
1012 1012
 		$this->setTemplateFile('delete_comment_form');
1013 1013
 	}
@@ -1019,7 +1019,7 @@  discard block
 block discarded – undo
1019 1019
 	{
1020 1020
 		$oTrackbackModel = getModel('trackback');
1021 1021
 
1022
-		if(!$oTrackbackModel)
1022
+		if (!$oTrackbackModel)
1023 1023
 		{
1024 1024
 			return;
1025 1025
 		}
@@ -1033,7 +1033,7 @@  discard block
 block discarded – undo
1033 1033
 		$trackback = $output->data;
1034 1034
 
1035 1035
 		// if no trackback, then display the board content
1036
-		if(!$trackback)
1036
+		if (!$trackback)
1037 1037
 		{
1038 1038
 			return $this->dispBoardContent();
1039 1039
 		}
@@ -1043,7 +1043,7 @@  discard block
 block discarded – undo
1043 1043
 		/**
1044 1044
 		 * add JS filters
1045 1045
 		 **/
1046
-		Context::addJsFilter($this->module_path.'tpl/filter', 'delete_trackback.xml');
1046
+		Context::addJsFilter($this->module_path . 'tpl/filter', 'delete_trackback.xml');
1047 1047
 
1048 1048
 		$this->setTemplateFile('delete_trackback_form');
1049 1049
 	}
@@ -1054,7 +1054,7 @@  discard block
 block discarded – undo
1054 1054
 	function dispBoardMessage($msg_code)
1055 1055
 	{
1056 1056
 		$msg = Context::getLang($msg_code);
1057
-		if(!$msg) $msg = $msg_code;
1057
+		if (!$msg) $msg = $msg_code;
1058 1058
 		Context::set('message', $msg);
1059 1059
 		$this->setTemplateFile('message');
1060 1060
 	}
@@ -1065,8 +1065,8 @@  discard block
 block discarded – undo
1065 1065
 	 **/
1066 1066
 	function alertMessage($message)
1067 1067
 	{
1068
-		$script =  sprintf('<script> jQuery(function(){ alert("%s"); } );</script>', Context::getLang($message));
1069
-		Context::addHtmlFooter( $script );
1068
+		$script = sprintf('<script> jQuery(function(){ alert("%s"); } );</script>', Context::getLang($message));
1069
+		Context::addHtmlFooter($script);
1070 1070
 	}
1071 1071
 
1072 1072
 }
Please login to merge, or discard this patch.