Completed
Branch release-2.1 (3c29ac)
by Mathias
08:54
created
Themes/default/PersonalMessage.template.php 2 patches
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 
232 232
 			foreach ($message['custom_fields']['above_member'] as $custom)
233 233
 				echo '
234
-					<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
234
+					<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
235 235
 
236 236
 			echo '
237 237
 				</ul>
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
 		if (!empty($message['custom_fields']['below_avatar']))
269 269
 			foreach ($message['custom_fields']['below_avatar'] as $custom)
270 270
 				echo '
271
-				<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
271
+				<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
272 272
 
273 273
 			if (!$message['member']['is_guest'])
274 274
 				echo '
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
 
311 311
 					foreach ($message['custom_fields']['icons'] as $custom)
312 312
 						echo '
313
-						<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
313
+						<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
314 314
 
315 315
 					echo '
316 316
 					</ol>
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
 				if (!empty($message['custom_fields']['standard']))
369 369
 					foreach ($message['custom_fields']['standard'] as $custom)
370 370
 						echo '
371
-				<li class="custom ', $custom['col_name'] ,'">', $custom['title'], ': ', $custom['value'], '</li>';
371
+				<li class="custom ', $custom['col_name'], '">', $custom['title'], ': ', $custom['value'], '</li>';
372 372
 
373 373
 				// Are we showing the warning status?
374 374
 				if ($message['member']['can_see_warning'])
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
 				if (!empty($message['custom_fields']['bottom_poster']))
380 380
 					foreach ($message['custom_fields']['bottom_poster'] as $custom)
381 381
 						echo '
382
-				<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
382
+				<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
383 383
 			}
384 384
 
385 385
 			// Done with the information about the poster... on to the post itself.
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
 
479 479
 				foreach ($message['custom_fields']['above_signature'] as $custom)
480 480
 					echo '
481
-							<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
481
+							<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
482 482
 
483 483
 				echo '
484 484
 						</ul>
@@ -499,7 +499,7 @@  discard block
 block discarded – undo
499 499
 
500 500
 				foreach ($message['custom_fields']['below_signature'] as $custom)
501 501
 					echo '
502
-							<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
502
+							<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
503 503
 
504 504
 				echo '
505 505
 						</ul>
@@ -631,7 +631,7 @@  discard block
 block discarded – undo
631 631
 	while ($message = $context['get_pmessage']('subject'))
632 632
 	{
633 633
 		echo '
634
-		<tr class="windowbg', $message['is_unread'] ? ' unread_pm' : '','">
634
+		<tr class="windowbg', $message['is_unread'] ? ' unread_pm' : '', '">
635 635
 			<td class="table_icon">
636 636
 			<script>
637 637
 				currentLabels[', $message['id'], '] = {';
@@ -903,12 +903,12 @@  discard block
 block discarded – undo
903 903
 					// You can only reply if they are not a guest...
904 904
 					if (!$message['member']['is_guest'])
905 905
 						echo '
906
-							<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=', $context['folder'] == 'sent' ? '' : $message['member']['id'], '">', $quote_button , '</a>', $context['menu_separator'], '
907
-							<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';u=', $message['member']['id'], '">', $reply_button , '</a> ', $context['menu_separator'];
906
+							<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=', $context['folder'] == 'sent' ? '' : $message['member']['id'], '">', $quote_button, '</a>', $context['menu_separator'], '
907
+							<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';u=', $message['member']['id'], '">', $reply_button, '</a> ', $context['menu_separator'];
908 908
 					// This is for "forwarding" - even if the member is gone.
909 909
 					else
910 910
 						echo '
911
-							<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote">', $quote_button , '</a>', $context['menu_separator'];
911
+							<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote">', $quote_button, '</a>', $context['menu_separator'];
912 912
 				}
913 913
 
914 914
 				echo '
@@ -1008,7 +1008,7 @@  discard block
 block discarded – undo
1008 1008
 			<div class="', empty($context['error_type']) || $context['error_type'] != 'serious' ? 'noticebox' : 'errorbox', '"', empty($context['post_error']['messages']) ? ' style="display: none"' : '', ' id="errors">
1009 1009
 				<dl>
1010 1010
 					<dt>
1011
-						<strong id="error_serious">', $txt['error_while_submitting'] , '</strong>
1011
+						<strong id="error_serious">', $txt['error_while_submitting'], '</strong>
1012 1012
 					</dt>
1013 1013
 					<dd class="error" id="error_list">
1014 1014
 						', empty($context['post_error']['messages']) ? '' : implode('<br>', $context['post_error']['messages']), '
@@ -1064,7 +1064,7 @@  discard block
 block discarded – undo
1064 1064
 					<span', (isset($context['post_error']['no_subject']) ? ' class="error"' : ''), ' id="caption_subject">', $txt['subject'], ':</span>
1065 1065
 				</dt>
1066 1066
 				<dd id="pm_subject">
1067
-					<input type="text" name="subject" value="', $context['subject'], '" tabindex="', $context['tabindex']++, '" size="80" maxlength="80"',isset($context['post_error']['no_subject']) ? ' class="error"' : ' class="input_text"', '/>
1067
+					<input type="text" name="subject" value="', $context['subject'], '" tabindex="', $context['tabindex']++, '" size="80" maxlength="80"', isset($context['post_error']['no_subject']) ? ' class="error"' : ' class="input_text"', '/>
1068 1068
 				</dd>
1069 1069
 			</dl><hr>';
1070 1070
 
@@ -1427,7 +1427,7 @@  discard block
 block discarded – undo
1427 1427
 		echo '
1428 1428
 		<div class="padding">
1429 1429
 			<input type="submit" name="save" value="', $txt['save'], '" class="button_submit">
1430
-			<input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" data-confirm="', $txt['pm_labels_delete'] ,'" class="button_submit you_sure">
1430
+			<input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" data-confirm="', $txt['pm_labels_delete'], '" class="button_submit you_sure">
1431 1431
 		</div>';
1432 1432
 
1433 1433
 	echo '
@@ -1591,7 +1591,7 @@  discard block
 block discarded – undo
1591 1591
 	if (!empty($context['rules']))
1592 1592
 		echo '
1593 1593
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
1594
-			<input type="submit" name="delselected" value="', $txt['pm_delete_selected_rule'], '" data-confirm="', $txt['pm_js_delete_rule_confirm'] ,'" class="button_submit smalltext you_sure">';
1594
+			<input type="submit" name="delselected" value="', $txt['pm_delete_selected_rule'], '" data-confirm="', $txt['pm_js_delete_rule_confirm'], '" class="button_submit smalltext you_sure">';
1595 1595
 
1596 1596
 	echo '
1597 1597
 		</div>
@@ -1832,9 +1832,9 @@  discard block
 block discarded – undo
1832 1832
 
1833 1833
 		echo '
1834 1834
 				<select name="acttype[', $k, ']" id="acttype', $k, '" onchange="updateActionDef(', $k, '); rebuildRuleDesc();">
1835
-					<option value="">', $txt['pm_rule_sel_action'] , ':</option>
1836
-					<option value="lab"', $action['t'] == 'lab' ? ' selected' : '', '>', $txt['pm_rule_label'] , '</option>
1837
-					<option value="del"', $action['t'] == 'del' ? ' selected' : '', '>', $txt['pm_rule_delete'] , '</option>
1835
+					<option value="">', $txt['pm_rule_sel_action'], ':</option>
1836
+					<option value="lab"', $action['t'] == 'lab' ? ' selected' : '', '>', $txt['pm_rule_label'], '</option>
1837
+					<option value="del"', $action['t'] == 'del' ? ' selected' : '', '>', $txt['pm_rule_delete'], '</option>
1838 1838
 				</select>
1839 1839
 				<span id="labdiv', $k, '">
1840 1840
 					<select name="labdef[', $k, ']" id="labdef', $k, '" onchange="rebuildRuleDesc();">
@@ -1951,7 +1951,7 @@  discard block
 block discarded – undo
1951 1951
 					</div>
1952 1952
 					<ul class="quickbuttons">
1953 1953
 						<li><a href="', $scripturl, '?action=pm;sa=showpmdrafts;id_draft=', $draft['id_draft'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons modifybutton"></span>', $txt['draft_edit'], '</a></li>
1954
-						<li><a href="', $scripturl, '?action=pm;sa=showpmdrafts;delete=', $draft['id_draft'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['draft_remove'] ,'?" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['draft_delete'], '</a></li>
1954
+						<li><a href="', $scripturl, '?action=pm;sa=showpmdrafts;delete=', $draft['id_draft'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['draft_remove'], '?" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['draft_delete'], '</a></li>
1955 1955
 					</ul>
1956 1956
 				</div>';
1957 1957
 		}
Please login to merge, or discard this patch.
Braces   +262 added lines, -181 removed lines patch added patch discarded remove patch
@@ -21,8 +21,8 @@  discard block
 block discarded – undo
21 21
 	<div id="personal_messages">';
22 22
 
23 23
 	// Show the capacity bar, if available.
24
-	if (!empty($context['limit_bar']))
25
-		echo '
24
+	if (!empty($context['limit_bar'])) {
25
+			echo '
26 26
 		<div class="cat_bar">
27 27
 			<h3 class="catbg">
28 28
 				<span class="floatleft">', $txt['pm_capacity'], ':</span>
@@ -32,14 +32,16 @@  discard block
 block discarded – undo
32 32
 				<span class="floatright', $context['limit_bar']['percent'] > 90 ? ' alert' : '', '">', $context['limit_bar']['text'], '</span>
33 33
 			</h3>
34 34
 		</div>';
35
+	}
35 36
 
36 37
 	// Message sent? Show a small indication.
37
-	if (isset($context['pm_sent']))
38
-		echo '
38
+	if (isset($context['pm_sent'])) {
39
+			echo '
39 40
 		<div class="infobox">
40 41
 			', $txt['pm_sent'], '
41 42
 		</div>';
42
-}
43
+	}
44
+	}
43 45
 
44 46
 /**
45 47
  * Just the end of the index bar, nothing special.
@@ -72,8 +74,7 @@  discard block
 block discarded – undo
72 74
 	{
73 75
 		echo '
74 76
 			<div class="no_unread">', $txt['pm_no_unread'], '</div>';
75
-	}
76
-	else
77
+	} else
77 78
 	{
78 79
 		foreach ($context['unread_pms'] as $id_pm => $pm_details)
79 80
 		{
@@ -193,14 +194,15 @@  discard block
 block discarded – undo
193 194
 	if ($context['get_pmessage']('message', true))
194 195
 	{
195 196
 		// Show the helpful titlebar - generally.
196
-		if ($context['display_mode'] != 1)
197
-			echo '
197
+		if ($context['display_mode'] != 1) {
198
+					echo '
198 199
 				<div class="cat_bar">
199 200
 					<h3 class="catbg">
200 201
 						<span id="author">', $txt['author'], '</span>
201 202
 						<span id="topic_title">', $txt[$context['display_mode'] == 0 ? 'messages' : 'conversation'], '</span>
202 203
 					</h3>
203 204
 				</div>';
205
+		}
204 206
 
205 207
 		// Show a few buttons if we are in conversation mode and outputting the first message.
206 208
 		if ($context['display_mode'] == 2)
@@ -229,9 +231,10 @@  discard block
 block discarded – undo
229 231
 			<div class="custom_fields_above_member">
230 232
 				<ul class="nolist">';
231 233
 
232
-			foreach ($message['custom_fields']['above_member'] as $custom)
233
-				echo '
234
+			foreach ($message['custom_fields']['above_member'] as $custom) {
235
+							echo '
234 236
 					<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
237
+			}
235 238
 
236 239
 			echo '
237 240
 				</ul>
@@ -243,9 +246,10 @@  discard block
 block discarded – undo
243 246
 				<a id="msg', $message['id'], '"></a>';
244 247
 
245 248
 		// Show online and offline buttons?
246
-		if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest'])
247
-			echo '
249
+		if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest']) {
250
+					echo '
248 251
 				<span class="' . ($message['member']['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $message['member']['online']['text'] . '"></span>';
252
+		}
249 253
 
250 254
 		// Show a link to the member's profile (but only if the sender isn't a guest).
251 255
 				echo '
@@ -258,48 +262,56 @@  discard block
 block discarded – undo
258 262
 			<ul class="user_info">';
259 263
 
260 264
 			// Show the user's avatar.
261
-			if (!empty($modSettings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image']))
262
-				echo '
265
+			if (!empty($modSettings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image'])) {
266
+							echo '
263 267
 				<li class="avatar">
264 268
 					<a href="', $scripturl, '?action=profile;u=', $message['member']['id'], '">', $message['member']['avatar']['image'], '</a>
265 269
 				</li>';
270
+			}
266 271
 
267 272
 		// Are there any custom fields below the avatar?
268
-		if (!empty($message['custom_fields']['below_avatar']))
269
-			foreach ($message['custom_fields']['below_avatar'] as $custom)
273
+		if (!empty($message['custom_fields']['below_avatar'])) {
274
+					foreach ($message['custom_fields']['below_avatar'] as $custom)
270 275
 				echo '
271 276
 				<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
277
+		}
272 278
 
273
-			if (!$message['member']['is_guest'])
274
-				echo '
279
+			if (!$message['member']['is_guest']) {
280
+							echo '
275 281
 				<li class="icons">', $message['member']['group_icons'], '</li>';
282
+			}
276 283
 			// Show the member's primary group (like 'Administrator') if they have one.
277
-			if (isset($message['member']['group']) && $message['member']['group'] != '')
278
-				echo '
284
+			if (isset($message['member']['group']) && $message['member']['group'] != '') {
285
+							echo '
279 286
 				<li class="membergroup">', $message['member']['group'], '</li>';
287
+			}
280 288
 
281 289
 			// Show the member's custom title, if they have one.
282
-			if (isset($message['member']['title']) && $message['member']['title'] != '')
283
-				echo '
290
+			if (isset($message['member']['title']) && $message['member']['title'] != '') {
291
+							echo '
284 292
 				<li class="title">', $message['member']['title'], '</li>';
293
+			}
285 294
 
286 295
 			// Don't show these things for guests.
287 296
 			if (!$message['member']['is_guest'])
288 297
 			{
289 298
 				// Show the post group if and only if they have no other group or the option is on, and they are in a post group.
290
-				if ((empty($modSettings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '')
291
-					echo '
299
+				if ((empty($modSettings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '') {
300
+									echo '
292 301
 				<li class="postgroup">', $message['member']['post_group'], '</li>';
302
+				}
293 303
 
294 304
 				// Show how many posts they have made.
295
-				if (!isset($context['disabled_fields']['posts']))
296
-					echo '
305
+				if (!isset($context['disabled_fields']['posts'])) {
306
+									echo '
297 307
 				<li class="postcount">', $txt['member_postcount'], ': ', $message['member']['posts'], '</li>';
308
+				}
298 309
 
299 310
 				// Show their personal text?
300
-				if (!empty($modSettings['show_blurb']) && $message['member']['blurb'] != '')
301
-					echo '
311
+				if (!empty($modSettings['show_blurb']) && $message['member']['blurb'] != '') {
312
+									echo '
302 313
 				<li class="blurb">', $message['member']['blurb'], '</li>';
314
+				}
303 315
 
304 316
 				// Any custom fields to show as icons?
305 317
 				if (!empty($message['custom_fields']['icons']))
@@ -308,9 +320,10 @@  discard block
 block discarded – undo
308 320
 				<li class="im_icons">
309 321
 					<ol>';
310 322
 
311
-					foreach ($message['custom_fields']['icons'] as $custom)
312
-						echo '
323
+					foreach ($message['custom_fields']['icons'] as $custom) {
324
+											echo '
313 325
 						<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
326
+					}
314 327
 
315 328
 					echo '
316 329
 					</ol>
@@ -318,19 +331,22 @@  discard block
 block discarded – undo
318 331
 				}
319 332
 
320 333
 		// Show the IP to this user for this post - because you can moderate?
321
-		if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip']))
322
-			echo '
334
+		if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip'])) {
335
+					echo '
323 336
 				<li class="poster_ip"><a href="', $scripturl, '?action=', !empty($message['member']['is_guest']) ? 'trackip' : 'profile;area=tracking;sa=ip;u=' . $message['member']['id'], ';searchip=', $message['member']['ip'], '">', $message['member']['ip'], '</a> <a href="', $scripturl, '?action=helpadmin;help=see_admin_ip" onclick="return reqOverlayDiv(this.href);" class="help">(?)</a></li>';
337
+		}
324 338
 
325 339
 		// Or, should we show it because this is you?
326
-		elseif ($message['can_see_ip'])
327
-			echo '
340
+		elseif ($message['can_see_ip']) {
341
+					echo '
328 342
 				<li class="poster_ip"><a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help">', $message['member']['ip'], '</a></li>';
343
+		}
329 344
 
330 345
 		// Okay, you are logged in, then we can show something about why IPs are logged...
331
-		else
332
-			echo '
346
+		else {
347
+					echo '
333 348
 				<li class="poster_ip"><a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help">', $txt['logged'], '</a></li>';
349
+		}
334 350
 
335 351
 				// Show the profile, website, email address, and personal message buttons.
336 352
 				if ($message['member']['show_profile_buttons'])
@@ -340,24 +356,28 @@  discard block
 block discarded – undo
340 356
 					<ol class="profile_icons">';
341 357
 
342 358
 					// Show the profile button
343
-					if ($message['member']['can_view_profile'])
344
-						echo '
359
+					if ($message['member']['can_view_profile']) {
360
+											echo '
345 361
 						<li><a href="', $message['member']['href'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/icons/profile_sm.png" alt="' . $txt['view_profile'] . '" title="' . $txt['view_profile'] . '">' : $txt['view_profile']), '</a></li>';
362
+					}
346 363
 
347 364
 					// Don't show an icon if they haven't specified a website.
348
-					if ($message['member']['website']['url'] != '' && !isset($context['disabled_fields']['website']))
349
-						echo '
365
+					if ($message['member']['website']['url'] != '' && !isset($context['disabled_fields']['website'])) {
366
+											echo '
350 367
 						<li><a href="', $message['member']['website']['url'], '" title="' . $message['member']['website']['title'] . '" target="_blank" class="new_win">', ($settings['use_image_buttons'] ? '<span class="generic_icons www centericon" title="' . $message['member']['website']['title'] . '"></span>' : $txt['www']), '</a></li>';
368
+					}
351 369
 
352 370
 					// Don't show the email address if they want it hidden.
353
-					if ($message['member']['show_email'])
354
-						echo '
371
+					if ($message['member']['show_email']) {
372
+											echo '
355 373
 						<li><a href="mailto:', $message['member']['email'], '" rel="nofollow">', ($settings['use_image_buttons'] ? '<span class="generic_icons mail centericon" title="' . $txt['email'] . '"></span>' : $txt['email']), '</a></li>';
374
+					}
356 375
 
357 376
 					// Since we know this person isn't a guest, you *can* message them.
358
-					if ($context['can_send_pm'])
359
-						echo '
377
+					if ($context['can_send_pm']) {
378
+											echo '
360 379
 						<li><a href="', $scripturl, '?action=pm;sa=send;u=', $message['member']['id'], '" title="', $message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline'], '">', $settings['use_image_buttons'] ? '<span class="generic_icons im_' . ($message['member']['online']['is_online'] ? 'on' : 'off') . ' centericon" title="' . ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']) . '"></span> ' : ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']), '</a></li>';
380
+					}
361 381
 
362 382
 					echo '
363 383
 					</ol>
@@ -365,21 +385,24 @@  discard block
 block discarded – undo
365 385
 				}
366 386
 
367 387
 				// Any custom fields for standard placement?
368
-				if (!empty($message['custom_fields']['standard']))
369
-					foreach ($message['custom_fields']['standard'] as $custom)
388
+				if (!empty($message['custom_fields']['standard'])) {
389
+									foreach ($message['custom_fields']['standard'] as $custom)
370 390
 						echo '
371 391
 				<li class="custom ', $custom['col_name'] ,'">', $custom['title'], ': ', $custom['value'], '</li>';
392
+				}
372 393
 
373 394
 				// Are we showing the warning status?
374
-				if ($message['member']['can_see_warning'])
375
-					echo '
395
+				if ($message['member']['can_see_warning']) {
396
+									echo '
376 397
 				<li class="warning">', $context['can_issue_warning'] ? '<a href="' . $scripturl . '?action=profile;area=issuewarning;u=' . $message['member']['id'] . '">' : '', '<span class="generic_icons warning_', $message['member']['warning_status'], '"></span>', $context['can_issue_warning'] ? '</a>' : '', '<span class="warn_', $message['member']['warning_status'], '">', $txt['warn_' . $message['member']['warning_status']], '</span></li>';
398
+				}
377 399
 
378 400
 				// Are there any custom fields to show at the bottom of the poster info?
379
-				if (!empty($message['custom_fields']['bottom_poster']))
380
-					foreach ($message['custom_fields']['bottom_poster'] as $custom)
401
+				if (!empty($message['custom_fields']['bottom_poster'])) {
402
+									foreach ($message['custom_fields']['bottom_poster'] as $custom)
381 403
 						echo '
382 404
 				<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
405
+				}
383 406
 			}
384 407
 
385 408
 			// Done with the information about the poster... on to the post itself.
@@ -398,25 +421,29 @@  discard block
 block discarded – undo
398 421
 					<span class="smalltext">&#171; <strong> ', $txt['sent_to'], ':</strong> ';
399 422
 
400 423
 			// People it was sent directly to....
401
-			if (!empty($message['recipients']['to']))
402
-				echo implode(', ', $message['recipients']['to']);
424
+			if (!empty($message['recipients']['to'])) {
425
+							echo implode(', ', $message['recipients']['to']);
426
+			}
403 427
 			// Otherwise, we're just going to say "some people"...
404
-			elseif ($context['folder'] != 'sent')
405
-				echo '(', $txt['pm_undisclosed_recipients'], ')';
428
+			elseif ($context['folder'] != 'sent') {
429
+							echo '(', $txt['pm_undisclosed_recipients'], ')';
430
+			}
406 431
 
407 432
 			echo '
408 433
 						<strong> ', $txt['on'], ':</strong> ', $message['time'], ' &#187;
409 434
 					</span>';
410 435
 
411 436
 			// If we're in the sent items, show who it was sent to besides the "To:" people.
412
-			if (!empty($message['recipients']['bcc']))
413
-				echo '
437
+			if (!empty($message['recipients']['bcc'])) {
438
+							echo '
414 439
 					<br><span class="smalltext">&#171; <strong> ', $txt['pm_bcc'], ':</strong> ', implode(', ', $message['recipients']['bcc']), ' &#187;</span>';
440
+			}
415 441
 
416
-			if (!empty($message['is_replied_to']))
417
-				echo '
442
+			if (!empty($message['is_replied_to'])) {
443
+							echo '
418 444
 					<br><span class="smalltext">&#171; ', $txt['pm_is_replied_to'], ' &#187;</span>
419 445
 					<br><span class="smalltext">&#171; ', $context['folder'] == 'sent' ? $txt['pm_sent_is_replied_to'] : $txt['pm_is_replied_to'], ' &#187;</span>';
446
+			}
420 447
 
421 448
 			echo '
422 449
 				</div>
@@ -424,13 +451,15 @@  discard block
 block discarded – undo
424 451
 			<div class="post">
425 452
 				<div class="inner" id="msg_', $message['id'], '"', '>', $message['body'], '</div>';
426 453
 
427
-			if ($message['can_report'] || $context['can_send_pm'])
428
-			echo '
454
+			if ($message['can_report'] || $context['can_send_pm']) {
455
+						echo '
429 456
 				<div class="under_message">';
457
+			}
430 458
 
431
-				if ($message['can_report'])
432
-				echo '
459
+				if ($message['can_report']) {
460
+								echo '
433 461
 					<a href="' . $scripturl . '?action=pm;sa=report;l=' . $context['current_label_id'] . ';pmsg=' . $message['id'] . '" class="floatright">' . $txt['pm_report_to_admin'] . '</a>';
462
+				}
434 463
 
435 464
 				echo '
436 465
 					<ul class="quickbuttons">';
@@ -442,32 +471,36 @@  discard block
 block discarded – undo
442 471
 					if (!$message['member']['is_guest'])
443 472
 					{
444 473
 						// Is there than more than one recipient you can reply to?
445
-						if ($message['number_recipients'] > 1)
446
-							echo '
474
+						if ($message['number_recipients'] > 1) {
475
+													echo '
447 476
 						<li><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=all"><span class="generic_icons reply_all_button"></span>', $txt['reply_to_all'], '</a></li>';
477
+						}
448 478
 
449 479
 						echo '
450 480
 						<li><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';u=', $message['member']['id'], '"><span class="generic_icons reply_button"></span>', $txt['reply'], '</a></li>
451 481
 						<li><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote', $context['folder'] == 'sent' ? '' : ';u=' . $message['member']['id'], '"><span class="generic_icons quote"></span>', $txt['quote_action'], '</a></li>';
452 482
 					}
453 483
 					// This is for "forwarding" - even if the member is gone.
454
-					else
455
-						echo '
484
+					else {
485
+											echo '
456 486
 						<li><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote"><span class="generic_icons quote"></span>', $txt['reply_quote'], '</a></li>';
487
+					}
457 488
 				}
458 489
 				echo '
459 490
 						<li><a href="', $scripturl, '?action=pm;sa=pmactions;pm_actions%5b', $message['id'], '%5D=delete;f=', $context['folder'], ';start=', $context['start'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', addslashes($txt['remove_message_question']), '" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['delete'], '</a></li>';
460 491
 
461
-				if (empty($context['display_mode']))
462
-					echo '
492
+				if (empty($context['display_mode'])) {
493
+									echo '
463 494
 						<li><input type="checkbox" name="pms[]" id="deletedisplay', $message['id'], '" value="', $message['id'], '" onclick="document.getElementById(\'deletelisting', $message['id'], '\').checked = this.checked;" class="input_check"></li>';
495
+				}
464 496
 
465 497
 				echo '
466 498
 					</ul>';
467 499
 
468
-			if ($message['can_report'] || $context['can_send_pm'])
469
-			echo '
500
+			if ($message['can_report'] || $context['can_send_pm']) {
501
+						echo '
470 502
 				</div>';
503
+			}
471 504
 
472 505
 			// Are there any custom profile fields for above the signature?
473 506
 			if (!empty($message['custom_fields']['above_signature']))
@@ -476,9 +509,10 @@  discard block
 block discarded – undo
476 509
 					<div class="custom_fields_above_signature">
477 510
 						<ul class="nolist">';
478 511
 
479
-				foreach ($message['custom_fields']['above_signature'] as $custom)
480
-					echo '
512
+				foreach ($message['custom_fields']['above_signature'] as $custom) {
513
+									echo '
481 514
 							<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
515
+				}
482 516
 
483 517
 				echo '
484 518
 						</ul>
@@ -486,9 +520,10 @@  discard block
 block discarded – undo
486 520
 			}
487 521
 
488 522
 			// Show the member's signature?
489
-			if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled'])
490
-				echo '
523
+			if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled']) {
524
+							echo '
491 525
 				<div class="signature">', $message['member']['signature'], '</div>';
526
+			}
492 527
 
493 528
 			// Are there any custom profile fields for below the signature?
494 529
 			if (!empty($message['custom_fields']['below_signature']))
@@ -497,9 +532,10 @@  discard block
 block discarded – undo
497 532
 					<div class="custom_fields_below_signature">
498 533
 						<ul class="nolist">';
499 534
 
500
-				foreach ($message['custom_fields']['below_signature'] as $custom)
501
-					echo '
535
+				foreach ($message['custom_fields']['below_signature'] as $custom) {
536
+									echo '
502 537
 							<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
538
+				}
503 539
 
504 540
 				echo '
505 541
 						</ul>
@@ -524,19 +560,21 @@  discard block
 block discarded – undo
524 560
 					{
525 561
 						echo '
526 562
 						<option value="" disabled>', $txt['pm_msg_label_apply'], ':</option>';
527
-						foreach ($context['labels'] as $label)
528
-							if (!isset($message['labels'][$label['id']]))
563
+						foreach ($context['labels'] as $label) {
564
+													if (!isset($message['labels'][$label['id']]))
529 565
 								echo '
530 566
 							<option value="', $label['id'], '">&nbsp;', $label['name'], '</option>';
567
+						}
531 568
 					}
532 569
 					// ... and are there any that can be removed?
533 570
 					if (!empty($message['labels']) && (count($message['labels']) > 1 || !isset($message['labels'][-1])))
534 571
 					{
535 572
 						echo '
536 573
 						<option value="" disabled>', $txt['pm_msg_label_remove'], ':</option>';
537
-						foreach ($message['labels'] as $label)
538
-							echo '
574
+						foreach ($message['labels'] as $label) {
575
+													echo '
539 576
 							<option value="', $label['id'], '">&nbsp;', $label['name'], '</option>';
577
+						}
540 578
 					}
541 579
 					echo '
542 580
 					</select>
@@ -556,13 +594,14 @@  discard block
 block discarded – undo
556 594
 	</div>';
557 595
 		}
558 596
 
559
-		if (empty($context['display_mode']))
560
-			echo '
597
+		if (empty($context['display_mode'])) {
598
+					echo '
561 599
 
562 600
 	<div class="pagesection">
563 601
 		<div class="floatleft">', $context['page_index'], '</div>
564 602
 		<div class="floatright"><input type="submit" name="del_selected" value="', $txt['quickmod_delete_selected'], '" style="font-weight: normal;" onclick="if (!confirm(\'', $txt['delete_selected_confirm'], '\')) return false;" class="button_submit"></div>
565 603
 	</div>';
604
+		}
566 605
 
567 606
 		// Show a few buttons if we are in conversation mode and outputting the first message.
568 607
 		elseif ($context['display_mode'] == 2 && isset($context['conversation_buttons']))
@@ -622,11 +661,12 @@  discard block
 block discarded – undo
622 661
 		</tr>
623 662
 	</thead>
624 663
 	<tbody>';
625
-	if (!$context['show_delete'])
626
-		echo '
664
+	if (!$context['show_delete']) {
665
+			echo '
627 666
 		<tr class="windowbg">
628 667
 			<td colspan="5">', $txt['pm_alert_none'], '</td>
629 668
 		</tr>';
669
+	}
630 670
 
631 671
 	while ($message = $context['get_pmessage']('subject'))
632 672
 	{
@@ -679,9 +719,10 @@  discard block
 block discarded – undo
679 719
 
680 720
 			foreach ($context['labels'] as $label)
681 721
 			{
682
-				if ($label['id'] != $context['current_label_id'])
683
-					echo '
722
+				if ($label['id'] != $context['current_label_id']) {
723
+									echo '
684 724
 					<option value="add_', $label['id'], '">&nbsp;', $label['name'], '</option>';
725
+				}
685 726
 			}
686 727
 
687 728
 			echo '
@@ -766,9 +807,10 @@  discard block
 block discarded – undo
766 807
 					<dt class="between">', $txt['pm_search_post_age'], ':</dt>
767 808
 					<dd>', $txt['pm_search_between'], ' <input type="number" name="minage" value="', empty($context['search_params']['minage']) ? '0' : $context['search_params']['minage'], '" size="5" maxlength="5" class="input_text" min="0" max="9999">&nbsp;', $txt['pm_search_between_and'], '&nbsp;<input type="number" name="maxage" value="', empty($context['search_params']['maxage']) ? '9999' : $context['search_params']['maxage'], '" size="5" maxlength="5" class="input_text" min="0" max="9999"> ', $txt['pm_search_between_days'], '</dd>
768 809
 				</dl>';
769
-	if (!$context['currently_using_labels'])
770
-		echo '
810
+	if (!$context['currently_using_labels']) {
811
+			echo '
771 812
 				<input type="submit" name="pm_search" value="', $txt['pm_search_go'], '" class="button_submit">';
813
+	}
772 814
 		echo '
773 815
 				<br class="clear_right">
774 816
 			</div>
@@ -788,12 +830,13 @@  discard block
 block discarded – undo
788 830
 				<div id="advanced_panel_div">
789 831
 					<ul id="searchLabelsExpand">';
790 832
 
791
-		foreach ($context['search_labels'] as $label)
792
-			echo '
833
+		foreach ($context['search_labels'] as $label) {
834
+					echo '
793 835
 						<li>
794 836
 							<label for="searchlabel_', $label['id'], '"><input type="checkbox" id="searchlabel_', $label['id'], '" name="searchlabel[', $label['id'], ']" value="', $label['id'], '"', $label['checked'] ? ' checked' : '', ' class="input_check">
795 837
 							', $label['name'], '</label>
796 838
 						</li>';
839
+		}
797 840
 
798 841
 		echo '
799 842
 					</ul>
@@ -853,8 +896,8 @@  discard block
 block discarded – undo
853 896
 		</div>';
854 897
 
855 898
 	// complete results ?
856
-	if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages']))
857
-		echo '
899
+	if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages'])) {
900
+			echo '
858 901
 	<table class="table_grid">
859 902
 	<thead>
860 903
 		<tr class="title_bar">
@@ -864,6 +907,7 @@  discard block
 block discarded – undo
864 907
 		</tr>
865 908
 	</thead>
866 909
 	<tbody>';
910
+	}
867 911
 
868 912
 	// Print each message out...
869 913
 	foreach ($context['personal_messages'] as $message)
@@ -883,11 +927,13 @@  discard block
 block discarded – undo
883 927
 
884 928
 				// Show the recipients.
885 929
 				// @todo This doesn't deal with the sent item searching quite right for bcc.
886
-				if (!empty($message['recipients']['to']))
887
-					echo implode(', ', $message['recipients']['to']);
930
+				if (!empty($message['recipients']['to'])) {
931
+									echo implode(', ', $message['recipients']['to']);
932
+				}
888 933
 				// Otherwise, we're just going to say "some people"...
889
-				elseif ($context['folder'] != 'sent')
890
-					echo '(', $txt['pm_undisclosed_recipients'], ')';
934
+				elseif ($context['folder'] != 'sent') {
935
+									echo '(', $txt['pm_undisclosed_recipients'], ')';
936
+				}
891 937
 
892 938
 					echo '
893 939
 				</h3>
@@ -901,14 +947,16 @@  discard block
 block discarded – undo
901 947
 					$quote_button = create_button('quote.png', 'reply_quote', 'reply_quote', 'class="centericon"');
902 948
 					$reply_button = create_button('im_reply.png', 'reply', 'reply', 'class="centericon"');
903 949
 					// You can only reply if they are not a guest...
904
-					if (!$message['member']['is_guest'])
905
-						echo '
950
+					if (!$message['member']['is_guest']) {
951
+											echo '
906 952
 							<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=', $context['folder'] == 'sent' ? '' : $message['member']['id'], '">', $quote_button , '</a>', $context['menu_separator'], '
907 953
 							<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';u=', $message['member']['id'], '">', $reply_button , '</a> ', $context['menu_separator'];
954
+					}
908 955
 					// This is for "forwarding" - even if the member is gone.
909
-					else
910
-						echo '
956
+					else {
957
+											echo '
911 958
 							<a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote">', $quote_button , '</a>', $context['menu_separator'];
959
+					}
912 960
 				}
913 961
 
914 962
 				echo '
@@ -929,17 +977,19 @@  discard block
 block discarded – undo
929 977
 	}
930 978
 
931 979
 	// Finish off the page...
932
-	if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages']))
933
-		echo '
980
+	if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages'])) {
981
+			echo '
934 982
 		</tbody>
935 983
 		</table>';
984
+	}
936 985
 
937 986
 	// No results?
938
-	if (empty($context['personal_messages']))
939
-		echo '
987
+	if (empty($context['personal_messages'])) {
988
+			echo '
940 989
 		<div class="windowbg">
941 990
 			<p class="centertext">', $txt['pm_search_none_found'], '</p>
942 991
 		</div>';
992
+	}
943 993
 
944 994
 	echo '
945 995
 		<div class="pagesection">
@@ -963,12 +1013,14 @@  discard block
 block discarded – undo
963 1013
 				<h3 class="catbg">', $txt['pm_send_report'], '</h3>
964 1014
 			</div>
965 1015
 			<div class="windowbg">';
966
-				if (!empty($context['send_log']['sent']))
967
-					foreach ($context['send_log']['sent'] as $log_entry)
1016
+				if (!empty($context['send_log']['sent'])) {
1017
+									foreach ($context['send_log']['sent'] as $log_entry)
968 1018
 						echo '<span class="error">', $log_entry, '</span><br>';
969
-				if (!empty($context['send_log']['failed']))
970
-					foreach ($context['send_log']['failed'] as $log_entry)
1019
+				}
1020
+				if (!empty($context['send_log']['failed'])) {
1021
+									foreach ($context['send_log']['failed'] as $log_entry)
971 1022
 						echo '<span class="error">', $log_entry, '</span><br>';
1023
+				}
972 1024
 				echo '
973 1025
 			</div>
974 1026
 			<br>';
@@ -1016,12 +1068,13 @@  discard block
 block discarded – undo
1016 1068
 				</dl>
1017 1069
 			</div>';
1018 1070
 
1019
-	if (!empty($modSettings['drafts_pm_enabled']))
1020
-		echo '
1071
+	if (!empty($modSettings['drafts_pm_enabled'])) {
1072
+			echo '
1021 1073
 			<div id="draft_section" class="infobox"', isset($context['draft_saved']) ? '' : ' style="display: none;"', '>',
1022 1074
 				sprintf($txt['draft_pm_saved'], $scripturl . '?action=pm;sa=showpmdrafts'), '
1023 1075
 				', (!empty($modSettings['drafts_keep_days']) ? ' <strong>' . sprintf($txt['draft_save_warning'], $modSettings['drafts_keep_days']) . '</strong>' : ''), '
1024 1076
 			</div>';
1077
+	}
1025 1078
 
1026 1079
 	echo '
1027 1080
 			<dl id="post_header">';
@@ -1076,9 +1129,10 @@  discard block
 block discarded – undo
1076 1129
 	}
1077 1130
 
1078 1131
 	// What about smileys?
1079
-	if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup']))
1080
-		echo '
1132
+	if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup'])) {
1133
+			echo '
1081 1134
 			<div id="smileyBox_message"></div>';
1135
+	}
1082 1136
 
1083 1137
 	// Show BBC buttons, smileys and textbox.
1084 1138
 	echo '
@@ -1125,10 +1179,11 @@  discard block
 block discarded – undo
1125 1179
 					<dt><strong>', $txt['subject'], '</strong></dt>
1126 1180
 					<dd><strong>', $txt['draft_saved_on'], '</strong></dd>';
1127 1181
 
1128
-		foreach ($context['drafts'] as $draft)
1129
-			echo '
1182
+		foreach ($context['drafts'] as $draft) {
1183
+					echo '
1130 1184
 					<dt>', $draft['link'], '</dt>
1131 1185
 					<dd>', $draft['poster_time'], '</dd>';
1186
+		}
1132 1187
 		echo '
1133 1188
 				</dl>
1134 1189
 			</div>';
@@ -1234,8 +1289,8 @@  discard block
 block discarded – undo
1234 1289
 			}';
1235 1290
 
1236 1291
 	// Code for showing and hiding drafts
1237
-	if (!empty($context['drafts']))
1238
-		echo '
1292
+	if (!empty($context['drafts'])) {
1293
+			echo '
1239 1294
 			var oSwapDraftOptions = new smc_Toggle({
1240 1295
 				bToggleEnabled: true,
1241 1296
 				bCurrentlyCollapsed: true,
@@ -1257,13 +1312,14 @@  discard block
 block discarded – undo
1257 1312
 					}
1258 1313
 				]
1259 1314
 			});';
1315
+	}
1260 1316
 
1261 1317
 	echo '
1262 1318
 		</script>';
1263 1319
 
1264 1320
 	// Show the message you're replying to.
1265
-	if ($context['reply'])
1266
-		echo '
1321
+	if ($context['reply']) {
1322
+			echo '
1267 1323
 	<br>
1268 1324
 	<br>
1269 1325
 	<div class="cat_bar">
@@ -1277,6 +1333,7 @@  discard block
 block discarded – undo
1277 1333
 		<hr>
1278 1334
 		', $context['quoted_message']['body'], '
1279 1335
 	</div><br class="clear">';
1336
+	}
1280 1337
 
1281 1338
 	echo '
1282 1339
 		<script>
@@ -1287,22 +1344,24 @@  discard block
 block discarded – undo
1287 1344
 				sTextDeleteItem: \'', $txt['autosuggest_delete_item'], '\',
1288 1345
 				sToControlId: \'to_control\',
1289 1346
 				aToRecipients: [';
1290
-	foreach ($context['recipients']['to'] as $i => $member)
1291
-		echo '
1347
+	foreach ($context['recipients']['to'] as $i => $member) {
1348
+			echo '
1292 1349
 					{
1293 1350
 						sItemId: ', JavaScriptEscape($member['id']), ',
1294 1351
 						sItemName: ', JavaScriptEscape($member['name']), '
1295 1352
 					}', $i == count($context['recipients']['to']) - 1 ? '' : ',';
1353
+	}
1296 1354
 
1297 1355
 	echo '
1298 1356
 				],
1299 1357
 				aBccRecipients: [';
1300
-	foreach ($context['recipients']['bcc'] as $i => $member)
1301
-		echo '
1358
+	foreach ($context['recipients']['bcc'] as $i => $member) {
1359
+			echo '
1302 1360
 					{
1303 1361
 						sItemId: ', JavaScriptEscape($member['id']), ',
1304 1362
 						sItemName: ', JavaScriptEscape($member['name']), '
1305 1363
 					}', $i == count($context['recipients']['bcc']) - 1 ? '' : ',';
1364
+	}
1306 1365
 
1307 1366
 	echo '
1308 1367
 				],
@@ -1389,26 +1448,28 @@  discard block
 block discarded – undo
1389 1448
 				</th>
1390 1449
 				<th class="centertext table_icon">';
1391 1450
 
1392
-	if (count($context['labels']) > 2)
1393
-		echo '
1451
+	if (count($context['labels']) > 2) {
1452
+			echo '
1394 1453
 					<input type="checkbox" class="input_check" onclick="invertAll(this, this.form);">';
1454
+	}
1395 1455
 
1396 1456
 	echo '
1397 1457
 				</th>
1398 1458
 			</tr>
1399 1459
 		</thead>
1400 1460
 		<tbody>';
1401
-	if (count($context['labels']) < 2)
1402
-		echo '
1461
+	if (count($context['labels']) < 2) {
1462
+			echo '
1403 1463
 			<tr class="windowbg">
1404 1464
 				<td colspan="2">', $txt['pm_labels_no_exist'], '</td>
1405 1465
 			</tr>';
1406
-	else
1466
+	} else
1407 1467
 	{
1408 1468
 		foreach ($context['labels'] as $label)
1409 1469
 		{
1410
-			if ($label['id'] == -1)
1411
-				continue;
1470
+			if ($label['id'] == -1) {
1471
+							continue;
1472
+			}
1412 1473
 
1413 1474
 				echo '
1414 1475
 			<tr class="windowbg">
@@ -1423,12 +1484,13 @@  discard block
 block discarded – undo
1423 1484
 		</tbody>
1424 1485
 		</table>';
1425 1486
 
1426
-	if (!count($context['labels']) < 2)
1427
-		echo '
1487
+	if (!count($context['labels']) < 2) {
1488
+			echo '
1428 1489
 		<div class="padding">
1429 1490
 			<input type="submit" name="save" value="', $txt['save'], '" class="button_submit">
1430 1491
 			<input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" data-confirm="', $txt['pm_labels_delete'] ,'" class="button_submit you_sure">
1431 1492
 		</div>';
1493
+	}
1432 1494
 
1433 1495
 	echo '
1434 1496
 		<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -1483,9 +1545,10 @@  discard block
 block discarded – undo
1483 1545
 				<dd>
1484 1546
 					<select name="id_admin">
1485 1547
 						<option value="0">', $txt['pm_report_all_admins'], '</option>';
1486
-		foreach ($context['admins'] as $id => $name)
1487
-			echo '
1548
+		foreach ($context['admins'] as $id => $name) {
1549
+					echo '
1488 1550
 						<option value="', $id, '">', $name, '</option>';
1551
+		}
1489 1552
 		echo '
1490 1553
 					</select>
1491 1554
 				</dd>';
@@ -1547,9 +1610,10 @@  discard block
 block discarded – undo
1547 1610
 				</th>
1548 1611
 				<th class="centertext table_icon">';
1549 1612
 
1550
-	if (!empty($context['rules']))
1551
-		echo '
1613
+	if (!empty($context['rules'])) {
1614
+			echo '
1552 1615
 					<input type="checkbox" onclick="invertAll(this, this.form);" class="input_check">';
1616
+	}
1553 1617
 
1554 1618
 	echo '
1555 1619
 				</th>
@@ -1557,13 +1621,14 @@  discard block
 block discarded – undo
1557 1621
 		</thead>
1558 1622
 		<tbody>';
1559 1623
 
1560
-	if (empty($context['rules']))
1561
-		echo '
1624
+	if (empty($context['rules'])) {
1625
+			echo '
1562 1626
 			<tr class="windowbg">
1563 1627
 				<td colspan="2">
1564 1628
 					', $txt['pm_rules_none'], '
1565 1629
 				</td>
1566 1630
 			</tr>';
1631
+	}
1567 1632
 
1568 1633
 	foreach ($context['rules'] as $rule)
1569 1634
 	{
@@ -1584,14 +1649,16 @@  discard block
 block discarded – undo
1584 1649
 		<div class="righttext">
1585 1650
 			<a class="button_link" href="', $scripturl, '?action=pm;sa=manrules;add;rid=0">', $txt['pm_add_rule'], '</a>';
1586 1651
 
1587
-	if (!empty($context['rules']))
1588
-		echo '
1652
+	if (!empty($context['rules'])) {
1653
+			echo '
1589 1654
 			[<a href="', $scripturl, '?action=pm;sa=manrules;apply;', $context['session_var'], '=', $context['session_id'], '" onclick="return confirm(\'', $txt['pm_js_apply_rules_confirm'], '\');">', $txt['pm_apply_rules'], '</a>]';
1655
+	}
1590 1656
 
1591
-	if (!empty($context['rules']))
1592
-		echo '
1657
+	if (!empty($context['rules'])) {
1658
+			echo '
1593 1659
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
1594 1660
 			<input type="submit" name="delselected" value="', $txt['pm_delete_selected_rule'], '" data-confirm="', $txt['pm_js_delete_rule_confirm'] ,'" class="button_submit smalltext you_sure">';
1661
+	}
1595 1662
 
1596 1663
 	echo '
1597 1664
 		</div>
@@ -1613,14 +1680,16 @@  discard block
 block discarded – undo
1613 1680
 			var groups = new Array()
1614 1681
 			var labels = new Array()';
1615 1682
 
1616
-	foreach ($context['groups'] as $id => $title)
1617
-		echo '
1683
+	foreach ($context['groups'] as $id => $title) {
1684
+			echo '
1618 1685
 			groups[', $id, '] = "', addslashes($title), '";';
1686
+	}
1619 1687
 
1620
-	foreach ($context['labels'] as $label)
1621
-		if ($label['id'] != -1)
1688
+	foreach ($context['labels'] as $label) {
1689
+			if ($label['id'] != -1)
1622 1690
 			echo '
1623 1691
 			labels[', ($label['id']), '] = "', addslashes($label['name']), '";';
1692
+	}
1624 1693
 
1625 1694
 	echo '
1626 1695
 			function addCriteriaOption()
@@ -1635,8 +1704,9 @@  discard block
 block discarded – undo
1635 1704
 
1636 1705
 				setOuterHTML(document.getElementById("criteriaAddHere"), \'<br><select name="ruletype[\' + criteriaNum + \']" id="ruletype\' + criteriaNum + \'" onchange="updateRuleDef(\' + criteriaNum + \'); rebuildRuleDesc();"><option value="">', addslashes($txt['pm_rule_criteria_pick']), ':<\' + \'/option><option value="mid">', addslashes($txt['pm_rule_mid']), '<\' + \'/option><option value="gid">', addslashes($txt['pm_rule_gid']), '<\' + \'/option><option value="sub">', addslashes($txt['pm_rule_sub']), '<\' + \'/option><option value="msg">', addslashes($txt['pm_rule_msg']), '<\' + \'/option><option value="bud">', addslashes($txt['pm_rule_bud']), '<\' + \'/option><\' + \'/select>&nbsp;<span id="defdiv\' + criteriaNum + \'" style="display: none;"><input type="text" name="ruledef[\' + criteriaNum + \']" id="ruledef\' + criteriaNum + \'" onkeyup="rebuildRuleDesc();" value="" class="input_text"><\' + \'/span><span id="defseldiv\' + criteriaNum + \'" style="display: none;"><select name="ruledefgroup[\' + criteriaNum + \']" id="ruledefgroup\' + criteriaNum + \'" onchange="rebuildRuleDesc();"><option value="">', addslashes($txt['pm_rule_sel_group']), '<\' + \'/option>';
1637 1706
 
1638
-	foreach ($context['groups'] as $id => $group)
1639
-		echo '<option value="', $id, '">', strtr($group, array("'" => "\'")), '<\' + \'/option>';
1707
+	foreach ($context['groups'] as $id => $group) {
1708
+			echo '<option value="', $id, '">', strtr($group, array("'" => "\'")), '<\' + \'/option>';
1709
+	}
1640 1710
 
1641 1711
 	echo '<\' + \'/select><\' + \'/span><span id="criteriaAddHere"><\' + \'/span>\');
1642 1712
 			}
@@ -1653,9 +1723,10 @@  discard block
 block discarded – undo
1653 1723
 
1654 1724
 				setOuterHTML(document.getElementById("actionAddHere"), \'<br><select name="acttype[\' + actionNum + \']" id="acttype\' + actionNum + \'" onchange="updateActionDef(\' + actionNum + \'); rebuildRuleDesc();"><option value="">', addslashes($txt['pm_rule_sel_action']), ':<\' + \'/option><option value="lab">', addslashes($txt['pm_rule_label']), '<\' + \'/option><option value="del">', addslashes($txt['pm_rule_delete']), '<\' + \'/option><\' + \'/select>&nbsp;<span id="labdiv\' + actionNum + \'" style="display: none;"><select name="labdef[\' + actionNum + \']" id="labdef\' + actionNum + \'" onchange="rebuildRuleDesc();"><option value="">', addslashes($txt['pm_rule_sel_label']), '<\' + \'/option>';
1655 1725
 
1656
-	foreach ($context['labels'] as $label)
1657
-		if ($label['id'] != -1)
1726
+	foreach ($context['labels'] as $label) {
1727
+			if ($label['id'] != -1)
1658 1728
 			echo '<option value="', ($label['id']), '">', addslashes($label['name']), '<\' + \'/option>';
1729
+	}
1659 1730
 
1660 1731
 	echo '<\' + \'/select><\' + \'/span><span id="actionAddHere"><\' + \'/span>\');
1661 1732
 			}
@@ -1769,18 +1840,20 @@  discard block
 block discarded – undo
1769 1840
 	$isFirst = true;
1770 1841
 	foreach ($context['rule']['criteria'] as $k => $criteria)
1771 1842
 	{
1772
-		if (!$isFirst && $criteria['t'] == '')
1773
-			echo '<div id="removeonjs1">';
1774
-		elseif (!$isFirst)
1775
-			echo '<br>';
1843
+		if (!$isFirst && $criteria['t'] == '') {
1844
+					echo '<div id="removeonjs1">';
1845
+		} elseif (!$isFirst) {
1846
+					echo '<br>';
1847
+		}
1776 1848
 
1777 1849
 		echo '
1778 1850
 				<select name="ruletype[', $k, ']" id="ruletype', $k, '" onchange="updateRuleDef(', $k, '); rebuildRuleDesc();">
1779 1851
 					<option value="">', $txt['pm_rule_criteria_pick'], ':</option>';
1780 1852
 
1781
-		foreach (array('mid', 'gid', 'sub', 'msg', 'bud') as $cr)
1782
-			echo '
1853
+		foreach (array('mid', 'gid', 'sub', 'msg', 'bud') as $cr) {
1854
+					echo '
1783 1855
 					<option value="', $cr, '"', $criteria['t'] == $cr ? ' selected' : '', '>', $txt['pm_rule_' . $cr], '</option>';
1856
+		}
1784 1857
 
1785 1858
 		echo '
1786 1859
 				</select>
@@ -1791,18 +1864,20 @@  discard block
 block discarded – undo
1791 1864
 					<select name="ruledefgroup[', $k, ']" id="ruledefgroup', $k, '" onchange="rebuildRuleDesc();">
1792 1865
 						<option value="">', $txt['pm_rule_sel_group'], '</option>';
1793 1866
 
1794
-		foreach ($context['groups'] as $id => $group)
1795
-			echo '
1867
+		foreach ($context['groups'] as $id => $group) {
1868
+					echo '
1796 1869
 						<option value="', $id, '"', $criteria['t'] == 'gid' && $criteria['v'] == $id ? ' selected' : '', '>', $group, '</option>';
1870
+		}
1797 1871
 		echo '
1798 1872
 					</select>
1799 1873
 				</span>';
1800 1874
 
1801 1875
 		// If this is the dummy we add a means to hide for non js users.
1802
-		if ($isFirst)
1803
-			$isFirst = false;
1804
-		elseif ($criteria['t'] == '')
1805
-			echo '</div>';
1876
+		if ($isFirst) {
1877
+					$isFirst = false;
1878
+		} elseif ($criteria['t'] == '') {
1879
+					echo '</div>';
1880
+		}
1806 1881
 	}
1807 1882
 
1808 1883
 	echo '
@@ -1825,10 +1900,11 @@  discard block
 block discarded – undo
1825 1900
 	$isFirst = true;
1826 1901
 	foreach ($context['rule']['actions'] as $k => $action)
1827 1902
 	{
1828
-		if (!$isFirst && $action['t'] == '')
1829
-			echo '<div id="removeonjs2">';
1830
-		elseif (!$isFirst)
1831
-			echo '<br>';
1903
+		if (!$isFirst && $action['t'] == '') {
1904
+					echo '<div id="removeonjs2">';
1905
+		} elseif (!$isFirst) {
1906
+					echo '<br>';
1907
+		}
1832 1908
 
1833 1909
 		echo '
1834 1910
 				<select name="acttype[', $k, ']" id="acttype', $k, '" onchange="updateActionDef(', $k, '); rebuildRuleDesc();">
@@ -1839,20 +1915,22 @@  discard block
 block discarded – undo
1839 1915
 				<span id="labdiv', $k, '">
1840 1916
 					<select name="labdef[', $k, ']" id="labdef', $k, '" onchange="rebuildRuleDesc();">
1841 1917
 						<option value="">', $txt['pm_rule_sel_label'], '</option>';
1842
-		foreach ($context['labels'] as $label)
1843
-			if ($label['id'] != -1)
1918
+		foreach ($context['labels'] as $label) {
1919
+					if ($label['id'] != -1)
1844 1920
 				echo '
1845 1921
 						<option value="', ($label['id']), '"', $action['t'] == 'lab' && $action['v'] == $label['id'] ? ' selected' : '', '>', $label['name'], '</option>';
1922
+		}
1846 1923
 
1847 1924
 		echo '
1848 1925
 					</select>
1849 1926
 				</span>';
1850 1927
 
1851
-		if ($isFirst)
1852
-			$isFirst = false;
1853
-		elseif ($action['t'] == '')
1854
-			echo '
1928
+		if ($isFirst) {
1929
+					$isFirst = false;
1930
+		} elseif ($action['t'] == '') {
1931
+					echo '
1855 1932
 			</div>';
1933
+		}
1856 1934
 	}
1857 1935
 
1858 1936
 	echo '
@@ -1876,22 +1954,25 @@  discard block
 block discarded – undo
1876 1954
 		echo '
1877 1955
 	<script>';
1878 1956
 
1879
-	foreach ($context['rule']['criteria'] as $k => $c)
1880
-		echo '
1957
+	foreach ($context['rule']['criteria'] as $k => $c) {
1958
+			echo '
1881 1959
 			updateRuleDef(', $k, ');';
1960
+	}
1882 1961
 
1883
-	foreach ($context['rule']['actions'] as $k => $c)
1884
-		echo '
1962
+	foreach ($context['rule']['actions'] as $k => $c) {
1963
+			echo '
1885 1964
 			updateActionDef(', $k, ');';
1965
+	}
1886 1966
 
1887 1967
 	echo '
1888 1968
 			rebuildRuleDesc();';
1889 1969
 
1890 1970
 	// If this isn't a new rule and we have JS enabled remove the JS compatibility stuff.
1891
-	if ($context['rid'])
1892
-		echo '
1971
+	if ($context['rid']) {
1972
+			echo '
1893 1973
 			document.getElementById("removeonjs1").style.display = "none";
1894 1974
 			document.getElementById("removeonjs2").style.display = "none";';
1975
+	}
1895 1976
 
1896 1977
 	echo '
1897 1978
 			document.getElementById("addonjs1").style.display = "";
@@ -1924,12 +2005,12 @@  discard block
 block discarded – undo
1924 2005
 
1925 2006
 
1926 2007
 	// No drafts? Just show an informative message.
1927
-	if (empty($context['drafts']))
1928
-		echo '
2008
+	if (empty($context['drafts'])) {
2009
+			echo '
1929 2010
 		<div class="windowbg2 centertext">
1930 2011
 			', $txt['draft_none'], '
1931 2012
 		</div>';
1932
-	else
2013
+	} else
1933 2014
 	{
1934 2015
 		// For every draft to be displayed, give it its own div, and show the important details of the draft.
1935 2016
 		foreach ($context['drafts'] as $draft)
Please login to merge, or discard this patch.
Themes/default/Register.template.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 							<strong', !empty($field['is_error']) ? ' class="red"' : '', '>', $field['name'], ':</strong>
151 151
 							<span class="smalltext">', $field['desc'], '</span>
152 152
 						</dt>
153
-						<dd>', str_replace('name="', 'tabindex="' . $context['tabindex']++ .'" name="', $field['input_html']), '</dd>';
153
+						<dd>', str_replace('name="', 'tabindex="' . $context['tabindex']++ . '" name="', $field['input_html']), '</dd>';
154 154
 
155 155
 		echo '
156 156
 					</dl>';
@@ -436,7 +436,7 @@  discard block
 block discarded – undo
436 436
 		<meta charset="', $context['character_set'], '">
437 437
 		<title>', $txt['visual_verification_sound'], '</title>
438 438
 		<meta name="robots" content="noindex">
439
-		<link rel="stylesheet" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css', $modSettings['browser_cache'] ,'">
439
+		<link rel="stylesheet" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css', $modSettings['browser_cache'], '">
440 440
 		<style>';
441 441
 
442 442
 	// Just show the help text and a "close window" link.
@@ -542,7 +542,7 @@  discard block
 block discarded – undo
542 542
 							<strong', !empty($field['is_error']) ? ' class="red"' : '', '>', $field['name'], ':</strong>
543 543
 							<span class="smalltext">', $field['desc'], '</span>
544 544
 						</dt>
545
-						<dd>', str_replace('name="', 'tabindex="' . $context['tabindex']++ .'" name="', $field['input_html']), '</dd>';
545
+						<dd>', str_replace('name="', 'tabindex="' . $context['tabindex']++ . '" name="', $field['input_html']), '</dd>';
546 546
 
547 547
 	echo '
548 548
 						<dt>
Please login to merge, or discard this patch.
Braces   +72 added lines, -52 removed lines patch added patch discarded remove patch
@@ -28,13 +28,14 @@  discard block
 block discarded – undo
28 28
 			<div id="confirm_buttons">';
29 29
 
30 30
 	// Age restriction in effect?
31
-	if ($context['show_coppa'])
32
-		echo '
31
+	if ($context['show_coppa']) {
32
+			echo '
33 33
 				<input type="submit" name="accept_agreement" value="', $context['coppa_agree_above'], '" class="button_submit"><br><br>
34 34
 				<input type="submit" name="accept_agreement_coppa" value="', $context['coppa_agree_below'], '" class="button_submit">';
35
-	else
36
-		echo '
35
+	} else {
36
+			echo '
37 37
 				<input type="submit" name="accept_agreement" value="', $txt['agreement_agree'], '" class="button_submit">';
38
+	}
38 39
 
39 40
 	echo '
40 41
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -77,9 +78,10 @@  discard block
 block discarded – undo
77 78
 			<ul>';
78 79
 
79 80
 		// Cycle through each error and display an error message.
80
-		foreach ($context['registration_errors'] as $error)
81
-			echo '
81
+		foreach ($context['registration_errors'] as $error) {
82
+					echo '
82 83
 				<li>', $error, '</li>';
84
+		}
83 85
 
84 86
 		echo '
85 87
 			</ul>
@@ -143,14 +145,15 @@  discard block
 block discarded – undo
143 145
 
144 146
 					<dl class="register_form">';
145 147
 
146
-		foreach ($context['custom_fields'] as $field)
147
-			if ($field['show_reg'] > 1)
148
+		foreach ($context['custom_fields'] as $field) {
149
+					if ($field['show_reg'] > 1)
148 150
 				echo '
149 151
 						<dt>
150 152
 							<strong', !empty($field['is_error']) ? ' class="red"' : '', '>', $field['name'], ':</strong>
151 153
 							<span class="smalltext">', $field['desc'], '</span>
152 154
 						</dt>
153 155
 						<dd>', str_replace('name="', 'tabindex="' . $context['tabindex']++ .'" name="', $field['input_html']), '</dd>';
156
+		}
154 157
 
155 158
 		echo '
156 159
 					</dl>';
@@ -184,41 +187,45 @@  discard block
 block discarded – undo
184 187
 					$callback_func = 'template_profile_' . $field['callback_func'];
185 188
 					$callback_func();
186 189
 				}
187
-			}
188
-			else
190
+			} else
189 191
 			{
190 192
 					echo '
191 193
 						<dt>
192 194
 							<strong', !empty($field['is_error']) ? ' class="red"' : '', '>', $field['label'], ':</strong>';
193 195
 
194 196
 				// Does it have any subtext to show?
195
-				if (!empty($field['subtext']))
196
-					echo '
197
+				if (!empty($field['subtext'])) {
198
+									echo '
197 199
 							<span class="smalltext">', $field['subtext'], '</span>';
200
+				}
198 201
 
199 202
 				echo '
200 203
 						</dt>
201 204
 						<dd>';
202 205
 
203 206
 				// Want to put something infront of the box?
204
-				if (!empty($field['preinput']))
205
-					echo '
207
+				if (!empty($field['preinput'])) {
208
+									echo '
206 209
 							', $field['preinput'];
210
+				}
207 211
 
208 212
 				// What type of data are we showing?
209
-				if ($field['type'] == 'label')
210
-					echo '
213
+				if ($field['type'] == 'label') {
214
+									echo '
211 215
 							', $field['value'];
216
+				}
212 217
 
213 218
 				// Maybe it's a text box - very likely!
214
-				elseif (in_array($field['type'], array('int', 'float', 'text', 'password')))
215
-					echo '
219
+				elseif (in_array($field['type'], array('int', 'float', 'text', 'password'))) {
220
+									echo '
216 221
 							<input type="', $field['type'] == 'password' ? 'password' : 'text', '" name="', $key, '" id="', $key, '" size="', empty($field['size']) ? 30 : $field['size'], '" value="', $field['value'], '" tabindex="', $context['tabindex']++, '" ', $field['input_attr'], ' class="input_', $field['type'] == 'password' ? 'password' : 'text', '">';
222
+				}
217 223
 
218 224
 				// You "checking" me out? ;)
219
-				elseif ($field['type'] == 'check')
220
-					echo '
225
+				elseif ($field['type'] == 'check') {
226
+									echo '
221 227
 							<input type="hidden" name="', $key, '" value="0"><input type="checkbox" name="', $key, '" id="', $key, '"', !empty($field['value']) ? ' checked' : '', ' value="1" tabindex="', $context['tabindex']++, '" class="input_check" ', $field['input_attr'], '>';
228
+				}
222 229
 
223 230
 				// Always fun - select boxes!
224 231
 				elseif ($field['type'] == 'select')
@@ -229,13 +236,15 @@  discard block
 block discarded – undo
229 236
 					if (isset($field['options']))
230 237
 					{
231 238
 						// Is this some code to generate the options?
232
-						if (!is_array($field['options']))
233
-							$field['options'] = eval($field['options']);
239
+						if (!is_array($field['options'])) {
240
+													$field['options'] = eval($field['options']);
241
+						}
234 242
 						// Assuming we now have some!
235
-						if (is_array($field['options']))
236
-							foreach ($field['options'] as $value => $name)
243
+						if (is_array($field['options'])) {
244
+													foreach ($field['options'] as $value => $name)
237 245
 								echo '
238 246
 								<option value="', $value, '"', $value == $field['value'] ? ' selected' : '', '>', $name, '</option>';
247
+						}
239 248
 					}
240 249
 
241 250
 					echo '
@@ -243,9 +252,10 @@  discard block
 block discarded – undo
243 252
 				}
244 253
 
245 254
 				// Something to end with?
246
-				if (!empty($field['postinput']))
247
-					echo '
255
+				if (!empty($field['postinput'])) {
256
+									echo '
248 257
 							', $field['postinput'];
258
+				}
249 259
 
250 260
 				echo '
251 261
 						</dd>';
@@ -258,13 +268,14 @@  discard block
 block discarded – undo
258 268
 	{
259 269
 		foreach ($context['custom_fields'] as $field)
260 270
 		{
261
-			if ($field['show_reg'] < 2)
262
-				echo '
271
+			if ($field['show_reg'] < 2) {
272
+							echo '
263 273
 						<dt>
264 274
 							<strong', !empty($field['is_error']) ? ' class="red"' : '', '>', $field['name'], ':</strong>
265 275
 							<span class="smalltext">', $field['desc'], '</span>
266 276
 						</dt>
267 277
 						<dd>', $field['input_html'], '</dd>';
278
+			}
268 279
 		}
269 280
 	}
270 281
 
@@ -294,13 +305,14 @@  discard block
 block discarded – undo
294 305
 			<div id="confirm_buttons" class="flow_auto">';
295 306
 
296 307
 	// Age restriction in effect?
297
-	if (!$context['require_agreement'] && $context['show_coppa'])
298
-		echo '
308
+	if (!$context['require_agreement'] && $context['show_coppa']) {
309
+			echo '
299 310
 				<input type="submit" name="accept_agreement" value="', $context['coppa_agree_above'], '" class="button_submit"><br><br>
300 311
 				<input type="submit" name="accept_agreement_coppa" value="', $context['coppa_agree_below'], '" class="button_submit">';
301
-	else
302
-		echo '
312
+	} else {
313
+			echo '
303 314
 				<input type="submit" name="regSubmit" value="', $txt['register'], '" tabindex="', $context['tabindex']++, '" class="button_submit">';
315
+	}
304 316
 	echo '
305 317
 			</div>
306 318
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -445,19 +457,20 @@  discard block
 block discarded – undo
445 457
 	</head>
446 458
 	<body style="margin: 1ex;">
447 459
 		<div class="windowbg description" style="text-align: center;">';
448
-	if (isBrowser('is_ie') || isBrowser('is_ie11'))
449
-		echo '
460
+	if (isBrowser('is_ie') || isBrowser('is_ie11')) {
461
+			echo '
450 462
 			<object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" type="audio/x-wav">
451 463
 				<param name="AutoStart" value="1">
452 464
 				<param name="FileName" value="', $context['verification_sound_href'], '">
453 465
 			</object>';
454
-	else
455
-		echo '
466
+	} else {
467
+			echo '
456 468
 			<audio src="', $context['verification_sound_href'], '" controls>
457 469
 				<object type="audio/x-wav" data="', $context['verification_sound_href'], '">
458 470
 					<a href="', $context['verification_sound_href'], '" rel="nofollow">', $context['verification_sound_href'], '</a>
459 471
 				</object>
460 472
 			</audio>';
473
+	}
461 474
 	echo '
462 475
 		<br>
463 476
 		<a href="', $context['verification_sound_href'], ';sound" rel="nofollow">', $txt['visual_verification_sound_again'], '</a><br>
@@ -484,11 +497,12 @@  discard block
 block discarded – undo
484 497
 				</div>
485 498
 				<div id="register_screen" class="windowbg2 noup">';
486 499
 
487
-	if (!empty($context['registration_done']))
488
-		echo '
500
+	if (!empty($context['registration_done'])) {
501
+			echo '
489 502
 					<div class="infobox">
490 503
 						', $context['registration_done'], '
491 504
 					</div>';
505
+	}
492 506
 
493 507
 	echo '
494 508
 					<dl class="register_form" id="admin_register_form">
@@ -524,9 +538,10 @@  discard block
 block discarded – undo
524 538
 						<dd>
525 539
 							<select name="group" id="group_select" tabindex="', $context['tabindex']++, '">';
526 540
 
527
-		foreach ($context['member_groups'] as $id => $name)
528
-			echo '
541
+		foreach ($context['member_groups'] as $id => $name) {
542
+					echo '
529 543
 								<option value="', $id, '">', $name, '</option>';
544
+		}
530 545
 
531 546
 		echo '
532 547
 							</select>
@@ -534,8 +549,8 @@  discard block
 block discarded – undo
534 549
 	}
535 550
 
536 551
 	// If there is any field marked as required, show it here!
537
-	if (!empty($context['custom_fields_required']) && !empty($context['custom_fields']))
538
-		foreach ($context['custom_fields'] as $field)
552
+	if (!empty($context['custom_fields_required']) && !empty($context['custom_fields'])) {
553
+			foreach ($context['custom_fields'] as $field)
539 554
 			if ($field['show_reg'] > 1)
540 555
 				echo '
541 556
 						<dt>
@@ -543,6 +558,7 @@  discard block
 block discarded – undo
543 558
 							<span class="smalltext">', $field['desc'], '</span>
544 559
 						</dt>
545 560
 						<dd>', str_replace('name="', 'tabindex="' . $context['tabindex']++ .'" name="', $field['input_html']), '</dd>';
561
+	}
546 562
 
547 563
 	echo '
548 564
 						<dt>
@@ -579,12 +595,13 @@  discard block
 block discarded – undo
579 595
 {
580 596
 	global $context, $scripturl, $txt;
581 597
 
582
-	if (!empty($context['saved_successful']))
583
-		echo '
598
+	if (!empty($context['saved_successful'])) {
599
+			echo '
584 600
 					<div class="infobox">', $txt['settings_saved'], '</div>';
585
-	elseif (!empty($context['could_not_save']))
586
-		echo '
601
+	} elseif (!empty($context['could_not_save'])) {
602
+			echo '
587 603
 					<div class="errorbox">', $txt['admin_agreement_not_saved'], '</div>';
604
+	}
588 605
 
589 606
 	// Just a big box to edit the text file ;).
590 607
 	echo '
@@ -594,9 +611,10 @@  discard block
 block discarded – undo
594 611
 			</div>';
595 612
 
596 613
 	// Warning for if the file isn't writable.
597
-	if (!empty($context['warning']))
598
-		echo '
614
+	if (!empty($context['warning'])) {
615
+			echo '
599 616
 			<p class="error">', $context['warning'], '</p>';
617
+	}
600 618
 
601 619
 	echo '
602 620
 			<div class="windowbg2 noup" id="registration_agreement">';
@@ -613,9 +631,10 @@  discard block
 block discarded – undo
613 631
 						<strong>', $txt['admin_agreement_select_language'], ':</strong>&nbsp;
614 632
 						<select name="agree_lang" onchange="document.getElementById(\'change_reg\').submit();" tabindex="', $context['tabindex']++, '">';
615 633
 
616
-		foreach ($context['editable_agreements'] as $file => $name)
617
-			echo '
634
+		foreach ($context['editable_agreements'] as $file => $name) {
635
+					echo '
618 636
 							<option value="', $file, '"', $context['current_agreement'] == $file ? ' selected' : '', '>', $name, '</option>';
637
+		}
619 638
 
620 639
 		echo '
621 640
 						</select>
@@ -655,9 +674,10 @@  discard block
 block discarded – undo
655 674
 {
656 675
 	global $context, $scripturl, $txt;
657 676
 
658
-	if (!empty($context['saved_successful']))
659
-		echo '
677
+	if (!empty($context['saved_successful'])) {
678
+			echo '
660 679
 	<div class="infobox">', $txt['settings_saved'], '</div>';
680
+	}
661 681
 
662 682
 	echo '
663 683
 		<form id="admin_form_wrapper" action="', $scripturl, '?action=admin;area=regcenter" method="post" accept-charset="', $context['character_set'], '">
Please login to merge, or discard this patch.
Themes/default/ManageScheduledTasks.template.php 1 patch
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -20,12 +20,12 @@
 block discarded – undo
20 20
 	// We completed some tasks?
21 21
 	if (!empty($context['tasks_were_run']))
22 22
 	{
23
-		if (empty($context['scheduled_errors']))
24
-			echo '
23
+		if (empty($context['scheduled_errors'])) {
24
+					echo '
25 25
 	<div class="infobox">
26 26
 		', $txt['scheduled_tasks_were_run'], '
27 27
 	</div>';
28
-		else
28
+		} else
29 29
 		{
30 30
 			echo '
31 31
 	<div class="errorbox" id="errors">
Please login to merge, or discard this patch.
Themes/default/Xml.template.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 <smf>
48 48
 	<subject><![CDATA[', cleanXml($context['message']['subject']), ']]></subject>
49 49
 	<message id="msg_', $context['message']['id'], '"><![CDATA[', cleanXml($context['message']['body']), ']]></message>
50
-	<reason time="', $context['message']['reason']['time'] ,'" name="', $context['message']['reason']['name'] ,'"><![CDATA[', cleanXml($context['message']['reason']['text']), ']]></reason>
50
+	<reason time="', $context['message']['reason']['time'], '" name="', $context['message']['reason']['name'], '"><![CDATA[', cleanXml($context['message']['reason']['text']), ']]></reason>
51 51
 </smf>';
52 52
 
53 53
 }
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 		// Build our string of info about when and why it was modified
68 68
 
69 69
 		$modified = empty($context['message']['modified']['time']) ? '' : sprintf($txt['last_edit_by'], $context['message']['modified']['time'], $context['message']['modified']['name']);
70
-		$modified .= empty($context['message']['modified']['reason']) ? '' : ' '. sprintf($txt['last_edit_reason'], $context['message']['modified']['reason']);
70
+		$modified .= empty($context['message']['modified']['reason']) ? '' : ' ' . sprintf($txt['last_edit_reason'], $context['message']['modified']['reason']);
71 71
 
72 72
 		echo '
73 73
 		<modified><![CDATA[', empty($modified) ? '' : cleanXml('&#171; <em>' . $modified . '</em>&#187;'), ']]></modified>
Please login to merge, or discard this patch.
Braces   +50 added lines, -37 removed lines patch added patch discarded remove patch
@@ -74,10 +74,10 @@  discard block
 block discarded – undo
74 74
 		<subject is_first="', $context['message']['first_in_topic'] ? '1' : '0', '"><![CDATA[', cleanXml($context['message']['subject']), ']]></subject>
75 75
 		<body><![CDATA[', $context['message']['body'], ']]></body>
76 76
 		<success><![CDATA[', $txt['quick_modify_message'], ']]></success>';
77
-	}
78
-	else
79
-		echo '
77
+	} else {
78
+			echo '
80 79
 		<error in_subject="', $context['message']['error_in_subject'] ? '1' : '0', '" in_body="', cleanXml($context['message']['error_in_body']) ? '1' : '0', '"><![CDATA[', implode('<br />', $context['message']['errors']), ']]></error>';
80
+	}
81 81
 	echo '
82 82
 	</message>
83 83
 </smf>';
@@ -101,13 +101,14 @@  discard block
 block discarded – undo
101 101
 
102 102
 		echo '
103 103
 		<modified><![CDATA[', empty($modified) ? '' : cleanXml('&#171; <em>' . $modified . '</em>&#187;'), ']]></modified>';
104
-		if (!empty($context['message']['subject']))
105
-			echo '
104
+		if (!empty($context['message']['subject'])) {
105
+					echo '
106 106
 		<subject><![CDATA[', cleanXml($context['message']['subject']), ']]></subject>';
107
-	}
108
-	else
109
-		echo '
107
+		}
108
+	} else {
109
+			echo '
110 110
 		<error in_subject="', $context['message']['error_in_subject'] ? '1' : '0', '"><![CDATA[', cleanXml(implode('<br />', $context['message']['errors'])), ']]></error>';
111
+	}
111 112
 	echo '
112 113
 	</message>
113 114
 </smf>';
@@ -127,10 +128,11 @@  discard block
 block discarded – undo
127 128
 		<body><![CDATA[', $context['preview_message'], ']]></body>
128 129
 	</preview>
129 130
 	<errors serious="', empty($context['error_type']) || $context['error_type'] != 'serious' ? '0' : '1', '" topic_locked="', $context['locked'] ? '1' : '0', '">';
130
-	if (!empty($context['post_error']))
131
-		foreach ($context['post_error'] as $message)
131
+	if (!empty($context['post_error'])) {
132
+			foreach ($context['post_error'] as $message)
132 133
 			echo '
133 134
 		<error><![CDATA[', cleanXml($message), ']]></error>';
135
+	}
134 136
 	echo '
135 137
 		<caption name="guestname" class="', isset($context['post_error']['long_name']) || isset($context['post_error']['no_name']) || isset($context['post_error']['bad_name']) ? 'error' : '', '" />
136 138
 		<caption name="email" class="', isset($context['post_error']['no_email']) || isset($context['post_error']['bad_email']) ? 'error' : '', '" />
@@ -145,14 +147,15 @@  discard block
 block discarded – undo
145 147
 	{
146 148
 		echo '
147 149
 	<new_posts>';
148
-		foreach ($context['previous_posts'] as $post)
149
-			echo '
150
+		foreach ($context['previous_posts'] as $post) {
151
+					echo '
150 152
 		<post id="', $post['id'], '">
151 153
 			<time><![CDATA[', $post['time'], ']]></time>
152 154
 			<poster><![CDATA[', cleanXml($post['poster']), ']]></poster>
153 155
 			<message><![CDATA[', cleanXml($post['message']), ']]></message>
154 156
 			<is_ignored>', $post['is_ignored'] ? '1' : '0', '</is_ignored>
155 157
 		</post>';
158
+		}
156 159
 		echo '
157 160
 	</new_posts>';
158 161
 	}
@@ -176,10 +179,11 @@  discard block
 block discarded – undo
176 179
 		<body><![CDATA[', $context['preview_message'], ']]></body>
177 180
 	</preview>
178 181
 	<errors serious="', empty($context['error_type']) || $context['error_type'] != 'serious' ? '0' : '1', '">';
179
-	if (!empty($context['post_error']['messages']))
180
-		foreach ($context['post_error']['messages'] as $message)
182
+	if (!empty($context['post_error']['messages'])) {
183
+			foreach ($context['post_error']['messages'] as $message)
181 184
 			echo '
182 185
 		<error><![CDATA[', cleanXml($message), ']]></error>';
186
+	}
183 187
 
184 188
 	echo '
185 189
 		<caption name="to" class="', isset($context['post_error']['no_to']) ? 'error' : '', '" />
@@ -208,10 +212,11 @@  discard block
 block discarded – undo
208 212
 		<body><![CDATA[', $context['preview_message'], ']]></body>
209 213
 	</preview>
210 214
 	<errors serious="', empty($context['error_type']) || $context['error_type'] != 'serious' ? '0' : '1', '">';
211
-	if (!empty($context['post_error']['messages']))
212
-		foreach ($context['post_error']['messages'] as $message)
215
+	if (!empty($context['post_error']['messages'])) {
216
+			foreach ($context['post_error']['messages'] as $message)
213 217
 			echo '
214 218
 		<error><![CDATA[', cleanXml($message), ']]></error>';
219
+	}
215 220
 
216 221
 	echo '
217 222
 	</errors>';
@@ -227,19 +232,22 @@  discard block
 block discarded – undo
227 232
 {
228 233
 	global $context, $modSettings;
229 234
 
230
-	if (empty($context['yearly']))
231
-		return;
235
+	if (empty($context['yearly'])) {
236
+			return;
237
+	}
232 238
 
233 239
 	echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '>
234 240
 <smf>';
235
-	foreach ($context['yearly'] as $year)
236
-		foreach ($year['months'] as $month)
241
+	foreach ($context['yearly'] as $year) {
242
+			foreach ($year['months'] as $month)
237 243
 		{
238 244
 			echo '
239 245
 	<month id="', $month['date']['year'], $month['date']['month'], '">';
240
-			foreach ($month['days'] as $day)
241
-				echo '
246
+	}
247
+			foreach ($month['days'] as $day) {
248
+							echo '
242 249
 		<day date="', $day['year'], '-', $day['month'], '-', $day['day'], '" new_topics="', $day['new_topics'], '" new_posts="', $day['new_posts'], '" new_members="', $day['new_members'], '" most_members_online="', $day['most_members_online'], '"', empty($modSettings['hitStats']) ? '' : ' hits="' . $day['hits'] . '"', ' />';
250
+			}
243 251
 			echo '
244 252
 	</month>';
245 253
 		}
@@ -260,17 +268,18 @@  discard block
 block discarded – undo
260 268
 	<pageIndex section="selected" startFrom="', $context['selected']['start'], '"><![CDATA[', $context['selected']['page_index'], ']]></pageIndex>';
261 269
 	foreach ($context['changes'] as $change)
262 270
 	{
263
-		if ($change['type'] == 'remove')
264
-			echo '
271
+		if ($change['type'] == 'remove') {
272
+					echo '
265 273
 	<change id="', $change['id'], '" curAction="remove" section="', $change['section'], '" />';
266
-		else
267
-			echo '
274
+		} else {
275
+					echo '
268 276
 	<change id="', $change['id'], '" curAction="insert" section="', $change['section'], '">
269 277
 		<subject><![CDATA[', cleanXml($change['insert_value']['subject']), ']]></subject>
270 278
 		<time><![CDATA[', cleanXml($change['insert_value']['time']), ']]></time>
271 279
 		<body><![CDATA[', cleanXml($change['insert_value']['body']), ']]></body>
272 280
 		<poster><![CDATA[', cleanXml($change['insert_value']['poster']), ']]></poster>
273 281
 	</change>';
282
+		}
274 283
 	}
275 284
 	echo '
276 285
 </smf>';
@@ -301,10 +310,10 @@  discard block
 block discarded – undo
301 310
 	echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '>
302 311
 <smf>';
303 312
 
304
-	if (empty($context['topics']))
305
-		echo '
313
+	if (empty($context['topics'])) {
314
+			echo '
306 315
 		<noresults>', $txt['search_no_results'], '</noresults>';
307
-	else
316
+	} else
308 317
 	{
309 318
 		echo '
310 319
 		<results>';
@@ -370,9 +379,10 @@  discard block
 block discarded – undo
370 379
 	{
371 380
 		echo '
372 381
 	<item type="category" id="', $category['id'], '"><![CDATA[', cleanXml($category['name']), ']]></item>';
373
-		foreach ($category['boards'] as $board)
374
-			echo '
382
+		foreach ($category['boards'] as $board) {
383
+					echo '
375 384
 	<item type="board" id="', $board['id'], '" childlevel="', $board['child_level'], '"><![CDATA[', cleanXml($board['name']), ']]></item>';
385
+		}
376 386
 	}
377 387
 	echo '
378 388
 </smf>';
@@ -387,9 +397,10 @@  discard block
 block discarded – undo
387 397
 
388 398
 	echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '>
389 399
 <smf>';
390
-	foreach ($context['icons'] as $icon)
391
-		echo '
400
+	foreach ($context['icons'] as $icon) {
401
+			echo '
392 402
 	<icon value="', $icon['value'], '" url="', $icon['url'], '"><![CDATA[', cleanXml($icon['name']), ']]></icon>';
403
+	}
393 404
 	echo '
394 405
 </smf>';
395 406
 }
@@ -438,16 +449,18 @@  discard block
 block discarded – undo
438 449
 	foreach ($xml_data as $key => $data)
439 450
 	{
440 451
 		// A group?
441
-		if (is_array($data) && isset($data['identifier']))
442
-			template_generic_xml_recursive($data['children'], $key, $data['identifier'], $level);
452
+		if (is_array($data) && isset($data['identifier'])) {
453
+					template_generic_xml_recursive($data['children'], $key, $data['identifier'], $level);
454
+		}
443 455
 		// An item...
444 456
 		elseif (is_array($data) && isset($data['value']))
445 457
 		{
446 458
 			echo "\n", str_repeat("\t", $level), '<', $child_ident;
447 459
 
448
-			if (!empty($data['attributes']))
449
-				foreach ($data['attributes'] as $k => $v)
460
+			if (!empty($data['attributes'])) {
461
+							foreach ($data['attributes'] as $k => $v)
450 462
 					echo ' ' . $k . '="' . $v . '"';
463
+			}
451 464
 			echo '><![CDATA[', cleanXml($data['value']), ']]></', $child_ident, '>';
452 465
 		}
453 466
 
Please login to merge, or discard this patch.
Themes/default/ManageNews.template.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 	// Are we done sending the newsletter?
21 21
 	if (!empty($context['newsletter_sent']))
22 22
 		echo '
23
-	<div class="infobox">', $txt['admin_news_newsletter_'. $context['newsletter_sent']] ,'</div>';
23
+	<div class="infobox">', $txt['admin_news_newsletter_' . $context['newsletter_sent']], '</div>';
24 24
 
25 25
 	echo '
26 26
 	<div id="admincenter">
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 		<form name="newsmodify" action="', $scripturl, '?action=admin;area=news;sa=mailingsend" method="post" accept-charset="', $context['character_set'], '">
201 201
 			<div class="cat_bar">
202 202
 				<h3 class="catbg">
203
-					<a href="', $scripturl, '?action=helpadmin;help=email_members" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'],'"></span></a> ', $txt['admin_newsletters'], '
203
+					<a href="', $scripturl, '?action=helpadmin;help=email_members" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'], '"></span></a> ', $txt['admin_newsletters'], '
204 204
 				</h3>
205 205
 			</div>
206 206
 			<div class="information">
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 				<div class="', empty($context['error_type']) || $context['error_type'] != 'serious' ? 'noticebox' : 'errorbox', '"', empty($context['post_error']['messages']) ? ' style="display: none"' : '', ' id="errors">
211 211
 					<dl>
212 212
 						<dt>
213
-							<strong id="error_serious">', $txt['error_while_submitting'] , '</strong>
213
+							<strong id="error_serious">', $txt['error_while_submitting'], '</strong>
214 214
 						</dt>
215 215
 						<dd class="error" id="error_list">
216 216
 							', empty($context['post_error']['messages']) ? '' : implode('<br>', $context['post_error']['messages']), '
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
 						<span', (isset($context['post_error']['no_subject']) ? ' class="error"' : ''), ' id="caption_subject">', $txt['subject'], ':</span>
223 223
 					</dt>
224 224
 					<dd id="pm_subject">
225
-						<input type="text" name="subject" value="', $context['subject'], '" tabindex="', $context['tabindex']++, '" size="60" maxlength="60"',isset($context['post_error']['no_subject']) ? ' class="error"' : ' class="input_text"', '/>
225
+						<input type="text" name="subject" value="', $context['subject'], '" tabindex="', $context['tabindex']++, '" size="60" maxlength="60"', isset($context['post_error']['no_subject']) ? ' class="error"' : ' class="input_text"', '/>
226 226
 					</dd>
227 227
 				</dl><hr class="clear">
228 228
 				<div id="bbcBox_message"></div>';
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
 		<form action="', $scripturl, '?action=admin;area=news;sa=mailingsend" method="post" accept-charset="', $context['character_set'], '" name="autoSubmit" id="autoSubmit">
388 388
 			<div class="cat_bar">
389 389
 				<h3 class="catbg">
390
-					<a href="', $scripturl, '?action=helpadmin;help=email_members" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'],'"></span></a> ', $txt['admin_newsletters'], '
390
+					<a href="', $scripturl, '?action=helpadmin;help=email_members" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="', $txt['help'], '"></span></a> ', $txt['admin_newsletters'], '
391 391
 				</h3>
392 392
 			</div>
393 393
 			<div class="windowbg">
Please login to merge, or discard this patch.
Braces   +21 added lines, -14 removed lines patch added patch discarded remove patch
@@ -18,9 +18,10 @@  discard block
 block discarded – undo
18 18
 	global $context, $txt, $scripturl;
19 19
 
20 20
 	// Are we done sending the newsletter?
21
-	if (!empty($context['newsletter_sent']))
22
-		echo '
21
+	if (!empty($context['newsletter_sent'])) {
22
+			echo '
23 23
 	<div class="infobox">', $txt['admin_news_newsletter_'. $context['newsletter_sent']] ,'</div>';
24
+	}
24 25
 
25 26
 	echo '
26 27
 	<div id="admincenter">
@@ -39,9 +40,10 @@  discard block
 block discarded – undo
39 40
 					</dt>
40 41
 					<dd>';
41 42
 
42
-	foreach ($context['groups'] as $group)
43
-				echo '
43
+	foreach ($context['groups'] as $group) {
44
+					echo '
44 45
 						<label for="groups_', $group['id'], '"><input type="checkbox" name="groups[', $group['id'], ']" id="groups_', $group['id'], '" value="', $group['id'], '" checked class="input_check"> ', $group['name'], '</label> <em>(', $group['member_count'], ')</em><br>';
46
+	}
45 47
 
46 48
 	echo '
47 49
 						<br>
@@ -82,9 +84,10 @@  discard block
 block discarded – undo
82 84
 						</dt>
83 85
 						<dd>';
84 86
 
85
-	foreach ($context['groups'] as $group)
86
-				echo '
87
+	foreach ($context['groups'] as $group) {
88
+					echo '
87 89
 							<label for="exclude_groups_', $group['id'], '"><input type="checkbox" name="exclude_groups[', $group['id'], ']" id="exclude_groups_', $group['id'], '" value="', $group['id'], '" class="input_check"> ', $group['name'], '</label> <em>(', $group['member_count'], ')</em><br>';
90
+	}
88 91
 
89 92
 	echo '
90 93
 							<br>
@@ -228,9 +231,10 @@  discard block
 block discarded – undo
228 231
 				<div id="bbcBox_message"></div>';
229 232
 
230 233
 	// What about smileys?
231
-	if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup']))
232
-		echo '
234
+	if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup'])) {
235
+			echo '
233 236
 				<div id="smileyBox_message"></div>';
237
+	}
234 238
 
235 239
 	// Show BBC buttons, smileys and textbox.
236 240
 	echo '
@@ -251,9 +255,10 @@  discard block
 block discarded – undo
251 255
 			<input type="hidden" name="email_force" value="', $context['email_force'], '">
252 256
 			<input type="hidden" name="total_emails" value="', $context['total_emails'], '">';
253 257
 
254
-	foreach ($context['recipients'] as $key => $values)
255
-		echo '
258
+	foreach ($context['recipients'] as $key => $values) {
259
+			echo '
256 260
 			<input type="hidden" name="', $key, '" value="', implode(($key == 'emails' ? ';' : ','), $values), '">';
261
+	}
257 262
 
258 263
 	echo '
259 264
 		<script>';
@@ -408,9 +413,10 @@  discard block
 block discarded – undo
408 413
 				<input type="hidden" name="parse_html" value="', $context['parse_html'], '">';
409 414
 
410 415
 	// All the things we must remember!
411
-	foreach ($context['recipients'] as $key => $values)
412
-		echo '
416
+	foreach ($context['recipients'] as $key => $values) {
417
+			echo '
413 418
 				<input type="hidden" name="', $key, '" value="', implode(($key == 'emails' ? ';' : ','), $values), '">';
419
+	}
414 420
 
415 421
 	echo '
416 422
 			</div>
@@ -443,9 +449,10 @@  discard block
 block discarded – undo
443 449
 {
444 450
 	global $context, $txt;
445 451
 
446
-	if (!empty($context['saved_successful']))
447
-		echo '
452
+	if (!empty($context['saved_successful'])) {
453
+			echo '
448 454
 					<div class="infobox">', $txt['settings_saved'], '</div>';
455
+	}
449 456
 
450 457
 	template_show_list('news_lists');
451 458
 }
Please login to merge, or discard this patch.
Themes/default/ManageCalendar.template.php 1 patch
Braces   +14 added lines, -10 removed lines patch added patch discarded remove patch
@@ -39,9 +39,10 @@  discard block
 block discarded – undo
39 39
 						<select name="year" id="year" onchange="generateDays();">
40 40
 							<option value="0000"', $context['holiday']['year'] == '0000' ? ' selected' : '', '>', $txt['every_year'], '</option>';
41 41
 	// Show a list of all the years we allow...
42
-	for ($year = $modSettings['cal_minyear']; $year <= $modSettings['cal_maxyear']; $year++)
43
-		echo '
42
+	for ($year = $modSettings['cal_minyear']; $year <= $modSettings['cal_maxyear']; $year++) {
43
+			echo '
44 44
 							<option value="', $year, '"', $year == $context['holiday']['year'] ? ' selected' : '', '>', $year, '</option>';
45
+	}
45 46
 
46 47
 	echo '
47 48
 						</select>&nbsp;
@@ -49,9 +50,10 @@  discard block
 block discarded – undo
49 50
 						<select name="month" id="month" onchange="generateDays();">';
50 51
 
51 52
 	// There are 12 months per year - ensure that they all get listed.
52
-	for ($month = 1; $month <= 12; $month++)
53
-		echo '
53
+	for ($month = 1; $month <= 12; $month++) {
54
+			echo '
54 55
 							<option value="', $month, '"', $month == $context['holiday']['month'] ? ' selected' : '', '>', $txt['months'][$month], '</option>';
56
+	}
55 57
 
56 58
 	echo '
57 59
 						</select>&nbsp;
@@ -59,23 +61,25 @@  discard block
 block discarded – undo
59 61
 						<select name="day" id="day" onchange="generateDays();">';
60 62
 
61 63
 	// This prints out all the days in the current month - this changes dynamically as we switch months.
62
-	for ($day = 1; $day <= $context['holiday']['last_day']; $day++)
63
-		echo '
64
+	for ($day = 1; $day <= $context['holiday']['last_day']; $day++) {
65
+			echo '
64 66
 							<option value="', $day, '"', $day == $context['holiday']['day'] ? ' selected' : '', '>', $day, '</option>';
67
+	}
65 68
 
66 69
 	echo '
67 70
 						</select>
68 71
 					</dd>
69 72
 				</dl>';
70 73
 
71
-	if ($context['is_new'])
72
-		echo '
74
+	if ($context['is_new']) {
75
+			echo '
73 76
 				<input type="submit" value="', $txt['holidays_button_add'], '" class="button_submit">';
74
-	else
75
-		echo '
77
+	} else {
78
+			echo '
76 79
 				<input type="submit" name="edit" value="', $txt['holidays_button_edit'], '" class="button_submit">
77 80
 				<input type="submit" name="delete" value="', $txt['holidays_button_remove'], '" class="button_submit">
78 81
 				<input type="hidden" name="holiday" value="', $context['holiday']['id'], '">';
82
+	}
79 83
 	echo '
80 84
 				<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
81 85
 			</div>
Please login to merge, or discard this patch.
Themes/default/SplitTopics.template.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -101,8 +101,8 @@  discard block
 block discarded – undo
101 101
 				</div>
102 102
 				<ul id="messages_not_selected" class="split_messages smalltext">';
103 103
 
104
-	foreach ($context['not_selected']['messages'] as $message)
105
-		echo '
104
+	foreach ($context['not_selected']['messages'] as $message) {
105
+			echo '
106 106
 					<li class="windowbg" id="not_selected_', $message['id'], '">
107 107
 						<div class="message_header">
108 108
 							<a class="split_icon floatright" href="', $scripturl, '?action=splittopics;sa=selectTopics;subname=', $context['topic']['subject'], ';topic=', $context['topic']['id'], '.', $context['not_selected']['start'], ';start2=', $context['selected']['start'], ';move=down;msg=', $message['id'], '" onclick="return select(\'down\', ', $message['id'], ');"><span class="generic_icons split_sel" title="-&gt;"></span></a>
@@ -111,6 +111,7 @@  discard block
 block discarded – undo
111 111
 						</div>
112 112
 						<div class="post">', $message['body'], '</div>
113 113
 					</li>';
114
+	}
114 115
 
115 116
 	echo '
116 117
 					<li class="dummy">
@@ -130,8 +131,8 @@  discard block
 block discarded – undo
130 131
 				</div>
131 132
 				<ul id="messages_selected" class="split_messages smalltext">';
132 133
 
133
-	if (!empty($context['selected']['messages']))
134
-		foreach ($context['selected']['messages'] as $message)
134
+	if (!empty($context['selected']['messages'])) {
135
+			foreach ($context['selected']['messages'] as $message)
135 136
 			echo '
136 137
 					<li class="windowbg" id="selected_', $message['id'], '">
137 138
 						<div class="message_header">
@@ -141,6 +142,7 @@  discard block
 block discarded – undo
141 142
 						</div>
142 143
 						<div class="post">', $message['body'], '</div>
143 144
 					</li>';
145
+	}
144 146
 
145 147
 	echo '
146 148
 					<li class="dummy">
Please login to merge, or discard this patch.
Themes/default/ManagePermissions.template.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 		echo '
70 70
 					<tr class="windowbg">
71 71
 						<td>
72
-							', !empty($group['help']) ? ' <a class="help" href="' . $scripturl . '?action=helpadmin;help=' . $group['help'] . '" onclick="return reqOverlayDiv(this.href);"><span class="generic_icons help" title="'. $txt['help'].'"></span></a>' : '<img class="icon" src="' . $settings['images_url'] . '/blank.png" alt="' . $txt['help'] . '">', '&nbsp;<span>', $group['name'], '</span>';
72
+							', !empty($group['help']) ? ' <a class="help" href="' . $scripturl . '?action=helpadmin;help=' . $group['help'] . '" onclick="return reqOverlayDiv(this.href);"><span class="generic_icons help" title="' . $txt['help'] . '"></span></a>' : '<img class="icon" src="' . $settings['images_url'] . '/blank.png" alt="' . $txt['help'] . '">', '&nbsp;<span>', $group['name'], '</span>';
73 73
 
74 74
 		if (!empty($group['children']))
75 75
 			echo '
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 						<td ', $group['id'] == 1 || $group['id'] == -1 ? ' style="font-style: italic;"' : (!empty($group['num_permissions']['denied']) ? ' class="red"' : ''), '>', $group['num_permissions']['denied'], '</td>';
90 90
 
91 91
 		echo '
92
-						<td>', $group['allow_modify'] ? '<a href="' . $scripturl . '?action=admin;area=permissions;sa=modify;group=' . $group['id'] . (empty($context['profile']) ? '' : ';pid=' . $context['profile']['id']) . '">' . ($context['can_modify'] ? $txt['permissions_modify'] : $txt['permissions_view']). '</a>' : '', '</td>
92
+						<td>', $group['allow_modify'] ? '<a href="' . $scripturl . '?action=admin;area=permissions;sa=modify;group=' . $group['id'] . (empty($context['profile']) ? '' : ';pid=' . $context['profile']['id']) . '">' . ($context['can_modify'] ? $txt['permissions_modify'] : $txt['permissions_view']) . '</a>' : '', '</td>
93 93
 						<td class="centercol">', $group['allow_modify'] && $context['can_modify'] ? '<input type="checkbox" name="group[]" value="' . $group['id'] . '" class="input_check">' : '', '</td>
94 94
 					</tr>';
95 95
 	}
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 					<legend>', $txt['permissions_with_selection'], '</legend>
115 115
 					<dl class="settings">
116 116
 						<dt>
117
-							<a class="help" href="', $scripturl, '?action=helpadmin;help=permissions_quickgroups" onclick="return reqOverlayDiv(this.href);"><span class="generic_icons help" title="', $txt['help'],'"></span></a>', $txt['permissions_apply_pre_defined'], ':
117
+							<a class="help" href="', $scripturl, '?action=helpadmin;help=permissions_quickgroups" onclick="return reqOverlayDiv(this.href);"><span class="generic_icons help" title="', $txt['help'], '"></span></a>', $txt['permissions_apply_pre_defined'], ':
118 118
 						</dt>
119 119
 						<dd>
120 120
 							<select name="predefined">
@@ -593,7 +593,7 @@  discard block
 block discarded – undo
593 593
 					echo '
594 594
 						<tr class="windowbg">
595 595
 							<td>
596
-								', $permission['show_help'] ? '<a href="' . $scripturl . '?action=helpadmin;help=permissionhelp_' . $permission['id'] . '" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="'. $txt['help'].'"></span></a>' : '', '
596
+								', $permission['show_help'] ? '<a href="' . $scripturl . '?action=helpadmin;help=permissionhelp_' . $permission['id'] . '" onclick="return reqOverlayDiv(this.href);" class="help"><span class="generic_icons help" title="' . $txt['help'] . '"></span></a>' : '', '
597 597
 							</td>
598 598
 							<td class="lefttext full_width">', $permission['name'], '</td><td>';
599 599
 
@@ -731,7 +731,7 @@  discard block
 block discarded – undo
731 731
 	if (empty($modSettings['permission_enable_deny']))
732 732
 		echo '
733 733
 													<li>
734
-														<input type="checkbox" class="input_check" onclick="invertAll(this, this.form, \''. $context['current_permission']. '[\');">
734
+														<input type="checkbox" class="input_check" onclick="invertAll(this, this.form, \''. $context['current_permission'] . '[\');">
735 735
 														<span>', $txt['check_all'], '</span>
736 736
 													</li>
737 737
 												</ul>';
Please login to merge, or discard this patch.
Braces   +162 added lines, -125 removed lines patch added patch discarded remove patch
@@ -19,26 +19,28 @@  discard block
 block discarded – undo
19 19
 	global $context, $settings, $scripturl, $txt, $modSettings;
20 20
 
21 21
 	// Not allowed to edit?
22
-	if (!$context['can_modify'])
23
-		echo '
22
+	if (!$context['can_modify']) {
23
+			echo '
24 24
 	<div class="errorbox">
25 25
 		', sprintf($txt['permission_cannot_edit'], $scripturl . '?action=admin;area=permissions;sa=profiles'), '
26 26
 	</div>';
27
+	}
27 28
 
28 29
 	echo '
29 30
 	<div id="admin_form_wrapper">
30 31
 		<form action="', $scripturl, '?action=admin;area=permissions;sa=quick" method="post" accept-charset="', $context['character_set'], '" name="permissionForm" id="permissionForm">';
31 32
 
32
-		if (!empty($context['profile']))
33
-			echo '
33
+		if (!empty($context['profile'])) {
34
+					echo '
34 35
 			<div class="cat_bar">
35 36
 				<h3 class="catbg">', $txt['permissions_for_profile'], ': &quot;', $context['profile']['name'], '&quot;</h3>
36 37
 			</div>';
37
-		else
38
-			echo '
38
+		} else {
39
+					echo '
39 40
 			<div class="cat_bar">
40 41
 				<h3 class="catbg">', $txt['permissions_title'], '</h3>
41 42
 			</div>';
43
+		}
42 44
 
43 45
 		echo '
44 46
 			<table class="table_grid">
@@ -47,13 +49,14 @@  discard block
 block discarded – undo
47 49
 						<th>', $txt['membergroups_name'], '</th>
48 50
 						<th class="small_table">', $txt['membergroups_members_top'], '</th>';
49 51
 
50
-			if (empty($modSettings['permission_enable_deny']))
51
-				echo '
52
+			if (empty($modSettings['permission_enable_deny'])) {
53
+							echo '
52 54
 						<th class="small_table">', $txt['membergroups_permissions'], '</th>';
53
-			else
54
-				echo '
55
+			} else {
56
+							echo '
55 57
 						<th class="small_table">', $txt['permissions_allowed'], '</th>
56 58
 						<th class="small_table">', $txt['permissions_denied'], '</th>';
59
+			}
57 60
 
58 61
 			echo '
59 62
 						<th class="small_table">', $context['can_modify'] ? $txt['permissions_modify'] : $txt['permissions_view'], '</th>
@@ -71,22 +74,24 @@  discard block
 block discarded – undo
71 74
 						<td>
72 75
 							', !empty($group['help']) ? ' <a class="help" href="' . $scripturl . '?action=helpadmin;help=' . $group['help'] . '" onclick="return reqOverlayDiv(this.href);"><span class="generic_icons help" title="'. $txt['help'].'"></span></a>' : '<img class="icon" src="' . $settings['images_url'] . '/blank.png" alt="' . $txt['help'] . '">', '&nbsp;<span>', $group['name'], '</span>';
73 76
 
74
-		if (!empty($group['children']))
75
-			echo '
77
+		if (!empty($group['children'])) {
78
+					echo '
76 79
 							<br>
77 80
 							<span class="smalltext">', $txt['permissions_includes_inherited'], ': &quot;', implode('&quot;, &quot;', $group['children']), '&quot;</span>';
81
+		}
78 82
 
79 83
 		echo '
80 84
 						</td>
81 85
 						<td>', $group['can_search'] ? $group['link'] : $group['num_members'], '</td>';
82 86
 
83
-		if (empty($modSettings['permission_enable_deny']))
84
-			echo '
87
+		if (empty($modSettings['permission_enable_deny'])) {
88
+					echo '
85 89
 						<td>', $group['num_permissions']['allowed'], '</td>';
86
-		else
87
-			echo '
90
+		} else {
91
+					echo '
88 92
 						<td ', $group['id'] == 1 ? ' style="font-style: italic;"' : '', '>', $group['num_permissions']['allowed'], '</td>
89 93
 						<td ', $group['id'] == 1 || $group['id'] == -1 ? ' style="font-style: italic;"' : (!empty($group['num_permissions']['denied']) ? ' class="red"' : ''), '>', $group['num_permissions']['denied'], '</td>';
94
+		}
90 95
 
91 96
 		echo '
92 97
 						<td>', $group['allow_modify'] ? '<a href="' . $scripturl . '?action=admin;area=permissions;sa=modify;group=' . $group['id'] . (empty($context['profile']) ? '' : ';pid=' . $context['profile']['id']) . '">' . ($context['can_modify'] ? $txt['permissions_modify'] : $txt['permissions_view']). '</a>' : '', '</td>
@@ -133,9 +138,10 @@  discard block
 block discarded – undo
133 138
 								<option value="empty">(', $txt['permissions_select_membergroup'], ')</option>';
134 139
 		foreach ($context['groups'] as $group)
135 140
 		{
136
-			if ($group['id'] != 1)
137
-				echo '
141
+			if ($group['id'] != 1) {
142
+							echo '
138 143
 								<option value="', $group['id'], '">', $group['name'], '</option>';
144
+			}
139 145
 		}
140 146
 
141 147
 		echo '
@@ -145,9 +151,10 @@  discard block
 block discarded – undo
145 151
 							<select name="add_remove">
146 152
 								<option value="add">', $txt['permissions_add'], '...</option>
147 153
 								<option value="clear">', $txt['permissions_remove'], '...</option>';
148
-		if (!empty($modSettings['permission_enable_deny']))
149
-			echo '
154
+		if (!empty($modSettings['permission_enable_deny'])) {
155
+					echo '
150 156
 								<option value="deny">', $txt['permissions_deny'], '...</option>';
157
+		}
151 158
 		echo '
152 159
 							</select>
153 160
 						</dt>
@@ -156,30 +163,34 @@  discard block
 block discarded – undo
156 163
 								<option value="">(', $txt['permissions_select_permission'], ')</option>';
157 164
 		foreach ($context['permissions'] as $permissionType)
158 165
 		{
159
-			if ($permissionType['id'] == 'membergroup' && !empty($context['profile']))
160
-				continue;
166
+			if ($permissionType['id'] == 'membergroup' && !empty($context['profile'])) {
167
+							continue;
168
+			}
161 169
 
162 170
 			foreach ($permissionType['columns'] as $column)
163 171
 			{
164 172
 				foreach ($column as $permissionGroup)
165 173
 				{
166
-					if ($permissionGroup['hidden'])
167
-						continue;
174
+					if ($permissionGroup['hidden']) {
175
+											continue;
176
+					}
168 177
 
169 178
 					echo '
170 179
 								<option value="" disabled>[', $permissionGroup['name'], ']</option>';
171 180
 					foreach ($permissionGroup['permissions'] as $perm)
172 181
 					{
173
-						if ($perm['hidden'])
174
-							continue;
182
+						if ($perm['hidden']) {
183
+													continue;
184
+						}
175 185
 
176
-						if ($perm['has_own_any'])
177
-							echo '
186
+						if ($perm['has_own_any']) {
187
+													echo '
178 188
 								<option value="', $permissionType['id'], '/', $perm['own']['id'], '">&nbsp;&nbsp;&nbsp;', $perm['name'], ' (', $perm['own']['name'], ')</option>
179 189
 								<option value="', $permissionType['id'], '/', $perm['any']['id'], '">&nbsp;&nbsp;&nbsp;', $perm['name'], ' (', $perm['any']['name'], ')</option>';
180
-						else
181
-							echo '
190
+						} else {
191
+													echo '
182 192
 								<option value="', $permissionType['id'], '/', $perm['id'], '">&nbsp;&nbsp;&nbsp;', $perm['name'], '</option>';
193
+						}
183 194
 					}
184 195
 				}
185 196
 			}
@@ -246,17 +257,18 @@  discard block
 block discarded – undo
246 257
 		}
247 258
 	</script>';
248 259
 
249
-		if (!empty($context['profile']))
250
-			echo '
260
+		if (!empty($context['profile'])) {
261
+					echo '
251 262
 			<input type="hidden" name="pid" value="', $context['profile']['id'], '">';
263
+		}
252 264
 
253 265
 		echo '
254 266
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
255 267
 			<input type="hidden" name="', $context['admin-mpq_token_var'], '" value="', $context['admin-mpq_token'], '">';
256
-	}
257
-	else
258
-		echo '
268
+	} else {
269
+			echo '
259 270
 			</table>';
271
+	}
260 272
 
261 273
 	echo '
262 274
 		</form>
@@ -296,9 +308,10 @@  discard block
 block discarded – undo
296 308
 				<h3 class="subbg">', $category['name'], '</h3>
297 309
 			</div>';
298 310
 
299
-		if (!empty($category['boards']))
300
-			echo '
311
+		if (!empty($category['boards'])) {
312
+					echo '
301 313
 				<ul class="perm_boards flow_hidden">';
314
+		}
302 315
 
303 316
 		foreach ($category['boards'] as $board)
304 317
 		{
@@ -315,33 +328,36 @@  discard block
 block discarded – undo
315 328
 				echo '
316 329
 							<select name="boardprofile[', $board['id'], ']">';
317 330
 
318
-				foreach ($context['profiles'] as $id => $profile)
319
-					echo '
331
+				foreach ($context['profiles'] as $id => $profile) {
332
+									echo '
320 333
 								<option value="', $id, '"', $id == $board['profile'] ? ' selected' : '', '>', $profile['name'], '</option>';
334
+				}
321 335
 
322 336
 				echo '
323 337
 							</select>';
324
-			}
325
-			else
326
-				echo '
338
+			} else {
339
+							echo '
327 340
 							<a href="', $scripturl, '?action=admin;area=permissions;sa=index;pid=', $board['profile'], ';', $context['session_var'], '=', $context['session_id'], '">', $board['profile_name'], '</a>';
341
+			}
328 342
 
329 343
 			echo '
330 344
 						</span>
331 345
 					</li>';
332 346
 		}
333 347
 
334
-		if (!empty($category['boards']))
335
-			echo '
348
+		if (!empty($category['boards'])) {
349
+					echo '
336 350
 				</ul>';
351
+		}
337 352
 	}
338 353
 
339
-	if ($context['edit_all'])
340
-		echo '
354
+	if ($context['edit_all']) {
355
+			echo '
341 356
 			<input type="submit" name="save_changes" value="', $txt['save'], '" class="button_submit">';
342
-	else
343
-		echo '
357
+	} else {
358
+			echo '
344 359
 			<a class="button_link" href="', $scripturl, '?action=admin;area=permissions;sa=board;edit;', $context['session_var'], '=', $context['session_id'], '">', $txt['permissions_board_all'], '</a>';
360
+	}
345 361
 
346 362
 	echo '
347 363
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -381,12 +397,13 @@  discard block
 block discarded – undo
381 397
 					<tr class="windowbg">
382 398
 						<td>';
383 399
 
384
-		if (!empty($context['show_rename_boxes']) && $profile['can_edit'])
385
-			echo '
400
+		if (!empty($context['show_rename_boxes']) && $profile['can_edit']) {
401
+					echo '
386 402
 							<input type="text" name="rename_profile[', $profile['id'], ']" value="', $profile['name'], '" class="input_text">';
387
-		else
388
-			echo '
403
+		} else {
404
+					echo '
389 405
 							<a href="', $scripturl, '?action=admin;area=permissions;sa=index;pid=', $profile['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $profile['name'], '</a>';
406
+		}
390 407
 
391 408
 		echo '
392 409
 						</td>
@@ -406,9 +423,10 @@  discard block
 block discarded – undo
406 423
 				<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
407 424
 				<input type="hidden" name="', $context['admin-mpp_token_var'], '" value="', $context['admin-mpp_token'], '">';
408 425
 
409
-	if ($context['can_edit_something'])
410
-		echo '
426
+	if ($context['can_edit_something']) {
427
+			echo '
411 428
 				<input type="submit" name="rename" value="', empty($context['show_rename_boxes']) ? $txt['permissions_profile_rename'] : $txt['permissions_commit'], '" class="button_submit">';
429
+	}
412 430
 
413 431
 	echo '
414 432
 				<input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" class="button_submit" ', !empty($context['show_rename_boxes']) ? ' style="display:none"' : '', '/>
@@ -433,9 +451,10 @@  discard block
 block discarded – undo
433 451
 					<dd>
434 452
 						<select name="copy_from">';
435 453
 
436
-	foreach ($context['profiles'] as $id => $profile)
437
-		echo '
454
+	foreach ($context['profiles'] as $id => $profile) {
455
+			echo '
438 456
 							<option value="', $id, '">', $profile['name'], '</option>';
457
+	}
439 458
 
440 459
 	echo '
441 460
 						</select>
@@ -463,8 +482,7 @@  discard block
 block discarded – undo
463 482
 		<div class="errorbox">
464 483
 			', sprintf($txt['permission_cannot_edit'], $scripturl . '?action=admin;area=permissions;sa=profiles'), '
465 484
 		</div>';
466
-	}
467
-	else
485
+	} else
468 486
 	{
469 487
 		echo '
470 488
 		<script>
@@ -484,21 +502,23 @@  discard block
 block discarded – undo
484 502
 	<div id="admincenter">
485 503
 		<form id="permissions" action="', $scripturl, '?action=admin;area=permissions;sa=modify2;group=', $context['group']['id'], ';pid=', $context['profile']['id'], '" method="post" accept-charset="', $context['character_set'], '" name="permissionForm" onsubmit="return warnAboutDeny();">';
486 504
 
487
-	if (!empty($modSettings['permission_enable_deny']) && $context['group']['id'] != -1)
488
-		echo '
505
+	if (!empty($modSettings['permission_enable_deny']) && $context['group']['id'] != -1) {
506
+			echo '
489 507
 			<div class="information">
490 508
 				', $txt['permissions_option_desc'], '
491 509
 			</div>';
510
+	}
492 511
 
493 512
 	echo '
494 513
 			<div class="cat_bar">
495 514
 				<h3 class="catbg">';
496
-	if ($context['permission_type'] == 'board')
497
-		echo '
515
+	if ($context['permission_type'] == 'board') {
516
+			echo '
498 517
 				', $txt['permissions_local_for'], ' &quot;', $context['group']['name'], '&quot; ', $txt['permissions_on'], ' &quot;', $context['profile']['name'], '&quot;';
499
-	else
500
-		echo '
518
+	} else {
519
+			echo '
501 520
 				', $context['permission_type'] == 'membergroup' ? $txt['permissions_general'] : $txt['permissions_board'], ' - &quot;', $context['group']['name'], '&quot;';
521
+	}
502 522
 	echo '
503 523
 				</h3>
504 524
 			</div>';
@@ -521,15 +541,17 @@  discard block
 block discarded – undo
521 541
 		template_modify_group_display('board');
522 542
 	}
523 543
 
524
-	if ($context['profile']['can_modify'])
525
-		echo '
544
+	if ($context['profile']['can_modify']) {
545
+			echo '
526 546
 			<div class="padding">
527 547
 				<input type="submit" value="', $txt['permissions_commit'], '" class="button_submit">
528 548
 			</div>';
549
+	}
529 550
 
530
-	foreach ($context['hidden_perms'] as $hidden_perm)
531
-		echo '
551
+	foreach ($context['hidden_perms'] as $hidden_perm) {
552
+			echo '
532 553
 			<input type="hidden" name="perm[', $hidden_perm[0], '][', $hidden_perm[1], ']" value="', $hidden_perm[2], '">';
554
+	}
533 555
 
534 556
 	echo '
535 557
 			<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -557,17 +579,19 @@  discard block
 block discarded – undo
557 579
 
558 580
 		foreach ($column as $permissionGroup)
559 581
 		{
560
-			if (empty($permissionGroup['permissions']))
561
-				continue;
582
+			if (empty($permissionGroup['permissions'])) {
583
+							continue;
584
+			}
562 585
 
563 586
 			// Are we likely to have something in this group to display or is it all hidden?
564 587
 			$has_display_content = false;
565 588
 			if (!$permissionGroup['hidden'])
566 589
 			{
567 590
 				// Before we go any further check we are going to have some data to print otherwise we just have a silly heading.
568
-				foreach ($permissionGroup['permissions'] as $permission)
569
-					if (!$permission['hidden'])
591
+				foreach ($permissionGroup['permissions'] as $permission) {
592
+									if (!$permission['hidden'])
570 593
 						$has_display_content = true;
594
+				}
571 595
 
572 596
 				if ($has_display_content)
573 597
 				{
@@ -576,10 +600,11 @@  discard block
 block discarded – undo
576 600
 							<th></th>
577 601
 							<th', $context['group']['id'] == -1 ? ' colspan="2"' : '', ' class="smalltext">', $permissionGroup['name'], '</th>';
578 602
 
579
-					if ($context['group']['id'] != -1)
580
-						echo '
603
+					if ($context['group']['id'] != -1) {
604
+											echo '
581 605
 							<th>', $txt['permissions_option_own'], '</th>
582 606
 							<th>', $txt['permissions_option_any'], '</th>';
607
+					}
583 608
 
584 609
 						echo '
585 610
 						</tr>';
@@ -602,17 +627,18 @@  discard block
 block discarded – undo
602 627
 						// Guests can't do their own thing.
603 628
 						if ($context['group']['id'] != -1)
604 629
 						{
605
-							if (empty($modSettings['permission_enable_deny']))
606
-								echo '
630
+							if (empty($modSettings['permission_enable_deny'])) {
631
+															echo '
607 632
 								<input type="checkbox" name="perm[', $permission_type['id'], '][', $permission['own']['id'], ']"', $permission['own']['select'] == 'on' ? ' checked="checked"' : '', ' value="on" id="', $permission['own']['id'], '_on" class="input_check" ', $disable_field, '/>';
608
-							else
633
+							} else
609 634
 							{
610 635
 								echo '
611 636
 								<select name="perm[', $permission_type['id'], '][', $permission['own']['id'], ']" ', $disable_field, '>';
612 637
 
613
-								foreach (array('on', 'off', 'deny') as $c)
614
-									echo '
638
+								foreach (array('on', 'off', 'deny') as $c) {
639
+																	echo '
615 640
 									<option ', $permission['own']['select'] == $c ? ' selected' : '', ' value="', $c, '">', $txt['permissions_option_' . $c], '</option>';
641
+								}
616 642
 							echo '
617 643
 								</select>';
618 644
 							}
@@ -622,39 +648,41 @@  discard block
 block discarded – undo
622 648
 							<td>';
623 649
 						}
624 650
 
625
-						if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1)
626
-							echo '
651
+						if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1) {
652
+													echo '
627 653
 								<input type="checkbox" name="perm[', $permission_type['id'], '][', $permission['any']['id'], ']"', $permission['any']['select'] == 'on' ? ' checked="checked"' : '', ' value="on" class="input_check" ', $disable_field, '/>';
628
-						else
654
+						} else
629 655
 						{
630 656
 							echo '
631 657
 								<select name="perm[', $permission_type['id'], '][', $permission['any']['id'], ']" ', $disable_field, '>';
632 658
 
633
-							foreach (array('on', 'off', 'deny') as $c)
634
-								echo '
659
+							foreach (array('on', 'off', 'deny') as $c) {
660
+															echo '
635 661
 									<option ', $permission['any']['select'] == $c ? ' selected' : '', ' value="', $c, '">', $txt['permissions_option_' . $c], '</option>';
662
+							}
636 663
 							echo '
637 664
 								</select>';
638 665
 						}
639
-					}
640
-					else
666
+					} else
641 667
 					{
642
-						if ($context['group']['id'] != -1)
643
-							echo '
668
+						if ($context['group']['id'] != -1) {
669
+													echo '
644 670
 							</td>
645 671
 							<td>';
672
+						}
646 673
 
647
-						if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1)
648
-							echo '
674
+						if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1) {
675
+													echo '
649 676
 								<input type="checkbox" name="perm[', $permission_type['id'], '][', $permission['id'], ']"', $permission['select'] == 'on' ? ' checked="checked"' : '', ' value="on" class="input_check" ', $disable_field, '/>';
650
-						else
677
+						} else
651 678
 						{
652 679
 							echo '
653 680
 								<select name="perm[', $permission_type['id'], '][', $permission['id'], ']" ', $disable_field, '>';
654 681
 
655
-							foreach (array('on', 'off', 'deny') as $c)
656
-								echo '
682
+							foreach (array('on', 'off', 'deny') as $c) {
683
+															echo '
657 684
 									<option ', $permission['select'] == $c ? ' selected' : '', ' value="', $c, '">', $txt['permissions_option_' . $c], '</option>';
685
+							}
658 686
 							echo '
659 687
 								</select>';
660 688
 						}
@@ -684,11 +712,11 @@  discard block
 block discarded – undo
684 712
 	echo '
685 713
 											<fieldset id="', $context['current_permission'], '">
686 714
 												<legend><a href="javascript:void(0);" onclick="document.getElementById(\'', $context['current_permission'], '\').style.display = \'none\';document.getElementById(\'', $context['current_permission'], '_groups_link\').style.display = \'block\'; return false;" class="toggle_up"> ', $txt['avatar_select_permission'], '</a></legend>';
687
-	if (empty($modSettings['permission_enable_deny']))
688
-		echo '
715
+	if (empty($modSettings['permission_enable_deny'])) {
716
+			echo '
689 717
 												<ul>';
690
-	else
691
-		echo '
718
+	} else {
719
+			echo '
692 720
 												<div class="information">', $txt['permissions_option_desc'], '</div>
693 721
 												<dl class="settings">
694 722
 													<dt>
@@ -698,46 +726,51 @@  discard block
 block discarded – undo
698 726
 													</dt>
699 727
 													<dd>
700 728
 													</dd>';
729
+	}
701 730
 	foreach ($context['member_groups'] as $group)
702 731
 	{
703
-		if (!empty($modSettings['permission_enable_deny']))
704
-			echo '
732
+		if (!empty($modSettings['permission_enable_deny'])) {
733
+					echo '
705 734
 													<dt>';
706
-		else
707
-			echo '
735
+		} else {
736
+					echo '
708 737
 													<li>';
738
+		}
709 739
 
710
-		if (empty($modSettings['permission_enable_deny']))
711
-			echo '
740
+		if (empty($modSettings['permission_enable_deny'])) {
741
+					echo '
712 742
 														<input type="checkbox" name="', $context['current_permission'], '[', $group['id'], ']" value="on"', $group['status'] == 'on' ? ' checked' : '', ' class="input_check">';
713
-		else
714
-			echo '
743
+		} else {
744
+					echo '
715 745
 														<span class="perms"><input type="radio" name="', $context['current_permission'], '[', $group['id'], ']" value="on"', $group['status'] == 'on' ? ' checked' : '', ' class="input_radio"></span>
716 746
 														<span class="perms"><input type="radio" name="', $context['current_permission'], '[', $group['id'], ']" value="off"', $group['status'] == 'off' ? ' checked' : '', ' class="input_radio"></span>
717 747
 														<span class="perms"><input type="radio" name="', $context['current_permission'], '[', $group['id'], ']" value="deny"', $group['status'] == 'deny' ? ' checked' : '', ' class="input_radio"></span>';
748
+		}
718 749
 
719
-		if (!empty($modSettings['permission_enable_deny']))
720
-			echo '
750
+		if (!empty($modSettings['permission_enable_deny'])) {
751
+					echo '
721 752
 													</dt>
722 753
 													<dd>
723 754
 														<span', $group['is_postgroup'] ? ' style="font-style: italic;"' : '', '>', $group['name'], '</span>
724 755
 													</dd>';
725
-		else
726
-			echo '
756
+		} else {
757
+					echo '
727 758
 														<span', $group['is_postgroup'] ? ' style="font-style: italic;"' : '', '>', $group['name'], '</span>
728 759
 													</li>';
760
+		}
729 761
 	}
730 762
 
731
-	if (empty($modSettings['permission_enable_deny']))
732
-		echo '
763
+	if (empty($modSettings['permission_enable_deny'])) {
764
+			echo '
733 765
 													<li>
734 766
 														<input type="checkbox" class="input_check" onclick="invertAll(this, this.form, \''. $context['current_permission']. '[\');">
735 767
 														<span>', $txt['check_all'], '</span>
736 768
 													</li>
737 769
 												</ul>';
738
-	else
739
-		echo '
770
+	} else {
771
+			echo '
740 772
 												</dl>';
773
+	}
741 774
 
742 775
 	echo '
743 776
 											</fieldset>
@@ -777,9 +810,10 @@  discard block
 block discarded – undo
777 810
 	if (!empty($modSettings['postmod_active']))
778 811
 	{
779 812
 		// Got advanced permissions - if so warn!
780
-		if (!empty($modSettings['permission_enable_deny']))
781
-			echo '
813
+		if (!empty($modSettings['permission_enable_deny'])) {
814
+					echo '
782 815
 							<div class="information">', $txt['permissions_post_moderation_deny_note'], '</div>';
816
+		}
783 817
 
784 818
 		echo '
785 819
 							<div class="padding">
@@ -794,10 +828,11 @@  discard block
 block discarded – undo
794 828
 									', $txt['permissions_post_moderation_select'], ':
795 829
 									<select name="pid" onchange="document.forms.postmodForm.submit();">';
796 830
 
797
-		foreach ($context['profiles'] as $profile)
798
-			if ($profile['can_modify'])
831
+		foreach ($context['profiles'] as $profile) {
832
+					if ($profile['can_modify'])
799 833
 				echo '
800 834
 										<option value="', $profile['id'], '"', $profile['id'] == $context['current_profile'] ? ' selected' : '', '>', $profile['name'], '</option>';
835
+		}
801 836
 
802 837
 		echo '
803 838
 									</select>
@@ -818,11 +853,12 @@  discard block
 block discarded – undo
818 853
 											', $txt['permissions_post_moderation_replies_any'], '
819 854
 										</th>';
820 855
 
821
-		if ($modSettings['attachmentEnable'] == 1)
822
-			echo '
856
+		if ($modSettings['attachmentEnable'] == 1) {
857
+					echo '
823 858
 										<th class="centercol" colspan="3">
824 859
 											', $txt['permissions_post_moderation_attachments'], '
825 860
 										</th>';
861
+		}
826 862
 
827 863
 		echo '
828 864
 									</tr>
@@ -840,11 +876,12 @@  discard block
 block discarded – undo
840 876
 										<th><span class="generic_icons post_moderation_moderate"></span></th>
841 877
 										<th><span class="generic_icons post_moderation_deny"></span></th>';
842 878
 
843
-		if ($modSettings['attachmentEnable'] == 1)
844
-			echo '
879
+		if ($modSettings['attachmentEnable'] == 1) {
880
+					echo '
845 881
 										<th><span class="generic_icons post_moderation_allow"></span></th>
846 882
 										<th><span class="generic_icons post_moderation_moderate"></span></th>
847 883
 										<th><span class="generic_icons post_moderation_deny"></span></th>';
884
+		}
848 885
 
849 886
 		echo '
850 887
 									</tr>
@@ -857,9 +894,10 @@  discard block
 block discarded – undo
857 894
 									<tr class="windowbg">
858 895
 										<td class="half_table">
859 896
 											<span ', ($group['color'] ? 'style="color: ' . $group['color'] . '"' : ''), '>', $group['name'], '</span>';
860
-				if (!empty($group['children']))
861
-					echo '
897
+				if (!empty($group['children'])) {
898
+									echo '
862 899
 											<br><span class="smalltext">', $txt['permissions_includes_inherited'], ': &quot;', implode('&quot;, &quot;', $group['children']), '&quot;</span>';
900
+				}
863 901
 
864 902
 				echo '
865 903
 										</td>
@@ -872,8 +910,7 @@  discard block
 block discarded – undo
872 910
 				{
873 911
 				echo '
874 912
 										<td colspan="3"></td>';
875
-				}
876
-				else
913
+				} else
877 914
 				{
878 915
 					echo '
879 916
 										<td class="centercol"><input type="radio" name="replies_own[', $group['id'], ']" value="allow"', $group['replies_own'] == 'allow' ? ' checked' : '', ' class="input_radio"></td>
Please login to merge, or discard this patch.
Themes/default/Poll.template.php 1 patch
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
46 46
 				<h3 class="catbg">', $context['page_title'], '</h3>
47 47
 			</div>';
48 48
 
49
-	if (!empty($context['poll_error']['messages']))
50
-		echo '
49
+	if (!empty($context['poll_error']['messages'])) {
50
+			echo '
51 51
 			<div class="errorbox">
52 52
 				<dl class="poll_error">
53 53
 					<dt>
@@ -58,6 +58,7 @@  discard block
 block discarded – undo
58 58
 					</dt>
59 59
 				</dl>
60 60
 			</div>';
61
+	}
61 62
 
62 63
 	echo '
63 64
 			<div>
@@ -79,8 +80,9 @@  discard block
 block discarded – undo
79 80
 								<input type="text" name="options[', $choice['id'], ']" id="options-', $choice['id'], '" value="', $choice['label'], '" class="input_text" size="80" maxlength="255">';
80 81
 
81 82
 		// Does this option have a vote count yet, or is it new?
82
-		if ($choice['votes'] != -1)
83
-			echo ' (', $choice['votes'], ' ', $txt['votes'], ')';
83
+		if ($choice['votes'] != -1) {
84
+					echo ' (', $choice['votes'], ' ', $txt['votes'], ')';
85
+		}
84 86
 
85 87
 		echo '
86 88
 							</dd>';
@@ -118,14 +120,15 @@  discard block
 block discarded – undo
118 120
 								<input type="checkbox" id="poll_change_vote" name="poll_change_vote"', !empty($context['poll']['change_vote']) ? ' checked' : '', ' class="input_check">
119 121
 							</dd>';
120 122
 
121
-		if ($context['poll']['guest_vote_allowed'])
122
-			echo '
123
+		if ($context['poll']['guest_vote_allowed']) {
124
+					echo '
123 125
 							<dt>
124 126
 								<label for="poll_guest_vote">', $txt['poll_guest_vote'], ':</label>
125 127
 							</dt>
126 128
 							<dd>
127 129
 								<input type="checkbox" id="poll_guest_vote" name="poll_guest_vote"', !empty($context['poll']['guest_vote']) ? ' checked' : '', ' class="input_check">
128 130
 							</dd>';
131
+		}
129 132
 	}
130 133
 
131 134
 	echo '
@@ -140,12 +143,13 @@  discard block
 block discarded – undo
140 143
 						</dl>
141 144
 					</fieldset>';
142 145
 	// If this is an edit, we can allow them to reset the vote counts.
143
-	if ($context['is_edit'])
144
-		echo '
146
+	if ($context['is_edit']) {
147
+			echo '
145 148
 					<fieldset id="poll_reset">
146 149
 						<legend>', $txt['reset_votes'], '</legend>
147 150
 						<input type="checkbox" name="resetVoteCount" value="on" class="input_check"> ' . $txt['reset_votes_check'] . '
148 151
 					</fieldset>';
152
+	}
149 153
 	echo '
150 154
 					<input type="submit" name="post" value="', $txt['save'], '" onclick="return submitThisOnce(this);" accesskey="s" class="button_submit">
151 155
 				</div>
Please login to merge, or discard this patch.