Completed
Branch release-2.1 (e49a83)
by Michael
08:59
created
Themes/default/Display.template.php 1 patch
Braces   +202 added lines, -137 removed lines patch added patch discarded remove patch
@@ -51,11 +51,13 @@  discard block
 block discarded – undo
51 51
 				<p>';
52 52
 
53 53
 		// Show just numbers...?
54
-		if ($settings['display_who_viewing'] == 1)
55
-				echo count($context['view_members']), ' ', count($context['view_members']) == 1 ? $txt['who_member'] : $txt['members'];
54
+		if ($settings['display_who_viewing'] == 1) {
55
+						echo count($context['view_members']), ' ', count($context['view_members']) == 1 ? $txt['who_member'] : $txt['members'];
56
+		}
56 57
 		// Or show the actual people viewing the topic?
57
-		else
58
-			echo empty($context['view_members_list']) ? '0 ' . $txt['members'] : implode(', ', $context['view_members_list']) . ((empty($context['view_num_hidden']) || $context['can_moderate_forum']) ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')');
58
+		else {
59
+					echo empty($context['view_members_list']) ? '0 ' . $txt['members'] : implode(', ', $context['view_members_list']) . ((empty($context['view_num_hidden']) || $context['can_moderate_forum']) ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')');
60
+		}
59 61
 
60 62
 		// Now show how many guests are here too.
61 63
 		echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_topic'], '
@@ -93,10 +95,11 @@  discard block
 block discarded – undo
93 95
 						<dt class="', $option['voted_this'] ? ' voted' : '', '">', $option['option'], '</dt>
94 96
 						<dd class="statsbar', $option['voted_this'] ? ' voted' : '', '">';
95 97
 
96
-				if ($context['allow_results_view'])
97
-					echo '
98
+				if ($context['allow_results_view']) {
99
+									echo '
98 100
 							', $option['bar_ndt'], '
99 101
 							<span class="percentage">', $option['votes'], ' (', $option['percent'], '%)</span>';
102
+				}
100 103
 
101 104
 				echo '
102 105
 						</dd>';
@@ -105,9 +108,10 @@  discard block
 block discarded – undo
105 108
 			echo '
106 109
 					</dl>';
107 110
 
108
-			if ($context['allow_results_view'])
109
-				echo '
111
+			if ($context['allow_results_view']) {
112
+							echo '
110 113
 						<p><strong>', $txt['poll_total_voters'], ':</strong> ', $context['poll']['total_votes'], '</p>';
114
+			}
111 115
 		}
112 116
 		// They are allowed to vote! Go to it!
113 117
 		else
@@ -116,17 +120,19 @@  discard block
 block discarded – undo
116 120
 						<form action="', $scripturl, '?action=vote;topic=', $context['current_topic'], '.', $context['start'], ';poll=', $context['poll']['id'], '" method="post" accept-charset="', $context['character_set'], '">';
117 121
 
118 122
 			// Show a warning if they are allowed more than one option.
119
-			if ($context['poll']['allowed_warning'])
120
-				echo '
123
+			if ($context['poll']['allowed_warning']) {
124
+							echo '
121 125
 							<p class="smallpadding">', $context['poll']['allowed_warning'], '</p>';
126
+			}
122 127
 
123 128
 			echo '
124 129
 							<ul class="options">';
125 130
 
126 131
 			// Show each option with its button - a radio likely.
127
-			foreach ($context['poll']['options'] as $option)
128
-				echo '
132
+			foreach ($context['poll']['options'] as $option) {
133
+							echo '
129 134
 								<li>', $option['vote_button'], ' <label for="', $option['id'], '">', $option['option'], '</label></li>';
135
+			}
130 136
 
131 137
 			echo '
132 138
 							</ul>
@@ -138,9 +144,10 @@  discard block
 block discarded – undo
138 144
 		}
139 145
 
140 146
 		// Is the clock ticking?
141
-		if (!empty($context['poll']['expire_time']))
142
-			echo '
147
+		if (!empty($context['poll']['expire_time'])) {
148
+					echo '
143 149
 						<p><strong>', ($context['poll']['is_expired'] ? $txt['poll_expired_on'] : $txt['poll_expires_on']), ':</strong> ', $context['poll']['expire_time'], '</p>';
150
+		}
144 151
 
145 152
 		echo '
146 153
 					</div>
@@ -164,11 +171,12 @@  discard block
 block discarded – undo
164 171
 			<div class="information">
165 172
 				<ul>';
166 173
 
167
-		foreach ($context['linked_calendar_events'] as $event)
168
-			echo '
174
+		foreach ($context['linked_calendar_events'] as $event) {
175
+					echo '
169 176
 					<li>
170 177
 						', ($event['can_edit'] ? '<a href="' . $event['modify_href'] . '"><span class="generic_icons calendar_modify"></span></a> ' : ''), '<strong>', $event['title'], '</strong>: ', $event['start_date'], ($event['start_date'] != $event['end_date'] ? ' - ' . $event['end_date'] : ''), '
171 178
 					</li>';
179
+		}
172 180
 
173 181
 		echo '
174 182
 				</ul>
@@ -203,8 +211,9 @@  discard block
 block discarded – undo
203 211
 	$context['removableMessageIDs'] = array();
204 212
 
205 213
 	// Get all the messages...
206
-	while ($message = $context['get_message']())
207
-		template_single_post($message);
214
+	while ($message = $context['get_message']()) {
215
+			template_single_post($message);
216
+	}
208 217
 
209 218
 	echo '
210 219
 				</form>
@@ -241,8 +250,9 @@  discard block
 block discarded – undo
241 250
 			<div id="display_jump_to">&nbsp;</div>';
242 251
 
243 252
 	// Show quickreply
244
-	if ($context['can_reply'])
245
-	template_quickreply();
253
+	if ($context['can_reply']) {
254
+		template_quickreply();
255
+	}
246 256
 
247 257
 	// User action pop on mobile screen (or actually small screen), this uses responsive css does not check mobile device.
248 258
 	echo '
@@ -255,8 +265,8 @@  discard block
 block discarded – undo
255 265
 			</div>';
256 266
 
257 267
 	// Show the moderation button & pop only if user can moderate
258
-	if ($context['can_moderate_forum'] || $context['user']['is_mod'])
259
-		echo '
268
+	if ($context['can_moderate_forum'] || $context['user']['is_mod']) {
269
+			echo '
260 270
 			<div id="mobile_moderation" class="popup_container">
261 271
 				<div class="popup_window description">
262 272
 					<div class="popup_heading">', $txt['mobile_moderation'],'
@@ -266,6 +276,7 @@  discard block
 block discarded – undo
266 276
 					</div>
267 277
 				</div>
268 278
 			</div>';
279
+	}
269 280
 
270 281
 		echo '
271 282
 				<script>';
@@ -389,9 +400,10 @@  discard block
 block discarded – undo
389 400
 						});
390 401
 					}';
391 402
 
392
-	if (!empty($context['ignoredMsgs']))
393
-		echo '
403
+	if (!empty($context['ignoredMsgs'])) {
404
+			echo '
394 405
 					ignore_toggles([', implode(', ', $context['ignoredMsgs']), '], ', JavaScriptEscape($txt['show_ignore_user_post']), ');';
406
+	}
395 407
 
396 408
 	echo '
397 409
 				</script>';
@@ -408,8 +420,9 @@  discard block
 block discarded – undo
408 420
 
409 421
 	$ignoring = false;
410 422
 
411
-	if ($message['can_remove'])
412
-		$context['removableMessageIDs'][] = $message['id'];
423
+	if ($message['can_remove']) {
424
+			$context['removableMessageIDs'][] = $message['id'];
425
+	}
413 426
 
414 427
 	// Are we ignoring this message?
415 428
 	if (!empty($message['is_ignored']))
@@ -435,9 +448,10 @@  discard block
 block discarded – undo
435 448
 							<div class="custom_fields_above_member">
436 449
 								<ul class="nolist">';
437 450
 
438
-		foreach ($message['custom_fields']['above_member'] as $custom)
439
-			echo '
451
+		foreach ($message['custom_fields']['above_member'] as $custom) {
452
+					echo '
440 453
 									<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
454
+		}
441 455
 
442 456
 		echo '
443 457
 								</ul>
@@ -448,9 +462,10 @@  discard block
 block discarded – undo
448 462
 									<h4>';
449 463
 
450 464
 	// Show online and offline buttons?
451
-	if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest'])
452
-		echo '
465
+	if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest']) {
466
+			echo '
453 467
 								', $context['can_send_pm'] ? '<a href="' . $message['member']['online']['href'] . '" title="' . $message['member']['online']['label'] . '">' : '', '<span class="' . ($message['member']['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $message['member']['online']['text'] . '"></span>', $context['can_send_pm'] ? '</a>' : '';
468
+	}
454 469
 
455 470
 
456 471
 	// Show a link to the member's profile.
@@ -463,51 +478,59 @@  discard block
 block discarded – undo
463 478
 
464 479
 
465 480
 	// Show the user's avatar.
466
-	if (!empty($modSettings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image']))
467
-		echo '
481
+	if (!empty($modSettings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image'])) {
482
+			echo '
468 483
 								<li class="avatar">
469 484
 									<a href="', $message['member']['href'], '">', $message['member']['avatar']['image'], '</a>
470 485
 								</li>';
486
+	}
471 487
 
472 488
 	// Are there any custom fields below the avatar?
473
-	if (!empty($message['custom_fields']['below_avatar']))
474
-		foreach ($message['custom_fields']['below_avatar'] as $custom)
489
+	if (!empty($message['custom_fields']['below_avatar'])) {
490
+			foreach ($message['custom_fields']['below_avatar'] as $custom)
475 491
 			echo '
476 492
 								<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
493
+	}
477 494
 
478 495
 	// Show the post group icons, but not for guests.
479
-	if (!$message['member']['is_guest'])
480
-		echo '
496
+	if (!$message['member']['is_guest']) {
497
+			echo '
481 498
 								<li class="icons">', $message['member']['group_icons'], '</li>';
499
+	}
482 500
 
483 501
 	// Show the member's primary group (like 'Administrator') if they have one.
484
-	if (!empty($message['member']['group']))
485
-		echo '
502
+	if (!empty($message['member']['group'])) {
503
+			echo '
486 504
 								<li class="membergroup">', $message['member']['group'], '</li>';
505
+	}
487 506
 
488 507
 	// Show the member's custom title, if they have one.
489
-	if (!empty($message['member']['title']))
490
-		echo '
508
+	if (!empty($message['member']['title'])) {
509
+			echo '
491 510
 								<li class="title">', $message['member']['title'], '</li>';
511
+	}
492 512
 
493 513
 	// Don't show these things for guests.
494 514
 	if (!$message['member']['is_guest'])
495 515
 	{
496 516
 
497 517
 		// 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.
498
-		if ((empty($modSettings['hide_post_group']) || empty($message['member']['group'])) && !empty($message['member']['post_group']))
499
-			echo '
518
+		if ((empty($modSettings['hide_post_group']) || empty($message['member']['group'])) && !empty($message['member']['post_group'])) {
519
+					echo '
500 520
 								<li class="postgroup">', $message['member']['post_group'], '</li>';
521
+		}
501 522
 
502 523
 		// Show how many posts they have made.
503
-		if (!isset($context['disabled_fields']['posts']))
504
-			echo '
524
+		if (!isset($context['disabled_fields']['posts'])) {
525
+					echo '
505 526
 								<li class="postcount">', $txt['member_postcount'], ': ', $message['member']['posts'], '</li>';
527
+		}
506 528
 
507 529
 		// Show their personal text?
508
-		if (!empty($modSettings['show_blurb']) && !empty($message['member']['blurb']))
509
-			echo '
530
+		if (!empty($modSettings['show_blurb']) && !empty($message['member']['blurb'])) {
531
+					echo '
510 532
 								<li class="blurb">', $message['member']['blurb'], '</li>';
533
+		}
511 534
 
512 535
 		// Any custom fields to show as icons?
513 536
 		if (!empty($message['custom_fields']['icons']))
@@ -516,9 +539,10 @@  discard block
 block discarded – undo
516 539
 								<li class="im_icons">
517 540
 									<ol>';
518 541
 
519
-			foreach ($message['custom_fields']['icons'] as $custom)
520
-				echo '
542
+			foreach ($message['custom_fields']['icons'] as $custom) {
543
+							echo '
521 544
 										<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
545
+			}
522 546
 
523 547
 			echo '
524 548
 									</ol>
@@ -533,19 +557,22 @@  discard block
 block discarded – undo
533 557
 									<ol class="profile_icons">';
534 558
 
535 559
 			// Don't show an icon if they haven't specified a website.
536
-			if (!empty($message['member']['website']['url']) && !isset($context['disabled_fields']['website']))
537
-				echo '
560
+			if (!empty($message['member']['website']['url']) && !isset($context['disabled_fields']['website'])) {
561
+							echo '
538 562
 										<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>';
563
+			}
539 564
 
540 565
 			// Since we know this person isn't a guest, you *can* message them.
541
-			if ($context['can_send_pm'])
542
-				echo '
566
+			if ($context['can_send_pm']) {
567
+							echo '
543 568
 										<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>';
569
+			}
544 570
 
545 571
 			// Show the email if necessary
546
-			if (!empty($message['member']['email']) && $message['member']['show_email'])
547
-				echo '
572
+			if (!empty($message['member']['email']) && $message['member']['show_email']) {
573
+							echo '
548 574
 										<li class="email"><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>';
575
+			}
549 576
 
550 577
 				echo '
551 578
 									</ol>
@@ -553,48 +580,56 @@  discard block
 block discarded – undo
553 580
 		}
554 581
 
555 582
 		// Any custom fields for standard placement?
556
-		if (!empty($message['custom_fields']['standard']))
557
-			foreach ($message['custom_fields']['standard'] as $custom)
583
+		if (!empty($message['custom_fields']['standard'])) {
584
+					foreach ($message['custom_fields']['standard'] as $custom)
558 585
 				echo '
559 586
 								<li class="custom ', $custom['col_name'] ,'">', $custom['title'], ': ', $custom['value'], '</li>';
587
+		}
560 588
 
561 589
 	}
562 590
 	// Otherwise, show the guest's email.
563
-	elseif (!empty($message['member']['email']) && $message['member']['show_email'])
564
-		echo '
591
+	elseif (!empty($message['member']['email']) && $message['member']['show_email']) {
592
+			echo '
565 593
 								<li class="email"><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>';
594
+	}
566 595
 
567 596
 	// Show the IP to this user for this post - because you can moderate?
568
-	if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip']))
569
-		echo '
597
+	if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip'])) {
598
+			echo '
570 599
 								<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>';
600
+	}
571 601
 
572 602
 	// Or, should we show it because this is you?
573
-	elseif ($message['can_see_ip'])
574
-		echo '
603
+	elseif ($message['can_see_ip']) {
604
+			echo '
575 605
 								<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>';
606
+	}
576 607
 
577 608
 	// Okay, are you at least logged in? Then we can show something about why IPs are logged...
578
-	elseif (!$context['user']['is_guest'])
579
-		echo '
609
+	elseif (!$context['user']['is_guest']) {
610
+			echo '
580 611
 								<li class="poster_ip"><a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help">', $txt['logged'], '</a></li>';
612
+	}
581 613
 
582 614
 	// Otherwise, you see NOTHING!
583
-	else
584
-		echo '
615
+	else {
616
+			echo '
585 617
 								<li class="poster_ip">', $txt['logged'], '</li>';
618
+	}
586 619
 
587 620
 	// Are we showing the warning status?
588 621
 	// Don't show these things for guests.
589
-	if (!$message['member']['is_guest'] && $message['member']['can_see_warning'])
590
-		echo '
622
+	if (!$message['member']['is_guest'] && $message['member']['can_see_warning']) {
623
+			echo '
591 624
 								<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>';
625
+	}
592 626
 
593 627
 	// Are there any custom fields to show at the bottom of the poster info?
594
-	if (!empty($message['custom_fields']['bottom_poster']))
595
-		foreach ($message['custom_fields']['bottom_poster'] as $custom)
628
+	if (!empty($message['custom_fields']['bottom_poster'])) {
629
+			foreach ($message['custom_fields']['bottom_poster'] as $custom)
596 630
 			echo '
597 631
 									<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
632
+	}
598 633
 
599 634
 	// Poster info ends.
600 635
 	echo '
@@ -623,9 +658,10 @@  discard block
 block discarded – undo
623 658
 	echo '
624 659
 									<span class="smalltext modified" id="modified_', $message['id'], '">';
625 660
 
626
-	if (!empty($modSettings['show_modify']) && !empty($message['modified']['name']))
627
-		echo
661
+	if (!empty($modSettings['show_modify']) && !empty($message['modified']['name'])) {
662
+			echo
628 663
 										$message['modified']['last_edit_text'];
664
+	}
629 665
 
630 666
 	echo '
631 667
 									</span>';
@@ -636,22 +672,24 @@  discard block
 block discarded – undo
636 672
 							</div>';
637 673
 
638 674
 	// Ignoring this user? Hide the post.
639
-	if ($ignoring)
640
-		echo '
675
+	if ($ignoring) {
676
+			echo '
641 677
 							<div id="msg_', $message['id'], '_ignored_prompt">
642 678
 								', $txt['ignoring_user'], '
643 679
 								<a href="#" id="msg_', $message['id'], '_ignored_link" style="display: none;">', $txt['show_ignore_user_post'], '</a>
644 680
 							</div>';
681
+	}
645 682
 
646 683
 	// Show the post itself, finally!
647 684
 	echo '
648 685
 							<div class="post">';
649 686
 
650
-	if (!$message['approved'] && $message['member']['id'] != 0 && $message['member']['id'] == $context['user']['id'])
651
-		echo '
687
+	if (!$message['approved'] && $message['member']['id'] != 0 && $message['member']['id'] == $context['user']['id']) {
688
+			echo '
652 689
 								<div class="approve_post">
653 690
 									', $txt['post_awaiting_approval'], '
654 691
 								</div>';
692
+	}
655 693
 	echo '
656 694
 								<div class="inner" data-msgid="', $message['id'], '" id="msg_', $message['id'], '"', $ignoring ? ' style="display:none;"' : '', '>', $message['body'], '</div>
657 695
 							</div>';
@@ -668,9 +706,9 @@  discard block
 block discarded – undo
668 706
 		foreach ($message['attachment'] as $attachment)
669 707
 		{
670 708
 			// Do we want this attachment to not be showed here?
671
-			if (!empty($modSettings['dont_show_attach_under_post']) && !empty($context['show_attach_under_post'][$attachment['id']]))
672
-				continue;
673
-			elseif (!$div_output)
709
+			if (!empty($modSettings['dont_show_attach_under_post']) && !empty($context['show_attach_under_post'][$attachment['id']])) {
710
+							continue;
711
+			} elseif (!$div_output)
674 712
 			{
675 713
 				$div_output = true;
676 714
 
@@ -686,9 +724,10 @@  discard block
 block discarded – undo
686 724
 								<fieldset>
687 725
 									<legend>', $txt['attach_awaiting_approve'];
688 726
 
689
-				if ($context['can_approve'])
690
-					echo '
727
+				if ($context['can_approve']) {
728
+									echo '
691 729
 										&nbsp;[<a href="', $scripturl, '?action=attachapprove;sa=all;mid=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve_all'], '</a>]';
730
+				}
692 731
 
693 732
 				echo '
694 733
 									</legend>';
@@ -702,12 +741,13 @@  discard block
 block discarded – undo
702 741
 				echo '
703 742
 										<div class="attachments_top">';
704 743
 
705
-				if ($attachment['thumbnail']['has_thumb'])
706
-					echo '
744
+				if ($attachment['thumbnail']['has_thumb']) {
745
+									echo '
707 746
 											<a href="', $attachment['href'], ';image" id="link_', $attachment['id'], '" onclick="', $attachment['thumbnail']['javascript'], '"><img src="', $attachment['thumbnail']['href'], '" alt="" id="thumb_', $attachment['id'], '" class="atc_img"></a>';
708
-				else
709
-					echo '
747
+				} else {
748
+									echo '
710 749
 											<img src="' . $attachment['href'] . ';image" alt="" width="' . $attachment['width'] . '" height="' . $attachment['height'] . '" class="atc_img">';
750
+				}
711 751
 
712 752
 				echo '
713 753
 										</div>';
@@ -717,9 +757,10 @@  discard block
 block discarded – undo
717 757
 										<div class="attachments_bot">
718 758
 											<a href="' . $attachment['href'] . '"><img src="' . $settings['images_url'] . '/icons/clip.png" class="centericon" alt="*">&nbsp;' . $attachment['name'] . '</a> ';
719 759
 
720
-			if (!$attachment['is_approved'] && $context['can_approve'])
721
-				echo '
760
+			if (!$attachment['is_approved'] && $context['can_approve']) {
761
+							echo '
722 762
 											[<a href="', $scripturl, '?action=attachapprove;sa=approve;aid=', $attachment['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve'], '</a>]&nbsp;|&nbsp;[<a href="', $scripturl, '?action=attachapprove;sa=reject;aid=', $attachment['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['delete'], '</a>] ';
763
+			}
723 764
 			echo '
724 765
 											<br>', $attachment['size'], ($attachment['is_image'] ? ', ' . $attachment['real_width'] . 'x' . $attachment['real_height'] . '<br>' . sprintf($txt['attach_viewed'], $attachment['downloads']) : '<br>' . sprintf($txt['attach_downloaded'], $attachment['downloads'])), '
725 766
 										</div>';
@@ -728,33 +769,38 @@  discard block
 block discarded – undo
728 769
 									</div>';
729 770
 
730 771
 			// Next attachment line ?
731
-			if (++$i % $attachments_per_line === 0)
732
-				echo '
772
+			if (++$i % $attachments_per_line === 0) {
773
+							echo '
733 774
 									<br>';
775
+			}
734 776
 		}
735 777
 
736 778
 		// If we had unapproved attachments clean up.
737
-		if ($last_approved_state == 0)
738
-			echo '
779
+		if ($last_approved_state == 0) {
780
+					echo '
739 781
 								</fieldset>';
782
+		}
740 783
 
741 784
 		// Only do this if we output a div above - otherwise it'll break things
742
-		if ($div_output)
743
-			echo '
785
+		if ($div_output) {
786
+					echo '
744 787
 							</div>';
788
+		}
745 789
 	}
746 790
 
747 791
 	// And stuff below the attachments.
748
-	if ($context['can_report_moderator'] || !empty($context['can_see_likes']) || !empty($context['can_like']) || $message['can_approve'] || $message['can_unapprove'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'] || $context['can_quote'])
749
-	echo '
792
+	if ($context['can_report_moderator'] || !empty($context['can_see_likes']) || !empty($context['can_like']) || $message['can_approve'] || $message['can_unapprove'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'] || $context['can_quote']) {
793
+		echo '
750 794
 							<div class="under_message">';
795
+	}
751 796
 
752 797
 	// Maybe they want to report this post to the moderator(s)?
753
-	if ($context['can_report_moderator'])
754
-		echo '
798
+	if ($context['can_report_moderator']) {
799
+			echo '
755 800
 								<ul class="floatright smalltext">
756 801
 									<li class="report_link"><a href="', $scripturl, '?action=reporttm;topic=', $context['current_topic'], '.', $message['counter'], ';msg=', $message['id'], '">', $txt['report_to_mod'], '</a></li>
757 802
 								</ul>';
803
+	}
758 804
 
759 805
 	// What about likes?
760 806
 	if (!empty($modSettings['enable_likes']))
@@ -795,78 +841,91 @@  discard block
 block discarded – undo
795 841
 								<ul class="quickbuttons">';
796 842
 
797 843
 		// Can they quote? if so they can select and quote as well!
798
-		if ($context['can_quote'])
799
-			echo '
844
+		if ($context['can_quote']) {
845
+					echo '
800 846
 									<li><a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';last_msg=', $context['topic_last_message'], '" onclick="return oQuickReply.quote(', $message['id'], ');"><span class="generic_icons quote"></span>', $txt['quote_action'], '</a></li>
801 847
 									<li style="display:none;" id="quoteSelected_', $message['id'], '"><a href="javascript:void(0)"><span class="generic_icons quote_selected"></span>', $txt['quote_selected_action'] ,'</a></li>';
848
+		}
802 849
 
803 850
 		// Can the user modify the contents of this post? Show the modify inline image.
804
-		if ($message['can_modify'])
805
-			echo '
851
+		if ($message['can_modify']) {
852
+					echo '
806 853
 									<li class="quick_edit"><a title="', $txt['modify_msg'], '" class="modifybutton" id="modify_button_', $message['id'], '" onclick="oQuickModify.modifyMsg(\'', $message['id'], '\', \'', !empty($modSettings['toggle_subject']), '\')"><span class="generic_icons quick_edit_button"></span>', $txt['quick_edit'], '</a></li>';
854
+		}
807 855
 
808
-		if ($message['can_approve'] || $message['can_unapprove'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'])
809
-			echo '
856
+		if ($message['can_approve'] || $message['can_unapprove'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg']) {
857
+					echo '
810 858
 									<li class="post_options">', $txt['post_options'];
859
+		}
811 860
 
812 861
 		echo '
813 862
 										<ul>';
814 863
 
815 864
 		// Can the user modify the contents of this post?
816
-		if ($message['can_modify'])
817
-			echo '
865
+		if ($message['can_modify']) {
866
+					echo '
818 867
 											<li><a href="', $scripturl, '?action=post;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], '"><span class="generic_icons modify_button"></span>', $txt['modify'], '</a></li>';
868
+		}
819 869
 
820 870
 		// How about... even... remove it entirely?!
821
-		if ($context['can_delete'] && ($context['topic_first_message'] == $message['id']))
822
-			echo '
871
+		if ($context['can_delete'] && ($context['topic_first_message'] == $message['id'])) {
872
+					echo '
823 873
 											<li><a href="', $scripturl, '?action=removetopic2;topic=', $context['current_topic'], '.', $context['start'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['are_sure_remove_topic'], '" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['remove_topic'],'</a></li>';
824
-		elseif ($message['can_remove'] && ($context['topic_first_message'] != $message['id']))
825
-			echo '
874
+		} elseif ($message['can_remove'] && ($context['topic_first_message'] != $message['id'])) {
875
+					echo '
826 876
 											<li><a href="', $scripturl, '?action=deletemsg;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['remove_message_question'] ,'" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['remove'], '</a></li>';
877
+		}
827 878
 
828 879
 		// What about splitting it off the rest of the topic?
829
-		if ($context['can_split'] && !empty($context['real_num_replies']))
830
-			echo '
880
+		if ($context['can_split'] && !empty($context['real_num_replies'])) {
881
+					echo '
831 882
 											<li><a href="', $scripturl, '?action=splittopics;topic=', $context['current_topic'], '.0;at=', $message['id'], '"><span class="generic_icons split_button"></span>', $txt['split'], '</a></li>';
883
+		}
832 884
 
833 885
 		// Can we issue a warning because of this post? Remember, we can't give guests warnings.
834
-		if ($context['can_issue_warning'] && !$message['is_message_author'] && !$message['member']['is_guest'])
835
-			echo '
886
+		if ($context['can_issue_warning'] && !$message['is_message_author'] && !$message['member']['is_guest']) {
887
+					echo '
836 888
 											<li><a href="', $scripturl, '?action=profile;area=issuewarning;u=', $message['member']['id'], ';msg=', $message['id'], '"><span class="generic_icons warn_button"></span>', $txt['issue_warning'], '</a></li>';
889
+		}
837 890
 
838 891
 		// Can we restore topics?
839
-		if ($context['can_restore_msg'])
840
-			echo '
892
+		if ($context['can_restore_msg']) {
893
+					echo '
841 894
 											<li><a href="', $scripturl, '?action=restoretopic;msgs=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons restore_button"></span>', $txt['restore_message'], '</a></li>';
895
+		}
842 896
 
843 897
 		// Maybe we can approve it, maybe we should?
844
-		if ($message['can_approve'])
845
-			echo '
898
+		if ($message['can_approve']) {
899
+					echo '
846 900
 											<li><a href="', $scripturl, '?action=moderate;area=postmod;sa=approve;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons approve_button"></span>', $txt['approve'], '</a></li>';
901
+		}
847 902
 
848 903
 		// Maybe we can unapprove it?
849
-		if ($message['can_unapprove'])
850
-			echo '
904
+		if ($message['can_unapprove']) {
905
+					echo '
851 906
 											<li><a href="', $scripturl, '?action=moderate;area=postmod;sa=approve;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons unapprove_button"></span>', $txt['unapprove'], '</a></li>';
907
+		}
852 908
 
853 909
 		echo '
854 910
 										</ul>
855 911
 									</li>';
856 912
 
857 913
 		// Show a checkbox for quick moderation?
858
-		if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $message['can_remove'])
859
-			echo '
914
+		if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $message['can_remove']) {
915
+					echo '
860 916
 									<li style="display: none;" id="in_topic_mod_check_', $message['id'], '"></li>';
917
+		}
861 918
 
862
-		if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'])
863
-			echo '
919
+		if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg']) {
920
+					echo '
864 921
 								</ul>';
922
+		}
865 923
 	}
866 924
 
867
-	if ($context['can_report_moderator'] || !empty($context['can_see_likes']) || !empty($context['can_like']) || $message['can_approve'] || $message['can_unapprove'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'] || $context['can_quote'])
868
-	echo '
925
+	if ($context['can_report_moderator'] || !empty($context['can_see_likes']) || !empty($context['can_like']) || $message['can_approve'] || $message['can_unapprove'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'] || $context['can_quote']) {
926
+		echo '
869 927
 							</div>';
928
+	}
870 929
 
871 930
 	echo '
872 931
 						</div>
@@ -879,9 +938,10 @@  discard block
 block discarded – undo
879 938
 							<div class="custom_fields_above_signature">
880 939
 								<ul class="nolist">';
881 940
 
882
-		foreach ($message['custom_fields']['above_signature'] as $custom)
883
-			echo '
941
+		foreach ($message['custom_fields']['above_signature'] as $custom) {
942
+					echo '
884 943
 									<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
944
+		}
885 945
 
886 946
 		echo '
887 947
 								</ul>
@@ -889,9 +949,10 @@  discard block
 block discarded – undo
889 949
 	}
890 950
 
891 951
 	// Show the member's signature?
892
-	if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled'])
893
-		echo '
952
+	if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled']) {
953
+			echo '
894 954
 							<div class="signature" id="msg_', $message['id'], '_signature"', $ignoring ? ' style="display:none;"' : '', '>', $message['member']['signature'], '</div>';
955
+	}
895 956
 
896 957
 
897 958
 	// Are there any custom profile fields for below the signature?
@@ -901,9 +962,10 @@  discard block
 block discarded – undo
901 962
 							<div class="custom_fields_below_signature">
902 963
 								<ul class="nolist">';
903 964
 
904
-		foreach ($message['custom_fields']['below_signature'] as $custom)
905
-			echo '
965
+		foreach ($message['custom_fields']['below_signature'] as $custom) {
966
+					echo '
906 967
 									<li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>';
968
+		}
907 969
 
908 970
 		echo '
909 971
 								</ul>
@@ -951,8 +1013,8 @@  discard block
 block discarded – undo
951 1013
 						<input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '">';
952 1014
 
953 1015
 		// Guests just need more.
954
-		if ($context['user']['is_guest'])
955
-			echo '
1016
+		if ($context['user']['is_guest']) {
1017
+					echo '
956 1018
 						<dl id="post_header">
957 1019
 							<dt>
958 1020
 								', $txt['name'], ':
@@ -967,6 +1029,7 @@  discard block
 block discarded – undo
967 1029
 								<input type="email" name="email" size="25" value="', $context['email'], '" tabindex="', $context['tabindex']++, '" class="input_text" required>
968 1030
 							</dd>
969 1031
 						</dl>';
1032
+		}
970 1033
 
971 1034
 		echo '
972 1035
 						', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message'), '
@@ -1014,8 +1077,8 @@  discard block
 block discarded – undo
1014 1077
 		<br class="clear">';
1015 1078
 
1016 1079
 	// draft autosave available and the user has it enabled?
1017
-	if (!empty($context['drafts_autosave']))
1018
-		echo '
1080
+	if (!empty($context['drafts_autosave'])) {
1081
+			echo '
1019 1082
 			<script>
1020 1083
 				var oDraftAutoSave = new smf_DraftAutoSave({
1021 1084
 					sSelf: \'oDraftAutoSave\',
@@ -1027,10 +1090,12 @@  discard block
 block discarded – undo
1027 1090
 					iFreq: ', (empty($modSettings['masterAutoSaveDraftsDelay']) ? 60000 : $modSettings['masterAutoSaveDraftsDelay'] * 1000), '
1028 1091
 				});
1029 1092
 			</script>';
1093
+	}
1030 1094
 
1031
-	if ($context['show_spellchecking'])
1032
-		echo '
1095
+	if ($context['show_spellchecking']) {
1096
+			echo '
1033 1097
 			<form action="', $scripturl, '?action=spellcheck" method="post" accept-charset="', $context['character_set'], '" name="spell_form" id="spell_form" target="spellWindow"><input type="hidden" name="spellstring" value=""></form>';
1098
+	}
1034 1099
 
1035 1100
 	echo '
1036 1101
 				<script>
Please login to merge, or discard this patch.
Themes/default/ManagePermissions.template.php 1 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/PersonalMessage.template.php 1 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/ManageAttachments.template.php 1 patch
Braces   +20 added lines, -14 removed lines patch added patch discarded remove patch
@@ -116,9 +116,10 @@  discard block
 block discarded – undo
116 116
 				<h3 class="catbg">', $txt['attachment_transfer'], '</h3>
117 117
 			</div>';
118 118
 
119
-	if (!empty($context['results']))
120
-		echo '
119
+	if (!empty($context['results'])) {
120
+			echo '
121 121
 			<div class="noticebox">', $context['results'], '</div>';
122
+	}
122 123
 
123 124
 	echo '
124 125
 			<div class="windowbg2 noup">
@@ -129,9 +130,10 @@  discard block
 block discarded – undo
129 130
 						<dd><select name="from">
130 131
 							<option value="0">', $txt['attachment_transfer_select'], '</option>';
131 132
 
132
-	foreach ($context['attach_dirs'] as $id => $dir)
133
-		echo '
133
+	foreach ($context['attach_dirs'] as $id => $dir) {
134
+			echo '
134 135
 							<option value="', $id, '">', $dir, '</option>';
136
+	}
135 137
 	echo '
136 138
 						</select></dd>
137 139
 						<dt>', $txt['attachment_transfer_auto'], '</dt>
@@ -139,13 +141,14 @@  discard block
 block discarded – undo
139 141
 							<option value="0">', $txt['attachment_transfer_auto_select'], '</option>
140 142
 							<option value="-1">', $txt['attachment_transfer_forum_root'], '</option>';
141 143
 
142
-	if (!empty($context['base_dirs']))
143
-		foreach ($context['base_dirs'] as $id => $dir)
144
+	if (!empty($context['base_dirs'])) {
145
+			foreach ($context['base_dirs'] as $id => $dir)
144 146
 			echo '
145 147
 							<option value="', $id, '">', $dir, '</option>';
146
-	else
147
-			echo '
148
+	} else {
149
+				echo '
148 150
 							<option value="0" disabled>', $txt['attachment_transfer_no_base'], '</option>';
151
+	}
149 152
 
150 153
 	echo '
151 154
 						</select></dd>
@@ -153,16 +156,18 @@  discard block
 block discarded – undo
153 156
 						<dd><select name="to">
154 157
 							<option value="0">', $txt['attachment_transfer_select'], '</option>';
155 158
 
156
-	foreach ($context['attach_dirs'] as $id => $dir)
157
-		echo '
159
+	foreach ($context['attach_dirs'] as $id => $dir) {
160
+			echo '
158 161
 							<option value="', $id, '">', $dir, '</option>';
162
+	}
159 163
 	echo '
160 164
 						</select></dd>';
161 165
 
162
-	if (!empty($modSettings['attachmentDirFileLimit']))
163
-		echo '
166
+	if (!empty($modSettings['attachmentDirFileLimit'])) {
167
+			echo '
164 168
 						<dt>', $txt['attachment_transfer_empty'], '</dt>
165 169
 						<dd><input type="checkbox" name="empty_it"', $context['checked'] ? ' checked' : '', '></dd>';
170
+	}
166 171
 	echo '
167 172
 					</dl>
168 173
 					<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
@@ -238,10 +243,11 @@  discard block
 block discarded – undo
238 243
 		// Loop through each error reporting the status
239 244
 		foreach ($context['repair_errors'] as $error => $number)
240 245
 		{
241
-			if (!empty($number))
242
-			echo '
246
+			if (!empty($number)) {
247
+						echo '
243 248
 				<input type="checkbox" name="to_fix[]" id="', $error, '" value="', $error, '" class="input_check">
244 249
 				<label for="', $error, '">', sprintf($txt['attach_repair_' . $error], $number), '</label><br>';
250
+			}
245 251
 		}
246 252
 
247 253
 		echo '		<br>
Please login to merge, or discard this patch.
Themes/default/ManageNews.template.php 1 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/Admin.template.php 1 patch
Braces   +173 added lines, -125 removed lines patch added patch discarded remove patch
@@ -64,9 +64,10 @@  discard block
 block discarded – undo
64 64
 										<strong>', $txt['administrators'], ':</strong>
65 65
 										', implode(', ', $context['administrators']);
66 66
 	// If we have lots of admins... don't show them all.
67
-	if (!empty($context['more_admins_link']))
68
-		echo '
67
+	if (!empty($context['more_admins_link'])) {
68
+			echo '
69 69
 							(', $context['more_admins_link'], ')';
70
+	}
70 71
 
71 72
 	echo '
72 73
 									</div>
@@ -83,16 +84,18 @@  discard block
 block discarded – undo
83 84
 		foreach ($area['areas'] as $item_id => $item)
84 85
 		{
85 86
 			// No point showing the 'home' page here, we're already on it!
86
-			if ($area_id == 'forum' && $item_id == 'index')
87
-				continue;
87
+			if ($area_id == 'forum' && $item_id == 'index') {
88
+							continue;
89
+			}
88 90
 
89 91
 			$url = isset($item['url']) ? $item['url'] : $scripturl . '?action=admin;area=' . $item_id . (!empty($context[$context['admin_menu_name']]['extra_parameters']) ? $context[$context['admin_menu_name']]['extra_parameters'] : '');
90
-			if (!empty($item['icon_file']))
91
-				echo '
92
+			if (!empty($item['icon_file'])) {
93
+							echo '
92 94
 							<a href="', $url, '" class="admin_group', !empty($item['inactive']) ? ' inactive' : '', '"><img class="large_admin_menu_icon_file" src="', $item['icon_file'], '" alt="">', $item['label'], '</a>';
93
-			else
94
-				echo '
95
+			} else {
96
+							echo '
95 97
 							<a href="', $url, '"><span class="large_', $item['icon_class'], !empty($item['inactive']) ? ' inactive' : '', '"></span>', $item['label'], '</a>';
98
+			}
96 99
 		}
97 100
 
98 101
 		echo '
@@ -103,10 +106,11 @@  discard block
 block discarded – undo
103 106
 					</div>';
104 107
 
105 108
 	// The below functions include all the scripts needed from the simplemachines.org site. The language and format are passed for internationalization.
106
-	if (empty($modSettings['disable_smf_js']))
107
-		echo '
109
+	if (empty($modSettings['disable_smf_js'])) {
110
+			echo '
108 111
 					<script src="', $scripturl, '?action=viewsmfile;filename=current-version.js"></script>
109 112
 					<script src="', $scripturl, '?action=viewsmfile;filename=latest-news.js"></script>';
113
+	}
110 114
 
111 115
 	// This sets the announcements and current versions themselves ;).
112 116
 	echo '
@@ -185,9 +189,10 @@  discard block
 block discarded – undo
185 189
 								<em>', $version['version'], '</em>';
186 190
 
187 191
 		// more details for this item, show them a link
188
-		if ($context['can_admin'] && isset($version['more']))
189
-			echo
192
+		if ($context['can_admin'] && isset($version['more'])) {
193
+					echo
190 194
 								' <a href="', $scripturl, $version['more'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['version_check_more'], '</a>';
195
+		}
191 196
 		echo '
192 197
 								<br>';
193 198
 	}
@@ -218,20 +223,22 @@  discard block
 block discarded – undo
218 223
 
219 224
 	foreach ($context['credits'] as $section)
220 225
 	{
221
-		if (isset($section['pretext']))
222
-			echo '
226
+		if (isset($section['pretext'])) {
227
+					echo '
223 228
 								<p>', $section['pretext'], '</p><hr>';
229
+		}
224 230
 
225 231
 		echo '
226 232
 								<dl>';
227 233
 
228 234
 		foreach ($section['groups'] as $group)
229 235
 		{
230
-			if (isset($group['title']))
231
-				echo '
236
+			if (isset($group['title'])) {
237
+							echo '
232 238
 									<dt>
233 239
 										<strong>', $group['title'], ':</strong>
234 240
 									</dt>';
241
+			}
235 242
 
236 243
 			echo '
237 244
 									<dd>', implode(', ', $group['members']), '</dd>';
@@ -240,10 +247,11 @@  discard block
 block discarded – undo
240 247
 		echo '
241 248
 								</dl>';
242 249
 
243
-		if (isset($section['posttext']))
244
-			echo '
250
+		if (isset($section['posttext'])) {
251
+					echo '
245 252
 								<hr>
246 253
 								<p>', $section['posttext'], '</p>';
254
+		}
247 255
 	}
248 256
 
249 257
 	echo '
@@ -259,9 +267,10 @@  discard block
 block discarded – undo
259 267
 							smfSupportVersions.forum = "', $context['forum_version'], '";';
260 268
 
261 269
 	// Don't worry, none of this is logged, it's just used to give information that might be of use.
262
-	foreach ($context['current_versions'] as $variable => $version)
263
-		echo '
270
+	foreach ($context['current_versions'] as $variable => $version) {
271
+			echo '
264 272
 							smfSupportVersions.', $variable, ' = "', $version['version'], '";';
273
+	}
265 274
 
266 275
 	// Now we just have to include the script and wait ;).
267 276
 	echo '
@@ -358,8 +367,8 @@  discard block
 block discarded – undo
358 367
 							<tbody>';
359 368
 
360 369
 	// Loop through every source file displaying its version - using javascript.
361
-	foreach ($context['file_versions'] as $filename => $version)
362
-		echo '
370
+	foreach ($context['file_versions'] as $filename => $version) {
371
+			echo '
363 372
 								<tr class="windowbg">
364 373
 									<td class="half_table">
365 374
 										', $filename, '
@@ -371,6 +380,7 @@  discard block
 block discarded – undo
371 380
 										<em id="currentSources', $filename, '">??</em>
372 381
 									</td>
373 382
 								</tr>';
383
+	}
374 384
 
375 385
 	// Default template files.
376 386
 	echo '
@@ -396,8 +406,8 @@  discard block
 block discarded – undo
396 406
 							<table id="Default" class="table_grid">
397 407
 								<tbody>';
398 408
 
399
-	foreach ($context['default_template_versions'] as $filename => $version)
400
-		echo '
409
+	foreach ($context['default_template_versions'] as $filename => $version) {
410
+			echo '
401 411
 									<tr class="windowbg">
402 412
 										<td class="half_table">
403 413
 											', $filename, '
@@ -409,6 +419,7 @@  discard block
 block discarded – undo
409 419
 											<em id="currentDefault', $filename, '">??</em>
410 420
 										</td>
411 421
 									</tr>';
422
+	}
412 423
 
413 424
 	// Now the language files...
414 425
 	echo '
@@ -436,8 +447,8 @@  discard block
 block discarded – undo
436 447
 
437 448
 	foreach ($context['default_language_versions'] as $language => $files)
438 449
 	{
439
-		foreach ($files as $filename => $version)
440
-			echo '
450
+		foreach ($files as $filename => $version) {
451
+					echo '
441 452
 									<tr class="windowbg">
442 453
 										<td class="half_table">
443 454
 											', $filename, '.<em>', $language, '</em>.php
@@ -449,6 +460,7 @@  discard block
 block discarded – undo
449 460
 											<em id="current', $filename, '.', $language, '">??</em>
450 461
 										</td>
451 462
 									</tr>';
463
+		}
452 464
 	}
453 465
 
454 466
 	echo '
@@ -478,8 +490,8 @@  discard block
 block discarded – undo
478 490
 							<table id="Templates" class="table_grid">
479 491
 								<tbody>';
480 492
 
481
-		foreach ($context['template_versions'] as $filename => $version)
482
-			echo '
493
+		foreach ($context['template_versions'] as $filename => $version) {
494
+					echo '
483 495
 									<tr class="windowbg">
484 496
 										<td class="half_table">
485 497
 											', $filename, '
@@ -491,6 +503,7 @@  discard block
 block discarded – undo
491 503
 											<em id="currentTemplates', $filename, '">??</em>
492 504
 										</td>
493 505
 									</tr>';
506
+		}
494 507
 
495 508
 		echo '
496 509
 								</tbody>
@@ -520,8 +533,8 @@  discard block
 block discarded – undo
520 533
 							<table id="Tasks" class="table_grid">
521 534
 								<tbody>';
522 535
 
523
-		foreach ($context['tasks_versions'] as $filename => $version)
524
-			echo '
536
+		foreach ($context['tasks_versions'] as $filename => $version) {
537
+					echo '
525 538
 									<tr class="windowbg">
526 539
 										<td class="half_table">
527 540
 											', $filename, '
@@ -533,6 +546,7 @@  discard block
 block discarded – undo
533 546
 											<em id="currentTasks', $filename, '">??</em>
534 547
 										</td>
535 548
 									</tr>';
549
+		}
536 550
 
537 551
 		echo '
538 552
 								</tbody>
@@ -574,9 +588,10 @@  discard block
 block discarded – undo
574 588
 {
575 589
 	global $context, $scripturl, $txt, $modSettings;
576 590
 
577
-	if (!empty($context['saved_successful']))
578
-		echo '
591
+	if (!empty($context['saved_successful'])) {
592
+			echo '
579 593
 					<div class="infobox">', $txt['settings_saved'], '</div>';
594
+	}
580 595
 
581 596
 	// First section is for adding/removing words from the censored list.
582 597
 	echo '
@@ -591,11 +606,12 @@  discard block
 block discarded – undo
591 606
 								<p>', $txt['admin_censored_where'], '</p>';
592 607
 
593 608
 	// Show text boxes for censoring [bad   ] => [good  ].
594
-	foreach ($context['censored_words'] as $vulgar => $proper)
595
-		echo '
609
+	foreach ($context['censored_words'] as $vulgar => $proper) {
610
+			echo '
596 611
 								<div class="block">
597 612
 									<input type="text" name="censor_vulgar[]" value="', $vulgar, '" size="30"> =&gt; <input type="text" name="censor_proper[]" value="', $proper, '" size="30">
598 613
 								</div>';
614
+	}
599 615
 
600 616
 	// Now provide a way to censor more words.
601 617
 	echo '
@@ -669,19 +685,21 @@  discard block
 block discarded – undo
669 685
 						<div class="windowbg2 noup">
670 686
 							', $txt['not_done_reason'];
671 687
 
672
-	if (!empty($context['continue_percent']))
673
-		echo '
688
+	if (!empty($context['continue_percent'])) {
689
+			echo '
674 690
 							<div class="progress_bar">
675 691
 								<div class="full_bar">', $context['continue_percent'], '%</div>
676 692
 								<div class="green_percent" style="width: ', $context['continue_percent'], '%;">&nbsp;</div>
677 693
 							</div>';
694
+	}
678 695
 
679
-	if (!empty($context['substep_enabled']))
680
-		echo '
696
+	if (!empty($context['substep_enabled'])) {
697
+			echo '
681 698
 							<div class="progress_bar">
682 699
 								<div class="full_bar">', $context['substep_title'], ' (', $context['substep_continue_percent'], '%)</div>
683 700
 								<div class="blue_percent" style="width: ', $context['substep_continue_percent'], '%;">&nbsp;</div>
684 701
 							</div>';
702
+	}
685 703
 
686 704
 	echo '
687 705
 							<form action="', $scripturl, $context['continue_get_data'], '" method="post" accept-charset="', $context['character_set'], '" name="autoSubmit" id="autoSubmit">
@@ -716,35 +734,40 @@  discard block
 block discarded – undo
716 734
 {
717 735
 	global $context, $txt, $settings, $scripturl;
718 736
 
719
-	if (!empty($context['saved_successful']))
720
-		echo '
737
+	if (!empty($context['saved_successful'])) {
738
+			echo '
721 739
 					<div class="infobox">', $txt['settings_saved'], '</div>';
722
-	elseif (!empty($context['saved_failed']))
723
-		echo '
740
+	} elseif (!empty($context['saved_failed'])) {
741
+			echo '
724 742
 					<div class="errorbox">', sprintf($txt['settings_not_saved'], $context['saved_failed']), '</div>';
743
+	}
725 744
 
726
-	if (!empty($context['settings_pre_javascript']))
727
-		echo '
745
+	if (!empty($context['settings_pre_javascript'])) {
746
+			echo '
728 747
 					<script>', $context['settings_pre_javascript'], '</script>';
748
+	}
729 749
 
730
-	if (!empty($context['settings_insert_above']))
731
-		echo $context['settings_insert_above'];
750
+	if (!empty($context['settings_insert_above'])) {
751
+			echo $context['settings_insert_above'];
752
+	}
732 753
 
733 754
 	echo '
734 755
 					<div id="admincenter">
735 756
 						<form id="admin_form_wrapper" action="', $context['post_url'], '" method="post" accept-charset="', $context['character_set'], '"', !empty($context['force_form_onsubmit']) ? ' onsubmit="' . $context['force_form_onsubmit'] . '"' : '', '>';
736 757
 
737 758
 	// Is there a custom title?
738
-	if (isset($context['settings_title']))
739
-		echo '
759
+	if (isset($context['settings_title'])) {
760
+			echo '
740 761
 							<div class="cat_bar">
741 762
 								<h3 class="catbg">', $context['settings_title'], '</h3>
742 763
 							</div>';
764
+	}
743 765
 
744 766
 	// Have we got a message to display?
745
-	if (!empty($context['settings_message']))
746
-		echo '
767
+	if (!empty($context['settings_message'])) {
768
+			echo '
747 769
 							<div class="information">', $context['settings_message'], '</div>';
770
+	}
748 771
 
749 772
 	// Now actually loop through all the variables.
750 773
 	$is_open = false;
@@ -797,8 +820,9 @@  discard block
 block discarded – undo
797 820
 		// Hang about? Are you pulling my leg - a callback?!
798 821
 		if (is_array($config_var) && $config_var['type'] == 'callback')
799 822
 		{
800
-			if (function_exists('template_callback_' . $config_var['name']))
801
-				call_user_func('template_callback_' . $config_var['name']);
823
+			if (function_exists('template_callback_' . $config_var['name'])) {
824
+							call_user_func('template_callback_' . $config_var['name']);
825
+			}
802 826
 
803 827
 			continue;
804 828
 		}
@@ -828,9 +852,10 @@  discard block
 block discarded – undo
828 852
 				$text_types = array('color', 'date', 'datetime', 'datetime-local', 'email', 'month', 'time');
829 853
 
830 854
 				// Show the [?] button.
831
-				if ($config_var['help'])
832
-					echo '
855
+				if ($config_var['help']) {
856
+									echo '
833 857
 							<a id="setting_', $config_var['name'], '_help" href="', $scripturl, '?action=helpadmin;help=', $config_var['help'], '" onclick="return reqOverlayDiv(this.href);"><span class="generic_icons help" title="', $txt['help'],'"></span></a> ';
858
+				}
834 859
 
835 860
 				echo '
836 861
 										<a id="setting_', $config_var['name'], '"></a> <span', ($config_var['disabled'] ? ' style="color: #777777;"' : ($config_var['invalid'] ? ' class="error"' : '')), '><label for="', $config_var['name'], '">', $config_var['label'], '</label>', $subtext, ($config_var['type'] == 'password' ? '<br><em>' . $txt['admin_confirm_password'] . '</em>' : ''), '</span>
@@ -839,22 +864,25 @@  discard block
 block discarded – undo
839 864
 										$config_var['preinput'];
840 865
 
841 866
 				// Show a check box.
842
-				if ($config_var['type'] == 'check')
843
-					echo '
867
+				if ($config_var['type'] == 'check') {
868
+									echo '
844 869
 										<input type="checkbox"', $javascript, $disabled, ' name="', $config_var['name'], '" id="', $config_var['name'], '"', ($config_var['value'] ? ' checked' : ''), ' value="1" class="input_check">';
870
+				}
845 871
 				// Escape (via htmlspecialchars.) the text box.
846
-				elseif ($config_var['type'] == 'password')
847
-					echo '
872
+				elseif ($config_var['type'] == 'password') {
873
+									echo '
848 874
 										<input type="password"', $disabled, $javascript, ' name="', $config_var['name'], '[0]"', ($config_var['size'] ? ' size="' . $config_var['size'] . '"' : ''), ' value="*#fakepass#*" onfocus="this.value = \'\'; this.form.', $config_var['name'], '.disabled = false;" class="input_password"><br>
849 875
 										<input type="password" disabled id="', $config_var['name'], '" name="', $config_var['name'], '[1]"', ($config_var['size'] ? ' size="' . $config_var['size'] . '"' : ''), ' class="input_password">';
876
+				}
850 877
 				// Show a selection box.
851 878
 				elseif ($config_var['type'] == 'select')
852 879
 				{
853 880
 					echo '
854 881
 										<select name="', $config_var['name'], '" id="', $config_var['name'], '" ', $javascript, $disabled, (!empty($config_var['multiple']) ? ' multiple="multiple"' : ''), (!empty($config_var['multiple']) && !empty($config_var['size']) ? ' size="' . $config_var['size'] . '"' : ''), '>';
855
-					foreach ($config_var['data'] as $option)
856
-						echo '
882
+					foreach ($config_var['data'] as $option) {
883
+											echo '
857 884
 											<option value="', $option[0], '"', (!empty($config_var['value']) && ($option[0] == $config_var['value'] || (!empty($config_var['multiple']) && in_array($option[0], $config_var['value']))) ? ' selected' : ''), '>', $option[1], '</option>';
885
+					}
858 886
 					echo '
859 887
 										</select>';
860 888
 				}
@@ -869,15 +897,17 @@  discard block
 block discarded – undo
869 897
 												<legend class="board_selector"><a href="#">', $txt['select_boards_from_list'], '</a></legend>';
870 898
 					foreach ($context['board_list'] as $id_cat => $cat)
871 899
 					{
872
-						if (!$first)
873
-							echo '
900
+						if (!$first) {
901
+													echo '
874 902
 											<hr>';
903
+						}
875 904
 						echo '
876 905
 											<strong>', $cat['name'], '</strong>
877 906
 											<ul>';
878
-						foreach ($cat['boards'] as $id_board => $brd)
879
-							echo '
907
+						foreach ($cat['boards'] as $id_board => $brd) {
908
+													echo '
880 909
 												<li><label><input type="checkbox" name="', $config_var['name'], '[', $brd['id'], ']" value="1" class="input_check"', in_array($brd['id'], $config_var['value']) ? ' checked' : '', '> ', $brd['child_level'] > 0 ? str_repeat('&nbsp; &nbsp;', $brd['child_level']) : '', $brd['name'], '</label></li>';
910
+						}
881 911
 
882 912
 						echo '
883 913
 											</ul>';
@@ -887,12 +917,14 @@  discard block
 block discarded – undo
887 917
 											</fieldset>';
888 918
 				}
889 919
 				// Text area?
890
-				elseif ($config_var['type'] == 'large_text')
891
-					echo '
920
+				elseif ($config_var['type'] == 'large_text') {
921
+									echo '
892 922
 											<textarea rows="', (!empty($config_var['size']) ? $config_var['size'] : (!empty($config_var['rows']) ? $config_var['rows'] : 4)), '" cols="', (!empty($config_var['cols']) ? $config_var['cols'] : 30), '" ', $javascript, $disabled, ' name="', $config_var['name'], '" id="', $config_var['name'], '">', $config_var['value'], '</textarea>';
923
+				}
893 924
 				// Permission group?
894
-				elseif ($config_var['type'] == 'permissions')
895
-					theme_inline_permissions($config_var['name']);
925
+				elseif ($config_var['type'] == 'permissions') {
926
+									theme_inline_permissions($config_var['name']);
927
+				}
896 928
 				// BBC selection?
897 929
 				elseif ($config_var['type'] == 'bbc')
898 930
 				{
@@ -903,20 +935,22 @@  discard block
 block discarded – undo
903 935
 
904 936
 					foreach ($context['bbc_columns'] as $bbcColumn)
905 937
 					{
906
-						foreach ($bbcColumn as $bbcTag)
907
-							echo '
938
+						foreach ($bbcColumn as $bbcTag) {
939
+													echo '
908 940
 														<li class="list_bbc floatleft">
909 941
 															<input type="checkbox" name="', $config_var['name'], '_enabledTags[]" id="tag_', $config_var['name'], '_', $bbcTag['tag'], '" value="', $bbcTag['tag'], '"', !in_array($bbcTag['tag'], $context['bbc_sections'][$config_var['name']]['disabled']) ? ' checked' : '', ' class="input_check"> <label for="tag_', $config_var['name'], '_', $bbcTag['tag'], '">', $bbcTag['tag'], '</label>', $bbcTag['show_help'] ? ' (<a href="' . $scripturl . '?action=helpadmin;help=tag_' . $bbcTag['tag'] . '" onclick="return reqOverlayDiv(this.href);">?</a>)' : '', '
910 942
 														</li>';
943
+						}
911 944
 					}
912 945
 					echo '							</ul>
913 946
 												<input type="checkbox" id="bbc_', $config_var['name'], '_select_all" onclick="invertAll(this, this.form, \'', $config_var['name'], '_enabledTags\');"', $context['bbc_sections'][$config_var['name']]['all_selected'] ? ' checked' : '', ' class="input_check"> <label for="bbc_', $config_var['name'], '_select_all"><em>', $txt['bbcTagsToUse_select_all'], '</em></label>
914 947
 											</fieldset>';
915 948
 				}
916 949
 				// A simple message?
917
-				elseif ($config_var['type'] == 'var_message')
918
-					echo '
950
+				elseif ($config_var['type'] == 'var_message') {
951
+									echo '
919 952
 											<div', !empty($config_var['name']) ? ' id="' . $config_var['name'] . '"' : '', '>', $config_var['var_message'], '</div>';
953
+				}
920 954
 				// Assume it must be a text box
921 955
 				else
922 956
 				{
@@ -941,63 +975,70 @@  discard block
 block discarded – undo
941 975
 											' . $config_var['postinput'] : '',
942 976
 										'</dd>';
943 977
 			}
944
-		}
945
-
946
-		else
978
+		} else
947 979
 		{
948 980
 			// Just show a separator.
949
-			if ($config_var == '')
950
-				echo '
981
+			if ($config_var == '') {
982
+							echo '
951 983
 								</dl>
952 984
 								<hr>
953 985
 								<dl class="settings">';
954
-			else
955
-				echo '
986
+			} else {
987
+							echo '
956 988
 									<dd>
957 989
 										<strong>' . $config_var . '</strong>
958 990
 									</dd>';
991
+			}
959 992
 		}
960 993
 	}
961 994
 
962
-	if ($is_open)
963
-		echo '
995
+	if ($is_open) {
996
+			echo '
964 997
 								</dl>';
998
+	}
965 999
 
966
-	if (empty($context['settings_save_dont_show']))
967
-		echo '
1000
+	if (empty($context['settings_save_dont_show'])) {
1001
+			echo '
968 1002
 								<input type="submit" value="', $txt['save'], '"', (!empty($context['save_disabled']) ? ' disabled' : ''), (!empty($context['settings_save_onclick']) ? ' onclick="' . $context['settings_save_onclick'] . '"' : ''), ' class="button_submit">';
1003
+	}
969 1004
 
970
-	if ($is_open)
971
-		echo '
1005
+	if ($is_open) {
1006
+			echo '
972 1007
 							</div>';
1008
+	}
973 1009
 
974 1010
 
975 1011
 	// At least one token has to be used!
976
-	if (isset($context['admin-ssc_token']))
977
-		echo '
1012
+	if (isset($context['admin-ssc_token'])) {
1013
+			echo '
978 1014
 							<input type="hidden" name="', $context['admin-ssc_token_var'], '" value="', $context['admin-ssc_token'], '">';
1015
+	}
979 1016
 
980
-	if (isset($context['admin-dbsc_token']))
981
-		echo '
1017
+	if (isset($context['admin-dbsc_token'])) {
1018
+			echo '
982 1019
 							<input type="hidden" name="', $context['admin-dbsc_token_var'], '" value="', $context['admin-dbsc_token'], '">';
1020
+	}
983 1021
 
984
-	if (isset($context['admin-mp_token']))
985
-		echo '
1022
+	if (isset($context['admin-mp_token'])) {
1023
+			echo '
986 1024
 							<input type="hidden" name="', $context['admin-mp_token_var'], '" value="', $context['admin-mp_token'], '">';
1025
+	}
987 1026
 
988 1027
 	echo '
989 1028
 							<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
990 1029
 						</form>
991 1030
 					</div>';
992 1031
 
993
-	if (!empty($context['settings_post_javascript']))
994
-		echo '
1032
+	if (!empty($context['settings_post_javascript'])) {
1033
+			echo '
995 1034
 					<script>
996 1035
 					', $context['settings_post_javascript'], '
997 1036
 					</script>';
1037
+	}
998 1038
 
999
-	if (!empty($context['settings_insert_below']))
1000
-		echo $context['settings_insert_below'];
1039
+	if (!empty($context['settings_insert_below'])) {
1040
+			echo $context['settings_insert_below'];
1041
+	}
1001 1042
 
1002 1043
 	// We may have added a board listing. If we did, we need to make it work.
1003 1044
 	addInlineJavascript('
@@ -1020,9 +1061,10 @@  discard block
 block discarded – undo
1020 1061
 {
1021 1062
 	global $context, $txt;
1022 1063
 
1023
-	if (!empty($context['saved_successful']))
1024
-		echo '
1064
+	if (!empty($context['saved_successful'])) {
1065
+			echo '
1025 1066
 					<div class="infobox">', $txt['settings_saved'], '</div>';
1067
+	}
1026 1068
 
1027 1069
 	// Standard fields.
1028 1070
 	template_show_list('standard_profile_fields');
@@ -1054,11 +1096,12 @@  discard block
 block discarded – undo
1054 1096
 	if (isset($_GET['msg']))
1055 1097
 	{
1056 1098
 		loadLanguage('Errors');
1057
-		if (isset($txt['custom_option_' . $_GET['msg']]))
1058
-			echo '
1099
+		if (isset($txt['custom_option_' . $_GET['msg']])) {
1100
+					echo '
1059 1101
 					<div class="errorbox">',
1060 1102
 						$txt['custom_option_' . $_GET['msg']], '
1061 1103
 					</div>';
1104
+		}
1062 1105
 	}
1063 1106
 
1064 1107
 	echo '
@@ -1124,9 +1167,10 @@  discard block
 block discarded – undo
1124 1167
 										<dd>
1125 1168
 											<select name="placement" id="placement">';
1126 1169
 
1127
-	foreach ($context['cust_profile_fields_placement'] as $order => $name)
1128
-		echo '
1170
+	foreach ($context['cust_profile_fields_placement'] as $order => $name) {
1171
+			echo '
1129 1172
 												<option value="', $order ,'"', $context['field']['placement'] == $order ? ' selected' : '', '>', $txt['custom_profile_placement_'. $name], '</option>';
1173
+	}
1130 1174
 
1131 1175
 	echo '
1132 1176
 											</select>
@@ -1149,9 +1193,10 @@  discard block
 block discarded – undo
1149 1193
 										</dt>
1150 1194
 										<dd>
1151 1195
 											<select name="field_type" id="field_type" onchange="updateInputBoxes();">';
1152
-	foreach (array('text', 'textarea', 'select', 'radio', 'check') as $field_type)
1153
-		echo '
1196
+	foreach (array('text', 'textarea', 'select', 'radio', 'check') as $field_type) {
1197
+			echo '
1154 1198
 												<option value="', $field_type, '"', $context['field']['type'] == $field_type ? ' selected' : '', '>', $txt['custom_profile_type_' . $field_type], '</option>';
1199
+	}
1155 1200
 
1156 1201
 	echo '
1157 1202
 											</select>
@@ -1252,9 +1297,10 @@  discard block
 block discarded – undo
1252 1297
 								</fieldset>
1253 1298
 									<input type="submit" name="save" value="', $txt['save'], '" class="button_submit">';
1254 1299
 
1255
-	if ($context['fid'])
1256
-		echo '
1300
+	if ($context['fid']) {
1301
+			echo '
1257 1302
 									<input type="submit" name="delete" value="', $txt['delete'], '" data-confirm="', $txt['custom_edit_delete_sure'], '" class="button_submit you_sure">';
1303
+	}
1258 1304
 
1259 1305
 	echo '
1260 1306
 							</div>
@@ -1297,8 +1343,7 @@  discard block
 block discarded – undo
1297 1343
 	{
1298 1344
 		echo '
1299 1345
 						<p class="centertext"><strong>', $txt['admin_search_results_none'], '</strong></p>';
1300
-	}
1301
-	else
1346
+	} else
1302 1347
 	{
1303 1348
 		echo '
1304 1349
 						<ol class="search_results">';
@@ -1324,9 +1369,10 @@  discard block
 block discarded – undo
1324 1369
 							<li>
1325 1370
 								<a href="', $result['url'], '"><strong>', $result['name'], '</strong></a> [', isset($txt['admin_search_section_' . $result['type']]) ? $txt['admin_search_section_' . $result['type']] : $result['type'] , ']';
1326 1371
 
1327
-				if ($result['help'])
1328
-					echo '
1372
+				if ($result['help']) {
1373
+									echo '
1329 1374
 								<p class="double_height">', $result['help'], '</p>';
1375
+				}
1330 1376
 
1331 1377
 				echo '
1332 1378
 							</li>';
@@ -1366,18 +1412,20 @@  discard block
 block discarded – undo
1366 1412
 									<strong>', $txt['setup_verification_answer'], '</strong>
1367 1413
 								</dd>';
1368 1414
 
1369
-		if (!empty($context['qa_by_lang'][$lang_id]))
1370
-			foreach ($context['qa_by_lang'][$lang_id] as $q_id)
1415
+		if (!empty($context['qa_by_lang'][$lang_id])) {
1416
+					foreach ($context['qa_by_lang'][$lang_id] as $q_id)
1371 1417
 			{
1372 1418
 				$question = $context['question_answers'][$q_id];
1419
+		}
1373 1420
 				echo '
1374 1421
 								<dt>
1375 1422
 									<input type="text" name="question[', $lang_id, '][', $q_id, ']" value="', $question['question'], '" size="50" class="input_text verification_question">
1376 1423
 								</dt>
1377 1424
 								<dd>';
1378
-				foreach ($question['answers'] as $answer)
1379
-					echo '
1425
+				foreach ($question['answers'] as $answer) {
1426
+									echo '
1380 1427
 									<input type="text" name="answer[', $lang_id, '][', $q_id, '][]" value="', $answer, '" size="50" class="input_text verification_answer">';
1428
+				}
1381 1429
 
1382 1430
 				echo '
1383 1431
 									<div class="qa_add_answer"><a href="javascript:void(0);" onclick="return addAnswer(this);">[ ', $txt['setup_verification_add_answer'], ' ]</a></div>
@@ -1416,11 +1464,12 @@  discard block
 block discarded – undo
1416 1464
 							', $txt['errors_found'], ':
1417 1465
 							<ul>';
1418 1466
 
1419
-			foreach ($context['repair_errors'] as $error)
1420
-				echo '
1467
+			foreach ($context['repair_errors'] as $error) {
1468
+							echo '
1421 1469
 								<li>
1422 1470
 									', $error, '
1423 1471
 								</li>';
1472
+			}
1424 1473
 
1425 1474
 			echo '
1426 1475
 							</ul>
@@ -1430,16 +1479,15 @@  discard block
 block discarded – undo
1430 1479
 							<p class="padding">
1431 1480
 								<strong><a href="', $scripturl, '?action=admin;area=repairboards;fixErrors;', $context['session_var'], '=', $context['session_id'], '">', $txt['yes'], '</a> - <a href="', $scripturl, '?action=admin;area=maintain">', $txt['no'], '</a></strong>
1432 1481
 							</p>';
1433
-		}
1434
-		else
1435
-			echo '
1482
+		} else {
1483
+					echo '
1436 1484
 							<p>', $txt['maintain_no_errors'], '</p>
1437 1485
 							<p class="padding">
1438 1486
 								<a href="', $scripturl, '?action=admin;area=maintain;sa=routine">', $txt['maintain_return'], '</a>
1439 1487
 							</p>';
1488
+		}
1440 1489
 
1441
-	}
1442
-	else
1490
+	} else
1443 1491
 	{
1444 1492
 		if (!empty($context['redirect_to_recount']))
1445 1493
 		{
@@ -1451,8 +1499,7 @@  discard block
 block discarded – undo
1451 1499
 								<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
1452 1500
 								<input type="submit" name="recount" id="recount_now" value="', $txt['errors_recount_now'], '">
1453 1501
 							</form>';
1454
-		}
1455
-		else
1502
+		} else
1456 1503
 		{
1457 1504
 			echo '
1458 1505
 							<p>', $txt['errors_fixed'], '</p>
@@ -1604,8 +1651,8 @@  discard block
 block discarded – undo
1604 1651
 function template_admin_quick_search()
1605 1652
 {
1606 1653
 	global $context, $txt, $scripturl;
1607
-	if ($context['user']['is_admin'])
1608
-		echo '
1654
+	if ($context['user']['is_admin']) {
1655
+			echo '
1609 1656
 								<span class="floatright">
1610 1657
 									<span class="generic_icons filter centericon"></span>
1611 1658
 									<input type="search" name="search_term" value="', $txt['admin_search'], '" onclick="if (this.value == \'', $txt['admin_search'], '\') this.value = \'\';" class="input_text">
@@ -1616,6 +1663,7 @@  discard block
 block discarded – undo
1616 1663
 									</select>
1617 1664
 									<input type="submit" name="search_go" id="search_go" value="', $txt['admin_search_go'], '" class="button_submit">
1618 1665
 								</span>';
1619
-}
1666
+	}
1667
+	}
1620 1668
 
1621 1669
 ?>
Please login to merge, or discard this patch.
Themes/default/Register.template.php 1 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/Printpage.template.php 1 patch
Braces   +12 added lines, -9 removed lines patch added patch discarded remove patch
@@ -145,11 +145,12 @@  discard block
 block discarded – undo
145 145
 				<div class="question">', $txt['poll_question'], ': <strong>', $context['poll']['question'], '</strong>';
146 146
 
147 147
 		$options = 1;
148
-		foreach ($context['poll']['options'] as $option)
149
-			echo '
148
+		foreach ($context['poll']['options'] as $option) {
149
+					echo '
150 150
 					<div class="', $option['voted_this'] ? 'voted' : '', '">', $txt['option'], ' ', $options++, ': <strong>', $option['option'], '</strong>
151 151
 						', $context['allow_poll_view'] ? $txt['votes'] . ': ' . $option['votes'] . '' : '', '
152 152
 					</div>';
153
+		}
153 154
 
154 155
 		echo '
155 156
 			</div>';
@@ -171,9 +172,10 @@  discard block
 block discarded – undo
171 172
 			echo '
172 173
 				<hr>';
173 174
 
174
-			foreach ($context['printattach'][$post['id_msg']] as $attach)
175
-				echo '
175
+			foreach ($context['printattach'][$post['id_msg']] as $attach) {
176
+							echo '
176 177
 					<img width="' . $attach['width'] . '" height="' . $attach['height'] . '" src="', $scripturl . '?action=dlattach;topic=' . $topic . '.0;attach=' . $attach['id_attach'] . '" alt="">';
178
+			}
177 179
 		}
178 180
 
179 181
 		echo '
@@ -213,11 +215,12 @@  discard block
 block discarded – undo
213 215
 		<div class="print_options">';
214 216
 
215 217
 	// which option is set, text or text&images
216
-	if (isset($_REQUEST['images']))
217
-		echo '
218
+	if (isset($_REQUEST['images'])) {
219
+			echo '
218 220
 			<a href="', $url_text, '">', $txt['print_page_text'], '</a> | <strong><a href="', $url_images, '">', $txt['print_page_images'], '</a></strong>';
219
-	else
220
-		echo '
221
+	} else {
222
+			echo '
221 223
 			<strong><a href="', $url_text, '">', $txt['print_page_text'], '</a></strong> | <a href="', $url_images, '">', $txt['print_page_images'], '</a>';
222
-}
224
+	}
225
+	}
223 226
 ?>
224 227
\ No newline at end of file
Please login to merge, or discard this patch.
Themes/default/BoardIndex.template.php 1 patch
Braces   +57 added lines, -39 removed lines patch added patch discarded remove patch
@@ -67,8 +67,9 @@  discard block
 block discarded – undo
67 67
 	foreach ($context['categories'] as $category)
68 68
 	{
69 69
 		// If theres no parent boards we can see, avoid showing an empty category (unless its collapsed)
70
-		if (empty($category['boards']) && !$category['is_collapsed'])
71
-			continue;
70
+		if (empty($category['boards']) && !$category['is_collapsed']) {
71
+					continue;
72
+		}
72 73
 
73 74
 		echo '
74 75
 		<div class="main_container">
@@ -76,9 +77,10 @@  discard block
 block discarded – undo
76 77
 				<h3 class="catbg">';
77 78
 
78 79
 		// If this category even can collapse, show a link to collapse it.
79
-		if ($category['can_collapse'])
80
-			echo '
80
+		if ($category['can_collapse']) {
81
+					echo '
81 82
 					<span id="category_', $category['id'], '_upshrink" class="', $category['is_collapsed'] ? 'toggle_down' : 'toggle_up', ' floatright" data-collapsed="', (int) $category['is_collapsed'], '" title="', !$category['is_collapsed'] ? $txt['hide_category'] : $txt['show_category'] ,'" style="display: none;"></span>';
83
+		}
82 84
 
83 85
 		echo '
84 86
 					', $category['link'], '
@@ -105,17 +107,19 @@  discard block
 block discarded – undo
105 107
 						</a>';
106 108
 
107 109
 				// Has it outstanding posts for approval?
108
-				if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics']))
109
-					echo '
110
+				if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics'])) {
111
+									echo '
110 112
 						<a href="', $scripturl, '?action=moderate;area=postmod;sa=', ($board['unapproved_topics'] > 0 ? 'topics' : 'posts'), ';brd=', $board['id'], ';', $context['session_var'], '=', $context['session_id'], '" title="', sprintf($txt['unapproved_posts'], $board['unapproved_topics'], $board['unapproved_posts']), '" class="moderation_link">(!)</a>';
113
+				}
111 114
 
112 115
 				echo '
113 116
 						<p class="board_description">', $board['description'] , '</p>';
114 117
 
115 118
 				// Show the "Moderators: ". Each has name, href, link, and id. (but we're gonna use link_moderators.)
116
-				if (!empty($board['link_moderators']))
117
-					echo '
119
+				if (!empty($board['link_moderators'])) {
120
+									echo '
118 121
 						<p class="moderators">', count($board['link_moderators']) == 1 ? $txt['moderator'] : $txt['moderators'], ': ', implode(', ', $board['link_moderators']), '</p>';
122
+				}
119 123
 
120 124
 				// Show some basic information about the number of posts, etc.
121 125
 					echo '
@@ -127,9 +131,10 @@  discard block
 block discarded – undo
127 131
 					</div>
128 132
 					<div class="lastpost ',!empty($board['last_post']['id']) ? 'lpr_border' : 'hidden','">';
129 133
 
130
-				if (!empty($board['last_post']['id']))
131
-					echo '
134
+				if (!empty($board['last_post']['id'])) {
135
+									echo '
132 136
 						<p>', $board['last_post']['last_post_message'], '</p>';
137
+				}
133 138
 				echo '
134 139
 					</div>';
135 140
 				// Show the "Child Boards: ". (there's a link_children but we're going to bold the new ones...)
@@ -141,14 +146,16 @@  discard block
 block discarded – undo
141 146
 							id, name, description, new (is it new?), topics (#), posts (#), href, link, and last_post. */
142 147
 					foreach ($board['children'] as $child)
143 148
 					{
144
-						if (!$child['is_redirect'])
145
-							$child['link'] = '<a href="' . $child['href'] . '" ' . ($child['new'] ? 'class="board_new_posts" ' : '') . 'title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')">' . $child['name'] . ($child['new'] ? '</a> <a href="' . $scripturl . '?action=unread;board=' . $child['id'] . '" title="' . $txt['new_posts'] . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')"><span class="new_posts">' . $txt['new'] . '</span>' : '') . '</a>';
146
-						else
147
-							$child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . ' - ' . $child['short_description'] . '">' . $child['name'] . '</a>';
149
+						if (!$child['is_redirect']) {
150
+													$child['link'] = '<a href="' . $child['href'] . '" ' . ($child['new'] ? 'class="board_new_posts" ' : '') . 'title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')">' . $child['name'] . ($child['new'] ? '</a> <a href="' . $scripturl . '?action=unread;board=' . $child['id'] . '" title="' . $txt['new_posts'] . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')"><span class="new_posts">' . $txt['new'] . '</span>' : '') . '</a>';
151
+						} else {
152
+													$child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . ' - ' . $child['short_description'] . '">' . $child['name'] . '</a>';
153
+						}
148 154
 
149 155
 						// Has it posts awaiting approval?
150
-						if ($child['can_approve_posts'] && ($child['unapproved_posts'] || $child['unapproved_topics']))
151
-							$child['link'] .= ' <a href="' . $scripturl . '?action=moderate;area=postmod;sa=' . ($child['unapproved_topics'] > 0 ? 'topics' : 'posts') . ';brd=' . $child['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" title="' . sprintf($txt['unapproved_posts'], $child['unapproved_topics'], $child['unapproved_posts']) . '" class="moderation_link">(!)</a>';
156
+						if ($child['can_approve_posts'] && ($child['unapproved_posts'] || $child['unapproved_topics'])) {
157
+													$child['link'] .= ' <a href="' . $scripturl . '?action=moderate;area=postmod;sa=' . ($child['unapproved_topics'] > 0 ? 'topics' : 'posts') . ';brd=' . $child['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" title="' . sprintf($txt['unapproved_posts'], $child['unapproved_topics'], $child['unapproved_posts']) . '" class="moderation_link">(!)</a>';
158
+						}
152 159
 
153 160
 						$children[] = $child['new'] ? '<strong>' . $child['link'] . '</strong>' : $child['link'];
154 161
 					}
@@ -172,10 +179,11 @@  discard block
 block discarded – undo
172 179
 	</div>';
173 180
 
174 181
 	// Show the mark all as read button?
175
-	if ($context['user']['is_logged'] && !empty($context['categories']))
176
-		echo '
182
+	if ($context['user']['is_logged'] && !empty($context['categories'])) {
183
+			echo '
177 184
 		<div class="mark_read">', template_button_strip($context['mark_read_button'], 'right'), '</div>';
178
-}
185
+	}
186
+	}
179 187
 
180 188
 /**
181 189
  * The lower part of the outer layer of the board index
@@ -192,8 +200,9 @@  discard block
 block discarded – undo
192 200
 {
193 201
 	global $context, $options, $txt;
194 202
 
195
-	if (empty($context['info_center']))
196
-		return;
203
+	if (empty($context['info_center'])) {
204
+			return;
205
+	}
197 206
 
198 207
 	// Here's where the "Info Center" starts...
199 208
 	echo '
@@ -293,14 +302,15 @@  discard block
 block discarded – undo
293 302
 		/* Each post in latest_posts has:
294 303
 				board (with an id, name, and link.), topic (the topic's id.), poster (with id, name, and link.),
295 304
 				subject, short_subject (shortened with...), time, link, and href. */
296
-		foreach ($context['latest_posts'] as $post)
297
-			echo '
305
+		foreach ($context['latest_posts'] as $post) {
306
+					echo '
298 307
 					<tr class="windowbg">
299 308
 						<td class="recentpost"><strong>', $post['link'], '</strong></td>
300 309
 						<td class="recentposter">', $post['poster']['link'], '</td>
301 310
 						<td class="recentboard">', $post['board']['link'], '</td>
302 311
 						<td class="recenttime">', $post['time'], '</td>
303 312
 					</tr>';
313
+		}
304 314
 		echo '
305 315
 				</table>';
306 316
 	}
@@ -324,9 +334,10 @@  discard block
 block discarded – undo
324 334
 			</div>';
325 335
 
326 336
 	// Holidays like "Christmas", "Chanukah", and "We Love [Unknown] Day" :P.
327
-	if (!empty($context['calendar_holidays']))
328
-		echo '
337
+	if (!empty($context['calendar_holidays'])) {
338
+			echo '
329 339
 				<p class="inline holiday"><span>', $txt['calendar_prompt'], '</span> ', implode(', ', $context['calendar_holidays']), '</p>';
340
+	}
330 341
 
331 342
 	// People's birthdays. Like mine. And yours, I guess. Kidding.
332 343
 	if (!empty($context['calendar_birthdays']))
@@ -335,9 +346,10 @@  discard block
 block discarded – undo
335 346
 				<p class="inline">
336 347
 					<span class="birthday">', $context['calendar_only_today'] ? $txt['birthdays'] : $txt['birthdays_upcoming'], '</span>';
337 348
 		// Each member in calendar_birthdays has: id, name (person), age (if they have one set?), is_last. (last in list?), and is_today (birthday is today?)
338
-		foreach ($context['calendar_birthdays'] as $member)
339
-			echo '
349
+		foreach ($context['calendar_birthdays'] as $member) {
350
+					echo '
340 351
 					<a href="', $scripturl, '?action=profile;u=', $member['id'], '">', $member['is_today'] ? '<strong class="fix_rtl_names">' : '', $member['name'], $member['is_today'] ? '</strong>' : '', isset($member['age']) ? ' (' . $member['age'] . ')' : '', '</a>', $member['is_last'] ? '' : ', ';
352
+		}
341 353
 		echo '
342 354
 				</p>';
343 355
 	}
@@ -351,9 +363,10 @@  discard block
 block discarded – undo
351 363
 
352 364
 		// Each event in calendar_events should have:
353 365
 		//		title, href, is_last, can_edit (are they allowed?), modify_href, and is_today.
354
-		foreach ($context['calendar_events'] as $event)
355
-			echo '
366
+		foreach ($context['calendar_events'] as $event) {
367
+					echo '
356 368
 					', $event['can_edit'] ? '<a href="' . $event['modify_href'] . '" title="' . $txt['calendar_edit'] . '"><span class="generic_icons calendar_modify"></span></a> ' : '', $event['href'] == '' ? '' : '<a href="' . $event['href'] . '">', $event['is_today'] ? '<strong>' . $event['title'] . '</strong>' : $event['title'], $event['href'] == '' ? '' : '</a>', $event['is_last'] ? '<br>' : ', ';
369
+		}
357 370
 		echo '
358 371
 				</p>';
359 372
 	}
@@ -398,15 +411,19 @@  discard block
 block discarded – undo
398 411
 
399 412
 	// Handle hidden users and buddies.
400 413
 	$bracketList = array();
401
-	if ($context['show_buddies'])
402
-		$bracketList[] = comma_format($context['num_buddies']) . ' ' . ($context['num_buddies'] == 1 ? $txt['buddy'] : $txt['buddies']);
403
-	if (!empty($context['num_spiders']))
404
-		$bracketList[] = comma_format($context['num_spiders']) . ' ' . ($context['num_spiders'] == 1 ? $txt['spider'] : $txt['spiders']);
405
-	if (!empty($context['num_users_hidden']))
406
-		$bracketList[] = comma_format($context['num_users_hidden']) . ' ' . ($context['num_spiders'] == 1 ? $txt['hidden'] : $txt['hidden_s']);
414
+	if ($context['show_buddies']) {
415
+			$bracketList[] = comma_format($context['num_buddies']) . ' ' . ($context['num_buddies'] == 1 ? $txt['buddy'] : $txt['buddies']);
416
+	}
417
+	if (!empty($context['num_spiders'])) {
418
+			$bracketList[] = comma_format($context['num_spiders']) . ' ' . ($context['num_spiders'] == 1 ? $txt['spider'] : $txt['spiders']);
419
+	}
420
+	if (!empty($context['num_users_hidden'])) {
421
+			$bracketList[] = comma_format($context['num_users_hidden']) . ' ' . ($context['num_spiders'] == 1 ? $txt['hidden'] : $txt['hidden_s']);
422
+	}
407 423
 
408
-	if (!empty($bracketList))
409
-		echo ' (' . implode(', ', $bracketList) . ')';
424
+	if (!empty($bracketList)) {
425
+			echo ' (' . implode(', ', $bracketList) . ')';
426
+	}
410 427
 
411 428
 	echo $context['show_who'] ? '</a>' : '', '
412 429
 
@@ -420,9 +437,10 @@  discard block
 block discarded – undo
420 437
 				', sprintf($txt['users_active'], $modSettings['lastActive']), ': ', implode(', ', $context['list_users_online']);
421 438
 
422 439
 		// Showing membergroups?
423
-		if (!empty($settings['show_group_key']) && !empty($context['membergroups']))
424
-			echo '
440
+		if (!empty($settings['show_group_key']) && !empty($context['membergroups'])) {
441
+					echo '
425 442
 				<span class="membergroups">' . implode(',&nbsp;', $context['membergroups']). '</span>';
443
+		}
426 444
 	}
427 445
 
428 446
 	echo '
Please login to merge, or discard this patch.