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 ( ba9f3c...6bcce1 )
by gyeong-won
07:26
created
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.
modules/install/script/ko.install.php 2 patches
Braces   +31 added lines, -12 removed lines patch added patch discarded remove patch
@@ -140,8 +140,7 @@  discard block
 block discarded – undo
140 140
 		{
141 141
 			Context::set('is_shortcut', $item['is_shortcut'], TRUE);
142 142
 			Context::set('shortcut_target', $item['shortcut_target'], TRUE);
143
-		}
144
-		else
143
+		} else
145 144
 		{
146 145
 			Context::set('is_shortcut', 'N', TRUE);
147 146
 			Context::set('shortcut_target', null, TRUE);
@@ -155,7 +154,9 @@  discard block
 block discarded – undo
155 154
 		$menu_srl = $oMenuAdminController->get('menu_item_srl');
156 155
 		$item['menu_srl'] = $menu_srl;
157 156
 
158
-		if($item['list']) __makeMenu($item['list'], $menu_srl);
157
+		if($item['list']) {
158
+			__makeMenu($item['list'], $menu_srl);
159
+		}
159 160
 	}
160 161
 }
161 162
 
@@ -191,12 +192,16 @@  discard block
 block discarded – undo
191 192
 
192 193
 $oLayoutAdminController = getAdminController('layout');
193 194
 $output = $oLayoutAdminController->insertLayout($args);
194
-if(!$output->toBool()) return $output;
195
+if(!$output->toBool()) {
196
+	return $output;
197
+}
195 198
 
196 199
 // update Layout (PC)
197 200
 $args->extra_vars = serialize($extra_vars);
198 201
 $output = $oLayoutAdminController->updateLayout($args);
199
-if(!$output->toBool()) return $output;
202
+if(!$output->toBool()) {
203
+	return $output;
204
+}
200 205
 
201 206
 //create mobile layout
202 207
 $mlayout_srl = $args->layout_srl = getNextSequence();
@@ -206,12 +211,16 @@  discard block
 block discarded – undo
206 211
 $extra_vars->main_menu = $sitemap['GNB']['menu_srl'];
207 212
 
208 213
 $output = $oLayoutAdminController->insertLayout($args);
209
-if(!$output->toBool()) return $output;
214
+if(!$output->toBool()) {
215
+	return $output;
216
+}
210 217
 
211 218
 // update mobile Layout
212 219
 $args->extra_vars = serialize($extra_vars);
213 220
 $output = $oLayoutAdminController->updateLayout($args);
214
-if(!$output->toBool()) return $output;
221
+if(!$output->toBool()) {
222
+	return $output;
223
+}
215 224
 
216 225
 
217 226
 $siteDesignPath = _XE_PATH_.'files/site_design/';
@@ -274,14 +283,18 @@  discard block
 block discarded – undo
274 283
 $obj->content = $oTemplateHandler->compile(_XE_PATH_ . 'modules/install/script/welcome_content', 'welcome_content_'.$lang);
275 284
 
276 285
 $output = $oDocumentController->insertDocument($obj, true);
277
-if(!$output->toBool()) return $output;
286
+if(!$output->toBool()) {
287
+	return $output;
288
+}
278 289
 
279 290
 $document_srl = $output->get('document_srl');
280 291
 
281 292
 unset($obj->document_srl);
282 293
 $obj->title = 'Welcome mobile XE';
283 294
 $output = $oDocumentController->insertDocument($obj, true);
284
-if(!$output->toBool()) return $output;
295
+if(!$output->toBool()) {
296
+	return $output;
297
+}
285 298
 
286 299
 // save PageWidget
287 300
 $oModuleController = getController('module'); /* @var $oModuleController moduleController */
@@ -290,7 +303,9 @@  discard block
 block discarded – undo
290 303
 $module_info->content = '<img hasContent="true" class="zbxe_widget_output" widget="widgetContent" style="width: 100%; float: left;" body="" document_srl="'.$document_srl.'" widget_padding_left="0" widget_padding_right="0" widget_padding_top="0" widget_padding_bottom="0"  />';
291 304
 $module_info->mcontent = '<img hasContent="true" class="zbxe_widget_output" widget="widgetContent" style="width: 100%; float: left;" body="" document_srl="'.$mdocument_srl.'" widget_padding_left="0" widget_padding_right="0" widget_padding_top="0" widget_padding_bottom="0"  />';
292 305
 $output = $oModuleController->updateModule($module_info);
293
-if(!$output->toBool()) return $output;
306
+if(!$output->toBool()) {
307
+	return $output;
308
+}
294 309
 
295 310
 // insertFirstModule
296 311
 $site_args = new stdClass();
@@ -311,7 +326,9 @@  discard block
 block discarded – undo
311 326
 	$obj->content = $oTemplateHandler->compile(_XE_PATH_ . 'modules/install/script/xeicon_content', 'xeicon_content_ko_' . $i);
312 327
 
313 328
 	$output = $oDocumentController->insertDocument($obj, true);
314
-	if(!$output->toBool()) return $output;
329
+	if(!$output->toBool()) {
330
+		return $output;
331
+	}
315 332
 
316 333
 	$xeicon_document_srl[$i] = $output->get('document_srl');
317 334
 }
@@ -321,7 +338,9 @@  discard block
 block discarded – undo
321 338
 $module_info = $oModuleModel->getModuleInfoByModuleSrl($xeicon_module_srl);
322 339
 $module_info->content = '<div widget="widgetBox" style="float:left;width:100%;" widget_padding_left="0" widget_padding_right="0" widget_padding_top="0" widget_padding_bottom="0" css_class="XEicon" ><div><div><img hasContent="true" class="zbxe_widget_output" widget="widgetContent" style="float:left;padding:none;margin:none;width:100%;" document_srl="'.$xeicon_document_srl[1].'" widget_padding_left="0" widget_padding_right="0" widget_padding_top="0" widget_padding_bottom="0" /><img hasContent="true" class="zbxe_widget_output" widget="widgetContent" style="float:left;padding:none;margin:none;width:100%;" document_srl="'.$xeicon_document_srl[2].'" widget_padding_left="0" widget_padding_right="0" widget_padding_top="0" widget_padding_bottom="0" /><img hasContent="true" class="zbxe_widget_output" widget="widgetContent" style="float:left;padding:none;margin:none;width:100%;" document_srl="'.$xeicon_document_srl[3].'" widget_padding_left="0" widget_padding_right="0" widget_padding_top="0" widget_padding_bottom="0" /><img hasContent="true" class="zbxe_widget_output" widget="widgetContent" style="float:left;padding:none;margin:none;width:100%;" document_srl="'.$xeicon_document_srl[4].'" widget_padding_left="0" widget_padding_right="0" widget_padding_top="0" widget_padding_bottom="0" /></div></div></div>';
323 340
 $output = $oModuleController->updateModule($module_info);
324
-if(!$output->toBool()) return $output;
341
+if(!$output->toBool()) {
342
+	return $output;
343
+}
325 344
 
326 345
 
327 346
 // create menu cache
Please login to merge, or discard this patch.
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -130,13 +130,13 @@  discard block
 block discarded – undo
130 130
 function __makeMenu(&$list, $parent_srl)
131 131
 {
132 132
 	$oMenuAdminController = getAdminController('menu');
133
-	foreach($list as $idx => &$item)
133
+	foreach ($list as $idx => &$item)
134 134
 	{
135 135
 		Context::set('parent_srl', $parent_srl, TRUE);
136 136
 		Context::set('menu_name', $item['menu_name'], TRUE);
137 137
 		Context::set('module_type', $item['module_type'], TRUE);
138 138
 		Context::set('module_id', $item['module_id'], TRUE);
139
-		if($item['is_shortcut'] === 'Y')
139
+		if ($item['is_shortcut'] === 'Y')
140 140
 		{
141 141
 			Context::set('is_shortcut', $item['is_shortcut'], TRUE);
142 142
 			Context::set('shortcut_target', $item['shortcut_target'], TRUE);
@@ -148,23 +148,23 @@  discard block
 block discarded – undo
148 148
 		}
149 149
 
150 150
 		$output = $oMenuAdminController->procMenuAdminInsertItem();
151
-		if($output instanceof BaseObject && !$output->toBool())
151
+		if ($output instanceof BaseObject && !$output->toBool())
152 152
 		{
153 153
 			return $output;
154 154
 		}
155 155
 		$menu_srl = $oMenuAdminController->get('menu_item_srl');
156 156
 		$item['menu_srl'] = $menu_srl;
157 157
 
158
-		if($item['list']) __makeMenu($item['list'], $menu_srl);
158
+		if ($item['list']) __makeMenu($item['list'], $menu_srl);
159 159
 	}
160 160
 }
161 161
 
162 162
 
163 163
 // 사이트맵 생성
164
-foreach($sitemap as $id => &$val)
164
+foreach ($sitemap as $id => &$val)
165 165
 {
166 166
 	$output = $oMenuAdminController->addMenu($val['title']);
167
-	if(!$output->toBool())
167
+	if (!$output->toBool())
168 168
 	{
169 169
 		return $output;
170 170
 	}
@@ -191,12 +191,12 @@  discard block
 block discarded – undo
191 191
 
192 192
 $oLayoutAdminController = getAdminController('layout');
193 193
 $output = $oLayoutAdminController->insertLayout($args);
194
-if(!$output->toBool()) return $output;
194
+if (!$output->toBool()) return $output;
195 195
 
196 196
 // update Layout (PC)
197 197
 $args->extra_vars = serialize($extra_vars);
198 198
 $output = $oLayoutAdminController->updateLayout($args);
199
-if(!$output->toBool()) return $output;
199
+if (!$output->toBool()) return $output;
200 200
 
201 201
 //create mobile layout
202 202
 $mlayout_srl = $args->layout_srl = getNextSequence();
@@ -206,12 +206,12 @@  discard block
 block discarded – undo
206 206
 $extra_vars->main_menu = $sitemap['GNB']['menu_srl'];
207 207
 
208 208
 $output = $oLayoutAdminController->insertLayout($args);
209
-if(!$output->toBool()) return $output;
209
+if (!$output->toBool()) return $output;
210 210
 
211 211
 // update mobile Layout
212 212
 $args->extra_vars = serialize($extra_vars);
213 213
 $output = $oLayoutAdminController->updateLayout($args);
214
-if(!$output->toBool()) return $output;
214
+if (!$output->toBool()) return $output;
215 215
 
216 216
 
217 217
 $siteDesignPath = _XE_PATH_.'files/site_design/';
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 
225 225
 $moduleList = array('page', 'board', 'editor');
226 226
 $moutput = ModuleHandler::triggerCall('menu.getModuleListInSitemap', 'after', $moduleList);
227
-if($moutput->toBool())
227
+if ($moutput->toBool())
228 228
 {
229 229
 	$moduleList = array_unique($moduleList);
230 230
 }
@@ -234,10 +234,10 @@  discard block
 block discarded – undo
234 234
 $designInfo->module = new stdClass();
235 235
 
236 236
 $oModuleModel = getModel('module'); /* @var $oModuleModel moduleModel */
237
-foreach($skinTypes as $key => $dir)
237
+foreach ($skinTypes as $key => $dir)
238 238
 {
239 239
 	$skinType = $key == 'skin' ? 'P' : 'M';
240
-	foreach($moduleList as $moduleName)
240
+	foreach ($moduleList as $moduleName)
241 241
 	{
242 242
 		$designInfo->module->{$moduleName} = new stdClass();
243 243
 		$designInfo->module->{$moduleName}->{$key} = $oModuleModel->getModuleDefaultSkin($moduleName, $skinType, 0, false);
@@ -271,17 +271,17 @@  discard block
 block discarded – undo
271 271
 Context::set('version', __XE_VERSION__);
272 272
 $obj->title = 'Welcome XE';
273 273
 
274
-$obj->content = $oTemplateHandler->compile(_XE_PATH_ . 'modules/install/script/welcome_content', 'welcome_content_'.$lang);
274
+$obj->content = $oTemplateHandler->compile(_XE_PATH_.'modules/install/script/welcome_content', 'welcome_content_'.$lang);
275 275
 
276 276
 $output = $oDocumentController->insertDocument($obj, true);
277
-if(!$output->toBool()) return $output;
277
+if (!$output->toBool()) return $output;
278 278
 
279 279
 $document_srl = $output->get('document_srl');
280 280
 
281 281
 unset($obj->document_srl);
282 282
 $obj->title = 'Welcome mobile XE';
283 283
 $output = $oDocumentController->insertDocument($obj, true);
284
-if(!$output->toBool()) return $output;
284
+if (!$output->toBool()) return $output;
285 285
 
286 286
 // save PageWidget
287 287
 $oModuleController = getController('module'); /* @var $oModuleController moduleController */
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
 $module_info->content = '<img hasContent="true" class="zbxe_widget_output" widget="widgetContent" style="width: 100%; float: left;" body="" document_srl="'.$document_srl.'" widget_padding_left="0" widget_padding_right="0" widget_padding_top="0" widget_padding_bottom="0"  />';
291 291
 $module_info->mcontent = '<img hasContent="true" class="zbxe_widget_output" widget="widgetContent" style="width: 100%; float: left;" body="" document_srl="'.$mdocument_srl.'" widget_padding_left="0" widget_padding_right="0" widget_padding_top="0" widget_padding_bottom="0"  />';
292 292
 $output = $oModuleController->updateModule($module_info);
293
-if(!$output->toBool()) return $output;
293
+if (!$output->toBool()) return $output;
294 294
 
295 295
 // insertFirstModule
296 296
 $site_args = new stdClass();
@@ -304,14 +304,14 @@  discard block
 block discarded – undo
304 304
 $xeicon_module_srl = $moduleInfo->module_srl;
305 305
 
306 306
 $xeicon_document_srl = array();
307
-for($i = 1; $i <=4; $i++)
307
+for ($i = 1; $i <= 4; $i++)
308 308
 {
309 309
 	unset($obj->document_srl);
310 310
 	$obj->title = "XEIcon ({$i})";
311
-	$obj->content = $oTemplateHandler->compile(_XE_PATH_ . 'modules/install/script/xeicon_content', 'xeicon_content_ko_' . $i);
311
+	$obj->content = $oTemplateHandler->compile(_XE_PATH_.'modules/install/script/xeicon_content', 'xeicon_content_ko_'.$i);
312 312
 
313 313
 	$output = $oDocumentController->insertDocument($obj, true);
314
-	if(!$output->toBool()) return $output;
314
+	if (!$output->toBool()) return $output;
315 315
 
316 316
 	$xeicon_document_srl[$i] = $output->get('document_srl');
317 317
 }
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
 $module_info = $oModuleModel->getModuleInfoByModuleSrl($xeicon_module_srl);
322 322
 $module_info->content = '<div widget="widgetBox" style="float:left;width:100%;" widget_padding_left="0" widget_padding_right="0" widget_padding_top="0" widget_padding_bottom="0" css_class="XEicon" ><div><div><img hasContent="true" class="zbxe_widget_output" widget="widgetContent" style="float:left;padding:none;margin:none;width:100%;" document_srl="'.$xeicon_document_srl[1].'" widget_padding_left="0" widget_padding_right="0" widget_padding_top="0" widget_padding_bottom="0" /><img hasContent="true" class="zbxe_widget_output" widget="widgetContent" style="float:left;padding:none;margin:none;width:100%;" document_srl="'.$xeicon_document_srl[2].'" widget_padding_left="0" widget_padding_right="0" widget_padding_top="0" widget_padding_bottom="0" /><img hasContent="true" class="zbxe_widget_output" widget="widgetContent" style="float:left;padding:none;margin:none;width:100%;" document_srl="'.$xeicon_document_srl[3].'" widget_padding_left="0" widget_padding_right="0" widget_padding_top="0" widget_padding_bottom="0" /><img hasContent="true" class="zbxe_widget_output" widget="widgetContent" style="float:left;padding:none;margin:none;width:100%;" document_srl="'.$xeicon_document_srl[4].'" widget_padding_left="0" widget_padding_right="0" widget_padding_top="0" widget_padding_bottom="0" /></div></div></div>';
323 323
 $output = $oModuleController->updateModule($module_info);
324
-if(!$output->toBool()) return $output;
324
+if (!$output->toBool()) return $output;
325 325
 
326 326
 
327 327
 // create menu cache
Please login to merge, or discard this patch.