GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 423fe8...f48289 )
by gyeong-won
15:56 queued 08:14
created
modules/addon/addon.admin.controller.php 2 patches
Braces   +7 added lines, -14 removed lines patch added patch discarded remove patch
@@ -36,8 +36,7 @@  discard block
 block discarded – undo
36 36
 		if($site_module_info->site_srl)
37 37
 		{
38 38
 			$site_srl = $site_module_info->site_srl;
39
-		}
40
-		else
39
+		} else
41 40
 		{
42 41
 			$site_srl = 0;
43 42
 		}
@@ -103,8 +102,7 @@  discard block
 block discarded – undo
103 102
 			if(in_array($targetAddon, $pcOnList))
104 103
 			{
105 104
 				$args->is_used = 'Y';
106
-			}
107
-			else
105
+			} else
108 106
 			{
109 107
 				$args->is_used = 'N';
110 108
 			}
@@ -112,8 +110,7 @@  discard block
 block discarded – undo
112 110
 			if(in_array($targetAddon, $mobileOnList))
113 111
 			{
114 112
 				$args->is_used_m = 'Y';
115
-			}
116
-			else
113
+			} else
117 114
 			{
118 115
 				$args->is_used_m = 'N';
119 116
 			}
@@ -121,8 +118,7 @@  discard block
 block discarded – undo
121 118
 			if(in_array($targetAddon, $fixed))
122 119
 			{
123 120
 				$args->fixed = 'Y';
124
-			}
125
-			else
121
+			} else
126 122
 			{
127 123
 				$args->fixed = 'N';
128 124
 			}
@@ -147,8 +143,7 @@  discard block
 block discarded – undo
147 143
 		if(Context::get('success_return_url'))
148 144
 		{
149 145
 			$this->setRedirectUrl(Context::get('success_return_url'));
150
-		}
151
-		else
146
+		} else
152 147
 		{
153 148
 			$this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAddonAdminIndex'));
154 149
 		}
@@ -256,8 +251,7 @@  discard block
 block discarded – undo
256 251
 		if($type == "pc")
257 252
 		{
258 253
 			$args->is_used = 'Y';
259
-		}
260
-		else
254
+		} else
261 255
 		{
262 256
 			$args->is_used_m = "Y";
263 257
 		}
@@ -284,8 +278,7 @@  discard block
 block discarded – undo
284 278
 		if($type == "pc")
285 279
 		{
286 280
 			$args->is_used = 'N';
287
-		}
288
-		else
281
+		} else
289 282
 		{
290 283
 			$args->is_used_m = 'N';
291 284
 		}
Please login to merge, or discard this patch.
Spacing   +28 added lines, -28 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/addon/addon.controller.php');
4
+require_once(_XE_PATH_.'modules/addon/addon.controller.php');
5 5
 
6 6
 /**
7 7
  * Admin controller class of addon modules
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 
34 34
 		$site_module_info = Context::get('site_module_info');
35 35
 
36
-		if($site_module_info->site_srl)
36
+		if ($site_module_info->site_srl)
37 37
 		{
38 38
 			$site_srl = $site_module_info->site_srl;
39 39
 		}
@@ -42,28 +42,28 @@  discard block
 block discarded – undo
42 42
 			$site_srl = 0;
43 43
 		}
44 44
 
45
-		if(!$pcOnList)
45
+		if (!$pcOnList)
46 46
 		{
47 47
 			$pcOnList = array();
48 48
 		}
49
-		if(!$mobileOnList)
49
+		if (!$mobileOnList)
50 50
 		{
51 51
 			$mobileOnList = array();
52 52
 		}
53
-		if(!$fixed)
53
+		if (!$fixed)
54 54
 		{
55 55
 			$fixed = array();
56 56
 		}
57 57
 
58
-		if(!is_array($pcOnList))
58
+		if (!is_array($pcOnList))
59 59
 		{
60 60
 			$pcOnList = array($pcOnList);
61 61
 		}
62
-		if(!is_array($mobileOnList))
62
+		if (!is_array($mobileOnList))
63 63
 		{
64 64
 			$pcOnList = array($mobileOnList);
65 65
 		}
66
-		if(!is_array($fixed))
66
+		if (!is_array($fixed))
67 67
 		{
68 68
 			$pcOnList = array($fixed);
69 69
 		}
@@ -74,21 +74,21 @@  discard block
 block discarded – undo
74 74
 
75 75
 		// get need update addon list
76 76
 		$updateList = array();
77
-		foreach($currentAddonList as $addon)
77
+		foreach ($currentAddonList as $addon)
78 78
 		{
79
-			if($addon->activated !== in_array($addon->addon_name, $pcOnList))
79
+			if ($addon->activated !== in_array($addon->addon_name, $pcOnList))
80 80
 			{
81 81
 				$updateList[] = $addon->addon_name;
82 82
 				continue;
83 83
 			}
84 84
 
85
-			if($addon->mactivated !== in_array($addon->addon_name, $mobileOnList))
85
+			if ($addon->mactivated !== in_array($addon->addon_name, $mobileOnList))
86 86
 			{
87 87
 				$updateList[] = $addon->addon_name;
88 88
 				continue;
89 89
 			}
90 90
 
91
-			if($addon->fixed !== in_array($addon->addon_name, $fixed))
91
+			if ($addon->fixed !== in_array($addon->addon_name, $fixed))
92 92
 			{
93 93
 				$updateList[] = $addon->addon_name;
94 94
 				continue;
@@ -96,11 +96,11 @@  discard block
 block discarded – undo
96 96
 		}
97 97
 
98 98
 		// update
99
-		foreach($updateList as $targetAddon)
99
+		foreach ($updateList as $targetAddon)
100 100
 		{
101 101
 			$args = new stdClass();
102 102
 
103
-			if(in_array($targetAddon, $pcOnList))
103
+			if (in_array($targetAddon, $pcOnList))
104 104
 			{
105 105
 				$args->is_used = 'Y';
106 106
 			}
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 				$args->is_used = 'N';
110 110
 			}
111 111
 
112
-			if(in_array($targetAddon, $mobileOnList))
112
+			if (in_array($targetAddon, $mobileOnList))
113 113
 			{
114 114
 				$args->is_used_m = 'Y';
115 115
 			}
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 				$args->is_used_m = 'N';
119 119
 			}
120 120
 
121
-			if(in_array($targetAddon, $fixed))
121
+			if (in_array($targetAddon, $fixed))
122 122
 			{
123 123
 				$args->fixed = 'Y';
124 124
 			}
@@ -131,20 +131,20 @@  discard block
 block discarded – undo
131 131
 			$args->site_srl = $site_srl;
132 132
 
133 133
 			$output = executeQuery('addon.updateSiteAddon', $args);
134
-			if(!$output->toBool())
134
+			if (!$output->toBool())
135 135
 			{
136 136
 				return $output;
137 137
 			}
138 138
 		}
139 139
 
140
-		if(count($updateList))
140
+		if (count($updateList))
141 141
 		{
142 142
 			$this->makeCacheFile($site_srl, 'pc', 'site');
143 143
 			$this->makeCacheFile($site_srl, 'mobile', 'site');
144 144
 		}
145 145
 
146 146
 		$this->setMessage('success_updated', 'info');
147
-		if(Context::get('success_return_url'))
147
+		if (Context::get('success_return_url'))
148 148
 		{
149 149
 			$this->setRedirectUrl(Context::get('success_return_url'));
150 150
 		}
@@ -167,14 +167,14 @@  discard block
 block discarded – undo
167 167
 		// batahom addon values
168 168
 		$addon = Context::get('addon');
169 169
 		$type = Context::get('type');
170
-		if(!$type)
170
+		if (!$type)
171 171
 		{
172 172
 			$type = "pc";
173 173
 		}
174
-		if($addon)
174
+		if ($addon)
175 175
 		{
176 176
 			// If enabled Disables
177
-			if($oAddonModel->isActivatedAddon($addon, $site_module_info->site_srl, $type))
177
+			if ($oAddonModel->isActivatedAddon($addon, $site_module_info->site_srl, $type))
178 178
 			{
179 179
 				$this->doDeactivate($addon, $site_module_info->site_srl, $type);
180 180
 			}
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 		$site_module_info = Context::get('site_module_info');
208 208
 
209 209
 		$output = $this->doSetup($addon_name, $args, $site_module_info->site_srl, 'site');
210
-		if(!$output->toBool())
210
+		if (!$output->toBool())
211 211
 		{
212 212
 			return $output;
213 213
 		}
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 		$args = new stdClass;
233 233
 		$args->addon = $addon;
234 234
 		$args->is_used = $isUsed;
235
-		if($gtype == 'global')
235
+		if ($gtype == 'global')
236 236
 		{
237 237
 			return executeQuery('addon.insertAddon', $args);
238 238
 		}
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 	{
254 254
 		$args = new stdClass();
255 255
 		$args->addon = $addon;
256
-		if($type == "pc")
256
+		if ($type == "pc")
257 257
 		{
258 258
 			$args->is_used = 'Y';
259 259
 		}
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
 		{
262 262
 			$args->is_used_m = "Y";
263 263
 		}
264
-		if($gtype == 'global')
264
+		if ($gtype == 'global')
265 265
 		{
266 266
 			return executeQuery('addon.updateAddon', $args);
267 267
 		}
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
 	{
282 282
 		$args = new stdClass();
283 283
 		$args->addon = $addon;
284
-		if($type == "pc")
284
+		if ($type == "pc")
285 285
 		{
286 286
 			$args->is_used = 'N';
287 287
 		}
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
 		{
290 290
 			$args->is_used_m = 'N';
291 291
 		}
292
-		if($gtype == 'global')
292
+		if ($gtype == 'global')
293 293
 		{
294 294
 			return executeQuery('addon.updateAddon', $args);
295 295
 		}
Please login to merge, or discard this patch.
modules/addon/addon.admin.view.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -83,8 +83,7 @@
 block discarded – undo
83 83
 					$module_categories[$module->module_category_srl]->list[$module_srl] = $module;
84 84
 				}
85 85
 			}
86
-		}
87
-		else
86
+		} else
88 87
 		{
89 88
 			$module_categories = array();
90 89
 			$module_categories[0] = new stdClass();
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 	 */
16 16
 	function init()
17 17
 	{
18
-		$this->setTemplatePath($this->module_path . 'tpl');
18
+		$this->setTemplatePath($this->module_path.'tpl');
19 19
 	}
20 20
 
21 21
 	/**
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 		$security = new Security($addon_list);
35 35
 		$addon_list = $security->encodeHTML('..', '..author..');
36 36
 
37
-		foreach($addon_list as $no => $addon_info)
37
+		foreach ($addon_list as $no => $addon_info)
38 38
 		{
39 39
 			$addon_list[$no]->description = nl2br(trim($addon_info->description));
40 40
 		}
@@ -64,21 +64,21 @@  discard block
 block discarded – undo
64 64
 		$oModuleAdminModel = getAdminModel('module');
65 65
 
66 66
 		$args = new stdClass();
67
-		if($site_module_info->site_srl)
67
+		if ($site_module_info->site_srl)
68 68
 		{
69 69
 			$args->site_srl = $site_module_info->site_srl;
70 70
 		}
71 71
 		$columnList = array('module_srl', 'module_category_srl', 'mid', 'browser_title');
72 72
 		$mid_list = $oModuleModel->getMidList($args, $columnList);
73 73
 		// module_category and module combination
74
-		if(!$site_module_info->site_srl)
74
+		if (!$site_module_info->site_srl)
75 75
 		{
76 76
 			// Get a list of module categories
77 77
 			$module_categories = $oModuleModel->getModuleCategories();
78 78
 
79
-			if(is_array($mid_list))
79
+			if (is_array($mid_list))
80 80
 			{
81
-				foreach($mid_list as $module_srl => $module)
81
+				foreach ($mid_list as $module_srl => $module)
82 82
 				{
83 83
 					$module_categories[$module->module_category_srl]->list[$module_srl] = $module;
84 84
 				}
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 		// Template specifies the path and file
97 97
 		$this->setTemplateFile('setup_addon');
98 98
 
99
-		if(Context::get('module') != 'admin')
99
+		if (Context::get('module') != 'admin')
100 100
 		{
101 101
 			$this->setLayoutPath('./common/tpl');
102 102
 			$this->setLayoutFile('popup_layout');
Please login to merge, or discard this patch.
modules/admin/admin.class.php 2 patches
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -92,8 +92,7 @@  discard block
 block discarded – undo
92 92
 			{
93 93
 				$this->createXeAdminMenu();
94 94
 				$output = $oMenuAdminModel->getMenuByTitle($this->adminMenuName);
95
-			}
96
-			else
95
+			} else
97 96
 			{
98 97
 				if(!is_readable(FileHandler::getRealPath($output->php_file)))
99 98
 				{
@@ -140,8 +139,7 @@  discard block
 block discarded – undo
140 139
 			if($value == 'dashboard')
141 140
 			{
142 141
 				$args->url = 'index.php?module=admin';
143
-			}
144
-			else
142
+			} else
145 143
 			{
146 144
 				$args->url = '#';
147 145
 			}
@@ -449,8 +447,7 @@  discard block
 block discarded – undo
449 447
 							if($parentMenu[$menuItem->parent_srl] == 'extensions')
450 448
 							{
451 449
 								$newParentItem = $newAdminParentMenuList['advanced'];
452
-							}
453
-							else
450
+							} else
454 451
 							{
455 452
 								$newParentItem = $newAdminParentMenuList[$parentMenu[$menuItem->parent_srl]];
456 453
 							}
Please login to merge, or discard this patch.
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -37,9 +37,9 @@  discard block
 block discarded – undo
37 37
 		$oModuleModel = getModel('module');
38 38
 		$oModuleController = getController('module');
39 39
 		$version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated'));
40
-		if($oModuleModel->needUpdate($version_update_id))
40
+		if ($oModuleModel->needUpdate($version_update_id))
41 41
 		{
42
-			if(!$oDB->isColumnExists("admin_favorite", "type"))
42
+			if (!$oDB->isColumnExists("admin_favorite", "type"))
43 43
 			{
44 44
 				return TRUE;
45 45
 			}
@@ -60,9 +60,9 @@  discard block
 block discarded – undo
60 60
 		$oModuleModel = getModel('module');
61 61
 		$oModuleController = getController('module');
62 62
 		$version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated'));
63
-		if($oModuleModel->needUpdate($version_update_id))
63
+		if ($oModuleModel->needUpdate($version_update_id))
64 64
 		{
65
-			if(!$oDB->isColumnExists("admin_favorite", "type"))
65
+			if (!$oDB->isColumnExists("admin_favorite", "type"))
66 66
 			{
67 67
 				$oAdminAdminModel = getAdminModel('admin');
68 68
 				$output = $oAdminAdminModel->getFavoriteList();
@@ -71,11 +71,11 @@  discard block
 block discarded – undo
71 71
 				$oDB->dropColumn('admin_favorite', 'admin_favorite_srl');
72 72
 				$oDB->addColumn('admin_favorite', "admin_favorite_srl", "number", 11, 0);
73 73
 				$oDB->addColumn('admin_favorite', "type", "varchar", 30, 'module');
74
-				if(is_array($favoriteList))
74
+				if (is_array($favoriteList))
75 75
 				{
76 76
 					$oAdminAdminController = getAdminController('admin');
77 77
 					$oAdminAdminController->_deleteAllFavorite();
78
-					foreach($favoriteList AS $key => $value)
78
+					foreach ($favoriteList AS $key => $value)
79 79
 					{
80 80
 						$oAdminAdminController->_insertFavorite($value->site_srl, $value->module);
81 81
 					}
@@ -99,19 +99,19 @@  discard block
 block discarded – undo
99 99
 	public function checkAdminMenu()
100 100
 	{
101 101
 		// for admin menu
102
-		if(Context::isInstalled())
102
+		if (Context::isInstalled())
103 103
 		{
104 104
 			$oMenuAdminModel = getAdminModel('menu');
105 105
 			$output = $oMenuAdminModel->getMenuByTitle($this->adminMenuName);
106 106
 
107
-			if(!$output->menu_srl)
107
+			if (!$output->menu_srl)
108 108
 			{
109 109
 				$this->createXeAdminMenu();
110 110
 				$output = $oMenuAdminModel->getMenuByTitle($this->adminMenuName);
111 111
 			}
112 112
 			else
113 113
 			{
114
-				if(!is_readable(FileHandler::getRealPath($output->php_file)))
114
+				if (!is_readable(FileHandler::getRealPath($output->php_file)))
115 115
 				{
116 116
 					$oMenuAdminController = getAdminController('menu');
117 117
 					$oMenuAdminController->makeXmlFile($output->menu_srl);
@@ -146,14 +146,14 @@  discard block
 block discarded – undo
146 146
 
147 147
 		// gnb item create
148 148
 		$gnbList = array('dashboard', 'menu', 'user', 'content', 'configuration', 'advanced');
149
-		foreach($gnbList AS $key => $value)
149
+		foreach ($gnbList AS $key => $value)
150 150
 		{
151 151
 			//insert menu item
152 152
 			$args = new stdClass();
153 153
 			$args->menu_srl = $menuSrl;
154 154
 			$args->menu_item_srl = getNextSequence();
155
-			$args->name = '{$lang->menu_gnb[\'' . $value . '\']}';
156
-			if($value == 'dashboard')
155
+			$args->name = '{$lang->menu_gnb[\''.$value.'\']}';
156
+			if ($value == 'dashboard')
157 157
 			{
158 158
 				$args->url = 'index.php?module=admin';
159 159
 			}
@@ -168,9 +168,9 @@  discard block
 block discarded – undo
168 168
 		$oMenuAdminModel = getAdminModel('menu');
169 169
 		$columnList = array('menu_item_srl', 'name');
170 170
 		$output = $oMenuAdminModel->getMenuItems($menuSrl, 0, $columnList);
171
-		if(is_array($output->data))
171
+		if (is_array($output->data))
172 172
 		{
173
-			foreach($output->data AS $key => $value)
173
+			foreach ($output->data AS $key => $value)
174 174
 			{
175 175
 				preg_match('/\{\$lang->menu_gnb\[(.*?)\]\}/i', $value->name, $m);
176 176
 				$gnbDBList[$m[1]] = $value->menu_item_srl;
@@ -281,20 +281,20 @@  discard block
 block discarded – undo
281 281
 		$args->group_srls = $adminGroupSrl;
282 282
 		$oModuleModel = getModel('module');
283 283
 
284
-		foreach($gnbModuleList AS $key => $value)
284
+		foreach ($gnbModuleList AS $key => $value)
285 285
 		{
286
-			if(is_array($value['subMenu']))
286
+			if (is_array($value['subMenu']))
287 287
 			{
288 288
 				$moduleActionInfo = $oModuleModel->getModuleActionXml($value['module']);
289
-				foreach($value['subMenu'] AS $key2 => $value2)
289
+				foreach ($value['subMenu'] AS $key2 => $value2)
290 290
 				{
291
-					$gnbKey = "'" . $this->_getGnbKey($value2) . "'";
291
+					$gnbKey = "'".$this->_getGnbKey($value2)."'";
292 292
 
293 293
 					//insert menu item
294 294
 					$args->menu_item_srl = getNextSequence();
295 295
 					$args->parent_srl = $gnbDBList[$gnbKey];
296
-					$args->name = '{$lang->menu_gnb_sub[\'' . $value2 . '\']}';
297
-					$args->url = 'index.php?module=admin&act=' . $moduleActionInfo->menu->{$value2}->index;
296
+					$args->name = '{$lang->menu_gnb_sub[\''.$value2.'\']}';
297
+					$args->url = 'index.php?module=admin&act='.$moduleActionInfo->menu->{$value2}->index;
298 298
 					$args->listorder = -1 * $args->menu_item_srl;
299 299
 					$output = executeQuery('menu.insertMenuItem', $args);
300 300
 				}
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
 	 */
316 316
 	function _getGnbKey($menuName)
317 317
 	{
318
-		switch($menuName)
318
+		switch ($menuName)
319 319
 		{
320 320
 			case 'siteMap':
321 321
 			case 'siteDesign':
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
 	 */
365 365
 	function _getOldGnbKey($menuName)
366 366
 	{
367
-		switch($menuName)
367
+		switch ($menuName)
368 368
 		{
369 369
 			case 'siteMap':
370 370
 				return 'menu';
@@ -414,9 +414,9 @@  discard block
 block discarded – undo
414 414
 		$newAdminmenuSrl = $output->menu_srl;
415 415
 		$output = $oMenuAdminModel->getMenuItems($newAdminmenuSrl, 0);
416 416
 		$newAdminParentMenuList = array();
417
-		if(is_array($output->data))
417
+		if (is_array($output->data))
418 418
 		{
419
-			foreach($output->data AS $key => $value)
419
+			foreach ($output->data AS $key => $value)
420 420
 			{
421 421
 				$tmp = explode('\'', $value->name);
422 422
 				$newAdminParentMenuList[$tmp[1]] = $value;
@@ -429,15 +429,15 @@  discard block
 block discarded – undo
429 429
 		$menuSrl = $output->menu_srl;
430 430
 
431 431
 		$oMenuAdminController = getAdminController('menu');
432
-		if($menuSrl)
432
+		if ($menuSrl)
433 433
 		{
434 434
 			$output = $oMenuAdminModel->getMenuItems($menuSrl);
435
-			if(is_array($output->data))
435
+			if (is_array($output->data))
436 436
 			{
437 437
 				$parentMenu = array();
438
-				foreach($output->data AS $key => $menuItem)
438
+				foreach ($output->data AS $key => $menuItem)
439 439
 				{
440
-					if($menuItem->parent_srl == 0)
440
+					if ($menuItem->parent_srl == 0)
441 441
 					{
442 442
 						$tmp = explode('\'', $menuItem->name);
443 443
 						$parentMenuKey = $tmp[1];
@@ -446,15 +446,15 @@  discard block
 block discarded – undo
446 446
 				}
447 447
 
448 448
 				$isUserAddedMenuMoved = FALSE;
449
-				foreach($output->data AS $key => $menuItem)
449
+				foreach ($output->data AS $key => $menuItem)
450 450
 				{
451
-					if($menuItem->parent_srl != 0)
451
+					if ($menuItem->parent_srl != 0)
452 452
 					{
453 453
 						$tmp = explode('\'', $menuItem->name);
454 454
 						$menuKey = $tmp[1];
455 455
 
456 456
 						$result = $this->_getOldGnbKey($menuKey);
457
-						if($result == 'user_added_menu')
457
+						if ($result == 'user_added_menu')
458 458
 						{
459 459
 							// theme menu use not anymore
460 460
 							/* if($parentMenu[$menuItem->parent_srl] == 'theme')
@@ -462,7 +462,7 @@  discard block
 block discarded – undo
462 462
 							  $newParentItem = $newAdminParentMenuList['menu'];
463 463
 							  }
464 464
 							  else */
465
-							if($parentMenu[$menuItem->parent_srl] == 'extensions')
465
+							if ($parentMenu[$menuItem->parent_srl] == 'extensions')
466 466
 							{
467 467
 								$newParentItem = $newAdminParentMenuList['advanced'];
468 468
 							}
@@ -479,7 +479,7 @@  discard block
 block discarded – undo
479 479
 					}
480 480
 				}
481 481
 
482
-				if($isUserAddedMenuMoved)
482
+				if ($isUserAddedMenuMoved)
483 483
 				{
484 484
 					$oMenuAdminController->makeXmlFile($newAdminmenuSrl);
485 485
 				}
@@ -488,9 +488,9 @@  discard block
 block discarded – undo
488 488
 
489 489
 		// all old admin menu delete
490 490
 		$output = $oMenuAdminModel->getMenuListByTitle('__XE_ADMIN__');
491
-		if(is_array($output))
491
+		if (is_array($output))
492 492
 		{
493
-			foreach($output AS $key=>$value)
493
+			foreach ($output AS $key=>$value)
494 494
 			{
495 495
 				$oMenuAdminController->deleteMenu($value->menu_srl);
496 496
 			}
Please login to merge, or discard this patch.
modules/autoinstall/autoinstall.lib.php 2 patches
Braces   +6 added lines, -12 removed lines patch added patch discarded remove patch
@@ -121,8 +121,7 @@  discard block
 block discarded – undo
121 121
 			$this->download_file = $this->temp_dir . "xe.tar";
122 122
 			$this->target_path = "";
123 123
 			$this->download_path = $this->temp_dir;
124
-		}
125
-		else
124
+		} else
126 125
 		{
127 126
 			$subpath = trim(substr($this->package->path, 2), '/');
128 127
 			$this->download_file = $this->temp_dir . $subpath . ".tar";
@@ -297,8 +296,7 @@  discard block
 block discarded – undo
297 296
 				{
298 297
 					return $output;
299 298
 				}
300
-			}
301
-			else
299
+			} else
302 300
 			{
303 301
 				$output = $this->_removeFile($file_path);
304 302
 				if(!$output->toBool())
@@ -370,8 +368,7 @@  discard block
 block discarded – undo
370 368
 		if($this->ftp_info->ftp_host)
371 369
 		{
372 370
 			$ftp_host = $this->ftp_info->ftp_host;
373
-		}
374
-		else
371
+		} else
375 372
 		{
376 373
 			$ftp_host = "127.0.0.1";
377 374
 		}
@@ -523,8 +520,7 @@  discard block
 block discarded – undo
523 520
 		if($this->ftp_info->ftp_host)
524 521
 		{
525 522
 			$ftp_host = $this->ftp_info->ftp_host;
526
-		}
527
-		else
523
+		} else
528 524
 		{
529 525
 			$ftp_host = "127.0.0.1";
530 526
 		}
@@ -673,8 +669,7 @@  discard block
 block discarded – undo
673 669
 								{
674 670
 									return new Object(-1, "msg_permission_adjust_failed");
675 671
 								}
676
-							}
677
-							else
672
+							} else
678 673
 							{
679 674
 								if(!ftp_site($this->connection, "CHMOD 755 " . $ftp_path))
680 675
 								{
@@ -736,8 +731,7 @@  discard block
 block discarded – undo
736 731
 		if($this->ftp_info->ftp_host)
737 732
 		{
738 733
 			$ftp_host = $this->ftp_info->ftp_host;
739
-		}
740
-		else
734
+		} else
741 735
 		{
742 736
 			$ftp_host = "127.0.0.1";
743 737
 		}
Please login to merge, or discard this patch.
Spacing   +122 added lines, -122 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_ . 'libs/ftp.class.php');
4
+require_once(_XE_PATH_.'libs/ftp.class.php');
5 5
 
6 6
 /**
7 7
  * Module installer
@@ -78,17 +78,17 @@  discard block
 block discarded – undo
78 78
 	{
79 79
 		$oModel = getModel('autoinstall');
80 80
 		$type = $oModel->getTypeFromPath($this->package->path);
81
-		if($type == "module")
81
+		if ($type == "module")
82 82
 		{
83 83
 			$output = $this->uninstallModule();
84
-			if(!$output->toBool())
84
+			if (!$output->toBool())
85 85
 			{
86 86
 				return $output;
87 87
 			}
88 88
 		}
89 89
 
90 90
 		$output = $this->_connect();
91
-		if(!$output->toBool())
91
+		if (!$output->toBool())
92 92
 		{
93 93
 			return $output;
94 94
 		}
@@ -116,19 +116,19 @@  discard block
 block discarded – undo
116 116
 	 */
117 117
 	function _download()
118 118
 	{
119
-		if($this->package->path == ".")
119
+		if ($this->package->path == ".")
120 120
 		{
121
-			$this->download_file = $this->temp_dir . "xe.tar";
121
+			$this->download_file = $this->temp_dir."xe.tar";
122 122
 			$this->target_path = "";
123 123
 			$this->download_path = $this->temp_dir;
124 124
 		}
125 125
 		else
126 126
 		{
127 127
 			$subpath = trim(substr($this->package->path, 2), '/');
128
-			$this->download_file = $this->temp_dir . $subpath . ".tar";
128
+			$this->download_file = $this->temp_dir.$subpath.".tar";
129 129
 			$subpatharr = explode("/", $subpath);
130 130
 			array_pop($subpatharr);
131
-			$this->download_path = $this->temp_dir . implode("/", $subpatharr);
131
+			$this->download_path = $this->temp_dir.implode("/", $subpatharr);
132 132
 			$this->target_path = implode("/", $subpatharr);
133 133
 		}
134 134
 
@@ -152,17 +152,17 @@  discard block
 block discarded – undo
152 152
 		$path_array = explode("/", $this->package->path);
153 153
 		$target_name = array_pop($path_array);
154 154
 		$oModule = getModule($target_name, "class");
155
-		if(!$oModule)
155
+		if (!$oModule)
156 156
 		{
157 157
 			return new Object(-1, 'msg_invalid_request');
158 158
 		}
159
-		if(!method_exists($oModule, "moduleUninstall"))
159
+		if (!method_exists($oModule, "moduleUninstall"))
160 160
 		{
161 161
 			return new Object(-1, 'msg_invalid_request');
162 162
 		}
163 163
 
164 164
 		$output = $oModule->moduleUninstall();
165
-		if(is_subclass_of($output, 'Object') && !$output->toBool())
165
+		if (is_subclass_of($output, 'Object') && !$output->toBool())
166 166
 		{
167 167
 			return $output;
168 168
 		}
@@ -170,9 +170,9 @@  discard block
 block discarded – undo
170 170
 		$schema_dir = sprintf('%s/schemas/', $this->package->path);
171 171
 		$schema_files = FileHandler::readDir($schema_dir);
172 172
 		$oDB = DB::getInstance();
173
-		if(is_array($schema_files))
173
+		if (is_array($schema_files))
174 174
 		{
175
-			foreach($schema_files as $file)
175
+			foreach ($schema_files as $file)
176 176
 			{
177 177
 				$filename_arr = explode(".", $file);
178 178
 				$filename = array_shift($filename_arr);
@@ -192,26 +192,26 @@  discard block
 block discarded – undo
192 192
 	function installModule()
193 193
 	{
194 194
 		$path = $this->package->path;
195
-		if($path != ".")
195
+		if ($path != ".")
196 196
 		{
197 197
 			$path_array = explode("/", $path);
198 198
 			$target_name = array_pop($path_array);
199 199
 			$type = substr(array_pop($path_array), 0, -1);
200 200
 		}
201 201
 
202
-		if($type == "module")
202
+		if ($type == "module")
203 203
 		{
204 204
 			$oModuleModel = getModel('module');
205 205
 			$oInstallController = getController('install');
206 206
 			$module_path = ModuleHandler::getModulePath($target_name);
207
-			if($oModuleModel->checkNeedInstall($target_name))
207
+			if ($oModuleModel->checkNeedInstall($target_name))
208 208
 			{
209 209
 				$oInstallController->installModule($target_name, $module_path);
210 210
 			}
211
-			if($oModuleModel->checkNeedUpdate($target_name))
211
+			if ($oModuleModel->checkNeedUpdate($target_name))
212 212
 			{
213 213
 				$oModule = getModule($target_name, 'class');
214
-				if(method_exists($oModule, 'moduleUpdate'))
214
+				if (method_exists($oModule, 'moduleUpdate'))
215 215
 				{
216 216
 					$oModule->moduleUpdate();
217 217
 				}
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 		$this->_download();
232 232
 		$file_list = $this->_unPack();
233 233
 		$output = $this->_copyDir($file_list);
234
-		if(!$output->toBool())
234
+		if (!$output->toBool())
235 235
 		{
236 236
 			FileHandler::removeDir($this->temp_dir);
237 237
 			return $output;
@@ -249,18 +249,18 @@  discard block
 block discarded – undo
249 249
 	 */
250 250
 	function _unPack()
251 251
 	{
252
-		require_once(_XE_PATH_ . 'libs/tar.class.php');
252
+		require_once(_XE_PATH_.'libs/tar.class.php');
253 253
 
254 254
 		$oTar = new tar();
255 255
 		$oTar->openTAR($this->download_file);
256 256
 
257 257
 		$_files = $oTar->files;
258 258
 		$file_list = array();
259
-		if(is_array($_files))
259
+		if (is_array($_files))
260 260
 		{
261
-			foreach($_files as $key => $info)
261
+			foreach ($_files as $key => $info)
262 262
 			{
263
-				FileHandler::writeFile($this->download_path . "/" . $info['name'], $info['file']);
263
+				FileHandler::writeFile($this->download_path."/".$info['name'], $info['file']);
264 264
 				$file_list[] = $info['name'];
265 265
 			}
266 266
 		}
@@ -278,22 +278,22 @@  discard block
 block discarded – undo
278 278
 		$real_path = FileHandler::getRealPath($path);
279 279
 		$oDir = dir($path);
280 280
 		$files = array();
281
-		while($file = $oDir->read())
281
+		while ($file = $oDir->read())
282 282
 		{
283
-			if($file == "." || $file == "..")
283
+			if ($file == "." || $file == "..")
284 284
 			{
285 285
 				continue;
286 286
 			}
287 287
 			$files[] = $file;
288 288
 		}
289 289
 
290
-		foreach($files as $file)
290
+		foreach ($files as $file)
291 291
 		{
292
-			$file_path = $path . "/" . $file;
293
-			if(is_dir(FileHandler::getRealPath($file_path)))
292
+			$file_path = $path."/".$file;
293
+			if (is_dir(FileHandler::getRealPath($file_path)))
294 294
 			{
295 295
 				$output = $this->_removeDir($file_path);
296
-				if(!$output->toBool())
296
+				if (!$output->toBool())
297 297
 				{
298 298
 					return $output;
299 299
 				}
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 			else
302 302
 			{
303 303
 				$output = $this->_removeFile($file_path);
304
-				if(!$output->toBool())
304
+				if (!$output->toBool())
305 305
 				{
306 306
 					return $output;
307 307
 				}
@@ -357,17 +357,17 @@  discard block
 block discarded – undo
357 357
 	 */
358 358
 	function _connect()
359 359
 	{
360
-		if(!function_exists('ssh2_connect'))
360
+		if (!function_exists('ssh2_connect'))
361 361
 		{
362 362
 			return new Object(-1, 'msg_sftp_not_supported');
363 363
 		}
364 364
 
365
-		if(!$this->ftp_info->ftp_user || !$this->ftp_info->sftp || $this->ftp_info->sftp != 'Y')
365
+		if (!$this->ftp_info->ftp_user || !$this->ftp_info->sftp || $this->ftp_info->sftp != 'Y')
366 366
 		{
367 367
 			return new Object(-1, 'msg_ftp_invalid_auth_info');
368 368
 		}
369 369
 
370
-		if($this->ftp_info->ftp_host)
370
+		if ($this->ftp_info->ftp_host)
371 371
 		{
372 372
 			$ftp_host = $this->ftp_info->ftp_host;
373 373
 		}
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
 			$ftp_host = "127.0.0.1";
377 377
 		}
378 378
 		$this->connection = ssh2_connect($ftp_host, $this->ftp_info->ftp_port);
379
-		if(!@ssh2_auth_password($this->connection, $this->ftp_info->ftp_user, $this->ftp_password))
379
+		if (!@ssh2_auth_password($this->connection, $this->ftp_info->ftp_user, $this->ftp_password))
380 380
 		{
381 381
 			return new Object(-1, 'msg_ftp_invalid_auth_info');
382 382
 		}
@@ -403,13 +403,13 @@  discard block
 block discarded – undo
403 403
 	 */
404 404
 	function _removeFile($path)
405 405
 	{
406
-		if(substr($path, 0, 2) == "./")
406
+		if (substr($path, 0, 2) == "./")
407 407
 		{
408 408
 			$path = substr($path, 2);
409 409
 		}
410
-		$target_path = $this->ftp_info->ftp_root_path . $path;
410
+		$target_path = $this->ftp_info->ftp_root_path.$path;
411 411
 
412
-		if(!@ssh2_sftp_unlink($this->sftp, $target_path))
412
+		if (!@ssh2_sftp_unlink($this->sftp, $target_path))
413 413
 		{
414 414
 			return new Object(-1, sprintf(Context::getLang('msg_delete_file_failed'), $path));
415 415
 		}
@@ -424,13 +424,13 @@  discard block
 block discarded – undo
424 424
 	 */
425 425
 	function _removeDir_real($path)
426 426
 	{
427
-		if(substr($path, 0, 2) == "./")
427
+		if (substr($path, 0, 2) == "./")
428 428
 		{
429 429
 			$path = substr($path, 2);
430 430
 		}
431
-		$target_path = $this->ftp_info->ftp_root_path . $path;
431
+		$target_path = $this->ftp_info->ftp_root_path.$path;
432 432
 
433
-		if(!@ssh2_sftp_rmdir($this->sftp, $target_path))
433
+		if (!@ssh2_sftp_rmdir($this->sftp, $target_path))
434 434
 		{
435 435
 			return new Object(-1, sprintf(Context::getLang('msg_delete_dir_failed'), $path));
436 436
 		}
@@ -445,36 +445,36 @@  discard block
 block discarded – undo
445 445
 	 */
446 446
 	function _copyDir(&$file_list)
447 447
 	{
448
-		if(!$this->ftp_password)
448
+		if (!$this->ftp_password)
449 449
 		{
450 450
 			return new Object(-1, 'msg_ftp_password_input');
451 451
 		}
452 452
 
453 453
 		$output = $this->_connect();
454
-		if(!$output->toBool())
454
+		if (!$output->toBool())
455 455
 		{
456 456
 			return $output;
457 457
 		}
458
-		$target_dir = $this->ftp_info->ftp_root_path . $this->target_path;
458
+		$target_dir = $this->ftp_info->ftp_root_path.$this->target_path;
459 459
 
460
-		if(is_array($file_list))
460
+		if (is_array($file_list))
461 461
 		{
462
-			foreach($file_list as $k => $file)
462
+			foreach ($file_list as $k => $file)
463 463
 			{
464 464
 				$org_file = $file;
465
-				if($this->package->path == ".")
465
+				if ($this->package->path == ".")
466 466
 				{
467 467
 					$file = substr($file, 3);
468 468
 				}
469
-				$path = FileHandler::getRealPath("./" . $this->target_path . "/" . $file);
470
-				$pathname = dirname($target_dir . "/" . $file);
469
+				$path = FileHandler::getRealPath("./".$this->target_path."/".$file);
470
+				$pathname = dirname($target_dir."/".$file);
471 471
 
472
-				if(!file_exists(FileHandler::getRealPath($real_path)))
472
+				if (!file_exists(FileHandler::getRealPath($real_path)))
473 473
 				{
474 474
 					ssh2_sftp_mkdir($this->sftp, $pathname, 0755, TRUE);
475 475
 				}
476 476
 
477
-				ssh2_scp_send($this->connection, FileHandler::getRealPath($this->download_path . "/" . $org_file), $target_dir . "/" . $file);
477
+				ssh2_scp_send($this->connection, FileHandler::getRealPath($this->download_path."/".$org_file), $target_dir."/".$file);
478 478
 			}
479 479
 		}
480 480
 		return new Object();
@@ -520,7 +520,7 @@  discard block
 block discarded – undo
520 520
 	 */
521 521
 	function _connect()
522 522
 	{
523
-		if($this->ftp_info->ftp_host)
523
+		if ($this->ftp_info->ftp_host)
524 524
 		{
525 525
 			$ftp_host = $this->ftp_info->ftp_host;
526 526
 		}
@@ -530,20 +530,20 @@  discard block
 block discarded – undo
530 530
 		}
531 531
 
532 532
 		$this->connection = ftp_connect($ftp_host, $this->ftp_info->ftp_port);
533
-		if(!$this->connection)
533
+		if (!$this->connection)
534 534
 		{
535 535
 			return new Object(-1, sprintf(Context::getLang('msg_ftp_not_connected'), 'host'));
536 536
 		}
537 537
 
538 538
 		$login_result = @ftp_login($this->connection, $this->ftp_info->ftp_user, $this->ftp_password);
539
-		if(!$login_result)
539
+		if (!$login_result)
540 540
 		{
541 541
 			$this->_close();
542 542
 			return new Object(-1, 'msg_ftp_invalid_auth_info');
543 543
 		}
544 544
 
545 545
 		$_SESSION['ftp_password'] = $this->ftp_password;
546
-		if($this->ftp_info->ftp_pasv != "N")
546
+		if ($this->ftp_info->ftp_pasv != "N")
547 547
 		{
548 548
 			ftp_pasv($this->connection, TRUE);
549 549
 		}
@@ -558,15 +558,15 @@  discard block
 block discarded – undo
558 558
 	 */
559 559
 	function _removeFile($path)
560 560
 	{
561
-		if(substr($path, 0, 2) == "./")
561
+		if (substr($path, 0, 2) == "./")
562 562
 		{
563 563
 			$path = substr($path, 2);
564 564
 		}
565
-		$target_path = $this->ftp_info->ftp_root_path . $path;
565
+		$target_path = $this->ftp_info->ftp_root_path.$path;
566 566
 
567
-		if(!@ftp_delete($this->connection, $target_path))
567
+		if (!@ftp_delete($this->connection, $target_path))
568 568
 		{
569
-			return new Object(-1, "failed to delete file " . $path);
569
+			return new Object(-1, "failed to delete file ".$path);
570 570
 		}
571 571
 		return new Object();
572 572
 	}
@@ -579,15 +579,15 @@  discard block
 block discarded – undo
579 579
 	 */
580 580
 	function _removeDir_real($path)
581 581
 	{
582
-		if(substr($path, 0, 2) == "./")
582
+		if (substr($path, 0, 2) == "./")
583 583
 		{
584 584
 			$path = substr($path, 2);
585 585
 		}
586
-		$target_path = $this->ftp_info->ftp_root_path . $path;
586
+		$target_path = $this->ftp_info->ftp_root_path.$path;
587 587
 
588
-		if(!@ftp_rmdir($this->connection, $target_path))
588
+		if (!@ftp_rmdir($this->connection, $target_path))
589 589
 		{
590
-			return new Object(-1, "failed to delete directory " . $path);
590
+			return new Object(-1, "failed to delete directory ".$path);
591 591
 		}
592 592
 		return new Object();
593 593
 	}
@@ -610,73 +610,73 @@  discard block
 block discarded – undo
610 610
 	 */
611 611
 	function _copyDir(&$file_list)
612 612
 	{
613
-		if(!$this->ftp_password)
613
+		if (!$this->ftp_password)
614 614
 		{
615 615
 			return new Object(-1, 'msg_ftp_password_input');
616 616
 		}
617 617
 
618 618
 		$output = $this->_connect();
619
-		if(!$output->toBool())
619
+		if (!$output->toBool())
620 620
 		{
621 621
 			return $output;
622 622
 		}
623 623
 
624
-		if(!$this->target_path)
624
+		if (!$this->target_path)
625 625
 		{
626 626
 			$this->target_path = '.';
627 627
 		}
628
-		if(substr($this->download_path, -1) == '/')
628
+		if (substr($this->download_path, -1) == '/')
629 629
 		{
630 630
 			$this->download_path = substr($this->download_path, 0, -1);
631 631
 		}
632
-		$target_dir = $this->ftp_info->ftp_root_path . $this->target_path;
632
+		$target_dir = $this->ftp_info->ftp_root_path.$this->target_path;
633 633
 
634
-		if(is_array($file_list))
634
+		if (is_array($file_list))
635 635
 		{
636
-			foreach($file_list as $k => $file)
636
+			foreach ($file_list as $k => $file)
637 637
 			{
638
-				if(!$file)
638
+				if (!$file)
639 639
 				{
640 640
 					continue;
641 641
 				}
642 642
 				$org_file = $file;
643
-				if($this->package->path == ".")
643
+				if ($this->package->path == ".")
644 644
 				{
645 645
 					$file = substr($file, 3);
646 646
 				}
647
-				$path = FileHandler::getRealPath("./" . $this->target_path . "/" . $file);
648
-				$path_list = explode('/', dirname($this->target_path . "/" . $file));
647
+				$path = FileHandler::getRealPath("./".$this->target_path."/".$file);
648
+				$path_list = explode('/', dirname($this->target_path."/".$file));
649 649
 
650 650
 				$real_path = "./";
651 651
 				$ftp_path = $this->ftp_info->ftp_root_path;
652 652
 
653
-				for($i = 0; $i < count($path_list); $i++)
653
+				for ($i = 0; $i < count($path_list); $i++)
654 654
 				{
655
-					if($path_list == "")
655
+					if ($path_list == "")
656 656
 					{
657 657
 						continue;
658 658
 					}
659
-					$real_path .= $path_list[$i] . "/";
660
-					$ftp_path .= $path_list[$i] . "/";
661
-					if(!file_exists(FileHandler::getRealPath($real_path)))
659
+					$real_path .= $path_list[$i]."/";
660
+					$ftp_path .= $path_list[$i]."/";
661
+					if (!file_exists(FileHandler::getRealPath($real_path)))
662 662
 					{
663
-						if(!@ftp_mkdir($this->connection, $ftp_path))
663
+						if (!@ftp_mkdir($this->connection, $ftp_path))
664 664
 						{
665 665
 							return new Object(-1, "msg_make_directory_failed");
666 666
 						}
667 667
 
668
-						if(strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN')
668
+						if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN')
669 669
 						{
670
-							if(function_exists('ftp_chmod'))
670
+							if (function_exists('ftp_chmod'))
671 671
 							{
672
-								if(!ftp_chmod($this->connection, 0755, $ftp_path))
672
+								if (!ftp_chmod($this->connection, 0755, $ftp_path))
673 673
 								{
674 674
 									return new Object(-1, "msg_permission_adjust_failed");
675 675
 								}
676 676
 							}
677 677
 							else
678 678
 							{
679
-								if(!ftp_site($this->connection, "CHMOD 755 " . $ftp_path))
679
+								if (!ftp_site($this->connection, "CHMOD 755 ".$ftp_path))
680 680
 								{
681 681
 									return new Object(-1, "msg_permission_adjust_failed");
682 682
 								}
@@ -684,7 +684,7 @@  discard block
 block discarded – undo
684 684
 						}
685 685
 					}
686 686
 				}
687
-				if(!ftp_put($this->connection, $target_dir . '/' . $file, FileHandler::getRealPath($this->download_path . "/" . $org_file), FTP_BINARY))
687
+				if (!ftp_put($this->connection, $target_dir.'/'.$file, FileHandler::getRealPath($this->download_path."/".$org_file), FTP_BINARY))
688 688
 				{
689 689
 					return new Object(-1, "msg_ftp_upload_failed");
690 690
 				}
@@ -733,7 +733,7 @@  discard block
 block discarded – undo
733 733
 	 */
734 734
 	function _connect()
735 735
 	{
736
-		if($this->ftp_info->ftp_host)
736
+		if ($this->ftp_info->ftp_host)
737 737
 		{
738 738
 			$ftp_host = $this->ftp_info->ftp_host;
739 739
 		}
@@ -743,11 +743,11 @@  discard block
 block discarded – undo
743 743
 		}
744 744
 
745 745
 		$this->oFtp = new ftp();
746
-		if(!$this->oFtp->ftp_connect($ftp_host, $this->ftp_info->ftp_port))
746
+		if (!$this->oFtp->ftp_connect($ftp_host, $this->ftp_info->ftp_port))
747 747
 		{
748 748
 			return new Object(-1, sprintf(Context::getLang('msg_ftp_not_connected'), 'host'));
749 749
 		}
750
-		if(!$this->oFtp->ftp_login($this->ftp_info->ftp_user, $this->ftp_password))
750
+		if (!$this->oFtp->ftp_login($this->ftp_info->ftp_user, $this->ftp_password))
751 751
 		{
752 752
 			$this->_close();
753 753
 			return new Object(-1, 'msg_ftp_invalid_auth_info');
@@ -764,13 +764,13 @@  discard block
 block discarded – undo
764 764
 	 */
765 765
 	function _removeFile($path)
766 766
 	{
767
-		if(substr($path, 0, 2) == "./")
767
+		if (substr($path, 0, 2) == "./")
768 768
 		{
769 769
 			$path = substr($path, 2);
770 770
 		}
771
-		$target_path = $this->ftp_info->ftp_root_path . $path;
771
+		$target_path = $this->ftp_info->ftp_root_path.$path;
772 772
 
773
-		if(!$this->oFtp->ftp_delete($target_path))
773
+		if (!$this->oFtp->ftp_delete($target_path))
774 774
 		{
775 775
 			return new Object(-1, sprintf(Context::getLang('msg_delete_file_failed'), $path));
776 776
 		}
@@ -784,13 +784,13 @@  discard block
 block discarded – undo
784 784
 	 */
785 785
 	function _removeDir_real($path)
786 786
 	{
787
-		if(substr($path, 0, 2) == "./")
787
+		if (substr($path, 0, 2) == "./")
788 788
 		{
789 789
 			$path = substr($path, 2);
790 790
 		}
791
-		$target_path = $this->ftp_info->ftp_root_path . $path;
791
+		$target_path = $this->ftp_info->ftp_root_path.$path;
792 792
 
793
-		if(!$this->oFtp->ftp_rmdir($target_path))
793
+		if (!$this->oFtp->ftp_rmdir($target_path))
794 794
 		{
795 795
 			return new Object(-1, sprintf(Context::getLang('msg_delete_dir_failed'), $path));
796 796
 		}
@@ -815,50 +815,50 @@  discard block
 block discarded – undo
815 815
 	 */
816 816
 	function _copyDir(&$file_list)
817 817
 	{
818
-		if(!$this->ftp_password)
818
+		if (!$this->ftp_password)
819 819
 		{
820 820
 			return new Object(-1, 'msg_ftp_password_input');
821 821
 		}
822 822
 
823 823
 		$output = $this->_connect();
824
-		if(!$output->toBool())
824
+		if (!$output->toBool())
825 825
 		{
826 826
 			return $output;
827 827
 		}
828 828
 
829 829
 		$oFtp = &$this->oFtp;
830
-		$target_dir = $this->ftp_info->ftp_root_path . $this->target_path;
830
+		$target_dir = $this->ftp_info->ftp_root_path.$this->target_path;
831 831
 
832
-		if(is_array($file_list))
832
+		if (is_array($file_list))
833 833
 		{
834
-			foreach($file_list as $k => $file)
834
+			foreach ($file_list as $k => $file)
835 835
 			{
836 836
 				$org_file = $file;
837
-				if($this->package->path == ".")
837
+				if ($this->package->path == ".")
838 838
 				{
839 839
 					$file = substr($file, 3);
840 840
 				}
841
-				$path = FileHandler::getRealPath("./" . $this->target_path . "/" . $file);
842
-				$path_list = explode('/', dirname($this->target_path . "/" . $file));
841
+				$path = FileHandler::getRealPath("./".$this->target_path."/".$file);
842
+				$path_list = explode('/', dirname($this->target_path."/".$file));
843 843
 
844 844
 				$real_path = "./";
845 845
 				$ftp_path = $this->ftp_info->ftp_root_path;
846 846
 
847
-				for($i = 0; $i < count($path_list); $i++)
847
+				for ($i = 0; $i < count($path_list); $i++)
848 848
 				{
849
-					if($path_list == "")
849
+					if ($path_list == "")
850 850
 					{
851 851
 						continue;
852 852
 					}
853
-					$real_path .= $path_list[$i] . "/";
854
-					$ftp_path .= $path_list[$i] . "/";
855
-					if(!file_exists(FileHandler::getRealPath($real_path)))
853
+					$real_path .= $path_list[$i]."/";
854
+					$ftp_path .= $path_list[$i]."/";
855
+					if (!file_exists(FileHandler::getRealPath($real_path)))
856 856
 					{
857 857
 						$oFtp->ftp_mkdir($ftp_path);
858
-						$oFtp->ftp_site("CHMOD 755 " . $ftp_path);
858
+						$oFtp->ftp_site("CHMOD 755 ".$ftp_path);
859 859
 					}
860 860
 				}
861
-				$oFtp->ftp_put($target_dir . '/' . $file, FileHandler::getRealPath($this->download_path . "/" . $org_file));
861
+				$oFtp->ftp_put($target_dir.'/'.$file, FileHandler::getRealPath($this->download_path."/".$org_file));
862 862
 			}
863 863
 		}
864 864
 
@@ -903,13 +903,13 @@  discard block
 block discarded – undo
903 903
 	 */
904 904
 	function _removeFile($path)
905 905
 	{
906
-		if(substr($path, 0, 2) == "./")
906
+		if (substr($path, 0, 2) == "./")
907 907
 		{
908 908
 			$path = substr($path, 2);
909 909
 		}
910 910
 		$target_path = FileHandler::getRealPath($path);
911 911
 
912
-		if(!FileHandler::removeFile($target_path))
912
+		if (!FileHandler::removeFile($target_path))
913 913
 		{
914 914
 			return new Object(-1, sprintf(Context::getLang('msg_delete_file_failed'), $path));
915 915
 		}
@@ -923,7 +923,7 @@  discard block
 block discarded – undo
923 923
 	 */
924 924
 	function _removeDir_real($path)
925 925
 	{
926
-		if(substr($path, 0, 2) == "./")
926
+		if (substr($path, 0, 2) == "./")
927 927
 		{
928 928
 			$path = substr($path, 2);
929 929
 		}
@@ -952,38 +952,38 @@  discard block
 block discarded – undo
952 952
 	function _copyDir(&$file_list)
953 953
 	{
954 954
 		$output = $this->_connect();
955
-		if(!$output->toBool())
955
+		if (!$output->toBool())
956 956
 		{
957 957
 			return $output;
958 958
 		}
959 959
 		$target_dir = $this->target_path;
960 960
 
961
-		if(is_array($file_list))
961
+		if (is_array($file_list))
962 962
 		{
963
-			foreach($file_list as $k => $file)
963
+			foreach ($file_list as $k => $file)
964 964
 			{
965 965
 				$org_file = $file;
966
-				if($this->package->path == ".")
966
+				if ($this->package->path == ".")
967 967
 				{
968 968
 					$file = substr($file, 3);
969 969
 				}
970
-				$path = FileHandler::getRealPath("./" . $this->target_path . "/" . $file);
971
-				$path_list = explode('/', dirname($this->target_path . "/" . $file));
970
+				$path = FileHandler::getRealPath("./".$this->target_path."/".$file);
971
+				$path_list = explode('/', dirname($this->target_path."/".$file));
972 972
 				$real_path = "./";
973 973
 
974
-				for($i = 0; $i < count($path_list); $i++)
974
+				for ($i = 0; $i < count($path_list); $i++)
975 975
 				{
976
-					if($path_list == "")
976
+					if ($path_list == "")
977 977
 					{
978 978
 						continue;
979 979
 					}
980
-					$real_path .= $path_list[$i] . "/";
981
-					if(!file_exists(FileHandler::getRealPath($real_path)))
980
+					$real_path .= $path_list[$i]."/";
981
+					if (!file_exists(FileHandler::getRealPath($real_path)))
982 982
 					{
983 983
 						FileHandler::makeDir($real_path);
984 984
 					}
985 985
 				}
986
-				FileHandler::copyFile( FileHandler::getRealPath($this->download_path . "/" . $org_file), FileHandler::getRealPath("./" . $target_dir . '/' . $file));
986
+				FileHandler::copyFile(FileHandler::getRealPath($this->download_path."/".$org_file), FileHandler::getRealPath("./".$target_dir.'/'.$file));
987 987
 			}
988 988
 		}
989 989
 
Please login to merge, or discard this patch.
modules/autoinstall/autoinstall.model.php 2 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -103,8 +103,7 @@  discard block
 block discarded – undo
103 103
 			if($category->parent_srl)
104 104
 			{
105 105
 				$categoryList[$category->parent_srl]->children[] = & $categoryList[$key];
106
-			}
107
-			else
106
+			} else
108 107
 			{
109 108
 				$depth0[] = $key;
110 109
 			}
@@ -324,8 +323,7 @@  discard block
 block discarded – undo
324 323
 		if(method_exists($oModule, "moduleUninstall"))
325 324
 		{
326 325
 			return TRUE;
327
-		}
328
-		else
326
+		} else
329 327
 		{
330 328
 			return FALSE;
331 329
 		}
Please login to merge, or discard this patch.
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 		$args = new stdClass();
20 20
 		$args->category_srl = $category_srl;
21 21
 		$output = executeQueryArray("autoinstall.getCategory", $args);
22
-		if(!$output->data)
22
+		if (!$output->data)
23 23
 		{
24 24
 			return null;
25 25
 		}
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 	function getPackages()
35 35
 	{
36 36
 		$output = executeQueryArray("autoinstall.getPackages");
37
-		if(!$output->data)
37
+		if (!$output->data)
38 38
 		{
39 39
 			return array();
40 40
 		}
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 		$args = new stdClass();
53 53
 		$args->package_srl = $package_srl;
54 54
 		$output = executeQueryArray("autoinstall.getInstalledPackage", $args);
55
-		if(!$output->data)
55
+		if (!$output->data)
56 56
 		{
57 57
 			return null;
58 58
 		}
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 		$args = new stdClass();
71 71
 		$args->package_srl = $package_srl;
72 72
 		$output = executeQueryArray("autoinstall.getPackage", $args);
73
-		if(!$output->data)
73
+		if (!$output->data)
74 74
 		{
75 75
 			return null;
76 76
 		}
@@ -85,22 +85,22 @@  discard block
 block discarded – undo
85 85
 	function getCategoryList()
86 86
 	{
87 87
 		$output = executeQueryArray("autoinstall.getCategories");
88
-		if(!$output->toBool() || !$output->data)
88
+		if (!$output->toBool() || !$output->data)
89 89
 		{
90 90
 			return array();
91 91
 		}
92 92
 
93 93
 		$categoryList = array();
94
-		foreach($output->data as $category)
94
+		foreach ($output->data as $category)
95 95
 		{
96 96
 			$category->children = array();
97 97
 			$categoryList[$category->category_srl] = $category;
98 98
 		}
99 99
 
100 100
 		$depth0 = array();
101
-		foreach($categoryList as $key => $category)
101
+		foreach ($categoryList as $key => $category)
102 102
 		{
103
-			if($category->parent_srl)
103
+			if ($category->parent_srl)
104 104
 			{
105 105
 				$categoryList[$category->parent_srl]->children[] = & $categoryList[$key];
106 106
 			}
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 			}
111 111
 		}
112 112
 		$resultList = array();
113
-		foreach($depth0 as $category_srl)
113
+		foreach ($depth0 as $category_srl)
114 114
 		{
115 115
 			$this->setDepth($categoryList[$category_srl], 0, $categoryList, $resultList);
116 116
 		}
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 		$args = new stdClass();
129 129
 		$args->category_srl = $category_srl;
130 130
 		$output = executeQuery("autoinstall.getPackageCount", $args);
131
-		if(!$output->data)
131
+		if (!$output->data)
132 132
 		{
133 133
 			return 0;
134 134
 		}
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 	function getInstalledPackageCount()
144 144
 	{
145 145
 		$output = executeQuery("autoinstall.getInstalledPackageCount");
146
-		if(!$output->data)
146
+		if (!$output->data)
147 147
 		{
148 148
 			return 0;
149 149
 		}
@@ -164,11 +164,11 @@  discard block
 block discarded – undo
164 164
 		$resultList[$item->category_srl] = &$item;
165 165
 		$item->depth = $depth;
166 166
 		$siblingList = $item->category_srl;
167
-		foreach($item->children as $child)
167
+		foreach ($item->children as $child)
168 168
 		{
169
-			$siblingList .= "," . $this->setDepth($list[$child->category_srl], $depth + 1, $list, $resultList);
169
+			$siblingList .= ",".$this->setDepth($list[$child->category_srl], $depth + 1, $list, $resultList);
170 170
 		}
171
-		if(count($item->children) < 1)
171
+		if (count($item->children) < 1)
172 172
 		{
173 173
 			$item->nPackages = $this->getPackageCount($item->category_srl);
174 174
 		}
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 	function getLatestPackage()
185 185
 	{
186 186
 		$output = executeQueryArray("autoinstall.getLatestPackage");
187
-		if(!$output->data)
187
+		if (!$output->data)
188 188
 		{
189 189
 			return null;
190 190
 		}
@@ -203,11 +203,11 @@  discard block
 block discarded – undo
203 203
 		$args->package_list = $package_list;
204 204
 		$output = executeQueryArray("autoinstall.getInstalledPackages", $args);
205 205
 		$result = array();
206
-		if(!$output->data)
206
+		if (!$output->data)
207 207
 		{
208 208
 			return $result;
209 209
 		}
210
-		foreach($output->data as $value)
210
+		foreach ($output->data as $value)
211 211
 		{
212 212
 			$result[$value->package_srl] = $value;
213 213
 		}
@@ -226,15 +226,15 @@  discard block
 block discarded – undo
226 226
 		$args->page = $page;
227 227
 		$args->list_count = 10;
228 228
 		$args->page_count = 5;
229
-		if(Context::getDBType() == 'mssql')
229
+		if (Context::getDBType() == 'mssql')
230 230
 		{
231 231
 			$args->sort_index = 'package_srl';
232 232
 		}
233 233
 		$output = executeQueryArray("autoinstall.getInstalledPackageList", $args);
234 234
 		$res = array();
235
-		if($output->data)
235
+		if ($output->data)
236 236
 		{
237
-			foreach($output->data as $val)
237
+			foreach ($output->data as $val)
238 238
 			{
239 239
 				$res[$val->package_srl] = $val;
240 240
 			}
@@ -251,19 +251,19 @@  discard block
 block discarded – undo
251 251
 	 */
252 252
 	function getTypeFromPath($path)
253 253
 	{
254
-		if(!$path)
254
+		if (!$path)
255 255
 		{
256 256
 			return NULL;
257 257
 		}
258 258
 
259
-		if($path == ".")
259
+		if ($path == ".")
260 260
 		{
261 261
 			return "core";
262 262
 		}
263 263
 
264 264
 		$path_array = explode("/", $path);
265 265
 		$target_name = array_pop($path_array);
266
-		if(!$target_name)
266
+		if (!$target_name)
267 267
 		{
268 268
 			$target_name = array_pop($path_array);
269 269
 		}
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 	function getConfigFilePath($type)
281 281
 	{
282 282
 		$config_file = NULL;
283
-		switch($type)
283
+		switch ($type)
284 284
 		{
285 285
 			case "m.layout":
286 286
 			case "module":
@@ -317,11 +317,11 @@  discard block
 block discarded – undo
317 317
 		$path_array = explode("/", $path);
318 318
 		$target_name = array_pop($path_array);
319 319
 		$oModule = getModule($target_name, "class");
320
-		if(!$oModule)
320
+		if (!$oModule)
321 321
 		{
322 322
 			return FALSE;
323 323
 		}
324
-		if(method_exists($oModule, "moduleUninstall"))
324
+		if (method_exists($oModule, "moduleUninstall"))
325 325
 		{
326 326
 			return TRUE;
327 327
 		}
@@ -339,17 +339,17 @@  discard block
 block discarded – undo
339 339
 	 */
340 340
 	function getPackageSrlByPath($path)
341 341
 	{
342
-		if(!$path)
342
+		if (!$path)
343 343
 		{
344 344
 			return;
345 345
 		}
346 346
 
347
-		if(substr($path, -1) == '/')
347
+		if (substr($path, -1) == '/')
348 348
 		{
349 349
 			$path = substr($path, 0, strlen($path) - 1);
350 350
 		}
351 351
 
352
-		if(!$GLOBLAS['XE_AUTOINSTALL_PACKAGE_SRL_BY_PATH'][$path])
352
+		if (!$GLOBLAS['XE_AUTOINSTALL_PACKAGE_SRL_BY_PATH'][$path])
353 353
 		{
354 354
 			$args = new stdClass();
355 355
 			$args->path = $path;
@@ -370,12 +370,12 @@  discard block
 block discarded – undo
370 370
 	function getRemoveUrlByPackageSrl($packageSrl)
371 371
 	{
372 372
 		$ftp_info = Context::getFTPInfo();
373
-		if(!$ftp_info->ftp_root_path)
373
+		if (!$ftp_info->ftp_root_path)
374 374
 		{
375 375
 			return;
376 376
 		}
377 377
 
378
-		if(!$packageSrl)
378
+		if (!$packageSrl)
379 379
 		{
380 380
 			return;
381 381
 		}
@@ -391,19 +391,19 @@  discard block
 block discarded – undo
391 391
 	 */
392 392
 	function getRemoveUrlByPath($path)
393 393
 	{
394
-		if(!$path)
394
+		if (!$path)
395 395
 		{
396 396
 			return;
397 397
 		}
398 398
 
399 399
 		$ftp_info = Context::getFTPInfo();
400
-		if(!$ftp_info->ftp_root_path)
400
+		if (!$ftp_info->ftp_root_path)
401 401
 		{
402 402
 			return;
403 403
 		}
404 404
 
405 405
 		$packageSrl = $this->getPackageSrlByPath($path);
406
-		if(!$packageSrl)
406
+		if (!$packageSrl)
407 407
 		{
408 408
 			return;
409 409
 		}
@@ -419,7 +419,7 @@  discard block
 block discarded – undo
419 419
 	 */
420 420
 	function getUpdateUrlByPackageSrl($packageSrl)
421 421
 	{
422
-		if(!$packageSrl)
422
+		if (!$packageSrl)
423 423
 		{
424 424
 			return;
425 425
 		}
@@ -435,13 +435,13 @@  discard block
 block discarded – undo
435 435
 	 */
436 436
 	function getUpdateUrlByPath($path)
437 437
 	{
438
-		if(!$path)
438
+		if (!$path)
439 439
 		{
440 440
 			return;
441 441
 		}
442 442
 
443 443
 		$packageSrl = $this->getPackageSrlByPath($path);
444
-		if(!$packageSrl)
444
+		if (!$packageSrl)
445 445
 		{
446 446
 			return;
447 447
 		}
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
 	function getHaveInstance($columnList = array())
453 453
 	{
454 454
 		$output = executeQueryArray('autoinstall.getHaveInstance', NULL, $columnList);
455
-		if(!$output->data)
455
+		if (!$output->data)
456 456
 		{
457 457
 			return array();
458 458
 		}
Please login to merge, or discard this patch.
modules/board/board.admin.controller.php 2 patches
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -27,37 +27,37 @@  discard block
 block discarded – undo
27 27
 		$args = Context::getRequestVars();
28 28
 		$args->module = 'board';
29 29
 		$args->mid = $args->board_name;
30
-		if(is_array($args->use_status)) $args->use_status = implode('|@|', $args->use_status);
30
+		if (is_array($args->use_status)) $args->use_status = implode('|@|', $args->use_status);
31 31
 		unset($args->board_name);
32 32
 
33 33
 		// setup extra_order_target
34 34
 		$extra_order_target = array();
35
-		if($args->module_srl)
35
+		if ($args->module_srl)
36 36
 		{
37 37
 			$oDocumentModel = getModel('document');
38 38
 			$module_extra_vars = $oDocumentModel->getExtraKeys($args->module_srl);
39
-			foreach($module_extra_vars as $oExtraItem)
39
+			foreach ($module_extra_vars as $oExtraItem)
40 40
 			{
41 41
 				$extra_order_target[$oExtraItem->eid] = $oExtraItem->name;
42 42
 			}
43 43
 		}
44 44
 
45 45
 		// setup other variables
46
-		if($args->except_notice != 'Y') $args->except_notice = 'N';
47
-		if($args->use_anonymous != 'Y') $args->use_anonymous = 'N';
48
-		if($args->consultation != 'Y') $args->consultation = 'N';
49
-		if($args->protect_content!= 'Y') $args->protect_content = 'N';
50
-		if(!in_array($args->order_target,$this->order_target) && !array_key_exists($args->order_target, $extra_order_target)) $args->order_target = 'list_order';
51
-		if(!in_array($args->order_type, array('asc', 'desc'))) $args->order_type = 'asc';
46
+		if ($args->except_notice != 'Y') $args->except_notice = 'N';
47
+		if ($args->use_anonymous != 'Y') $args->use_anonymous = 'N';
48
+		if ($args->consultation != 'Y') $args->consultation = 'N';
49
+		if ($args->protect_content != 'Y') $args->protect_content = 'N';
50
+		if (!in_array($args->order_target, $this->order_target) && !array_key_exists($args->order_target, $extra_order_target)) $args->order_target = 'list_order';
51
+		if (!in_array($args->order_type, array('asc', 'desc'))) $args->order_type = 'asc';
52 52
 
53 53
 		// if there is an existed module
54
-		if($args->module_srl) {
54
+		if ($args->module_srl) {
55 55
 			$module_info = $oModuleModel->getModuleInfoByModuleSrl($args->module_srl);
56
-			if($module_info->module_srl != $args->module_srl) unset($args->module_srl);
56
+			if ($module_info->module_srl != $args->module_srl) unset($args->module_srl);
57 57
 		}
58 58
 
59 59
 		// insert/update the board module based on module_srl
60
-		if(!$args->module_srl) {
60
+		if (!$args->module_srl) {
61 61
 			$args->hide_category = 'N';
62 62
 			$output = $oModuleController->insertModule($args);
63 63
 			$msg_code = 'success_registed';
@@ -67,18 +67,18 @@  discard block
 block discarded – undo
67 67
 			$msg_code = 'success_updated';
68 68
 		}
69 69
 
70
-		if(!$output->toBool()) return $output;
70
+		if (!$output->toBool()) return $output;
71 71
 
72 72
 		// setup list config
73
-		$list = explode(',',Context::get('list'));
74
-		if(count($list))
73
+		$list = explode(',', Context::get('list'));
74
+		if (count($list))
75 75
 		{
76 76
 			$list_arr = array();
77
-			foreach($list as $val)
77
+			foreach ($list as $val)
78 78
 			{
79 79
 				$val = trim($val);
80
-				if(!$val) continue;
81
-				if(substr($val,0,10)=='extra_vars') $val = substr($val,10);
80
+				if (!$val) continue;
81
+				if (substr($val, 0, 10) == 'extra_vars') $val = substr($val, 10);
82 82
 				$list_arr[] = $val;
83 83
 			}
84 84
 			$oModuleController = getController('module');
@@ -86,10 +86,10 @@  discard block
 block discarded – undo
86 86
 		}
87 87
 
88 88
 		$this->setMessage($msg_code);
89
-		if (Context::get('success_return_url')){
89
+		if (Context::get('success_return_url')) {
90 90
 			changeValueInUrl('mid', $args->mid, $module_info->mid);
91 91
 			$this->setRedirectUrl(Context::get('success_return_url'));
92
-		}else{
92
+		} else {
93 93
 			$this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispBoardAdminBoardInfo', 'module_srl', $output->get('module_srl')));
94 94
 		}
95 95
 	}
@@ -105,17 +105,17 @@  discard block
 block discarded – undo
105 105
 		// for board info
106 106
 		$args->module = 'board';
107 107
 		$args->mid = $args->board_name;
108
-		if(is_array($args->use_status))
108
+		if (is_array($args->use_status))
109 109
 		{
110 110
 			$args->use_status = implode('|@|', $args->use_status);
111 111
 		}
112 112
 		unset($args->board_name);
113 113
 
114
-		if(!in_array($args->order_target, $this->order_target))
114
+		if (!in_array($args->order_target, $this->order_target))
115 115
 		{
116 116
 			$args->order_target = 'list_order';
117 117
 		}
118
-		if(!in_array($args->order_type, array('asc', 'desc')))
118
+		if (!in_array($args->order_type, array('asc', 'desc')))
119 119
 		{
120 120
 			$args->order_type = 'asc';
121 121
 		}
@@ -125,13 +125,13 @@  discard block
 block discarded – undo
125 125
 
126 126
 		// for grant info, Register Admin ID
127 127
 		$oModuleController->deleteAdminId($args->module_srl);
128
-		if($args->admin_member)
128
+		if ($args->admin_member)
129 129
 		{
130
-			$admin_members = explode(',',$args->admin_member);
131
-			for($i=0;$i<count($admin_members);$i++)
130
+			$admin_members = explode(',', $args->admin_member);
131
+			for ($i = 0; $i < count($admin_members); $i++)
132 132
 			{
133 133
 				$admin_id = trim($admin_members[$i]);
134
-				if(!$admin_id) continue;
134
+				if (!$admin_id) continue;
135 135
 				$oModuleController->insertAdminId($args->module_srl, $admin_id);
136 136
 			}
137 137
 		}
@@ -146,10 +146,10 @@  discard block
 block discarded – undo
146 146
 		// get the current module
147 147
 		$oModuleController = getController('module');
148 148
 		$output = $oModuleController->deleteModule($module_srl);
149
-		if(!$output->toBool()) return $output;
149
+		if (!$output->toBool()) return $output;
150 150
 
151
-		$this->add('module','board');
152
-		$this->add('page',Context::get('page'));
151
+		$this->add('module', 'board');
152
+		$this->add('page', Context::get('page'));
153 153
 		$this->setMessage('success_deleted');
154 154
 	}
155 155
 
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 
161 161
 		$oModuleModel = getModel('module');
162 162
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
163
-		if($module_info->mid != $mid)
163
+		if ($module_info->mid != $mid)
164 164
 		{
165 165
 			return new Object(-1, 'msg_invalid_request');
166 166
 		}
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 		$module_info->hide_category = Context::get('hide_category') == 'Y' ? 'Y' : 'N';
169 169
 		$oModuleController = getController('module'); /* @var $oModuleController moduleController */
170 170
 		$output = $oModuleController->updateModule($module_info);
171
-		if(!$output->toBool())
171
+		if (!$output->toBool())
172 172
 		{
173 173
 			return $output;
174 174
 		}
Please login to merge, or discard this patch.
Braces   +41 added lines, -16 removed lines patch added patch discarded remove patch
@@ -27,7 +27,9 @@  discard block
 block discarded – undo
27 27
 		$args = Context::getRequestVars();
28 28
 		$args->module = 'board';
29 29
 		$args->mid = $args->board_name;
30
-		if(is_array($args->use_status)) $args->use_status = implode('|@|', $args->use_status);
30
+		if(is_array($args->use_status)) {
31
+			$args->use_status = implode('|@|', $args->use_status);
32
+		}
31 33
 		unset($args->board_name);
32 34
 
33 35
 		// setup extra_order_target
@@ -43,17 +45,31 @@  discard block
 block discarded – undo
43 45
 		}
44 46
 
45 47
 		// setup other variables
46
-		if($args->except_notice != 'Y') $args->except_notice = 'N';
47
-		if($args->use_anonymous != 'Y') $args->use_anonymous = 'N';
48
-		if($args->consultation != 'Y') $args->consultation = 'N';
49
-		if($args->protect_content!= 'Y') $args->protect_content = 'N';
50
-		if(!in_array($args->order_target,$this->order_target) && !array_key_exists($args->order_target, $extra_order_target)) $args->order_target = 'list_order';
51
-		if(!in_array($args->order_type, array('asc', 'desc'))) $args->order_type = 'asc';
48
+		if($args->except_notice != 'Y') {
49
+			$args->except_notice = 'N';
50
+		}
51
+		if($args->use_anonymous != 'Y') {
52
+			$args->use_anonymous = 'N';
53
+		}
54
+		if($args->consultation != 'Y') {
55
+			$args->consultation = 'N';
56
+		}
57
+		if($args->protect_content!= 'Y') {
58
+			$args->protect_content = 'N';
59
+		}
60
+		if(!in_array($args->order_target,$this->order_target) && !array_key_exists($args->order_target, $extra_order_target)) {
61
+			$args->order_target = 'list_order';
62
+		}
63
+		if(!in_array($args->order_type, array('asc', 'desc'))) {
64
+			$args->order_type = 'asc';
65
+		}
52 66
 
53 67
 		// if there is an existed module
54 68
 		if($args->module_srl) {
55 69
 			$module_info = $oModuleModel->getModuleInfoByModuleSrl($args->module_srl);
56
-			if($module_info->module_srl != $args->module_srl) unset($args->module_srl);
70
+			if($module_info->module_srl != $args->module_srl) {
71
+				unset($args->module_srl);
72
+			}
57 73
 		}
58 74
 
59 75
 		// insert/update the board module based on module_srl
@@ -67,7 +83,9 @@  discard block
 block discarded – undo
67 83
 			$msg_code = 'success_updated';
68 84
 		}
69 85
 
70
-		if(!$output->toBool()) return $output;
86
+		if(!$output->toBool()) {
87
+			return $output;
88
+		}
71 89
 
72 90
 		// setup list config
73 91
 		$list = explode(',',Context::get('list'));
@@ -77,8 +95,12 @@  discard block
 block discarded – undo
77 95
 			foreach($list as $val)
78 96
 			{
79 97
 				$val = trim($val);
80
-				if(!$val) continue;
81
-				if(substr($val,0,10)=='extra_vars') $val = substr($val,10);
98
+				if(!$val) {
99
+					continue;
100
+				}
101
+				if(substr($val,0,10)=='extra_vars') {
102
+					$val = substr($val,10);
103
+				}
82 104
 				$list_arr[] = $val;
83 105
 			}
84 106
 			$oModuleController = getController('module');
@@ -89,7 +111,7 @@  discard block
 block discarded – undo
89 111
 		if (Context::get('success_return_url')){
90 112
 			changeValueInUrl('mid', $args->mid, $module_info->mid);
91 113
 			$this->setRedirectUrl(Context::get('success_return_url'));
92
-		}else{
114
+		} else{
93 115
 			$this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispBoardAdminBoardInfo', 'module_srl', $output->get('module_srl')));
94 116
 		}
95 117
 	}
@@ -131,7 +153,9 @@  discard block
 block discarded – undo
131 153
 			for($i=0;$i<count($admin_members);$i++)
132 154
 			{
133 155
 				$admin_id = trim($admin_members[$i]);
134
-				if(!$admin_id) continue;
156
+				if(!$admin_id) {
157
+					continue;
158
+				}
135 159
 				$oModuleController->insertAdminId($args->module_srl, $admin_id);
136 160
 			}
137 161
 		}
@@ -146,7 +170,9 @@  discard block
 block discarded – undo
146 170
 		// get the current module
147 171
 		$oModuleController = getController('module');
148 172
 		$output = $oModuleController->deleteModule($module_srl);
149
-		if(!$output->toBool()) return $output;
173
+		if(!$output->toBool()) {
174
+			return $output;
175
+		}
150 176
 
151 177
 		$this->add('module','board');
152 178
 		$this->add('page',Context::get('page'));
@@ -177,8 +203,7 @@  discard block
 block discarded – undo
177 203
 		if (Context::get('success_return_url'))
178 204
 		{
179 205
 			$this->setRedirectUrl(Context::get('success_return_url'));
180
-		}
181
-		else
206
+		} else
182 207
 		{
183 208
 			$this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispBoardAdminCategoryInfo', 'module_srl', $output->get('module_srl')));
184 209
 		}
Please login to merge, or discard this patch.
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.model.php 2 patches
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.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -25,19 +25,19 @@  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 42
 					$output['extra_vars'.$key] = $inserted_extra_vars[$key];
43 43
 				}
@@ -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,9 +71,9 @@  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 78
 				$extra_vars['extra_vars'.$obj->idx] = $obj;
79 79
 			}
Please login to merge, or discard this patch.
modules/board/board.wap.php 2 patches
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.
Spacing   +28 added lines, -28 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;
77
+					$content = Context::getLang('replies').' : <a href="'.getUrl('act', 'dispBoardContentCommentList').'">'.$oDocument->getCommentCount().'</a><br>'."\r\n".$content;
78 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,25 +92,25 @@  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().']';
113
+				if ($val->getCommentCount()) $title .= ' ['.$val->getCommentCount().']';
114 114
 				$obj['link'] = $obj['text'] = '['.$val->getNickName().'] '.$title;
115 115
 				$childs[] = $obj;
116 116
 			}
@@ -118,18 +118,18 @@  discard block
 block discarded – undo
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.