GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Pull Request — develop (#1814)
by
unknown
11:57
created
modules/message/message.admin.view.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 /* Copyright (C) NAVER <http://www.navercorp.com> */
3 3
 /**
4
- * @class  messageAdminView
5
- * @author NAVER ([email protected])
6
- * @brief admin view class of the message module
7
- */
4
+	 * @class  messageAdminView
5
+	 * @author NAVER ([email protected])
6
+	 * @brief admin view class of the message module
7
+	 */
8 8
 class messageAdminView extends message
9 9
 {
10 10
 	/**
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,10 +30,10 @@
 block discarded – undo
30 30
 
31 31
 		// Get configurations (using module model object)
32 32
 		$config = $oModuleModel->getModuleConfig('message');
33
-		Context::set('config',$config);
33
+		Context::set('config', $config);
34 34
 
35 35
 		// Set a template file
36
-		$this->setTemplatePath($this->module_path.'tpl');
36
+		$this->setTemplatePath($this->module_path . 'tpl');
37 37
 
38 38
 		//Security
39 39
 		$security = new Security();
Please login to merge, or discard this patch.
modules/message/message.class.php 3 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 /* Copyright (C) NAVER <http://www.navercorp.com> */
3 3
 /**
4
- * @class  message
5
- * @author NAVER ([email protected])
6
- * @brief high class of message module
7
- */
4
+	 * @class  message
5
+	 * @author NAVER ([email protected])
6
+	 * @brief high class of message module
7
+	 */
8 8
 class message extends ModuleObject
9 9
 {
10 10
 	/**
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,13 +23,13 @@  discard block
 block discarded – undo
23 23
 		$oModuleModel = getModel('module');
24 24
 		$config = $oModuleModel->getModuleConfig('message');
25 25
 
26
-		if($config->skin)
26
+		if ($config->skin)
27 27
 		{
28 28
 			$config_parse = explode('.', $config->skin);
29 29
 			if (count($config_parse) > 1)
30 30
 			{
31 31
 				$template_path = sprintf('./themes/%s/modules/message/', $config_parse[0]);
32
-				if(is_dir($template_path)) return true;
32
+				if (is_dir($template_path)) return true;
33 33
 			}
34 34
 		}
35 35
 		return false;
@@ -43,13 +43,13 @@  discard block
 block discarded – undo
43 43
 		$oModuleModel = getModel('module');
44 44
 		$config = $oModuleModel->getModuleConfig('message');
45 45
 
46
-		if($config->skin)
46
+		if ($config->skin)
47 47
 		{
48 48
 			$config_parse = explode('.', $config->skin);
49 49
 			if (count($config_parse) > 1)
50 50
 			{
51 51
 				$template_path = sprintf('./themes/%s/modules/message/', $config_parse[0]);
52
-				if(is_dir($template_path))
52
+				if (is_dir($template_path))
53 53
 				{
54 54
 					$config->skin = implode('|@|', $config_parse);
55 55
 					$oModuleController = getController('module');
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,9 @@
 block discarded – undo
29 29
 			if (count($config_parse) > 1)
30 30
 			{
31 31
 				$template_path = sprintf('./themes/%s/modules/message/', $config_parse[0]);
32
-				if(is_dir($template_path)) return true;
32
+				if(is_dir($template_path)) {
33
+					return true;
34
+				}
33 35
 			}
34 36
 		}
35 37
 		return false;
Please login to merge, or discard this patch.
modules/message/message.mobile.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /* Copyright (C) NAVER <http://www.navercorp.com> */
3
-require_once(_XE_PATH_.'modules/message/message.view.php');
3
+require_once(_XE_PATH_ . 'modules/message/message.view.php');
4 4
 class messageMobile extends messageView
5 5
 {
6 6
 	/**
@@ -18,8 +18,8 @@  discard block
 block discarded – undo
18 18
 		// Get configurations (using module model object)
19 19
 		$oModuleModel = getModel('module');
20 20
 		$config = $oModuleModel->getModuleConfig('message');
21
-		if(!is_object($config)) $config = new stdClass;
22
-		if(!$config->mskin) $config->mskin = 'default';
21
+		if (!is_object($config)) $config = new stdClass;
22
+		if (!$config->mskin) $config->mskin = 'default';
23 23
 		// Set the template path
24 24
 		$template_path = sprintf('%sm.skins/%s', $this->module_path, $config->mskin);
25 25
 		// Get the member configuration
@@ -28,11 +28,11 @@  discard block
 block discarded – undo
28 28
 		Context::set('member_config', $member_config);
29 29
 		// Set a flag to check if the https connection is made when using SSL and create https url 
30 30
 		$ssl_mode = false;
31
-		if($member_config->enable_ssl == 'Y')
31
+		if ($member_config->enable_ssl == 'Y')
32 32
 		{
33
-			if(strncasecmp('https://', Context::getRequestUri(), 8) === 0) $ssl_mode = true;
33
+			if (strncasecmp('https://', Context::getRequestUri(), 8) === 0) $ssl_mode = true;
34 34
 		}
35
-		Context::set('ssl_mode',$ssl_mode);
35
+		Context::set('ssl_mode', $ssl_mode);
36 36
 
37 37
 		Context::set('system_message', nl2br($this->getMessage()));
38 38
 
Please login to merge, or discard this patch.
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -18,8 +18,12 @@  discard block
 block discarded – undo
18 18
 		// Get configurations (using module model object)
19 19
 		$oModuleModel = getModel('module');
20 20
 		$config = $oModuleModel->getModuleConfig('message');
21
-		if(!is_object($config)) $config = new stdClass;
22
-		if(!$config->mskin) $config->mskin = 'default';
21
+		if(!is_object($config)) {
22
+			$config = new stdClass;
23
+		}
24
+		if(!$config->mskin) {
25
+			$config->mskin = 'default';
26
+		}
23 27
 		// Set the template path
24 28
 		$template_path = sprintf('%sm.skins/%s', $this->module_path, $config->mskin);
25 29
 		// Get the member configuration
@@ -30,7 +34,9 @@  discard block
 block discarded – undo
30 34
 		$ssl_mode = false;
31 35
 		if($member_config->enable_ssl == 'Y')
32 36
 		{
33
-			if(strncasecmp('https://', Context::getRequestUri(), 8) === 0) $ssl_mode = true;
37
+			if(strncasecmp('https://', Context::getRequestUri(), 8) === 0) {
38
+				$ssl_mode = true;
39
+			}
34 40
 		}
35 41
 		Context::set('ssl_mode',$ssl_mode);
36 42
 
Please login to merge, or discard this patch.
modules/message/message.view.php 3 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 /* Copyright (C) NAVER <http://www.navercorp.com> */
3 3
 /**
4
- * @class  messageView
5
- * @author NAVER ([email protected])
6
- * @brief view class of the message module
7
- */
4
+	 * @class  messageView
5
+	 * @author NAVER ([email protected])
6
+	 * @brief view class of the message module
7
+	 */
8 8
 class messageView extends message
9 9
 {
10 10
 	/**
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -23,12 +23,12 @@  discard block
 block discarded – undo
23 23
 		$oModuleModel = getModel('module');
24 24
 		$this->module_config = $config = $oModuleModel->getModuleConfig('message', $this->module_info->site_srl);
25 25
 
26
-		if(!$config)
26
+		if (!$config)
27 27
 		{
28 28
 			$config = new stdClass();
29 29
 		}
30 30
 
31
-		if(!$config->skin)
31
+		if (!$config->skin)
32 32
 		{
33 33
 			$config->skin = 'xedition';
34 34
 			$template_path = sprintf('%sskins/%s', $this->module_path, $config->skin);
@@ -54,11 +54,11 @@  discard block
 block discarded – undo
54 54
 		Context::set('member_config', $member_config);
55 55
 		// Set a flag to check if the https connection is made when using SSL and create https url
56 56
 		$ssl_mode = false;
57
-		if($member_config->enable_ssl == 'Y')
57
+		if ($member_config->enable_ssl == 'Y')
58 58
 		{
59
-			if(strncasecmp('https://', Context::getRequestUri(), 8) === 0) $ssl_mode = true;
59
+			if (strncasecmp('https://', Context::getRequestUri(), 8) === 0) $ssl_mode = true;
60 60
 		}
61
-		Context::set('ssl_mode',$ssl_mode);
61
+		Context::set('ssl_mode', $ssl_mode);
62 62
 
63 63
 		Context::set('system_message', nl2br($this->getMessage()));
64 64
 
Please login to merge, or discard this patch.
Braces   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -32,16 +32,14 @@  discard block
 block discarded – undo
32 32
 		{
33 33
 			$config->skin = 'xedition';
34 34
 			$template_path = sprintf('%sskins/%s', $this->module_path, $config->skin);
35
-		}
36
-		else
35
+		} else
37 36
 		{
38 37
 			//check theme
39 38
 			$config_parse = explode('|@|', $config->skin);
40 39
 			if (count($config_parse) > 1)
41 40
 			{
42 41
 				$template_path = sprintf('./themes/%s/modules/message/', $config_parse[0]);
43
-			}
44
-			else
42
+			} else
45 43
 			{
46 44
 				$template_path = sprintf('%sskins/%s', $this->module_path, $config->skin);
47 45
 			}
@@ -56,7 +54,9 @@  discard block
 block discarded – undo
56 54
 		$ssl_mode = false;
57 55
 		if($member_config->enable_ssl == 'Y')
58 56
 		{
59
-			if(strncasecmp('https://', Context::getRequestUri(), 8) === 0) $ssl_mode = true;
57
+			if(strncasecmp('https://', Context::getRequestUri(), 8) === 0) {
58
+				$ssl_mode = true;
59
+			}
60 60
 		}
61 61
 		Context::set('ssl_mode',$ssl_mode);
62 62
 
Please login to merge, or discard this patch.
modules/module/module.admin.view.php 3 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 /* Copyright (C) NAVER <http://www.navercorp.com> */
3 3
 /**
4
- * @class  moduleAdminView
5
- * @author NAVER ([email protected])
6
- * @brief admin view class of the module module
7
- */
4
+	 * @class  moduleAdminView
5
+	 * @author NAVER ([email protected])
6
+	 * @brief admin view class of the module module
7
+	 */
8 8
 class moduleAdminView extends module
9 9
 {
10 10
 	/**
Please login to merge, or discard this patch.
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 	function init()
14 14
 	{
15 15
 		// Set the template path
16
-		$this->setTemplatePath($this->module_path.'tpl');
16
+		$this->setTemplatePath($this->module_path . 'tpl');
17 17
 	}
18 18
 
19 19
 	/**
@@ -35,9 +35,9 @@  discard block
 block discarded – undo
35 35
 		$oAutoinstallModel = getModel('autoinstall');
36 36
 
37 37
 		$module_list = $oModuleModel->getModuleList();
38
-		if(is_array($module_list))
38
+		if (is_array($module_list))
39 39
 		{
40
-			foreach($module_list as $key => $val)
40
+			foreach ($module_list as $key => $val)
41 41
 			{
42 42
 				$module_list[$key]->delete_url = $oAutoinstallModel->getRemoveUrlByPath($val->path);
43 43
 
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 				$module_list[$key]->need_autoinstall_update = $package[$packageSrl]->need_update;
48 48
 
49 49
 				// get easyinstall update url
50
-				if($module_list[$key]->need_autoinstall_update == 'Y')
50
+				if ($module_list[$key]->need_autoinstall_update == 'Y')
51 51
 				{
52 52
 					$module_list[$key]->update_url = $oAutoinstallModel->getUpdateUrlByPackageSrl($packageSrl);
53 53
 				}
@@ -58,9 +58,9 @@  discard block
 block discarded – undo
58 58
 
59 59
 		$favoriteList = $output->get('favoriteList');
60 60
 		$favoriteModuleList = array();
61
-		if($favoriteList)
61
+		if ($favoriteList)
62 62
 		{
63
-			foreach($favoriteList as $favorite => $favorite_info)
63
+			foreach ($favoriteList as $favorite => $favorite_info)
64 64
 			{
65 65
 				$favoriteModuleList[] = $favorite_info->module;
66 66
 			}
@@ -110,9 +110,9 @@  discard block
 block discarded – undo
110 110
 		//Security
111 111
 		$security = new Security();
112 112
 
113
-		if($module_category_srl)
113
+		if ($module_category_srl)
114 114
 		{
115
-			$selected_category  = $oModuleModel->getModuleCategory($module_category_srl);
115
+			$selected_category = $oModuleModel->getModuleCategory($module_category_srl);
116 116
 			Context::set('selected_category', $selected_category);
117 117
 
118 118
 			//Security
@@ -164,15 +164,15 @@  discard block
 block discarded – undo
164 164
 	{
165 165
 		$module_srls = Context::get('module_srls');
166 166
 
167
-		$modules = explode(',',$module_srls);
168
-		if(!count($modules)) if(!$module_srls) return new Object(-1,'msg_invalid_request');
167
+		$modules = explode(',', $module_srls);
168
+		if (!count($modules)) if (!$module_srls) return new Object(-1, 'msg_invalid_request');
169 169
 
170 170
 		$oModuleModel = getModel('module');
171 171
 		$columnList = array('module_srl', 'module');
172 172
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($modules[0], $columnList);
173 173
 		// Get a skin list of the module
174
-		$skin_list = $oModuleModel->getSkins(_XE_PATH_ . 'modules/'.$module_info->module);
175
-		Context::set('skin_list',$skin_list);
174
+		$skin_list = $oModuleModel->getSkins(_XE_PATH_ . 'modules/' . $module_info->module);
175
+		Context::set('skin_list', $skin_list);
176 176
 		// Get a layout list
177 177
 		$oLayoutModel = getModel('layout');
178 178
 		$layout_list = $oLayoutModel->getLayoutList();
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 		Context::set('module_category', $module_category);
183 183
 
184 184
 		$security = new Security();
185
-		$security->encodeHTML('layout_list..title','layout_list..layout');
185
+		$security->encodeHTML('layout_list..title', 'layout_list..layout');
186 186
 		$security->encodeHTML('skin_list....');
187 187
 		$security->encodeHTML('module_category...');
188 188
 
@@ -200,8 +200,8 @@  discard block
 block discarded – undo
200 200
 	{
201 201
 		$module_srls = Context::get('module_srls');
202 202
 
203
-		$modules = explode(',',$module_srls);
204
-		if(!count($modules)) if(!$module_srls) return new Object(-1,'msg_invalid_request');
203
+		$modules = explode(',', $module_srls);
204
+		if (!count($modules)) if (!$module_srls) return new Object(-1, 'msg_invalid_request');
205 205
 		// pre-define variables because you can get contents from other module (call by reference)
206 206
 		$content = '';
207 207
 		// Call a trigger for additional settings
@@ -223,8 +223,8 @@  discard block
 block discarded – undo
223 223
 	{
224 224
 		$module_srls = Context::get('module_srls');
225 225
 
226
-		$modules = explode(',',$module_srls);
227
-		if(!count($modules)) if(!$module_srls) return new Object(-1,'msg_invalid_request');
226
+		$modules = explode(',', $module_srls);
227
+		if (!count($modules)) if (!$module_srls) return new Object(-1, 'msg_invalid_request');
228 228
 
229 229
 		$oModuleModel = getModel('module');
230 230
 		$columnList = array('module_srl', 'module', 'site_srl');
@@ -234,12 +234,12 @@  discard block
 block discarded – undo
234 234
 		// Grant virtual permissions for access and manager
235 235
 		$grant_list->access->title = Context::getLang('grant_access');
236 236
 		$grant_list->access->default = 'guest';
237
-		if(count($source_grant_list))
237
+		if (count($source_grant_list))
238 238
 		{
239
-			foreach($source_grant_list as $key => $val)
239
+			foreach ($source_grant_list as $key => $val)
240 240
 			{
241
-				if(!$val->default) $val->default = 'guest';
242
-				if($val->default == 'root') $val->default = 'manager';
241
+				if (!$val->default) $val->default = 'guest';
242
+				if ($val->default == 'root') $val->default = 'manager';
243 243
 				$grant_list->{$key} = $val;
244 244
 			}
245 245
 		}
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
 		// Get the language file of the current site
269 269
 		$site_module_info = Context::get('site_module_info');
270 270
 		$args = new stdClass();
271
-		$args->site_srl = (int)$site_module_info->site_srl;
271
+		$args->site_srl = (int) $site_module_info->site_srl;
272 272
 		$args->langCode = Context::get('lang_type');
273 273
 		$args->page = Context::get('page'); // /< Page
274 274
 		$args->list_count = 30; // /< the number of posts to display on a single page
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
 		Context::set('lang_code_list', $output->data);
288 288
 		Context::set('page_navigation', $output->page_navigation);
289 289
 
290
-		if(Context::get('module') != 'admin')
290
+		if (Context::get('module') != 'admin')
291 291
 		{
292 292
 			$this->setLayoutPath('./common/tpl');
293 293
 			$this->setLayoutFile('popup_layout');
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 		$oModuleModel = getModel('module');
302 302
 		$output = $oModuleModel->getModuleFileBoxList();
303 303
 		$page = Context::get('page');
304
-		$page = $page?$page:1;
304
+		$page = $page ? $page : 1;
305 305
 		Context::set('filebox_list', $output->data);
306 306
 		Context::set('page_navigation', $output->page_navigation);
307 307
 		Context::set('page', $page);
Please login to merge, or discard this patch.
Braces   +16 added lines, -7 removed lines patch added patch discarded remove patch
@@ -121,8 +121,7 @@  discard block
 block discarded – undo
121 121
 			// Set a template file
122 122
 			$this->setTemplateFile('category_update_form');
123 123
 			// If not selected, display a list of categories
124
-		}
125
-		else
124
+		} else
126 125
 		{
127 126
 			$category_list = $oModuleModel->getModuleCategories();
128 127
 			Context::set('category_list', $category_list);
@@ -165,7 +164,9 @@  discard block
 block discarded – undo
165 164
 		$module_srls = Context::get('module_srls');
166 165
 
167 166
 		$modules = explode(',',$module_srls);
168
-		if(!count($modules)) if(!$module_srls) return new Object(-1,'msg_invalid_request');
167
+		if(!count($modules)) {
168
+			if(!$module_srls) return new Object(-1,'msg_invalid_request');
169
+		}
169 170
 
170 171
 		$oModuleModel = getModel('module');
171 172
 		$columnList = array('module_srl', 'module');
@@ -201,7 +202,9 @@  discard block
 block discarded – undo
201 202
 		$module_srls = Context::get('module_srls');
202 203
 
203 204
 		$modules = explode(',',$module_srls);
204
-		if(!count($modules)) if(!$module_srls) return new Object(-1,'msg_invalid_request');
205
+		if(!count($modules)) {
206
+			if(!$module_srls) return new Object(-1,'msg_invalid_request');
207
+		}
205 208
 		// pre-define variables because you can get contents from other module (call by reference)
206 209
 		$content = '';
207 210
 		// Call a trigger for additional settings
@@ -224,7 +227,9 @@  discard block
 block discarded – undo
224 227
 		$module_srls = Context::get('module_srls');
225 228
 
226 229
 		$modules = explode(',',$module_srls);
227
-		if(!count($modules)) if(!$module_srls) return new Object(-1,'msg_invalid_request');
230
+		if(!count($modules)) {
231
+			if(!$module_srls) return new Object(-1,'msg_invalid_request');
232
+		}
228 233
 
229 234
 		$oModuleModel = getModel('module');
230 235
 		$columnList = array('module_srl', 'module', 'site_srl');
@@ -238,8 +243,12 @@  discard block
 block discarded – undo
238 243
 		{
239 244
 			foreach($source_grant_list as $key => $val)
240 245
 			{
241
-				if(!$val->default) $val->default = 'guest';
242
-				if($val->default == 'root') $val->default = 'manager';
246
+				if(!$val->default) {
247
+					$val->default = 'guest';
248
+				}
249
+				if($val->default == 'root') {
250
+					$val->default = 'manager';
251
+				}
243 252
 				$grant_list->{$key} = $val;
244 253
 			}
245 254
 		}
Please login to merge, or discard this patch.
modules/module/module.class.php 2 patches
Spacing   +110 added lines, -110 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@  discard block
 block discarded – undo
16 16
 		$oModuleController = getController('module');
17 17
 
18 18
 		$oDB = &DB::getInstance();
19
-		$oDB->addIndex("modules","idx_site_mid", array("site_srl","mid"), true);
20
-		$oDB->addIndex('sites','unique_domain',array('domain'),true);
19
+		$oDB->addIndex("modules", "idx_site_mid", array("site_srl", "mid"), true);
20
+		$oDB->addIndex('sites', 'unique_domain', array('domain'), true);
21 21
 		// Create a directory to use in the module module
22 22
 		FileHandler::makeDir('./files/cache/module_info');
23 23
 		FileHandler::makeDir('./files/cache/triggers');
@@ -27,21 +27,21 @@  discard block
 block discarded – undo
27 27
 		$args = new stdClass;
28 28
 		$args->site_srl = 0;
29 29
 		$output = $oDB->executeQuery('module.getSite', $args);
30
-		if(!$output->data || !$output->data->index_module_srl)
30
+		if (!$output->data || !$output->data->index_module_srl)
31 31
 		{
32 32
 			$db_info = Context::getDBInfo();
33 33
 			$domain = Context::getDefaultUrl();
34 34
 			$url_info = parse_url($domain);
35
-			$domain = $url_info['host'].( (!empty($url_info['port'])&&$url_info['port']!=80)?':'.$url_info['port']:'').$url_info['path'];
35
+			$domain = $url_info['host'] . ((!empty($url_info['port']) && $url_info['port'] != 80) ? ':' . $url_info['port'] : '') . $url_info['path'];
36 36
 
37 37
 			$site_args = new stdClass;
38 38
 			$site_args->site_srl = 0;
39
-			$site_args->index_module_srl  = 0;
39
+			$site_args->index_module_srl = 0;
40 40
 			$site_args->domain = $domain;
41 41
 			$site_args->default_language = $db_info->lang_type;
42 42
 
43 43
 			$output = executeQuery('module.insertSite', $site_args);
44
-			if(!$output->toBool()) return $output;
44
+			if (!$output->toBool()) return $output;
45 45
 		}
46 46
 
47 47
 		return new Object();
@@ -54,60 +54,60 @@  discard block
 block discarded – undo
54 54
 	{
55 55
 		$oDB = &DB::getInstance();
56 56
 		// 2008. 10. 27 Add multi-index in the table, the module_part_config
57
-		if(!$oDB->isIndexExists("module_part_config","idx_module_part_config")) return true;
57
+		if (!$oDB->isIndexExists("module_part_config", "idx_module_part_config")) return true;
58 58
 		// 2008. 11. 13 Delete unique constraint on mid in modules. Add site_srl and then create unique index on site_srl and mid
59
-		if(!$oDB->isIndexExists('modules',"idx_site_mid")) return true;
59
+		if (!$oDB->isIndexExists('modules', "idx_site_mid")) return true;
60 60
 		// Move permissions/skin information of all modules to the table, grants.
61
-		if($oDB->isColumnExists('modules', 'grants')) return true;
61
+		if ($oDB->isColumnExists('modules', 'grants')) return true;
62 62
 		// Move permissions/skin information of all modules to the table, grants.
63
-		if(!$oDB->isColumnExists('sites', 'default_language')) return true;
63
+		if (!$oDB->isColumnExists('sites', 'default_language')) return true;
64 64
 		// Delete extra_vars* column
65
-		for($i=1;$i<=20;$i++)
65
+		for ($i = 1; $i <= 20; $i++)
66 66
 		{
67
-			if($oDB->isColumnExists("documents","extra_vars".$i)) return true;
67
+			if ($oDB->isColumnExists("documents", "extra_vars" . $i)) return true;
68 68
 		}
69 69
 		// Insert site information to the table, sites
70 70
 		$args = new stdClass();
71 71
 		$args->site_srl = 0;
72 72
 		$output = $oDB->executeQuery('module.getSite', $args);
73
-		if(!$output->data) return true;
73
+		if (!$output->data) return true;
74 74
 
75 75
 		// If domain index is defined on the table, sites
76
-		if($oDB->isIndexExists('sites', 'idx_domain')) return true;
77
-		if(!$oDB->isIndexExists('sites','unique_domain')) return true;
76
+		if ($oDB->isIndexExists('sites', 'idx_domain')) return true;
77
+		if (!$oDB->isIndexExists('sites', 'unique_domain')) return true;
78 78
 
79
-		if(!$oDB->isColumnExists("modules", "use_mobile")) return true;
80
-		if(!$oDB->isColumnExists("modules", "mlayout_srl")) return true;
81
-		if(!$oDB->isColumnExists("modules", "mcontent")) return true;
82
-		if(!$oDB->isColumnExists("modules", "mskin")) return true;
79
+		if (!$oDB->isColumnExists("modules", "use_mobile")) return true;
80
+		if (!$oDB->isColumnExists("modules", "mlayout_srl")) return true;
81
+		if (!$oDB->isColumnExists("modules", "mcontent")) return true;
82
+		if (!$oDB->isColumnExists("modules", "mskin")) return true;
83 83
 
84 84
 		// check fix skin
85
-		if(!$oDB->isColumnExists("modules", "is_skin_fix")) return true;
85
+		if (!$oDB->isColumnExists("modules", "is_skin_fix")) return true;
86 86
 
87
-		if(!$oDB->isColumnExists("module_config", "site_srl")) return true;
87
+		if (!$oDB->isColumnExists("module_config", "site_srl")) return true;
88 88
 
89
-		if(!is_dir('./files/ruleset')) return true;
89
+		if (!is_dir('./files/ruleset')) return true;
90 90
 
91 91
 		$args->skin = '.';
92 92
 		$output = executeQueryArray('module.getModuleSkinDotList', $args);
93
-		if($output->data && count($output->data) > 0)
93
+		if ($output->data && count($output->data) > 0)
94 94
 		{
95
-			foreach($output->data as $item)
95
+			foreach ($output->data as $item)
96 96
 			{
97 97
 				$skin_path = explode('.', $item->skin);
98
-				if(count($skin_path) != 2) continue;
99
-				if(is_dir(sprintf(_XE_PATH_ . 'themes/%s/modules/%s', $skin_path[0], $skin_path[1]))) return true;
98
+				if (count($skin_path) != 2) continue;
99
+				if (is_dir(sprintf(_XE_PATH_ . 'themes/%s/modules/%s', $skin_path[0], $skin_path[1]))) return true;
100 100
 			}
101 101
 		}
102 102
 
103 103
 		// XE 1.7
104 104
 
105 105
 		// check fix mskin
106
-		if(!$oDB->isColumnExists("modules", "is_mskin_fix")) return true;
106
+		if (!$oDB->isColumnExists("modules", "is_mskin_fix")) return true;
107 107
 
108 108
 		$oModuleModel = getModel('module');
109 109
 		$moduleConfig = $oModuleModel->getModuleConfig('module');
110
-		if(!$moduleConfig->isUpdateFixedValue) return true;
110
+		if (!$moduleConfig->isUpdateFixedValue) return true;
111 111
 	}
112 112
 
113 113
 	/**
@@ -117,19 +117,19 @@  discard block
 block discarded – undo
117 117
 	{
118 118
 		$oDB = &DB::getInstance();
119 119
 		// 2008. 10. 27 module_part_config Add a multi-index to the table and check all information of module_configg
120
-		if(!$oDB->isIndexExists("module_part_config","idx_module_part_config"))
120
+		if (!$oDB->isIndexExists("module_part_config", "idx_module_part_config"))
121 121
 		{
122 122
 			$oModuleModel = getModel('module');
123 123
 			$oModuleController = getController('module');
124 124
 			$modules = $oModuleModel->getModuleList();
125
-			foreach($modules as $key => $module_info)
125
+			foreach ($modules as $key => $module_info)
126 126
 			{
127 127
 				$module = $module_info->module;
128
-				if(!in_array($module, array('point','trackback','layout','rss','file','comment','editor'))) continue;
128
+				if (!in_array($module, array('point', 'trackback', 'layout', 'rss', 'file', 'comment', 'editor'))) continue;
129 129
 				$config = $oModuleModel->getModuleConfig($module);
130 130
 
131 131
 				$module_config = null;
132
-				switch($module)
132
+				switch ($module)
133 133
 				{
134 134
 					case 'point' :
135 135
 						$module_config = $config->module_point;
@@ -142,21 +142,21 @@  discard block
 block discarded – undo
142 142
 					case 'editor' :
143 143
 						$module_config = $config->module_config;
144 144
 						unset($config->module_config);
145
-						if(is_array($module_config) && count($module_config))
145
+						if (is_array($module_config) && count($module_config))
146 146
 						{
147
-							foreach($module_config as $key => $val)
147
+							foreach ($module_config as $key => $val)
148 148
 							{
149
-								if(isset($module_config[$key]->module_srl)) unset($module_config[$key]->module_srl);
149
+								if (isset($module_config[$key]->module_srl)) unset($module_config[$key]->module_srl);
150 150
 							}
151 151
 						}
152 152
 						break;
153 153
 					case 'layout' :
154 154
 						$tmp = $config->header_script;
155
-						if(is_array($tmp) && count($tmp))
155
+						if (is_array($tmp) && count($tmp))
156 156
 						{
157
-							foreach($tmp as $k => $v)
157
+							foreach ($tmp as $k => $v)
158 158
 							{
159
-								if(!$v && !trim($v)) continue;
159
+								if (!$v && !trim($v)) continue;
160 160
 								$module_config[$k]->header_script = $v;
161 161
 							}
162 162
 						}
@@ -166,29 +166,29 @@  discard block
 block discarded – undo
166 166
 
167 167
 				$oModuleController->insertModuleConfig($module, $config);
168 168
 
169
-				if(is_array($module_config) && count($module_config))
169
+				if (is_array($module_config) && count($module_config))
170 170
 				{
171
-					foreach($module_config as $module_srl => $module_part_config)
171
+					foreach ($module_config as $module_srl => $module_part_config)
172 172
 					{
173
-						$oModuleController->insertModulePartConfig($module,$module_srl,$module_part_config);
173
+						$oModuleController->insertModulePartConfig($module, $module_srl, $module_part_config);
174 174
 					}
175 175
 				}
176 176
 			}
177
-			$oDB->addIndex("module_part_config","idx_module_part_config", array("module","module_srl"));
177
+			$oDB->addIndex("module_part_config", "idx_module_part_config", array("module", "module_srl"));
178 178
 		}
179 179
 		// 2008. 11. 13 drop index(unique_mid). Add a column and index on site_srl and mid columns
180
-		if(!$oDB->isIndexExists('modules',"idx_site_mid"))
180
+		if (!$oDB->isIndexExists('modules', "idx_site_mid"))
181 181
 		{
182
-			$oDB->dropIndex("modules","unique_mid",true);
183
-			$oDB->addColumn('modules','site_srl','number',11,0,true);
184
-			$oDB->addIndex("modules","idx_site_mid", array("site_srl","mid"),true);
182
+			$oDB->dropIndex("modules", "unique_mid", true);
183
+			$oDB->addColumn('modules', 'site_srl', 'number', 11, 0, true);
184
+			$oDB->addIndex("modules", "idx_site_mid", array("site_srl", "mid"), true);
185 185
 		}
186 186
 		// document extra vars
187
-		if(!$oDB->isTableExists('document_extra_vars')) $oDB->createTableByXmlFile('./modules/document/schemas/document_extra_vars.xml');
187
+		if (!$oDB->isTableExists('document_extra_vars')) $oDB->createTableByXmlFile('./modules/document/schemas/document_extra_vars.xml');
188 188
 
189
-		if(!$oDB->isTableExists('document_extra_keys')) $oDB->createTableByXmlFile('./modules/document/schemas/document_extra_keys.xml');
189
+		if (!$oDB->isTableExists('document_extra_keys')) $oDB->createTableByXmlFile('./modules/document/schemas/document_extra_keys.xml');
190 190
 		// Move permission, skin info, extection info, admin ID of all modules to the table, grants
191
-		if($oDB->isColumnExists('modules', 'grants'))
191
+		if ($oDB->isColumnExists('modules', 'grants'))
192 192
 		{
193 193
 			$oModuleController = getController('module');
194 194
 			$oDocumentController = getController('document');
@@ -196,26 +196,26 @@  discard block
 block discarded – undo
196 196
 			$lang_code = Context::getLangType();
197 197
 			// Get module_info of all modules
198 198
 			$output = executeQueryArray('module.getModuleInfos');
199
-			if(count($output->data))
199
+			if (count($output->data))
200 200
 			{
201
-				foreach($output->data as $module_info)
201
+				foreach ($output->data as $module_info)
202 202
 				{
203 203
 					// Separate information about permission granted to the module, extra vars, skin vars, super-admin's authority
204 204
 					$module_srl = trim($module_info->module_srl);
205 205
 					// grant an authority
206 206
 					$grants = unserialize($module_info->grants);
207
-					if($grants) $oModuleController->insertModuleGrants($module_srl, $grants);
207
+					if ($grants) $oModuleController->insertModuleGrants($module_srl, $grants);
208 208
 					// Insert skin vars
209 209
 					$skin_vars = unserialize($module_info->skin_vars);
210
-					if($skin_vars) $oModuleController->insertModuleSkinVars($module_srl, $skin_vars);
210
+					if ($skin_vars) $oModuleController->insertModuleSkinVars($module_srl, $skin_vars);
211 211
 					// Insert super admin's ID
212 212
 					$admin_id = trim($module_info->admin_id);
213
-					if($admin_id && $admin_id != 'Array')
213
+					if ($admin_id && $admin_id != 'Array')
214 214
 					{
215
-						$admin_ids = explode(',',$admin_id);
216
-						if(count($admin_id))
215
+						$admin_ids = explode(',', $admin_id);
216
+						if (count($admin_id))
217 217
 						{
218
-							foreach($admin_ids as $admin_id)
218
+							foreach ($admin_ids as $admin_id)
219 219
 							{
220 220
 								$oModuleController->insertAdminId($module_srl, $admin_id);
221 221
 							}
@@ -224,20 +224,20 @@  discard block
 block discarded – undo
224 224
 					// Save extra configurations for each module(column data which doesn't exist in the defaut modules)
225 225
 					$extra_vars = unserialize($module_info->extra_vars);
226 226
 					$document_extra_keys = null;
227
-					if($extra_vars->extra_vars && count($extra_vars->extra_vars))
227
+					if ($extra_vars->extra_vars && count($extra_vars->extra_vars))
228 228
 					{
229 229
 						$document_extra_keys = $extra_vars->extra_vars;
230 230
 						unset($extra_vars->extra_vars);
231 231
 					}
232
-					if($extra_vars) $oModuleController->insertModuleExtraVars($module_srl, $extra_vars);
232
+					if ($extra_vars) $oModuleController->insertModuleExtraVars($module_srl, $extra_vars);
233 233
 
234 234
 					/**
235 235
 					 * Move document extra vars(it should have conducted in the documents module however extra vars in modules table should be listed up in this module)
236 236
 					 */
237 237
 					// Insert extra vars if planet module is
238
-					if($module_info->module == 'planet')
238
+					if ($module_info->module == 'planet')
239 239
 					{
240
-						if(!$document_extra_keys || !is_array($document_extra_keys)) $document_extra_keys = array();
240
+						if (!$document_extra_keys || !is_array($document_extra_keys)) $document_extra_keys = array();
241 241
 						$planet_extra_keys->name = 'postscript';
242 242
 						$planet_extra_keys->type = 'text';
243 243
 						$planet_extra_keys->is_required = 'N';
@@ -247,17 +247,17 @@  discard block
 block discarded – undo
247 247
 						$document_extra_keys[20] = $planet_extra_keys;
248 248
 					}
249 249
 					// Register keys for document extra vars
250
-					if(count($document_extra_keys))
250
+					if (count($document_extra_keys))
251 251
 					{
252
-						foreach($document_extra_keys as $var_idx => $val)
252
+						foreach ($document_extra_keys as $var_idx => $val)
253 253
 						{
254
-							$oDocumentController->insertDocumentExtraKey($module_srl, $var_idx, $val->name, $val->type, $val->is_required, $val->search, $val->default, $val->desc, 'extra_vars'.$var_idx);
254
+							$oDocumentController->insertDocumentExtraKey($module_srl, $var_idx, $val->name, $val->type, $val->is_required, $val->search, $val->default, $val->desc, 'extra_vars' . $var_idx);
255 255
 						}
256 256
 						// 2009-04-14 Fixed a bug that only 100 extra vars are moved
257 257
 						$oDocumentModel = getModel('document');
258 258
 						$total_count = $oDocumentModel->getDocumentCount($module_srl);
259 259
 
260
-						if($total_count > 0)
260
+						if ($total_count > 0)
261 261
 						{
262 262
 							$per_page = 100;
263 263
 							$total_pages = (int) (($total_count - 1) / $per_page) + 1;
@@ -268,20 +268,20 @@  discard block
 block discarded – undo
268 268
 							$doc_args->sort_index = 'list_order';
269 269
 							$doc_args->order_type = 'asc';
270 270
 
271
-							for($doc_args->page = 1; $doc_args->page <= $total_pages; $doc_args->page++)
271
+							for ($doc_args->page = 1; $doc_args->page <= $total_pages; $doc_args->page++)
272 272
 							{
273 273
 								$output = executeQueryArray('document.getDocumentList', $doc_args);
274 274
 
275
-								if($output->toBool() && $output->data && count($output->data))
275
+								if ($output->toBool() && $output->data && count($output->data))
276 276
 								{
277 277
 									foreach ($output->data as $document)
278 278
 									{
279
-										if(!$document) continue;
279
+										if (!$document) continue;
280 280
 										foreach ($document as $key => $var)
281 281
 										{
282 282
 											if (strpos($key, 'extra_vars') !== 0 || !trim($var) || $var == 'N;') continue;
283
-											$var_idx = str_replace('extra_vars','',$key);
284
-											$oDocumentController->insertDocumentExtraVar($module_srl, $document->document_srl, $var_idx, $var, 'extra_vars'.$var_idx, $lang_code);
283
+											$var_idx = str_replace('extra_vars', '', $key);
284
+											$oDocumentController->insertDocumentExtraVar($module_srl, $document->document_srl, $var_idx, $var, 'extra_vars' . $var_idx, $lang_code);
285 285
 										}
286 286
 									}
287 287
 								}
@@ -296,83 +296,83 @@  discard block
 block discarded – undo
296 296
 					executeQuery('module.updateModule', $module_info);
297 297
 
298 298
 					$oCacheHandler = CacheHandler::getInstance('object', null, true);
299
-					if($oCacheHandler->isSupport())
299
+					if ($oCacheHandler->isSupport())
300 300
 					{
301 301
 						$oCacheHandler->invalidateGroupKey('site_and_module');
302 302
 					}
303 303
 				}
304 304
 			}
305 305
 			// Various column drop
306
-			$oDB->dropColumn('modules','grants');
307
-			$oDB->dropColumn('modules','admin_id');
308
-			$oDB->dropColumn('modules','skin_vars');
309
-			$oDB->dropColumn('modules','extra_vars');
306
+			$oDB->dropColumn('modules', 'grants');
307
+			$oDB->dropColumn('modules', 'admin_id');
308
+			$oDB->dropColumn('modules', 'skin_vars');
309
+			$oDB->dropColumn('modules', 'extra_vars');
310 310
 		}
311 311
 		// Rights of all modules/skins transferring the information into a table Update grants
312
-		if(!$oDB->isColumnExists('sites', 'default_language'))
312
+		if (!$oDB->isColumnExists('sites', 'default_language'))
313 313
 		{
314
-			$oDB->addColumn('sites','default_language','varchar',255,0,false);
314
+			$oDB->addColumn('sites', 'default_language', 'varchar', 255, 0, false);
315 315
 		}
316 316
 		// extra_vars * Remove Column
317
-		for($i=1;$i<=20;$i++)
317
+		for ($i = 1; $i <= 20; $i++)
318 318
 		{
319
-			if(!$oDB->isColumnExists("documents","extra_vars".$i)) continue;
320
-			$oDB->dropColumn('documents','extra_vars'.$i);
319
+			if (!$oDB->isColumnExists("documents", "extra_vars" . $i)) continue;
320
+			$oDB->dropColumn('documents', 'extra_vars' . $i);
321 321
 		}
322 322
 
323 323
 		// Enter the main site information sites on the table
324 324
 		$args = new stdClass;
325 325
 		$args->site_srl = 0;
326 326
 		$output = $oDB->executeQuery('module.getSite', $args);
327
-		if(!$output->data)
327
+		if (!$output->data)
328 328
 		{
329 329
 			// Basic mid, language Wanted
330 330
 			$mid_output = $oDB->executeQuery('module.getDefaultMidInfo', $args);
331 331
 			$db_info = Context::getDBInfo();
332 332
 			$domain = Context::getDefaultUrl();
333 333
 			$url_info = parse_url($domain);
334
-			$domain = $url_info['host'].( (!empty($url_info['port'])&&$url_info['port']!=80)?':'.$url_info['port']:'').$url_info['path'];
334
+			$domain = $url_info['host'] . ((!empty($url_info['port']) && $url_info['port'] != 80) ? ':' . $url_info['port'] : '') . $url_info['path'];
335 335
 			$site_args->site_srl = 0;
336
-			$site_args->index_module_srl  = $mid_output->data->module_srl;
336
+			$site_args->index_module_srl = $mid_output->data->module_srl;
337 337
 			$site_args->domain = $domain;
338 338
 			$site_args->default_language = $db_info->lang_type;
339 339
 
340 340
 			$output = executeQuery('module.insertSite', $site_args);
341
-			if(!$output->toBool()) return $output;
341
+			if (!$output->toBool()) return $output;
342 342
 		}
343 343
 
344
-		if($oDB->isIndexExists('sites','idx_domain'))
344
+		if ($oDB->isIndexExists('sites', 'idx_domain'))
345 345
 		{
346
-			$oDB->dropIndex('sites','idx_domain');
346
+			$oDB->dropIndex('sites', 'idx_domain');
347 347
 		}
348
-		if(!$oDB->isIndexExists('sites','unique_domain'))
348
+		if (!$oDB->isIndexExists('sites', 'unique_domain'))
349 349
 		{
350 350
 			$this->updateForUniqueSiteDomain();
351
-			$oDB->addIndex('sites','unique_domain',array('domain'),true);
351
+			$oDB->addIndex('sites', 'unique_domain', array('domain'), true);
352 352
 		}
353 353
 
354
-		if(!$oDB->isColumnExists("modules", "use_mobile"))
354
+		if (!$oDB->isColumnExists("modules", "use_mobile"))
355 355
 		{
356
-			$oDB->addColumn('modules','use_mobile','char',1,'N');
356
+			$oDB->addColumn('modules', 'use_mobile', 'char', 1, 'N');
357 357
 		}
358
-		if(!$oDB->isColumnExists("modules", "mlayout_srl"))
358
+		if (!$oDB->isColumnExists("modules", "mlayout_srl"))
359 359
 		{
360
-			$oDB->addColumn('modules','mlayout_srl','number',11, 0);
360
+			$oDB->addColumn('modules', 'mlayout_srl', 'number', 11, 0);
361 361
 		}
362
-		if(!$oDB->isColumnExists("modules", "mcontent"))
362
+		if (!$oDB->isColumnExists("modules", "mcontent"))
363 363
 		{
364
-			$oDB->addColumn('modules','mcontent','bigtext');
364
+			$oDB->addColumn('modules', 'mcontent', 'bigtext');
365 365
 		}
366
-		if(!$oDB->isColumnExists("modules", "mskin"))
366
+		if (!$oDB->isColumnExists("modules", "mskin"))
367 367
 		{
368
-			$oDB->addColumn('modules','mskin','varchar',250);
368
+			$oDB->addColumn('modules', 'mskin', 'varchar', 250);
369 369
 		}
370
-		if(!$oDB->isColumnExists("modules", "is_skin_fix"))
370
+		if (!$oDB->isColumnExists("modules", "is_skin_fix"))
371 371
 		{
372 372
 			$oDB->addColumn('modules', 'is_skin_fix', 'char', 1, 'N');
373 373
 			$output = executeQuery('module.updateSkinFixModules');
374 374
 		}
375
-		if(!$oDB->isColumnExists("module_config", "site_srl"))
375
+		if (!$oDB->isColumnExists("module_config", "site_srl"))
376 376
 		{
377 377
 			$oDB->addColumn('module_config', 'site_srl', 'number', 11, 0, true);
378 378
 		}
@@ -380,13 +380,13 @@  discard block
 block discarded – undo
380 380
 
381 381
 		$args->skin = '.';
382 382
 		$output = executeQueryArray('module.getModuleSkinDotList', $args);
383
-		if($output->data && count($output->data) > 0)
383
+		if ($output->data && count($output->data) > 0)
384 384
 		{
385
-			foreach($output->data as $item)
385
+			foreach ($output->data as $item)
386 386
 			{
387 387
 				$skin_path = explode('.', $item->skin);
388
-				if(count($skin_path) != 2) continue;
389
-				if(is_dir(sprintf(_XE_PATH_ . 'themes/%s/modules/%s', $skin_path[0], $skin_path[1])))
388
+				if (count($skin_path) != 2) continue;
389
+				if (is_dir(sprintf(_XE_PATH_ . 'themes/%s/modules/%s', $skin_path[0], $skin_path[1])))
390 390
 				{
391 391
 					unset($args);
392 392
 					$args->skin = $item->skin;
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
 		}
398 398
 
399 399
 		// XE 1.7
400
-		if(!$oDB->isColumnExists("modules", "is_mskin_fix"))
400
+		if (!$oDB->isColumnExists("modules", "is_mskin_fix"))
401 401
 		{
402 402
 			$oDB->addColumn('modules', 'is_mskin_fix', 'char', 1, 'N');
403 403
 			$output = executeQuery('module.updateMobileSkinFixModules');
@@ -405,13 +405,13 @@  discard block
 block discarded – undo
405 405
 
406 406
 		$oModuleModel = getModel('module');
407 407
 		$moduleConfig = $oModuleModel->getModuleConfig('module');
408
-		if(!$moduleConfig->isUpdateFixedValue)
408
+		if (!$moduleConfig->isUpdateFixedValue)
409 409
 		{
410 410
 			$output = executeQuery('module.updateSkinFixModules');
411 411
 			$output = executeQuery('module.updateMobileSkinFixModules');
412 412
 
413 413
 			$oModuleController = getController('module');
414
-			if(!$moduleConfig) $moduleConfig = new stdClass;
414
+			if (!$moduleConfig) $moduleConfig = new stdClass;
415 415
 			$moduleConfig->isUpdateFixedValue = TRUE;
416 416
 			$output = $oModuleController->updateModuleConfig('module', $moduleConfig);
417 417
 		}
@@ -422,18 +422,18 @@  discard block
 block discarded – undo
422 422
 	function updateForUniqueSiteDomain()
423 423
 	{
424 424
 		$output = executeQueryArray("module.getNonuniqueDomains");
425
-		if(!$output->data) return;
426
-		foreach($output->data as $data)
425
+		if (!$output->data) return;
426
+		foreach ($output->data as $data)
427 427
 		{
428
-			if($data->count == 1) continue;
428
+			if ($data->count == 1) continue;
429 429
 			$domain = $data->domain;
430 430
 			$args = new stdClass;
431 431
 			$args->domain = $domain;
432 432
 			$output2 = executeQueryArray("module.getSiteByDomain", $args);
433 433
 			$bFirst = true;
434
-			foreach($output2->data as $site)
434
+			foreach ($output2->data as $site)
435 435
 			{
436
-				if($bFirst)
436
+				if ($bFirst)
437 437
 				{
438 438
 					$bFirst = false;
439 439
 					continue;
Please login to merge, or discard this patch.
Braces   +111 added lines, -37 removed lines patch added patch discarded remove patch
@@ -41,7 +41,9 @@  discard block
 block discarded – undo
41 41
 			$site_args->default_language = $db_info->lang_type;
42 42
 
43 43
 			$output = executeQuery('module.insertSite', $site_args);
44
-			if(!$output->toBool()) return $output;
44
+			if(!$output->toBool()) {
45
+				return $output;
46
+			}
45 47
 		}
46 48
 
47 49
 		return new Object();
@@ -54,39 +56,69 @@  discard block
 block discarded – undo
54 56
 	{
55 57
 		$oDB = &DB::getInstance();
56 58
 		// 2008. 10. 27 Add multi-index in the table, the module_part_config
57
-		if(!$oDB->isIndexExists("module_part_config","idx_module_part_config")) return true;
59
+		if(!$oDB->isIndexExists("module_part_config","idx_module_part_config")) {
60
+			return true;
61
+		}
58 62
 		// 2008. 11. 13 Delete unique constraint on mid in modules. Add site_srl and then create unique index on site_srl and mid
59
-		if(!$oDB->isIndexExists('modules',"idx_site_mid")) return true;
63
+		if(!$oDB->isIndexExists('modules',"idx_site_mid")) {
64
+			return true;
65
+		}
60 66
 		// Move permissions/skin information of all modules to the table, grants.
61
-		if($oDB->isColumnExists('modules', 'grants')) return true;
67
+		if($oDB->isColumnExists('modules', 'grants')) {
68
+			return true;
69
+		}
62 70
 		// Move permissions/skin information of all modules to the table, grants.
63
-		if(!$oDB->isColumnExists('sites', 'default_language')) return true;
71
+		if(!$oDB->isColumnExists('sites', 'default_language')) {
72
+			return true;
73
+		}
64 74
 		// Delete extra_vars* column
65 75
 		for($i=1;$i<=20;$i++)
66 76
 		{
67
-			if($oDB->isColumnExists("documents","extra_vars".$i)) return true;
77
+			if($oDB->isColumnExists("documents","extra_vars".$i)) {
78
+				return true;
79
+			}
68 80
 		}
69 81
 		// Insert site information to the table, sites
70 82
 		$args = new stdClass();
71 83
 		$args->site_srl = 0;
72 84
 		$output = $oDB->executeQuery('module.getSite', $args);
73
-		if(!$output->data) return true;
85
+		if(!$output->data) {
86
+			return true;
87
+		}
74 88
 
75 89
 		// If domain index is defined on the table, sites
76
-		if($oDB->isIndexExists('sites', 'idx_domain')) return true;
77
-		if(!$oDB->isIndexExists('sites','unique_domain')) return true;
90
+		if($oDB->isIndexExists('sites', 'idx_domain')) {
91
+			return true;
92
+		}
93
+		if(!$oDB->isIndexExists('sites','unique_domain')) {
94
+			return true;
95
+		}
78 96
 
79
-		if(!$oDB->isColumnExists("modules", "use_mobile")) return true;
80
-		if(!$oDB->isColumnExists("modules", "mlayout_srl")) return true;
81
-		if(!$oDB->isColumnExists("modules", "mcontent")) return true;
82
-		if(!$oDB->isColumnExists("modules", "mskin")) return true;
97
+		if(!$oDB->isColumnExists("modules", "use_mobile")) {
98
+			return true;
99
+		}
100
+		if(!$oDB->isColumnExists("modules", "mlayout_srl")) {
101
+			return true;
102
+		}
103
+		if(!$oDB->isColumnExists("modules", "mcontent")) {
104
+			return true;
105
+		}
106
+		if(!$oDB->isColumnExists("modules", "mskin")) {
107
+			return true;
108
+		}
83 109
 
84 110
 		// check fix skin
85
-		if(!$oDB->isColumnExists("modules", "is_skin_fix")) return true;
111
+		if(!$oDB->isColumnExists("modules", "is_skin_fix")) {
112
+			return true;
113
+		}
86 114
 
87
-		if(!$oDB->isColumnExists("module_config", "site_srl")) return true;
115
+		if(!$oDB->isColumnExists("module_config", "site_srl")) {
116
+			return true;
117
+		}
88 118
 
89
-		if(!is_dir('./files/ruleset')) return true;
119
+		if(!is_dir('./files/ruleset')) {
120
+			return true;
121
+		}
90 122
 
91 123
 		$args->skin = '.';
92 124
 		$output = executeQueryArray('module.getModuleSkinDotList', $args);
@@ -95,19 +127,27 @@  discard block
 block discarded – undo
95 127
 			foreach($output->data as $item)
96 128
 			{
97 129
 				$skin_path = explode('.', $item->skin);
98
-				if(count($skin_path) != 2) continue;
99
-				if(is_dir(sprintf(_XE_PATH_ . 'themes/%s/modules/%s', $skin_path[0], $skin_path[1]))) return true;
130
+				if(count($skin_path) != 2) {
131
+					continue;
132
+				}
133
+				if(is_dir(sprintf(_XE_PATH_ . 'themes/%s/modules/%s', $skin_path[0], $skin_path[1]))) {
134
+					return true;
135
+				}
100 136
 			}
101 137
 		}
102 138
 
103 139
 		// XE 1.7
104 140
 
105 141
 		// check fix mskin
106
-		if(!$oDB->isColumnExists("modules", "is_mskin_fix")) return true;
142
+		if(!$oDB->isColumnExists("modules", "is_mskin_fix")) {
143
+			return true;
144
+		}
107 145
 
108 146
 		$oModuleModel = getModel('module');
109 147
 		$moduleConfig = $oModuleModel->getModuleConfig('module');
110
-		if(!$moduleConfig->isUpdateFixedValue) return true;
148
+		if(!$moduleConfig->isUpdateFixedValue) {
149
+			return true;
150
+		}
111 151
 	}
112 152
 
113 153
 	/**
@@ -125,7 +165,9 @@  discard block
 block discarded – undo
125 165
 			foreach($modules as $key => $module_info)
126 166
 			{
127 167
 				$module = $module_info->module;
128
-				if(!in_array($module, array('point','trackback','layout','rss','file','comment','editor'))) continue;
168
+				if(!in_array($module, array('point','trackback','layout','rss','file','comment','editor'))) {
169
+					continue;
170
+				}
129 171
 				$config = $oModuleModel->getModuleConfig($module);
130 172
 
131 173
 				$module_config = null;
@@ -146,7 +188,9 @@  discard block
 block discarded – undo
146 188
 						{
147 189
 							foreach($module_config as $key => $val)
148 190
 							{
149
-								if(isset($module_config[$key]->module_srl)) unset($module_config[$key]->module_srl);
191
+								if(isset($module_config[$key]->module_srl)) {
192
+									unset($module_config[$key]->module_srl);
193
+								}
150 194
 							}
151 195
 						}
152 196
 						break;
@@ -156,7 +200,9 @@  discard block
 block discarded – undo
156 200
 						{
157 201
 							foreach($tmp as $k => $v)
158 202
 							{
159
-								if(!$v && !trim($v)) continue;
203
+								if(!$v && !trim($v)) {
204
+									continue;
205
+								}
160 206
 								$module_config[$k]->header_script = $v;
161 207
 							}
162 208
 						}
@@ -184,9 +230,13 @@  discard block
 block discarded – undo
184 230
 			$oDB->addIndex("modules","idx_site_mid", array("site_srl","mid"),true);
185 231
 		}
186 232
 		// document extra vars
187
-		if(!$oDB->isTableExists('document_extra_vars')) $oDB->createTableByXmlFile('./modules/document/schemas/document_extra_vars.xml');
233
+		if(!$oDB->isTableExists('document_extra_vars')) {
234
+			$oDB->createTableByXmlFile('./modules/document/schemas/document_extra_vars.xml');
235
+		}
188 236
 
189
-		if(!$oDB->isTableExists('document_extra_keys')) $oDB->createTableByXmlFile('./modules/document/schemas/document_extra_keys.xml');
237
+		if(!$oDB->isTableExists('document_extra_keys')) {
238
+			$oDB->createTableByXmlFile('./modules/document/schemas/document_extra_keys.xml');
239
+		}
190 240
 		// Move permission, skin info, extection info, admin ID of all modules to the table, grants
191 241
 		if($oDB->isColumnExists('modules', 'grants'))
192 242
 		{
@@ -204,10 +254,14 @@  discard block
 block discarded – undo
204 254
 					$module_srl = trim($module_info->module_srl);
205 255
 					// grant an authority
206 256
 					$grants = unserialize($module_info->grants);
207
-					if($grants) $oModuleController->insertModuleGrants($module_srl, $grants);
257
+					if($grants) {
258
+						$oModuleController->insertModuleGrants($module_srl, $grants);
259
+					}
208 260
 					// Insert skin vars
209 261
 					$skin_vars = unserialize($module_info->skin_vars);
210
-					if($skin_vars) $oModuleController->insertModuleSkinVars($module_srl, $skin_vars);
262
+					if($skin_vars) {
263
+						$oModuleController->insertModuleSkinVars($module_srl, $skin_vars);
264
+					}
211 265
 					// Insert super admin's ID
212 266
 					$admin_id = trim($module_info->admin_id);
213 267
 					if($admin_id && $admin_id != 'Array')
@@ -229,7 +283,9 @@  discard block
 block discarded – undo
229 283
 						$document_extra_keys = $extra_vars->extra_vars;
230 284
 						unset($extra_vars->extra_vars);
231 285
 					}
232
-					if($extra_vars) $oModuleController->insertModuleExtraVars($module_srl, $extra_vars);
286
+					if($extra_vars) {
287
+						$oModuleController->insertModuleExtraVars($module_srl, $extra_vars);
288
+					}
233 289
 
234 290
 					/**
235 291
 					 * Move document extra vars(it should have conducted in the documents module however extra vars in modules table should be listed up in this module)
@@ -237,7 +293,9 @@  discard block
 block discarded – undo
237 293
 					// Insert extra vars if planet module is
238 294
 					if($module_info->module == 'planet')
239 295
 					{
240
-						if(!$document_extra_keys || !is_array($document_extra_keys)) $document_extra_keys = array();
296
+						if(!$document_extra_keys || !is_array($document_extra_keys)) {
297
+							$document_extra_keys = array();
298
+						}
241 299
 						$planet_extra_keys->name = 'postscript';
242 300
 						$planet_extra_keys->type = 'text';
243 301
 						$planet_extra_keys->is_required = 'N';
@@ -276,10 +334,14 @@  discard block
 block discarded – undo
276 334
 								{
277 335
 									foreach ($output->data as $document)
278 336
 									{
279
-										if(!$document) continue;
337
+										if(!$document) {
338
+											continue;
339
+										}
280 340
 										foreach ($document as $key => $var)
281 341
 										{
282
-											if (strpos($key, 'extra_vars') !== 0 || !trim($var) || $var == 'N;') continue;
342
+											if (strpos($key, 'extra_vars') !== 0 || !trim($var) || $var == 'N;') {
343
+												continue;
344
+											}
283 345
 											$var_idx = str_replace('extra_vars','',$key);
284 346
 											$oDocumentController->insertDocumentExtraVar($module_srl, $document->document_srl, $var_idx, $var, 'extra_vars'.$var_idx, $lang_code);
285 347
 										}
@@ -316,7 +378,9 @@  discard block
 block discarded – undo
316 378
 		// extra_vars * Remove Column
317 379
 		for($i=1;$i<=20;$i++)
318 380
 		{
319
-			if(!$oDB->isColumnExists("documents","extra_vars".$i)) continue;
381
+			if(!$oDB->isColumnExists("documents","extra_vars".$i)) {
382
+				continue;
383
+			}
320 384
 			$oDB->dropColumn('documents','extra_vars'.$i);
321 385
 		}
322 386
 
@@ -338,7 +402,9 @@  discard block
 block discarded – undo
338 402
 			$site_args->default_language = $db_info->lang_type;
339 403
 
340 404
 			$output = executeQuery('module.insertSite', $site_args);
341
-			if(!$output->toBool()) return $output;
405
+			if(!$output->toBool()) {
406
+				return $output;
407
+			}
342 408
 		}
343 409
 
344 410
 		if($oDB->isIndexExists('sites','idx_domain'))
@@ -385,7 +451,9 @@  discard block
 block discarded – undo
385 451
 			foreach($output->data as $item)
386 452
 			{
387 453
 				$skin_path = explode('.', $item->skin);
388
-				if(count($skin_path) != 2) continue;
454
+				if(count($skin_path) != 2) {
455
+					continue;
456
+				}
389 457
 				if(is_dir(sprintf(_XE_PATH_ . 'themes/%s/modules/%s', $skin_path[0], $skin_path[1])))
390 458
 				{
391 459
 					unset($args);
@@ -411,7 +479,9 @@  discard block
 block discarded – undo
411 479
 			$output = executeQuery('module.updateMobileSkinFixModules');
412 480
 
413 481
 			$oModuleController = getController('module');
414
-			if(!$moduleConfig) $moduleConfig = new stdClass;
482
+			if(!$moduleConfig) {
483
+				$moduleConfig = new stdClass;
484
+			}
415 485
 			$moduleConfig->isUpdateFixedValue = TRUE;
416 486
 			$output = $oModuleController->updateModuleConfig('module', $moduleConfig);
417 487
 		}
@@ -422,10 +492,14 @@  discard block
 block discarded – undo
422 492
 	function updateForUniqueSiteDomain()
423 493
 	{
424 494
 		$output = executeQueryArray("module.getNonuniqueDomains");
425
-		if(!$output->data) return;
495
+		if(!$output->data) {
496
+			return;
497
+		}
426 498
 		foreach($output->data as $data)
427 499
 		{
428
-			if($data->count == 1) continue;
500
+			if($data->count == 1) {
501
+				continue;
502
+			}
429 503
 			$domain = $data->domain;
430 504
 			$args = new stdClass;
431 505
 			$args->domain = $domain;
Please login to merge, or discard this patch.
modules/module/module.mobile.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@
 block discarded – undo
4 4
 {
5 5
 	function dispModuleChangeLang()
6 6
 	{
7
-		$this->setTemplatePath(sprintf("%stpl/",$this->module_path));
7
+		$this->setTemplatePath(sprintf("%stpl/", $this->module_path));
8 8
 		$this->setTemplateFile('lang.html');
9 9
 	}
10 10
 }
Please login to merge, or discard this patch.
modules/module/module.view.php 3 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 /* Copyright (C) NAVER <http://www.navercorp.com> */
3 3
 /**
4
- * @class  moduleView
5
- * @author NAVER ([email protected])
6
- * @brief view class of the module module
7
- */
4
+	 * @class  moduleView
5
+	 * @author NAVER ([email protected])
6
+	 * @brief view class of the module module
7
+	 */
8 8
 class moduleView extends module
9 9
 {
10 10
 	/**
Please login to merge, or discard this patch.
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 	function init()
14 14
 	{
15 15
 		// Set the template path
16
-		$this->setTemplatePath($this->module_path.'tpl');
16
+		$this->setTemplatePath($this->module_path . 'tpl');
17 17
 	}
18 18
 
19 19
 	/**
@@ -25,14 +25,14 @@  discard block
 block discarded – undo
25 25
 		$skin = Context::get('skin');
26 26
 		// Get modules/skin information
27 27
 		$module_path = sprintf("./modules/%s/", $selected_module);
28
-		if(!is_dir($module_path)) $this->stop("msg_invalid_request");
28
+		if (!is_dir($module_path)) $this->stop("msg_invalid_request");
29 29
 
30 30
 		$skin_info_xml = sprintf("%sskins/%s/skin.xml", $module_path, $skin);
31
-		if(!file_exists($skin_info_xml)) $this->stop("msg_invalid_request");
31
+		if (!file_exists($skin_info_xml)) $this->stop("msg_invalid_request");
32 32
 
33 33
 		$oModuleModel = getModel('module');
34 34
 		$skin_info = $oModuleModel->loadSkinInfo($module_path, $skin);
35
-		Context::set('skin_info',$skin_info);
35
+		Context::set('skin_info', $skin_info);
36 36
 
37 37
 		$this->setLayoutFile("popup_layout");
38 38
 		$this->setTemplateFile("skin_info");
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 	 */
44 44
 	function dispModuleSelectList()
45 45
 	{
46
-		if(!Context::get('is_logged')) return new Object(-1, 'msg_not_permitted');
46
+		if (!Context::get('is_logged')) return new Object(-1, 'msg_not_permitted');
47 47
 
48 48
 		$oModuleModel = getModel('module');
49 49
 		// Extract the number of virtual sites
@@ -55,17 +55,17 @@  discard block
 block discarded – undo
55 55
 		// If there is no site keyword, use as information of the current virtual site
56 56
 		$args = new stdClass();
57 57
 		$logged_info = Context::get('logged_info');
58
-		if($logged_info->is_admin == 'Y')
58
+		if ($logged_info->is_admin == 'Y')
59 59
 		{
60 60
 			$query_id = 'module.getSiteModules';
61 61
 			$module_category_exists = false;
62
-			if(!$site_keyword)
62
+			if (!$site_keyword)
63 63
 			{
64 64
 				$site_module_info = Context::get('site_module_info');
65
-				if($site_module_info && $logged_info->is_admin != 'Y')
65
+				if ($site_module_info && $logged_info->is_admin != 'Y')
66 66
 				{
67 67
 					$site_keyword = $site_module_info->domain;
68
-					$args->site_srl = (int)$site_module_info->site_srl;
68
+					$args->site_srl = (int) $site_module_info->site_srl;
69 69
 					Context::set('site_keyword', $site_keyword);
70 70
 				}
71 71
 				else
@@ -85,18 +85,18 @@  discard block
 block discarded – undo
85 85
 		{
86 86
 			$query_id = 'module.getSiteModules';
87 87
 			$site_module_info = Context::get('site_module_info');
88
-			$args->site_srl = (int)$site_module_info->site_srl;
88
+			$args->site_srl = (int) $site_module_info->site_srl;
89 89
 		}
90 90
 		//if(is_null($args->site_srl)) $query_id = 'module.getDefaultModules';
91 91
 		// Get a list of modules at the site
92 92
 		$output = executeQueryArray($query_id, $args);
93 93
 		$category_list = $mid_list = array();
94
-		if(count($output->data))
94
+		if (count($output->data))
95 95
 		{
96
-			foreach($output->data as $key => $val)
96
+			foreach ($output->data as $key => $val)
97 97
 			{
98 98
 				$module = trim($val->module);
99
-				if(!$module) continue;
99
+				if (!$module) continue;
100 100
 
101 101
 				$category = $val->category;
102 102
 				$obj = new stdClass();
@@ -107,11 +107,11 @@  discard block
 block discarded – undo
107 107
 		}
108 108
 
109 109
 		$selected_module = Context::get('selected_module');
110
-		if(count($mid_list))
110
+		if (count($mid_list))
111 111
 		{
112
-			foreach($mid_list as $module => $val)
112
+			foreach ($mid_list as $module => $val)
113 113
 			{
114
-				if(!$selected_module) $selected_module = $module;
114
+				if (!$selected_module) $selected_module = $module;
115 115
 				$xml_info = $oModuleModel->getModuleInfoXml($module);
116 116
 				$mid_list[$module]->title = $xml_info->title;
117 117
 			}
@@ -136,15 +136,15 @@  discard block
 block discarded – undo
136 136
 	function dispModuleFileBox()
137 137
 	{
138 138
 		$logged_info = Context::get('logged_info');
139
-		if($logged_info->is_admin !='Y' && !$logged_info->is_site_admin) return new Object(-1, 'msg_not_permitted');
139
+		if ($logged_info->is_admin != 'Y' && !$logged_info->is_site_admin) return new Object(-1, 'msg_not_permitted');
140 140
 
141 141
 		$input_name = Context::get('input');
142
-		if(!preg_match('/^[a-z0-9_]+$/i', $input_name))
142
+		if (!preg_match('/^[a-z0-9_]+$/i', $input_name))
143 143
 		{
144 144
 			return new Object(-1, 'msg_invalid_request');
145 145
 		}
146 146
 
147
-		if(!$input_name) return new Object(-1, 'msg_not_permitted');
147
+		if (!$input_name) return new Object(-1, 'msg_not_permitted');
148 148
 
149 149
 		$addscript = sprintf('<script>//<![CDATA[
150 150
 				var selected_filebox_input_name = "%s";
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 		Context::set('filebox_list', $output->data);
157 157
 
158 158
 		$filter = Context::get('filter');
159
-		if($filter) Context::set('arrfilter',explode(',',$filter));
159
+		if ($filter) Context::set('arrfilter', explode(',', $filter));
160 160
 
161 161
 		Context::set('page_navigation', $output->page_navigation);
162 162
 		$this->setLayoutFile('popup_layout');
@@ -167,10 +167,10 @@  discard block
 block discarded – undo
167 167
 	function dispModuleFileBoxAdd()
168 168
 	{
169 169
 		$logged_info = Context::get('logged_info');
170
-		if($logged_info->is_admin !='Y' && !$logged_info->is_site_admin) return new Object(-1, 'msg_not_permitted');
170
+		if ($logged_info->is_admin != 'Y' && !$logged_info->is_site_admin) return new Object(-1, 'msg_not_permitted');
171 171
 
172 172
 		$filter = Context::get('filter');
173
-		if($filter) Context::set('arrfilter',explode(',',$filter));
173
+		if ($filter) Context::set('arrfilter', explode(',', $filter));
174 174
 
175 175
 		$this->setLayoutFile('popup_layout');
176 176
 		$this->setTemplateFile('filebox_add');
Please login to merge, or discard this patch.
Braces   +33 added lines, -16 removed lines patch added patch discarded remove patch
@@ -25,10 +25,14 @@  discard block
 block discarded – undo
25 25
 		$skin = Context::get('skin');
26 26
 		// Get modules/skin information
27 27
 		$module_path = sprintf("./modules/%s/", $selected_module);
28
-		if(!is_dir($module_path)) $this->stop("msg_invalid_request");
28
+		if(!is_dir($module_path)) {
29
+			$this->stop("msg_invalid_request");
30
+		}
29 31
 
30 32
 		$skin_info_xml = sprintf("%sskins/%s/skin.xml", $module_path, $skin);
31
-		if(!file_exists($skin_info_xml)) $this->stop("msg_invalid_request");
33
+		if(!file_exists($skin_info_xml)) {
34
+			$this->stop("msg_invalid_request");
35
+		}
32 36
 
33 37
 		$oModuleModel = getModel('module');
34 38
 		$skin_info = $oModuleModel->loadSkinInfo($module_path, $skin);
@@ -43,7 +47,9 @@  discard block
 block discarded – undo
43 47
 	 */
44 48
 	function dispModuleSelectList()
45 49
 	{
46
-		if(!Context::get('is_logged')) return new Object(-1, 'msg_not_permitted');
50
+		if(!Context::get('is_logged')) {
51
+			return new Object(-1, 'msg_not_permitted');
52
+		}
47 53
 
48 54
 		$oModuleModel = getModel('module');
49 55
 		// Extract the number of virtual sites
@@ -67,21 +73,18 @@  discard block
 block discarded – undo
67 73
 					$site_keyword = $site_module_info->domain;
68 74
 					$args->site_srl = (int)$site_module_info->site_srl;
69 75
 					Context::set('site_keyword', $site_keyword);
70
-				}
71
-				else
76
+				} else
72 77
 				{
73 78
 					$query_id = 'module.getDefaultModules';
74 79
 					$args->site_srl = 0;
75 80
 					$module_category_exists = true;
76 81
 				}
77 82
 				// If site keyword exists, extract information from the sites
78
-			}
79
-			else
83
+			} else
80 84
 			{
81 85
 				$args->site_keyword = $site_keyword;
82 86
 			}
83
-		}
84
-		else
87
+		} else
85 88
 		{
86 89
 			$query_id = 'module.getSiteModules';
87 90
 			$site_module_info = Context::get('site_module_info');
@@ -96,7 +99,9 @@  discard block
 block discarded – undo
96 99
 			foreach($output->data as $key => $val)
97 100
 			{
98 101
 				$module = trim($val->module);
99
-				if(!$module) continue;
102
+				if(!$module) {
103
+					continue;
104
+				}
100 105
 
101 106
 				$category = $val->category;
102 107
 				$obj = new stdClass();
@@ -111,7 +116,9 @@  discard block
 block discarded – undo
111 116
 		{
112 117
 			foreach($mid_list as $module => $val)
113 118
 			{
114
-				if(!$selected_module) $selected_module = $module;
119
+				if(!$selected_module) {
120
+					$selected_module = $module;
121
+				}
115 122
 				$xml_info = $oModuleModel->getModuleInfoXml($module);
116 123
 				$mid_list[$module]->title = $xml_info->title;
117 124
 			}
@@ -136,7 +143,9 @@  discard block
 block discarded – undo
136 143
 	function dispModuleFileBox()
137 144
 	{
138 145
 		$logged_info = Context::get('logged_info');
139
-		if($logged_info->is_admin !='Y' && !$logged_info->is_site_admin) return new Object(-1, 'msg_not_permitted');
146
+		if($logged_info->is_admin !='Y' && !$logged_info->is_site_admin) {
147
+			return new Object(-1, 'msg_not_permitted');
148
+		}
140 149
 
141 150
 		$input_name = Context::get('input');
142 151
 		if(!preg_match('/^[a-z0-9_]+$/i', $input_name))
@@ -144,7 +153,9 @@  discard block
 block discarded – undo
144 153
 			return new Object(-1, 'msg_invalid_request');
145 154
 		}
146 155
 
147
-		if(!$input_name) return new Object(-1, 'msg_not_permitted');
156
+		if(!$input_name) {
157
+			return new Object(-1, 'msg_not_permitted');
158
+		}
148 159
 
149 160
 		$addscript = sprintf('<script>//<![CDATA[
150 161
 				var selected_filebox_input_name = "%s";
@@ -156,7 +167,9 @@  discard block
 block discarded – undo
156 167
 		Context::set('filebox_list', $output->data);
157 168
 
158 169
 		$filter = Context::get('filter');
159
-		if($filter) Context::set('arrfilter',explode(',',$filter));
170
+		if($filter) {
171
+			Context::set('arrfilter',explode(',',$filter));
172
+		}
160 173
 
161 174
 		Context::set('page_navigation', $output->page_navigation);
162 175
 		$this->setLayoutFile('popup_layout');
@@ -167,10 +180,14 @@  discard block
 block discarded – undo
167 180
 	function dispModuleFileBoxAdd()
168 181
 	{
169 182
 		$logged_info = Context::get('logged_info');
170
-		if($logged_info->is_admin !='Y' && !$logged_info->is_site_admin) return new Object(-1, 'msg_not_permitted');
183
+		if($logged_info->is_admin !='Y' && !$logged_info->is_site_admin) {
184
+			return new Object(-1, 'msg_not_permitted');
185
+		}
171 186
 
172 187
 		$filter = Context::get('filter');
173
-		if($filter) Context::set('arrfilter',explode(',',$filter));
188
+		if($filter) {
189
+			Context::set('arrfilter',explode(',',$filter));
190
+		}
174 191
 
175 192
 		$this->setLayoutFile('popup_layout');
176 193
 		$this->setTemplateFile('filebox_add');
Please login to merge, or discard this patch.
modules/page/page.admin.controller.php 3 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 /* Copyright (C) NAVER <http://www.navercorp.com> */
3 3
 /**
4
- * @class  pageAdminController
5
- * @author NAVER ([email protected])
6
- * @brief page of the module admin controller class
7
- */
4
+	 * @class  pageAdminController
5
+	 * @author NAVER ([email protected])
6
+	 * @brief page of the module admin controller class
7
+	 */
8 8
 class pageAdminController extends page
9 9
 {
10 10
 	/**
Please login to merge, or discard this patch.
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -25,24 +25,24 @@  discard block
 block discarded – undo
25 25
 		// Set board module
26 26
 		$args = Context::getRequestVars();
27 27
 		$args->module = 'page';
28
-		$args->mid = $args->page_name;	//because if mid is empty in context, set start page mid
28
+		$args->mid = $args->page_name; //because if mid is empty in context, set start page mid
29 29
 		$args->path = (!$args->path) ? '' : $args->path;
30 30
 		$args->mpath = (!$args->mpath) ? '' : $args->mpath;
31 31
 		unset($args->page_name);
32 32
 
33
-		if($args->use_mobile != 'Y') $args->use_mobile = '';
33
+		if ($args->use_mobile != 'Y') $args->use_mobile = '';
34 34
 		// Check if an original module exists by using module_srl
35
-		if($args->module_srl)
35
+		if ($args->module_srl)
36 36
 		{
37 37
 			$columnList = array('module_srl');
38 38
 			$module_info = $oModuleModel->getModuleInfoByModuleSrl($args->module_srl, $columnList);
39
-			if($module_info->module_srl != $args->module_srl)
39
+			if ($module_info->module_srl != $args->module_srl)
40 40
 			{
41 41
 				unset($args->module_srl);
42 42
 			}
43 43
 			else
44 44
 			{
45
-				foreach($args as $key=>$val)
45
+				foreach ($args as $key=>$val)
46 46
 				{
47 47
 					$module_info->{$key} = $val;
48 48
 				}
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 				}
76 76
 		}
77 77
 		// Insert/update depending on module_srl
78
-		if(!$args->module_srl)
78
+		if (!$args->module_srl)
79 79
 		{
80 80
 			$output = $oModuleController->insertModule($args);
81 81
 			$msg_code = 'success_registed';
@@ -86,10 +86,10 @@  discard block
 block discarded – undo
86 86
 			$msg_code = 'success_updated';
87 87
 		}
88 88
 
89
-		if(!$output->toBool()) return $output;
89
+		if (!$output->toBool()) return $output;
90 90
 
91 91
 		$this->add("page", Context::get('page'));
92
-		$this->add('module_srl',$output->get('module_srl'));
92
+		$this->add('module_srl', $output->get('module_srl'));
93 93
 		$this->setMessage($msg_code);
94 94
 
95 95
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'module_srl', $output->get('module_srl'), 'act', 'dispPageAdminInfo');
@@ -106,16 +106,16 @@  discard block
 block discarded – undo
106 106
 
107 107
 	function putDocumentsInPageToArray($target, &$array)
108 108
 	{
109
-		if(!$target) return;
109
+		if (!$target) return;
110 110
 		preg_match_all('!<img hasContent="true" ([^>]+)!is', $target, $matches);
111 111
 		$pattern = '!document_srl="(\d+)"!';
112
-		foreach($matches[1] as $match)
112
+		foreach ($matches[1] as $match)
113 113
 		{
114 114
 			$match2 = null;
115 115
 			preg_match($pattern, $match, $match2);
116
-			if(count($match2))
116
+			if (count($match2))
117 117
 			{
118
-				$array[(int)$match2[1]] = 1;
118
+				$array[(int) $match2[1]] = 1;
119 119
 			}
120 120
 		}
121 121
 	}
@@ -127,20 +127,20 @@  discard block
 block discarded – undo
127 127
 	{
128 128
 		$module_srl = Context::get('module_srl');
129 129
 		$content = Context::get('content');
130
-		if(!$module_srl) return new Object(-1,'msg_invalid_request');
130
+		if (!$module_srl) return new Object(-1, 'msg_invalid_request');
131 131
 		$mcontent = Context::get('mcontent');
132 132
 		$type = Context::get('type');
133 133
 		// Guhaeom won information page
134 134
 		$oModuleModel = getModel('module');
135 135
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
136
-		if($type == "mobile")
136
+		if ($type == "mobile")
137 137
 		{
138
-			if(!$mcontent) $mcontent = '';
138
+			if (!$mcontent) $mcontent = '';
139 139
 			$module_info->mcontent = $mcontent;
140 140
 		}
141 141
 		else
142 142
 		{
143
-			if(!isset($content)) $content ='';
143
+			if (!isset($content)) $content = '';
144 144
 			$module_info->content = $content;
145 145
 		}
146 146
 
@@ -154,11 +154,11 @@  discard block
 block discarded – undo
154 154
 		$obj->module_srl = $module_srl;
155 155
 		$obj->list_count = 99999999;
156 156
 		$output = $oDocumentModel->getDocumentList($obj);
157
-		if(count($output->data))
157
+		if (count($output->data))
158 158
 		{
159
-			foreach($output->data as $document)
159
+			foreach ($output->data as $document)
160 160
 			{
161
-				if($document_srls[$document->document_srl]) continue;
161
+				if ($document_srls[$document->document_srl]) continue;
162 162
 				$oDocumentController->deleteDocument($document->document_srl, true);
163 163
 			}
164 164
 		}
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 		$oModuleController = getController('module');
167 167
 		// Save
168 168
 		$output = $oModuleController->updateModule($module_info);
169
-		if(!$output->toBool()) return $output;
169
+		if (!$output->toBool()) return $output;
170 170
 		// On the page, change the validity status of the attached file
171 171
 		$oFileController = getController('file');
172 172
 		$oFileController->setFilesValid($module_info->module_srl);
@@ -189,10 +189,10 @@  discard block
 block discarded – undo
189 189
 		// Get an original
190 190
 		$oModuleController = getController('module');
191 191
 		$output = $oModuleController->deleteModule($module_srl);
192
-		if(!$output->toBool()) return $output;
192
+		if (!$output->toBool()) return $output;
193 193
 
194
-		$this->add('module','page');
195
-		$this->add('page',Context::get('page'));
194
+		$this->add('module', 'page');
195
+		$this->add('page', Context::get('page'));
196 196
 		$this->setMessage('success_deleted');
197 197
 
198 198
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispPageAdminContent');
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 		$args = Context::getRequestVars();
209 209
 		// Insert by creating the module Controller object
210 210
 		$oModuleController = getController('module');
211
-		$output = $oModuleController->insertModuleConfig('page',$args);
211
+		$output = $oModuleController->insertModuleConfig('page', $args);
212 212
 		return $output;
213 213
 	}
214 214
 
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 		$file_srl = Context::get('file_srl');
240 240
 		// Create the controller object file class
241 241
 		$oFileController = getController('file');
242
-		if($file_srl) $output = $oFileController->deleteFile($file_srl, $this->grant->manager);
242
+		if ($file_srl) $output = $oFileController->deleteFile($file_srl, $this->grant->manager);
243 243
 		// Attachment to the output of the list, java script
244 244
 		$oFileController->printUploadedFileList($upload_target_srl);
245 245
 	}
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
 	{
252 252
 		$module_srl = Context::get('module_srl');
253 253
 
254
-		if(!$module_srl) return;
254
+		if (!$module_srl) return;
255 255
 
256 256
 		$oModuleModel = getModel('module');
257 257
 		$columnList = array('module_srl', 'content');
@@ -263,27 +263,27 @@  discard block
 block discarded – undo
263 263
 		$oWidgetController = getController('widget');
264 264
 		$oWidgetController->recompileWidget($content);
265 265
 
266
-		if($module_info->page_type == 'WIDGET')
266
+		if ($module_info->page_type == 'WIDGET')
267 267
 		{
268 268
 			$path = _XE_PATH_ . 'files/cache/page/';
269 269
 			$cache_files = FileHandler::readDir($path, '/^' . $module_info->module_srl . '\./');
270
-			foreach($cache_files as $file_name)
270
+			foreach ($cache_files as $file_name)
271 271
 			{
272 272
 				FileHandler::removeFile($path . $module_info->module_srl . '.' . $file_name);
273 273
 			}
274 274
 		}
275
-		else if($module_info->page_type == 'OUTSIDE')
275
+		else if ($module_info->page_type == 'OUTSIDE')
276 276
 		{
277 277
 			$path = _XE_PATH_ . 'files/cache/page/';
278 278
 			$cache_files = FileHandler::readDir($path, '/^' . $module_info->module_srl . './');
279
-			foreach($cache_files as $file_name)
279
+			foreach ($cache_files as $file_name)
280 280
 			{
281 281
 				FileHandler::removeFile($path . $module_info->module_srl . '.' . $file_name);
282 282
 			}
283 283
 		}
284 284
 
285 285
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
286
-		if($oCacheHandler->isSupport())
286
+		if ($oCacheHandler->isSupport())
287 287
 		{
288 288
 			$object_key = 'mid_info:' . $module_info->module_srl;
289 289
 			$cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 		$oModuleModel = getModel('module');
302 302
 		$grant = $oModuleModel->getGrant($this->module_info, $logged_info);
303 303
 
304
-		if(!$grant->manager)
304
+		if (!$grant->manager)
305 305
 		{
306 306
 			return new Object(-1, 'msg_not_permitted');
307 307
 		}
@@ -311,9 +311,9 @@  discard block
 block discarded – undo
311 311
 		$obj->is_notice = 'N';
312 312
 
313 313
 		settype($obj->title, "string");
314
-		if($obj->title == '') $obj->title = cut_str(strip_tags($obj->content),20,'...');
314
+		if ($obj->title == '') $obj->title = cut_str(strip_tags($obj->content), 20, '...');
315 315
 		//그래도 없으면 Untitled
316
-		if($obj->title == '') $obj->title = 'Untitled';
316
+		if ($obj->title == '') $obj->title = 'Untitled';
317 317
 
318 318
 		$document_srl = $obj->document_srl;
319 319
 
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
 		$target = ($obj->ismobile == 'Y') ? 'mdocument_srl' : 'document_srl';
325 325
 
326 326
 		// 이미 존재하는 경우 수정
327
-		if($oDocument->isExists() && $oDocument->document_srl == $obj->document_srl) 
327
+		if ($oDocument->isExists() && $oDocument->document_srl == $obj->document_srl) 
328 328
 		{
329 329
 			$output = $oDocumentController->updateDocument($oDocument, $obj);
330 330
 			$msg_code = 'success_updated';
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
 			$document_srl = $output->get('document_srl');
338 338
 		}
339 339
 
340
-		if(!isset($this->module_info->{$target}) || (isset($this->module_info->{$target}) && $this->module_info->{$target} !== $document_srl))
340
+		if (!isset($this->module_info->{$target}) || (isset($this->module_info->{$target}) && $this->module_info->{$target} !== $document_srl))
341 341
 		{
342 342
 			$oModuleController = getController('module');
343 343
 			$this->module_info->{$target} = $document_srl;
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
 		}
346 346
 
347 347
 		// 오류 발생시 멈춤
348
-		if(!$output->toBool()) return $output;
348
+		if (!$output->toBool()) return $output;
349 349
 
350 350
 		// 결과를 리턴
351 351
 		$this->add('mid', Context::get('mid'));
Please login to merge, or discard this patch.
Braces   +47 added lines, -24 removed lines patch added patch discarded remove patch
@@ -30,7 +30,9 @@  discard block
 block discarded – undo
30 30
 		$args->mpath = (!$args->mpath) ? '' : $args->mpath;
31 31
 		unset($args->page_name);
32 32
 
33
-		if($args->use_mobile != 'Y') $args->use_mobile = '';
33
+		if($args->use_mobile != 'Y') {
34
+			$args->use_mobile = '';
35
+		}
34 36
 		// Check if an original module exists by using module_srl
35 37
 		if($args->module_srl)
36 38
 		{
@@ -39,8 +41,7 @@  discard block
 block discarded – undo
39 41
 			if($module_info->module_srl != $args->module_srl)
40 42
 			{
41 43
 				unset($args->module_srl);
42
-			}
43
-			else
44
+			} else
44 45
 			{
45 46
 				foreach($args as $key=>$val)
46 47
 				{
@@ -79,14 +80,15 @@  discard block
 block discarded – undo
79 80
 		{
80 81
 			$output = $oModuleController->insertModule($args);
81 82
 			$msg_code = 'success_registed';
82
-		}
83
-		else
83
+		} else
84 84
 		{
85 85
 			$output = $oModuleController->updateModule($args);
86 86
 			$msg_code = 'success_updated';
87 87
 		}
88 88
 
89
-		if(!$output->toBool()) return $output;
89
+		if(!$output->toBool()) {
90
+			return $output;
91
+		}
90 92
 
91 93
 		$this->add("page", Context::get('page'));
92 94
 		$this->add('module_srl',$output->get('module_srl'));
@@ -106,7 +108,9 @@  discard block
 block discarded – undo
106 108
 
107 109
 	function putDocumentsInPageToArray($target, &$array)
108 110
 	{
109
-		if(!$target) return;
111
+		if(!$target) {
112
+			return;
113
+		}
110 114
 		preg_match_all('!<img hasContent="true" ([^>]+)!is', $target, $matches);
111 115
 		$pattern = '!document_srl="(\d+)"!';
112 116
 		foreach($matches[1] as $match)
@@ -127,7 +131,9 @@  discard block
 block discarded – undo
127 131
 	{
128 132
 		$module_srl = Context::get('module_srl');
129 133
 		$content = Context::get('content');
130
-		if(!$module_srl) return new Object(-1,'msg_invalid_request');
134
+		if(!$module_srl) {
135
+			return new Object(-1,'msg_invalid_request');
136
+		}
131 137
 		$mcontent = Context::get('mcontent');
132 138
 		$type = Context::get('type');
133 139
 		// Guhaeom won information page
@@ -135,12 +141,15 @@  discard block
 block discarded – undo
135 141
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
136 142
 		if($type == "mobile")
137 143
 		{
138
-			if(!$mcontent) $mcontent = '';
144
+			if(!$mcontent) {
145
+				$mcontent = '';
146
+			}
139 147
 			$module_info->mcontent = $mcontent;
140
-		}
141
-		else
148
+		} else
142 149
 		{
143
-			if(!isset($content)) $content ='';
150
+			if(!isset($content)) {
151
+				$content ='';
152
+			}
144 153
 			$module_info->content = $content;
145 154
 		}
146 155
 
@@ -158,7 +167,9 @@  discard block
 block discarded – undo
158 167
 		{
159 168
 			foreach($output->data as $document)
160 169
 			{
161
-				if($document_srls[$document->document_srl]) continue;
170
+				if($document_srls[$document->document_srl]) {
171
+					continue;
172
+				}
162 173
 				$oDocumentController->deleteDocument($document->document_srl, true);
163 174
 			}
164 175
 		}
@@ -166,7 +177,9 @@  discard block
 block discarded – undo
166 177
 		$oModuleController = getController('module');
167 178
 		// Save
168 179
 		$output = $oModuleController->updateModule($module_info);
169
-		if(!$output->toBool()) return $output;
180
+		if(!$output->toBool()) {
181
+			return $output;
182
+		}
170 183
 		// On the page, change the validity status of the attached file
171 184
 		$oFileController = getController('file');
172 185
 		$oFileController->setFilesValid($module_info->module_srl);
@@ -189,7 +202,9 @@  discard block
 block discarded – undo
189 202
 		// Get an original
190 203
 		$oModuleController = getController('module');
191 204
 		$output = $oModuleController->deleteModule($module_srl);
192
-		if(!$output->toBool()) return $output;
205
+		if(!$output->toBool()) {
206
+			return $output;
207
+		}
193 208
 
194 209
 		$this->add('module','page');
195 210
 		$this->add('page',Context::get('page'));
@@ -239,7 +254,9 @@  discard block
 block discarded – undo
239 254
 		$file_srl = Context::get('file_srl');
240 255
 		// Create the controller object file class
241 256
 		$oFileController = getController('file');
242
-		if($file_srl) $output = $oFileController->deleteFile($file_srl, $this->grant->manager);
257
+		if($file_srl) {
258
+			$output = $oFileController->deleteFile($file_srl, $this->grant->manager);
259
+		}
243 260
 		// Attachment to the output of the list, java script
244 261
 		$oFileController->printUploadedFileList($upload_target_srl);
245 262
 	}
@@ -251,7 +268,9 @@  discard block
 block discarded – undo
251 268
 	{
252 269
 		$module_srl = Context::get('module_srl');
253 270
 
254
-		if(!$module_srl) return;
271
+		if(!$module_srl) {
272
+			return;
273
+		}
255 274
 
256 275
 		$oModuleModel = getModel('module');
257 276
 		$columnList = array('module_srl', 'content');
@@ -271,8 +290,7 @@  discard block
 block discarded – undo
271 290
 			{
272 291
 				FileHandler::removeFile($path . $module_info->module_srl . '.' . $file_name);
273 292
 			}
274
-		}
275
-		else if($module_info->page_type == 'OUTSIDE')
293
+		} else if($module_info->page_type == 'OUTSIDE')
276 294
 		{
277 295
 			$path = _XE_PATH_ . 'files/cache/page/';
278 296
 			$cache_files = FileHandler::readDir($path, '/^' . $module_info->module_srl . './');
@@ -311,9 +329,13 @@  discard block
 block discarded – undo
311 329
 		$obj->is_notice = 'N';
312 330
 
313 331
 		settype($obj->title, "string");
314
-		if($obj->title == '') $obj->title = cut_str(strip_tags($obj->content),20,'...');
332
+		if($obj->title == '') {
333
+			$obj->title = cut_str(strip_tags($obj->content),20,'...');
334
+		}
315 335
 		//그래도 없으면 Untitled
316
-		if($obj->title == '') $obj->title = 'Untitled';
336
+		if($obj->title == '') {
337
+			$obj->title = 'Untitled';
338
+		}
317 339
 
318 340
 		$document_srl = $obj->document_srl;
319 341
 
@@ -328,8 +350,7 @@  discard block
 block discarded – undo
328 350
 		{
329 351
 			$output = $oDocumentController->updateDocument($oDocument, $obj);
330 352
 			$msg_code = 'success_updated';
331
-		}
332
-		else
353
+		} else
333 354
 		{
334 355
 			// 그렇지 않으면 신규 등록
335 356
 			$output = $oDocumentController->insertDocument($obj, $bAnonymous);
@@ -345,7 +366,9 @@  discard block
 block discarded – undo
345 366
 		}
346 367
 
347 368
 		// 오류 발생시 멈춤
348
-		if(!$output->toBool()) return $output;
369
+		if(!$output->toBool()) {
370
+			return $output;
371
+		}
349 372
 
350 373
 		// 결과를 리턴
351 374
 		$this->add('mid', Context::get('mid'));
Please login to merge, or discard this patch.