Completed
Push — develop ( 4d26b2...764757 )
by Daniel
07:05
created
services/form/form.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -195,8 +195,7 @@  discard block
 block discarded – undo
195 195
 			if ($previewing || empty($row['field_props']['is_db_field']))
196 196
 			{
197 197
 				$fields_data[$field] = $value;
198
-			}
199
-			else
198
+			} else
200 199
 			{
201 200
 				$this->db_fields[$field] = $value;
202 201
 			}
@@ -236,14 +235,12 @@  discard block
 block discarded – undo
236 235
 		if (!empty($field_value))
237 236
 		{
238 237
 			$this->errors[] = $obj->validate_field($row);
239
-		}
240
-		else if ($row['field_required'])
238
+		} else if ($row['field_required'])
241 239
 		{
242 240
 			if (!$row['field_mod_only'] || $cp_class === 'mcp')
243 241
 			{
244 242
 				$this->errors[] = $this->language->lang_array('CONTENT_FIELD_REQUIRED', array($row['field_label']));
245
-			}
246
-			else
243
+			} else
247 244
 			{
248 245
 				$req_mod_input = true;
249 246
 			}
Please login to merge, or discard this patch.
services/form/builder.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 		foreach ($fields_data as $field => $value)
148 148
 		{
149 149
 			$value = is_array($value) ? join("\n", $value) : $value;
150
-			$message .= '[smcf=' . $field . ']' . $value . '[/smcf]';
150
+			$message .= '[smcf='.$field.']'.$value.'[/smcf]';
151 151
 		}
152 152
 
153 153
 		return $message;
@@ -200,13 +200,13 @@  discard block
 block discarded – undo
200 200
 		$text = '';
201 201
 		if ($entity = $this->types->get_type($content_type))
202 202
 		{
203
-			$fields_accessor = 'get_' . $view . '_fields';
204
-			$template_accessor = 'get_' . $view . '_tpl';
203
+			$fields_accessor = 'get_'.$view.'_fields';
204
+			$template_accessor = 'get_'.$view.'_tpl';
205 205
 
206 206
 			$this->fields->prepare_to_show($entity, array($post_data['topic_id']), $entity->$fields_accessor(), $entity->$template_accessor(), $view);
207 207
 			$content = $this->fields->build_content(array_change_key_case($post_data, CASE_UPPER));
208 208
 
209
-			$text =  $content['CUSTOM_DISPLAY'] ?: join('', $content['FIELDS']['all']);
209
+			$text = $content['CUSTOM_DISPLAY'] ?: join('', $content['FIELDS']['all']);
210 210
 		}
211 211
 		return $text;
212 212
 	}
@@ -402,8 +402,8 @@  discard block
 block discarded – undo
402 402
 		}
403 403
 		else
404 404
 		{
405
-			$options[ITEM_UNAPPROVED]	= 'CONTENT_STATUS_DISAPPROVE';
406
-			$options[ITEM_APPROVED]		= 'CONTENT_STATUS_APPROVE';
405
+			$options[ITEM_UNAPPROVED] = 'CONTENT_STATUS_DISAPPROVE';
406
+			$options[ITEM_APPROVED] = 'CONTENT_STATUS_APPROVE';
407 407
 		}
408 408
 
409 409
 		return $options;
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -286,8 +286,7 @@  discard block
 block discarded – undo
286 286
 		if (!$field_data['field_mod_only'] || $this->mode === 'mcp')
287 287
 		{
288 288
 			$this->form->add($field, $field_data['field_type'], $field_data, $topic_id);
289
-		}
290
-		else if (!empty($field_data['field_value']))
289
+		} else if (!empty($field_data['field_value']))
291 290
 		{
292 291
 			$this->form->add($field, 'hidden', $field_data, $topic_id);
293 292
 		}
@@ -334,8 +333,7 @@  discard block
 block discarded – undo
334 333
 			{
335 334
 				$data['force_visibility'] = $visibility;
336 335
 			}
337
-		}
338
-		else if ($this->force_state())
336
+		} else if ($this->force_state())
339 337
 		{
340 338
 			$data['force_visibility'] = ($mode == 'edit_first_post') ? ITEM_REAPPROVE : ITEM_UNAPPROVED;
341 339
 		}
@@ -399,8 +397,7 @@  discard block
 block discarded – undo
399 397
 		if ($visibility == ITEM_APPROVED)
400 398
 		{
401 399
 			$options[ITEM_REAPPROVE] = 'CONTENT_STATUS_REAPPROVE';
402
-		}
403
-		else
400
+		} else
404 401
 		{
405 402
 			$options[ITEM_UNAPPROVED]	= 'CONTENT_STATUS_DISAPPROVE';
406 403
 			$options[ITEM_APPROVED]		= 'CONTENT_STATUS_APPROVE';
Please login to merge, or discard this patch.
services/actions/topic/index.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 	 */
91 91
 	public function execute($u_action, $mode = '')
92 92
 	{
93
-		include($this->phpbb_root_path . 'includes/functions_display.' . $this->php_ext);
93
+		include($this->phpbb_root_path.'includes/functions_display.'.$this->php_ext);
94 94
 
95 95
 		$this->language->add_lang('viewforum');
96 96
 		$this->template->assign_var('MODE', $mode);
@@ -105,8 +105,8 @@  discard block
 block discarded – undo
105 105
 			$filter_topic_status = $this->apply_status_filter($sql_where_array);
106 106
 			$filter_content_type = $this->apply_content_type_filter();
107 107
 
108
-			$callable = 'init_' . $mode . '_mode';
109
-			$this->base_url = $u_action . (sizeof($this->params) ? '&' : '');
108
+			$callable = 'init_'.$mode.'_mode';
109
+			$this->base_url = $u_action.(sizeof($this->params) ? '&' : '');
110 110
 			$this->$callable($content_types, $sql_where_array);
111 111
 
112 112
 			$this->forum->query(true, false)
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 		$topic_tracking_info = $this->forum->get_topic_tracking_info();
138 138
 
139 139
 		$topics_data = array_values($topics_data);
140
-		$base_url = $u_action . http_build_query($this->params);
140
+		$base_url = $u_action.http_build_query($this->params);
141 141
 
142 142
 		for ($i = 0, $size = sizeof($topics_data); $i < $size; $i++)
143 143
 		{
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
 	{
170 170
 		return array(
171 171
 			'ATTACH_ICON_IMG'	=> $this->get_attachment_icon($row),
172
-			'U_REVIEW_TOPIC'	=> $u_action . "&amp;do=view&amp;type=$content_type&amp;t=" . $row['topic_id'],
172
+			'U_REVIEW_TOPIC'	=> $u_action."&amp;do=view&amp;type=$content_type&amp;t=".$row['topic_id'],
173 173
 		);
174 174
 	}
175 175
 
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
 			'S_CAN_MAKE_NORMAL'		=> ($s_can_make_sticky || $s_can_make_announce),
195 195
 			'S_CAN_MAKE_STICKY'		=> $s_can_make_sticky,
196 196
 			'S_CAN_MAKE_ANNOUNCE'	=> $s_can_make_announce,
197
-			'U_MCP_ACTION'			=> $this->base_url . '&amp;do=moderate&amp;redirect=' . $this->get_redirect_url($this->base_url),
197
+			'U_MCP_ACTION'			=> $this->base_url.'&amp;do=moderate&amp;redirect='.$this->get_redirect_url($this->base_url),
198 198
 		));
199 199
 	}
200 200
 
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 	 */
205 205
 	protected function init_ucp_mode(array $content_types, array &$sql_where_array)
206 206
 	{
207
-		$sql_where_array[] =  't.topic_poster = ' . (int) $this->user->data['user_id'];
207
+		$sql_where_array[] = 't.topic_poster = '.(int) $this->user->data['user_id'];
208 208
 
209 209
 		// list all content types that the user can post in
210 210
 		$postable_forums = array_intersect_key($this->content_forums, $this->auth->acl_getf('f_post', true));
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 			$this->template->assign_block_vars('postable', array(
217 217
 				'TYPE'		=> $entity->get_content_langname(),
218 218
 				'COLOUR'	=> $entity->get_content_colour(),
219
-				'U_POST'	=> append_sid("{$this->phpbb_root_path}posting." . $this->php_ext, 'mode=post&amp;f=' . $entity->get_forum_id()),
219
+				'U_POST'	=> append_sid("{$this->phpbb_root_path}posting.".$this->php_ext, 'mode=post&amp;f='.$entity->get_forum_id()),
220 220
 			));
221 221
 		}
222 222
 	}
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 			'CONTENT_TYPE'			=> $entity->get_content_langname(),
235 235
 			'CONTENT_TYPE_COLOR'	=> $entity->get_content_colour(),
236 236
 			'S_COMMENTS'			=> $entity->get_allow_comments(),
237
-			'U_CONTENT_TYPE'		=> $base_url . "&amp;type=$type",
237
+			'U_CONTENT_TYPE'		=> $base_url."&amp;type=$type",
238 238
 		);
239 239
 	}
240 240
 
@@ -284,8 +284,8 @@  discard block
 block discarded – undo
284 284
 		}
285 285
 
286 286
 		return array(
287
-			'TOPIC_STATUS'		=> $this->language->lang('TOPIC_' . strtoupper($topic_status)),
288
-			'U_TOPIC_STATUS'	=> $base_url . "&amp;status=$topic_status",
287
+			'TOPIC_STATUS'		=> $this->language->lang('TOPIC_'.strtoupper($topic_status)),
288
+			'U_TOPIC_STATUS'	=> $base_url."&amp;status=$topic_status",
289 289
 		);
290 290
 	}
291 291
 
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
 		if ($mode === 'mcp')
313 313
 		{
314 314
 			$u_mcp_queue = $this->get_mcp_queue_url($topic_unapproved, $posts_unapproved, $topic_id);
315
-			$u_mcp_queue = (!$u_mcp_queue && $topic_deleted) ? append_sid("{$this->phpbb_root_path}mcp.$this->php_ext", 'i=queue&amp;mode=deleted_topics&amp;t=' . $topic_id, true, $this->user->session_id) : $u_mcp_queue;
315
+			$u_mcp_queue = (!$u_mcp_queue && $topic_deleted) ? append_sid("{$this->phpbb_root_path}mcp.$this->php_ext", 'i=queue&amp;mode=deleted_topics&amp;t='.$topic_id, true, $this->user->session_id) : $u_mcp_queue;
316 316
 		}
317 317
 
318 318
 		return array(
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
 	 */
329 329
 	protected function get_mcp_queue_url($topic_unapproved, $posts_unapproved, $topic_id)
330 330
 	{
331
-		return ($topic_unapproved || $posts_unapproved) ? append_sid("{$this->phpbb_root_path}mcp.$this->php_ext", 'i=queue&amp;mode=' . (($topic_unapproved) ? 'approve_details' : 'unapproved_posts') . "&amp;t=$topic_id", true, $this->user->session_id) : '';
331
+		return ($topic_unapproved || $posts_unapproved) ? append_sid("{$this->phpbb_root_path}mcp.$this->php_ext", 'i=queue&amp;mode='.(($topic_unapproved) ? 'approve_details' : 'unapproved_posts')."&amp;t=$topic_id", true, $this->user->session_id) : '';
332 332
 	}
333 333
 
334 334
 	/**
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
 			if ($mode === 'mcp')
346 346
 			{
347 347
 				$redirect_url = $this->get_redirect_url($u_action);
348
-				$u_delete = append_sid("{$this->phpbb_root_path}mcp.$this->php_ext", 'quickmod=1&amp;action=delete_topic&amp;t=' . $row['topic_id'] . '&amp;redirect=' . $redirect_url, true, $this->user->session_id);
348
+				$u_delete = append_sid("{$this->phpbb_root_path}mcp.$this->php_ext", 'quickmod=1&amp;action=delete_topic&amp;t='.$row['topic_id'].'&amp;redirect='.$redirect_url, true, $this->user->session_id);
349 349
 			}
350 350
 		}
351 351
 
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
 	 */
359 359
 	protected function get_redirect_url($base_url)
360 360
 	{
361
-		$base_url .= (sizeof($this->params)) ? '&' . http_build_query($this->params) : '';
361
+		$base_url .= (sizeof($this->params)) ? '&'.http_build_query($this->params) : '';
362 362
 		return urlencode(str_replace('&amp;', '&', $base_url));
363 363
 	}
364 364
 
Please login to merge, or discard this patch.
services/actions/type/delete.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@
 block discarded – undo
61 61
 	 * @param \blitze\sitemaker\model\mapper_factory	$sitemaker_mapper_factory	Sitemaker Mapper factory object
62 62
 	 * @param bool										$auto_refresh				Used during testing
63 63
 	 * @param bool										$trigger_error				Used during testing
64
-	*/
64
+	 */
65 65
 	public function __construct(\phpbb\cache\driver\driver_interface $cache, \phpbb\language\language $language, \phpbb\log\log_interface $logger, \phpbb\request\request_interface $request, \phpbb\user $user, \blitze\content\services\types $content_types, \blitze\sitemaker\services\forum\manager $forum_manager, \blitze\content\model\mapper_factory $content_mapper_factory, \blitze\sitemaker\model\mapper_factory $sitemaker_mapper_factory, $auto_refresh = true, $trigger_error = true)
66 66
 	{
67 67
 		$this->cache = $cache;
Please login to merge, or discard this patch.
services/actions/type/save.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@
 block discarded – undo
73 73
 	 * @param string									$phpbb_admin_path       Relative admin root path
74 74
 	 * @param string									$php_ext				php file extension
75 75
 	 * @param boolean									$auto_refresh			Used for testing
76
-	*/
76
+	 */
77 77
 	public function __construct(\phpbb\auth\auth $auth, \phpbb\cache\driver\driver_interface $cache, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\language\language $language, \phpbb\log\log_interface $logger, \phpbb\request\request_interface $request, \phpbb\user $user, \blitze\content\services\types $content_types, \blitze\sitemaker\services\forum\manager $forum_manager, \blitze\content\model\mapper_factory $mapper_factory, $phpbb_admin_path, $php_ext, $auto_refresh = true)
78 78
 	{
79 79
 		$this->auth = $auth;
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 	 * @param \blitze\content\model\entity\type $unsaved_entity
123 123
 	 * @return string
124 124
 	 */
125
-	protected function handle_content_type($type, \blitze\content\model\entity\type &$unsaved_entity)
125
+	protected function handle_content_type($type, \blitze\content\model\entity\type & $unsaved_entity)
126 126
 	{
127 127
 		$existing_langname = '';
128 128
 		$forum_perm_from = $this->request->variable('copy_forum_perm', 0);
@@ -207,9 +207,9 @@  discard block
 block discarded – undo
207 207
 	{
208 208
 		if (!$type)
209 209
 		{
210
-			$u_set_permission = append_sid("{$this->phpbb_admin_path}index.$this->php_ext", 'i=permissions&mode=setting_forum_local&forum_id[]=' . $entity->get_forum_id(), true);
210
+			$u_set_permission = append_sid("{$this->phpbb_admin_path}index.$this->php_ext", 'i=permissions&mode=setting_forum_local&forum_id[]='.$entity->get_forum_id(), true);
211 211
 			$lang_key = 'CONTENT_TYPE_CREATED';
212
-			$message = $this->language->lang($lang_key, '<a href="' . $u_set_permission . '">', '</a>');
212
+			$message = $this->language->lang($lang_key, '<a href="'.$u_set_permission.'">', '</a>');
213 213
 		}
214 214
 		else
215 215
 		{
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 		}
227 227
 
228 228
 		$additional_data[] = $entity->get_content_langname();
229
-		$this->logger->add('admin', $this->user->data['user_id'], $this->user->ip, 'ACP_LOG_' . $lang_key, time(), $additional_data);
229
+		$this->logger->add('admin', $this->user->data['user_id'], $this->user->ip, 'ACP_LOG_'.$lang_key, time(), $additional_data);
230 230
 
231 231
 		$this->trigger_error($message, $u_action);
232 232
 	}
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
 		if ($old_langname !== $new_langname)
270 270
 		{
271 271
 			$forum_name = $this->language->lang($new_langname);
272
-			$sql = 'UPDATE ' . FORUMS_TABLE . " SET forum_name = '" . $this->db->sql_escape($forum_name) . "' WHERE forum_id = " . (int) $forum_id;
272
+			$sql = 'UPDATE '.FORUMS_TABLE." SET forum_name = '".$this->db->sql_escape($forum_name)."' WHERE forum_id = ".(int) $forum_id;
273 273
 			$this->db->sql_query($sql);
274 274
 		}
275 275
 	}
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -137,8 +137,7 @@  discard block
 block discarded – undo
137 137
 			$unsaved_entity->set_content_id($entity->get_content_id());
138 138
 			$this->handle_langname_change($forum_id, $entity->get_content_langname(), $unsaved_entity->get_content_langname());
139 139
 			$this->copy_forum_permissions($forum_id, $forum_perm_from);
140
-		}
141
-		else
140
+		} else
142 141
 		{
143 142
 			$forum_id = $this->create_content_forum($unsaved_entity->get_content_langname(), $forum_perm_from);
144 143
 			$unsaved_entity->set_forum_id($forum_id);
@@ -210,8 +209,7 @@  discard block
 block discarded – undo
210 209
 			$u_set_permission = append_sid("{$this->phpbb_admin_path}index.$this->php_ext", 'i=permissions&mode=setting_forum_local&forum_id[]=' . $entity->get_forum_id(), true);
211 210
 			$lang_key = 'CONTENT_TYPE_CREATED';
212 211
 			$message = $this->language->lang($lang_key, '<a href="' . $u_set_permission . '">', '</a>');
213
-		}
214
-		else
212
+		} else
215 213
 		{
216 214
 			$this->meta_refresh(3, $u_action);
217 215
 			$lang_key = 'CONTENT_TYPE_UPDATED';
Please login to merge, or discard this patch.