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 ( 3d3ece...f480fa )
by gyeong-won
09:44
created
modules/counter/counter.model.php 2 patches
Braces   +29 added lines, -23 removed lines patch added patch discarded remove patch
@@ -42,7 +42,9 @@  discard block
 block discarded – undo
42 42
 		if($iplogged === false)
43 43
 		{
44 44
 			$output = executeQuery('counter.getCounterLog', $args);
45
-			if($output->data->count) $iplogged = TRUE;
45
+			if($output->data->count) {
46
+				$iplogged = TRUE;
47
+			}
46 48
 		}
47 49
 
48 50
 		if($iplogged && $oCacheHandler->isSupport())
@@ -78,8 +80,7 @@  discard block
 block discarded – undo
78 80
 			{
79 81
 				$args->site_srl = $site_srl;
80 82
 				$output = executeQuery('counter.getSiteTodayStatus', $args);
81
-			}
82
-			else
83
+			} else
83 84
 			{
84 85
 				$output = executeQuery('counter.getTodayStatus', $args);
85 86
 			}
@@ -113,8 +114,7 @@  discard block
 block discarded – undo
113 114
 		{
114 115
 			$args->site_srl = $site_srl;
115 116
 			$output = executeQuery('counter.getSiteCounterStatusDays', $args);
116
-		}
117
-		else
117
+		} else
118 118
 		{
119 119
 			$output = executeQuery('counter.getCounterStatusDays', $args);
120 120
 		}
@@ -125,7 +125,9 @@  discard block
 block discarded – undo
125 125
 			return $status;
126 126
 		}
127 127
 
128
-		if(!is_array($status)) $status = array($status);
128
+		if(!is_array($status)) {
129
+			$status = array($status);
130
+		}
129 131
 		$output = array();
130 132
 		foreach($status as $val)
131 133
 		{
@@ -157,8 +159,7 @@  discard block
 block discarded – undo
157 159
 					$args = new stdClass();
158 160
 					$args->site_srl = $site_srl;
159 161
 					$output = executeQuery('counter.getSiteStartLogDate', $args);
160
-				}
161
-				else
162
+				} else
162 163
 				{
163 164
 					$output = executeQuery('counter.getStartLogDate');
164 165
 				}
@@ -178,8 +179,7 @@  discard block
 block discarded – undo
178 179
 					{
179 180
 						$args->site_srl = $site_srl;
180 181
 						$output = executeQuery('counter.getSiteCounterStatus', $args);
181
-					}
182
-					else
182
+					} else
183 183
 					{
184 184
 						$output = executeQuery('counter.getCounterStatus', $args);
185 185
 					}
@@ -187,7 +187,9 @@  discard block
 block discarded – undo
187 187
 					$count = (int)($isPageView ? $output->data->pageview : $output->data->unique_visitor);
188 188
 					$status->list[$i] = $count;
189 189
 
190
-					if($count > $max) $max = $count;
190
+					if($count > $max) {
191
+						$max = $count;
192
+					}
191 193
 
192 194
 					$sum += $count;
193 195
 				}
@@ -224,8 +226,7 @@  discard block
 block discarded – undo
224 226
 					{
225 227
 						$args->site_srl = $site_srl;
226 228
 						$output = executeQuery('counter.getSiteCounterStatus', $args);
227
-					}
228
-					else
229
+					} else
229 230
 					{
230 231
 						$output = executeQuery('counter.getCounterStatus', $args);
231 232
 					}
@@ -233,7 +234,9 @@  discard block
 block discarded – undo
233 234
 					$count = (int)($isPageView ? $output->data->pageview : $output->data->unique_visitor);
234 235
 					$status->list[$day] = $count;
235 236
 
236
-					if($count > $max) $max = $count;
237
+					if($count > $max) {
238
+						$max = $count;
239
+					}
237 240
 
238 241
 					$sum += $count;
239 242
 				}
@@ -251,8 +254,7 @@  discard block
 block discarded – undo
251 254
 					{
252 255
 						$args->site_srl = $site_srl;
253 256
 						$output = executeQuery('counter.getSiteCounterStatus', $args);
254
-					}
255
-					else
257
+					} else
256 258
 					{
257 259
 						$output = executeQuery('counter.getCounterStatus', $args);
258 260
 					}
@@ -260,7 +262,9 @@  discard block
 block discarded – undo
260 262
 					$count = (int)($isPageView ? $output->data->pageview : $output->data->unique_visitor);
261 263
 					$status->list[$i] = $count;
262 264
 
263
-					if($count > $max) $max = $count;
265
+					if($count > $max) {
266
+						$max = $count;
267
+					}
264 268
 
265 269
 					$sum += $count;
266 270
 				}
@@ -277,8 +281,7 @@  discard block
 block discarded – undo
277 281
 					{
278 282
 						$args->site_srl = $site_srl;
279 283
 						$output = executeQuery('counter.getSiteCounterLogStatus', $args);
280
-					}
281
-					else
284
+					} else
282 285
 					{
283 286
 						$args->site_srl = 0;
284 287
 						$output = executeQuery('counter.getCounterLogStatus', $args);
@@ -287,7 +290,9 @@  discard block
 block discarded – undo
287 290
 					$count = (int) $output->data->count;
288 291
 					$status->list[$i] = $count;
289 292
 
290
-					if($count > $max) $max = $count;
293
+					if($count > $max) {
294
+						$max = $count;
295
+					}
291 296
 
292 297
 					$sum += $count;
293 298
 				}
@@ -308,8 +313,7 @@  discard block
 block discarded – undo
308 313
 					{
309 314
 						$args->site_srl = $site_srl;
310 315
 						$output = executeQuery('counter.getSiteCounterStatus', $args);
311
-					}
312
-					else
316
+					} else
313 317
 					{
314 318
 						$output = executeQuery('counter.getCounterStatus', $args);
315 319
 					}
@@ -317,7 +321,9 @@  discard block
 block discarded – undo
317 321
 					$count = (int)($isPageView ? $output->data->pageview : $output->data->unique_visitor);
318 322
 					$status->list[$i] = $count;
319 323
 
320
-					if($count > $max) $max = $count;
324
+					if($count > $max) {
325
+						$max = $count;
326
+					}
321 327
 
322 328
 					$sum += $count;
323 329
 				}
Please login to merge, or discard this patch.
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -32,20 +32,20 @@  discard block
 block discarded – undo
32 32
 
33 33
 		$iplogged = false;
34 34
 		$oCacheHandler = CacheHandler::getInstance('object');
35
-		if($oCacheHandler->isSupport())
35
+		if ($oCacheHandler->isSupport())
36 36
 		{
37
-			$object_key = 'counter:' . $site_srl . '_' . str_replace(array('.', ':'), '-', $args->ipaddress);
38
-			$cache_key = $oCacheHandler->getGroupKey('counterIpLogged_' . $args->regdate, $object_key);
37
+			$object_key = 'counter:'.$site_srl.'_'.str_replace(array('.', ':'), '-', $args->ipaddress);
38
+			$cache_key = $oCacheHandler->getGroupKey('counterIpLogged_'.$args->regdate, $object_key);
39 39
 			$iplogged = $oCacheHandler->get($cache_key);
40 40
 		}
41 41
 
42
-		if($iplogged === false)
42
+		if ($iplogged === false)
43 43
 		{
44 44
 			$output = executeQuery('counter.getCounterLog', $args);
45
-			if($output->data->count) $iplogged = TRUE;
45
+			if ($output->data->count) $iplogged = TRUE;
46 46
 		}
47 47
 
48
-		if($iplogged && $oCacheHandler->isSupport())
48
+		if ($iplogged && $oCacheHandler->isSupport())
49 49
 		{
50 50
 			$oCacheHandler->put($cache_key, $iplogged);
51 51
 		}
@@ -66,15 +66,15 @@  discard block
 block discarded – undo
66 66
 
67 67
 		$insertedTodayStatus = false;
68 68
 		$oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE);
69
-		if($oCacheHandler->isSupport())
69
+		if ($oCacheHandler->isSupport())
70 70
 		{
71
-			$cache_key = 'counter:insertedTodayStatus:' . $site_srl . '_' . $args->regdate;
71
+			$cache_key = 'counter:insertedTodayStatus:'.$site_srl.'_'.$args->regdate;
72 72
 			$insertedTodayStatus = $oCacheHandler->get($cache_key);
73 73
 		}
74 74
 
75
-		if($insertedTodayStatus === false)
75
+		if ($insertedTodayStatus === false)
76 76
 		{
77
-			if($site_srl)
77
+			if ($site_srl)
78 78
 			{
79 79
 				$args->site_srl = $site_srl;
80 80
 				$output = executeQuery('counter.getSiteTodayStatus', $args);
@@ -86,11 +86,11 @@  discard block
 block discarded – undo
86 86
 
87 87
 			$insertedTodayStatus = !!$output->data->count;
88 88
 
89
-			if($insertedTodayStatus && $oCacheHandler->isSupport())
89
+			if ($insertedTodayStatus && $oCacheHandler->isSupport())
90 90
 			{
91 91
 				$oCacheHandler->put($cache_key, TRUE);
92 92
 				$_old_date = date('Ymd', strtotime('-1 day'));
93
-				$oCacheHandler->delete('counter:insertedTodayStatus:' . $site_srl . '_' . $_old_date);
93
+				$oCacheHandler->delete('counter:insertedTodayStatus:'.$site_srl.'_'.$_old_date);
94 94
 			}
95 95
 		}
96 96
 
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 		// If more than one date logs are selected
110 110
 		$args = new stdClass();
111 111
 		$args->regdate = is_array($selected_date) ? join(',', $selected_date) : $selected_date;
112
-		if($site_srl)
112
+		if ($site_srl)
113 113
 		{
114 114
 			$args->site_srl = $site_srl;
115 115
 			$output = executeQuery('counter.getSiteCounterStatusDays', $args);
@@ -120,14 +120,14 @@  discard block
 block discarded – undo
120 120
 		}
121 121
 		$status = $output->data;
122 122
 
123
-		if(!is_array($selected_date))
123
+		if (!is_array($selected_date))
124 124
 		{
125 125
 			return $status;
126 126
 		}
127 127
 
128
-		if(!is_array($status)) $status = array($status);
128
+		if (!is_array($status)) $status = array($status);
129 129
 		$output = array();
130
-		foreach($status as $val)
130
+		foreach ($status as $val)
131 131
 		{
132 132
 			$output[substr($val->regdate, 0, 8)] = $val;
133 133
 		}
@@ -148,11 +148,11 @@  discard block
 block discarded – undo
148 148
 		$max = 0;
149 149
 		$sum = 0;
150 150
 
151
-		switch($type)
151
+		switch ($type)
152 152
 		{
153 153
 			case 'year' :
154 154
 				// Get a date to start counting
155
-				if($site_srl)
155
+				if ($site_srl)
156 156
 				{
157 157
 					$args = new stdClass();
158 158
 					$args->site_srl = $site_srl;
@@ -163,18 +163,18 @@  discard block
 block discarded – undo
163 163
 					$output = executeQuery('counter.getStartLogDate');
164 164
 				}
165 165
 
166
-				if(!($start_year = substr($output->data->regdate, 0, 4)))
166
+				if (!($start_year = substr($output->data->regdate, 0, 4)))
167 167
 				{
168 168
 					$start_year = date("Y");
169 169
 				}
170 170
 
171
-				for($i = $start_year, $y = date("Y"); $i <= $y; $i++)
171
+				for ($i = $start_year, $y = date("Y"); $i <= $y; $i++)
172 172
 				{
173 173
 					$args = new stdClass();
174 174
 					$args->start_date = sprintf('%04d0000', $i);
175 175
 					$args->end_date = sprintf('%04d1231', $i);
176 176
 
177
-					if($site_srl)
177
+					if ($site_srl)
178 178
 					{
179 179
 						$args->site_srl = $site_srl;
180 180
 						$output = executeQuery('counter.getSiteCounterStatus', $args);
@@ -184,10 +184,10 @@  discard block
 block discarded – undo
184 184
 						$output = executeQuery('counter.getCounterStatus', $args);
185 185
 					}
186 186
 
187
-					$count = (int)($isPageView ? $output->data->pageview : $output->data->unique_visitor);
187
+					$count = (int) ($isPageView ? $output->data->pageview : $output->data->unique_visitor);
188 188
 					$status->list[$i] = $count;
189 189
 
190
-					if($count > $max) $max = $count;
190
+					if ($count > $max) $max = $count;
191 191
 
192 192
 					$sum += $count;
193 193
 				}
@@ -197,14 +197,14 @@  discard block
 block discarded – undo
197 197
 				$time = strtotime($selected_date);
198 198
 				$w = date("D");
199 199
 
200
-				while(date("D", $time) != "Sun")
200
+				while (date("D", $time) != "Sun")
201 201
 				{
202 202
 					$time += 60 * 60 * 24;
203 203
 				}
204 204
 
205 205
 				$time -= 60 * 60 * 24;
206 206
 
207
-				while(date("D", $time) != "Sun")
207
+				while (date("D", $time) != "Sun")
208 208
 				{
209 209
 					$thisWeek[] = date("Ymd", $time);
210 210
 					$time -= 60 * 60 * 24;
@@ -214,13 +214,13 @@  discard block
 block discarded – undo
214 214
 
215 215
 				asort($thisWeek);
216 216
 
217
-				foreach($thisWeek as $day)
217
+				foreach ($thisWeek as $day)
218 218
 				{
219 219
 					$args = new stdClass();
220 220
 					$args->start_date = $day;
221 221
 					$args->end_date = $day;
222 222
 
223
-					if($site_srl)
223
+					if ($site_srl)
224 224
 					{
225 225
 						$args->site_srl = $site_srl;
226 226
 						$output = executeQuery('counter.getSiteCounterStatus', $args);
@@ -230,10 +230,10 @@  discard block
 block discarded – undo
230 230
 						$output = executeQuery('counter.getCounterStatus', $args);
231 231
 					}
232 232
 
233
-					$count = (int)($isPageView ? $output->data->pageview : $output->data->unique_visitor);
233
+					$count = (int) ($isPageView ? $output->data->pageview : $output->data->unique_visitor);
234 234
 					$status->list[$day] = $count;
235 235
 
236
-					if($count > $max) $max = $count;
236
+					if ($count > $max) $max = $count;
237 237
 
238 238
 					$sum += $count;
239 239
 				}
@@ -241,13 +241,13 @@  discard block
 block discarded – undo
241 241
 
242 242
 			case 'month' :
243 243
 				$year = substr($selected_date, 0, 4);
244
-				for($i = 1; $i <= 12; $i++)
244
+				for ($i = 1; $i <= 12; $i++)
245 245
 				{
246 246
 					$args = new stdClass();
247 247
 					$args->start_date = sprintf('%04d%02d00', $year, $i);
248 248
 					$args->end_date = sprintf('%04d%02d31', $year, $i);
249 249
 
250
-					if($site_srl)
250
+					if ($site_srl)
251 251
 					{
252 252
 						$args->site_srl = $site_srl;
253 253
 						$output = executeQuery('counter.getSiteCounterStatus', $args);
@@ -257,23 +257,23 @@  discard block
 block discarded – undo
257 257
 						$output = executeQuery('counter.getCounterStatus', $args);
258 258
 					}
259 259
 
260
-					$count = (int)($isPageView ? $output->data->pageview : $output->data->unique_visitor);
260
+					$count = (int) ($isPageView ? $output->data->pageview : $output->data->unique_visitor);
261 261
 					$status->list[$i] = $count;
262 262
 
263
-					if($count > $max) $max = $count;
263
+					if ($count > $max) $max = $count;
264 264
 
265 265
 					$sum += $count;
266 266
 				}
267 267
 				break;
268 268
 
269 269
 			case 'hour' :
270
-				for($i = 0; $i < 24; $i++)
270
+				for ($i = 0; $i < 24; $i++)
271 271
 				{
272 272
 					$args = new stdClass();
273 273
 					$args->start_date = sprintf('%08d%02d0000', $selected_date, $i);
274 274
 					$args->end_date = sprintf('%08d%02d5959', $selected_date, $i);
275 275
 
276
-					if($site_srl)
276
+					if ($site_srl)
277 277
 					{
278 278
 						$args->site_srl = $site_srl;
279 279
 						$output = executeQuery('counter.getSiteCounterLogStatus', $args);
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
 					$count = (int) $output->data->count;
288 288
 					$status->list[$i] = $count;
289 289
 
290
-					if($count > $max) $max = $count;
290
+					if ($count > $max) $max = $count;
291 291
 
292 292
 					$sum += $count;
293 293
 				}
@@ -298,13 +298,13 @@  discard block
 block discarded – undo
298 298
 				$month = substr($selected_date, 4, 2);
299 299
 				$end_day = date('t', mktime(0, 0, 0, $month, 1, $year));
300 300
 
301
-				for($i = 1; $i <= $end_day; $i++)
301
+				for ($i = 1; $i <= $end_day; $i++)
302 302
 				{
303 303
 					$args = new stdClass();
304 304
 					$args->start_date = sprintf('%04d%02d%02d', $year, $month, $i);
305 305
 					$args->end_date = sprintf('%04d%02d%02d', $year, $month, $i);
306 306
 
307
-					if($site_srl)
307
+					if ($site_srl)
308 308
 					{
309 309
 						$args->site_srl = $site_srl;
310 310
 						$output = executeQuery('counter.getSiteCounterStatus', $args);
@@ -314,10 +314,10 @@  discard block
 block discarded – undo
314 314
 						$output = executeQuery('counter.getCounterStatus', $args);
315 315
 					}
316 316
 
317
-					$count = (int)($isPageView ? $output->data->pageview : $output->data->unique_visitor);
317
+					$count = (int) ($isPageView ? $output->data->pageview : $output->data->unique_visitor);
318 318
 					$status->list[$i] = $count;
319 319
 
320
-					if($count > $max) $max = $count;
320
+					if ($count > $max) $max = $count;
321 321
 
322 322
 					$sum += $count;
323 323
 				}
@@ -337,9 +337,9 @@  discard block
 block discarded – undo
337 337
 		$output1 = $this->getHourlyStatus('week', $date1);
338 338
 
339 339
 		$tmp = array();
340
-		foreach($output1->list as $key => $value)
340
+		foreach ($output1->list as $key => $value)
341 341
 		{
342
-			$tmp["'" . $key . "'"] = $value;
342
+			$tmp["'".$key."'"] = $value;
343 343
 		}
344 344
 		$output1->list = $tmp;
345 345
 
@@ -348,9 +348,9 @@  discard block
 block discarded – undo
348 348
 		$output2 = $this->getHourlyStatus('week', $date2);
349 349
 
350 350
 		$tmp = array();
351
-		foreach($output2->list as $key => $value)
351
+		foreach ($output2->list as $key => $value)
352 352
 		{
353
-			$tmp["'" . $key . "'"] = $value;
353
+			$tmp["'".$key."'"] = $value;
354 354
 		}
355 355
 		$output2->list = $tmp;
356 356
 
@@ -365,9 +365,9 @@  discard block
 block discarded – undo
365 365
 		$output1 = $this->getHourlyStatus('week', $date1, 0, TRUE);
366 366
 
367 367
 		$tmp = array();
368
-		foreach($output1->list as $key => $value)
368
+		foreach ($output1->list as $key => $value)
369 369
 		{
370
-			$tmp["'" . $key . "'"] = $value;
370
+			$tmp["'".$key."'"] = $value;
371 371
 		}
372 372
 		$output1->list = $tmp;
373 373
 
@@ -376,9 +376,9 @@  discard block
 block discarded – undo
376 376
 		$output2 = $this->getHourlyStatus('week', $date2, 0, TRUE);
377 377
 
378 378
 		$tmp = array();
379
-		foreach($output2->list as $key => $value)
379
+		foreach ($output2->list as $key => $value)
380 380
 		{
381
-			$tmp["'" . $key . "'"] = $value;
381
+			$tmp["'".$key."'"] = $value;
382 382
 		}
383 383
 		$output2->list = $tmp;
384 384
 
Please login to merge, or discard this patch.
modules/document/document.admin.controller.php 4 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -721,10 +721,10 @@
 block discarded – undo
721 721
 	}
722 722
 
723 723
 	/**
724
-	  * @fn procDocumentAdminMoveToTrash
725
-	  * @brief move a document to trash.
726
-	  * @see documentModel::getDocumentMenu
727
-	  */
724
+	 * @fn procDocumentAdminMoveToTrash
725
+	 * @brief move a document to trash.
726
+	 * @see documentModel::getDocumentMenu
727
+	 */
728 728
 	function procDocumentAdminMoveToTrash()
729 729
 	{
730 730
 		$document_srl = Context::get('document_srl');
Please login to merge, or discard this patch.
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 
22 22
 	/**
23 23
 	 * Remove the selected docs from admin page
24
-	 * @return void
24
+	 * @return ModuleObject|null
25 25
 	 */
26 26
 	function procDocumentAdminDeleteChecked()
27 27
 	{
@@ -869,8 +869,8 @@  discard block
 block discarded – undo
869 869
 	/**
870 870
 	 * Restore document from trash module, called by trash module
871 871
 	 * This method is passived
872
-	 * @param object|array $originObject
873
-	 * @return object
872
+	 * @param string $originObject
873
+	 * @return BaseObject
874 874
 	 */
875 875
 	function restoreTrash($originObject)
876 876
 	{
Please login to merge, or discard this patch.
Spacing   +127 added lines, -127 removed lines patch added patch discarded remove patch
@@ -27,21 +27,21 @@  discard block
 block discarded – undo
27 27
 	{
28 28
 		// error appears if no doc is selected
29 29
 		$cart = Context::get('cart');
30
-		if(!$cart) return $this->stop('msg_cart_is_null');
31
-		$document_srl_list= explode('|@|', $cart);
30
+		if (!$cart) return $this->stop('msg_cart_is_null');
31
+		$document_srl_list = explode('|@|', $cart);
32 32
 		$document_count = count($document_srl_list);
33
-		if(!$document_count) return $this->stop('msg_cart_is_null');
33
+		if (!$document_count) return $this->stop('msg_cart_is_null');
34 34
 		// Delete a doc
35 35
 		$oDocumentController = getController('document');
36
-		for($i=0;$i<$document_count;$i++)
36
+		for ($i = 0; $i < $document_count; $i++)
37 37
 		{
38 38
 			$document_srl = trim($document_srl_list[$i]);
39
-			if(!$document_srl) continue;
39
+			if (!$document_srl) continue;
40 40
 
41 41
 			$oDocumentController->deleteDocument($document_srl, true);
42 42
 		}
43 43
 
44
-		$this->setMessage(sprintf(Context::getLang('msg_checked_document_is_deleted'), $document_count) );
44
+		$this->setMessage(sprintf(Context::getLang('msg_checked_document_is_deleted'), $document_count));
45 45
 	}
46 46
 
47 47
 	/**
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 	 */
54 54
 	function moveDocumentModule($document_srl_list, $module_srl, $category_srl)
55 55
 	{
56
-		if(!count($document_srl_list)) return;
56
+		if (!count($document_srl_list)) return;
57 57
 
58 58
 		$oDocumentModel = getModel('document');
59 59
 		$oDocumentController = getController('document');
@@ -62,24 +62,24 @@  discard block
 block discarded – undo
62 62
 		$oDB->begin();
63 63
 
64 64
 		$triggerObj = new stdClass();
65
-		$triggerObj->document_srls = implode(',',$document_srl_list);
65
+		$triggerObj->document_srls = implode(',', $document_srl_list);
66 66
 		$triggerObj->module_srl = $module_srl;
67 67
 		$triggerObj->source_module_srl = array();
68 68
 		$triggerObj->category_srl = $category_srl;
69 69
 
70 70
 		// Call a trigger (before)
71 71
 		$output = ModuleHandler::triggerCall('document.moveDocumentModule', 'before', $triggerObj);
72
-		if(!$output->toBool())
72
+		if (!$output->toBool())
73 73
 		{
74 74
 			$oDB->rollback();
75 75
 			return $output;
76 76
 		}
77 77
 
78
-		for($i=count($document_srl_list)-1;$i>=0;$i--)
78
+		for ($i = count($document_srl_list) - 1; $i >= 0; $i--)
79 79
 		{
80 80
 			$document_srl = $document_srl_list[$i];
81 81
 			$oDocument = $oDocumentModel->getDocument($document_srl);
82
-			if(!$oDocument->isExists()) continue;
82
+			if (!$oDocument->isExists()) continue;
83 83
 
84 84
 			$triggerObj->source_module_srl[$document_srl] = $oDocument->get('module_srl');
85 85
 
@@ -94,27 +94,27 @@  discard block
 block discarded – undo
94 94
 			$obj->content = $output_ori->data->content;
95 95
 
96 96
 			// Move the attached file if the target module is different
97
-			if($module_srl != $obj->module_srl && $oDocument->hasUploadedFiles())
97
+			if ($module_srl != $obj->module_srl && $oDocument->hasUploadedFiles())
98 98
 			{
99 99
 				$oFileController = getController('file');
100 100
 
101 101
 				$files = $oDocument->getUploadedFiles();
102 102
 				$delete_file_srls = array();
103
-				if(is_array($files))
103
+				if (is_array($files))
104 104
 				{
105
-					foreach($files as $val)
105
+					foreach ($files as $val)
106 106
 					{
107 107
 						$file_info = array();
108 108
 						$file_info['tmp_name'] = $val->uploaded_filename;
109 109
 						$file_info['name'] = $val->source_filename;
110 110
 						$inserted_file = $oFileController->insertFile($file_info, $module_srl, $obj->document_srl, $val->download_count, true);
111
-						if($inserted_file && $inserted_file->toBool())
111
+						if ($inserted_file && $inserted_file->toBool())
112 112
 						{
113 113
 							// for image/video files
114
-							if($val->direct_download == 'Y')
114
+							if ($val->direct_download == 'Y')
115 115
 							{
116
-								$source_filename = substr($val->uploaded_filename,2);
117
-								$target_filename = substr($inserted_file->get('uploaded_filename'),2);
116
+								$source_filename = substr($val->uploaded_filename, 2);
117
+								$target_filename = substr($inserted_file->get('uploaded_filename'), 2);
118 118
 								$obj->content = str_replace($source_filename, $target_filename, $obj->content);
119 119
 								// For binary files
120 120
 							}
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 				$oFileController->setFilesValid($obj->document_srl);
134 134
 			}
135 135
 
136
-			if($module_srl != $obj->module_srl)
136
+			if ($module_srl != $obj->module_srl)
137 137
 			{
138 138
 				$oDocumentController->deleteDocumentAliasByDocument($obj->document_srl);
139 139
 			}
@@ -141,48 +141,48 @@  discard block
 block discarded – undo
141 141
 			$obj->module_srl = $module_srl;
142 142
 			$obj->category_srl = $category_srl;
143 143
 			$output = executeQuery('document.updateDocumentModule', $obj);
144
-			if(!$output->toBool()) {
144
+			if (!$output->toBool()) {
145 145
 				$oDB->rollback();
146 146
 				return $output;
147 147
 			}
148 148
 
149 149
 			//Move a module of the extra vars
150 150
 			$output = executeQuery('document.moveDocumentExtraVars', $obj);
151
-			if(!$output->toBool()) {
151
+			if (!$output->toBool()) {
152 152
 				$oDB->rollback();
153 153
 				return $output;
154 154
 			}
155 155
 			// Set 0 if a new category doesn't exist after catergory change
156
-			if($source_category_srl != $category_srl)
156
+			if ($source_category_srl != $category_srl)
157 157
 			{
158
-				if($source_category_srl) $oDocumentController->updateCategoryCount($oDocument->get('module_srl'), $source_category_srl);
159
-				if($category_srl) $oDocumentController->updateCategoryCount($module_srl, $category_srl);
158
+				if ($source_category_srl) $oDocumentController->updateCategoryCount($oDocument->get('module_srl'), $source_category_srl);
159
+				if ($category_srl) $oDocumentController->updateCategoryCount($module_srl, $category_srl);
160 160
 			}
161 161
 		}
162 162
 
163 163
 		$args = new stdClass();
164
-		$args->document_srls = implode(',',$document_srl_list);
164
+		$args->document_srls = implode(',', $document_srl_list);
165 165
 		$args->module_srl = $module_srl;
166 166
 		// move the comment
167 167
 		$output = executeQuery('comment.updateCommentModule', $args);
168
-		if(!$output->toBool())
168
+		if (!$output->toBool())
169 169
 		{
170 170
 			$oDB->rollback();
171 171
 			return $output;
172 172
 		}
173 173
 
174 174
 		$output = executeQuery('comment.updateCommentListModule', $args);
175
-		if(!$output->toBool())
175
+		if (!$output->toBool())
176 176
 		{
177 177
 			$oDB->rollback();
178 178
 			return $output;
179 179
 		}
180 180
 		
181 181
 		// move the trackback
182
-		if(getClass('trackback'))
182
+		if (getClass('trackback'))
183 183
 		{
184 184
 			$output = executeQuery('trackback.updateTrackbackModule', $args);
185
-			if(!$output->toBool())
185
+			if (!$output->toBool())
186 186
 			{
187 187
 				$oDB->rollback();
188 188
 				return $output;
@@ -191,14 +191,14 @@  discard block
 block discarded – undo
191 191
 
192 192
 		// Tags
193 193
 		$output = executeQuery('tag.updateTagModule', $args);
194
-		if(!$output->toBool())
194
+		if (!$output->toBool())
195 195
 		{
196 196
 			$oDB->rollback();
197 197
 			return $output;
198 198
 		}
199 199
 		// Call a trigger (before)
200 200
 		$output = ModuleHandler::triggerCall('document.moveDocumentModule', 'after', $triggerObj);
201
-		if(!$output->toBool())
201
+		if (!$output->toBool())
202 202
 		{
203 203
 			$oDB->rollback();
204 204
 			return $output;
@@ -207,11 +207,11 @@  discard block
 block discarded – undo
207 207
 		$oDB->commit();
208 208
 		//remove from cache
209 209
 		$oCacheHandler = CacheHandler::getInstance('object');
210
-		if($oCacheHandler->isSupport())
210
+		if ($oCacheHandler->isSupport())
211 211
 		{
212
-			foreach($document_srl_list as $document_srl)
212
+			foreach ($document_srl_list as $document_srl)
213 213
 			{
214
-				$cache_key_item = 'document_item:'. getNumberingPath($document_srl) . $document_srl;
214
+				$cache_key_item = 'document_item:'.getNumberingPath($document_srl).$document_srl;
215 215
 				$oCacheHandler->delete($cache_key_item);
216 216
 			}
217 217
 		}
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 	 */
228 228
 	function copyDocumentModule($document_srl_list, $module_srl, $category_srl)
229 229
 	{
230
-		if(count($document_srl_list) < 1) return;
230
+		if (count($document_srl_list) < 1) return;
231 231
 
232 232
 		$oDocumentModel = getModel('document');
233 233
 		$oDocumentController = getController('document');
@@ -238,12 +238,12 @@  discard block
 block discarded – undo
238 238
 		$oDB->begin();
239 239
 
240 240
 		$triggerObj = new stdClass();
241
-		$triggerObj->document_srls = implode(',',$document_srl_list);
241
+		$triggerObj->document_srls = implode(',', $document_srl_list);
242 242
 		$triggerObj->module_srl = $module_srl;
243 243
 		$triggerObj->category_srl = $category_srl;
244 244
 		// Call a trigger (before)
245 245
 		$output = ModuleHandler::triggerCall('document.copyDocumentModule', 'before', $triggerObj);
246
-		if(!$output->toBool())
246
+		if (!$output->toBool())
247 247
 		{
248 248
 			$oDB->rollback();
249 249
 			return $output;
@@ -251,11 +251,11 @@  discard block
 block discarded – undo
251 251
 
252 252
 		$extraVarsList = $oDocumentModel->getDocumentExtraVarsFromDB($document_srl_list);
253 253
 		$extraVarsListByDocumentSrl = array();
254
-		if(is_array($extraVarsList->data))
254
+		if (is_array($extraVarsList->data))
255 255
 		{
256
-			foreach($extraVarsList->data as $value)
256
+			foreach ($extraVarsList->data as $value)
257 257
 			{
258
-				if(!isset($extraVarsListByDocumentSrl[$value->document_srl]))
258
+				if (!isset($extraVarsListByDocumentSrl[$value->document_srl]))
259 259
 				{
260 260
 					$extraVarsListByDocumentSrl[$value->document_srl] = array();
261 261
 				}
@@ -264,22 +264,22 @@  discard block
 block discarded – undo
264 264
 			}
265 265
 		}
266 266
 
267
-		for($i=count($document_srl_list)-1;$i>=0;$i--)
267
+		for ($i = count($document_srl_list) - 1; $i >= 0; $i--)
268 268
 		{
269 269
 			$document_srl = $document_srl_list[$i];
270 270
 			$oDocument = $oDocumentModel->getDocument($document_srl);
271
-			if(!$oDocument->isExists()) continue;
271
+			if (!$oDocument->isExists()) continue;
272 272
 
273 273
 			$obj = $oDocument->getObjectVars();
274 274
 
275 275
 			$extraVars = $extraVarsListByDocumentSrl[$document_srl];
276
-			if($module_srl == $obj->module_srl)
276
+			if ($module_srl == $obj->module_srl)
277 277
 			{
278
-				if(is_array($extraVars))
278
+				if (is_array($extraVars))
279 279
 				{
280
-					foreach($extraVars as $extraItem)
280
+					foreach ($extraVars as $extraItem)
281 281
 					{
282
-						if($extraItem->var_idx >= 0) $obj->{'extra_vars'.$extraItem->var_idx} = $extraItem->value;
282
+						if ($extraItem->var_idx >= 0) $obj->{'extra_vars'.$extraItem->var_idx} = $extraItem->value;
283 283
 					}
284 284
 				}
285 285
 			}
@@ -291,10 +291,10 @@  discard block
 block discarded – undo
291 291
 			$obj->trackback_count = 0;
292 292
 
293 293
 			// Pre-register the attachment
294
-			if($oDocument->hasUploadedFiles())
294
+			if ($oDocument->hasUploadedFiles())
295 295
 			{
296 296
 				$files = $oDocument->getUploadedFiles();
297
-				foreach($files as $val)
297
+				foreach ($files as $val)
298 298
 				{
299 299
 					$file_info = array();
300 300
 					$file_info['tmp_name'] = $val->uploaded_filename;
@@ -302,10 +302,10 @@  discard block
 block discarded – undo
302 302
 					$oFileController = getController('file');
303 303
 					$inserted_file = $oFileController->insertFile($file_info, $module_srl, $obj->document_srl, 0, true);
304 304
 					// if image/video files
305
-					if($val->direct_download == 'Y')
305
+					if ($val->direct_download == 'Y')
306 306
 					{
307
-						$source_filename = substr($val->uploaded_filename,2);
308
-						$target_filename = substr($inserted_file->get('uploaded_filename'),2);
307
+						$source_filename = substr($val->uploaded_filename, 2);
308
+						$target_filename = substr($inserted_file->get('uploaded_filename'), 2);
309 309
 						$obj->content = str_replace($source_filename, $target_filename, $obj->content);
310 310
 						// If binary file
311 311
 					}
@@ -319,23 +319,23 @@  discard block
 block discarded – undo
319 319
 
320 320
 			// Write a post
321 321
 			$output = $oDocumentController->insertDocument($obj, true, true);
322
-			if(!$output->toBool())
322
+			if (!$output->toBool())
323 323
 			{
324 324
 				$oDB->rollback();
325 325
 				return $output;
326 326
 			}
327 327
 
328 328
 			// copy multi language contents
329
-			if(is_array($extraVars))
329
+			if (is_array($extraVars))
330 330
 			{
331
-				foreach($extraVars as $value)
331
+				foreach ($extraVars as $value)
332 332
 				{
333
-					if($value->idx >= 0 && $value->lang_code == Context::getLangType())
333
+					if ($value->idx >= 0 && $value->lang_code == Context::getLangType())
334 334
 					{
335 335
 						continue;
336 336
 					}
337 337
 
338
-					if( $value->var_idx < 0 || ($module_srl == $value->module_srl && $value->var_idx >= 0) )
338
+					if ($value->var_idx < 0 || ($module_srl == $value->module_srl && $value->var_idx >= 0))
339 339
 					{
340 340
 						$oDocumentController->insertDocumentExtraVar($value->module_srl, $obj->document_srl, $value->var_idx, $value->value, $value->eid, $value->lang_code);
341 341
 					}
@@ -343,26 +343,26 @@  discard block
 block discarded – undo
343 343
 			}
344 344
 
345 345
 			// Move the comments
346
-			if($oDocument->getCommentCount())
346
+			if ($oDocument->getCommentCount())
347 347
 			{
348 348
 				$oCommentModel = getModel('comment');
349 349
 				$comment_output = $oCommentModel->getCommentList($document_srl, 0, true, 99999999);
350 350
 				$comments = $comment_output->data;
351
-				if(count($comments) > 0)
351
+				if (count($comments) > 0)
352 352
 				{
353 353
 					$oCommentController = getController('comment');
354 354
 					$success_count = 0;
355 355
 					$p_comment_srl = array();
356
-					foreach($comments as $comment_obj)
356
+					foreach ($comments as $comment_obj)
357 357
 					{
358 358
 						$comment_srl = getNextSequence();
359 359
 						$p_comment_srl[$comment_obj->comment_srl] = $comment_srl;
360 360
 
361 361
 						// Pre-register the attachment
362
-						if($comment_obj->uploaded_count)
362
+						if ($comment_obj->uploaded_count)
363 363
 						{
364 364
 							$files = $oFileModel->getFiles($comment_obj->comment_srl, true);
365
-							foreach($files as $val)
365
+							foreach ($files as $val)
366 366
 							{
367 367
 								$file_info = array();
368 368
 								$file_info['tmp_name'] = $val->uploaded_filename;
@@ -370,10 +370,10 @@  discard block
 block discarded – undo
370 370
 								$oFileController = getController('file');
371 371
 								$inserted_file = $oFileController->insertFile($file_info, $module_srl, $comment_srl, 0, true);
372 372
 								// if image/video files
373
-								if($val->direct_download == 'Y')
373
+								if ($val->direct_download == 'Y')
374 374
 								{
375
-									$source_filename = substr($val->uploaded_filename,2);
376
-									$target_filename = substr($inserted_file->get('uploaded_filename'),2);
375
+									$source_filename = substr($val->uploaded_filename, 2);
376
+									$target_filename = substr($inserted_file->get('uploaded_filename'), 2);
377 377
 									$comment_obj->content = str_replace($source_filename, $target_filename, $comment_obj->content);
378 378
 									// If binary file
379 379
 								}
@@ -389,10 +389,10 @@  discard block
 block discarded – undo
389 389
 						$comment_obj->document_srl = $obj->document_srl;
390 390
 						$comment_obj->comment_srl = $comment_srl;
391 391
 
392
-						if($comment_obj->parent_srl) $comment_obj->parent_srl = $p_comment_srl[$comment_obj->parent_srl];
392
+						if ($comment_obj->parent_srl) $comment_obj->parent_srl = $p_comment_srl[$comment_obj->parent_srl];
393 393
 
394 394
 						$output = $oCommentController->insertComment($comment_obj, true);
395
-						if($output->toBool()) $success_count ++;
395
+						if ($output->toBool()) $success_count++;
396 396
 					}
397 397
 					$oDocumentController->updateCommentCount($obj->document_srl, $success_count, $comment_obj->nick_name, true);
398 398
 				}
@@ -400,19 +400,19 @@  discard block
 block discarded – undo
400 400
 
401 401
 			// Move the trackbacks
402 402
 			$oTrackbackModel = getModel('trackback');
403
-			if($oTrackbackModel && $oDocument->getTrackbackCount())
403
+			if ($oTrackbackModel && $oDocument->getTrackbackCount())
404 404
 			{
405 405
 				$trackbacks = $oTrackbackModel->getTrackbackList($oDocument->document_srl);
406
-				if(count($trackbacks))
406
+				if (count($trackbacks))
407 407
 				{
408 408
 					$success_count = 0;
409
-					foreach($trackbacks as $trackback_obj)
409
+					foreach ($trackbacks as $trackback_obj)
410 410
 					{
411 411
 						$trackback_obj->trackback_srl = getNextSequence();
412 412
 						$trackback_obj->module_srl = $obj->module_srl;
413 413
 						$trackback_obj->document_srl = $obj->document_srl;
414 414
 						$output = executeQuery('trackback.insertTrackback', $trackback_obj);
415
-						if($output->toBool()) $success_count++;
415
+						if ($output->toBool()) $success_count++;
416 416
 					}
417 417
 					// Update the number of trackbacks
418 418
 					$oDocumentController->updateTrackbackCount($obj->document_srl, $success_count);
@@ -425,7 +425,7 @@  discard block
 block discarded – undo
425 425
 		// Call a trigger (before)
426 426
 		$triggerObj->copied_srls = $copied_srls;
427 427
 		$output = ModuleHandler::triggerCall('document.copyDocumentModule', 'after', $triggerObj);
428
-		if(!$output->toBool())
428
+		if (!$output->toBool())
429 429
 		{
430 430
 			$oDB->rollback();
431 431
 			return $output;
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
 		$document_list = $oDocumentModel->getDocumentList($args);
453 453
 		$documents = $document_list->data;
454 454
 		$output = executeQuery('document.deleteModuleDocument', $args);
455
-		if(is_array($documents))
455
+		if (is_array($documents))
456 456
 		{
457 457
 			foreach ($documents as $oDocument)
458 458
 			{
@@ -461,13 +461,13 @@  discard block
 block discarded – undo
461 461
 		}
462 462
 		//remove from cache
463 463
 		$oCacheHandler = CacheHandler::getInstance('object');
464
-		if($oCacheHandler->isSupport())
464
+		if ($oCacheHandler->isSupport())
465 465
 		{
466
-			if(is_array($document_srl_list))
466
+			if (is_array($document_srl_list))
467 467
 			{
468
-				foreach($document_srl_list as $document_srl)
468
+				foreach ($document_srl_list as $document_srl)
469 469
 				{
470
-					$cache_key_item = 'document_item:'. getNumberingPath($document_srl) . $document_srl;
470
+					$cache_key_item = 'document_item:'.getNumberingPath($document_srl).$document_srl;
471 471
 					$oCacheHandler->delete($cache_key_item);
472 472
 				}
473 473
 			}
@@ -486,8 +486,8 @@  discard block
 block discarded – undo
486 486
 		$config = getModel('document')->getDocumentConfig();
487 487
 		$config->icons = Context::get('icons');
488 488
 		$config->micons = Context::get('micons');
489
-		$output = $oModuleController->insertModuleConfig('document',$config);
490
-		if(!$output->toBool())
489
+		$output = $oModuleController->insertModuleConfig('document', $config);
490
+		if (!$output->toBool())
491 491
 		{
492 492
 			return $output;
493 493
 		}
@@ -506,11 +506,11 @@  discard block
 block discarded – undo
506 506
 	{
507 507
 		$document_srl = trim(Context::get('document_srl'));
508 508
 
509
-		if($document_srl)
509
+		if ($document_srl)
510 510
 		{
511 511
 			$args->document_srl = $document_srl;
512 512
 			$output = executeQuery('document.deleteDeclaredDocuments', $args);
513
-			if(!$output->toBool()) return $output;
513
+			if (!$output->toBool()) return $output;
514 514
 		}
515 515
 	}
516 516
 
@@ -520,7 +520,7 @@  discard block
 block discarded – undo
520 520
 	 */
521 521
 	function procDocumentAdminDeleteAllThumbnail()
522 522
 	{
523
-		$temp_cache_dir = './files/thumbnails_' . $_SERVER['REQUEST_TIME'];
523
+		$temp_cache_dir = './files/thumbnails_'.$_SERVER['REQUEST_TIME'];
524 524
 		FileHandler::rename('./files/thumbnails', $temp_cache_dir);
525 525
 		FileHandler::makeDir('./files/thumbnails');
526 526
 
@@ -536,12 +536,12 @@  discard block
 block discarded – undo
536 536
 	function deleteThumbnailFile($path)
537 537
 	{
538 538
 		$directory = dir($path);
539
-		while($entry = $directory->read()) {
539
+		while ($entry = $directory->read()) {
540 540
 			if ($entry != "." && $entry != "..") {
541 541
 				if (is_dir($path."/".$entry)) {
542 542
 					$this->deleteThumbnailFile($path."/".$entry);
543 543
 				} else {
544
-					if(!preg_match('/^thumbnail_([^\.]*)\.jpg$/i',$entry)) continue;
544
+					if (!preg_match('/^thumbnail_([^\.]*)\.jpg$/i', $entry)) continue;
545 545
 					FileHandler::removeFile($path.'/'.$entry);
546 546
 				}
547 547
 			}
@@ -566,13 +566,13 @@  discard block
 block discarded – undo
566 566
 		$eid = Context::get('eid');
567 567
 		$obj = new stdClass();
568 568
 
569
-		if(!$module_srl || !$name || !$eid) return new BaseObject(-1,'msg_invalid_request');
569
+		if (!$module_srl || !$name || !$eid) return new BaseObject(-1, 'msg_invalid_request');
570 570
 		// set the max value if idx is not specified
571
-		if(!$var_idx)
571
+		if (!$var_idx)
572 572
 		{
573 573
 			$obj->module_srl = $module_srl;
574 574
 			$output = executeQuery('document.getDocumentMaxExtraKeyIdx', $obj);
575
-			$var_idx = $output->data->var_idx+1;
575
+			$var_idx = $output->data->var_idx + 1;
576 576
 		}
577 577
 
578 578
 		// Check if the module name already exists
@@ -580,7 +580,7 @@  discard block
 block discarded – undo
580 580
 		$obj->var_idx = $var_idx;
581 581
 		$obj->eid = $eid;
582 582
 		$output = executeQuery('document.isExistsExtraKey', $obj);
583
-		if(!$output->toBool() || $output->data->count)
583
+		if (!$output->toBool() || $output->data->count)
584 584
 		{
585 585
 			return new BaseObject(-1, 'msg_extra_name_exists');
586 586
 		}
@@ -588,7 +588,7 @@  discard block
 block discarded – undo
588 588
 		// insert or update
589 589
 		$oDocumentController = getController('document');
590 590
 		$output = $oDocumentController->insertDocumentExtraKey($module_srl, $var_idx, $name, $type, $is_required, $search, $default, $desc, $eid);
591
-		if(!$output->toBool()) return $output;
591
+		if (!$output->toBool()) return $output;
592 592
 
593 593
 		$this->setMessage('success_registed');
594 594
 
@@ -604,11 +604,11 @@  discard block
 block discarded – undo
604 604
 	{
605 605
 		$module_srl = Context::get('module_srl');
606 606
 		$var_idx = Context::get('var_idx');
607
-		if(!$module_srl || !$var_idx) return new BaseObject(-1,'msg_invalid_request');
607
+		if (!$module_srl || !$var_idx) return new BaseObject(-1, 'msg_invalid_request');
608 608
 
609 609
 		$oDocumentController = getController('document');
610 610
 		$output = $oDocumentController->deleteDocumentExtraKeys($module_srl, $var_idx);
611
-		if(!$output->toBool()) return $output;
611
+		if (!$output->toBool()) return $output;
612 612
 
613 613
 		$this->setMessage('success_deleted');
614 614
 	}
@@ -623,19 +623,19 @@  discard block
 block discarded – undo
623 623
 		$module_srl = Context::get('module_srl');
624 624
 		$var_idx = Context::get('var_idx');
625 625
 
626
-		if(!$type || !$module_srl || !$var_idx) return new BaseObject(-1,'msg_invalid_request');
626
+		if (!$type || !$module_srl || !$var_idx) return new BaseObject(-1, 'msg_invalid_request');
627 627
 
628 628
 		$oModuleModel = getModel('module');
629 629
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
630
-		if(!$module_info->module_srl) return new BaseObject(-1,'msg_invalid_request');
630
+		if (!$module_info->module_srl) return new BaseObject(-1, 'msg_invalid_request');
631 631
 
632 632
 		$oDocumentModel = getModel('document');
633 633
 		$extra_keys = $oDocumentModel->getExtraKeys($module_srl);
634
-		if(!$extra_keys[$var_idx]) return new BaseObject(-1,'msg_invalid_request');
634
+		if (!$extra_keys[$var_idx]) return new BaseObject(-1, 'msg_invalid_request');
635 635
 
636
-		if($type == 'up') $new_idx = $var_idx-1;
637
-		else $new_idx = $var_idx+1;
638
-		if($new_idx<1) return new BaseObject(-1,'msg_invalid_request');
636
+		if ($type == 'up') $new_idx = $var_idx - 1;
637
+		else $new_idx = $var_idx + 1;
638
+		if ($new_idx < 1) return new BaseObject(-1, 'msg_invalid_request');
639 639
 
640 640
 		$args = new stdClass();
641 641
 		$args->module_srl = $module_srl;
@@ -646,16 +646,16 @@  discard block
 block discarded – undo
646 646
 		unset($args);
647 647
 
648 648
 		// update immediately if there is no idx to change
649
-		if(!$extra_keys[$new_idx])
649
+		if (!$extra_keys[$new_idx])
650 650
 		{
651 651
 			$args = new stdClass();
652 652
 			$args->module_srl = $module_srl;
653 653
 			$args->var_idx = $var_idx;
654 654
 			$args->new_idx = $new_idx;
655 655
 			$output = executeQuery('document.updateDocumentExtraKeyIdx', $args);
656
-			if(!$output->toBool()) return $output;
656
+			if (!$output->toBool()) return $output;
657 657
 			$output = executeQuery('document.updateDocumentExtraVarIdx', $args);
658
-			if(!$output->toBool()) return $output;
658
+			if (!$output->toBool()) return $output;
659 659
 			// replace if exists
660 660
 		}
661 661
 		else
@@ -665,27 +665,27 @@  discard block
 block discarded – undo
665 665
 			$args->var_idx = $new_idx;
666 666
 			$args->new_idx = -10000;
667 667
 			$output = executeQuery('document.updateDocumentExtraKeyIdx', $args);
668
-			if(!$output->toBool()) return $output;
668
+			if (!$output->toBool()) return $output;
669 669
 			$output = executeQuery('document.updateDocumentExtraVarIdx', $args);
670
-			if(!$output->toBool()) return $output;
670
+			if (!$output->toBool()) return $output;
671 671
 
672 672
 			$args->var_idx = $var_idx;
673 673
 			$args->new_idx = $new_idx;
674 674
 			$output = executeQuery('document.updateDocumentExtraKeyIdx', $args);
675
-			if(!$output->toBool()) return $output;
675
+			if (!$output->toBool()) return $output;
676 676
 			$output = executeQuery('document.updateDocumentExtraVarIdx', $args);
677
-			if(!$output->toBool()) return $output;
677
+			if (!$output->toBool()) return $output;
678 678
 
679 679
 			$args->var_idx = -10000;
680 680
 			$args->new_idx = $var_idx;
681 681
 			$output = executeQuery('document.updateDocumentExtraKeyIdx', $args);
682
-			if(!$output->toBool()) return $output;
682
+			if (!$output->toBool()) return $output;
683 683
 			$output = executeQuery('document.updateDocumentExtraVarIdx', $args);
684
-			if(!$output->toBool()) return $output;
684
+			if (!$output->toBool()) return $output;
685 685
 		}
686 686
 
687 687
 		$oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE);
688
-		if($oCacheHandler->isSupport())
688
+		if ($oCacheHandler->isSupport())
689 689
 		{
690 690
 			$object_key = 'module_document_extra_keys:'.$module_srl;
691 691
 			$cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
@@ -699,9 +699,9 @@  discard block
 block discarded – undo
699 699
 	 */
700 700
 	function procDocumentAdminInsertAlias()
701 701
 	{
702
-		$args = Context::gets('module_srl','document_srl', 'alias_title');
702
+		$args = Context::gets('module_srl', 'document_srl', 'alias_title');
703 703
 		$alias_srl = Context::get('alias_srl');
704
-		if(!$alias_srl)
704
+		if (!$alias_srl)
705 705
 		{
706 706
 			$args->alias_srl = getNextSequence();
707 707
 			$query = "document.insertAlias";
@@ -744,7 +744,7 @@  discard block
 block discarded – undo
744 744
 		$oDocumentModel = getModel('document');
745 745
 		$oDocumentController = getController('document');
746 746
 		$oDocument = $oDocumentModel->getDocument($document_srl, false, false);
747
-		if(!$oDocument->isGranted()) return $this->stop('msg_not_permitted');
747
+		if (!$oDocument->isGranted()) return $this->stop('msg_not_permitted');
748 748
 	
749 749
 		$oModuleModel = getModel('module');
750 750
 		$module_info = $oModuleModel->getModuleInfoByDocumentSrl($document_srl);
@@ -756,31 +756,31 @@  discard block
 block discarded – undo
756 756
 		$oDocumentController->moveDocumentToTrash($args);
757 757
 
758 758
 		$returnUrl = Context::get('success_return_url');
759
-		if(!$returnUrl)	
759
+		if (!$returnUrl)	
760 760
 		{
761 761
 			$arrUrl = parse_url(Context::get('cur_url'));
762 762
 			$query = "";
763 763
 
764
-			if($arrUrl['query'])
764
+			if ($arrUrl['query'])
765 765
 			{
766 766
 				parse_str($arrUrl['query'], $arrQuery);
767 767
 
768 768
 				// set query
769
-				if(isset($arrQuery['document_srl']))
769
+				if (isset($arrQuery['document_srl']))
770 770
 					unset($arrQuery['document_srl']);
771 771
 
772 772
 				$searchArgs = new stdClass;
773
-				foreach($arrQuery as $key=>$val)
773
+				foreach ($arrQuery as $key=>$val)
774 774
 				{
775 775
 					$searchArgs->{$key} = $val;
776 776
 				}
777 777
 
778
-				if(!isset($searchArgs->sort_index))
778
+				if (!isset($searchArgs->sort_index))
779 779
 					$searchArgs->sort_index = $module_info->order_target;
780 780
 
781
-				foreach($module_info as $key=>$val)
781
+				foreach ($module_info as $key=>$val)
782 782
 				{
783
-					if(!isset($searchArgs->{$key}))
783
+					if (!isset($searchArgs->{$key}))
784 784
 						$searchArgs->{$key} = $val;
785 785
 				}
786 786
 
@@ -788,20 +788,20 @@  discard block
 block discarded – undo
788 788
 				$output = $oDocumentModel->getDocumentList($searchArgs, $module_info->except_notice, TRUE, array('document_srl'));
789 789
 
790 790
 				$cur_page = 1;
791
-				if(isset($arrQuery['page'])) {
792
-					$cur_page = (int)$arrQuery['page'];
791
+				if (isset($arrQuery['page'])) {
792
+					$cur_page = (int) $arrQuery['page'];
793 793
 				}
794 794
 
795 795
 
796
-				if($cur_page>1 && count($output->data) == 0)
796
+				if ($cur_page > 1 && count($output->data) == 0)
797 797
 					$arrQuery['page'] = $cur_page - 1;
798 798
 
799 799
 				$query = "?";
800
-				foreach($arrQuery as $key=>$val)
800
+				foreach ($arrQuery as $key=>$val)
801 801
 					$query .= sprintf("%s=%s&", $key, $val);
802 802
 				$query = substr($query, 0, -1);
803 803
 			}
804
-			$returnUrl = $arrUrl['path'] . $query;
804
+			$returnUrl = $arrUrl['path'].$query;
805 805
 		}
806 806
 
807 807
 		$this->add('redirect_url', $returnUrl);
@@ -878,7 +878,7 @@  discard block
 block discarded – undo
878 878
 	 */
879 879
 	function restoreTrash($originObject)
880 880
 	{
881
-		if(is_array($originObject)) $originObject = (object)$originObject;
881
+		if (is_array($originObject)) $originObject = (object) $originObject;
882 882
 
883 883
 		$oDocumentController = getController('document');
884 884
 		$oDocumentModel = getModel('document');
@@ -888,12 +888,12 @@  discard block
 block discarded – undo
888 888
 
889 889
 		//DB restore
890 890
 		$output = $oDocumentController->insertDocument($originObject, false, true, false);
891
-		if(!$output->toBool()) return new BaseObject(-1, $output->getMessage());
891
+		if (!$output->toBool()) return new BaseObject(-1, $output->getMessage());
892 892
 
893 893
 		//FILE restore
894 894
 		$oDocument = $oDocumentModel->getDocument($originObject->document_srl);
895 895
 		// If the post was not temorarily saved, set the attachment's status to be valid
896
-		if($oDocument->hasUploadedFiles() && $originObject->member_srl != $originObject->module_srl)
896
+		if ($oDocument->hasUploadedFiles() && $originObject->member_srl != $originObject->module_srl)
897 897
 		{
898 898
 			$args = new stdClass();
899 899
 			$args->upload_target_srl = $oDocument->document_srl;
@@ -902,10 +902,10 @@  discard block
 block discarded – undo
902 902
 		}
903 903
 
904 904
 		// call a trigger (after)
905
-		if($output->toBool())
905
+		if ($output->toBool())
906 906
 		{
907 907
 			$trigger_output = ModuleHandler::triggerCall('document.restoreTrash', 'after', $originObject);
908
-			if(!$trigger_output->toBool())
908
+			if (!$trigger_output->toBool())
909 909
 			{
910 910
 				$oDB->rollback();
911 911
 				return $trigger_output;
@@ -926,7 +926,7 @@  discard block
 block discarded – undo
926 926
 	function emptyTrash($originObject)
927 927
 	{
928 928
 		$originObject = unserialize($originObject);
929
-		if(is_array($originObject)) $originObject = (object) $originObject;
929
+		if (is_array($originObject)) $originObject = (object) $originObject;
930 930
 
931 931
 		$oDocument = new documentItem();
932 932
 		$oDocument->setAttribute($originObject);
Please login to merge, or discard this patch.
Braces   +136 added lines, -59 removed lines patch added patch discarded remove patch
@@ -27,16 +27,22 @@  discard block
 block discarded – undo
27 27
 	{
28 28
 		// error appears if no doc is selected
29 29
 		$cart = Context::get('cart');
30
-		if(!$cart) return $this->stop('msg_cart_is_null');
30
+		if(!$cart) {
31
+			return $this->stop('msg_cart_is_null');
32
+		}
31 33
 		$document_srl_list= explode('|@|', $cart);
32 34
 		$document_count = count($document_srl_list);
33
-		if(!$document_count) return $this->stop('msg_cart_is_null');
35
+		if(!$document_count) {
36
+			return $this->stop('msg_cart_is_null');
37
+		}
34 38
 		// Delete a doc
35 39
 		$oDocumentController = getController('document');
36 40
 		for($i=0;$i<$document_count;$i++)
37 41
 		{
38 42
 			$document_srl = trim($document_srl_list[$i]);
39
-			if(!$document_srl) continue;
43
+			if(!$document_srl) {
44
+				continue;
45
+			}
40 46
 
41 47
 			$oDocumentController->deleteDocument($document_srl, true);
42 48
 		}
@@ -53,7 +59,9 @@  discard block
 block discarded – undo
53 59
 	 */
54 60
 	function moveDocumentModule($document_srl_list, $module_srl, $category_srl)
55 61
 	{
56
-		if(!count($document_srl_list)) return;
62
+		if(!count($document_srl_list)) {
63
+			return;
64
+		}
57 65
 
58 66
 		$oDocumentModel = getModel('document');
59 67
 		$oDocumentController = getController('document');
@@ -79,7 +87,9 @@  discard block
 block discarded – undo
79 87
 		{
80 88
 			$document_srl = $document_srl_list[$i];
81 89
 			$oDocument = $oDocumentModel->getDocument($document_srl);
82
-			if(!$oDocument->isExists()) continue;
90
+			if(!$oDocument->isExists()) {
91
+				continue;
92
+			}
83 93
 
84 94
 			$triggerObj->source_module_srl[$document_srl] = $oDocument->get('module_srl');
85 95
 
@@ -117,8 +127,7 @@  discard block
 block discarded – undo
117 127
 								$target_filename = substr($inserted_file->get('uploaded_filename'),2);
118 128
 								$obj->content = str_replace($source_filename, $target_filename, $obj->content);
119 129
 								// For binary files
120
-							}
121
-							else
130
+							} else
122 131
 							{
123 132
 								$obj->content = str_replace('file_srl='.$val->file_srl, 'file_srl='.$inserted_file->get('file_srl'), $obj->content);
124 133
 								$obj->content = str_replace('sid='.$val->sid, 'sid='.$inserted_file->get('sid'), $obj->content);
@@ -155,8 +164,12 @@  discard block
 block discarded – undo
155 164
 			// Set 0 if a new category doesn't exist after catergory change
156 165
 			if($source_category_srl != $category_srl)
157 166
 			{
158
-				if($source_category_srl) $oDocumentController->updateCategoryCount($oDocument->get('module_srl'), $source_category_srl);
159
-				if($category_srl) $oDocumentController->updateCategoryCount($module_srl, $category_srl);
167
+				if($source_category_srl) {
168
+					$oDocumentController->updateCategoryCount($oDocument->get('module_srl'), $source_category_srl);
169
+				}
170
+				if($category_srl) {
171
+					$oDocumentController->updateCategoryCount($module_srl, $category_srl);
172
+				}
160 173
 			}
161 174
 		}
162 175
 
@@ -227,7 +240,9 @@  discard block
 block discarded – undo
227 240
 	 */
228 241
 	function copyDocumentModule($document_srl_list, $module_srl, $category_srl)
229 242
 	{
230
-		if(count($document_srl_list) < 1) return;
243
+		if(count($document_srl_list) < 1) {
244
+			return;
245
+		}
231 246
 
232 247
 		$oDocumentModel = getModel('document');
233 248
 		$oDocumentController = getController('document');
@@ -268,7 +283,9 @@  discard block
 block discarded – undo
268 283
 		{
269 284
 			$document_srl = $document_srl_list[$i];
270 285
 			$oDocument = $oDocumentModel->getDocument($document_srl);
271
-			if(!$oDocument->isExists()) continue;
286
+			if(!$oDocument->isExists()) {
287
+				continue;
288
+			}
272 289
 
273 290
 			$obj = $oDocument->getObjectVars();
274 291
 
@@ -279,7 +296,9 @@  discard block
 block discarded – undo
279 296
 				{
280 297
 					foreach($extraVars as $extraItem)
281 298
 					{
282
-						if($extraItem->var_idx >= 0) $obj->{'extra_vars'.$extraItem->var_idx} = $extraItem->value;
299
+						if($extraItem->var_idx >= 0) {
300
+							$obj->{'extra_vars'.$extraItem->var_idx} = $extraItem->value;
301
+						}
283 302
 					}
284 303
 				}
285 304
 			}
@@ -308,8 +327,7 @@  discard block
 block discarded – undo
308 327
 						$target_filename = substr($inserted_file->get('uploaded_filename'),2);
309 328
 						$obj->content = str_replace($source_filename, $target_filename, $obj->content);
310 329
 						// If binary file
311
-					}
312
-					else
330
+					} else
313 331
 					{
314 332
 						$obj->content = str_replace('file_srl='.$val->file_srl, 'file_srl='.$inserted_file->get('file_srl'), $obj->content);
315 333
 						$obj->content = str_replace('sid='.$val->sid, 'sid='.$inserted_file->get('sid'), $obj->content);
@@ -376,8 +394,7 @@  discard block
 block discarded – undo
376 394
 									$target_filename = substr($inserted_file->get('uploaded_filename'),2);
377 395
 									$comment_obj->content = str_replace($source_filename, $target_filename, $comment_obj->content);
378 396
 									// If binary file
379
-								}
380
-								else
397
+								} else
381 398
 								{
382 399
 									$comment_obj->content = str_replace('file_srl='.$val->file_srl, 'file_srl='.$inserted_file->get('file_srl'), $comment_obj->content);
383 400
 									$comment_obj->content = str_replace('sid='.$val->sid, 'sid='.$inserted_file->get('sid'), $comment_obj->content);
@@ -389,10 +406,14 @@  discard block
 block discarded – undo
389 406
 						$comment_obj->document_srl = $obj->document_srl;
390 407
 						$comment_obj->comment_srl = $comment_srl;
391 408
 
392
-						if($comment_obj->parent_srl) $comment_obj->parent_srl = $p_comment_srl[$comment_obj->parent_srl];
409
+						if($comment_obj->parent_srl) {
410
+							$comment_obj->parent_srl = $p_comment_srl[$comment_obj->parent_srl];
411
+						}
393 412
 
394 413
 						$output = $oCommentController->insertComment($comment_obj, true);
395
-						if($output->toBool()) $success_count ++;
414
+						if($output->toBool()) {
415
+							$success_count ++;
416
+						}
396 417
 					}
397 418
 					$oDocumentController->updateCommentCount($obj->document_srl, $success_count, $comment_obj->nick_name, true);
398 419
 				}
@@ -412,7 +433,9 @@  discard block
 block discarded – undo
412 433
 						$trackback_obj->module_srl = $obj->module_srl;
413 434
 						$trackback_obj->document_srl = $obj->document_srl;
414 435
 						$output = executeQuery('trackback.insertTrackback', $trackback_obj);
415
-						if($output->toBool()) $success_count++;
436
+						if($output->toBool()) {
437
+							$success_count++;
438
+						}
416 439
 					}
417 440
 					// Update the number of trackbacks
418 441
 					$oDocumentController->updateTrackbackCount($obj->document_srl, $success_count);
@@ -510,7 +533,9 @@  discard block
 block discarded – undo
510 533
 		{
511 534
 			$args->document_srl = $document_srl;
512 535
 			$output = executeQuery('document.deleteDeclaredDocuments', $args);
513
-			if(!$output->toBool()) return $output;
536
+			if(!$output->toBool()) {
537
+				return $output;
538
+			}
514 539
 		}
515 540
 	}
516 541
 
@@ -541,7 +566,9 @@  discard block
 block discarded – undo
541 566
 				if (is_dir($path."/".$entry)) {
542 567
 					$this->deleteThumbnailFile($path."/".$entry);
543 568
 				} else {
544
-					if(!preg_match('/^thumbnail_([^\.]*)\.jpg$/i',$entry)) continue;
569
+					if(!preg_match('/^thumbnail_([^\.]*)\.jpg$/i',$entry)) {
570
+						continue;
571
+					}
545 572
 					FileHandler::removeFile($path.'/'.$entry);
546 573
 				}
547 574
 			}
@@ -566,7 +593,9 @@  discard block
 block discarded – undo
566 593
 		$eid = Context::get('eid');
567 594
 		$obj = new stdClass();
568 595
 
569
-		if(!$module_srl || !$name || !$eid) return new BaseObject(-1,'msg_invalid_request');
596
+		if(!$module_srl || !$name || !$eid) {
597
+			return new BaseObject(-1,'msg_invalid_request');
598
+		}
570 599
 		// set the max value if idx is not specified
571 600
 		if(!$var_idx)
572 601
 		{
@@ -588,7 +617,9 @@  discard block
 block discarded – undo
588 617
 		// insert or update
589 618
 		$oDocumentController = getController('document');
590 619
 		$output = $oDocumentController->insertDocumentExtraKey($module_srl, $var_idx, $name, $type, $is_required, $search, $default, $desc, $eid);
591
-		if(!$output->toBool()) return $output;
620
+		if(!$output->toBool()) {
621
+			return $output;
622
+		}
592 623
 
593 624
 		$this->setMessage('success_registed');
594 625
 
@@ -604,11 +635,15 @@  discard block
 block discarded – undo
604 635
 	{
605 636
 		$module_srl = Context::get('module_srl');
606 637
 		$var_idx = Context::get('var_idx');
607
-		if(!$module_srl || !$var_idx) return new BaseObject(-1,'msg_invalid_request');
638
+		if(!$module_srl || !$var_idx) {
639
+			return new BaseObject(-1,'msg_invalid_request');
640
+		}
608 641
 
609 642
 		$oDocumentController = getController('document');
610 643
 		$output = $oDocumentController->deleteDocumentExtraKeys($module_srl, $var_idx);
611
-		if(!$output->toBool()) return $output;
644
+		if(!$output->toBool()) {
645
+			return $output;
646
+		}
612 647
 
613 648
 		$this->setMessage('success_deleted');
614 649
 	}
@@ -623,26 +658,41 @@  discard block
 block discarded – undo
623 658
 		$module_srl = Context::get('module_srl');
624 659
 		$var_idx = Context::get('var_idx');
625 660
 
626
-		if(!$type || !$module_srl || !$var_idx) return new BaseObject(-1,'msg_invalid_request');
661
+		if(!$type || !$module_srl || !$var_idx) {
662
+			return new BaseObject(-1,'msg_invalid_request');
663
+		}
627 664
 
628 665
 		$oModuleModel = getModel('module');
629 666
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
630
-		if(!$module_info->module_srl) return new BaseObject(-1,'msg_invalid_request');
667
+		if(!$module_info->module_srl) {
668
+			return new BaseObject(-1,'msg_invalid_request');
669
+		}
631 670
 
632 671
 		$oDocumentModel = getModel('document');
633 672
 		$extra_keys = $oDocumentModel->getExtraKeys($module_srl);
634
-		if(!$extra_keys[$var_idx]) return new BaseObject(-1,'msg_invalid_request');
673
+		if(!$extra_keys[$var_idx]) {
674
+			return new BaseObject(-1,'msg_invalid_request');
675
+		}
635 676
 
636
-		if($type == 'up') $new_idx = $var_idx-1;
637
-		else $new_idx = $var_idx+1;
638
-		if($new_idx<1) return new BaseObject(-1,'msg_invalid_request');
677
+		if($type == 'up') {
678
+			$new_idx = $var_idx-1;
679
+		} else {
680
+			$new_idx = $var_idx+1;
681
+		}
682
+		if($new_idx<1) {
683
+			return new BaseObject(-1,'msg_invalid_request');
684
+		}
639 685
 
640 686
 		$args = new stdClass();
641 687
 		$args->module_srl = $module_srl;
642 688
 		$args->var_idx = $new_idx;
643 689
 		$output = executeQuery('document.getDocumentExtraKeys', $args);
644
-		if (!$output->toBool()) return $output;
645
-		if (!$output->data) return new BaseObject(-1, 'msg_invalid_request');
690
+		if (!$output->toBool()) {
691
+			return $output;
692
+		}
693
+		if (!$output->data) {
694
+			return new BaseObject(-1, 'msg_invalid_request');
695
+		}
646 696
 		unset($args);
647 697
 
648 698
 		// update immediately if there is no idx to change
@@ -653,35 +703,50 @@  discard block
 block discarded – undo
653 703
 			$args->var_idx = $var_idx;
654 704
 			$args->new_idx = $new_idx;
655 705
 			$output = executeQuery('document.updateDocumentExtraKeyIdx', $args);
656
-			if(!$output->toBool()) return $output;
706
+			if(!$output->toBool()) {
707
+				return $output;
708
+			}
657 709
 			$output = executeQuery('document.updateDocumentExtraVarIdx', $args);
658
-			if(!$output->toBool()) return $output;
710
+			if(!$output->toBool()) {
711
+				return $output;
712
+			}
659 713
 			// replace if exists
660
-		}
661
-		else
714
+		} else
662 715
 		{
663 716
 			$args = new stdClass();
664 717
 			$args->module_srl = $module_srl;
665 718
 			$args->var_idx = $new_idx;
666 719
 			$args->new_idx = -10000;
667 720
 			$output = executeQuery('document.updateDocumentExtraKeyIdx', $args);
668
-			if(!$output->toBool()) return $output;
721
+			if(!$output->toBool()) {
722
+				return $output;
723
+			}
669 724
 			$output = executeQuery('document.updateDocumentExtraVarIdx', $args);
670
-			if(!$output->toBool()) return $output;
725
+			if(!$output->toBool()) {
726
+				return $output;
727
+			}
671 728
 
672 729
 			$args->var_idx = $var_idx;
673 730
 			$args->new_idx = $new_idx;
674 731
 			$output = executeQuery('document.updateDocumentExtraKeyIdx', $args);
675
-			if(!$output->toBool()) return $output;
732
+			if(!$output->toBool()) {
733
+				return $output;
734
+			}
676 735
 			$output = executeQuery('document.updateDocumentExtraVarIdx', $args);
677
-			if(!$output->toBool()) return $output;
736
+			if(!$output->toBool()) {
737
+				return $output;
738
+			}
678 739
 
679 740
 			$args->var_idx = -10000;
680 741
 			$args->new_idx = $var_idx;
681 742
 			$output = executeQuery('document.updateDocumentExtraKeyIdx', $args);
682
-			if(!$output->toBool()) return $output;
743
+			if(!$output->toBool()) {
744
+				return $output;
745
+			}
683 746
 			$output = executeQuery('document.updateDocumentExtraVarIdx', $args);
684
-			if(!$output->toBool()) return $output;
747
+			if(!$output->toBool()) {
748
+				return $output;
749
+			}
685 750
 		}
686 751
 
687 752
 		$oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE);
@@ -705,8 +770,7 @@  discard block
 block discarded – undo
705 770
 		{
706 771
 			$args->alias_srl = getNextSequence();
707 772
 			$query = "document.insertAlias";
708
-		}
709
-		else
773
+		} else
710 774
 		{
711 775
 			$args->alias_srl = $alias_srl;
712 776
 			$query = "document.updateAlias";
@@ -744,7 +808,9 @@  discard block
 block discarded – undo
744 808
 		$oDocumentModel = getModel('document');
745 809
 		$oDocumentController = getController('document');
746 810
 		$oDocument = $oDocumentModel->getDocument($document_srl, false, false);
747
-		if(!$oDocument->isGranted()) return $this->stop('msg_not_permitted');
811
+		if(!$oDocument->isGranted()) {
812
+			return $this->stop('msg_not_permitted');
813
+		}
748 814
 	
749 815
 		$oModuleModel = getModel('module');
750 816
 		$module_info = $oModuleModel->getModuleInfoByDocumentSrl($document_srl);
@@ -766,8 +832,9 @@  discard block
 block discarded – undo
766 832
 				parse_str($arrUrl['query'], $arrQuery);
767 833
 
768 834
 				// set query
769
-				if(isset($arrQuery['document_srl']))
770
-					unset($arrQuery['document_srl']);
835
+				if(isset($arrQuery['document_srl'])) {
836
+									unset($arrQuery['document_srl']);
837
+				}
771 838
 
772 839
 				$searchArgs = new stdClass;
773 840
 				foreach($arrQuery as $key=>$val)
@@ -775,13 +842,15 @@  discard block
 block discarded – undo
775 842
 					$searchArgs->{$key} = $val;
776 843
 				}
777 844
 
778
-				if(!isset($searchArgs->sort_index))
779
-					$searchArgs->sort_index = $module_info->order_target;
845
+				if(!isset($searchArgs->sort_index)) {
846
+									$searchArgs->sort_index = $module_info->order_target;
847
+				}
780 848
 
781 849
 				foreach($module_info as $key=>$val)
782 850
 				{
783
-					if(!isset($searchArgs->{$key}))
784
-						$searchArgs->{$key} = $val;
851
+					if(!isset($searchArgs->{$key})) {
852
+											$searchArgs->{$key} = $val;
853
+					}
785 854
 				}
786 855
 
787 856
 				$oDocumentModel = getModel('document');
@@ -793,12 +862,14 @@  discard block
 block discarded – undo
793 862
 				}
794 863
 
795 864
 
796
-				if($cur_page>1 && count($output->data) == 0)
797
-					$arrQuery['page'] = $cur_page - 1;
865
+				if($cur_page>1 && count($output->data) == 0) {
866
+									$arrQuery['page'] = $cur_page - 1;
867
+				}
798 868
 
799 869
 				$query = "?";
800
-				foreach($arrQuery as $key=>$val)
801
-					$query .= sprintf("%s=%s&", $key, $val);
870
+				foreach($arrQuery as $key=>$val) {
871
+									$query .= sprintf("%s=%s&", $key, $val);
872
+				}
802 873
 				$query = substr($query, 0, -1);
803 874
 			}
804 875
 			$returnUrl = $arrUrl['path'] . $query;
@@ -878,7 +949,9 @@  discard block
 block discarded – undo
878 949
 	 */
879 950
 	function restoreTrash($originObject)
880 951
 	{
881
-		if(is_array($originObject)) $originObject = (object)$originObject;
952
+		if(is_array($originObject)) {
953
+			$originObject = (object)$originObject;
954
+		}
882 955
 
883 956
 		$oDocumentController = getController('document');
884 957
 		$oDocumentModel = getModel('document');
@@ -888,7 +961,9 @@  discard block
 block discarded – undo
888 961
 
889 962
 		//DB restore
890 963
 		$output = $oDocumentController->insertDocument($originObject, false, true, false);
891
-		if(!$output->toBool()) return new BaseObject(-1, $output->getMessage());
964
+		if(!$output->toBool()) {
965
+			return new BaseObject(-1, $output->getMessage());
966
+		}
892 967
 
893 968
 		//FILE restore
894 969
 		$oDocument = $oDocumentModel->getDocument($originObject->document_srl);
@@ -926,7 +1001,9 @@  discard block
 block discarded – undo
926 1001
 	function emptyTrash($originObject)
927 1002
 	{
928 1003
 		$originObject = unserialize($originObject);
929
-		if(is_array($originObject)) $originObject = (object) $originObject;
1004
+		if(is_array($originObject)) {
1005
+			$originObject = (object) $originObject;
1006
+		}
930 1007
 
931 1008
 		$oDocument = new documentItem();
932 1009
 		$oDocument->setAttribute($originObject);
Please login to merge, or discard this patch.
modules/document/document.admin.model.php 2 patches
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -27,31 +27,31 @@  discard block
 block discarded – undo
27 27
 	function getDocumentTrashList($obj)
28 28
 	{
29 29
 		// check a list and its order
30
-		if(!in_array($obj->sort_index, array('list_order','delete_date','title'))) $obj->sort_index = 'list_order';
31
-		if(!in_array($obj->order_type, array('desc','asc'))) $obj->order_type = 'asc';
30
+		if (!in_array($obj->sort_index, array('list_order', 'delete_date', 'title'))) $obj->sort_index = 'list_order';
31
+		if (!in_array($obj->order_type, array('desc', 'asc'))) $obj->order_type = 'asc';
32 32
 		// get a module_srl if mid is returned instead of modul_srl
33
-		if($obj->mid)
33
+		if ($obj->mid)
34 34
 		{
35 35
 			$oModuleModel = getModel('module');
36 36
 			$obj->module_srl = $oModuleModel->getModuleSrlByMid($obj->mid);
37 37
 			unset($obj->mid);
38 38
 		}
39 39
 		// check if the module_srl is an array
40
-		if(is_array($obj->module_srl)) $args->module_srl = implode(',', $obj->module_srl);
40
+		if (is_array($obj->module_srl)) $args->module_srl = implode(',', $obj->module_srl);
41 41
 		else $args->module_srl = $obj->module_srl;
42 42
 		// Variable check
43 43
 		$args->sort_index = $obj->sort_index;
44 44
 		$args->order_type = $obj->order_type;
45
-		$args->page = $obj->page?$obj->page:1;
46
-		$args->list_count = $obj->list_count?$obj->list_count:20;
47
-		$args->page_count = $obj->page_count?$obj->page_count:10;
45
+		$args->page = $obj->page ? $obj->page : 1;
46
+		$args->list_count = $obj->list_count ? $obj->list_count : 20;
47
+		$args->page_count = $obj->page_count ? $obj->page_count : 10;
48 48
 		$args->member_srl = $obj->member_srl;
49 49
 		// Specify query_id
50 50
 		$query_id = 'document.getTrashList';
51 51
 		// Execute a query
52 52
 		$output = executeQueryArray($query_id, $args);
53 53
 		// Return if no result or an error occurs
54
-		if(!$output->toBool() || !count($output->data)) return $output;
54
+		if (!$output->toBool() || !count($output->data)) return $output;
55 55
 
56 56
 		$idx = 0;
57 57
 		$data = $output->data;
@@ -60,12 +60,12 @@  discard block
 block discarded – undo
60 60
 		$keys = array_keys($data);
61 61
 		$virtual_number = $keys[0];
62 62
 
63
-		foreach($data as $key => $attribute)
63
+		foreach ($data as $key => $attribute)
64 64
 		{
65 65
 			$oDocument = null;
66 66
 			$oDocument = new documentItem();
67 67
 			$oDocument->setAttribute($attribute, false);
68
-			if($is_admin) $oDocument->setGrant();
68
+			if ($is_admin) $oDocument->setGrant();
69 69
 
70 70
 			$output->data[$virtual_number] = $oDocument;
71 71
 			$virtual_number--;
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 		$output = executeQuery('document.getTrash', $args);
86 86
 
87 87
 		$node = $output->data;
88
-		if(!$node) return;
88
+		if (!$node) return;
89 89
 
90 90
 		return $node;
91 91
 	}
@@ -100,12 +100,12 @@  discard block
 block discarded – undo
100 100
 	function getDocumentCountByDate($date = '', $moduleSrlList = array(), $statusList = array())
101 101
 	{
102 102
 		$args = new stdClass();
103
-		if($date) $args->regDate = date('Ymd', strtotime($date));
104
-		if(count($moduleSrlList)>0) $args->moduleSrlList = $moduleSrlList;
105
-		if(count($statusList)>0) $args->statusList = $statusList;
103
+		if ($date) $args->regDate = date('Ymd', strtotime($date));
104
+		if (count($moduleSrlList) > 0) $args->moduleSrlList = $moduleSrlList;
105
+		if (count($statusList) > 0) $args->statusList = $statusList;
106 106
 
107 107
 		$output = executeQuery('document.getDocumentCountByDate', $args);
108
-		if(!$output->toBool()) return 0;
108
+		if (!$output->toBool()) return 0;
109 109
 
110 110
 		return $output->data->count;
111 111
 	}
Please login to merge, or discard this patch.
Braces   +32 added lines, -11 removed lines patch added patch discarded remove patch
@@ -27,8 +27,12 @@  discard block
 block discarded – undo
27 27
 	function getDocumentTrashList($obj)
28 28
 	{
29 29
 		// check a list and its order
30
-		if(!in_array($obj->sort_index, array('list_order','delete_date','title'))) $obj->sort_index = 'list_order';
31
-		if(!in_array($obj->order_type, array('desc','asc'))) $obj->order_type = 'asc';
30
+		if(!in_array($obj->sort_index, array('list_order','delete_date','title'))) {
31
+			$obj->sort_index = 'list_order';
32
+		}
33
+		if(!in_array($obj->order_type, array('desc','asc'))) {
34
+			$obj->order_type = 'asc';
35
+		}
32 36
 		// get a module_srl if mid is returned instead of modul_srl
33 37
 		if($obj->mid)
34 38
 		{
@@ -37,8 +41,11 @@  discard block
 block discarded – undo
37 41
 			unset($obj->mid);
38 42
 		}
39 43
 		// check if the module_srl is an array
40
-		if(is_array($obj->module_srl)) $args->module_srl = implode(',', $obj->module_srl);
41
-		else $args->module_srl = $obj->module_srl;
44
+		if(is_array($obj->module_srl)) {
45
+			$args->module_srl = implode(',', $obj->module_srl);
46
+		} else {
47
+			$args->module_srl = $obj->module_srl;
48
+		}
42 49
 		// Variable check
43 50
 		$args->sort_index = $obj->sort_index;
44 51
 		$args->order_type = $obj->order_type;
@@ -51,7 +58,9 @@  discard block
 block discarded – undo
51 58
 		// Execute a query
52 59
 		$output = executeQueryArray($query_id, $args);
53 60
 		// Return if no result or an error occurs
54
-		if(!$output->toBool() || !count($output->data)) return $output;
61
+		if(!$output->toBool() || !count($output->data)) {
62
+			return $output;
63
+		}
55 64
 
56 65
 		$idx = 0;
57 66
 		$data = $output->data;
@@ -65,7 +74,9 @@  discard block
 block discarded – undo
65 74
 			$oDocument = null;
66 75
 			$oDocument = new documentItem();
67 76
 			$oDocument->setAttribute($attribute, false);
68
-			if($is_admin) $oDocument->setGrant();
77
+			if($is_admin) {
78
+				$oDocument->setGrant();
79
+			}
69 80
 
70 81
 			$output->data[$virtual_number] = $oDocument;
71 82
 			$virtual_number--;
@@ -85,7 +96,9 @@  discard block
 block discarded – undo
85 96
 		$output = executeQuery('document.getTrash', $args);
86 97
 
87 98
 		$node = $output->data;
88
-		if(!$node) return;
99
+		if(!$node) {
100
+			return;
101
+		}
89 102
 
90 103
 		return $node;
91 104
 	}
@@ -100,12 +113,20 @@  discard block
 block discarded – undo
100 113
 	function getDocumentCountByDate($date = '', $moduleSrlList = array(), $statusList = array())
101 114
 	{
102 115
 		$args = new stdClass();
103
-		if($date) $args->regDate = date('Ymd', strtotime($date));
104
-		if(count($moduleSrlList)>0) $args->moduleSrlList = $moduleSrlList;
105
-		if(count($statusList)>0) $args->statusList = $statusList;
116
+		if($date) {
117
+			$args->regDate = date('Ymd', strtotime($date));
118
+		}
119
+		if(count($moduleSrlList)>0) {
120
+			$args->moduleSrlList = $moduleSrlList;
121
+		}
122
+		if(count($statusList)>0) {
123
+			$args->statusList = $statusList;
124
+		}
106 125
 
107 126
 		$output = executeQuery('document.getDocumentCountByDate', $args);
108
-		if(!$output->toBool()) return 0;
127
+		if(!$output->toBool()) {
128
+			return 0;
129
+		}
109 130
 
110 131
 		return $output->data->count;
111 132
 	}
Please login to merge, or discard this patch.
modules/document/document.admin.view.php 2 patches
Braces   +7 added lines, -4 removed lines patch added patch discarded remove patch
@@ -168,19 +168,22 @@
 block discarded – undo
168 168
 	function dispDocumentAdminAlias()
169 169
 	{
170 170
 		$args->document_srl = Context::get('document_srl');
171
-		if(!$args->document_srl) return $this->dispDocumentAdminList();
171
+		if(!$args->document_srl) {
172
+			return $this->dispDocumentAdminList();
173
+		}
172 174
 
173 175
 		$oModel = getModel('document');
174 176
 		$oDocument = $oModel->getDocument($args->document_srl);
175
-		if(!$oDocument->isExists()) return $this->dispDocumentAdminList();
177
+		if(!$oDocument->isExists()) {
178
+			return $this->dispDocumentAdminList();
179
+		}
176 180
 		Context::set('oDocument', $oDocument);
177 181
 
178 182
 		$output = executeQueryArray('document.getAliases', $args);
179 183
 		if(!$output->data)
180 184
 		{
181 185
 			$aliases = array();
182
-		}
183
-		else
186
+		} else
184 187
 		{
185 188
 			$aliases = $output->data; 
186 189
 		}
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -19,9 +19,9 @@  discard block
 block discarded – undo
19 19
 		// check current location in admin menu
20 20
 		$oModuleModel = getModel('module');
21 21
 		$info = $oModuleModel->getModuleActionXml('document');
22
-		foreach($info->menu AS $key => $menu)
22
+		foreach ($info->menu AS $key => $menu)
23 23
 		{
24
-			if(in_array($this->act, $menu->acts))
24
+			if (in_array($this->act, $menu->acts))
25 25
 			{
26 26
 				Context::set('currentMenu', $key);
27 27
 				break;
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 
67 67
 		// set a search option used in the template
68 68
 		$count_search_option = count($this->search_option);
69
-		for($i=0;$i<$count_search_option;$i++)
69
+		for ($i = 0; $i < $count_search_option; $i++)
70 70
 		{
71 71
 			$search_option[$this->search_option[$i]] = Context::getLang($this->search_option[$i]);
72 72
 		}
@@ -75,20 +75,20 @@  discard block
 block discarded – undo
75 75
 		$oModuleModel = getModel('module');
76 76
 		$module_list = array();
77 77
 		$mod_srls = array();
78
-		foreach($output->data as $oDocument)
78
+		foreach ($output->data as $oDocument)
79 79
 		{
80 80
 			$mod_srls[] = $oDocument->get('module_srl');
81 81
 		}
82 82
 		$mod_srls = array_unique($mod_srls);
83 83
 		// Module List
84 84
 		$mod_srls_count = count($mod_srls);
85
-		if($mod_srls_count)
85
+		if ($mod_srls_count)
86 86
 		{
87 87
 			$columnList = array('module_srl', 'mid', 'browser_title');
88 88
 			$module_output = $oModuleModel->getModulesInfo($mod_srls, $columnList);
89
-			if($module_output && is_array($module_output))
89
+			if ($module_output && is_array($module_output))
90 90
 			{
91
-				foreach($module_output as $module)
91
+				foreach ($module_output as $module)
92 92
 				{
93 93
 					$module_list[$module->module_srl] = $module;
94 94
 				}
@@ -115,8 +115,8 @@  discard block
 block discarded – undo
115 115
 		Context::set('config', $config);
116 116
 
117 117
 		$oModuleModel = getModel('module');
118
-		$pcIconSkinList = $oModuleModel->getSkins($this->module_path . 'tpl', 'icons');
119
-		$mobileIconSkinList = $oModuleModel->getSkins($this->module_path . 'tpl', 'm.icons');
118
+		$pcIconSkinList = $oModuleModel->getSkins($this->module_path.'tpl', 'icons');
119
+		$mobileIconSkinList = $oModuleModel->getSkins($this->module_path.'tpl', 'm.icons');
120 120
 
121 121
 		Context::set('pcIconSkinList', $pcIconSkinList);
122 122
 		Context::set('mobileIconSkinList', $mobileIconSkinList);
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 	function dispDocumentAdminDeclared()
134 134
 	{
135 135
 		// option for a list
136
-		$args =new stdClass();
136
+		$args = new stdClass();
137 137
 		$args->page = Context::get('page'); // /< Page
138 138
 		$args->list_count = 30; // /< the number of posts to display on a single page
139 139
 		$args->page_count = 10; // /< the number of pages that appear in the page navigation
@@ -147,11 +147,11 @@  discard block
 block discarded – undo
147 147
 
148 148
 		// get a list
149 149
 		$declared_output = executeQuery('document.getDeclaredList', $args);
150
-		if($declared_output->data && count($declared_output->data))
150
+		if ($declared_output->data && count($declared_output->data))
151 151
 		{
152 152
 			$document_list = array();
153 153
 
154
-			foreach($declared_output->data as $key => $document)
154
+			foreach ($declared_output->data as $key => $document)
155 155
 			{
156 156
 				$document_list[$key] = new documentItem();
157 157
 				$document_list[$key]->setAttribute($document);
@@ -178,15 +178,15 @@  discard block
 block discarded – undo
178 178
 	function dispDocumentAdminAlias()
179 179
 	{
180 180
 		$args->document_srl = Context::get('document_srl');
181
-		if(!$args->document_srl) return $this->dispDocumentAdminList();
181
+		if (!$args->document_srl) return $this->dispDocumentAdminList();
182 182
 
183 183
 		$oModel = getModel('document');
184 184
 		$oDocument = $oModel->getDocument($args->document_srl);
185
-		if(!$oDocument->isExists()) return $this->dispDocumentAdminList();
185
+		if (!$oDocument->isExists()) return $this->dispDocumentAdminList();
186 186
 		Context::set('oDocument', $oDocument);
187 187
 
188 188
 		$output = executeQueryArray('document.getAliases', $args);
189
-		if(!$output->data)
189
+		if (!$output->data)
190 190
 		{
191 191
 			$aliases = array();
192 192
 		}
Please login to merge, or discard this patch.
modules/editor/components/image_gallery/image_gallery.class.php 2 patches
Braces   +8 added lines, -3 removed lines patch added patch discarded remove patch
@@ -75,15 +75,20 @@
 block discarded – undo
75 75
 		// HTML gallery output, the output settings via the template for the conversion to generate the html code should
76 76
 		preg_match_all('/(width|height)([^[:digit:]]+)([0-9]+)/i',$xml_obj->attrs->style,$matches);
77 77
 		$gallery_info->width = trim($matches[3][0]);
78
-		if(!$gallery_info->width) $gallery_info->width = 400;
78
+		if(!$gallery_info->width) {
79
+			$gallery_info->width = 400;
80
+		}
79 81
 
80 82
 		Context::set('gallery_info', $gallery_info);
81 83
 
82 84
 		$tpl_path = $this->component_path.'tpl';
83 85
 		Context::set("tpl_path", $tpl_path);
84 86
 
85
-		if($gallery_info->gallery_style == "list") $tpl_file = 'list_gallery.html';
86
-		else $tpl_file = 'slide_gallery.html';
87
+		if($gallery_info->gallery_style == "list") {
88
+			$tpl_file = 'list_gallery.html';
89
+		} else {
90
+			$tpl_file = 'slide_gallery.html';
91
+		}
87 92
 
88 93
 		$oTemplate = &TemplateHandler::getInstance();
89 94
 		return $oTemplate->compile($tpl_path, $tpl_file);
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -45,14 +45,14 @@  discard block
 block discarded – undo
45 45
 	{
46 46
 		$gallery_info = new stdClass();
47 47
 		$gallery_info->srl = rand(111111, 999999);
48
-		$gallery_info->border_thickness = (int)$xml_obj->attrs->border_thickness;
48
+		$gallery_info->border_thickness = (int) $xml_obj->attrs->border_thickness;
49 49
 		$gallery_info->gallery_style = $xml_obj->attrs->gallery_style;
50 50
 		$color_preg = "/^([a-fA-F0-9]{6})/";
51
-		$gallery_info->border_color = preg_replace($color_preg,"#$1",$xml_obj->attrs->border_color);
52
-		$gallery_info->bg_color = preg_replace($color_preg,"#$1",$xml_obj->attrs->bg_color);
51
+		$gallery_info->border_color = preg_replace($color_preg, "#$1", $xml_obj->attrs->border_color);
52
+		$gallery_info->bg_color = preg_replace($color_preg, "#$1", $xml_obj->attrs->bg_color);
53 53
 		$gallery_info->gallery_align = $xml_obj->attrs->gallery_align;
54 54
 
55
-		if(!in_array($gallery_info->gallery_align, array('left', 'center', 'right'))) {
55
+		if (!in_array($gallery_info->gallery_align, array('left', 'center', 'right'))) {
56 56
 			$gallery_info->gallery_align = 'center';
57 57
 		}
58 58
 
@@ -62,10 +62,10 @@  discard block
 block discarded – undo
62 62
 		$gallery_info->images_list = preg_grep("/^[a-z0-9\/]+\.(gif|jpe?g|png)+$/i", $images_list);
63 63
 
64 64
 		// If you set the output to output the XML code generated a list of the image
65
-		if(Context::getResponseMethod() == 'XMLRPC')
65
+		if (Context::getResponseMethod() == 'XMLRPC')
66 66
 		{
67 67
 			$output = array();
68
-			for($i=0;$i<count($gallery_info->images_list);$i++)
68
+			for ($i = 0; $i < count($gallery_info->images_list); $i++)
69 69
 			{
70 70
 				$output[] = sprintf('<img src="%s" alt="" />', $gallery_info->images_list[$i]);
71 71
 			}
@@ -73,16 +73,16 @@  discard block
 block discarded – undo
73 73
 			return implode('<br />', $output);
74 74
 		}
75 75
 		// HTML gallery output, the output settings via the template for the conversion to generate the html code should
76
-		preg_match_all('/(width|height)([^[:digit:]]+)([0-9]+)/i',$xml_obj->attrs->style,$matches);
76
+		preg_match_all('/(width|height)([^[:digit:]]+)([0-9]+)/i', $xml_obj->attrs->style, $matches);
77 77
 		$gallery_info->width = trim($matches[3][0]);
78
-		if(!$gallery_info->width) $gallery_info->width = 400;
78
+		if (!$gallery_info->width) $gallery_info->width = 400;
79 79
 
80 80
 		Context::set('gallery_info', $gallery_info);
81 81
 
82 82
 		$tpl_path = $this->component_path.'tpl';
83 83
 		Context::set("tpl_path", $tpl_path);
84 84
 
85
-		if($gallery_info->gallery_style == "list") $tpl_file = 'list_gallery.html';
85
+		if ($gallery_info->gallery_style == "list") $tpl_file = 'list_gallery.html';
86 86
 		else $tpl_file = 'slide_gallery.html';
87 87
 
88 88
 		$oTemplate = &TemplateHandler::getInstance();
Please login to merge, or discard this patch.
modules/editor/components/poll_maker/poll_maker.class.php 2 patches
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -47,11 +47,15 @@
 block discarded – undo
47 47
 	{
48 48
 		$poll_srl = $xml_obj->attrs->poll_srl;
49 49
 		$skin = $xml_obj->attrs->skin;
50
-		if(!$skin) $skin = 'default';
50
+		if(!$skin) {
51
+			$skin = 'default';
52
+		}
51 53
 
52 54
 		preg_match('/width([^[:digit:]]+)([0-9]+)/i',$xml_obj->attrs->style,$matches);
53 55
 		$width = $matches[2];
54
-		if(!$width) $width = 400;
56
+		if(!$width) {
57
+			$width = 400;
58
+		}
55 59
 		$style = sprintf('width:%dpx', $width);
56 60
 		// poll model object creation to come get it return html
57 61
 		$oPollModel = getModel('poll');
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 	{
28 28
 		// Wanted Skins survey
29 29
 		$oModuleModel = getModel('module');
30
-		$skin_list = $oModuleModel->getSkins(_XE_PATH_ . 'modules/poll/');
30
+		$skin_list = $oModuleModel->getSkins(_XE_PATH_.'modules/poll/');
31 31
 		Context::set('skin_list', $skin_list);
32 32
 		// Pre-compiled source code to compile template return to
33 33
 		$tpl_path = $this->component_path.'tpl';
@@ -47,11 +47,11 @@  discard block
 block discarded – undo
47 47
 	{
48 48
 		$poll_srl = $xml_obj->attrs->poll_srl;
49 49
 		$skin = $xml_obj->attrs->skin;
50
-		if(!$skin) $skin = 'default';
50
+		if (!$skin) $skin = 'default';
51 51
 
52
-		preg_match('/width([^[:digit:]]+)([0-9]+)/i',$xml_obj->attrs->style,$matches);
52
+		preg_match('/width([^[:digit:]]+)([0-9]+)/i', $xml_obj->attrs->style, $matches);
53 53
 		$width = $matches[2];
54
-		if(!$width) $width = 400;
54
+		if (!$width) $width = 400;
55 55
 		$style = sprintf('width:%dpx', $width);
56 56
 		// poll model object creation to come get it return html
57 57
 		$oPollModel = getModel('poll');
Please login to merge, or discard this patch.
modules/editor/editor.admin.view.php 2 patches
Braces   +34 added lines, -13 removed lines patch added patch discarded remove patch
@@ -35,12 +35,24 @@  discard block
 block discarded – undo
35 35
 		}
36 36
 
37 37
 		//editor_config init
38
-		if(!$editor_config->editor_height) $editor_config->editor_height = 300;
39
-		if(!$editor_config->comment_editor_height) $editor_config->comment_editor_height = 100;
40
-		if(!$editor_config->editor_skin) $editor_config->editor_skin = 'ckeditor';
41
-		if(!$editor_config->comment_editor_skin) $editor_config->comment_editor_skin = 'ckeditor';
42
-		if(!$editor_config->sel_editor_colorset) $editor_config->sel_editor_colorset= 'moono';
43
-		if(!$editor_config->sel_comment_editor_colorset) $editor_config->sel_comment_editor_colorset= 'moono';
38
+		if(!$editor_config->editor_height) {
39
+			$editor_config->editor_height = 300;
40
+		}
41
+		if(!$editor_config->comment_editor_height) {
42
+			$editor_config->comment_editor_height = 100;
43
+		}
44
+		if(!$editor_config->editor_skin) {
45
+			$editor_config->editor_skin = 'ckeditor';
46
+		}
47
+		if(!$editor_config->comment_editor_skin) {
48
+			$editor_config->comment_editor_skin = 'ckeditor';
49
+		}
50
+		if(!$editor_config->sel_editor_colorset) {
51
+			$editor_config->sel_editor_colorset= 'moono';
52
+		}
53
+		if(!$editor_config->sel_comment_editor_colorset) {
54
+			$editor_config->sel_comment_editor_colorset= 'moono';
55
+		}
44 56
 
45 57
 		$component_list = $oEditorModel->getComponentList(false, $site_srl, true);
46 58
 		$editor_skin_list = FileHandler::readDir(_XE_PATH_.'modules/editor/skins');
@@ -65,14 +77,20 @@  discard block
 block discarded – undo
65 77
 			$xml_info->path = './modules/editor/components/'.$xml_info->component_name;
66 78
 			$xml_info->delete_url = $oAutoinstallModel->getRemoveUrlByPath($xml_info->path);
67 79
 			$xml_info->package_srl = $oAutoinstallModel->getPackageSrlByPath($xml_info->path);
68
-			if($xml_info->package_srl) $targetpackages[$xml_info->package_srl] = 0;
80
+			if($xml_info->package_srl) {
81
+				$targetpackages[$xml_info->package_srl] = 0;
82
+			}
69 83
 		}
70 84
 
71
-		if(is_array($targetpackages))	$packages = $oAutoinstallModel->getInstalledPackages(array_keys($targetpackages));
85
+		if(is_array($targetpackages)) {
86
+			$packages = $oAutoinstallModel->getInstalledPackages(array_keys($targetpackages));
87
+		}
72 88
 
73 89
 		foreach($component_list as $component_name => $xml_info)
74 90
 		{
75
-			if($packages[$xml_info->package_srl])	$xml_info->need_update = $packages[$xml_info->package_srl]->need_update;
91
+			if($packages[$xml_info->package_srl]) {
92
+				$xml_info->need_update = $packages[$xml_info->package_srl]->need_update;
93
+			}
76 94
 		}
77 95
 		$editor_config_default = array( "editor_height" => "300", "comment_editor_height" => "100","content_font_size"=>"13");
78 96
 
@@ -162,13 +180,16 @@  discard block
 block discarded – undo
162 180
 			// Get a list of module category
163 181
 			$module_categories = $oModuleModel->getModuleCategories();
164 182
 
165
-			if(!is_array($mid_list)) $mid_list = array($mid_list);
183
+			if(!is_array($mid_list)) {
184
+				$mid_list = array($mid_list);
185
+			}
166 186
 			foreach($mid_list as $module_srl => $module)
167 187
 			{
168
-				if($module) $module_categories[$module->module_category_srl]->list[$module_srl] = $module; 
188
+				if($module) {
189
+					$module_categories[$module->module_category_srl]->list[$module_srl] = $module;
190
+				}
169 191
 			}
170
-		}
171
-		else
192
+		} else
172 193
 		{
173 194
 			$module_categories[0]->list = $mid_list;
174 195
 		}
Please login to merge, or discard this patch.
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -22,59 +22,59 @@  discard block
 block discarded – undo
22 22
 	{
23 23
 		$component_count = 0;
24 24
 		$site_module_info = Context::get('site_module_info');
25
-		$site_srl = (int)$site_module_info->site_srl;
25
+		$site_srl = (int) $site_module_info->site_srl;
26 26
 
27 27
 		// Get a type of component
28 28
 		$oEditorModel = getModel('editor');
29 29
 		$oModuleModel = getModel('module');
30 30
 		$editor_config = $oModuleModel->getModuleConfig('editor');
31 31
 
32
-		if(!$editor_config)
32
+		if (!$editor_config)
33 33
 		{
34 34
 			$editor_config = new stdClass();
35 35
 		}
36 36
 
37 37
 		//editor_config init
38
-		if(!$editor_config->editor_height) $editor_config->editor_height = 300;
39
-		if(!$editor_config->comment_editor_height) $editor_config->comment_editor_height = 100;
40
-		if(!$editor_config->editor_skin) $editor_config->editor_skin = 'ckeditor';
41
-		if(!$editor_config->comment_editor_skin) $editor_config->comment_editor_skin = 'ckeditor';
42
-		if(!$editor_config->sel_editor_colorset) $editor_config->sel_editor_colorset= 'moono';
43
-		if(!$editor_config->sel_comment_editor_colorset) $editor_config->sel_comment_editor_colorset= 'moono';
38
+		if (!$editor_config->editor_height) $editor_config->editor_height = 300;
39
+		if (!$editor_config->comment_editor_height) $editor_config->comment_editor_height = 100;
40
+		if (!$editor_config->editor_skin) $editor_config->editor_skin = 'ckeditor';
41
+		if (!$editor_config->comment_editor_skin) $editor_config->comment_editor_skin = 'ckeditor';
42
+		if (!$editor_config->sel_editor_colorset) $editor_config->sel_editor_colorset = 'moono';
43
+		if (!$editor_config->sel_comment_editor_colorset) $editor_config->sel_comment_editor_colorset = 'moono';
44 44
 
45 45
 		$component_list = $oEditorModel->getComponentList(false, $site_srl, true);
46 46
 		$editor_skin_list = FileHandler::readDir(_XE_PATH_.'modules/editor/skins');
47 47
 
48
-		$skin_info = $oModuleModel->loadSkinInfo($this->module_path,$editor_config->editor_skin);
48
+		$skin_info = $oModuleModel->loadSkinInfo($this->module_path, $editor_config->editor_skin);
49 49
 
50 50
 		$contents = FileHandler::readDir(_XE_PATH_.'modules/editor/styles');
51 51
 		$content_style_list = array();
52
-		for($i=0,$c=count($contents);$i<$c;$i++)
52
+		for ($i = 0, $c = count($contents); $i < $c; $i++)
53 53
 		{
54 54
 			$style = $contents[$i];
55
-			$info = $oModuleModel->loadSkinInfo($this->module_path,$style,'styles');
55
+			$info = $oModuleModel->loadSkinInfo($this->module_path, $style, 'styles');
56 56
 			$content_style_list[$style] = new stdClass();
57 57
 			$content_style_list[$style]->title = $info->title;
58 58
 		}
59 59
 
60 60
 		// Get install info, update info, count
61 61
 		$oAutoinstallModel = getModel('autoinstall');
62
-		foreach($component_list as $component_name => $xml_info)
62
+		foreach ($component_list as $component_name => $xml_info)
63 63
 		{
64 64
 			$component_count++;
65 65
 			$xml_info->path = './modules/editor/components/'.$xml_info->component_name;
66 66
 			$xml_info->delete_url = $oAutoinstallModel->getRemoveUrlByPath($xml_info->path);
67 67
 			$xml_info->package_srl = $oAutoinstallModel->getPackageSrlByPath($xml_info->path);
68
-			if($xml_info->package_srl) $targetpackages[$xml_info->package_srl] = 0;
68
+			if ($xml_info->package_srl) $targetpackages[$xml_info->package_srl] = 0;
69 69
 		}
70 70
 
71
-		if(is_array($targetpackages))	$packages = $oAutoinstallModel->getInstalledPackages(array_keys($targetpackages));
71
+		if (is_array($targetpackages))	$packages = $oAutoinstallModel->getInstalledPackages(array_keys($targetpackages));
72 72
 
73
-		foreach($component_list as $component_name => $xml_info)
73
+		foreach ($component_list as $component_name => $xml_info)
74 74
 		{
75
-			if($packages[$xml_info->package_srl])	$xml_info->need_update = $packages[$xml_info->package_srl]->need_update;
75
+			if ($packages[$xml_info->package_srl])	$xml_info->need_update = $packages[$xml_info->package_srl]->need_update;
76 76
 		}
77
-		$editor_config_default = array( "editor_height" => "300", "comment_editor_height" => "100","content_font_size"=>"13");
77
+		$editor_config_default = array("editor_height" => "300", "comment_editor_height" => "100", "content_font_size"=>"13");
78 78
 
79 79
 		//editor preview
80 80
 		$config = $oEditorModel->getEditorConfig();
@@ -138,14 +138,14 @@  discard block
 block discarded – undo
138 138
 	function dispEditorAdminSetupComponent()
139 139
 	{
140 140
 		$site_module_info = Context::get('site_module_info');
141
-		$site_srl = (int)$site_module_info->site_srl;
141
+		$site_srl = (int) $site_module_info->site_srl;
142 142
 
143 143
 		$component_name = Context::get('component_name');
144 144
 		// Get information of the editor component
145 145
 		$oEditorModel = getModel('editor');
146
-		$component = $oEditorModel->getComponent($component_name,$site_srl);
146
+		$component = $oEditorModel->getComponent($component_name, $site_srl);
147 147
 
148
-		if(!$component->component_name) {
148
+		if (!$component->component_name) {
149 149
 			$this->stop('msg_invalid_request');
150 150
 			return;
151 151
 		}
@@ -158,20 +158,20 @@  discard block
 block discarded – undo
158 158
 		// Get a mid list
159 159
 		$oModuleModel = getModel('module');
160 160
 
161
-		$args =new stdClass();
161
+		$args = new stdClass();
162 162
 		$args->site_srl = $site_srl;
163 163
 		$columnList = array('module_srl', 'mid', 'module_category_srl', 'browser_title');
164 164
 		$mid_list = $oModuleModel->getMidList($args, $columnList);
165 165
 		// Combination of module_category and module
166
-		if(!$args->site_srl)
166
+		if (!$args->site_srl)
167 167
 		{
168 168
 			// Get a list of module category
169 169
 			$module_categories = $oModuleModel->getModuleCategories();
170 170
 
171
-			if(!is_array($mid_list)) $mid_list = array($mid_list);
172
-			foreach($mid_list as $module_srl => $module)
171
+			if (!is_array($mid_list)) $mid_list = array($mid_list);
172
+			foreach ($mid_list as $module_srl => $module)
173 173
 			{
174
-				if($module) $module_categories[$module->module_category_srl]->list[$module_srl] = $module; 
174
+				if ($module) $module_categories[$module->module_category_srl]->list[$module_srl] = $module; 
175 175
 			}
176 176
 		}
177 177
 		else
@@ -179,13 +179,13 @@  discard block
 block discarded – undo
179 179
 			$module_categories[0]->list = $mid_list;
180 180
 		}
181 181
 
182
-		Context::set('mid_list',$module_categories);
182
+		Context::set('mid_list', $module_categories);
183 183
 
184 184
 		//Security
185 185
 		$security = new Security();
186 186
 		$security->encodeHTML('group_list..title');
187 187
 		$security->encodeHTML('component...', 'component_name');
188
-		$security->encodeHTML('mid_list..title','mid_list..list..browser_title');
188
+		$security->encodeHTML('mid_list..title', 'mid_list..list..browser_title');
189 189
 
190 190
 		$this->setTemplatePath($this->module_path.'tpl');
191 191
 		$this->setTemplateFile('setup_component');
Please login to merge, or discard this patch.
modules/file/file.admin.view.php 2 patches
Braces   +12 added lines, -9 removed lines patch added patch discarded remove patch
@@ -64,16 +64,13 @@  discard block
 block discarded – undo
64 64
 					if($document_list[$target_srl])
65 65
 					{
66 66
 						$file->upload_target_type = 'doc';
67
-					}
68
-					else if($comment_list[$target_srl])
67
+					} else if($comment_list[$target_srl])
69 68
 					{
70 69
 						$file->upload_target_type = 'com';
71
-					}
72
-					else if($module_list[$target_srl])
70
+					} else if($module_list[$target_srl])
73 71
 					{
74 72
 						$file->upload_target_type = 'mod';
75
-					}
76
-					else
73
+					} else
77 74
 					{
78 75
 						// document
79 76
 						$document = $oDocumentModel->getDocument($target_srl);
@@ -115,15 +112,21 @@  discard block
 block discarded – undo
115 112
 					// Check if data is already obtained
116 113
 					for($i = 0; $i < $com_srls_count; ++$i)
117 114
 					{
118
-						if($comment_list[$com_srls[$i]]) delete($com_srls[$i]);
115
+						if($comment_list[$com_srls[$i]]) {
116
+							delete($com_srls[$i]);
117
+						}
119 118
 					}
120 119
 					for($i = 0; $i < $doc_srls_count; ++$i)
121 120
 					{
122
-						if($document_list[$doc_srls[$i]]) delete($doc_srls[$i]);
121
+						if($document_list[$doc_srls[$i]]) {
122
+							delete($doc_srls[$i]);
123
+						}
123 124
 					}
124 125
 					for($i = 0; $i < $mod_srls_count; ++$i)
125 126
 					{
126
-						if($module_list[$mod_srls[$i]]) delete($mod_srls[$i]);
127
+						if($module_list[$mod_srls[$i]]) {
128
+							delete($mod_srls[$i]);
129
+						}
127 130
 					}
128 131
 				}
129 132
 
Please login to merge, or discard this patch.
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 				, 'source_filename', 'isvalid', 'file_size', 'download_count', 'files.regdate', 'ipaddress', 'member.member_srl', 'member.nick_name', 'uploaded_filename');
37 37
 		$output = $oFileAdminModel->getFileList($args, $columnList);
38 38
 		// Get the document for looping a list
39
-		if($output->data)
39
+		if ($output->data)
40 40
 		{
41 41
 			$oCommentModel = getModel('comment');
42 42
 			$oDocumentModel = getModel('document');
@@ -45,31 +45,31 @@  discard block
 block discarded – undo
45 45
 			$file_list = array();
46 46
 			$document_list = array();
47 47
 			$comment_list = array();
48
-			$module_list= array();
48
+			$module_list = array();
49 49
 
50 50
 			$doc_srls = array();
51 51
 			$com_srls = array();
52
-			$mod_srls= array();
52
+			$mod_srls = array();
53 53
 
54
-			foreach($output->data as $file)
54
+			foreach ($output->data as $file)
55 55
 			{
56 56
 				$file_srl = $file->file_srl;
57 57
 				$target_srl = $file->upload_target_srl;
58 58
 				$file_update_args = new stdClass();
59 59
 				$file_update_args->file_srl = $file_srl;
60 60
 				// Find and update if upload_target_type doesn't exist
61
-				if(!$file->upload_target_type)
61
+				if (!$file->upload_target_type)
62 62
 				{
63 63
 					// Pass if upload_target_type is already found 
64
-					if($document_list[$target_srl])
64
+					if ($document_list[$target_srl])
65 65
 					{
66 66
 						$file->upload_target_type = 'doc';
67 67
 					}
68
-					else if($comment_list[$target_srl])
68
+					else if ($comment_list[$target_srl])
69 69
 					{
70 70
 						$file->upload_target_type = 'com';
71 71
 					}
72
-					else if($module_list[$target_srl])
72
+					else if ($module_list[$target_srl])
73 73
 					{
74 74
 						$file->upload_target_type = 'mod';
75 75
 					}
@@ -77,17 +77,17 @@  discard block
 block discarded – undo
77 77
 					{
78 78
 						// document
79 79
 						$document = $oDocumentModel->getDocument($target_srl);
80
-						if($document->isExists())
80
+						if ($document->isExists())
81 81
 						{
82 82
 							$file->upload_target_type = 'doc';
83 83
 							$file_update_args->upload_target_type = $file->upload_target_type;
84 84
 							$document_list[$target_srl] = $document;
85 85
 						}
86 86
 						// comment
87
-						if(!$file->upload_target_type)
87
+						if (!$file->upload_target_type)
88 88
 						{
89 89
 							$comment = $oCommentModel->getComment($target_srl);
90
-							if($comment->isExists())
90
+							if ($comment->isExists())
91 91
 							{
92 92
 								$file->upload_target_type = 'com';
93 93
 								$file->target_document_srl = $comment->document_srl;
@@ -97,39 +97,39 @@  discard block
 block discarded – undo
97 97
 							}
98 98
 						}
99 99
 						// module (for a page)
100
-						if(!$file->upload_target_type)
100
+						if (!$file->upload_target_type)
101 101
 						{
102 102
 							$module = $oModuleModel->getModulesInfo($target_srl);
103
-							if($module)
103
+							if ($module)
104 104
 							{
105 105
 								$file->upload_target_type = 'mod';
106 106
 								$file_update_args->upload_target_type = $file->upload_target_type;
107 107
 								$module_list[$module->comment_srl] = $module;
108 108
 							}
109 109
 						}
110
-						if($file_update_args->upload_target_type)
110
+						if ($file_update_args->upload_target_type)
111 111
 						{
112 112
 							executeQuery('file.updateFileTargetType', $file_update_args);
113 113
 						}
114 114
 					}
115 115
 					// Check if data is already obtained
116
-					for($i = 0; $i < $com_srls_count; ++$i)
116
+					for ($i = 0; $i < $com_srls_count; ++$i)
117 117
 					{
118
-						if($comment_list[$com_srls[$i]]) delete($com_srls[$i]);
118
+						if ($comment_list[$com_srls[$i]]) delete($com_srls[$i]);
119 119
 					}
120
-					for($i = 0; $i < $doc_srls_count; ++$i)
120
+					for ($i = 0; $i < $doc_srls_count; ++$i)
121 121
 					{
122
-						if($document_list[$doc_srls[$i]]) delete($doc_srls[$i]);
122
+						if ($document_list[$doc_srls[$i]]) delete($doc_srls[$i]);
123 123
 					}
124
-					for($i = 0; $i < $mod_srls_count; ++$i)
124
+					for ($i = 0; $i < $mod_srls_count; ++$i)
125 125
 					{
126
-						if($module_list[$mod_srls[$i]]) delete($mod_srls[$i]);
126
+						if ($module_list[$mod_srls[$i]]) delete($mod_srls[$i]);
127 127
 					}
128 128
 				}
129 129
 
130
-				if($file->upload_target_type)
130
+				if ($file->upload_target_type)
131 131
 				{
132
-					if(!in_array($file->upload_target_srl, ${$file->upload_target_type.'_srls'}))
132
+					if (!in_array($file->upload_target_srl, ${$file->upload_target_type.'_srls'}))
133 133
 					{
134 134
 						${$file->upload_target_type.'_srls'}[] = $target_srl;
135 135
 					}
@@ -144,10 +144,10 @@  discard block
 block discarded – undo
144 144
 			$mod_srls = array_unique($mod_srls);
145 145
 			// Comment list
146 146
 			$com_srls_count = count($com_srls);
147
-			if($com_srls_count)
147
+			if ($com_srls_count)
148 148
 			{
149 149
 				$comment_output = $oCommentModel->getComments($com_srls);
150
-				foreach($comment_output as $comment)
150
+				foreach ($comment_output as $comment)
151 151
 				{
152 152
 					$comment_list[$comment->comment_srl] = $comment;
153 153
 					$doc_srls[] = $comment->document_srl;
@@ -155,12 +155,12 @@  discard block
 block discarded – undo
155 155
 			}
156 156
 			// Document list
157 157
 			$doc_srls_count = count($doc_srls);
158
-			if($doc_srls_count)
158
+			if ($doc_srls_count)
159 159
 			{
160 160
 				$document_output = $oDocumentModel->getDocuments($doc_srls);
161
-				if(is_array($document_output))
161
+				if (is_array($document_output))
162 162
 				{
163
-					foreach($document_output as $document)
163
+					foreach ($document_output as $document)
164 164
 					{
165 165
 						$document_list[$document->document_srl] = $document;
166 166
 					}
@@ -168,22 +168,22 @@  discard block
 block discarded – undo
168 168
 			}
169 169
 			// Module List
170 170
 			$mod_srls_count = count($mod_srls);
171
-			if($mod_srls_count)
171
+			if ($mod_srls_count)
172 172
 			{
173 173
 				$columnList = array('module_srl', 'mid', 'browser_title');
174 174
 				$module_output = $oModuleModel->getModulesInfo($mod_srls, $columnList);
175
-				if($module_output && is_array($module_output))
175
+				if ($module_output && is_array($module_output))
176 176
 				{
177
-					foreach($module_output as $module)
177
+					foreach ($module_output as $module)
178 178
 					{
179 179
 						$module_list[$module->module_srl] = $module;
180 180
 					}
181 181
 				}
182 182
 			}
183 183
 
184
-			foreach($file_list as $srl => $file)
184
+			foreach ($file_list as $srl => $file)
185 185
 			{
186
-				if($file->upload_target_type == 'com')
186
+				if ($file->upload_target_type == 'com')
187 187
 				{
188 188
 					$file_list[$srl]->target_document_srl = $comment_list[$file->upload_target_srl]->document_srl;
189 189
 				}
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 	{
217 217
 		$oFileModel = getModel('file');
218 218
 		$config = $oFileModel->getFileConfig();
219
-		Context::set('config',$config);
219
+		Context::set('config', $config);
220 220
 		$iniPostMaxSize = FileHandler::returnbytes(ini_get('post_max_size'));
221 221
 		$iniUploadMaxSize = FileHandler::returnbytes(ini_get('upload_max_filesize'));
222 222
 		$iniMinSize = min($iniPostMaxSize, $iniUploadMaxSize);
Please login to merge, or discard this patch.
modules/install/install.view.php 2 patches
Braces   +34 added lines, -13 removed lines patch added patch discarded remove patch
@@ -19,12 +19,16 @@  discard block
 block discarded – undo
19 19
 		// Specify the template path
20 20
 		$this->setTemplatePath($this->module_path.'tpl');
21 21
 		// Error occurs if already installed
22
-		if(Context::isInstalled()) return $this->stop('msg_already_installed');
22
+		if(Context::isInstalled()) {
23
+			return $this->stop('msg_already_installed');
24
+		}
23 25
 		// Install a controller
24 26
 		$oInstallController = getController('install');
25 27
 		$this->install_enable = $oInstallController->checkInstallEnv();
26 28
 		// If the environment is installable, execute installController::makeDefaultDirectory()
27
-		if($this->install_enable) $oInstallController->makeDefaultDirectory();
29
+		if($this->install_enable) {
30
+			$oInstallController->makeDefaultDirectory();
31
+		}
28 32
 	}
29 33
 
30 34
 	/**
@@ -68,7 +72,9 @@  discard block
 block discarded – undo
68 72
 				Context::set('install_config', true, true);
69 73
 				$oInstallController = getController('install');
70 74
 				$output = $oInstallController->procInstall();
71
-				if (!$output->toBool()) return $output;
75
+				if (!$output->toBool()) {
76
+					return $output;
77
+				}
72 78
 				header("location: ./");
73 79
 				Context::close();
74 80
 				exit;
@@ -101,7 +107,9 @@  discard block
 block discarded – undo
101 107
 		Context::set('use_rewrite', $useRewrite); 
102 108
 
103 109
 		// nginx 체크, rewrite 사용법 안내
104
-		if($useRewrite == 'N' && stripos($_SERVER['SERVER_SOFTWARE'], 'nginx') !== false) Context::set('use_nginx', 'Y');
110
+		if($useRewrite == 'N' && stripos($_SERVER['SERVER_SOFTWARE'], 'nginx') !== false) {
111
+			Context::set('use_nginx', 'Y');
112
+		}
105 113
 		
106 114
 		$this->setTemplateFile('check_env');
107 115
 	}
@@ -112,14 +120,15 @@  discard block
 block discarded – undo
112 120
 	function dispInstallSelectDB()
113 121
 	{
114 122
 		// Display check_env if it is not installable
115
-		if(!$this->install_enable) return $this->dispInstallCheckEnv();
123
+		if(!$this->install_enable) {
124
+			return $this->dispInstallCheckEnv();
125
+		}
116 126
 		// Enter ftp information
117 127
 		if(ini_get('safe_mode') && !Context::isFTPRegisted())
118 128
 		{
119 129
 			Context::set('progressMenu', '3');
120 130
 			$this->setTemplateFile('ftp');
121
-		}
122
-		else
131
+		} else
123 132
 		{
124 133
 			$defaultDatabase = 'mysqli';
125 134
 			$disableList = DB::getDisableList();
@@ -147,9 +156,13 @@  discard block
 block discarded – undo
147 156
 	function dispInstallDBForm()
148 157
 	{
149 158
 		// Display check_env if not installable
150
-		if(!$this->install_enable) return $this->dispInstallCheckEnv();
159
+		if(!$this->install_enable) {
160
+			return $this->dispInstallCheckEnv();
161
+		}
151 162
 		// Return to the start-up screen if db_type is not specified
152
-		if(!Context::get('db_type')) return $this->dispInstallSelectDB();
163
+		if(!Context::get('db_type')) {
164
+			return $this->dispInstallSelectDB();
165
+		}
153 166
 
154 167
 		// Output the file, disp_db_info_form.html
155 168
 		$tpl_filename = sprintf('form.%s', Context::get('db_type'));
@@ -163,9 +176,15 @@  discard block
 block discarded – undo
163 176
 			// Error occured when using https protocol at "ModuleHandler::init() '
164 177
 			$parsedUrl = parse_url($error_return_url);
165 178
 			$error_return_url = '';
166
-			if(isset($parsedUrl['path'])) $error_return_url .= $parsedUrl['path'];
167
-			if(isset($parsedUrl['query'])) $error_return_url .= '?' . $parsedUrl['query'];
168
-			if(isset($parsedUrl['fragment'])) $error_return_url .= '?' . $parsedUrl['fragment'];
179
+			if(isset($parsedUrl['path'])) {
180
+				$error_return_url .= $parsedUrl['path'];
181
+			}
182
+			if(isset($parsedUrl['query'])) {
183
+				$error_return_url .= '?' . $parsedUrl['query'];
184
+			}
185
+			if(isset($parsedUrl['fragment'])) {
186
+				$error_return_url .= '?' . $parsedUrl['fragment'];
187
+			}
169 188
 		}
170 189
 		Context::set('error_return_url', $error_return_url);
171 190
 
@@ -178,7 +197,9 @@  discard block
 block discarded – undo
178 197
 	function dispInstallConfigForm()
179 198
 	{
180 199
 		// Display check_env if not installable
181
-		if(!$this->install_enable) return $this->dispInstallCheckEnv();
200
+		if(!$this->install_enable) {
201
+			return $this->dispInstallCheckEnv();
202
+		}
182 203
 
183 204
 		include _XE_PATH_.'files/config/tmpDB.config.php';
184 205
 
Please login to merge, or discard this patch.
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -19,12 +19,12 @@  discard block
 block discarded – undo
19 19
 		// Specify the template path
20 20
 		$this->setTemplatePath($this->module_path.'tpl');
21 21
 		// Error occurs if already installed
22
-		if(Context::isInstalled()) return $this->stop('msg_already_installed');
22
+		if (Context::isInstalled()) return $this->stop('msg_already_installed');
23 23
 		// Install a controller
24 24
 		$oInstallController = getController('install');
25 25
 		$this->install_enable = $oInstallController->checkInstallEnv();
26 26
 		// If the environment is installable, execute installController::makeDefaultDirectory()
27
-		if($this->install_enable) $oInstallController->makeDefaultDirectory();
27
+		if ($this->install_enable) $oInstallController->makeDefaultDirectory();
28 28
 	}
29 29
 
30 30
 	/**
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 	function dispInstallIntroduce()
34 34
 	{
35 35
 		$install_config_file = FileHandler::getRealPath('./config/install.config.php');
36
-		if(file_exists($install_config_file))
36
+		if (file_exists($install_config_file))
37 37
 		{
38 38
 			/**
39 39
 			 * If './config/install.config.php' file created  and write array shown in the example below, XE installed using config file.
@@ -57,12 +57,12 @@  discard block
 block discarded – undo
57 57
 			  );
58 58
 			 */
59 59
 			include $install_config_file;
60
-			if(is_array($install_config))
60
+			if (is_array($install_config))
61 61
 			{
62
-				foreach($install_config as $k => $v) 
62
+				foreach ($install_config as $k => $v) 
63 63
 				{
64 64
 					$v = ($k == 'db_table_prefix') ? $v.'_' : $v;
65
-					Context::set($k,$v,true);
65
+					Context::set($k, $v, true);
66 66
 				}
67 67
 				unset($GLOBALS['__DB__']);
68 68
 				Context::set('install_config', true, true);
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 		Context::set('use_rewrite', $useRewrite); 
102 102
 
103 103
 		// nginx 체크, rewrite 사용법 안내
104
-		if($useRewrite == 'N' && stripos($_SERVER['SERVER_SOFTWARE'], 'nginx') !== false) Context::set('use_nginx', 'Y');
104
+		if ($useRewrite == 'N' && stripos($_SERVER['SERVER_SOFTWARE'], 'nginx') !== false) Context::set('use_nginx', 'Y');
105 105
 		
106 106
 		$this->setTemplateFile('check_env');
107 107
 	}
@@ -112,9 +112,9 @@  discard block
 block discarded – undo
112 112
 	function dispInstallSelectDB()
113 113
 	{
114 114
 		// Display check_env if it is not installable
115
-		if(!$this->install_enable) return $this->dispInstallCheckEnv();
115
+		if (!$this->install_enable) return $this->dispInstallCheckEnv();
116 116
 		// Enter ftp information
117
-		if(ini_get('safe_mode') && !Context::isFTPRegisted())
117
+		if (ini_get('safe_mode') && !Context::isFTPRegisted())
118 118
 		{
119 119
 			Context::set('progressMenu', '3');
120 120
 			$this->setTemplateFile('ftp');
@@ -123,11 +123,11 @@  discard block
 block discarded – undo
123 123
 		{
124 124
 			$defaultDatabase = 'mysqli';
125 125
 			$disableList = DB::getDisableList();
126
-			if(is_array($disableList))
126
+			if (is_array($disableList))
127 127
 			{
128
-				foreach($disableList AS $key=>$value)
128
+				foreach ($disableList AS $key=>$value)
129 129
 				{
130
-					if($value->db_type == $defaultDatabase)
130
+					if ($value->db_type == $defaultDatabase)
131 131
 					{
132 132
 						$defaultDatabase = 'mysql';
133 133
 						break;
@@ -147,9 +147,9 @@  discard block
 block discarded – undo
147 147
 	function dispInstallDBForm()
148 148
 	{
149 149
 		// Display check_env if not installable
150
-		if(!$this->install_enable) return $this->dispInstallCheckEnv();
150
+		if (!$this->install_enable) return $this->dispInstallCheckEnv();
151 151
 		// Return to the start-up screen if db_type is not specified
152
-		if(!Context::get('db_type')) return $this->dispInstallSelectDB();
152
+		if (!Context::get('db_type')) return $this->dispInstallSelectDB();
153 153
 
154 154
 		// Output the file, disp_db_info_form.html
155 155
 		$tpl_filename = sprintf('form.%s', Context::get('db_type'));
@@ -158,14 +158,14 @@  discard block
 block discarded – undo
158 158
 		Context::set('title', $title);
159 159
 
160 160
 		$error_return_url = getNotEncodedUrl('', 'act', Context::get('act'), 'db_type', Context::get('db_type'));
161
-		if($_SERVER['HTTPS'] == 'on')
161
+		if ($_SERVER['HTTPS'] == 'on')
162 162
 		{
163 163
 			// Error occured when using https protocol at "ModuleHandler::init() '
164 164
 			$parsedUrl = parse_url($error_return_url);
165 165
 			$error_return_url = '';
166
-			if(isset($parsedUrl['path'])) $error_return_url .= $parsedUrl['path'];
167
-			if(isset($parsedUrl['query'])) $error_return_url .= '?' . $parsedUrl['query'];
168
-			if(isset($parsedUrl['fragment'])) $error_return_url .= '?' . $parsedUrl['fragment'];
166
+			if (isset($parsedUrl['path'])) $error_return_url .= $parsedUrl['path'];
167
+			if (isset($parsedUrl['query'])) $error_return_url .= '?'.$parsedUrl['query'];
168
+			if (isset($parsedUrl['fragment'])) $error_return_url .= '?'.$parsedUrl['fragment'];
169 169
 		}
170 170
 		Context::set('error_return_url', $error_return_url);
171 171
 
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 	function dispInstallConfigForm()
179 179
 	{
180 180
 		// Display check_env if not installable
181
-		if(!$this->install_enable) return $this->dispInstallCheckEnv();
181
+		if (!$this->install_enable) return $this->dispInstallCheckEnv();
182 182
 
183 183
 		include _XE_PATH_.'files/config/tmpDB.config.php';
184 184
 
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 
191 191
 	function useRewriteModule()
192 192
 	{
193
-		if(function_exists('apache_get_modules') && in_array('mod_rewrite',apache_get_modules()))
193
+		if (function_exists('apache_get_modules') && in_array('mod_rewrite', apache_get_modules()))
194 194
 		{
195 195
 			return true;
196 196
 		}
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 	function dispInstallManagerForm()
210 210
 	{
211 211
 		// Display check_env if not installable
212
-		if(!$this->install_enable)
212
+		if (!$this->install_enable)
213 213
 		{
214 214
 			return $this->dispInstallCheckEnv();
215 215
 		}
Please login to merge, or discard this patch.