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