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 — develop ( 594959...601687 )
by gyeong-won
08:31
created
modules/rss/rss.controller.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -28,29 +28,29 @@  discard block
 block discarded – undo
28 28
 		$current_module_srl = Context::get('module_srl');
29 29
 		$site_module_info = Context::get('site_module_info');
30 30
 
31
-		if(is_array($current_module_srl))
31
+		if (is_array($current_module_srl))
32 32
 		{
33 33
 			unset($current_module_srl);
34 34
 		}
35
-		if(!$current_module_srl) {
35
+		if (!$current_module_srl) {
36 36
 			$current_module_info = Context::get('current_module_info');
37 37
 			$current_module_srl = $current_module_info->module_srl;
38 38
 		}
39 39
 
40
-		if(!$current_module_srl) return new BaseObject();
40
+		if (!$current_module_srl) return new BaseObject();
41 41
 		// Imported rss settings of the selected module
42 42
 		$oRssModel = getModel('rss');
43 43
 		$rss_config = $oRssModel->getRssModuleConfig($current_module_srl);
44 44
 
45
-		if($rss_config->open_rss != 'N')
45
+		if ($rss_config->open_rss != 'N')
46 46
 		{
47 47
 			Context::set('rss_url', $oRssModel->getModuleFeedUrl(Context::get('vid'), Context::get('mid'), 'rss'));
48 48
 			Context::set('atom_url', $oRssModel->getModuleFeedUrl(Context::get('vid'), Context::get('mid'), 'atom'));
49 49
 		}
50 50
 
51
-		if(Context::isInstalled() && $site_module_info->mid == Context::get('mid') && $total_config->use_total_feed != 'N')
51
+		if (Context::isInstalled() && $site_module_info->mid == Context::get('mid') && $total_config->use_total_feed != 'N')
52 52
 		{
53
-			if(Context::isAllowRewrite() && !Context::get('vid'))
53
+			if (Context::isAllowRewrite() && !Context::get('vid'))
54 54
 			{
55 55
 				$request_uri = Context::getRequestUri();
56 56
 				Context::set('general_rss_url', $request_uri.'rss');
@@ -58,8 +58,8 @@  discard block
 block discarded – undo
58 58
 			}
59 59
 			else
60 60
 			{
61
-				Context::set('general_rss_url', getUrl('','module','rss','act','rss'));
62
-				Context::set('general_atom_url', getUrl('','module','rss','act','atom'));
61
+				Context::set('general_rss_url', getUrl('', 'module', 'rss', 'act', 'rss'));
62
+				Context::set('general_atom_url', getUrl('', 'module', 'rss', 'act', 'atom'));
63 63
 			}
64 64
 		}
65 65
 
@@ -72,9 +72,9 @@  discard block
 block discarded – undo
72 72
 		$rssConfig = $oModuleModel->getModulePartConfig('rss', $obj->originModuleSrl);
73 73
 
74 74
 		$oModuleController = getController('module');
75
-		if(is_array($obj->moduleSrlList))
75
+		if (is_array($obj->moduleSrlList))
76 76
 		{
77
-			foreach($obj->moduleSrlList AS $key=>$moduleSrl)
77
+			foreach ($obj->moduleSrlList AS $key=>$moduleSrl)
78 78
 			{
79 79
 				$oModuleController->insertModulePartConfig('rss', $moduleSrl, $rssConfig);
80 80
 			}
Please login to merge, or discard this patch.
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -37,7 +37,9 @@  discard block
 block discarded – undo
37 37
 			$current_module_srl = $current_module_info->module_srl;
38 38
 		}
39 39
 
40
-		if(!$current_module_srl) return new BaseObject();
40
+		if(!$current_module_srl) {
41
+			return new BaseObject();
42
+		}
41 43
 		// Imported rss settings of the selected module
42 44
 		$oRssModel = getModel('rss');
43 45
 		$rss_config = $oRssModel->getRssModuleConfig($current_module_srl);
@@ -55,8 +57,7 @@  discard block
 block discarded – undo
55 57
 				$request_uri = Context::getRequestUri();
56 58
 				Context::set('general_rss_url', $request_uri.'rss');
57 59
 				Context::set('general_atom_url', $request_uri.'atom');
58
-			}
59
-			else
60
+			} else
60 61
 			{
61 62
 				Context::set('general_rss_url', getUrl('','module','rss','act','rss'));
62 63
 				Context::set('general_atom_url', getUrl('','module','rss','act','atom'));
Please login to merge, or discard this patch.
modules/rss/rss.view.php 2 patches
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -30,24 +30,24 @@  discard block
 block discarded – undo
30 30
 		$oModuleModel = getModel('module');
31 31
 		$oModuleController = getController('module');
32 32
 		// Get the content and information for the current requested module if the method is not called from another module
33
-		if(!$document_list)
33
+		if (!$document_list)
34 34
 		{
35 35
 			$site_module_info = Context::get('site_module_info');
36 36
 			$site_srl = $site_module_info->site_srl;
37 37
 			$mid = Context::getRequestVars()->mid; // The target module id, if absent, then all
38
-			$start_date = (int)Context::get('start_date');
39
-			$end_date = (int)Context::get('end_date');
38
+			$start_date = (int) Context::get('start_date');
39
+			$end_date = (int) Context::get('end_date');
40 40
 
41 41
 			$module_srls = array();
42 42
 			$rss_config = array();
43 43
 			$total_config = '';
44 44
 			$total_config = $oModuleModel->getModuleConfig('rss');
45 45
 			// If one is specified, extract only for this mid
46
-			if($mid)
46
+			if ($mid)
47 47
 			{
48 48
 				$module_srl = $this->module_info->module_srl;
49 49
 				$config = $oModuleModel->getModulePartConfig('rss', $module_srl);
50
-				if($config->open_rss && $config->open_rss != 'N')
50
+				if ($config->open_rss && $config->open_rss != 'N')
51 51
 				{
52 52
 					$module_srls[] = $module_srl; 
53 53
 					$open_rss_config[$module_srl] = $config->open_rss;
@@ -56,14 +56,14 @@  discard block
 block discarded – undo
56 56
 			}
57 57
 			else
58 58
 			{
59
-				if($total_config->use_total_feed != 'N')
59
+				if ($total_config->use_total_feed != 'N')
60 60
 				{
61 61
 					$rss_config = $oModuleModel->getModulePartConfigs('rss', $site_srl);
62
-					if($rss_config)
62
+					if ($rss_config)
63 63
 					{
64
-						foreach($rss_config as $module_srl => $config)
64
+						foreach ($rss_config as $module_srl => $config)
65 65
 						{
66
-							if($config && $config->open_rss != 'N' && $config->open_total_feed != 'T_N')
66
+							if ($config && $config->open_rss != 'N' && $config->open_total_feed != 'T_N')
67 67
 							{
68 68
 								$module_srls[] = $module_srl;
69 69
 								$open_rss_config[$module_srl] = $config->open_rss;
@@ -73,39 +73,39 @@  discard block
 block discarded – undo
73 73
 				}
74 74
 			}
75 75
 
76
-			if(!count($module_srls) && !$add_description) return $this->dispError();
76
+			if (!count($module_srls) && !$add_description) return $this->dispError();
77 77
 
78 78
 			$info = new stdClass;
79 79
 			$args = new stdClass;
80 80
 
81
-			if($module_srls)
81
+			if ($module_srls)
82 82
 			{
83
-				$args->module_srl = implode(',',$module_srls);
83
+				$args->module_srl = implode(',', $module_srls);
84 84
 				//$module_list = $oModuleModel->getMidList($args);	//perhaps module_list varialbles not use
85 85
 
86 86
 				$args->search_target = 'is_secret';
87 87
 				$args->search_keyword = 'N';
88
-				$args->page = (int)Context::get('page');
88
+				$args->page = (int) Context::get('page');
89 89
 				$args->list_count = 15;
90
-				if($total_config->feed_document_count) $args->list_count = $total_config->feed_document_count;
91
-				if(!$args->page || $args->page < 1) $args->page = 1;
92
-				if($start_date || $start_date != 0) $args->start_date = $start_date;
93
-				if($end_date || $end_date != 0) $args->end_date = $end_date;
94
-				if($start_date == 0) unset($start_date);
95
-				if($end_date == 0) unset($end_date);
90
+				if ($total_config->feed_document_count) $args->list_count = $total_config->feed_document_count;
91
+				if (!$args->page || $args->page < 1) $args->page = 1;
92
+				if ($start_date || $start_date != 0) $args->start_date = $start_date;
93
+				if ($end_date || $end_date != 0) $args->end_date = $end_date;
94
+				if ($start_date == 0) unset($start_date);
95
+				if ($end_date == 0) unset($end_date);
96 96
 
97 97
 				$args->sort_index = 'list_order'; 
98 98
 				$args->order_type = 'asc';
99 99
 				$output = $oDocumentModel->getDocumentList($args);
100 100
 				$document_list = $output->data;
101 101
 				// Extract the feed title and information with Context::getBrowserTitle
102
-				if($mid)
102
+				if ($mid)
103 103
 				{
104 104
 					$info->title = Context::getBrowserTitle();
105 105
 					$oModuleController->replaceDefinedLangCode($info->title);
106 106
 
107
-					$info->title = str_replace('\'', '&apos;',$info->title);
108
-					if($config->feed_description)
107
+					$info->title = str_replace('\'', '&apos;', $info->title);
108
+					if ($config->feed_description)
109 109
 					{
110 110
 						$info->description = str_replace('\'', '&apos;', htmlspecialchars($config->feed_description, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
111 111
 					}
@@ -113,9 +113,9 @@  discard block
 block discarded – undo
113 113
 					{
114 114
 						$info->description = str_replace('\'', '&apos;', htmlspecialchars($this->module_info->description, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
115 115
 					}
116
-					$info->link = getUrl('','mid',$mid);
116
+					$info->link = getUrl('', 'mid', $mid);
117 117
 					$info->feed_copyright = str_replace('\'', '&apos;', htmlspecialchars($feed_config->feed_copyright, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
118
-					if(!$info->feed_copyright)
118
+					if (!$info->feed_copyright)
119 119
 					{
120 120
 						$info->feed_copyright = str_replace('\'', '&apos;', htmlspecialchars($total_config->feed_copyright, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
121 121
 					}
@@ -123,10 +123,10 @@  discard block
 block discarded – undo
123 123
 			}
124 124
 		}
125 125
 
126
-		if(!$info->title)
126
+		if (!$info->title)
127 127
 		{
128
-			if($rss_title) $info->title = $rss_title;
129
-			else if($total_config->feed_title) $info->title = $total_config->feed_title;
128
+			if ($rss_title) $info->title = $rss_title;
129
+			else if ($total_config->feed_title) $info->title = $total_config->feed_title;
130 130
 			else
131 131
 			{
132 132
 				$site_module_info = Context::get('site_module_info');
@@ -139,15 +139,15 @@  discard block
 block discarded – undo
139 139
 			$info->link = Context::getRequestUri();
140 140
 			$info->feed_copyright = str_replace('\'', '&apos;', htmlspecialchars($total_config->feed_copyright, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
141 141
 		}
142
-		if($add_description) $info->description .= "\r\n".$add_description;
142
+		if ($add_description) $info->description .= "\r\n".$add_description;
143 143
 
144
-		if($total_config->image) $info->image = Context::getRequestUri().str_replace('\'', '&apos;', htmlspecialchars($total_config->image, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
145
-		switch(Context::get('format'))
144
+		if ($total_config->image) $info->image = Context::getRequestUri().str_replace('\'', '&apos;', htmlspecialchars($total_config->image, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
145
+		switch (Context::get('format'))
146 146
 		{
147 147
 			case 'atom':
148 148
 				$info->date = date('Y-m-d\TH:i:sP');
149
-				if($mid) { $info->id = getUrl('','mid',$mid,'act','atom','page',Context::get('page'),'start_date',Context::get('start_date'),'end_date',Context::get('end_date')); }
150
-				else { $info->id = getUrl('','module','rss','act','atom','page',Context::get('page'),'start_date',Context::get('start_date'),'end_date',Context::get('end_date')); }
149
+				if ($mid) { $info->id = getUrl('', 'mid', $mid, 'act', 'atom', 'page', Context::get('page'), 'start_date', Context::get('start_date'), 'end_date', Context::get('end_date')); }
150
+				else { $info->id = getUrl('', 'module', 'rss', 'act', 'atom', 'page', Context::get('page'), 'start_date', Context::get('start_date'), 'end_date', Context::get('end_date')); }
151 151
 				break;
152 152
 			case 'rss1.0':
153 153
 				$info->date = date('Y-m-d\TH:i:sP');
@@ -157,22 +157,22 @@  discard block
 block discarded – undo
157 157
 				break;
158 158
 		}
159 159
 
160
-		if($_SERVER['HTTPS']=='on') $proctcl = 'https://';
160
+		if ($_SERVER['HTTPS'] == 'on') $proctcl = 'https://';
161 161
 		else $proctcl = 'http://';
162 162
 
163 163
 		$temp_link = explode('/', $info->link);
164
-		if($temp_link[0]=='' && $info->link)
164
+		if ($temp_link[0] == '' && $info->link)
165 165
 		{
166 166
 			$info->link = $proctcl.$_SERVER['HTTP_HOST'].$info->link;
167 167
 		}
168 168
 
169 169
 		$temp_id = explode('/', $info->id);
170
-		if($temp_id[0]=='' && $info->id)
170
+		if ($temp_id[0] == '' && $info->id)
171 171
 		{
172 172
 			$info->id = $proctcl.$_SERVER['HTTP_HOST'].$info->id;
173 173
 		}
174 174
 
175
-		$info->language = str_replace('jp','ja',Context::getLangType());
175
+		$info->language = str_replace('jp', 'ja', Context::getLangType());
176 176
 		// Set the variables used in the RSS output
177 177
 		Context::set('info', $info);
178 178
 		Context::set('feed_config', $config);
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 	function dispError()
229 229
 	{
230 230
 		// Prepare the output message
231
-		$this->rss(null, null, Context::getLang('msg_rss_is_disabled') );
231
+		$this->rss(null, null, Context::getLang('msg_rss_is_disabled'));
232 232
 	}
233 233
 
234 234
 	/**
@@ -243,12 +243,12 @@  discard block
 block discarded – undo
243 243
 		$current_module_srl = Context::get('module_srl');
244 244
 		$current_module_srls = Context::get('module_srls');
245 245
 
246
-		if(!$current_module_srl && !$current_module_srls)
246
+		if (!$current_module_srl && !$current_module_srls)
247 247
 		{
248 248
 			// Get information of the selected module
249 249
 			$current_module_info = Context::get('current_module_info');
250 250
 			$current_module_srl = $current_module_info->module_srl;
251
-			if(!$current_module_srl) return new BaseObject();
251
+			if (!$current_module_srl) return new BaseObject();
252 252
 		}
253 253
 		// Get teh RSS configurations for the selected module
254 254
 		$oRssModel = getModel('rss');
Please login to merge, or discard this patch.
Braces   +43 added lines, -21 removed lines patch added patch discarded remove patch
@@ -53,8 +53,7 @@  discard block
 block discarded – undo
53 53
 					$open_rss_config[$module_srl] = $config->open_rss;
54 54
 				}
55 55
 				// If mid is not selected, then get all
56
-			}
57
-			else
56
+			} else
58 57
 			{
59 58
 				if($total_config->use_total_feed != 'N')
60 59
 				{
@@ -73,7 +72,9 @@  discard block
 block discarded – undo
73 72
 				}
74 73
 			}
75 74
 
76
-			if(!count($module_srls) && !$add_description) return $this->dispError();
75
+			if(!count($module_srls) && !$add_description) {
76
+				return $this->dispError();
77
+			}
77 78
 
78 79
 			$info = new stdClass;
79 80
 			$args = new stdClass;
@@ -87,12 +88,24 @@  discard block
 block discarded – undo
87 88
 				$args->search_keyword = 'N';
88 89
 				$args->page = (int)Context::get('page');
89 90
 				$args->list_count = 15;
90
-				if($total_config->feed_document_count) $args->list_count = $total_config->feed_document_count;
91
-				if(!$args->page || $args->page < 1) $args->page = 1;
92
-				if($start_date || $start_date != 0) $args->start_date = $start_date;
93
-				if($end_date || $end_date != 0) $args->end_date = $end_date;
94
-				if($start_date == 0) unset($start_date);
95
-				if($end_date == 0) unset($end_date);
91
+				if($total_config->feed_document_count) {
92
+					$args->list_count = $total_config->feed_document_count;
93
+				}
94
+				if(!$args->page || $args->page < 1) {
95
+					$args->page = 1;
96
+				}
97
+				if($start_date || $start_date != 0) {
98
+					$args->start_date = $start_date;
99
+				}
100
+				if($end_date || $end_date != 0) {
101
+					$args->end_date = $end_date;
102
+				}
103
+				if($start_date == 0) {
104
+					unset($start_date);
105
+				}
106
+				if($end_date == 0) {
107
+					unset($end_date);
108
+				}
96 109
 
97 110
 				$args->sort_index = 'list_order'; 
98 111
 				$args->order_type = 'asc';
@@ -108,8 +121,7 @@  discard block
 block discarded – undo
108 121
 					if($config->feed_description)
109 122
 					{
110 123
 						$info->description = str_replace('\'', '&apos;', htmlspecialchars($config->feed_description, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
111
-					}
112
-					else
124
+					} else
113 125
 					{
114 126
 						$info->description = str_replace('\'', '&apos;', htmlspecialchars($this->module_info->description, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
115 127
 					}
@@ -125,9 +137,11 @@  discard block
 block discarded – undo
125 137
 
126 138
 		if(!$info->title)
127 139
 		{
128
-			if($rss_title) $info->title = $rss_title;
129
-			else if($total_config->feed_title) $info->title = $total_config->feed_title;
130
-			else
140
+			if($rss_title) {
141
+				$info->title = $rss_title;
142
+			} else if($total_config->feed_title) {
143
+				$info->title = $total_config->feed_title;
144
+			} else
131 145
 			{
132 146
 				$site_module_info = Context::get('site_module_info');
133 147
 				$info->title = $site_module_info->browser_title;
@@ -139,15 +153,18 @@  discard block
 block discarded – undo
139 153
 			$info->link = Context::getRequestUri();
140 154
 			$info->feed_copyright = str_replace('\'', '&apos;', htmlspecialchars($total_config->feed_copyright, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
141 155
 		}
142
-		if($add_description) $info->description .= "\r\n".$add_description;
156
+		if($add_description) {
157
+			$info->description .= "\r\n".$add_description;
158
+		}
143 159
 
144
-		if($total_config->image) $info->image = Context::getRequestUri().str_replace('\'', '&apos;', htmlspecialchars($total_config->image, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
160
+		if($total_config->image) {
161
+			$info->image = Context::getRequestUri().str_replace('\'', '&apos;', htmlspecialchars($total_config->image, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
162
+		}
145 163
 		switch(Context::get('format'))
146 164
 		{
147 165
 			case 'atom':
148 166
 				$info->date = date('Y-m-d\TH:i:sP');
149
-				if($mid) { $info->id = getUrl('','mid',$mid,'act','atom','page',Context::get('page'),'start_date',Context::get('start_date'),'end_date',Context::get('end_date')); }
150
-				else { $info->id = getUrl('','module','rss','act','atom','page',Context::get('page'),'start_date',Context::get('start_date'),'end_date',Context::get('end_date')); }
167
+				if($mid) { $info->id = getUrl('','mid',$mid,'act','atom','page',Context::get('page'),'start_date',Context::get('start_date'),'end_date',Context::get('end_date')); } else { $info->id = getUrl('','module','rss','act','atom','page',Context::get('page'),'start_date',Context::get('start_date'),'end_date',Context::get('end_date')); }
151 168
 				break;
152 169
 			case 'rss1.0':
153 170
 				$info->date = date('Y-m-d\TH:i:sP');
@@ -157,8 +174,11 @@  discard block
 block discarded – undo
157 174
 				break;
158 175
 		}
159 176
 
160
-		if($_SERVER['HTTPS']=='on') $proctcl = 'https://';
161
-		else $proctcl = 'http://';
177
+		if($_SERVER['HTTPS']=='on') {
178
+			$proctcl = 'https://';
179
+		} else {
180
+			$proctcl = 'http://';
181
+		}
162 182
 
163 183
 		$temp_link = explode('/', $info->link);
164 184
 		if($temp_link[0]=='' && $info->link)
@@ -248,7 +268,9 @@  discard block
 block discarded – undo
248 268
 			// Get information of the selected module
249 269
 			$current_module_info = Context::get('current_module_info');
250 270
 			$current_module_srl = $current_module_info->module_srl;
251
-			if(!$current_module_srl) return new BaseObject();
271
+			if(!$current_module_srl) {
272
+				return new BaseObject();
273
+			}
252 274
 		}
253 275
 		// Get teh RSS configurations for the selected module
254 276
 		$oRssModel = getModel('rss');
Please login to merge, or discard this patch.
modules/editor/editor.view.php 2 patches
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -27,11 +27,11 @@  discard block
 block discarded – undo
27 27
 		$component = Context::get('component');
28 28
 
29 29
 		$site_module_info = Context::get('site_module_info');
30
-		$site_srl = (int)$site_module_info->site_srl;
30
+		$site_srl = (int) $site_module_info->site_srl;
31 31
 		// Get compoenet object
32 32
 		$oEditorModel = getModel('editor');
33 33
 		$oComponent = &$oEditorModel->getComponentObject($component, $editor_sequence, $site_srl);
34
-		if(!$oComponent->toBool())
34
+		if (!$oComponent->toBool())
35 35
 		{
36 36
 			Context::set('message', sprintf(Context::getLang('msg_component_is_not_founded'), $component));
37 37
 			$this->setTemplatePath($this->module_path.'tpl');
@@ -58,12 +58,12 @@  discard block
 block discarded – undo
58 58
 		$component_name = Context::get('component_name');
59 59
 
60 60
 		$site_module_info = Context::get('site_module_info');
61
-		$site_srl = (int)$site_module_info->site_srl;
61
+		$site_srl = (int) $site_module_info->site_srl;
62 62
 
63 63
 		$oEditorModel = getModel('editor');
64 64
 		$component = $oEditorModel->getComponent($component_name, $site_srl);
65 65
 
66
-		if(!$component->component_name) {
66
+		if (!$component->component_name) {
67 67
 			$this->stop('msg_invalid_request');
68 68
 			return;
69 69
 		}
@@ -83,12 +83,12 @@  discard block
 block discarded – undo
83 83
 		$current_module_srl = Context::get('module_srl');
84 84
 		$current_module_srls = Context::get('module_srls');
85 85
 
86
-		if(!$current_module_srl && !$current_module_srls)
86
+		if (!$current_module_srl && !$current_module_srls)
87 87
 		{
88 88
 			// Get information of the current module
89 89
 			$current_module_info = Context::get('current_module_info');
90 90
 			$current_module_srl = $current_module_info->module_srl;
91
-			if(!$current_module_srl) return new BaseObject();
91
+			if (!$current_module_srl) return new BaseObject();
92 92
 		}
93 93
 		// Get editors settings
94 94
 		$oEditorModel = getModel('editor');
@@ -101,17 +101,17 @@  discard block
 block discarded – undo
101 101
 		$editor_skin_list = FileHandler::readDir(_XE_PATH_.'modules/editor/skins');
102 102
 		Context::set('editor_skin_list', $editor_skin_list);
103 103
 
104
-		$skin_info = $oModuleModel->loadSkinInfo($this->module_path,$editor_config->editor_skin);
104
+		$skin_info = $oModuleModel->loadSkinInfo($this->module_path, $editor_config->editor_skin);
105 105
 		Context::set('editor_colorset_list', $skin_info->colorset);
106
-		$skin_info = $oModuleModel->loadSkinInfo($this->module_path,$editor_config->comment_editor_skin);
106
+		$skin_info = $oModuleModel->loadSkinInfo($this->module_path, $editor_config->comment_editor_skin);
107 107
 		Context::set('editor_comment_colorset_list', $skin_info->colorset);
108 108
 
109 109
 		$contents = FileHandler::readDir(_XE_PATH_.'modules/editor/styles');
110 110
 		$content_style_list = array();
111
-		for($i=0,$c=count($contents);$i<$c;$i++)
111
+		for ($i = 0, $c = count($contents); $i < $c; $i++)
112 112
 		{
113 113
 			$style = $contents[$i];
114
-			$info = $oModuleModel->loadSkinInfo($this->module_path,$style,'styles');
114
+			$info = $oModuleModel->loadSkinInfo($this->module_path, $style, 'styles');
115 115
 			$content_style_list[$style] = new stdClass();
116 116
 			$content_style_list[$style]->title = $info->title;
117 117
 		}			
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 	{
149 149
 		$skin = Context::get('skin');
150 150
 		$oModuleModel = getModel('module');
151
-		$skin_info = $oModuleModel->loadSkinInfo($this->module_path,$skin);
151
+		$skin_info = $oModuleModel->loadSkinInfo($this->module_path, $skin);
152 152
 		$colorset = $skin_info->colorset;
153 153
 		Context::set('colorset', $colorset);
154 154
 	}
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 
161 161
 		$mode = Context::get('mode');
162 162
 
163
-		if($mode != 'main')
163
+		if ($mode != 'main')
164 164
 		{
165 165
 			$option_com = new stdClass();
166 166
 			$option_com->allow_fileupload = false;
Please login to merge, or discard this patch.
Braces   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -36,8 +36,7 @@  discard block
 block discarded – undo
36 36
 			Context::set('message', sprintf(Context::getLang('msg_component_is_not_founded'), $component));
37 37
 			$this->setTemplatePath($this->module_path.'tpl');
38 38
 			$this->setTemplateFile('component_not_founded');
39
-		}
40
-		else
39
+		} else
41 40
 		{
42 41
 			// Get the result after executing a method to display popup url of the component
43 42
 			$popup_content = $oComponent->getPopupContent();
@@ -88,7 +87,9 @@  discard block
 block discarded – undo
88 87
 			// Get information of the current module
89 88
 			$current_module_info = Context::get('current_module_info');
90 89
 			$current_module_srl = $current_module_info->module_srl;
91
-			if(!$current_module_srl) return new BaseObject();
90
+			if(!$current_module_srl) {
91
+				return new BaseObject();
92
+			}
92 93
 		}
93 94
 		// Get editors settings
94 95
 		$oEditorModel = getModel('editor');
@@ -178,8 +179,7 @@  discard block
 block discarded – undo
178 179
 			$option_com->content_style = $config->comment_content_style;
179 180
 			$option_com->colorset = $config->sel_comment_editor_colorset;
180 181
 			$editor = $oEditorModel->getEditor(0, $option_com);
181
-		}
182
-		else
182
+		} else
183 183
 		{
184 184
 			$option = new stdClass();
185 185
 			$option->allow_fileupload = false;
Please login to merge, or discard this patch.
modules/editor/components/emoticon/emoticon.class.php 2 patches
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 	{
20 20
 		$this->editor_sequence = $editor_sequence;
21 21
 		$this->component_path = $component_path;
22
-		$this->emoticon_path = sprintf('%s%s/images',preg_replace('/^\.\//i','',$this->component_path),'tpl','images');
22
+		$this->emoticon_path = sprintf('%s%s/images', preg_replace('/^\.\//i', '', $this->component_path), 'tpl', 'images');
23 23
 	}
24 24
 
25 25
 	/**
@@ -28,11 +28,11 @@  discard block
 block discarded – undo
28 28
 	function getEmoticonList()
29 29
 	{
30 30
 		$emoticon = Context::get('emoticon');
31
-		if(!$emoticon || !preg_match("/^([a-z0-9\_]+)$/i",$emoticon)) return new BaseObject(-1,'msg_invalid_request');
31
+		if (!$emoticon || !preg_match("/^([a-z0-9\_]+)$/i", $emoticon)) return new BaseObject(-1, 'msg_invalid_request');
32 32
 
33 33
 		$list = $this->getEmoticons($emoticon);
34 34
 
35
-		$this->add('emoticons', implode("\n",$list));
35
+		$this->add('emoticons', implode("\n", $list));
36 36
 	}
37 37
 
38 38
 	/**
@@ -44,13 +44,13 @@  discard block
 block discarded – undo
44 44
 		$output = array();
45 45
 
46 46
 		$oDir = dir($emoticon_path);
47
-		while($file = $oDir->read())
47
+		while ($file = $oDir->read())
48 48
 		{
49
-			if(substr($file,0,1)=='.') continue;
50
-			if(preg_match('/\.(jpg|jpeg|gif|png)$/i',$file)) $output[] = sprintf("%s/%s", $path, str_replace($this->emoticon_path,'',$file));
49
+			if (substr($file, 0, 1) == '.') continue;
50
+			if (preg_match('/\.(jpg|jpeg|gif|png)$/i', $file)) $output[] = sprintf("%s/%s", $path, str_replace($this->emoticon_path, '', $file));
51 51
 		}
52 52
 		$oDir->close();
53
-		if(count($output)) asort($output);
53
+		if (count($output)) asort($output);
54 54
 		return $output;
55 55
 	}
56 56
 
@@ -62,11 +62,11 @@  discard block
 block discarded – undo
62 62
 		// Bringing a list of emoticons directory
63 63
 		$emoticon_dirs = FileHandler::readDir($this->emoticon_path);
64 64
 		$emoticon_list = array();
65
-		if($emoticon_dirs)
65
+		if ($emoticon_dirs)
66 66
 		{
67
-			foreach($emoticon_dirs as $emoticon)
67
+			foreach ($emoticon_dirs as $emoticon)
68 68
 			{
69
-				if(preg_match("/^([a-z0-9\_]+)$/i", $emoticon)) $emoticon_list[] = $emoticon;
69
+				if (preg_match("/^([a-z0-9\_]+)$/i", $emoticon)) $emoticon_list[] = $emoticon;
70 70
 			}
71 71
 		}
72 72
 		Context::set('emoticon_list', $emoticon_list);
@@ -89,24 +89,24 @@  discard block
 block discarded – undo
89 89
 		$src = $xml_obj->attrs->src;
90 90
 		$alt = $xml_obj->attrs->alt;
91 91
 
92
-		if(!$alt)
92
+		if (!$alt)
93 93
 		{
94
-			$tmp_arr = explode('/',$src);
94
+			$tmp_arr = explode('/', $src);
95 95
 			$alt = array_pop($tmp_arr);
96 96
 		}
97 97
 
98
-		$src = str_replace(array('&','"'), array('&amp;','&qout;'), $src);
99
-		if(!$alt) $alt = $src;
98
+		$src = str_replace(array('&', '"'), array('&amp;', '&qout;'), $src);
99
+		if (!$alt) $alt = $src;
100 100
 
101 101
 		$attr_output = array();
102 102
 		$attr_output = array("src=\"".$src."\"");
103 103
 
104
-		if($alt)
104
+		if ($alt)
105 105
 		{
106 106
 			$attr_output[] = "alt=\"".$alt."\"";
107 107
 		}
108 108
 
109
-		$code = sprintf("<img %s style=\"border:0px\" />", implode(" ",$attr_output));
109
+		$code = sprintf("<img %s style=\"border:0px\" />", implode(" ", $attr_output));
110 110
 
111 111
 		return $code;
112 112
 	}
Please login to merge, or discard this patch.
Braces   +18 added lines, -6 removed lines patch added patch discarded remove patch
@@ -28,7 +28,9 @@  discard block
 block discarded – undo
28 28
 	function getEmoticonList()
29 29
 	{
30 30
 		$emoticon = Context::get('emoticon');
31
-		if(!$emoticon || !preg_match("/^([a-z0-9\_]+)$/i",$emoticon)) return new BaseObject(-1,'msg_invalid_request');
31
+		if(!$emoticon || !preg_match("/^([a-z0-9\_]+)$/i",$emoticon)) {
32
+			return new BaseObject(-1,'msg_invalid_request');
33
+		}
32 34
 
33 35
 		$list = $this->getEmoticons($emoticon);
34 36
 
@@ -46,11 +48,17 @@  discard block
 block discarded – undo
46 48
 		$oDir = dir($emoticon_path);
47 49
 		while($file = $oDir->read())
48 50
 		{
49
-			if(substr($file,0,1)=='.') continue;
50
-			if(preg_match('/\.(jpg|jpeg|gif|png)$/i',$file)) $output[] = sprintf("%s/%s", $path, str_replace($this->emoticon_path,'',$file));
51
+			if(substr($file,0,1)=='.') {
52
+				continue;
53
+			}
54
+			if(preg_match('/\.(jpg|jpeg|gif|png)$/i',$file)) {
55
+				$output[] = sprintf("%s/%s", $path, str_replace($this->emoticon_path,'',$file));
56
+			}
51 57
 		}
52 58
 		$oDir->close();
53
-		if(count($output)) asort($output);
59
+		if(count($output)) {
60
+			asort($output);
61
+		}
54 62
 		return $output;
55 63
 	}
56 64
 
@@ -66,7 +74,9 @@  discard block
 block discarded – undo
66 74
 		{
67 75
 			foreach($emoticon_dirs as $emoticon)
68 76
 			{
69
-				if(preg_match("/^([a-z0-9\_]+)$/i", $emoticon)) $emoticon_list[] = $emoticon;
77
+				if(preg_match("/^([a-z0-9\_]+)$/i", $emoticon)) {
78
+					$emoticon_list[] = $emoticon;
79
+				}
70 80
 			}
71 81
 		}
72 82
 		Context::set('emoticon_list', $emoticon_list);
@@ -96,7 +106,9 @@  discard block
 block discarded – undo
96 106
 		}
97 107
 
98 108
 		$src = str_replace(array('&','"'), array('&amp;','&qout;'), $src);
99
-		if(!$alt) $alt = $src;
109
+		if(!$alt) {
110
+			$alt = $src;
111
+		}
100 112
 
101 113
 		$attr_output = array();
102 114
 		$attr_output = array("src=\"".$src."\"");
Please login to merge, or discard this patch.
modules/editor/editor.admin.controller.php 2 patches
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -23,26 +23,26 @@  discard block
 block discarded – undo
23 23
 		$enables = Context::get('enables');
24 24
 		$component_names = Context::get('component_names');
25 25
 
26
-		if(!is_array($component_names)) $component_names = array();
27
-		if(!is_array($enables)) $enables = array();
26
+		if (!is_array($component_names)) $component_names = array();
27
+		if (!is_array($enables)) $enables = array();
28 28
 
29 29
 		$unables = array_diff($component_names, $enables);
30 30
 		$componentList = array();
31 31
 
32
-		foreach($enables as $component_name)
32
+		foreach ($enables as $component_name)
33 33
 		{
34 34
 			$componentList[$component_name] = 'Y';
35 35
 		}
36
-		foreach($unables as $component_name)
36
+		foreach ($unables as $component_name)
37 37
 		{
38 38
 			$componentList[$component_name] = 'N';
39 39
 		}
40 40
 
41
-		$output = $this->editorListOrder($component_names,$site_module_info->site_srl);
42
-		if(!$output->toBool()) return new BaseObject();
41
+		$output = $this->editorListOrder($component_names, $site_module_info->site_srl);
42
+		if (!$output->toBool()) return new BaseObject();
43 43
 
44
-		$output = $this->editorCheckUse($componentList,$site_module_info->site_srl);
45
-		if(!$output->toBool()) return new BaseObject();
44
+		$output = $this->editorCheckUse($componentList, $site_module_info->site_srl);
45
+		if (!$output->toBool()) return new BaseObject();
46 46
 
47 47
 		$oEditorController = getController('editor');
48 48
 		$oEditorController->removeCache($site_module_info->site_srl);
@@ -57,11 +57,11 @@  discard block
 block discarded – undo
57 57
 		$args = new stdClass();
58 58
 		$args->site_srl = $site_srl;
59 59
 
60
-		foreach($componentList as $componentName => $value)
60
+		foreach ($componentList as $componentName => $value)
61 61
 		{
62 62
 			$args->component_name = $componentName;
63 63
 			$args->enabled = $value;
64
-			if($site_srl == 0)
64
+			if ($site_srl == 0)
65 65
 			{
66 66
 				$output = executeQuery('editor.updateComponent', $args);
67 67
 			}
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 				$output = executeQuery('editor.updateSiteComponent', $args);
71 71
 			}
72 72
 		}
73
-		if(!$output->toBool()) return new BaseObject();
73
+		if (!$output->toBool()) return new BaseObject();
74 74
 
75 75
 		unset($componentList);
76 76
 		return $output;
@@ -84,13 +84,13 @@  discard block
 block discarded – undo
84 84
 		$args = new stdClass();
85 85
 		$args->site_srl = $site_srl;
86 86
 		$list_order_num = '30';
87
-		if(is_array($component_names))
87
+		if (is_array($component_names))
88 88
 		{
89
-			foreach($component_names as $name)
89
+			foreach ($component_names as $name)
90 90
 			{
91 91
 				$args->list_order = $list_order_num;
92 92
 				$args->component_name = $name;
93
-				if($site_srl == 0)
93
+				if ($site_srl == 0)
94 94
 				{
95 95
 					$output = executeQuery('editor.updateComponent', $args);
96 96
 				}
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 					$output = executeQuery('editor.updateSiteComponent', $args);
100 100
 				}
101 101
 
102
-				if(!$output->toBool()) return new BaseObject();
102
+				if (!$output->toBool()) return new BaseObject();
103 103
 				$list_order_num++;
104 104
 			}
105 105
 		}
@@ -124,11 +124,11 @@  discard block
 block discarded – undo
124 124
 		$args = new stdClass;
125 125
 		$args->component_name = $component_name;
126 126
 		$args->extra_vars = serialize($extra_vars);
127
-		$args->site_srl = (int)$site_module_info->site_srl;
127
+		$args->site_srl = (int) $site_module_info->site_srl;
128 128
 
129
-		if(!$args->site_srl) $output = executeQuery('editor.updateComponent', $args);
129
+		if (!$args->site_srl) $output = executeQuery('editor.updateComponent', $args);
130 130
 		else $output = executeQuery('editor.updateSiteComponent', $args);
131
-		if(!$output->toBool()) return $output;
131
+		if (!$output->toBool()) return $output;
132 132
 
133 133
 		$oEditorController = getController('editor');
134 134
 		$oEditorController->removeCache($args->site_srl);
@@ -146,10 +146,10 @@  discard block
 block discarded – undo
146 146
 		$configVars = Context::getRequestVars();
147 147
 		
148 148
 		$config = new stdClass;
149
-		if($configVars->font_defined != 'Y') $config->font_defined = $configVars->font_defined = 'N';
149
+		if ($configVars->font_defined != 'Y') $config->font_defined = $configVars->font_defined = 'N';
150 150
 		else $config->font_defined = 'Y';
151 151
 
152
-		if($config->font_defined == 'Y')
152
+		if ($config->font_defined == 'Y')
153 153
 			$config->content_font = $configVars->content_font_defined;
154 154
 		else
155 155
 			$config->content_font = $configVars->content_font;
@@ -160,11 +160,11 @@  discard block
 block discarded – undo
160 160
 		$config->comment_editor_height = $configVars->comment_editor_height;
161 161
 		$config->content_style = $configVars->content_style;
162 162
 
163
-		$config->content_font_size= $configVars->content_font_size.'px';
164
-		$config->sel_editor_colorset= $configVars->sel_editor_colorset;
165
-		$config->sel_comment_editor_colorset= $configVars->sel_comment_editor_colorset;
163
+		$config->content_font_size = $configVars->content_font_size.'px';
164
+		$config->sel_editor_colorset = $configVars->sel_editor_colorset;
165
+		$config->sel_comment_editor_colorset = $configVars->sel_comment_editor_colorset;
166 166
 
167
-		$oModuleController->insertModuleConfig('editor',$config);
167
+		$oModuleController->insertModuleConfig('editor', $config);
168 168
 		$this->setRedirectUrl(Context::get('error_return_url'));
169 169
 	}
170 170
 
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 	 */
174 174
 	function insertComponent($component_name, $enabled = false, $site_srl = 0)
175 175
 	{
176
-		if($enabled) $enabled = 'Y';
176
+		if ($enabled) $enabled = 'Y';
177 177
 		else $enabled = 'N';
178 178
 
179 179
 		$args = new stdClass;
@@ -181,12 +181,12 @@  discard block
 block discarded – undo
181 181
 		$args->enabled = $enabled;
182 182
 		$args->site_srl = $site_srl;
183 183
 		// Check if the component exists
184
-		if(!$site_srl) $output = executeQuery('editor.isComponentInserted', $args);
184
+		if (!$site_srl) $output = executeQuery('editor.isComponentInserted', $args);
185 185
 		else $output = executeQuery('editor.isSiteComponentInserted', $args);
186
-		if($output->data->count) return new BaseObject(-1, 'msg_component_is_not_founded');
186
+		if ($output->data->count) return new BaseObject(-1, 'msg_component_is_not_founded');
187 187
 		// Inert a component
188 188
 		$args->list_order = getNextSequence();
189
-		if(!$site_srl) $output = executeQuery('editor.insertComponent', $args);
189
+		if (!$site_srl) $output = executeQuery('editor.insertComponent', $args);
190 190
 		else $output = executeQuery('editor.insertSiteComponent', $args);
191 191
 
192 192
 		$oEditorController = getController('editor');
Please login to merge, or discard this patch.
Braces   +56 added lines, -26 removed lines patch added patch discarded remove patch
@@ -23,8 +23,12 @@  discard block
 block discarded – undo
23 23
 		$enables = Context::get('enables');
24 24
 		$component_names = Context::get('component_names');
25 25
 
26
-		if(!is_array($component_names)) $component_names = array();
27
-		if(!is_array($enables)) $enables = array();
26
+		if(!is_array($component_names)) {
27
+			$component_names = array();
28
+		}
29
+		if(!is_array($enables)) {
30
+			$enables = array();
31
+		}
28 32
 
29 33
 		$unables = array_diff($component_names, $enables);
30 34
 		$componentList = array();
@@ -39,10 +43,14 @@  discard block
 block discarded – undo
39 43
 		}
40 44
 
41 45
 		$output = $this->editorListOrder($component_names,$site_module_info->site_srl);
42
-		if(!$output->toBool()) return new BaseObject();
46
+		if(!$output->toBool()) {
47
+			return new BaseObject();
48
+		}
43 49
 
44 50
 		$output = $this->editorCheckUse($componentList,$site_module_info->site_srl);
45
-		if(!$output->toBool()) return new BaseObject();
51
+		if(!$output->toBool()) {
52
+			return new BaseObject();
53
+		}
46 54
 
47 55
 		$oEditorController = getController('editor');
48 56
 		$oEditorController->removeCache($site_module_info->site_srl);
@@ -64,13 +72,14 @@  discard block
 block discarded – undo
64 72
 			if($site_srl == 0)
65 73
 			{
66 74
 				$output = executeQuery('editor.updateComponent', $args);
67
-			}
68
-			else
75
+			} else
69 76
 			{
70 77
 				$output = executeQuery('editor.updateSiteComponent', $args);
71 78
 			}
72 79
 		}
73
-		if(!$output->toBool()) return new BaseObject();
80
+		if(!$output->toBool()) {
81
+			return new BaseObject();
82
+		}
74 83
 
75 84
 		unset($componentList);
76 85
 		return $output;
@@ -93,13 +102,14 @@  discard block
 block discarded – undo
93 102
 				if($site_srl == 0)
94 103
 				{
95 104
 					$output = executeQuery('editor.updateComponent', $args);
96
-				}
97
-				else
105
+				} else
98 106
 				{
99 107
 					$output = executeQuery('editor.updateSiteComponent', $args);
100 108
 				}
101 109
 
102
-				if(!$output->toBool()) return new BaseObject();
110
+				if(!$output->toBool()) {
111
+					return new BaseObject();
112
+				}
103 113
 				$list_order_num++;
104 114
 			}
105 115
 		}
@@ -126,9 +136,14 @@  discard block
 block discarded – undo
126 136
 		$args->extra_vars = serialize($extra_vars);
127 137
 		$args->site_srl = (int)$site_module_info->site_srl;
128 138
 
129
-		if(!$args->site_srl) $output = executeQuery('editor.updateComponent', $args);
130
-		else $output = executeQuery('editor.updateSiteComponent', $args);
131
-		if(!$output->toBool()) return $output;
139
+		if(!$args->site_srl) {
140
+			$output = executeQuery('editor.updateComponent', $args);
141
+		} else {
142
+			$output = executeQuery('editor.updateSiteComponent', $args);
143
+		}
144
+		if(!$output->toBool()) {
145
+			return $output;
146
+		}
132 147
 
133 148
 		$oEditorController = getController('editor');
134 149
 		$oEditorController->removeCache($args->site_srl);
@@ -146,13 +161,17 @@  discard block
 block discarded – undo
146 161
 		$configVars = Context::getRequestVars();
147 162
 		
148 163
 		$config = new stdClass;
149
-		if($configVars->font_defined != 'Y') $config->font_defined = $configVars->font_defined = 'N';
150
-		else $config->font_defined = 'Y';
164
+		if($configVars->font_defined != 'Y') {
165
+			$config->font_defined = $configVars->font_defined = 'N';
166
+		} else {
167
+			$config->font_defined = 'Y';
168
+		}
151 169
 
152
-		if($config->font_defined == 'Y')
153
-			$config->content_font = $configVars->content_font_defined;
154
-		else
155
-			$config->content_font = $configVars->content_font;
170
+		if($config->font_defined == 'Y') {
171
+					$config->content_font = $configVars->content_font_defined;
172
+		} else {
173
+					$config->content_font = $configVars->content_font;
174
+		}
156 175
 
157 176
 		$config->editor_skin = $configVars->editor_skin;
158 177
 		$config->editor_height = $configVars->editor_height;
@@ -173,21 +192,32 @@  discard block
 block discarded – undo
173 192
 	 */
174 193
 	function insertComponent($component_name, $enabled = false, $site_srl = 0)
175 194
 	{
176
-		if($enabled) $enabled = 'Y';
177
-		else $enabled = 'N';
195
+		if($enabled) {
196
+			$enabled = 'Y';
197
+		} else {
198
+			$enabled = 'N';
199
+		}
178 200
 
179 201
 		$args = new stdClass;
180 202
 		$args->component_name = $component_name;
181 203
 		$args->enabled = $enabled;
182 204
 		$args->site_srl = $site_srl;
183 205
 		// Check if the component exists
184
-		if(!$site_srl) $output = executeQuery('editor.isComponentInserted', $args);
185
-		else $output = executeQuery('editor.isSiteComponentInserted', $args);
186
-		if($output->data->count) return new BaseObject(-1, 'msg_component_is_not_founded');
206
+		if(!$site_srl) {
207
+			$output = executeQuery('editor.isComponentInserted', $args);
208
+		} else {
209
+			$output = executeQuery('editor.isSiteComponentInserted', $args);
210
+		}
211
+		if($output->data->count) {
212
+			return new BaseObject(-1, 'msg_component_is_not_founded');
213
+		}
187 214
 		// Inert a component
188 215
 		$args->list_order = getNextSequence();
189
-		if(!$site_srl) $output = executeQuery('editor.insertComponent', $args);
190
-		else $output = executeQuery('editor.insertSiteComponent', $args);
216
+		if(!$site_srl) {
217
+			$output = executeQuery('editor.insertComponent', $args);
218
+		} else {
219
+			$output = executeQuery('editor.insertSiteComponent', $args);
220
+		}
191 221
 
192 222
 		$oEditorController = getController('editor');
193 223
 		$oEditorController->removeCache($site_srl);
Please login to merge, or discard this patch.
modules/poll/poll.controller.php 2 patches
Spacing   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -20,9 +20,9 @@  discard block
 block discarded – undo
20 20
 	function procPollInsert()
21 21
 	{
22 22
 		$stop_date = Context::get('stop_date');
23
-		if($stop_date < date('Ymd'))
23
+		if ($stop_date < date('Ymd'))
24 24
 		{
25
-			$stop_date = date('YmdHis', $_SERVER['REQUEST_TIME']+60*60*24*365);
25
+			$stop_date = date('YmdHis', $_SERVER['REQUEST_TIME'] + 60 * 60 * 24 * 365);
26 26
 		}
27 27
 
28 28
 		$logged_info = Context::get('logged_info');
@@ -34,9 +34,9 @@  discard block
 block discarded – undo
34 34
 		unset($vars->error_return_url);
35 35
 		unset($vars->stop_date);
36 36
 
37
-		foreach($vars as $key => $val)
37
+		foreach ($vars as $key => $val)
38 38
 		{
39
-			if(stripos($key, 'tidx'))
39
+			if (stripos($key, 'tidx'))
40 40
 			{
41 41
 				continue;
42 42
 			}
@@ -44,32 +44,32 @@  discard block
 block discarded – undo
44 44
 			$tmp_arr = explode('_', $key);
45 45
 
46 46
 			$poll_index = $tmp_arr[1];
47
-			if(!$poll_index)
47
+			if (!$poll_index)
48 48
 			{
49 49
 				continue;
50 50
 			}
51 51
 
52
-			if(!trim($val))
52
+			if (!trim($val))
53 53
 			{
54 54
 				continue;
55 55
 			}
56 56
 
57
-			if($tmp_args[$poll_index] == NULL)
57
+			if ($tmp_args[$poll_index] == NULL)
58 58
 			{
59 59
 				$tmp_args[$poll_index] = new stdClass;
60 60
 			}
61 61
 
62
-			if(!is_array($tmp_args[$poll_index]->item))
62
+			if (!is_array($tmp_args[$poll_index]->item))
63 63
 			{
64 64
 				$tmp_args[$poll_index]->item = array();
65 65
 			}
66 66
 
67
-			if($logged_info->is_admin != 'Y')
67
+			if ($logged_info->is_admin != 'Y')
68 68
 			{
69 69
 				$val = htmlspecialchars($val, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
70 70
 			}
71 71
 
72
-			switch($tmp_arr[0])
72
+			switch ($tmp_arr[0])
73 73
 			{
74 74
 				case 'title':
75 75
 					$tmp_args[$poll_index]->title = $val;
@@ -83,26 +83,26 @@  discard block
 block discarded – undo
83 83
 			}
84 84
 		}
85 85
 
86
-		foreach($tmp_args as $key => $val)
86
+		foreach ($tmp_args as $key => $val)
87 87
 		{
88
-			if(!$val->checkcount)
88
+			if (!$val->checkcount)
89 89
 			{
90 90
 				$val->checkcount = 1;
91 91
 			}
92 92
 
93
-			if($val->title && count($val->item))
93
+			if ($val->title && count($val->item))
94 94
 			{
95 95
 				$args->poll[] = $val;
96 96
 			}
97 97
 		}
98 98
 
99
-		if(!count($args->poll)) return new BaseObject(-1, 'cmd_null_item');
99
+		if (!count($args->poll)) return new BaseObject(-1, 'cmd_null_item');
100 100
 
101 101
 		$args->stop_date = $stop_date;
102 102
 
103 103
 		// Configure the variables
104 104
 		$poll_srl = getNextSequence();
105
-		$member_srl = $logged_info->member_srl?$logged_info->member_srl:0;
105
+		$member_srl = $logged_info->member_srl ? $logged_info->member_srl : 0;
106 106
 
107 107
 		$oDB = &DB::getInstance();
108 108
 		$oDB->begin();
@@ -111,18 +111,18 @@  discard block
 block discarded – undo
111 111
 		$poll_args = new stdClass;
112 112
 		$poll_args->poll_srl = $poll_srl;
113 113
 		$poll_args->member_srl = $member_srl;
114
-		$poll_args->list_order = $poll_srl*-1;
114
+		$poll_args->list_order = $poll_srl * -1;
115 115
 		$poll_args->stop_date = $args->stop_date;
116 116
 		$poll_args->poll_count = 0;
117 117
 		$output = executeQuery('poll.insertPoll', $poll_args);
118
-		if(!$output->toBool())
118
+		if (!$output->toBool())
119 119
 		{
120 120
 			$oDB->rollback();
121 121
 			return $output;
122 122
 		}
123 123
 
124 124
 		// Individual poll registration
125
-		foreach($args->poll as $key => $val)
125
+		foreach ($args->poll as $key => $val)
126 126
 		{
127 127
 			$title_args = new stdClass;
128 128
 			$title_args->poll_srl = $poll_srl;
@@ -134,14 +134,14 @@  discard block
 block discarded – undo
134 134
 			$title_args->member_srl = $member_srl;
135 135
 			$title_args->upload_target_srl = $upload_target_srl;
136 136
 			$output = executeQuery('poll.insertPollTitle', $title_args);
137
-			if(!$output->toBool())
137
+			if (!$output->toBool())
138 138
 			{
139 139
 				$oDB->rollback();
140 140
 				return $output;
141 141
 			}
142 142
 
143 143
 			// Add the individual survey items
144
-			foreach($val->item as $k => $v)
144
+			foreach ($val->item as $k => $v)
145 145
 			{
146 146
 				$item_args = new stdClass;
147 147
 				$item_args->poll_srl = $poll_srl;
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 				$item_args->poll_count = 0;
151 151
 				$item_args->upload_target_srl = $upload_target_srl;
152 152
 				$output = executeQuery('poll.insertPollItem', $item_args);
153
-				if(!$output->toBool())
153
+				if (!$output->toBool())
154 154
 				{
155 155
 					$oDB->rollback();
156 156
 					return $output;
@@ -171,19 +171,19 @@  discard block
 block discarded – undo
171 171
 	{
172 172
 		$poll_srl = Context::get('poll_srl');
173 173
 		$poll_srl_indexes = Context::get('poll_srl_indexes');
174
-		$tmp_item_srls = explode(',',$poll_srl_indexes);
175
-		for($i=0;$i<count($tmp_item_srls);$i++)
174
+		$tmp_item_srls = explode(',', $poll_srl_indexes);
175
+		for ($i = 0; $i < count($tmp_item_srls); $i++)
176 176
 		{
177
-			$srl = (int)trim($tmp_item_srls[$i]);
178
-			if(!$srl) continue;
177
+			$srl = (int) trim($tmp_item_srls[$i]);
178
+			if (!$srl) continue;
179 179
 			$item_srls[] = $srl;
180 180
 		}
181 181
 
182 182
 		// If there is no response item, display an error
183
-		if(!count($item_srls)) return new BaseObject(-1, 'msg_check_poll_item');
183
+		if (!count($item_srls)) return new BaseObject(-1, 'msg_check_poll_item');
184 184
 		// Make sure is the poll has already been taken
185 185
 		$oPollModel = getModel('poll');
186
-		if($oPollModel->isPolled($poll_srl)) return new BaseObject(-1, 'msg_already_poll');
186
+		if ($oPollModel->isPolled($poll_srl)) return new BaseObject(-1, 'msg_already_poll');
187 187
 
188 188
 		$oDB = &DB::getInstance();
189 189
 		$oDB->begin();
@@ -193,15 +193,15 @@  discard block
 block discarded – undo
193 193
 		// Update all poll responses related to the post
194 194
 		$output = executeQuery('poll.updatePoll', $args);
195 195
 		$output = executeQuery('poll.updatePollTitle', $args);
196
-		if(!$output->toBool())
196
+		if (!$output->toBool())
197 197
 		{
198 198
 			$oDB->rollback();
199 199
 			return $output;
200 200
 		}
201 201
 		// Record each polls selected items
202
-		$args->poll_item_srl = implode(',',$item_srls);
202
+		$args->poll_item_srl = implode(',', $item_srls);
203 203
 		$output = executeQuery('poll.updatePollItems', $args);
204
-		if(!$output->toBool())
204
+		if (!$output->toBool())
205 205
 		{
206 206
 			$oDB->rollback();
207 207
 			return $output;
@@ -211,12 +211,12 @@  discard block
 block discarded – undo
211 211
 		$log_args->poll_srl = $poll_srl;
212 212
 
213 213
 		$logged_info = Context::get('logged_info');
214
-		$member_srl = $logged_info->member_srl?$logged_info->member_srl:0;
214
+		$member_srl = $logged_info->member_srl ? $logged_info->member_srl : 0;
215 215
 
216 216
 		$log_args->member_srl = $member_srl;
217 217
 		$log_args->ipaddress = $_SERVER['REMOTE_ADDR'];
218 218
 		$output = executeQuery('poll.insertPollLog', $log_args);
219
-		if(!$output->toBool())
219
+		if (!$output->toBool())
220 220
 		{
221 221
 			$oDB->rollback();
222 222
 			return $output;
@@ -225,12 +225,12 @@  discard block
 block discarded – undo
225 225
 		$oDB->commit();
226 226
 
227 227
 		$skin = Context::get('skin');
228
-		if(!$skin || !is_dir(_XE_PATH_ . 'modules/poll/skins/'.$skin)) $skin = 'default';
228
+		if (!$skin || !is_dir(_XE_PATH_.'modules/poll/skins/'.$skin)) $skin = 'default';
229 229
 		// Get tpl
230 230
 		$tpl = $oPollModel->getPollHtml($poll_srl, '', $skin);
231 231
 
232 232
 		$this->add('poll_srl', $poll_srl);
233
-		$this->add('tpl',$tpl);
233
+		$this->add('tpl', $tpl);
234 234
 		$this->setMessage('success_poll');
235 235
 
236 236
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispPollAdminConfig');
@@ -245,13 +245,13 @@  discard block
 block discarded – undo
245 245
 		$poll_srl = Context::get('poll_srl');
246 246
 
247 247
 		$skin = Context::get('skin');
248
-		if(!$skin || !is_dir(_XE_PATH_ . 'modules/poll/skins/'.$skin)) $skin = 'default';
248
+		if (!$skin || !is_dir(_XE_PATH_.'modules/poll/skins/'.$skin)) $skin = 'default';
249 249
 
250 250
 		$oPollModel = getModel('poll');
251 251
 		$tpl = $oPollModel->getPollResultHtml($poll_srl, $skin);
252 252
 
253 253
 		$this->add('poll_srl', $poll_srl);
254
-		$this->add('tpl',$tpl);
254
+		$this->add('tpl', $tpl);
255 255
 	}
256 256
 
257 257
 	/**
@@ -259,12 +259,12 @@  discard block
 block discarded – undo
259 259
 	 */
260 260
 	function procPollGetList()
261 261
 	{
262
-		if(!Context::get('is_logged')) return new BaseObject(-1,'msg_not_permitted');
262
+		if (!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_permitted');
263 263
 		$pollSrls = Context::get('poll_srls');
264
-		if($pollSrls) $pollSrlList = explode(',', $pollSrls);
264
+		if ($pollSrls) $pollSrlList = explode(',', $pollSrls);
265 265
 
266 266
 		global $lang;
267
-		if(count($pollSrlList) > 0)
267
+		if (count($pollSrlList) > 0)
268 268
 		{
269 269
 			$oPollAdminModel = getAdminModel('poll');
270 270
 			$args = new stdClass;
@@ -272,11 +272,11 @@  discard block
 block discarded – undo
272 272
 			$output = $oPollAdminModel->getPollListWithMember($args);
273 273
 			$pollList = $output->data;
274 274
 
275
-			if(is_array($pollList))
275
+			if (is_array($pollList))
276 276
 			{
277
-				foreach($pollList AS $key=>$value)
277
+				foreach ($pollList AS $key=>$value)
278 278
 				{
279
-					if($value->checkcount == 1) $value->checkName = $lang->single_check;
279
+					if ($value->checkcount == 1) $value->checkName = $lang->single_check;
280 280
 					else $value->checkName = $lang->multi_check;
281 281
 				}
282 282
 			}
@@ -332,29 +332,29 @@  discard block
 block discarded – undo
332 332
 	function triggerDeleteDocumentPoll(&$obj)
333 333
 	{
334 334
 		$document_srl = $obj->document_srl;
335
-		if(!$document_srl) return new BaseObject();
335
+		if (!$document_srl) return new BaseObject();
336 336
 		// Get the poll
337 337
 		$args = new stdClass();
338 338
 		$args->upload_target_srl = $document_srl;
339 339
 		$output = executeQuery('poll.getPollByTargetSrl', $args);
340
-		if(!$output->data) return new BaseObject();
340
+		if (!$output->data) return new BaseObject();
341 341
 
342 342
 		$poll_srl = $output->data->poll_srl;
343
-		if(!$poll_srl) return new BaseObject();
343
+		if (!$poll_srl) return new BaseObject();
344 344
 
345 345
 		$args->poll_srl = $poll_srl;
346 346
 
347 347
 		$output = executeQuery('poll.deletePoll', $args);
348
-		if(!$output->toBool()) return $output;
348
+		if (!$output->toBool()) return $output;
349 349
 
350 350
 		$output = executeQuery('poll.deletePollItem', $args);
351
-		if(!$output->toBool()) return $output;
351
+		if (!$output->toBool()) return $output;
352 352
 
353 353
 		$output = executeQuery('poll.deletePollTitle', $args);
354
-		if(!$output->toBool()) return $output;
354
+		if (!$output->toBool()) return $output;
355 355
 
356 356
 		$output = executeQuery('poll.deletePollLog', $args);
357
-		if(!$output->toBool()) return $output;
357
+		if (!$output->toBool()) return $output;
358 358
 
359 359
 		return new BaseObject();
360 360
 	}
@@ -365,29 +365,29 @@  discard block
 block discarded – undo
365 365
 	function triggerDeleteCommentPoll(&$obj)
366 366
 	{
367 367
 		$comment_srl = $obj->comment_srl;
368
-		if(!$comment_srl) return new BaseObject();
368
+		if (!$comment_srl) return new BaseObject();
369 369
 		// Get the poll
370 370
 		$args = new stdClass();
371 371
 		$args->upload_target_srl = $comment_srl;
372 372
 		$output = executeQuery('poll.getPollByTargetSrl', $args);
373
-		if(!$output->data) return new BaseObject();
373
+		if (!$output->data) return new BaseObject();
374 374
 
375 375
 		$poll_srl = $output->data->poll_srl;
376
-		if(!$poll_srl) return new BaseObject();
376
+		if (!$poll_srl) return new BaseObject();
377 377
 
378 378
 		$args->poll_srl = $poll_srl;
379 379
 
380 380
 		$output = executeQuery('poll.deletePoll', $args);
381
-		if(!$output->toBool()) return $output;
381
+		if (!$output->toBool()) return $output;
382 382
 
383 383
 		$output = executeQuery('poll.deletePollItem', $args);
384
-		if(!$output->toBool()) return $output;
384
+		if (!$output->toBool()) return $output;
385 385
 
386 386
 		$output = executeQuery('poll.deletePollTitle', $args);
387
-		if(!$output->toBool()) return $output;
387
+		if (!$output->toBool()) return $output;
388 388
 
389 389
 		$output = executeQuery('poll.deletePollLog', $args);
390
-		if(!$output->toBool()) return $output;
390
+		if (!$output->toBool()) return $output;
391 391
 
392 392
 		return new BaseObject();
393 393
 	}
@@ -397,8 +397,8 @@  discard block
 block discarded – undo
397 397
 	 */
398 398
 	function syncPoll($upload_target_srl, $content)
399 399
 	{
400
-		$match_cnt = preg_match_all('!<img([^\>]*)poll_srl=(["\']?)([0-9]*)(["\']?)([^\>]*?)\>!is',$content, $matches);
401
-		for($i=0;$i<$match_cnt;$i++)
400
+		$match_cnt = preg_match_all('!<img([^\>]*)poll_srl=(["\']?)([0-9]*)(["\']?)([^\>]*?)\>!is', $content, $matches);
401
+		for ($i = 0; $i < $match_cnt; $i++)
402 402
 		{
403 403
 			$poll_srl = $matches[3][$i];
404 404
 
@@ -407,7 +407,7 @@  discard block
 block discarded – undo
407 407
 			$output = executeQuery('poll.getPoll', $args);
408 408
 			$poll = $output->data;
409 409
 
410
-			if($poll->upload_target_srl) continue;
410
+			if ($poll->upload_target_srl) continue;
411 411
 
412 412
 			$args->upload_target_srl = $upload_target_srl;
413 413
 			$output = executeQuery('poll.updatePollTarget', $args);
Please login to merge, or discard this patch.
Braces   +75 added lines, -27 removed lines patch added patch discarded remove patch
@@ -96,7 +96,9 @@  discard block
 block discarded – undo
96 96
 			}
97 97
 		}
98 98
 
99
-		if(!count($args->poll)) return new BaseObject(-1, 'cmd_null_item');
99
+		if(!count($args->poll)) {
100
+			return new BaseObject(-1, 'cmd_null_item');
101
+		}
100 102
 
101 103
 		$args->stop_date = $stop_date;
102 104
 
@@ -175,15 +177,21 @@  discard block
 block discarded – undo
175 177
 		for($i=0;$i<count($tmp_item_srls);$i++)
176 178
 		{
177 179
 			$srl = (int)trim($tmp_item_srls[$i]);
178
-			if(!$srl) continue;
180
+			if(!$srl) {
181
+				continue;
182
+			}
179 183
 			$item_srls[] = $srl;
180 184
 		}
181 185
 
182 186
 		// If there is no response item, display an error
183
-		if(!count($item_srls)) return new BaseObject(-1, 'msg_check_poll_item');
187
+		if(!count($item_srls)) {
188
+			return new BaseObject(-1, 'msg_check_poll_item');
189
+		}
184 190
 		// Make sure is the poll has already been taken
185 191
 		$oPollModel = getModel('poll');
186
-		if($oPollModel->isPolled($poll_srl)) return new BaseObject(-1, 'msg_already_poll');
192
+		if($oPollModel->isPolled($poll_srl)) {
193
+			return new BaseObject(-1, 'msg_already_poll');
194
+		}
187 195
 
188 196
 		$oDB = &DB::getInstance();
189 197
 		$oDB->begin();
@@ -225,7 +233,9 @@  discard block
 block discarded – undo
225 233
 		$oDB->commit();
226 234
 
227 235
 		$skin = Context::get('skin');
228
-		if(!$skin || !is_dir(_XE_PATH_ . 'modules/poll/skins/'.$skin)) $skin = 'default';
236
+		if(!$skin || !is_dir(_XE_PATH_ . 'modules/poll/skins/'.$skin)) {
237
+			$skin = 'default';
238
+		}
229 239
 		// Get tpl
230 240
 		$tpl = $oPollModel->getPollHtml($poll_srl, '', $skin);
231 241
 
@@ -245,7 +255,9 @@  discard block
 block discarded – undo
245 255
 		$poll_srl = Context::get('poll_srl');
246 256
 
247 257
 		$skin = Context::get('skin');
248
-		if(!$skin || !is_dir(_XE_PATH_ . 'modules/poll/skins/'.$skin)) $skin = 'default';
258
+		if(!$skin || !is_dir(_XE_PATH_ . 'modules/poll/skins/'.$skin)) {
259
+			$skin = 'default';
260
+		}
249 261
 
250 262
 		$oPollModel = getModel('poll');
251 263
 		$tpl = $oPollModel->getPollResultHtml($poll_srl, $skin);
@@ -259,9 +271,13 @@  discard block
 block discarded – undo
259 271
 	 */
260 272
 	function procPollGetList()
261 273
 	{
262
-		if(!Context::get('is_logged')) return new BaseObject(-1,'msg_not_permitted');
274
+		if(!Context::get('is_logged')) {
275
+			return new BaseObject(-1,'msg_not_permitted');
276
+		}
263 277
 		$pollSrls = Context::get('poll_srls');
264
-		if($pollSrls) $pollSrlList = explode(',', $pollSrls);
278
+		if($pollSrls) {
279
+			$pollSrlList = explode(',', $pollSrls);
280
+		}
265 281
 
266 282
 		global $lang;
267 283
 		if(count($pollSrlList) > 0)
@@ -276,12 +292,14 @@  discard block
 block discarded – undo
276 292
 			{
277 293
 				foreach($pollList AS $key=>$value)
278 294
 				{
279
-					if($value->checkcount == 1) $value->checkName = $lang->single_check;
280
-					else $value->checkName = $lang->multi_check;
295
+					if($value->checkcount == 1) {
296
+						$value->checkName = $lang->single_check;
297
+					} else {
298
+						$value->checkName = $lang->multi_check;
299
+					}
281 300
 				}
282 301
 			}
283
-		}
284
-		else
302
+		} else
285 303
 		{
286 304
 			$pollList = array();
287 305
 			$this->setMessage($lang->no_documents);
@@ -332,29 +350,43 @@  discard block
 block discarded – undo
332 350
 	function triggerDeleteDocumentPoll(&$obj)
333 351
 	{
334 352
 		$document_srl = $obj->document_srl;
335
-		if(!$document_srl) return new BaseObject();
353
+		if(!$document_srl) {
354
+			return new BaseObject();
355
+		}
336 356
 		// Get the poll
337 357
 		$args = new stdClass();
338 358
 		$args->upload_target_srl = $document_srl;
339 359
 		$output = executeQuery('poll.getPollByTargetSrl', $args);
340
-		if(!$output->data) return new BaseObject();
360
+		if(!$output->data) {
361
+			return new BaseObject();
362
+		}
341 363
 
342 364
 		$poll_srl = $output->data->poll_srl;
343
-		if(!$poll_srl) return new BaseObject();
365
+		if(!$poll_srl) {
366
+			return new BaseObject();
367
+		}
344 368
 
345 369
 		$args->poll_srl = $poll_srl;
346 370
 
347 371
 		$output = executeQuery('poll.deletePoll', $args);
348
-		if(!$output->toBool()) return $output;
372
+		if(!$output->toBool()) {
373
+			return $output;
374
+		}
349 375
 
350 376
 		$output = executeQuery('poll.deletePollItem', $args);
351
-		if(!$output->toBool()) return $output;
377
+		if(!$output->toBool()) {
378
+			return $output;
379
+		}
352 380
 
353 381
 		$output = executeQuery('poll.deletePollTitle', $args);
354
-		if(!$output->toBool()) return $output;
382
+		if(!$output->toBool()) {
383
+			return $output;
384
+		}
355 385
 
356 386
 		$output = executeQuery('poll.deletePollLog', $args);
357
-		if(!$output->toBool()) return $output;
387
+		if(!$output->toBool()) {
388
+			return $output;
389
+		}
358 390
 
359 391
 		return new BaseObject();
360 392
 	}
@@ -365,29 +397,43 @@  discard block
 block discarded – undo
365 397
 	function triggerDeleteCommentPoll(&$obj)
366 398
 	{
367 399
 		$comment_srl = $obj->comment_srl;
368
-		if(!$comment_srl) return new BaseObject();
400
+		if(!$comment_srl) {
401
+			return new BaseObject();
402
+		}
369 403
 		// Get the poll
370 404
 		$args = new stdClass();
371 405
 		$args->upload_target_srl = $comment_srl;
372 406
 		$output = executeQuery('poll.getPollByTargetSrl', $args);
373
-		if(!$output->data) return new BaseObject();
407
+		if(!$output->data) {
408
+			return new BaseObject();
409
+		}
374 410
 
375 411
 		$poll_srl = $output->data->poll_srl;
376
-		if(!$poll_srl) return new BaseObject();
412
+		if(!$poll_srl) {
413
+			return new BaseObject();
414
+		}
377 415
 
378 416
 		$args->poll_srl = $poll_srl;
379 417
 
380 418
 		$output = executeQuery('poll.deletePoll', $args);
381
-		if(!$output->toBool()) return $output;
419
+		if(!$output->toBool()) {
420
+			return $output;
421
+		}
382 422
 
383 423
 		$output = executeQuery('poll.deletePollItem', $args);
384
-		if(!$output->toBool()) return $output;
424
+		if(!$output->toBool()) {
425
+			return $output;
426
+		}
385 427
 
386 428
 		$output = executeQuery('poll.deletePollTitle', $args);
387
-		if(!$output->toBool()) return $output;
429
+		if(!$output->toBool()) {
430
+			return $output;
431
+		}
388 432
 
389 433
 		$output = executeQuery('poll.deletePollLog', $args);
390
-		if(!$output->toBool()) return $output;
434
+		if(!$output->toBool()) {
435
+			return $output;
436
+		}
391 437
 
392 438
 		return new BaseObject();
393 439
 	}
@@ -407,7 +453,9 @@  discard block
 block discarded – undo
407 453
 			$output = executeQuery('poll.getPoll', $args);
408 454
 			$poll = $output->data;
409 455
 
410
-			if($poll->upload_target_srl) continue;
456
+			if($poll->upload_target_srl) {
457
+				continue;
458
+			}
411 459
 
412 460
 			$args->upload_target_srl = $upload_target_srl;
413 461
 			$output = executeQuery('poll.updatePollTarget', $args);
Please login to merge, or discard this patch.
modules/point/point.view.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -26,20 +26,20 @@
 block discarded – undo
26 26
 		$current_module_srl = Context::get('module_srl');
27 27
 		$current_module_srls = Context::get('module_srls');
28 28
 
29
-		if(!$current_module_srl && !$current_module_srls)
29
+		if (!$current_module_srl && !$current_module_srls)
30 30
 		{
31 31
 			$current_module_info = Context::get('current_module_info');
32 32
 			$current_module_srl = $current_module_info->module_srl;
33
-			if(!$current_module_srl) return new BaseObject();
33
+			if (!$current_module_srl) return new BaseObject();
34 34
 		}
35 35
 		// Get the configuration information
36 36
 		$oModuleModel = getModel('module');
37 37
 		$config = $oModuleModel->getModuleConfig('point');
38 38
 
39
-		if($current_module_srl)
39
+		if ($current_module_srl)
40 40
 		{
41 41
 			$module_config = $oModuleModel->getModulePartConfig('point', $current_module_srl);
42
-			if(!$module_config)
42
+			if (!$module_config)
43 43
 			{
44 44
 				$module_config['insert_document'] = $config->insert_document;
45 45
 				$module_config['insert_comment'] = $config->insert_comment;
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,9 @@
 block discarded – undo
30 30
 		{
31 31
 			$current_module_info = Context::get('current_module_info');
32 32
 			$current_module_srl = $current_module_info->module_srl;
33
-			if(!$current_module_srl) return new BaseObject();
33
+			if(!$current_module_srl) {
34
+				return new BaseObject();
35
+			}
34 36
 		}
35 37
 		// Get the configuration information
36 38
 		$oModuleModel = getModel('module');
Please login to merge, or discard this patch.
modules/point/point.admin.controller.php 2 patches
Spacing   +83 added lines, -83 removed lines patch added patch discarded remove patch
@@ -26,10 +26,10 @@  discard block
 block discarded – undo
26 26
 		$args = Context::getRequestVars();
27 27
 
28 28
 		//if module IO config is off
29
-		if($args->able_module == 'Y')
29
+		if ($args->able_module == 'Y')
30 30
 		{
31 31
 			// Re-install triggers, if it was disabled.
32
-			if($config->able_module == 'N')
32
+			if ($config->able_module == 'N')
33 33
 			{
34 34
 				$this->moduleUpdate();
35 35
 			}
@@ -39,28 +39,28 @@  discard block
 block discarded – undo
39 39
 
40 40
 			// Check the point name
41 41
 			$config->point_name = $args->point_name;
42
-			if(!$config->point_name) $config->point_name = 'point';
42
+			if (!$config->point_name) $config->point_name = 'point';
43 43
 			// Specify the default points
44
-			$config->signup_point = (int)$args->signup_point;
45
-			$config->login_point = (int)$args->login_point;
46
-			$config->insert_document = (int)$args->insert_document;
47
-			$config->read_document = (int)$args->read_document;
48
-			$config->insert_comment = (int)$args->insert_comment;
49
-			$config->upload_file = (int)$args->upload_file;
50
-			$config->download_file = (int)$args->download_file;
51
-			$config->voted = (int)$args->voted;
52
-			$config->blamed = (int)$args->blamed;
44
+			$config->signup_point = (int) $args->signup_point;
45
+			$config->login_point = (int) $args->login_point;
46
+			$config->insert_document = (int) $args->insert_document;
47
+			$config->read_document = (int) $args->read_document;
48
+			$config->insert_comment = (int) $args->insert_comment;
49
+			$config->upload_file = (int) $args->upload_file;
50
+			$config->download_file = (int) $args->download_file;
51
+			$config->voted = (int) $args->voted;
52
+			$config->blamed = (int) $args->blamed;
53 53
 			// The highest level
54 54
 			$config->max_level = $args->max_level;
55
-			if($config->max_level>1000) $config->max_level = 1000;
56
-			if($config->max_level<1) $config->max_level = 1;
55
+			if ($config->max_level > 1000) $config->max_level = 1000;
56
+			if ($config->max_level < 1) $config->max_level = 1;
57 57
 			// Set the level icon
58 58
 			$config->level_icon = $args->level_icon;
59 59
 			// Check if downloads are not allowed
60
-			if($args->disable_download == 'Y') $config->disable_download = 'Y';
60
+			if ($args->disable_download == 'Y') $config->disable_download = 'Y';
61 61
 			else $config->disable_download = 'N';
62 62
 			// Check if reading a document is not allowed
63
-			if($args->disable_read_document == 'Y') $config->disable_read_document = 'Y';
63
+			if ($args->disable_read_document == 'Y') $config->disable_read_document = 'Y';
64 64
 			else $config->disable_read_document = 'N';
65 65
 
66 66
 			$oMemberModel = getModel('member');
@@ -68,23 +68,23 @@  discard block
 block discarded – undo
68 68
 			$config->point_group = array();
69 69
 
70 70
 			// Per-level group configurations
71
-			foreach($group_list as $group)
71
+			foreach ($group_list as $group)
72 72
 			{
73 73
 				// Admin group should not be connected to point.
74
-				if($group->is_admin == 'Y' || $group->is_default == 'Y') continue;
74
+				if ($group->is_admin == 'Y' || $group->is_default == 'Y') continue;
75 75
 
76 76
 				$group_srl = $group->group_srl;
77 77
 
78
-				if(isset($args->{'point_group_'.$group_srl}))
78
+				if (isset($args->{'point_group_'.$group_srl}))
79 79
 				{
80 80
 					//if group level is higher than max level, change to max level
81
-					if($args->{'point_group_'.$group_srl} > $args->max_level)
81
+					if ($args->{'point_group_'.$group_srl} > $args->max_level)
82 82
 					{
83 83
 						$args->{'point_group_'.$group_srl} = $args->max_level;
84 84
 					}
85 85
 
86 86
 					//if group level is lower than 1, change to 1
87
-					if($args->{'point_group_'.$group_srl} < 1)
87
+					if ($args->{'point_group_'.$group_srl} < 1)
88 88
 					{
89 89
 						$args->{'point_group_'.$group_srl} = 1;
90 90
 					}
@@ -95,10 +95,10 @@  discard block
 block discarded – undo
95 95
 			$config->group_reset = $args->group_reset;
96 96
 			// Per-level point configurations
97 97
 			unset($config->level_step);
98
-			for($i=1;$i<=$config->max_level;$i++)
98
+			for ($i = 1; $i <= $config->max_level; $i++)
99 99
 			{
100 100
 				$key = "level_step_".$i;
101
-				$config->level_step[$i] = (int)$args->{$key};
101
+				$config->level_step[$i] = (int) $args->{$key};
102 102
 			}
103 103
 			// A function to calculate per-level points
104 104
 			$config->expression = $args->expression;
@@ -130,11 +130,11 @@  discard block
 block discarded – undo
130 130
 		$args = Context::getRequestVars();
131 131
 
132 132
 		$configTypeList = array('insert_document', 'insert_comment', 'upload_file', 'download_file', 'read_document', 'voted', 'blamed');
133
-		foreach($configTypeList AS $config)
133
+		foreach ($configTypeList AS $config)
134 134
 		{
135
-			if(is_array($args->{$config}))
135
+			if (is_array($args->{$config}))
136 136
 			{
137
-				foreach($args->{$config} AS $key=>$value)
137
+				foreach ($args->{$config} AS $key=>$value)
138 138
 				{
139 139
 					$module_config[$key][$config] = $value;
140 140
 				}
@@ -142,16 +142,16 @@  discard block
 block discarded – undo
142 142
 		}
143 143
 
144 144
 		$oModuleController = getController('module');
145
-		if(count($module_config))
145
+		if (count($module_config))
146 146
 		{
147
-			foreach($module_config as $module_srl => $config)
147
+			foreach ($module_config as $module_srl => $config)
148 148
 			{
149
-				$oModuleController->insertModulePartConfig('point',$module_srl,$config);
149
+				$oModuleController->insertModulePartConfig('point', $module_srl, $config);
150 150
 			}
151 151
 		}
152 152
 
153 153
 		$this->setMessage('success_updated');
154
-		if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON')))
154
+		if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON')))
155 155
 		{
156 156
 			$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispPointAdminModuleConfig');
157 157
 			header('location:'.$returnUrl);
@@ -165,24 +165,24 @@  discard block
 block discarded – undo
165 165
 	function procPointAdminInsertPointModuleConfig()
166 166
 	{
167 167
 		$module_srl = Context::get('target_module_srl');
168
-		if(!$module_srl) return new BaseObject(-1, 'msg_invalid_request');
168
+		if (!$module_srl) return new BaseObject(-1, 'msg_invalid_request');
169 169
 		// In case of batch configuration of several modules
170
-		if(preg_match('/^([0-9,]+)$/',$module_srl)) $module_srl = explode(',',$module_srl);
170
+		if (preg_match('/^([0-9,]+)$/', $module_srl)) $module_srl = explode(',', $module_srl);
171 171
 		else $module_srl = array($module_srl);
172 172
 		// Save configurations
173 173
 		$oModuleController = getController('module');
174
-		for($i=0;$i<count($module_srl);$i++)
174
+		for ($i = 0; $i < count($module_srl); $i++)
175 175
 		{
176 176
 			$srl = trim($module_srl[$i]);
177
-			if(!$srl) continue;
177
+			if (!$srl) continue;
178 178
 			unset($config);
179
-			$config['insert_document'] = (int)Context::get('insert_document');
180
-			$config['insert_comment'] = (int)Context::get('insert_comment');
181
-			$config['upload_file'] = (int)Context::get('upload_file');
182
-			$config['download_file'] = (int)Context::get('download_file');
183
-			$config['read_document'] = (int)Context::get('read_document');
184
-			$config['voted'] = (int)Context::get('voted');
185
-			$config['blamed'] = (int)Context::get('blamed');
179
+			$config['insert_document'] = (int) Context::get('insert_document');
180
+			$config['insert_comment'] = (int) Context::get('insert_comment');
181
+			$config['upload_file'] = (int) Context::get('upload_file');
182
+			$config['download_file'] = (int) Context::get('download_file');
183
+			$config['read_document'] = (int) Context::get('read_document');
184
+			$config['voted'] = (int) Context::get('voted');
185
+			$config['blamed'] = (int) Context::get('blamed');
186 186
 			$oModuleController->insertModulePartConfig('point', $srl, $config);
187 187
 		}
188 188
 
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 		preg_match('/^(\+|-)?([1-9][0-9]*)$/', $point, $m);
205 205
 
206 206
 		$action = '';
207
-		switch($m[1])
207
+		switch ($m[1])
208 208
 		{
209 209
 			case '+':
210 210
 				$action = 'add';
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
 		$point = $m[2];
220 220
 
221 221
 		$oPointController = getController('point');
222
-		$output = $oPointController->setPoint($member_srl, (int)$point, $action);
222
+		$output = $oPointController->setPoint($member_srl, (int) $point, $action);
223 223
 
224 224
 		$this->setError(-1);
225 225
 		$this->setMessage('success_updated', 'info');
@@ -244,29 +244,29 @@  discard block
 block discarded – undo
244 244
 
245 245
 		// Get member infomation
246 246
 		$output = executeQueryArray('point.getMemberCount');
247
-		if(!$output->toBool()) return $output;
247
+		if (!$output->toBool()) return $output;
248 248
 
249
-		if($output->data)
249
+		if ($output->data)
250 250
 		{
251
-			foreach($output->data as $key => $val)
251
+			foreach ($output->data as $key => $val)
252 252
 			{
253
-				if(!$val->member_srl) continue;
253
+				if (!$val->member_srl) continue;
254 254
 				$member[$val->member_srl] = 0;
255 255
 			}
256 256
 		}
257 257
 
258 258
 		// Get post information
259 259
 		$output = executeQueryArray('point.getDocumentPoint');
260
-		if(!$output->toBool()) return $output;
260
+		if (!$output->toBool()) return $output;
261 261
 
262
-		if($output->data)
262
+		if ($output->data)
263 263
 		{
264
-			foreach($output->data as $key => $val)
264
+			foreach ($output->data as $key => $val)
265 265
 			{
266
-				if($module_config[$val->module_srl]['insert_document']) $insert_point = $module_config[$val->module_srl]['insert_document'];
266
+				if ($module_config[$val->module_srl]['insert_document']) $insert_point = $module_config[$val->module_srl]['insert_document'];
267 267
 				else $insert_point = $config->insert_document;
268 268
 
269
-				if(!$val->member_srl) continue;
269
+				if (!$val->member_srl) continue;
270 270
 				$point = $insert_point * $val->count;
271 271
 				$member[$val->member_srl] += $point;
272 272
 			}
@@ -275,16 +275,16 @@  discard block
 block discarded – undo
275 275
 		$output = null;
276 276
 		// Get comments information
277 277
 		$output = executeQueryArray('point.getCommentPoint');
278
-		if(!$output->toBool()) return $output;
278
+		if (!$output->toBool()) return $output;
279 279
 
280
-		if($output->data)
280
+		if ($output->data)
281 281
 		{
282
-			foreach($output->data as $key => $val)
282
+			foreach ($output->data as $key => $val)
283 283
 			{
284
-				if($module_config[$val->module_srl]['insert_comment']) $insert_point = $module_config[$val->module_srl]['insert_comment'];
284
+				if ($module_config[$val->module_srl]['insert_comment']) $insert_point = $module_config[$val->module_srl]['insert_comment'];
285 285
 				else $insert_point = $config->insert_comment;
286 286
 
287
-				if(!$val->member_srl) continue;
287
+				if (!$val->member_srl) continue;
288 288
 				$point = $insert_point * $val->count;
289 289
 				$member[$val->member_srl] += $point;
290 290
 			}
@@ -292,16 +292,16 @@  discard block
 block discarded – undo
292 292
 		$output = null;
293 293
 		// Get the attached files' information
294 294
 		$output = executeQueryArray('point.getFilePoint');
295
-		if(!$output->toBool()) return $output;
295
+		if (!$output->toBool()) return $output;
296 296
 
297
-		if($output->data)
297
+		if ($output->data)
298 298
 		{
299
-			foreach($output->data as $key => $val)
299
+			foreach ($output->data as $key => $val)
300 300
 			{
301
-				if($module_config[$val->module_srl]['upload_file']) $insert_point = $module_config[$val->module_srl]['upload_file'];
301
+				if ($module_config[$val->module_srl]['upload_file']) $insert_point = $module_config[$val->module_srl]['upload_file'];
302 302
 				else $insert_point = $config->upload_file;
303 303
 
304
-				if(!$val->member_srl) continue;
304
+				if (!$val->member_srl) continue;
305 305
 				$point = $insert_point * $val->count;
306 306
 				$member[$val->member_srl] += $point;
307 307
 			}
@@ -309,13 +309,13 @@  discard block
 block discarded – undo
309 309
 		$output = null;
310 310
 		// Set all members' points to 0
311 311
 		$output = executeQuery("point.initMemberPoint");
312
-		if(!$output->toBool()) return $output;
312
+		if (!$output->toBool()) return $output;
313 313
 		// Save the file temporarily
314 314
 		
315 315
 		$str = '';
316
-		foreach($member as $key => $val)
316
+		foreach ($member as $key => $val)
317 317
 		{
318
-			$val += (int)$config->signup_point;
318
+			$val += (int) $config->signup_point;
319 319
 			$str .= $key.','.$val."\r\n";
320 320
 		}
321 321
 
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
 
324 324
 		$this->add('total', count($member));
325 325
 		$this->add('position', 0);
326
-		$this->setMessage( sprintf(Context::getLang('point_recal_message'), 0, $this->get('total')) );
326
+		$this->setMessage(sprintf(Context::getLang('point_recal_message'), 0, $this->get('total')));
327 327
 	}
328 328
 
329 329
 	/**
@@ -331,35 +331,35 @@  discard block
 block discarded – undo
331 331
 	 */
332 332
 	function procPointAdminApplyPoint()
333 333
 	{
334
-		$position = (int)Context::get('position');
335
-		$total = (int)Context::get('total');
334
+		$position = (int) Context::get('position');
335
+		$total = (int) Context::get('total');
336 336
 
337
-		if(!file_exists('./files/cache/pointRecal.txt')) return new BaseObject(-1, 'msg_invalid_request');
337
+		if (!file_exists('./files/cache/pointRecal.txt')) return new BaseObject(-1, 'msg_invalid_request');
338 338
 
339 339
 		$idx = 0;
340
-		$f = fopen("./files/cache/pointRecal.txt","r");
341
-		while(!feof($f))
340
+		$f = fopen("./files/cache/pointRecal.txt", "r");
341
+		while (!feof($f))
342 342
 		{
343 343
 			$str = trim(fgets($f, 1024));
344
-			$idx ++;
345
-			if($idx > $position)
344
+			$idx++;
345
+			if ($idx > $position)
346 346
 			{
347
-				list($member_srl, $point) = explode(',',$str);
347
+				list($member_srl, $point) = explode(',', $str);
348 348
 
349 349
 				$args = new stdClass();
350 350
 				$args->member_srl = $member_srl;
351 351
 				$args->point = $point;
352
-				$output = executeQuery('point.insertPoint',$args);
353
-				if($idx%5000==0) break;
352
+				$output = executeQuery('point.insertPoint', $args);
353
+				if ($idx % 5000 == 0) break;
354 354
 			}
355 355
 		}
356 356
 
357
-		if(feof($f))
357
+		if (feof($f))
358 358
 		{
359 359
 			FileHandler::removeFile('./files/cache/pointRecal.txt');
360 360
 			$idx = $total;
361 361
 
362
-			FileHandler::rename('./files/member_extra_info/point','./files/member_extra_info/point.old');
362
+			FileHandler::rename('./files/member_extra_info/point', './files/member_extra_info/point.old');
363 363
 
364 364
 			FileHandler::removeDir('./files/member_extra_info/point.old');
365 365
 		}
@@ -377,16 +377,16 @@  discard block
 block discarded – undo
377 377
 	function procPointAdminReset()
378 378
 	{
379 379
 		$module_srl = Context::get('module_srls');
380
-		if(!$module_srl) return new BaseObject(-1, 'msg_invalid_request');
380
+		if (!$module_srl) return new BaseObject(-1, 'msg_invalid_request');
381 381
 		// In case of batch configuration of several modules
382
-		if(preg_match('/^([0-9,]+)$/',$module_srl)) $module_srl = explode(',',$module_srl);
382
+		if (preg_match('/^([0-9,]+)$/', $module_srl)) $module_srl = explode(',', $module_srl);
383 383
 		else $module_srl = array($module_srl);
384 384
 		// Save configurations
385 385
 		$oModuleController = getController('module');
386
-		for($i=0;$i<count($module_srl);$i++)
386
+		for ($i = 0; $i < count($module_srl); $i++)
387 387
 		{
388 388
 			$srl = trim($module_srl[$i]);
389
-			if(!$srl) continue;
389
+			if (!$srl) continue;
390 390
 			$args = new stdClass();
391 391
 			$args->module = 'point';
392 392
 			$args->module_srl = $srl;
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
 		}
395 395
 
396 396
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
397
-		if($oCacheHandler->isSupport())
397
+		if ($oCacheHandler->isSupport())
398 398
 		{
399 399
 			$oCacheHandler->invalidateGroupKey('site_and_module');
400 400
 		}
Please login to merge, or discard this patch.
Braces   +93 added lines, -35 removed lines patch added patch discarded remove patch
@@ -39,7 +39,9 @@  discard block
 block discarded – undo
39 39
 
40 40
 			// Check the point name
41 41
 			$config->point_name = $args->point_name;
42
-			if(!$config->point_name) $config->point_name = 'point';
42
+			if(!$config->point_name) {
43
+				$config->point_name = 'point';
44
+			}
43 45
 			// Specify the default points
44 46
 			$config->signup_point = (int)$args->signup_point;
45 47
 			$config->login_point = (int)$args->login_point;
@@ -52,16 +54,26 @@  discard block
 block discarded – undo
52 54
 			$config->blamed = (int)$args->blamed;
53 55
 			// The highest level
54 56
 			$config->max_level = $args->max_level;
55
-			if($config->max_level>1000) $config->max_level = 1000;
56
-			if($config->max_level<1) $config->max_level = 1;
57
+			if($config->max_level>1000) {
58
+				$config->max_level = 1000;
59
+			}
60
+			if($config->max_level<1) {
61
+				$config->max_level = 1;
62
+			}
57 63
 			// Set the level icon
58 64
 			$config->level_icon = $args->level_icon;
59 65
 			// Check if downloads are not allowed
60
-			if($args->disable_download == 'Y') $config->disable_download = 'Y';
61
-			else $config->disable_download = 'N';
66
+			if($args->disable_download == 'Y') {
67
+				$config->disable_download = 'Y';
68
+			} else {
69
+				$config->disable_download = 'N';
70
+			}
62 71
 			// Check if reading a document is not allowed
63
-			if($args->disable_read_document == 'Y') $config->disable_read_document = 'Y';
64
-			else $config->disable_read_document = 'N';
72
+			if($args->disable_read_document == 'Y') {
73
+				$config->disable_read_document = 'Y';
74
+			} else {
75
+				$config->disable_read_document = 'N';
76
+			}
65 77
 
66 78
 			$oMemberModel = getModel('member');
67 79
 			$group_list = $oMemberModel->getGroups();
@@ -71,7 +83,9 @@  discard block
 block discarded – undo
71 83
 			foreach($group_list as $group)
72 84
 			{
73 85
 				// Admin group should not be connected to point.
74
-				if($group->is_admin == 'Y' || $group->is_default == 'Y') continue;
86
+				if($group->is_admin == 'Y' || $group->is_default == 'Y') {
87
+					continue;
88
+				}
75 89
 
76 90
 				$group_srl = $group->group_srl;
77 91
 
@@ -102,8 +116,7 @@  discard block
 block discarded – undo
102 116
 			}
103 117
 			// A function to calculate per-level points
104 118
 			$config->expression = $args->expression;
105
-		}
106
-		else
119
+		} else
107 120
 		{
108 121
 			//module IO config is OFF, Other settings will not be modified.
109 122
 			$config->able_module = 'N';
@@ -165,16 +178,23 @@  discard block
 block discarded – undo
165 178
 	function procPointAdminInsertPointModuleConfig()
166 179
 	{
167 180
 		$module_srl = Context::get('target_module_srl');
168
-		if(!$module_srl) return new BaseObject(-1, 'msg_invalid_request');
181
+		if(!$module_srl) {
182
+			return new BaseObject(-1, 'msg_invalid_request');
183
+		}
169 184
 		// In case of batch configuration of several modules
170
-		if(preg_match('/^([0-9,]+)$/',$module_srl)) $module_srl = explode(',',$module_srl);
171
-		else $module_srl = array($module_srl);
185
+		if(preg_match('/^([0-9,]+)$/',$module_srl)) {
186
+			$module_srl = explode(',',$module_srl);
187
+		} else {
188
+			$module_srl = array($module_srl);
189
+		}
172 190
 		// Save configurations
173 191
 		$oModuleController = getController('module');
174 192
 		for($i=0;$i<count($module_srl);$i++)
175 193
 		{
176 194
 			$srl = trim($module_srl[$i]);
177
-			if(!$srl) continue;
195
+			if(!$srl) {
196
+				continue;
197
+			}
178 198
 			unset($config);
179 199
 			$config['insert_document'] = (int)Context::get('insert_document');
180 200
 			$config['insert_comment'] = (int)Context::get('insert_comment');
@@ -244,29 +264,40 @@  discard block
 block discarded – undo
244 264
 
245 265
 		// Get member infomation
246 266
 		$output = executeQueryArray('point.getMemberCount');
247
-		if(!$output->toBool()) return $output;
267
+		if(!$output->toBool()) {
268
+			return $output;
269
+		}
248 270
 
249 271
 		if($output->data)
250 272
 		{
251 273
 			foreach($output->data as $key => $val)
252 274
 			{
253
-				if(!$val->member_srl) continue;
275
+				if(!$val->member_srl) {
276
+					continue;
277
+				}
254 278
 				$member[$val->member_srl] = 0;
255 279
 			}
256 280
 		}
257 281
 
258 282
 		// Get post information
259 283
 		$output = executeQueryArray('point.getDocumentPoint');
260
-		if(!$output->toBool()) return $output;
284
+		if(!$output->toBool()) {
285
+			return $output;
286
+		}
261 287
 
262 288
 		if($output->data)
263 289
 		{
264 290
 			foreach($output->data as $key => $val)
265 291
 			{
266
-				if($module_config[$val->module_srl]['insert_document']) $insert_point = $module_config[$val->module_srl]['insert_document'];
267
-				else $insert_point = $config->insert_document;
292
+				if($module_config[$val->module_srl]['insert_document']) {
293
+					$insert_point = $module_config[$val->module_srl]['insert_document'];
294
+				} else {
295
+					$insert_point = $config->insert_document;
296
+				}
268 297
 
269
-				if(!$val->member_srl) continue;
298
+				if(!$val->member_srl) {
299
+					continue;
300
+				}
270 301
 				$point = $insert_point * $val->count;
271 302
 				$member[$val->member_srl] += $point;
272 303
 			}
@@ -275,16 +306,23 @@  discard block
 block discarded – undo
275 306
 		$output = null;
276 307
 		// Get comments information
277 308
 		$output = executeQueryArray('point.getCommentPoint');
278
-		if(!$output->toBool()) return $output;
309
+		if(!$output->toBool()) {
310
+			return $output;
311
+		}
279 312
 
280 313
 		if($output->data)
281 314
 		{
282 315
 			foreach($output->data as $key => $val)
283 316
 			{
284
-				if($module_config[$val->module_srl]['insert_comment']) $insert_point = $module_config[$val->module_srl]['insert_comment'];
285
-				else $insert_point = $config->insert_comment;
317
+				if($module_config[$val->module_srl]['insert_comment']) {
318
+					$insert_point = $module_config[$val->module_srl]['insert_comment'];
319
+				} else {
320
+					$insert_point = $config->insert_comment;
321
+				}
286 322
 
287
-				if(!$val->member_srl) continue;
323
+				if(!$val->member_srl) {
324
+					continue;
325
+				}
288 326
 				$point = $insert_point * $val->count;
289 327
 				$member[$val->member_srl] += $point;
290 328
 			}
@@ -292,16 +330,23 @@  discard block
 block discarded – undo
292 330
 		$output = null;
293 331
 		// Get the attached files' information
294 332
 		$output = executeQueryArray('point.getFilePoint');
295
-		if(!$output->toBool()) return $output;
333
+		if(!$output->toBool()) {
334
+			return $output;
335
+		}
296 336
 
297 337
 		if($output->data)
298 338
 		{
299 339
 			foreach($output->data as $key => $val)
300 340
 			{
301
-				if($module_config[$val->module_srl]['upload_file']) $insert_point = $module_config[$val->module_srl]['upload_file'];
302
-				else $insert_point = $config->upload_file;
341
+				if($module_config[$val->module_srl]['upload_file']) {
342
+					$insert_point = $module_config[$val->module_srl]['upload_file'];
343
+				} else {
344
+					$insert_point = $config->upload_file;
345
+				}
303 346
 
304
-				if(!$val->member_srl) continue;
347
+				if(!$val->member_srl) {
348
+					continue;
349
+				}
305 350
 				$point = $insert_point * $val->count;
306 351
 				$member[$val->member_srl] += $point;
307 352
 			}
@@ -309,7 +354,9 @@  discard block
 block discarded – undo
309 354
 		$output = null;
310 355
 		// Set all members' points to 0
311 356
 		$output = executeQuery("point.initMemberPoint");
312
-		if(!$output->toBool()) return $output;
357
+		if(!$output->toBool()) {
358
+			return $output;
359
+		}
313 360
 		// Save the file temporarily
314 361
 		
315 362
 		$str = '';
@@ -334,7 +381,9 @@  discard block
 block discarded – undo
334 381
 		$position = (int)Context::get('position');
335 382
 		$total = (int)Context::get('total');
336 383
 
337
-		if(!file_exists('./files/cache/pointRecal.txt')) return new BaseObject(-1, 'msg_invalid_request');
384
+		if(!file_exists('./files/cache/pointRecal.txt')) {
385
+			return new BaseObject(-1, 'msg_invalid_request');
386
+		}
338 387
 
339 388
 		$idx = 0;
340 389
 		$f = fopen("./files/cache/pointRecal.txt","r");
@@ -350,7 +399,9 @@  discard block
 block discarded – undo
350 399
 				$args->member_srl = $member_srl;
351 400
 				$args->point = $point;
352 401
 				$output = executeQuery('point.insertPoint',$args);
353
-				if($idx%5000==0) break;
402
+				if($idx%5000==0) {
403
+					break;
404
+				}
354 405
 			}
355 406
 		}
356 407
 
@@ -377,16 +428,23 @@  discard block
 block discarded – undo
377 428
 	function procPointAdminReset()
378 429
 	{
379 430
 		$module_srl = Context::get('module_srls');
380
-		if(!$module_srl) return new BaseObject(-1, 'msg_invalid_request');
431
+		if(!$module_srl) {
432
+			return new BaseObject(-1, 'msg_invalid_request');
433
+		}
381 434
 		// In case of batch configuration of several modules
382
-		if(preg_match('/^([0-9,]+)$/',$module_srl)) $module_srl = explode(',',$module_srl);
383
-		else $module_srl = array($module_srl);
435
+		if(preg_match('/^([0-9,]+)$/',$module_srl)) {
436
+			$module_srl = explode(',',$module_srl);
437
+		} else {
438
+			$module_srl = array($module_srl);
439
+		}
384 440
 		// Save configurations
385 441
 		$oModuleController = getController('module');
386 442
 		for($i=0;$i<count($module_srl);$i++)
387 443
 		{
388 444
 			$srl = trim($module_srl[$i]);
389
-			if(!$srl) continue;
445
+			if(!$srl) {
446
+				continue;
447
+			}
390 448
 			$args = new stdClass();
391 449
 			$args->module = 'point';
392 450
 			$args->module_srl = $srl;
Please login to merge, or discard this patch.
modules/board/board.class.php 2 patches
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 
10 10
 class board extends ModuleObject
11 11
 {
12
-	var $search_option = array('title_content','title','content','comment','user_name','nick_name','user_id','tag'); ///< 검색 옵션
12
+	var $search_option = array('title_content', 'title', 'content', 'comment', 'user_name', 'nick_name', 'user_id', 'tag'); ///< 검색 옵션
13 13
 
14 14
 	var $order_target = array('list_order', 'update_order', 'regdate', 'voted_count', 'blamed_count', 'readed_count', 'comment_count', 'title', 'nick_name', 'user_name', 'user_id'); // 정렬 옵션
15 15
 
@@ -25,14 +25,14 @@  discard block
 block discarded – undo
25 25
 	 */
26 26
 	function board()
27 27
 	{
28
-		if(!Context::isInstalled()) return;
28
+		if (!Context::isInstalled()) return;
29 29
 
30
-		if(!Context::isExistsSSLAction('dispBoardWrite') && Context::getSslStatus() == 'optional')
30
+		if (!Context::isExistsSSLAction('dispBoardWrite') && Context::getSslStatus() == 'optional')
31 31
 		{
32 32
 			$ssl_actions = array('dispBoardWrite', 'dispBoardWriteComment', 'dispBoardReplyComment', 'dispBoardModifyComment', 'dispBoardDelete', 'dispBoardDeleteComment', 'procBoardInsertDocument', 'procBoardDeleteDocument', 'procBoardInsertComment', 'procBoardDeleteComment', 'procBoardVerificationPassword');
33 33
 			Context::addSSLActions($ssl_actions);
34 34
 		}
35
-		if(!Context::isExistsSSLAction('dispTempSavedList') && Context::getSslStatus() == 'optional')
35
+		if (!Context::isExistsSSLAction('dispTempSavedList') && Context::getSslStatus() == 'optional')
36 36
 		{
37 37
 			Context::addSSLAction('dispTempSavedList');
38 38
 		}
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 		$args = new stdClass;
55 55
 		$args->site_srl = 0;
56 56
 		$output = executeQuery('module.getSite', $args);
57
-		if(!$output->data->index_module_srl)
57
+		if (!$output->data->index_module_srl)
58 58
 		{
59 59
 			$args->mid = 'board';
60 60
 			$args->module = 'board';
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 			$args->site_srl = 0;
64 64
 			$output = $oModuleController->insertModule($args);
65 65
 
66
-			if($output->toBool())
66
+			if ($output->toBool())
67 67
 			{
68 68
 				$module_srl = $output->get('module_srl');
69 69
 
@@ -87,13 +87,13 @@  discard block
 block discarded – undo
87 87
 		$oModuleModel = getModel('module');
88 88
 		$oModuleController = getController('module');
89 89
 		$version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated'));
90
-		if($oModuleModel->needUpdate($version_update_id))
90
+		if ($oModuleModel->needUpdate($version_update_id))
91 91
 		{
92 92
 			// 2007. 10. 17 get the member menu trigger
93
-			if(!$oModuleModel->getTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after')) return true;
93
+			if (!$oModuleModel->getTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after')) return true;
94 94
 
95 95
 			// 2011. 09. 20 when add new menu in sitemap, custom menu add
96
-			if(!$oModuleModel->getTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after')) return true;
96
+			if (!$oModuleModel->getTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after')) return true;
97 97
 
98 98
 			$oModuleController->insertUpdatedLog($version_update_id);
99 99
 		}
@@ -109,16 +109,16 @@  discard block
 block discarded – undo
109 109
 		$oModuleModel = getModel('module');
110 110
 		$oModuleController = getController('module');
111 111
 		$version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated'));
112
-		if($oModuleModel->needUpdate($version_update_id))
112
+		if ($oModuleModel->needUpdate($version_update_id))
113 113
 		{
114 114
 			// 2007. 10. 17  check the member menu trigger, if it is not existed then insert
115
-			if(!$oModuleModel->getTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after'))
115
+			if (!$oModuleModel->getTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after'))
116 116
 			{
117 117
 				$oModuleController->insertTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after');
118 118
 			}
119 119
 
120 120
 			// 2011. 09. 20 when add new menu in sitemap, custom menu add
121
-			if(!$oModuleModel->getTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after'))
121
+			if (!$oModuleModel->getTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after'))
122 122
 			{
123 123
 				$oModuleController->insertTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after');
124 124
 			}
@@ -131,12 +131,12 @@  discard block
 block discarded – undo
131 131
 	function moduleUninstall()
132 132
 	{
133 133
 		$output = executeQueryArray("board.getAllBoard");
134
-		if(!$output->data) return new BaseObject();
134
+		if (!$output->data) return new BaseObject();
135 135
 		@set_time_limit(0);
136 136
 
137 137
 		$oModuleController = getController('module');
138 138
 
139
-		foreach($output->data as $board)
139
+		foreach ($output->data as $board)
140 140
 		{
141 141
 			$oModuleController->deleteModule($board->module_srl);
142 142
 		}
Please login to merge, or discard this patch.
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -25,7 +25,9 @@  discard block
 block discarded – undo
25 25
 	 */
26 26
 	function board()
27 27
 	{
28
-		if(!Context::isInstalled()) return;
28
+		if(!Context::isInstalled()) {
29
+			return;
30
+		}
29 31
 
30 32
 		if(!Context::isExistsSSLAction('dispBoardWrite') && Context::getSslStatus() == 'optional')
31 33
 		{
@@ -90,10 +92,14 @@  discard block
 block discarded – undo
90 92
 		if($oModuleModel->needUpdate($version_update_id))
91 93
 		{
92 94
 			// 2007. 10. 17 get the member menu trigger
93
-			if(!$oModuleModel->getTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after')) return true;
95
+			if(!$oModuleModel->getTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after')) {
96
+				return true;
97
+			}
94 98
 
95 99
 			// 2011. 09. 20 when add new menu in sitemap, custom menu add
96
-			if(!$oModuleModel->getTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after')) return true;
100
+			if(!$oModuleModel->getTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after')) {
101
+				return true;
102
+			}
97 103
 
98 104
 			$oModuleController->insertUpdatedLog($version_update_id);
99 105
 		}
@@ -131,7 +137,9 @@  discard block
 block discarded – undo
131 137
 	function moduleUninstall()
132 138
 	{
133 139
 		$output = executeQueryArray("board.getAllBoard");
134
-		if(!$output->data) return new BaseObject();
140
+		if(!$output->data) {
141
+			return new BaseObject();
142
+		}
135 143
 		@set_time_limit(0);
136 144
 
137 145
 		$oModuleController = getController('module');
Please login to merge, or discard this patch.